@watermarkinsights/ripple 5.20.0-alpha.8 → 5.20.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/dist/cjs/{app-globals-c2d0797b.js → app-globals-c9940f6b.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/priv-option-list.cjs.entry.js +2 -4
- package/dist/cjs/ripple.cjs.js +2 -2
- package/dist/cjs/wm-option_2.cjs.entry.js +189 -96
- package/dist/cjs/wm-tab-item_3.cjs.entry.js +12 -27
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +2 -4
- package/dist/collection/components/selects/wm-option/wm-option.css +5 -10
- package/dist/collection/components/selects/wm-select/wm-select.css +66 -55
- package/dist/collection/components/selects/wm-select/wm-select.js +199 -110
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.css +1 -1
- package/dist/collection/components/wm-tabs/wm-tab-item/wm-tab-item.js +2 -13
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.css +2 -2
- package/dist/collection/components/wm-tabs/wm-tab-list/wm-tab-list.js +8 -29
- package/dist/esm/{app-globals-cc0448d5.js → app-globals-8cefcc2e.js} +1 -1
- package/dist/esm/{chartFunctions-3a54f8ac.js → chartFunctions-613e9c87.js} +1 -1
- package/dist/esm/{functions-669184a6.js → functions-38e392cb.js} +1 -1
- package/dist/esm/{intl-7906e2d7.js → intl-0b8f342e.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +4 -6
- package/dist/esm/ripple.js +2 -2
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +1 -1
- package/dist/esm/wm-flyout.entry.js +2 -2
- package/dist/esm/wm-input.entry.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +2 -2
- package/dist/esm/wm-modal_3.entry.js +2 -2
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +2 -2
- package/dist/esm/wm-optgroup.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +191 -98
- package/dist/esm/wm-pagination.entry.js +2 -2
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +2 -2
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-tab-item_3.entry.js +13 -28
- package/dist/esm/wm-tag-input.entry.js +2 -2
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +2 -2
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +2 -2
- package/dist/esm-es5/app-globals-8cefcc2e.js +1 -0
- package/dist/esm-es5/{chartFunctions-3a54f8ac.js → chartFunctions-613e9c87.js} +1 -1
- package/dist/esm-es5/{functions-669184a6.js → functions-38e392cb.js} +1 -1
- package/dist/esm-es5/{intl-7906e2d7.js → intl-0b8f342e.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-flyout.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-6d32911c.system.entry.js → p-00eaa361.system.entry.js} +1 -1
- package/dist/ripple/p-0652e156.js +1 -0
- package/dist/ripple/{p-c85dae6b.entry.js → p-0825151e.entry.js} +1 -1
- package/dist/ripple/{p-c70fa14f.entry.js → p-0bce3f83.entry.js} +1 -1
- package/dist/ripple/{p-69b38da5.entry.js → p-118093e1.entry.js} +1 -1
- package/dist/ripple/p-1259cb49.system.js +1 -0
- package/dist/ripple/{p-de14d683.system.entry.js → p-17964357.system.entry.js} +1 -1
- package/dist/ripple/{p-bd37b0f9.system.entry.js → p-1a89139d.system.entry.js} +1 -1
- package/dist/ripple/{p-bdac9bec.entry.js → p-2508b801.entry.js} +1 -1
- package/dist/ripple/{p-1027e508.entry.js → p-26ffcd83.entry.js} +1 -1
- package/dist/ripple/{p-55cdfcb4.system.entry.js → p-2b7259cb.system.entry.js} +1 -1
- package/dist/ripple/{p-ff6b7376.system.entry.js → p-2db6573e.system.entry.js} +1 -1
- package/dist/ripple/{p-03759d86.system.entry.js → p-2f7e25a2.system.entry.js} +1 -1
- package/dist/ripple/p-2f8bad10.entry.js +1 -0
- package/dist/ripple/{p-1efa25b5.system.entry.js → p-3133ce3c.system.entry.js} +1 -1
- package/dist/ripple/{p-9ac6957b.entry.js → p-31bac55d.entry.js} +1 -1
- package/dist/ripple/{p-ce2d310c.entry.js → p-3612ee73.entry.js} +1 -1
- package/dist/ripple/{p-21c100d8.entry.js → p-39a4934f.entry.js} +1 -1
- package/dist/ripple/{p-54759960.entry.js → p-41664372.entry.js} +1 -1
- package/dist/ripple/{p-c8dfc321.system.entry.js → p-44cc05f6.system.entry.js} +1 -1
- package/dist/ripple/{p-c73882de.system.entry.js → p-4602304a.system.entry.js} +1 -1
- package/dist/ripple/p-47e87534.entry.js +1 -0
- package/dist/ripple/{p-bb364d6b.entry.js → p-4b8f7d1e.entry.js} +1 -1
- package/dist/ripple/{p-b55883ee.entry.js → p-4d0abf7a.entry.js} +1 -1
- package/dist/ripple/{p-d99c9eb8.entry.js → p-4df8346a.entry.js} +1 -1
- package/dist/ripple/{p-9eaab627.system.entry.js → p-507ea41f.system.entry.js} +1 -1
- package/dist/ripple/{p-26ab5004.system.entry.js → p-5405df80.system.entry.js} +1 -1
- package/dist/ripple/{p-b9f36d37.entry.js → p-56b6d9f6.entry.js} +1 -1
- package/dist/ripple/{p-686b20f5.system.entry.js → p-56e376b2.system.entry.js} +1 -1
- package/dist/ripple/{p-88a7ccee.system.js → p-608971f2.system.js} +1 -1
- package/dist/ripple/{p-6ec4129b.entry.js → p-60e16c79.entry.js} +1 -1
- package/dist/ripple/{p-95f19440.system.js → p-65abcbb4.system.js} +1 -1
- package/dist/ripple/{p-65d3f9c4.system.entry.js → p-667fdcbb.system.entry.js} +1 -1
- package/dist/ripple/{p-68e90b50.system.entry.js → p-6a70dc0b.system.entry.js} +1 -1
- package/dist/ripple/{p-7394f4e9.system.entry.js → p-7134a305.system.entry.js} +1 -1
- package/dist/ripple/{p-24dcf159.entry.js → p-72e1fdb5.entry.js} +1 -1
- package/dist/ripple/{p-047e510d.entry.js → p-7c3bf608.entry.js} +1 -1
- package/dist/ripple/{p-176dcfc0.system.js → p-7edd25f7.system.js} +1 -1
- package/dist/ripple/{p-ebfa5876.entry.js → p-86a61a2a.entry.js} +1 -1
- package/dist/ripple/{p-eea39358.system.entry.js → p-8d1e0f23.system.entry.js} +1 -1
- package/dist/ripple/{p-009a6e5a.entry.js → p-8e2f3a45.entry.js} +1 -1
- package/dist/ripple/{p-a0ef456d.entry.js → p-8ec6ec53.entry.js} +1 -1
- package/dist/ripple/{p-71cc21a4.entry.js → p-908057b2.entry.js} +1 -1
- package/dist/ripple/{p-dbc3a44d.entry.js → p-9202d9e9.entry.js} +1 -1
- package/dist/ripple/{p-0ae9b6d3.js → p-92c8361f.js} +1 -1
- package/dist/ripple/{p-ad10664f.entry.js → p-957f13fb.entry.js} +1 -1
- package/dist/ripple/{p-1ad6c15b.entry.js → p-9609d8e7.entry.js} +1 -1
- package/dist/ripple/{p-3c9972a6.system.entry.js → p-960d2cf0.system.entry.js} +1 -1
- package/dist/ripple/{p-22d4c7e0.system.entry.js → p-96f86eb4.system.entry.js} +1 -1
- package/dist/ripple/{p-ea10c498.entry.js → p-9e89655f.entry.js} +1 -1
- package/dist/ripple/{p-f8fd7172.system.entry.js → p-a14dee02.system.entry.js} +1 -1
- package/dist/ripple/{p-222624ae.entry.js → p-a5c5c64c.entry.js} +1 -1
- package/dist/ripple/{p-dfa30c3d.entry.js → p-a7cde3fc.entry.js} +1 -1
- package/dist/ripple/{p-acb4d87c.system.entry.js → p-abcdd7be.system.entry.js} +1 -1
- package/dist/ripple/{p-f6ad9cc2.system.entry.js → p-b0da7ad4.system.entry.js} +1 -1
- package/dist/ripple/{p-6a40014e.system.entry.js → p-b1fb99e4.system.entry.js} +1 -1
- package/dist/ripple/{p-91669f66.js → p-b511ebfd.js} +1 -1
- package/dist/ripple/{p-036fd03b.system.entry.js → p-bde7e77b.system.entry.js} +1 -1
- package/dist/ripple/{p-c0f4f1ea.system.entry.js → p-c7f3ef7f.system.entry.js} +1 -1
- package/dist/ripple/{p-1806e50b.js → p-d815809f.js} +1 -1
- package/dist/ripple/{p-fb61a10e.system.entry.js → p-e5c34af5.system.entry.js} +1 -1
- package/dist/ripple/{p-e1a15515.system.entry.js → p-e660d0b8.system.entry.js} +1 -1
- package/dist/ripple/{p-66489ded.entry.js → p-ecd1c2ba.entry.js} +1 -1
- package/dist/ripple/p-f1939079.system.js +1 -0
- package/dist/ripple/{p-5bf2eb50.system.entry.js → p-f4390a0a.system.entry.js} +1 -1
- package/dist/ripple/{p-ae2520e4.entry.js → p-f91fc18d.entry.js} +1 -1
- package/dist/ripple/{p-1841c319.system.entry.js → p-f9bbb123.system.entry.js} +1 -1
- package/dist/ripple/{p-25c17efe.system.entry.js → p-fbad04d7.system.entry.js} +1 -1
- package/dist/ripple/p-fe697924.system.entry.js +1 -0
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/selects/wm-select/wm-select.d.ts +17 -9
- package/dist/types/components/wm-tabs/wm-tab-list/wm-tab-list.d.ts +0 -1
- package/dist/types/components.d.ts +0 -2
- package/package.json +2 -2
- package/dist/esm-es5/app-globals-cc0448d5.js +0 -1
- package/dist/ripple/p-2fd6d2c1.system.js +0 -1
- package/dist/ripple/p-76cb8681.entry.js +0 -1
- package/dist/ripple/p-87214c42.js +0 -1
- package/dist/ripple/p-8732edf0.system.entry.js +0 -1
- package/dist/ripple/p-9e1ea6e2.entry.js +0 -1
- package/dist/ripple/p-c71d8769.system.js +0 -1
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { forceUpdate } from "@stencil/core";
|
|
3
|
-
import { getTextDir,
|
|
3
|
+
import { getTextDir, toBool, handleDisabledAttribute, showTooltip, hideTooltip, debounce, findAllScrollableParents, } from "../../../global/functions";
|
|
4
4
|
import { globalMessages, selectMessages } from "../../../global/intl";
|
|
5
5
|
export class Select {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.
|
|
7
|
+
this.scrollableParents = [];
|
|
8
|
+
this.returnFocus = false;
|
|
9
|
+
this.hasAnchor = CSS.supports("top", "anchor(bottom)"); // for FF polyfill
|
|
8
10
|
//////////////////////////////////////
|
|
9
11
|
// for multiselect button text
|
|
10
12
|
this.overflowCount = 0;
|
|
11
13
|
this.displayedOptions = [];
|
|
14
|
+
this.previousDisplayedOptions = [];
|
|
15
|
+
this.debouncedReposition = debounce(() => {
|
|
16
|
+
this.dropdownPosition();
|
|
17
|
+
}, 100);
|
|
12
18
|
this.disabled = false;
|
|
13
19
|
this.maxHeight = "200px";
|
|
14
20
|
this.label = undefined;
|
|
@@ -22,6 +28,8 @@ export class Select {
|
|
|
22
28
|
this.searchPlaceholder = selectMessages.searchPlaceholder;
|
|
23
29
|
this.allSelectedMessage = selectMessages.allSelected;
|
|
24
30
|
this.isExpanded = false;
|
|
31
|
+
this.isHidden = false;
|
|
32
|
+
this.openUp = false;
|
|
25
33
|
this.announcement = "";
|
|
26
34
|
}
|
|
27
35
|
get childOptions() {
|
|
@@ -40,58 +48,165 @@ export class Select {
|
|
|
40
48
|
//////////////////////////////////////
|
|
41
49
|
handleOptionSelection() {
|
|
42
50
|
if (!this.multiple) {
|
|
43
|
-
this.
|
|
51
|
+
this.returnFocus = true;
|
|
52
|
+
this.dropdownEl.hidePopover();
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
handleChildEnter() {
|
|
47
56
|
// only occurs for multiselects. handle the click, then close
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
event.relatedTarget = ev.detail.relatedTarget;
|
|
60
|
-
this.el.dispatchEvent(event);
|
|
57
|
+
this.returnFocus = true;
|
|
58
|
+
this.dropdownEl.hidePopover();
|
|
59
|
+
}
|
|
60
|
+
closeDropdownOnEscape() {
|
|
61
|
+
this.returnFocus = true;
|
|
62
|
+
this.dropdownEl.hidePopover();
|
|
63
|
+
}
|
|
64
|
+
handleBeforeToggle() {
|
|
65
|
+
if (!this.hasAnchor) {
|
|
66
|
+
// Start hidden to prevent flash during positioning calculation
|
|
67
|
+
this.isHidden = true;
|
|
61
68
|
}
|
|
62
69
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
handleToggle(ev) {
|
|
71
|
+
ev.newState === "open" ? this.onOpen() : this.onClose();
|
|
72
|
+
}
|
|
73
|
+
dropdownPosition() {
|
|
74
|
+
// polyfill for opening up or down + positioning according to screen
|
|
75
|
+
// (must recalculate on scroll, resize)
|
|
76
|
+
// Using transform for better performance - only affects composite layer, no layout recalculation
|
|
77
|
+
const buttonElRect = this.buttonEl.getBoundingClientRect();
|
|
78
|
+
const spaceAbove = buttonElRect.top;
|
|
79
|
+
const spaceBelow = document.documentElement.clientHeight - buttonElRect.bottom;
|
|
80
|
+
const dropdownHeight = this.dropdownEl.clientHeight;
|
|
81
|
+
// Clear any previously set positioning properties
|
|
82
|
+
this.el.style.removeProperty("--dropdown-translate-y");
|
|
83
|
+
this.el.style.removeProperty("--dropdown-max-height");
|
|
84
|
+
this.el.style.removeProperty("--dropdown-left");
|
|
85
|
+
// Set horizontal position and width to match button
|
|
86
|
+
this.el.style.setProperty("--dropdown-left", buttonElRect.left + "px");
|
|
87
|
+
this.el.style.setProperty("--button-width", buttonElRect.width + "px");
|
|
88
|
+
if (dropdownHeight <= spaceBelow) {
|
|
89
|
+
// Case 1: Enough space below - position dropdown below the button
|
|
90
|
+
this.el.style.setProperty("--dropdown-translate-y", buttonElRect.bottom + "px");
|
|
91
|
+
}
|
|
92
|
+
else if (dropdownHeight <= spaceAbove) {
|
|
93
|
+
// Case 2: Not enough space below, but enough above - position dropdown above the button
|
|
94
|
+
this.el.style.setProperty("--dropdown-translate-y", buttonElRect.top - dropdownHeight + "px");
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
// Case 3: Not enough space in either direction - use the larger available space and constrain height
|
|
98
|
+
if (spaceBelow >= spaceAbove) {
|
|
99
|
+
// Use space below and constrain dropdown height
|
|
100
|
+
this.el.style.setProperty("--dropdown-translate-y", buttonElRect.bottom + "px");
|
|
101
|
+
this.el.style.setProperty("--dropdown-max-height", spaceBelow + "px");
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
// Use space above and constrain dropdown height
|
|
105
|
+
this.el.style.setProperty("--dropdown-translate-y", "0px");
|
|
106
|
+
this.el.style.setProperty("--dropdown-max-height", spaceAbove + "px");
|
|
107
|
+
}
|
|
66
108
|
}
|
|
109
|
+
this.isHidden = false;
|
|
67
110
|
}
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
//
|
|
71
|
-
|
|
111
|
+
onOpen() {
|
|
112
|
+
if (!this.isExpanded && !this.isDisabled) {
|
|
113
|
+
// polyfill for browsers without anchor() support (FF)
|
|
114
|
+
if (!this.hasAnchor) {
|
|
115
|
+
this.dropdownPosition();
|
|
116
|
+
}
|
|
117
|
+
requestAnimationFrame(() => {
|
|
118
|
+
const anchorRect = this.buttonEl.getBoundingClientRect();
|
|
119
|
+
const hasSpaceBelow = this.dropdownEl.offsetHeight <= document.documentElement.clientHeight - anchorRect.bottom;
|
|
120
|
+
const hasSpaceAbove = this.dropdownEl.offsetHeight <= anchorRect.top;
|
|
121
|
+
this.openUp = !hasSpaceBelow && hasSpaceAbove;
|
|
122
|
+
if (!hasSpaceBelow && !hasSpaceAbove) {
|
|
123
|
+
// dropdown will open downwards but doesn't have enough space
|
|
124
|
+
// it needs to be absolutely positioned + html has to have overflow-y auto
|
|
125
|
+
// (the default, but could have been overriden)
|
|
126
|
+
// in order to ensure the options can be scrolled to
|
|
127
|
+
// (would already be possible if the page has content below. this is in case select was at bottom of page)
|
|
128
|
+
this.initialHtmlOverflowY = document.documentElement.style.overflowY;
|
|
129
|
+
document.documentElement.style.overflowY = "auto";
|
|
130
|
+
this.dropdownEl.style.position = "absolute";
|
|
131
|
+
}
|
|
132
|
+
this.isExpanded = true;
|
|
133
|
+
});
|
|
134
|
+
setTimeout(() => {
|
|
135
|
+
// focusing doesn't work when within requestAnimationFrame
|
|
136
|
+
this.optionListEl.handleInitialFocus(this.elToFocus);
|
|
137
|
+
this.elToFocus = undefined;
|
|
138
|
+
}, 50);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
onClose() {
|
|
142
|
+
if (this.isExpanded) {
|
|
143
|
+
this.optionListEl.unfocusAll();
|
|
144
|
+
// see onOpen
|
|
145
|
+
document.documentElement.style.overflowY = this.initialHtmlOverflowY || "";
|
|
146
|
+
this.dropdownEl.style.position = "fixed";
|
|
147
|
+
window.setTimeout(() => {
|
|
148
|
+
if (!this.hasAnchor) {
|
|
149
|
+
this.isHidden = true;
|
|
150
|
+
}
|
|
151
|
+
if (this.optionListEl.multiple) {
|
|
152
|
+
this.optionListEl.updateOptionVisibility();
|
|
153
|
+
}
|
|
154
|
+
// clear search field, reset filtered / bolded state of wm-options
|
|
155
|
+
if (this.search) {
|
|
156
|
+
this.optionListEl.clearSearch();
|
|
157
|
+
}
|
|
158
|
+
this.isExpanded = false;
|
|
159
|
+
}, 150);
|
|
160
|
+
if (this.returnFocus) {
|
|
161
|
+
requestAnimationFrame(() => {
|
|
162
|
+
this.buttonEl.focus();
|
|
163
|
+
this.returnFocus = false;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
72
166
|
}
|
|
73
167
|
}
|
|
74
168
|
handleKey(ev) {
|
|
75
169
|
switch (ev.key) {
|
|
76
170
|
case "Tab":
|
|
77
171
|
// if tabbing backwards, close and return focus to button. Otherwise, close but do not redirect focus.
|
|
78
|
-
this.
|
|
172
|
+
if (this.isExpanded && ev.shiftKey) {
|
|
173
|
+
this.returnFocus = true;
|
|
174
|
+
}
|
|
175
|
+
this.dropdownEl.hidePopover();
|
|
79
176
|
break;
|
|
80
177
|
case "ArrowDown":
|
|
81
178
|
if (this.isExpanded === false) {
|
|
82
179
|
ev.preventDefault();
|
|
83
|
-
this.
|
|
180
|
+
this.elToFocus = "next";
|
|
181
|
+
this.dropdownEl.showPopover();
|
|
84
182
|
}
|
|
85
183
|
break;
|
|
86
184
|
case "ArrowUp":
|
|
87
185
|
if (this.isExpanded === false) {
|
|
88
186
|
ev.preventDefault();
|
|
89
|
-
this.
|
|
187
|
+
this.elToFocus = "previous";
|
|
188
|
+
this.dropdownEl.showPopover();
|
|
90
189
|
}
|
|
91
190
|
break;
|
|
92
191
|
}
|
|
93
192
|
}
|
|
193
|
+
handleResize() {
|
|
194
|
+
if (!this.hasAnchor && this.isExpanded) {
|
|
195
|
+
this.isHidden = true;
|
|
196
|
+
this.debouncedReposition();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
handleScroll() {
|
|
200
|
+
if (this.isExpanded) {
|
|
201
|
+
this.isHidden = true;
|
|
202
|
+
this.debouncedReposition();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
94
205
|
componentWillLoad() {
|
|
206
|
+
if (!this.hasAnchor) {
|
|
207
|
+
// Start hidden to prevent flash on first load
|
|
208
|
+
this.isHidden = true;
|
|
209
|
+
}
|
|
95
210
|
if (!this.label) {
|
|
96
211
|
console.error("For accessibility purposes, this component requires a label (even if `label-position` is set to `none`).");
|
|
97
212
|
}
|
|
@@ -108,8 +223,6 @@ export class Select {
|
|
|
108
223
|
});
|
|
109
224
|
}
|
|
110
225
|
handleChildChange() {
|
|
111
|
-
// on update of children or children selected state, reset button text and rerender
|
|
112
|
-
this.setButtonText();
|
|
113
226
|
forceUpdate(this.el);
|
|
114
227
|
if (this.multiple) {
|
|
115
228
|
// update state of clone options
|
|
@@ -118,43 +231,19 @@ export class Select {
|
|
|
118
231
|
}
|
|
119
232
|
componentDidLoad() {
|
|
120
233
|
this.wmSelectDidLoad.emit();
|
|
121
|
-
this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.isExpanded = true;
|
|
129
|
-
this.dropdownEl.classList.add("open");
|
|
130
|
-
this.dropdownEl.classList.remove("hidden");
|
|
131
|
-
window.requestAnimationFrame(() => {
|
|
132
|
-
this.optionListEl.handleInitialFocus(optionToSelect);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
close(returnFocus = true) {
|
|
137
|
-
if (this.isExpanded) {
|
|
138
|
-
this.isExpanded = false;
|
|
139
|
-
this.optionListEl.unfocusAll();
|
|
140
|
-
this.dropdownEl.classList.remove("open");
|
|
141
|
-
window.setTimeout(() => {
|
|
142
|
-
this.dropdownEl.classList.add("hidden");
|
|
143
|
-
if (this.optionListEl.multiple) {
|
|
144
|
-
this.optionListEl.updateOptionVisibility();
|
|
234
|
+
if (!this.hasAnchor) {
|
|
235
|
+
this.scrollableParents = findAllScrollableParents(this.el);
|
|
236
|
+
// Add scroll listeners to all scrollable parents
|
|
237
|
+
this.scrollableParents.forEach((parent) => {
|
|
238
|
+
if (parent === document.documentElement) {
|
|
239
|
+
// For document element, listen to window scroll event
|
|
240
|
+
window.addEventListener("scroll", () => this.handleScroll());
|
|
145
241
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
this.
|
|
149
|
-
}
|
|
150
|
-
// Returns focus to button after popup closes (no need if user is tabbing)
|
|
151
|
-
// Delay is necessary for screenreader to get new expanded state before focus
|
|
152
|
-
// window.requestAnimationFrame is probably enough, but since we are already using setTimeout it may as well be here
|
|
153
|
-
// also UX wise, it makes sense for the button to only be focused after the animation is complete
|
|
154
|
-
if (returnFocus) {
|
|
155
|
-
this.buttonEl.focus();
|
|
242
|
+
else {
|
|
243
|
+
// For regular elements, listen to their scroll event
|
|
244
|
+
parent.addEventListener("scroll", () => this.handleScroll());
|
|
156
245
|
}
|
|
157
|
-
}
|
|
246
|
+
});
|
|
158
247
|
}
|
|
159
248
|
}
|
|
160
249
|
announceError() {
|
|
@@ -168,7 +257,6 @@ export class Select {
|
|
|
168
257
|
handleComponentBlur(ev) {
|
|
169
258
|
// Do not close or emit custom blur event when blurring to an element inside (wm-option)
|
|
170
259
|
if (!this.el.contains(ev.relatedTarget)) {
|
|
171
|
-
this.close(false);
|
|
172
260
|
this.wmSelectBlurred.emit();
|
|
173
261
|
}
|
|
174
262
|
}
|
|
@@ -178,28 +266,6 @@ export class Select {
|
|
|
178
266
|
showTooltip("right", ev.target, this.label);
|
|
179
267
|
}
|
|
180
268
|
}
|
|
181
|
-
setButtonText() {
|
|
182
|
-
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
183
|
-
// handle overflow + counter for multiselect
|
|
184
|
-
if (this.multiple) {
|
|
185
|
-
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
186
|
-
const overflowCounterWidth = 38;
|
|
187
|
-
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
188
|
-
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
189
|
-
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
190
|
-
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
191
|
-
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
192
|
-
this.overflowCount = 0;
|
|
193
|
-
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
194
|
-
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
195
|
-
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
196
|
-
this.overflowCount++;
|
|
197
|
-
this.displayedOptions.pop();
|
|
198
|
-
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
199
|
-
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
269
|
announce(message) {
|
|
204
270
|
// \u00A0 is a non-breaking space character, which causes the message to be read as a new one
|
|
205
271
|
if (this.liveRegionEl.textContent === message) {
|
|
@@ -208,6 +274,7 @@ export class Select {
|
|
|
208
274
|
this.announcement = message;
|
|
209
275
|
}
|
|
210
276
|
renderButtonText() {
|
|
277
|
+
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
211
278
|
if (this.multiple && this.displayedOptions.length < 1) {
|
|
212
279
|
return h("span", null, this.placeholder);
|
|
213
280
|
}
|
|
@@ -215,6 +282,28 @@ export class Select {
|
|
|
215
282
|
return this.allSelectedMessage;
|
|
216
283
|
}
|
|
217
284
|
else {
|
|
285
|
+
// handle overflow + counter for multiselect
|
|
286
|
+
// only bother if things have changed
|
|
287
|
+
const hasChanged = this.displayedOptions !== this.previousDisplayedOptions;
|
|
288
|
+
if (this.multiple && hasChanged) {
|
|
289
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
290
|
+
const overflowCounterWidth = 38;
|
|
291
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
292
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
293
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
294
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
295
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
296
|
+
this.overflowCount = 0;
|
|
297
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
298
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
299
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
300
|
+
this.overflowCount++;
|
|
301
|
+
this.displayedOptions.pop();
|
|
302
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
303
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
304
|
+
}
|
|
305
|
+
this.previousDisplayedOptions = this.displayedOptions;
|
|
306
|
+
}
|
|
218
307
|
return this.displayedOptions.map((x, idx) => (h("span", null, idx > 0 ? ", " : "", x.textContent)));
|
|
219
308
|
}
|
|
220
309
|
}
|
|
@@ -225,18 +314,22 @@ export class Select {
|
|
|
225
314
|
}
|
|
226
315
|
render() {
|
|
227
316
|
const showSubinfo = !this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo;
|
|
228
|
-
|
|
229
|
-
id: "selectbtn",
|
|
230
|
-
["disabled"]: this.isDisabled,
|
|
231
|
-
["aria-controls"]: "list",
|
|
232
|
-
["aria-labelledby"]: "label selectbtn",
|
|
233
|
-
["aria-describedby"]: "error",
|
|
234
|
-
["aria-expanded"]: this.isExpanded ? "true" : "false",
|
|
235
|
-
onClick: () => (this.isExpanded ? this.close() : this.open()),
|
|
236
|
-
};
|
|
237
|
-
return (h(Host, { key: '27f57d30b836eac8dc27ae98a425015d86a0948b', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '8f48d8e8d616244350e61d6e81f350640131bbf0', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '39d3bcec9b67d671a6bdbb6a3ee738832189ea51', ref: (el) => (this.labelEl = el), class: "label-wrapper" }, h("label", { key: 'b0bb90a215ac20de94afa8dba56e839bdc590dc1', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
|
|
317
|
+
return (h(Host, { key: '7e8a475bb0ec52e4944c6873e01c4606898f4c5f', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: 'ab7b7ac75c131204dfb9053522aca310def8f45c', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: 'd621ab97f8538a4888b57724ce19459216a909a2', class: "label-wrapper" }, h("label", { key: '6721709ccc53c4dcb34adde92400213edcecfcd1', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
|
|
238
318
|
// we can't use aria-required because the listbox is in a sub-component and it is not announced
|
|
239
|
-
this.requiredField && (h("span", { key: '
|
|
319
|
+
this.requiredField && (h("span", { key: 'aa206ab21ef45c4881508a7d89dbeb9c9e391bc5', class: "required" }, h("span", { key: '4831f113ee6326704bdd4c54062e3a68c6c17783', class: "sr-only" }, globalMessages.requiredField), h("span", { key: '88d2090f8ad7a017a0d43d54e8344b8ee6fa858d', "aria-hidden": "true" }, "*")))), h("div", { key: '414f570b751a2c8a886b7b4b8c80b2c2f9150f2d', class: "button-wrapper" }, h("button", { key: '11bd141ae70438ac048bce9df4e8983e36b4abb0', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, h("span", { key: '1f337bb2196dfd0c2c22f32f05073eac31f978d2', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: '978a03d535551ade50c872610b53af59bca79004', class: "button-text" }, this.renderButtonText()), showSubinfo && h("span", { key: 'b97e2bccd8dc0ccc55df54a8220c80940ae21b15', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: '687523e6ee6f23a22a55481dbbb4856580e71770', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: 'eb88eb23947a6c7c608fe80c752b604102db6a2d', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: '0c8b8cd661caa7f55de6e0eb56d304e6ae299e45',
|
|
320
|
+
// is-open is for the CSS transition in modern browsers
|
|
321
|
+
// hidden is to wait for position calculations in Firefox
|
|
322
|
+
class: `dropdown ${this.isExpanded ? "is-open" : ""} ${this.isHidden ? "hidden" : ""} ${this.openUp ? "upward" : ""}`, id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el),
|
|
323
|
+
// @ts-ignore -- don't tell typescript but we're in the future
|
|
324
|
+
onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: 'c2f173700a255dfe637bb0bbd12d73ef1c4e15fd', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
|
|
325
|
+
this.dropdownEl.hidePopover();
|
|
326
|
+
}, onOptionListAllSelected: () => {
|
|
327
|
+
this.returnFocus = true;
|
|
328
|
+
this.wmSelectAllSelected.emit();
|
|
329
|
+
}, onOptionListAllDeselected: () => {
|
|
330
|
+
this.returnFocus = true;
|
|
331
|
+
this.wmSelectAllDeselected.emit();
|
|
332
|
+
} }, h("slot", { key: '7f7e2c3a4c3e174a108f028fb4fa0236f829b7b8' }))), h("div", { key: '4734b6b6f448c151a2f4373001285e0f2bbacff8', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: 'c8a8b6d9d4e67b71f86ee522386fbc9f5e47c3de', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
240
333
|
}
|
|
241
334
|
static get is() { return "wm-select"; }
|
|
242
335
|
static get encapsulation() { return "shadow"; }
|
|
@@ -472,6 +565,8 @@ export class Select {
|
|
|
472
565
|
static get states() {
|
|
473
566
|
return {
|
|
474
567
|
"isExpanded": {},
|
|
568
|
+
"isHidden": {},
|
|
569
|
+
"openUp": {},
|
|
475
570
|
"announcement": {}
|
|
476
571
|
};
|
|
477
572
|
}
|
|
@@ -563,28 +658,22 @@ export class Select {
|
|
|
563
658
|
"passive": false
|
|
564
659
|
}, {
|
|
565
660
|
"name": "wmEscKeyPressed",
|
|
566
|
-
"method": "
|
|
661
|
+
"method": "closeDropdownOnEscape",
|
|
567
662
|
"target": undefined,
|
|
568
663
|
"capture": false,
|
|
569
664
|
"passive": false
|
|
570
|
-
}, {
|
|
571
|
-
"name": "wmOptionBlurred",
|
|
572
|
-
"method": "handleOptionBlur",
|
|
573
|
-
"target": undefined,
|
|
574
|
-
"capture": false,
|
|
575
|
-
"passive": false
|
|
576
|
-
}, {
|
|
577
|
-
"name": "click",
|
|
578
|
-
"method": "handleClick",
|
|
579
|
-
"target": "document",
|
|
580
|
-
"capture": true,
|
|
581
|
-
"passive": false
|
|
582
665
|
}, {
|
|
583
666
|
"name": "keydown",
|
|
584
667
|
"method": "handleKey",
|
|
585
668
|
"target": undefined,
|
|
586
669
|
"capture": false,
|
|
587
670
|
"passive": false
|
|
671
|
+
}, {
|
|
672
|
+
"name": "resize",
|
|
673
|
+
"method": "handleResize",
|
|
674
|
+
"target": "window",
|
|
675
|
+
"capture": false,
|
|
676
|
+
"passive": true
|
|
588
677
|
}];
|
|
589
678
|
}
|
|
590
679
|
}
|
|
@@ -27,20 +27,9 @@ export class TabItem {
|
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
29
|
const isDark = this.parentTabList && this.parentTabList.customBackground == "dark";
|
|
30
|
-
|
|
31
|
-
const padding = this.parentTabList && this.parentTabList.customPadding;
|
|
32
|
-
if (padding) {
|
|
33
|
-
const bkgSize = parseInt(padding, 10) * 2 || 0;
|
|
34
|
-
const units = padding.split(/([0-9]+)/).pop();
|
|
35
|
-
styles = {
|
|
36
|
-
"padding-left": this.parentTabList.customPadding,
|
|
37
|
-
"padding-right": this.parentTabList.customPadding,
|
|
38
|
-
"background-size": `calc(100% - ${bkgSize}${units}) 3px`,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return (h(Host, { key: '52900a0ba44bc12c82c17f3f578110fab5869333', role: "presentation" }, h("li", { key: '510269829fc3885c9c45c358446051cf64121882', class: `tab-item ${isDark ? "dark" : ""}`, role: "presentation" }, h("a", { key: '68dcdd7baf19d5a311e3eebe06a4b69627b31e95', class: `tab`, style: styles, role: "tab", ref: (el) => (this.linkEl = el), id: `tab-link-${this.tabId}`, onKeyDown: (ev) => this.tabPressed(ev), "aria-selected": this.selected ? "true" : "false", tabindex: this.selected ? 0 : -1, onClick: this.tabClicked, onFocus: () => {
|
|
30
|
+
return (h(Host, { key: 'd767cecfc366c666d0920361e1af1eeb2cb120f8', role: "presentation" }, h("li", { key: '05626b99685379b2c774a59eb10d4774f01dcd83', class: `tab-item ${isDark ? "dark" : ""}`, role: "presentation" }, h("a", { key: '3ae61be7ebb1bd1c45cd4a4badddebf990dc5c06', class: `tab`, role: "tab", ref: (el) => (this.linkEl = el), id: `tab-link-${this.tabId}`, onKeyDown: (ev) => this.tabPressed(ev), "aria-selected": this.selected ? "true" : "false", tabindex: this.selected ? 0 : -1, onClick: this.tabClicked, onFocus: () => {
|
|
42
31
|
this.wmIntTabFocused.emit({ tabItem: this.el });
|
|
43
|
-
} }, h("slot", { key: '
|
|
32
|
+
} }, h("slot", { key: '128c129d643610993747736efe64018cdaf5ab31' })))));
|
|
44
33
|
}
|
|
45
34
|
static get is() { return "wm-tab-item"; }
|
|
46
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,7 +7,6 @@ export class TabList {
|
|
|
7
7
|
this.updateArrowVisibility();
|
|
8
8
|
}, 16);
|
|
9
9
|
this.customBackground = undefined;
|
|
10
|
-
this.customPadding = undefined;
|
|
11
10
|
this.selectedTab = undefined;
|
|
12
11
|
this.announcement = "";
|
|
13
12
|
this.containerFadeLeft = false;
|
|
@@ -55,11 +54,14 @@ export class TabList {
|
|
|
55
54
|
componentDidLoad() {
|
|
56
55
|
const selectedTab = this.selectedTab || this.tabItems[0].tabId;
|
|
57
56
|
this.setSelected(selectedTab);
|
|
58
|
-
this.handleTabFocused(this.selectedTabItem);
|
|
59
57
|
this.updateArrowVisibility();
|
|
60
58
|
this.tabContainerEl.addEventListener("scroll", this.debouncedUpdateContainerState);
|
|
61
59
|
const resizeObserver = new ResizeObserver(() => this.debouncedUpdateContainerState());
|
|
62
60
|
resizeObserver.observe(this.el);
|
|
61
|
+
requestAnimationFrame(() => {
|
|
62
|
+
// Wait for layout to complete before measuring and scrolling initial tab into view
|
|
63
|
+
this.handleTabFocused(this.selectedTabItem);
|
|
64
|
+
});
|
|
63
65
|
}
|
|
64
66
|
tabItemLoaded(ev) {
|
|
65
67
|
this.setAriaOnPanelAndTab(ev.target);
|
|
@@ -179,7 +181,7 @@ export class TabList {
|
|
|
179
181
|
updateArrowVisibility() {
|
|
180
182
|
const leftArrowEl = this.el.shadowRoot.querySelector(".left-arrow");
|
|
181
183
|
const rightArrowEl = this.el.shadowRoot.querySelector(".right-arrow");
|
|
182
|
-
const isScrollable = this.tabContainerEl.scrollWidth > this.
|
|
184
|
+
const isScrollable = this.tabContainerEl.scrollWidth > this.tabContainerEl.clientWidth;
|
|
183
185
|
this.scrollArrowsVisible = isScrollable;
|
|
184
186
|
requestAnimationFrame(() => {
|
|
185
187
|
// Let arrows render before checking if they should be disabled
|
|
@@ -255,21 +257,15 @@ export class TabList {
|
|
|
255
257
|
this.announcement = message;
|
|
256
258
|
}
|
|
257
259
|
render() {
|
|
258
|
-
|
|
259
|
-
if (this.customPadding) {
|
|
260
|
-
margins = {
|
|
261
|
-
"margin-inline": "-" + this.customPadding,
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
return (h(Host, { key: '951f6dcf457201034adca055366df0107df6a116' }, h("div", { key: '489cf5f1acf3c985c6208e9b5b6f507422251c6c', class: "component-wrapper", style: margins }, h("wm-button", { key: 'c83f686c864b91ef3ac2530a47196e3a767b8609', class: `left-arrow ${this.scrollArrowsVisible ? "visible" : ""}`, "aria-controls": "tablist", customBackground: this.customBackground, buttonType: "navigational", icon: "#previous", tooltip: intl.formatMessage({
|
|
260
|
+
return (h(Host, { key: '5818027d2cb7470679c21ac94fef8bae53395054' }, h("div", { key: '02a4a7678765a6cbf269c01d4e2f2f8afcde8cb1', class: "component-wrapper" }, h("wm-button", { key: '267436b0e7f4dae88da12517527ca0dbf324d0b0', class: `left-arrow ${this.scrollArrowsVisible ? "visible" : ""}`, "aria-controls": "tablist", customBackground: this.customBackground, buttonType: "navigational", icon: "#previous", tooltip: intl.formatMessage({
|
|
265
261
|
id: "tabs.showPreviousTabs",
|
|
266
262
|
defaultMessage: "Show previous tabs",
|
|
267
263
|
description: "Tooltip for button scrolling tab group.",
|
|
268
|
-
}), onClick: (ev) => this.handleLeftArrowClick(ev) }), h("ul", { key: '
|
|
264
|
+
}), onClick: (ev) => this.handleLeftArrowClick(ev) }), h("ul", { key: '4983447234c47552d424d4572ae794503eb536fd', id: "tablist", ref: (el) => (this.tabContainerEl = el), class: `tabcontainer ${this.customBackground || ""} ${this.containerFadeLeft ? "fade-left" : ""} ${this.containerFadeRight ? "fade-right" : ""}`, role: "tablist", tabIndex: -1 }, h("slot", { key: '40d3c063e98bf2fbec8d9e92ecc8ada156cea2ea' })), h("wm-button", { key: 'bc45390e49d2246cd16b24a1159720308a3fe24f', class: `right-arrow ${this.scrollArrowsVisible ? "visible" : ""}`, "aria-controls": "tablist", customBackground: this.customBackground, buttonType: "navigational", icon: "#next", tooltip: intl.formatMessage({
|
|
269
265
|
id: "tabs.showNextTabs",
|
|
270
266
|
defaultMessage: "Show next tabs",
|
|
271
267
|
description: "Tooltip for button scrolling tab group.",
|
|
272
|
-
}), onClick: (ev) => this.handleRightArrowClick(ev) }), h("span", { key: '
|
|
268
|
+
}), onClick: (ev) => this.handleRightArrowClick(ev) }), h("span", { key: 'c98334986ffe5ffc47d0b48d141c2d985772b3e5', "aria-live": "assertive", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement))));
|
|
273
269
|
}
|
|
274
270
|
static get is() { return "wm-tab-list"; }
|
|
275
271
|
static get encapsulation() { return "shadow"; }
|
|
@@ -303,23 +299,6 @@ export class TabList {
|
|
|
303
299
|
"attribute": "custom-background",
|
|
304
300
|
"reflect": false
|
|
305
301
|
},
|
|
306
|
-
"customPadding": {
|
|
307
|
-
"type": "string",
|
|
308
|
-
"mutable": false,
|
|
309
|
-
"complexType": {
|
|
310
|
-
"original": "string",
|
|
311
|
-
"resolved": "string | undefined",
|
|
312
|
-
"references": {}
|
|
313
|
-
},
|
|
314
|
-
"required": false,
|
|
315
|
-
"optional": true,
|
|
316
|
-
"docs": {
|
|
317
|
-
"tags": [],
|
|
318
|
-
"text": ""
|
|
319
|
-
},
|
|
320
|
-
"attribute": "custom-padding",
|
|
321
|
-
"reflect": false
|
|
322
|
-
},
|
|
323
302
|
"selectedTab": {
|
|
324
303
|
"type": "string",
|
|
325
304
|
"mutable": false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from './index-130e07bb.js';
|
|
2
|
-
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-
|
|
2
|
+
import { i as intl, c as checkForActiveElInShadow, e as safeMultiplyFloat, f as getPosition } from './functions-38e392cb.js';
|
|
3
3
|
|
|
4
4
|
const colors = {
|
|
5
5
|
salmon: "#ff5f4e",
|
|
@@ -10585,4 +10585,4 @@ const weekdays = [
|
|
|
10585
10585
|
intl.formatMessage({ id: "date.saturday", defaultMessage: "Saturday" }),
|
|
10586
10586
|
];
|
|
10587
10587
|
|
|
10588
|
-
export { findPrev as A, getTextDir as B,
|
|
10588
|
+
export { findPrev as A, getTextDir as B, throttle as C, getContextMeasurements as D, dateFind as E, calendar_months as F, findParentWithHiddenOverflow as G, transposeMatrix as H, wrapAround as I, getSmallestSkipInterval as J, calcPercentageInRange as K, isElOrChild as L, makeISO as M, getMonthLength as N, weekdays as O, handleDisabledAttribute as a, triggerFormSubmit as b, checkForActiveElInShadow as c, debounce as d, safeMultiplyFloat as e, getPosition as f, generateId as g, hideTooltip as h, intl as i, findAllScrollableParents as j, dateToISO as k, shouldOpenUp as l, hasRoomRight as m, truncateText as n, getLastFocusableDescendant as o, csvToArray as p, snakeCaseToCamelCase as q, getNewIndexToFocus as r, showTooltip as s, toBool as t, getCumulativeScrollOffset as u, shouldOpenDown as v, shouldShiftRight as w, shouldShiftLeft as x, measureText as y, findNext as z };
|