wcs-core 2.6.0 → 2.7.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +16 -0
  3. package/dist/cjs/{helpers-d9aaa8c4.js → helpers-6abce594.js} +5 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/popper-6a290c40.js +1731 -0
  6. package/dist/cjs/wcs-button.cjs.entry.js +1 -1
  7. package/dist/cjs/wcs-checkbox.cjs.entry.js +6 -2
  8. package/dist/cjs/wcs-dropdown-divider.cjs.entry.js +19 -0
  9. package/dist/cjs/wcs-dropdown-header.cjs.entry.js +19 -0
  10. package/dist/cjs/wcs-dropdown.cjs.entry.js +43 -10
  11. package/dist/cjs/wcs-error_2.cjs.entry.js +1 -1
  12. package/dist/cjs/wcs-galactic-menu.cjs.entry.js +3 -1730
  13. package/dist/cjs/wcs-grid-column.cjs.entry.js +5 -1
  14. package/dist/cjs/wcs-grid.cjs.entry.js +28 -5
  15. package/dist/cjs/wcs-input.cjs.entry.js +3 -3
  16. package/dist/cjs/wcs-radio.cjs.entry.js +2 -2
  17. package/dist/cjs/wcs-select_2.cjs.entry.js +1 -1
  18. package/dist/cjs/wcs-switch.cjs.entry.js +10 -2
  19. package/dist/cjs/wcs-textarea.cjs.entry.js +2 -2
  20. package/dist/cjs/wcs.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +2 -0
  22. package/dist/collection/components/checkbox/checkbox.css +18 -7
  23. package/dist/collection/components/checkbox/checkbox.js +24 -2
  24. package/dist/collection/components/dropdown/dropdown-interface.js +1 -0
  25. package/dist/collection/components/dropdown/dropdown.css +46 -38
  26. package/dist/collection/components/dropdown/dropdown.js +90 -29
  27. package/dist/collection/components/dropdown-divider/dropdown-divider.css +7 -0
  28. package/dist/collection/components/dropdown-divider/dropdown-divider.js +14 -0
  29. package/dist/collection/components/dropdown-header/dropdown-header.css +8 -0
  30. package/dist/collection/components/dropdown-header/dropdown-header.js +15 -0
  31. package/dist/collection/components/form-field/form-field.css +1 -1
  32. package/dist/collection/components/grid/grid.js +28 -5
  33. package/dist/collection/components/grid-column/grid-column.js +7 -1
  34. package/dist/collection/components/input/input.css +48 -0
  35. package/dist/collection/components/input/input.js +38 -2
  36. package/dist/collection/components/radio/radio.component.js +1 -1
  37. package/dist/collection/components/radio/radio.css +18 -4
  38. package/dist/collection/components/radio-group/radio-group.js +7 -2
  39. package/dist/collection/components/switch/switch.css +53 -16
  40. package/dist/collection/components/switch/switch.js +55 -6
  41. package/dist/collection/components/textarea/textarea.css +4 -0
  42. package/dist/collection/utils/helpers.js +4 -0
  43. package/dist/esm/{helpers-50436c51.js → helpers-e2993152.js} +5 -1
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/popper-e5fdfb6a.js +1729 -0
  46. package/dist/esm/wcs-button.entry.js +1 -1
  47. package/dist/esm/wcs-checkbox.entry.js +6 -2
  48. package/dist/esm/wcs-dropdown-divider.entry.js +15 -0
  49. package/dist/esm/wcs-dropdown-header.entry.js +15 -0
  50. package/dist/esm/wcs-dropdown.entry.js +43 -10
  51. package/dist/esm/wcs-error_2.entry.js +1 -1
  52. package/dist/esm/wcs-galactic-menu.entry.js +2 -1729
  53. package/dist/esm/wcs-grid-column.entry.js +5 -1
  54. package/dist/esm/wcs-grid.entry.js +28 -5
  55. package/dist/esm/wcs-input.entry.js +3 -3
  56. package/dist/esm/wcs-radio.entry.js +2 -2
  57. package/dist/esm/wcs-select_2.entry.js +1 -1
  58. package/dist/esm/wcs-switch.entry.js +10 -2
  59. package/dist/esm/wcs-textarea.entry.js +2 -2
  60. package/dist/esm/wcs.js +1 -1
  61. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  62. package/dist/types/components/dropdown/dropdown-interface.d.ts +1 -0
  63. package/dist/types/components/dropdown/dropdown.d.ts +13 -16
  64. package/dist/types/components/dropdown-divider/dropdown-divider.d.ts +3 -0
  65. package/dist/types/components/dropdown-header/dropdown-header.d.ts +3 -0
  66. package/dist/types/components/grid/grid.d.ts +11 -0
  67. package/dist/types/components/grid-column/grid-column.d.ts +1 -0
  68. package/dist/types/components/input/input.d.ts +8 -0
  69. package/dist/types/components/radio-group/radio-group-interface.d.ts +1 -0
  70. package/dist/types/components/radio-group/radio-group.d.ts +2 -2
  71. package/dist/types/components/switch/switch-interface.d.ts +1 -0
  72. package/dist/types/components/switch/switch.d.ts +10 -2
  73. package/dist/types/components.d.ts +105 -4
  74. package/dist/types/utils/helpers.d.ts +1 -0
  75. package/dist/wcs/{p-356a8e3b.entry.js → p-384068f7.entry.js} +1 -1
  76. package/dist/wcs/p-41037455.entry.js +1 -0
  77. package/dist/wcs/p-57247184.entry.js +1 -0
  78. package/dist/wcs/p-7206e492.entry.js +1 -0
  79. package/dist/wcs/p-8c8740e3.entry.js +1 -0
  80. package/dist/wcs/p-a92d369e.entry.js +1 -0
  81. package/dist/wcs/p-a978c1e3.entry.js +1 -0
  82. package/dist/wcs/p-b5138986.js +1 -0
  83. package/dist/wcs/p-bbf1ef42.entry.js +1 -0
  84. package/dist/wcs/{p-3d10b02a.entry.js → p-c7d6d3e1.entry.js} +1 -1
  85. package/dist/wcs/p-cf4d7a83.js +1 -0
  86. package/dist/wcs/{p-a5a1b27c.entry.js → p-d7dec082.entry.js} +1 -1
  87. package/dist/wcs/p-e65d1c27.entry.js +1 -0
  88. package/dist/wcs/p-ea3e93e9.entry.js +1 -0
  89. package/dist/wcs/p-fbaf299d.entry.js +1 -0
  90. package/dist/wcs/{p-4338f140.entry.js → p-ff6d0dfd.entry.js} +1 -1
  91. package/dist/wcs/wcs.esm.js +1 -1
  92. package/package.json +1 -2
  93. package/dist/wcs/p-0fbe574e.entry.js +0 -1
  94. package/dist/wcs/p-62f7ab6d.entry.js +0 -1
  95. package/dist/wcs/p-83f1ad32.js +0 -1
  96. package/dist/wcs/p-8f0f9868.entry.js +0 -1
  97. package/dist/wcs/p-af1a5e52.entry.js +0 -1
  98. package/dist/wcs/p-bef44630.entry.js +0 -1
  99. package/dist/wcs/p-d59b4495.entry.js +0 -1
  100. package/dist/wcs/p-dd300dea.entry.js +0 -1
  101. package/dist/wcs/p-e486647c.entry.js +0 -1
@@ -3,1735 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-3cb9d725.js');
6
- const helpers = require('./helpers-d9aaa8c4.js');
7
-
8
- var top = 'top';
9
- var bottom = 'bottom';
10
- var right = 'right';
11
- var left = 'left';
12
- var auto = 'auto';
13
- var basePlacements = [top, bottom, right, left];
14
- var start = 'start';
15
- var end = 'end';
16
- var clippingParents = 'clippingParents';
17
- var viewport = 'viewport';
18
- var popper = 'popper';
19
- var reference = 'reference';
20
- var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
21
- return acc.concat([placement + "-" + start, placement + "-" + end]);
22
- }, []);
23
- var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
24
- return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
25
- }, []); // modifiers that need to read the DOM
26
-
27
- var beforeRead = 'beforeRead';
28
- var read = 'read';
29
- var afterRead = 'afterRead'; // pure-logic modifiers
30
-
31
- var beforeMain = 'beforeMain';
32
- var main = 'main';
33
- var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
34
-
35
- var beforeWrite = 'beforeWrite';
36
- var write = 'write';
37
- var afterWrite = 'afterWrite';
38
- var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
39
-
40
- function getNodeName(element) {
41
- return element ? (element.nodeName || '').toLowerCase() : null;
42
- }
43
-
44
- function getWindow(node) {
45
- if (node == null) {
46
- return window;
47
- }
48
-
49
- if (node.toString() !== '[object Window]') {
50
- var ownerDocument = node.ownerDocument;
51
- return ownerDocument ? ownerDocument.defaultView || window : window;
52
- }
53
-
54
- return node;
55
- }
56
-
57
- function isElement(node) {
58
- var OwnElement = getWindow(node).Element;
59
- return node instanceof OwnElement || node instanceof Element;
60
- }
61
-
62
- function isHTMLElement(node) {
63
- var OwnElement = getWindow(node).HTMLElement;
64
- return node instanceof OwnElement || node instanceof HTMLElement;
65
- }
66
-
67
- function isShadowRoot(node) {
68
- // IE 11 has no ShadowRoot
69
- if (typeof ShadowRoot === 'undefined') {
70
- return false;
71
- }
72
-
73
- var OwnElement = getWindow(node).ShadowRoot;
74
- return node instanceof OwnElement || node instanceof ShadowRoot;
75
- }
76
-
77
- // and applies them to the HTMLElements such as popper and arrow
78
-
79
- function applyStyles(_ref) {
80
- var state = _ref.state;
81
- Object.keys(state.elements).forEach(function (name) {
82
- var style = state.styles[name] || {};
83
- var attributes = state.attributes[name] || {};
84
- var element = state.elements[name]; // arrow is optional + virtual elements
85
-
86
- if (!isHTMLElement(element) || !getNodeName(element)) {
87
- return;
88
- } // Flow doesn't support to extend this property, but it's the most
89
- // effective way to apply styles to an HTMLElement
90
- // $FlowFixMe[cannot-write]
91
-
92
-
93
- Object.assign(element.style, style);
94
- Object.keys(attributes).forEach(function (name) {
95
- var value = attributes[name];
96
-
97
- if (value === false) {
98
- element.removeAttribute(name);
99
- } else {
100
- element.setAttribute(name, value === true ? '' : value);
101
- }
102
- });
103
- });
104
- }
105
-
106
- function effect$2(_ref2) {
107
- var state = _ref2.state;
108
- var initialStyles = {
109
- popper: {
110
- position: state.options.strategy,
111
- left: '0',
112
- top: '0',
113
- margin: '0'
114
- },
115
- arrow: {
116
- position: 'absolute'
117
- },
118
- reference: {}
119
- };
120
- Object.assign(state.elements.popper.style, initialStyles.popper);
121
- state.styles = initialStyles;
122
-
123
- if (state.elements.arrow) {
124
- Object.assign(state.elements.arrow.style, initialStyles.arrow);
125
- }
126
-
127
- return function () {
128
- Object.keys(state.elements).forEach(function (name) {
129
- var element = state.elements[name];
130
- var attributes = state.attributes[name] || {};
131
- var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
132
-
133
- var style = styleProperties.reduce(function (style, property) {
134
- style[property] = '';
135
- return style;
136
- }, {}); // arrow is optional + virtual elements
137
-
138
- if (!isHTMLElement(element) || !getNodeName(element)) {
139
- return;
140
- }
141
-
142
- Object.assign(element.style, style);
143
- Object.keys(attributes).forEach(function (attribute) {
144
- element.removeAttribute(attribute);
145
- });
146
- });
147
- };
148
- } // eslint-disable-next-line import/no-unused-modules
149
-
150
-
151
- const applyStyles$1 = {
152
- name: 'applyStyles',
153
- enabled: true,
154
- phase: 'write',
155
- fn: applyStyles,
156
- effect: effect$2,
157
- requires: ['computeStyles']
158
- };
159
-
160
- function getBasePlacement(placement) {
161
- return placement.split('-')[0];
162
- }
163
-
164
- var round$1 = Math.round;
165
- function getBoundingClientRect(element, includeScale) {
166
- if (includeScale === void 0) {
167
- includeScale = false;
168
- }
169
-
170
- var rect = element.getBoundingClientRect();
171
- var scaleX = 1;
172
- var scaleY = 1;
173
-
174
- if (isHTMLElement(element) && includeScale) {
175
- // Fallback to 1 in case both values are `0`
176
- scaleX = rect.width / element.offsetWidth || 1;
177
- scaleY = rect.height / element.offsetHeight || 1;
178
- }
179
-
180
- return {
181
- width: round$1(rect.width / scaleX),
182
- height: round$1(rect.height / scaleY),
183
- top: round$1(rect.top / scaleY),
184
- right: round$1(rect.right / scaleX),
185
- bottom: round$1(rect.bottom / scaleY),
186
- left: round$1(rect.left / scaleX),
187
- x: round$1(rect.left / scaleX),
188
- y: round$1(rect.top / scaleY)
189
- };
190
- }
191
-
192
- // means it doesn't take into account transforms.
193
-
194
- function getLayoutRect(element) {
195
- var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
196
- // Fixes https://github.com/popperjs/popper-core/issues/1223
197
-
198
- var width = element.offsetWidth;
199
- var height = element.offsetHeight;
200
-
201
- if (Math.abs(clientRect.width - width) <= 1) {
202
- width = clientRect.width;
203
- }
204
-
205
- if (Math.abs(clientRect.height - height) <= 1) {
206
- height = clientRect.height;
207
- }
208
-
209
- return {
210
- x: element.offsetLeft,
211
- y: element.offsetTop,
212
- width: width,
213
- height: height
214
- };
215
- }
216
-
217
- function contains(parent, child) {
218
- var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
219
-
220
- if (parent.contains(child)) {
221
- return true;
222
- } // then fallback to custom implementation with Shadow DOM support
223
- else if (rootNode && isShadowRoot(rootNode)) {
224
- var next = child;
225
-
226
- do {
227
- if (next && parent.isSameNode(next)) {
228
- return true;
229
- } // $FlowFixMe[prop-missing]: need a better way to handle this...
230
-
231
-
232
- next = next.parentNode || next.host;
233
- } while (next);
234
- } // Give up, the result is false
235
-
236
-
237
- return false;
238
- }
239
-
240
- function getComputedStyle(element) {
241
- return getWindow(element).getComputedStyle(element);
242
- }
243
-
244
- function isTableElement(element) {
245
- return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
246
- }
247
-
248
- function getDocumentElement(element) {
249
- // $FlowFixMe[incompatible-return]: assume body is always available
250
- return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
251
- element.document) || window.document).documentElement;
252
- }
253
-
254
- function getParentNode(element) {
255
- if (getNodeName(element) === 'html') {
256
- return element;
257
- }
258
-
259
- return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
260
- // $FlowFixMe[incompatible-return]
261
- // $FlowFixMe[prop-missing]
262
- element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
263
- element.parentNode || ( // DOM Element detected
264
- isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
265
- // $FlowFixMe[incompatible-call]: HTMLElement is a Node
266
- getDocumentElement(element) // fallback
267
-
268
- );
269
- }
270
-
271
- function getTrueOffsetParent(element) {
272
- if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
273
- getComputedStyle(element).position === 'fixed') {
274
- return null;
275
- }
276
-
277
- return element.offsetParent;
278
- } // `.offsetParent` reports `null` for fixed elements, while absolute elements
279
- // return the containing block
280
-
281
-
282
- function getContainingBlock(element) {
283
- var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
284
- var isIE = navigator.userAgent.indexOf('Trident') !== -1;
285
-
286
- if (isIE && isHTMLElement(element)) {
287
- // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
288
- var elementCss = getComputedStyle(element);
289
-
290
- if (elementCss.position === 'fixed') {
291
- return null;
292
- }
293
- }
294
-
295
- var currentNode = getParentNode(element);
296
-
297
- while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
298
- var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
299
- // create a containing block.
300
- // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
301
-
302
- 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') {
303
- return currentNode;
304
- } else {
305
- currentNode = currentNode.parentNode;
306
- }
307
- }
308
-
309
- return null;
310
- } // Gets the closest ancestor positioned element. Handles some edge cases,
311
- // such as table ancestors and cross browser bugs.
312
-
313
-
314
- function getOffsetParent(element) {
315
- var window = getWindow(element);
316
- var offsetParent = getTrueOffsetParent(element);
317
-
318
- while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
319
- offsetParent = getTrueOffsetParent(offsetParent);
320
- }
321
-
322
- if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
323
- return window;
324
- }
325
-
326
- return offsetParent || getContainingBlock(element) || window;
327
- }
328
-
329
- function getMainAxisFromPlacement(placement) {
330
- return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
331
- }
332
-
333
- var max = Math.max;
334
- var min = Math.min;
335
- var round = Math.round;
336
-
337
- function within(min$1, value, max$1) {
338
- return max(min$1, min(value, max$1));
339
- }
340
-
341
- function getFreshSideObject() {
342
- return {
343
- top: 0,
344
- right: 0,
345
- bottom: 0,
346
- left: 0
347
- };
348
- }
349
-
350
- function mergePaddingObject(paddingObject) {
351
- return Object.assign({}, getFreshSideObject(), paddingObject);
352
- }
353
-
354
- function expandToHashMap(value, keys) {
355
- return keys.reduce(function (hashMap, key) {
356
- hashMap[key] = value;
357
- return hashMap;
358
- }, {});
359
- }
360
-
361
- var toPaddingObject = function toPaddingObject(padding, state) {
362
- padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
363
- placement: state.placement
364
- })) : padding;
365
- return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
366
- };
367
-
368
- function arrow(_ref) {
369
- var _state$modifiersData$;
370
-
371
- var state = _ref.state,
372
- name = _ref.name,
373
- options = _ref.options;
374
- var arrowElement = state.elements.arrow;
375
- var popperOffsets = state.modifiersData.popperOffsets;
376
- var basePlacement = getBasePlacement(state.placement);
377
- var axis = getMainAxisFromPlacement(basePlacement);
378
- var isVertical = [left, right].indexOf(basePlacement) >= 0;
379
- var len = isVertical ? 'height' : 'width';
380
-
381
- if (!arrowElement || !popperOffsets) {
382
- return;
383
- }
384
-
385
- var paddingObject = toPaddingObject(options.padding, state);
386
- var arrowRect = getLayoutRect(arrowElement);
387
- var minProp = axis === 'y' ? top : left;
388
- var maxProp = axis === 'y' ? bottom : right;
389
- var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
390
- var startDiff = popperOffsets[axis] - state.rects.reference[axis];
391
- var arrowOffsetParent = getOffsetParent(arrowElement);
392
- var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
393
- var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
394
- // outside of the popper bounds
395
-
396
- var min = paddingObject[minProp];
397
- var max = clientSize - arrowRect[len] - paddingObject[maxProp];
398
- var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
399
- var offset = within(min, center, max); // Prevents breaking syntax highlighting...
400
-
401
- var axisProp = axis;
402
- state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
403
- }
404
-
405
- function effect$1(_ref2) {
406
- var state = _ref2.state,
407
- options = _ref2.options;
408
- var _options$element = options.element,
409
- arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
410
-
411
- if (arrowElement == null) {
412
- return;
413
- } // CSS selector
414
-
415
-
416
- if (typeof arrowElement === 'string') {
417
- arrowElement = state.elements.popper.querySelector(arrowElement);
418
-
419
- if (!arrowElement) {
420
- return;
421
- }
422
- }
423
-
424
- if (!contains(state.elements.popper, arrowElement)) {
425
-
426
- return;
427
- }
428
-
429
- state.elements.arrow = arrowElement;
430
- } // eslint-disable-next-line import/no-unused-modules
431
-
432
-
433
- const arrow$1 = {
434
- name: 'arrow',
435
- enabled: true,
436
- phase: 'main',
437
- fn: arrow,
438
- effect: effect$1,
439
- requires: ['popperOffsets'],
440
- requiresIfExists: ['preventOverflow']
441
- };
442
-
443
- var unsetSides = {
444
- top: 'auto',
445
- right: 'auto',
446
- bottom: 'auto',
447
- left: 'auto'
448
- }; // Round the offsets to the nearest suitable subpixel based on the DPR.
449
- // Zooming can change the DPR, but it seems to report a value that will
450
- // cleanly divide the values into the appropriate subpixels.
451
-
452
- function roundOffsetsByDPR(_ref) {
453
- var x = _ref.x,
454
- y = _ref.y;
455
- var win = window;
456
- var dpr = win.devicePixelRatio || 1;
457
- return {
458
- x: round(round(x * dpr) / dpr) || 0,
459
- y: round(round(y * dpr) / dpr) || 0
460
- };
461
- }
462
-
463
- function mapToStyles(_ref2) {
464
- var _Object$assign2;
465
-
466
- var popper = _ref2.popper,
467
- popperRect = _ref2.popperRect,
468
- placement = _ref2.placement,
469
- offsets = _ref2.offsets,
470
- position = _ref2.position,
471
- gpuAcceleration = _ref2.gpuAcceleration,
472
- adaptive = _ref2.adaptive,
473
- roundOffsets = _ref2.roundOffsets;
474
-
475
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
476
- _ref3$x = _ref3.x,
477
- x = _ref3$x === void 0 ? 0 : _ref3$x,
478
- _ref3$y = _ref3.y,
479
- y = _ref3$y === void 0 ? 0 : _ref3$y;
480
-
481
- var hasX = offsets.hasOwnProperty('x');
482
- var hasY = offsets.hasOwnProperty('y');
483
- var sideX = left;
484
- var sideY = top;
485
- var win = window;
486
-
487
- if (adaptive) {
488
- var offsetParent = getOffsetParent(popper);
489
- var heightProp = 'clientHeight';
490
- var widthProp = 'clientWidth';
491
-
492
- if (offsetParent === getWindow(popper)) {
493
- offsetParent = getDocumentElement(popper);
494
-
495
- if (getComputedStyle(offsetParent).position !== 'static') {
496
- heightProp = 'scrollHeight';
497
- widthProp = 'scrollWidth';
498
- }
499
- } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
500
-
501
-
502
- offsetParent = offsetParent;
503
-
504
- if (placement === top) {
505
- sideY = bottom; // $FlowFixMe[prop-missing]
506
-
507
- y -= offsetParent[heightProp] - popperRect.height;
508
- y *= gpuAcceleration ? 1 : -1;
509
- }
510
-
511
- if (placement === left) {
512
- sideX = right; // $FlowFixMe[prop-missing]
513
-
514
- x -= offsetParent[widthProp] - popperRect.width;
515
- x *= gpuAcceleration ? 1 : -1;
516
- }
517
- }
518
-
519
- var commonStyles = Object.assign({
520
- position: position
521
- }, adaptive && unsetSides);
522
-
523
- if (gpuAcceleration) {
524
- var _Object$assign;
525
-
526
- return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
527
- }
528
-
529
- return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
530
- }
531
-
532
- function computeStyles(_ref4) {
533
- var state = _ref4.state,
534
- options = _ref4.options;
535
- var _options$gpuAccelerat = options.gpuAcceleration,
536
- gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
537
- _options$adaptive = options.adaptive,
538
- adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
539
- _options$roundOffsets = options.roundOffsets,
540
- roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
541
-
542
- var commonStyles = {
543
- placement: getBasePlacement(state.placement),
544
- popper: state.elements.popper,
545
- popperRect: state.rects.popper,
546
- gpuAcceleration: gpuAcceleration
547
- };
548
-
549
- if (state.modifiersData.popperOffsets != null) {
550
- state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
551
- offsets: state.modifiersData.popperOffsets,
552
- position: state.options.strategy,
553
- adaptive: adaptive,
554
- roundOffsets: roundOffsets
555
- })));
556
- }
557
-
558
- if (state.modifiersData.arrow != null) {
559
- state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
560
- offsets: state.modifiersData.arrow,
561
- position: 'absolute',
562
- adaptive: false,
563
- roundOffsets: roundOffsets
564
- })));
565
- }
566
-
567
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
568
- 'data-popper-placement': state.placement
569
- });
570
- } // eslint-disable-next-line import/no-unused-modules
571
-
572
-
573
- const computeStyles$1 = {
574
- name: 'computeStyles',
575
- enabled: true,
576
- phase: 'beforeWrite',
577
- fn: computeStyles,
578
- data: {}
579
- };
580
-
581
- var passive = {
582
- passive: true
583
- };
584
-
585
- function effect(_ref) {
586
- var state = _ref.state,
587
- instance = _ref.instance,
588
- options = _ref.options;
589
- var _options$scroll = options.scroll,
590
- scroll = _options$scroll === void 0 ? true : _options$scroll,
591
- _options$resize = options.resize,
592
- resize = _options$resize === void 0 ? true : _options$resize;
593
- var window = getWindow(state.elements.popper);
594
- var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
595
-
596
- if (scroll) {
597
- scrollParents.forEach(function (scrollParent) {
598
- scrollParent.addEventListener('scroll', instance.update, passive);
599
- });
600
- }
601
-
602
- if (resize) {
603
- window.addEventListener('resize', instance.update, passive);
604
- }
605
-
606
- return function () {
607
- if (scroll) {
608
- scrollParents.forEach(function (scrollParent) {
609
- scrollParent.removeEventListener('scroll', instance.update, passive);
610
- });
611
- }
612
-
613
- if (resize) {
614
- window.removeEventListener('resize', instance.update, passive);
615
- }
616
- };
617
- } // eslint-disable-next-line import/no-unused-modules
618
-
619
-
620
- const eventListeners = {
621
- name: 'eventListeners',
622
- enabled: true,
623
- phase: 'write',
624
- fn: function fn() {},
625
- effect: effect,
626
- data: {}
627
- };
628
-
629
- var hash$1 = {
630
- left: 'right',
631
- right: 'left',
632
- bottom: 'top',
633
- top: 'bottom'
634
- };
635
- function getOppositePlacement(placement) {
636
- return placement.replace(/left|right|bottom|top/g, function (matched) {
637
- return hash$1[matched];
638
- });
639
- }
640
-
641
- var hash = {
642
- start: 'end',
643
- end: 'start'
644
- };
645
- function getOppositeVariationPlacement(placement) {
646
- return placement.replace(/start|end/g, function (matched) {
647
- return hash[matched];
648
- });
649
- }
650
-
651
- function getWindowScroll(node) {
652
- var win = getWindow(node);
653
- var scrollLeft = win.pageXOffset;
654
- var scrollTop = win.pageYOffset;
655
- return {
656
- scrollLeft: scrollLeft,
657
- scrollTop: scrollTop
658
- };
659
- }
660
-
661
- function getWindowScrollBarX(element) {
662
- // If <html> has a CSS width greater than the viewport, then this will be
663
- // incorrect for RTL.
664
- // Popper 1 is broken in this case and never had a bug report so let's assume
665
- // it's not an issue. I don't think anyone ever specifies width on <html>
666
- // anyway.
667
- // Browsers where the left scrollbar doesn't cause an issue report `0` for
668
- // this (e.g. Edge 2019, IE11, Safari)
669
- return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
670
- }
671
-
672
- function getViewportRect(element) {
673
- var win = getWindow(element);
674
- var html = getDocumentElement(element);
675
- var visualViewport = win.visualViewport;
676
- var width = html.clientWidth;
677
- var height = html.clientHeight;
678
- var x = 0;
679
- var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
680
- // can be obscured underneath it.
681
- // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
682
- // if it isn't open, so if this isn't available, the popper will be detected
683
- // to overflow the bottom of the screen too early.
684
-
685
- if (visualViewport) {
686
- width = visualViewport.width;
687
- height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
688
- // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
689
- // errors due to floating point numbers, so we need to check precision.
690
- // Safari returns a number <= 0, usually < -1 when pinch-zoomed
691
- // Feature detection fails in mobile emulation mode in Chrome.
692
- // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
693
- // 0.001
694
- // Fallback here: "Not Safari" userAgent
695
-
696
- if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
697
- x = visualViewport.offsetLeft;
698
- y = visualViewport.offsetTop;
699
- }
700
- }
701
-
702
- return {
703
- width: width,
704
- height: height,
705
- x: x + getWindowScrollBarX(element),
706
- y: y
707
- };
708
- }
709
-
710
- // of the `<html>` and `<body>` rect bounds if horizontally scrollable
711
-
712
- function getDocumentRect(element) {
713
- var _element$ownerDocumen;
714
-
715
- var html = getDocumentElement(element);
716
- var winScroll = getWindowScroll(element);
717
- var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
718
- var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
719
- var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
720
- var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
721
- var y = -winScroll.scrollTop;
722
-
723
- if (getComputedStyle(body || html).direction === 'rtl') {
724
- x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
725
- }
726
-
727
- return {
728
- width: width,
729
- height: height,
730
- x: x,
731
- y: y
732
- };
733
- }
734
-
735
- function isScrollParent(element) {
736
- // Firefox wants us to check `-x` and `-y` variations as well
737
- var _getComputedStyle = getComputedStyle(element),
738
- overflow = _getComputedStyle.overflow,
739
- overflowX = _getComputedStyle.overflowX,
740
- overflowY = _getComputedStyle.overflowY;
741
-
742
- return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
743
- }
744
-
745
- function getScrollParent(node) {
746
- if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
747
- // $FlowFixMe[incompatible-return]: assume body is always available
748
- return node.ownerDocument.body;
749
- }
750
-
751
- if (isHTMLElement(node) && isScrollParent(node)) {
752
- return node;
753
- }
754
-
755
- return getScrollParent(getParentNode(node));
756
- }
757
-
758
- /*
759
- given a DOM element, return the list of all scroll parents, up the list of ancesors
760
- until we get to the top window object. This list is what we attach scroll listeners
761
- to, because if any of these parent elements scroll, we'll need to re-calculate the
762
- reference element's position.
763
- */
764
-
765
- function listScrollParents(element, list) {
766
- var _element$ownerDocumen;
767
-
768
- if (list === void 0) {
769
- list = [];
770
- }
771
-
772
- var scrollParent = getScrollParent(element);
773
- var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
774
- var win = getWindow(scrollParent);
775
- var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
776
- var updatedList = list.concat(target);
777
- return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
778
- updatedList.concat(listScrollParents(getParentNode(target)));
779
- }
780
-
781
- function rectToClientRect(rect) {
782
- return Object.assign({}, rect, {
783
- left: rect.x,
784
- top: rect.y,
785
- right: rect.x + rect.width,
786
- bottom: rect.y + rect.height
787
- });
788
- }
789
-
790
- function getInnerBoundingClientRect(element) {
791
- var rect = getBoundingClientRect(element);
792
- rect.top = rect.top + element.clientTop;
793
- rect.left = rect.left + element.clientLeft;
794
- rect.bottom = rect.top + element.clientHeight;
795
- rect.right = rect.left + element.clientWidth;
796
- rect.width = element.clientWidth;
797
- rect.height = element.clientHeight;
798
- rect.x = rect.left;
799
- rect.y = rect.top;
800
- return rect;
801
- }
802
-
803
- function getClientRectFromMixedType(element, clippingParent) {
804
- return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
805
- } // A "clipping parent" is an overflowable container with the characteristic of
806
- // clipping (or hiding) overflowing elements with a position different from
807
- // `initial`
808
-
809
-
810
- function getClippingParents(element) {
811
- var clippingParents = listScrollParents(getParentNode(element));
812
- var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
813
- var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
814
-
815
- if (!isElement(clipperElement)) {
816
- return [];
817
- } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
818
-
819
-
820
- return clippingParents.filter(function (clippingParent) {
821
- return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
822
- });
823
- } // Gets the maximum area that the element is visible in due to any number of
824
- // clipping parents
825
-
826
-
827
- function getClippingRect(element, boundary, rootBoundary) {
828
- var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
829
- var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
830
- var firstClippingParent = clippingParents[0];
831
- var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
832
- var rect = getClientRectFromMixedType(element, clippingParent);
833
- accRect.top = max(rect.top, accRect.top);
834
- accRect.right = min(rect.right, accRect.right);
835
- accRect.bottom = min(rect.bottom, accRect.bottom);
836
- accRect.left = max(rect.left, accRect.left);
837
- return accRect;
838
- }, getClientRectFromMixedType(element, firstClippingParent));
839
- clippingRect.width = clippingRect.right - clippingRect.left;
840
- clippingRect.height = clippingRect.bottom - clippingRect.top;
841
- clippingRect.x = clippingRect.left;
842
- clippingRect.y = clippingRect.top;
843
- return clippingRect;
844
- }
845
-
846
- function getVariation(placement) {
847
- return placement.split('-')[1];
848
- }
849
-
850
- function computeOffsets(_ref) {
851
- var reference = _ref.reference,
852
- element = _ref.element,
853
- placement = _ref.placement;
854
- var basePlacement = placement ? getBasePlacement(placement) : null;
855
- var variation = placement ? getVariation(placement) : null;
856
- var commonX = reference.x + reference.width / 2 - element.width / 2;
857
- var commonY = reference.y + reference.height / 2 - element.height / 2;
858
- var offsets;
859
-
860
- switch (basePlacement) {
861
- case top:
862
- offsets = {
863
- x: commonX,
864
- y: reference.y - element.height
865
- };
866
- break;
867
-
868
- case bottom:
869
- offsets = {
870
- x: commonX,
871
- y: reference.y + reference.height
872
- };
873
- break;
874
-
875
- case right:
876
- offsets = {
877
- x: reference.x + reference.width,
878
- y: commonY
879
- };
880
- break;
881
-
882
- case left:
883
- offsets = {
884
- x: reference.x - element.width,
885
- y: commonY
886
- };
887
- break;
888
-
889
- default:
890
- offsets = {
891
- x: reference.x,
892
- y: reference.y
893
- };
894
- }
895
-
896
- var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
897
-
898
- if (mainAxis != null) {
899
- var len = mainAxis === 'y' ? 'height' : 'width';
900
-
901
- switch (variation) {
902
- case start:
903
- offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
904
- break;
905
-
906
- case end:
907
- offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
908
- break;
909
- }
910
- }
911
-
912
- return offsets;
913
- }
914
-
915
- function detectOverflow(state, options) {
916
- if (options === void 0) {
917
- options = {};
918
- }
919
-
920
- var _options = options,
921
- _options$placement = _options.placement,
922
- placement = _options$placement === void 0 ? state.placement : _options$placement,
923
- _options$boundary = _options.boundary,
924
- boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
925
- _options$rootBoundary = _options.rootBoundary,
926
- rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
927
- _options$elementConte = _options.elementContext,
928
- elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
929
- _options$altBoundary = _options.altBoundary,
930
- altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
931
- _options$padding = _options.padding,
932
- padding = _options$padding === void 0 ? 0 : _options$padding;
933
- var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
934
- var altContext = elementContext === popper ? reference : popper;
935
- var referenceElement = state.elements.reference;
936
- var popperRect = state.rects.popper;
937
- var element = state.elements[altBoundary ? altContext : elementContext];
938
- var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
939
- var referenceClientRect = getBoundingClientRect(referenceElement);
940
- var popperOffsets = computeOffsets({
941
- reference: referenceClientRect,
942
- element: popperRect,
943
- strategy: 'absolute',
944
- placement: placement
945
- });
946
- var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
947
- var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
948
- // 0 or negative = within the clipping rect
949
-
950
- var overflowOffsets = {
951
- top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
952
- bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
953
- left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
954
- right: elementClientRect.right - clippingClientRect.right + paddingObject.right
955
- };
956
- var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
957
-
958
- if (elementContext === popper && offsetData) {
959
- var offset = offsetData[placement];
960
- Object.keys(overflowOffsets).forEach(function (key) {
961
- var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
962
- var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
963
- overflowOffsets[key] += offset[axis] * multiply;
964
- });
965
- }
966
-
967
- return overflowOffsets;
968
- }
969
-
970
- function computeAutoPlacement(state, options) {
971
- if (options === void 0) {
972
- options = {};
973
- }
974
-
975
- var _options = options,
976
- placement = _options.placement,
977
- boundary = _options.boundary,
978
- rootBoundary = _options.rootBoundary,
979
- padding = _options.padding,
980
- flipVariations = _options.flipVariations,
981
- _options$allowedAutoP = _options.allowedAutoPlacements,
982
- allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
983
- var variation = getVariation(placement);
984
- var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
985
- return getVariation(placement) === variation;
986
- }) : basePlacements;
987
- var allowedPlacements = placements$1.filter(function (placement) {
988
- return allowedAutoPlacements.indexOf(placement) >= 0;
989
- });
990
-
991
- if (allowedPlacements.length === 0) {
992
- allowedPlacements = placements$1;
993
- } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
994
-
995
-
996
- var overflows = allowedPlacements.reduce(function (acc, placement) {
997
- acc[placement] = detectOverflow(state, {
998
- placement: placement,
999
- boundary: boundary,
1000
- rootBoundary: rootBoundary,
1001
- padding: padding
1002
- })[getBasePlacement(placement)];
1003
- return acc;
1004
- }, {});
1005
- return Object.keys(overflows).sort(function (a, b) {
1006
- return overflows[a] - overflows[b];
1007
- });
1008
- }
1009
-
1010
- function getExpandedFallbackPlacements(placement) {
1011
- if (getBasePlacement(placement) === auto) {
1012
- return [];
1013
- }
1014
-
1015
- var oppositePlacement = getOppositePlacement(placement);
1016
- return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1017
- }
1018
-
1019
- function flip(_ref) {
1020
- var state = _ref.state,
1021
- options = _ref.options,
1022
- name = _ref.name;
1023
-
1024
- if (state.modifiersData[name]._skip) {
1025
- return;
1026
- }
1027
-
1028
- var _options$mainAxis = options.mainAxis,
1029
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1030
- _options$altAxis = options.altAxis,
1031
- checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1032
- specifiedFallbackPlacements = options.fallbackPlacements,
1033
- padding = options.padding,
1034
- boundary = options.boundary,
1035
- rootBoundary = options.rootBoundary,
1036
- altBoundary = options.altBoundary,
1037
- _options$flipVariatio = options.flipVariations,
1038
- flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1039
- allowedAutoPlacements = options.allowedAutoPlacements;
1040
- var preferredPlacement = state.options.placement;
1041
- var basePlacement = getBasePlacement(preferredPlacement);
1042
- var isBasePlacement = basePlacement === preferredPlacement;
1043
- var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1044
- var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1045
- return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1046
- placement: placement,
1047
- boundary: boundary,
1048
- rootBoundary: rootBoundary,
1049
- padding: padding,
1050
- flipVariations: flipVariations,
1051
- allowedAutoPlacements: allowedAutoPlacements
1052
- }) : placement);
1053
- }, []);
1054
- var referenceRect = state.rects.reference;
1055
- var popperRect = state.rects.popper;
1056
- var checksMap = new Map();
1057
- var makeFallbackChecks = true;
1058
- var firstFittingPlacement = placements[0];
1059
-
1060
- for (var i = 0; i < placements.length; i++) {
1061
- var placement = placements[i];
1062
-
1063
- var _basePlacement = getBasePlacement(placement);
1064
-
1065
- var isStartVariation = getVariation(placement) === start;
1066
- var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1067
- var len = isVertical ? 'width' : 'height';
1068
- var overflow = detectOverflow(state, {
1069
- placement: placement,
1070
- boundary: boundary,
1071
- rootBoundary: rootBoundary,
1072
- altBoundary: altBoundary,
1073
- padding: padding
1074
- });
1075
- var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1076
-
1077
- if (referenceRect[len] > popperRect[len]) {
1078
- mainVariationSide = getOppositePlacement(mainVariationSide);
1079
- }
1080
-
1081
- var altVariationSide = getOppositePlacement(mainVariationSide);
1082
- var checks = [];
1083
-
1084
- if (checkMainAxis) {
1085
- checks.push(overflow[_basePlacement] <= 0);
1086
- }
1087
-
1088
- if (checkAltAxis) {
1089
- checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1090
- }
1091
-
1092
- if (checks.every(function (check) {
1093
- return check;
1094
- })) {
1095
- firstFittingPlacement = placement;
1096
- makeFallbackChecks = false;
1097
- break;
1098
- }
1099
-
1100
- checksMap.set(placement, checks);
1101
- }
1102
-
1103
- if (makeFallbackChecks) {
1104
- // `2` may be desired in some cases – research later
1105
- var numberOfChecks = flipVariations ? 3 : 1;
1106
-
1107
- var _loop = function _loop(_i) {
1108
- var fittingPlacement = placements.find(function (placement) {
1109
- var checks = checksMap.get(placement);
1110
-
1111
- if (checks) {
1112
- return checks.slice(0, _i).every(function (check) {
1113
- return check;
1114
- });
1115
- }
1116
- });
1117
-
1118
- if (fittingPlacement) {
1119
- firstFittingPlacement = fittingPlacement;
1120
- return "break";
1121
- }
1122
- };
1123
-
1124
- for (var _i = numberOfChecks; _i > 0; _i--) {
1125
- var _ret = _loop(_i);
1126
-
1127
- if (_ret === "break") break;
1128
- }
1129
- }
1130
-
1131
- if (state.placement !== firstFittingPlacement) {
1132
- state.modifiersData[name]._skip = true;
1133
- state.placement = firstFittingPlacement;
1134
- state.reset = true;
1135
- }
1136
- } // eslint-disable-next-line import/no-unused-modules
1137
-
1138
-
1139
- const flip$1 = {
1140
- name: 'flip',
1141
- enabled: true,
1142
- phase: 'main',
1143
- fn: flip,
1144
- requiresIfExists: ['offset'],
1145
- data: {
1146
- _skip: false
1147
- }
1148
- };
1149
-
1150
- function getSideOffsets(overflow, rect, preventedOffsets) {
1151
- if (preventedOffsets === void 0) {
1152
- preventedOffsets = {
1153
- x: 0,
1154
- y: 0
1155
- };
1156
- }
1157
-
1158
- return {
1159
- top: overflow.top - rect.height - preventedOffsets.y,
1160
- right: overflow.right - rect.width + preventedOffsets.x,
1161
- bottom: overflow.bottom - rect.height + preventedOffsets.y,
1162
- left: overflow.left - rect.width - preventedOffsets.x
1163
- };
1164
- }
1165
-
1166
- function isAnySideFullyClipped(overflow) {
1167
- return [top, right, bottom, left].some(function (side) {
1168
- return overflow[side] >= 0;
1169
- });
1170
- }
1171
-
1172
- function hide(_ref) {
1173
- var state = _ref.state,
1174
- name = _ref.name;
1175
- var referenceRect = state.rects.reference;
1176
- var popperRect = state.rects.popper;
1177
- var preventedOffsets = state.modifiersData.preventOverflow;
1178
- var referenceOverflow = detectOverflow(state, {
1179
- elementContext: 'reference'
1180
- });
1181
- var popperAltOverflow = detectOverflow(state, {
1182
- altBoundary: true
1183
- });
1184
- var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1185
- var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1186
- var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1187
- var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1188
- state.modifiersData[name] = {
1189
- referenceClippingOffsets: referenceClippingOffsets,
1190
- popperEscapeOffsets: popperEscapeOffsets,
1191
- isReferenceHidden: isReferenceHidden,
1192
- hasPopperEscaped: hasPopperEscaped
1193
- };
1194
- state.attributes.popper = Object.assign({}, state.attributes.popper, {
1195
- 'data-popper-reference-hidden': isReferenceHidden,
1196
- 'data-popper-escaped': hasPopperEscaped
1197
- });
1198
- } // eslint-disable-next-line import/no-unused-modules
1199
-
1200
-
1201
- const hide$1 = {
1202
- name: 'hide',
1203
- enabled: true,
1204
- phase: 'main',
1205
- requiresIfExists: ['preventOverflow'],
1206
- fn: hide
1207
- };
1208
-
1209
- function distanceAndSkiddingToXY(placement, rects, offset) {
1210
- var basePlacement = getBasePlacement(placement);
1211
- var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1212
-
1213
- var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1214
- placement: placement
1215
- })) : offset,
1216
- skidding = _ref[0],
1217
- distance = _ref[1];
1218
-
1219
- skidding = skidding || 0;
1220
- distance = (distance || 0) * invertDistance;
1221
- return [left, right].indexOf(basePlacement) >= 0 ? {
1222
- x: distance,
1223
- y: skidding
1224
- } : {
1225
- x: skidding,
1226
- y: distance
1227
- };
1228
- }
1229
-
1230
- function offset(_ref2) {
1231
- var state = _ref2.state,
1232
- options = _ref2.options,
1233
- name = _ref2.name;
1234
- var _options$offset = options.offset,
1235
- offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1236
- var data = placements.reduce(function (acc, placement) {
1237
- acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1238
- return acc;
1239
- }, {});
1240
- var _data$state$placement = data[state.placement],
1241
- x = _data$state$placement.x,
1242
- y = _data$state$placement.y;
1243
-
1244
- if (state.modifiersData.popperOffsets != null) {
1245
- state.modifiersData.popperOffsets.x += x;
1246
- state.modifiersData.popperOffsets.y += y;
1247
- }
1248
-
1249
- state.modifiersData[name] = data;
1250
- } // eslint-disable-next-line import/no-unused-modules
1251
-
1252
-
1253
- const offset$1 = {
1254
- name: 'offset',
1255
- enabled: true,
1256
- phase: 'main',
1257
- requires: ['popperOffsets'],
1258
- fn: offset
1259
- };
1260
-
1261
- function popperOffsets(_ref) {
1262
- var state = _ref.state,
1263
- name = _ref.name;
1264
- // Offsets are the actual position the popper needs to have to be
1265
- // properly positioned near its reference element
1266
- // This is the most basic placement, and will be adjusted by
1267
- // the modifiers in the next step
1268
- state.modifiersData[name] = computeOffsets({
1269
- reference: state.rects.reference,
1270
- element: state.rects.popper,
1271
- strategy: 'absolute',
1272
- placement: state.placement
1273
- });
1274
- } // eslint-disable-next-line import/no-unused-modules
1275
-
1276
-
1277
- const popperOffsets$1 = {
1278
- name: 'popperOffsets',
1279
- enabled: true,
1280
- phase: 'read',
1281
- fn: popperOffsets,
1282
- data: {}
1283
- };
1284
-
1285
- function getAltAxis(axis) {
1286
- return axis === 'x' ? 'y' : 'x';
1287
- }
1288
-
1289
- function preventOverflow(_ref) {
1290
- var state = _ref.state,
1291
- options = _ref.options,
1292
- name = _ref.name;
1293
- var _options$mainAxis = options.mainAxis,
1294
- checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1295
- _options$altAxis = options.altAxis,
1296
- checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1297
- boundary = options.boundary,
1298
- rootBoundary = options.rootBoundary,
1299
- altBoundary = options.altBoundary,
1300
- padding = options.padding,
1301
- _options$tether = options.tether,
1302
- tether = _options$tether === void 0 ? true : _options$tether,
1303
- _options$tetherOffset = options.tetherOffset,
1304
- tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1305
- var overflow = detectOverflow(state, {
1306
- boundary: boundary,
1307
- rootBoundary: rootBoundary,
1308
- padding: padding,
1309
- altBoundary: altBoundary
1310
- });
1311
- var basePlacement = getBasePlacement(state.placement);
1312
- var variation = getVariation(state.placement);
1313
- var isBasePlacement = !variation;
1314
- var mainAxis = getMainAxisFromPlacement(basePlacement);
1315
- var altAxis = getAltAxis(mainAxis);
1316
- var popperOffsets = state.modifiersData.popperOffsets;
1317
- var referenceRect = state.rects.reference;
1318
- var popperRect = state.rects.popper;
1319
- var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1320
- placement: state.placement
1321
- })) : tetherOffset;
1322
- var data = {
1323
- x: 0,
1324
- y: 0
1325
- };
1326
-
1327
- if (!popperOffsets) {
1328
- return;
1329
- }
1330
-
1331
- if (checkMainAxis || checkAltAxis) {
1332
- var mainSide = mainAxis === 'y' ? top : left;
1333
- var altSide = mainAxis === 'y' ? bottom : right;
1334
- var len = mainAxis === 'y' ? 'height' : 'width';
1335
- var offset = popperOffsets[mainAxis];
1336
- var min$1 = popperOffsets[mainAxis] + overflow[mainSide];
1337
- var max$1 = popperOffsets[mainAxis] - overflow[altSide];
1338
- var additive = tether ? -popperRect[len] / 2 : 0;
1339
- var minLen = variation === start ? referenceRect[len] : popperRect[len];
1340
- var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1341
- // outside the reference bounds
1342
-
1343
- var arrowElement = state.elements.arrow;
1344
- var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1345
- width: 0,
1346
- height: 0
1347
- };
1348
- var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1349
- var arrowPaddingMin = arrowPaddingObject[mainSide];
1350
- var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1351
- // to include its full size in the calculation. If the reference is small
1352
- // and near the edge of a boundary, the popper can overflow even if the
1353
- // reference is not overflowing as well (e.g. virtual elements with no
1354
- // width or height)
1355
-
1356
- var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1357
- var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;
1358
- var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;
1359
- var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1360
- var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1361
- var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;
1362
- var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;
1363
- var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;
1364
-
1365
- if (checkMainAxis) {
1366
- var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1367
- popperOffsets[mainAxis] = preventedOffset;
1368
- data[mainAxis] = preventedOffset - offset;
1369
- }
1370
-
1371
- if (checkAltAxis) {
1372
- var _mainSide = mainAxis === 'x' ? top : left;
1373
-
1374
- var _altSide = mainAxis === 'x' ? bottom : right;
1375
-
1376
- var _offset = popperOffsets[altAxis];
1377
-
1378
- var _min = _offset + overflow[_mainSide];
1379
-
1380
- var _max = _offset - overflow[_altSide];
1381
-
1382
- var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max);
1383
-
1384
- popperOffsets[altAxis] = _preventedOffset;
1385
- data[altAxis] = _preventedOffset - _offset;
1386
- }
1387
- }
1388
-
1389
- state.modifiersData[name] = data;
1390
- } // eslint-disable-next-line import/no-unused-modules
1391
-
1392
-
1393
- const preventOverflow$1 = {
1394
- name: 'preventOverflow',
1395
- enabled: true,
1396
- phase: 'main',
1397
- fn: preventOverflow,
1398
- requiresIfExists: ['offset']
1399
- };
1400
-
1401
- function getHTMLElementScroll(element) {
1402
- return {
1403
- scrollLeft: element.scrollLeft,
1404
- scrollTop: element.scrollTop
1405
- };
1406
- }
1407
-
1408
- function getNodeScroll(node) {
1409
- if (node === getWindow(node) || !isHTMLElement(node)) {
1410
- return getWindowScroll(node);
1411
- } else {
1412
- return getHTMLElementScroll(node);
1413
- }
1414
- }
1415
-
1416
- function isElementScaled(element) {
1417
- var rect = element.getBoundingClientRect();
1418
- var scaleX = rect.width / element.offsetWidth || 1;
1419
- var scaleY = rect.height / element.offsetHeight || 1;
1420
- return scaleX !== 1 || scaleY !== 1;
1421
- } // Returns the composite rect of an element relative to its offsetParent.
1422
- // Composite means it takes into account transforms as well as layout.
1423
-
1424
-
1425
- function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1426
- if (isFixed === void 0) {
1427
- isFixed = false;
1428
- }
1429
-
1430
- var isOffsetParentAnElement = isHTMLElement(offsetParent);
1431
- var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1432
- var documentElement = getDocumentElement(offsetParent);
1433
- var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1434
- var scroll = {
1435
- scrollLeft: 0,
1436
- scrollTop: 0
1437
- };
1438
- var offsets = {
1439
- x: 0,
1440
- y: 0
1441
- };
1442
-
1443
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1444
- if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1445
- isScrollParent(documentElement)) {
1446
- scroll = getNodeScroll(offsetParent);
1447
- }
1448
-
1449
- if (isHTMLElement(offsetParent)) {
1450
- offsets = getBoundingClientRect(offsetParent, true);
1451
- offsets.x += offsetParent.clientLeft;
1452
- offsets.y += offsetParent.clientTop;
1453
- } else if (documentElement) {
1454
- offsets.x = getWindowScrollBarX(documentElement);
1455
- }
1456
- }
1457
-
1458
- return {
1459
- x: rect.left + scroll.scrollLeft - offsets.x,
1460
- y: rect.top + scroll.scrollTop - offsets.y,
1461
- width: rect.width,
1462
- height: rect.height
1463
- };
1464
- }
1465
-
1466
- function order(modifiers) {
1467
- var map = new Map();
1468
- var visited = new Set();
1469
- var result = [];
1470
- modifiers.forEach(function (modifier) {
1471
- map.set(modifier.name, modifier);
1472
- }); // On visiting object, check for its dependencies and visit them recursively
1473
-
1474
- function sort(modifier) {
1475
- visited.add(modifier.name);
1476
- var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1477
- requires.forEach(function (dep) {
1478
- if (!visited.has(dep)) {
1479
- var depModifier = map.get(dep);
1480
-
1481
- if (depModifier) {
1482
- sort(depModifier);
1483
- }
1484
- }
1485
- });
1486
- result.push(modifier);
1487
- }
1488
-
1489
- modifiers.forEach(function (modifier) {
1490
- if (!visited.has(modifier.name)) {
1491
- // check for visited object
1492
- sort(modifier);
1493
- }
1494
- });
1495
- return result;
1496
- }
1497
-
1498
- function orderModifiers(modifiers) {
1499
- // order based on dependencies
1500
- var orderedModifiers = order(modifiers); // order based on phase
1501
-
1502
- return modifierPhases.reduce(function (acc, phase) {
1503
- return acc.concat(orderedModifiers.filter(function (modifier) {
1504
- return modifier.phase === phase;
1505
- }));
1506
- }, []);
1507
- }
1508
-
1509
- function debounce(fn) {
1510
- var pending;
1511
- return function () {
1512
- if (!pending) {
1513
- pending = new Promise(function (resolve) {
1514
- Promise.resolve().then(function () {
1515
- pending = undefined;
1516
- resolve(fn());
1517
- });
1518
- });
1519
- }
1520
-
1521
- return pending;
1522
- };
1523
- }
1524
-
1525
- function mergeByName(modifiers) {
1526
- var merged = modifiers.reduce(function (merged, current) {
1527
- var existing = merged[current.name];
1528
- merged[current.name] = existing ? Object.assign({}, existing, current, {
1529
- options: Object.assign({}, existing.options, current.options),
1530
- data: Object.assign({}, existing.data, current.data)
1531
- }) : current;
1532
- return merged;
1533
- }, {}); // IE11 does not support Object.values
1534
-
1535
- return Object.keys(merged).map(function (key) {
1536
- return merged[key];
1537
- });
1538
- }
1539
-
1540
- var DEFAULT_OPTIONS = {
1541
- placement: 'bottom',
1542
- modifiers: [],
1543
- strategy: 'absolute'
1544
- };
1545
-
1546
- function areValidElements() {
1547
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1548
- args[_key] = arguments[_key];
1549
- }
1550
-
1551
- return !args.some(function (element) {
1552
- return !(element && typeof element.getBoundingClientRect === 'function');
1553
- });
1554
- }
1555
-
1556
- function popperGenerator(generatorOptions) {
1557
- if (generatorOptions === void 0) {
1558
- generatorOptions = {};
1559
- }
1560
-
1561
- var _generatorOptions = generatorOptions,
1562
- _generatorOptions$def = _generatorOptions.defaultModifiers,
1563
- defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1564
- _generatorOptions$def2 = _generatorOptions.defaultOptions,
1565
- defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1566
- return function createPopper(reference, popper, options) {
1567
- if (options === void 0) {
1568
- options = defaultOptions;
1569
- }
1570
-
1571
- var state = {
1572
- placement: 'bottom',
1573
- orderedModifiers: [],
1574
- options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1575
- modifiersData: {},
1576
- elements: {
1577
- reference: reference,
1578
- popper: popper
1579
- },
1580
- attributes: {},
1581
- styles: {}
1582
- };
1583
- var effectCleanupFns = [];
1584
- var isDestroyed = false;
1585
- var instance = {
1586
- state: state,
1587
- setOptions: function setOptions(options) {
1588
- cleanupModifierEffects();
1589
- state.options = Object.assign({}, defaultOptions, state.options, options);
1590
- state.scrollParents = {
1591
- reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1592
- popper: listScrollParents(popper)
1593
- }; // Orders the modifiers based on their dependencies and `phase`
1594
- // properties
1595
-
1596
- var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1597
-
1598
- state.orderedModifiers = orderedModifiers.filter(function (m) {
1599
- return m.enabled;
1600
- }); // Validate the provided modifiers so that the consumer will get warned
1601
-
1602
- runModifierEffects();
1603
- return instance.update();
1604
- },
1605
- // Sync update – it will always be executed, even if not necessary. This
1606
- // is useful for low frequency updates where sync behavior simplifies the
1607
- // logic.
1608
- // For high frequency updates (e.g. `resize` and `scroll` events), always
1609
- // prefer the async Popper#update method
1610
- forceUpdate: function forceUpdate() {
1611
- if (isDestroyed) {
1612
- return;
1613
- }
1614
-
1615
- var _state$elements = state.elements,
1616
- reference = _state$elements.reference,
1617
- popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1618
- // anymore
1619
-
1620
- if (!areValidElements(reference, popper)) {
1621
-
1622
- return;
1623
- } // Store the reference and popper rects to be read by modifiers
1624
-
1625
-
1626
- state.rects = {
1627
- reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1628
- popper: getLayoutRect(popper)
1629
- }; // Modifiers have the ability to reset the current update cycle. The
1630
- // most common use case for this is the `flip` modifier changing the
1631
- // placement, which then needs to re-run all the modifiers, because the
1632
- // logic was previously ran for the previous placement and is therefore
1633
- // stale/incorrect
1634
-
1635
- state.reset = false;
1636
- state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1637
- // is filled with the initial data specified by the modifier. This means
1638
- // it doesn't persist and is fresh on each update.
1639
- // To ensure persistent data, use `${name}#persistent`
1640
-
1641
- state.orderedModifiers.forEach(function (modifier) {
1642
- return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1643
- });
1644
-
1645
- for (var index = 0; index < state.orderedModifiers.length; index++) {
1646
-
1647
- if (state.reset === true) {
1648
- state.reset = false;
1649
- index = -1;
1650
- continue;
1651
- }
1652
-
1653
- var _state$orderedModifie = state.orderedModifiers[index],
1654
- fn = _state$orderedModifie.fn,
1655
- _state$orderedModifie2 = _state$orderedModifie.options,
1656
- _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1657
- name = _state$orderedModifie.name;
1658
-
1659
- if (typeof fn === 'function') {
1660
- state = fn({
1661
- state: state,
1662
- options: _options,
1663
- name: name,
1664
- instance: instance
1665
- }) || state;
1666
- }
1667
- }
1668
- },
1669
- // Async and optimistically optimized update – it will not be executed if
1670
- // not necessary (debounced to run at most once-per-tick)
1671
- update: debounce(function () {
1672
- return new Promise(function (resolve) {
1673
- instance.forceUpdate();
1674
- resolve(state);
1675
- });
1676
- }),
1677
- destroy: function destroy() {
1678
- cleanupModifierEffects();
1679
- isDestroyed = true;
1680
- }
1681
- };
1682
-
1683
- if (!areValidElements(reference, popper)) {
1684
-
1685
- return instance;
1686
- }
1687
-
1688
- instance.setOptions(options).then(function (state) {
1689
- if (!isDestroyed && options.onFirstUpdate) {
1690
- options.onFirstUpdate(state);
1691
- }
1692
- }); // Modifiers have the ability to execute arbitrary code before the first
1693
- // update cycle runs. They will be executed in the same order as the update
1694
- // cycle. This is useful when a modifier adds some persistent data that
1695
- // other modifiers need to use, but the modifier is run after the dependent
1696
- // one.
1697
-
1698
- function runModifierEffects() {
1699
- state.orderedModifiers.forEach(function (_ref3) {
1700
- var name = _ref3.name,
1701
- _ref3$options = _ref3.options,
1702
- options = _ref3$options === void 0 ? {} : _ref3$options,
1703
- effect = _ref3.effect;
1704
-
1705
- if (typeof effect === 'function') {
1706
- var cleanupFn = effect({
1707
- state: state,
1708
- name: name,
1709
- instance: instance,
1710
- options: options
1711
- });
1712
-
1713
- var noopFn = function noopFn() {};
1714
-
1715
- effectCleanupFns.push(cleanupFn || noopFn);
1716
- }
1717
- });
1718
- }
1719
-
1720
- function cleanupModifierEffects() {
1721
- effectCleanupFns.forEach(function (fn) {
1722
- return fn();
1723
- });
1724
- effectCleanupFns = [];
1725
- }
1726
-
1727
- return instance;
1728
- };
1729
- }
1730
-
1731
- var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1732
- var createPopper = /*#__PURE__*/popperGenerator({
1733
- defaultModifiers: defaultModifiers
1734
- }); // eslint-disable-next-line import/no-unused-modules
6
+ const helpers = require('./helpers-6abce594.js');
7
+ const popper = require('./popper-6a290c40.js');
1735
8
 
1736
9
  const galacticMenuCss = "#menu{background-color:var(--wcs-gray);color:white;display:none;padding:var(--wcs-padding)}#menu[data-show]{display:block;z-index:9999}#menu[data-popper-placement^=top]>#arrow{bottom:-4px}#menu[data-popper-placement^=bottom]>#arrow{top:-4px}#menu[data-popper-placement^=left]>#arrow{right:-4px}#menu[data-popper-placement^=right]>#arrow{left:-4px}:host{display:flex;align-items:center;height:32px;padding-left:var(--wcs-padding);background-color:var(--wcs-gray-light)}#toggle-menu-icon{cursor:pointer;padding:0 var(--wcs-padding);user-select:none}#arrow,#arrow::before{position:absolute;width:8px;height:8px;background:inherit}#arrow{visibility:hidden}#arrow::before{visibility:visible;content:\"\";transform:rotate(45deg)}";
1737
10
 
@@ -1743,7 +16,7 @@ let Galactic = class {
1743
16
  componentDidLoad() {
1744
17
  this.menu = this.el.shadowRoot.getElementById('toggle-menu-icon');
1745
18
  this.tooltip = this.el.shadowRoot.getElementById('menu');
1746
- this.popper = createPopper(this.menu, this.tooltip, {
19
+ this.popper = popper.createPopper(this.menu, this.tooltip, {
1747
20
  placement: 'bottom-end',
1748
21
  modifiers: [
1749
22
  {