@vonage/vivid 3.51.0 → 3.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +4 -3
- package/audio-player/index.js +4 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -8
- package/combobox/index.js +5 -8
- package/custom-elements.json +2310 -769
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -9
- package/date-picker/index.js +7 -9
- package/date-range-picker/index.cjs +7 -9
- package/date-range-picker/index.js +7 -9
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -5
- package/file-picker/index.js +4 -5
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +135 -123
- package/index.js +48 -46
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +3 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +25 -24
- package/listbox/index.js +25 -24
- package/locales/en-GB.cjs +34 -0
- package/locales/en-GB.js +34 -0
- package/locales/en-US.cjs +202 -0
- package/locales/en-US.js +202 -0
- package/locales/ja-JP.cjs +202 -1
- package/locales/ja-JP.js +202 -1
- package/locales/zh-CN.cjs +203 -0
- package/locales/zh-CN.js +203 -0
- package/menu/index.cjs +7 -7
- package/menu/index.js +7 -7
- package/menu-item/index.cjs +4 -4
- package/menu-item/index.js +4 -4
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -6
- package/number-field/index.js +5 -6
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +34 -34
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +9 -4
- package/shared/definition.js +9 -4
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +77 -49
- package/shared/definition11.js +78 -50
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +34 -33
- package/shared/definition14.js +34 -33
- package/shared/definition15.cjs +24 -12
- package/shared/definition15.js +24 -12
- package/shared/definition16.cjs +38 -43
- package/shared/definition16.js +38 -43
- package/shared/definition17.cjs +126 -66
- package/shared/definition17.js +127 -67
- package/shared/definition18.cjs +31 -15
- package/shared/definition18.js +31 -15
- package/shared/definition19.cjs +117 -81
- package/shared/definition19.js +117 -81
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +187 -227
- package/shared/definition20.js +183 -223
- package/shared/definition21.cjs +262 -69
- package/shared/definition21.js +261 -67
- package/shared/definition22.cjs +66 -61
- package/shared/definition22.js +64 -60
- package/shared/definition23.cjs +42 -77
- package/shared/definition23.js +41 -76
- package/shared/definition24.cjs +65 -2350
- package/shared/definition24.js +64 -2349
- package/shared/definition25.cjs +2402 -48
- package/shared/definition25.js +2401 -47
- package/shared/definition26.cjs +62 -28
- package/shared/definition26.js +61 -27
- package/shared/definition27.cjs +28 -54
- package/shared/definition27.js +27 -53
- package/shared/definition28.cjs +39 -819
- package/shared/definition28.js +38 -817
- package/shared/definition29.cjs +893 -54
- package/shared/definition29.js +893 -55
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +69 -85
- package/shared/definition30.js +68 -84
- package/shared/definition31.cjs +86 -23
- package/shared/definition31.js +86 -23
- package/shared/definition32.cjs +24 -14
- package/shared/definition32.js +23 -13
- package/shared/definition33.cjs +11 -53
- package/shared/definition33.js +10 -52
- package/shared/definition34.cjs +28 -500
- package/shared/definition34.js +28 -500
- package/shared/definition35.cjs +447 -194
- package/shared/definition35.js +447 -192
- package/shared/definition36.cjs +258 -188
- package/shared/definition36.js +255 -187
- package/shared/definition37.cjs +204 -78
- package/shared/definition37.js +203 -76
- package/shared/definition38.cjs +55 -51
- package/shared/definition38.js +52 -49
- package/shared/definition39.cjs +65 -423
- package/shared/definition39.js +64 -422
- package/shared/definition4.cjs +24 -12
- package/shared/definition4.js +24 -12
- package/shared/definition40.cjs +447 -35
- package/shared/definition40.js +444 -32
- package/shared/definition41.cjs +35 -678
- package/shared/definition41.js +34 -677
- package/shared/definition42.cjs +544 -99
- package/shared/definition42.js +543 -98
- package/shared/definition43.cjs +696 -77
- package/shared/definition43.js +695 -76
- package/shared/definition44.cjs +113 -563
- package/shared/definition44.js +112 -561
- package/shared/definition45.cjs +77 -117
- package/shared/definition45.js +75 -115
- package/shared/definition46.cjs +474 -86
- package/shared/definition46.js +474 -87
- package/shared/definition47.cjs +140 -23
- package/shared/definition47.js +139 -22
- package/shared/definition48.cjs +132 -57
- package/shared/definition48.js +131 -56
- package/shared/definition49.cjs +18 -524
- package/shared/definition49.js +17 -523
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +73 -25
- package/shared/definition50.js +72 -24
- package/shared/definition51.cjs +506 -99
- package/shared/definition51.js +505 -99
- package/shared/definition52.cjs +29 -277
- package/shared/definition52.js +28 -276
- package/shared/definition53.cjs +97 -256
- package/shared/definition53.js +97 -255
- package/shared/definition54.cjs +287 -769
- package/shared/definition54.js +287 -769
- package/shared/definition55.cjs +305 -105
- package/shared/definition55.js +304 -104
- package/shared/definition56.cjs +841 -81
- package/shared/definition56.js +840 -80
- package/shared/definition57.cjs +153 -69
- package/shared/definition57.js +152 -68
- package/shared/definition58.cjs +138 -299
- package/shared/definition58.js +137 -298
- package/shared/definition59.cjs +72 -27
- package/shared/definition59.js +71 -26
- package/shared/definition6.cjs +4 -5
- package/shared/definition6.js +4 -5
- package/shared/definition60.cjs +279 -1780
- package/shared/definition60.js +278 -1779
- package/shared/definition61.cjs +65870 -11
- package/shared/definition61.js +65869 -11
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +8 -6
- package/shared/definition7.js +8 -6
- package/shared/definition8.cjs +27 -20
- package/shared/definition8.js +27 -20
- package/shared/definition9.cjs +7 -10
- package/shared/definition9.js +7 -10
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +67 -38
- package/shared/index2.js +67 -38
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +6 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +140 -81
- package/shared/presentationDate.js +140 -81
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +33 -33
- package/shared/text-anchor.template.js +33 -33
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -6
- package/text-field/index.js +4 -6
- package/time-picker/index.cjs +8 -10
- package/time-picker/index.js +8 -10
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +428 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition60.cjs
CHANGED
|
@@ -1,1810 +1,309 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const treeItem = require('./tree-item.cjs');
|
|
5
|
+
const dom = require('./dom.cjs');
|
|
6
|
+
const keyCodes = require('./key-codes.cjs');
|
|
6
7
|
const ref = require('./ref.cjs');
|
|
7
|
-
const
|
|
8
|
+
const slotted = require('./slotted.cjs');
|
|
8
9
|
const classNames = require('./class-names.cjs');
|
|
9
10
|
|
|
10
|
-
const sides = ['top', 'right', 'bottom', 'left'];
|
|
11
|
-
const min = Math.min;
|
|
12
|
-
const max = Math.max;
|
|
13
|
-
const round = Math.round;
|
|
14
|
-
const floor = Math.floor;
|
|
15
|
-
const createCoords = v => ({
|
|
16
|
-
x: v,
|
|
17
|
-
y: v
|
|
18
|
-
});
|
|
19
|
-
const oppositeSideMap = {
|
|
20
|
-
left: 'right',
|
|
21
|
-
right: 'left',
|
|
22
|
-
bottom: 'top',
|
|
23
|
-
top: 'bottom'
|
|
24
|
-
};
|
|
25
|
-
const oppositeAlignmentMap = {
|
|
26
|
-
start: 'end',
|
|
27
|
-
end: 'start'
|
|
28
|
-
};
|
|
29
|
-
function clamp(start, value, end) {
|
|
30
|
-
return max(start, min(value, end));
|
|
31
|
-
}
|
|
32
|
-
function evaluate(value, param) {
|
|
33
|
-
return typeof value === 'function' ? value(param) : value;
|
|
34
|
-
}
|
|
35
|
-
function getSide(placement) {
|
|
36
|
-
return placement.split('-')[0];
|
|
37
|
-
}
|
|
38
|
-
function getAlignment(placement) {
|
|
39
|
-
return placement.split('-')[1];
|
|
40
|
-
}
|
|
41
|
-
function getOppositeAxis(axis) {
|
|
42
|
-
return axis === 'x' ? 'y' : 'x';
|
|
43
|
-
}
|
|
44
|
-
function getAxisLength(axis) {
|
|
45
|
-
return axis === 'y' ? 'height' : 'width';
|
|
46
|
-
}
|
|
47
|
-
function getSideAxis(placement) {
|
|
48
|
-
return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
|
|
49
|
-
}
|
|
50
|
-
function getAlignmentAxis(placement) {
|
|
51
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
52
|
-
}
|
|
53
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
54
|
-
if (rtl === void 0) {
|
|
55
|
-
rtl = false;
|
|
56
|
-
}
|
|
57
|
-
const alignment = getAlignment(placement);
|
|
58
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
59
|
-
const length = getAxisLength(alignmentAxis);
|
|
60
|
-
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
61
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
62
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
63
|
-
}
|
|
64
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
65
|
-
}
|
|
66
|
-
function getExpandedPlacements(placement) {
|
|
67
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
68
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
69
|
-
}
|
|
70
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
71
|
-
return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
|
|
72
|
-
}
|
|
73
|
-
function getSideList(side, isStart, rtl) {
|
|
74
|
-
const lr = ['left', 'right'];
|
|
75
|
-
const rl = ['right', 'left'];
|
|
76
|
-
const tb = ['top', 'bottom'];
|
|
77
|
-
const bt = ['bottom', 'top'];
|
|
78
|
-
switch (side) {
|
|
79
|
-
case 'top':
|
|
80
|
-
case 'bottom':
|
|
81
|
-
if (rtl) return isStart ? rl : lr;
|
|
82
|
-
return isStart ? lr : rl;
|
|
83
|
-
case 'left':
|
|
84
|
-
case 'right':
|
|
85
|
-
return isStart ? tb : bt;
|
|
86
|
-
default:
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
91
|
-
const alignment = getAlignment(placement);
|
|
92
|
-
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
93
|
-
if (alignment) {
|
|
94
|
-
list = list.map(side => side + "-" + alignment);
|
|
95
|
-
if (flipAlignment) {
|
|
96
|
-
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return list;
|
|
100
|
-
}
|
|
101
|
-
function getOppositePlacement(placement) {
|
|
102
|
-
return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
|
|
103
|
-
}
|
|
104
|
-
function expandPaddingObject(padding) {
|
|
105
|
-
return {
|
|
106
|
-
top: 0,
|
|
107
|
-
right: 0,
|
|
108
|
-
bottom: 0,
|
|
109
|
-
left: 0,
|
|
110
|
-
...padding
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function getPaddingObject(padding) {
|
|
114
|
-
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
115
|
-
top: padding,
|
|
116
|
-
right: padding,
|
|
117
|
-
bottom: padding,
|
|
118
|
-
left: padding
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function rectToClientRect(rect) {
|
|
122
|
-
return {
|
|
123
|
-
...rect,
|
|
124
|
-
top: rect.y,
|
|
125
|
-
left: rect.x,
|
|
126
|
-
right: rect.x + rect.width,
|
|
127
|
-
bottom: rect.y + rect.height
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
132
|
-
let {
|
|
133
|
-
reference,
|
|
134
|
-
floating
|
|
135
|
-
} = _ref;
|
|
136
|
-
const sideAxis = getSideAxis(placement);
|
|
137
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
138
|
-
const alignLength = getAxisLength(alignmentAxis);
|
|
139
|
-
const side = getSide(placement);
|
|
140
|
-
const isVertical = sideAxis === 'y';
|
|
141
|
-
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
142
|
-
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
143
|
-
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
144
|
-
let coords;
|
|
145
|
-
switch (side) {
|
|
146
|
-
case 'top':
|
|
147
|
-
coords = {
|
|
148
|
-
x: commonX,
|
|
149
|
-
y: reference.y - floating.height
|
|
150
|
-
};
|
|
151
|
-
break;
|
|
152
|
-
case 'bottom':
|
|
153
|
-
coords = {
|
|
154
|
-
x: commonX,
|
|
155
|
-
y: reference.y + reference.height
|
|
156
|
-
};
|
|
157
|
-
break;
|
|
158
|
-
case 'right':
|
|
159
|
-
coords = {
|
|
160
|
-
x: reference.x + reference.width,
|
|
161
|
-
y: commonY
|
|
162
|
-
};
|
|
163
|
-
break;
|
|
164
|
-
case 'left':
|
|
165
|
-
coords = {
|
|
166
|
-
x: reference.x - floating.width,
|
|
167
|
-
y: commonY
|
|
168
|
-
};
|
|
169
|
-
break;
|
|
170
|
-
default:
|
|
171
|
-
coords = {
|
|
172
|
-
x: reference.x,
|
|
173
|
-
y: reference.y
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
switch (getAlignment(placement)) {
|
|
177
|
-
case 'start':
|
|
178
|
-
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
179
|
-
break;
|
|
180
|
-
case 'end':
|
|
181
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
return coords;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
11
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
12
|
+
* A Tree view Custom HTML Element.
|
|
13
|
+
* Implements the {@link https://w3c.github.io/aria-practices/#TreeView | ARIA TreeView }.
|
|
190
14
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
|
|
194
|
-
const computePosition$1 = async (reference, floating, config) => {
|
|
195
|
-
const {
|
|
196
|
-
placement = 'bottom',
|
|
197
|
-
strategy = 'absolute',
|
|
198
|
-
middleware = [],
|
|
199
|
-
platform
|
|
200
|
-
} = config;
|
|
201
|
-
const validMiddleware = middleware.filter(Boolean);
|
|
202
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
203
|
-
let rects = await platform.getElementRects({
|
|
204
|
-
reference,
|
|
205
|
-
floating,
|
|
206
|
-
strategy
|
|
207
|
-
});
|
|
208
|
-
let {
|
|
209
|
-
x,
|
|
210
|
-
y
|
|
211
|
-
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
212
|
-
let statefulPlacement = placement;
|
|
213
|
-
let middlewareData = {};
|
|
214
|
-
let resetCount = 0;
|
|
215
|
-
for (let i = 0; i < validMiddleware.length; i++) {
|
|
216
|
-
const {
|
|
217
|
-
name,
|
|
218
|
-
fn
|
|
219
|
-
} = validMiddleware[i];
|
|
220
|
-
const {
|
|
221
|
-
x: nextX,
|
|
222
|
-
y: nextY,
|
|
223
|
-
data,
|
|
224
|
-
reset
|
|
225
|
-
} = await fn({
|
|
226
|
-
x,
|
|
227
|
-
y,
|
|
228
|
-
initialPlacement: placement,
|
|
229
|
-
placement: statefulPlacement,
|
|
230
|
-
strategy,
|
|
231
|
-
middlewareData,
|
|
232
|
-
rects,
|
|
233
|
-
platform,
|
|
234
|
-
elements: {
|
|
235
|
-
reference,
|
|
236
|
-
floating
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
x = nextX != null ? nextX : x;
|
|
240
|
-
y = nextY != null ? nextY : y;
|
|
241
|
-
middlewareData = {
|
|
242
|
-
...middlewareData,
|
|
243
|
-
[name]: {
|
|
244
|
-
...middlewareData[name],
|
|
245
|
-
...data
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
if (reset && resetCount <= 50) {
|
|
249
|
-
resetCount++;
|
|
250
|
-
if (typeof reset === 'object') {
|
|
251
|
-
if (reset.placement) {
|
|
252
|
-
statefulPlacement = reset.placement;
|
|
253
|
-
}
|
|
254
|
-
if (reset.rects) {
|
|
255
|
-
rects = reset.rects === true ? await platform.getElementRects({
|
|
256
|
-
reference,
|
|
257
|
-
floating,
|
|
258
|
-
strategy
|
|
259
|
-
}) : reset.rects;
|
|
260
|
-
}
|
|
261
|
-
({
|
|
262
|
-
x,
|
|
263
|
-
y
|
|
264
|
-
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
265
|
-
}
|
|
266
|
-
i = -1;
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return {
|
|
271
|
-
x,
|
|
272
|
-
y,
|
|
273
|
-
placement: statefulPlacement,
|
|
274
|
-
strategy,
|
|
275
|
-
middlewareData
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
281
|
-
* element is overflowing a given clipping boundary on each side.
|
|
282
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
283
|
-
* - negative = how many pixels left before it will overflow
|
|
284
|
-
* - 0 = lies flush with the boundary
|
|
285
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
286
|
-
*/
|
|
287
|
-
async function detectOverflow(state, options) {
|
|
288
|
-
var _await$platform$isEle;
|
|
289
|
-
if (options === void 0) {
|
|
290
|
-
options = {};
|
|
291
|
-
}
|
|
292
|
-
const {
|
|
293
|
-
x,
|
|
294
|
-
y,
|
|
295
|
-
platform,
|
|
296
|
-
rects,
|
|
297
|
-
elements,
|
|
298
|
-
strategy
|
|
299
|
-
} = state;
|
|
300
|
-
const {
|
|
301
|
-
boundary = 'clippingAncestors',
|
|
302
|
-
rootBoundary = 'viewport',
|
|
303
|
-
elementContext = 'floating',
|
|
304
|
-
altBoundary = false,
|
|
305
|
-
padding = 0
|
|
306
|
-
} = evaluate(options, state);
|
|
307
|
-
const paddingObject = getPaddingObject(padding);
|
|
308
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
309
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
310
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
311
|
-
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))),
|
|
312
|
-
boundary,
|
|
313
|
-
rootBoundary,
|
|
314
|
-
strategy
|
|
315
|
-
}));
|
|
316
|
-
const rect = elementContext === 'floating' ? {
|
|
317
|
-
...rects.floating,
|
|
318
|
-
x,
|
|
319
|
-
y
|
|
320
|
-
} : rects.reference;
|
|
321
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
322
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
323
|
-
x: 1,
|
|
324
|
-
y: 1
|
|
325
|
-
} : {
|
|
326
|
-
x: 1,
|
|
327
|
-
y: 1
|
|
328
|
-
};
|
|
329
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
330
|
-
rect,
|
|
331
|
-
offsetParent,
|
|
332
|
-
strategy
|
|
333
|
-
}) : rect);
|
|
334
|
-
return {
|
|
335
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
336
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
337
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
338
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Provides data to position an inner element of the floating element so that it
|
|
344
|
-
* appears centered to the reference element.
|
|
345
|
-
* @see https://floating-ui.com/docs/arrow
|
|
346
|
-
*/
|
|
347
|
-
const arrow = options => ({
|
|
348
|
-
name: 'arrow',
|
|
349
|
-
options,
|
|
350
|
-
async fn(state) {
|
|
351
|
-
const {
|
|
352
|
-
x,
|
|
353
|
-
y,
|
|
354
|
-
placement,
|
|
355
|
-
rects,
|
|
356
|
-
platform,
|
|
357
|
-
elements,
|
|
358
|
-
middlewareData
|
|
359
|
-
} = state;
|
|
360
|
-
// Since `element` is required, we don't Partial<> the type.
|
|
361
|
-
const {
|
|
362
|
-
element,
|
|
363
|
-
padding = 0
|
|
364
|
-
} = evaluate(options, state) || {};
|
|
365
|
-
if (element == null) {
|
|
366
|
-
return {};
|
|
367
|
-
}
|
|
368
|
-
const paddingObject = getPaddingObject(padding);
|
|
369
|
-
const coords = {
|
|
370
|
-
x,
|
|
371
|
-
y
|
|
372
|
-
};
|
|
373
|
-
const axis = getAlignmentAxis(placement);
|
|
374
|
-
const length = getAxisLength(axis);
|
|
375
|
-
const arrowDimensions = await platform.getDimensions(element);
|
|
376
|
-
const isYAxis = axis === 'y';
|
|
377
|
-
const minProp = isYAxis ? 'top' : 'left';
|
|
378
|
-
const maxProp = isYAxis ? 'bottom' : 'right';
|
|
379
|
-
const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
|
|
380
|
-
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
381
|
-
const startDiff = coords[axis] - rects.reference[axis];
|
|
382
|
-
const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
|
|
383
|
-
let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
384
|
-
|
|
385
|
-
// DOM platform can return `window` as the `offsetParent`.
|
|
386
|
-
if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
|
|
387
|
-
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
388
|
-
}
|
|
389
|
-
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
390
|
-
|
|
391
|
-
// If the padding is large enough that it causes the arrow to no longer be
|
|
392
|
-
// centered, modify the padding so that it is centered.
|
|
393
|
-
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
394
|
-
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
395
|
-
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
396
|
-
|
|
397
|
-
// Make sure the arrow doesn't overflow the floating element if the center
|
|
398
|
-
// point is outside the floating element's bounds.
|
|
399
|
-
const min$1 = minPadding;
|
|
400
|
-
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
401
|
-
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
402
|
-
const offset = clamp(min$1, center, max);
|
|
403
|
-
|
|
404
|
-
// If the reference is small enough that the arrow's padding causes it to
|
|
405
|
-
// to point to nothing for an aligned placement, adjust the offset of the
|
|
406
|
-
// floating element itself. To ensure `shift()` continues to take action,
|
|
407
|
-
// a single reset is performed when this is true.
|
|
408
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
409
|
-
const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
|
|
410
|
-
return {
|
|
411
|
-
[axis]: coords[axis] + alignmentOffset,
|
|
412
|
-
data: {
|
|
413
|
-
[axis]: offset,
|
|
414
|
-
centerOffset: center - offset - alignmentOffset,
|
|
415
|
-
...(shouldAddOffset && {
|
|
416
|
-
alignmentOffset
|
|
417
|
-
})
|
|
418
|
-
},
|
|
419
|
-
reset: shouldAddOffset
|
|
420
|
-
};
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
426
|
-
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
427
|
-
* clipping boundary. Alternative to `autoPlacement`.
|
|
428
|
-
* @see https://floating-ui.com/docs/flip
|
|
15
|
+
* @slot - The default slot for tree items
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
429
18
|
*/
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
mainAxis: checkMainAxis = true,
|
|
449
|
-
crossAxis: checkCrossAxis = true,
|
|
450
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
451
|
-
fallbackStrategy = 'bestFit',
|
|
452
|
-
fallbackAxisSideDirection = 'none',
|
|
453
|
-
flipAlignment = true,
|
|
454
|
-
...detectOverflowOptions
|
|
455
|
-
} = evaluate(options, state);
|
|
456
|
-
|
|
457
|
-
// If a reset by the arrow was caused due to an alignment offset being
|
|
458
|
-
// added, we should skip any logic now since `flip()` has already done its
|
|
459
|
-
// work.
|
|
460
|
-
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
461
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
462
|
-
return {};
|
|
463
|
-
}
|
|
464
|
-
const side = getSide(placement);
|
|
465
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
466
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
467
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
468
|
-
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
|
|
469
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
470
|
-
}
|
|
471
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
472
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
473
|
-
const overflows = [];
|
|
474
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
475
|
-
if (checkMainAxis) {
|
|
476
|
-
overflows.push(overflow[side]);
|
|
477
|
-
}
|
|
478
|
-
if (checkCrossAxis) {
|
|
479
|
-
const sides = getAlignmentSides(placement, rects, rtl);
|
|
480
|
-
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
481
|
-
}
|
|
482
|
-
overflowsData = [...overflowsData, {
|
|
483
|
-
placement,
|
|
484
|
-
overflows
|
|
485
|
-
}];
|
|
486
|
-
|
|
487
|
-
// One or more sides is overflowing.
|
|
488
|
-
if (!overflows.every(side => side <= 0)) {
|
|
489
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
490
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
491
|
-
const nextPlacement = placements[nextIndex];
|
|
492
|
-
if (nextPlacement) {
|
|
493
|
-
// Try next placement and re-run the lifecycle.
|
|
494
|
-
return {
|
|
495
|
-
data: {
|
|
496
|
-
index: nextIndex,
|
|
497
|
-
overflows: overflowsData
|
|
498
|
-
},
|
|
499
|
-
reset: {
|
|
500
|
-
placement: nextPlacement
|
|
19
|
+
let TreeView$1 = class TreeView extends index.FoundationElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
/**
|
|
23
|
+
* The tree item that is designated to be in the tab queue.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
this.currentFocused = null;
|
|
28
|
+
/**
|
|
29
|
+
* Handle focus events
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
this.handleFocus = (e) => {
|
|
34
|
+
if (this.slottedTreeItems.length < 1) {
|
|
35
|
+
// no child items, nothing to do
|
|
36
|
+
return;
|
|
501
37
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
506
|
-
// then find the placement that fits the best on the main crossAxis side.
|
|
507
|
-
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;
|
|
508
|
-
|
|
509
|
-
// Otherwise fallback.
|
|
510
|
-
if (!resetPlacement) {
|
|
511
|
-
switch (fallbackStrategy) {
|
|
512
|
-
case 'bestFit':
|
|
513
|
-
{
|
|
514
|
-
var _overflowsData$map$so;
|
|
515
|
-
const placement = (_overflowsData$map$so = overflowsData.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$map$so[0];
|
|
516
|
-
if (placement) {
|
|
517
|
-
resetPlacement = placement;
|
|
38
|
+
if (e.target === this) {
|
|
39
|
+
if (this.currentFocused === null) {
|
|
40
|
+
this.currentFocused = this.getValidFocusableItem();
|
|
518
41
|
}
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
break;
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (placement !== resetPlacement) {
|
|
527
|
-
return {
|
|
528
|
-
reset: {
|
|
529
|
-
placement: resetPlacement
|
|
42
|
+
if (this.currentFocused !== null) {
|
|
43
|
+
treeItem.TreeItem.focusItem(this.currentFocused);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
530
46
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
47
|
+
if (this.contains(e.target)) {
|
|
48
|
+
this.setAttribute("tabindex", "-1");
|
|
49
|
+
this.currentFocused = e.target;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Handle blur events
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
this.handleBlur = (e) => {
|
|
58
|
+
if (e.target instanceof HTMLElement &&
|
|
59
|
+
(e.relatedTarget === null || !this.contains(e.relatedTarget))) {
|
|
60
|
+
this.setAttribute("tabindex", "0");
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* KeyDown handler
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
this.handleKeyDown = (e) => {
|
|
69
|
+
if (e.defaultPrevented) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (this.slottedTreeItems.length < 1) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
const treeItems = this.getVisibleNodes();
|
|
76
|
+
switch (e.key) {
|
|
77
|
+
case keyCodes.keyHome:
|
|
78
|
+
if (treeItems.length) {
|
|
79
|
+
treeItem.TreeItem.focusItem(treeItems[0]);
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
case keyCodes.keyEnd:
|
|
83
|
+
if (treeItems.length) {
|
|
84
|
+
treeItem.TreeItem.focusItem(treeItems[treeItems.length - 1]);
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
case keyCodes.keyArrowLeft:
|
|
88
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
89
|
+
const item = e.target;
|
|
90
|
+
if (item instanceof treeItem.TreeItem &&
|
|
91
|
+
item.childItemLength() > 0 &&
|
|
92
|
+
item.expanded) {
|
|
93
|
+
item.expanded = false;
|
|
94
|
+
}
|
|
95
|
+
else if (item instanceof treeItem.TreeItem &&
|
|
96
|
+
item.parentElement instanceof treeItem.TreeItem) {
|
|
97
|
+
treeItem.TreeItem.focusItem(item.parentElement);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
101
|
+
case keyCodes.keyArrowRight:
|
|
102
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
103
|
+
const item = e.target;
|
|
104
|
+
if (item instanceof treeItem.TreeItem &&
|
|
105
|
+
item.childItemLength() > 0 &&
|
|
106
|
+
!item.expanded) {
|
|
107
|
+
item.expanded = true;
|
|
108
|
+
}
|
|
109
|
+
else if (item instanceof treeItem.TreeItem && item.childItemLength() > 0) {
|
|
110
|
+
this.focusNextNode(1, e.target);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
case keyCodes.keyArrowDown:
|
|
115
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
116
|
+
this.focusNextNode(1, e.target);
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
case keyCodes.keyArrowUp:
|
|
120
|
+
if (e.target && this.isFocusableElement(e.target)) {
|
|
121
|
+
this.focusNextNode(-1, e.target);
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
case keyCodes.keyEnter:
|
|
125
|
+
// In single-select trees where selection does not follow focus (see note below),
|
|
126
|
+
// the default action is typically to select the focused node.
|
|
127
|
+
this.handleClick(e);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// don't prevent default if we took no action
|
|
131
|
+
return true;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Handles the selected-changed events bubbling up
|
|
135
|
+
* from child tree items
|
|
136
|
+
*
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
this.handleSelectedChange = (e) => {
|
|
140
|
+
if (e.defaultPrevented) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (!(e.target instanceof Element) || !treeItem.isTreeItemElement(e.target)) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
const item = e.target;
|
|
147
|
+
if (item.selected) {
|
|
148
|
+
if (this.currentSelected && this.currentSelected !== item) {
|
|
149
|
+
this.currentSelected.selected = false;
|
|
150
|
+
}
|
|
151
|
+
// new selected item
|
|
152
|
+
this.currentSelected = item;
|
|
153
|
+
}
|
|
154
|
+
else if (!item.selected && this.currentSelected === item) {
|
|
155
|
+
// selected item deselected
|
|
156
|
+
this.currentSelected = null;
|
|
157
|
+
}
|
|
158
|
+
return;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Updates the tree view when slottedTreeItems changes
|
|
162
|
+
*/
|
|
163
|
+
this.setItems = () => {
|
|
164
|
+
// force single selection
|
|
165
|
+
// defaults to first one found
|
|
166
|
+
const selectedItem = this.treeView.querySelector("[aria-selected='true']");
|
|
167
|
+
this.currentSelected = selectedItem;
|
|
168
|
+
// invalidate the current focused item if it is no longer valid
|
|
169
|
+
if (this.currentFocused === null || !this.contains(this.currentFocused)) {
|
|
170
|
+
this.currentFocused = this.getValidFocusableItem();
|
|
171
|
+
}
|
|
172
|
+
// toggle properties on child elements
|
|
173
|
+
this.nested = this.checkForNestedItems();
|
|
174
|
+
const treeItems = this.getVisibleNodes();
|
|
175
|
+
treeItems.forEach(node => {
|
|
176
|
+
if (treeItem.isTreeItemElement(node)) {
|
|
177
|
+
node.nested = this.nested;
|
|
178
|
+
}
|
|
590
179
|
});
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
return {};
|
|
602
|
-
}
|
|
603
|
-
}
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* check if the item is focusable
|
|
183
|
+
*/
|
|
184
|
+
this.isFocusableElement = (el) => {
|
|
185
|
+
return treeItem.isTreeItemElement(el);
|
|
186
|
+
};
|
|
187
|
+
this.isSelectedElement = (el) => {
|
|
188
|
+
return el.selected;
|
|
189
|
+
};
|
|
604
190
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const minY = min(...rects.map(rect => rect.top));
|
|
611
|
-
const maxX = max(...rects.map(rect => rect.right));
|
|
612
|
-
const maxY = max(...rects.map(rect => rect.bottom));
|
|
613
|
-
return {
|
|
614
|
-
x: minX,
|
|
615
|
-
y: minY,
|
|
616
|
-
width: maxX - minX,
|
|
617
|
-
height: maxY - minY
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
function getRectsByLine(rects) {
|
|
621
|
-
const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
|
|
622
|
-
const groups = [];
|
|
623
|
-
let prevRect = null;
|
|
624
|
-
for (let i = 0; i < sortedRects.length; i++) {
|
|
625
|
-
const rect = sortedRects[i];
|
|
626
|
-
if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
|
|
627
|
-
groups.push([rect]);
|
|
628
|
-
} else {
|
|
629
|
-
groups[groups.length - 1].push(rect);
|
|
191
|
+
slottedTreeItemsChanged() {
|
|
192
|
+
if (this.$fastController.isConnected) {
|
|
193
|
+
// update for slotted children change
|
|
194
|
+
this.setItems();
|
|
195
|
+
}
|
|
630
196
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
async fn(state) {
|
|
648
|
-
const {
|
|
649
|
-
placement,
|
|
650
|
-
elements,
|
|
651
|
-
rects,
|
|
652
|
-
platform,
|
|
653
|
-
strategy
|
|
654
|
-
} = state;
|
|
655
|
-
// A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
|
|
656
|
-
// ClientRect's bounds, despite the event listener being triggered. A
|
|
657
|
-
// padding of 2 seems to handle this issue.
|
|
658
|
-
const {
|
|
659
|
-
padding = 2,
|
|
660
|
-
x,
|
|
661
|
-
y
|
|
662
|
-
} = evaluate(options, state);
|
|
663
|
-
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
664
|
-
const clientRects = getRectsByLine(nativeClientRects);
|
|
665
|
-
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
666
|
-
const paddingObject = getPaddingObject(padding);
|
|
667
|
-
function getBoundingClientRect() {
|
|
668
|
-
// There are two rects and they are disjoined.
|
|
669
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
670
|
-
// Find the first rect in which the point is fully inside.
|
|
671
|
-
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
197
|
+
connectedCallback() {
|
|
198
|
+
super.connectedCallback();
|
|
199
|
+
this.setAttribute("tabindex", "0");
|
|
200
|
+
index.DOM.queueUpdate(() => {
|
|
201
|
+
this.setItems();
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Handles click events bubbling up
|
|
206
|
+
*
|
|
207
|
+
* @internal
|
|
208
|
+
*/
|
|
209
|
+
handleClick(e) {
|
|
210
|
+
if (e.defaultPrevented) {
|
|
211
|
+
// handled, do nothing
|
|
212
|
+
return;
|
|
672
213
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
if (getSideAxis(placement) === 'y') {
|
|
677
|
-
const firstRect = clientRects[0];
|
|
678
|
-
const lastRect = clientRects[clientRects.length - 1];
|
|
679
|
-
const isTop = getSide(placement) === 'top';
|
|
680
|
-
const top = firstRect.top;
|
|
681
|
-
const bottom = lastRect.bottom;
|
|
682
|
-
const left = isTop ? firstRect.left : lastRect.left;
|
|
683
|
-
const right = isTop ? firstRect.right : lastRect.right;
|
|
684
|
-
const width = right - left;
|
|
685
|
-
const height = bottom - top;
|
|
686
|
-
return {
|
|
687
|
-
top,
|
|
688
|
-
bottom,
|
|
689
|
-
left,
|
|
690
|
-
right,
|
|
691
|
-
width,
|
|
692
|
-
height,
|
|
693
|
-
x: left,
|
|
694
|
-
y: top
|
|
695
|
-
};
|
|
696
|
-
}
|
|
697
|
-
const isLeftSide = getSide(placement) === 'left';
|
|
698
|
-
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
699
|
-
const minLeft = min(...clientRects.map(rect => rect.left));
|
|
700
|
-
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
701
|
-
const top = measureRects[0].top;
|
|
702
|
-
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
703
|
-
const left = minLeft;
|
|
704
|
-
const right = maxRight;
|
|
705
|
-
const width = right - left;
|
|
706
|
-
const height = bottom - top;
|
|
707
|
-
return {
|
|
708
|
-
top,
|
|
709
|
-
bottom,
|
|
710
|
-
left,
|
|
711
|
-
right,
|
|
712
|
-
width,
|
|
713
|
-
height,
|
|
714
|
-
x: left,
|
|
715
|
-
y: top
|
|
716
|
-
};
|
|
214
|
+
if (!(e.target instanceof Element) || !treeItem.isTreeItemElement(e.target)) {
|
|
215
|
+
// not a tree item, ignore
|
|
216
|
+
return true;
|
|
717
217
|
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
reference: {
|
|
722
|
-
getBoundingClientRect
|
|
723
|
-
},
|
|
724
|
-
floating: elements.floating,
|
|
725
|
-
strategy
|
|
726
|
-
});
|
|
727
|
-
if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
|
|
728
|
-
return {
|
|
729
|
-
reset: {
|
|
730
|
-
rects: resetRects
|
|
731
|
-
}
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
return {};
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
};
|
|
738
|
-
|
|
739
|
-
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
740
|
-
// Derivable.
|
|
741
|
-
async function convertValueToCoords(state, options) {
|
|
742
|
-
const {
|
|
743
|
-
placement,
|
|
744
|
-
platform,
|
|
745
|
-
elements
|
|
746
|
-
} = state;
|
|
747
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
748
|
-
const side = getSide(placement);
|
|
749
|
-
const alignment = getAlignment(placement);
|
|
750
|
-
const isVertical = getSideAxis(placement) === 'y';
|
|
751
|
-
const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
|
|
752
|
-
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
753
|
-
const rawValue = evaluate(options, state);
|
|
754
|
-
|
|
755
|
-
// eslint-disable-next-line prefer-const
|
|
756
|
-
let {
|
|
757
|
-
mainAxis,
|
|
758
|
-
crossAxis,
|
|
759
|
-
alignmentAxis
|
|
760
|
-
} = typeof rawValue === 'number' ? {
|
|
761
|
-
mainAxis: rawValue,
|
|
762
|
-
crossAxis: 0,
|
|
763
|
-
alignmentAxis: null
|
|
764
|
-
} : {
|
|
765
|
-
mainAxis: 0,
|
|
766
|
-
crossAxis: 0,
|
|
767
|
-
alignmentAxis: null,
|
|
768
|
-
...rawValue
|
|
769
|
-
};
|
|
770
|
-
if (alignment && typeof alignmentAxis === 'number') {
|
|
771
|
-
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
772
|
-
}
|
|
773
|
-
return isVertical ? {
|
|
774
|
-
x: crossAxis * crossAxisMulti,
|
|
775
|
-
y: mainAxis * mainAxisMulti
|
|
776
|
-
} : {
|
|
777
|
-
x: mainAxis * mainAxisMulti,
|
|
778
|
-
y: crossAxis * crossAxisMulti
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* Modifies the placement by translating the floating element along the
|
|
784
|
-
* specified axes.
|
|
785
|
-
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
786
|
-
* object may be passed.
|
|
787
|
-
* @see https://floating-ui.com/docs/offset
|
|
788
|
-
*/
|
|
789
|
-
const offset = function (options) {
|
|
790
|
-
if (options === void 0) {
|
|
791
|
-
options = 0;
|
|
792
|
-
}
|
|
793
|
-
return {
|
|
794
|
-
name: 'offset',
|
|
795
|
-
options,
|
|
796
|
-
async fn(state) {
|
|
797
|
-
var _middlewareData$offse, _middlewareData$arrow;
|
|
798
|
-
const {
|
|
799
|
-
x,
|
|
800
|
-
y,
|
|
801
|
-
placement,
|
|
802
|
-
middlewareData
|
|
803
|
-
} = state;
|
|
804
|
-
const diffCoords = await convertValueToCoords(state, options);
|
|
805
|
-
|
|
806
|
-
// If the placement is the same and the arrow caused an alignment offset
|
|
807
|
-
// then we don't need to change the positioning coordinates.
|
|
808
|
-
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
809
|
-
return {};
|
|
810
|
-
}
|
|
811
|
-
return {
|
|
812
|
-
x: x + diffCoords.x,
|
|
813
|
-
y: y + diffCoords.y,
|
|
814
|
-
data: {
|
|
815
|
-
...diffCoords,
|
|
816
|
-
placement
|
|
218
|
+
const item = e.target;
|
|
219
|
+
if (!item.disabled) {
|
|
220
|
+
item.selected = !item.selected;
|
|
817
221
|
}
|
|
818
|
-
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
options = {};
|
|
832
|
-
}
|
|
833
|
-
return {
|
|
834
|
-
name: 'size',
|
|
835
|
-
options,
|
|
836
|
-
async fn(state) {
|
|
837
|
-
const {
|
|
838
|
-
placement,
|
|
839
|
-
rects,
|
|
840
|
-
platform,
|
|
841
|
-
elements
|
|
842
|
-
} = state;
|
|
843
|
-
const {
|
|
844
|
-
apply = () => {},
|
|
845
|
-
...detectOverflowOptions
|
|
846
|
-
} = evaluate(options, state);
|
|
847
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
848
|
-
const side = getSide(placement);
|
|
849
|
-
const alignment = getAlignment(placement);
|
|
850
|
-
const isYAxis = getSideAxis(placement) === 'y';
|
|
851
|
-
const {
|
|
852
|
-
width,
|
|
853
|
-
height
|
|
854
|
-
} = rects.floating;
|
|
855
|
-
let heightSide;
|
|
856
|
-
let widthSide;
|
|
857
|
-
if (side === 'top' || side === 'bottom') {
|
|
858
|
-
heightSide = side;
|
|
859
|
-
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
860
|
-
} else {
|
|
861
|
-
widthSide = side;
|
|
862
|
-
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
863
|
-
}
|
|
864
|
-
const overflowAvailableHeight = height - overflow[heightSide];
|
|
865
|
-
const overflowAvailableWidth = width - overflow[widthSide];
|
|
866
|
-
const noShift = !state.middlewareData.shift;
|
|
867
|
-
let availableHeight = overflowAvailableHeight;
|
|
868
|
-
let availableWidth = overflowAvailableWidth;
|
|
869
|
-
if (isYAxis) {
|
|
870
|
-
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
871
|
-
availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
|
|
872
|
-
} else {
|
|
873
|
-
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
874
|
-
availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
|
|
875
|
-
}
|
|
876
|
-
if (noShift && !alignment) {
|
|
877
|
-
const xMin = max(overflow.left, 0);
|
|
878
|
-
const xMax = max(overflow.right, 0);
|
|
879
|
-
const yMin = max(overflow.top, 0);
|
|
880
|
-
const yMax = max(overflow.bottom, 0);
|
|
881
|
-
if (isYAxis) {
|
|
882
|
-
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
883
|
-
} else {
|
|
884
|
-
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Move focus to a tree item based on its offset from the provided item
|
|
226
|
+
*/
|
|
227
|
+
focusNextNode(delta, item) {
|
|
228
|
+
const visibleNodes = this.getVisibleNodes();
|
|
229
|
+
if (!visibleNodes) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta];
|
|
233
|
+
if (dom.isHTMLElement(focusItem)) {
|
|
234
|
+
treeItem.TreeItem.focusItem(focusItem);
|
|
885
235
|
}
|
|
886
|
-
}
|
|
887
|
-
await apply({
|
|
888
|
-
...state,
|
|
889
|
-
availableWidth,
|
|
890
|
-
availableHeight
|
|
891
|
-
});
|
|
892
|
-
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
893
|
-
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
894
|
-
return {
|
|
895
|
-
reset: {
|
|
896
|
-
rects: true
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
}
|
|
900
|
-
return {};
|
|
901
|
-
}
|
|
902
|
-
};
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
function getNodeName(node) {
|
|
906
|
-
if (isNode(node)) {
|
|
907
|
-
return (node.nodeName || '').toLowerCase();
|
|
908
|
-
}
|
|
909
|
-
// Mocked nodes in testing environments may not be instances of Node. By
|
|
910
|
-
// returning `#document` an infinite loop won't occur.
|
|
911
|
-
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
912
|
-
return '#document';
|
|
913
|
-
}
|
|
914
|
-
function getWindow(node) {
|
|
915
|
-
var _node$ownerDocument;
|
|
916
|
-
return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
917
|
-
}
|
|
918
|
-
function getDocumentElement(node) {
|
|
919
|
-
var _ref;
|
|
920
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
921
|
-
}
|
|
922
|
-
function isNode(value) {
|
|
923
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
924
|
-
}
|
|
925
|
-
function isElement(value) {
|
|
926
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
927
|
-
}
|
|
928
|
-
function isHTMLElement(value) {
|
|
929
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
930
|
-
}
|
|
931
|
-
function isShadowRoot(value) {
|
|
932
|
-
// Browsers without `ShadowRoot` support.
|
|
933
|
-
if (typeof ShadowRoot === 'undefined') {
|
|
934
|
-
return false;
|
|
935
|
-
}
|
|
936
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
937
|
-
}
|
|
938
|
-
function isOverflowElement(element) {
|
|
939
|
-
const {
|
|
940
|
-
overflow,
|
|
941
|
-
overflowX,
|
|
942
|
-
overflowY,
|
|
943
|
-
display
|
|
944
|
-
} = getComputedStyle(element);
|
|
945
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
946
|
-
}
|
|
947
|
-
function isTableElement(element) {
|
|
948
|
-
return ['table', 'td', 'th'].includes(getNodeName(element));
|
|
949
|
-
}
|
|
950
|
-
function isContainingBlock(element) {
|
|
951
|
-
const webkit = isWebKit();
|
|
952
|
-
const css = getComputedStyle(element);
|
|
953
|
-
|
|
954
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
955
|
-
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
956
|
-
}
|
|
957
|
-
function getContainingBlock(element) {
|
|
958
|
-
let currentNode = getParentNode(element);
|
|
959
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
960
|
-
if (isContainingBlock(currentNode)) {
|
|
961
|
-
return currentNode;
|
|
962
|
-
} else {
|
|
963
|
-
currentNode = getParentNode(currentNode);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
return null;
|
|
967
|
-
}
|
|
968
|
-
function isWebKit() {
|
|
969
|
-
if (typeof CSS === 'undefined' || !CSS.supports) return false;
|
|
970
|
-
return CSS.supports('-webkit-backdrop-filter', 'none');
|
|
971
|
-
}
|
|
972
|
-
function isLastTraversableNode(node) {
|
|
973
|
-
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
974
|
-
}
|
|
975
|
-
function getComputedStyle(element) {
|
|
976
|
-
return getWindow(element).getComputedStyle(element);
|
|
977
|
-
}
|
|
978
|
-
function getNodeScroll(element) {
|
|
979
|
-
if (isElement(element)) {
|
|
980
|
-
return {
|
|
981
|
-
scrollLeft: element.scrollLeft,
|
|
982
|
-
scrollTop: element.scrollTop
|
|
983
|
-
};
|
|
984
|
-
}
|
|
985
|
-
return {
|
|
986
|
-
scrollLeft: element.pageXOffset,
|
|
987
|
-
scrollTop: element.pageYOffset
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
function getParentNode(node) {
|
|
991
|
-
if (getNodeName(node) === 'html') {
|
|
992
|
-
return node;
|
|
993
|
-
}
|
|
994
|
-
const result =
|
|
995
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
996
|
-
node.assignedSlot ||
|
|
997
|
-
// DOM Element detected.
|
|
998
|
-
node.parentNode ||
|
|
999
|
-
// ShadowRoot detected.
|
|
1000
|
-
isShadowRoot(node) && node.host ||
|
|
1001
|
-
// Fallback.
|
|
1002
|
-
getDocumentElement(node);
|
|
1003
|
-
return isShadowRoot(result) ? result.host : result;
|
|
1004
|
-
}
|
|
1005
|
-
function getNearestOverflowAncestor(node) {
|
|
1006
|
-
const parentNode = getParentNode(node);
|
|
1007
|
-
if (isLastTraversableNode(parentNode)) {
|
|
1008
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1009
|
-
}
|
|
1010
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1011
|
-
return parentNode;
|
|
1012
|
-
}
|
|
1013
|
-
return getNearestOverflowAncestor(parentNode);
|
|
1014
|
-
}
|
|
1015
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1016
|
-
var _node$ownerDocument2;
|
|
1017
|
-
if (list === void 0) {
|
|
1018
|
-
list = [];
|
|
1019
|
-
}
|
|
1020
|
-
if (traverseIframes === void 0) {
|
|
1021
|
-
traverseIframes = true;
|
|
1022
|
-
}
|
|
1023
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1024
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1025
|
-
const win = getWindow(scrollableAncestor);
|
|
1026
|
-
if (isBody) {
|
|
1027
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
1028
|
-
}
|
|
1029
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
function getCssDimensions(element) {
|
|
1033
|
-
const css = getComputedStyle(element);
|
|
1034
|
-
// In testing environments, the `width` and `height` properties are empty
|
|
1035
|
-
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1036
|
-
let width = parseFloat(css.width) || 0;
|
|
1037
|
-
let height = parseFloat(css.height) || 0;
|
|
1038
|
-
const hasOffset = isHTMLElement(element);
|
|
1039
|
-
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1040
|
-
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1041
|
-
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1042
|
-
if (shouldFallback) {
|
|
1043
|
-
width = offsetWidth;
|
|
1044
|
-
height = offsetHeight;
|
|
1045
|
-
}
|
|
1046
|
-
return {
|
|
1047
|
-
width,
|
|
1048
|
-
height,
|
|
1049
|
-
$: shouldFallback
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
function unwrapElement(element) {
|
|
1054
|
-
return !isElement(element) ? element.contextElement : element;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
function getScale(element) {
|
|
1058
|
-
const domElement = unwrapElement(element);
|
|
1059
|
-
if (!isHTMLElement(domElement)) {
|
|
1060
|
-
return createCoords(1);
|
|
1061
|
-
}
|
|
1062
|
-
const rect = domElement.getBoundingClientRect();
|
|
1063
|
-
const {
|
|
1064
|
-
width,
|
|
1065
|
-
height,
|
|
1066
|
-
$
|
|
1067
|
-
} = getCssDimensions(domElement);
|
|
1068
|
-
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1069
|
-
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
1070
|
-
|
|
1071
|
-
// 0, NaN, or Infinity should always fallback to 1.
|
|
1072
|
-
|
|
1073
|
-
if (!x || !Number.isFinite(x)) {
|
|
1074
|
-
x = 1;
|
|
1075
|
-
}
|
|
1076
|
-
if (!y || !Number.isFinite(y)) {
|
|
1077
|
-
y = 1;
|
|
1078
|
-
}
|
|
1079
|
-
return {
|
|
1080
|
-
x,
|
|
1081
|
-
y
|
|
1082
|
-
};
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1086
|
-
function getVisualOffsets(element) {
|
|
1087
|
-
const win = getWindow(element);
|
|
1088
|
-
if (!isWebKit() || !win.visualViewport) {
|
|
1089
|
-
return noOffsets;
|
|
1090
|
-
}
|
|
1091
|
-
return {
|
|
1092
|
-
x: win.visualViewport.offsetLeft,
|
|
1093
|
-
y: win.visualViewport.offsetTop
|
|
1094
|
-
};
|
|
1095
|
-
}
|
|
1096
|
-
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1097
|
-
if (isFixed === void 0) {
|
|
1098
|
-
isFixed = false;
|
|
1099
|
-
}
|
|
1100
|
-
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1101
|
-
return false;
|
|
1102
|
-
}
|
|
1103
|
-
return isFixed;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1107
|
-
if (includeScale === void 0) {
|
|
1108
|
-
includeScale = false;
|
|
1109
|
-
}
|
|
1110
|
-
if (isFixedStrategy === void 0) {
|
|
1111
|
-
isFixedStrategy = false;
|
|
1112
|
-
}
|
|
1113
|
-
const clientRect = element.getBoundingClientRect();
|
|
1114
|
-
const domElement = unwrapElement(element);
|
|
1115
|
-
let scale = createCoords(1);
|
|
1116
|
-
if (includeScale) {
|
|
1117
|
-
if (offsetParent) {
|
|
1118
|
-
if (isElement(offsetParent)) {
|
|
1119
|
-
scale = getScale(offsetParent);
|
|
1120
|
-
}
|
|
1121
|
-
} else {
|
|
1122
|
-
scale = getScale(element);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1126
|
-
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1127
|
-
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1128
|
-
let width = clientRect.width / scale.x;
|
|
1129
|
-
let height = clientRect.height / scale.y;
|
|
1130
|
-
if (domElement) {
|
|
1131
|
-
const win = getWindow(domElement);
|
|
1132
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1133
|
-
let currentIFrame = win.frameElement;
|
|
1134
|
-
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1135
|
-
const iframeScale = getScale(currentIFrame);
|
|
1136
|
-
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1137
|
-
const css = getComputedStyle(currentIFrame);
|
|
1138
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1139
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1140
|
-
x *= iframeScale.x;
|
|
1141
|
-
y *= iframeScale.y;
|
|
1142
|
-
width *= iframeScale.x;
|
|
1143
|
-
height *= iframeScale.y;
|
|
1144
|
-
x += left;
|
|
1145
|
-
y += top;
|
|
1146
|
-
currentIFrame = getWindow(currentIFrame).frameElement;
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
return rectToClientRect({
|
|
1150
|
-
width,
|
|
1151
|
-
height,
|
|
1152
|
-
x,
|
|
1153
|
-
y
|
|
1154
|
-
});
|
|
1155
|
-
}
|
|
1156
|
-
|
|
1157
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1158
|
-
let {
|
|
1159
|
-
rect,
|
|
1160
|
-
offsetParent,
|
|
1161
|
-
strategy
|
|
1162
|
-
} = _ref;
|
|
1163
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1164
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1165
|
-
if (offsetParent === documentElement) {
|
|
1166
|
-
return rect;
|
|
1167
|
-
}
|
|
1168
|
-
let scroll = {
|
|
1169
|
-
scrollLeft: 0,
|
|
1170
|
-
scrollTop: 0
|
|
1171
|
-
};
|
|
1172
|
-
let scale = createCoords(1);
|
|
1173
|
-
const offsets = createCoords(0);
|
|
1174
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
|
|
1175
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1176
|
-
scroll = getNodeScroll(offsetParent);
|
|
1177
|
-
}
|
|
1178
|
-
if (isHTMLElement(offsetParent)) {
|
|
1179
|
-
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1180
|
-
scale = getScale(offsetParent);
|
|
1181
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1182
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
return {
|
|
1186
|
-
width: rect.width * scale.x,
|
|
1187
|
-
height: rect.height * scale.y,
|
|
1188
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1189
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1190
|
-
};
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
function getClientRects(element) {
|
|
1194
|
-
return Array.from(element.getClientRects());
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
function getWindowScrollBarX(element) {
|
|
1198
|
-
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1199
|
-
// incorrect for RTL.
|
|
1200
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
// Gets the entire size of the scrollable document area, even extending outside
|
|
1204
|
-
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1205
|
-
function getDocumentRect(element) {
|
|
1206
|
-
const html = getDocumentElement(element);
|
|
1207
|
-
const scroll = getNodeScroll(element);
|
|
1208
|
-
const body = element.ownerDocument.body;
|
|
1209
|
-
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1210
|
-
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1211
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1212
|
-
const y = -scroll.scrollTop;
|
|
1213
|
-
if (getComputedStyle(body).direction === 'rtl') {
|
|
1214
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1215
|
-
}
|
|
1216
|
-
return {
|
|
1217
|
-
width,
|
|
1218
|
-
height,
|
|
1219
|
-
x,
|
|
1220
|
-
y
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
function getViewportRect(element, strategy) {
|
|
1225
|
-
const win = getWindow(element);
|
|
1226
|
-
const html = getDocumentElement(element);
|
|
1227
|
-
const visualViewport = win.visualViewport;
|
|
1228
|
-
let width = html.clientWidth;
|
|
1229
|
-
let height = html.clientHeight;
|
|
1230
|
-
let x = 0;
|
|
1231
|
-
let y = 0;
|
|
1232
|
-
if (visualViewport) {
|
|
1233
|
-
width = visualViewport.width;
|
|
1234
|
-
height = visualViewport.height;
|
|
1235
|
-
const visualViewportBased = isWebKit();
|
|
1236
|
-
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1237
|
-
x = visualViewport.offsetLeft;
|
|
1238
|
-
y = visualViewport.offsetTop;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
return {
|
|
1242
|
-
width,
|
|
1243
|
-
height,
|
|
1244
|
-
x,
|
|
1245
|
-
y
|
|
1246
|
-
};
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1250
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
1251
|
-
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1252
|
-
const top = clientRect.top + element.clientTop;
|
|
1253
|
-
const left = clientRect.left + element.clientLeft;
|
|
1254
|
-
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1255
|
-
const width = element.clientWidth * scale.x;
|
|
1256
|
-
const height = element.clientHeight * scale.y;
|
|
1257
|
-
const x = left * scale.x;
|
|
1258
|
-
const y = top * scale.y;
|
|
1259
|
-
return {
|
|
1260
|
-
width,
|
|
1261
|
-
height,
|
|
1262
|
-
x,
|
|
1263
|
-
y
|
|
1264
|
-
};
|
|
1265
|
-
}
|
|
1266
|
-
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1267
|
-
let rect;
|
|
1268
|
-
if (clippingAncestor === 'viewport') {
|
|
1269
|
-
rect = getViewportRect(element, strategy);
|
|
1270
|
-
} else if (clippingAncestor === 'document') {
|
|
1271
|
-
rect = getDocumentRect(getDocumentElement(element));
|
|
1272
|
-
} else if (isElement(clippingAncestor)) {
|
|
1273
|
-
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1274
|
-
} else {
|
|
1275
|
-
const visualOffsets = getVisualOffsets(element);
|
|
1276
|
-
rect = {
|
|
1277
|
-
...clippingAncestor,
|
|
1278
|
-
x: clippingAncestor.x - visualOffsets.x,
|
|
1279
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
return rectToClientRect(rect);
|
|
1283
|
-
}
|
|
1284
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
1285
|
-
const parentNode = getParentNode(element);
|
|
1286
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1287
|
-
return false;
|
|
1288
|
-
}
|
|
1289
|
-
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1293
|
-
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1294
|
-
// of the given element up the tree.
|
|
1295
|
-
function getClippingElementAncestors(element, cache) {
|
|
1296
|
-
const cachedResult = cache.get(element);
|
|
1297
|
-
if (cachedResult) {
|
|
1298
|
-
return cachedResult;
|
|
1299
|
-
}
|
|
1300
|
-
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1301
|
-
let currentContainingBlockComputedStyle = null;
|
|
1302
|
-
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
1303
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1304
|
-
|
|
1305
|
-
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1306
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1307
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
1308
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1309
|
-
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1310
|
-
currentContainingBlockComputedStyle = null;
|
|
1311
|
-
}
|
|
1312
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1313
|
-
if (shouldDropCurrentNode) {
|
|
1314
|
-
// Drop non-containing blocks.
|
|
1315
|
-
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1316
|
-
} else {
|
|
1317
|
-
// Record last containing block for next iteration.
|
|
1318
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
1319
|
-
}
|
|
1320
|
-
currentNode = getParentNode(currentNode);
|
|
1321
|
-
}
|
|
1322
|
-
cache.set(element, result);
|
|
1323
|
-
return result;
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
// Gets the maximum area that the element is visible in due to any number of
|
|
1327
|
-
// clipping ancestors.
|
|
1328
|
-
function getClippingRect(_ref) {
|
|
1329
|
-
let {
|
|
1330
|
-
element,
|
|
1331
|
-
boundary,
|
|
1332
|
-
rootBoundary,
|
|
1333
|
-
strategy
|
|
1334
|
-
} = _ref;
|
|
1335
|
-
const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1336
|
-
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1337
|
-
const firstClippingAncestor = clippingAncestors[0];
|
|
1338
|
-
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
1339
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
1340
|
-
accRect.top = max(rect.top, accRect.top);
|
|
1341
|
-
accRect.right = min(rect.right, accRect.right);
|
|
1342
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
1343
|
-
accRect.left = max(rect.left, accRect.left);
|
|
1344
|
-
return accRect;
|
|
1345
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
1346
|
-
return {
|
|
1347
|
-
width: clippingRect.right - clippingRect.left,
|
|
1348
|
-
height: clippingRect.bottom - clippingRect.top,
|
|
1349
|
-
x: clippingRect.left,
|
|
1350
|
-
y: clippingRect.top
|
|
1351
|
-
};
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
function getDimensions(element) {
|
|
1355
|
-
return getCssDimensions(element);
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1359
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1360
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
1361
|
-
const isFixed = strategy === 'fixed';
|
|
1362
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1363
|
-
let scroll = {
|
|
1364
|
-
scrollLeft: 0,
|
|
1365
|
-
scrollTop: 0
|
|
1366
|
-
};
|
|
1367
|
-
const offsets = createCoords(0);
|
|
1368
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1369
|
-
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1370
|
-
scroll = getNodeScroll(offsetParent);
|
|
1371
|
-
}
|
|
1372
|
-
if (isOffsetParentAnElement) {
|
|
1373
|
-
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1374
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1375
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1376
|
-
} else if (documentElement) {
|
|
1377
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
return {
|
|
1381
|
-
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
1382
|
-
y: rect.top + scroll.scrollTop - offsets.y,
|
|
1383
|
-
width: rect.width,
|
|
1384
|
-
height: rect.height
|
|
1385
|
-
};
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
function getTrueOffsetParent(element, polyfill) {
|
|
1389
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1390
|
-
return null;
|
|
1391
|
-
}
|
|
1392
|
-
if (polyfill) {
|
|
1393
|
-
return polyfill(element);
|
|
1394
|
-
}
|
|
1395
|
-
return element.offsetParent;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1399
|
-
// such as table ancestors and cross browser bugs.
|
|
1400
|
-
function getOffsetParent(element, polyfill) {
|
|
1401
|
-
const window = getWindow(element);
|
|
1402
|
-
if (!isHTMLElement(element)) {
|
|
1403
|
-
return window;
|
|
1404
|
-
}
|
|
1405
|
-
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1406
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1407
|
-
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1408
|
-
}
|
|
1409
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1410
|
-
return window;
|
|
1411
|
-
}
|
|
1412
|
-
return offsetParent || getContainingBlock(element) || window;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
const getElementRects = async function (_ref) {
|
|
1416
|
-
let {
|
|
1417
|
-
reference,
|
|
1418
|
-
floating,
|
|
1419
|
-
strategy
|
|
1420
|
-
} = _ref;
|
|
1421
|
-
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1422
|
-
const getDimensionsFn = this.getDimensions;
|
|
1423
|
-
return {
|
|
1424
|
-
reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
|
|
1425
|
-
floating: {
|
|
1426
|
-
x: 0,
|
|
1427
|
-
y: 0,
|
|
1428
|
-
...(await getDimensionsFn(floating))
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
};
|
|
1432
|
-
|
|
1433
|
-
function isRTL(element) {
|
|
1434
|
-
return getComputedStyle(element).direction === 'rtl';
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
const platform = {
|
|
1438
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1439
|
-
getDocumentElement,
|
|
1440
|
-
getClippingRect,
|
|
1441
|
-
getOffsetParent,
|
|
1442
|
-
getElementRects,
|
|
1443
|
-
getClientRects,
|
|
1444
|
-
getDimensions,
|
|
1445
|
-
getScale,
|
|
1446
|
-
isElement,
|
|
1447
|
-
isRTL
|
|
1448
|
-
};
|
|
1449
|
-
|
|
1450
|
-
// https://samthor.au/2021/observing-dom/
|
|
1451
|
-
function observeMove(element, onMove) {
|
|
1452
|
-
let io = null;
|
|
1453
|
-
let timeoutId;
|
|
1454
|
-
const root = getDocumentElement(element);
|
|
1455
|
-
function cleanup() {
|
|
1456
|
-
clearTimeout(timeoutId);
|
|
1457
|
-
io && io.disconnect();
|
|
1458
|
-
io = null;
|
|
1459
|
-
}
|
|
1460
|
-
function refresh(skip, threshold) {
|
|
1461
|
-
if (skip === void 0) {
|
|
1462
|
-
skip = false;
|
|
1463
|
-
}
|
|
1464
|
-
if (threshold === void 0) {
|
|
1465
|
-
threshold = 1;
|
|
1466
|
-
}
|
|
1467
|
-
cleanup();
|
|
1468
|
-
const {
|
|
1469
|
-
left,
|
|
1470
|
-
top,
|
|
1471
|
-
width,
|
|
1472
|
-
height
|
|
1473
|
-
} = element.getBoundingClientRect();
|
|
1474
|
-
if (!skip) {
|
|
1475
|
-
onMove();
|
|
1476
|
-
}
|
|
1477
|
-
if (!width || !height) {
|
|
1478
|
-
return;
|
|
1479
236
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
function handleObserve(entries) {
|
|
1491
|
-
const ratio = entries[0].intersectionRatio;
|
|
1492
|
-
if (ratio !== threshold) {
|
|
1493
|
-
if (!isFirstUpdate) {
|
|
1494
|
-
return refresh();
|
|
237
|
+
/**
|
|
238
|
+
* checks if there are any nested tree items
|
|
239
|
+
*/
|
|
240
|
+
getValidFocusableItem() {
|
|
241
|
+
const treeItems = this.getVisibleNodes();
|
|
242
|
+
// default to selected element if there is one
|
|
243
|
+
let focusIndex = treeItems.findIndex(this.isSelectedElement);
|
|
244
|
+
if (focusIndex === -1) {
|
|
245
|
+
// otherwise first focusable tree item
|
|
246
|
+
focusIndex = treeItems.findIndex(this.isFocusableElement);
|
|
1495
247
|
}
|
|
1496
|
-
if (
|
|
1497
|
-
|
|
1498
|
-
refresh(false, 1e-7);
|
|
1499
|
-
}, 100);
|
|
1500
|
-
} else {
|
|
1501
|
-
refresh(false, ratio);
|
|
248
|
+
if (focusIndex !== -1) {
|
|
249
|
+
return treeItems[focusIndex];
|
|
1502
250
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
...options,
|
|
1512
|
-
// Handle <iframe>s
|
|
1513
|
-
root: root.ownerDocument
|
|
1514
|
-
});
|
|
1515
|
-
} catch (e) {
|
|
1516
|
-
io = new IntersectionObserver(handleObserve, options);
|
|
1517
|
-
}
|
|
1518
|
-
io.observe(element);
|
|
1519
|
-
}
|
|
1520
|
-
refresh(true);
|
|
1521
|
-
return cleanup;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
/**
|
|
1525
|
-
* Automatically updates the position of the floating element when necessary.
|
|
1526
|
-
* Should only be called when the floating element is mounted on the DOM or
|
|
1527
|
-
* visible on the screen.
|
|
1528
|
-
* @returns cleanup function that should be invoked when the floating element is
|
|
1529
|
-
* removed from the DOM or hidden from the screen.
|
|
1530
|
-
* @see https://floating-ui.com/docs/autoUpdate
|
|
1531
|
-
*/
|
|
1532
|
-
function autoUpdate(reference, floating, update, options) {
|
|
1533
|
-
if (options === void 0) {
|
|
1534
|
-
options = {};
|
|
1535
|
-
}
|
|
1536
|
-
const {
|
|
1537
|
-
ancestorScroll = true,
|
|
1538
|
-
ancestorResize = true,
|
|
1539
|
-
elementResize = typeof ResizeObserver === 'function',
|
|
1540
|
-
layoutShift = typeof IntersectionObserver === 'function',
|
|
1541
|
-
animationFrame = false
|
|
1542
|
-
} = options;
|
|
1543
|
-
const referenceEl = unwrapElement(reference);
|
|
1544
|
-
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
|
|
1545
|
-
ancestors.forEach(ancestor => {
|
|
1546
|
-
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1547
|
-
passive: true
|
|
1548
|
-
});
|
|
1549
|
-
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1550
|
-
});
|
|
1551
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1552
|
-
let reobserveFrame = -1;
|
|
1553
|
-
let resizeObserver = null;
|
|
1554
|
-
if (elementResize) {
|
|
1555
|
-
resizeObserver = new ResizeObserver(_ref => {
|
|
1556
|
-
let [firstEntry] = _ref;
|
|
1557
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
1558
|
-
// Prevent update loops when using the `size` middleware.
|
|
1559
|
-
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
1560
|
-
resizeObserver.unobserve(floating);
|
|
1561
|
-
cancelAnimationFrame(reobserveFrame);
|
|
1562
|
-
reobserveFrame = requestAnimationFrame(() => {
|
|
1563
|
-
resizeObserver && resizeObserver.observe(floating);
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* checks if there are any nested tree items
|
|
255
|
+
*/
|
|
256
|
+
checkForNestedItems() {
|
|
257
|
+
return this.slottedTreeItems.some((node) => {
|
|
258
|
+
return treeItem.isTreeItemElement(node) && node.querySelector("[role='treeitem']");
|
|
1564
259
|
});
|
|
1565
|
-
}
|
|
1566
|
-
update();
|
|
1567
|
-
});
|
|
1568
|
-
if (referenceEl && !animationFrame) {
|
|
1569
|
-
resizeObserver.observe(referenceEl);
|
|
1570
260
|
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
let frameId;
|
|
1574
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1575
|
-
if (animationFrame) {
|
|
1576
|
-
frameLoop();
|
|
1577
|
-
}
|
|
1578
|
-
function frameLoop() {
|
|
1579
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
1580
|
-
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
1581
|
-
update();
|
|
261
|
+
getVisibleNodes() {
|
|
262
|
+
return dom.getDisplayedNodes(this, "[role='treeitem']") || [];
|
|
1582
263
|
}
|
|
1583
|
-
prevRefRect = nextRefRect;
|
|
1584
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
1585
|
-
}
|
|
1586
|
-
update();
|
|
1587
|
-
return () => {
|
|
1588
|
-
ancestors.forEach(ancestor => {
|
|
1589
|
-
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1590
|
-
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1591
|
-
});
|
|
1592
|
-
cleanupIo && cleanupIo();
|
|
1593
|
-
resizeObserver && resizeObserver.disconnect();
|
|
1594
|
-
resizeObserver = null;
|
|
1595
|
-
if (animationFrame) {
|
|
1596
|
-
cancelAnimationFrame(frameId);
|
|
1597
|
-
}
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
/**
|
|
1602
|
-
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1603
|
-
* next to a reference element when it is given a certain CSS positioning
|
|
1604
|
-
* strategy.
|
|
1605
|
-
*/
|
|
1606
|
-
const computePosition = (reference, floating, options) => {
|
|
1607
|
-
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1608
|
-
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1609
|
-
// single call. If other functions become expensive, we can add them as well.
|
|
1610
|
-
const cache = new Map();
|
|
1611
|
-
const mergedOptions = {
|
|
1612
|
-
platform,
|
|
1613
|
-
...options
|
|
1614
|
-
};
|
|
1615
|
-
const platformWithCache = {
|
|
1616
|
-
...mergedOptions.platform,
|
|
1617
|
-
_c: cache
|
|
1618
|
-
};
|
|
1619
|
-
return computePosition$1(reference, floating, {
|
|
1620
|
-
...mergedOptions,
|
|
1621
|
-
platform: platformWithCache
|
|
1622
|
-
});
|
|
1623
264
|
};
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
265
|
+
index.__decorate([
|
|
266
|
+
index.attr({ attribute: "render-collapsed-nodes" })
|
|
267
|
+
], TreeView$1.prototype, "renderCollapsedNodes", void 0);
|
|
268
|
+
index.__decorate([
|
|
269
|
+
index.observable
|
|
270
|
+
], TreeView$1.prototype, "currentSelected", void 0);
|
|
271
|
+
index.__decorate([
|
|
272
|
+
index.observable
|
|
273
|
+
], TreeView$1.prototype, "slottedTreeItems", void 0);
|
|
274
|
+
|
|
275
|
+
const styles = ".control{position:relative;display:flex;flex-direction:column;gap:4px}\n";
|
|
276
|
+
|
|
277
|
+
class TreeView extends TreeView$1 {
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const getClasses = (_) => classNames.classNames("control");
|
|
281
|
+
const TreeViewTemplate = () => {
|
|
282
|
+
return index.html` <template
|
|
283
|
+
role="tree"
|
|
284
|
+
${ref.ref("treeView")}
|
|
285
|
+
@keydown="${(x, c) => x.handleKeyDown(c.event)}"
|
|
286
|
+
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
287
|
+
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
288
|
+
@click="${(x, c) => x.handleClick(c.event)}"
|
|
289
|
+
@selected-change="${(x, c) => x.handleSelectedChange(c.event)}"
|
|
290
|
+
>
|
|
291
|
+
<div class="${getClasses}">
|
|
292
|
+
<slot ${slotted.slotted("slottedTreeItems")}></slot>
|
|
293
|
+
</div>
|
|
294
|
+
</template>`;
|
|
1635
295
|
};
|
|
1636
|
-
class Popup extends index.FoundationElement {
|
|
1637
|
-
constructor() {
|
|
1638
|
-
super(...arguments);
|
|
1639
|
-
this.open = false;
|
|
1640
|
-
this.dismissible = false;
|
|
1641
|
-
this.arrow = false;
|
|
1642
|
-
this.alternate = false;
|
|
1643
|
-
this.strategy = "fixed";
|
|
1644
|
-
}
|
|
1645
|
-
get #middleware() {
|
|
1646
|
-
let middleware = [inline(), flip(), hide(), size({
|
|
1647
|
-
apply({ availableWidth, availableHeight, elements }) {
|
|
1648
|
-
Object.assign(elements.floating.style, {
|
|
1649
|
-
maxWidth: `${availableWidth}px`,
|
|
1650
|
-
maxHeight: `${availableHeight}px`
|
|
1651
|
-
});
|
|
1652
|
-
}
|
|
1653
|
-
})];
|
|
1654
|
-
if (this.arrow) {
|
|
1655
|
-
middleware = [offset(12), ...middleware, arrow({ element: this.arrowEl, padding: 10 })];
|
|
1656
|
-
}
|
|
1657
|
-
return middleware;
|
|
1658
|
-
}
|
|
1659
|
-
#cleanup;
|
|
1660
|
-
openChanged(_, newValue) {
|
|
1661
|
-
newValue ? this.$emit("vwc-popup:open") : this.$emit("vwc-popup:close");
|
|
1662
|
-
this.#updateAutoUpdate();
|
|
1663
|
-
}
|
|
1664
|
-
/**
|
|
1665
|
-
* @internal
|
|
1666
|
-
*/
|
|
1667
|
-
anchorChanged() {
|
|
1668
|
-
this.#updateAutoUpdate();
|
|
1669
|
-
}
|
|
1670
|
-
connectedCallback() {
|
|
1671
|
-
super.connectedCallback();
|
|
1672
|
-
this.#updateAutoUpdate();
|
|
1673
|
-
}
|
|
1674
|
-
disconnectedCallback() {
|
|
1675
|
-
super.disconnectedCallback();
|
|
1676
|
-
this.#updateAutoUpdate();
|
|
1677
|
-
}
|
|
1678
|
-
#updateAutoUpdate() {
|
|
1679
|
-
this.#cleanup?.();
|
|
1680
|
-
if (this.anchorEl && this.open && this.popupEl) {
|
|
1681
|
-
this.#cleanup = autoUpdate(this.anchorEl, this.popupEl, () => this.updatePosition());
|
|
1682
|
-
}
|
|
1683
|
-
}
|
|
1684
|
-
/**
|
|
1685
|
-
* Updates popup's position
|
|
1686
|
-
*
|
|
1687
|
-
* @public
|
|
1688
|
-
*/
|
|
1689
|
-
async updatePosition() {
|
|
1690
|
-
if (!this.open || !this.anchorEl) {
|
|
1691
|
-
return;
|
|
1692
|
-
}
|
|
1693
|
-
const positionData = await computePosition(this.anchorEl, this.popupEl, {
|
|
1694
|
-
placement: this.placement,
|
|
1695
|
-
strategy: this.strategy,
|
|
1696
|
-
middleware: this.#middleware
|
|
1697
|
-
});
|
|
1698
|
-
this.#assignPopupPosition(positionData);
|
|
1699
|
-
if (this.arrow) {
|
|
1700
|
-
this.#assignArrowPosition(positionData);
|
|
1701
|
-
}
|
|
1702
|
-
}
|
|
1703
|
-
#assignPopupPosition(data) {
|
|
1704
|
-
const { x: popupX, y: popupY } = data;
|
|
1705
|
-
const { referenceHidden } = data.middlewareData.hide;
|
|
1706
|
-
Object.assign(this.popupEl.style, {
|
|
1707
|
-
left: `${popupX}px`,
|
|
1708
|
-
top: `${popupY}px`,
|
|
1709
|
-
visibility: referenceHidden ? "hidden" : "visible"
|
|
1710
|
-
});
|
|
1711
|
-
}
|
|
1712
|
-
#assignArrowPosition(data) {
|
|
1713
|
-
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
1714
|
-
const styles = {
|
|
1715
|
-
"left": "calc(100% - 4px)",
|
|
1716
|
-
"right": "-4px",
|
|
1717
|
-
"top": "calc(100% - 4px)",
|
|
1718
|
-
"bottom": "-4px"
|
|
1719
|
-
};
|
|
1720
|
-
const staticAxis = data.placement.split("-")[0];
|
|
1721
|
-
Object.assign(this.arrowEl.style, {
|
|
1722
|
-
left: arrowX ? `${arrowX}px` : styles[staticAxis],
|
|
1723
|
-
top: arrowY ? `${arrowY}px` : styles[staticAxis]
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
get anchorEl() {
|
|
1727
|
-
return this.anchor ?? null;
|
|
1728
|
-
}
|
|
1729
|
-
show() {
|
|
1730
|
-
this.open = true;
|
|
1731
|
-
}
|
|
1732
|
-
hide() {
|
|
1733
|
-
this.open = false;
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
__decorateClass([
|
|
1737
|
-
index.attr({
|
|
1738
|
-
mode: "boolean"
|
|
1739
|
-
})
|
|
1740
|
-
], Popup.prototype, "open", 2);
|
|
1741
|
-
__decorateClass([
|
|
1742
|
-
index.attr({
|
|
1743
|
-
mode: "boolean"
|
|
1744
|
-
})
|
|
1745
|
-
], Popup.prototype, "dismissible", 2);
|
|
1746
|
-
__decorateClass([
|
|
1747
|
-
index.attr({
|
|
1748
|
-
mode: "boolean"
|
|
1749
|
-
})
|
|
1750
|
-
], Popup.prototype, "arrow", 2);
|
|
1751
|
-
__decorateClass([
|
|
1752
|
-
index.attr({
|
|
1753
|
-
mode: "boolean"
|
|
1754
|
-
})
|
|
1755
|
-
], Popup.prototype, "alternate", 2);
|
|
1756
|
-
__decorateClass([
|
|
1757
|
-
index.attr({ mode: "fromView" })
|
|
1758
|
-
], Popup.prototype, "placement", 2);
|
|
1759
|
-
__decorateClass([
|
|
1760
|
-
index.attr({ mode: "fromView" })
|
|
1761
|
-
], Popup.prototype, "strategy", 2);
|
|
1762
|
-
__decorateClass([
|
|
1763
|
-
index.observable
|
|
1764
|
-
], Popup.prototype, "anchor", 2);
|
|
1765
296
|
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
}) => classNames.classNames(
|
|
1773
|
-
"control",
|
|
1774
|
-
["open", Boolean(open)],
|
|
1775
|
-
["dismissible", Boolean(dismissible)],
|
|
1776
|
-
["alternate", Boolean(alternate)]
|
|
297
|
+
const treeViewDefinition = TreeView.compose(
|
|
298
|
+
{
|
|
299
|
+
baseName: "tree-view",
|
|
300
|
+
template: TreeViewTemplate,
|
|
301
|
+
styles
|
|
302
|
+
}
|
|
1777
303
|
);
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1780
|
-
const buttonTag = context.tagFor(definition$1.Button);
|
|
1781
|
-
return index.html`
|
|
1782
|
-
<${elevationTag}>
|
|
1783
|
-
<div class="popup-wrapper ${(x) => x.strategy}" ${ref.ref("popupEl")} part="popup-base">
|
|
1784
|
-
<div class="${getClasses}" aria-hidden="${(x) => x.open ? "false" : "true"}"
|
|
1785
|
-
part="${(x) => x.alternate ? "vvd-theme-alternate" : ""}">
|
|
1786
|
-
<div class="popup-content">
|
|
1787
|
-
<slot></slot>
|
|
1788
|
-
${when.when(
|
|
1789
|
-
(x) => x.dismissible,
|
|
1790
|
-
index.html`<${buttonTag} size="condensed" @click="${(x) => x.open = false}"
|
|
1791
|
-
class="dismissible-button" icon="close-small-solid" shape="pill"></${buttonTag}>`
|
|
1792
|
-
)}
|
|
1793
|
-
</div>
|
|
1794
|
-
${when.when((x) => x.arrow, index.html`<div class="arrow" ${ref.ref("arrowEl")}></div>`)}
|
|
1795
|
-
</div>
|
|
1796
|
-
</div>
|
|
1797
|
-
</${elevationTag}>`;
|
|
1798
|
-
};
|
|
1799
|
-
|
|
1800
|
-
const popupDefinition = Popup.compose({
|
|
1801
|
-
baseName: "popup",
|
|
1802
|
-
template: popupTemplate,
|
|
1803
|
-
styles
|
|
1804
|
-
});
|
|
1805
|
-
const popupRegistries = [popupDefinition(), ...definition.elevationRegistries, ...definition$1.buttonRegistries];
|
|
1806
|
-
const registerPopup = index.registerFactory(popupRegistries);
|
|
304
|
+
const treeViewRegistries = [treeViewDefinition()];
|
|
305
|
+
const registerTreeView = index.registerFactory(treeViewRegistries);
|
|
1807
306
|
|
|
1808
|
-
exports.
|
|
1809
|
-
exports.
|
|
1810
|
-
exports.
|
|
307
|
+
exports.registerTreeView = registerTreeView;
|
|
308
|
+
exports.treeViewDefinition = treeViewDefinition;
|
|
309
|
+
exports.treeViewRegistries = treeViewRegistries;
|