@ui5/webcomponents 2.19.2 → 2.20.0-rc.1
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 +32 -4
- 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.d.ts +5 -0
- package/dist/AvatarGroup.js +17 -10
- package/dist/AvatarGroup.js.map +1 -1
- package/dist/AvatarTemplate.js +1 -1
- package/dist/AvatarTemplate.js.map +1 -1
- package/dist/Breadcrumbs.d.ts +4 -1
- package/dist/Breadcrumbs.js +4 -0
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/ColorPalette.d.ts +14 -0
- package/dist/ColorPalette.js +11 -1
- package/dist/ColorPalette.js.map +1 -1
- package/dist/ColorPalettePopover.d.ts +14 -0
- package/dist/ColorPalettePopover.js +6 -0
- package/dist/ColorPalettePopover.js.map +1 -1
- package/dist/ColorPalettePopoverTemplate.js +1 -1
- package/dist/ColorPalettePopoverTemplate.js.map +1 -1
- package/dist/ColorPaletteTemplate.js +1 -1
- package/dist/ColorPaletteTemplate.js.map +1 -1
- package/dist/ColorPicker.d.ts +14 -0
- package/dist/ColorPicker.js +11 -1
- package/dist/ColorPicker.js.map +1 -1
- package/dist/ColorPickerTemplate.js +1 -1
- package/dist/ColorPickerTemplate.js.map +1 -1
- package/dist/DateComponentBase.d.ts +2 -2
- package/dist/DateComponentBase.js +1 -1
- package/dist/DateComponentBase.js.map +1 -1
- package/dist/DatePicker.d.ts +3 -2
- package/dist/DatePicker.js +6 -3
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePickerPopoverTemplate.js +8 -4
- package/dist/DatePickerPopoverTemplate.js.map +1 -1
- package/dist/List.js +6 -0
- package/dist/List.js.map +1 -1
- package/dist/ListItemCustom.d.ts +21 -1
- package/dist/ListItemCustom.js +86 -2
- 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/MultiComboBoxPopoverTemplate.js +2 -1
- package/dist/MultiComboBoxPopoverTemplate.js.map +1 -1
- package/dist/MultiInputTemplate.js +2 -1
- package/dist/MultiInputTemplate.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/RatingIndicator.d.ts +17 -0
- package/dist/RatingIndicator.js +12 -0
- package/dist/RatingIndicator.js.map +1 -1
- package/dist/RatingIndicatorTemplate.js +6 -8
- package/dist/RatingIndicatorTemplate.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/StepInput.js +2 -2
- package/dist/StepInput.js.map +1 -1
- package/dist/Switch.js +2 -2
- package/dist/Switch.js.map +1 -1
- package/dist/TimePickerPopoverTemplate.js +2 -3
- package/dist/TimePickerPopoverTemplate.js.map +1 -1
- package/dist/Tokenizer.js +2 -2
- package/dist/Tokenizer.js.map +1 -1
- package/dist/Toolbar.d.ts +5 -2
- package/dist/Toolbar.js +29 -4
- package/dist/Toolbar.js.map +1 -1
- package/dist/ToolbarItem.d.ts +40 -1
- package/dist/ToolbarItem.js +97 -2
- package/dist/ToolbarItem.js.map +1 -1
- package/dist/ToolbarItemTemplate.d.ts +2 -0
- package/dist/ToolbarItemTemplate.js +5 -0
- package/dist/ToolbarItemTemplate.js.map +1 -0
- package/dist/ToolbarTemplate.js +9 -8
- package/dist/ToolbarTemplate.js.map +1 -1
- package/dist/bundle.esm.js +1 -0
- package/dist/bundle.esm.js.map +1 -1
- package/dist/css/themes/Avatar.css +1 -1
- package/dist/css/themes/Bar.css +1 -1
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/Panel.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/ResponsivePopoverCommon.css +1 -1
- package/dist/css/themes/TimePickerPopover.css +1 -1
- package/dist/css/themes/Toolbar.css +1 -1
- package/dist/css/themes/ToolbarItem.css +1 -0
- package/dist/css/themes/ToolbarPopover.css +1 -1
- package/dist/custom-elements-internal.json +476 -11
- package/dist/custom-elements.json +340 -7
- package/dist/features/InputSuggestionsTemplate.js +2 -1
- package/dist/features/InputSuggestionsTemplate.js.map +1 -1
- 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/i18n/i18n-defaults.d.ts +2 -2
- package/dist/generated/i18n/i18n-defaults.js +2 -2
- package/dist/generated/i18n/i18n-defaults.js.map +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/Bar.css.d.ts +1 -1
- package/dist/generated/themes/Bar.css.js +1 -1
- package/dist/generated/themes/Bar.css.js.map +1 -1
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.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/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.d.ts +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js +1 -1
- package/dist/generated/themes/ResponsivePopoverCommon.css.js.map +1 -1
- package/dist/generated/themes/TimePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/TimePickerPopover.css.js +1 -1
- package/dist/generated/themes/TimePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/Toolbar.css.d.ts +1 -1
- package/dist/generated/themes/Toolbar.css.js +1 -1
- package/dist/generated/themes/Toolbar.css.js.map +1 -1
- package/dist/generated/themes/ToolbarItem.css.d.ts +2 -0
- package/dist/generated/themes/ToolbarItem.css.js +8 -0
- package/dist/generated/themes/ToolbarItem.css.js.map +1 -0
- package/dist/generated/themes/ToolbarPopover.css.d.ts +1 -1
- package/dist/generated/themes/ToolbarPopover.css.js +1 -1
- package/dist/generated/themes/ToolbarPopover.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 +64 -14
- package/dist/web-types.json +234 -19
- package/package.json +10 -10
- package/src/AvatarTemplate.tsx +1 -0
- package/src/ColorPalettePopoverTemplate.tsx +3 -0
- package/src/ColorPaletteTemplate.tsx +1 -1
- package/src/ColorPickerTemplate.tsx +2 -2
- package/src/DatePickerPopoverTemplate.tsx +21 -10
- package/src/ListItemGroupTemplate.tsx +9 -3
- package/src/MultiComboBoxPopoverTemplate.tsx +8 -1
- package/src/MultiInputTemplate.tsx +2 -1
- package/src/PanelTemplate.tsx +2 -0
- package/src/RatingIndicatorTemplate.tsx +10 -10
- package/src/TimePickerPopoverTemplate.tsx +1 -9
- package/src/ToolbarItemTemplate.tsx +7 -0
- package/src/ToolbarTemplate.tsx +9 -16
- package/src/features/InputSuggestionsTemplate.tsx +9 -2
- package/src/i18n/messagebundle.properties +5 -5
- 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 +17 -11
- package/src/i18n/messagebundle_en_US_saprigi.properties +17 -11
- package/src/i18n/messagebundle_en_US_saptrc.properties +17 -11
- 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/Bar.css +1 -1
- package/src/themes/DatePickerPopover.css +24 -1
- package/src/themes/Panel.css +5 -1
- package/src/themes/RatingIndicator.css +26 -12
- package/src/themes/ResponsivePopoverCommon.css +1 -1
- package/src/themes/TimePickerPopover.css +7 -0
- package/src/themes/Toolbar.css +11 -3
- package/src/themes/ToolbarItem.css +8 -0
- package/src/themes/ToolbarPopover.css +1 -1
package/dist/Avatar.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type Icon from "./Icon.js";
|
|
|
9
9
|
import AvatarSize from "./types/AvatarSize.js";
|
|
10
10
|
import type AvatarShape from "./types/AvatarShape.js";
|
|
11
11
|
import type AvatarColorScheme from "./types/AvatarColorScheme.js";
|
|
12
|
+
import AvatarMode from "./types/AvatarMode.js";
|
|
12
13
|
import "@ui5/webcomponents-icons/dist/employee.js";
|
|
13
14
|
type AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup">;
|
|
14
15
|
/**
|
|
@@ -23,7 +24,7 @@ type AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup">;
|
|
|
23
24
|
*
|
|
24
25
|
* ### Keyboard Handling
|
|
25
26
|
*
|
|
26
|
-
* - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true.
|
|
27
|
+
* - [Space] / [Enter] or [Return] - Fires the `click` event if the `mode` is set to `Interactive` or the deprecated `interactive` property is set to true.
|
|
27
28
|
* - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.
|
|
28
29
|
*
|
|
29
30
|
* ### ES6 Module Import
|
|
@@ -49,12 +50,31 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
49
50
|
/**
|
|
50
51
|
* Defines if the avatar is interactive (focusable and pressable).
|
|
51
52
|
*
|
|
53
|
+
* **Note:** When set to `true`, this property takes precedence over the `mode` property,
|
|
54
|
+
* and the avatar will be rendered as interactive (role="button", focusable) regardless of the `mode` value.
|
|
55
|
+
*
|
|
52
56
|
* **Note:** This property won't have effect if the `disabled`
|
|
53
57
|
* property is set to `true`.
|
|
54
58
|
* @default false
|
|
55
59
|
* @public
|
|
60
|
+
* @deprecated Set `mode="Interactive"` instead for the same functionality with proper accessibility.
|
|
56
61
|
*/
|
|
57
62
|
interactive: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Defines the mode of the component.
|
|
65
|
+
*
|
|
66
|
+
* **Note:**
|
|
67
|
+
* - `Image` (default) - renders with role="img"
|
|
68
|
+
* - `Decorative` - renders with role="presentation" and aria-hidden="true", making it purely decorative
|
|
69
|
+
* - `Interactive` - renders with role="button", focusable (tabindex="0"), and supports keyboard interaction
|
|
70
|
+
*
|
|
71
|
+
* **Note:** This property is ignored when the `interactive` property is set to `true`.
|
|
72
|
+
* In that case, the avatar will always be rendered as interactive.
|
|
73
|
+
* @default "Image"
|
|
74
|
+
* @public
|
|
75
|
+
* @since 2.20
|
|
76
|
+
*/
|
|
77
|
+
mode: `${AvatarMode}`;
|
|
58
78
|
/**
|
|
59
79
|
* Defines the name of the UI5 Icon, that will be displayed.
|
|
60
80
|
*
|
|
@@ -193,7 +213,8 @@ declare class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
|
|
|
193
213
|
* @private
|
|
194
214
|
*/
|
|
195
215
|
get effectiveBackgroundColor(): AvatarColorScheme;
|
|
196
|
-
get _role(): "button" | "img";
|
|
216
|
+
get _role(): "button" | "presentation" | "img";
|
|
217
|
+
get effectiveAriaHidden(): "true" | undefined;
|
|
197
218
|
get _ariaHasPopup(): import("@ui5/webcomponents-base/dist/types.js").AriaHasPopup | undefined;
|
|
198
219
|
get _interactive(): boolean;
|
|
199
220
|
get validInitials(): string | null | undefined;
|
package/dist/Avatar.js
CHANGED
|
@@ -22,6 +22,7 @@ import { AVATAR_TOOLTIP, AVATAR_TYPE_BUTTON, AVATAR_TYPE_IMAGE, } from "./genera
|
|
|
22
22
|
// Styles
|
|
23
23
|
import AvatarCss from "./generated/themes/Avatar.css.js";
|
|
24
24
|
import AvatarSize from "./types/AvatarSize.js";
|
|
25
|
+
import AvatarMode from "./types/AvatarMode.js";
|
|
25
26
|
// Icon
|
|
26
27
|
import "@ui5/webcomponents-icons/dist/employee.js";
|
|
27
28
|
/**
|
|
@@ -36,7 +37,7 @@ import "@ui5/webcomponents-icons/dist/employee.js";
|
|
|
36
37
|
*
|
|
37
38
|
* ### Keyboard Handling
|
|
38
39
|
*
|
|
39
|
-
* - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true.
|
|
40
|
+
* - [Space] / [Enter] or [Return] - Fires the `click` event if the `mode` is set to `Interactive` or the deprecated `interactive` property is set to true.
|
|
40
41
|
* - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.
|
|
41
42
|
*
|
|
42
43
|
* ### ES6 Module Import
|
|
@@ -61,12 +62,31 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
61
62
|
/**
|
|
62
63
|
* Defines if the avatar is interactive (focusable and pressable).
|
|
63
64
|
*
|
|
65
|
+
* **Note:** When set to `true`, this property takes precedence over the `mode` property,
|
|
66
|
+
* and the avatar will be rendered as interactive (role="button", focusable) regardless of the `mode` value.
|
|
67
|
+
*
|
|
64
68
|
* **Note:** This property won't have effect if the `disabled`
|
|
65
69
|
* property is set to `true`.
|
|
66
70
|
* @default false
|
|
67
71
|
* @public
|
|
72
|
+
* @deprecated Set `mode="Interactive"` instead for the same functionality with proper accessibility.
|
|
68
73
|
*/
|
|
69
74
|
this.interactive = false;
|
|
75
|
+
/**
|
|
76
|
+
* Defines the mode of the component.
|
|
77
|
+
*
|
|
78
|
+
* **Note:**
|
|
79
|
+
* - `Image` (default) - renders with role="img"
|
|
80
|
+
* - `Decorative` - renders with role="presentation" and aria-hidden="true", making it purely decorative
|
|
81
|
+
* - `Interactive` - renders with role="button", focusable (tabindex="0"), and supports keyboard interaction
|
|
82
|
+
*
|
|
83
|
+
* **Note:** This property is ignored when the `interactive` property is set to `true`.
|
|
84
|
+
* In that case, the avatar will always be rendered as interactive.
|
|
85
|
+
* @default "Image"
|
|
86
|
+
* @public
|
|
87
|
+
* @since 2.20
|
|
88
|
+
*/
|
|
89
|
+
this.mode = "Image";
|
|
70
90
|
/**
|
|
71
91
|
* Defines the name of the fallback icon, which should be displayed in the following cases:
|
|
72
92
|
*
|
|
@@ -164,13 +184,26 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
164
184
|
return this.getAttribute("color-scheme") || this._colorScheme;
|
|
165
185
|
}
|
|
166
186
|
get _role() {
|
|
167
|
-
|
|
187
|
+
if (this._interactive) {
|
|
188
|
+
return "button";
|
|
189
|
+
}
|
|
190
|
+
if (this.mode === AvatarMode.Decorative) {
|
|
191
|
+
return "presentation";
|
|
192
|
+
}
|
|
193
|
+
return "img";
|
|
194
|
+
}
|
|
195
|
+
get effectiveAriaHidden() {
|
|
196
|
+
// interactive property takes precedence - never hidden when interactive
|
|
197
|
+
if (this.interactive) {
|
|
198
|
+
return undefined;
|
|
199
|
+
}
|
|
200
|
+
return this.mode === AvatarMode.Decorative ? "true" : undefined;
|
|
168
201
|
}
|
|
169
202
|
get _ariaHasPopup() {
|
|
170
203
|
return this._getAriaHasPopup();
|
|
171
204
|
}
|
|
172
205
|
get _interactive() {
|
|
173
|
-
return this.interactive && !this.disabled;
|
|
206
|
+
return (this.interactive || this.mode === AvatarMode.Interactive) && !this.disabled;
|
|
174
207
|
}
|
|
175
208
|
get validInitials() {
|
|
176
209
|
// initials should consist of only 1,2 or 3 latin letters
|
|
@@ -263,6 +296,7 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
263
296
|
}
|
|
264
297
|
_getAriaHasPopup() {
|
|
265
298
|
const ariaHaspopup = this.accessibilityAttributes.hasPopup;
|
|
299
|
+
// aria-haspopup only applies when avatar is interactive
|
|
266
300
|
if (!this._interactive || !ariaHaspopup) {
|
|
267
301
|
return;
|
|
268
302
|
}
|
|
@@ -324,7 +358,7 @@ let Avatar = Avatar_1 = class Avatar extends UI5Element {
|
|
|
324
358
|
get accessibilityInfo() {
|
|
325
359
|
return {
|
|
326
360
|
role: this._role,
|
|
327
|
-
type: this.
|
|
361
|
+
type: this._interactive ? Avatar_1.i18nBundle.getText(AVATAR_TYPE_BUTTON) : Avatar_1.i18nBundle.getText(AVATAR_TYPE_IMAGE),
|
|
328
362
|
description: this.accessibleNameText,
|
|
329
363
|
disabled: this.disabled,
|
|
330
364
|
};
|
|
@@ -336,6 +370,9 @@ __decorate([
|
|
|
336
370
|
__decorate([
|
|
337
371
|
property({ type: Boolean })
|
|
338
372
|
], Avatar.prototype, "interactive", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
property()
|
|
375
|
+
], Avatar.prototype, "mode", void 0);
|
|
339
376
|
__decorate([
|
|
340
377
|
property()
|
|
341
378
|
], Avatar.prototype, "icon", void 0);
|
package/dist/Avatar.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.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,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAI/E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEnE,WAAW;AACX,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAE3C,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAGzD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAI/C,OAAO;AACP,OAAO,2CAA2C,CAAC;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;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;GACI,MAAM,CA4aX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { Slot, 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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { AccessibilityAttributes, AriaRole } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type { IAvatarGroupItem } from \"./AvatarGroup.js\";\n// Template\nimport AvatarTemplate from \"./AvatarTemplate.js\";\n\nimport {\n\tAVATAR_TOOLTIP,\n\tAVATAR_TYPE_BUTTON,\n\tAVATAR_TYPE_IMAGE,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport type Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport type AvatarShape from \"./types/AvatarShape.js\";\nimport type AvatarColorScheme from \"./types/AvatarColorScheme.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\ntype AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\n/**\n * @class\n * ### Overview\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * ### Keyboard Handling\n *\n * - [Space] / [Enter] or [Return] - Fires the `click` event if the `interactive` property is set to true.\n * - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/Avatar.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @implements {IAvatarGroupItem}\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n})\n/**\n * Fired on mouseup, space and enter if avatar is interactive\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {\n\teventDetails!: {\n\t\tclick: void,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t *\n\t * **Note:** This property won't have effect if the `disabled`\n\t * property is set to `true`.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t *\n\t * **Note:** If `image` slot is provided, the property will be ignored.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar icon=\"employee\">`\n\t *\n\t * **Note:** If no icon or an empty one is provided, by default the \"employee\" icon should be displayed.\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the name of the fallback icon, which should be displayed in the following cases:\n\t *\n\t * \t- If the initials are not valid (more than 3 letters, unsupported languages or empty initials).\n\t * \t- If there are three initials and they do not fit in the shape (e.g. WWW for some of the sizes).\n\t * \t- If the image src is wrong.\n\t *\n\t * **Note:** If not set, a default fallback icon \"employee\" is displayed.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"fallback-icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar fallback-icon=\"alert\">`\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default \"employee\"\n\t * @public\n\t */\n\t@property()\n\tfallbackIcon = \"employee\";\n\n\t/**\n\t * Defines the displayed initials.\n\t *\n\t * Up to three Latin letters can be displayed as initials.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tinitials?: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * @default \"Circle\"\n\t * @public\n\t */\n\t@property()\n\tshape: `${AvatarShape}` = \"Circle\";\n\n\t/**\n\t * Defines predefined size of the component.\n\t * @default \"S\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${AvatarSize}` = \"S\";\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * If `colorScheme` is set to `Auto`, the avatar will be displayed with the `Accent6` color.\n\t *\n\t * @default \"Auto\"\n\t * @public\n\t */\n\t@property()\n\tcolorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * @private\n\t */\n\t@property()\n\t_colorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * 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.7\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarAccessibilityAttributes = {};\n\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasImage = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_imageLoadError = false;\n\n\t/**\n\t * Receives the desired `<img>` tag\n\t *\n\t * **Note:** If you experience flickering of the provided image, you can hide the component until it is defined with the following CSS:<br/>\n\t * `ui5-avatar:not(:defined) {`<br/>\n\t * `visibility: hidden;`<br/>\n\t * `}`\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: DefaultSlot<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t *\n\t * **Note:** While the slot allows for custom badges, to achieve\n\t * the Fiori design, use the `ui5-avatar-badge` component.\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Slot<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_handleResizeBound: ResizeObserverCallback;\n\t_onImageLoadBound: (e: Event) => void;\n\t_onImageErrorBound: (e: Event) => void;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._handleResizeBound = this.handleResize.bind(this);\n\t\tthis._onImageLoadBound = this._onImageLoad.bind(this);\n\t\tthis._onImageErrorBound = this._onImageError.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._attachImageEventHandlers();\n\t\tthis._hasImage = this.hasImage;\n\t}\n\n\tget tabindex() {\n\t\tif (this.forcedTabIndex) {\n\t\t\treturn parseInt(this.forcedTabIndex);\n\t\t}\n\t\treturn this._interactive ? 0 : undefined;\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @default \"S\"\n\t * @private\n\t */\n\tget effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || AvatarSize.S;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @default \"Auto\"\n\t * @private\n\t */\n\tget effectiveBackgroundColor(): AvatarColorScheme {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") as AvatarColorScheme || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\treturn this._interactive ? \"button\" : \"img\";\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget _interactive() {\n\t\treturn this.interactive && !this.disabled;\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\tconst defaultLabel = Avatar.i18nBundle.getText(AVATAR_TOOLTIP);\n\n\t\treturn this.initials ? `${defaultLabel} ${this.initials}`.trim() : defaultLabel;\n\t}\n\n\tget hasImage() {\n\t\treturn !!this.image.length && !this._imageLoadError;\n\t}\n\n\tget imageEl(): HTMLImageElement | null {\n\t\treturn this.image?.[0] instanceof HTMLImageElement ? this.image[0] : null;\n\t}\n\n\tget initialsContainer(): HTMLObjectElement | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-initials\");\n\t}\n\n\tget fallBackIconDomRef(): Icon | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-icon-fallback\");\n\t}\n\n\tasync onAfterRendering() {\n\t\tawait renderFinished();\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tthis.initialsContainer && ResizeHandler.register(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\t}\n\n\tonExitDOM() {\n\t\tthis.initialsContainer && ResizeHandler.deregister(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\n\t\tthis._detachImageEventHandlers();\n\t}\n\n\thandleResize() {\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!;\n\t\tconst avatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\tconst validInitials = this.validInitials && avatarInitials && avatarInitials.scrollWidth <= avatar.scrollWidth;\n\n\t\tif (validInitials) {\n\t\t\tthis.showInitials();\n\t\t\treturn;\n\t\t}\n\t\tthis.showFallbackIcon();\n\t}\n\n\tshowFallbackIcon() {\n\t\tthis.initialsContainer?.classList.add(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.remove(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\tshowInitials() {\n\t\tthis.initialsContainer?.classList.remove(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.add(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._fireClick();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\t}\n\n\t_fireClick() {\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_getAriaHasPopup() {\n\t\tconst ariaHaspopup = this.accessibilityAttributes.hasPopup;\n\n\t\tif (!this._interactive || !ariaHaspopup) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn ariaHaspopup;\n\t}\n\n\t_attachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove previous handlers to avoid duplicates\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Attach new handlers\n\t\timgEl.addEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.addEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Check existing image state\n\t\tthis._checkExistingImageState();\n\t}\n\n\t_checkExistingImageState() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (imgEl.complete && imgEl.naturalWidth === 0) {\n\t\t\tthis._imageLoadError = true; // Already broken\n\t\t} else if (imgEl.complete && imgEl.naturalWidth > 0) {\n\t\t\tthis._imageLoadError = false; // Already loaded\n\t\t} else {\n\t\t\tthis._imageLoadError = false; // Pending load\n\t\t}\n\t}\n\n\t_detachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\treturn;\n\t\t}\n\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\t}\n\n\t_onImageLoad(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"load\", this._onImageLoadBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = false;\n\t}\n\n\t_onImageError(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"error\", this._onImageErrorBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = true;\n\t}\n\n\tget accessibilityInfo() {\n\t\treturn {\n\t\t\trole: this._role as AriaRole,\n\t\t\ttype: this.interactive ? Avatar.i18nBundle.getText(AVATAR_TYPE_BUTTON) : Avatar.i18nBundle.getText(AVATAR_TYPE_IMAGE),\n\t\t\tdescription: this.accessibleNameText,\n\t\t\tdisabled: this.disabled,\n\t\t};\n\t}\n}\n\nAvatar.define();\n\nexport default Avatar;\nexport type {\n\tAvatarAccessibilityAttributes,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.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,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAI/E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,OA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AAE;oCACqB;AAoBhC;IADC,QAAQ,EAAE;oCACG;AAsBd;IADC,QAAQ,EAAE;4CACe;AAU1B;IADC,QAAQ,EAAE;wCACO;AAQlB;IADC,QAAQ,EAAE;qCACwB;AAQnC;IADC,QAAQ,EAAE;oCACiB;AAU5B;IADC,QAAQ,EAAE;2CACkC;AAM7C;IADC,QAAQ,EAAE;4CACmC;AAU9C;IADC,QAAQ,EAAE;8CACa;AAcxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDACiC;AAG5D;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;8CACR;AAMxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACV;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;+CACvB;AAaxB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCACZ;AAWjC;IADC,IAAI,EAAE;qCACmB;AAGnB;IADN,IAAI,CAAC,oBAAoB,CAAC;gCACG;AAlMzB,MAAM;IAlBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;KACxB,CAAC;IACF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;KACb,CAAC;GACI,MAAM,CAgdX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { Slot, 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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport type { AccessibilityAttributes, AriaRole } from \"@ui5/webcomponents-base/dist/types.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport type { ResizeObserverCallback } from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport { renderFinished } from \"@ui5/webcomponents-base/dist/Render.js\";\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type { IAvatarGroupItem } from \"./AvatarGroup.js\";\n// Template\nimport AvatarTemplate from \"./AvatarTemplate.js\";\n\nimport {\n\tAVATAR_TOOLTIP,\n\tAVATAR_TYPE_BUTTON,\n\tAVATAR_TYPE_IMAGE,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport type Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport type AvatarShape from \"./types/AvatarShape.js\";\nimport type AvatarColorScheme from \"./types/AvatarColorScheme.js\";\nimport AvatarMode from \"./types/AvatarMode.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\ntype AvatarAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\n/**\n * @class\n * ### Overview\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * ### Keyboard Handling\n *\n * - [Space] / [Enter] or [Return] - Fires the `click` event if the `mode` is set to `Interactive` or the deprecated `interactive` property is set to true.\n * - [Shift] - If [Space] is pressed, pressing [Shift] releases the component without triggering the click event.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/Avatar.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @implements {IAvatarGroupItem}\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n})\n/**\n * Fired on mouseup, space and enter if avatar is interactive\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n * @since 2.11.0\n */\n@event(\"click\", {\n\tbubbles: true,\n})\nclass Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {\n\teventDetails!: {\n\t\tclick: void,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t *\n\t * **Note:** When set to `true`, this property takes precedence over the `mode` property,\n\t * and the avatar will be rendered as interactive (role=\"button\", focusable) regardless of the `mode` value.\n\t *\n\t * **Note:** This property won't have effect if the `disabled`\n\t * property is set to `true`.\n\t * @default false\n\t * @public\n\t * @deprecated Set `mode=\"Interactive\"` instead for the same functionality with proper accessibility.\n\t */\n\t@property({ type: Boolean })\n\tinteractive = false;\n\n\t/**\n\t * Defines the mode of the component.\n\t *\n\t * **Note:**\n\t * - `Image` (default) - renders with role=\"img\"\n\t * - `Decorative` - renders with role=\"presentation\" and aria-hidden=\"true\", making it purely decorative\n\t * - `Interactive` - renders with role=\"button\", focusable (tabindex=\"0\"), and supports keyboard interaction\n\t *\n\t * **Note:** This property is ignored when the `interactive` property is set to `true`.\n\t * In that case, the avatar will always be rendered as interactive.\n\t * @default \"Image\"\n\t * @public\n\t * @since 2.20\n\t */\n\t@property()\n\tmode: `${AvatarMode}` = \"Image\";\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t *\n\t * **Note:** If `image` slot is provided, the property will be ignored.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar icon=\"employee\">`\n\t *\n\t * **Note:** If no icon or an empty one is provided, by default the \"employee\" icon should be displayed.\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string;\n\n\t/**\n\t * Defines the name of the fallback icon, which should be displayed in the following cases:\n\t *\n\t * \t- If the initials are not valid (more than 3 letters, unsupported languages or empty initials).\n\t * \t- If there are three initials and they do not fit in the shape (e.g. WWW for some of the sizes).\n\t * \t- If the image src is wrong.\n\t *\n\t * **Note:** If not set, a default fallback icon \"employee\" is displayed.\n\t *\n\t * **Note:** You should import the desired icon first, then use its name as \"fallback-icon\".\n\t *\n\t * `import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"`\n\t *\n\t * `<ui5-avatar fallback-icon=\"alert\">`\n\t *\n\t * See all the available icons in the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default \"employee\"\n\t * @public\n\t */\n\t@property()\n\tfallbackIcon = \"employee\";\n\n\t/**\n\t * Defines the displayed initials.\n\t *\n\t * Up to three Latin letters can be displayed as initials.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tinitials?: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * @default \"Circle\"\n\t * @public\n\t */\n\t@property()\n\tshape: `${AvatarShape}` = \"Circle\";\n\n\t/**\n\t * Defines predefined size of the component.\n\t * @default \"S\"\n\t * @public\n\t */\n\t@property()\n\tsize: `${AvatarSize}` = \"S\";\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * If `colorScheme` is set to `Auto`, the avatar will be displayed with the `Accent6` color.\n\t *\n\t * @default \"Auto\"\n\t * @public\n\t */\n\t@property()\n\tcolorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * @private\n\t */\n\t@property()\n\t_colorScheme: `${AvatarColorScheme}` = \"Auto\";\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * 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.7\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarAccessibilityAttributes = {};\n\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_hasImage = false;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean, noAttribute: true })\n\t_imageLoadError = false;\n\n\t/**\n\t * Receives the desired `<img>` tag\n\t *\n\t * **Note:** If you experience flickering of the provided image, you can hide the component until it is defined with the following CSS:<br/>\n\t * `ui5-avatar:not(:defined) {`<br/>\n\t * `visibility: hidden;`<br/>\n\t * `}`\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: DefaultSlot<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t *\n\t * **Note:** While the slot allows for custom badges, to achieve\n\t * the Fiori design, use the `ui5-avatar-badge` component.\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Slot<HTMLElement>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_handleResizeBound: ResizeObserverCallback;\n\t_onImageLoadBound: (e: Event) => void;\n\t_onImageErrorBound: (e: Event) => void;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._handleResizeBound = this.handleResize.bind(this);\n\t\tthis._onImageLoadBound = this._onImageLoad.bind(this);\n\t\tthis._onImageErrorBound = this._onImageError.bind(this);\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._attachImageEventHandlers();\n\t\tthis._hasImage = this.hasImage;\n\t}\n\n\tget tabindex() {\n\t\tif (this.forcedTabIndex) {\n\t\t\treturn parseInt(this.forcedTabIndex);\n\t\t}\n\t\treturn this._interactive ? 0 : undefined;\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @default \"S\"\n\t * @private\n\t */\n\tget effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || AvatarSize.S;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @default \"Auto\"\n\t * @private\n\t */\n\tget effectiveBackgroundColor(): AvatarColorScheme {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") as AvatarColorScheme || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\tif (this._interactive) {\n\t\t\treturn \"button\";\n\t\t}\n\t\tif (this.mode === AvatarMode.Decorative) {\n\t\t\treturn \"presentation\";\n\t\t}\n\t\treturn \"img\";\n\t}\n\n\tget effectiveAriaHidden() {\n\t\t// interactive property takes precedence - never hidden when interactive\n\t\tif (this.interactive) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn this.mode === AvatarMode.Decorative ? \"true\" : undefined;\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget _interactive() {\n\t\treturn (this.interactive || this.mode === AvatarMode.Interactive) && !this.disabled;\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\tconst defaultLabel = Avatar.i18nBundle.getText(AVATAR_TOOLTIP);\n\n\t\treturn this.initials ? `${defaultLabel} ${this.initials}`.trim() : defaultLabel;\n\t}\n\n\tget hasImage() {\n\t\treturn !!this.image.length && !this._imageLoadError;\n\t}\n\n\tget imageEl(): HTMLImageElement | null {\n\t\treturn this.image?.[0] instanceof HTMLImageElement ? this.image[0] : null;\n\t}\n\n\tget initialsContainer(): HTMLObjectElement | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-initials\");\n\t}\n\n\tget fallBackIconDomRef(): Icon | null {\n\t\treturn this.getDomRef()!.querySelector(\".ui5-avatar-icon-fallback\");\n\t}\n\n\tasync onAfterRendering() {\n\t\tawait renderFinished();\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tthis.initialsContainer && ResizeHandler.register(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\t}\n\n\tonExitDOM() {\n\t\tthis.initialsContainer && ResizeHandler.deregister(this.initialsContainer,\n\t\t\tthis._handleResizeBound);\n\n\t\tthis._detachImageEventHandlers();\n\t}\n\n\thandleResize() {\n\t\tif (this.initials && !this.icon) {\n\t\t\tthis._checkInitials();\n\t\t}\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!;\n\t\tconst avatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\tconst validInitials = this.validInitials && avatarInitials && avatarInitials.scrollWidth <= avatar.scrollWidth;\n\n\t\tif (validInitials) {\n\t\t\tthis.showInitials();\n\t\t\treturn;\n\t\t}\n\t\tthis.showFallbackIcon();\n\t}\n\n\tshowFallbackIcon() {\n\t\tthis.initialsContainer?.classList.add(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.remove(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\tshowInitials() {\n\t\tthis.initialsContainer?.classList.remove(\"ui5-avatar-initials-hidden\");\n\t\tthis.fallBackIconDomRef?.classList.add(\"ui5-avatar-fallback-icon-hidden\");\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._fireClick();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this._interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this._interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis._fireClick();\n\t\t}\n\t}\n\n\t_fireClick() {\n\t\tthis.fireDecoratorEvent(\"click\");\n\t}\n\n\t_getAriaHasPopup() {\n\t\tconst ariaHaspopup = this.accessibilityAttributes.hasPopup;\n\n\t\t// aria-haspopup only applies when avatar is interactive\n\t\tif (!this._interactive || !ariaHaspopup) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn ariaHaspopup;\n\t}\n\n\t_attachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove previous handlers to avoid duplicates\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Attach new handlers\n\t\timgEl.addEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.addEventListener(\"error\", this._onImageErrorBound);\n\n\t\t// Check existing image state\n\t\tthis._checkExistingImageState();\n\t}\n\n\t_checkExistingImageState() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\tthis._imageLoadError = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif (imgEl.complete && imgEl.naturalWidth === 0) {\n\t\t\tthis._imageLoadError = true; // Already broken\n\t\t} else if (imgEl.complete && imgEl.naturalWidth > 0) {\n\t\t\tthis._imageLoadError = false; // Already loaded\n\t\t} else {\n\t\t\tthis._imageLoadError = false; // Pending load\n\t\t}\n\t}\n\n\t_detachImageEventHandlers() {\n\t\tconst imgEl = this.imageEl;\n\t\tif (!imgEl) {\n\t\t\treturn;\n\t\t}\n\n\t\timgEl.removeEventListener(\"load\", this._onImageLoadBound);\n\t\timgEl.removeEventListener(\"error\", this._onImageErrorBound);\n\t}\n\n\t_onImageLoad(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"load\", this._onImageLoadBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = false;\n\t}\n\n\t_onImageError(e: Event) {\n\t\tif (e.target !== this.imageEl) {\n\t\t\t(e.target as HTMLImageElement)?.removeEventListener(\"error\", this._onImageErrorBound);\n\t\t\treturn;\n\t\t}\n\t\tthis._imageLoadError = true;\n\t}\n\n\tget accessibilityInfo() {\n\t\treturn {\n\t\t\trole: this._role as AriaRole,\n\t\t\ttype: this._interactive ? Avatar.i18nBundle.getText(AVATAR_TYPE_BUTTON) : Avatar.i18nBundle.getText(AVATAR_TYPE_IMAGE),\n\t\t\tdescription: this.accessibleNameText,\n\t\t\tdisabled: this.disabled,\n\t\t};\n\t}\n}\n\nAvatar.define();\n\nexport default Avatar;\nexport type {\n\tAvatarAccessibilityAttributes,\n};\n"]}
|
package/dist/AvatarGroup.d.ts
CHANGED
|
@@ -158,6 +158,11 @@ declare class AvatarGroup extends UI5Element {
|
|
|
158
158
|
_colorIndex: number;
|
|
159
159
|
_hiddenItems: number;
|
|
160
160
|
_itemNavigation: ItemNavigation;
|
|
161
|
+
/**
|
|
162
|
+
* Returns the actual avatar items, handling transitive slotting.
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
get _slottedItems(): IAvatarGroupItem[];
|
|
161
166
|
constructor();
|
|
162
167
|
/**
|
|
163
168
|
* Returns an array containing the `ui5-avatar` instances that are currently not displayed due to lack of space.
|
package/dist/AvatarGroup.js
CHANGED
|
@@ -112,6 +112,13 @@ const offsets = {
|
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
114
|
let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
115
|
+
/**
|
|
116
|
+
* Returns the actual avatar items, handling transitive slotting.
|
|
117
|
+
* @private
|
|
118
|
+
*/
|
|
119
|
+
get _slottedItems() {
|
|
120
|
+
return this.getSlottedNodes("items");
|
|
121
|
+
}
|
|
115
122
|
constructor() {
|
|
116
123
|
super();
|
|
117
124
|
/**
|
|
@@ -136,7 +143,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
136
143
|
this._hiddenItems = 0;
|
|
137
144
|
this._itemNavigation = new ItemNavigation(this, {
|
|
138
145
|
getItemsCallback: () => {
|
|
139
|
-
return this._isGroup ? [] : this.
|
|
146
|
+
return this._isGroup ? [] : this._slottedItems.slice(0, this._hiddenStartIndex);
|
|
140
147
|
},
|
|
141
148
|
});
|
|
142
149
|
this._onResizeHandler = this._onResize.bind(this);
|
|
@@ -147,7 +154,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
147
154
|
* @public
|
|
148
155
|
*/
|
|
149
156
|
get hiddenItems() {
|
|
150
|
-
return this.
|
|
157
|
+
return this._slottedItems.slice(this._hiddenStartIndex);
|
|
151
158
|
}
|
|
152
159
|
/**
|
|
153
160
|
* Returns an array containing the `AvatarColorScheme` values that correspond to the avatars in the component.
|
|
@@ -155,7 +162,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
155
162
|
* @public
|
|
156
163
|
*/
|
|
157
164
|
get colorScheme() {
|
|
158
|
-
return this.
|
|
165
|
+
return this._slottedItems.map(avatar => avatar.effectiveBackgroundColor);
|
|
159
166
|
}
|
|
160
167
|
get _customOverflowButton() {
|
|
161
168
|
return this.overflowButton.length ? this.overflowButton[0] : undefined;
|
|
@@ -205,7 +212,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
205
212
|
return this.type === AvatarGroupType.Group;
|
|
206
213
|
}
|
|
207
214
|
get _itemsCount() {
|
|
208
|
-
return this.
|
|
215
|
+
return this._slottedItems.length;
|
|
209
216
|
}
|
|
210
217
|
get _groupTabIndex() {
|
|
211
218
|
return this._isGroup ? 0 : -1;
|
|
@@ -228,7 +235,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
228
235
|
return 0;
|
|
229
236
|
}
|
|
230
237
|
if (this._isGroup) {
|
|
231
|
-
let item = this.
|
|
238
|
+
let item = this._slottedItems[1];
|
|
232
239
|
const ltrEffectiveWidth = item.offsetLeft - this.offsetLeft;
|
|
233
240
|
// in some cases when second avatar is overflowed the offset of the button is the right one
|
|
234
241
|
if (!item || item.hidden) {
|
|
@@ -239,7 +246,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
239
246
|
return button.offsetWidth;
|
|
240
247
|
}
|
|
241
248
|
get firstAvatarSize() {
|
|
242
|
-
return this.
|
|
249
|
+
return this._slottedItems[0]?.size ?? AvatarSize.S;
|
|
243
250
|
}
|
|
244
251
|
onAfterRendering() {
|
|
245
252
|
this._overflowItems();
|
|
@@ -314,7 +321,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
314
321
|
*/
|
|
315
322
|
_prepareAvatars() {
|
|
316
323
|
this._colorIndex = 0;
|
|
317
|
-
this.
|
|
324
|
+
this._slottedItems.forEach((avatar, index) => {
|
|
318
325
|
const colorIndex = this._getNextBackgroundColor();
|
|
319
326
|
avatar.interactive = !this._isGroup;
|
|
320
327
|
if (avatar.getAttribute("_color-scheme") === AvatarColorScheme.Auto) {
|
|
@@ -362,14 +369,14 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
362
369
|
* @private
|
|
363
370
|
*/
|
|
364
371
|
_overflowItems() {
|
|
365
|
-
if (this.
|
|
372
|
+
if (this._slottedItems.length < 2) {
|
|
366
373
|
// no need to overflow avatars
|
|
367
374
|
this._setHiddenItems(0);
|
|
368
375
|
return;
|
|
369
376
|
}
|
|
370
377
|
let hiddenItems = 0;
|
|
371
378
|
for (let index = 0; index < this._itemsCount; index++) {
|
|
372
|
-
const item = this.
|
|
379
|
+
const item = this._slottedItems[index];
|
|
373
380
|
// show item to determine if it will fit the new container size
|
|
374
381
|
item.hidden = false;
|
|
375
382
|
// container width to current item + item width (avatar)
|
|
@@ -396,7 +403,7 @@ let AvatarGroup = AvatarGroup_1 = class AvatarGroup extends UI5Element {
|
|
|
396
403
|
_setHiddenItems(hiddenItems) {
|
|
397
404
|
const shouldFireEvent = this._hiddenItems !== hiddenItems;
|
|
398
405
|
this._hiddenItems = hiddenItems;
|
|
399
|
-
this.
|
|
406
|
+
this._slottedItems.forEach((item, index) => {
|
|
400
407
|
item.hidden = index >= this._hiddenStartIndex;
|
|
401
408
|
});
|
|
402
409
|
this._overflowButtonText = `+${hiddenItems > 99 ? 99 : hiddenItems}`;
|
package/dist/AvatarGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.js","sourceRoot":"","sources":["../src/AvatarGroup.ts"],"names":[],"mappings":";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A;IADC,QAAQ,EAAE;yCACyB;AAcpC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DACsC;AAMjE;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;wDACH;AAU7B;IADC,QAAQ,EAAE;mDACa;AAUxB;IADC,QAAQ,EAAE;sDACgB;AAY3B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;0CACP;AAYtC;IADC,IAAI,EAAE;mDACwB;AAGxB;IADN,IAAI,CAAC,oBAAoB,CAAC;qCACG;AApFzB,WAAW;IAvBhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;IACF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,CAAC;IAEf;;;;;OAKG;;IACF,KAAK,CAAC,UAAU,CAAC;GACZ,WAAW,CA+ahB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ItemNavigation from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\nimport {\n\tisEnter,\n\tisSpace,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type Button from \"./Button.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport AvatarGroupType from \"./types/AvatarGroupType.js\";\nimport AvatarColorScheme from \"./types/AvatarColorScheme.js\";\nimport type { IButton } from \"./Button.js\";\n\nimport {\n\tAVATAR_GROUP_DISPLAYED_HIDDEN_LABEL,\n\tAVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL,\n\tAVATAR_GROUP_ARIA_LABEL_INDIVIDUAL,\n\tAVATAR_GROUP_ARIA_LABEL_GROUP,\n\tAVATAR_GROUP_MOVE,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarGroupCss from \"./generated/themes/AvatarGroup.css.js\";\n\n// Template\nimport AvatarGroupTemplate from \"./AvatarGroupTemplate.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\n\n/**\n * Interface for components that represent an avatar and may be slotted in numerous higher-order components such as `ui5-avatar-group`\n * @public\n */\ninterface IAvatarGroupItem extends HTMLElement, ITabbable {\n\teffectiveBackgroundColor: AvatarColorScheme;\n\tsize: `${AvatarSize}`;\n\teffectiveSize: AvatarSize;\n\tinteractive: boolean;\n}\n\nconst OVERFLOW_BTN_CLASS = \"ui5-avatar-group-overflow-btn\";\nconst AVATAR_GROUP_OVERFLOW_BTN_SELECTOR = `.${OVERFLOW_BTN_CLASS}`;\n\n// based on RTL/LTR a margin-left/right is set respectfully\nconst offsets = {\n\t[AvatarSize.XS]: {\n\t\t[AvatarGroupType.Individual]: \"0.0625rem\",\n\t\t[AvatarGroupType.Group]: \"-0.5rem\",\n\t},\n\t[AvatarSize.S]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-1.25rem\",\n\t},\n\t[AvatarSize.M]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-1.625rem\",\n\t},\n\t[AvatarSize.L]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-2rem\",\n\t},\n\t[AvatarSize.XL]: {\n\t\t[AvatarGroupType.Individual]: \"0.25rem\",\n\t\t[AvatarGroupType.Group]: \"-2.75rem\",\n\t},\n};\n\ntype AvatarGroupAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\ntype AvatarGroupClickEventDetail = {\n\ttargetRef: HTMLElement,\n\toverflowButtonClicked: boolean,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * Displays a group of avatars arranged horizontally. It is useful to visually\n * showcase a group of related avatars, such as, project team members or employees.\n *\n * The component allows you to display the avatars in different sizes,\n * depending on your use case.\n *\n * The `AvatarGroup` component has two group types:\n *\n * - `Group` type: The avatars are displayed as partially overlapped on\n * top of each other and the entire group has one click/tap area.\n * - `Individual` type: The avatars are displayed side-by-side and each\n * avatar has its own click/tap area.\n *\n * ### Usage\n *\n * Use the `AvatarGroup` if:\n *\n * - You want to display a group of avatars.\n * - You want to display several avatars which have something in common.\n *\n * Do not use the `AvatarGroup` if:\n *\n * - You want to display a single avatar.\n * - You want to display a gallery for simple images.\n * - You want to use it for other visual content than avatars.\n *\n * ### Responsive Behavior\n *\n * When the available space is less than the width required to display all avatars,\n * an overflow visualization appears as a button placed at the end with the same shape\n * and size as the avatars. The visualization displays the number of avatars that have overflowed\n * and are not currently visible.\n *\n * ### Keyboard Handling\n * The component provides advanced keyboard handling.\n * When focused, the user can use the following keyboard\n * shortcuts in order to perform a navigation:\n *\n * `type` Individual:\n *\n * - [Tab] - Move focus to the overflow button\n * - [Left] - Navigate one avatar to the left\n * - [Right] - Navigate one avatar to the right\n * - [Home] - Navigate to the first avatar\n * - [End] - Navigate to the last avatar\n * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event\n *\n * `type` Group:\n *\n * - [Tab] - Move focus to the next interactive element after the component\n * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.11\n * @public\n */\n\n@customElement({\n\ttag: \"ui5-avatar-group\",\n\trenderer: jsxRenderer,\n\ttemplate: AvatarGroupTemplate,\n\tstyles: AvatarGroupCss,\n})\n/**\n * Fired when the component is activated either with a\n * click/tap or by using the Enter or Space key.\n * @param {HTMLElement} targetRef The DOM ref of the clicked item.\n * @param {boolean} overflowButtonClicked indicates if the overflow button is clicked\n * @public\n * @since 1.0.0-rc.11\n */\n@event(\"click\")\n\n/**\n * Fired when the count of visible `ui5-avatar` elements in the\n * component has changed\n * @public\n * @since 1.0.0-rc.13\n */\n@event(\"overflow\")\nclass AvatarGroup extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": AvatarGroupClickEventDetail\n\t\t\"overflow\": void\n\t}\n\n\tslotDetails!: {\n\t\toverflowButton: IButton;\n\t\titems: IAvatarGroupItem;\n\t}\n\n\t/**\n\t * Defines the mode of the `AvatarGroup`.\n\t * @default \"Group\"\n\t * @public\n\t */\n\t@property()\n\ttype: `${AvatarGroupType}` = \"Group\"\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarGroupAccessibilityAttributes = {};\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\t_overflowButtonText?: string;\n\n\t/**\n \t* Defines the accessible name of the AvatarGroup.\n \t* When provided, this will override the default aria-label text.\n \t* @default undefined\n \t* @public\n \t* @since 2.12.0\n \t*/\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n \t* Receives id(s) of the elements that describe the AvatarGroup.\n \t* When provided, this will be used as aria-labelledby instead of aria-label.\n \t* @default undefined\n \t* @public\n \t* @since 2.12.0\n \t*/\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the items of the component. Use the `ui5-avatar` component as an item.\n\t *\n\t * **Note:** The UX guidelines recommends using avatars with \"Circle\" shape.\n\t *\n\t * Moreover, if you use avatars with \"Square\" shape, there will be visual inconsistency\n\t * as the built-in overflow action has \"Circle\" shape.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\titems!: DefaultSlot<IAvatarGroupItem>;\n\n\t/**\n\t * Defines the overflow button of the component.\n\t *\n\t * **Note:** We recommend using the `ui5-button` component.\n\t *\n\t * **Note:** If this slot is not used, the component will display the built-in overflow button.\n\t * @public\n\t * @since 1.0.0-rc.13\n\t */\n\t@slot()\n\toverflowButton!: Slot<IButton>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t_onResizeHandler: () => void;\n\t_colorIndex = 0;\n\t_hiddenItems = 0;\n\t_itemNavigation: ItemNavigation;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._itemNavigation = new ItemNavigation(this, {\n\t\t\tgetItemsCallback: () => {\n\t\t\t\treturn this._isGroup ? [] : this.items.slice(0, this._hiddenStartIndex);\n\t\t\t},\n\t\t});\n\t\tthis._onResizeHandler = this._onResize.bind(this);\n\t}\n\n\t/**\n\t * Returns an array containing the `ui5-avatar` instances that are currently not displayed due to lack of space.\n\t * @default []\n\t * @public\n\t */\n\tget hiddenItems(): IAvatarGroupItem[] {\n\t\treturn this.items.slice(this._hiddenStartIndex);\n\t}\n\n\t/**\n\t * Returns an array containing the `AvatarColorScheme` values that correspond to the avatars in the component.\n\t * @default []\n\t * @public\n\t */\n\tget colorScheme(): AvatarColorScheme[] {\n\t\treturn this.items.map(avatar => avatar.effectiveBackgroundColor);\n\t}\n\n\tget _customOverflowButton() {\n\t\treturn this.overflowButton.length ? this.overflowButton[0] : undefined;\n\t}\n\n\tget _ariaLabelText() {\n\t\tif (this.accessibleName || this.accessibleNameRef) {\n\t\t\treturn getEffectiveAriaLabelText(this);\n\t\t}\n\t\t// Fallback to existing default behavior\n\t\tconst hiddenItemsCount = this.hiddenItems.length;\n\t\tconst typeLabelKey = this._isGroup ? AVATAR_GROUP_ARIA_LABEL_GROUP : AVATAR_GROUP_ARIA_LABEL_INDIVIDUAL;\n\n\t\t// avatar type label\n\t\tlet text = AvatarGroup.i18nBundle.getText(typeLabelKey);\n\n\t\t// add displayed-hidden avatars label\n\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_DISPLAYED_HIDDEN_LABEL, this._itemsCount - hiddenItemsCount, hiddenItemsCount)}`;\n\n\t\tif (this._isGroup) {\n\t\t\t// the container role is \"button\", add the message for complete list activation\n\t\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL)}`;\n\t\t} else {\n\t\t\t// the container role is \"group\", add the \"how to navigate\" message\n\t\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_MOVE)}`;\n\t\t}\n\n\t\treturn text;\n\t}\n\n\tget _overflowButtonAriaLabelText() {\n\t\treturn this._isGroup ? undefined : AvatarGroup.i18nBundle.getText(AVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL);\n\t}\n\n\tget _containerAriaHasPopup() {\n\t\treturn this._isGroup ? this._getAriaHasPopup() : undefined;\n\t}\n\n\tget _overflowButtonAccAttributes() {\n\t\treturn {\n\t\t\thasPopup: this._isGroup ? undefined : this._getAriaHasPopup(),\n\t\t};\n\t}\n\n\tget _role() {\n\t\treturn this._isGroup ? \"button\" : \"group\";\n\t}\n\n\tget _hiddenStartIndex() {\n\t\treturn this._itemsCount - this._hiddenItems;\n\t}\n\n\tget _overflowBtnHidden() {\n\t\treturn this._hiddenItems === 0;\n\t}\n\n\tget _isGroup() {\n\t\treturn this.type === AvatarGroupType.Group;\n\t}\n\n\tget _itemsCount() {\n\t\treturn this.items.length;\n\t}\n\n\tget _groupTabIndex() {\n\t\treturn this._isGroup ? 0 : -1;\n\t}\n\n\tget _overflowButton() {\n\t\treturn this.shadowRoot!.querySelector<Button>(AVATAR_GROUP_OVERFLOW_BTN_SELECTOR);\n\t}\n\n\t/**\n\t * Return the effective overflow button width\n\t * Differences are that when in \"Group\" type the button is offset and overlaps the avatars\n\t *\n\t * 1) In case of \"Group\", (LTR/RTL aware) button width is qual to second item offset left/right\n\t * 2) In case of \"Individual\" group type width is directly taken from button element\n\t * @private\n\t */\n\tget _overflowButtonEffectiveWidth() {\n\t\tconst button = this._customOverflowButton ? this._customOverflowButton : this._overflowButton;\n\t\t// if in \"Group\" mode overflow button size is equal to the offset from second item\n\n\t\tif (!button) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (this._isGroup) {\n\t\t\tlet item: HTMLElement = this.items[1];\n\t\t\tconst ltrEffectiveWidth = item.offsetLeft - this.offsetLeft;\n\n\t\t\t// in some cases when second avatar is overflowed the offset of the button is the right one\n\t\t\tif (!item || item.hidden) {\n\t\t\t\titem = button;\n\t\t\t}\n\n\t\t\treturn this.effectiveDir === \"rtl\" ? this._getWidthToItem(item) : ltrEffectiveWidth;\n\t\t}\n\n\t\treturn button.offsetWidth;\n\t}\n\n\tget firstAvatarSize() {\n\t\treturn this.items[0]?.size ?? AvatarSize.S;\n\t}\n\n\tonAfterRendering() {\n\t\tthis._overflowItems();\n\t}\n\n\tonBeforeRendering() {\n\t\tif (this._customOverflowButton) {\n\t\t\tthis._customOverflowButton.nonInteractive = this._isGroup;\n\t\t}\n\n\t\tthis._prepareAvatars();\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tResizeHandler.register(this, this._onResizeHandler);\n\t}\n\n\tonExitDOM() {\n\t\tResizeHandler.deregister(this, this._onResizeHandler);\n\t}\n\n\t_onResize() {\n\t\tthis._overflowItems();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this._isGroup) {\n\t\t\tif (isEnter(e)) {\n\t\t\t\tthis._fireGroupEvent(e.target as HTMLElement);\n\t\t\t} else if (isSpace(e)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (!e.shiftKey && isSpace(e) && this._isGroup) {\n\t\t\tthis._fireGroupEvent(e.target as HTMLElement);\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_fireGroupEvent(targetRef: HTMLElement) {\n\t\tconst isOverflowButtonClicked = targetRef.classList.contains(OVERFLOW_BTN_CLASS) || targetRef === this._customOverflowButton;\n\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef,\n\t\t\toverflowButtonClicked: isOverflowButtonClicked,\n\t\t});\n\t}\n\n\t_onClick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._isGroup && this._fireGroupEvent(e.target as HTMLElement);\n\t}\n\n\tonAvatarClick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t\toverflowButtonClicked: false,\n\t\t});\n\t}\n\n\tonAvatarUI5Click(e: MouseEvent) {\n\t\t// AvatrGroup fires click and ui5-click - Avatar's ui5-click should be stopped.\n\t\te.stopPropagation();\n\t}\n\n\tonOverflowButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\te.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t\toverflowButtonClicked: true,\n\t\t});\n\t}\n\n\t/**\n\t * Modifies avatars to the needs of avatar group properties. Respects already set size and background color.\n\t * Set the margins (offsets) based on RTL/LTR.\n\t * @private\n\t */\n\t_prepareAvatars() {\n\t\tthis._colorIndex = 0;\n\n\t\tthis.items.forEach((avatar, index) => {\n\t\t\tconst colorIndex = this._getNextBackgroundColor();\n\t\t\tavatar.interactive = !this._isGroup;\n\n\t\t\tif (avatar.getAttribute(\"_color-scheme\") === AvatarColorScheme.Auto) {\n\t\t\t\t// AvatarGroup respects colors set to ui5-avatar\n\t\t\t\tavatar.setAttribute(\"_color-scheme\", AvatarColorScheme[`Accent${colorIndex}` as keyof typeof AvatarColorScheme]);\n\t\t\t}\n\n\t\t\t// last avatar should not be offset as it breaks the container width and focus styles are no set correctly\n\t\t\tif (index !== this._itemsCount - 1 || this._customOverflowButton) {\n\t\t\t\t// based on RTL the browser automatically sets left or right margin to avatars\n\t\t\t\tavatar.style.marginInlineEnd = offsets[avatar.effectiveSize][this.type];\n\t\t\t} else {\n\t\t\t\tavatar.style.marginInlineEnd = \"\";\n\t\t\t}\n\t\t});\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tthis._itemNavigation.setCurrentItem(e.target as IAvatarGroupItem);\n\t}\n\n\tgetFocusDomRef() {\n\t\treturn this._itemNavigation._getCurrentItem();\n\t}\n\n\t/**\n\t * Returns the total width to item excluding the item width\n\t * RTL/LTR aware\n\t * @private\n\t * @param item\n\t */\n\t_getWidthToItem(item: HTMLElement) {\n\t\tconst isRTL = this.effectiveDir === \"rtl\";\n\t\tconst ltrWidthToItem = item.offsetLeft - this.offsetLeft;\n\n\t\tif (isRTL) {\n\t\t\tconst itemOffsetParent = item.offsetParent as HTMLElement;\n\n\t\t\t// in RTL the total width is equal to difference of the parent container width and\n\t\t\t// how much is the item offset to the left minus its offsetWidth\n\n\t\t\tif (!itemOffsetParent) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\treturn itemOffsetParent.offsetWidth - item.offsetLeft - item.offsetWidth;\n\t\t}\n\n\t\treturn ltrWidthToItem;\n\t}\n\n\t/**\n\t * Overflows items that were not able to fit the container\n\t * @private\n\t */\n\t_overflowItems() {\n\t\tif (this.items.length < 2) {\n\t\t\t// no need to overflow avatars\n\t\t\tthis._setHiddenItems(0);\n\t\t\treturn;\n\t\t}\n\n\t\tlet hiddenItems = 0;\n\n\t\tfor (let index = 0; index < this._itemsCount; index++) {\n\t\t\tconst item: IAvatarGroupItem = this.items[index];\n\n\t\t\t// show item to determine if it will fit the new container size\n\t\t\titem.hidden = false;\n\n\t\t\t// container width to current item + item width (avatar)\n\t\t\t// used to determine whether the following items will fit the container or not\n\t\t\tlet totalWidth = this._getWidthToItem(item) + item.offsetWidth;\n\n\t\t\tif (index !== this._itemsCount - 1 || this._customOverflowButton) {\n\t\t\t\ttotalWidth += this._overflowButtonEffectiveWidth;\n\t\t\t}\n\n\t\t\tif (totalWidth > this.offsetWidth) {\n\t\t\t\thiddenItems = this._itemsCount - index;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// hide the items that did not fit the container size\n\t\tthis._setHiddenItems(hiddenItems);\n\t}\n\n\t_getNextBackgroundColor() {\n\t\t// counter is to automatically assign background colors to avatars, `Accent10` is the highest color value\n\t\tif (++this._colorIndex > 10) {\n\t\t\tthis._colorIndex = 1;\n\t\t}\n\t\treturn this._colorIndex;\n\t}\n\n\t_setHiddenItems(hiddenItems: number) {\n\t\tconst shouldFireEvent = this._hiddenItems !== hiddenItems;\n\n\t\tthis._hiddenItems = hiddenItems;\n\n\t\tthis.items.forEach((item, index) => {\n\t\t\titem.hidden = index >= this._hiddenStartIndex;\n\t\t});\n\n\t\tthis._overflowButtonText = `+${hiddenItems > 99 ? 99 : hiddenItems}`;\n\n\t\tif (shouldFireEvent) {\n\t\t\tthis.fireDecoratorEvent(\"overflow\");\n\t\t}\n\t}\n\n\t_getAriaHasPopup() {\n\t\treturn this.accessibilityAttributes.hasPopup;\n\t}\n}\n\nAvatarGroup.define();\n\nexport default AvatarGroup;\nexport type {\n\tAvatarGroupClickEventDetail,\n\tAvatarGroupAccessibilityAttributes,\n\tIAvatarGroupItem,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"AvatarGroup.js","sourceRoot":"","sources":["../src/AvatarGroup.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,wDAAwD,CAAC;AACnF,OAAO,cAAc,MAAM,yDAAyD,CAAC;AAIrF,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,IAAI,MAAM,iDAAiD,CAAC;AAGnE,OAAO,EACN,OAAO,EACP,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAEnE,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,eAAe,MAAM,4BAA4B,CAAC;AACzD,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EACN,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,6BAA6B,EAC7B,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAE3C,SAAS;AACT,OAAO,cAAc,MAAM,uCAAuC,CAAC;AAEnE,WAAW;AACX,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAa1G,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAC3D,MAAM,kCAAkC,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEpE,2DAA2D;AAC3D,MAAM,OAAO,GAAG;IACf,CAAC,UAAU,CAAC,EAAE,CAAC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BAAmB,GAAG,IAAI,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QAErE,IAAI,eAAe,EAAE,CAAC;YACrB,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAED,gBAAgB;QACf,OAAO,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC;IAC9C,CAAC;CACD,CAAA;AAtaA;IADC,QAAQ,EAAE;yCACyB;AAcpC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DACsC;AAMjE;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;wDACH;AAU7B;IADC,QAAQ,EAAE;mDACa;AAUxB;IADC,QAAQ,EAAE;sDACgB;AAY3B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;0CACP;AAYtC;IADC,IAAI,EAAE;mDACwB;AAGxB;IADN,IAAI,CAAC,oBAAoB,CAAC;qCACG;AApFzB,WAAW;IAvBhB,aAAa,CAAC;QACd,GAAG,EAAE,kBAAkB;QACvB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;IACF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,CAAC;IAEf;;;;;OAKG;;IACF,KAAK,CAAC,UAAU,CAAC;GACZ,WAAW,CAubhB;AAED,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport ResizeHandler from \"@ui5/webcomponents-base/dist/delegate/ResizeHandler.js\";\nimport ItemNavigation from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { UI5CustomEvent } from \"@ui5/webcomponents-base\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.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 i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport type { AccessibilityAttributes } from \"@ui5/webcomponents-base/dist/types.js\";\n\nimport {\n\tisEnter,\n\tisSpace,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport type Button from \"./Button.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport AvatarGroupType from \"./types/AvatarGroupType.js\";\nimport AvatarColorScheme from \"./types/AvatarColorScheme.js\";\nimport type { IButton } from \"./Button.js\";\n\nimport {\n\tAVATAR_GROUP_DISPLAYED_HIDDEN_LABEL,\n\tAVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL,\n\tAVATAR_GROUP_ARIA_LABEL_INDIVIDUAL,\n\tAVATAR_GROUP_ARIA_LABEL_GROUP,\n\tAVATAR_GROUP_MOVE,\n} from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarGroupCss from \"./generated/themes/AvatarGroup.css.js\";\n\n// Template\nimport AvatarGroupTemplate from \"./AvatarGroupTemplate.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\n\n/**\n * Interface for components that represent an avatar and may be slotted in numerous higher-order components such as `ui5-avatar-group`\n * @public\n */\ninterface IAvatarGroupItem extends HTMLElement, ITabbable {\n\teffectiveBackgroundColor: AvatarColorScheme;\n\tsize: `${AvatarSize}`;\n\teffectiveSize: AvatarSize;\n\tinteractive: boolean;\n}\n\nconst OVERFLOW_BTN_CLASS = \"ui5-avatar-group-overflow-btn\";\nconst AVATAR_GROUP_OVERFLOW_BTN_SELECTOR = `.${OVERFLOW_BTN_CLASS}`;\n\n// based on RTL/LTR a margin-left/right is set respectfully\nconst offsets = {\n\t[AvatarSize.XS]: {\n\t\t[AvatarGroupType.Individual]: \"0.0625rem\",\n\t\t[AvatarGroupType.Group]: \"-0.5rem\",\n\t},\n\t[AvatarSize.S]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-1.25rem\",\n\t},\n\t[AvatarSize.M]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-1.625rem\",\n\t},\n\t[AvatarSize.L]: {\n\t\t[AvatarGroupType.Individual]: \"0.125rem\",\n\t\t[AvatarGroupType.Group]: \"-2rem\",\n\t},\n\t[AvatarSize.XL]: {\n\t\t[AvatarGroupType.Individual]: \"0.25rem\",\n\t\t[AvatarGroupType.Group]: \"-2.75rem\",\n\t},\n};\n\ntype AvatarGroupAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\">;\n\ntype AvatarGroupClickEventDetail = {\n\ttargetRef: HTMLElement,\n\toverflowButtonClicked: boolean,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * Displays a group of avatars arranged horizontally. It is useful to visually\n * showcase a group of related avatars, such as, project team members or employees.\n *\n * The component allows you to display the avatars in different sizes,\n * depending on your use case.\n *\n * The `AvatarGroup` component has two group types:\n *\n * - `Group` type: The avatars are displayed as partially overlapped on\n * top of each other and the entire group has one click/tap area.\n * - `Individual` type: The avatars are displayed side-by-side and each\n * avatar has its own click/tap area.\n *\n * ### Usage\n *\n * Use the `AvatarGroup` if:\n *\n * - You want to display a group of avatars.\n * - You want to display several avatars which have something in common.\n *\n * Do not use the `AvatarGroup` if:\n *\n * - You want to display a single avatar.\n * - You want to display a gallery for simple images.\n * - You want to use it for other visual content than avatars.\n *\n * ### Responsive Behavior\n *\n * When the available space is less than the width required to display all avatars,\n * an overflow visualization appears as a button placed at the end with the same shape\n * and size as the avatars. The visualization displays the number of avatars that have overflowed\n * and are not currently visible.\n *\n * ### Keyboard Handling\n * The component provides advanced keyboard handling.\n * When focused, the user can use the following keyboard\n * shortcuts in order to perform a navigation:\n *\n * `type` Individual:\n *\n * - [Tab] - Move focus to the overflow button\n * - [Left] - Navigate one avatar to the left\n * - [Right] - Navigate one avatar to the right\n * - [Home] - Navigate to the first avatar\n * - [End] - Navigate to the last avatar\n * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event\n *\n * `type` Group:\n *\n * - [Tab] - Move focus to the next interactive element after the component\n * - [Space] / [Enter] or [Return] - Trigger `ui5-click` event\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.11\n * @public\n */\n\n@customElement({\n\ttag: \"ui5-avatar-group\",\n\trenderer: jsxRenderer,\n\ttemplate: AvatarGroupTemplate,\n\tstyles: AvatarGroupCss,\n})\n/**\n * Fired when the component is activated either with a\n * click/tap or by using the Enter or Space key.\n * @param {HTMLElement} targetRef The DOM ref of the clicked item.\n * @param {boolean} overflowButtonClicked indicates if the overflow button is clicked\n * @public\n * @since 1.0.0-rc.11\n */\n@event(\"click\")\n\n/**\n * Fired when the count of visible `ui5-avatar` elements in the\n * component has changed\n * @public\n * @since 1.0.0-rc.13\n */\n@event(\"overflow\")\nclass AvatarGroup extends UI5Element {\n\teventDetails!: {\n\t\t\"click\": AvatarGroupClickEventDetail\n\t\t\"overflow\": void\n\t}\n\n\tslotDetails!: {\n\t\toverflowButton: IButton;\n\t\titems: IAvatarGroupItem;\n\t}\n\n\t/**\n\t * Defines the mode of the `AvatarGroup`.\n\t * @default \"Group\"\n\t * @public\n\t */\n\t@property()\n\ttype: `${AvatarGroupType}` = \"Group\"\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following field is supported:\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * @public\n\t * @since 2.0.0\n\t * @default {}\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: AvatarGroupAccessibilityAttributes = {};\n\n\t/**\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\t_overflowButtonText?: string;\n\n\t/**\n \t* Defines the accessible name of the AvatarGroup.\n \t* When provided, this will override the default aria-label text.\n \t* @default undefined\n \t* @public\n \t* @since 2.12.0\n \t*/\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n \t* Receives id(s) of the elements that describe the AvatarGroup.\n \t* When provided, this will be used as aria-labelledby instead of aria-label.\n \t* @default undefined\n \t* @public\n \t* @since 2.12.0\n \t*/\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the items of the component. Use the `ui5-avatar` component as an item.\n\t *\n\t * **Note:** The UX guidelines recommends using avatars with \"Circle\" shape.\n\t *\n\t * Moreover, if you use avatars with \"Square\" shape, there will be visual inconsistency\n\t * as the built-in overflow action has \"Circle\" shape.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\titems!: DefaultSlot<IAvatarGroupItem>;\n\n\t/**\n\t * Defines the overflow button of the component.\n\t *\n\t * **Note:** We recommend using the `ui5-button` component.\n\t *\n\t * **Note:** If this slot is not used, the component will display the built-in overflow button.\n\t * @public\n\t * @since 1.0.0-rc.13\n\t */\n\t@slot()\n\toverflowButton!: Slot<IButton>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\t_onResizeHandler: () => void;\n\t_colorIndex = 0;\n\t_hiddenItems = 0;\n\t_itemNavigation: ItemNavigation;\n\n\t/**\n\t * Returns the actual avatar items, handling transitive slotting.\n\t * @private\n\t */\n\tget _slottedItems(): IAvatarGroupItem[] {\n\t\treturn this.getSlottedNodes<IAvatarGroupItem>(\"items\");\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._itemNavigation = new ItemNavigation(this, {\n\t\t\tgetItemsCallback: () => {\n\t\t\t\treturn this._isGroup ? [] : this._slottedItems.slice(0, this._hiddenStartIndex);\n\t\t\t},\n\t\t});\n\t\tthis._onResizeHandler = this._onResize.bind(this);\n\t}\n\n\t/**\n\t * Returns an array containing the `ui5-avatar` instances that are currently not displayed due to lack of space.\n\t * @default []\n\t * @public\n\t */\n\tget hiddenItems(): IAvatarGroupItem[] {\n\t\treturn this._slottedItems.slice(this._hiddenStartIndex);\n\t}\n\n\t/**\n\t * Returns an array containing the `AvatarColorScheme` values that correspond to the avatars in the component.\n\t * @default []\n\t * @public\n\t */\n\tget colorScheme(): AvatarColorScheme[] {\n\t\treturn this._slottedItems.map(avatar => avatar.effectiveBackgroundColor);\n\t}\n\n\tget _customOverflowButton() {\n\t\treturn this.overflowButton.length ? this.overflowButton[0] : undefined;\n\t}\n\n\tget _ariaLabelText() {\n\t\tif (this.accessibleName || this.accessibleNameRef) {\n\t\t\treturn getEffectiveAriaLabelText(this);\n\t\t}\n\t\t// Fallback to existing default behavior\n\t\tconst hiddenItemsCount = this.hiddenItems.length;\n\t\tconst typeLabelKey = this._isGroup ? AVATAR_GROUP_ARIA_LABEL_GROUP : AVATAR_GROUP_ARIA_LABEL_INDIVIDUAL;\n\n\t\t// avatar type label\n\t\tlet text = AvatarGroup.i18nBundle.getText(typeLabelKey);\n\n\t\t// add displayed-hidden avatars label\n\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_DISPLAYED_HIDDEN_LABEL, this._itemsCount - hiddenItemsCount, hiddenItemsCount)}`;\n\n\t\tif (this._isGroup) {\n\t\t\t// the container role is \"button\", add the message for complete list activation\n\t\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL)}`;\n\t\t} else {\n\t\t\t// the container role is \"group\", add the \"how to navigate\" message\n\t\t\ttext += ` ${AvatarGroup.i18nBundle.getText(AVATAR_GROUP_MOVE)}`;\n\t\t}\n\n\t\treturn text;\n\t}\n\n\tget _overflowButtonAriaLabelText() {\n\t\treturn this._isGroup ? undefined : AvatarGroup.i18nBundle.getText(AVATAR_GROUP_SHOW_COMPLETE_LIST_LABEL);\n\t}\n\n\tget _containerAriaHasPopup() {\n\t\treturn this._isGroup ? this._getAriaHasPopup() : undefined;\n\t}\n\n\tget _overflowButtonAccAttributes() {\n\t\treturn {\n\t\t\thasPopup: this._isGroup ? undefined : this._getAriaHasPopup(),\n\t\t};\n\t}\n\n\tget _role() {\n\t\treturn this._isGroup ? \"button\" : \"group\";\n\t}\n\n\tget _hiddenStartIndex() {\n\t\treturn this._itemsCount - this._hiddenItems;\n\t}\n\n\tget _overflowBtnHidden() {\n\t\treturn this._hiddenItems === 0;\n\t}\n\n\tget _isGroup() {\n\t\treturn this.type === AvatarGroupType.Group;\n\t}\n\n\tget _itemsCount() {\n\t\treturn this._slottedItems.length;\n\t}\n\n\tget _groupTabIndex() {\n\t\treturn this._isGroup ? 0 : -1;\n\t}\n\n\tget _overflowButton() {\n\t\treturn this.shadowRoot!.querySelector<Button>(AVATAR_GROUP_OVERFLOW_BTN_SELECTOR);\n\t}\n\n\t/**\n\t * Return the effective overflow button width\n\t * Differences are that when in \"Group\" type the button is offset and overlaps the avatars\n\t *\n\t * 1) In case of \"Group\", (LTR/RTL aware) button width is qual to second item offset left/right\n\t * 2) In case of \"Individual\" group type width is directly taken from button element\n\t * @private\n\t */\n\tget _overflowButtonEffectiveWidth() {\n\t\tconst button = this._customOverflowButton ? this._customOverflowButton : this._overflowButton;\n\t\t// if in \"Group\" mode overflow button size is equal to the offset from second item\n\n\t\tif (!button) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (this._isGroup) {\n\t\t\tlet item: HTMLElement = this._slottedItems[1];\n\t\t\tconst ltrEffectiveWidth = item.offsetLeft - this.offsetLeft;\n\n\t\t\t// in some cases when second avatar is overflowed the offset of the button is the right one\n\t\t\tif (!item || item.hidden) {\n\t\t\t\titem = button;\n\t\t\t}\n\n\t\t\treturn this.effectiveDir === \"rtl\" ? this._getWidthToItem(item) : ltrEffectiveWidth;\n\t\t}\n\n\t\treturn button.offsetWidth;\n\t}\n\n\tget firstAvatarSize() {\n\t\treturn this._slottedItems[0]?.size ?? AvatarSize.S;\n\t}\n\n\tonAfterRendering() {\n\t\tthis._overflowItems();\n\t}\n\n\tonBeforeRendering() {\n\t\tif (this._customOverflowButton) {\n\t\t\tthis._customOverflowButton.nonInteractive = this._isGroup;\n\t\t}\n\n\t\tthis._prepareAvatars();\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\n\t\tResizeHandler.register(this, this._onResizeHandler);\n\t}\n\n\tonExitDOM() {\n\t\tResizeHandler.deregister(this, this._onResizeHandler);\n\t}\n\n\t_onResize() {\n\t\tthis._overflowItems();\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (this._isGroup) {\n\t\t\tif (isEnter(e)) {\n\t\t\t\tthis._fireGroupEvent(e.target as HTMLElement);\n\t\t\t} else if (isSpace(e)) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (!e.shiftKey && isSpace(e) && this._isGroup) {\n\t\t\tthis._fireGroupEvent(e.target as HTMLElement);\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_fireGroupEvent(targetRef: HTMLElement) {\n\t\tconst isOverflowButtonClicked = targetRef.classList.contains(OVERFLOW_BTN_CLASS) || targetRef === this._customOverflowButton;\n\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef,\n\t\t\toverflowButtonClicked: isOverflowButtonClicked,\n\t\t});\n\t}\n\n\t_onClick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis._isGroup && this._fireGroupEvent(e.target as HTMLElement);\n\t}\n\n\tonAvatarClick(e: MouseEvent) {\n\t\te.stopPropagation();\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t\toverflowButtonClicked: false,\n\t\t});\n\t}\n\n\tonAvatarUI5Click(e: MouseEvent) {\n\t\t// AvatrGroup fires click and ui5-click - Avatar's ui5-click should be stopped.\n\t\te.stopPropagation();\n\t}\n\n\tonOverflowButtonClick(e: UI5CustomEvent<Button, \"click\">) {\n\t\te.stopPropagation();\n\n\t\tthis.fireDecoratorEvent(\"click\", {\n\t\t\ttargetRef: e.target as HTMLElement,\n\t\t\toverflowButtonClicked: true,\n\t\t});\n\t}\n\n\t/**\n\t * Modifies avatars to the needs of avatar group properties. Respects already set size and background color.\n\t * Set the margins (offsets) based on RTL/LTR.\n\t * @private\n\t */\n\t_prepareAvatars() {\n\t\tthis._colorIndex = 0;\n\n\t\tthis._slottedItems.forEach((avatar, index) => {\n\t\t\tconst colorIndex = this._getNextBackgroundColor();\n\t\t\tavatar.interactive = !this._isGroup;\n\n\t\t\tif (avatar.getAttribute(\"_color-scheme\") === AvatarColorScheme.Auto) {\n\t\t\t\t// AvatarGroup respects colors set to ui5-avatar\n\t\t\t\tavatar.setAttribute(\"_color-scheme\", AvatarColorScheme[`Accent${colorIndex}` as keyof typeof AvatarColorScheme]);\n\t\t\t}\n\n\t\t\t// last avatar should not be offset as it breaks the container width and focus styles are no set correctly\n\t\t\tif (index !== this._itemsCount - 1 || this._customOverflowButton) {\n\t\t\t\t// based on RTL the browser automatically sets left or right margin to avatars\n\t\t\t\tavatar.style.marginInlineEnd = offsets[avatar.effectiveSize][this.type];\n\t\t\t} else {\n\t\t\t\tavatar.style.marginInlineEnd = \"\";\n\t\t\t}\n\t\t});\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tthis._itemNavigation.setCurrentItem(e.target as IAvatarGroupItem);\n\t}\n\n\tgetFocusDomRef() {\n\t\treturn this._itemNavigation._getCurrentItem();\n\t}\n\n\t/**\n\t * Returns the total width to item excluding the item width\n\t * RTL/LTR aware\n\t * @private\n\t * @param item\n\t */\n\t_getWidthToItem(item: HTMLElement) {\n\t\tconst isRTL = this.effectiveDir === \"rtl\";\n\t\tconst ltrWidthToItem = item.offsetLeft - this.offsetLeft;\n\n\t\tif (isRTL) {\n\t\t\tconst itemOffsetParent = item.offsetParent as HTMLElement;\n\n\t\t\t// in RTL the total width is equal to difference of the parent container width and\n\t\t\t// how much is the item offset to the left minus its offsetWidth\n\n\t\t\tif (!itemOffsetParent) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\treturn itemOffsetParent.offsetWidth - item.offsetLeft - item.offsetWidth;\n\t\t}\n\n\t\treturn ltrWidthToItem;\n\t}\n\n\t/**\n\t * Overflows items that were not able to fit the container\n\t * @private\n\t */\n\t_overflowItems() {\n\t\tif (this._slottedItems.length < 2) {\n\t\t\t// no need to overflow avatars\n\t\t\tthis._setHiddenItems(0);\n\t\t\treturn;\n\t\t}\n\n\t\tlet hiddenItems = 0;\n\n\t\tfor (let index = 0; index < this._itemsCount; index++) {\n\t\t\tconst item: IAvatarGroupItem = this._slottedItems[index];\n\n\t\t\t// show item to determine if it will fit the new container size\n\t\t\titem.hidden = false;\n\n\t\t\t// container width to current item + item width (avatar)\n\t\t\t// used to determine whether the following items will fit the container or not\n\t\t\tlet totalWidth = this._getWidthToItem(item) + item.offsetWidth;\n\n\t\t\tif (index !== this._itemsCount - 1 || this._customOverflowButton) {\n\t\t\t\ttotalWidth += this._overflowButtonEffectiveWidth;\n\t\t\t}\n\n\t\t\tif (totalWidth > this.offsetWidth) {\n\t\t\t\thiddenItems = this._itemsCount - index;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// hide the items that did not fit the container size\n\t\tthis._setHiddenItems(hiddenItems);\n\t}\n\n\t_getNextBackgroundColor() {\n\t\t// counter is to automatically assign background colors to avatars, `Accent10` is the highest color value\n\t\tif (++this._colorIndex > 10) {\n\t\t\tthis._colorIndex = 1;\n\t\t}\n\t\treturn this._colorIndex;\n\t}\n\n\t_setHiddenItems(hiddenItems: number) {\n\t\tconst shouldFireEvent = this._hiddenItems !== hiddenItems;\n\n\t\tthis._hiddenItems = hiddenItems;\n\n\t\tthis._slottedItems.forEach((item, index) => {\n\t\t\titem.hidden = index >= this._hiddenStartIndex;\n\t\t});\n\n\t\tthis._overflowButtonText = `+${hiddenItems > 99 ? 99 : hiddenItems}`;\n\n\t\tif (shouldFireEvent) {\n\t\t\tthis.fireDecoratorEvent(\"overflow\");\n\t\t}\n\t}\n\n\t_getAriaHasPopup() {\n\t\treturn this.accessibilityAttributes.hasPopup;\n\t}\n}\n\nAvatarGroup.define();\n\nexport default AvatarGroup;\nexport type {\n\tAvatarGroupClickEventDetail,\n\tAvatarGroupAccessibilityAttributes,\n\tIAvatarGroupItem,\n};\n"]}
|
package/dist/AvatarTemplate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
import Icon from "./Icon.js";
|
|
3
3
|
export default function AvatarTemplate() {
|
|
4
|
-
return (_jsxs("div", { class: "ui5-avatar-root", tabindex: this.tabindex, "data-sap-focus-ref": true, role: this._role, "aria-haspopup": this._ariaHasPopup, "aria-label": this.accessibleNameText, onKeyUp: this._onkeyup, onKeyDown: this._onkeydown, onClick: this._onclick, children: [this._hasImage ?
|
|
4
|
+
return (_jsxs("div", { class: "ui5-avatar-root", tabindex: this.tabindex, "data-sap-focus-ref": true, role: this._role, "aria-hidden": this.effectiveAriaHidden, "aria-haspopup": this._ariaHasPopup, "aria-label": this.accessibleNameText, onKeyUp: this._onkeyup, onKeyDown: this._onkeydown, onClick: this._onclick, children: [this._hasImage ?
|
|
5
5
|
_jsx("slot", {})
|
|
6
6
|
: _jsxs(_Fragment, { children: [this.icon && _jsx(Icon, { class: "ui5-avatar-icon", name: this.icon, accessibleName: this.accessibleName }), this.initials ? (_jsxs(_Fragment, { children: [_jsx("span", { class: "ui5-avatar-initials ui5-avatar-initials-hidden", children: this.validInitials }), _jsx(Icon, { name: this.fallbackIcon, class: "ui5-avatar-icon ui5-avatar-icon-fallback ui5-avatar-fallback-icon-hidden" })] })) : (
|
|
7
7
|
// Show fallback icon only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarTemplate.js","sourceRoot":"","sources":["../src/AvatarTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CACN,eACC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,8BAEvB,IAAI,EAAE,IAAI,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"AvatarTemplate.js","sourceRoot":"","sources":["../src/AvatarTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,cAAc;IACrC,OAAO,CACN,eACC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,8BAEvB,IAAI,EAAE,IAAI,CAAC,KAAK,iBACH,IAAI,CAAC,mBAAmB,mBACtB,IAAI,CAAC,aAAa,gBACrB,IAAI,CAAC,kBAAkB,EACnC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,aAErB,IAAI,CAAC,SAAS,CAAC,CAAC;gBAChB,gBAAa;gBACb,CAAC,CAAC,8BACA,IAAI,CAAC,IAAI,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,GAAS,EAExG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,8BAEC,eAAM,KAAK,EAAC,gDAAgD,YAAE,IAAI,CAAC,aAAa,GAAQ,EACxF,KAAC,IAAI,IACJ,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,KAAK,EAAC,0EAA0E,GACzE,IACN,CACH,CAAC,CAAC,CAAC;wBACH,0BAA0B;wBAC1B,KAAC,IAAI,IACJ,IAAI,EAAE,IAAI,CAAC,YAAY,EACvB,KAAK,EAAC,0CAA0C,GACzC,CACR,IACC,EAGJ,eAAM,IAAI,EAAC,OAAO,GAAQ,IACrB,CACN,CAAC;AACH,CAAC","sourcesContent":["import type Avatar from \"./Avatar.js\";\nimport Icon from \"./Icon.js\";\n\nexport default function AvatarTemplate(this: Avatar) {\n\treturn (\n\t\t<div\n\t\t\tclass=\"ui5-avatar-root\"\n\t\t\ttabindex={this.tabindex}\n\t\t\tdata-sap-focus-ref\n\t\t\trole={this._role}\n\t\t\taria-hidden={this.effectiveAriaHidden}\n\t\t\taria-haspopup={this._ariaHasPopup}\n\t\t\taria-label={this.accessibleNameText}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\tonClick={this._onclick}\n\t\t>\n\t\t\t{this._hasImage ?\n\t\t\t\t<slot></slot>\n\t\t\t\t: <>\n\t\t\t\t\t{this.icon && <Icon class=\"ui5-avatar-icon\" name={this.icon} accessibleName={this.accessibleName}></Icon>}\n\n\t\t\t\t\t{this.initials ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{/* Show initials + hidden fallback icon */}\n\t\t\t\t\t\t\t<span class=\"ui5-avatar-initials ui5-avatar-initials-hidden\">{this.validInitials}</span>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\tname={this.fallbackIcon}\n\t\t\t\t\t\t\t\tclass=\"ui5-avatar-icon ui5-avatar-icon-fallback ui5-avatar-fallback-icon-hidden\"\n\t\t\t\t\t\t\t></Icon>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t// Show fallback icon only\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tname={this.fallbackIcon}\n\t\t\t\t\t\t\tclass=\"ui5-avatar-icon ui5-avatar-icon-fallback\"\n\t\t\t\t\t\t></Icon>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t}\n\n\t\t\t<slot name=\"badge\"></slot>\n\t\t</div>\n\t);\n}\n"]}
|
package/dist/Breadcrumbs.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import BreadcrumbsDesign from "./types/BreadcrumbsDesign.js";
|
|
|
9
9
|
import "./BreadcrumbsItem.js";
|
|
10
10
|
import type BreadcrumbsItem from "./BreadcrumbsItem.js";
|
|
11
11
|
import type BreadcrumbsSeparator from "./types/BreadcrumbsSeparator.js";
|
|
12
|
+
import type { IOverflowToolbarItem } from "./ToolbarItem.js";
|
|
12
13
|
import type Link from "./Link.js";
|
|
13
14
|
import type { LinkClickEventDetail } from "./Link.js";
|
|
14
15
|
import type Label from "./Label.js";
|
|
@@ -51,10 +52,11 @@ type FocusAdaptor = ITabbable & {
|
|
|
51
52
|
* - [End] - Navigates to the last item.
|
|
52
53
|
* @constructor
|
|
53
54
|
* @extends UI5Element
|
|
55
|
+
* @implements {IOverflowToolbarItem}
|
|
54
56
|
* @public
|
|
55
57
|
* @since 1.0.0-rc.15
|
|
56
58
|
*/
|
|
57
|
-
declare class Breadcrumbs extends UI5Element {
|
|
59
|
+
declare class Breadcrumbs extends UI5Element implements IOverflowToolbarItem {
|
|
58
60
|
eventDetails: {
|
|
59
61
|
"item-click": BreadcrumbsItemClickEventDetail;
|
|
60
62
|
};
|
|
@@ -181,6 +183,7 @@ declare class Breadcrumbs extends UI5Element {
|
|
|
181
183
|
get _accessibleNameText(): string;
|
|
182
184
|
get _dropdownArrowAccessibleNameText(): string;
|
|
183
185
|
get _cancelButtonText(): string;
|
|
186
|
+
get hasOverflow(): boolean;
|
|
184
187
|
}
|
|
185
188
|
export default Breadcrumbs;
|
|
186
189
|
export type { BreadcrumbsItemClickEventDetail, };
|
package/dist/Breadcrumbs.js
CHANGED
|
@@ -52,6 +52,7 @@ import breadcrumbsPopoverCss from "./generated/themes/BreadcrumbsPopover.css.js"
|
|
|
52
52
|
* - [End] - Navigates to the last item.
|
|
53
53
|
* @constructor
|
|
54
54
|
* @extends UI5Element
|
|
55
|
+
* @implements {IOverflowToolbarItem}
|
|
55
56
|
* @public
|
|
56
57
|
* @since 1.0.0-rc.15
|
|
57
58
|
*/
|
|
@@ -452,6 +453,9 @@ let Breadcrumbs = Breadcrumbs_1 = class Breadcrumbs extends UI5Element {
|
|
|
452
453
|
get _cancelButtonText() {
|
|
453
454
|
return Breadcrumbs_1.i18nBundle.getText(BREADCRUMBS_CANCEL_BUTTON);
|
|
454
455
|
}
|
|
456
|
+
get hasOverflow() {
|
|
457
|
+
return true;
|
|
458
|
+
}
|
|
455
459
|
};
|
|
456
460
|
__decorate([
|
|
457
461
|
property()
|