@govbr-ds/webcomponents 2.0.0-next.41 → 2.0.0-next.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/br-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/br-breadcrumb.entry.cjs.js.map +1 -1
- package/dist/cjs/br-button.br-icon.entry.cjs.js.map +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js +22 -3
- package/dist/cjs/br-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/br-collapse.br-list.entry.cjs.js.map +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +2 -2
- package/dist/cjs/br-collapse_2.cjs.entry.js.map +1 -1
- package/dist/cjs/br-dropdown.cjs.entry.js +324 -10
- package/dist/cjs/br-dropdown.cjs.entry.js.map +1 -1
- package/dist/cjs/br-dropdown.entry.cjs.js.map +1 -1
- package/dist/cjs/br-footer.cjs.entry.js +1 -1
- package/dist/cjs/br-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/br-footer.entry.cjs.js.map +1 -1
- package/dist/cjs/br-item.cjs.entry.js +1 -1
- package/dist/cjs/br-item.cjs.entry.js.map +1 -1
- package/dist/cjs/br-item.entry.cjs.js.map +1 -1
- package/dist/cjs/br-scrim.cjs.entry.js +1 -1
- package/dist/cjs/br-scrim.cjs.entry.js.map +1 -1
- package/dist/cjs/br-scrim.entry.cjs.js.map +1 -1
- package/dist/cjs/br-tooltip.cjs.entry.js +2187 -0
- package/dist/cjs/br-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/br-tooltip.entry.cjs.js.map +1 -0
- package/dist/cjs/br-upload.cjs.entry.js +1 -1
- package/dist/cjs/index-DAOr34NM.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/button/button.js +2 -1
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +346 -9
- package/dist/collection/components/dropdown/dropdown.js.map +1 -1
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.js +40 -1
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/list/list.js +1 -1
- package/dist/collection/components/list/list.js.map +1 -1
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/step-item/step-item.js +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -0
- package/dist/collection/components/tooltip/tooltip.js +683 -0
- package/dist/collection/components/tooltip/tooltip.js.map +1 -0
- package/dist/collection/components/upload/upload.js +1 -1
- package/dist/collection/pages/components/tooltip/index.js +18 -0
- package/dist/collection/pages/scripts/menu.js +14 -1
- package/dist/collection/utils/floating-ui.js +119 -0
- package/dist/collection/utils/floating-ui.js.map +1 -0
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb.js +6 -6
- package/dist/components/br-button.js +3 -3
- package/dist/components/br-collapse.js +4 -4
- package/dist/components/br-dropdown.js +332 -25
- package/dist/components/br-dropdown.js.map +1 -1
- package/dist/components/br-footer-category.js +3 -3
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-social.js +2 -2
- package/dist/components/br-footer.js +1 -1
- package/dist/components/br-icon.js +4 -4
- package/dist/components/br-input.js +4 -4
- package/dist/components/br-item.js +4 -4
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-message.js +2 -2
- package/dist/components/br-scrim.js +1 -1
- package/dist/components/br-scrim.js.map +1 -1
- package/dist/components/br-select.js +5 -5
- package/dist/components/br-step-item.js +2 -2
- package/dist/components/br-tab-item.js +1 -1
- package/dist/components/br-tag.js +7 -7
- package/dist/components/br-tooltip.d.ts +11 -0
- package/dist/components/br-tooltip.js +2144 -0
- package/dist/components/br-tooltip.js.map +1 -0
- package/dist/components/br-upload.js +11 -11
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/{p-pq3SZemh.js → p-CIINlcIu.js} +3 -3
- package/dist/components/{p-brOPUYUL.js → p-DJtFpYiN.js} +3 -3
- package/dist/components/p-DJtFpYiN.js.map +1 -0
- package/dist/components/{p-DlMJ2wZW.js → p-DLL8l_-5.js} +7 -7
- package/dist/components/{p-DlMJ2wZW.js.map → p-DLL8l_-5.js.map} +1 -1
- package/dist/components/{p-BxU9TOn1.js → p-DuPFr2fm.js} +4 -4
- package/dist/components/{p-COPEUBKR.js → p-Dxc2AzjS.js} +6 -5
- package/dist/components/p-Dxc2AzjS.js.map +1 -0
- package/dist/components/{p-jx7aLpDh.js → p-vi3ehOfu.js} +40 -23
- package/dist/components/p-vi3ehOfu.js.map +1 -0
- package/dist/custom-docs/markdown-methods.js +2 -0
- package/dist/custom-docs/markdown-methods.js.map +1 -1
- package/dist/custom-elements.json +745 -76
- package/dist/esm/br-breadcrumb.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js.map +1 -1
- package/dist/esm/br-button.br-icon.entry.js.map +1 -1
- package/dist/esm/br-button_2.entry.js +22 -3
- package/dist/esm/br-button_2.entry.js.map +1 -1
- package/dist/esm/br-collapse.br-list.entry.js.map +1 -1
- package/dist/esm/br-collapse_2.entry.js +2 -2
- package/dist/esm/br-collapse_2.entry.js.map +1 -1
- package/dist/esm/br-dropdown.entry.js +324 -10
- package/dist/esm/br-dropdown.entry.js.map +1 -1
- package/dist/esm/br-footer.entry.js +1 -1
- package/dist/esm/br-footer.entry.js.map +1 -1
- package/dist/esm/br-item.entry.js +1 -1
- package/dist/esm/br-item.entry.js.map +1 -1
- package/dist/esm/br-scrim.entry.js +1 -1
- package/dist/esm/br-scrim.entry.js.map +1 -1
- package/dist/esm/br-tooltip.entry.js +2185 -0
- package/dist/esm/br-tooltip.entry.js.map +1 -0
- package/dist/esm/br-upload.entry.js +1 -1
- package/dist/esm/index-ClsF4De3.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +2558 -23
- package/dist/hydrate/index.mjs +2558 -23
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/dropdown/dropdown.d.ts +48 -1
- package/dist/types/components/icon/icon.d.ts +7 -0
- package/dist/types/components/tooltip/tooltip.d.ts +238 -0
- package/dist/types/components.d.ts +139 -0
- package/dist/types/utils/floating-ui.d.ts +78 -0
- package/dist/webcomponents/br-breadcrumb.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-button.br-icon.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-collapse.br-list.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-dropdown.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-footer.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-item.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-scrim.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-tooltip.entry.esm.js.map +1 -0
- package/dist/webcomponents/{p-c3267481.entry.js → p-3d5600cb.entry.js} +2 -2
- package/dist/webcomponents/p-3d5600cb.entry.js.map +1 -0
- package/dist/webcomponents/{p-713035b5.entry.js → p-5c638bff.entry.js} +4 -4
- package/dist/webcomponents/{p-713035b5.entry.js.map → p-5c638bff.entry.js.map} +1 -1
- package/dist/webcomponents/{p-5a36e6be.entry.js → p-83fd1103.entry.js} +2 -2
- package/dist/webcomponents/{p-ab251560.entry.js → p-8ac9dcff.entry.js} +329 -23
- package/dist/webcomponents/p-8ac9dcff.entry.js.map +1 -0
- package/dist/webcomponents/{p-dbfc2a44.entry.js → p-c25d500c.entry.js} +2 -2
- package/dist/webcomponents/p-c25d500c.entry.js.map +1 -0
- package/dist/webcomponents/{p-383a4240.entry.js → p-d01d51a9.entry.js} +27 -10
- package/dist/webcomponents/p-d01d51a9.entry.js.map +1 -0
- package/dist/webcomponents/{p-1cf7cc9c.entry.js → p-d1bc7827.entry.js} +2 -2
- package/dist/webcomponents/p-e15ccd94.entry.js +2098 -0
- package/dist/webcomponents/p-e15ccd94.entry.js.map +1 -0
- package/dist/webcomponents/{p-ad8edd59.entry.js → p-f3ab9e06.entry.js} +10 -10
- package/dist/webcomponents/webcomponents.esm.js +24 -10
- package/dist/webcomponents.html-custom-data.json +18 -2
- package/package.json +1 -1
- package/dist/components/p-COPEUBKR.js.map +0 -1
- package/dist/components/p-brOPUYUL.js.map +0 -1
- package/dist/components/p-jx7aLpDh.js.map +0 -1
- package/dist/webcomponents/p-383a4240.entry.js.map +0 -1
- package/dist/webcomponents/p-ab251560.entry.js.map +0 -1
- package/dist/webcomponents/p-c3267481.entry.js.map +0 -1
- package/dist/webcomponents/p-dbfc2a44.entry.js.map +0 -1
- /package/dist/components/{p-pq3SZemh.js.map → p-CIINlcIu.js.map} +0 -0
- /package/dist/components/{p-BxU9TOn1.js.map → p-DuPFr2fm.js.map} +0 -0
- /package/dist/webcomponents/{p-5a36e6be.entry.js.map → p-83fd1103.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-1cf7cc9c.entry.js.map → p-d1bc7827.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-ad8edd59.entry.js.map → p-f3ab9e06.entry.js.map} +0 -0
|
@@ -0,0 +1,2185 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído por SERPRO
|
|
3
|
+
* © https://serpro.gov.br/ - MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { r as registerInstance, c as createEvent, g as getElement, h, a as Host } from './index-ClsF4De3.js';
|
|
6
|
+
import { H as Helpers } from './helpers-BRKK5nMe.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Custom positioning reference element.
|
|
10
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
14
|
+
const min = Math.min;
|
|
15
|
+
const max = Math.max;
|
|
16
|
+
const round = Math.round;
|
|
17
|
+
const floor = Math.floor;
|
|
18
|
+
const createCoords = v => ({
|
|
19
|
+
x: v,
|
|
20
|
+
y: v
|
|
21
|
+
});
|
|
22
|
+
const oppositeSideMap = {
|
|
23
|
+
left: 'right',
|
|
24
|
+
right: 'left',
|
|
25
|
+
bottom: 'top',
|
|
26
|
+
top: 'bottom'
|
|
27
|
+
};
|
|
28
|
+
const oppositeAlignmentMap = {
|
|
29
|
+
start: 'end',
|
|
30
|
+
end: 'start'
|
|
31
|
+
};
|
|
32
|
+
function clamp(start, value, end) {
|
|
33
|
+
return max(start, min(value, end));
|
|
34
|
+
}
|
|
35
|
+
function evaluate(value, param) {
|
|
36
|
+
return typeof value === 'function' ? value(param) : value;
|
|
37
|
+
}
|
|
38
|
+
function getSide(placement) {
|
|
39
|
+
return placement.split('-')[0];
|
|
40
|
+
}
|
|
41
|
+
function getAlignment(placement) {
|
|
42
|
+
return placement.split('-')[1];
|
|
43
|
+
}
|
|
44
|
+
function getOppositeAxis(axis) {
|
|
45
|
+
return axis === 'x' ? 'y' : 'x';
|
|
46
|
+
}
|
|
47
|
+
function getAxisLength(axis) {
|
|
48
|
+
return axis === 'y' ? 'height' : 'width';
|
|
49
|
+
}
|
|
50
|
+
function getSideAxis(placement) {
|
|
51
|
+
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
52
|
+
}
|
|
53
|
+
function getAlignmentAxis(placement) {
|
|
54
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
55
|
+
}
|
|
56
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
57
|
+
if (rtl === void 0) {
|
|
58
|
+
rtl = false;
|
|
59
|
+
}
|
|
60
|
+
const alignment = getAlignment(placement);
|
|
61
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
62
|
+
const length = getAxisLength(alignmentAxis);
|
|
63
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
64
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
65
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
66
|
+
}
|
|
67
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
68
|
+
}
|
|
69
|
+
function getExpandedPlacements(placement) {
|
|
70
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
71
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
72
|
+
}
|
|
73
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
74
|
+
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
75
|
+
}
|
|
76
|
+
function getSideList(side, isStart, rtl) {
|
|
77
|
+
const lr = ['left', 'right'];
|
|
78
|
+
const rl = ['right', 'left'];
|
|
79
|
+
const tb = ['top', 'bottom'];
|
|
80
|
+
const bt = ['bottom', 'top'];
|
|
81
|
+
switch (side) {
|
|
82
|
+
case 'top':
|
|
83
|
+
case 'bottom':
|
|
84
|
+
if (rtl) return isStart ? rl : lr;
|
|
85
|
+
return isStart ? lr : rl;
|
|
86
|
+
case 'left':
|
|
87
|
+
case 'right':
|
|
88
|
+
return isStart ? tb : bt;
|
|
89
|
+
default:
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
94
|
+
const alignment = getAlignment(placement);
|
|
95
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
96
|
+
if (alignment) {
|
|
97
|
+
list = list.map(side => side + "-" + alignment);
|
|
98
|
+
if (flipAlignment) {
|
|
99
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return list;
|
|
103
|
+
}
|
|
104
|
+
function getOppositePlacement(placement) {
|
|
105
|
+
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
106
|
+
}
|
|
107
|
+
function expandPaddingObject(padding) {
|
|
108
|
+
return {
|
|
109
|
+
top: 0,
|
|
110
|
+
right: 0,
|
|
111
|
+
bottom: 0,
|
|
112
|
+
left: 0,
|
|
113
|
+
...padding
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function getPaddingObject(padding) {
|
|
117
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
118
|
+
top: padding,
|
|
119
|
+
right: padding,
|
|
120
|
+
bottom: padding,
|
|
121
|
+
left: padding
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function rectToClientRect(rect) {
|
|
125
|
+
const {
|
|
126
|
+
x,
|
|
127
|
+
y,
|
|
128
|
+
width,
|
|
129
|
+
height
|
|
130
|
+
} = rect;
|
|
131
|
+
return {
|
|
132
|
+
width,
|
|
133
|
+
height,
|
|
134
|
+
top: y,
|
|
135
|
+
left: x,
|
|
136
|
+
right: x + width,
|
|
137
|
+
bottom: y + height,
|
|
138
|
+
x,
|
|
139
|
+
y
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
144
|
+
let {
|
|
145
|
+
reference,
|
|
146
|
+
floating
|
|
147
|
+
} = _ref;
|
|
148
|
+
const sideAxis = getSideAxis(placement);
|
|
149
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
150
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
151
|
+
const side = getSide(placement);
|
|
152
|
+
const isVertical = sideAxis === 'y';
|
|
153
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
154
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
155
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
156
|
+
let coords;
|
|
157
|
+
switch (side) {
|
|
158
|
+
case 'top':
|
|
159
|
+
coords = {
|
|
160
|
+
x: commonX,
|
|
161
|
+
y: reference.y - floating.height
|
|
162
|
+
};
|
|
163
|
+
break;
|
|
164
|
+
case 'bottom':
|
|
165
|
+
coords = {
|
|
166
|
+
x: commonX,
|
|
167
|
+
y: reference.y + reference.height
|
|
168
|
+
};
|
|
169
|
+
break;
|
|
170
|
+
case 'right':
|
|
171
|
+
coords = {
|
|
172
|
+
x: reference.x + reference.width,
|
|
173
|
+
y: commonY
|
|
174
|
+
};
|
|
175
|
+
break;
|
|
176
|
+
case 'left':
|
|
177
|
+
coords = {
|
|
178
|
+
x: reference.x - floating.width,
|
|
179
|
+
y: commonY
|
|
180
|
+
};
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
coords = {
|
|
184
|
+
x: reference.x,
|
|
185
|
+
y: reference.y
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
switch (getAlignment(placement)) {
|
|
189
|
+
case 'start':
|
|
190
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
191
|
+
break;
|
|
192
|
+
case 'end':
|
|
193
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
return coords;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
201
|
+
* next to a given reference element.
|
|
202
|
+
*
|
|
203
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
204
|
+
* write one for the platform you are using Floating UI with.
|
|
205
|
+
*/
|
|
206
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
207
|
+
const {
|
|
208
|
+
placement = 'bottom',
|
|
209
|
+
strategy = 'absolute',
|
|
210
|
+
middleware = [],
|
|
211
|
+
platform
|
|
212
|
+
} = config;
|
|
213
|
+
const validMiddleware = middleware.filter(Boolean);
|
|
214
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
215
|
+
let rects = await platform.getElementRects({
|
|
216
|
+
reference,
|
|
217
|
+
floating,
|
|
218
|
+
strategy
|
|
219
|
+
});
|
|
220
|
+
let {
|
|
221
|
+
x,
|
|
222
|
+
y
|
|
223
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
224
|
+
let statefulPlacement = placement;
|
|
225
|
+
let middlewareData = {};
|
|
226
|
+
let resetCount = 0;
|
|
227
|
+
for (let i = 0; i < validMiddleware.length; i++) {
|
|
228
|
+
const {
|
|
229
|
+
name,
|
|
230
|
+
fn
|
|
231
|
+
} = validMiddleware[i];
|
|
232
|
+
const {
|
|
233
|
+
x: nextX,
|
|
234
|
+
y: nextY,
|
|
235
|
+
data,
|
|
236
|
+
reset
|
|
237
|
+
} = await fn({
|
|
238
|
+
x,
|
|
239
|
+
y,
|
|
240
|
+
initialPlacement: placement,
|
|
241
|
+
placement: statefulPlacement,
|
|
242
|
+
strategy,
|
|
243
|
+
middlewareData,
|
|
244
|
+
rects,
|
|
245
|
+
platform,
|
|
246
|
+
elements: {
|
|
247
|
+
reference,
|
|
248
|
+
floating
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
x = nextX != null ? nextX : x;
|
|
252
|
+
y = nextY != null ? nextY : y;
|
|
253
|
+
middlewareData = {
|
|
254
|
+
...middlewareData,
|
|
255
|
+
[name]: {
|
|
256
|
+
...middlewareData[name],
|
|
257
|
+
...data
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
if (reset && resetCount <= 50) {
|
|
261
|
+
resetCount++;
|
|
262
|
+
if (typeof reset === 'object') {
|
|
263
|
+
if (reset.placement) {
|
|
264
|
+
statefulPlacement = reset.placement;
|
|
265
|
+
}
|
|
266
|
+
if (reset.rects) {
|
|
267
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
268
|
+
reference,
|
|
269
|
+
floating,
|
|
270
|
+
strategy
|
|
271
|
+
}) : reset.rects;
|
|
272
|
+
}
|
|
273
|
+
({
|
|
274
|
+
x,
|
|
275
|
+
y
|
|
276
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
277
|
+
}
|
|
278
|
+
i = -1;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
x,
|
|
283
|
+
y,
|
|
284
|
+
placement: statefulPlacement,
|
|
285
|
+
strategy,
|
|
286
|
+
middlewareData
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
292
|
+
* element is overflowing a given clipping boundary on each side.
|
|
293
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
294
|
+
* - negative = how many pixels left before it will overflow
|
|
295
|
+
* - 0 = lies flush with the boundary
|
|
296
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
297
|
+
*/
|
|
298
|
+
async function detectOverflow(state, options) {
|
|
299
|
+
var _await$platform$isEle;
|
|
300
|
+
if (options === void 0) {
|
|
301
|
+
options = {};
|
|
302
|
+
}
|
|
303
|
+
const {
|
|
304
|
+
x,
|
|
305
|
+
y,
|
|
306
|
+
platform,
|
|
307
|
+
rects,
|
|
308
|
+
elements,
|
|
309
|
+
strategy
|
|
310
|
+
} = state;
|
|
311
|
+
const {
|
|
312
|
+
boundary = 'clippingAncestors',
|
|
313
|
+
rootBoundary = 'viewport',
|
|
314
|
+
elementContext = 'floating',
|
|
315
|
+
altBoundary = false,
|
|
316
|
+
padding = 0
|
|
317
|
+
} = evaluate(options, state);
|
|
318
|
+
const paddingObject = getPaddingObject(padding);
|
|
319
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
320
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
321
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
322
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
323
|
+
boundary,
|
|
324
|
+
rootBoundary,
|
|
325
|
+
strategy
|
|
326
|
+
}));
|
|
327
|
+
const rect = elementContext === 'floating' ? {
|
|
328
|
+
x,
|
|
329
|
+
y,
|
|
330
|
+
width: rects.floating.width,
|
|
331
|
+
height: rects.floating.height
|
|
332
|
+
} : rects.reference;
|
|
333
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
334
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
335
|
+
x: 1,
|
|
336
|
+
y: 1
|
|
337
|
+
} : {
|
|
338
|
+
x: 1,
|
|
339
|
+
y: 1
|
|
340
|
+
};
|
|
341
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
342
|
+
elements,
|
|
343
|
+
rect,
|
|
344
|
+
offsetParent,
|
|
345
|
+
strategy
|
|
346
|
+
}) : rect);
|
|
347
|
+
return {
|
|
348
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
349
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
350
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
351
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Provides data to position an inner element of the floating element so that it
|
|
357
|
+
* appears centered to the reference element.
|
|
358
|
+
* @see https://floating-ui.com/docs/arrow
|
|
359
|
+
*/
|
|
360
|
+
const arrow$1 = options => ({
|
|
361
|
+
name: 'arrow',
|
|
362
|
+
options,
|
|
363
|
+
async fn(state) {
|
|
364
|
+
const {
|
|
365
|
+
x,
|
|
366
|
+
y,
|
|
367
|
+
placement,
|
|
368
|
+
rects,
|
|
369
|
+
platform,
|
|
370
|
+
elements,
|
|
371
|
+
middlewareData
|
|
372
|
+
} = state;
|
|
373
|
+
// Since `element` is required, we don't Partial<> the type.
|
|
374
|
+
const {
|
|
375
|
+
element,
|
|
376
|
+
padding = 0
|
|
377
|
+
} = evaluate(options, state) || {};
|
|
378
|
+
if (element == null) {
|
|
379
|
+
return {};
|
|
380
|
+
}
|
|
381
|
+
const paddingObject = getPaddingObject(padding);
|
|
382
|
+
const coords = {
|
|
383
|
+
x,
|
|
384
|
+
y
|
|
385
|
+
};
|
|
386
|
+
const axis = getAlignmentAxis(placement);
|
|
387
|
+
const length = getAxisLength(axis);
|
|
388
|
+
const arrowDimensions = await platform.getDimensions(element);
|
|
389
|
+
const isYAxis = axis === 'y';
|
|
390
|
+
const minProp = isYAxis ? 'top' : 'left';
|
|
391
|
+
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
392
|
+
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
393
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
394
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
395
|
+
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
396
|
+
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
397
|
+
|
|
398
|
+
// DOM platform can return `window` as the `offsetParent`.
|
|
399
|
+
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
400
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
401
|
+
}
|
|
402
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
403
|
+
|
|
404
|
+
// If the padding is large enough that it causes the arrow to no longer be
|
|
405
|
+
// centered, modify the padding so that it is centered.
|
|
406
|
+
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
407
|
+
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
408
|
+
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
409
|
+
|
|
410
|
+
// Make sure the arrow doesn't overflow the floating element if the center
|
|
411
|
+
// point is outside the floating element's bounds.
|
|
412
|
+
const min$1 = minPadding;
|
|
413
|
+
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
414
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
415
|
+
const offset = clamp(min$1, center, max);
|
|
416
|
+
|
|
417
|
+
// If the reference is small enough that the arrow's padding causes it to
|
|
418
|
+
// to point to nothing for an aligned placement, adjust the offset of the
|
|
419
|
+
// floating element itself. To ensure `shift()` continues to take action,
|
|
420
|
+
// a single reset is performed when this is true.
|
|
421
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
422
|
+
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
423
|
+
return {
|
|
424
|
+
[axis]: coords[axis] + alignmentOffset,
|
|
425
|
+
data: {
|
|
426
|
+
[axis]: offset,
|
|
427
|
+
centerOffset: center - offset - alignmentOffset,
|
|
428
|
+
...(shouldAddOffset && {
|
|
429
|
+
alignmentOffset
|
|
430
|
+
})
|
|
431
|
+
},
|
|
432
|
+
reset: shouldAddOffset
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
439
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
440
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
441
|
+
* @see https://floating-ui.com/docs/flip
|
|
442
|
+
*/
|
|
443
|
+
const flip$1 = function (options) {
|
|
444
|
+
if (options === void 0) {
|
|
445
|
+
options = {};
|
|
446
|
+
}
|
|
447
|
+
return {
|
|
448
|
+
name: 'flip',
|
|
449
|
+
options,
|
|
450
|
+
async fn(state) {
|
|
451
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
452
|
+
const {
|
|
453
|
+
placement,
|
|
454
|
+
middlewareData,
|
|
455
|
+
rects,
|
|
456
|
+
initialPlacement,
|
|
457
|
+
platform,
|
|
458
|
+
elements
|
|
459
|
+
} = state;
|
|
460
|
+
const {
|
|
461
|
+
mainAxis: checkMainAxis = true,
|
|
462
|
+
crossAxis: checkCrossAxis = true,
|
|
463
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
464
|
+
fallbackStrategy = 'bestFit',
|
|
465
|
+
fallbackAxisSideDirection = 'none',
|
|
466
|
+
flipAlignment = true,
|
|
467
|
+
...detectOverflowOptions
|
|
468
|
+
} = evaluate(options, state);
|
|
469
|
+
|
|
470
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
471
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
472
|
+
// work.
|
|
473
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
474
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
475
|
+
return {};
|
|
476
|
+
}
|
|
477
|
+
const side = getSide(placement);
|
|
478
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
479
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
480
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
481
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
482
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
483
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
484
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
485
|
+
}
|
|
486
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
487
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
488
|
+
const overflows = [];
|
|
489
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
490
|
+
if (checkMainAxis) {
|
|
491
|
+
overflows.push(overflow[side]);
|
|
492
|
+
}
|
|
493
|
+
if (checkCrossAxis) {
|
|
494
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
495
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
496
|
+
}
|
|
497
|
+
overflowsData = [...overflowsData, {
|
|
498
|
+
placement,
|
|
499
|
+
overflows
|
|
500
|
+
}];
|
|
501
|
+
|
|
502
|
+
// One or more sides is overflowing.
|
|
503
|
+
if (!overflows.every(side => side <= 0)) {
|
|
504
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
505
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
506
|
+
const nextPlacement = placements[nextIndex];
|
|
507
|
+
if (nextPlacement) {
|
|
508
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
509
|
+
if (!ignoreCrossAxisOverflow ||
|
|
510
|
+
// We leave the current main axis only if every placement on that axis
|
|
511
|
+
// overflows the main axis.
|
|
512
|
+
overflowsData.every(d => d.overflows[0] > 0 && getSideAxis(d.placement) === initialSideAxis)) {
|
|
513
|
+
// Try next placement and re-run the lifecycle.
|
|
514
|
+
return {
|
|
515
|
+
data: {
|
|
516
|
+
index: nextIndex,
|
|
517
|
+
overflows: overflowsData
|
|
518
|
+
},
|
|
519
|
+
reset: {
|
|
520
|
+
placement: nextPlacement
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
527
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
528
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
529
|
+
|
|
530
|
+
// Otherwise fallback.
|
|
531
|
+
if (!resetPlacement) {
|
|
532
|
+
switch (fallbackStrategy) {
|
|
533
|
+
case 'bestFit':
|
|
534
|
+
{
|
|
535
|
+
var _overflowsData$filter2;
|
|
536
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
537
|
+
if (hasFallbackAxisSideDirection) {
|
|
538
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
539
|
+
return currentSideAxis === initialSideAxis ||
|
|
540
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
541
|
+
// reading directions favoring greater width.
|
|
542
|
+
currentSideAxis === 'y';
|
|
543
|
+
}
|
|
544
|
+
return true;
|
|
545
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
546
|
+
if (placement) {
|
|
547
|
+
resetPlacement = placement;
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
case 'initialPlacement':
|
|
552
|
+
resetPlacement = initialPlacement;
|
|
553
|
+
break;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
if (placement !== resetPlacement) {
|
|
557
|
+
return {
|
|
558
|
+
reset: {
|
|
559
|
+
placement: resetPlacement
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return {};
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
|
|
569
|
+
function getSideOffsets(overflow, rect) {
|
|
570
|
+
return {
|
|
571
|
+
top: overflow.top - rect.height,
|
|
572
|
+
right: overflow.right - rect.width,
|
|
573
|
+
bottom: overflow.bottom - rect.height,
|
|
574
|
+
left: overflow.left - rect.width
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
function isAnySideFullyClipped(overflow) {
|
|
578
|
+
return sides.some(side => overflow[side] >= 0);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
582
|
+
* when it is not in the same clipping context as the reference element.
|
|
583
|
+
* @see https://floating-ui.com/docs/hide
|
|
584
|
+
*/
|
|
585
|
+
const hide$1 = function (options) {
|
|
586
|
+
if (options === void 0) {
|
|
587
|
+
options = {};
|
|
588
|
+
}
|
|
589
|
+
return {
|
|
590
|
+
name: 'hide',
|
|
591
|
+
options,
|
|
592
|
+
async fn(state) {
|
|
593
|
+
const {
|
|
594
|
+
rects
|
|
595
|
+
} = state;
|
|
596
|
+
const {
|
|
597
|
+
strategy = 'referenceHidden',
|
|
598
|
+
...detectOverflowOptions
|
|
599
|
+
} = evaluate(options, state);
|
|
600
|
+
switch (strategy) {
|
|
601
|
+
case 'referenceHidden':
|
|
602
|
+
{
|
|
603
|
+
const overflow = await detectOverflow(state, {
|
|
604
|
+
...detectOverflowOptions,
|
|
605
|
+
elementContext: 'reference'
|
|
606
|
+
});
|
|
607
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
608
|
+
return {
|
|
609
|
+
data: {
|
|
610
|
+
referenceHiddenOffsets: offsets,
|
|
611
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
case 'escaped':
|
|
616
|
+
{
|
|
617
|
+
const overflow = await detectOverflow(state, {
|
|
618
|
+
...detectOverflowOptions,
|
|
619
|
+
altBoundary: true
|
|
620
|
+
});
|
|
621
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
622
|
+
return {
|
|
623
|
+
data: {
|
|
624
|
+
escapedOffsets: offsets,
|
|
625
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
default:
|
|
630
|
+
{
|
|
631
|
+
return {};
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
639
|
+
// Derivable.
|
|
640
|
+
|
|
641
|
+
async function convertValueToCoords(state, options) {
|
|
642
|
+
const {
|
|
643
|
+
placement,
|
|
644
|
+
platform,
|
|
645
|
+
elements
|
|
646
|
+
} = state;
|
|
647
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
648
|
+
const side = getSide(placement);
|
|
649
|
+
const alignment = getAlignment(placement);
|
|
650
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
651
|
+
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
652
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
653
|
+
const rawValue = evaluate(options, state);
|
|
654
|
+
|
|
655
|
+
// eslint-disable-next-line prefer-const
|
|
656
|
+
let {
|
|
657
|
+
mainAxis,
|
|
658
|
+
crossAxis,
|
|
659
|
+
alignmentAxis
|
|
660
|
+
} = typeof rawValue === 'number' ? {
|
|
661
|
+
mainAxis: rawValue,
|
|
662
|
+
crossAxis: 0,
|
|
663
|
+
alignmentAxis: null
|
|
664
|
+
} : {
|
|
665
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
666
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
667
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
668
|
+
};
|
|
669
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
670
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
671
|
+
}
|
|
672
|
+
return isVertical ? {
|
|
673
|
+
x: crossAxis * crossAxisMulti,
|
|
674
|
+
y: mainAxis * mainAxisMulti
|
|
675
|
+
} : {
|
|
676
|
+
x: mainAxis * mainAxisMulti,
|
|
677
|
+
y: crossAxis * crossAxisMulti
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Modifies the placement by translating the floating element along the
|
|
683
|
+
* specified axes.
|
|
684
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
685
|
+
* object may be passed.
|
|
686
|
+
* @see https://floating-ui.com/docs/offset
|
|
687
|
+
*/
|
|
688
|
+
const offset$1 = function (options) {
|
|
689
|
+
if (options === void 0) {
|
|
690
|
+
options = 0;
|
|
691
|
+
}
|
|
692
|
+
return {
|
|
693
|
+
name: 'offset',
|
|
694
|
+
options,
|
|
695
|
+
async fn(state) {
|
|
696
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
697
|
+
const {
|
|
698
|
+
x,
|
|
699
|
+
y,
|
|
700
|
+
placement,
|
|
701
|
+
middlewareData
|
|
702
|
+
} = state;
|
|
703
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
704
|
+
|
|
705
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
706
|
+
// then we don't need to change the positioning coordinates.
|
|
707
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
708
|
+
return {};
|
|
709
|
+
}
|
|
710
|
+
return {
|
|
711
|
+
x: x + diffCoords.x,
|
|
712
|
+
y: y + diffCoords.y,
|
|
713
|
+
data: {
|
|
714
|
+
...diffCoords,
|
|
715
|
+
placement
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
724
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
725
|
+
* @see https://floating-ui.com/docs/shift
|
|
726
|
+
*/
|
|
727
|
+
const shift$1 = function (options) {
|
|
728
|
+
if (options === void 0) {
|
|
729
|
+
options = {};
|
|
730
|
+
}
|
|
731
|
+
return {
|
|
732
|
+
name: 'shift',
|
|
733
|
+
options,
|
|
734
|
+
async fn(state) {
|
|
735
|
+
const {
|
|
736
|
+
x,
|
|
737
|
+
y,
|
|
738
|
+
placement
|
|
739
|
+
} = state;
|
|
740
|
+
const {
|
|
741
|
+
mainAxis: checkMainAxis = true,
|
|
742
|
+
crossAxis: checkCrossAxis = false,
|
|
743
|
+
limiter = {
|
|
744
|
+
fn: _ref => {
|
|
745
|
+
let {
|
|
746
|
+
x,
|
|
747
|
+
y
|
|
748
|
+
} = _ref;
|
|
749
|
+
return {
|
|
750
|
+
x,
|
|
751
|
+
y
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
...detectOverflowOptions
|
|
756
|
+
} = evaluate(options, state);
|
|
757
|
+
const coords = {
|
|
758
|
+
x,
|
|
759
|
+
y
|
|
760
|
+
};
|
|
761
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
762
|
+
const crossAxis = getSideAxis(getSide(placement));
|
|
763
|
+
const mainAxis = getOppositeAxis(crossAxis);
|
|
764
|
+
let mainAxisCoord = coords[mainAxis];
|
|
765
|
+
let crossAxisCoord = coords[crossAxis];
|
|
766
|
+
if (checkMainAxis) {
|
|
767
|
+
const minSide = mainAxis === 'y' ? 'top' : 'left';
|
|
768
|
+
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
769
|
+
const min = mainAxisCoord + overflow[minSide];
|
|
770
|
+
const max = mainAxisCoord - overflow[maxSide];
|
|
771
|
+
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
772
|
+
}
|
|
773
|
+
if (checkCrossAxis) {
|
|
774
|
+
const minSide = crossAxis === 'y' ? 'top' : 'left';
|
|
775
|
+
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
776
|
+
const min = crossAxisCoord + overflow[minSide];
|
|
777
|
+
const max = crossAxisCoord - overflow[maxSide];
|
|
778
|
+
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
779
|
+
}
|
|
780
|
+
const limitedCoords = limiter.fn({
|
|
781
|
+
...state,
|
|
782
|
+
[mainAxis]: mainAxisCoord,
|
|
783
|
+
[crossAxis]: crossAxisCoord
|
|
784
|
+
});
|
|
785
|
+
return {
|
|
786
|
+
...limitedCoords,
|
|
787
|
+
data: {
|
|
788
|
+
x: limitedCoords.x - x,
|
|
789
|
+
y: limitedCoords.y - y,
|
|
790
|
+
enabled: {
|
|
791
|
+
[mainAxis]: checkMainAxis,
|
|
792
|
+
[crossAxis]: checkCrossAxis
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
function hasWindow() {
|
|
801
|
+
return typeof window !== 'undefined';
|
|
802
|
+
}
|
|
803
|
+
function getNodeName(node) {
|
|
804
|
+
if (isNode(node)) {
|
|
805
|
+
return (node.nodeName || '').toLowerCase();
|
|
806
|
+
}
|
|
807
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
808
|
+
// returning `#document` an infinite loop won't occur.
|
|
809
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
810
|
+
return '#document';
|
|
811
|
+
}
|
|
812
|
+
function getWindow(node) {
|
|
813
|
+
var _node$ownerDocument;
|
|
814
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
815
|
+
}
|
|
816
|
+
function getDocumentElement(node) {
|
|
817
|
+
var _ref;
|
|
818
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
819
|
+
}
|
|
820
|
+
function isNode(value) {
|
|
821
|
+
if (!hasWindow()) {
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
825
|
+
}
|
|
826
|
+
function isElement(value) {
|
|
827
|
+
if (!hasWindow()) {
|
|
828
|
+
return false;
|
|
829
|
+
}
|
|
830
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
831
|
+
}
|
|
832
|
+
function isHTMLElement(value) {
|
|
833
|
+
if (!hasWindow()) {
|
|
834
|
+
return false;
|
|
835
|
+
}
|
|
836
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
837
|
+
}
|
|
838
|
+
function isShadowRoot(value) {
|
|
839
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
843
|
+
}
|
|
844
|
+
function isOverflowElement(element) {
|
|
845
|
+
const {
|
|
846
|
+
overflow,
|
|
847
|
+
overflowX,
|
|
848
|
+
overflowY,
|
|
849
|
+
display
|
|
850
|
+
} = getComputedStyle(element);
|
|
851
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
852
|
+
}
|
|
853
|
+
function isTableElement(element) {
|
|
854
|
+
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
855
|
+
}
|
|
856
|
+
function isTopLayer(element) {
|
|
857
|
+
return [':popover-open', ':modal'].some(selector => {
|
|
858
|
+
try {
|
|
859
|
+
return element.matches(selector);
|
|
860
|
+
} catch (e) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
function isContainingBlock(elementOrCss) {
|
|
866
|
+
const webkit = isWebKit();
|
|
867
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
868
|
+
|
|
869
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
870
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
871
|
+
return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
872
|
+
}
|
|
873
|
+
function getContainingBlock(element) {
|
|
874
|
+
let currentNode = getParentNode(element);
|
|
875
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
876
|
+
if (isContainingBlock(currentNode)) {
|
|
877
|
+
return currentNode;
|
|
878
|
+
} else if (isTopLayer(currentNode)) {
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
currentNode = getParentNode(currentNode);
|
|
882
|
+
}
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
function isWebKit() {
|
|
886
|
+
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
887
|
+
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
888
|
+
}
|
|
889
|
+
function isLastTraversableNode(node) {
|
|
890
|
+
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
891
|
+
}
|
|
892
|
+
function getComputedStyle(element) {
|
|
893
|
+
return getWindow(element).getComputedStyle(element);
|
|
894
|
+
}
|
|
895
|
+
function getNodeScroll(element) {
|
|
896
|
+
if (isElement(element)) {
|
|
897
|
+
return {
|
|
898
|
+
scrollLeft: element.scrollLeft,
|
|
899
|
+
scrollTop: element.scrollTop
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
return {
|
|
903
|
+
scrollLeft: element.scrollX,
|
|
904
|
+
scrollTop: element.scrollY
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
function getParentNode(node) {
|
|
908
|
+
if (getNodeName(node) === 'html') {
|
|
909
|
+
return node;
|
|
910
|
+
}
|
|
911
|
+
const result =
|
|
912
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
913
|
+
node.assignedSlot ||
|
|
914
|
+
// DOM Element detected.
|
|
915
|
+
node.parentNode ||
|
|
916
|
+
// ShadowRoot detected.
|
|
917
|
+
isShadowRoot(node) && node.host ||
|
|
918
|
+
// Fallback.
|
|
919
|
+
getDocumentElement(node);
|
|
920
|
+
return isShadowRoot(result) ? result.host : result;
|
|
921
|
+
}
|
|
922
|
+
function getNearestOverflowAncestor(node) {
|
|
923
|
+
const parentNode = getParentNode(node);
|
|
924
|
+
if (isLastTraversableNode(parentNode)) {
|
|
925
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
926
|
+
}
|
|
927
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
928
|
+
return parentNode;
|
|
929
|
+
}
|
|
930
|
+
return getNearestOverflowAncestor(parentNode);
|
|
931
|
+
}
|
|
932
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
933
|
+
var _node$ownerDocument2;
|
|
934
|
+
if (list === void 0) {
|
|
935
|
+
list = [];
|
|
936
|
+
}
|
|
937
|
+
if (traverseIframes === void 0) {
|
|
938
|
+
traverseIframes = true;
|
|
939
|
+
}
|
|
940
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
941
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
942
|
+
const win = getWindow(scrollableAncestor);
|
|
943
|
+
if (isBody) {
|
|
944
|
+
const frameElement = getFrameElement(win);
|
|
945
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
946
|
+
}
|
|
947
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
948
|
+
}
|
|
949
|
+
function getFrameElement(win) {
|
|
950
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function getCssDimensions(element) {
|
|
954
|
+
const css = getComputedStyle(element);
|
|
955
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
956
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
957
|
+
let width = parseFloat(css.width) || 0;
|
|
958
|
+
let height = parseFloat(css.height) || 0;
|
|
959
|
+
const hasOffset = isHTMLElement(element);
|
|
960
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
961
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
962
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
963
|
+
if (shouldFallback) {
|
|
964
|
+
width = offsetWidth;
|
|
965
|
+
height = offsetHeight;
|
|
966
|
+
}
|
|
967
|
+
return {
|
|
968
|
+
width,
|
|
969
|
+
height,
|
|
970
|
+
$: shouldFallback
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
function unwrapElement(element) {
|
|
975
|
+
return !isElement(element) ? element.contextElement : element;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
function getScale(element) {
|
|
979
|
+
const domElement = unwrapElement(element);
|
|
980
|
+
if (!isHTMLElement(domElement)) {
|
|
981
|
+
return createCoords(1);
|
|
982
|
+
}
|
|
983
|
+
const rect = domElement.getBoundingClientRect();
|
|
984
|
+
const {
|
|
985
|
+
width,
|
|
986
|
+
height,
|
|
987
|
+
$
|
|
988
|
+
} = getCssDimensions(domElement);
|
|
989
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
990
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
991
|
+
|
|
992
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
993
|
+
|
|
994
|
+
if (!x || !Number.isFinite(x)) {
|
|
995
|
+
x = 1;
|
|
996
|
+
}
|
|
997
|
+
if (!y || !Number.isFinite(y)) {
|
|
998
|
+
y = 1;
|
|
999
|
+
}
|
|
1000
|
+
return {
|
|
1001
|
+
x,
|
|
1002
|
+
y
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1007
|
+
function getVisualOffsets(element) {
|
|
1008
|
+
const win = getWindow(element);
|
|
1009
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
1010
|
+
return noOffsets;
|
|
1011
|
+
}
|
|
1012
|
+
return {
|
|
1013
|
+
x: win.visualViewport.offsetLeft,
|
|
1014
|
+
y: win.visualViewport.offsetTop
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1018
|
+
if (isFixed === void 0) {
|
|
1019
|
+
isFixed = false;
|
|
1020
|
+
}
|
|
1021
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1022
|
+
return false;
|
|
1023
|
+
}
|
|
1024
|
+
return isFixed;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1028
|
+
if (includeScale === void 0) {
|
|
1029
|
+
includeScale = false;
|
|
1030
|
+
}
|
|
1031
|
+
if (isFixedStrategy === void 0) {
|
|
1032
|
+
isFixedStrategy = false;
|
|
1033
|
+
}
|
|
1034
|
+
const clientRect = element.getBoundingClientRect();
|
|
1035
|
+
const domElement = unwrapElement(element);
|
|
1036
|
+
let scale = createCoords(1);
|
|
1037
|
+
if (includeScale) {
|
|
1038
|
+
if (offsetParent) {
|
|
1039
|
+
if (isElement(offsetParent)) {
|
|
1040
|
+
scale = getScale(offsetParent);
|
|
1041
|
+
}
|
|
1042
|
+
} else {
|
|
1043
|
+
scale = getScale(element);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1047
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1048
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1049
|
+
let width = clientRect.width / scale.x;
|
|
1050
|
+
let height = clientRect.height / scale.y;
|
|
1051
|
+
if (domElement) {
|
|
1052
|
+
const win = getWindow(domElement);
|
|
1053
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1054
|
+
let currentWin = win;
|
|
1055
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1056
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1057
|
+
const iframeScale = getScale(currentIFrame);
|
|
1058
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1059
|
+
const css = getComputedStyle(currentIFrame);
|
|
1060
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1061
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1062
|
+
x *= iframeScale.x;
|
|
1063
|
+
y *= iframeScale.y;
|
|
1064
|
+
width *= iframeScale.x;
|
|
1065
|
+
height *= iframeScale.y;
|
|
1066
|
+
x += left;
|
|
1067
|
+
y += top;
|
|
1068
|
+
currentWin = getWindow(currentIFrame);
|
|
1069
|
+
currentIFrame = getFrameElement(currentWin);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
return rectToClientRect({
|
|
1073
|
+
width,
|
|
1074
|
+
height,
|
|
1075
|
+
x,
|
|
1076
|
+
y
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1081
|
+
// incorrect for RTL.
|
|
1082
|
+
function getWindowScrollBarX(element, rect) {
|
|
1083
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1084
|
+
if (!rect) {
|
|
1085
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1086
|
+
}
|
|
1087
|
+
return rect.left + leftScroll;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1091
|
+
if (ignoreScrollbarX === void 0) {
|
|
1092
|
+
ignoreScrollbarX = false;
|
|
1093
|
+
}
|
|
1094
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1095
|
+
const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :
|
|
1096
|
+
// RTL <body> scrollbar.
|
|
1097
|
+
getWindowScrollBarX(documentElement, htmlRect));
|
|
1098
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1099
|
+
return {
|
|
1100
|
+
x,
|
|
1101
|
+
y
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1106
|
+
let {
|
|
1107
|
+
elements,
|
|
1108
|
+
rect,
|
|
1109
|
+
offsetParent,
|
|
1110
|
+
strategy
|
|
1111
|
+
} = _ref;
|
|
1112
|
+
const isFixed = strategy === 'fixed';
|
|
1113
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1114
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1115
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1116
|
+
return rect;
|
|
1117
|
+
}
|
|
1118
|
+
let scroll = {
|
|
1119
|
+
scrollLeft: 0,
|
|
1120
|
+
scrollTop: 0
|
|
1121
|
+
};
|
|
1122
|
+
let scale = createCoords(1);
|
|
1123
|
+
const offsets = createCoords(0);
|
|
1124
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1125
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1126
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1127
|
+
scroll = getNodeScroll(offsetParent);
|
|
1128
|
+
}
|
|
1129
|
+
if (isHTMLElement(offsetParent)) {
|
|
1130
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1131
|
+
scale = getScale(offsetParent);
|
|
1132
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1133
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1137
|
+
return {
|
|
1138
|
+
width: rect.width * scale.x,
|
|
1139
|
+
height: rect.height * scale.y,
|
|
1140
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1141
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
function getClientRects(element) {
|
|
1146
|
+
return Array.from(element.getClientRects());
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1150
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1151
|
+
function getDocumentRect(element) {
|
|
1152
|
+
const html = getDocumentElement(element);
|
|
1153
|
+
const scroll = getNodeScroll(element);
|
|
1154
|
+
const body = element.ownerDocument.body;
|
|
1155
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1156
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1157
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1158
|
+
const y = -scroll.scrollTop;
|
|
1159
|
+
if (getComputedStyle(body).direction === 'rtl') {
|
|
1160
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1161
|
+
}
|
|
1162
|
+
return {
|
|
1163
|
+
width,
|
|
1164
|
+
height,
|
|
1165
|
+
x,
|
|
1166
|
+
y
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
function getViewportRect(element, strategy) {
|
|
1171
|
+
const win = getWindow(element);
|
|
1172
|
+
const html = getDocumentElement(element);
|
|
1173
|
+
const visualViewport = win.visualViewport;
|
|
1174
|
+
let width = html.clientWidth;
|
|
1175
|
+
let height = html.clientHeight;
|
|
1176
|
+
let x = 0;
|
|
1177
|
+
let y = 0;
|
|
1178
|
+
if (visualViewport) {
|
|
1179
|
+
width = visualViewport.width;
|
|
1180
|
+
height = visualViewport.height;
|
|
1181
|
+
const visualViewportBased = isWebKit();
|
|
1182
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1183
|
+
x = visualViewport.offsetLeft;
|
|
1184
|
+
y = visualViewport.offsetTop;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
return {
|
|
1188
|
+
width,
|
|
1189
|
+
height,
|
|
1190
|
+
x,
|
|
1191
|
+
y
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1196
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1197
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1198
|
+
const top = clientRect.top + element.clientTop;
|
|
1199
|
+
const left = clientRect.left + element.clientLeft;
|
|
1200
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1201
|
+
const width = element.clientWidth * scale.x;
|
|
1202
|
+
const height = element.clientHeight * scale.y;
|
|
1203
|
+
const x = left * scale.x;
|
|
1204
|
+
const y = top * scale.y;
|
|
1205
|
+
return {
|
|
1206
|
+
width,
|
|
1207
|
+
height,
|
|
1208
|
+
x,
|
|
1209
|
+
y
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1213
|
+
let rect;
|
|
1214
|
+
if (clippingAncestor === 'viewport') {
|
|
1215
|
+
rect = getViewportRect(element, strategy);
|
|
1216
|
+
} else if (clippingAncestor === 'document') {
|
|
1217
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1218
|
+
} else if (isElement(clippingAncestor)) {
|
|
1219
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1220
|
+
} else {
|
|
1221
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1222
|
+
rect = {
|
|
1223
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1224
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1225
|
+
width: clippingAncestor.width,
|
|
1226
|
+
height: clippingAncestor.height
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
return rectToClientRect(rect);
|
|
1230
|
+
}
|
|
1231
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1232
|
+
const parentNode = getParentNode(element);
|
|
1233
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1234
|
+
return false;
|
|
1235
|
+
}
|
|
1236
|
+
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1240
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1241
|
+
// of the given element up the tree.
|
|
1242
|
+
function getClippingElementAncestors(element, cache) {
|
|
1243
|
+
const cachedResult = cache.get(element);
|
|
1244
|
+
if (cachedResult) {
|
|
1245
|
+
return cachedResult;
|
|
1246
|
+
}
|
|
1247
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1248
|
+
let currentContainingBlockComputedStyle = null;
|
|
1249
|
+
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
1250
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1251
|
+
|
|
1252
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1253
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1254
|
+
const computedStyle = getComputedStyle(currentNode);
|
|
1255
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1256
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1257
|
+
currentContainingBlockComputedStyle = null;
|
|
1258
|
+
}
|
|
1259
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1260
|
+
if (shouldDropCurrentNode) {
|
|
1261
|
+
// Drop non-containing blocks.
|
|
1262
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1263
|
+
} else {
|
|
1264
|
+
// Record last containing block for next iteration.
|
|
1265
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1266
|
+
}
|
|
1267
|
+
currentNode = getParentNode(currentNode);
|
|
1268
|
+
}
|
|
1269
|
+
cache.set(element, result);
|
|
1270
|
+
return result;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1274
|
+
// clipping ancestors.
|
|
1275
|
+
function getClippingRect(_ref) {
|
|
1276
|
+
let {
|
|
1277
|
+
element,
|
|
1278
|
+
boundary,
|
|
1279
|
+
rootBoundary,
|
|
1280
|
+
strategy
|
|
1281
|
+
} = _ref;
|
|
1282
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1283
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1284
|
+
const firstClippingAncestor = clippingAncestors[0];
|
|
1285
|
+
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1286
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1287
|
+
accRect.top = max(rect.top, accRect.top);
|
|
1288
|
+
accRect.right = min(rect.right, accRect.right);
|
|
1289
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1290
|
+
accRect.left = max(rect.left, accRect.left);
|
|
1291
|
+
return accRect;
|
|
1292
|
+
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1293
|
+
return {
|
|
1294
|
+
width: clippingRect.right - clippingRect.left,
|
|
1295
|
+
height: clippingRect.bottom - clippingRect.top,
|
|
1296
|
+
x: clippingRect.left,
|
|
1297
|
+
y: clippingRect.top
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
function getDimensions(element) {
|
|
1302
|
+
const {
|
|
1303
|
+
width,
|
|
1304
|
+
height
|
|
1305
|
+
} = getCssDimensions(element);
|
|
1306
|
+
return {
|
|
1307
|
+
width,
|
|
1308
|
+
height
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1313
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1314
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1315
|
+
const isFixed = strategy === 'fixed';
|
|
1316
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1317
|
+
let scroll = {
|
|
1318
|
+
scrollLeft: 0,
|
|
1319
|
+
scrollTop: 0
|
|
1320
|
+
};
|
|
1321
|
+
const offsets = createCoords(0);
|
|
1322
|
+
|
|
1323
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1324
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1325
|
+
function setLeftRTLScrollbarOffset() {
|
|
1326
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1327
|
+
}
|
|
1328
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1329
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1330
|
+
scroll = getNodeScroll(offsetParent);
|
|
1331
|
+
}
|
|
1332
|
+
if (isOffsetParentAnElement) {
|
|
1333
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1334
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1335
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1336
|
+
} else if (documentElement) {
|
|
1337
|
+
setLeftRTLScrollbarOffset();
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1341
|
+
setLeftRTLScrollbarOffset();
|
|
1342
|
+
}
|
|
1343
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1344
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1345
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1346
|
+
return {
|
|
1347
|
+
x,
|
|
1348
|
+
y,
|
|
1349
|
+
width: rect.width,
|
|
1350
|
+
height: rect.height
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
function isStaticPositioned(element) {
|
|
1355
|
+
return getComputedStyle(element).position === 'static';
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1359
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1360
|
+
return null;
|
|
1361
|
+
}
|
|
1362
|
+
if (polyfill) {
|
|
1363
|
+
return polyfill(element);
|
|
1364
|
+
}
|
|
1365
|
+
let rawOffsetParent = element.offsetParent;
|
|
1366
|
+
|
|
1367
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1368
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1369
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
1370
|
+
// non-static.
|
|
1371
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1372
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1373
|
+
}
|
|
1374
|
+
return rawOffsetParent;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1378
|
+
// such as table ancestors and cross browser bugs.
|
|
1379
|
+
function getOffsetParent(element, polyfill) {
|
|
1380
|
+
const win = getWindow(element);
|
|
1381
|
+
if (isTopLayer(element)) {
|
|
1382
|
+
return win;
|
|
1383
|
+
}
|
|
1384
|
+
if (!isHTMLElement(element)) {
|
|
1385
|
+
let svgOffsetParent = getParentNode(element);
|
|
1386
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1387
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1388
|
+
return svgOffsetParent;
|
|
1389
|
+
}
|
|
1390
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1391
|
+
}
|
|
1392
|
+
return win;
|
|
1393
|
+
}
|
|
1394
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1395
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1396
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1397
|
+
}
|
|
1398
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1399
|
+
return win;
|
|
1400
|
+
}
|
|
1401
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
const getElementRects = async function (data) {
|
|
1405
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1406
|
+
const getDimensionsFn = this.getDimensions;
|
|
1407
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1408
|
+
return {
|
|
1409
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1410
|
+
floating: {
|
|
1411
|
+
x: 0,
|
|
1412
|
+
y: 0,
|
|
1413
|
+
width: floatingDimensions.width,
|
|
1414
|
+
height: floatingDimensions.height
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
function isRTL(element) {
|
|
1420
|
+
return getComputedStyle(element).direction === 'rtl';
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
const platform = {
|
|
1424
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1425
|
+
getDocumentElement,
|
|
1426
|
+
getClippingRect,
|
|
1427
|
+
getOffsetParent,
|
|
1428
|
+
getElementRects,
|
|
1429
|
+
getClientRects,
|
|
1430
|
+
getDimensions,
|
|
1431
|
+
getScale,
|
|
1432
|
+
isElement,
|
|
1433
|
+
isRTL
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
function rectsAreEqual(a, b) {
|
|
1437
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
// https://samthor.au/2021/observing-dom/
|
|
1441
|
+
function observeMove(element, onMove) {
|
|
1442
|
+
let io = null;
|
|
1443
|
+
let timeoutId;
|
|
1444
|
+
const root = getDocumentElement(element);
|
|
1445
|
+
function cleanup() {
|
|
1446
|
+
var _io;
|
|
1447
|
+
clearTimeout(timeoutId);
|
|
1448
|
+
(_io = io) == null || _io.disconnect();
|
|
1449
|
+
io = null;
|
|
1450
|
+
}
|
|
1451
|
+
function refresh(skip, threshold) {
|
|
1452
|
+
if (skip === void 0) {
|
|
1453
|
+
skip = false;
|
|
1454
|
+
}
|
|
1455
|
+
if (threshold === void 0) {
|
|
1456
|
+
threshold = 1;
|
|
1457
|
+
}
|
|
1458
|
+
cleanup();
|
|
1459
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1460
|
+
const {
|
|
1461
|
+
left,
|
|
1462
|
+
top,
|
|
1463
|
+
width,
|
|
1464
|
+
height
|
|
1465
|
+
} = elementRectForRootMargin;
|
|
1466
|
+
if (!skip) {
|
|
1467
|
+
onMove();
|
|
1468
|
+
}
|
|
1469
|
+
if (!width || !height) {
|
|
1470
|
+
return;
|
|
1471
|
+
}
|
|
1472
|
+
const insetTop = floor(top);
|
|
1473
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1474
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1475
|
+
const insetLeft = floor(left);
|
|
1476
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1477
|
+
const options = {
|
|
1478
|
+
rootMargin,
|
|
1479
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1480
|
+
};
|
|
1481
|
+
let isFirstUpdate = true;
|
|
1482
|
+
function handleObserve(entries) {
|
|
1483
|
+
const ratio = entries[0].intersectionRatio;
|
|
1484
|
+
if (ratio !== threshold) {
|
|
1485
|
+
if (!isFirstUpdate) {
|
|
1486
|
+
return refresh();
|
|
1487
|
+
}
|
|
1488
|
+
if (!ratio) {
|
|
1489
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1490
|
+
// to prevent an infinite loop of updates.
|
|
1491
|
+
timeoutId = setTimeout(() => {
|
|
1492
|
+
refresh(false, 1e-7);
|
|
1493
|
+
}, 1000);
|
|
1494
|
+
} else {
|
|
1495
|
+
refresh(false, ratio);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1499
|
+
// It's possible that even though the ratio is reported as 1, the
|
|
1500
|
+
// element is not actually fully within the IntersectionObserver's root
|
|
1501
|
+
// area anymore. This can happen under performance constraints. This may
|
|
1502
|
+
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1503
|
+
// work around this, we compare the element's bounding rect now with
|
|
1504
|
+
// what it was at the time we created the IntersectionObserver. If they
|
|
1505
|
+
// are not equal then the element moved, so we refresh.
|
|
1506
|
+
refresh();
|
|
1507
|
+
}
|
|
1508
|
+
isFirstUpdate = false;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
1512
|
+
// error.
|
|
1513
|
+
try {
|
|
1514
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1515
|
+
...options,
|
|
1516
|
+
// Handle <iframe>s
|
|
1517
|
+
root: root.ownerDocument
|
|
1518
|
+
});
|
|
1519
|
+
} catch (_e) {
|
|
1520
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1521
|
+
}
|
|
1522
|
+
io.observe(element);
|
|
1523
|
+
}
|
|
1524
|
+
refresh(true);
|
|
1525
|
+
return cleanup;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
/**
|
|
1529
|
+
* Automatically updates the position of the floating element when necessary.
|
|
1530
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
1531
|
+
* visible on the screen.
|
|
1532
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
1533
|
+
* removed from the DOM or hidden from the screen.
|
|
1534
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
1535
|
+
*/
|
|
1536
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1537
|
+
if (options === void 0) {
|
|
1538
|
+
options = {};
|
|
1539
|
+
}
|
|
1540
|
+
const {
|
|
1541
|
+
ancestorScroll = true,
|
|
1542
|
+
ancestorResize = true,
|
|
1543
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
1544
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
1545
|
+
animationFrame = false
|
|
1546
|
+
} = options;
|
|
1547
|
+
const referenceEl = unwrapElement(reference);
|
|
1548
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
1549
|
+
ancestors.forEach(ancestor => {
|
|
1550
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1551
|
+
passive: true
|
|
1552
|
+
});
|
|
1553
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1554
|
+
});
|
|
1555
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1556
|
+
let reobserveFrame = -1;
|
|
1557
|
+
let resizeObserver = null;
|
|
1558
|
+
if (elementResize) {
|
|
1559
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
1560
|
+
let [firstEntry] = _ref;
|
|
1561
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1562
|
+
// Prevent update loops when using the `size` middleware.
|
|
1563
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
1564
|
+
resizeObserver.unobserve(floating);
|
|
1565
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1566
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1567
|
+
var _resizeObserver;
|
|
1568
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
update();
|
|
1572
|
+
});
|
|
1573
|
+
if (referenceEl && !animationFrame) {
|
|
1574
|
+
resizeObserver.observe(referenceEl);
|
|
1575
|
+
}
|
|
1576
|
+
resizeObserver.observe(floating);
|
|
1577
|
+
}
|
|
1578
|
+
let frameId;
|
|
1579
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1580
|
+
if (animationFrame) {
|
|
1581
|
+
frameLoop();
|
|
1582
|
+
}
|
|
1583
|
+
function frameLoop() {
|
|
1584
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1585
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1586
|
+
update();
|
|
1587
|
+
}
|
|
1588
|
+
prevRefRect = nextRefRect;
|
|
1589
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1590
|
+
}
|
|
1591
|
+
update();
|
|
1592
|
+
return () => {
|
|
1593
|
+
var _resizeObserver2;
|
|
1594
|
+
ancestors.forEach(ancestor => {
|
|
1595
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1596
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1597
|
+
});
|
|
1598
|
+
cleanupIo == null || cleanupIo();
|
|
1599
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1600
|
+
resizeObserver = null;
|
|
1601
|
+
if (animationFrame) {
|
|
1602
|
+
cancelAnimationFrame(frameId);
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/**
|
|
1608
|
+
* Modifies the placement by translating the floating element along the
|
|
1609
|
+
* specified axes.
|
|
1610
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1611
|
+
* object may be passed.
|
|
1612
|
+
* @see https://floating-ui.com/docs/offset
|
|
1613
|
+
*/
|
|
1614
|
+
const offset = offset$1;
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Optimizes the visibility of the floating element by shifting it in order to
|
|
1618
|
+
* keep it in view when it will overflow the clipping boundary.
|
|
1619
|
+
* @see https://floating-ui.com/docs/shift
|
|
1620
|
+
*/
|
|
1621
|
+
const shift = shift$1;
|
|
1622
|
+
|
|
1623
|
+
/**
|
|
1624
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1625
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1626
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1627
|
+
* @see https://floating-ui.com/docs/flip
|
|
1628
|
+
*/
|
|
1629
|
+
const flip = flip$1;
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1633
|
+
* when it is not in the same clipping context as the reference element.
|
|
1634
|
+
* @see https://floating-ui.com/docs/hide
|
|
1635
|
+
*/
|
|
1636
|
+
const hide = hide$1;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* Provides data to position an inner element of the floating element so that it
|
|
1640
|
+
* appears centered to the reference element.
|
|
1641
|
+
* @see https://floating-ui.com/docs/arrow
|
|
1642
|
+
*/
|
|
1643
|
+
const arrow = arrow$1;
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1647
|
+
* next to a given reference element.
|
|
1648
|
+
*/
|
|
1649
|
+
const computePosition = (reference, floating, options) => {
|
|
1650
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1651
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1652
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1653
|
+
const cache = new Map();
|
|
1654
|
+
const mergedOptions = {
|
|
1655
|
+
platform,
|
|
1656
|
+
...options
|
|
1657
|
+
};
|
|
1658
|
+
const platformWithCache = {
|
|
1659
|
+
...mergedOptions.platform,
|
|
1660
|
+
_c: cache
|
|
1661
|
+
};
|
|
1662
|
+
return computePosition$1(reference, floating, {
|
|
1663
|
+
...mergedOptions,
|
|
1664
|
+
platform: platformWithCache
|
|
1665
|
+
});
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* FloatingUIManager é uma classe utilitária que gerencia o posicionamento de elementos flutuantes
|
|
1670
|
+
* como tooltips ou popovers em relação a um elemento de disparo (trigger).
|
|
1671
|
+
* Ela utiliza a biblioteca Floating UI para calcular posições e lidar com atualizações.
|
|
1672
|
+
*/
|
|
1673
|
+
class FloatingUIManager {
|
|
1674
|
+
triggerElement;
|
|
1675
|
+
contentElement;
|
|
1676
|
+
arrowElement;
|
|
1677
|
+
placement;
|
|
1678
|
+
onUpdate;
|
|
1679
|
+
cleanupAutoUpdate;
|
|
1680
|
+
constructor(options) {
|
|
1681
|
+
this.triggerElement = options.triggerElement;
|
|
1682
|
+
this.contentElement = options.contentElement;
|
|
1683
|
+
this.arrowElement = options.arrowElement;
|
|
1684
|
+
this.placement = options.placement ?? 'top';
|
|
1685
|
+
this.onUpdate = options.onUpdate;
|
|
1686
|
+
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Inicia o gerenciador Floating UI configurando a atualização automática da posição.
|
|
1689
|
+
*/
|
|
1690
|
+
start() {
|
|
1691
|
+
this.cleanupAutoUpdate = autoUpdate(this.triggerElement, this.contentElement, () => this.updatePosition());
|
|
1692
|
+
}
|
|
1693
|
+
/**
|
|
1694
|
+
* Para o gerenciador Floating UI e limpa os recursos utilizados.
|
|
1695
|
+
*/
|
|
1696
|
+
stop() {
|
|
1697
|
+
this.cleanupAutoUpdate?.();
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Atualiza a posição do elemento flutuante com base no elemento disparador e no elemento de conteúdo.
|
|
1701
|
+
* Esta função é chamada automaticamente quando o gerenciador está ativo.
|
|
1702
|
+
* Ela calcula a nova posição usando a biblioteca Floating UI e aplica as transformações necessárias.
|
|
1703
|
+
* Também atualiza a posição da seta, se fornecida.
|
|
1704
|
+
* Além disso, define o atributo de dados `data-placement` no elemento de conteúdo para refletir a posição atual.
|
|
1705
|
+
* @returns {Promise<void>} Uma promessa que resolve quando a posição é atualizada.
|
|
1706
|
+
*/
|
|
1707
|
+
async updatePosition() {
|
|
1708
|
+
const data = await computePosition(this.triggerElement, this.contentElement, {
|
|
1709
|
+
placement: this.placement,
|
|
1710
|
+
middleware: this.buildMiddleware(),
|
|
1711
|
+
});
|
|
1712
|
+
this.updateTooltipPosition(data);
|
|
1713
|
+
this.updateArrowPosition(data);
|
|
1714
|
+
this.setPlacementDataAttribute(data);
|
|
1715
|
+
this.onUpdate?.(data);
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Constrói os middlewares necessários para o Floating UI.
|
|
1719
|
+
* Esses middlewares são usados para ajustar o posicionamento do elemento flutuante,
|
|
1720
|
+
* incluindo offset, flip, shift e hide. Se uma seta for fornecida, o middleware de seta também é adicionado.
|
|
1721
|
+
* @returns {Middleware[]} Retorna um array de middlewares configurados para o Floating UI.
|
|
1722
|
+
*/
|
|
1723
|
+
buildMiddleware() {
|
|
1724
|
+
const middleware = [offset(8), flip(), shift({ padding: 5 }), hide()];
|
|
1725
|
+
if (this.arrowElement != null) {
|
|
1726
|
+
middleware.push(arrow({ element: this.arrowElement }));
|
|
1727
|
+
}
|
|
1728
|
+
return middleware;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Adiciona o estilo necessário para posicionar o tooltip com base nas coordenadas fornecidas.
|
|
1732
|
+
* Esta função é chamada após o cálculo da posição do tooltip.
|
|
1733
|
+
* Ela aplica as propriedades CSS `left` e `top` ao elemento de conteúdo do tooltip.
|
|
1734
|
+
* @param data Contém as coordenadas x e y para posicionar o tooltip.
|
|
1735
|
+
*/
|
|
1736
|
+
updateTooltipPosition(data) {
|
|
1737
|
+
const { x, y } = data;
|
|
1738
|
+
Object.assign(this.contentElement.style, {
|
|
1739
|
+
left: `${x}px`,
|
|
1740
|
+
top: `${y}px`,
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* Adiciona o estilo necessário para posicionar a seta do tooltip com base nos dados de middleware.
|
|
1745
|
+
* Esta função é chamada após o cálculo da posição do tooltip.
|
|
1746
|
+
* Ela aplica as propriedades CSS `left`, `top`, `right`, `bottom` e a posição estática da seta.
|
|
1747
|
+
* A posição estática é determinada com base na colocação do tooltip (top, right, bottom, left).
|
|
1748
|
+
* Se a seta não estiver presente ou os dados de middleware não contiverem informações sobre a seta, nada será feito.
|
|
1749
|
+
* @param data Contém a posição da seta e os dados de middleware.
|
|
1750
|
+
*/
|
|
1751
|
+
updateArrowPosition(data) {
|
|
1752
|
+
if (this.arrowElement == null || data.middlewareData.arrow == null)
|
|
1753
|
+
return;
|
|
1754
|
+
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
1755
|
+
const basePlacement = data.placement.split('-')[0];
|
|
1756
|
+
const staticSide = {
|
|
1757
|
+
top: 'bottom',
|
|
1758
|
+
right: 'left',
|
|
1759
|
+
bottom: 'top',
|
|
1760
|
+
left: 'right',
|
|
1761
|
+
}[basePlacement];
|
|
1762
|
+
Object.assign(this.arrowElement.style, {
|
|
1763
|
+
left: arrowX != null ? `${arrowX}px` : '',
|
|
1764
|
+
top: arrowY != null ? `${arrowY}px` : '',
|
|
1765
|
+
right: '',
|
|
1766
|
+
bottom: '',
|
|
1767
|
+
[staticSide]: '-4px',
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Define o atributo de dados `data-placement` no elemento de conteúdo.
|
|
1772
|
+
* Este atributo é usado para indicar a posição atual do tooltip ou popover.
|
|
1773
|
+
* Ele é útil para fins de acessibilidade e para permitir que estilos CSS sejam aplicados com base na posição.
|
|
1774
|
+
* @param data Objeto contendo a propriedade `placement` que define a posição do tooltip ou popover.
|
|
1775
|
+
* A propriedade `placement` deve ser uma string representando a posição, como 'top', 'bottom', 'left', 'right', etc.
|
|
1776
|
+
*/
|
|
1777
|
+
setPlacementDataAttribute(data) {
|
|
1778
|
+
this.contentElement.setAttribute('data-placement', data.placement);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
const tooltipCss = "*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;-moz-appearance:button;appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden]{display:none}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.col-2{-ms-flex-preferred-size:16.6666666667%;flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-.5);margin-right:calc(var(--grid-gutter)*-.5)}@media (min-width:576px){.container,.container-lg{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width:992px){.container,.container-lg{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width:1280px){.container,.container-lg{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width:1600px){.container,.container-lg{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half)!important}.mb-1{margin-bottom:var(--spacing-scale-half)!important}.mr-2{margin-right:var(--spacing-scale-base)!important}.mr-n2{margin-right:calc(var(--spacing-scale-base)*-1)!important}.ml-2{margin-left:var(--spacing-scale-base)!important}.mr-auto{margin-right:auto!important}.pt-half{padding-top:var(--spacing-scale-half)!important}.py-3{padding-bottom:var(--spacing-scale-2x)!important;padding-top:var(--spacing-scale-2x)!important}.py-4{padding-bottom:var(--spacing-scale-3x)!important;padding-top:var(--spacing-scale-3x)!important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width:576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--interactive-rgb),var(--hover))),to(rgba(var(--interactive-rgb),var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb),var(--hover)),rgba(var(--interactive-rgb),var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--interactive-rgb),var(--pressed))),to(rgba(var(--interactive-rgb),var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb),var(--pressed)),rgba(var(--interactive-rgb),var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ol,ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}.label,label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}.placeholder,::placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}.input,input,textarea{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.bg-blue-90{--background:var(--blue-90);background:var(--blue-90)!important}.bg-blue-80{--background:var(--blue-80);background:var(--blue-80)!important}.bg-blue-70{--background:var(--blue-70);background:var(--blue-70)!important}.bg-blue-60{--background:var(--blue-60);background:var(--blue-60)!important}.bg-blue-50{--background:var(--blue-50);background:var(--blue-50)!important}.bg-blue-40{--background:var(--blue-40);background:var(--blue-40)!important}.bg-blue-30{--background:var(--blue-30);background:var(--blue-30)!important}.bg-blue-20{--background:var(--blue-20);background:var(--blue-20)!important}.bg-blue-10{--background:var(--blue-10);background:var(--blue-10)!important}.bg-blue-5{--background:var(--blue-5);background:var(--blue-5)!important}.bg-blue-cool-90{--background:var(--blue-cool-90);background:var(--blue-cool-90)!important}.bg-blue-cool-80{--background:var(--blue-cool-80);background:var(--blue-cool-80)!important}.bg-blue-cool-70{--background:var(--blue-cool-70);background:var(--blue-cool-70)!important}.bg-blue-cool-60{--background:var(--blue-cool-60);background:var(--blue-cool-60)!important}.bg-blue-cool-50{--background:var(--blue-cool-50);background:var(--blue-cool-50)!important}.bg-blue-cool-40{--background:var(--blue-cool-40);background:var(--blue-cool-40)!important}.bg-blue-cool-30{--background:var(--blue-cool-30);background:var(--blue-cool-30)!important}.bg-blue-cool-20{--background:var(--blue-cool-20);background:var(--blue-cool-20)!important}.bg-blue-cool-10{--background:var(--blue-cool-10);background:var(--blue-cool-10)!important}.bg-blue-cool-5{--background:var(--blue-cool-5);background:var(--blue-cool-5)!important}.bg-blue-warm-90{--background:var(--blue-warm-90);background:var(--blue-warm-90)!important}.bg-blue-warm-80{--background:var(--blue-warm-80);background:var(--blue-warm-80)!important}.bg-blue-warm-70{--background:var(--blue-warm-70);background:var(--blue-warm-70)!important}.bg-blue-warm-60{--background:var(--blue-warm-60);background:var(--blue-warm-60)!important}.bg-blue-warm-50{--background:var(--blue-warm-50);background:var(--blue-warm-50)!important}.bg-blue-warm-40{--background:var(--blue-warm-40);background:var(--blue-warm-40)!important}.bg-blue-warm-30{--background:var(--blue-warm-30);background:var(--blue-warm-30)!important}.bg-blue-warm-20{--background:var(--blue-warm-20);background:var(--blue-warm-20)!important}.bg-blue-warm-10{--background:var(--blue-warm-10);background:var(--blue-warm-10)!important}.bg-blue-warm-5{--background:var(--blue-warm-5);background:var(--blue-warm-5)!important}.bg-blue-vivid-80{--background:var(--blue-vivid-80);background:var(--blue-vivid-80)!important}.bg-blue-vivid-70{--background:var(--blue-vivid-70);background:var(--blue-vivid-70)!important}.bg-blue-vivid-60{--background:var(--blue-vivid-60);background:var(--blue-vivid-60)!important}.bg-blue-vivid-50{--background:var(--blue-vivid-50);background:var(--blue-vivid-50)!important}.bg-blue-vivid-40{--background:var(--blue-vivid-40);background:var(--blue-vivid-40)!important}.bg-blue-vivid-30{--background:var(--blue-vivid-30);background:var(--blue-vivid-30)!important}.bg-blue-vivid-20{--background:var(--blue-vivid-20);background:var(--blue-vivid-20)!important}.bg-blue-vivid-10{--background:var(--blue-vivid-10);background:var(--blue-vivid-10)!important}.bg-blue-vivid-5{--background:var(--blue-vivid-5);background:var(--blue-vivid-5)!important}.bg-blue-cool-vivid-80{--background:var(--blue-cool-vivid-80);background:var(--blue-cool-vivid-80)!important}.bg-blue-cool-vivid-70{--background:var(--blue-cool-vivid-70);background:var(--blue-cool-vivid-70)!important}.bg-blue-cool-vivid-60{--background:var(--blue-cool-vivid-60);background:var(--blue-cool-vivid-60)!important}.bg-blue-cool-vivid-50{--background:var(--blue-cool-vivid-50);background:var(--blue-cool-vivid-50)!important}.bg-blue-cool-vivid-40{--background:var(--blue-cool-vivid-40);background:var(--blue-cool-vivid-40)!important}.bg-blue-cool-vivid-30{--background:var(--blue-cool-vivid-30);background:var(--blue-cool-vivid-30)!important}.bg-blue-cool-vivid-20{--background:var(--blue-cool-vivid-20);background:var(--blue-cool-vivid-20)!important}.bg-blue-cool-vivid-10{--background:var(--blue-cool-vivid-10);background:var(--blue-cool-vivid-10)!important}.bg-blue-cool-vivid-5{--background:var(--blue-cool-vivid-5);background:var(--blue-cool-vivid-5)!important}.bg-blue-warm-vivid-90{--background:var(--blue-warm-vivid-90);background:var(--blue-warm-vivid-90)!important}.bg-blue-warm-vivid-80{--background:var(--blue-warm-vivid-80);background:var(--blue-warm-vivid-80)!important}.bg-blue-warm-vivid-70{--background:var(--blue-warm-vivid-70);background:var(--blue-warm-vivid-70)!important}.bg-blue-warm-vivid-60{--background:var(--blue-warm-vivid-60);background:var(--blue-warm-vivid-60)!important}.bg-blue-warm-vivid-50{--background:var(--blue-warm-vivid-50);background:var(--blue-warm-vivid-50)!important}.bg-blue-warm-vivid-40{--background:var(--blue-warm-vivid-40);background:var(--blue-warm-vivid-40)!important}.bg-blue-warm-vivid-30{--background:var(--blue-warm-vivid-30);background:var(--blue-warm-vivid-30)!important}.bg-blue-warm-vivid-20{--background:var(--blue-warm-vivid-20);background:var(--blue-warm-vivid-20)!important}.bg-blue-warm-vivid-10{--background:var(--blue-warm-vivid-10);background:var(--blue-warm-vivid-10)!important}.bg-blue-warm-vivid-5{--background:var(--blue-warm-vivid-5);background:var(--blue-warm-vivid-5)!important}.bg-cyan-90{--background:var(--cyan-90);background:var(--cyan-90)!important}.bg-cyan-80{--background:var(--cyan-80);background:var(--cyan-80)!important}.bg-cyan-70{--background:var(--cyan-70);background:var(--cyan-70)!important}.bg-cyan-60{--background:var(--cyan-60);background:var(--cyan-60)!important}.bg-cyan-50{--background:var(--cyan-50);background:var(--cyan-50)!important}.bg-cyan-40{--background:var(--cyan-40);background:var(--cyan-40)!important}.bg-cyan-30{--background:var(--cyan-30);background:var(--cyan-30)!important}.bg-cyan-20{--background:var(--cyan-20);background:var(--cyan-20)!important}.bg-cyan-10{--background:var(--cyan-10);background:var(--cyan-10)!important}.bg-cyan-5{--background:var(--cyan-5);background:var(--cyan-5)!important}.bg-cyan-vivid-80{--background:var(--cyan-vivid-80);background:var(--cyan-vivid-80)!important}.bg-cyan-vivid-70{--background:var(--cyan-vivid-70);background:var(--cyan-vivid-70)!important}.bg-cyan-vivid-60{--background:var(--cyan-vivid-60);background:var(--cyan-vivid-60)!important}.bg-cyan-vivid-50{--background:var(--cyan-vivid-50);background:var(--cyan-vivid-50)!important}.bg-cyan-vivid-40{--background:var(--cyan-vivid-40);background:var(--cyan-vivid-40)!important}.bg-cyan-vivid-30{--background:var(--cyan-vivid-30);background:var(--cyan-vivid-30)!important}.bg-cyan-vivid-20{--background:var(--cyan-vivid-20);background:var(--cyan-vivid-20)!important}.bg-cyan-vivid-10{--background:var(--cyan-vivid-10);background:var(--cyan-vivid-10)!important}.bg-cyan-vivid-5{--background:var(--cyan-vivid-5);background:var(--cyan-vivid-5)!important}.bg-gold-90{--background:var(--gold-90);background:var(--gold-90)!important}.bg-gold-80{--background:var(--gold-80);background:var(--gold-80)!important}.bg-gold-70{--background:var(--gold-70);background:var(--gold-70)!important}.bg-gold-60{--background:var(--gold-60);background:var(--gold-60)!important}.bg-gold-50{--background:var(--gold-50);background:var(--gold-50)!important}.bg-gold-40{--background:var(--gold-40);background:var(--gold-40)!important}.bg-gold-30{--background:var(--gold-30);background:var(--gold-30)!important}.bg-gold-20{--background:var(--gold-20);background:var(--gold-20)!important}.bg-gold-10{--background:var(--gold-10);background:var(--gold-10)!important}.bg-gold-5{--background:var(--gold-5);background:var(--gold-5)!important}.bg-gold-vivid-80{--background:var(--gold-vivid-80);background:var(--gold-vivid-80)!important}.bg-gold-vivid-70{--background:var(--gold-vivid-70);background:var(--gold-vivid-70)!important}.bg-gold-vivid-60{--background:var(--gold-vivid-60);background:var(--gold-vivid-60)!important}.bg-gold-vivid-50{--background:var(--gold-vivid-50);background:var(--gold-vivid-50)!important}.bg-gold-vivid-40{--background:var(--gold-vivid-40);background:var(--gold-vivid-40)!important}.bg-gold-vivid-30{--background:var(--gold-vivid-30);background:var(--gold-vivid-30)!important}.bg-gold-vivid-20{--background:var(--gold-vivid-20);background:var(--gold-vivid-20)!important}.bg-gold-vivid-10{--background:var(--gold-vivid-10);background:var(--gold-vivid-10)!important}.bg-gold-vivid-5{--background:var(--gold-vivid-5);background:var(--gold-vivid-5)!important}.bg-gray-90{--background:var(--gray-90);background:var(--gray-90)!important}.bg-gray-80{--background:var(--gray-80);background:var(--gray-80)!important}.bg-gray-70{--background:var(--gray-70);background:var(--gray-70)!important}.bg-gray-60{--background:var(--gray-60);background:var(--gray-60)!important}.bg-gray-50{--background:var(--gray-50);background:var(--gray-50)!important}.bg-gray-40{--background:var(--gray-40);background:var(--gray-40)!important}.bg-gray-30{--background:var(--gray-30);background:var(--gray-30)!important}.bg-gray-20{--background:var(--gray-20);background:var(--gray-20)!important}.bg-gray-10{--background:var(--gray-10);background:var(--gray-10)!important}.bg-gray-5{--background:var(--gray-5);background:var(--gray-5)!important}.bg-gray-4{--background:var(--gray-4);background:var(--gray-4)!important}.bg-gray-3{--background:var(--gray-3);background:var(--gray-3)!important}.bg-gray-2{--background:var(--gray-2);background:var(--gray-2)!important}.bg-gray-1{--background:var(--gray-1);background:var(--gray-1)!important}.bg-gray-cool-90{--background:var(--gray-cool-90);background:var(--gray-cool-90)!important}.bg-gray-cool-80{--background:var(--gray-cool-80);background:var(--gray-cool-80)!important}.bg-gray-cool-70{--background:var(--gray-cool-70);background:var(--gray-cool-70)!important}.bg-gray-cool-60{--background:var(--gray-cool-60);background:var(--gray-cool-60)!important}.bg-gray-cool-50{--background:var(--gray-cool-50);background:var(--gray-cool-50)!important}.bg-gray-cool-40{--background:var(--gray-cool-40);background:var(--gray-cool-40)!important}.bg-gray-cool-30{--background:var(--gray-cool-30);background:var(--gray-cool-30)!important}.bg-gray-cool-20{--background:var(--gray-cool-20);background:var(--gray-cool-20)!important}.bg-gray-cool-10{--background:var(--gray-cool-10);background:var(--gray-cool-10)!important}.bg-gray-cool-5{--background:var(--gray-cool-5);background:var(--gray-cool-5)!important}.bg-gray-cool-4{--background:var(--gray-cool-4);background:var(--gray-cool-4)!important}.bg-gray-cool-3{--background:var(--gray-cool-3);background:var(--gray-cool-3)!important}.bg-gray-cool-2{--background:var(--gray-cool-2);background:var(--gray-cool-2)!important}.bg-gray-cool-1{--background:var(--gray-cool-1);background:var(--gray-cool-1)!important}.bg-gray-warm-90{--background:var(--gray-warm-90);background:var(--gray-warm-90)!important}.bg-gray-warm-80{--background:var(--gray-warm-80);background:var(--gray-warm-80)!important}.bg-gray-warm-70{--background:var(--gray-warm-70);background:var(--gray-warm-70)!important}.bg-gray-warm-60{--background:var(--gray-warm-60);background:var(--gray-warm-60)!important}.bg-gray-warm-50{--background:var(--gray-warm-50);background:var(--gray-warm-50)!important}.bg-gray-warm-40{--background:var(--gray-warm-40);background:var(--gray-warm-40)!important}.bg-gray-warm-30{--background:var(--gray-warm-30);background:var(--gray-warm-30)!important}.bg-gray-warm-20{--background:var(--gray-warm-20);background:var(--gray-warm-20)!important}.bg-gray-warm-10{--background:var(--gray-warm-10);background:var(--gray-warm-10)!important}.bg-gray-warm-5{--background:var(--gray-warm-5);background:var(--gray-warm-5)!important}.bg-gray-warm-4{--background:var(--gray-warm-4);background:var(--gray-warm-4)!important}.bg-gray-warm-3{--background:var(--gray-warm-3);background:var(--gray-warm-3)!important}.bg-gray-warm-2{--background:var(--gray-warm-2);background:var(--gray-warm-2)!important}.bg-gray-warm-1{--background:var(--gray-warm-1);background:var(--gray-warm-1)!important}.bg-green-90{--background:var(--green-90);background:var(--green-90)!important}.bg-green-80{--background:var(--green-80);background:var(--green-80)!important}.bg-green-70{--background:var(--green-70);background:var(--green-70)!important}.bg-green-60{--background:var(--green-60);background:var(--green-60)!important}.bg-green-50{--background:var(--green-50);background:var(--green-50)!important}.bg-green-40{--background:var(--green-40);background:var(--green-40)!important}.bg-green-30{--background:var(--green-30);background:var(--green-30)!important}.bg-green-20{--background:var(--green-20);background:var(--green-20)!important}.bg-green-10{--background:var(--green-10);background:var(--green-10)!important}.bg-green-5{--background:var(--green-5);background:var(--green-5)!important}.bg-green-cool-90{--background:var(--green-cool-90);background:var(--green-cool-90)!important}.bg-green-cool-80{--background:var(--green-cool-80);background:var(--green-cool-80)!important}.bg-green-cool-70{--background:var(--green-cool-70);background:var(--green-cool-70)!important}.bg-green-cool-60{--background:var(--green-cool-60);background:var(--green-cool-60)!important}.bg-green-cool-50{--background:var(--green-cool-50);background:var(--green-cool-50)!important}.bg-green-cool-40{--background:var(--green-cool-40);background:var(--green-cool-40)!important}.bg-green-cool-30{--background:var(--green-cool-30);background:var(--green-cool-30)!important}.bg-green-cool-20{--background:var(--green-cool-20);background:var(--green-cool-20)!important}.bg-green-cool-10{--background:var(--green-cool-10);background:var(--green-cool-10)!important}.bg-green-cool-5{--background:var(--green-cool-5);background:var(--green-cool-5)!important}.bg-green-warm-90{--background:var(--green-warm-90);background:var(--green-warm-90)!important}.bg-green-warm-80{--background:var(--green-warm-80);background:var(--green-warm-80)!important}.bg-green-warm-70{--background:var(--green-warm-70);background:var(--green-warm-70)!important}.bg-green-warm-60{--background:var(--green-warm-60);background:var(--green-warm-60)!important}.bg-green-warm-50{--background:var(--green-warm-50);background:var(--green-warm-50)!important}.bg-green-warm-40{--background:var(--green-warm-40);background:var(--green-warm-40)!important}.bg-green-warm-30{--background:var(--green-warm-30);background:var(--green-warm-30)!important}.bg-green-warm-20{--background:var(--green-warm-20);background:var(--green-warm-20)!important}.bg-green-warm-10{--background:var(--green-warm-10);background:var(--green-warm-10)!important}.bg-green-warm-5{--background:var(--green-warm-5);background:var(--green-warm-5)!important}.bg-green-vivid-80{--background:var(--green-vivid-80);background:var(--green-vivid-80)!important}.bg-green-vivid-70{--background:var(--green-vivid-70);background:var(--green-vivid-70)!important}.bg-green-vivid-60{--background:var(--green-vivid-60);background:var(--green-vivid-60)!important}.bg-green-vivid-50{--background:var(--green-vivid-50);background:var(--green-vivid-50)!important}.bg-green-vivid-40{--background:var(--green-vivid-40);background:var(--green-vivid-40)!important}.bg-green-vivid-30{--background:var(--green-vivid-30);background:var(--green-vivid-30)!important}.bg-green-vivid-20{--background:var(--green-vivid-20);background:var(--green-vivid-20)!important}.bg-green-vivid-10{--background:var(--green-vivid-10);background:var(--green-vivid-10)!important}.bg-green-vivid-5{--background:var(--green-vivid-5);background:var(--green-vivid-5)!important}.bg-green-cool-vivid-80{--background:var(--green-cool-vivid-80);background:var(--green-cool-vivid-80)!important}.bg-green-cool-vivid-70{--background:var(--green-cool-vivid-70);background:var(--green-cool-vivid-70)!important}.bg-green-cool-vivid-60{--background:var(--green-cool-vivid-60);background:var(--green-cool-vivid-60)!important}.bg-green-cool-vivid-50{--background:var(--green-cool-vivid-50);background:var(--green-cool-vivid-50)!important}.bg-green-cool-vivid-40{--background:var(--green-cool-vivid-40);background:var(--green-cool-vivid-40)!important}.bg-green-cool-vivid-30{--background:var(--green-cool-vivid-30);background:var(--green-cool-vivid-30)!important}.bg-green-cool-vivid-20{--background:var(--green-cool-vivid-20);background:var(--green-cool-vivid-20)!important}.bg-green-cool-vivid-10{--background:var(--green-cool-vivid-10);background:var(--green-cool-vivid-10)!important}.bg-green-cool-vivid-5{--background:var(--green-cool-vivid-5);background:var(--green-cool-vivid-5)!important}.bg-green-warm-vivid-80{--background:var(--green-warm-vivid-80);background:var(--green-warm-vivid-80)!important}.bg-green-warm-vivid-70{--background:var(--green-warm-vivid-70);background:var(--green-warm-vivid-70)!important}.bg-green-warm-vivid-60{--background:var(--green-warm-vivid-60);background:var(--green-warm-vivid-60)!important}.bg-green-warm-vivid-50{--background:var(--green-warm-vivid-50);background:var(--green-warm-vivid-50)!important}.bg-green-warm-vivid-40{--background:var(--green-warm-vivid-40);background:var(--green-warm-vivid-40)!important}.bg-green-warm-vivid-30{--background:var(--green-warm-vivid-30);background:var(--green-warm-vivid-30)!important}.bg-green-warm-vivid-20{--background:var(--green-warm-vivid-20);background:var(--green-warm-vivid-20)!important}.bg-green-warm-vivid-10{--background:var(--green-warm-vivid-10);background:var(--green-warm-vivid-10)!important}.bg-green-warm-vivid-5{--background:var(--green-warm-vivid-5);background:var(--green-warm-vivid-5)!important}.bg-indigo-90{--background:var(--indigo-90);background:var(--indigo-90)!important}.bg-indigo-80{--background:var(--indigo-80);background:var(--indigo-80)!important}.bg-indigo-70{--background:var(--indigo-70);background:var(--indigo-70)!important}.bg-indigo-60{--background:var(--indigo-60);background:var(--indigo-60)!important}.bg-indigo-50{--background:var(--indigo-50);background:var(--indigo-50)!important}.bg-indigo-40{--background:var(--indigo-40);background:var(--indigo-40)!important}.bg-indigo-30{--background:var(--indigo-30);background:var(--indigo-30)!important}.bg-indigo-20{--background:var(--indigo-20);background:var(--indigo-20)!important}.bg-indigo-10{--background:var(--indigo-10);background:var(--indigo-10)!important}.bg-indigo-5{--background:var(--indigo-5);background:var(--indigo-5)!important}.bg-indigo-cool-90{--background:var(--indigo-cool-90);background:var(--indigo-cool-90)!important}.bg-indigo-cool-80{--background:var(--indigo-cool-80);background:var(--indigo-cool-80)!important}.bg-indigo-cool-70{--background:var(--indigo-cool-70);background:var(--indigo-cool-70)!important}.bg-indigo-cool-60{--background:var(--indigo-cool-60);background:var(--indigo-cool-60)!important}.bg-indigo-cool-50{--background:var(--indigo-cool-50);background:var(--indigo-cool-50)!important}.bg-indigo-cool-40{--background:var(--indigo-cool-40);background:var(--indigo-cool-40)!important}.bg-indigo-cool-30{--background:var(--indigo-cool-30);background:var(--indigo-cool-30)!important}.bg-indigo-cool-20{--background:var(--indigo-cool-20);background:var(--indigo-cool-20)!important}.bg-indigo-cool-10{--background:var(--indigo-cool-10);background:var(--indigo-cool-10)!important}.bg-indigo-cool-5{--background:var(--indigo-cool-5);background:var(--indigo-cool-5)!important}.bg-indigo-warm-90{--background:var(--indigo-warm-90);background:var(--indigo-warm-90)!important}.bg-indigo-warm-80{--background:var(--indigo-warm-80);background:var(--indigo-warm-80)!important}.bg-indigo-warm-70{--background:var(--indigo-warm-70);background:var(--indigo-warm-70)!important}.bg-indigo-warm-60{--background:var(--indigo-warm-60);background:var(--indigo-warm-60)!important}.bg-indigo-warm-50{--background:var(--indigo-warm-50);background:var(--indigo-warm-50)!important}.bg-indigo-warm-40{--background:var(--indigo-warm-40);background:var(--indigo-warm-40)!important}.bg-indigo-warm-30{--background:var(--indigo-warm-30);background:var(--indigo-warm-30)!important}.bg-indigo-warm-20{--background:var(--indigo-warm-20);background:var(--indigo-warm-20)!important}.bg-indigo-warm-10{--background:var(--indigo-warm-10);background:var(--indigo-warm-10)!important}.bg-indigo-warm-5{--background:var(--indigo-warm-5);background:var(--indigo-warm-5)!important}.bg-indigo-vivid-80{--background:var(--indigo-vivid-80);background:var(--indigo-vivid-80)!important}.bg-indigo-vivid-70{--background:var(--indigo-vivid-70);background:var(--indigo-vivid-70)!important}.bg-indigo-vivid-60{--background:var(--indigo-vivid-60);background:var(--indigo-vivid-60)!important}.bg-indigo-vivid-50{--background:var(--indigo-vivid-50);background:var(--indigo-vivid-50)!important}.bg-indigo-vivid-40{--background:var(--indigo-vivid-40);background:var(--indigo-vivid-40)!important}.bg-indigo-vivid-30{--background:var(--indigo-vivid-30);background:var(--indigo-vivid-30)!important}.bg-indigo-vivid-20{--background:var(--indigo-vivid-20);background:var(--indigo-vivid-20)!important}.bg-indigo-vivid-10{--background:var(--indigo-vivid-10);background:var(--indigo-vivid-10)!important}.bg-indigo-vivid-5{--background:var(--indigo-vivid-5);background:var(--indigo-vivid-5)!important}.bg-indigo-cool-vivid-80{--background:var(--indigo-cool-vivid-80);background:var(--indigo-cool-vivid-80)!important}.bg-indigo-cool-vivid-70{--background:var(--indigo-cool-vivid-70);background:var(--indigo-cool-vivid-70)!important}.bg-indigo-cool-vivid-60{--background:var(--indigo-cool-vivid-60);background:var(--indigo-cool-vivid-60)!important}.bg-indigo-cool-vivid-50{--background:var(--indigo-cool-vivid-50);background:var(--indigo-cool-vivid-50)!important}.bg-indigo-cool-vivid-40{--background:var(--indigo-cool-vivid-40);background:var(--indigo-cool-vivid-40)!important}.bg-indigo-cool-vivid-30{--background:var(--indigo-cool-vivid-30);background:var(--indigo-cool-vivid-30)!important}.bg-indigo-cool-vivid-20{--background:var(--indigo-cool-vivid-20);background:var(--indigo-cool-vivid-20)!important}.bg-indigo-cool-vivid-10{--background:var(--indigo-cool-vivid-10);background:var(--indigo-cool-vivid-10)!important}.bg-indigo-cool-vivid-5{--background:var(--indigo-cool-vivid-5);background:var(--indigo-cool-vivid-5)!important}.bg-indigo-warm-vivid-80{--background:var(--indigo-warm-vivid-80);background:var(--indigo-warm-vivid-80)!important}.bg-indigo-warm-vivid-70{--background:var(--indigo-warm-vivid-70);background:var(--indigo-warm-vivid-70)!important}.bg-indigo-warm-vivid-60{--background:var(--indigo-warm-vivid-60);background:var(--indigo-warm-vivid-60)!important}.bg-indigo-warm-vivid-50{--background:var(--indigo-warm-vivid-50);background:var(--indigo-warm-vivid-50)!important}.bg-indigo-warm-vivid-40{--background:var(--indigo-warm-vivid-40);background:var(--indigo-warm-vivid-40)!important}.bg-indigo-warm-vivid-30{--background:var(--indigo-warm-vivid-30);background:var(--indigo-warm-vivid-30)!important}.bg-indigo-warm-vivid-20{--background:var(--indigo-warm-vivid-20);background:var(--indigo-warm-vivid-20)!important}.bg-indigo-warm-vivid-10{--background:var(--indigo-warm-vivid-10);background:var(--indigo-warm-vivid-10)!important}.bg-indigo-warm-vivid-5{--background:var(--indigo-warm-vivid-5);background:var(--indigo-warm-vivid-5)!important}.bg-magenta-90{--background:var(--magenta-90);background:var(--magenta-90)!important}.bg-magenta-80{--background:var(--magenta-80);background:var(--magenta-80)!important}.bg-magenta-70{--background:var(--magenta-70);background:var(--magenta-70)!important}.bg-magenta-60{--background:var(--magenta-60);background:var(--magenta-60)!important}.bg-magenta-50{--background:var(--magenta-50);background:var(--magenta-50)!important}.bg-magenta-40{--background:var(--magenta-40);background:var(--magenta-40)!important}.bg-magenta-30{--background:var(--magenta-30);background:var(--magenta-30)!important}.bg-magenta-20{--background:var(--magenta-20);background:var(--magenta-20)!important}.bg-magenta-10{--background:var(--magenta-10);background:var(--magenta-10)!important}.bg-magenta-5{--background:var(--magenta-5);background:var(--magenta-5)!important}.bg-magenta-vivid-80{--background:var(--magenta-vivid-80);background:var(--magenta-vivid-80)!important}.bg-magenta-vivid-70{--background:var(--magenta-vivid-70);background:var(--magenta-vivid-70)!important}.bg-magenta-vivid-60{--background:var(--magenta-vivid-60);background:var(--magenta-vivid-60)!important}.bg-magenta-vivid-50{--background:var(--magenta-vivid-50);background:var(--magenta-vivid-50)!important}.bg-magenta-vivid-40{--background:var(--magenta-vivid-40);background:var(--magenta-vivid-40)!important}.bg-magenta-vivid-30{--background:var(--magenta-vivid-30);background:var(--magenta-vivid-30)!important}.bg-magenta-vivid-20{--background:var(--magenta-vivid-20);background:var(--magenta-vivid-20)!important}.bg-magenta-vivid-10{--background:var(--magenta-vivid-10);background:var(--magenta-vivid-10)!important}.bg-magenta-vivid-5{--background:var(--magenta-vivid-5);background:var(--magenta-vivid-5)!important}.bg-mint-90{--background:var(--mint-90);background:var(--mint-90)!important}.bg-mint-80{--background:var(--mint-80);background:var(--mint-80)!important}.bg-mint-70{--background:var(--mint-70);background:var(--mint-70)!important}.bg-mint-60{--background:var(--mint-60);background:var(--mint-60)!important}.bg-mint-50{--background:var(--mint-50);background:var(--mint-50)!important}.bg-mint-40{--background:var(--mint-40);background:var(--mint-40)!important}.bg-mint-30{--background:var(--mint-30);background:var(--mint-30)!important}.bg-mint-20{--background:var(--mint-20);background:var(--mint-20)!important}.bg-mint-10{--background:var(--mint-10);background:var(--mint-10)!important}.bg-mint-5{--background:var(--mint-5);background:var(--mint-5)!important}.bg-mint-cool-90{--background:var(--mint-cool-90);background:var(--mint-cool-90)!important}.bg-mint-cool-80{--background:var(--mint-cool-80);background:var(--mint-cool-80)!important}.bg-mint-cool-70{--background:var(--mint-cool-70);background:var(--mint-cool-70)!important}.bg-mint-cool-60{--background:var(--mint-cool-60);background:var(--mint-cool-60)!important}.bg-mint-cool-50{--background:var(--mint-cool-50);background:var(--mint-cool-50)!important}.bg-mint-cool-40{--background:var(--mint-cool-40);background:var(--mint-cool-40)!important}.bg-mint-cool-30{--background:var(--mint-cool-30);background:var(--mint-cool-30)!important}.bg-mint-cool-20{--background:var(--mint-cool-20);background:var(--mint-cool-20)!important}.bg-mint-cool-10{--background:var(--mint-cool-10);background:var(--mint-cool-10)!important}.bg-mint-cool-5{--background:var(--mint-cool-5);background:var(--mint-cool-5)!important}.bg-mint-vivid-80{--background:var(--mint-vivid-80);background:var(--mint-vivid-80)!important}.bg-mint-vivid-70{--background:var(--mint-vivid-70);background:var(--mint-vivid-70)!important}.bg-mint-vivid-60{--background:var(--mint-vivid-60);background:var(--mint-vivid-60)!important}.bg-mint-vivid-50{--background:var(--mint-vivid-50);background:var(--mint-vivid-50)!important}.bg-mint-vivid-40{--background:var(--mint-vivid-40);background:var(--mint-vivid-40)!important}.bg-mint-vivid-30{--background:var(--mint-vivid-30);background:var(--mint-vivid-30)!important}.bg-mint-vivid-20{--background:var(--mint-vivid-20);background:var(--mint-vivid-20)!important}.bg-mint-vivid-10{--background:var(--mint-vivid-10);background:var(--mint-vivid-10)!important}.bg-mint-vivid-5{--background:var(--mint-vivid-5);background:var(--mint-vivid-5)!important}.bg-mint-cool-vivid-80{--background:var(--mint-cool-vivid-80);background:var(--mint-cool-vivid-80)!important}.bg-mint-cool-vivid-70{--background:var(--mint-cool-vivid-70);background:var(--mint-cool-vivid-70)!important}.bg-mint-cool-vivid-60{--background:var(--mint-cool-vivid-60);background:var(--mint-cool-vivid-60)!important}.bg-mint-cool-vivid-50{--background:var(--mint-cool-vivid-50);background:var(--mint-cool-vivid-50)!important}.bg-mint-cool-vivid-40{--background:var(--mint-cool-vivid-40);background:var(--mint-cool-vivid-40)!important}.bg-mint-cool-vivid-30{--background:var(--mint-cool-vivid-30);background:var(--mint-cool-vivid-30)!important}.bg-mint-cool-vivid-20{--background:var(--mint-cool-vivid-20);background:var(--mint-cool-vivid-20)!important}.bg-mint-cool-vivid-10{--background:var(--mint-cool-vivid-10);background:var(--mint-cool-vivid-10)!important}.bg-mint-cool-vivid-5{--background:var(--mint-cool-vivid-5);background:var(--mint-cool-vivid-5)!important}.bg-orange-90{--background:var(--orange-90);background:var(--orange-90)!important}.bg-orange-80{--background:var(--orange-80);background:var(--orange-80)!important}.bg-orange-70{--background:var(--orange-70);background:var(--orange-70)!important}.bg-orange-60{--background:var(--orange-60);background:var(--orange-60)!important}.bg-orange-50{--background:var(--orange-50);background:var(--orange-50)!important}.bg-orange-40{--background:var(--orange-40);background:var(--orange-40)!important}.bg-orange-30{--background:var(--orange-30);background:var(--orange-30)!important}.bg-orange-20{--background:var(--orange-20);background:var(--orange-20)!important}.bg-orange-10{--background:var(--orange-10);background:var(--orange-10)!important}.bg-orange-5{--background:var(--orange-5);background:var(--orange-5)!important}.bg-orange-warm-90{--background:var(--orange-warm-90);background:var(--orange-warm-90)!important}.bg-orange-warm-80{--background:var(--orange-warm-80);background:var(--orange-warm-80)!important}.bg-orange-warm-70{--background:var(--orange-warm-70);background:var(--orange-warm-70)!important}.bg-orange-warm-60{--background:var(--orange-warm-60);background:var(--orange-warm-60)!important}.bg-orange-warm-50{--background:var(--orange-warm-50);background:var(--orange-warm-50)!important}.bg-orange-warm-40{--background:var(--orange-warm-40);background:var(--orange-warm-40)!important}.bg-orange-warm-30{--background:var(--orange-warm-30);background:var(--orange-warm-30)!important}.bg-orange-warm-20{--background:var(--orange-warm-20);background:var(--orange-warm-20)!important}.bg-orange-warm-10{--background:var(--orange-warm-10);background:var(--orange-warm-10)!important}.bg-orange-warm-5{--background:var(--orange-warm-5);background:var(--orange-warm-5)!important}.bg-orange-vivid-80{--background:var(--orange-vivid-80);background:var(--orange-vivid-80)!important}.bg-orange-vivid-70{--background:var(--orange-vivid-70);background:var(--orange-vivid-70)!important}.bg-orange-vivid-60{--background:var(--orange-vivid-60);background:var(--orange-vivid-60)!important}.bg-orange-vivid-50{--background:var(--orange-vivid-50);background:var(--orange-vivid-50)!important}.bg-orange-vivid-40{--background:var(--orange-vivid-40);background:var(--orange-vivid-40)!important}.bg-orange-vivid-30{--background:var(--orange-vivid-30);background:var(--orange-vivid-30)!important}.bg-orange-vivid-20{--background:var(--orange-vivid-20);background:var(--orange-vivid-20)!important}.bg-orange-vivid-10{--background:var(--orange-vivid-10);background:var(--orange-vivid-10)!important}.bg-orange-vivid-5{--background:var(--orange-vivid-5);background:var(--orange-vivid-5)!important}.bg-orange-warm-vivid-80{--background:var(--orange-warm-vivid-80);background:var(--orange-warm-vivid-80)!important}.bg-orange-warm-vivid-70{--background:var(--orange-warm-vivid-70);background:var(--orange-warm-vivid-70)!important}.bg-orange-warm-vivid-60{--background:var(--orange-warm-vivid-60);background:var(--orange-warm-vivid-60)!important}.bg-orange-warm-vivid-50{--background:var(--orange-warm-vivid-50);background:var(--orange-warm-vivid-50)!important}.bg-orange-warm-vivid-40{--background:var(--orange-warm-vivid-40);background:var(--orange-warm-vivid-40)!important}.bg-orange-warm-vivid-30{--background:var(--orange-warm-vivid-30);background:var(--orange-warm-vivid-30)!important}.bg-orange-warm-vivid-20{--background:var(--orange-warm-vivid-20);background:var(--orange-warm-vivid-20)!important}.bg-orange-warm-vivid-10{--background:var(--orange-warm-vivid-10);background:var(--orange-warm-vivid-10)!important}.bg-orange-warm-vivid-5{--background:var(--orange-warm-vivid-5);background:var(--orange-warm-vivid-5)!important}.bg-pure-100{--background:var(--pure-100);background:var(--pure-100)!important}.bg-pure-0{--background:var(--pure-0);background:var(--pure-0)!important}.text-pure-0{color:var(--pure-0)!important}.bg-red-90{--background:var(--red-90);background:var(--red-90)!important}.bg-red-80{--background:var(--red-80);background:var(--red-80)!important}.bg-red-70{--background:var(--red-70);background:var(--red-70)!important}.bg-red-60{--background:var(--red-60);background:var(--red-60)!important}.bg-red-50{--background:var(--red-50);background:var(--red-50)!important}.bg-red-40{--background:var(--red-40);background:var(--red-40)!important}.bg-red-30{--background:var(--red-30);background:var(--red-30)!important}.bg-red-20{--background:var(--red-20);background:var(--red-20)!important}.bg-red-10{--background:var(--red-10);background:var(--red-10)!important}.bg-red-5{--background:var(--red-5);background:var(--red-5)!important}.bg-red-cool-90{--background:var(--red-cool-90);background:var(--red-cool-90)!important}.bg-red-cool-80{--background:var(--red-cool-80);background:var(--red-cool-80)!important}.bg-red-cool-70{--background:var(--red-cool-70);background:var(--red-cool-70)!important}.bg-red-cool-60{--background:var(--red-cool-60);background:var(--red-cool-60)!important}.bg-red-cool-50{--background:var(--red-cool-50);background:var(--red-cool-50)!important}.bg-red-cool-40{--background:var(--red-cool-40);background:var(--red-cool-40)!important}.bg-red-cool-30{--background:var(--red-cool-30);background:var(--red-cool-30)!important}.bg-red-cool-20{--background:var(--red-cool-20);background:var(--red-cool-20)!important}.bg-red-cool-10{--background:var(--red-cool-10);background:var(--red-cool-10)!important}.bg-red-cool-5{--background:var(--red-cool-5);background:var(--red-cool-5)!important}.bg-red-warm-90{--background:var(--red-warm-90);background:var(--red-warm-90)!important}.bg-red-warm-80{--background:var(--red-warm-80);background:var(--red-warm-80)!important}.bg-red-warm-70{--background:var(--red-warm-70);background:var(--red-warm-70)!important}.bg-red-warm-60{--background:var(--red-warm-60);background:var(--red-warm-60)!important}.bg-red-warm-50{--background:var(--red-warm-50);background:var(--red-warm-50)!important}.bg-red-warm-40{--background:var(--red-warm-40);background:var(--red-warm-40)!important}.bg-red-warm-30{--background:var(--red-warm-30);background:var(--red-warm-30)!important}.bg-red-warm-20{--background:var(--red-warm-20);background:var(--red-warm-20)!important}.bg-red-warm-10{--background:var(--red-warm-10);background:var(--red-warm-10)!important}.bg-red-warm-5{--background:var(--red-warm-5);background:var(--red-warm-5)!important}.bg-red-vivid-80{--background:var(--red-vivid-80);background:var(--red-vivid-80)!important}.bg-red-vivid-70{--background:var(--red-vivid-70);background:var(--red-vivid-70)!important}.bg-red-vivid-60{--background:var(--red-vivid-60);background:var(--red-vivid-60)!important}.bg-red-vivid-50{--background:var(--red-vivid-50);background:var(--red-vivid-50)!important}.bg-red-vivid-40{--background:var(--red-vivid-40);background:var(--red-vivid-40)!important}.bg-red-vivid-30{--background:var(--red-vivid-30);background:var(--red-vivid-30)!important}.bg-red-vivid-20{--background:var(--red-vivid-20);background:var(--red-vivid-20)!important}.bg-red-vivid-10{--background:var(--red-vivid-10);background:var(--red-vivid-10)!important}.bg-red-vivid-5{--background:var(--red-vivid-5);background:var(--red-vivid-5)!important}.bg-red-cool-vivid-80{--background:var(--red-cool-vivid-80);background:var(--red-cool-vivid-80)!important}.bg-red-cool-vivid-70{--background:var(--red-cool-vivid-70);background:var(--red-cool-vivid-70)!important}.bg-red-cool-vivid-60{--background:var(--red-cool-vivid-60);background:var(--red-cool-vivid-60)!important}.bg-red-cool-vivid-50{--background:var(--red-cool-vivid-50);background:var(--red-cool-vivid-50)!important}.bg-red-cool-vivid-40{--background:var(--red-cool-vivid-40);background:var(--red-cool-vivid-40)!important}.bg-red-cool-vivid-30{--background:var(--red-cool-vivid-30);background:var(--red-cool-vivid-30)!important}.bg-red-cool-vivid-20{--background:var(--red-cool-vivid-20);background:var(--red-cool-vivid-20)!important}.bg-red-cool-vivid-10{--background:var(--red-cool-vivid-10);background:var(--red-cool-vivid-10)!important}.bg-red-cool-vivid-5{--background:var(--red-cool-vivid-5);background:var(--red-cool-vivid-5)!important}.bg-red-warm-vivid-80{--background:var(--red-warm-vivid-80);background:var(--red-warm-vivid-80)!important}.bg-red-warm-vivid-70{--background:var(--red-warm-vivid-70);background:var(--red-warm-vivid-70)!important}.bg-red-warm-vivid-60{--background:var(--red-warm-vivid-60);background:var(--red-warm-vivid-60)!important}.bg-red-warm-vivid-50{--background:var(--red-warm-vivid-50);background:var(--red-warm-vivid-50)!important}.bg-red-warm-vivid-40{--background:var(--red-warm-vivid-40);background:var(--red-warm-vivid-40)!important}.bg-red-warm-vivid-30{--background:var(--red-warm-vivid-30);background:var(--red-warm-vivid-30)!important}.bg-red-warm-vivid-20{--background:var(--red-warm-vivid-20);background:var(--red-warm-vivid-20)!important}.bg-red-warm-vivid-10{--background:var(--red-warm-vivid-10);background:var(--red-warm-vivid-10)!important}.bg-red-warm-vivid-5{--background:var(--red-warm-vivid-5);background:var(--red-warm-vivid-5)!important}.bg-violet-90{--background:var(--violet-90);background:var(--violet-90)!important}.bg-violet-80{--background:var(--violet-80);background:var(--violet-80)!important}.bg-violet-70{--background:var(--violet-70);background:var(--violet-70)!important}.bg-violet-60{--background:var(--violet-60);background:var(--violet-60)!important}.bg-violet-50{--background:var(--violet-50);background:var(--violet-50)!important}.bg-violet-40{--background:var(--violet-40);background:var(--violet-40)!important}.bg-violet-30{--background:var(--violet-30);background:var(--violet-30)!important}.bg-violet-20{--background:var(--violet-20);background:var(--violet-20)!important}.bg-violet-10{--background:var(--violet-10);background:var(--violet-10)!important}.bg-violet-5{--background:var(--violet-5);background:var(--violet-5)!important}.bg-violet-warm-90{--background:var(--violet-warm-90);background:var(--violet-warm-90)!important}.bg-violet-warm-80{--background:var(--violet-warm-80);background:var(--violet-warm-80)!important}.bg-violet-warm-70{--background:var(--violet-warm-70);background:var(--violet-warm-70)!important}.bg-violet-warm-60{--background:var(--violet-warm-60);background:var(--violet-warm-60)!important}.bg-violet-warm-50{--background:var(--violet-warm-50);background:var(--violet-warm-50)!important}.bg-violet-warm-40{--background:var(--violet-warm-40);background:var(--violet-warm-40)!important}.bg-violet-warm-30{--background:var(--violet-warm-30);background:var(--violet-warm-30)!important}.bg-violet-warm-20{--background:var(--violet-warm-20);background:var(--violet-warm-20)!important}.bg-violet-warm-10{--background:var(--violet-warm-10);background:var(--violet-warm-10)!important}.bg-violet-warm-5{--background:var(--violet-warm-5);background:var(--violet-warm-5)!important}.bg-violet-vivid-80{--background:var(--violet-vivid-80);background:var(--violet-vivid-80)!important}.bg-violet-vivid-70{--background:var(--violet-vivid-70);background:var(--violet-vivid-70)!important}.bg-violet-vivid-60{--background:var(--violet-vivid-60);background:var(--violet-vivid-60)!important}.bg-violet-vivid-50{--background:var(--violet-vivid-50);background:var(--violet-vivid-50)!important}.bg-violet-vivid-40{--background:var(--violet-vivid-40);background:var(--violet-vivid-40)!important}.bg-violet-vivid-30{--background:var(--violet-vivid-30);background:var(--violet-vivid-30)!important}.bg-violet-vivid-20{--background:var(--violet-vivid-20);background:var(--violet-vivid-20)!important}.bg-violet-vivid-10{--background:var(--violet-vivid-10);background:var(--violet-vivid-10)!important}.bg-violet-vivid-5{--background:var(--violet-vivid-5);background:var(--violet-vivid-5)!important}.bg-violet-warm-vivid-80{--background:var(--violet-warm-vivid-80);background:var(--violet-warm-vivid-80)!important}.bg-violet-warm-vivid-70{--background:var(--violet-warm-vivid-70);background:var(--violet-warm-vivid-70)!important}.bg-violet-warm-vivid-60{--background:var(--violet-warm-vivid-60);background:var(--violet-warm-vivid-60)!important}.bg-violet-warm-vivid-50{--background:var(--violet-warm-vivid-50);background:var(--violet-warm-vivid-50)!important}.bg-violet-warm-vivid-40{--background:var(--violet-warm-vivid-40);background:var(--violet-warm-vivid-40)!important}.bg-violet-warm-vivid-30{--background:var(--violet-warm-vivid-30);background:var(--violet-warm-vivid-30)!important}.bg-violet-warm-vivid-20{--background:var(--violet-warm-vivid-20);background:var(--violet-warm-vivid-20)!important}.bg-violet-warm-vivid-10{--background:var(--violet-warm-vivid-10);background:var(--violet-warm-vivid-10)!important}.bg-violet-warm-vivid-5{--background:var(--violet-warm-vivid-5);background:var(--violet-warm-vivid-5)!important}.bg-yellow-90{--background:var(--yellow-90);background:var(--yellow-90)!important}.bg-yellow-80{--background:var(--yellow-80);background:var(--yellow-80)!important}.bg-yellow-70{--background:var(--yellow-70);background:var(--yellow-70)!important}.bg-yellow-60{--background:var(--yellow-60);background:var(--yellow-60)!important}.bg-yellow-50{--background:var(--yellow-50);background:var(--yellow-50)!important}.bg-yellow-40{--background:var(--yellow-40);background:var(--yellow-40)!important}.bg-yellow-30{--background:var(--yellow-30);background:var(--yellow-30)!important}.bg-yellow-20{--background:var(--yellow-20);background:var(--yellow-20)!important}.bg-yellow-10{--background:var(--yellow-10);background:var(--yellow-10)!important}.bg-yellow-5{--background:var(--yellow-5);background:var(--yellow-5)!important}.bg-yellow-vivid-80{--background:var(--yellow-vivid-80);background:var(--yellow-vivid-80)!important}.bg-yellow-vivid-70{--background:var(--yellow-vivid-70);background:var(--yellow-vivid-70)!important}.bg-yellow-vivid-60{--background:var(--yellow-vivid-60);background:var(--yellow-vivid-60)!important}.bg-yellow-vivid-50{--background:var(--yellow-vivid-50);background:var(--yellow-vivid-50)!important}.bg-yellow-vivid-40{--background:var(--yellow-vivid-40);background:var(--yellow-vivid-40)!important}.bg-yellow-vivid-30{--background:var(--yellow-vivid-30);background:var(--yellow-vivid-30)!important}.bg-yellow-vivid-20{--background:var(--yellow-vivid-20);background:var(--yellow-vivid-20)!important}.bg-yellow-vivid-10{--background:var(--yellow-vivid-10);background:var(--yellow-vivid-10)!important}.bg-yellow-vivid-5{--background:var(--yellow-vivid-5);background:var(--yellow-vivid-5)!important}.bg-interactive{--background:var(--interactive);background:var(--interactive)!important}.bg-interactive-dark{--background:var(--interactive-dark);background:var(--interactive-dark)!important}.bg-danger{--background:var(--danger);background:var(--danger)!important}.bg-warning{--background:var(--warning);background:var(--warning)!important}.bg-success{--background:var(--success);background:var(--success)!important}.bg-info{--background:var(--info);background:var(--info)!important}.bg-primary-pastel-01{background:var(--color-primary-pastel-01)!important}.bg-primary-pastel-02{background:var(--color-primary-pastel-02)!important}.bg-primary-lighten-01{background:var(--color-primary-lighten-01)!important}.bg-primary-lighten-01,.bg-primary-lighten-02{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-primary-lighten-02{background:var(--color-primary-lighten-02)!important}.bg-primary-default{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-primary-default)!important}.text-primary-default{color:var(--color-primary-default)!important}.bg-primary-darken-01{background:var(--color-primary-darken-01)!important}.bg-primary-darken-01,.bg-primary-darken-02{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-primary-darken-02{background:var(--color-primary-darken-02)!important}.bg-secondary-01{background:var(--color-secondary-01)!important}.bg-secondary-02{background:var(--color-secondary-02)!important}.bg-secondary-03{background:var(--color-secondary-03)!important}.bg-secondary-04{background:var(--color-secondary-04)!important}.bg-secondary-05{background:var(--color-secondary-05)!important}.bg-secondary-06{background:var(--color-secondary-06)!important}.bg-secondary-06,.bg-secondary-07{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-secondary-07{background:var(--color-secondary-07)!important}.bg-secondary-08{background:var(--color-secondary-08)!important}.bg-secondary-08,.bg-secondary-09{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-secondary-09{background:var(--color-secondary-09)!important}.bg-highlight{background:var(--color-highlight)!important}.bg-highlight,.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-support-01{background:var(--color-support-01)!important}.bg-support-02{background:var(--color-support-02)!important}.bg-support-03{background:var(--color-support-03)!important}.bg-support-03,.bg-support-04{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-support-04{background:var(--color-support-04)!important}.bg-support-05{background:var(--color-support-05)!important}.bg-support-06{background:var(--color-support-06)!important}.bg-support-07{background:var(--color-support-07)!important}.bg-support-07,.bg-support-08{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.bg-support-08{background:var(--color-support-08)!important}.bg-support-09{background:var(--color-support-09)!important}.bg-support-10{background:var(--color-support-10)!important}.bg-support-11{background:var(--color-support-11)!important}.text-right{text-align:right!important}.text-nowrap{white-space:nowrap!important}.text-medium{font-weight:500!important}.text-base{font-size:var(--font-size-scale-base)!important}.text-down-01{font-size:var(--font-size-scale-down-01)!important}@media (min-width:576px){.text-sm-center{text-align:center!important}.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}}.ease{-webkit-animation-timing-function:ease;animation-timing-function:ease}.ease-in-out{-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear,left top,left bottom,from(var(--status-highlight-overlay)),to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay),var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}.disabled,[disabled]{cursor:not-allowed;opacity:var(--disabled)}.disabled *,[disabled] *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}[data-toggle=collapse]:not(:disabled):hover{background-image:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--interactive-rgb),var(--hover))),to(rgba(var(--interactive-rgb),var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb),var(--hover)),rgba(var(--interactive-rgb),var(--hover)))}[data-toggle=collapse]:focus{outline:none}[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}:host{display:block;position:relative}.br-tooltip .content{border-radius:4px;-webkit-box-shadow:var(--surface-offset-xl) var(--surface-offset-xl) var(--surface-offset-xl) rgba(0,0,0,.16);box-shadow:var(--surface-offset-xl) var(--surface-offset-xl) var(--surface-offset-xl) rgba(0,0,0,.16);color:var(--pure-0);display:none;font-size:var(--font-size-scale-down-01);font-weight:var(--font-weight-regular);left:0;position:absolute;text-align:center;top:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;z-index:4}.br-tooltip .content.small{padding:var(--spacing-scale-base) var(--spacing-scale-base)}.br-tooltip .content.medium{padding:var(--spacing-scale-baseh) var(--spacing-scale-baseh)}.br-tooltip .content.large{padding:var(--spacing-scale-2x) var(--spacing-scale-2x)}.br-tooltip .content.is-visible{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.br-tooltip .content.popover br-button{-ms-flex-item-align:start;align-self:flex-start;margin-left:var(--spacing-scale-half)}.br-tooltip .content:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.br-tooltip .arrow{height:8px;position:absolute;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:8px}.br-tooltip .arrow.info,.br-tooltip .content.info{background-color:var(--blue-warm-vivid-60)}.br-tooltip .arrow.info br-button::part(button),.br-tooltip .content.info br-button::part(button){color:var(--pure-0)}.br-tooltip .arrow.info br-button::part(button):hover,.br-tooltip .content.info br-button::part(button):hover{background:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--pure-0-rgb),var(--hover))),to(rgba(var(--pure-0-rgb),var(--hover))));background:linear-gradient(rgba(var(--pure-0-rgb),var(--hover)),rgba(var(--pure-0-rgb),var(--hover)))}.br-tooltip .arrow.warning,.br-tooltip .content.warning{background-color:var(--yellow-vivid-20);color:var(--gray-80)}.br-tooltip .arrow.warning br-button::part(button),.br-tooltip .content.warning br-button::part(button){color:var(--gray-80)}.br-tooltip .arrow.warning br-button::part(button):hover,.br-tooltip .content.warning br-button::part(button):hover{background:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--gray-80-rgb),var(--hover))),to(rgba(var(--gray-80-rgb),var(--hover))));background:linear-gradient(rgba(var(--gray-80-rgb),var(--hover)),rgba(var(--gray-80-rgb),var(--hover)))}.br-tooltip .arrow.error,.br-tooltip .content.error{background-color:var(--red-vivid-50)}.br-tooltip .arrow.error br-button::part(button),.br-tooltip .content.error br-button::part(button){color:var(--pure-0)}.br-tooltip .arrow.error br-button::part(button):hover,.br-tooltip .content.error br-button::part(button):hover{background:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--pure-0-rgb),var(--hover))),to(rgba(var(--pure-0-rgb),var(--hover))));background:linear-gradient(rgba(var(--pure-0-rgb),var(--hover)),rgba(var(--pure-0-rgb),var(--hover)))}.br-tooltip .arrow.success,.br-tooltip .content.success{background-color:var(--green-cool-vivid-50)}.br-tooltip .arrow.success br-button::part(button),.br-tooltip .content.success br-button::part(button){color:var(--pure-0)}.br-tooltip .arrow.success br-button::part(button):hover,.br-tooltip .content.success br-button::part(button):hover{background:-webkit-gradient(linear,left top,left bottom,from(rgba(var(--pure-0-rgb),var(--hover))),to(rgba(var(--pure-0-rgb),var(--hover))));background:linear-gradient(rgba(var(--pure-0-rgb),var(--hover)),rgba(var(--pure-0-rgb),var(--hover)))}";
|
|
1783
|
+
|
|
1784
|
+
const Tooltip = class {
|
|
1785
|
+
constructor(hostRef) {
|
|
1786
|
+
registerInstance(this, hostRef);
|
|
1787
|
+
this.brDidOpen = createEvent(this, "brDidOpen");
|
|
1788
|
+
this.brDidClose = createEvent(this, "brDidClose");
|
|
1789
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
1790
|
+
this.elementInternals = hostRef.$hostElement$["s-ei"];
|
|
1791
|
+
}
|
|
1792
|
+
else {
|
|
1793
|
+
this.elementInternals = hostRef.$hostElement$.attachInternals();
|
|
1794
|
+
hostRef.$hostElement$["s-ei"] = this.elementInternals;
|
|
1795
|
+
}
|
|
1796
|
+
}
|
|
1797
|
+
get el() { return getElement(this); }
|
|
1798
|
+
/**
|
|
1799
|
+
* Referência ao elemento Internals do componente.
|
|
1800
|
+
* O elemento Internals fornece uma interface para acessar e manipular o estado interno do componente.
|
|
1801
|
+
* Isso é útil para componentes que precisam se integrar com o sistema de formulários nativo do navegador.
|
|
1802
|
+
*/
|
|
1803
|
+
elementInternals;
|
|
1804
|
+
/**
|
|
1805
|
+
* Identificador único.
|
|
1806
|
+
* Caso não seja fornecido, um ID gerado automaticamente será usado.
|
|
1807
|
+
*/
|
|
1808
|
+
customId = Helpers.generateUniqueId();
|
|
1809
|
+
/**
|
|
1810
|
+
* Define a posição do tooltip em relação ao elemento acionador.
|
|
1811
|
+
* As opções disponíveis são: 'top', 'bottom', 'left' e 'right'.
|
|
1812
|
+
* @default 'top'
|
|
1813
|
+
*/
|
|
1814
|
+
position = 'top';
|
|
1815
|
+
/**
|
|
1816
|
+
* Define o tipo de tooltip a ser exibido.
|
|
1817
|
+
* As opções disponíveis são: 'standard' e 'popover'.
|
|
1818
|
+
* O tipo 'standard' exibe um tooltip simples, enquanto o tipo 'popover' exibe um tooltip com mais informações e fechamento por interação.
|
|
1819
|
+
* @default 'standard'
|
|
1820
|
+
*/
|
|
1821
|
+
type = 'standard';
|
|
1822
|
+
/**
|
|
1823
|
+
* Define a densidade do tooltip.
|
|
1824
|
+
* As opções disponíveis são: 'large', 'medium' e 'small'.
|
|
1825
|
+
* A densidade 'small' exibe um tooltip mais compacto, enquanto a densidade 'large' exibe um tooltip mais espaçado.
|
|
1826
|
+
* @default 'medium'
|
|
1827
|
+
*/
|
|
1828
|
+
density = 'medium';
|
|
1829
|
+
/**
|
|
1830
|
+
* Define o estado do tooltip.
|
|
1831
|
+
* Os estados disponíveis são: 'info', 'warning', 'error' e 'success'.
|
|
1832
|
+
* @default 'info'
|
|
1833
|
+
*/
|
|
1834
|
+
state = 'info';
|
|
1835
|
+
/**
|
|
1836
|
+
* Define se o tooltip deve ser exibido automaticamente.
|
|
1837
|
+
* Quando definido como true, o tooltip será exibido automaticamente.
|
|
1838
|
+
* Quando definido como false, o tooltip será exibido apenas quando acionado pelo usuário.
|
|
1839
|
+
* @default false
|
|
1840
|
+
*/
|
|
1841
|
+
isAutoVisible = false;
|
|
1842
|
+
/**
|
|
1843
|
+
* Define o atraso em milissegundos para exibir o tooltip.
|
|
1844
|
+
* @default null
|
|
1845
|
+
*/
|
|
1846
|
+
showDelay = null;
|
|
1847
|
+
/**
|
|
1848
|
+
* Define o atraso em milissegundos para ocultar o tooltip.
|
|
1849
|
+
* @default null
|
|
1850
|
+
*/
|
|
1851
|
+
hideDelay = null;
|
|
1852
|
+
/**
|
|
1853
|
+
* Define a visibilidade do tooltip.
|
|
1854
|
+
* Quando definido como true, o tooltip será exibido.
|
|
1855
|
+
* Quando definido como false, o tooltip será ocultado.
|
|
1856
|
+
* @default false
|
|
1857
|
+
*/
|
|
1858
|
+
isVisible = false;
|
|
1859
|
+
/**
|
|
1860
|
+
* Watcher para monitorar alterações na propriedade `isVisible`.
|
|
1861
|
+
* @param visible boolean
|
|
1862
|
+
* @returns void
|
|
1863
|
+
*/
|
|
1864
|
+
handleVisibilityChange(visible) {
|
|
1865
|
+
if (this.contentElement == null)
|
|
1866
|
+
return;
|
|
1867
|
+
if (visible) {
|
|
1868
|
+
this.positionTooltip();
|
|
1869
|
+
this.brDidOpen.emit();
|
|
1870
|
+
}
|
|
1871
|
+
else {
|
|
1872
|
+
this.clearAutoUpdate?.();
|
|
1873
|
+
this.clearAutoUpdate = undefined;
|
|
1874
|
+
this.brDidClose.emit();
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Evento emitido quando o tooltip é aberto.
|
|
1879
|
+
*/
|
|
1880
|
+
brDidOpen;
|
|
1881
|
+
/**
|
|
1882
|
+
* Evento emitido quando o tooltip é fechado.
|
|
1883
|
+
*/
|
|
1884
|
+
brDidClose;
|
|
1885
|
+
/**
|
|
1886
|
+
* Listener para o evento de foco no elemento acionador.
|
|
1887
|
+
* Este evento é utilizado para exibir o tooltip quando o elemento acionador recebe foco.
|
|
1888
|
+
*/
|
|
1889
|
+
handleFocusIn() {
|
|
1890
|
+
if (!this.fromPointerDown) {
|
|
1891
|
+
this.showContent();
|
|
1892
|
+
}
|
|
1893
|
+
this.fromPointerDown = false;
|
|
1894
|
+
}
|
|
1895
|
+
/**
|
|
1896
|
+
* Listener para o evento de desfoque no elemento acionador.
|
|
1897
|
+
* Este evento é utilizado para ocultar o tooltip quando o elemento acionador perde o foco.
|
|
1898
|
+
*/
|
|
1899
|
+
handleFocusOut() {
|
|
1900
|
+
this.hideContent();
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Listener para o evento de teclado no documento.
|
|
1904
|
+
* Este evento é utilizado para fechar o tooltip quando a tecla Escape é pressionada.
|
|
1905
|
+
* @param event KeyboardEvent
|
|
1906
|
+
*/
|
|
1907
|
+
handleKeyDown(event) {
|
|
1908
|
+
if (event.key === 'Escape') {
|
|
1909
|
+
event.preventDefault();
|
|
1910
|
+
this.hideContent();
|
|
1911
|
+
this.triggerElement?.focus();
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
floatingManager;
|
|
1915
|
+
/**
|
|
1916
|
+
* Elemento que aciona a exibição do tooltip.
|
|
1917
|
+
* Este elemento é referenciado para garantir que o tooltip seja posicionado corretamente em relação a ele.
|
|
1918
|
+
*/
|
|
1919
|
+
triggerElement;
|
|
1920
|
+
/**
|
|
1921
|
+
* Elemento que contém o conteúdo do tooltip.
|
|
1922
|
+
* Este elemento é referenciado para garantir que o tooltip seja posicionado corretamente em relação a ele.
|
|
1923
|
+
*/
|
|
1924
|
+
contentElement;
|
|
1925
|
+
/**
|
|
1926
|
+
* Elemento que representa a seta do tooltip.
|
|
1927
|
+
* Este elemento é utilizado para indicar a direção do tooltip em relação ao elemento acionador.
|
|
1928
|
+
*/
|
|
1929
|
+
arrowElement;
|
|
1930
|
+
/**
|
|
1931
|
+
* Função de limpeza para atualizar a posição do tooltip automaticamente.
|
|
1932
|
+
* Esta função é chamada quando o tooltip não está mais visível ou quando o componente é desconectado.
|
|
1933
|
+
* Isso garante que o tooltip não consuma recursos desnecessários quando não estiver em uso.
|
|
1934
|
+
*/
|
|
1935
|
+
clearAutoUpdate;
|
|
1936
|
+
/**
|
|
1937
|
+
* Tempo limite para exibir o tooltip automaticamente.
|
|
1938
|
+
*/
|
|
1939
|
+
showTimer;
|
|
1940
|
+
/**
|
|
1941
|
+
* Tempo limite para ocultar o tooltip.
|
|
1942
|
+
*/
|
|
1943
|
+
hideTimer;
|
|
1944
|
+
/**
|
|
1945
|
+
* Indica se o tooltip foi acionado por um clique do mouse.
|
|
1946
|
+
* Isso é utilizado para evitar conflito com o acionamento por foco.
|
|
1947
|
+
*/
|
|
1948
|
+
fromPointerDown = false;
|
|
1949
|
+
/**
|
|
1950
|
+
* Controla a exibição do tooltip.
|
|
1951
|
+
* Quando o tooltip é exibido, ele é posicionado em relação ao elemento acionador.
|
|
1952
|
+
* Isso é feito utilizando a biblioteca Floating UI, que calcula a posição ideal do tooltip com base no espaço disponível na tela.
|
|
1953
|
+
* A função `autoUpdate` é utilizada para atualizar automaticamente a posição do tooltip quando o elemento acionador é movido ou redimensionado.
|
|
1954
|
+
*/
|
|
1955
|
+
positionTooltip() {
|
|
1956
|
+
if (this.triggerElement == null || this.contentElement == null)
|
|
1957
|
+
return;
|
|
1958
|
+
this.floatingManager = new FloatingUIManager({
|
|
1959
|
+
triggerElement: this.triggerElement,
|
|
1960
|
+
contentElement: this.contentElement,
|
|
1961
|
+
arrowElement: this.arrowElement,
|
|
1962
|
+
placement: this.position,
|
|
1963
|
+
});
|
|
1964
|
+
this.floatingManager.start();
|
|
1965
|
+
}
|
|
1966
|
+
cleanupPositioning() {
|
|
1967
|
+
this.floatingManager?.stop();
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Define os eventos de interação do tooltip.
|
|
1971
|
+
* Os eventos de interação incluem mouseenter, mouseleave, focus e blur.
|
|
1972
|
+
* @returns void
|
|
1973
|
+
*/
|
|
1974
|
+
setupInteractions() {
|
|
1975
|
+
if (this.triggerElement == null || this.contentElement == null)
|
|
1976
|
+
return;
|
|
1977
|
+
if (this.type === 'standard') {
|
|
1978
|
+
this.triggerElement.addEventListener('mouseenter', this.showContent);
|
|
1979
|
+
this.triggerElement.addEventListener('mouseleave', this.hideContent);
|
|
1980
|
+
}
|
|
1981
|
+
if (this.type === 'popover') {
|
|
1982
|
+
this.triggerElement.addEventListener('pointerdown', this.toggleContent);
|
|
1983
|
+
}
|
|
1984
|
+
if (this.isAutoVisible) {
|
|
1985
|
+
requestAnimationFrame(() => {
|
|
1986
|
+
this.clearShowTimer();
|
|
1987
|
+
this.setShowTimer();
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Alterna a exibição do tooltip.
|
|
1993
|
+
* Se o tooltip estiver visível, ele será ocultado.
|
|
1994
|
+
* Se o tooltip estiver oculto, ele será exibido.
|
|
1995
|
+
*/
|
|
1996
|
+
toggleContent = () => {
|
|
1997
|
+
this.fromPointerDown = true;
|
|
1998
|
+
if (this.isVisible) {
|
|
1999
|
+
this.hideContent();
|
|
2000
|
+
}
|
|
2001
|
+
else {
|
|
2002
|
+
this.showContent();
|
|
2003
|
+
}
|
|
2004
|
+
};
|
|
2005
|
+
/**
|
|
2006
|
+
* Processa as ações relacionadas à exibição do tooltip.
|
|
2007
|
+
* Isso inclui exibir o tooltip e iniciar o tempo limite de ocultação automática.
|
|
2008
|
+
* @returns void
|
|
2009
|
+
*/
|
|
2010
|
+
showContent = () => {
|
|
2011
|
+
if (this.contentElement == null)
|
|
2012
|
+
return;
|
|
2013
|
+
this.isVisible = true;
|
|
2014
|
+
if (this.isAutoVisible) {
|
|
2015
|
+
if (this.hideDelay !== null) {
|
|
2016
|
+
this.clearHideTimer();
|
|
2017
|
+
this.setHideTimer();
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
if (this.type === 'popover') {
|
|
2021
|
+
document.addEventListener('click', this.handleOutsideClick);
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
/**
|
|
2025
|
+
* Processa as ações relacionadas ao fechamento do tooltip.
|
|
2026
|
+
* Isso inclui ocultar o tooltip e limpar o tempo limite de ocultação automática.
|
|
2027
|
+
* @returns void
|
|
2028
|
+
*/
|
|
2029
|
+
hideContent = () => {
|
|
2030
|
+
if (this.contentElement == null)
|
|
2031
|
+
return;
|
|
2032
|
+
this.isVisible = false;
|
|
2033
|
+
if (this.type === 'popover') {
|
|
2034
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
2035
|
+
requestAnimationFrame(() => this.contentElement?.focus());
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
/**
|
|
2039
|
+
* Configura o tempo limite para exibir o tooltip automaticamente.
|
|
2040
|
+
* O tempo limite é definido pelo valor da propriedade `showDelay`.
|
|
2041
|
+
*/
|
|
2042
|
+
setShowTimer() {
|
|
2043
|
+
this.showTimer = setTimeout(() => {
|
|
2044
|
+
this.showContent();
|
|
2045
|
+
}, this.showDelay || 0);
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Limpa o tempo limite de exibição automática do tooltip.
|
|
2049
|
+
*/
|
|
2050
|
+
clearShowTimer() {
|
|
2051
|
+
if (this.showTimer !== undefined) {
|
|
2052
|
+
clearTimeout(this.showTimer);
|
|
2053
|
+
this.showTimer = undefined;
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
/**
|
|
2057
|
+
* Configura o tempo limite para ocultar o tooltip automaticamente.
|
|
2058
|
+
* O tempo limite é definido pelo valor da propriedade `hideDelay`.
|
|
2059
|
+
*/
|
|
2060
|
+
setHideTimer() {
|
|
2061
|
+
this.hideTimer = setTimeout(() => {
|
|
2062
|
+
this.hideContent();
|
|
2063
|
+
}, this.hideDelay);
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* Limpa o tempo limite de ocultação automática do tooltip.
|
|
2067
|
+
*/
|
|
2068
|
+
clearHideTimer() {
|
|
2069
|
+
if (this.hideTimer !== undefined) {
|
|
2070
|
+
clearTimeout(this.hideTimer);
|
|
2071
|
+
this.hideTimer = undefined;
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2074
|
+
/**
|
|
2075
|
+
* Lida com cliques fora do tooltip.
|
|
2076
|
+
* É utilizado para o tooltip do tipo 'popover'.
|
|
2077
|
+
* @param event MouseEvent
|
|
2078
|
+
*/
|
|
2079
|
+
handleOutsideClick = (event) => {
|
|
2080
|
+
const path = event.composedPath();
|
|
2081
|
+
if (this.isVisible &&
|
|
2082
|
+
this.type === 'popover' &&
|
|
2083
|
+
!path.includes(this.contentElement) &&
|
|
2084
|
+
!path.includes(this.triggerElement)) {
|
|
2085
|
+
this.hideContent();
|
|
2086
|
+
}
|
|
2087
|
+
};
|
|
2088
|
+
/**
|
|
2089
|
+
* Determina o mapeamento de classes CSS do componente.
|
|
2090
|
+
* @returns Um objeto que representa o mapeamento de classes CSS do componente.
|
|
2091
|
+
*/
|
|
2092
|
+
getCssClassMap() {
|
|
2093
|
+
return {
|
|
2094
|
+
'br-tooltip': true,
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Determina o mapeamento de classes CSS do trigger.
|
|
2099
|
+
* @returns Um objeto que representa o mapeamento de classes CSS do trigger.
|
|
2100
|
+
*/
|
|
2101
|
+
getTriggerCssClassMap() {
|
|
2102
|
+
return {
|
|
2103
|
+
trigger: true,
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* Determina o mapeamento de classes CSS do conteúdo.
|
|
2108
|
+
* @returns Um objeto que representa o mapeamento de classes CSS do conteúdo.
|
|
2109
|
+
*/
|
|
2110
|
+
getContentCssClassMap() {
|
|
2111
|
+
return {
|
|
2112
|
+
'is-visible': this.isVisible,
|
|
2113
|
+
content: true,
|
|
2114
|
+
popover: this.type === 'popover',
|
|
2115
|
+
large: this.density === 'large',
|
|
2116
|
+
medium: this.density === 'medium',
|
|
2117
|
+
small: this.density === 'small',
|
|
2118
|
+
info: this.state === 'info',
|
|
2119
|
+
warning: this.state === 'warning',
|
|
2120
|
+
error: this.state === 'error',
|
|
2121
|
+
success: this.state === 'success',
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Determina o mapeamento de classes CSS da seta.
|
|
2126
|
+
* @returns Um objeto que representa o mapeamento de classes CSS da seta.
|
|
2127
|
+
*/
|
|
2128
|
+
getArrowCssClassMap() {
|
|
2129
|
+
return {
|
|
2130
|
+
arrow: true,
|
|
2131
|
+
large: this.density === 'large',
|
|
2132
|
+
medium: this.density === 'medium',
|
|
2133
|
+
small: this.density === 'small',
|
|
2134
|
+
info: this.state === 'info',
|
|
2135
|
+
warning: this.state === 'warning',
|
|
2136
|
+
error: this.state === 'error',
|
|
2137
|
+
success: this.state === 'success',
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* Método do ciclo de vida do componente.
|
|
2142
|
+
* Este método é chamado uma única vez após o componente ser montado no DOM.
|
|
2143
|
+
*/
|
|
2144
|
+
componentDidLoad() {
|
|
2145
|
+
if (typeof window === 'undefined')
|
|
2146
|
+
return;
|
|
2147
|
+
this.setupInteractions();
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Método do ciclo de vida do componente.
|
|
2151
|
+
* Este método é chamado quando o componente é desconectado do DOM.
|
|
2152
|
+
*/
|
|
2153
|
+
disconnectedCallback() {
|
|
2154
|
+
if (this.type === 'standard') {
|
|
2155
|
+
this.triggerElement?.removeEventListener('mouseenter', this.showContent);
|
|
2156
|
+
this.triggerElement?.removeEventListener('mouseleave', this.hideContent);
|
|
2157
|
+
}
|
|
2158
|
+
else if (this.type === 'popover') {
|
|
2159
|
+
this.triggerElement?.removeEventListener('pointerdown', this.toggleContent);
|
|
2160
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
2161
|
+
}
|
|
2162
|
+
this.cleanupPositioning();
|
|
2163
|
+
this.clearShowTimer();
|
|
2164
|
+
this.clearHideTimer();
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Renderiza o componente.
|
|
2168
|
+
* Este método é responsável por gerar o conteúdo HTML do componente.
|
|
2169
|
+
* Ele utiliza a função `h` do Stencil para criar elementos JSX.
|
|
2170
|
+
* @returns JSX.Element
|
|
2171
|
+
*/
|
|
2172
|
+
render() {
|
|
2173
|
+
return (h(Host, { key: 'c2ee0c8f2fb36acda135948629412023bce72e2b' }, h("div", { key: '05d87a50f8e33874bf9ecf7eeb0d8ac5cb79df3e', id: this.customId, class: this.getCssClassMap() }, h("div", { key: '71997f8547d509d31cb51f446354ed071ced6e30', class: this.getTriggerCssClassMap(), ref: (el) => (this.triggerElement = el), "aria-describedby": `${this.customId}-content`, "aria-expanded": this.isVisible ? 'true' : 'false', "aria-controls": `${this.customId}-content`, role: "button", tabindex: "-1 " }, h("slot", { key: 'b21d028a56374bc1ade6723b482b36eaf095d61a', name: "trigger" })), h("div", { key: 'ad412dcef59491cd56e5dbc7ce74a9e57fdec640', id: `${this.customId}-content`, class: this.getContentCssClassMap(), ref: (el) => (this.contentElement = el), role: this.type === 'popover' ? 'dialog' : 'tooltip', tabindex: "-1" }, h("slot", { key: '6a92b688e02a9a63786fcb999dc7a923c271087a', name: "content" }), this.type === 'popover' && (h("br-button", { key: 'd3cb6806d7b71e6893da692c087f54bce057483e', class: "close", shape: "circle", density: "small", onClick: this.hideContent, "aria-label": "Fechar popover" }, h("br-icon", { key: '0661b70afafe7bd7203cc93cbdf2537ad5dfb389', "icon-name": "fa6-solid:xmark" }))), h("div", { key: '852540bd9ef91d874df93785192dba5af023e3d8', class: this.getArrowCssClassMap(), ref: (el) => (this.arrowElement = el) })))));
|
|
2174
|
+
}
|
|
2175
|
+
static get formAssociated() { return true; }
|
|
2176
|
+
static get watchers() { return {
|
|
2177
|
+
"isVisible": ["handleVisibilityChange"]
|
|
2178
|
+
}; }
|
|
2179
|
+
};
|
|
2180
|
+
Tooltip.style = tooltipCss;
|
|
2181
|
+
|
|
2182
|
+
export { Tooltip as br_tooltip };
|
|
2183
|
+
//# sourceMappingURL=br-tooltip.entry.js.map
|
|
2184
|
+
|
|
2185
|
+
//# sourceMappingURL=br-tooltip.entry.js.map
|