@ui5/webcomponents 2.20.0-rc.0 → 2.20.0-rc.2
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 +40 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Avatar.d.ts +23 -2
- package/dist/Avatar.js +41 -4
- package/dist/Avatar.js.map +1 -1
- package/dist/AvatarGroup.js +2 -0
- package/dist/AvatarGroup.js.map +1 -1
- package/dist/AvatarGroupTemplate.js +8 -1
- package/dist/AvatarGroupTemplate.js.map +1 -1
- package/dist/AvatarTemplate.js +1 -1
- package/dist/AvatarTemplate.js.map +1 -1
- package/dist/ComboBox.d.ts +19 -0
- package/dist/ComboBox.js +58 -2
- package/dist/ComboBox.js.map +1 -1
- package/dist/ComboBoxItem.d.ts +23 -0
- package/dist/ComboBoxItem.js +4 -0
- package/dist/ComboBoxItem.js.map +1 -1
- package/dist/List.js +6 -0
- package/dist/List.js.map +1 -1
- package/dist/ListItem.js +1 -1
- package/dist/ListItem.js.map +1 -1
- package/dist/ListItemCustom.d.ts +2 -14
- package/dist/ListItemCustom.js +31 -66
- package/dist/ListItemCustom.js.map +1 -1
- package/dist/ListItemGroup.d.ts +1 -0
- package/dist/ListItemGroup.js +1 -0
- package/dist/ListItemGroup.js.map +1 -1
- package/dist/ListItemGroupTemplate.js +1 -1
- package/dist/ListItemGroupTemplate.js.map +1 -1
- package/dist/Menu.d.ts +2 -1
- package/dist/Menu.js +14 -7
- package/dist/Menu.js.map +1 -1
- package/dist/MenuItem.d.ts +1 -0
- package/dist/MenuItem.js +6 -2
- package/dist/MenuItem.js.map +1 -1
- package/dist/Panel.d.ts +3 -0
- package/dist/Panel.js +13 -0
- package/dist/Panel.js.map +1 -1
- package/dist/PanelTemplate.js +1 -1
- package/dist/PanelTemplate.js.map +1 -1
- package/dist/Slider.d.ts +13 -20
- package/dist/Slider.js +48 -74
- package/dist/Slider.js.map +1 -1
- package/dist/SliderHandle.d.ts +61 -0
- package/dist/SliderHandle.js +104 -0
- package/dist/SliderHandle.js.map +1 -0
- package/dist/SliderHandleTemplate.d.ts +2 -0
- package/dist/SliderHandleTemplate.js +7 -0
- package/dist/SliderHandleTemplate.js.map +1 -0
- package/dist/SliderScale.d.ts +138 -0
- package/dist/SliderScale.js +300 -0
- package/dist/SliderScale.js.map +1 -0
- package/dist/SliderScaleTemplate.d.ts +2 -0
- package/dist/SliderScaleTemplate.js +11 -0
- package/dist/SliderScaleTemplate.js.map +1 -0
- package/dist/SliderTemplate.d.ts +0 -2
- package/dist/SliderTemplate.js +16 -14
- package/dist/SliderTemplate.js.map +1 -1
- package/dist/SliderTooltip.js +0 -4
- package/dist/SliderTooltip.js.map +1 -1
- package/dist/SplitButton.d.ts +2 -0
- package/dist/SplitButton.js +5 -0
- package/dist/SplitButton.js.map +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/TabContainer.js +1 -1
- package/dist/TabContainer.js.map +1 -1
- package/dist/TableDragAndDrop.js +1 -1
- package/dist/TableDragAndDrop.js.map +1 -1
- package/dist/Tokenizer.js +16 -4
- package/dist/Tokenizer.js.map +1 -1
- package/dist/Toolbar.d.ts +4 -0
- package/dist/Toolbar.js +11 -0
- package/dist/Toolbar.js.map +1 -1
- package/dist/bundle.esm.js +2 -0
- package/dist/bundle.esm.js.map +1 -1
- package/dist/css/themes/Avatar.css +1 -1
- package/dist/css/themes/AvatarGroup.css +1 -1
- package/dist/css/themes/ColorPicker.css +1 -1
- package/dist/css/themes/Form.css +1 -1
- package/dist/css/themes/FormItemSpan.css +1 -1
- package/dist/css/themes/Panel.css +1 -1
- package/dist/css/themes/ProgressIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -0
- package/dist/css/themes/SliderHandle.css +1 -0
- package/dist/css/themes/SliderScale.css +1 -0
- package/dist/css/themes/ToolbarItem.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_hcb/parameters-bundle.css +1 -2
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -2
- package/dist/custom-elements-internal.json +242 -32
- package/dist/custom-elements.json +198 -31
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.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_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/themes/Avatar.css.d.ts +1 -1
- package/dist/generated/themes/Avatar.css.js +1 -1
- package/dist/generated/themes/Avatar.css.js.map +1 -1
- package/dist/generated/themes/AvatarGroup.css.d.ts +1 -1
- package/dist/generated/themes/AvatarGroup.css.js +1 -1
- package/dist/generated/themes/AvatarGroup.css.js.map +1 -1
- package/dist/generated/themes/ColorPicker.css.d.ts +1 -1
- package/dist/generated/themes/ColorPicker.css.js +1 -1
- package/dist/generated/themes/ColorPicker.css.js.map +1 -1
- package/dist/generated/themes/Form.css.d.ts +1 -1
- package/dist/generated/themes/Form.css.js +1 -1
- package/dist/generated/themes/Form.css.js.map +1 -1
- package/dist/generated/themes/FormItemSpan.css.d.ts +1 -1
- package/dist/generated/themes/FormItemSpan.css.js +1 -1
- package/dist/generated/themes/FormItemSpan.css.js.map +1 -1
- package/dist/generated/themes/Panel.css.d.ts +1 -1
- package/dist/generated/themes/Panel.css.js +1 -1
- package/dist/generated/themes/Panel.css.js.map +1 -1
- package/dist/generated/themes/ProgressIndicator.css.d.ts +1 -1
- package/dist/generated/themes/ProgressIndicator.css.js +1 -1
- package/dist/generated/themes/ProgressIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +2 -0
- package/dist/generated/themes/Slider.css.js +8 -0
- package/dist/generated/themes/Slider.css.js.map +1 -0
- package/dist/generated/themes/SliderHandle.css.d.ts +2 -0
- package/dist/generated/themes/SliderHandle.css.js +8 -0
- package/dist/generated/themes/SliderHandle.css.js.map +1 -0
- package/dist/generated/themes/SliderScale.css.d.ts +2 -0
- package/dist/generated/themes/SliderScale.css.js +8 -0
- package/dist/generated/themes/SliderScale.css.js.map +1 -0
- package/dist/generated/themes/ToolbarItem.css.d.ts +1 -1
- package/dist/generated/themes/ToolbarItem.css.js +1 -1
- package/dist/generated/themes/ToolbarItem.css.js.map +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +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.d.ts +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.d.ts +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.d.ts +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.d.ts +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.d.ts +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_hcb/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -2
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -2
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
- package/dist/types/AvatarMode.d.ts +30 -0
- package/dist/types/AvatarMode.js +32 -0
- package/dist/types/AvatarMode.js.map +1 -0
- package/dist/vscode.html-custom-data.json +35 -11
- package/dist/web-types.json +80 -19
- package/package.json +9 -9
- package/src/AvatarGroupTemplate.tsx +8 -1
- package/src/AvatarTemplate.tsx +1 -0
- package/src/ListItemGroupTemplate.tsx +9 -3
- package/src/PanelTemplate.tsx +2 -0
- package/src/SliderHandleTemplate.tsx +15 -0
- package/src/SliderScaleTemplate.tsx +32 -0
- package/src/SliderTemplate.tsx +85 -64
- package/src/i18n/messagebundle_ar.properties +14 -8
- package/src/i18n/messagebundle_bg.properties +14 -8
- package/src/i18n/messagebundle_ca.properties +14 -8
- package/src/i18n/messagebundle_cnr.properties +14 -8
- package/src/i18n/messagebundle_cs.properties +14 -8
- package/src/i18n/messagebundle_cy.properties +14 -8
- package/src/i18n/messagebundle_da.properties +14 -8
- package/src/i18n/messagebundle_de.properties +14 -8
- package/src/i18n/messagebundle_el.properties +14 -8
- package/src/i18n/messagebundle_en.properties +14 -8
- package/src/i18n/messagebundle_en_GB.properties +14 -8
- package/src/i18n/messagebundle_en_US_sappsd.properties +3 -3
- package/src/i18n/messagebundle_en_US_saprigi.properties +3 -3
- package/src/i18n/messagebundle_en_US_saptrc.properties +3 -3
- package/src/i18n/messagebundle_es.properties +16 -10
- package/src/i18n/messagebundle_es_MX.properties +15 -9
- package/src/i18n/messagebundle_et.properties +14 -8
- package/src/i18n/messagebundle_fi.properties +14 -8
- package/src/i18n/messagebundle_fr.properties +14 -8
- package/src/i18n/messagebundle_fr_CA.properties +15 -9
- package/src/i18n/messagebundle_hi.properties +14 -8
- package/src/i18n/messagebundle_hr.properties +14 -8
- package/src/i18n/messagebundle_hu.properties +14 -8
- package/src/i18n/messagebundle_id.properties +14 -8
- package/src/i18n/messagebundle_it.properties +14 -8
- package/src/i18n/messagebundle_iw.properties +14 -8
- package/src/i18n/messagebundle_ja.properties +14 -8
- package/src/i18n/messagebundle_kk.properties +14 -8
- package/src/i18n/messagebundle_ko.properties +14 -8
- package/src/i18n/messagebundle_lt.properties +14 -8
- package/src/i18n/messagebundle_lv.properties +14 -8
- package/src/i18n/messagebundle_mk.properties +14 -8
- package/src/i18n/messagebundle_ms.properties +14 -8
- package/src/i18n/messagebundle_nl.properties +14 -8
- package/src/i18n/messagebundle_no.properties +14 -8
- package/src/i18n/messagebundle_pl.properties +14 -8
- package/src/i18n/messagebundle_pt.properties +14 -8
- package/src/i18n/messagebundle_pt_PT.properties +14 -8
- package/src/i18n/messagebundle_ro.properties +14 -8
- package/src/i18n/messagebundle_ru.properties +14 -8
- package/src/i18n/messagebundle_sh.properties +14 -8
- package/src/i18n/messagebundle_sk.properties +14 -8
- package/src/i18n/messagebundle_sl.properties +14 -8
- package/src/i18n/messagebundle_sr.properties +14 -8
- package/src/i18n/messagebundle_sv.properties +14 -8
- package/src/i18n/messagebundle_th.properties +14 -8
- package/src/i18n/messagebundle_tr.properties +14 -8
- package/src/i18n/messagebundle_uk.properties +14 -8
- package/src/i18n/messagebundle_vi.properties +14 -8
- package/src/i18n/messagebundle_zh_CN.properties +14 -8
- package/src/i18n/messagebundle_zh_TW.properties +15 -9
- package/src/themes/Avatar.css +39 -14
- package/src/themes/AvatarGroup.css +24 -0
- package/src/themes/ColorPicker.css +23 -27
- package/src/themes/FormItemSpan.css +1 -1
- package/src/themes/Panel.css +5 -1
- package/src/themes/ProgressIndicator.css +1 -0
- package/src/themes/Slider.css +32 -0
- package/src/themes/SliderHandle.css +61 -0
- package/src/themes/SliderScale.css +149 -0
- package/src/themes/ToolbarItem.css +1 -1
- package/src/themes/base/SliderHandle-parameters.css +3 -0
- package/src/themes/base/SliderScale-parameters.css +13 -0
- package/src/themes/sap_fiori_3/Slider-parameters.css +11 -0
- package/src/themes/sap_fiori_3/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_fiori_3/SliderScale-parameters.css +13 -0
- package/src/themes/sap_fiori_3/parameters-bundle.css +2 -0
- package/src/themes/sap_fiori_3_dark/Slider-parameters.css +11 -0
- package/src/themes/sap_fiori_3_dark/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_fiori_3_dark/SliderScale-parameters.css +13 -0
- package/src/themes/sap_fiori_3_dark/parameters-bundle.css +2 -0
- package/src/themes/sap_fiori_3_hcb/Slider-parameters.css +11 -0
- package/src/themes/sap_fiori_3_hcb/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_fiori_3_hcb/SliderScale-parameters.css +14 -0
- package/src/themes/sap_fiori_3_hcb/parameters-bundle.css +2 -0
- package/src/themes/sap_fiori_3_hcw/Slider-parameters.css +11 -0
- package/src/themes/sap_fiori_3_hcw/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_fiori_3_hcw/SliderScale-parameters.css +14 -0
- package/src/themes/sap_fiori_3_hcw/parameters-bundle.css +2 -0
- package/src/themes/sap_horizon/AvatarGroup-parameters.css +20 -3
- package/src/themes/sap_horizon/Slider-parameters.css +11 -0
- package/src/themes/sap_horizon/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_horizon/SliderScale-parameters.css +10 -0
- package/src/themes/sap_horizon/parameters-bundle.css +3 -0
- package/src/themes/sap_horizon/rtl-parameters.css +4 -0
- package/src/themes/sap_horizon_dark/Slider-parameters.css +11 -0
- package/src/themes/sap_horizon_dark/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_horizon_dark/SliderScale-parameters.css +10 -0
- package/src/themes/sap_horizon_dark/parameters-bundle.css +3 -0
- package/src/themes/sap_horizon_dark/rtl-parameters.css +6 -0
- package/src/themes/sap_horizon_hcb/Slider-parameters.css +11 -0
- package/src/themes/sap_horizon_hcb/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_horizon_hcb/SliderScale-parameters.css +10 -0
- package/src/themes/sap_horizon_hcb/parameters-bundle.css +3 -1
- package/src/themes/sap_horizon_hcb/rtl-parameters.css +1 -0
- package/src/themes/sap_horizon_hcw/Slider-parameters.css +11 -0
- package/src/themes/sap_horizon_hcw/SliderHandle-parameters.css +5 -0
- package/src/themes/sap_horizon_hcw/SliderScale-parameters.css +10 -0
- package/src/themes/sap_horizon_hcw/parameters-bundle.css +3 -1
- package/src/themes/sap_horizon_hcw/rtl-parameters.css +1 -0
package/dist/ListItemCustom.js
CHANGED
|
@@ -12,7 +12,7 @@ import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
|
12
12
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
13
13
|
import ListItem from "./ListItem.js";
|
|
14
14
|
import ListItemCustomTemplate from "./ListItemCustomTemplate.js";
|
|
15
|
-
import { getCustomAnnouncement } from "./CustomAnnouncement.js";
|
|
15
|
+
import { getCustomAnnouncement, applyCustomAnnouncement } from "./CustomAnnouncement.js";
|
|
16
16
|
import { LISTITEMCUSTOM_TYPE_TEXT, } from "./generated/i18n/i18n-defaults.js";
|
|
17
17
|
// Styles
|
|
18
18
|
import ListItemCustomCss from "./generated/themes/ListItemCustom.css.js";
|
|
@@ -66,24 +66,19 @@ let ListItemCustom = ListItemCustom_1 = class ListItemCustom extends ListItem {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
get _accessibleNameRef() {
|
|
69
|
-
|
|
70
|
-
// accessibleName is set - return labels excluding content
|
|
71
|
-
return `${this._id}-invisibleText`;
|
|
72
|
-
}
|
|
73
|
-
// accessibleName is not set - return _accInfo.listItemAriaLabel including custom content announcements
|
|
74
|
-
return `${this._id}-invisibleTextContent ${this._id}-invisibleText`;
|
|
69
|
+
return `${this._id}-invisibleText`;
|
|
75
70
|
}
|
|
76
71
|
_onfocusin(e) {
|
|
77
72
|
super._onfocusin(e);
|
|
78
73
|
// Skip updating invisible text during drag operations
|
|
79
|
-
if (!this._isDragging()) {
|
|
74
|
+
if (!this._isDragging() && !this.accessibleName) {
|
|
80
75
|
this._updateInvisibleTextContent();
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
_onfocusout(e) {
|
|
84
79
|
super._onfocusout(e);
|
|
85
80
|
// Skip clearing invisible text during drag operations
|
|
86
|
-
if (!this._isDragging()) {
|
|
81
|
+
if (!this._isDragging() && !this.accessibleName) {
|
|
87
82
|
this._clearInvisibleTextContent();
|
|
88
83
|
}
|
|
89
84
|
}
|
|
@@ -96,69 +91,23 @@ let ListItemCustom = ListItemCustom_1 = class ListItemCustom extends ListItem {
|
|
|
96
91
|
// Check if this specific element has the data-moving attribute
|
|
97
92
|
return this.hasAttribute("data-moving");
|
|
98
93
|
}
|
|
99
|
-
onAfterRendering() {
|
|
100
|
-
// This will run after the component is rendered
|
|
101
|
-
if (this.shadowRoot && !this.shadowRoot.querySelector(`#${this._id}-invisibleTextContent`)) {
|
|
102
|
-
const span = document.createElement("span");
|
|
103
|
-
span.id = `${this._id}-invisibleTextContent`;
|
|
104
|
-
span.className = "ui5-hidden-text";
|
|
105
|
-
// Empty content as requested
|
|
106
|
-
this.shadowRoot.appendChild(span);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Returns the invisible text span element used for accessibility announcements
|
|
111
|
-
* @returns {HTMLElement | null} The HTMLElement representing the invisible text span used for accessibility announcements, or null if the element is not found in the shadow DOM
|
|
112
|
-
* @private
|
|
113
|
-
*/
|
|
114
|
-
get _invisibleTextSpan() {
|
|
115
|
-
return this.shadowRoot?.querySelector(`#${this._id}-invisibleTextContent`);
|
|
116
|
-
}
|
|
117
94
|
_updateInvisibleTextContent() {
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
95
|
+
const listItem = this._listItem;
|
|
96
|
+
if (!listItem) {
|
|
120
97
|
return;
|
|
121
98
|
}
|
|
122
|
-
// Get accessibility
|
|
123
|
-
const
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
// Update the span content
|
|
127
|
-
invisibleTextSpan.textContent = allTexts.join(" ");
|
|
99
|
+
// Get accessibility announcements
|
|
100
|
+
const accessibilityText = getCustomAnnouncement(this);
|
|
101
|
+
// Apply the announcement using the shared invisible text element from CustomAnnouncement
|
|
102
|
+
applyCustomAnnouncement(listItem, accessibilityText);
|
|
128
103
|
}
|
|
129
104
|
_clearInvisibleTextContent() {
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Gets accessibility description by processing content nodes and delete buttons
|
|
137
|
-
* @returns {string[]} Array of accessibility text strings
|
|
138
|
-
* @private
|
|
139
|
-
*/
|
|
140
|
-
_getAccessibilityDescription() {
|
|
141
|
-
const accessibilityTexts = [];
|
|
142
|
-
// Process slotted content elements (default slot)
|
|
143
|
-
const defaultSlot = this.shadowRoot?.querySelector("slot:not([name])");
|
|
144
|
-
if (defaultSlot) {
|
|
145
|
-
const assignedNodes = defaultSlot.assignedNodes({ flatten: true });
|
|
146
|
-
assignedNodes.forEach(child => {
|
|
147
|
-
const text = getCustomAnnouncement(child, { lessDetails: false }, false);
|
|
148
|
-
if (text) {
|
|
149
|
-
accessibilityTexts.push(text);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
105
|
+
const listItem = this._listItem;
|
|
106
|
+
if (!listItem) {
|
|
107
|
+
return;
|
|
152
108
|
}
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
deleteButtonNodes.forEach(button => {
|
|
156
|
-
const text = getCustomAnnouncement(button, { lessDetails: false }, false);
|
|
157
|
-
if (text) {
|
|
158
|
-
accessibilityTexts.push(text);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return accessibilityTexts;
|
|
109
|
+
// Clear the announcement by passing empty text
|
|
110
|
+
applyCustomAnnouncement(listItem, "");
|
|
162
111
|
}
|
|
163
112
|
/**
|
|
164
113
|
* Gets delete button nodes to process for accessibility
|
|
@@ -182,6 +131,22 @@ let ListItemCustom = ListItemCustom_1 = class ListItemCustom extends ListItem {
|
|
|
182
131
|
result.main["ui5-custom-li-root"] = true;
|
|
183
132
|
return result;
|
|
184
133
|
}
|
|
134
|
+
get accessibilityInfo() {
|
|
135
|
+
const children = [];
|
|
136
|
+
// Get slotted content elements (default slot)
|
|
137
|
+
const defaultSlot = this.shadowRoot?.querySelector("slot:not([name])");
|
|
138
|
+
if (defaultSlot) {
|
|
139
|
+
const assignedNodes = defaultSlot.assignedNodes({ flatten: true });
|
|
140
|
+
children.push(...assignedNodes);
|
|
141
|
+
}
|
|
142
|
+
// Get delete button nodes
|
|
143
|
+
const deleteButtonNodes = this._getDeleteButtonNodes();
|
|
144
|
+
children.push(...deleteButtonNodes);
|
|
145
|
+
return {
|
|
146
|
+
type: ListItemCustom_1.i18nBundle.getText(LISTITEMCUSTOM_TYPE_TEXT),
|
|
147
|
+
children,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
185
150
|
};
|
|
186
151
|
__decorate([
|
|
187
152
|
property({ type: Boolean })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemCustom.js","sourceRoot":"","sources":["../src/ListItemCustom.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACN,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAClD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAG/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,sBAAsB,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACN,wBAAwB,GACxB,MAAM,mCA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;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import {\n\tisTabNext, isTabPrevious, isF2, isF7, isUp, isDown,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ClassMap } from \"@ui5/webcomponents-base/dist/types.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport ListItem from \"./ListItem.js\";\nimport ListItemCustomTemplate from \"./ListItemCustomTemplate.js\";\nimport { getCustomAnnouncement } from \"./CustomAnnouncement.js\";\nimport {\n\tLISTITEMCUSTOM_TYPE_TEXT,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport ListItemCustomCss from \"./generated/themes/ListItemCustom.css.js\";\n\n/**\n * @class\n *\n * A component to be used as custom list item within the `ui5-list`\n * the same way as the standard `ui5-li`.\n *\n * The component accepts arbitrary HTML content to allow full customization.\n * @csspart native-li - Used to style the main li tag of the list item\n * @csspart content - Used to style the content area of the list item\n * @csspart detail-button - Used to style the button rendered when the list item is of type detail\n * @csspart delete-button - Used to style the button rendered when the list item is in delete mode\n * @csspart radio - Used to style the radio button rendered when the list item is in single selection mode\n * @csspart checkbox - Used to style the checkbox rendered when the list item is in multiple selection mode\n * @slot {Node[]} default - Defines the content of the component.\n * @constructor\n * @extends ListItem\n * @public\n */\n@customElement({\n\ttag: \"ui5-li-custom\",\n\ttemplate: ListItemCustomTemplate,\n\trenderer: jsxRenderer,\n\tstyles: [ListItem.styles, ListItemCustomCss],\n})\nclass ListItemCustom extends ListItem {\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t/**\n\t * Defines whether the item is movable.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tmovable = false;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t *\n\t * **Note**: If not provided a default text alternative will be set, if present.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tdeclare accessibleName?: string;\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isFocused = this.matches(\":focus\");\n\t\tconst shouldHandle = isFocused\n\t\t\t|| isTabNext(e) || isTabPrevious(e)\n\t\t\t|| isF2(e) || isF7(e)\n\t\t\t|| isUp(e) || isDown(e);\n\n\t\tif (shouldHandle) {\n\t\t\tsuper._onkeydown(e);\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tconst isFocused = this.matches(\":focus\");\n\t\tconst shouldHandle = isFocused\n\t\t\t|| isTabNext(e) || isTabPrevious(e)\n\t\t\t|| isF2(e) || isF7(e)\n\t\t\t|| isUp(e) || isDown(e);\n\n\t\tif (shouldHandle) {\n\t\t\tsuper._onkeyup(e);\n\t\t}\n\t}\n\n\tget _accessibleNameRef(): string {\n\t\tif (this.accessibleName) {\n\t\t\t// accessibleName is set - return labels excluding content\n\t\t\treturn `${this._id}-invisibleText`;\n\t\t}\n\n\t\t// accessibleName is not set - return _accInfo.listItemAriaLabel including custom content announcements\n\t\treturn `${this._id}-invisibleTextContent ${this._id}-invisibleText`;\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tsuper._onfocusin(e);\n\t\t// Skip updating invisible text during drag operations\n\t\tif (!this._isDragging()) {\n\t\t\tthis._updateInvisibleTextContent();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tsuper._onfocusout(e);\n\t\t// Skip clearing invisible text during drag operations\n\t\tif (!this._isDragging()) {\n\t\t\tthis._clearInvisibleTextContent();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if this element is currently being dragged\n\t * @returns {boolean} True if this element is being dragged\n\t * @private\n\t */\n\t_isDragging(): boolean {\n\t\t// Check if this specific element has the data-moving attribute\n\t\treturn this.hasAttribute(\"data-moving\");\n\t}\n\n\tonAfterRendering() {\n\t\t// This will run after the component is rendered\n\t\tif (this.shadowRoot && !this.shadowRoot.querySelector(`#${this._id}-invisibleTextContent`)) {\n\t\t\tconst span = document.createElement(\"span\");\n\t\t\tspan.id = `${this._id}-invisibleTextContent`;\n\t\t\tspan.className = \"ui5-hidden-text\";\n\t\t\t// Empty content as requested\n\t\t\tthis.shadowRoot.appendChild(span);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the invisible text span element used for accessibility announcements\n\t * @returns {HTMLElement | null} The HTMLElement representing the invisible text span used for accessibility announcements, or null if the element is not found in the shadow DOM\n\t * @private\n\t */\n\tprivate get _invisibleTextSpan(): HTMLElement | null {\n\t\treturn this.shadowRoot?.querySelector(`#${this._id}-invisibleTextContent`) as HTMLElement;\n\t}\n\n\tprivate _updateInvisibleTextContent() {\n\t\tconst invisibleTextSpan = this._invisibleTextSpan;\n\t\tif (!invisibleTextSpan) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get accessibility descriptions\n\t\tconst accessibilityTexts = this._getAccessibilityDescription();\n\n\t\t// Create a new array with the type text at the beginning\n\t\tconst allTexts = [ListItemCustom.i18nBundle.getText(LISTITEMCUSTOM_TYPE_TEXT), ...accessibilityTexts];\n\n\t\t// Update the span content\n\t\tinvisibleTextSpan.textContent = allTexts.join(\" \");\n\t}\n\n\tprivate _clearInvisibleTextContent() {\n\t\tconst invisibleTextSpan = this._invisibleTextSpan;\n\t\tif (invisibleTextSpan) {\n\t\t\tinvisibleTextSpan.textContent = \"\";\n\t\t}\n\t}\n\n\t/**\n\t * Gets accessibility description by processing content nodes and delete buttons\n\t * @returns {string[]} Array of accessibility text strings\n\t * @private\n\t */\n\tprivate _getAccessibilityDescription(): string[] {\n\t\tconst accessibilityTexts: string[] = [];\n\n\t\t// Process slotted content elements (default slot)\n\t\tconst defaultSlot = this.shadowRoot?.querySelector(\"slot:not([name])\");\n\t\tif (defaultSlot) {\n\t\t\tconst assignedNodes = (defaultSlot as HTMLSlotElement).assignedNodes({ flatten: true });\n\t\t\tassignedNodes.forEach(child => {\n\t\t\t\tconst text = getCustomAnnouncement(child, { lessDetails: false }, false);\n\t\t\t\tif (text) {\n\t\t\t\t\taccessibilityTexts.push(text);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t// Process delete button in delete mode\n\t\tconst deleteButtonNodes = this._getDeleteButtonNodes();\n\t\tdeleteButtonNodes.forEach(button => {\n\t\t\tconst text = getCustomAnnouncement(button, { lessDetails: false }, false);\n\t\t\tif (text) {\n\t\t\t\taccessibilityTexts.push(text);\n\t\t\t}\n\t\t});\n\n\t\treturn accessibilityTexts;\n\t}\n\n\t/**\n\t * Gets delete button nodes to process for accessibility\n\t * @returns {Node[]} Array of nodes to process\n\t * @private\n\t */\n\tprivate _getDeleteButtonNodes(): Node[] {\n\t\tif (!this.modeDelete) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (this.hasDeleteButtonSlot) {\n\t\t\t// Return custom delete buttons from slot\n\t\t\treturn this.deleteButton;\n\t\t}\n\n\t\t// Return the built-in delete button from the shadow DOM if it exists\n\t\tconst deleteButton = this.shadowRoot?.querySelector(`#${this._id}-deleteSelectionElement`);\n\t\treturn deleteButton ? [deleteButton] : [];\n\t}\n\n\tget classes(): ClassMap {\n\t\tconst result = super.classes;\n\n\t\tresult.main[\"ui5-custom-li-root\"] = true;\n\n\t\treturn result;\n\t}\n}\n\nListItemCustom.define();\n\nexport default ListItemCustom;\n"]}
|
|
1
|
+
{"version":3,"file":"ListItemCustom.js","sourceRoot":"","sources":["../src/ListItemCustom.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACN,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAClD,MAAM,sCAAsC,CAAC;AAC9C,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAG/E,OAAO,aAAa,MAAM,0DAA0D,CAAC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AE,CAAC;+CACZ;AAWR;IADP,QAAQ,EAAE;sDACqB;AAnBzB;IADN,IAAI,CAAC,oBAAoB,CAAC;wCACG;AAFzB,cAAc;IANnB,aAAa,CAAC;QACd,GAAG,EAAE,eAAe;QACpB,QAAQ,EAAE,sBAAsB;QAChC,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;KAC5C,CAAC;GACI,cAAc,CAmJnB;AAED,cAAc,CAAC,MAAM,EAAE,CAAC;AAExB,eAAe,cAAc,CAAC","sourcesContent":["import {\n\tisTabNext, isTabPrevious, isF2, isF7, isUp, isDown,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ClassMap, AccessibilityInfo } from \"@ui5/webcomponents-base/dist/types.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport ListItem from \"./ListItem.js\";\nimport ListItemCustomTemplate from \"./ListItemCustomTemplate.js\";\nimport { getCustomAnnouncement, applyCustomAnnouncement } from \"./CustomAnnouncement.js\";\nimport {\n\tLISTITEMCUSTOM_TYPE_TEXT,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport ListItemCustomCss from \"./generated/themes/ListItemCustom.css.js\";\n\n/**\n * @class\n *\n * A component to be used as custom list item within the `ui5-list`\n * the same way as the standard `ui5-li`.\n *\n * The component accepts arbitrary HTML content to allow full customization.\n * @csspart native-li - Used to style the main li tag of the list item\n * @csspart content - Used to style the content area of the list item\n * @csspart detail-button - Used to style the button rendered when the list item is of type detail\n * @csspart delete-button - Used to style the button rendered when the list item is in delete mode\n * @csspart radio - Used to style the radio button rendered when the list item is in single selection mode\n * @csspart checkbox - Used to style the checkbox rendered when the list item is in multiple selection mode\n * @slot {Node[]} default - Defines the content of the component.\n * @constructor\n * @extends ListItem\n * @public\n */\n@customElement({\n\ttag: \"ui5-li-custom\",\n\ttemplate: ListItemCustomTemplate,\n\trenderer: jsxRenderer,\n\tstyles: [ListItem.styles, ListItemCustomCss],\n})\nclass ListItemCustom extends ListItem {\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t/**\n\t * Defines whether the item is movable.\n\t * @default false\n\t * @public\n\t * @since 2.0.0\n\t */\n\t@property({ type: Boolean })\n\tmovable = false;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t *\n\t * **Note**: If not provided a default text alternative will be set, if present.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\tdeclare accessibleName?: string;\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isFocused = this.matches(\":focus\");\n\t\tconst shouldHandle = isFocused\n\t\t\t|| isTabNext(e) || isTabPrevious(e)\n\t\t\t|| isF2(e) || isF7(e)\n\t\t\t|| isUp(e) || isDown(e);\n\n\t\tif (shouldHandle) {\n\t\t\tsuper._onkeydown(e);\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tconst isFocused = this.matches(\":focus\");\n\t\tconst shouldHandle = isFocused\n\t\t\t|| isTabNext(e) || isTabPrevious(e)\n\t\t\t|| isF2(e) || isF7(e)\n\t\t\t|| isUp(e) || isDown(e);\n\n\t\tif (shouldHandle) {\n\t\t\tsuper._onkeyup(e);\n\t\t}\n\t}\n\n\tget _accessibleNameRef(): string {\n\t\treturn `${this._id}-invisibleText`;\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tsuper._onfocusin(e);\n\t\t// Skip updating invisible text during drag operations\n\t\tif (!this._isDragging() && !this.accessibleName) {\n\t\t\tthis._updateInvisibleTextContent();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tsuper._onfocusout(e);\n\t\t// Skip clearing invisible text during drag operations\n\t\tif (!this._isDragging() && !this.accessibleName) {\n\t\t\tthis._clearInvisibleTextContent();\n\t\t}\n\t}\n\n\t/**\n\t * Checks if this element is currently being dragged\n\t * @returns {boolean} True if this element is being dragged\n\t * @private\n\t */\n\t_isDragging(): boolean {\n\t\t// Check if this specific element has the data-moving attribute\n\t\treturn this.hasAttribute(\"data-moving\");\n\t}\n\n\tprivate _updateInvisibleTextContent() {\n\t\tconst listItem = this._listItem;\n\t\tif (!listItem) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get accessibility announcements\n\t\tconst accessibilityText = getCustomAnnouncement(this);\n\n\t\t// Apply the announcement using the shared invisible text element from CustomAnnouncement\n\t\tapplyCustomAnnouncement(listItem, accessibilityText);\n\t}\n\n\tprivate _clearInvisibleTextContent() {\n\t\tconst listItem = this._listItem;\n\t\tif (!listItem) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear the announcement by passing empty text\n\t\tapplyCustomAnnouncement(listItem, \"\");\n\t}\n\n\t/**\n\t * Gets delete button nodes to process for accessibility\n\t * @returns {Node[]} Array of nodes to process\n\t * @private\n\t */\n\tprivate _getDeleteButtonNodes(): Node[] {\n\t\tif (!this.modeDelete) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (this.hasDeleteButtonSlot) {\n\t\t\t// Return custom delete buttons from slot\n\t\t\treturn this.deleteButton;\n\t\t}\n\n\t\t// Return the built-in delete button from the shadow DOM if it exists\n\t\tconst deleteButton = this.shadowRoot?.querySelector(`#${this._id}-deleteSelectionElement`);\n\t\treturn deleteButton ? [deleteButton] : [];\n\t}\n\n\tget classes(): ClassMap {\n\t\tconst result = super.classes;\n\n\t\tresult.main[\"ui5-custom-li-root\"] = true;\n\n\t\treturn result;\n\t}\n\n\tget accessibilityInfo(): AccessibilityInfo {\n\t\tconst children: Array<Node> = [];\n\n\t\t// Get slotted content elements (default slot)\n\t\tconst defaultSlot = this.shadowRoot?.querySelector(\"slot:not([name])\");\n\t\tif (defaultSlot) {\n\t\t\tconst assignedNodes = (defaultSlot as HTMLSlotElement).assignedNodes({ flatten: true });\n\t\t\tchildren.push(...assignedNodes);\n\t\t}\n\n\t\t// Get delete button nodes\n\t\tconst deleteButtonNodes = this._getDeleteButtonNodes();\n\t\tchildren.push(...deleteButtonNodes);\n\n\t\treturn {\n\t\t\ttype: ListItemCustom.i18nBundle.getText(LISTITEMCUSTOM_TYPE_TEXT),\n\t\t\tchildren,\n\t\t};\n\t}\n}\n\nListItemCustom.define();\n\nexport default ListItemCustom;\n"]}
|
package/dist/ListItemGroup.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ type ListItemGroupMoveEventDetail = {
|
|
|
25
25
|
* ### ES6 Module Import
|
|
26
26
|
* `import "@ui5/webcomponents/dist/ListItemGroup.js";`
|
|
27
27
|
* @csspart header - Used to style the header item of the group
|
|
28
|
+
* @csspart title - Used to style the title of the group header
|
|
28
29
|
* @constructor
|
|
29
30
|
* @extends UI5Element
|
|
30
31
|
* @public
|
package/dist/ListItemGroup.js
CHANGED
|
@@ -28,6 +28,7 @@ import createInstanceChecker from "@ui5/webcomponents-base/dist/util/createInsta
|
|
|
28
28
|
* ### ES6 Module Import
|
|
29
29
|
* `import "@ui5/webcomponents/dist/ListItemGroup.js";`
|
|
30
30
|
* @csspart header - Used to style the header item of the group
|
|
31
|
+
* @csspart title - Used to style the title of the group header
|
|
31
32
|
* @constructor
|
|
32
33
|
* @extends UI5Element
|
|
33
34
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemGroup.js","sourceRoot":"","sources":["../src/ListItemGroup.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,WAAW,MA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AAC,SAAS,KAAK,aAAa,CAAC,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,cAAc;QACb,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,sBAAsB,KAAmB,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;CACpE,CAAA;AAxHA;IADC,QAAQ,EAAE;iDACS;AAQpB;IADC,QAAQ,EAAE;2DACmB;AAW9B;IALC,IAAI,CAAC;QACL,SAAS,EAAE,IAAI;QACf,uBAAuB,EAAE,IAAI;QAC7B,IAAI,EAAE,WAAW;KACjB,CAAC;4CACgC;AAoBlC;IADC,QAAQ,EAAE;mDAC8B;AAOzC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACZ;AAShB;IADC,IAAI,EAAE;6CACqB;AAlEvB,aAAa;IApClB,aAAa,CAAC;QACd,GAAG,EAAE,cAAc;QACnB,QAAQ,EAAE,WAAW;QACrB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,qBAAqB;QAC/B,MAAM,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC;IAEF;;;;;;;;OAQG;;IAEF,KAAK,CAAC,WAAW,EAAE;QACnB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;;;;;OAQG;;IACF,KAAK,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,aAAa,CAmIlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC;AAC7B,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAgB,iBAAiB,CAAC,CAAC","sourcesContent":["import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { Slot, DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport DragAndDropHandler from \"./delegate/DragAndDropHandler.js\";\nimport MovePlacement from \"@ui5/webcomponents-base/dist/types/MovePlacement.js\";\nimport type DropIndicator from \"./DropIndicator.js\";\nimport type ListItemBase from \"./ListItemBase.js\";\n\n// Template\nimport ListItemGroupTemplate from \"./ListItemGroupTemplate.js\";\n\n// Styles\nimport ListItemGroupCss from \"./generated/themes/ListItemGroup.css.js\";\nimport type ListItemGroupHeader from \"./ListItemGroupHeader.js\";\nimport WrappingType from \"./types/WrappingType.js\";\nimport createInstanceChecker from \"@ui5/webcomponents-base/dist/util/createInstanceChecker.js\";\n\ntype ListItemGroupMoveEventDetail = {\n\tsource: {\n\t\telement: HTMLElement,\n\t},\n\tdestination: {\n\t\telement: HTMLElement,\n\t\tplacement: `${MovePlacement}`,\n\t}\n}\n\n/**\n * @class\n * ### Overview\n * The `ui5-li-group` is a special list item, used only to create groups of list items.\n *\n * This is the item to use inside a `ui5-list`.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/ListItemGroup.js\";`\n * @csspart header - Used to style the header item of the group\n * @csspart title - Used to style the title of the group header\n * @constructor\n * @extends UI5Element\n * @public\n * @since 2.0.0\n */\n@customElement({\n\ttag: \"ui5-li-group\",\n\trenderer: jsxRenderer,\n\tlanguageAware: true,\n\ttemplate: ListItemGroupTemplate,\n\tstyles: [ListItemGroupCss],\n})\n\n/**\n * Fired when a movable list item is moved over a potential drop target during a dragging operation.\n *\n * If the new position is valid, prevent the default action of the event using `preventDefault()`.\n * @param {object} source Contains information about the moved element under `element` property.\n * @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.\n * @public\n * @since 2.1.0\n */\n\n@event(\"move-over\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired when a movable list item is dropped onto a drop target.\n *\n * **Note:** `move` event is fired only if there was a preceding `move-over` with prevented default action.\n * @param {object} source Contains information about the moved element under `element` property.\n * @param {object} destination Contains information about the destination of the moved element. Has `element` and `placement` properties.\n * @public\n * @since 2.1.0\n */\n@event(\"move\", {\n\tbubbles: true,\n})\n\nclass ListItemGroup extends UI5Element {\n\teventDetails!: {\n\t\t\"move-over\": ListItemGroupMoveEventDetail,\n\t\t\"move\": ListItemGroupMoveEventDetail,\n\t}\n\t/**\n\t * Defines the header text of the <code>ui5-li-group</code>.\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Defines the accessible name of the header.\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\theaderAccessibleName?: string;\n\n\t/**\n\t * Defines the items of the <code>ui5-li-group</code>.\n\t * @public\n\t */\n\t@slot({\n\t\t\"default\": true,\n\t\tinvalidateOnChildChange: true,\n\t\ttype: HTMLElement,\n\t})\n\titems!: DefaultSlot<ListItemBase>;\n\n\t/**\n\t * Defines if the text of the component should wrap when it's too long.\n\t * When set to \"Normal\", the content (title, description) will be wrapped\n\t * using the `ui5-expandable-text` component.<br/>\n\t *\n\t * The text can wrap up to 100 characters on small screens (size S) and\n\t * up to 300 characters on larger screens (size M and above). When text exceeds\n\t * these limits, it truncates with an ellipsis followed by a text expansion trigger.\n\t *\n\t * Available options are:\n\t * - `None` (default) - The text will truncate with an ellipsis.\n\t * - `Normal` - The text will wrap (without truncation).\n\t *\n\t * @default \"None\"\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\twrappingType: `${WrappingType}` = \"None\";\n\n\t/**\n\t * Indicates whether the header is focused\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused = false;\n\n\t/**\n\t* Defines the header of the component.\n\t*\n\t* **Note:** Using this slot, the default header text of group and the value of `headerText` property will be overwritten.\n\t* @public\n\t*/\n\t@slot()\n\theader!: Slot<ListItemBase>;\n\n\t_dragAndDropHandler: DragAndDropHandler;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\t// Initialize the DragAndDropHandler with the necessary configurations\n\t\t// The handler will manage the drag and drop operations for the list items.\n\t\tthis._dragAndDropHandler = new DragAndDropHandler(this, {\n\t\t\tgetItems: () => this.items,\n\t\t\tgetDropIndicator: () => this.dropIndicatorDOM,\n\t\t\tfilterPlacements: this._filterPlacements.bind(this),\n\t\t});\n\t}\n\n\tget groupHeaderItem() {\n\t\treturn this.shadowRoot!.querySelector<ListItemGroupHeader>(\"[ui5-li-group-header]\")!;\n\t}\n\n\tget hasHeader(): boolean {\n\t\treturn !!this.headerText || this.hasFormattedHeader;\n\t}\n\n\tget hasFormattedHeader(): boolean {\n\t\treturn !!this.header.length;\n\t}\n\n\tget isListItemGroup() {\n\t\treturn true;\n\t}\n\n\tget dropIndicatorDOM(): DropIndicator | null {\n\t\treturn this.shadowRoot!.querySelector(\"[ui5-drop-indicator]\");\n\t}\n\n\t_ondragenter(e: DragEvent) {\n\t\tthis._dragAndDropHandler.ondragenter(e);\n\t}\n\n\t_ondragleave(e: DragEvent) {\n\t\tthis._dragAndDropHandler.ondragleave(e);\n\t}\n\n\t_ondragover(e: DragEvent) {\n\t\tthis._dragAndDropHandler.ondragover(e);\n\t}\n\n\t_ondrop(e: DragEvent) {\n\t\tthis._dragAndDropHandler.ondrop(e);\n\t}\n\n\t_filterPlacements(placements: MovePlacement[], draggedElement: HTMLElement, targetElement: HTMLElement): MovePlacement[] {\n\t\t// Filter out MovePlacement.On when dragged element is the same as target\n\t\tif (targetElement === draggedElement) {\n\t\t\treturn placements.filter(placement => placement !== MovePlacement.On);\n\t\t}\n\t\treturn placements;\n\t}\n\n\tgetFocusDomRef() {\n\t\treturn this.groupHeaderItem || this.items.at(0);\n\t}\n\n\tgetGroupHeaderWrapping(): WrappingType { return WrappingType.None; }\n}\n\nListItemGroup.define();\n\nexport default ListItemGroup;\nexport const isInstanceOfListItemGroup = createInstanceChecker<ListItemGroup>(\"isListItemGroup\");\nexport type { ListItemGroupMoveEventDetail };\n"]}
|
|
@@ -4,6 +4,6 @@ import DropIndicator from "./DropIndicator.js";
|
|
|
4
4
|
import ListItemAccessibleRole from "./types/ListItemAccessibleRole.js";
|
|
5
5
|
export default function ListItemGroupTemplate() {
|
|
6
6
|
return (_jsxs(_Fragment, { children: [this.hasHeader &&
|
|
7
|
-
_jsxs(ListItemGroupHeader, { wrappingType: this.wrappingType, focused: this.focused, part: "header", accessibleRole: ListItemAccessibleRole.ListItem, children: [this.hasFormattedHeader ? _jsx("slot", { name: "header" }) : this.headerText, _jsx("div", { role: "list", slot: "subItems", "aria-owns": `${this._id}-content`, "aria-label": this.headerText })] }), _jsxs("div", { class: "ui5-group-li-root", onDragEnter: this._ondragenter, onDragOver: this._ondragover, onDrop: this._ondrop, onDragLeave: this._ondragleave, id: `${this._id}-content`, children: [_jsx("slot", {}), _jsx(DropIndicator, { orientation: "Horizontal", ownerReference: this })] })] }));
|
|
7
|
+
_jsxs(ListItemGroupHeader, { wrappingType: this.wrappingType, focused: this.focused, part: "header", exportparts: "title", accessibleRole: ListItemAccessibleRole.ListItem, children: [this.hasFormattedHeader ? _jsx("slot", { name: "header" }) : this.headerText, _jsx("div", { role: "list", slot: "subItems", "aria-owns": `${this._id}-content`, "aria-label": this.headerText })] }), _jsxs("div", { class: "ui5-group-li-root", onDragEnter: this._ondragenter, onDragOver: this._ondragover, onDrop: this._ondrop, onDragLeave: this._ondragleave, id: `${this._id}-content`, children: [_jsx("slot", {}), _jsx(DropIndicator, { orientation: "Horizontal", ownerReference: this })] })] }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=ListItemGroupTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemGroupTemplate.js","sourceRoot":"","sources":["../src/ListItemGroupTemplate.tsx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,EAAC,YAAY,EAAC,cAAc,EAAE,IAAI,GAAI,IAC3D,IACJ,CAEH,CAAC;AACH,CAAC","sourcesContent":["import type ListItemGroup from \"./ListItemGroup.js\";\nimport ListItemGroupHeader from \"./ListItemGroupHeader.js\";\nimport DropIndicator from \"./DropIndicator.js\";\nimport ListItemAccessibleRole from \"./types/ListItemAccessibleRole.js\";\n\nexport default function ListItemGroupTemplate(this: ListItemGroup) {\n\treturn (\n\t\t<>\n\t\t\t{this.hasHeader &&\n\t\t\t\t<ListItemGroupHeader\n\t\t\t\t\twrappingType={this.wrappingType}\n\t\t\t\t\tfocused={this.focused}\n\t\t\t\t\tpart=\"header\"\n\t\t\t\t\texportparts=\"title\"\n\t\t\t\t\taccessibleRole={ListItemAccessibleRole.ListItem}\n\t\t\t\t>\n\t\t\t\t\t{this.hasFormattedHeader ? <slot name=\"header\"></slot> : this.headerText}\n\t\t\t\t\t<div\n\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\tslot=\"subItems\"\n\t\t\t\t\t\taria-owns={`${this._id}-content`}\n\t\t\t\t\t\taria-label={this.headerText}\n\t\t\t\t\t></div>\n\t\t\t\t</ListItemGroupHeader>\n\t\t\t}\n\t\t\t<div class=\"ui5-group-li-root\"\n\t\t\t\tonDragEnter={this._ondragenter}\n\t\t\t\tonDragOver={this._ondragover}\n\t\t\t\tonDrop={this._ondrop}\n\t\t\t\tonDragLeave={this._ondragleave}\n\t\t\t\tid={`${this._id}-content`}>\n\n\t\t\t\t<slot></slot>\n\n\t\t\t\t<DropIndicator orientation=\"Horizontal\" ownerReference={this} />\n\t\t\t</div>\n\t\t</>\n\n\t);\n}\n"]}
|
package/dist/Menu.d.ts
CHANGED
|
@@ -146,6 +146,7 @@ declare class Menu extends UI5Element {
|
|
|
146
146
|
get isPhone(): boolean;
|
|
147
147
|
get _popover(): ResponsivePopover;
|
|
148
148
|
get _list(): List | null;
|
|
149
|
+
get _opener(): HTMLElement | null | undefined;
|
|
149
150
|
/** Returns menu item groups */
|
|
150
151
|
get _menuItemGroups(): import("./MenuItemGroup.js").default[];
|
|
151
152
|
/** Returns menu items */
|
|
@@ -159,7 +160,7 @@ declare class Menu extends UI5Element {
|
|
|
159
160
|
getFocusDomRef(): HTMLElement | undefined;
|
|
160
161
|
_setupItemNavigation(): void;
|
|
161
162
|
_close(): void;
|
|
162
|
-
_openItemSubMenu(item: MenuItem): void;
|
|
163
|
+
_openItemSubMenu(item: MenuItem, openedByMouse?: boolean): void;
|
|
163
164
|
_itemMouseOver(e: MouseEvent): void;
|
|
164
165
|
focus(focusOptions?: FocusOptions): Promise<void>;
|
|
165
166
|
_closeOtherSubMenus(item: MenuItem): void;
|
package/dist/Menu.js
CHANGED
|
@@ -10,7 +10,7 @@ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement
|
|
|
10
10
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
11
11
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
|
|
12
12
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
13
|
-
import { isLeft, isRight, isEnter, isTabNext, isTabPrevious, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
13
|
+
import { isLeft, isRight, isEnter, isTabNext, isTabPrevious, isShow, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
14
14
|
import { isPhone, isDesktop, } from "@ui5/webcomponents-base/dist/Device.js";
|
|
15
15
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
16
16
|
import "@ui5/webcomponents-icons/dist/slim-arrow-right.js";
|
|
@@ -21,6 +21,7 @@ import DOMReferenceConverter from "@ui5/webcomponents-base/dist/converters/DOMRe
|
|
|
21
21
|
import { isInstanceOfMenuItem } from "./MenuItem.js";
|
|
22
22
|
import { isInstanceOfMenuItemGroup } from "./MenuItemGroup.js";
|
|
23
23
|
import { isInstanceOfMenuSeparator } from "./MenuSeparator.js";
|
|
24
|
+
import { isInstanceOfSplitButton } from "./SplitButton.js";
|
|
24
25
|
import menuTemplate from "./MenuTemplate.js";
|
|
25
26
|
import { MENU_CANCEL_BUTTON_TEXT, MENU_POPOVER_ACCESSIBLE_NAME, } from "./generated/i18n/i18n-defaults.js";
|
|
26
27
|
// Styles
|
|
@@ -123,6 +124,9 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
123
124
|
get _list() {
|
|
124
125
|
return this.shadowRoot.querySelector("[ui5-list]");
|
|
125
126
|
}
|
|
127
|
+
get _opener() {
|
|
128
|
+
return typeof this.opener === "string" ? document.getElementById(this.opener) : this.opener;
|
|
129
|
+
}
|
|
126
130
|
/** Returns menu item groups */
|
|
127
131
|
get _menuItemGroups() {
|
|
128
132
|
return this.items.filter(isInstanceOfMenuItemGroup);
|
|
@@ -181,7 +185,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
181
185
|
_close() {
|
|
182
186
|
this.open = false;
|
|
183
187
|
}
|
|
184
|
-
_openItemSubMenu(item) {
|
|
188
|
+
_openItemSubMenu(item, openedByMouse = false) {
|
|
185
189
|
clearTimeout(this._timeout);
|
|
186
190
|
if (!item._popover || item._popover.open) {
|
|
187
191
|
return;
|
|
@@ -192,6 +196,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
192
196
|
item._popover.opener = item;
|
|
193
197
|
item._popover.open = true;
|
|
194
198
|
item.selected = true;
|
|
199
|
+
item._openedByMouse = openedByMouse;
|
|
195
200
|
}
|
|
196
201
|
_itemMouseOver(e) {
|
|
197
202
|
if (!isDesktop()) {
|
|
@@ -201,7 +206,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
201
206
|
if (!isInstanceOfMenuItem(item)) {
|
|
202
207
|
return;
|
|
203
208
|
}
|
|
204
|
-
item.focus();
|
|
209
|
+
item.getFocusDomRef()?.focus();
|
|
205
210
|
// Opens submenu with 300ms delay
|
|
206
211
|
this._startOpenTimeout(item);
|
|
207
212
|
}
|
|
@@ -228,7 +233,7 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
228
233
|
clearTimeout(this._timeout);
|
|
229
234
|
this._timeout = setTimeout(() => {
|
|
230
235
|
this._closeOtherSubMenus(item);
|
|
231
|
-
this._openItemSubMenu(item);
|
|
236
|
+
this._openItemSubMenu(item, true);
|
|
232
237
|
}, MENU_OPEN_DELAY);
|
|
233
238
|
}
|
|
234
239
|
_itemClick(e) {
|
|
@@ -249,22 +254,24 @@ let Menu = Menu_1 = class Menu extends UI5Element {
|
|
|
249
254
|
}
|
|
250
255
|
_itemKeyDown(e) {
|
|
251
256
|
const isTabNextPrevious = isTabNext(e) || isTabPrevious(e);
|
|
257
|
+
const isShowKey = isShow(e);
|
|
258
|
+
const isSplitButton = this._opener && isInstanceOfSplitButton(this._opener);
|
|
252
259
|
const item = e.target;
|
|
253
260
|
if (!isInstanceOfMenuItem(item)) {
|
|
254
261
|
return;
|
|
255
262
|
}
|
|
256
263
|
const isEndContentNavigation = isRight(e) || isLeft(e);
|
|
257
264
|
const shouldOpenMenu = this.isRtl ? isLeft(e) : isRight(e);
|
|
258
|
-
if (isEnter(e) || isTabNextPrevious) {
|
|
265
|
+
if (isEnter(e) || isTabNextPrevious || (isShowKey && isSplitButton)) {
|
|
259
266
|
e.preventDefault();
|
|
260
267
|
}
|
|
261
268
|
if (isEndContentNavigation) {
|
|
262
269
|
item._navigateToEndContent(isLeft(e));
|
|
263
270
|
}
|
|
264
271
|
if (shouldOpenMenu) {
|
|
265
|
-
this._openItemSubMenu(item);
|
|
272
|
+
this._openItemSubMenu(item, false);
|
|
266
273
|
}
|
|
267
|
-
else if (isTabNextPrevious) {
|
|
274
|
+
else if (isTabNextPrevious || (isShowKey && isSplitButton)) {
|
|
268
275
|
this._close();
|
|
269
276
|
}
|
|
270
277
|
}
|
package/dist/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OA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AAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;oCACV;AASrC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;mCAC7C;AAGxB;IADN,IAAI,CAAC,oBAAoB,CAAC;8BACG;AAlFzB,IAAI;IAnET,aAAa,CAAC;QACd,GAAG,EAAE,UAAU;QACf,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,YAAY;KACtB,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,YAAY,EAAE;QACpB,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,YAAY,EAAE;QACpB,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,CAAC;GAET,IAAI,CAuUT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } 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-strict.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n\tisTabNext,\n\tisTabPrevious,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport DOMReferenceConverter from \"@ui5/webcomponents-base/dist/converters/DOMReference.js\";\nimport type List from \"./List.js\";\nimport type ResponsivePopover from \"./ResponsivePopover.js\";\nimport type MenuItem from \"./MenuItem.js\";\n// The import below should be kept, as MenuItem is part of the Menu component.\nimport { isInstanceOfMenuItem } from \"./MenuItem.js\";\nimport { isInstanceOfMenuItemGroup } from \"./MenuItemGroup.js\";\nimport { isInstanceOfMenuSeparator } from \"./MenuSeparator.js\";\nimport type PopoverHorizontalAlign from \"./types/PopoverHorizontalAlign.js\";\nimport type PopoverPlacement from \"./types/PopoverPlacement.js\";\nimport type {\n\tListItemClickEventDetail,\n} from \"./List.js\";\nimport menuTemplate from \"./MenuTemplate.js\";\nimport {\n\tMENU_CANCEL_BUTTON_TEXT,\n\tMENU_POPOVER_ACCESSIBLE_NAME,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport menuCss from \"./generated/themes/Menu.css.js\";\n\nconst MENU_OPEN_DELAY = 300;\n\n/**\n * Interface for components that may be slotted inside a `ui5-menu`.\n *\n * **Note:** Use with `ui5-menu-item` or `ui5-menu-separator`. Implementing the interface does not guarantee that any other classes can work with the `ui5-menu`.\n * @public\n */\ninterface IMenuItem extends UI5Element {\n\tisMenuItem?: boolean;\n\tisSeparator?: boolean;\n\tisGroup?: boolean;\n}\n\ntype MenuItemClickEventDetail = {\n\titem: MenuItem,\n\ttext: string,\n}\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu` component represents a hierarchical menu structure.\n *\n * ### Structure\n *\n * The `ui5-menu` can hold two types of entities:\n *\n * - `ui5-menu-item` components\n * - `ui5-menu-separator` - used to separate menu items with a line\n *\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Keyboard Handling\n *\n * The `ui5-menu` provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n *\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the menu items that are currently visible.\n * - `Arrow Right`, `Space` or `Enter` - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.\n * - `Arrow Left` or `Escape` - Closes the currently opened sub-menu.\n *\n * when there is `endContent` :\n * - `Arrow Left` or `ArrowRight` - Navigate between the menu item actions and the menu item itself\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the currently visible menu items\n *\n * **Note:** If the text direction is set to Right-to-left (RTL), `Arrow Right` and `Arrow Left` functionality is swapped.\n *\n * Application developers are responsible for ensuring that interactive elements placed in the `endContent` slot\n * have the correct accessibility behaviour, including their enabled or disabled states.\n * The menu does not manage these aspects when the menu item state changes.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Menu.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: jsxRenderer,\n\tstyles: menuCss,\n\ttemplate: menuTemplate,\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * **Note:** Since 1.17.0 the event is preventable, allowing the menu to remain open after an item is pressed.\n * @param { HTMLElement } 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\tcancelable: true,\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening.\n *\n * **Note:** Since 1.14.0 the event is also fired before a sub-menu opens.\n * @public\n * @since 1.10.0\n * @param { HTMLElement } item The `ui5-menu-item` that triggers opening of the sub-menu or undefined when fired upon root menu opening.\n */\n@event(\"before-open\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the menu is opened.\n * @public\n * @since 1.10.0\n */\n@event(\"open\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the menu is being closed.\n * @private\n */\n@event(\"close-menu\", {\n\tbubbles: true,\n})\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing.\n * @public\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the menu is closed.\n * @public\n * @since 1.10.0\n */\n@event(\"close\")\n\nclass Menu extends UI5Element {\n\teventDetails!: {\n\t\t\"item-click\": MenuItemClickEventDetail,\n\t\t\"before-open\": MenuBeforeOpenEventDetail,\n\t\t\"open\": void,\n\t\t\"before-close\": MenuBeforeCloseEventDetail,\n\t\t\"close\": void,\n\t\t\"close-menu\": void,\n\t}\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Indicates if the menu is open.\n\t * @public\n\t * @default false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen = false;\n\n\t/**\n\t * Determines on which side the component is placed at.\n\t * @default \"Bottom\"\n\t * @public\n\t * @since 2.16.0\n\t */\n\t@property()\n\tplacement: `${PopoverPlacement}` = \"Bottom\";\n\n\t/**\n\t * Determines the horizontal alignment of the menu relative to its opener control.\n\t * @default \"Start\"\n\t * @public\n\t */\n\t@property()\n\thorizontalAlign: `${PopoverHorizontalAlign}` = \"Start\";\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element at which the menu is shown.\n\t * When using this attribute in a declarative way, you must only use the `id` (as a string) of the element at which you want to show the popover.\n\t * You can only set the `opener` attribute to a DOM Reference when using JavaScript.\n\t * @public\n\t * @default undefined\n\t * @since 1.10.0\n\t */\n\t@property({ converter: DOMReferenceConverter })\n\topener?: HTMLElement | string | null;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** Use `ui5-menu-item` and `ui5-menu-separator` for their intended design.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: DefaultSlot<IMenuItem>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t_timeout?: Timeout;\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget labelCancel() {\n\t\treturn Menu.i18nBundle.getText(MENU_CANCEL_BUTTON_TEXT);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\tget _list() {\n\t\treturn this.shadowRoot!.querySelector<List>(\"[ui5-list]\");\n\t}\n\n\t/** Returns menu item groups */\n\tget _menuItemGroups() {\n\t\treturn this.items.filter(isInstanceOfMenuItemGroup);\n\t}\n\n\t/** Returns menu items */\n\tget _menuItems() {\n\t\treturn this.items.filter(isInstanceOfMenuItem);\n\t}\n\n\t/** Returns all menu items (including those in groups */\n\tget _allMenuItems() {\n\t\tconst items: MenuItem[] = [];\n\t\tconst slottedItems = this.getSlottedNodes<IMenuItem>(\"items\");\n\n\t\tslottedItems.forEach(item => {\n\t\t\tif (isInstanceOfMenuItemGroup(item)) {\n\t\t\t\titems.push(...item._menuItems);\n\t\t\t} else if (!isInstanceOfMenuSeparator(item)) {\n\t\t\t\titems.push(item as MenuItem);\n\t\t\t}\n\t\t});\n\n\t\treturn items;\n\t}\n\n\t/** Returns menu items included in the ItemNavigation */\n\tget _navigatableMenuItems() {\n\t\tconst items: MenuItem[] = [];\n\t\tconst slottedItems = this.getSlottedNodes<MenuItem>(\"items\");\n\n\t\tslottedItems.forEach(item => {\n\t\t\tif (isInstanceOfMenuItemGroup(item)) {\n\t\t\t\tconst groupItems = item.getSlottedNodes<MenuItem>(\"items\");\n\t\t\t\titems.push(...groupItems);\n\t\t\t} else if (!isInstanceOfMenuSeparator(item)) {\n\t\t\t\titems.push(item);\n\t\t\t}\n\t\t});\n\n\t\treturn items;\n\t}\n\n\tget accessibleNameText() {\n\t\treturn Menu.i18nBundle.getText(MENU_POPOVER_ACCESSIBLE_NAME);\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._allMenuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._setupItemNavigation();\n\n\t\tthis._allMenuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\tgetFocusDomRef(): HTMLElement | undefined {\n\t\treturn this._list?.getFocusDomRef();\n\t}\n\n\t_setupItemNavigation() {\n\t\tif (this._list) {\n\t\t\tthis._list._itemNavigation._getItems = () => this._navigatableMenuItems;\n\t\t}\n\t}\n\n\t_close() {\n\t\tthis.open = false;\n\t}\n\n\t_openItemSubMenu(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tif (!item._popover || item._popover.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"before-open\", {\n\t\t\titem,\n\t\t});\n\n\t\titem._popover.opener = item;\n\t\titem._popover.open = true;\n\t\titem.selected = true;\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (!isDesktop()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = e.target as MenuItem;\n\t\tif (!isInstanceOfMenuItem(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\titem.focus();\n\n\t\t// Opens submenu with 300ms delay\n\t\tthis._startOpenTimeout(item);\n\t}\n\n\tasync focus(focusOptions?: FocusOptions): Promise<void> {\n\t\tawait renderFinished();\n\t\tconst firstMenuItem = this._allMenuItems[0];\n\n\t\tif (firstMenuItem) {\n\t\t\treturn firstMenuItem.focus(focusOptions);\n\t\t}\n\n\t\treturn super.focus(focusOptions);\n\t}\n\n\t_closeOtherSubMenus(item: MenuItem) {\n\t\tconst menuItems = this._allMenuItems;\n\t\tif (!menuItems.includes(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\tmenuItems.forEach(menuItem => {\n\t\t\tif (menuItem !== item) {\n\t\t\t\tmenuItem._close();\n\t\t\t}\n\t\t});\n\t}\n\n\t_startOpenTimeout(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tthis._timeout = setTimeout(() => {\n\t\t\tthis._closeOtherSubMenus(item);\n\n\t\t\tthis._openItemSubMenu(item);\n\t\t}, MENU_OPEN_DELAY);\n\t}\n\n\t_itemClick(e: CustomEvent<ListItemClickEventDetail>) {\n\t\tconst item = e.detail.item as MenuItem;\n\n\t\tif (!item._popover) {\n\t\t\tconst prevented = !this.fireDecoratorEvent(\"item-click\", {\n\t\t\t\t\"item\": item,\n\t\t\t\t\"text\": item.text || \"\",\n\t\t\t});\n\n\t\t\tif (!prevented) {\n\t\t\t\titem._updateCheckedState();\n\t\t\t\tthis._popover && !item._shiftPressed && item.fireDecoratorEvent(\"close-menu\");\n\t\t\t}\n\t\t} else {\n\t\t\tthis._openItemSubMenu(item);\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isTabNextPrevious = isTabNext(e) || isTabPrevious(e);\n\t\tconst item = e.target as MenuItem;\n\n\t\tif (!isInstanceOfMenuItem(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isEndContentNavigation = isRight(e) || isLeft(e);\n\t\tconst shouldOpenMenu = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e) || isTabNextPrevious) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isEndContentNavigation) {\n\t\t\titem._navigateToEndContent(isLeft(e));\n\t\t}\n\n\t\tif (shouldOpenMenu) {\n\t\t\tthis._openItemSubMenu(item);\n\t\t} else if (isTabNextPrevious) {\n\t\t\tthis._close();\n\t\t}\n\t}\n\n\t_navigateOutOfEndContent(e: CustomEvent) {\n\t\tconst item = e.target as MenuItem;\n\t\tconst shouldNavigateToNextItem = e.detail.shouldNavigateToNextItem;\n\t\tconst menuItems = this._allMenuItems;\n\t\tconst itemIndex = menuItems.indexOf(item);\n\n\t\tif (itemIndex > -1) {\n\t\t\tconst nextItem = shouldNavigateToNextItem ? menuItems[itemIndex + 1] : menuItems[itemIndex - 1];\n\t\t\tconst itemToFocus = nextItem || menuItems[itemIndex];\n\t\t\titemToFocus?.focus();\n\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireDecoratorEvent(\"before-open\", {});\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._allMenuItems[0]?.focus();\n\t\tthis.fireDecoratorEvent(\"open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent) {\n\t\tconst prevented = !this.fireDecoratorEvent(\"before-close\", { escPressed: e.detail.escPressed });\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireDecoratorEvent(\"close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\nexport type {\n\tMenuItemClickEventDetail,\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n\tIMenuItem,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../src/Menu.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,GACN,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,OAAO,EACP,SAAS,GACT,MAAM,wCAAwC,CAAC;AAChD,OAAO,IAAI,MAAM,iDAAiD,CAAC;AAEnE,OAAO,mDAAmD,CAAC;AAC3D,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,qBAAqB,MAAM,yDAAyD,CAAC;AAI5F,8EAA8E;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAM3D,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACN,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,mCAAmC,CAAC;AAE3C,SAAS;AACT,OAAO,OAAO,MAAM,gCAAgC,CAAC;AAErD,MAAM,eAAe,GAAG,GAAG,CAAC;AAsB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACF,KAAK,CAAC,aAAa,EAAE;QACrB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,MAAM,EAAE;QACd,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;OAGG;;IACF,KAAK,CAAC,YAAY,EAAE;QACpB,OAAO,EAAE,IAAI;KACb,CAAC;IAEF;;;;;OAKG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;IAEF;;;;OAIG;;IACF,KAAK,CAAC,OAAO,CAAC;GAET,IAAI,CA8UT;AAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAEd,eAAe,IAAI,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } 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-strict.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport {\n\tisLeft,\n\tisRight,\n\tisEnter,\n\tisTabNext,\n\tisTabPrevious,\n\tisShow,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tisPhone,\n\tisDesktop,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { Timeout } from \"@ui5/webcomponents-base/dist/types.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport DOMReferenceConverter from \"@ui5/webcomponents-base/dist/converters/DOMReference.js\";\nimport type List from \"./List.js\";\nimport type ResponsivePopover from \"./ResponsivePopover.js\";\nimport type MenuItem from \"./MenuItem.js\";\n// The import below should be kept, as MenuItem is part of the Menu component.\nimport { isInstanceOfMenuItem } from \"./MenuItem.js\";\nimport { isInstanceOfMenuItemGroup } from \"./MenuItemGroup.js\";\nimport { isInstanceOfMenuSeparator } from \"./MenuSeparator.js\";\nimport { isInstanceOfSplitButton } from \"./SplitButton.js\";\nimport type PopoverHorizontalAlign from \"./types/PopoverHorizontalAlign.js\";\nimport type PopoverPlacement from \"./types/PopoverPlacement.js\";\nimport type {\n\tListItemClickEventDetail,\n} from \"./List.js\";\nimport menuTemplate from \"./MenuTemplate.js\";\nimport {\n\tMENU_CANCEL_BUTTON_TEXT,\n\tMENU_POPOVER_ACCESSIBLE_NAME,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport menuCss from \"./generated/themes/Menu.css.js\";\n\nconst MENU_OPEN_DELAY = 300;\n\n/**\n * Interface for components that may be slotted inside a `ui5-menu`.\n *\n * **Note:** Use with `ui5-menu-item` or `ui5-menu-separator`. Implementing the interface does not guarantee that any other classes can work with the `ui5-menu`.\n * @public\n */\ninterface IMenuItem extends UI5Element {\n\tisMenuItem?: boolean;\n\tisSeparator?: boolean;\n\tisGroup?: boolean;\n}\n\ntype MenuItemClickEventDetail = {\n\titem: MenuItem,\n\ttext: string,\n}\n\ntype MenuBeforeOpenEventDetail = { item?: MenuItem };\ntype MenuBeforeCloseEventDetail = { escPressed: boolean };\n\n/**\n * @class\n *\n * ### Overview\n *\n * `ui5-menu` component represents a hierarchical menu structure.\n *\n * ### Structure\n *\n * The `ui5-menu` can hold two types of entities:\n *\n * - `ui5-menu-item` components\n * - `ui5-menu-separator` - used to separate menu items with a line\n *\n * An arbitrary hierarchy structure can be represented by recursively nesting menu items.\n *\n * ### Keyboard Handling\n *\n * The `ui5-menu` provides advanced keyboard handling.\n * The user can use the following keyboard shortcuts in order to navigate trough the tree:\n *\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the menu items that are currently visible.\n * - `Arrow Right`, `Space` or `Enter` - Opens a sub-menu if there are menu items nested\n * in the currently clicked menu item.\n * - `Arrow Left` or `Escape` - Closes the currently opened sub-menu.\n *\n * when there is `endContent` :\n * - `Arrow Left` or `ArrowRight` - Navigate between the menu item actions and the menu item itself\n * - `Arrow Up` / `Arrow Down` - Navigates up and down the currently visible menu items\n *\n * **Note:** If the text direction is set to Right-to-left (RTL), `Arrow Right` and `Arrow Left` functionality is swapped.\n *\n * Application developers are responsible for ensuring that interactive elements placed in the `endContent` slot\n * have the correct accessibility behaviour, including their enabled or disabled states.\n * The menu does not manage these aspects when the menu item state changes.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/Menu.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.3.0\n * @public\n */\n@customElement({\n\ttag: \"ui5-menu\",\n\trenderer: jsxRenderer,\n\tstyles: menuCss,\n\ttemplate: menuTemplate,\n})\n\n/**\n * Fired when an item is being clicked.\n *\n * **Note:** Since 1.17.0 the event is preventable, allowing the menu to remain open after an item is pressed.\n * @param { HTMLElement } 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\tcancelable: true,\n})\n\n/**\n * Fired before the menu is opened. This event can be cancelled, which will prevent the menu from opening.\n *\n * **Note:** Since 1.14.0 the event is also fired before a sub-menu opens.\n * @public\n * @since 1.10.0\n * @param { HTMLElement } item The `ui5-menu-item` that triggers opening of the sub-menu or undefined when fired upon root menu opening.\n */\n@event(\"before-open\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the menu is opened.\n * @public\n * @since 1.10.0\n */\n@event(\"open\", {\n\tbubbles: true,\n})\n\n/**\n * Fired when the menu is being closed.\n * @private\n */\n@event(\"close-menu\", {\n\tbubbles: true,\n})\n\n/**\n * Fired before the menu is closed. This event can be cancelled, which will prevent the menu from closing.\n * @public\n * @param {boolean} escPressed Indicates that `ESC` key has triggered the event.\n * @since 1.10.0\n */\n@event(\"before-close\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\n/**\n * Fired after the menu is closed.\n * @public\n * @since 1.10.0\n */\n@event(\"close\")\n\nclass Menu extends UI5Element {\n\teventDetails!: {\n\t\t\"item-click\": MenuItemClickEventDetail,\n\t\t\"before-open\": MenuBeforeOpenEventDetail,\n\t\t\"open\": void,\n\t\t\"before-close\": MenuBeforeCloseEventDetail,\n\t\t\"close\": void,\n\t\t\"close-menu\": void,\n\t}\n\t/**\n\t * Defines the header text of the menu (displayed on mobile).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\theaderText?: string;\n\n\t/**\n\t * Indicates if the menu is open.\n\t * @public\n\t * @default false\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\topen = false;\n\n\t/**\n\t * Determines on which side the component is placed at.\n\t * @default \"Bottom\"\n\t * @public\n\t * @since 2.16.0\n\t */\n\t@property()\n\tplacement: `${PopoverPlacement}` = \"Bottom\";\n\n\t/**\n\t * Determines the horizontal alignment of the menu relative to its opener control.\n\t * @default \"Start\"\n\t * @public\n\t */\n\t@property()\n\thorizontalAlign: `${PopoverHorizontalAlign}` = \"Start\";\n\n\t/**\n\t * Defines if a loading indicator would be displayed inside the corresponding ui5-menu popover.\n\t * @default false\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Boolean })\n\tloading = false;\n\n\t/**\n\t * Defines the delay in milliseconds, after which the loading indicator will be displayed inside the corresponding ui5-menu popover.\n\t * @default 1000\n\t * @public\n\t * @since 1.13.0\n\t */\n\t@property({ type: Number })\n\tloadingDelay = 1000;\n\n\t/**\n\t * Defines the ID or DOM Reference of the element at which the menu is shown.\n\t * When using this attribute in a declarative way, you must only use the `id` (as a string) of the element at which you want to show the popover.\n\t * You can only set the `opener` attribute to a DOM Reference when using JavaScript.\n\t * @public\n\t * @default undefined\n\t * @since 1.10.0\n\t */\n\t@property({ converter: DOMReferenceConverter })\n\topener?: HTMLElement | string | null;\n\n\t/**\n\t * Defines the items of this component.\n\t *\n\t * **Note:** Use `ui5-menu-item` and `ui5-menu-separator` for their intended design.\n\t * @public\n\t */\n\t@slot({ \"default\": true, type: HTMLElement, invalidateOnChildChange: true })\n\titems!: DefaultSlot<IMenuItem>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t_timeout?: Timeout;\n\n\tget isRtl() {\n\t\treturn this.effectiveDir === \"rtl\";\n\t}\n\n\tget labelCancel() {\n\t\treturn Menu.i18nBundle.getText(MENU_CANCEL_BUTTON_TEXT);\n\t}\n\n\tget isPhone() {\n\t\treturn isPhone();\n\t}\n\n\tget _popover() {\n\t\treturn this.shadowRoot!.querySelector<ResponsivePopover>(\"[ui5-responsive-popover]\")!;\n\t}\n\tget _list() {\n\t\treturn this.shadowRoot!.querySelector<List>(\"[ui5-list]\");\n\t}\n\n\tget _opener() {\n\t\treturn typeof this.opener === \"string\" ? document.getElementById(this.opener) : this.opener;\n\t}\n\n\t/** Returns menu item groups */\n\tget _menuItemGroups() {\n\t\treturn this.items.filter(isInstanceOfMenuItemGroup);\n\t}\n\n\t/** Returns menu items */\n\tget _menuItems() {\n\t\treturn this.items.filter(isInstanceOfMenuItem);\n\t}\n\n\t/** Returns all menu items (including those in groups */\n\tget _allMenuItems() {\n\t\tconst items: MenuItem[] = [];\n\t\tconst slottedItems = this.getSlottedNodes<IMenuItem>(\"items\");\n\n\t\tslottedItems.forEach(item => {\n\t\t\tif (isInstanceOfMenuItemGroup(item)) {\n\t\t\t\titems.push(...item._menuItems);\n\t\t\t} else if (!isInstanceOfMenuSeparator(item)) {\n\t\t\t\titems.push(item as MenuItem);\n\t\t\t}\n\t\t});\n\n\t\treturn items;\n\t}\n\n\t/** Returns menu items included in the ItemNavigation */\n\tget _navigatableMenuItems() {\n\t\tconst items: MenuItem[] = [];\n\t\tconst slottedItems = this.getSlottedNodes<MenuItem>(\"items\");\n\n\t\tslottedItems.forEach(item => {\n\t\t\tif (isInstanceOfMenuItemGroup(item)) {\n\t\t\t\tconst groupItems = item.getSlottedNodes<MenuItem>(\"items\");\n\t\t\t\titems.push(...groupItems);\n\t\t\t} else if (!isInstanceOfMenuSeparator(item)) {\n\t\t\t\titems.push(item);\n\t\t\t}\n\t\t});\n\n\t\treturn items;\n\t}\n\n\tget accessibleNameText() {\n\t\treturn Menu.i18nBundle.getText(MENU_POPOVER_ACCESSIBLE_NAME);\n\t}\n\n\tonBeforeRendering() {\n\t\tconst siblingsWithIcon = this._allMenuItems.some(menuItem => !!menuItem.icon);\n\n\t\tthis._setupItemNavigation();\n\n\t\tthis._allMenuItems.forEach(item => {\n\t\t\titem._siblingsWithIcon = siblingsWithIcon;\n\t\t});\n\t}\n\n\tgetFocusDomRef(): HTMLElement | undefined {\n\t\treturn this._list?.getFocusDomRef();\n\t}\n\n\t_setupItemNavigation() {\n\t\tif (this._list) {\n\t\t\tthis._list._itemNavigation._getItems = () => this._navigatableMenuItems;\n\t\t}\n\t}\n\n\t_close() {\n\t\tthis.open = false;\n\t}\n\n\t_openItemSubMenu(item: MenuItem, openedByMouse = false) {\n\t\tclearTimeout(this._timeout);\n\n\t\tif (!item._popover || item._popover.open) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"before-open\", {\n\t\t\titem,\n\t\t});\n\n\t\titem._popover.opener = item;\n\t\titem._popover.open = true;\n\t\titem.selected = true;\n\t\titem._openedByMouse = openedByMouse;\n\t}\n\n\t_itemMouseOver(e: MouseEvent) {\n\t\tif (!isDesktop()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = e.target as MenuItem;\n\t\tif (!isInstanceOfMenuItem(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\titem.getFocusDomRef()?.focus();\n\n\t\t// Opens submenu with 300ms delay\n\t\tthis._startOpenTimeout(item);\n\t}\n\n\tasync focus(focusOptions?: FocusOptions): Promise<void> {\n\t\tawait renderFinished();\n\t\tconst firstMenuItem = this._allMenuItems[0];\n\n\t\tif (firstMenuItem) {\n\t\t\treturn firstMenuItem.focus(focusOptions);\n\t\t}\n\n\t\treturn super.focus(focusOptions);\n\t}\n\n\t_closeOtherSubMenus(item: MenuItem) {\n\t\tconst menuItems = this._allMenuItems;\n\t\tif (!menuItems.includes(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\tmenuItems.forEach(menuItem => {\n\t\t\tif (menuItem !== item) {\n\t\t\t\tmenuItem._close();\n\t\t\t}\n\t\t});\n\t}\n\n\t_startOpenTimeout(item: MenuItem) {\n\t\tclearTimeout(this._timeout);\n\n\t\tthis._timeout = setTimeout(() => {\n\t\t\tthis._closeOtherSubMenus(item);\n\n\t\t\tthis._openItemSubMenu(item, true);\n\t\t}, MENU_OPEN_DELAY);\n\t}\n\n\t_itemClick(e: CustomEvent<ListItemClickEventDetail>) {\n\t\tconst item = e.detail.item as MenuItem;\n\n\t\tif (!item._popover) {\n\t\t\tconst prevented = !this.fireDecoratorEvent(\"item-click\", {\n\t\t\t\t\"item\": item,\n\t\t\t\t\"text\": item.text || \"\",\n\t\t\t});\n\n\t\t\tif (!prevented) {\n\t\t\t\titem._updateCheckedState();\n\t\t\t\tthis._popover && !item._shiftPressed && item.fireDecoratorEvent(\"close-menu\");\n\t\t\t}\n\t\t} else {\n\t\t\tthis._openItemSubMenu(item);\n\t\t}\n\t}\n\n\t_itemKeyDown(e: KeyboardEvent) {\n\t\tconst isTabNextPrevious = isTabNext(e) || isTabPrevious(e);\n\t\tconst isShowKey = isShow(e);\n\t\tconst isSplitButton = this._opener && isInstanceOfSplitButton(this._opener);\n\t\tconst item = e.target as MenuItem;\n\n\t\tif (!isInstanceOfMenuItem(item)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isEndContentNavigation = isRight(e) || isLeft(e);\n\t\tconst shouldOpenMenu = this.isRtl ? isLeft(e) : isRight(e);\n\n\t\tif (isEnter(e) || isTabNextPrevious || (isShowKey && isSplitButton)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (isEndContentNavigation) {\n\t\t\titem._navigateToEndContent(isLeft(e));\n\t\t}\n\n\t\tif (shouldOpenMenu) {\n\t\t\tthis._openItemSubMenu(item, false);\n\t\t} else if (isTabNextPrevious || (isShowKey && isSplitButton)) {\n\t\t\tthis._close();\n\t\t}\n\t}\n\n\t_navigateOutOfEndContent(e: CustomEvent) {\n\t\tconst item = e.target as MenuItem;\n\t\tconst shouldNavigateToNextItem = e.detail.shouldNavigateToNextItem;\n\t\tconst menuItems = this._allMenuItems;\n\t\tconst itemIndex = menuItems.indexOf(item);\n\n\t\tif (itemIndex > -1) {\n\t\t\tconst nextItem = shouldNavigateToNextItem ? menuItems[itemIndex + 1] : menuItems[itemIndex - 1];\n\t\t\tconst itemToFocus = nextItem || menuItems[itemIndex];\n\t\t\titemToFocus?.focus();\n\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\t_beforePopoverOpen(e: CustomEvent) {\n\t\tconst prevented = !this.fireDecoratorEvent(\"before-open\", {});\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._allMenuItems[0]?.focus();\n\t\tthis.fireDecoratorEvent(\"open\");\n\t}\n\n\t_beforePopoverClose(e: CustomEvent) {\n\t\tconst prevented = !this.fireDecoratorEvent(\"before-close\", { escPressed: e.detail.escPressed });\n\n\t\tif (prevented) {\n\t\t\tthis.open = true;\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_afterPopoverClose() {\n\t\tthis.open = false;\n\t\tthis.fireDecoratorEvent(\"close\");\n\t}\n}\n\nMenu.define();\n\nexport default Menu;\nexport type {\n\tMenuItemClickEventDetail,\n\tMenuBeforeCloseEventDetail,\n\tMenuBeforeOpenEventDetail,\n\tIMenuItem,\n};\n"]}
|
package/dist/MenuItem.d.ts
CHANGED
|
@@ -189,6 +189,7 @@ declare class MenuItem extends ListItem implements IMenuItem {
|
|
|
189
189
|
static i18nBundle: I18nBundle;
|
|
190
190
|
_itemNavigation: ItemNavigation;
|
|
191
191
|
_shiftPressed: boolean;
|
|
192
|
+
_openedByMouse: boolean;
|
|
192
193
|
constructor();
|
|
193
194
|
get _list(): List | null;
|
|
194
195
|
get _navigableItems(): Array<HTMLElement>;
|
package/dist/MenuItem.js
CHANGED
|
@@ -100,6 +100,7 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
100
100
|
*/
|
|
101
101
|
this._checkMode = "None";
|
|
102
102
|
this._shiftPressed = false;
|
|
103
|
+
this._openedByMouse = false;
|
|
103
104
|
this._itemNavigation = new ItemNavigation(this, {
|
|
104
105
|
navigationMode: NavigationMode.Horizontal,
|
|
105
106
|
behavior: ItemNavigationBehavior.Static,
|
|
@@ -266,7 +267,7 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
266
267
|
if (!isInstanceOfMenuItem(item)) {
|
|
267
268
|
return;
|
|
268
269
|
}
|
|
269
|
-
item.focus();
|
|
270
|
+
item.getFocusDomRef()?.focus();
|
|
270
271
|
this._closeOtherSubMenus(item);
|
|
271
272
|
}
|
|
272
273
|
_isSpace(e) {
|
|
@@ -336,7 +337,9 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
336
337
|
}
|
|
337
338
|
}
|
|
338
339
|
_afterPopoverOpen() {
|
|
339
|
-
this.
|
|
340
|
+
if (!this._openedByMouse) {
|
|
341
|
+
this._allMenuItems[0]?.focus();
|
|
342
|
+
}
|
|
340
343
|
this.fireDecoratorEvent("open");
|
|
341
344
|
}
|
|
342
345
|
_beforePopoverClose(e) {
|
|
@@ -354,6 +357,7 @@ let MenuItem = MenuItem_1 = class MenuItem extends ListItem {
|
|
|
354
357
|
}
|
|
355
358
|
}
|
|
356
359
|
_afterPopoverClose() {
|
|
360
|
+
this._openedByMouse = false;
|
|
357
361
|
this.fireDecoratorEvent("close");
|
|
358
362
|
}
|
|
359
363
|
get isMenuItem() {
|