@ui5/webcomponents 1.13.0-rc.2 → 1.13.0-rc.3
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/CHANGELOG.md +21 -0
- package/dist/Carousel.d.ts +1 -0
- package/dist/Carousel.js +1 -0
- package/dist/Carousel.js.map +1 -1
- package/dist/CheckBox.d.ts +10 -0
- package/dist/CheckBox.js +10 -0
- package/dist/CheckBox.js.map +1 -1
- package/dist/Icon.d.ts +11 -0
- package/dist/Icon.js +11 -0
- package/dist/Icon.js.map +1 -1
- package/dist/Menu.d.ts +21 -0
- package/dist/Menu.js +26 -6
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +23 -1
- package/dist/MenuItem.js +10 -3
- package/dist/MenuItem.js.map +1 -1
- package/dist/Popup.js +3 -3
- package/dist/Popup.js.map +1 -1
- package/dist/Tab.d.ts +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/TabContainer.d.ts +10 -10
- package/dist/TabContainer.js +10 -10
- package/dist/TabContainer.js.map +1 -1
- package/dist/Title.d.ts +1 -0
- package/dist/Title.js +1 -0
- package/dist/Title.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/assets/Title.3d358ef7.css +1 -0
- package/dist/assets/parameters-bundle.css.067142cc.js +1 -0
- package/dist/assets/parameters-bundle.css.0d6c19c9.js +1 -0
- package/dist/assets/{parameters-bundle.css.f36b416c.js → parameters-bundle.css.217b9808.js} +1 -1
- package/dist/assets/parameters-bundle.css.2280ce3e.js +1 -0
- package/dist/assets/parameters-bundle.css.3e7079bc.js +1 -0
- package/dist/assets/parameters-bundle.css.46b7578e.js +1 -0
- package/dist/assets/parameters-bundle.css.472c33c9.js +1 -0
- package/dist/assets/parameters-bundle.css.750d2219.js +1 -0
- package/dist/assets/parameters-bundle.css.78ee4829.js +1 -0
- package/dist/assets/parameters-bundle.css.7bae430d.js +1 -0
- package/dist/assets/{parameters-bundle.css.3c25e356.js → parameters-bundle.css.860290a0.js} +1 -1
- package/dist/assets/{parameters-bundle.css.4daa1648.js → parameters-bundle.css.8f1d575d.js} +1 -1
- package/dist/assets/{parameters-bundle.css.d8251aad.js → parameters-bundle.css.91b4958e.js} +1 -1
- package/dist/assets/{parameters-bundle.css.21513a38.js → parameters-bundle.css.9b175fb5.js} +1 -1
- package/dist/assets/{parameters-bundle.css.040aa3dd.js → parameters-bundle.css.a68d7143.js} +1 -1
- package/dist/assets/parameters-bundle.css.ab21e265.js +1 -0
- package/dist/assets/parameters-bundle.css.b7a02c6d.js +1 -0
- package/dist/assets/parameters-bundle.css.b8686554.js +1 -0
- package/dist/assets/parameters-bundle.css.bdbac4ec.js +1 -0
- package/dist/assets/parameters-bundle.css.d6e06337.js +1 -0
- package/dist/assets/parameters-bundle.css.d806367c.js +1 -0
- package/dist/assets/parameters-bundle.css.ef6e66b9.js +1 -0
- package/dist/assets/parameters-bundle.css.f3164b8d.js +1 -0
- package/dist/assets/parameters-bundle.css.f65359ec.js +1 -0
- package/dist/assets/test/pages/{ComboBox.html.8efde534.js → ComboBox.html.fe2828f4.js} +1 -1
- package/dist/assets/test/pages/{Icon.html.2b52be1e.js → Icon.html.d90a42c2.js} +1 -1
- package/dist/assets/test/pages/{Label.html.1a32d008.js → Label.html.e24cbd2c.js} +1 -1
- package/dist/assets/test/pages/{Popups.html.11aeb74f.js → Popups.html.cc7082c1.js} +1 -1
- package/dist/css/themes/CheckBox.css +1 -1
- package/dist/css/themes/Link.css +1 -1
- package/dist/css/themes/Menu.css +1 -1
- package/dist/css/themes/Suggestions.css +1 -1
- package/dist/css/themes/TabContainer.css +1 -1
- package/dist/css/themes/Title.css +1 -1
- package/dist/css/themes/sap_belize/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_belize_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_belize_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_exp/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/templates/CheckBoxTemplate.lit.js +1 -1
- package/dist/generated/templates/IconTemplate.lit.js +1 -1
- package/dist/generated/templates/InputPopoverTemplate.lit.js +1 -1
- package/dist/generated/templates/MenuTemplate.lit.js +5 -3
- package/dist/generated/themes/CheckBox.css.js +1 -1
- package/dist/generated/themes/CheckBox.css.js.map +1 -1
- package/dist/generated/themes/Link.css.js +1 -1
- package/dist/generated/themes/Link.css.js.map +1 -1
- package/dist/generated/themes/Menu.css.js +1 -1
- package/dist/generated/themes/Menu.css.js.map +1 -1
- package/dist/generated/themes/Suggestions.css.js +1 -1
- package/dist/generated/themes/Suggestions.css.js.map +1 -1
- package/dist/generated/themes/TabContainer.css.js +1 -1
- package/dist/generated/themes/TabContainer.css.js.map +1 -1
- package/dist/generated/themes/Title.css.js +1 -1
- package/dist/generated/themes/Title.css.js.map +1 -1
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/test/pages/72override.html +1 -1
- package/dist/test/pages/AnimanitionOff.html +1 -1
- package/dist/test/pages/Avatar.html +1 -1
- package/dist/test/pages/AvatarGroup.html +1 -1
- package/dist/test/pages/Badge.html +1 -1
- package/dist/test/pages/Breadcrumbs.html +1 -1
- package/dist/test/pages/BusyIndicator.html +1 -1
- package/dist/test/pages/Button.html +1 -1
- package/dist/test/pages/Calendar.html +1 -1
- package/dist/test/pages/Card.html +1 -1
- package/dist/test/pages/Carousel.html +1 -1
- package/dist/test/pages/CheckBox.html +1 -1
- package/dist/test/pages/ColorPalette.html +1 -1
- package/dist/test/pages/ColorPalettePopover.html +1 -1
- package/dist/test/pages/ColorPicker.html +1 -1
- package/dist/test/pages/ComboBox.html +2 -2
- package/dist/test/pages/Components.html +1 -1
- package/dist/test/pages/CoreControls.html +1 -1
- package/dist/test/pages/CoreControls_exp.html +1 -1
- package/dist/test/pages/CustomCSS.html +1 -1
- package/dist/test/pages/DatePicker.html +1 -1
- package/dist/test/pages/DatePicker_test_page.html +1 -1
- package/dist/test/pages/DateRangePicker.html +1 -1
- package/dist/test/pages/DateTimePicker.html +1 -1
- package/dist/test/pages/DateTimePicker_Timezone.html +1 -1
- package/dist/test/pages/DayPicker.html +1 -1
- package/dist/test/pages/Dialog.html +1 -1
- package/dist/test/pages/DialogLifecycle.html +1 -1
- package/dist/test/pages/DialogSemantic.html +1 -1
- package/dist/test/pages/Eventing.html +1 -1
- package/dist/test/pages/F6Test1.html +1 -1
- package/dist/test/pages/F6Test2.html +1 -1
- package/dist/test/pages/F6Test3.html +1 -1
- package/dist/test/pages/F6Test4.html +1 -1
- package/dist/test/pages/F6Test5.html +1 -1
- package/dist/test/pages/F6Test6.html +1 -1
- package/dist/test/pages/F6Test7.html +1 -1
- package/dist/test/pages/FileUploader.html +1 -1
- package/dist/test/pages/FormComponents.html +1 -1
- package/dist/test/pages/FormSupport.html +1 -1
- package/dist/test/pages/HCB.html +1 -1
- package/dist/test/pages/Icon.html +2 -2
- package/dist/test/pages/Icon_and_theming.html +1 -1
- package/dist/test/pages/Icon_custom.html +1 -1
- package/dist/test/pages/Input.html +1 -1
- package/dist/test/pages/InputFieldLabels.html +1 -1
- package/dist/test/pages/InputFieldMinWidth.html +1 -1
- package/dist/test/pages/InputIcons.html +1 -1
- package/dist/test/pages/Input_quickview.html +1 -1
- package/dist/test/pages/InputsAlignment.html +1 -1
- package/dist/test/pages/InputsLazyLoading.html +1 -1
- package/dist/test/pages/ItemNavigation.html +1 -1
- package/dist/test/pages/Kitchen.html +1 -1
- package/dist/test/pages/Kitchen.openui5.html +1 -1
- package/dist/test/pages/Label.html +2 -2
- package/dist/test/pages/Link.html +1 -1
- package/dist/test/pages/List.html +1 -1
- package/dist/test/pages/ListGrowing_Button.html +1 -1
- package/dist/test/pages/ListGrowing_Scroll.html +1 -1
- package/dist/test/pages/List_keyboard_support.html +1 -1
- package/dist/test/pages/List_test_page.html +1 -1
- package/dist/test/pages/LitKeyFunction.html +1 -1
- package/dist/test/pages/MemoryLeak.html +1 -1
- package/dist/test/pages/Menu.html +3 -3
- package/dist/test/pages/MessagePage.html +1 -1
- package/dist/test/pages/MessageStrip.html +1 -1
- package/dist/test/pages/MultiComboBox.html +1 -1
- package/dist/test/pages/MultiInput.html +1 -1
- package/dist/test/pages/MultiInput_Suggestions.html +1 -1
- package/dist/test/pages/OpenUI5-second.html +1 -1
- package/dist/test/pages/OpenUI5.html +1 -1
- package/dist/test/pages/Panel.html +1 -1
- package/dist/test/pages/Popover.html +1 -1
- package/dist/test/pages/PopoverArrowBounds.html +1 -1
- package/dist/test/pages/Popups.html +2 -2
- package/dist/test/pages/ProgressIndicator.html +1 -1
- package/dist/test/pages/RTL.html +1 -1
- package/dist/test/pages/RadioButton.html +1 -1
- package/dist/test/pages/RangeSlider.html +1 -1
- package/dist/test/pages/RatingIndicator.html +1 -1
- package/dist/test/pages/ResizeHandler.html +1 -1
- package/dist/test/pages/ResponsivePopover.html +1 -1
- package/dist/test/pages/SegmentedButton.html +1 -1
- package/dist/test/pages/Select.html +1 -1
- package/dist/test/pages/Simple.html +1 -1
- package/dist/test/pages/Slider.html +1 -1
- package/dist/test/pages/SplitButton.html +1 -1
- package/dist/test/pages/StepInput.html +1 -1
- package/dist/test/pages/Switch.html +1 -1
- package/dist/test/pages/TabContainer.html +1 -1
- package/dist/test/pages/Table-perf-pure.html +1 -1
- package/dist/test/pages/Table-perf.html +1 -1
- package/dist/test/pages/Table.html +1 -1
- package/dist/test/pages/Table2.html +1 -1
- package/dist/test/pages/TableAllPopin.html +1 -1
- package/dist/test/pages/TableCustomStyling.html +1 -1
- package/dist/test/pages/TableGrouping.html +1 -1
- package/dist/test/pages/TableGrowingWithButton.html +1 -1
- package/dist/test/pages/TableGrowingWithScroll.html +1 -1
- package/dist/test/pages/TableSelection.html +1 -1
- package/dist/test/pages/TextArea.html +1 -1
- package/dist/test/pages/TimePicker.html +1 -1
- package/dist/test/pages/TimeSelection.html +1 -1
- package/dist/test/pages/Title.html +38 -15
- package/dist/test/pages/Toast.html +1 -1
- package/dist/test/pages/ToggleButton.html +1 -1
- package/dist/test/pages/Tree.html +1 -1
- package/dist/test/pages/WheelSlider_Test_Page.html +1 -1
- package/dist/test/pages/base/AriaLabelHelper.html +1 -1
- package/dist/test/pages/base/DOMObserver.html +1 -1
- package/dist/test/pages/base/IconCollection.html +1 -1
- package/dist/test/pages/base/IconCollectionInCustomTheme.html +1 -1
- package/dist/test/pages/base/InvisibleMessage.html +1 -1
- package/dist/test/pages/form.html +1 -1
- package/dist/test/pages/i18n-defaultLang.html +1 -1
- package/dist/test/pages/i18n-demo.html +1 -1
- package/package.json +7 -7
- package/src/CheckBox.hbs +1 -0
- package/src/Icon.hbs +1 -0
- package/src/InputPopover.hbs +1 -1
- package/src/Menu.hbs +12 -1
- package/src/themes/CheckBox.css +13 -23
- package/src/themes/Link.css +10 -3
- package/src/themes/Menu.css +4 -0
- package/src/themes/Suggestions.css +12 -0
- package/src/themes/TabContainer.css +2 -0
- package/src/themes/Title.css +8 -1
- package/src/themes/base/Link-parameters.css +2 -0
- package/src/themes/sap_horizon/CheckBox-parameters.css +4 -9
- package/src/themes/sap_horizon/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_dark/CheckBox-parameters.css +4 -9
- package/src/themes/sap_horizon_dark/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_hcb/CheckBox-parameters.css +2 -7
- package/src/themes/sap_horizon_hcb/Link-parameters.css +1 -0
- package/src/themes/sap_horizon_hcw/CheckBox-parameters.css +2 -7
- package/src/themes/sap_horizon_hcw/Link-parameters.css +1 -0
- package/dist/assets/Title.d6aa17aa.css +0 -1
- package/dist/assets/parameters-bundle.css.1b6e2478.js +0 -1
- package/dist/assets/parameters-bundle.css.2c8496aa.js +0 -1
- package/dist/assets/parameters-bundle.css.52765351.js +0 -1
- package/dist/assets/parameters-bundle.css.699b96c0.js +0 -1
- package/dist/assets/parameters-bundle.css.6db4d34a.js +0 -1
- package/dist/assets/parameters-bundle.css.70a65e3a.js +0 -1
- package/dist/assets/parameters-bundle.css.71348be9.js +0 -1
- package/dist/assets/parameters-bundle.css.71c92b92.js +0 -1
- package/dist/assets/parameters-bundle.css.75b9ef28.js +0 -1
- package/dist/assets/parameters-bundle.css.7629e56e.js +0 -1
- package/dist/assets/parameters-bundle.css.91aaddc5.js +0 -1
- package/dist/assets/parameters-bundle.css.9bd22734.js +0 -1
- package/dist/assets/parameters-bundle.css.b7a262bf.js +0 -1
- package/dist/assets/parameters-bundle.css.b8f73a77.js +0 -1
- package/dist/assets/parameters-bundle.css.c565b624.js +0 -1
- package/dist/assets/parameters-bundle.css.cbd268df.js +0 -1
- package/dist/assets/parameters-bundle.css.f2cd40dd.js +0 -1
- package/dist/assets/parameters-bundle.css.f552e9e6.js +0 -1
package/dist/Menu.js
CHANGED
|
@@ -16,11 +16,13 @@ import { isPhone, isTablet, isDesktop, } from "@ui5/webcomponents-base/dist/Devi
|
|
|
16
16
|
import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
17
17
|
import "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
18
18
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
19
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
19
20
|
import ResponsivePopover from "./ResponsivePopover.js";
|
|
20
21
|
import Button from "./Button.js";
|
|
21
22
|
import List from "./List.js";
|
|
22
23
|
import StandardListItem from "./StandardListItem.js";
|
|
23
24
|
import Icon from "./Icon.js";
|
|
25
|
+
import BusyIndicator from "./BusyIndicator.js";
|
|
24
26
|
import staticAreaMenuTemplate from "./generated/templates/MenuTemplate.lit.js";
|
|
25
27
|
import { MENU_BACK_BUTTON_ARIA_LABEL, MENU_CLOSE_BUTTON_ARIA_LABEL, } from "./generated/i18n/i18n-defaults.js";
|
|
26
28
|
// Styles
|
|
@@ -105,6 +107,10 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
105
107
|
this._currentItems.forEach(item => {
|
|
106
108
|
item.item._siblingsWithChildren = itemsWithChildren;
|
|
107
109
|
item.item._siblingsWithIcon = itemsWithIcon;
|
|
110
|
+
if (item.item._subMenu) {
|
|
111
|
+
item.item._subMenu.busy = item.item.busy;
|
|
112
|
+
item.item._subMenu.busyDelay = item.item.busyDelay;
|
|
113
|
+
}
|
|
108
114
|
});
|
|
109
115
|
}
|
|
110
116
|
onAfterRendering() {
|
|
@@ -181,7 +187,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
181
187
|
return {
|
|
182
188
|
item,
|
|
183
189
|
position: index + 1,
|
|
184
|
-
ariaHasPopup: item.
|
|
190
|
+
ariaHasPopup: item.hasSubmenu ? "menu" : undefined,
|
|
185
191
|
};
|
|
186
192
|
});
|
|
187
193
|
}
|
|
@@ -192,6 +198,8 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
192
198
|
subMenu._isSubMenu = true;
|
|
193
199
|
subMenu.setAttribute("id", `submenu-${openerId}`);
|
|
194
200
|
subMenu._parentMenuItem = item;
|
|
201
|
+
subMenu.busy = item.busy;
|
|
202
|
+
subMenu.busyDelay = item.busyDelay;
|
|
195
203
|
const subItems = item.children;
|
|
196
204
|
let clonedItem, idx;
|
|
197
205
|
for (idx = 0; idx < subItems.length; idx++) {
|
|
@@ -232,11 +240,11 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
232
240
|
}
|
|
233
241
|
}
|
|
234
242
|
_prepareSubMenuDesktopTablet(item, opener, actionId) {
|
|
235
|
-
if (actionId !== this._subMenuOpenerId || (item && item.
|
|
243
|
+
if (actionId !== this._subMenuOpenerId || (item && item.hasSubmenu)) {
|
|
236
244
|
// close opened sub-menu if there is any opened
|
|
237
245
|
this._closeItemSubMenu(this._openedSubMenuItem, true);
|
|
238
246
|
}
|
|
239
|
-
if (item && item.
|
|
247
|
+
if (item && item.hasSubmenu) {
|
|
240
248
|
// create new sub-menu
|
|
241
249
|
this._createSubMenu(item, actionId);
|
|
242
250
|
this._openItemSubMenu(item, opener, actionId);
|
|
@@ -260,12 +268,17 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
260
268
|
this._prepareSubMenuDesktopTablet(item, opener, hoverId);
|
|
261
269
|
}
|
|
262
270
|
}
|
|
271
|
+
_busyMouseOver() {
|
|
272
|
+
if (this._parentMenuItem) {
|
|
273
|
+
this._parentMenuItem._preventSubMenuClose = true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
263
276
|
_itemMouseOut(e) {
|
|
264
277
|
if (isDesktop()) {
|
|
265
278
|
// respect mouseover only on desktop
|
|
266
279
|
const opener = e.target;
|
|
267
280
|
const item = opener.associatedItem;
|
|
268
|
-
if (item && item.
|
|
281
|
+
if (item && item.hasSubmenu && item._subMenu) {
|
|
269
282
|
// try to close the sub-menu
|
|
270
283
|
item._preventSubMenuClose = false;
|
|
271
284
|
this._closeItemSubMenu(item);
|
|
@@ -282,7 +295,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
282
295
|
const opener = e.target;
|
|
283
296
|
const item = opener.associatedItem;
|
|
284
297
|
const hoverId = opener.getAttribute("id");
|
|
285
|
-
item.
|
|
298
|
+
item.hasSubmenu && this._prepareSubMenuDesktopTablet(item, opener, hoverId);
|
|
286
299
|
}
|
|
287
300
|
else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {
|
|
288
301
|
const parentMenuItemParent = this._parentMenuItem.parentElement;
|
|
@@ -293,7 +306,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
293
306
|
const opener = e.detail.item;
|
|
294
307
|
const item = opener.associatedItem;
|
|
295
308
|
const actionId = opener.getAttribute("id");
|
|
296
|
-
if (!item.
|
|
309
|
+
if (!item.hasSubmenu) {
|
|
297
310
|
// click on an item that doesn't have sub-items fires an "item-click" event
|
|
298
311
|
if (!this._isSubMenu) {
|
|
299
312
|
if (isPhone()) {
|
|
@@ -360,6 +373,12 @@ __decorate([
|
|
|
360
373
|
__decorate([
|
|
361
374
|
property({ type: Boolean })
|
|
362
375
|
], Menu.prototype, "open", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
property({ type: Boolean })
|
|
378
|
+
], Menu.prototype, "busy", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
property({ validator: Integer, defaultValue: 1000 })
|
|
381
|
+
], Menu.prototype, "busyDelay", void 0);
|
|
363
382
|
__decorate([
|
|
364
383
|
property({ validator: DOMReference, defaultValue: "" })
|
|
365
384
|
], Menu.prototype, "opener", void 0);
|
|
@@ -399,6 +418,7 @@ Menu = Menu_1 = __decorate([
|
|
|
399
418
|
List,
|
|
400
419
|
StandardListItem,
|
|
401
420
|
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C;GACf,IAAI,CAkbT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport DOMReference from \"@ui5/webcomponents-base/dist/types/DOMReference.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport StandardListItem from \"./StandardListItem.js\";\nimport Icon from \"./Icon.js\";\nimport type MenuItem from \"./MenuItem.js\";\nimport type { ClickEventDetail } from \"./List.js\";\nimport staticAreaMenuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport staticAreaMenuCss from \"./generated/themes/Menu.css.js\";\n\ntype CurrentItem = {\n\titem: MenuItem,\n\tposition: number,\n\tariaHasPopup: string | undefined,\n}\n\ntype OpenerStandardListItem = StandardListItem & { associatedItem: MenuItem };\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu</code> component represents a hierarchical menu structure.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu</code> contains <code>ui5-menu-item</code> components.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Keyboard Handling</h3>\n *\n * The <code>ui5-menu</code> provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n * <ul>\n * <li><code>Arrow Up</code> / <code>Arrow Down</code> - Navigates up and down the menu items that are currently visible.</li>\n * <li><code>Arrow Right</code>, <code>Space</code> or <code>Enter</code> - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.</li>\n * <li><code>Arrow Left</code> or <code>Escape</code> - Closes the currently opened sub-menu.</li>\n * </ul>\n * Note: if the text ditrection is set to Right-to-left (RTL), <code>Arrow Right</code> and <code>Arrow Left</code> functionality is swapped.\n * <br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Menu.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Menu\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-menu\n * @appenddocs sap.ui.webc.main.MenuItem\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstaticAreaStyles: staticAreaMenuCss,\n\tstaticAreaTemplate: staticAreaMenuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tStandardListItem,\n\t\tIcon,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * @event sap.ui.webc.main.Menu#item-click\n * @param {object} item The currently clicked menu item.\n * @param {string} text The text of the currently clicked menu item.\n * @public\n */\n@event(\"item-click\", {\n\tdetail: {\n\t\titem: {\n\t\t\ttype: Object,\n\t\t},\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-open\n * @allowPreventDefault\n * @since 1.10.0\n */\n@event(\"before-open\")\n\n/**\n * Fired after the menu is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-open\n * @since 1.10.0\n */\n@event(\"after-open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tdetail: {\n\t\tescPressed: { type: Boolean },\n\t},\n})\n\n/**\n * Fired after the menu is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-close\n * @since 1.10.0\n */\n@event(\"after-close\")\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.headerText\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\theaderText!: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.open\n\t * @public\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen!:boolean;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element that the menu is shown at\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.opener\n\t * @public\n\t * @type {sap.ui.webc.base.types.DOMReference}\n\t * @defaultvalue \"\"\n\t * @since 1.10.0\n\t */\n\t@property({ validator: DOMReference, defaultValue: \"\" })\n\topener!: HTMLElement | string;\n\n\t/**\n\t * Defines if the menu is sub-menu (not first-level).\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_isSubMenu!: boolean;\n\n\t/**\n\t * Stores id of a list item that opened sub-menu.\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\t_subMenuOpenerId!: string;\n\n\t/**\n\t * Defines the currently available menu items.\n\t * (in case of non-phone devices these are the items of the menu,\n\t * but for phone devices the items of the currently opened sub-menu\n\t * will be populated here)\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_currentItems!: Array<CurrentItem>;\n\n\t/**\n\t * Stores a list of parent menu items for each sub-menu (on phone).\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_parentItemsStack!: Array<MenuItem>;\n\n\t/**\n\t * Stores the ResponsivePopover instance\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_popover?: ResponsivePopover;\n\n\t/**\n\t * Stores parent menu item (if there is such).\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_parentMenuItem?: MenuItem;\n\n\t/**\n\t * Stores menu item that have sub-menu opened.\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_openedSubMenuItem?: MenuItem;\n\n\t/**\n\t * Defines the items of this component.\n\t * <br><br>\n\t * <b>Note:</b> Use <code>ui5-menu-item</code> for the intended design.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget itemsWithChildren() {\n\t\treturn !!this._currentItems.filter(item => item.item.items.length).length;\n\t}\n\n\tget itemsWithIcon() {\n\t\treturn !!this._currentItems.filter(item => item.item.icon !== \"\").length;\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget placementType() {\n\t\tconst placement = this.isRtl ? \"Left\" : \"Right\";\n\t\treturn this._isSubMenu ? placement : \"Bottom\";\n\t}\n\n\tget verticalAlign() {\n\t\treturn this._isSubMenu ? \"Top\" : \"Bottom\";\n\t}\n\n\tget labelBack() {\n\t\treturn Menu.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget isSubMenuOpened() {\n\t\treturn !!this._parentMenuItem;\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this._parentMenuItem ? this._parentMenuItem.text : this.headerText;\n\t}\n\n\tonBeforeRendering() {\n\t\t!isPhone() && this._prepareCurrentItems(this.items);\n\n\t\tconst itemsWithChildren = this.itemsWithChildren;\n\t\tconst itemsWithIcon = this.itemsWithIcon;\n\n\t\tthis._currentItems.forEach(item => {\n\t\t\titem.item._siblingsWithChildren = itemsWithChildren;\n\t\t\titem.item._siblingsWithIcon = itemsWithIcon;\n\t\t});\n\t}\n\n\tonAfterRendering() {\n\t\tif (!this.opener) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.open) {\n\t\t\tconst rootNode = this.getRootNode() as Document;\n\t\t\tconst opener = this.opener instanceof HTMLElement ? this.opener : rootNode && rootNode.getElementById(this.opener);\n\n\t\t\tif (opener) {\n\t\t\t\tthis.showAt(opener);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Shows the Menu near the opener element.\n\t * @param {HTMLElement} opener the element that the popover is shown at\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#showAt\n\t */\n\tasync showAt(opener: HTMLElement) {\n\t\tif (isPhone()) {\n\t\t\tthis._prepareCurrentItems(this.items);\n\t\t\tthis._parentItemsStack = [];\n\t\t}\n\t\tif (!this._isSubMenu) {\n\t\t\tthis._parentMenuItem = undefined;\n\t\t}\n\t\tconst popover = await this._createPopover();\n\t\tpopover.initialFocus = \"\";\n\t\tfor (let index = 0; index < this._currentItems.length; index++) {\n\t\t\tif (!this._currentItems[index].item.disabled) {\n\t\t\t\tpopover.initialFocus = `${this._id}-menu-item-${index}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpopover.showAt(opener);\n\t}\n\n\t/**\n\t * Closes the Menu.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#close\n\t */\n\tclose() {\n\t\tif (this._popover) {\n\t\t\tif (isPhone()) {\n\t\t\t\tthis._parentItemsStack = [];\n\t\t\t}\n\t\t\tthis._popover.close();\n\t\t\tthis._popover.resetFocus();\n\t\t}\n\t}\n\n\tasync _createPopover() {\n\t\tconst staticAreaItemDomRef = await this.getStaticAreaItemDomRef();\n\t\tthis._popover = staticAreaItemDomRef!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t\treturn this._popover;\n\t}\n\n\t_navigateBack() {\n\t\tconst parentMenuItem = this._parentItemsStack.pop();\n\n\t\tthis.focus();\n\t\tif (parentMenuItem) {\n\t\t\tconst parentMenuItemParent = parentMenuItem.parentElement as MenuItem;\n\t\t\tthis._prepareCurrentItems(parentMenuItemParent.items);\n\t\t\tthis._parentMenuItem = this._parentItemsStack.length ? this._parentItemsStack[this._parentItemsStack.length - 1] : undefined;\n\t\t}\n\t}\n\n\t_prepareCurrentItems(items: Array<MenuItem>) {\n\t\tthis._currentItems = items.map((item, index) => {\n\t\t\treturn {\n\t\t\t\titem,\n\t\t\t\tposition: index + 1,\n\t\t\t\tariaHasPopup: item.hasChildren ? \"menu\" : undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t_createSubMenu(item: MenuItem, openerId: string) {\n\t\tconst ctor = this.constructor as typeof Menu;\n\t\tconst subMenu = document.createElement(ctor.getMetadata().getTag()) as Menu;\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tsubMenu._isSubMenu = true;\n\t\tsubMenu.setAttribute(\"id\", `submenu-${openerId}`);\n\t\tsubMenu._parentMenuItem = item;\n\t\tconst subItems = item.children;\n\t\tlet clonedItem,\n\t\t\tidx;\n\t\tfor (idx = 0; idx < subItems.length; idx++) {\n\t\t\tclonedItem = subItems[idx].cloneNode(true);\n\t\t\tfragment.appendChild(clonedItem);\n\t\t}\n\t\tsubMenu.appendChild(fragment);\n\t\tthis.staticAreaItem!.shadowRoot!.querySelector(\".ui5-menu-submenus\")!.appendChild(subMenu);\n\t\titem._subMenu = subMenu;\n\t}\n\n\t_openItemSubMenu(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\titem._subMenu!.showAt(opener);\n\t\titem._preventSubMenuClose = true;\n\t\tthis._openedSubMenuItem = item;\n\t\tthis._subMenuOpenerId = actionId;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem, forceClose = false) {\n\t\tif (item) {\n\t\t\tif (forceClose) {\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeSubMenuPopover(item._subMenu!, true);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => this._closeSubMenuPopover(item._subMenu!), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\t_closeSubMenuPopover(subMenu: Menu, forceClose = false) {\n\t\tif (subMenu) {\n\t\t\tconst parentItem = subMenu._parentMenuItem!;\n\n\t\t\tif (forceClose || !parentItem._preventSubMenuClose) {\n\t\t\t\tsubMenu.close();\n\t\t\t\tsubMenu.remove();\n\t\t\t\tparentItem._subMenu = undefined;\n\t\t\t\tthis._openedSubMenuItem = undefined;\n\t\t\t\tthis._subMenuOpenerId = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t_prepareSubMenuDesktopTablet(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\tif (actionId !== this._subMenuOpenerId || (item && item.hasChildren)) {\n\t\t\t// close opened sub-menu if there is any opened\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem!, true);\n\t\t}\n\t\tif (item && item.hasChildren) {\n\t\t\t// create new sub-menu\n\t\t\tthis._createSubMenu(item, actionId);\n\t\t\tthis._openItemSubMenu(item, opener, actionId);\n\t\t}\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_prepareSubMenuPhone(item: MenuItem) {\n\t\tthis._prepareCurrentItems(item.items);\n\t\tthis._parentMenuItem = item;\n\t\tthis._parentItemsStack.push(item);\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\topener.focus();\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t}\n\t}\n\n\t_itemMouseOut(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\n\t\t\tif (item && item.hasChildren && item._subMenu) {\n\t\t\t\t// try to close the sub-menu\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeItemSubMenu(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isMenuClose = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst isMenuOpen = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (isMenuOpen) {\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\titem.hasChildren && this._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t} else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {\n\t\t\tconst parentMenuItemParent = this._parentMenuItem.parentElement as Menu;\n\t\t\tparentMenuItemParent._closeItemSubMenu(this._parentMenuItem, true);\n\t\t}\n\t}\n\n\t_itemClick(e: CustomEvent<ClickEventDetail>) {\n\t\tconst opener = e.detail.item as OpenerStandardListItem;\n\t\tconst item = opener.associatedItem;\n\t\tconst actionId = opener.getAttribute(\"id\")!;\n\n\t\tif (!item.hasChildren) {\n\t\t\t// click on an item that doesn't have sub-items fires an \"item-click\" event\n\t\t\tif (!this._isSubMenu) {\n\t\t\t\tif (isPhone()) {\n\t\t\t\t\tthis._parentMenuItem = undefined;\n\t\t\t\t}\n\t\t\t\t// fire event if the click is on top-level menu item\n\t\t\t\tthis.fireEvent(\"item-click\", {\n\t\t\t\t\t\"item\": item,\n\t\t\t\t\t\"text\": item.text,\n\t\t\t\t});\n\t\t\t\tthis._popover!.close();\n\t\t\t} else {\n\t\t\t\t// find top-level menu and redirect event to it\n\t\t\t\tlet parentMenu = item.parentElement as Menu;\n\t\t\t\twhile (parentMenu._parentMenuItem) {\n\t\t\t\t\tparentMenu._parentMenuItem._preventSubMenuClose = false;\n\t\t\t\t\tthis._closeItemSubMenu(parentMenu._parentMenuItem);\n\t\t\t\t\tparentMenu = parentMenu._parentMenuItem.parentElement as Menu;\n\t\t\t\t}\n\t\t\t\tparentMenu._itemClick(e);\n\t\t\t}\n\t\t} else if (isPhone()) {\n\t\t\t// prepares and opens sub-menu on phone\n\t\t\tthis._prepareSubMenuPhone(item);\n\t\t} else if (isTablet()) {\n\t\t\t// prepares and opens sub-menu on tablet\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, actionId);\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.open = true;\n\t\tthis.fireEvent(\"after-open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._openedSubMenuItem) {\n\t\t\tthis._openedSubMenuItem._preventSubMenuClose = false;\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem);\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"after-close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\n"]}
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,YAAY,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EACN,MAAM,EACN,OAAO,EACP,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACT,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAE3E,OAAO,mDAAmD,CAAC;AAC3D,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,OAAO,MAAM,+CAA+C,CAAC;AACpE,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AAEvD,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,gBAAgB,MAAM,uBAAuB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,aAAa,MAAM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IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;6CACzB;AAM3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;gDACtB;AAa9B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;mCACpD;AA7HnB,IAAI;IA5ET,aAAa,CAAC;QACd,GAAG,EAAE,UAAU;QACf,QAAQ,EAAE,SAAS;QACnB,gBAAgB,EAAE,iBAAiB;QACnC,kBAAkB,EAAE,sBAAsB;QAC1C,YAAY,EAAE;YACb,iBAAiB;YACjB,MAAM;YACN,IAAI;YACJ,gBAAgB;YAChB,IAAI;YACJ,aAAa;SACb;KACD,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,YAAY,EAAE;QACpB,MAAM,EAAE;YACP,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;YACD,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;aACZ;SACD;KACD,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;;OAMG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;;;;;;OAQG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,MAAM,EAAE;YACP,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC7B;KACD,CAAC;IAEF;;;;;;OAMG;;IACF,KAAK,CAAC,aAAa,CAAC;GACf,IAAI,CAsdT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport DOMReference from \"@ui5/webcomponents-base/dist/types/DOMReference.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisTablet,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport ResponsivePopover from \"./ResponsivePopover.js\";\nimport type { ResponsivePopoverBeforeCloseEventDetail } from \"./ResponsivePopover.js\";\nimport Button from \"./Button.js\";\nimport List from \"./List.js\";\nimport StandardListItem from \"./StandardListItem.js\";\nimport Icon from \"./Icon.js\";\nimport BusyIndicator from \"./BusyIndicator.js\";\nimport type MenuItem from \"./MenuItem.js\";\nimport type { ClickEventDetail } from \"./List.js\";\nimport staticAreaMenuTemplate from \"./generated/templates/MenuTemplate.lit.js\";\nimport {\n\tMENU_BACK_BUTTON_ARIA_LABEL,\n\tMENU_CLOSE_BUTTON_ARIA_LABEL,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport staticAreaMenuCss from \"./generated/themes/Menu.css.js\";\n\ntype CurrentItem = {\n\titem: MenuItem,\n\tposition: number,\n\tariaHasPopup: string | undefined,\n}\n\ntype OpenerStandardListItem = StandardListItem & { associatedItem: MenuItem };\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu</code> component represents a hierarchical menu structure.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu</code> contains <code>ui5-menu-item</code> components.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Keyboard Handling</h3>\n *\n * The <code>ui5-menu</code> provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n * <ul>\n * <li><code>Arrow Up</code> / <code>Arrow Down</code> - Navigates up and down the menu items that are currently visible.</li>\n * <li><code>Arrow Right</code>, <code>Space</code> or <code>Enter</code> - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.</li>\n * <li><code>Arrow Left</code> or <code>Escape</code> - Closes the currently opened sub-menu.</li>\n * </ul>\n * Note: if the text ditrection is set to Right-to-left (RTL), <code>Arrow Right</code> and <code>Arrow Left</code> functionality is swapped.\n * <br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Menu.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Menu\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-menu\n * @appenddocs sap.ui.webc.main.MenuItem\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: litRender,\n\tstaticAreaStyles: staticAreaMenuCss,\n\tstaticAreaTemplate: staticAreaMenuTemplate,\n\tdependencies: [\n\t\tResponsivePopover,\n\t\tButton,\n\t\tList,\n\t\tStandardListItem,\n\t\tIcon,\n\t\tBusyIndicator,\n\t],\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * @event sap.ui.webc.main.Menu#item-click\n * @param {object} item The currently clicked menu item.\n * @param {string} text The text of the currently clicked menu item.\n * @public\n */\n@event(\"item-click\", {\n\tdetail: {\n\t\titem: {\n\t\t\ttype: Object,\n\t\t},\n\t\ttext: {\n\t\t\ttype: String,\n\t\t},\n\t},\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-open\n * @allowPreventDefault\n * @since 1.10.0\n */\n@event(\"before-open\")\n\n/**\n * Fired after the menu is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-open\n * @since 1.10.0\n */\n@event(\"after-open\")\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tdetail: {\n\t\tescPressed: { type: Boolean },\n\t},\n})\n\n/**\n * Fired after the menu is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Menu#after-close\n * @since 1.10.0\n */\n@event(\"after-close\")\nclass Menu extends UI5Element {\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.headerText\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\theaderText!: string;\n\n\t/**\n\t * Indicates if the menu is open\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.open\n\t * @public\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen!:boolean;\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.busy\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tbusy!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover..\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.busyDelay\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @defaultValue 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ validator: Integer, defaultValue: 1000 })\n\tbusyDelay!: number;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element that the menu is shown at\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.opener\n\t * @public\n\t * @type {sap.ui.webc.base.types.DOMReference}\n\t * @defaultvalue \"\"\n\t * @since 1.10.0\n\t */\n\t@property({ validator: DOMReference, defaultValue: \"\" })\n\topener!: HTMLElement | string;\n\n\t/**\n\t * Defines if the menu is sub-menu (not first-level).\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_isSubMenu!: boolean;\n\n\t/**\n\t * Stores id of a list item that opened sub-menu.\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\t_subMenuOpenerId!: string;\n\n\t/**\n\t * Defines the currently available menu items.\n\t * (in case of non-phone devices these are the items of the menu,\n\t * but for phone devices the items of the currently opened sub-menu\n\t * will be populated here)\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_currentItems!: Array<CurrentItem>;\n\n\t/**\n\t * Stores a list of parent menu items for each sub-menu (on phone).\n\t * @type {array}\n\t * @private\n\t */\n\t@property({ type: Object, multiple: true })\n\t_parentItemsStack!: Array<MenuItem>;\n\n\t/**\n\t * Stores the ResponsivePopover instance\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_popover?: ResponsivePopover;\n\n\t/**\n\t * Stores parent menu item (if there is such).\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_parentMenuItem?: MenuItem;\n\n\t/**\n\t * Stores menu item that have sub-menu opened.\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_openedSubMenuItem?: MenuItem;\n\n\t/**\n\t * Defines the items of this component.\n\t * <br><br>\n\t * <b>Note:</b> Use <code>ui5-menu-item</code> for the intended design.\n\t *\n\t * @name sap.ui.webc.main.Menu.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tMenu.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget itemsWithChildren() {\n\t\treturn !!this._currentItems.filter(item => item.item.items.length).length;\n\t}\n\n\tget itemsWithIcon() {\n\t\treturn !!this._currentItems.filter(item => item.item.icon !== \"\").length;\n\t}\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget placementType() {\n\t\tconst placement = this.isRtl ? \"Left\" : \"Right\";\n\t\treturn this._isSubMenu ? placement : \"Bottom\";\n\t}\n\n\tget verticalAlign() {\n\t\treturn this._isSubMenu ? \"Top\" : \"Bottom\";\n\t}\n\n\tget labelBack() {\n\t\treturn Menu.i18nBundle.getText(MENU_BACK_BUTTON_ARIA_LABEL);\n\t}\n\n\tget labelClose() {\n\t\treturn Menu.i18nBundle.getText(MENU_CLOSE_BUTTON_ARIA_LABEL);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget isSubMenuOpened() {\n\t\treturn !!this._parentMenuItem;\n\t}\n\n\tget menuHeaderTextPhone() {\n\t\treturn this._parentMenuItem ? this._parentMenuItem.text : this.headerText;\n\t}\n\n\tonBeforeRendering() {\n\t\t!isPhone() && this._prepareCurrentItems(this.items);\n\n\t\tconst itemsWithChildren = this.itemsWithChildren;\n\t\tconst itemsWithIcon = this.itemsWithIcon;\n\n\t\tthis._currentItems.forEach(item => {\n\t\t\titem.item._siblingsWithChildren = itemsWithChildren;\n\t\t\titem.item._siblingsWithIcon = itemsWithIcon;\n\t\t\tif (item.item._subMenu) {\n\t\t\t\titem.item._subMenu.busy = item.item.busy;\n\t\t\t\titem.item._subMenu.busyDelay = item.item.busyDelay;\n\t\t\t}\n\t\t});\n\t}\n\n\tonAfterRendering() {\n\t\tif (!this.opener) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.open) {\n\t\t\tconst rootNode = this.getRootNode() as Document;\n\t\t\tconst opener = this.opener instanceof HTMLElement ? this.opener : rootNode && rootNode.getElementById(this.opener);\n\n\t\t\tif (opener) {\n\t\t\t\tthis.showAt(opener);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.close();\n\t\t}\n\t}\n\n\t/**\n\t * Shows the Menu near the opener element.\n\t * @param {HTMLElement} opener the element that the popover is shown at\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#showAt\n\t */\n\tasync showAt(opener: HTMLElement) {\n\t\tif (isPhone()) {\n\t\t\tthis._prepareCurrentItems(this.items);\n\t\t\tthis._parentItemsStack = [];\n\t\t}\n\t\tif (!this._isSubMenu) {\n\t\t\tthis._parentMenuItem = undefined;\n\t\t}\n\t\tconst popover = await this._createPopover();\n\t\tpopover.initialFocus = \"\";\n\t\tfor (let index = 0; index < this._currentItems.length; index++) {\n\t\t\tif (!this._currentItems[index].item.disabled) {\n\t\t\t\tpopover.initialFocus = `${this._id}-menu-item-${index}`;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tpopover.showAt(opener);\n\t}\n\n\t/**\n\t * Closes the Menu.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Menu#close\n\t */\n\tclose() {\n\t\tif (this._popover) {\n\t\t\tif (isPhone()) {\n\t\t\t\tthis._parentItemsStack = [];\n\t\t\t}\n\t\t\tthis._popover.close();\n\t\t\tthis._popover.resetFocus();\n\t\t}\n\t}\n\n\tasync _createPopover() {\n\t\tconst staticAreaItemDomRef = await this.getStaticAreaItemDomRef();\n\t\tthis._popover = staticAreaItemDomRef!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t\treturn this._popover;\n\t}\n\n\t_navigateBack() {\n\t\tconst parentMenuItem = this._parentItemsStack.pop();\n\n\t\tthis.focus();\n\t\tif (parentMenuItem) {\n\t\t\tconst parentMenuItemParent = parentMenuItem.parentElement as MenuItem;\n\t\t\tthis._prepareCurrentItems(parentMenuItemParent.items);\n\t\t\tthis._parentMenuItem = this._parentItemsStack.length ? this._parentItemsStack[this._parentItemsStack.length - 1] : undefined;\n\t\t}\n\t}\n\n\t_prepareCurrentItems(items: Array<MenuItem>) {\n\t\tthis._currentItems = items.map((item, index) => {\n\t\t\treturn {\n\t\t\t\titem,\n\t\t\t\tposition: index + 1,\n\t\t\t\tariaHasPopup: item.hasSubmenu ? \"menu\" : undefined,\n\t\t\t};\n\t\t});\n\t}\n\n\t_createSubMenu(item: MenuItem, openerId: string) {\n\t\tconst ctor = this.constructor as typeof Menu;\n\t\tconst subMenu = document.createElement(ctor.getMetadata().getTag()) as Menu;\n\t\tconst fragment = document.createDocumentFragment();\n\n\t\tsubMenu._isSubMenu = true;\n\t\tsubMenu.setAttribute(\"id\", `submenu-${openerId}`);\n\t\tsubMenu._parentMenuItem = item;\n\t\tsubMenu.busy = item.busy;\n\t\tsubMenu.busyDelay = item.busyDelay;\n\t\tconst subItems = item.children;\n\t\tlet clonedItem,\n\t\t\tidx;\n\t\tfor (idx = 0; idx < subItems.length; idx++) {\n\t\t\tclonedItem = subItems[idx].cloneNode(true);\n\t\t\tfragment.appendChild(clonedItem);\n\t\t}\n\t\tsubMenu.appendChild(fragment);\n\t\tthis.staticAreaItem!.shadowRoot!.querySelector(\".ui5-menu-submenus\")!.appendChild(subMenu);\n\t\titem._subMenu = subMenu;\n\t}\n\n\t_openItemSubMenu(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\titem._subMenu!.showAt(opener);\n\t\titem._preventSubMenuClose = true;\n\t\tthis._openedSubMenuItem = item;\n\t\tthis._subMenuOpenerId = actionId;\n\t}\n\n\t_closeItemSubMenu(item: MenuItem, forceClose = false) {\n\t\tif (item) {\n\t\t\tif (forceClose) {\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeSubMenuPopover(item._subMenu!, true);\n\t\t\t} else {\n\t\t\t\tsetTimeout(() => this._closeSubMenuPopover(item._subMenu!), 0);\n\t\t\t}\n\t\t}\n\t}\n\n\t_closeSubMenuPopover(subMenu: Menu, forceClose = false) {\n\t\tif (subMenu) {\n\t\t\tconst parentItem = subMenu._parentMenuItem!;\n\n\t\t\tif (forceClose || !parentItem._preventSubMenuClose) {\n\t\t\t\tsubMenu.close();\n\t\t\t\tsubMenu.remove();\n\t\t\t\tparentItem._subMenu = undefined;\n\t\t\t\tthis._openedSubMenuItem = undefined;\n\t\t\t\tthis._subMenuOpenerId = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t_prepareSubMenuDesktopTablet(item: MenuItem, opener: HTMLElement, actionId: string) {\n\t\tif (actionId !== this._subMenuOpenerId || (item && item.hasSubmenu)) {\n\t\t\t// close opened sub-menu if there is any opened\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem!, true);\n\t\t}\n\t\tif (item && item.hasSubmenu) {\n\t\t\t// create new sub-menu\n\t\t\tthis._createSubMenu(item, actionId);\n\t\t\tthis._openItemSubMenu(item, opener, actionId);\n\t\t}\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_prepareSubMenuPhone(item: MenuItem) {\n\t\tthis._prepareCurrentItems(item.items);\n\t\tthis._parentMenuItem = item;\n\t\tthis._parentItemsStack.push(item);\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\topener.focus();\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t}\n\t}\n\n\t_busyMouseOver() {\n\t\tif (this._parentMenuItem) {\n\t\t\tthis._parentMenuItem._preventSubMenuClose = true;\n\t\t}\n\t}\n\n\t_itemMouseOut(e: MouseEvent) {\n\t\tif (isDesktop()) {\n\t\t\t// respect mouseover only on desktop\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\n\t\t\tif (item && item.hasSubmenu && item._subMenu) {\n\t\t\t\t// try to close the sub-menu\n\t\t\t\titem._preventSubMenuClose = false;\n\t\t\t\tthis._closeItemSubMenu(item);\n\t\t\t}\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isMenuClose = this.isRtl ? isRight(e) : isLeft(e);\n\t\tconst isMenuOpen = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tif (isMenuOpen) {\n\t\t\tconst opener = e.target as OpenerStandardListItem;\n\t\t\tconst item = opener.associatedItem;\n\t\t\tconst hoverId = opener.getAttribute(\"id\")!;\n\n\t\t\titem.hasSubmenu && this._prepareSubMenuDesktopTablet(item, opener, hoverId);\n\t\t} else if (isMenuClose && this._isSubMenu && this._parentMenuItem) {\n\t\t\tconst parentMenuItemParent = this._parentMenuItem.parentElement as Menu;\n\t\t\tparentMenuItemParent._closeItemSubMenu(this._parentMenuItem, true);\n\t\t}\n\t}\n\n\t_itemClick(e: CustomEvent<ClickEventDetail>) {\n\t\tconst opener = e.detail.item as OpenerStandardListItem;\n\t\tconst item = opener.associatedItem;\n\t\tconst actionId = opener.getAttribute(\"id\")!;\n\n\t\tif (!item.hasSubmenu) {\n\t\t\t// click on an item that doesn't have sub-items fires an \"item-click\" event\n\t\t\tif (!this._isSubMenu) {\n\t\t\t\tif (isPhone()) {\n\t\t\t\t\tthis._parentMenuItem = undefined;\n\t\t\t\t}\n\t\t\t\t// fire event if the click is on top-level menu item\n\t\t\t\tthis.fireEvent(\"item-click\", {\n\t\t\t\t\t\"item\": item,\n\t\t\t\t\t\"text\": item.text,\n\t\t\t\t});\n\t\t\t\tthis._popover!.close();\n\t\t\t} else {\n\t\t\t\t// find top-level menu and redirect event to it\n\t\t\t\tlet parentMenu = item.parentElement as Menu;\n\t\t\t\twhile (parentMenu._parentMenuItem) {\n\t\t\t\t\tparentMenu._parentMenuItem._preventSubMenuClose = false;\n\t\t\t\t\tthis._closeItemSubMenu(parentMenu._parentMenuItem);\n\t\t\t\t\tparentMenu = parentMenu._parentMenuItem.parentElement as Menu;\n\t\t\t\t}\n\t\t\t\tparentMenu._itemClick(e);\n\t\t\t}\n\t\t} else if (isPhone()) {\n\t\t\t// prepares and opens sub-menu on phone\n\t\t\tthis._prepareSubMenuPhone(item);\n\t\t} else if (isTablet()) {\n\t\t\t// prepares and opens sub-menu on tablet\n\t\t\tthis._prepareSubMenuDesktopTablet(item, opener, actionId);\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = false;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverOpen() {\n\t\tthis.open = true;\n\t\tthis.fireEvent(\"after-open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent<ResponsivePopoverBeforeCloseEventDetail>) {\n\t\tconst prevented = !this.fireEvent(\"before-close\", { escPressed: e.detail.escPressed }, true, false);\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._openedSubMenuItem) {\n\t\t\tthis._openedSubMenuItem._preventSubMenuClose = false;\n\t\t\tthis._closeItemSubMenu(this._openedSubMenuItem);\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireEvent(\"after-close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\n"]}
|
package/dist/MenuItem.d.ts
CHANGED
|
@@ -81,6 +81,28 @@ declare class MenuItem extends UI5Element {
|
|
|
81
81
|
* @public
|
|
82
82
|
*/
|
|
83
83
|
disabled: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.
|
|
86
|
+
*
|
|
87
|
+
* Note: If set to <code>true</code> a <code>ui5-busy-indicator</code> component will be displayed into the related one to the current <code>ui5-menu-item</code> sub-menu popover.
|
|
88
|
+
*
|
|
89
|
+
* @name sap.ui.webc.main.MenuItem.prototype.busy
|
|
90
|
+
* @type {boolean}
|
|
91
|
+
* @defaultvalue false
|
|
92
|
+
* @public
|
|
93
|
+
* @since 1.13.0
|
|
94
|
+
*/
|
|
95
|
+
busy: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.
|
|
98
|
+
*
|
|
99
|
+
* @name sap.ui.webc.main.MenuItem.prototype.busyDelay
|
|
100
|
+
* @type {sap.ui.webc.base.types.Integer}
|
|
101
|
+
* @defaultValue 1000
|
|
102
|
+
* @public
|
|
103
|
+
* @since 1.13.0
|
|
104
|
+
*/
|
|
105
|
+
busyDelay: number;
|
|
84
106
|
/**
|
|
85
107
|
* Defines the accessible ARIA name of the component.
|
|
86
108
|
*
|
|
@@ -116,7 +138,7 @@ declare class MenuItem extends UI5Element {
|
|
|
116
138
|
* @public
|
|
117
139
|
*/
|
|
118
140
|
items: Array<MenuItem>;
|
|
119
|
-
get
|
|
141
|
+
get hasSubmenu(): boolean;
|
|
120
142
|
get hasDummyIcon(): boolean;
|
|
121
143
|
get subMenuOpened(): boolean;
|
|
122
144
|
get _additionalText(): string;
|
package/dist/MenuItem.js
CHANGED
|
@@ -8,6 +8,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
8
8
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
9
9
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
10
10
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
11
|
+
import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
|
|
11
12
|
/**
|
|
12
13
|
* @class
|
|
13
14
|
*
|
|
@@ -37,8 +38,8 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
39
40
|
let MenuItem = class MenuItem extends UI5Element {
|
|
40
|
-
get
|
|
41
|
-
return !!this.items.length;
|
|
41
|
+
get hasSubmenu() {
|
|
42
|
+
return !!(this.items.length || this.busy);
|
|
42
43
|
}
|
|
43
44
|
get hasDummyIcon() {
|
|
44
45
|
return this._siblingsWithIcon && !this.icon;
|
|
@@ -47,7 +48,7 @@ let MenuItem = class MenuItem extends UI5Element {
|
|
|
47
48
|
return !!this._subMenu;
|
|
48
49
|
}
|
|
49
50
|
get _additionalText() {
|
|
50
|
-
return this.
|
|
51
|
+
return this.hasSubmenu ? "" : this.additionalText;
|
|
51
52
|
}
|
|
52
53
|
get ariaLabelledByText() {
|
|
53
54
|
return `${this.text} ${this.accessibleName}`.trim();
|
|
@@ -68,6 +69,12 @@ __decorate([
|
|
|
68
69
|
__decorate([
|
|
69
70
|
property({ type: Boolean })
|
|
70
71
|
], MenuItem.prototype, "disabled", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
property({ type: Boolean })
|
|
74
|
+
], MenuItem.prototype, "busy", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
property({ validator: Integer, defaultValue: 1000 })
|
|
77
|
+
], MenuItem.prototype, "busyDelay", void 0);
|
|
71
78
|
__decorate([
|
|
72
79
|
property()
|
|
73
80
|
], MenuItem.prototype, "accessibleName", void 0);
|
package/dist/MenuItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../src/MenuItem.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,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QAAQ,EAAE;gDACa;AAMxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;uDACf;AAMhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;mDACnB;AAM5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;sDAChB;AAM/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;0CACpC;AAWhB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;uCACpD;AAtInB,QAAQ;IADb,aAAa,CAAC,eAAe,CAAC;GACzB,QAAQ,CA2Jb;AAED,QAAQ,CAAC,MAAM,EAAE,CAAC;AAElB,eAAe,QAAQ,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport type Menu from \"./Menu.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * <code>ui5-menu-item</code> is the item to use inside a <code>ui5-menu</code>.\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * <h3>Usage</h3>\n *\n * <code>ui5-menu-item</code> is an abstract element, representing a node in a <code>ui5-menu</code>. The menu itself is rendered as a list,\n * and each <code>ui5-menu-item</code> is represented by a list item (<code>ui5-li</code>) in that list. Therefore, you should only use\n * <code>ui5-menu-item</code> directly in your apps. The <code>ui5-li</code> list item is internal for the list, and not intended for public use.\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/MenuItem.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.MenuItem\n * @extends sap.ui.webc.base.UI5Element\n * @abstract\n * @tagname ui5-menu-item\n * @implements sap.ui.webc.main.IMenuItem\n * @since 1.3.0\n * @public\n */\n@customElement(\"ui5-menu-item\")\nclass MenuItem extends UI5Element {\n\t/**\n\t * Defines the text of the tree item.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.text\n\t * @type {string}\n\t * @defaultValue \"\"\n\t * @public\n\t */\n\t@property()\n\ttext!: string;\n\n\t/**\n\t * Defines the <code>additionalText</code>, displayed in the end of the menu item.\n\t * <b>Note:</b> The additional text would not be displayed if the item has a submenu.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.additionalText\n\t * @type {string}\n\t * @public\n\t * @since 1.8.0\n\t */\n\t@property()\n\tadditionalText!: string;\n\n\t/**\n\t * Defines the icon to be displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t * <br><br>\n\t <b>* Example:</b>\n\t * See all the available icons in the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.icon\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines whether a visual separator should be rendered before the item.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.startsSection\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tstartsSection!: boolean;\n\n\t/**\n\t * Defines whether <code>ui5-menu-item</code> is in disabled state.\n\t * <br><br>\n\t * <b>Note:</b> A disabled <code>ui5-menu-item</code> is noninteractive.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.disabled\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * Note: If set to <code>true</code> a <code>ui5-busy-indicator</code> component will be displayed into the related one to the current <code>ui5-menu-item</code> sub-menu popover.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.busy\n\t * @type {boolean}\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tbusy!: boolean;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the busy indicator will be displayed inside the corresponding ui5-menu popover.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.busyDelay\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @defaultValue 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ validator: Integer, defaultValue: 1000 })\n\tbusyDelay!: number;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.accessibleName\n\t * @type {string}\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Indicates whether any of the element siblings have children items.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithChildren!: boolean;\n\n\t/**\n\t * Indicates whether any of the element siblings have icon.\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_siblingsWithIcon!: boolean;\n\n\t/**\n\t * Defines whether the submenu closing must be prevented\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_preventSubMenuClose!: boolean;\n\n\t/**\n\t * Stores Menu object with submenu items\n\t */\n\t@property({ type: Object, defaultValue: undefined })\n\t_subMenu?: Menu;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * @name sap.ui.webc.main.MenuItem.prototype.default\n\t * @type {sap.ui.webc.main.IMenuItem[]}\n\t * @slot items\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: Array<MenuItem>;\n\n\tget hasSubmenu() {\n\t\treturn !!(this.items.length || this.busy);\n\t}\n\n\tget hasDummyIcon() {\n\t\treturn this._siblingsWithIcon && !this.icon;\n\t}\n\n\tget subMenuOpened() {\n\t\treturn !!this._subMenu;\n\t}\n\n\tget _additionalText() {\n\t\treturn this.hasSubmenu ? \"\" : this.additionalText;\n\t}\n\n\tget ariaLabelledByText() {\n\t\treturn `${this.text} ${this.accessibleName}`.trim();\n\t}\n}\n\nMenuItem.define();\n\nexport default MenuItem;\n"]}
|
package/dist/Popup.js
CHANGED
|
@@ -247,13 +247,13 @@ let Popup = Popup_1 = class Popup extends UI5Element {
|
|
|
247
247
|
this.style.zIndex = this._zIndex?.toString() || "";
|
|
248
248
|
this._focusedElementBeforeOpen = getFocusedElement();
|
|
249
249
|
this._show();
|
|
250
|
-
if (!this._disableInitialFocus && !preventInitialFocus) {
|
|
251
|
-
this.applyInitialFocus();
|
|
252
|
-
}
|
|
253
250
|
this._addOpenedPopup();
|
|
254
251
|
this.opened = true;
|
|
255
252
|
this.open = true;
|
|
256
253
|
await renderFinished();
|
|
254
|
+
if (!this._disableInitialFocus && !preventInitialFocus) {
|
|
255
|
+
await this.applyInitialFocus();
|
|
256
|
+
}
|
|
257
257
|
this.fireEvent("after-open", {}, false, false);
|
|
258
258
|
}
|
|
259
259
|
/**
|
package/dist/Popup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../src/Popup.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAA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I,EAAE,OAAO,EAAE;KAC7B,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;OAKG;;IACF,KAAK,CAAC,QAAQ,CAAC;GACD,KAAK,CA6fnB;AAED,eAAe,KAAK,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { isChrome } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getFirstFocusableElement, getLastFocusableElement } from \"@ui5/webcomponents-base/dist/util/FocusableElements.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AriaLabelHelper.js\";\nimport getEffectiveScrollbarStyle from \"@ui5/webcomponents-base/dist/util/getEffectiveScrollbarStyle.js\";\nimport { hasStyle, createStyle } from \"@ui5/webcomponents-base/dist/ManagedStyles.js\";\nimport { isEnter, isTabPrevious } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getNextZIndex, getFocusedElement, isFocusedElementWithinNode } from \"@ui5/webcomponents-base/dist/util/PopupUtils.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport MediaRange from \"@ui5/webcomponents-base/dist/MediaRange.js\";\nimport PopupTemplate from \"./generated/templates/PopupTemplate.lit.js\";\nimport PopupBlockLayer from \"./generated/templates/PopupBlockLayerTemplate.lit.js\";\nimport PopupAccessibleRole from \"./types/PopupAccessibleRole.js\";\nimport { addOpenedPopup, removeOpenedPopup } from \"./popup-utils/OpenedPopupsRegistry.js\";\n\n// Styles\nimport popupStlyes from \"./generated/themes/Popup.css.js\";\nimport popupStaticAreaStyles from \"./generated/themes/PopupStaticAreaStyles.css.js\";\nimport globalStyles from \"./generated/themes/PopupGlobal.css.js\";\n\nconst createBlockingStyle = (): void => {\n\tif (!hasStyle(\"data-ui5-popup-scroll-blocker\")) {\n\t\tcreateStyle(globalStyles, \"data-ui5-popup-scroll-blocker\");\n\t}\n};\n\ncreateBlockingStyle();\n\nconst pageScrollingBlockers = new Set<Popup>();\n\ntype PopupScrollEventDetail = {\n\tscrollTop: number;\n\ttargetRef: HTMLElement;\n}\n\ntype PopupBeforeCloseEventDetail = {\n\tescPressed: boolean;\n}\n\n/**\n * @class\n * <h3 class=\"comment-api-title\">Overview</h3>\n * Base class for all popup Web Components.\n *\n * If you need to create your own popup-like custom UI5 Web Components, it is highly recommended that you extend\n * at least Popup in order to have consistency with other popups in terms of modal behavior and z-index management.\n *\n * 1. The Popup class handles modality:\n * - The \"isModal\" getter can be overridden by derivatives to provide their own conditions when they are modal or not\n * - Derivatives may call the \"blockPageScrolling\" and \"unblockPageScrolling\" static methods to temporarily remove scrollbars on the html element\n * - Derivatives may call the \"open\" and \"close\" methods which handle focus, manage the popup registry and for modal popups, manage the blocking layer\n *\n * 2. Provides blocking layer (relevant for modal popups only):\n * - It is in the static area\n * - Controlled by the \"open\" and \"close\" methods\n *\n * 3. The Popup class \"traps\" focus:\n * - Derivatives may call the \"applyInitialFocus\" method (usually when opening, to transfer focus inside the popup)\n *\n * 4. The Popup class automatically assigns \"z-index\"\n * - Each time a popup is opened, it gets a higher than the previously opened popup z-index\n *\n * 5. The template of this component exposes two inline partials you can override in derivatives:\n * - beforeContent (upper part of the box, useful for header/title/close button)\n * - afterContent (lower part, useful for footer/action buttons)\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Popup\n * @extends sap.ui.webc.base.UI5Element\n * @public\n */\n@customElement({\n\trenderer: litRender,\n\tstyles: popupStlyes,\n\ttemplate: PopupTemplate,\n\tstaticAreaTemplate: PopupBlockLayer,\n\tstaticAreaStyles: popupStaticAreaStyles,\n})\n/**\n * Fired before the component is opened. This event can be cancelled, which will prevent the popup from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#before-open\n * @allowPreventDefault\n */\n@event(\"before-open\")\n\n/**\n * Fired after the component is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#after-open\n */\n@event(\"after-open\")\n\n/**\n * Fired before the component is closed. This event can be cancelled, which will prevent the popup from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n */\n@event(\"before-close\", {\n\tescPressed: { type: Boolean },\n})\n\n/**\n * Fired after the component is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#after-close\n */\n@event(\"after-close\")\n\n/**\n * Fired whenever the popup content area is scrolled\n *\n * @private\n * @event sap.ui.webc.main.Popup#scroll\n */\n@event(\"scroll\")\nabstract class Popup extends UI5Element {\n\t/**\n\t * Defines the ID of the HTML Element, which will get the initial focus.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.initialFocus\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tinitialFocus!: string;\n\n\t/**\n\t * Defines if the focus should be returned to the previously focused element,\n\t * when the popup closes.\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Popup.prototype.preventFocusRestore\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.0.0-rc.8\n\t*/\n\t@property({ type: Boolean })\n\tpreventFocusRestore!: boolean;\n\n\t/**\n\t * Indicates if the element is open\n\t * @public\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Popup.prototype.open\n\t * @defaultvalue false\n\t * @since 1.2.0\n\t */\n\t@property({ type: Boolean })\n\topen!: boolean;\n\n\t/**\n\t * Indicates if the element is already open\n\t * @private\n\t * @type {boolean}\n\t * @defaultvalue false\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\topened!: boolean;\n\n\t/**\n\t * Defines the accessible name of the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleName\n\t * @defaultvalue undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ defaultValue: undefined })\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the IDs of the elements that label the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleNameRef\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property({ defaultValue: \"\" })\n\taccessibleNameRef!: string;\n\n\t/**\n\t * Allows setting a custom role. Available options are:\n\t * <ul>\n\t * <li><code>Dialog</code></li>\n\t * <li><code>None</code></li>\n\t * <li><code>AlertDialog</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.PopupAccessibleRole}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleRole\n\t * @defaultvalue \"Dialog\"\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property({ type: PopupAccessibleRole, defaultValue: PopupAccessibleRole.Dialog })\n\taccessibleRole!: PopupAccessibleRole;\n\n\t/**\n\t * Defines the current media query size.\n\t *\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\tmediaRange!: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_disableInitialFocus!: boolean;\n\n\t@property({ type: Boolean })\n\t_blockLayerHidden!: boolean;\n\n\t/**\n\t * Indicates if the element is the top modal popup\n\t *\n\t * This property is calculated automatically\n\t *\n\t * @private\n\t * @type {boolean}\n\t * @defaultvalue false\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tisTopModalPopup!: boolean;\n\n\t/**\n\t * Defines the content of the Popup.\n\t * @type {HTMLElement[]}\n\t * @name sap.ui.webc.main.Popup.prototype.default\n\t * @slot content\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tcontent!: Array<HTMLElement>\n\n\t_resizeHandler: ResizeObserverCallback;\n\t_shouldFocusRoot?: boolean;\n\t_zIndex?: number;\n\t_focusedElementBeforeOpen?: HTMLElement | null;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._resizeHandler = this._resize.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._blockLayerHidden = !this.isOpen() || !this.isTopModalPopup;\n\t}\n\n\tonEnterDOM() {\n\t\tResizeHandler.register(this, this._resizeHandler);\n\t}\n\n\tonExitDOM() {\n\t\tif (this.isOpen()) {\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tResizeHandler.deregister(this, this._resizeHandler);\n\t}\n\n\tget _displayProp() {\n\t\treturn \"block\";\n\t}\n\n\t_resize() {\n\t\tthis.mediaRange = MediaRange.getCurrentRange(MediaRange.RANGESETS.RANGE_4STEPS, this.getDomRef()!.offsetWidth);\n\t}\n\n\t/**\n\t * Prevents the user from interacting with the content under the block layer\n\t */\n\t_preventBlockLayerFocus(e: KeyboardEvent | MouseEvent) {\n\t\te.preventDefault();\n\t}\n\n\t/**\n\t * Temporarily removes scrollbars from the html element\n\t * @protected\n\t */\n\tstatic blockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.add(popup);\n\n\t\tif (pageScrollingBlockers.size !== 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.add(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t/**\n\t * Restores scrollbars on the html element, if needed\n\t * @protected\n\t */\n\tstatic unblockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.delete(popup);\n\n\t\tif (pageScrollingBlockers.size !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.remove(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t_scroll(e: Event) {\n\t\tthis.fireEvent<PopupScrollEventDetail>(\"scroll\", {\n\t\t\tscrollTop: (e.target as HTMLElement).scrollTop,\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t});\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isTabOutAttempt = e.target === this._root && isTabPrevious(e);\n\t\t// if the popup is closed, focus is already moved, so Enter keydown may result in click on the newly focused element\n\t\tconst isEnterOnClosedPopupChild = isEnter(e) && !this.isOpen();\n\n\t\tif (isTabOutAttempt || isEnterOnClosedPopupChild) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\t// relatedTarget is the element, which will get focus. If no such element exists, focus the root.\n\t\t// This happens after the mouse is released in order to not interrupt text selection.\n\t\tif (!e.relatedTarget) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tthis._root.removeAttribute(\"tabindex\");\n\n\t\tif (this.shadowRoot!.contains(e.target as HTMLElement)) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t} else {\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t_onmouseup() {\n\t\tthis._root.tabIndex = -1;\n\n\t\tif (this._shouldFocusRoot) {\n\t\t\tif (isChrome()) {\n\t\t\t\tthis._root.focus();\n\t\t\t}\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToFirst() {\n\t\tconst firstFocusable = await getFirstFocusableElement(this);\n\n\t\tif (firstFocusable) {\n\t\t\tfirstFocusable.focus({ focusVisible: true } as FocusOptions);\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToLast() {\n\t\tconst lastFocusable = await getLastFocusableElement(this);\n\n\t\tif (lastFocusable) {\n\t\t\tlastFocusable.focus({ focusVisible: true } as FocusOptions);\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Use this method to focus the element denoted by \"initialFocus\", if provided, or the first focusable element otherwise.\n\t * @protected\n\t */\n\tasync applyInitialFocus() {\n\t\tawait this.applyFocus();\n\t}\n\n\t/**\n\t * Focuses the element denoted by <code>initialFocus</code>, if provided,\n\t * or the first focusable element otherwise.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#applyFocus\n\t * @async\n\t * @returns {Promise} Promise that resolves when the focus is applied\n\t */\n\tasync applyFocus() {\n\t\tawait this._waitForDomRef();\n\n\t\tconst element = (this.getRootNode() as Document).getElementById(this.initialFocus)\n\t\t\t|| document.getElementById(this.initialFocus)\n\t\t\t|| await getFirstFocusableElement(this)\n\t\t\t|| this._root; // in case of no focusable content focus the root\n\n\t\tif (element) {\n\t\t\tif (element === this._root) {\n\t\t\t\telement.tabIndex = -1;\n\t\t\t}\n\t\t\telement.focus({ focusVisible: true } as FocusOptions);\n\t\t}\n\t}\n\n\t/**\n\t * Tells if the component is opened\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#isOpen\n\t * @returns {boolean}\n\t */\n\tisOpen() {\n\t\treturn this.opened;\n\t}\n\n\tisFocusWithin() {\n\t\treturn isFocusedElementWithinNode(this._root);\n\t}\n\n\t/**\n\t * Shows the block layer (for modal popups only) and sets the correct z-index for the purpose of popup stacking\n\t * @protected\n\t */\n\tasync _open(preventInitialFocus: boolean) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isModal && !this.shouldHideBackdrop) {\n\t\t\t// create static area item ref for block layer\n\t\t\tthis.getStaticAreaItemDomRef();\n\t\t\tthis._blockLayerHidden = false;\n\t\t\tPopup.blockPageScrolling(this);\n\t\t}\n\n\t\tthis._zIndex = getNextZIndex();\n\t\tthis.style.zIndex = this._zIndex?.toString() || \"\";\n\n\t\tthis._focusedElementBeforeOpen = getFocusedElement();\n\n\t\tthis._show();\n\n\t\tif (!this._disableInitialFocus && !preventInitialFocus) {\n\t\t\tthis.applyInitialFocus();\n\t\t}\n\n\t\tthis._addOpenedPopup();\n\n\t\tthis.opened = true;\n\t\tthis.open = true;\n\n\t\tawait renderFinished();\n\t\tthis.fireEvent(\"after-open\", {}, false, false);\n\t}\n\n\t/**\n\t * Adds the popup to the \"opened popups registry\"\n\t * @protected\n\t */\n\t_addOpenedPopup() {\n\t\taddOpenedPopup(this);\n\t}\n\n\t/**\n\t * Closes the popup.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#close\n\t * @returns {void}\n\t */\n\tclose(escPressed = false, preventRegistryUpdate = false, preventFocusRestore = false) {\n\t\tif (!this.opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevented = !this.fireEvent<PopupBeforeCloseEventDetail>(\"before-close\", { escPressed }, true, false);\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isModal) {\n\t\t\tthis._blockLayerHidden = true;\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t}\n\n\t\tthis.hide();\n\t\tthis.opened = false;\n\t\tthis.open = false;\n\n\t\tif (!preventRegistryUpdate) {\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tif (!this.preventFocusRestore && !preventFocusRestore) {\n\t\t\tthis.resetFocus();\n\t\t}\n\n\t\tthis.fireEvent(\"after-close\", {}, false, false);\n\t}\n\n\t/**\n\t * Removes the popup from the \"opened popups registry\"\n\t * @protected\n\t */\n\t_removeOpenedPopup() {\n\t\tremoveOpenedPopup(this);\n\t}\n\n\t/**\n\t * Returns the focus to the previously focused element\n\t * @protected\n\t */\n\tresetFocus() {\n\t\tif (!this._focusedElementBeforeOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusedElementBeforeOpen.focus({ focusVisible: true } as FocusOptions);\n\t\tthis._focusedElementBeforeOpen = null;\n\t}\n\n\t/**\n\t * Sets \"block\" display to the popup. The property can be overriden by derivatives of Popup.\n\t * @protected\n\t */\n\t_show() {\n\t\tthis.style.display = this._displayProp;\n\t}\n\n\t/**\n\t * Sets \"none\" display to the popup\n\t * @protected\n\t */\n\thide() {\n\t\tthis.style.display = \"none\";\n\t}\n\n\t/**\n\t * Implement this getter with relevant logic regarding the modality of the popup (e.g. based on a public property)\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {boolean}\n\t */\n\tabstract get isModal(): boolean\n\n\t/**\n\t * Implement this getter with relevant logic in order to hide the block layer (f.e. based on a public property)\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {boolean}\n\t */\n\tabstract get shouldHideBackdrop(): boolean\n\n\t/**\n\t * Return the ID of an element in the shadow DOM that is going to label this popup\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {string | undefined}\n\t */\n\tabstract get _ariaLabelledBy(): string | undefined\n\n\t/**\n\t * Ensures ariaLabel is never null or empty string\n\t * @returns {string | undefined}\n\t * @protected\n\t */\n\tget _ariaLabel() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tget _root(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-root\")!;\n\t}\n\n\tget _role(): string | undefined {\n\t\treturn (this.accessibleRole === PopupAccessibleRole.None) ? undefined : this.accessibleRole.toLowerCase();\n\t}\n\n\tget _ariaModal(): string | undefined {\n\t\treturn this.accessibleRole === PopupAccessibleRole.None ? undefined : \"true\";\n\t}\n\n\tget contentDOM(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-content\")!;\n\t}\n\n\tget styles() {\n\t\treturn {\n\t\t\troot: {},\n\t\t\tcontent: {},\n\t\t\tblockLayer: {\n\t\t\t\t\"zIndex\": this._zIndex ? this._zIndex - 1 : \"\",\n\t\t\t},\n\t\t};\n\t}\n\n\tget classes(): ClassMap {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-popup-root\": true,\n\t\t\t\t\"ui5-content-native-scrollbars\": getEffectiveScrollbarStyle(),\n\t\t\t},\n\t\t\tcontent: {\n\t\t\t\t\"ui5-popup-content\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport default Popup;\n\nexport type {\n\tPopupScrollEventDetail,\n\tPopupBeforeCloseEventDetail,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../src/Popup.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAE3E,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AAC3H,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,0BAA0B,MAAM,iEAAiE,CAAC;AACzG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC/H,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,4CAA4C,CAAC;AACvE,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,mBAAmB,MAAM,gCAAgC,CAAC;AACjE,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;AAY5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;8CACrB;AAU1B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;sCACjB;AA1Hd,KAAK;IAnDnB,aAAa,CAAC;QACd,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,aAAa;QACvB,kBAAkB,EAAE,eAAe;QACnC,gBAAgB,EAAE,qBAAqB;KACvC,CAAC;IACF;;;;;;OAMG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;OAKG;;IACF,KAAK,CAAC,YAAY,CAAC;IAEpB;;;;;;;OAOG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;KAC7B,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,aAAa,CAAC;IAErB;;;;;OAKG;;IACF,KAAK,CAAC,QAAQ,CAAC;GACD,KAAK,CA8fnB;AAED,eAAe,KAAK,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport { isChrome } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { getFirstFocusableElement, getLastFocusableElement } from \"@ui5/webcomponents-base/dist/util/FocusableElements.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AriaLabelHelper.js\";\nimport getEffectiveScrollbarStyle from \"@ui5/webcomponents-base/dist/util/getEffectiveScrollbarStyle.js\";\nimport { hasStyle, createStyle } from \"@ui5/webcomponents-base/dist/ManagedStyles.js\";\nimport { isEnter, isTabPrevious } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getNextZIndex, getFocusedElement, isFocusedElementWithinNode } from \"@ui5/webcomponents-base/dist/util/PopupUtils.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport MediaRange from \"@ui5/webcomponents-base/dist/MediaRange.js\";\nimport PopupTemplate from \"./generated/templates/PopupTemplate.lit.js\";\nimport PopupBlockLayer from \"./generated/templates/PopupBlockLayerTemplate.lit.js\";\nimport PopupAccessibleRole from \"./types/PopupAccessibleRole.js\";\nimport { addOpenedPopup, removeOpenedPopup } from \"./popup-utils/OpenedPopupsRegistry.js\";\n\n// Styles\nimport popupStlyes from \"./generated/themes/Popup.css.js\";\nimport popupStaticAreaStyles from \"./generated/themes/PopupStaticAreaStyles.css.js\";\nimport globalStyles from \"./generated/themes/PopupGlobal.css.js\";\n\nconst createBlockingStyle = (): void => {\n\tif (!hasStyle(\"data-ui5-popup-scroll-blocker\")) {\n\t\tcreateStyle(globalStyles, \"data-ui5-popup-scroll-blocker\");\n\t}\n};\n\ncreateBlockingStyle();\n\nconst pageScrollingBlockers = new Set<Popup>();\n\ntype PopupScrollEventDetail = {\n\tscrollTop: number;\n\ttargetRef: HTMLElement;\n}\n\ntype PopupBeforeCloseEventDetail = {\n\tescPressed: boolean;\n}\n\n/**\n * @class\n * <h3 class=\"comment-api-title\">Overview</h3>\n * Base class for all popup Web Components.\n *\n * If you need to create your own popup-like custom UI5 Web Components, it is highly recommended that you extend\n * at least Popup in order to have consistency with other popups in terms of modal behavior and z-index management.\n *\n * 1. The Popup class handles modality:\n * - The \"isModal\" getter can be overridden by derivatives to provide their own conditions when they are modal or not\n * - Derivatives may call the \"blockPageScrolling\" and \"unblockPageScrolling\" static methods to temporarily remove scrollbars on the html element\n * - Derivatives may call the \"open\" and \"close\" methods which handle focus, manage the popup registry and for modal popups, manage the blocking layer\n *\n * 2. Provides blocking layer (relevant for modal popups only):\n * - It is in the static area\n * - Controlled by the \"open\" and \"close\" methods\n *\n * 3. The Popup class \"traps\" focus:\n * - Derivatives may call the \"applyInitialFocus\" method (usually when opening, to transfer focus inside the popup)\n *\n * 4. The Popup class automatically assigns \"z-index\"\n * - Each time a popup is opened, it gets a higher than the previously opened popup z-index\n *\n * 5. The template of this component exposes two inline partials you can override in derivatives:\n * - beforeContent (upper part of the box, useful for header/title/close button)\n * - afterContent (lower part, useful for footer/action buttons)\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Popup\n * @extends sap.ui.webc.base.UI5Element\n * @public\n */\n@customElement({\n\trenderer: litRender,\n\tstyles: popupStlyes,\n\ttemplate: PopupTemplate,\n\tstaticAreaTemplate: PopupBlockLayer,\n\tstaticAreaStyles: popupStaticAreaStyles,\n})\n/**\n * Fired before the component is opened. This event can be cancelled, which will prevent the popup from opening. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#before-open\n * @allowPreventDefault\n */\n@event(\"before-open\")\n\n/**\n * Fired after the component is opened. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#after-open\n */\n@event(\"after-open\")\n\n/**\n * Fired before the component is closed. This event can be cancelled, which will prevent the popup from closing. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#before-close\n * @allowPreventDefault\n * @param {boolean} escPressed Indicates that <code>ESC</code> key has triggered the event.\n */\n@event(\"before-close\", {\n\tescPressed: { type: Boolean },\n})\n\n/**\n * Fired after the component is closed. <b>This event does not bubble.</b>\n *\n * @public\n * @event sap.ui.webc.main.Popup#after-close\n */\n@event(\"after-close\")\n\n/**\n * Fired whenever the popup content area is scrolled\n *\n * @private\n * @event sap.ui.webc.main.Popup#scroll\n */\n@event(\"scroll\")\nabstract class Popup extends UI5Element {\n\t/**\n\t * Defines the ID of the HTML Element, which will get the initial focus.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.initialFocus\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tinitialFocus!: string;\n\n\t/**\n\t * Defines if the focus should be returned to the previously focused element,\n\t * when the popup closes.\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Popup.prototype.preventFocusRestore\n\t * @defaultvalue false\n\t * @public\n\t * @since 1.0.0-rc.8\n\t*/\n\t@property({ type: Boolean })\n\tpreventFocusRestore!: boolean;\n\n\t/**\n\t * Indicates if the element is open\n\t * @public\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Popup.prototype.open\n\t * @defaultvalue false\n\t * @since 1.2.0\n\t */\n\t@property({ type: Boolean })\n\topen!: boolean;\n\n\t/**\n\t * Indicates if the element is already open\n\t * @private\n\t * @type {boolean}\n\t * @defaultvalue false\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\topened!: boolean;\n\n\t/**\n\t * Defines the accessible name of the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleName\n\t * @defaultvalue undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ defaultValue: undefined })\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the IDs of the elements that label the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleNameRef\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property({ defaultValue: \"\" })\n\taccessibleNameRef!: string;\n\n\t/**\n\t * Allows setting a custom role. Available options are:\n\t * <ul>\n\t * <li><code>Dialog</code></li>\n\t * <li><code>None</code></li>\n\t * <li><code>AlertDialog</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.PopupAccessibleRole}\n\t * @name sap.ui.webc.main.Popup.prototype.accessibleRole\n\t * @defaultvalue \"Dialog\"\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property({ type: PopupAccessibleRole, defaultValue: PopupAccessibleRole.Dialog })\n\taccessibleRole!: PopupAccessibleRole;\n\n\t/**\n\t * Defines the current media query size.\n\t *\n\t * @type {string}\n\t * @private\n\t */\n\t@property()\n\tmediaRange!: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_disableInitialFocus!: boolean;\n\n\t@property({ type: Boolean })\n\t_blockLayerHidden!: boolean;\n\n\t/**\n\t * Indicates if the element is the top modal popup\n\t *\n\t * This property is calculated automatically\n\t *\n\t * @private\n\t * @type {boolean}\n\t * @defaultvalue false\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\tisTopModalPopup!: boolean;\n\n\t/**\n\t * Defines the content of the Popup.\n\t * @type {HTMLElement[]}\n\t * @name sap.ui.webc.main.Popup.prototype.default\n\t * @slot content\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\tcontent!: Array<HTMLElement>\n\n\t_resizeHandler: ResizeObserverCallback;\n\t_shouldFocusRoot?: boolean;\n\t_zIndex?: number;\n\t_focusedElementBeforeOpen?: HTMLElement | null;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._resizeHandler = this._resize.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._blockLayerHidden = !this.isOpen() || !this.isTopModalPopup;\n\t}\n\n\tonEnterDOM() {\n\t\tResizeHandler.register(this, this._resizeHandler);\n\t}\n\n\tonExitDOM() {\n\t\tif (this.isOpen()) {\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tResizeHandler.deregister(this, this._resizeHandler);\n\t}\n\n\tget _displayProp() {\n\t\treturn \"block\";\n\t}\n\n\t_resize() {\n\t\tthis.mediaRange = MediaRange.getCurrentRange(MediaRange.RANGESETS.RANGE_4STEPS, this.getDomRef()!.offsetWidth);\n\t}\n\n\t/**\n\t * Prevents the user from interacting with the content under the block layer\n\t */\n\t_preventBlockLayerFocus(e: KeyboardEvent | MouseEvent) {\n\t\te.preventDefault();\n\t}\n\n\t/**\n\t * Temporarily removes scrollbars from the html element\n\t * @protected\n\t */\n\tstatic blockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.add(popup);\n\n\t\tif (pageScrollingBlockers.size !== 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.add(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t/**\n\t * Restores scrollbars on the html element, if needed\n\t * @protected\n\t */\n\tstatic unblockPageScrolling(popup: Popup) {\n\t\tpageScrollingBlockers.delete(popup);\n\n\t\tif (pageScrollingBlockers.size !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.classList.remove(\"ui5-popup-scroll-blocker\");\n\t}\n\n\t_scroll(e: Event) {\n\t\tthis.fireEvent<PopupScrollEventDetail>(\"scroll\", {\n\t\t\tscrollTop: (e.target as HTMLElement).scrollTop,\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t});\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isTabOutAttempt = e.target === this._root && isTabPrevious(e);\n\t\t// if the popup is closed, focus is already moved, so Enter keydown may result in click on the newly focused element\n\t\tconst isEnterOnClosedPopupChild = isEnter(e) && !this.isOpen();\n\n\t\tif (isTabOutAttempt || isEnterOnClosedPopupChild) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\t// relatedTarget is the element, which will get focus. If no such element exists, focus the root.\n\t\t// This happens after the mouse is released in order to not interrupt text selection.\n\t\tif (!e.relatedTarget) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tthis._root.removeAttribute(\"tabindex\");\n\n\t\tif (this.shadowRoot!.contains(e.target as HTMLElement)) {\n\t\t\tthis._shouldFocusRoot = true;\n\t\t} else {\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t_onmouseup() {\n\t\tthis._root.tabIndex = -1;\n\n\t\tif (this._shouldFocusRoot) {\n\t\t\tif (isChrome()) {\n\t\t\t\tthis._root.focus();\n\t\t\t}\n\t\t\tthis._shouldFocusRoot = false;\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToFirst() {\n\t\tconst firstFocusable = await getFirstFocusableElement(this);\n\n\t\tif (firstFocusable) {\n\t\t\tfirstFocusable.focus({ focusVisible: true } as FocusOptions);\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Focus trapping\n\t * @private\n\t */\n\tasync forwardToLast() {\n\t\tconst lastFocusable = await getLastFocusableElement(this);\n\n\t\tif (lastFocusable) {\n\t\t\tlastFocusable.focus({ focusVisible: true } as FocusOptions);\n\t\t} else {\n\t\t\tthis._root.focus();\n\t\t}\n\t}\n\n\t/**\n\t * Use this method to focus the element denoted by \"initialFocus\", if provided, or the first focusable element otherwise.\n\t * @protected\n\t */\n\tasync applyInitialFocus() {\n\t\tawait this.applyFocus();\n\t}\n\n\t/**\n\t * Focuses the element denoted by <code>initialFocus</code>, if provided,\n\t * or the first focusable element otherwise.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#applyFocus\n\t * @async\n\t * @returns {Promise} Promise that resolves when the focus is applied\n\t */\n\tasync applyFocus() {\n\t\tawait this._waitForDomRef();\n\n\t\tconst element = (this.getRootNode() as Document).getElementById(this.initialFocus)\n\t\t\t|| document.getElementById(this.initialFocus)\n\t\t\t|| await getFirstFocusableElement(this)\n\t\t\t|| this._root; // in case of no focusable content focus the root\n\n\t\tif (element) {\n\t\t\tif (element === this._root) {\n\t\t\t\telement.tabIndex = -1;\n\t\t\t}\n\t\t\telement.focus({ focusVisible: true } as FocusOptions);\n\t\t}\n\t}\n\n\t/**\n\t * Tells if the component is opened\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#isOpen\n\t * @returns {boolean}\n\t */\n\tisOpen() {\n\t\treturn this.opened;\n\t}\n\n\tisFocusWithin() {\n\t\treturn isFocusedElementWithinNode(this._root);\n\t}\n\n\t/**\n\t * Shows the block layer (for modal popups only) and sets the correct z-index for the purpose of popup stacking\n\t * @protected\n\t */\n\tasync _open(preventInitialFocus: boolean) {\n\t\tconst prevented = !this.fireEvent(\"before-open\", {}, true, false);\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isModal && !this.shouldHideBackdrop) {\n\t\t\t// create static area item ref for block layer\n\t\t\tthis.getStaticAreaItemDomRef();\n\t\t\tthis._blockLayerHidden = false;\n\t\t\tPopup.blockPageScrolling(this);\n\t\t}\n\n\t\tthis._zIndex = getNextZIndex();\n\t\tthis.style.zIndex = this._zIndex?.toString() || \"\";\n\n\t\tthis._focusedElementBeforeOpen = getFocusedElement();\n\n\t\tthis._show();\n\n\t\tthis._addOpenedPopup();\n\n\t\tthis.opened = true;\n\t\tthis.open = true;\n\n\t\tawait renderFinished();\n\n\t\tif (!this._disableInitialFocus && !preventInitialFocus) {\n\t\t\tawait this.applyInitialFocus();\n\t\t}\n\n\t\tthis.fireEvent(\"after-open\", {}, false, false);\n\t}\n\n\t/**\n\t * Adds the popup to the \"opened popups registry\"\n\t * @protected\n\t */\n\t_addOpenedPopup() {\n\t\taddOpenedPopup(this);\n\t}\n\n\t/**\n\t * Closes the popup.\n\t * @public\n\t * @method\n\t * @name sap.ui.webc.main.Popup#close\n\t * @returns {void}\n\t */\n\tclose(escPressed = false, preventRegistryUpdate = false, preventFocusRestore = false) {\n\t\tif (!this.opened) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevented = !this.fireEvent<PopupBeforeCloseEventDetail>(\"before-close\", { escPressed }, true, false);\n\t\tif (prevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isModal) {\n\t\t\tthis._blockLayerHidden = true;\n\t\t\tPopup.unblockPageScrolling(this);\n\t\t}\n\n\t\tthis.hide();\n\t\tthis.opened = false;\n\t\tthis.open = false;\n\n\t\tif (!preventRegistryUpdate) {\n\t\t\tthis._removeOpenedPopup();\n\t\t}\n\n\t\tif (!this.preventFocusRestore && !preventFocusRestore) {\n\t\t\tthis.resetFocus();\n\t\t}\n\n\t\tthis.fireEvent(\"after-close\", {}, false, false);\n\t}\n\n\t/**\n\t * Removes the popup from the \"opened popups registry\"\n\t * @protected\n\t */\n\t_removeOpenedPopup() {\n\t\tremoveOpenedPopup(this);\n\t}\n\n\t/**\n\t * Returns the focus to the previously focused element\n\t * @protected\n\t */\n\tresetFocus() {\n\t\tif (!this._focusedElementBeforeOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._focusedElementBeforeOpen.focus({ focusVisible: true } as FocusOptions);\n\t\tthis._focusedElementBeforeOpen = null;\n\t}\n\n\t/**\n\t * Sets \"block\" display to the popup. The property can be overriden by derivatives of Popup.\n\t * @protected\n\t */\n\t_show() {\n\t\tthis.style.display = this._displayProp;\n\t}\n\n\t/**\n\t * Sets \"none\" display to the popup\n\t * @protected\n\t */\n\thide() {\n\t\tthis.style.display = \"none\";\n\t}\n\n\t/**\n\t * Implement this getter with relevant logic regarding the modality of the popup (e.g. based on a public property)\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {boolean}\n\t */\n\tabstract get isModal(): boolean\n\n\t/**\n\t * Implement this getter with relevant logic in order to hide the block layer (f.e. based on a public property)\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {boolean}\n\t */\n\tabstract get shouldHideBackdrop(): boolean\n\n\t/**\n\t * Return the ID of an element in the shadow DOM that is going to label this popup\n\t *\n\t * @protected\n\t * @abstract\n\t * @returns {string | undefined}\n\t */\n\tabstract get _ariaLabelledBy(): string | undefined\n\n\t/**\n\t * Ensures ariaLabel is never null or empty string\n\t * @returns {string | undefined}\n\t * @protected\n\t */\n\tget _ariaLabel() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tget _root(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-root\")!;\n\t}\n\n\tget _role(): string | undefined {\n\t\treturn (this.accessibleRole === PopupAccessibleRole.None) ? undefined : this.accessibleRole.toLowerCase();\n\t}\n\n\tget _ariaModal(): string | undefined {\n\t\treturn this.accessibleRole === PopupAccessibleRole.None ? undefined : \"true\";\n\t}\n\n\tget contentDOM(): HTMLElement {\n\t\treturn this.shadowRoot!.querySelector(\".ui5-popup-content\")!;\n\t}\n\n\tget styles() {\n\t\treturn {\n\t\t\troot: {},\n\t\t\tcontent: {},\n\t\t\tblockLayer: {\n\t\t\t\t\"zIndex\": this._zIndex ? this._zIndex - 1 : \"\",\n\t\t\t},\n\t\t};\n\t}\n\n\tget classes(): ClassMap {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-popup-root\": true,\n\t\t\t\t\"ui5-content-native-scrollbars\": getEffectiveScrollbarStyle(),\n\t\t\t},\n\t\t\tcontent: {\n\t\t\t\t\"ui5-popup-content\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport default Popup;\n\nexport type {\n\tPopupScrollEventDetail,\n\tPopupBeforeCloseEventDetail,\n};\n"]}
|
package/dist/Tab.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare class Tab extends UI5Element implements ITab, ITabbable {
|
|
|
40
40
|
*/
|
|
41
41
|
disabled: boolean;
|
|
42
42
|
/**
|
|
43
|
-
* Represents the "additionalText" text, which is displayed in the tab.
|
|
43
|
+
* Represents the "additionalText" text, which is displayed in the tab. In the cases when in the same time there are tabs with icons and tabs without icons, if a tab has no icon the "additionalText" is displayed larger.
|
|
44
44
|
* @type {string}
|
|
45
45
|
* @defaultvalue ""
|
|
46
46
|
* @public
|