@3t-transform/threeteeui 0.0.13 → 0.0.15

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