@redsift/table 11.11.0-muiv7 → 11.11.0-muiv8-alpha.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.
@@ -1,2452 +0,0 @@
1
- import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
- import * as React from 'react';
3
- import React__default, { forwardRef } from 'react';
4
- import { ButtonsColorPalette, IconButton, Button, Checkbox, Icon } from '@redsift/design-system';
5
- import { mdiFilterVariant, mdiViewColumn, mdiArrowUp, mdiArrowDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronDown, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
6
- import { e as generateUtilityClass, g as generateUtilityClasses, o as ownerDocument, k as Portal, l as chainPropTypes, P as PropTypes, H as HTMLElementType, j as refType, m as useForkRef, n as useEnhancedEffect, p as useSlotProps, h as composeClasses, f as styled, q as useRtl, u as useDefaultProps } from './Portal.js';
7
- import { j as jsxRuntimeExports } from './jsx-runtime.js';
8
-
9
- const _excluded$2 = ["children", "color", "onClick", "startIcon"];
10
- const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
11
- var _props$className;
12
- const {
13
- children,
14
- color: propsColor,
15
- onClick,
16
- startIcon
17
- } = props,
18
- forwardedProps = _objectWithoutProperties(props, _excluded$2);
19
- const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
20
- if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
21
- return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
22
- color: color,
23
- onClick: onClick,
24
- ref: ref,
25
- variant: "unstyled",
26
- isActive: props['aria-expanded'] === 'true',
27
- icon: typeof startIcon !== 'string' ? /*#__PURE__*/React__default.cloneElement(startIcon, {
28
- fontSize: 'medium'
29
- }) : startIcon,
30
- "aria-label": children,
31
- size: "medium"
32
- }));
33
- }
34
- return /*#__PURE__*/React__default.createElement(Button, _extends({}, forwardedProps, {
35
- color: color,
36
- onClick: onClick,
37
- ref: ref,
38
- variant: "unstyled",
39
- isActive: props['aria-expanded'] === 'true',
40
- leftIcon: startIcon
41
- }), children);
42
- });
43
-
44
- const _excluded$1 = ["checked", "indeterminate", "disabled", "onChange"];
45
- const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
46
- const {
47
- checked,
48
- indeterminate,
49
- disabled,
50
- onChange
51
- } = props,
52
- forwardedProps = _objectWithoutProperties(props, _excluded$1);
53
- return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, forwardedProps, forwardedProps.inputProps, {
54
- isSelected: checked && !indeterminate,
55
- isDisabled: disabled,
56
- isIndeterminate: indeterminate,
57
- ref: ref,
58
- onChange: (isChecked, value, name, event) => onChange(event)
59
- }));
60
- });
61
-
62
- const _excluded = ["displayName"];
63
- const muiIconToDSIcon = {
64
- columnFilteredIcon: mdiFilterVariant,
65
- columnSelectorIcon: mdiViewColumn,
66
- columnSortedAscendingIcon: mdiArrowUp,
67
- columnSortedDescendingIcon: mdiArrowDown,
68
- densityCompactIcon: mdiViewHeadline,
69
- densityStandardIcon: mdiViewSequential,
70
- densityComfortableIcon: mdiViewStream,
71
- detailPanelCollapseIcon: mdiChevronDown,
72
- detailPanelExpandIcon: mdiChevronRight,
73
- exportIcon: mdiTrayArrowDown,
74
- openFilterButtonIcon: mdiFilterVariant
75
- };
76
- const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
77
- const {
78
- displayName
79
- } = props,
80
- forwardedProps = _objectWithoutProperties(props, _excluded);
81
- return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
82
- ref: ref,
83
- size: forwardedProps.fontSize,
84
- icon: muiIconToDSIcon[displayName]
85
- }));
86
- });
87
-
88
- var top = 'top';
89
- var bottom = 'bottom';
90
- var right = 'right';
91
- var left = 'left';
92
- var auto = 'auto';
93
- var basePlacements = [top, bottom, right, left];
94
- var start = 'start';
95
- var end = 'end';
96
- var clippingParents = 'clippingParents';
97
- var viewport = 'viewport';
98
- var popper = 'popper';
99
- var reference = 'reference';
100
- var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
101
- return acc.concat([placement + "-" + start, placement + "-" + end]);
102
- }, []);
103
- var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
104
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
105
- }, []); // modifiers that need to read the DOM
106
-
107
- var beforeRead = 'beforeRead';
108
- var read = 'read';
109
- var afterRead = 'afterRead'; // pure-logic modifiers
110
-
111
- var beforeMain = 'beforeMain';
112
- var main = 'main';
113
- var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
114
-
115
- var beforeWrite = 'beforeWrite';
116
- var write = 'write';
117
- var afterWrite = 'afterWrite';
118
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
119
-
120
- function getNodeName(element) {
121
- return element ? (element.nodeName || '').toLowerCase() : null;
122
- }
123
-
124
- function getWindow(node) {
125
- if (node == null) {
126
- return window;
127
- }
128
-
129
- if (node.toString() !== '[object Window]') {
130
- var ownerDocument = node.ownerDocument;
131
- return ownerDocument ? ownerDocument.defaultView || window : window;
132
- }
133
-
134
- return node;
135
- }
136
-
137
- function isElement(node) {
138
- var OwnElement = getWindow(node).Element;
139
- return node instanceof OwnElement || node instanceof Element;
140
- }
141
-
142
- function isHTMLElement$1(node) {
143
- var OwnElement = getWindow(node).HTMLElement;
144
- return node instanceof OwnElement || node instanceof HTMLElement;
145
- }
146
-
147
- function isShadowRoot(node) {
148
- // IE 11 has no ShadowRoot
149
- if (typeof ShadowRoot === 'undefined') {
150
- return false;
151
- }
152
-
153
- var OwnElement = getWindow(node).ShadowRoot;
154
- return node instanceof OwnElement || node instanceof ShadowRoot;
155
- }
156
-
157
- // and applies them to the HTMLElements such as popper and arrow
158
-
159
- function applyStyles(_ref) {
160
- var state = _ref.state;
161
- Object.keys(state.elements).forEach(function (name) {
162
- var style = state.styles[name] || {};
163
- var attributes = state.attributes[name] || {};
164
- var element = state.elements[name]; // arrow is optional + virtual elements
165
-
166
- if (!isHTMLElement$1(element) || !getNodeName(element)) {
167
- return;
168
- } // Flow doesn't support to extend this property, but it's the most
169
- // effective way to apply styles to an HTMLElement
170
- // $FlowFixMe[cannot-write]
171
-
172
-
173
- Object.assign(element.style, style);
174
- Object.keys(attributes).forEach(function (name) {
175
- var value = attributes[name];
176
-
177
- if (value === false) {
178
- element.removeAttribute(name);
179
- } else {
180
- element.setAttribute(name, value === true ? '' : value);
181
- }
182
- });
183
- });
184
- }
185
-
186
- function effect$2(_ref2) {
187
- var state = _ref2.state;
188
- var initialStyles = {
189
- popper: {
190
- position: state.options.strategy,
191
- left: '0',
192
- top: '0',
193
- margin: '0'
194
- },
195
- arrow: {
196
- position: 'absolute'
197
- },
198
- reference: {}
199
- };
200
- Object.assign(state.elements.popper.style, initialStyles.popper);
201
- state.styles = initialStyles;
202
-
203
- if (state.elements.arrow) {
204
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
205
- }
206
-
207
- return function () {
208
- Object.keys(state.elements).forEach(function (name) {
209
- var element = state.elements[name];
210
- var attributes = state.attributes[name] || {};
211
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
212
-
213
- var style = styleProperties.reduce(function (style, property) {
214
- style[property] = '';
215
- return style;
216
- }, {}); // arrow is optional + virtual elements
217
-
218
- if (!isHTMLElement$1(element) || !getNodeName(element)) {
219
- return;
220
- }
221
-
222
- Object.assign(element.style, style);
223
- Object.keys(attributes).forEach(function (attribute) {
224
- element.removeAttribute(attribute);
225
- });
226
- });
227
- };
228
- } // eslint-disable-next-line import/no-unused-modules
229
-
230
-
231
- var applyStyles$1 = {
232
- name: 'applyStyles',
233
- enabled: true,
234
- phase: 'write',
235
- fn: applyStyles,
236
- effect: effect$2,
237
- requires: ['computeStyles']
238
- };
239
-
240
- function getBasePlacement(placement) {
241
- return placement.split('-')[0];
242
- }
243
-
244
- var max = Math.max;
245
- var min = Math.min;
246
- var round = Math.round;
247
-
248
- function getUAString() {
249
- var uaData = navigator.userAgentData;
250
-
251
- if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {
252
- return uaData.brands.map(function (item) {
253
- return item.brand + "/" + item.version;
254
- }).join(' ');
255
- }
256
-
257
- return navigator.userAgent;
258
- }
259
-
260
- function isLayoutViewport() {
261
- return !/^((?!chrome|android).)*safari/i.test(getUAString());
262
- }
263
-
264
- function getBoundingClientRect(element, includeScale, isFixedStrategy) {
265
- if (includeScale === void 0) {
266
- includeScale = false;
267
- }
268
-
269
- if (isFixedStrategy === void 0) {
270
- isFixedStrategy = false;
271
- }
272
-
273
- var clientRect = element.getBoundingClientRect();
274
- var scaleX = 1;
275
- var scaleY = 1;
276
-
277
- if (includeScale && isHTMLElement$1(element)) {
278
- scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
279
- scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
280
- }
281
-
282
- var _ref = isElement(element) ? getWindow(element) : window,
283
- visualViewport = _ref.visualViewport;
284
-
285
- var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
286
- var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
287
- var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
288
- var width = clientRect.width / scaleX;
289
- var height = clientRect.height / scaleY;
290
- return {
291
- width: width,
292
- height: height,
293
- top: y,
294
- right: x + width,
295
- bottom: y + height,
296
- left: x,
297
- x: x,
298
- y: y
299
- };
300
- }
301
-
302
- // means it doesn't take into account transforms.
303
-
304
- function getLayoutRect(element) {
305
- var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
306
- // Fixes https://github.com/popperjs/popper-core/issues/1223
307
-
308
- var width = element.offsetWidth;
309
- var height = element.offsetHeight;
310
-
311
- if (Math.abs(clientRect.width - width) <= 1) {
312
- width = clientRect.width;
313
- }
314
-
315
- if (Math.abs(clientRect.height - height) <= 1) {
316
- height = clientRect.height;
317
- }
318
-
319
- return {
320
- x: element.offsetLeft,
321
- y: element.offsetTop,
322
- width: width,
323
- height: height
324
- };
325
- }
326
-
327
- function contains(parent, child) {
328
- var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
329
-
330
- if (parent.contains(child)) {
331
- return true;
332
- } // then fallback to custom implementation with Shadow DOM support
333
- else if (rootNode && isShadowRoot(rootNode)) {
334
- var next = child;
335
-
336
- do {
337
- if (next && parent.isSameNode(next)) {
338
- return true;
339
- } // $FlowFixMe[prop-missing]: need a better way to handle this...
340
-
341
-
342
- next = next.parentNode || next.host;
343
- } while (next);
344
- } // Give up, the result is false
345
-
346
-
347
- return false;
348
- }
349
-
350
- function getComputedStyle(element) {
351
- return getWindow(element).getComputedStyle(element);
352
- }
353
-
354
- function isTableElement(element) {
355
- return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
356
- }
357
-
358
- function getDocumentElement(element) {
359
- // $FlowFixMe[incompatible-return]: assume body is always available
360
- return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
361
- element.document) || window.document).documentElement;
362
- }
363
-
364
- function getParentNode(element) {
365
- if (getNodeName(element) === 'html') {
366
- return element;
367
- }
368
-
369
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
370
- // $FlowFixMe[incompatible-return]
371
- // $FlowFixMe[prop-missing]
372
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
373
- element.parentNode || ( // DOM Element detected
374
- isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
375
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
376
- getDocumentElement(element) // fallback
377
-
378
- );
379
- }
380
-
381
- function getTrueOffsetParent(element) {
382
- if (!isHTMLElement$1(element) || // https://github.com/popperjs/popper-core/issues/837
383
- getComputedStyle(element).position === 'fixed') {
384
- return null;
385
- }
386
-
387
- return element.offsetParent;
388
- } // `.offsetParent` reports `null` for fixed elements, while absolute elements
389
- // return the containing block
390
-
391
-
392
- function getContainingBlock(element) {
393
- var isFirefox = /firefox/i.test(getUAString());
394
- var isIE = /Trident/i.test(getUAString());
395
-
396
- if (isIE && isHTMLElement$1(element)) {
397
- // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
398
- var elementCss = getComputedStyle(element);
399
-
400
- if (elementCss.position === 'fixed') {
401
- return null;
402
- }
403
- }
404
-
405
- var currentNode = getParentNode(element);
406
-
407
- if (isShadowRoot(currentNode)) {
408
- currentNode = currentNode.host;
409
- }
410
-
411
- while (isHTMLElement$1(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
412
- var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
413
- // create a containing block.
414
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
415
-
416
- if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
417
- return currentNode;
418
- } else {
419
- currentNode = currentNode.parentNode;
420
- }
421
- }
422
-
423
- return null;
424
- } // Gets the closest ancestor positioned element. Handles some edge cases,
425
- // such as table ancestors and cross browser bugs.
426
-
427
-
428
- function getOffsetParent(element) {
429
- var window = getWindow(element);
430
- var offsetParent = getTrueOffsetParent(element);
431
-
432
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
433
- offsetParent = getTrueOffsetParent(offsetParent);
434
- }
435
-
436
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
437
- return window;
438
- }
439
-
440
- return offsetParent || getContainingBlock(element) || window;
441
- }
442
-
443
- function getMainAxisFromPlacement(placement) {
444
- return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
445
- }
446
-
447
- function within(min$1, value, max$1) {
448
- return max(min$1, min(value, max$1));
449
- }
450
- function withinMaxClamp(min, value, max) {
451
- var v = within(min, value, max);
452
- return v > max ? max : v;
453
- }
454
-
455
- function getFreshSideObject() {
456
- return {
457
- top: 0,
458
- right: 0,
459
- bottom: 0,
460
- left: 0
461
- };
462
- }
463
-
464
- function mergePaddingObject(paddingObject) {
465
- return Object.assign({}, getFreshSideObject(), paddingObject);
466
- }
467
-
468
- function expandToHashMap(value, keys) {
469
- return keys.reduce(function (hashMap, key) {
470
- hashMap[key] = value;
471
- return hashMap;
472
- }, {});
473
- }
474
-
475
- var toPaddingObject = function toPaddingObject(padding, state) {
476
- padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
477
- placement: state.placement
478
- })) : padding;
479
- return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
480
- };
481
-
482
- function arrow(_ref) {
483
- var _state$modifiersData$;
484
-
485
- var state = _ref.state,
486
- name = _ref.name,
487
- options = _ref.options;
488
- var arrowElement = state.elements.arrow;
489
- var popperOffsets = state.modifiersData.popperOffsets;
490
- var basePlacement = getBasePlacement(state.placement);
491
- var axis = getMainAxisFromPlacement(basePlacement);
492
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
493
- var len = isVertical ? 'height' : 'width';
494
-
495
- if (!arrowElement || !popperOffsets) {
496
- return;
497
- }
498
-
499
- var paddingObject = toPaddingObject(options.padding, state);
500
- var arrowRect = getLayoutRect(arrowElement);
501
- var minProp = axis === 'y' ? top : left;
502
- var maxProp = axis === 'y' ? bottom : right;
503
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
504
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
505
- var arrowOffsetParent = getOffsetParent(arrowElement);
506
- var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
507
- var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
508
- // outside of the popper bounds
509
-
510
- var min = paddingObject[minProp];
511
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
512
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
513
- var offset = within(min, center, max); // Prevents breaking syntax highlighting...
514
-
515
- var axisProp = axis;
516
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
517
- }
518
-
519
- function effect$1(_ref2) {
520
- var state = _ref2.state,
521
- options = _ref2.options;
522
- var _options$element = options.element,
523
- arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
524
-
525
- if (arrowElement == null) {
526
- return;
527
- } // CSS selector
528
-
529
-
530
- if (typeof arrowElement === 'string') {
531
- arrowElement = state.elements.popper.querySelector(arrowElement);
532
-
533
- if (!arrowElement) {
534
- return;
535
- }
536
- }
537
-
538
- if (!contains(state.elements.popper, arrowElement)) {
539
- return;
540
- }
541
-
542
- state.elements.arrow = arrowElement;
543
- } // eslint-disable-next-line import/no-unused-modules
544
-
545
-
546
- var arrow$1 = {
547
- name: 'arrow',
548
- enabled: true,
549
- phase: 'main',
550
- fn: arrow,
551
- effect: effect$1,
552
- requires: ['popperOffsets'],
553
- requiresIfExists: ['preventOverflow']
554
- };
555
-
556
- function getVariation(placement) {
557
- return placement.split('-')[1];
558
- }
559
-
560
- var unsetSides = {
561
- top: 'auto',
562
- right: 'auto',
563
- bottom: 'auto',
564
- left: 'auto'
565
- }; // Round the offsets to the nearest suitable subpixel based on the DPR.
566
- // Zooming can change the DPR, but it seems to report a value that will
567
- // cleanly divide the values into the appropriate subpixels.
568
-
569
- function roundOffsetsByDPR(_ref, win) {
570
- var x = _ref.x,
571
- y = _ref.y;
572
- var dpr = win.devicePixelRatio || 1;
573
- return {
574
- x: round(x * dpr) / dpr || 0,
575
- y: round(y * dpr) / dpr || 0
576
- };
577
- }
578
-
579
- function mapToStyles(_ref2) {
580
- var _Object$assign2;
581
-
582
- var popper = _ref2.popper,
583
- popperRect = _ref2.popperRect,
584
- placement = _ref2.placement,
585
- variation = _ref2.variation,
586
- offsets = _ref2.offsets,
587
- position = _ref2.position,
588
- gpuAcceleration = _ref2.gpuAcceleration,
589
- adaptive = _ref2.adaptive,
590
- roundOffsets = _ref2.roundOffsets,
591
- isFixed = _ref2.isFixed;
592
- var _offsets$x = offsets.x,
593
- x = _offsets$x === void 0 ? 0 : _offsets$x,
594
- _offsets$y = offsets.y,
595
- y = _offsets$y === void 0 ? 0 : _offsets$y;
596
-
597
- var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
598
- x: x,
599
- y: y
600
- }) : {
601
- x: x,
602
- y: y
603
- };
604
-
605
- x = _ref3.x;
606
- y = _ref3.y;
607
- var hasX = offsets.hasOwnProperty('x');
608
- var hasY = offsets.hasOwnProperty('y');
609
- var sideX = left;
610
- var sideY = top;
611
- var win = window;
612
-
613
- if (adaptive) {
614
- var offsetParent = getOffsetParent(popper);
615
- var heightProp = 'clientHeight';
616
- var widthProp = 'clientWidth';
617
-
618
- if (offsetParent === getWindow(popper)) {
619
- offsetParent = getDocumentElement(popper);
620
-
621
- if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
622
- heightProp = 'scrollHeight';
623
- widthProp = 'scrollWidth';
624
- }
625
- } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
626
-
627
-
628
- offsetParent = offsetParent;
629
-
630
- if (placement === top || (placement === left || placement === right) && variation === end) {
631
- sideY = bottom;
632
- var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
633
- offsetParent[heightProp];
634
- y -= offsetY - popperRect.height;
635
- y *= gpuAcceleration ? 1 : -1;
636
- }
637
-
638
- if (placement === left || (placement === top || placement === bottom) && variation === end) {
639
- sideX = right;
640
- var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
641
- offsetParent[widthProp];
642
- x -= offsetX - popperRect.width;
643
- x *= gpuAcceleration ? 1 : -1;
644
- }
645
- }
646
-
647
- var commonStyles = Object.assign({
648
- position: position
649
- }, adaptive && unsetSides);
650
-
651
- var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
652
- x: x,
653
- y: y
654
- }, getWindow(popper)) : {
655
- x: x,
656
- y: y
657
- };
658
-
659
- x = _ref4.x;
660
- y = _ref4.y;
661
-
662
- if (gpuAcceleration) {
663
- var _Object$assign;
664
-
665
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
666
- }
667
-
668
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
669
- }
670
-
671
- function computeStyles(_ref5) {
672
- var state = _ref5.state,
673
- options = _ref5.options;
674
- var _options$gpuAccelerat = options.gpuAcceleration,
675
- gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
676
- _options$adaptive = options.adaptive,
677
- adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
678
- _options$roundOffsets = options.roundOffsets,
679
- roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
680
- var commonStyles = {
681
- placement: getBasePlacement(state.placement),
682
- variation: getVariation(state.placement),
683
- popper: state.elements.popper,
684
- popperRect: state.rects.popper,
685
- gpuAcceleration: gpuAcceleration,
686
- isFixed: state.options.strategy === 'fixed'
687
- };
688
-
689
- if (state.modifiersData.popperOffsets != null) {
690
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
691
- offsets: state.modifiersData.popperOffsets,
692
- position: state.options.strategy,
693
- adaptive: adaptive,
694
- roundOffsets: roundOffsets
695
- })));
696
- }
697
-
698
- if (state.modifiersData.arrow != null) {
699
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
700
- offsets: state.modifiersData.arrow,
701
- position: 'absolute',
702
- adaptive: false,
703
- roundOffsets: roundOffsets
704
- })));
705
- }
706
-
707
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
708
- 'data-popper-placement': state.placement
709
- });
710
- } // eslint-disable-next-line import/no-unused-modules
711
-
712
-
713
- var computeStyles$1 = {
714
- name: 'computeStyles',
715
- enabled: true,
716
- phase: 'beforeWrite',
717
- fn: computeStyles,
718
- data: {}
719
- };
720
-
721
- var passive = {
722
- passive: true
723
- };
724
-
725
- function effect(_ref) {
726
- var state = _ref.state,
727
- instance = _ref.instance,
728
- options = _ref.options;
729
- var _options$scroll = options.scroll,
730
- scroll = _options$scroll === void 0 ? true : _options$scroll,
731
- _options$resize = options.resize,
732
- resize = _options$resize === void 0 ? true : _options$resize;
733
- var window = getWindow(state.elements.popper);
734
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
735
-
736
- if (scroll) {
737
- scrollParents.forEach(function (scrollParent) {
738
- scrollParent.addEventListener('scroll', instance.update, passive);
739
- });
740
- }
741
-
742
- if (resize) {
743
- window.addEventListener('resize', instance.update, passive);
744
- }
745
-
746
- return function () {
747
- if (scroll) {
748
- scrollParents.forEach(function (scrollParent) {
749
- scrollParent.removeEventListener('scroll', instance.update, passive);
750
- });
751
- }
752
-
753
- if (resize) {
754
- window.removeEventListener('resize', instance.update, passive);
755
- }
756
- };
757
- } // eslint-disable-next-line import/no-unused-modules
758
-
759
-
760
- var eventListeners = {
761
- name: 'eventListeners',
762
- enabled: true,
763
- phase: 'write',
764
- fn: function fn() {},
765
- effect: effect,
766
- data: {}
767
- };
768
-
769
- var hash$1 = {
770
- left: 'right',
771
- right: 'left',
772
- bottom: 'top',
773
- top: 'bottom'
774
- };
775
- function getOppositePlacement(placement) {
776
- return placement.replace(/left|right|bottom|top/g, function (matched) {
777
- return hash$1[matched];
778
- });
779
- }
780
-
781
- var hash = {
782
- start: 'end',
783
- end: 'start'
784
- };
785
- function getOppositeVariationPlacement(placement) {
786
- return placement.replace(/start|end/g, function (matched) {
787
- return hash[matched];
788
- });
789
- }
790
-
791
- function getWindowScroll(node) {
792
- var win = getWindow(node);
793
- var scrollLeft = win.pageXOffset;
794
- var scrollTop = win.pageYOffset;
795
- return {
796
- scrollLeft: scrollLeft,
797
- scrollTop: scrollTop
798
- };
799
- }
800
-
801
- function getWindowScrollBarX(element) {
802
- // If <html> has a CSS width greater than the viewport, then this will be
803
- // incorrect for RTL.
804
- // Popper 1 is broken in this case and never had a bug report so let's assume
805
- // it's not an issue. I don't think anyone ever specifies width on <html>
806
- // anyway.
807
- // Browsers where the left scrollbar doesn't cause an issue report `0` for
808
- // this (e.g. Edge 2019, IE11, Safari)
809
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
810
- }
811
-
812
- function getViewportRect(element, strategy) {
813
- var win = getWindow(element);
814
- var html = getDocumentElement(element);
815
- var visualViewport = win.visualViewport;
816
- var width = html.clientWidth;
817
- var height = html.clientHeight;
818
- var x = 0;
819
- var y = 0;
820
-
821
- if (visualViewport) {
822
- width = visualViewport.width;
823
- height = visualViewport.height;
824
- var layoutViewport = isLayoutViewport();
825
-
826
- if (layoutViewport || !layoutViewport && strategy === 'fixed') {
827
- x = visualViewport.offsetLeft;
828
- y = visualViewport.offsetTop;
829
- }
830
- }
831
-
832
- return {
833
- width: width,
834
- height: height,
835
- x: x + getWindowScrollBarX(element),
836
- y: y
837
- };
838
- }
839
-
840
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
841
-
842
- function getDocumentRect(element) {
843
- var _element$ownerDocumen;
844
-
845
- var html = getDocumentElement(element);
846
- var winScroll = getWindowScroll(element);
847
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
848
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
849
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
850
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
851
- var y = -winScroll.scrollTop;
852
-
853
- if (getComputedStyle(body || html).direction === 'rtl') {
854
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
855
- }
856
-
857
- return {
858
- width: width,
859
- height: height,
860
- x: x,
861
- y: y
862
- };
863
- }
864
-
865
- function isScrollParent(element) {
866
- // Firefox wants us to check `-x` and `-y` variations as well
867
- var _getComputedStyle = getComputedStyle(element),
868
- overflow = _getComputedStyle.overflow,
869
- overflowX = _getComputedStyle.overflowX,
870
- overflowY = _getComputedStyle.overflowY;
871
-
872
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
873
- }
874
-
875
- function getScrollParent(node) {
876
- if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
877
- // $FlowFixMe[incompatible-return]: assume body is always available
878
- return node.ownerDocument.body;
879
- }
880
-
881
- if (isHTMLElement$1(node) && isScrollParent(node)) {
882
- return node;
883
- }
884
-
885
- return getScrollParent(getParentNode(node));
886
- }
887
-
888
- /*
889
- given a DOM element, return the list of all scroll parents, up the list of ancesors
890
- until we get to the top window object. This list is what we attach scroll listeners
891
- to, because if any of these parent elements scroll, we'll need to re-calculate the
892
- reference element's position.
893
- */
894
-
895
- function listScrollParents(element, list) {
896
- var _element$ownerDocumen;
897
-
898
- if (list === void 0) {
899
- list = [];
900
- }
901
-
902
- var scrollParent = getScrollParent(element);
903
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
904
- var win = getWindow(scrollParent);
905
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
906
- var updatedList = list.concat(target);
907
- return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
908
- updatedList.concat(listScrollParents(getParentNode(target)));
909
- }
910
-
911
- function rectToClientRect(rect) {
912
- return Object.assign({}, rect, {
913
- left: rect.x,
914
- top: rect.y,
915
- right: rect.x + rect.width,
916
- bottom: rect.y + rect.height
917
- });
918
- }
919
-
920
- function getInnerBoundingClientRect(element, strategy) {
921
- var rect = getBoundingClientRect(element, false, strategy === 'fixed');
922
- rect.top = rect.top + element.clientTop;
923
- rect.left = rect.left + element.clientLeft;
924
- rect.bottom = rect.top + element.clientHeight;
925
- rect.right = rect.left + element.clientWidth;
926
- rect.width = element.clientWidth;
927
- rect.height = element.clientHeight;
928
- rect.x = rect.left;
929
- rect.y = rect.top;
930
- return rect;
931
- }
932
-
933
- function getClientRectFromMixedType(element, clippingParent, strategy) {
934
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
935
- } // A "clipping parent" is an overflowable container with the characteristic of
936
- // clipping (or hiding) overflowing elements with a position different from
937
- // `initial`
938
-
939
-
940
- function getClippingParents(element) {
941
- var clippingParents = listScrollParents(getParentNode(element));
942
- var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
943
- var clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent(element) : element;
944
-
945
- if (!isElement(clipperElement)) {
946
- return [];
947
- } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
948
-
949
-
950
- return clippingParents.filter(function (clippingParent) {
951
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
952
- });
953
- } // Gets the maximum area that the element is visible in due to any number of
954
- // clipping parents
955
-
956
-
957
- function getClippingRect(element, boundary, rootBoundary, strategy) {
958
- var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
959
- var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
960
- var firstClippingParent = clippingParents[0];
961
- var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
962
- var rect = getClientRectFromMixedType(element, clippingParent, strategy);
963
- accRect.top = max(rect.top, accRect.top);
964
- accRect.right = min(rect.right, accRect.right);
965
- accRect.bottom = min(rect.bottom, accRect.bottom);
966
- accRect.left = max(rect.left, accRect.left);
967
- return accRect;
968
- }, getClientRectFromMixedType(element, firstClippingParent, strategy));
969
- clippingRect.width = clippingRect.right - clippingRect.left;
970
- clippingRect.height = clippingRect.bottom - clippingRect.top;
971
- clippingRect.x = clippingRect.left;
972
- clippingRect.y = clippingRect.top;
973
- return clippingRect;
974
- }
975
-
976
- function computeOffsets(_ref) {
977
- var reference = _ref.reference,
978
- element = _ref.element,
979
- placement = _ref.placement;
980
- var basePlacement = placement ? getBasePlacement(placement) : null;
981
- var variation = placement ? getVariation(placement) : null;
982
- var commonX = reference.x + reference.width / 2 - element.width / 2;
983
- var commonY = reference.y + reference.height / 2 - element.height / 2;
984
- var offsets;
985
-
986
- switch (basePlacement) {
987
- case top:
988
- offsets = {
989
- x: commonX,
990
- y: reference.y - element.height
991
- };
992
- break;
993
-
994
- case bottom:
995
- offsets = {
996
- x: commonX,
997
- y: reference.y + reference.height
998
- };
999
- break;
1000
-
1001
- case right:
1002
- offsets = {
1003
- x: reference.x + reference.width,
1004
- y: commonY
1005
- };
1006
- break;
1007
-
1008
- case left:
1009
- offsets = {
1010
- x: reference.x - element.width,
1011
- y: commonY
1012
- };
1013
- break;
1014
-
1015
- default:
1016
- offsets = {
1017
- x: reference.x,
1018
- y: reference.y
1019
- };
1020
- }
1021
-
1022
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
1023
-
1024
- if (mainAxis != null) {
1025
- var len = mainAxis === 'y' ? 'height' : 'width';
1026
-
1027
- switch (variation) {
1028
- case start:
1029
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
1030
- break;
1031
-
1032
- case end:
1033
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
1034
- break;
1035
- }
1036
- }
1037
-
1038
- return offsets;
1039
- }
1040
-
1041
- function detectOverflow(state, options) {
1042
- if (options === void 0) {
1043
- options = {};
1044
- }
1045
-
1046
- var _options = options,
1047
- _options$placement = _options.placement,
1048
- placement = _options$placement === void 0 ? state.placement : _options$placement,
1049
- _options$strategy = _options.strategy,
1050
- strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,
1051
- _options$boundary = _options.boundary,
1052
- boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
1053
- _options$rootBoundary = _options.rootBoundary,
1054
- rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
1055
- _options$elementConte = _options.elementContext,
1056
- elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
1057
- _options$altBoundary = _options.altBoundary,
1058
- altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
1059
- _options$padding = _options.padding,
1060
- padding = _options$padding === void 0 ? 0 : _options$padding;
1061
- var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
1062
- var altContext = elementContext === popper ? reference : popper;
1063
- var popperRect = state.rects.popper;
1064
- var element = state.elements[altBoundary ? altContext : elementContext];
1065
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
1066
- var referenceClientRect = getBoundingClientRect(state.elements.reference);
1067
- var popperOffsets = computeOffsets({
1068
- reference: referenceClientRect,
1069
- element: popperRect,
1070
- strategy: 'absolute',
1071
- placement: placement
1072
- });
1073
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
1074
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
1075
- // 0 or negative = within the clipping rect
1076
-
1077
- var overflowOffsets = {
1078
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
1079
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
1080
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
1081
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
1082
- };
1083
- var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
1084
-
1085
- if (elementContext === popper && offsetData) {
1086
- var offset = offsetData[placement];
1087
- Object.keys(overflowOffsets).forEach(function (key) {
1088
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
1089
- var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
1090
- overflowOffsets[key] += offset[axis] * multiply;
1091
- });
1092
- }
1093
-
1094
- return overflowOffsets;
1095
- }
1096
-
1097
- function computeAutoPlacement(state, options) {
1098
- if (options === void 0) {
1099
- options = {};
1100
- }
1101
-
1102
- var _options = options,
1103
- placement = _options.placement,
1104
- boundary = _options.boundary,
1105
- rootBoundary = _options.rootBoundary,
1106
- padding = _options.padding,
1107
- flipVariations = _options.flipVariations,
1108
- _options$allowedAutoP = _options.allowedAutoPlacements,
1109
- allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1110
- var variation = getVariation(placement);
1111
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1112
- return getVariation(placement) === variation;
1113
- }) : basePlacements;
1114
- var allowedPlacements = placements$1.filter(function (placement) {
1115
- return allowedAutoPlacements.indexOf(placement) >= 0;
1116
- });
1117
-
1118
- if (allowedPlacements.length === 0) {
1119
- allowedPlacements = placements$1;
1120
- } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1121
-
1122
-
1123
- var overflows = allowedPlacements.reduce(function (acc, placement) {
1124
- acc[placement] = detectOverflow(state, {
1125
- placement: placement,
1126
- boundary: boundary,
1127
- rootBoundary: rootBoundary,
1128
- padding: padding
1129
- })[getBasePlacement(placement)];
1130
- return acc;
1131
- }, {});
1132
- return Object.keys(overflows).sort(function (a, b) {
1133
- return overflows[a] - overflows[b];
1134
- });
1135
- }
1136
-
1137
- function getExpandedFallbackPlacements(placement) {
1138
- if (getBasePlacement(placement) === auto) {
1139
- return [];
1140
- }
1141
-
1142
- var oppositePlacement = getOppositePlacement(placement);
1143
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1144
- }
1145
-
1146
- function flip(_ref) {
1147
- var state = _ref.state,
1148
- options = _ref.options,
1149
- name = _ref.name;
1150
-
1151
- if (state.modifiersData[name]._skip) {
1152
- return;
1153
- }
1154
-
1155
- var _options$mainAxis = options.mainAxis,
1156
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1157
- _options$altAxis = options.altAxis,
1158
- checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1159
- specifiedFallbackPlacements = options.fallbackPlacements,
1160
- padding = options.padding,
1161
- boundary = options.boundary,
1162
- rootBoundary = options.rootBoundary,
1163
- altBoundary = options.altBoundary,
1164
- _options$flipVariatio = options.flipVariations,
1165
- flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1166
- allowedAutoPlacements = options.allowedAutoPlacements;
1167
- var preferredPlacement = state.options.placement;
1168
- var basePlacement = getBasePlacement(preferredPlacement);
1169
- var isBasePlacement = basePlacement === preferredPlacement;
1170
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1171
- var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1172
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1173
- placement: placement,
1174
- boundary: boundary,
1175
- rootBoundary: rootBoundary,
1176
- padding: padding,
1177
- flipVariations: flipVariations,
1178
- allowedAutoPlacements: allowedAutoPlacements
1179
- }) : placement);
1180
- }, []);
1181
- var referenceRect = state.rects.reference;
1182
- var popperRect = state.rects.popper;
1183
- var checksMap = new Map();
1184
- var makeFallbackChecks = true;
1185
- var firstFittingPlacement = placements[0];
1186
-
1187
- for (var i = 0; i < placements.length; i++) {
1188
- var placement = placements[i];
1189
-
1190
- var _basePlacement = getBasePlacement(placement);
1191
-
1192
- var isStartVariation = getVariation(placement) === start;
1193
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1194
- var len = isVertical ? 'width' : 'height';
1195
- var overflow = detectOverflow(state, {
1196
- placement: placement,
1197
- boundary: boundary,
1198
- rootBoundary: rootBoundary,
1199
- altBoundary: altBoundary,
1200
- padding: padding
1201
- });
1202
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1203
-
1204
- if (referenceRect[len] > popperRect[len]) {
1205
- mainVariationSide = getOppositePlacement(mainVariationSide);
1206
- }
1207
-
1208
- var altVariationSide = getOppositePlacement(mainVariationSide);
1209
- var checks = [];
1210
-
1211
- if (checkMainAxis) {
1212
- checks.push(overflow[_basePlacement] <= 0);
1213
- }
1214
-
1215
- if (checkAltAxis) {
1216
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1217
- }
1218
-
1219
- if (checks.every(function (check) {
1220
- return check;
1221
- })) {
1222
- firstFittingPlacement = placement;
1223
- makeFallbackChecks = false;
1224
- break;
1225
- }
1226
-
1227
- checksMap.set(placement, checks);
1228
- }
1229
-
1230
- if (makeFallbackChecks) {
1231
- // `2` may be desired in some cases – research later
1232
- var numberOfChecks = flipVariations ? 3 : 1;
1233
-
1234
- var _loop = function _loop(_i) {
1235
- var fittingPlacement = placements.find(function (placement) {
1236
- var checks = checksMap.get(placement);
1237
-
1238
- if (checks) {
1239
- return checks.slice(0, _i).every(function (check) {
1240
- return check;
1241
- });
1242
- }
1243
- });
1244
-
1245
- if (fittingPlacement) {
1246
- firstFittingPlacement = fittingPlacement;
1247
- return "break";
1248
- }
1249
- };
1250
-
1251
- for (var _i = numberOfChecks; _i > 0; _i--) {
1252
- var _ret = _loop(_i);
1253
-
1254
- if (_ret === "break") break;
1255
- }
1256
- }
1257
-
1258
- if (state.placement !== firstFittingPlacement) {
1259
- state.modifiersData[name]._skip = true;
1260
- state.placement = firstFittingPlacement;
1261
- state.reset = true;
1262
- }
1263
- } // eslint-disable-next-line import/no-unused-modules
1264
-
1265
-
1266
- var flip$1 = {
1267
- name: 'flip',
1268
- enabled: true,
1269
- phase: 'main',
1270
- fn: flip,
1271
- requiresIfExists: ['offset'],
1272
- data: {
1273
- _skip: false
1274
- }
1275
- };
1276
-
1277
- function getSideOffsets(overflow, rect, preventedOffsets) {
1278
- if (preventedOffsets === void 0) {
1279
- preventedOffsets = {
1280
- x: 0,
1281
- y: 0
1282
- };
1283
- }
1284
-
1285
- return {
1286
- top: overflow.top - rect.height - preventedOffsets.y,
1287
- right: overflow.right - rect.width + preventedOffsets.x,
1288
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1289
- left: overflow.left - rect.width - preventedOffsets.x
1290
- };
1291
- }
1292
-
1293
- function isAnySideFullyClipped(overflow) {
1294
- return [top, right, bottom, left].some(function (side) {
1295
- return overflow[side] >= 0;
1296
- });
1297
- }
1298
-
1299
- function hide(_ref) {
1300
- var state = _ref.state,
1301
- name = _ref.name;
1302
- var referenceRect = state.rects.reference;
1303
- var popperRect = state.rects.popper;
1304
- var preventedOffsets = state.modifiersData.preventOverflow;
1305
- var referenceOverflow = detectOverflow(state, {
1306
- elementContext: 'reference'
1307
- });
1308
- var popperAltOverflow = detectOverflow(state, {
1309
- altBoundary: true
1310
- });
1311
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1312
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1313
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1314
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1315
- state.modifiersData[name] = {
1316
- referenceClippingOffsets: referenceClippingOffsets,
1317
- popperEscapeOffsets: popperEscapeOffsets,
1318
- isReferenceHidden: isReferenceHidden,
1319
- hasPopperEscaped: hasPopperEscaped
1320
- };
1321
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1322
- 'data-popper-reference-hidden': isReferenceHidden,
1323
- 'data-popper-escaped': hasPopperEscaped
1324
- });
1325
- } // eslint-disable-next-line import/no-unused-modules
1326
-
1327
-
1328
- var hide$1 = {
1329
- name: 'hide',
1330
- enabled: true,
1331
- phase: 'main',
1332
- requiresIfExists: ['preventOverflow'],
1333
- fn: hide
1334
- };
1335
-
1336
- function distanceAndSkiddingToXY(placement, rects, offset) {
1337
- var basePlacement = getBasePlacement(placement);
1338
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1339
-
1340
- var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1341
- placement: placement
1342
- })) : offset,
1343
- skidding = _ref[0],
1344
- distance = _ref[1];
1345
-
1346
- skidding = skidding || 0;
1347
- distance = (distance || 0) * invertDistance;
1348
- return [left, right].indexOf(basePlacement) >= 0 ? {
1349
- x: distance,
1350
- y: skidding
1351
- } : {
1352
- x: skidding,
1353
- y: distance
1354
- };
1355
- }
1356
-
1357
- function offset(_ref2) {
1358
- var state = _ref2.state,
1359
- options = _ref2.options,
1360
- name = _ref2.name;
1361
- var _options$offset = options.offset,
1362
- offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1363
- var data = placements.reduce(function (acc, placement) {
1364
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1365
- return acc;
1366
- }, {});
1367
- var _data$state$placement = data[state.placement],
1368
- x = _data$state$placement.x,
1369
- y = _data$state$placement.y;
1370
-
1371
- if (state.modifiersData.popperOffsets != null) {
1372
- state.modifiersData.popperOffsets.x += x;
1373
- state.modifiersData.popperOffsets.y += y;
1374
- }
1375
-
1376
- state.modifiersData[name] = data;
1377
- } // eslint-disable-next-line import/no-unused-modules
1378
-
1379
-
1380
- var offset$1 = {
1381
- name: 'offset',
1382
- enabled: true,
1383
- phase: 'main',
1384
- requires: ['popperOffsets'],
1385
- fn: offset
1386
- };
1387
-
1388
- function popperOffsets(_ref) {
1389
- var state = _ref.state,
1390
- name = _ref.name;
1391
- // Offsets are the actual position the popper needs to have to be
1392
- // properly positioned near its reference element
1393
- // This is the most basic placement, and will be adjusted by
1394
- // the modifiers in the next step
1395
- state.modifiersData[name] = computeOffsets({
1396
- reference: state.rects.reference,
1397
- element: state.rects.popper,
1398
- strategy: 'absolute',
1399
- placement: state.placement
1400
- });
1401
- } // eslint-disable-next-line import/no-unused-modules
1402
-
1403
-
1404
- var popperOffsets$1 = {
1405
- name: 'popperOffsets',
1406
- enabled: true,
1407
- phase: 'read',
1408
- fn: popperOffsets,
1409
- data: {}
1410
- };
1411
-
1412
- function getAltAxis(axis) {
1413
- return axis === 'x' ? 'y' : 'x';
1414
- }
1415
-
1416
- function preventOverflow(_ref) {
1417
- var state = _ref.state,
1418
- options = _ref.options,
1419
- name = _ref.name;
1420
- var _options$mainAxis = options.mainAxis,
1421
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1422
- _options$altAxis = options.altAxis,
1423
- checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1424
- boundary = options.boundary,
1425
- rootBoundary = options.rootBoundary,
1426
- altBoundary = options.altBoundary,
1427
- padding = options.padding,
1428
- _options$tether = options.tether,
1429
- tether = _options$tether === void 0 ? true : _options$tether,
1430
- _options$tetherOffset = options.tetherOffset,
1431
- tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1432
- var overflow = detectOverflow(state, {
1433
- boundary: boundary,
1434
- rootBoundary: rootBoundary,
1435
- padding: padding,
1436
- altBoundary: altBoundary
1437
- });
1438
- var basePlacement = getBasePlacement(state.placement);
1439
- var variation = getVariation(state.placement);
1440
- var isBasePlacement = !variation;
1441
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1442
- var altAxis = getAltAxis(mainAxis);
1443
- var popperOffsets = state.modifiersData.popperOffsets;
1444
- var referenceRect = state.rects.reference;
1445
- var popperRect = state.rects.popper;
1446
- var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1447
- placement: state.placement
1448
- })) : tetherOffset;
1449
- var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1450
- mainAxis: tetherOffsetValue,
1451
- altAxis: tetherOffsetValue
1452
- } : Object.assign({
1453
- mainAxis: 0,
1454
- altAxis: 0
1455
- }, tetherOffsetValue);
1456
- var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1457
- var data = {
1458
- x: 0,
1459
- y: 0
1460
- };
1461
-
1462
- if (!popperOffsets) {
1463
- return;
1464
- }
1465
-
1466
- if (checkMainAxis) {
1467
- var _offsetModifierState$;
1468
-
1469
- var mainSide = mainAxis === 'y' ? top : left;
1470
- var altSide = mainAxis === 'y' ? bottom : right;
1471
- var len = mainAxis === 'y' ? 'height' : 'width';
1472
- var offset = popperOffsets[mainAxis];
1473
- var min$1 = offset + overflow[mainSide];
1474
- var max$1 = offset - overflow[altSide];
1475
- var additive = tether ? -popperRect[len] / 2 : 0;
1476
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1477
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1478
- // outside the reference bounds
1479
-
1480
- var arrowElement = state.elements.arrow;
1481
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1482
- width: 0,
1483
- height: 0
1484
- };
1485
- var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1486
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1487
- var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1488
- // to include its full size in the calculation. If the reference is small
1489
- // and near the edge of a boundary, the popper can overflow even if the
1490
- // reference is not overflowing as well (e.g. virtual elements with no
1491
- // width or height)
1492
-
1493
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1494
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1495
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1496
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1497
- var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1498
- var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1499
- var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1500
- var tetherMax = offset + maxOffset - offsetModifierValue;
1501
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1502
- popperOffsets[mainAxis] = preventedOffset;
1503
- data[mainAxis] = preventedOffset - offset;
1504
- }
1505
-
1506
- if (checkAltAxis) {
1507
- var _offsetModifierState$2;
1508
-
1509
- var _mainSide = mainAxis === 'x' ? top : left;
1510
-
1511
- var _altSide = mainAxis === 'x' ? bottom : right;
1512
-
1513
- var _offset = popperOffsets[altAxis];
1514
-
1515
- var _len = altAxis === 'y' ? 'height' : 'width';
1516
-
1517
- var _min = _offset + overflow[_mainSide];
1518
-
1519
- var _max = _offset - overflow[_altSide];
1520
-
1521
- var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1522
-
1523
- var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1524
-
1525
- var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1526
-
1527
- var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1528
-
1529
- var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1530
-
1531
- popperOffsets[altAxis] = _preventedOffset;
1532
- data[altAxis] = _preventedOffset - _offset;
1533
- }
1534
-
1535
- state.modifiersData[name] = data;
1536
- } // eslint-disable-next-line import/no-unused-modules
1537
-
1538
-
1539
- var preventOverflow$1 = {
1540
- name: 'preventOverflow',
1541
- enabled: true,
1542
- phase: 'main',
1543
- fn: preventOverflow,
1544
- requiresIfExists: ['offset']
1545
- };
1546
-
1547
- function getHTMLElementScroll(element) {
1548
- return {
1549
- scrollLeft: element.scrollLeft,
1550
- scrollTop: element.scrollTop
1551
- };
1552
- }
1553
-
1554
- function getNodeScroll(node) {
1555
- if (node === getWindow(node) || !isHTMLElement$1(node)) {
1556
- return getWindowScroll(node);
1557
- } else {
1558
- return getHTMLElementScroll(node);
1559
- }
1560
- }
1561
-
1562
- function isElementScaled(element) {
1563
- var rect = element.getBoundingClientRect();
1564
- var scaleX = round(rect.width) / element.offsetWidth || 1;
1565
- var scaleY = round(rect.height) / element.offsetHeight || 1;
1566
- return scaleX !== 1 || scaleY !== 1;
1567
- } // Returns the composite rect of an element relative to its offsetParent.
1568
- // Composite means it takes into account transforms as well as layout.
1569
-
1570
-
1571
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1572
- if (isFixed === void 0) {
1573
- isFixed = false;
1574
- }
1575
-
1576
- var isOffsetParentAnElement = isHTMLElement$1(offsetParent);
1577
- var offsetParentIsScaled = isHTMLElement$1(offsetParent) && isElementScaled(offsetParent);
1578
- var documentElement = getDocumentElement(offsetParent);
1579
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
1580
- var scroll = {
1581
- scrollLeft: 0,
1582
- scrollTop: 0
1583
- };
1584
- var offsets = {
1585
- x: 0,
1586
- y: 0
1587
- };
1588
-
1589
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1590
- if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1591
- isScrollParent(documentElement)) {
1592
- scroll = getNodeScroll(offsetParent);
1593
- }
1594
-
1595
- if (isHTMLElement$1(offsetParent)) {
1596
- offsets = getBoundingClientRect(offsetParent, true);
1597
- offsets.x += offsetParent.clientLeft;
1598
- offsets.y += offsetParent.clientTop;
1599
- } else if (documentElement) {
1600
- offsets.x = getWindowScrollBarX(documentElement);
1601
- }
1602
- }
1603
-
1604
- return {
1605
- x: rect.left + scroll.scrollLeft - offsets.x,
1606
- y: rect.top + scroll.scrollTop - offsets.y,
1607
- width: rect.width,
1608
- height: rect.height
1609
- };
1610
- }
1611
-
1612
- function order(modifiers) {
1613
- var map = new Map();
1614
- var visited = new Set();
1615
- var result = [];
1616
- modifiers.forEach(function (modifier) {
1617
- map.set(modifier.name, modifier);
1618
- }); // On visiting object, check for its dependencies and visit them recursively
1619
-
1620
- function sort(modifier) {
1621
- visited.add(modifier.name);
1622
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1623
- requires.forEach(function (dep) {
1624
- if (!visited.has(dep)) {
1625
- var depModifier = map.get(dep);
1626
-
1627
- if (depModifier) {
1628
- sort(depModifier);
1629
- }
1630
- }
1631
- });
1632
- result.push(modifier);
1633
- }
1634
-
1635
- modifiers.forEach(function (modifier) {
1636
- if (!visited.has(modifier.name)) {
1637
- // check for visited object
1638
- sort(modifier);
1639
- }
1640
- });
1641
- return result;
1642
- }
1643
-
1644
- function orderModifiers(modifiers) {
1645
- // order based on dependencies
1646
- var orderedModifiers = order(modifiers); // order based on phase
1647
-
1648
- return modifierPhases.reduce(function (acc, phase) {
1649
- return acc.concat(orderedModifiers.filter(function (modifier) {
1650
- return modifier.phase === phase;
1651
- }));
1652
- }, []);
1653
- }
1654
-
1655
- function debounce(fn) {
1656
- var pending;
1657
- return function () {
1658
- if (!pending) {
1659
- pending = new Promise(function (resolve) {
1660
- Promise.resolve().then(function () {
1661
- pending = undefined;
1662
- resolve(fn());
1663
- });
1664
- });
1665
- }
1666
-
1667
- return pending;
1668
- };
1669
- }
1670
-
1671
- function mergeByName(modifiers) {
1672
- var merged = modifiers.reduce(function (merged, current) {
1673
- var existing = merged[current.name];
1674
- merged[current.name] = existing ? Object.assign({}, existing, current, {
1675
- options: Object.assign({}, existing.options, current.options),
1676
- data: Object.assign({}, existing.data, current.data)
1677
- }) : current;
1678
- return merged;
1679
- }, {}); // IE11 does not support Object.values
1680
-
1681
- return Object.keys(merged).map(function (key) {
1682
- return merged[key];
1683
- });
1684
- }
1685
-
1686
- var DEFAULT_OPTIONS = {
1687
- placement: 'bottom',
1688
- modifiers: [],
1689
- strategy: 'absolute'
1690
- };
1691
-
1692
- function areValidElements() {
1693
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1694
- args[_key] = arguments[_key];
1695
- }
1696
-
1697
- return !args.some(function (element) {
1698
- return !(element && typeof element.getBoundingClientRect === 'function');
1699
- });
1700
- }
1701
-
1702
- function popperGenerator(generatorOptions) {
1703
- if (generatorOptions === void 0) {
1704
- generatorOptions = {};
1705
- }
1706
-
1707
- var _generatorOptions = generatorOptions,
1708
- _generatorOptions$def = _generatorOptions.defaultModifiers,
1709
- defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1710
- _generatorOptions$def2 = _generatorOptions.defaultOptions,
1711
- defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1712
- return function createPopper(reference, popper, options) {
1713
- if (options === void 0) {
1714
- options = defaultOptions;
1715
- }
1716
-
1717
- var state = {
1718
- placement: 'bottom',
1719
- orderedModifiers: [],
1720
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1721
- modifiersData: {},
1722
- elements: {
1723
- reference: reference,
1724
- popper: popper
1725
- },
1726
- attributes: {},
1727
- styles: {}
1728
- };
1729
- var effectCleanupFns = [];
1730
- var isDestroyed = false;
1731
- var instance = {
1732
- state: state,
1733
- setOptions: function setOptions(setOptionsAction) {
1734
- var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1735
- cleanupModifierEffects();
1736
- state.options = Object.assign({}, defaultOptions, state.options, options);
1737
- state.scrollParents = {
1738
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1739
- popper: listScrollParents(popper)
1740
- }; // Orders the modifiers based on their dependencies and `phase`
1741
- // properties
1742
-
1743
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1744
-
1745
- state.orderedModifiers = orderedModifiers.filter(function (m) {
1746
- return m.enabled;
1747
- });
1748
- runModifierEffects();
1749
- return instance.update();
1750
- },
1751
- // Sync update – it will always be executed, even if not necessary. This
1752
- // is useful for low frequency updates where sync behavior simplifies the
1753
- // logic.
1754
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1755
- // prefer the async Popper#update method
1756
- forceUpdate: function forceUpdate() {
1757
- if (isDestroyed) {
1758
- return;
1759
- }
1760
-
1761
- var _state$elements = state.elements,
1762
- reference = _state$elements.reference,
1763
- popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1764
- // anymore
1765
-
1766
- if (!areValidElements(reference, popper)) {
1767
- return;
1768
- } // Store the reference and popper rects to be read by modifiers
1769
-
1770
-
1771
- state.rects = {
1772
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1773
- popper: getLayoutRect(popper)
1774
- }; // Modifiers have the ability to reset the current update cycle. The
1775
- // most common use case for this is the `flip` modifier changing the
1776
- // placement, which then needs to re-run all the modifiers, because the
1777
- // logic was previously ran for the previous placement and is therefore
1778
- // stale/incorrect
1779
-
1780
- state.reset = false;
1781
- state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1782
- // is filled with the initial data specified by the modifier. This means
1783
- // it doesn't persist and is fresh on each update.
1784
- // To ensure persistent data, use `${name}#persistent`
1785
-
1786
- state.orderedModifiers.forEach(function (modifier) {
1787
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1788
- });
1789
-
1790
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1791
- if (state.reset === true) {
1792
- state.reset = false;
1793
- index = -1;
1794
- continue;
1795
- }
1796
-
1797
- var _state$orderedModifie = state.orderedModifiers[index],
1798
- fn = _state$orderedModifie.fn,
1799
- _state$orderedModifie2 = _state$orderedModifie.options,
1800
- _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1801
- name = _state$orderedModifie.name;
1802
-
1803
- if (typeof fn === 'function') {
1804
- state = fn({
1805
- state: state,
1806
- options: _options,
1807
- name: name,
1808
- instance: instance
1809
- }) || state;
1810
- }
1811
- }
1812
- },
1813
- // Async and optimistically optimized update – it will not be executed if
1814
- // not necessary (debounced to run at most once-per-tick)
1815
- update: debounce(function () {
1816
- return new Promise(function (resolve) {
1817
- instance.forceUpdate();
1818
- resolve(state);
1819
- });
1820
- }),
1821
- destroy: function destroy() {
1822
- cleanupModifierEffects();
1823
- isDestroyed = true;
1824
- }
1825
- };
1826
-
1827
- if (!areValidElements(reference, popper)) {
1828
- return instance;
1829
- }
1830
-
1831
- instance.setOptions(options).then(function (state) {
1832
- if (!isDestroyed && options.onFirstUpdate) {
1833
- options.onFirstUpdate(state);
1834
- }
1835
- }); // Modifiers have the ability to execute arbitrary code before the first
1836
- // update cycle runs. They will be executed in the same order as the update
1837
- // cycle. This is useful when a modifier adds some persistent data that
1838
- // other modifiers need to use, but the modifier is run after the dependent
1839
- // one.
1840
-
1841
- function runModifierEffects() {
1842
- state.orderedModifiers.forEach(function (_ref) {
1843
- var name = _ref.name,
1844
- _ref$options = _ref.options,
1845
- options = _ref$options === void 0 ? {} : _ref$options,
1846
- effect = _ref.effect;
1847
-
1848
- if (typeof effect === 'function') {
1849
- var cleanupFn = effect({
1850
- state: state,
1851
- name: name,
1852
- instance: instance,
1853
- options: options
1854
- });
1855
-
1856
- var noopFn = function noopFn() {};
1857
-
1858
- effectCleanupFns.push(cleanupFn || noopFn);
1859
- }
1860
- });
1861
- }
1862
-
1863
- function cleanupModifierEffects() {
1864
- effectCleanupFns.forEach(function (fn) {
1865
- return fn();
1866
- });
1867
- effectCleanupFns = [];
1868
- }
1869
-
1870
- return instance;
1871
- };
1872
- }
1873
-
1874
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1875
- var createPopper = /*#__PURE__*/popperGenerator({
1876
- defaultModifiers: defaultModifiers
1877
- }); // eslint-disable-next-line import/no-unused-modules
1878
-
1879
- function getPopperUtilityClass(slot) {
1880
- return generateUtilityClass('MuiPopper', slot);
1881
- }
1882
- generateUtilityClasses('MuiPopper', ['root']);
1883
-
1884
- function flipPlacement(placement, direction) {
1885
- if (direction === 'ltr') {
1886
- return placement;
1887
- }
1888
- switch (placement) {
1889
- case 'bottom-end':
1890
- return 'bottom-start';
1891
- case 'bottom-start':
1892
- return 'bottom-end';
1893
- case 'top-end':
1894
- return 'top-start';
1895
- case 'top-start':
1896
- return 'top-end';
1897
- default:
1898
- return placement;
1899
- }
1900
- }
1901
- function resolveAnchorEl(anchorEl) {
1902
- return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
1903
- }
1904
- function isHTMLElement(element) {
1905
- return element.nodeType !== undefined;
1906
- }
1907
- function isVirtualElement(element) {
1908
- return !isHTMLElement(element);
1909
- }
1910
- const useUtilityClasses = ownerState => {
1911
- const {
1912
- classes
1913
- } = ownerState;
1914
- const slots = {
1915
- root: ['root']
1916
- };
1917
- return composeClasses(slots, getPopperUtilityClass, classes);
1918
- };
1919
- const defaultPopperOptions = {};
1920
- const PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, forwardedRef) {
1921
- const {
1922
- anchorEl,
1923
- children,
1924
- direction,
1925
- disablePortal,
1926
- modifiers,
1927
- open,
1928
- placement: initialPlacement,
1929
- popperOptions,
1930
- popperRef: popperRefProp,
1931
- slotProps = {},
1932
- slots = {},
1933
- TransitionProps,
1934
- // @ts-ignore internal logic
1935
- ownerState: ownerStateProp,
1936
- // prevent from spreading to DOM, it can come from the parent component e.g. Select.
1937
- ...other
1938
- } = props;
1939
- const tooltipRef = React.useRef(null);
1940
- const ownRef = useForkRef(tooltipRef, forwardedRef);
1941
- const popperRef = React.useRef(null);
1942
- const handlePopperRef = useForkRef(popperRef, popperRefProp);
1943
- const handlePopperRefRef = React.useRef(handlePopperRef);
1944
- useEnhancedEffect(() => {
1945
- handlePopperRefRef.current = handlePopperRef;
1946
- }, [handlePopperRef]);
1947
- React.useImperativeHandle(popperRefProp, () => popperRef.current, []);
1948
- const rtlPlacement = flipPlacement(initialPlacement, direction);
1949
- /**
1950
- * placement initialized from prop but can change during lifetime if modifiers.flip.
1951
- * modifiers.flip is essentially a flip for controlled/uncontrolled behavior
1952
- */
1953
- const [placement, setPlacement] = React.useState(rtlPlacement);
1954
- const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));
1955
- React.useEffect(() => {
1956
- if (popperRef.current) {
1957
- popperRef.current.forceUpdate();
1958
- }
1959
- });
1960
- React.useEffect(() => {
1961
- if (anchorEl) {
1962
- setResolvedAnchorElement(resolveAnchorEl(anchorEl));
1963
- }
1964
- }, [anchorEl]);
1965
- useEnhancedEffect(() => {
1966
- if (!resolvedAnchorElement || !open) {
1967
- return undefined;
1968
- }
1969
- const handlePopperUpdate = data => {
1970
- setPlacement(data.placement);
1971
- };
1972
- if (process.env.NODE_ENV !== 'production') {
1973
- if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {
1974
- const box = resolvedAnchorElement.getBoundingClientRect();
1975
- if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
1976
- console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
1977
- }
1978
- }
1979
- }
1980
- let popperModifiers = [{
1981
- name: 'preventOverflow',
1982
- options: {
1983
- altBoundary: disablePortal
1984
- }
1985
- }, {
1986
- name: 'flip',
1987
- options: {
1988
- altBoundary: disablePortal
1989
- }
1990
- }, {
1991
- name: 'onUpdate',
1992
- enabled: true,
1993
- phase: 'afterWrite',
1994
- fn: ({
1995
- state
1996
- }) => {
1997
- handlePopperUpdate(state);
1998
- }
1999
- }];
2000
- if (modifiers != null) {
2001
- popperModifiers = popperModifiers.concat(modifiers);
2002
- }
2003
- if (popperOptions && popperOptions.modifiers != null) {
2004
- popperModifiers = popperModifiers.concat(popperOptions.modifiers);
2005
- }
2006
- const popper = createPopper(resolvedAnchorElement, tooltipRef.current, {
2007
- placement: rtlPlacement,
2008
- ...popperOptions,
2009
- modifiers: popperModifiers
2010
- });
2011
- handlePopperRefRef.current(popper);
2012
- return () => {
2013
- popper.destroy();
2014
- handlePopperRefRef.current(null);
2015
- };
2016
- }, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);
2017
- const childProps = {
2018
- placement: placement
2019
- };
2020
- if (TransitionProps !== null) {
2021
- childProps.TransitionProps = TransitionProps;
2022
- }
2023
- const classes = useUtilityClasses(props);
2024
- const Root = slots.root ?? 'div';
2025
- const rootProps = useSlotProps({
2026
- elementType: Root,
2027
- externalSlotProps: slotProps.root,
2028
- externalForwardedProps: other,
2029
- additionalProps: {
2030
- role: 'tooltip',
2031
- ref: ownRef
2032
- },
2033
- ownerState: props,
2034
- className: classes.root
2035
- });
2036
- return /*#__PURE__*/jsxRuntimeExports.jsx(Root, {
2037
- ...rootProps,
2038
- children: typeof children === 'function' ? children(childProps) : children
2039
- });
2040
- });
2041
-
2042
- /**
2043
- * @ignore - internal component.
2044
- */
2045
- const Popper$2 = /*#__PURE__*/React.forwardRef(function Popper(props, forwardedRef) {
2046
- const {
2047
- anchorEl,
2048
- children,
2049
- container: containerProp,
2050
- direction = 'ltr',
2051
- disablePortal = false,
2052
- keepMounted = false,
2053
- modifiers,
2054
- open,
2055
- placement = 'bottom',
2056
- popperOptions = defaultPopperOptions,
2057
- popperRef,
2058
- style,
2059
- transition = false,
2060
- slotProps = {},
2061
- slots = {},
2062
- ...other
2063
- } = props;
2064
- const [exited, setExited] = React.useState(true);
2065
- const handleEnter = () => {
2066
- setExited(false);
2067
- };
2068
- const handleExited = () => {
2069
- setExited(true);
2070
- };
2071
- if (!keepMounted && !open && (!transition || exited)) {
2072
- return null;
2073
- }
2074
-
2075
- // If the container prop is provided, use that
2076
- // If the anchorEl prop is provided, use its parent body element as the container
2077
- // If neither are provided let the Modal take care of choosing the container
2078
- let container;
2079
- if (containerProp) {
2080
- container = containerProp;
2081
- } else if (anchorEl) {
2082
- const resolvedAnchorEl = resolveAnchorEl(anchorEl);
2083
- container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;
2084
- }
2085
- const display = !open && keepMounted && (!transition || exited) ? 'none' : undefined;
2086
- const transitionProps = transition ? {
2087
- in: open,
2088
- onEnter: handleEnter,
2089
- onExited: handleExited
2090
- } : undefined;
2091
- return /*#__PURE__*/jsxRuntimeExports.jsx(Portal, {
2092
- disablePortal: disablePortal,
2093
- container: container,
2094
- children: /*#__PURE__*/jsxRuntimeExports.jsx(PopperTooltip, {
2095
- anchorEl: anchorEl,
2096
- direction: direction,
2097
- disablePortal: disablePortal,
2098
- modifiers: modifiers,
2099
- ref: forwardedRef,
2100
- open: transition ? !exited : open,
2101
- placement: placement,
2102
- popperOptions: popperOptions,
2103
- popperRef: popperRef,
2104
- slotProps: slotProps,
2105
- slots: slots,
2106
- ...other,
2107
- style: {
2108
- // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
2109
- position: 'fixed',
2110
- // Fix Popper.js display issue
2111
- top: 0,
2112
- left: 0,
2113
- display,
2114
- ...style
2115
- },
2116
- TransitionProps: transitionProps,
2117
- children: children
2118
- })
2119
- });
2120
- });
2121
- process.env.NODE_ENV !== "production" ? Popper$2.propTypes /* remove-proptypes */ = {
2122
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2123
- // │ These PropTypes are generated from the TypeScript type definitions. │
2124
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2125
- // └─────────────────────────────────────────────────────────────────────┘
2126
- /**
2127
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2128
- * or a function that returns either.
2129
- * It's used to set the position of the popper.
2130
- * The return value will passed as the reference object of the Popper instance.
2131
- */
2132
- anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {
2133
- if (props.open) {
2134
- const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);
2135
- if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {
2136
- const box = resolvedAnchorEl.getBoundingClientRect();
2137
- if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {
2138
- return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
2139
- }
2140
- } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {
2141
- return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\n'));
2142
- }
2143
- }
2144
- return null;
2145
- }),
2146
- /**
2147
- * Popper render function or node.
2148
- */
2149
- children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2150
- /**
2151
- * An HTML element or function that returns one.
2152
- * The `container` will have the portal children appended to it.
2153
- *
2154
- * You can also provide a callback, which is called in a React layout effect.
2155
- * This lets you set the container from a ref, and also makes server-side rendering possible.
2156
- *
2157
- * By default, it uses the body of the top-level document object,
2158
- * so it's simply `document.body` most of the time.
2159
- */
2160
- container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2161
- /**
2162
- * Direction of the text.
2163
- * @default 'ltr'
2164
- */
2165
- direction: PropTypes.oneOf(['ltr', 'rtl']),
2166
- /**
2167
- * The `children` will be under the DOM hierarchy of the parent component.
2168
- * @default false
2169
- */
2170
- disablePortal: PropTypes.bool,
2171
- /**
2172
- * Always keep the children in the DOM.
2173
- * This prop can be useful in SEO situation or
2174
- * when you want to maximize the responsiveness of the Popper.
2175
- * @default false
2176
- */
2177
- keepMounted: PropTypes.bool,
2178
- /**
2179
- * Popper.js is based on a "plugin-like" architecture,
2180
- * most of its features are fully encapsulated "modifiers".
2181
- *
2182
- * A modifier is a function that is called each time Popper.js needs to
2183
- * compute the position of the popper.
2184
- * For this reason, modifiers should be very performant to avoid bottlenecks.
2185
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2186
- */
2187
- modifiers: PropTypes.arrayOf(PropTypes.shape({
2188
- data: PropTypes.object,
2189
- effect: PropTypes.func,
2190
- enabled: PropTypes.bool,
2191
- fn: PropTypes.func,
2192
- name: PropTypes.any,
2193
- options: PropTypes.object,
2194
- phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2195
- requires: PropTypes.arrayOf(PropTypes.string),
2196
- requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2197
- })),
2198
- /**
2199
- * If `true`, the component is shown.
2200
- */
2201
- open: PropTypes.bool.isRequired,
2202
- /**
2203
- * Popper placement.
2204
- * @default 'bottom'
2205
- */
2206
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2207
- /**
2208
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2209
- * @default {}
2210
- */
2211
- popperOptions: PropTypes.shape({
2212
- modifiers: PropTypes.array,
2213
- onFirstUpdate: PropTypes.func,
2214
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2215
- strategy: PropTypes.oneOf(['absolute', 'fixed'])
2216
- }),
2217
- /**
2218
- * A ref that points to the used popper instance.
2219
- */
2220
- popperRef: refType,
2221
- /**
2222
- * The props used for each slot inside the Popper.
2223
- * @default {}
2224
- */
2225
- slotProps: PropTypes.shape({
2226
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2227
- }),
2228
- /**
2229
- * The components used for each slot inside the Popper.
2230
- * Either a string to use a HTML element or a component.
2231
- * @default {}
2232
- */
2233
- slots: PropTypes.shape({
2234
- root: PropTypes.elementType
2235
- }),
2236
- /**
2237
- * Help supporting a react-transition-group/Transition component.
2238
- * @default false
2239
- */
2240
- transition: PropTypes.bool
2241
- } : void 0;
2242
- var BasePopper$1 = Popper$2;
2243
-
2244
- const PopperRoot = styled(BasePopper$1, {
2245
- name: 'MuiPopper',
2246
- slot: 'Root',
2247
- overridesResolver: (props, styles) => styles.root
2248
- })({});
2249
-
2250
- /**
2251
- *
2252
- * Demos:
2253
- *
2254
- * - [Autocomplete](https://v6.mui.com/material-ui/react-autocomplete/)
2255
- * - [Menu](https://v6.mui.com/material-ui/react-menu/)
2256
- * - [Popper](https://v6.mui.com/material-ui/react-popper/)
2257
- *
2258
- * API:
2259
- *
2260
- * - [Popper API](https://v6.mui.com/material-ui/api/popper/)
2261
- */
2262
- const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
2263
- const isRtl = useRtl();
2264
- const props = useDefaultProps({
2265
- props: inProps,
2266
- name: 'MuiPopper'
2267
- });
2268
- const {
2269
- anchorEl,
2270
- component,
2271
- components,
2272
- componentsProps,
2273
- container,
2274
- disablePortal,
2275
- keepMounted,
2276
- modifiers,
2277
- open,
2278
- placement,
2279
- popperOptions,
2280
- popperRef,
2281
- transition,
2282
- slots,
2283
- slotProps,
2284
- ...other
2285
- } = props;
2286
- const RootComponent = slots?.root ?? components?.Root;
2287
- const otherProps = {
2288
- anchorEl,
2289
- container,
2290
- disablePortal,
2291
- keepMounted,
2292
- modifiers,
2293
- open,
2294
- placement,
2295
- popperOptions,
2296
- popperRef,
2297
- transition,
2298
- ...other
2299
- };
2300
- return /*#__PURE__*/jsxRuntimeExports.jsx(PopperRoot, {
2301
- as: component,
2302
- direction: isRtl ? 'rtl' : 'ltr',
2303
- slots: {
2304
- root: RootComponent
2305
- },
2306
- slotProps: slotProps ?? componentsProps,
2307
- ...otherProps,
2308
- ref: ref
2309
- });
2310
- });
2311
- process.env.NODE_ENV !== "production" ? Popper.propTypes /* remove-proptypes */ = {
2312
- // ┌────────────────────────────── Warning ──────────────────────────────┐
2313
- // │ These PropTypes are generated from the TypeScript type definitions. │
2314
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
2315
- // └─────────────────────────────────────────────────────────────────────┘
2316
- /**
2317
- * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
2318
- * or a function that returns either.
2319
- * It's used to set the position of the popper.
2320
- * The return value will passed as the reference object of the Popper instance.
2321
- */
2322
- anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
2323
- /**
2324
- * Popper render function or node.
2325
- */
2326
- children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),
2327
- /**
2328
- * The component used for the root node.
2329
- * Either a string to use a HTML element or a component.
2330
- */
2331
- component: PropTypes.elementType,
2332
- /**
2333
- * The components used for each slot inside the Popper.
2334
- * Either a string to use a HTML element or a component.
2335
- *
2336
- * @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2337
- * @default {}
2338
- */
2339
- components: PropTypes.shape({
2340
- Root: PropTypes.elementType
2341
- }),
2342
- /**
2343
- * The props used for each slot inside the Popper.
2344
- *
2345
- * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
2346
- * @default {}
2347
- */
2348
- componentsProps: PropTypes.shape({
2349
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2350
- }),
2351
- /**
2352
- * An HTML element or function that returns one.
2353
- * The `container` will have the portal children appended to it.
2354
- *
2355
- * You can also provide a callback, which is called in a React layout effect.
2356
- * This lets you set the container from a ref, and also makes server-side rendering possible.
2357
- *
2358
- * By default, it uses the body of the top-level document object,
2359
- * so it's simply `document.body` most of the time.
2360
- */
2361
- container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),
2362
- /**
2363
- * The `children` will be under the DOM hierarchy of the parent component.
2364
- * @default false
2365
- */
2366
- disablePortal: PropTypes.bool,
2367
- /**
2368
- * Always keep the children in the DOM.
2369
- * This prop can be useful in SEO situation or
2370
- * when you want to maximize the responsiveness of the Popper.
2371
- * @default false
2372
- */
2373
- keepMounted: PropTypes.bool,
2374
- /**
2375
- * Popper.js is based on a "plugin-like" architecture,
2376
- * most of its features are fully encapsulated "modifiers".
2377
- *
2378
- * A modifier is a function that is called each time Popper.js needs to
2379
- * compute the position of the popper.
2380
- * For this reason, modifiers should be very performant to avoid bottlenecks.
2381
- * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).
2382
- */
2383
- modifiers: PropTypes.arrayOf(PropTypes.shape({
2384
- data: PropTypes.object,
2385
- effect: PropTypes.func,
2386
- enabled: PropTypes.bool,
2387
- fn: PropTypes.func,
2388
- name: PropTypes.any,
2389
- options: PropTypes.object,
2390
- phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),
2391
- requires: PropTypes.arrayOf(PropTypes.string),
2392
- requiresIfExists: PropTypes.arrayOf(PropTypes.string)
2393
- })),
2394
- /**
2395
- * If `true`, the component is shown.
2396
- */
2397
- open: PropTypes.bool.isRequired,
2398
- /**
2399
- * Popper placement.
2400
- * @default 'bottom'
2401
- */
2402
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2403
- /**
2404
- * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.
2405
- * @default {}
2406
- */
2407
- popperOptions: PropTypes.shape({
2408
- modifiers: PropTypes.array,
2409
- onFirstUpdate: PropTypes.func,
2410
- placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
2411
- strategy: PropTypes.oneOf(['absolute', 'fixed'])
2412
- }),
2413
- /**
2414
- * A ref that points to the used popper instance.
2415
- */
2416
- popperRef: refType,
2417
- /**
2418
- * The props used for each slot inside the Popper.
2419
- * @default {}
2420
- */
2421
- slotProps: PropTypes.shape({
2422
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
2423
- }),
2424
- /**
2425
- * The components used for each slot inside the Popper.
2426
- * Either a string to use a HTML element or a component.
2427
- * @default {}
2428
- */
2429
- slots: PropTypes.shape({
2430
- root: PropTypes.elementType
2431
- }),
2432
- /**
2433
- * The system prop that allows defining system overrides as well as additional CSS styles.
2434
- */
2435
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
2436
- /**
2437
- * Help supporting a react-transition-group/Transition component.
2438
- * @default false
2439
- */
2440
- transition: PropTypes.bool
2441
- } : void 0;
2442
- var Popper$1 = Popper;
2443
-
2444
- const BasePopper = /*#__PURE__*/forwardRef((props, ref) => {
2445
- return /*#__PURE__*/React__default.createElement(Popper$1, _extends({}, props, {
2446
- ref: ref,
2447
- container: () => document.getElementById('redsift-app-container')
2448
- }));
2449
- });
2450
-
2451
- export { BaseButton as B, BaseCheckbox as a, BaseIcon as b, BasePopper as c, muiIconToDSIcon as m };
2452
- //# sourceMappingURL=BasePopper.js.map