@ui5/webcomponents 2.25.1-rc.0 → 2.25.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 +3 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/ListItem.d.ts +6 -2
- package/dist/ListItem.js +14 -2
- package/dist/ListItem.js.map +1 -1
- package/dist/SegmentedButton.d.ts +2 -1
- package/dist/SegmentedButton.js +5 -7
- package/dist/SegmentedButton.js.map +1 -1
- package/dist/SegmentedButtonItem.d.ts +2 -1
- package/dist/SegmentedButtonItem.js +5 -2
- package/dist/SegmentedButtonItem.js.map +1 -1
- package/dist/SegmentedButtonItemTemplate.js +1 -1
- package/dist/SegmentedButtonItemTemplate.js.map +1 -1
- package/dist/SegmentedButtonTemplate.js +1 -1
- package/dist/SegmentedButtonTemplate.js.map +1 -1
- package/dist/custom-elements-internal.json +34 -24
- package/dist/custom-elements.json +24 -24
- package/dist/types/ListItemType.d.ts +8 -0
- package/dist/types/ListItemType.js +8 -0
- package/dist/types/ListItemType.js.map +1 -1
- package/dist/vscode.html-custom-data.json +16 -8
- package/dist/web-types.json +25 -25
- package/package.json +9 -9
- package/src/SegmentedButtonItemTemplate.tsx +1 -0
- package/src/SegmentedButtonTemplate.tsx +1 -0
package/dist/ListItem.d.ts
CHANGED
|
@@ -58,10 +58,13 @@ declare abstract class ListItem extends ListItemBase {
|
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Defines the visual indication and behavior of the list items.
|
|
61
|
-
* Available options are `Active` (by default), `Inactive`, `Detail` and `Navigation`.
|
|
61
|
+
* Available options are `Active` (by default), `Inactive`, `InactiveSelectable`, `Detail` and `Navigation`.
|
|
62
62
|
*
|
|
63
63
|
* **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,
|
|
64
|
-
* while with type `Inactive` and `Detail` - will not.
|
|
64
|
+
* while with type `Inactive`, `InactiveSelectable` and `Detail` - will not.
|
|
65
|
+
*
|
|
66
|
+
* **Note:** `InactiveSelectable` behaves like `Inactive` but allows selection (checkbox/radio) to be toggled
|
|
67
|
+
* when the list has a selection mode. The `item-click` event is not fired for this type.
|
|
65
68
|
* @default "Active"
|
|
66
69
|
* @public
|
|
67
70
|
*/
|
|
@@ -181,6 +184,7 @@ declare abstract class ListItem extends ListItemBase {
|
|
|
181
184
|
onDetailClick(): void;
|
|
182
185
|
fireItemPress(e: Event): void;
|
|
183
186
|
get isInactive(): boolean;
|
|
187
|
+
get isInactiveSelectable(): boolean;
|
|
184
188
|
get placeSelectionElementBefore(): boolean;
|
|
185
189
|
get placeSelectionElementAfter(): boolean;
|
|
186
190
|
get modeSingleSelect(): boolean;
|
package/dist/ListItem.js
CHANGED
|
@@ -41,10 +41,13 @@ let ListItem = ListItem_1 = class ListItem extends ListItemBase {
|
|
|
41
41
|
super();
|
|
42
42
|
/**
|
|
43
43
|
* Defines the visual indication and behavior of the list items.
|
|
44
|
-
* Available options are `Active` (by default), `Inactive`, `Detail` and `Navigation`.
|
|
44
|
+
* Available options are `Active` (by default), `Inactive`, `InactiveSelectable`, `Detail` and `Navigation`.
|
|
45
45
|
*
|
|
46
46
|
* **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,
|
|
47
|
-
* while with type `Inactive` and `Detail` - will not.
|
|
47
|
+
* while with type `Inactive`, `InactiveSelectable` and `Detail` - will not.
|
|
48
|
+
*
|
|
49
|
+
* **Note:** `InactiveSelectable` behaves like `Inactive` but allows selection (checkbox/radio) to be toggled
|
|
50
|
+
* when the list has a selection mode. The `item-click` event is not fired for this type.
|
|
48
51
|
* @default "Active"
|
|
49
52
|
* @public
|
|
50
53
|
*/
|
|
@@ -227,6 +230,12 @@ let ListItem = ListItem_1 = class ListItem extends ListItemBase {
|
|
|
227
230
|
if (this.isInactive) {
|
|
228
231
|
return;
|
|
229
232
|
}
|
|
233
|
+
if (this.isInactiveSelectable) {
|
|
234
|
+
if (this.modeSingleSelect || this.modeMultiple) {
|
|
235
|
+
this.fireDecoratorEvent("selection-requested", { item: this, selected: !this.selected, selectionComponentPressed: false });
|
|
236
|
+
}
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
230
239
|
super.fireItemPress(e);
|
|
231
240
|
if (document.activeElement !== this) {
|
|
232
241
|
this.focus();
|
|
@@ -235,6 +244,9 @@ let ListItem = ListItem_1 = class ListItem extends ListItemBase {
|
|
|
235
244
|
get isInactive() {
|
|
236
245
|
return this.type === ListItemType.Inactive || this.type === ListItemType.Detail;
|
|
237
246
|
}
|
|
247
|
+
get isInactiveSelectable() {
|
|
248
|
+
return this.type === ListItemType.InactiveSelectable;
|
|
249
|
+
}
|
|
238
250
|
get placeSelectionElementBefore() {
|
|
239
251
|
return this._selectionMode === ListSelectionMode.Multiple
|
|
240
252
|
|| this._selectionMode === ListSelectionMode.SingleStart;
|
package/dist/ListItem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../src/ListItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAChC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAE5F,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,0CAA0C,CAAC;AAClD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,YAAY,MAAM,+DAA+D,CAAC;AACzF,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,YAAY,MAA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,CAAC;QAE7C,cAAc,CAAC,KAAK,EAAE,CAAC;QAEvB,OAAO,SAAS,CAAC;IAClB,CAAC;CACD,CAAA;AApgBA;IADC,QAAQ,EAAE;sCACwB;AAiBnC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDACmC;AAU9D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CACV;AASlB;IADC,QAAQ,EAAE;yCACM;AAOjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACb;AAUf;IADC,QAAQ,EAAE;2CACwB;AAQ3B;IADP,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACF;AAa1B;IADC,QAAQ,EAAE;gDACkC;AAG7C;IADC,QAAQ,EAAE;uDACoB;AAG/B;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;0DACE;AAGlC;IADC,QAAQ,EAAE;gDACqC;AAiBhD;IADC,QAAQ,EAAE;4CACM;AAWjB;IADC,IAAI,EAAE;8CACsB;AAUtB;IADN,IAAI,CAAC,oBAAoB,CAAC;kCACG;AAxIhB,QAAQ;IAnBtB,aAAa,CAAC;QACd,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,yBAAyB;YACzB,MAAM;SACN;KACD,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,OAAO,EAAE,IAAI;KACb,CAAC;IACD,KAAK,CAAC,qBAAqB,EAAE;QAC7B,OAAO,EAAE,IAAI;KACb,CAAC;GACa,QAAQ,CAmhBtB;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport {\n\tisSpace, isEnter, isDelete, isF2,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { getTabbableElements } from \"@ui5/webcomponents-base/dist/util/TabbableElements.js\";\nimport type { AccessibilityAttributes, AriaRole, AriaHasPopup } from \"@ui5/webcomponents-base\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport \"@ui5/webcomponents-icons/dist/decline.js\";\nimport \"@ui5/webcomponents-icons/dist/edit.js\";\nimport DragRegistry from \"@ui5/webcomponents-base/dist/util/dragAndDrop/DragRegistry.js\";\nimport Highlight from \"./types/Highlight.js\";\nimport ListItemType from \"./types/ListItemType.js\";\nimport ListSelectionMode from \"./types/ListSelectionMode.js\";\nimport ListItemBase from \"./ListItemBase.js\";\nimport type RadioButton from \"./RadioButton.js\";\nimport type CheckBox from \"./CheckBox.js\";\nimport type { IButton } from \"./Button.js\";\nimport {\n\tDELETE,\n\tARIA_LABEL_LIST_ITEM_CHECKBOX,\n\tARIA_LABEL_LIST_ITEM_RADIO_BUTTON,\n\tLIST_ITEM_ACTIVE,\n\tLIST_ITEM_SELECTED,\n\tLIST_ITEM_NOT_SELECTED,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type ListItemAccessibleRole from \"./types/ListItemAccessibleRole.js\";\n\n// Styles\nimport styles from \"./generated/themes/ListItem.css.js\";\nimport listItemAdditionalTextCss from \"./generated/themes/ListItemAdditionalText.css.js\";\n\n// Icons\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport type { Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\ninterface IAccessibleListItem {\n\taccessibleName?: string;\n\taccessibleNameRef?: string;\n}\n\ntype SelectionRequestEventDetail = {\n\titem: ListItemBase,\n\tselectionComponentPressed: boolean,\n\tselected?: boolean,\n\tkey?: string,\n}\n\ntype AccInfo = {\n\trole?: AriaRole | undefined;\n\tariaExpanded?: boolean;\n\tariaLevel?: number;\n\tariaLabel: string;\n\tariaLabelRadioButton: string;\n\tariaSelectedText?: string;\n\tariaHaspopup?: `${AriaHasPopup}`;\n\tposinset?: number;\n\tsetsize?: number;\n\tariaSelected?: boolean;\n\tariaChecked?: boolean;\n\tlistItemAriaLabel?: string;\n\tariaOwns?: string;\n\ttooltip?: string;\n\tariaKeyShortcuts?: string;\n\tariaDescribedBy?: string;\n}\n\ntype ListItemAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"ariaSetsize\" | \"ariaPosinset\">;\n\n/**\n * @class\n * A class to serve as a base\n * for the `ListItemStandard` and `ListItemCustom` classes.\n * @constructor\n * @abstract\n * @extends ListItemBase\n * @public\n */\n@customElement({\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\tlistItemAdditionalTextCss,\n\t\tstyles,\n\t],\n})\n/**\n * Fired when the user clicks on the detail button when type is `Detail`.\n * @public\n */\n@event(\"detail-click\", {\n\tbubbles: true,\n})\n@event(\"selection-requested\", {\n\tbubbles: true,\n})\nabstract class ListItem extends ListItemBase {\n\teventDetails!: ListItemBase[\"eventDetails\"] & {\n\t\t\"detail-click\": { item: ListItem, selected: boolean };\n\t\t\"selection-requested\": SelectionRequestEventDetail,\n\t}\n\t/**\n\t * Defines the visual indication and behavior of the list items.\n\t * Available options are `Active` (by default), `Inactive`, `Detail` and `Navigation`.\n\t *\n\t * **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,\n\t * while with type `Inactive` and `Detail` - will not.\n\t * @default \"Active\"\n\t * @public\n\t*/\n\t@property()\n\ttype: `${ListItemType}` = \"Active\";\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following fields are supported:\n\t *\n\t * - **ariaSetsize**: Defines the number of items in the current set when not all items in the set are present in the DOM.\n\t * **Note:** The value is an integer reflecting the number of items in the complete set. If the size of the entire set is unknown, set `-1`.\n\t *\n\t * \t- **ariaPosinset**: Defines an element's number or position in the current set when not all items are present in the DOM.\n\t * \t**Note:** The value is an integer greater than or equal to 1, and less than or equal to the size of the set when that size is known.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ListItemAccessibilityAttributes = {};\n\n\t/**\n\t * The navigated state of the list item.\n\t * If set to `true`, a navigation indicator is displayed at the end of the list item.\n\t * @default false\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\tnavigated = false;\n\n\t/**\n\t * Defines the text of the tooltip that would be displayed for the list item.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Indicates if the list item is active, e.g pressed down with the mouse or the keyboard keys.\n\t * @private\n\t*/\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines the highlight state of the list items.\n\t * Available options are: `\"None\"` (by default), `\"Positive\"`, `\"Critical\"`, `\"Information\"` and `\"Negative\"`.\n\t * @default \"None\"\n\t * @public\n\t * @since 1.24\n\t */\n\t@property()\n\thighlight: `${Highlight}` = \"None\";\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdeclare selected: boolean;\n\n\t/**\n\t * Used to define the role of the list item.\n\t *\n\t * **Note:** If not set, the role is automatically inherited from the parent `ui5-list` based on its `accessible-role` property\n\t * (e.g. `Menu` -> `MenuItem`, `Tree` -> `TreeItem`, `ListBox` -> `Option`).\n\t * An explicitly set `accessible-role` on the list item takes precedence over the inherited role.\n\t * @default undefined\n\t * @public\n\t * @since 2.23.0\n\t */\n\t@property()\n\taccessibleRole?: `${ListItemAccessibleRole}`;\n\n\t@property()\n\t_forcedAccessibleRole?: string;\n\n\t@property({ noAttribute: true })\n\t_inheritedAccessibleRole?: string;\n\n\t@property()\n\t_selectionMode: `${ListSelectionMode}` = \"None\";\n\n\t/**\n\t * Indicates whether the list item is in edit mode.\n\t * When active, Tab cycles through internal focusable elements\n\t * instead of navigating to the next list item.\n\t * Toggled by F2; also set by the parent List on F7.\n\t * @private\n\t */\n\t_editMode = false;\n\n\t/**\n\t * Defines the current media query size.\n\t * @default \"S\"\n\t * @private\n\t */\n\t@property()\n\tmediaRange = \"S\";\n\n\t/**\n\t * Defines the delete button, displayed in \"Delete\" mode.\n\t * **Note:** While the slot allows custom buttons, to match\n\t * design guidelines, please use the `ui5-button` component.\n\t * **Note:** When the slot is not present, a built-in delete button will be displayed.\n\t * @since 1.9.0\n\t * @public\n\t*/\n\t@slot()\n\tdeleteButton!: Slot<IButton>;\n\n\tdeactivateByKey: (e: KeyboardEvent) => void;\n\tdeactivate: () => void;\n\t// used in template, implemented in TreeItemBase, ListItemStandard\n\taccessibleName?: string;\n\t// used in ListItem template but implemented in TreeItemBase\n\tindeterminate?: boolean;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.deactivateByKey = (e: KeyboardEvent) => {\n\t\t\tif (isEnter(e)) {\n\t\t\t\tthis.deactivate();\n\t\t\t}\n\t\t};\n\n\t\tthis.deactivate = () => {\n\t\t\tif (this.active) {\n\t\t\t\tthis.active = false;\n\t\t\t}\n\t\t};\n\t}\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.actionable = (this.type === ListItemType.Active || this.type === ListItemType.Navigation) && (this._selectionMode !== ListSelectionMode.Delete);\n\t}\n\n\tonEnterDOM() {\n\t\tsuper.onEnterDOM();\n\t\tdocument.addEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.addEventListener(\"touchend\", this.deactivate);\n\t\tdocument.addEventListener(\"keyup\", this.deactivateByKey);\n\t}\n\n\tonExitDOM() {\n\t\tdocument.removeEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.removeEventListener(\"keyup\", this.deactivateByKey);\n\t\tdocument.removeEventListener(\"touchend\", this.deactivate);\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isInternalElementFocused = e.target !== this.getFocusDomRef();\n\n\t\tif ((isSpace(e) || isEnter(e)) && isInternalElementFocused) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper._onkeydown(e);\n\n\t\tconst itemActive = this.type === ListItemType.Active,\n\t\t\titemNavigated = this.typeNavigation;\n\n\t\tif ((isSpace(e) || isEnter(e)) && (itemActive || itemNavigated)) {\n\t\t\tthis.activate();\n\t\t}\n\n\t\tif (isF2(e)) {\n\t\t\tthis._handleF2();\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tsuper._onkeyup(e);\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.deactivate();\n\t\t}\n\n\t\tif (this.modeDelete && isDelete(e)) {\n\t\t\tthis.onDelete();\n\t\t}\n\t}\n\n\t_onmousedown() {\n\t\tthis.activate();\n\t}\n\n\t_onmouseup() {\n\t\tif (this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\t\tthis.deactivate();\n\t}\n\n\t_ontouchend() {\n\t\tthis._onmouseup();\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tsuper._onfocusin(e);\n\n\t\tif (e.target !== this.getFocusDomRef()) {\n\t\t\tthis.deactivate();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst relatedTarget = e.relatedTarget as Node;\n\t\t\tif (!relatedTarget || !(this.contains(relatedTarget) || this.shadowRoot!.contains(relatedTarget))) {\n\t\t\t\tthis._editMode = false;\n\t\t\t}\n\t\t}\n\n\t\tif (e.target !== this.getFocusDomRef()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\t_ondragstart(e: DragEvent) {\n\t\tif (!e.dataTransfer) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.target === this._listItem) {\n\t\t\tDragRegistry.setDraggedElement(this, e);\n\t\t\tthis.setAttribute(\"data-moving\", \"\");\n\t\t\te.dataTransfer.dropEffect = \"move\";\n\t\t\te.dataTransfer.effectAllowed = \"move\";\n\t\t}\n\t}\n\n\t_ondragend(e: DragEvent) {\n\t\tif (e.target === this._listItem) {\n\t\t\tDragRegistry.clearDraggedElement();\n\t\t\tthis.removeAttribute(\"data-moving\");\n\t\t}\n\t}\n\n\t/**\n\t * Called when selection components in Single (ui5-radio-button)\n\t * and Multi (ui5-checkbox) selection modes are used.\n\t */\n\tonMultiSelectionComponentPress(e: CustomEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selected: (e.target as CheckBox).checked, selectionComponentPressed: true });\n\t}\n\n\tonSingleSelectionComponentPress(e: CustomEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selected: !(e.target as RadioButton).checked, selectionComponentPressed: true });\n\t}\n\n\tactivate() {\n\t\tif (this.type === ListItemType.Active || this.type === ListItemType.Navigation) {\n\t\t\tthis.active = true;\n\t\t}\n\t}\n\n\tonDelete() {\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selectionComponentPressed: false });\n\t}\n\n\tonDetailClick() {\n\t\tthis.fireDecoratorEvent(\"detail-click\", { item: this, selected: this.selected });\n\t}\n\n\tfireItemPress(e: Event) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\t\tsuper.fireItemPress(e);\n\t\tif (document.activeElement !== this) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\n\tget isInactive() {\n\t\treturn this.type === ListItemType.Inactive || this.type === ListItemType.Detail;\n\t}\n\n\tget placeSelectionElementBefore() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple\n\t\t\t|| this._selectionMode === ListSelectionMode.SingleStart;\n\t}\n\n\tget placeSelectionElementAfter() {\n\t\treturn !this.placeSelectionElementBefore\n\t\t\t&& (this._selectionMode === ListSelectionMode.SingleEnd || this._selectionMode === ListSelectionMode.Delete);\n\t}\n\n\tget modeSingleSelect() {\n\t\treturn [\n\t\t\tListSelectionMode.SingleStart,\n\t\t\tListSelectionMode.SingleEnd,\n\t\t\tListSelectionMode.Single,\n\t\t].includes(this._selectionMode as ListSelectionMode);\n\t}\n\n\tget modeMultiple() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple;\n\t}\n\n\tget modeDelete() {\n\t\treturn this._selectionMode === ListSelectionMode.Delete;\n\t}\n\n\tget typeDetail() {\n\t\treturn this.type === ListItemType.Detail;\n\t}\n\n\tget typeNavigation() {\n\t\treturn this.type === ListItemType.Navigation;\n\t}\n\n\tget typeActive() {\n\t\treturn this.type === ListItemType.Active;\n\t}\n\n\tget _ariaSelected() {\n\t\tif (this.modeMultiple || this.modeSingleSelect) {\n\t\t\treturn this.selected;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget listItemAccessibleRole() {\n\t\tif (this._forcedAccessibleRole) {\n\t\t\treturn this._forcedAccessibleRole as AriaRole;\n\t\t}\n\t\tif (this.accessibleRole) {\n\t\t\treturn this.accessibleRole.toLowerCase() as AriaRole;\n\t\t}\n\t\treturn (this._inheritedAccessibleRole || \"listitem\") as AriaRole;\n\t}\n\n\tget ariaSelectedText() {\n\t\tlet ariaSelectedText;\n\n\t\t// Selected state needs to be supported separately since now the role mapping is list -> listitem[]\n\t\t// to avoid the issue of nesting interactive elements, ex. (option -> radio/checkbox);\n\t\t// The text is added to aria-describedby because as part of the aria-labelledby\n\t\t// the whole content of the item is readout when the aria-labelledby value is changed.\n\t\tif (this._ariaSelected !== undefined) {\n\t\t\tariaSelectedText = this._ariaSelected ? ListItem.i18nBundle.getText(LIST_ITEM_SELECTED) : ListItem.i18nBundle.getText(LIST_ITEM_NOT_SELECTED);\n\t\t}\n\n\t\treturn ariaSelectedText;\n\t}\n\n\tget deleteText() {\n\t\treturn ListItem.i18nBundle.getText(DELETE);\n\t}\n\n\tget hasDeleteButtonSlot() {\n\t\treturn !!this.deleteButton.length;\n\t}\n\n\tget _accessibleNameRef(): string {\n\t\tif ((this as IAccessibleListItem).accessibleName) {\n\t\t\t// accessibleName is set - return labels excluding content\n\t\t\treturn `${this._id}-invisibleText`;\n\t\t}\n\n\t\t// accessibleName is not set - return _accInfo.listItemAriaLabel including content\n\t\treturn `${this._id}-content ${this._id}-invisibleText`;\n\t}\n\n\tget ariaLabelledByText() {\n\t\tconst texts = [\n\t\t\tthis._accInfo.listItemAriaLabel,\n\t\t\tthis.accessibleName,\n\t\t\tthis.typeActive ? ListItem.i18nBundle.getText(LIST_ITEM_ACTIVE) : undefined,\n\t\t].filter(Boolean);\n\n\t\treturn texts.join(\" \");\n\t}\n\n\tget _ariaDescribedByIds() {\n\t\treturn `${this._id}-invisibleText-describedby`;\n\t}\n\n\tget _accInfo(): AccInfo {\n\t\treturn {\n\t\t\trole: this.listItemAccessibleRole,\n\t\t\tariaExpanded: undefined,\n\t\t\tariaLevel: undefined,\n\t\t\tariaLabel: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_CHECKBOX),\n\t\t\tariaLabelRadioButton: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_RADIO_BUTTON),\n\t\t\tariaSelected: this._ariaSelected,\n\t\t\tariaSelectedText: this.ariaSelectedText,\n\t\t\tariaHaspopup: this.accessibilityAttributes.hasPopup,\n\t\t\tsetsize: this.accessibilityAttributes.ariaSetsize,\n\t\t\tposinset: this.accessibilityAttributes.ariaPosinset,\n\t\t\ttooltip: this.tooltip,\n\t\t\tariaDescribedBy: this._ariaDescribedByIds || undefined,\n\t\t};\n\t}\n\n\tget _hasHighlightColor() {\n\t\treturn this.highlight !== Highlight.None;\n\t}\n\n\tget hasConfigurableMode() {\n\t\treturn true;\n\t}\n\n\tget _listItem() {\n\t\treturn this.shadowRoot!.querySelector(\"li\");\n\t}\n\n\t_handleF2() {\n\t\tconst focusDomRef = this.getFocusDomRef()!;\n\n\t\tif (getActiveElement() === focusDomRef) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tif (!focusables.length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._editMode = true;\n\t\t\tfocusables[0].focus();\n\t\t} else {\n\t\t\tthis._editMode = false;\n\t\t\tfocusDomRef.focus();\n\t\t}\n\t}\n\n\t_handleTabNext(e: KeyboardEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tconst currentIndex = this._indexOfActiveElement(focusables);\n\t\t\tconst nextIndex = currentIndex + 1;\n\n\t\t\tif (currentIndex !== -1 && nextIndex < focusables.length) {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusables[nextIndex].focus();\n\t\t\t} else if (!this.fireDecoratorEvent(\"forward-after\")) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.fireDecoratorEvent(\"forward-after\")) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_handleTabPrevious(e: KeyboardEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tconst currentIndex = this._indexOfActiveElement(focusables);\n\t\t\tif (currentIndex > 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusables[currentIndex - 1].focus();\n\t\t\t} else if (!this.fireDecoratorEvent(\"forward-before\")) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.fireDecoratorEvent(\"forward-before\")) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_getFocusableElements(): HTMLElement[] {\n\t\tconst focusDomRef = this.getFocusDomRef()!;\n\t\treturn getTabbableElements(focusDomRef);\n\t}\n\n\t_indexOfActiveElement(focusables: HTMLElement[]): number {\n\t\tconst activeElement = getActiveElement() as HTMLElement;\n\t\treturn focusables.findIndex(el => el === activeElement || (el.shadowRoot !== null && el.shadowRoot.contains(activeElement)));\n\t}\n\n\t_getFocusedElementIndex(): number {\n\t\treturn this._indexOfActiveElement(this._getFocusableElements());\n\t}\n\n\t_hasFocusableElements(): boolean {\n\t\treturn this._getFocusableElements().length > 0;\n\t}\n\n\t_isFocusOnInternalElement(): boolean {\n\t\treturn this._indexOfActiveElement(this._getFocusableElements()) !== -1;\n\t}\n\n\t_focusInternalElement(targetIndex: number) {\n\t\tconst focusables = this._getFocusableElements();\n\t\tif (!focusables.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeIndex = Math.min(targetIndex, focusables.length - 1);\n\t\tconst elementToFocus = focusables[safeIndex];\n\n\t\telementToFocus.focus();\n\n\t\treturn safeIndex;\n\t}\n}\n\nexport default ListItem;\nexport type {\n\tIAccessibleListItem,\n\tSelectionRequestEventDetail,\n\tListItemAccessibilityAttributes,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../src/ListItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAChC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAE5F,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,0CAA0C,CAAC;AAClD,OA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,CAAC,oBAAoB,CAAC;kCACG;AA3IhB,QAAQ;IAnBtB,aAAa,CAAC;QACd,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE;YACP,YAAY,CAAC,MAAM;YACnB,yBAAyB;YACzB,MAAM;SACN;KACD,CAAC;IACF;;;OAGG;;IACF,KAAK,CAAC,cAAc,EAAE;QACtB,OAAO,EAAE,IAAI;KACb,CAAC;IACD,KAAK,CAAC,qBAAqB,EAAE;QAC7B,OAAO,EAAE,IAAI;KACb,CAAC;GACa,QAAQ,CAgiBtB;AAED,eAAe,QAAQ,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport {\n\tisSpace, isEnter, isDelete, isF2,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\nimport { getTabbableElements } from \"@ui5/webcomponents-base/dist/util/TabbableElements.js\";\nimport type { AccessibilityAttributes, AriaRole, AriaHasPopup } from \"@ui5/webcomponents-base\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport \"@ui5/webcomponents-icons/dist/decline.js\";\nimport \"@ui5/webcomponents-icons/dist/edit.js\";\nimport DragRegistry from \"@ui5/webcomponents-base/dist/util/dragAndDrop/DragRegistry.js\";\nimport Highlight from \"./types/Highlight.js\";\nimport ListItemType from \"./types/ListItemType.js\";\nimport ListSelectionMode from \"./types/ListSelectionMode.js\";\nimport ListItemBase from \"./ListItemBase.js\";\nimport type RadioButton from \"./RadioButton.js\";\nimport type CheckBox from \"./CheckBox.js\";\nimport type { IButton } from \"./Button.js\";\nimport {\n\tDELETE,\n\tARIA_LABEL_LIST_ITEM_CHECKBOX,\n\tARIA_LABEL_LIST_ITEM_RADIO_BUTTON,\n\tLIST_ITEM_ACTIVE,\n\tLIST_ITEM_SELECTED,\n\tLIST_ITEM_NOT_SELECTED,\n} from \"./generated/i18n/i18n-defaults.js\";\nimport type ListItemAccessibleRole from \"./types/ListItemAccessibleRole.js\";\n\n// Styles\nimport styles from \"./generated/themes/ListItem.css.js\";\nimport listItemAdditionalTextCss from \"./generated/themes/ListItemAdditionalText.css.js\";\n\n// Icons\nimport \"@ui5/webcomponents-icons/dist/slim-arrow-right.js\";\nimport type { Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n\ninterface IAccessibleListItem {\n\taccessibleName?: string;\n\taccessibleNameRef?: string;\n}\n\ntype SelectionRequestEventDetail = {\n\titem: ListItemBase,\n\tselectionComponentPressed: boolean,\n\tselected?: boolean,\n\tkey?: string,\n}\n\ntype AccInfo = {\n\trole?: AriaRole | undefined;\n\tariaExpanded?: boolean;\n\tariaLevel?: number;\n\tariaLabel: string;\n\tariaLabelRadioButton: string;\n\tariaSelectedText?: string;\n\tariaHaspopup?: `${AriaHasPopup}`;\n\tposinset?: number;\n\tsetsize?: number;\n\tariaSelected?: boolean;\n\tariaChecked?: boolean;\n\tlistItemAriaLabel?: string;\n\tariaOwns?: string;\n\ttooltip?: string;\n\tariaKeyShortcuts?: string;\n\tariaDescribedBy?: string;\n}\n\ntype ListItemAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"ariaSetsize\" | \"ariaPosinset\">;\n\n/**\n * @class\n * A class to serve as a base\n * for the `ListItemStandard` and `ListItemCustom` classes.\n * @constructor\n * @abstract\n * @extends ListItemBase\n * @public\n */\n@customElement({\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\tstyles: [\n\t\tListItemBase.styles,\n\t\tlistItemAdditionalTextCss,\n\t\tstyles,\n\t],\n})\n/**\n * Fired when the user clicks on the detail button when type is `Detail`.\n * @public\n */\n@event(\"detail-click\", {\n\tbubbles: true,\n})\n@event(\"selection-requested\", {\n\tbubbles: true,\n})\nabstract class ListItem extends ListItemBase {\n\teventDetails!: ListItemBase[\"eventDetails\"] & {\n\t\t\"detail-click\": { item: ListItem, selected: boolean };\n\t\t\"selection-requested\": SelectionRequestEventDetail,\n\t}\n\t/**\n\t * Defines the visual indication and behavior of the list items.\n\t * Available options are `Active` (by default), `Inactive`, `InactiveSelectable`, `Detail` and `Navigation`.\n\t *\n\t * **Note:** When set to `Active` or `Navigation`, the item will provide visual response upon press and hover,\n\t * while with type `Inactive`, `InactiveSelectable` and `Detail` - will not.\n\t *\n\t * **Note:** `InactiveSelectable` behaves like `Inactive` but allows selection (checkbox/radio) to be toggled\n\t * when the list has a selection mode. The `item-click` event is not fired for this type.\n\t * @default \"Active\"\n\t * @public\n\t*/\n\t@property()\n\ttype: `${ListItemType}` = \"Active\";\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t * The following fields are supported:\n\t *\n\t * - **ariaSetsize**: Defines the number of items in the current set when not all items in the set are present in the DOM.\n\t * **Note:** The value is an integer reflecting the number of items in the complete set. If the size of the entire set is unknown, set `-1`.\n\t *\n\t * \t- **ariaPosinset**: Defines an element's number or position in the current set when not all items are present in the DOM.\n\t * \t**Note:** The value is an integer greater than or equal to 1, and less than or equal to the size of the set when that size is known.\n\t *\n\t * @default {}\n\t * @public\n\t * @since 1.15.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ListItemAccessibilityAttributes = {};\n\n\t/**\n\t * The navigated state of the list item.\n\t * If set to `true`, a navigation indicator is displayed at the end of the list item.\n\t * @default false\n\t * @public\n\t * @since 1.10.0\n\t */\n\t@property({ type: Boolean })\n\tnavigated = false;\n\n\t/**\n\t * Defines the text of the tooltip that would be displayed for the list item.\n\t * @default undefined\n\t * @public\n\t * @since 1.23.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Indicates if the list item is active, e.g pressed down with the mouse or the keyboard keys.\n\t * @private\n\t*/\n\t@property({ type: Boolean })\n\tactive = false;\n\n\t/**\n\t * Defines the highlight state of the list items.\n\t * Available options are: `\"None\"` (by default), `\"Positive\"`, `\"Critical\"`, `\"Information\"` and `\"Negative\"`.\n\t * @default \"None\"\n\t * @public\n\t * @since 1.24\n\t */\n\t@property()\n\thighlight: `${Highlight}` = \"None\";\n\n\t/**\n\t * Defines the selected state of the component.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdeclare selected: boolean;\n\n\t/**\n\t * Used to define the role of the list item.\n\t *\n\t * **Note:** If not set, the role is automatically inherited from the parent `ui5-list` based on its `accessible-role` property\n\t * (e.g. `Menu` -> `MenuItem`, `Tree` -> `TreeItem`, `ListBox` -> `Option`).\n\t * An explicitly set `accessible-role` on the list item takes precedence over the inherited role.\n\t * @default undefined\n\t * @public\n\t * @since 2.23.0\n\t */\n\t@property()\n\taccessibleRole?: `${ListItemAccessibleRole}`;\n\n\t@property()\n\t_forcedAccessibleRole?: string;\n\n\t@property({ noAttribute: true })\n\t_inheritedAccessibleRole?: string;\n\n\t@property()\n\t_selectionMode: `${ListSelectionMode}` = \"None\";\n\n\t/**\n\t * Indicates whether the list item is in edit mode.\n\t * When active, Tab cycles through internal focusable elements\n\t * instead of navigating to the next list item.\n\t * Toggled by F2; also set by the parent List on F7.\n\t * @private\n\t */\n\t_editMode = false;\n\n\t/**\n\t * Defines the current media query size.\n\t * @default \"S\"\n\t * @private\n\t */\n\t@property()\n\tmediaRange = \"S\";\n\n\t/**\n\t * Defines the delete button, displayed in \"Delete\" mode.\n\t * **Note:** While the slot allows custom buttons, to match\n\t * design guidelines, please use the `ui5-button` component.\n\t * **Note:** When the slot is not present, a built-in delete button will be displayed.\n\t * @since 1.9.0\n\t * @public\n\t*/\n\t@slot()\n\tdeleteButton!: Slot<IButton>;\n\n\tdeactivateByKey: (e: KeyboardEvent) => void;\n\tdeactivate: () => void;\n\t// used in template, implemented in TreeItemBase, ListItemStandard\n\taccessibleName?: string;\n\t// used in ListItem template but implemented in TreeItemBase\n\tindeterminate?: boolean;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.deactivateByKey = (e: KeyboardEvent) => {\n\t\t\tif (isEnter(e)) {\n\t\t\t\tthis.deactivate();\n\t\t\t}\n\t\t};\n\n\t\tthis.deactivate = () => {\n\t\t\tif (this.active) {\n\t\t\t\tthis.active = false;\n\t\t\t}\n\t\t};\n\t}\n\n\tonBeforeRendering() {\n\t\tsuper.onBeforeRendering();\n\t\tthis.actionable = (this.type === ListItemType.Active || this.type === ListItemType.Navigation) && (this._selectionMode !== ListSelectionMode.Delete);\n\t}\n\n\tonEnterDOM() {\n\t\tsuper.onEnterDOM();\n\t\tdocument.addEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.addEventListener(\"touchend\", this.deactivate);\n\t\tdocument.addEventListener(\"keyup\", this.deactivateByKey);\n\t}\n\n\tonExitDOM() {\n\t\tdocument.removeEventListener(\"mouseup\", this.deactivate);\n\t\tdocument.removeEventListener(\"keyup\", this.deactivateByKey);\n\t\tdocument.removeEventListener(\"touchend\", this.deactivate);\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tconst isInternalElementFocused = e.target !== this.getFocusDomRef();\n\n\t\tif ((isSpace(e) || isEnter(e)) && isInternalElementFocused) {\n\t\t\treturn;\n\t\t}\n\n\t\tsuper._onkeydown(e);\n\n\t\tconst itemActive = this.type === ListItemType.Active,\n\t\t\titemNavigated = this.typeNavigation;\n\n\t\tif ((isSpace(e) || isEnter(e)) && (itemActive || itemNavigated)) {\n\t\t\tthis.activate();\n\t\t}\n\n\t\tif (isF2(e)) {\n\t\t\tthis._handleF2();\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tsuper._onkeyup(e);\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.deactivate();\n\t\t}\n\n\t\tif (this.modeDelete && isDelete(e)) {\n\t\t\tthis.onDelete();\n\t\t}\n\t}\n\n\t_onmousedown() {\n\t\tthis.activate();\n\t}\n\n\t_onmouseup() {\n\t\tif (this.getFocusDomRef()!.matches(\":has(:focus-within)\")) {\n\t\t\treturn;\n\t\t}\n\t\tthis.deactivate();\n\t}\n\n\t_ontouchend() {\n\t\tthis._onmouseup();\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tsuper._onfocusin(e);\n\n\t\tif (e.target !== this.getFocusDomRef()) {\n\t\t\tthis.deactivate();\n\t\t}\n\t}\n\n\t_onfocusout(e: FocusEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst relatedTarget = e.relatedTarget as Node;\n\t\t\tif (!relatedTarget || !(this.contains(relatedTarget) || this.shadowRoot!.contains(relatedTarget))) {\n\t\t\t\tthis._editMode = false;\n\t\t\t}\n\t\t}\n\n\t\tif (e.target !== this.getFocusDomRef()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.deactivate();\n\t}\n\n\t_ondragstart(e: DragEvent) {\n\t\tif (!e.dataTransfer) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.target === this._listItem) {\n\t\t\tDragRegistry.setDraggedElement(this, e);\n\t\t\tthis.setAttribute(\"data-moving\", \"\");\n\t\t\te.dataTransfer.dropEffect = \"move\";\n\t\t\te.dataTransfer.effectAllowed = \"move\";\n\t\t}\n\t}\n\n\t_ondragend(e: DragEvent) {\n\t\tif (e.target === this._listItem) {\n\t\t\tDragRegistry.clearDraggedElement();\n\t\t\tthis.removeAttribute(\"data-moving\");\n\t\t}\n\t}\n\n\t/**\n\t * Called when selection components in Single (ui5-radio-button)\n\t * and Multi (ui5-checkbox) selection modes are used.\n\t */\n\tonMultiSelectionComponentPress(e: CustomEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selected: (e.target as CheckBox).checked, selectionComponentPressed: true });\n\t}\n\n\tonSingleSelectionComponentPress(e: CustomEvent) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selected: !(e.target as RadioButton).checked, selectionComponentPressed: true });\n\t}\n\n\tactivate() {\n\t\tif (this.type === ListItemType.Active || this.type === ListItemType.Navigation) {\n\t\t\tthis.active = true;\n\t\t}\n\t}\n\n\tonDelete() {\n\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selectionComponentPressed: false });\n\t}\n\n\tonDetailClick() {\n\t\tthis.fireDecoratorEvent(\"detail-click\", { item: this, selected: this.selected });\n\t}\n\n\tfireItemPress(e: Event) {\n\t\tif (this.isInactive) {\n\t\t\treturn;\n\t\t}\n\t\tif (this.isInactiveSelectable) {\n\t\t\tif (this.modeSingleSelect || this.modeMultiple) {\n\t\t\t\tthis.fireDecoratorEvent(\"selection-requested\", { item: this, selected: !this.selected, selectionComponentPressed: false });\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsuper.fireItemPress(e);\n\t\tif (document.activeElement !== this) {\n\t\t\tthis.focus();\n\t\t}\n\t}\n\n\tget isInactive() {\n\t\treturn this.type === ListItemType.Inactive || this.type === ListItemType.Detail;\n\t}\n\n\tget isInactiveSelectable() {\n\t\treturn this.type === ListItemType.InactiveSelectable;\n\t}\n\n\tget placeSelectionElementBefore() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple\n\t\t\t|| this._selectionMode === ListSelectionMode.SingleStart;\n\t}\n\n\tget placeSelectionElementAfter() {\n\t\treturn !this.placeSelectionElementBefore\n\t\t\t&& (this._selectionMode === ListSelectionMode.SingleEnd || this._selectionMode === ListSelectionMode.Delete);\n\t}\n\n\tget modeSingleSelect() {\n\t\treturn [\n\t\t\tListSelectionMode.SingleStart,\n\t\t\tListSelectionMode.SingleEnd,\n\t\t\tListSelectionMode.Single,\n\t\t].includes(this._selectionMode as ListSelectionMode);\n\t}\n\n\tget modeMultiple() {\n\t\treturn this._selectionMode === ListSelectionMode.Multiple;\n\t}\n\n\tget modeDelete() {\n\t\treturn this._selectionMode === ListSelectionMode.Delete;\n\t}\n\n\tget typeDetail() {\n\t\treturn this.type === ListItemType.Detail;\n\t}\n\n\tget typeNavigation() {\n\t\treturn this.type === ListItemType.Navigation;\n\t}\n\n\tget typeActive() {\n\t\treturn this.type === ListItemType.Active;\n\t}\n\n\tget _ariaSelected() {\n\t\tif (this.modeMultiple || this.modeSingleSelect) {\n\t\t\treturn this.selected;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tget listItemAccessibleRole() {\n\t\tif (this._forcedAccessibleRole) {\n\t\t\treturn this._forcedAccessibleRole as AriaRole;\n\t\t}\n\t\tif (this.accessibleRole) {\n\t\t\treturn this.accessibleRole.toLowerCase() as AriaRole;\n\t\t}\n\t\treturn (this._inheritedAccessibleRole || \"listitem\") as AriaRole;\n\t}\n\n\tget ariaSelectedText() {\n\t\tlet ariaSelectedText;\n\n\t\t// Selected state needs to be supported separately since now the role mapping is list -> listitem[]\n\t\t// to avoid the issue of nesting interactive elements, ex. (option -> radio/checkbox);\n\t\t// The text is added to aria-describedby because as part of the aria-labelledby\n\t\t// the whole content of the item is readout when the aria-labelledby value is changed.\n\t\tif (this._ariaSelected !== undefined) {\n\t\t\tariaSelectedText = this._ariaSelected ? ListItem.i18nBundle.getText(LIST_ITEM_SELECTED) : ListItem.i18nBundle.getText(LIST_ITEM_NOT_SELECTED);\n\t\t}\n\n\t\treturn ariaSelectedText;\n\t}\n\n\tget deleteText() {\n\t\treturn ListItem.i18nBundle.getText(DELETE);\n\t}\n\n\tget hasDeleteButtonSlot() {\n\t\treturn !!this.deleteButton.length;\n\t}\n\n\tget _accessibleNameRef(): string {\n\t\tif ((this as IAccessibleListItem).accessibleName) {\n\t\t\t// accessibleName is set - return labels excluding content\n\t\t\treturn `${this._id}-invisibleText`;\n\t\t}\n\n\t\t// accessibleName is not set - return _accInfo.listItemAriaLabel including content\n\t\treturn `${this._id}-content ${this._id}-invisibleText`;\n\t}\n\n\tget ariaLabelledByText() {\n\t\tconst texts = [\n\t\t\tthis._accInfo.listItemAriaLabel,\n\t\t\tthis.accessibleName,\n\t\t\tthis.typeActive ? ListItem.i18nBundle.getText(LIST_ITEM_ACTIVE) : undefined,\n\t\t].filter(Boolean);\n\n\t\treturn texts.join(\" \");\n\t}\n\n\tget _ariaDescribedByIds() {\n\t\treturn `${this._id}-invisibleText-describedby`;\n\t}\n\n\tget _accInfo(): AccInfo {\n\t\treturn {\n\t\t\trole: this.listItemAccessibleRole,\n\t\t\tariaExpanded: undefined,\n\t\t\tariaLevel: undefined,\n\t\t\tariaLabel: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_CHECKBOX),\n\t\t\tariaLabelRadioButton: ListItem.i18nBundle.getText(ARIA_LABEL_LIST_ITEM_RADIO_BUTTON),\n\t\t\tariaSelected: this._ariaSelected,\n\t\t\tariaSelectedText: this.ariaSelectedText,\n\t\t\tariaHaspopup: this.accessibilityAttributes.hasPopup,\n\t\t\tsetsize: this.accessibilityAttributes.ariaSetsize,\n\t\t\tposinset: this.accessibilityAttributes.ariaPosinset,\n\t\t\ttooltip: this.tooltip,\n\t\t\tariaDescribedBy: this._ariaDescribedByIds || undefined,\n\t\t};\n\t}\n\n\tget _hasHighlightColor() {\n\t\treturn this.highlight !== Highlight.None;\n\t}\n\n\tget hasConfigurableMode() {\n\t\treturn true;\n\t}\n\n\tget _listItem() {\n\t\treturn this.shadowRoot!.querySelector(\"li\");\n\t}\n\n\t_handleF2() {\n\t\tconst focusDomRef = this.getFocusDomRef()!;\n\n\t\tif (getActiveElement() === focusDomRef) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tif (!focusables.length) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._editMode = true;\n\t\t\tfocusables[0].focus();\n\t\t} else {\n\t\t\tthis._editMode = false;\n\t\t\tfocusDomRef.focus();\n\t\t}\n\t}\n\n\t_handleTabNext(e: KeyboardEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tconst currentIndex = this._indexOfActiveElement(focusables);\n\t\t\tconst nextIndex = currentIndex + 1;\n\n\t\t\tif (currentIndex !== -1 && nextIndex < focusables.length) {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusables[nextIndex].focus();\n\t\t\t} else if (!this.fireDecoratorEvent(\"forward-after\")) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.fireDecoratorEvent(\"forward-after\")) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_handleTabPrevious(e: KeyboardEvent) {\n\t\tif (this._editMode) {\n\t\t\tconst focusables = this._getFocusableElements();\n\t\t\tconst currentIndex = this._indexOfActiveElement(focusables);\n\t\t\tif (currentIndex > 0) {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusables[currentIndex - 1].focus();\n\t\t\t} else if (!this.fireDecoratorEvent(\"forward-before\")) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.fireDecoratorEvent(\"forward-before\")) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\t_getFocusableElements(): HTMLElement[] {\n\t\tconst focusDomRef = this.getFocusDomRef()!;\n\t\treturn getTabbableElements(focusDomRef);\n\t}\n\n\t_indexOfActiveElement(focusables: HTMLElement[]): number {\n\t\tconst activeElement = getActiveElement() as HTMLElement;\n\t\treturn focusables.findIndex(el => el === activeElement || (el.shadowRoot !== null && el.shadowRoot.contains(activeElement)));\n\t}\n\n\t_getFocusedElementIndex(): number {\n\t\treturn this._indexOfActiveElement(this._getFocusableElements());\n\t}\n\n\t_hasFocusableElements(): boolean {\n\t\treturn this._getFocusableElements().length > 0;\n\t}\n\n\t_isFocusOnInternalElement(): boolean {\n\t\treturn this._indexOfActiveElement(this._getFocusableElements()) !== -1;\n\t}\n\n\t_focusInternalElement(targetIndex: number) {\n\t\tconst focusables = this._getFocusableElements();\n\t\tif (!focusables.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeIndex = Math.min(targetIndex, focusables.length - 1);\n\t\tconst elementToFocus = focusables[safeIndex];\n\n\t\telementToFocus.focus();\n\n\t\treturn safeIndex;\n\t}\n}\n\nexport default ListItem;\nexport type {\n\tIAccessibleListItem,\n\tSelectionRequestEventDetail,\n\tListItemAccessibilityAttributes,\n};\n"]}
|
|
@@ -120,7 +120,8 @@ declare class SegmentedButton extends UI5Element {
|
|
|
120
120
|
get selectedItems(): Array<ISegmentedButtonItem>;
|
|
121
121
|
get navigatableItems(): SegmentedButtonItem[];
|
|
122
122
|
get ariaLabelText(): string | undefined;
|
|
123
|
-
get ariaDescriptionText(): string
|
|
123
|
+
get ariaDescriptionText(): string;
|
|
124
|
+
get ariaRoleDescription(): string;
|
|
124
125
|
}
|
|
125
126
|
export default SegmentedButton;
|
|
126
127
|
export type { SegmentedButtonSelectionChangeEventDetail, ISegmentedButtonItem, };
|
package/dist/SegmentedButton.js
CHANGED
|
@@ -15,9 +15,7 @@ import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
|
15
15
|
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
|
|
16
16
|
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
17
17
|
import { isSpace, isEnter, isShift, isEscape, isSpaceShift, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
18
|
-
import {
|
|
19
|
-
import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js";
|
|
20
|
-
import InvisibleMessageMode from "@ui5/webcomponents-base/dist/types/InvisibleMessageMode.js";
|
|
18
|
+
import { SEGMENTEDBUTTON_ARIA_DESCRIPTION, SEGMENTEDBUTTON_ARIA_DESCRIBEDBY } from "./generated/i18n/i18n-defaults.js";
|
|
21
19
|
import "./SegmentedButtonItem.js";
|
|
22
20
|
import SegmentedButtonSelectionMode from "./types/SegmentedButtonSelectionMode.js";
|
|
23
21
|
// Template
|
|
@@ -124,9 +122,6 @@ let SegmentedButton = SegmentedButton_1 = class SegmentedButton extends UI5Eleme
|
|
|
124
122
|
this.fireDecoratorEvent("selection-change", {
|
|
125
123
|
selectedItems: this.selectedItems,
|
|
126
124
|
});
|
|
127
|
-
if (target.selected) {
|
|
128
|
-
announce(SegmentedButton_1.i18nBundle.getText(LIST_ITEM_SELECTED), InvisibleMessageMode.Assertive);
|
|
129
|
-
}
|
|
130
125
|
this._itemNavigation.setCurrentItem(target);
|
|
131
126
|
return this;
|
|
132
127
|
}
|
|
@@ -212,7 +207,10 @@ let SegmentedButton = SegmentedButton_1 = class SegmentedButton extends UI5Eleme
|
|
|
212
207
|
return getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;
|
|
213
208
|
}
|
|
214
209
|
get ariaDescriptionText() {
|
|
215
|
-
return getEffectiveAriaDescriptionText(this) ||
|
|
210
|
+
return `${(getEffectiveAriaDescriptionText(this) || "")} ${SegmentedButton_1.i18nBundle.getText(SEGMENTEDBUTTON_ARIA_DESCRIBEDBY)}`.trim();
|
|
211
|
+
}
|
|
212
|
+
get ariaRoleDescription() {
|
|
213
|
+
return SegmentedButton_1.i18nBundle.getText(SEGMENTEDBUTTON_ARIA_DESCRIPTION);
|
|
216
214
|
}
|
|
217
215
|
};
|
|
218
216
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedButton.js","sourceRoot":"","sources":["../src/SegmentedButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,wDAAwD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E,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,aAAa;QAChB,OAAO,yBAAyB,CAAC,IAAI,CAAC,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;IACzF,CAAC;IAED,IAAI,mBAAmB;QACtB,OAAO,+BAA+B,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;IAC3D,CAAC;CACD,CAAA;AA9PA;IADC,QAAQ,EAAE;uDACa;AASxB;IADC,QAAQ,EAAE;0DACgB;AAS3B;IADC,QAAQ,EAAE;8DACoB;AAS/B;IADC,QAAQ,EAAE;iEACuB;AASlC;IADC,QAAQ,EAAE;sDACiD;AAa5D;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDACK;AAUjC;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;8CAClC;AAGnC;IADN,IAAI,CAAC,oBAAoB,CAAC;yCACG;AAzEzB,eAAe;IAhBpB,aAAa,CAAC;QACd,GAAG,EAAE,sBAAsB;QAC3B,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,uBAAuB;QACjC,MAAM,EAAE,kBAAkB;KAC1B,CAAC;IACF;;;;OAIG;;IACF,KAAK,CAAC,kBAAkB,EAAE;QAC1B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,eAAe,CAyQpB;AAED,eAAe,CAAC,MAAM,EAAE,CAAC;AAEzB,eAAe,eAAe,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetEffectiveAriaDescriptionText,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport ItemNavigation from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport {\n\tisSpace,\n\tisEnter,\n\tisShift,\n\tisEscape,\n\tisSpaceShift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { LIST_ITEM_SELECTED } from \"./generated/i18n/i18n-defaults.js\";\nimport announce from \"@ui5/webcomponents-base/dist/util/InvisibleMessage.js\";\nimport InvisibleMessageMode from \"@ui5/webcomponents-base/dist/types/InvisibleMessageMode.js\";\nimport \"./SegmentedButtonItem.js\";\nimport type SegmentedButtonItem from \"./SegmentedButtonItem.js\";\nimport SegmentedButtonSelectionMode from \"./types/SegmentedButtonSelectionMode.js\";\n\n// Template\nimport SegmentedButtonTemplate from \"./SegmentedButtonTemplate.js\";\n\n// Styles\nimport SegmentedButtonCss from \"./generated/themes/SegmentedButton.css.js\";\n\n/**\n * Interface for components that may be slotted inside `ui5-segmented-button` as items\n * @public\n */\ninterface ISegmentedButtonItem extends UI5Element, ITabbable {\n\tdisabled: boolean,\n\tselected: boolean,\n}\n\ntype SegmentedButtonSelectionChangeEventDetail = {\n\tselectedItems: Array<ISegmentedButtonItem>,\n}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-segmented-button` shows a group of items. When the user clicks or taps\n * one of the items, it stays in a pressed state. It automatically resizes the items\n * to fit proportionally within the component. When no width is set, the component uses the available width.\n *\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SegmentedButton.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @public\n */\n@customElement({\n\ttag: \"ui5-segmented-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: SegmentedButtonTemplate,\n\tstyles: SegmentedButtonCss,\n})\n/**\n * Fired when the selected item changes.\n * @param {Array<ISegmentedButtonItem>} selectedItems an array of selected items. Since: 1.14.0\n * @public\n */\n@event(\"selection-change\", {\n\tbubbles: true,\n})\n\nclass SegmentedButton extends UI5Element {\n\teventDetails!: {\n\t\t\"selection-change\": SegmentedButtonSelectionChangeEventDetail,\n\t}\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.3\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that describe the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescriptionRef?: string;\n\n\t/**\n\t * Defines the component selection mode.\n\t * @default \"Single\"\n\t * @public\n\t * @since 1.14.0\n\t */\n\t@property()\n\tselectionMode: `${SegmentedButtonSelectionMode}` = \"Single\";\n\n\t/**\n\t * Determines whether the segmented button items should be sized to fit their content.\n\t *\n\t * If set to `true`, each item will be sized to fit its content, with any extra space distributed after the last item.\n\t * If set to `false` (the default), all items will be equally sized to fill the available space.\n\t *\n\t * @default false\n\t * @public\n\t * @since 2.16.0\n\t*/\n\t@property({ type: Boolean })\n\titemsFitContent: boolean = false;\n\t/**\n\t * Defines the items of `ui5-segmented-button`.\n\t *\n\t * **Note:** Multiple items are allowed.\n\t *\n\t * **Note:** Use the `ui5-segmented-button-item` for the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, invalidateOnChildChange: true, \"default\": true })\n\titems!: DefaultSlot<ISegmentedButtonItem>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_itemNavigation: ItemNavigation;\n\n\thasPreviouslyFocusedItem: boolean;\n\n\t_selectedItem?: ISegmentedButtonItem;\n\n\t_cancelAction: boolean;\n\t_isSpacePressed: boolean;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._itemNavigation = new ItemNavigation(this, {\n\t\t\tgetItemsCallback: () => this.navigatableItems,\n\t\t});\n\t\tthis.hasPreviouslyFocusedItem = false;\n\t\tthis._cancelAction = false;\n\t\tthis._isSpacePressed = false;\n\t}\n\n\tonBeforeRendering() {\n\t\tconst items = this.getSlottedNodes<SegmentedButtonItem>(\"items\");\n\t\tconst visibleItems = items.filter(item => !item.hidden);\n\t\tlet index = 1;\n\n\t\titems.forEach(item => {\n\t\t\titem.posInSet = item.hidden ? undefined : index++;\n\t\t\titem.sizeOfSet = item.hidden ? undefined : visibleItems.length;\n\t\t});\n\n\t\tthis.normalizeSelection();\n\n\t\tif (!this.itemsFitContent) {\n\t\t\tthis.style.setProperty(\"--_ui5_segmented_btn_items_count\", `${visibleItems.length}`);\n\t\t}\n\t}\n\n\tnormalizeSelection() {\n\t\tif (!this.items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (this.selectionMode) {\n\t\tcase SegmentedButtonSelectionMode.Single: {\n\t\t\tconst selectedItems = this.selectedItems;\n\t\t\tconst selectedItemIndex = this._selectedItem ? selectedItems.indexOf(this._selectedItem) : -1;\n\t\t\tif (this._selectedItem && selectedItems.length > 1) {\n\t\t\t\tselectedItems.splice(selectedItemIndex, 1);\n\t\t\t}\n\t\t\tconst selectedItem = selectedItems.pop() || this.items[0];\n\t\t\tthis._applySingleSelection(selectedItem);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t}\n\t}\n\n\tgetFocusDomRef(): HTMLElement | undefined {\n\t\treturn this._itemNavigation._getCurrentItem();\n\t}\n\n\t_selectItem(e: MouseEvent | KeyboardEvent) {\n\t\tconst target = e.target as SegmentedButtonItem;\n\t\tconst isTargetSegmentedButtonItem = target.hasAttribute(\"ui5-segmented-button-item\");\n\n\t\tif (target.disabled || target === this.getDomRef() || !isTargetSegmentedButtonItem) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if preventDefault was called on the native event (e.g., by item's semantic click handler)\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (this.selectionMode) {\n\t\tcase SegmentedButtonSelectionMode.Multiple:\n\t\t\ttarget.selected = !target.selected;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthis._applySingleSelection(target as unknown as ISegmentedButtonItem);\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-change\", {\n\t\t\tselectedItems: this.selectedItems,\n\t\t});\n\n\t\tif (target.selected) {\n\t\t\tannounce(SegmentedButton.i18nBundle.getText(LIST_ITEM_SELECTED), InvisibleMessageMode.Assertive);\n\t\t}\n\n\t\tthis._itemNavigation.setCurrentItem(target);\n\n\t\treturn this;\n\t}\n\n\t_applySingleSelection(item: ISegmentedButtonItem) {\n\t\tthis.items.forEach(currentItem => {\n\t\t\tcurrentItem.selected = false;\n\t\t});\n\t\titem.selected = true;\n\t\tthis._selectedItem = item;\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tthis._selectItem(e);\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (isEnter(e)) {\n\t\t\tthis._selectItem(e);\n\t\t} else if (isSpace(e)) {\n\t\t\te.preventDefault(); // Prevent scrolling\n\t\t\tthis._isSpacePressed = true;\n\t\t} else if (isShift(e) || isEscape(e)) {\n\t\t\tthis._cancelAction = true; // Set the flag to cancel the action\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tconst isSpaceKey = isSpace(e);\n\t\tconst isCancelKey = isShift(e) || isEscape(e);\n\n\t\tif (isSpaceKey || isSpaceShift(e)) {\n\t\t\tif (this._cancelAction) {\n\t\t\t\tthis._cancelAction = false;\n\t\t\t\tthis._isSpacePressed = false;\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._isSpacePressed = false;\n\t\t} else if (isCancelKey && !this._isSpacePressed) {\n\t\t\tthis._cancelAction = false;\n\t\t}\n\n\t\tif (isSpaceKey) {\n\t\t\tthis._selectItem(e);\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tconst eventTarget = e.target as SegmentedButtonItem;\n\t\tconst isTargetSegmentedButtonItem = eventTarget.hasAttribute(\"ui5-segmented-button-item\");\n\n\t\tif (isTargetSegmentedButtonItem) {\n\t\t\tthis._itemNavigation.setCurrentItem(eventTarget);\n\t\t\tthis.hasPreviouslyFocusedItem = true;\n\t\t}\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\t// If the component was previously focused,\n\t\t// update the ItemNavigation to sync the button's tabindex values\n\t\tif (this.hasPreviouslyFocusedItem) {\n\t\t\tthis._itemNavigation.setCurrentItem(e.target as SegmentedButtonItem);\n\t\t\treturn;\n\t\t}\n\n\t\t// If the component is focused for the first time\n\t\t// focus the selected item if such is present\n\t\tif (this.selectedItems.length) {\n\t\t\tthis._itemNavigation.setCurrentItem(this.selectedItems[0]);\n\t\t\tthis.selectedItems[0].focus();\n\t\t\tthis.hasPreviouslyFocusedItem = true;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of the currently selected items.\n\t * @since 1.14.0\n\t * @public\n\t * @default []\n\t */\n\tget selectedItems(): Array<ISegmentedButtonItem> {\n\t\treturn this.items.filter(item => item.selected);\n\t}\n\n\tget navigatableItems() {\n\t\treturn this.getSlottedNodes<SegmentedButtonItem>(\"items\").filter(item => {\n\t\t\treturn !item.disabled;\n\t\t});\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn getEffectiveAriaDescriptionText(this) || undefined;\n\t}\n}\n\nSegmentedButton.define();\n\nexport default SegmentedButton;\nexport type {\n\tSegmentedButtonSelectionChangeEventDetail,\n\tISegmentedButtonItem,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"SegmentedButton.js","sourceRoot":"","sources":["../src/SegmentedButton.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAEpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,GAC/B,MAAM,+DAA+D,CAAC;AACvE,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,cAAc,MAAM,yDAAyD,CAAC;AAGrF,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,YAAY,GACZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACvH,OAAO,0BAA0B,CAAC;AAElC,OAAO,4BAA4B,MAAM,yCAAyC,CAAC;AAEnF,WAAW;AACX,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE,SAAS;AACT,OAAO,kBAAkB,MAAM,2CAA2C,CAAC;AAe3E;;;;;;;;;;;;;;;;;GAiBG;AAiBH,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,UAAU;IAoFvC;QACC,KAAK,EAAE,CAAC;QA7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IAhBpB,aAAa,CAAC;QACd,GAAG,EAAE,sBAAsB;QAC3B,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,uBAAuB;QACjC,MAAM,EAAE,kBAAkB;KAC1B,CAAC;IACF;;;;OAIG;;IACF,KAAK,CAAC,kBAAkB,EAAE;QAC1B,OAAO,EAAE,IAAI;KACb,CAAC;GAEI,eAAe,CAyQpB;AAED,eAAe,CAAC,MAAM,EAAE,CAAC;AAEzB,eAAe,eAAe,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetEffectiveAriaDescriptionText,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport ItemNavigation from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport {\n\tisSpace,\n\tisEnter,\n\tisShift,\n\tisEscape,\n\tisSpaceShift,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { SEGMENTEDBUTTON_ARIA_DESCRIPTION, SEGMENTEDBUTTON_ARIA_DESCRIBEDBY } from \"./generated/i18n/i18n-defaults.js\";\nimport \"./SegmentedButtonItem.js\";\nimport type SegmentedButtonItem from \"./SegmentedButtonItem.js\";\nimport SegmentedButtonSelectionMode from \"./types/SegmentedButtonSelectionMode.js\";\n\n// Template\nimport SegmentedButtonTemplate from \"./SegmentedButtonTemplate.js\";\n\n// Styles\nimport SegmentedButtonCss from \"./generated/themes/SegmentedButton.css.js\";\n\n/**\n * Interface for components that may be slotted inside `ui5-segmented-button` as items\n * @public\n */\ninterface ISegmentedButtonItem extends UI5Element, ITabbable {\n\tdisabled: boolean,\n\tselected: boolean,\n}\n\ntype SegmentedButtonSelectionChangeEventDetail = {\n\tselectedItems: Array<ISegmentedButtonItem>,\n}\n\n/**\n * @class\n *\n * ### Overview\n *\n * The `ui5-segmented-button` shows a group of items. When the user clicks or taps\n * one of the items, it stays in a pressed state. It automatically resizes the items\n * to fit proportionally within the component. When no width is set, the component uses the available width.\n *\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SegmentedButton.js\";`\n * @constructor\n * @extends UI5Element\n * @since 1.0.0-rc.6\n * @public\n */\n@customElement({\n\ttag: \"ui5-segmented-button\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: SegmentedButtonTemplate,\n\tstyles: SegmentedButtonCss,\n})\n/**\n * Fired when the selected item changes.\n * @param {Array<ISegmentedButtonItem>} selectedItems an array of selected items. Since: 1.14.0\n * @public\n */\n@event(\"selection-change\", {\n\tbubbles: true,\n})\n\nclass SegmentedButton extends UI5Element {\n\teventDetails!: {\n\t\t\"selection-change\": SegmentedButtonSelectionChangeEventDetail,\n\t}\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.3\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that describe the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescriptionRef?: string;\n\n\t/**\n\t * Defines the component selection mode.\n\t * @default \"Single\"\n\t * @public\n\t * @since 1.14.0\n\t */\n\t@property()\n\tselectionMode: `${SegmentedButtonSelectionMode}` = \"Single\";\n\n\t/**\n\t * Determines whether the segmented button items should be sized to fit their content.\n\t *\n\t * If set to `true`, each item will be sized to fit its content, with any extra space distributed after the last item.\n\t * If set to `false` (the default), all items will be equally sized to fill the available space.\n\t *\n\t * @default false\n\t * @public\n\t * @since 2.16.0\n\t*/\n\t@property({ type: Boolean })\n\titemsFitContent: boolean = false;\n\t/**\n\t * Defines the items of `ui5-segmented-button`.\n\t *\n\t * **Note:** Multiple items are allowed.\n\t *\n\t * **Note:** Use the `ui5-segmented-button-item` for the intended design.\n\t * @public\n\t */\n\t@slot({ type: HTMLElement, invalidateOnChildChange: true, \"default\": true })\n\titems!: DefaultSlot<ISegmentedButtonItem>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\t_itemNavigation: ItemNavigation;\n\n\thasPreviouslyFocusedItem: boolean;\n\n\t_selectedItem?: ISegmentedButtonItem;\n\n\t_cancelAction: boolean;\n\t_isSpacePressed: boolean;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._itemNavigation = new ItemNavigation(this, {\n\t\t\tgetItemsCallback: () => this.navigatableItems,\n\t\t});\n\t\tthis.hasPreviouslyFocusedItem = false;\n\t\tthis._cancelAction = false;\n\t\tthis._isSpacePressed = false;\n\t}\n\n\tonBeforeRendering() {\n\t\tconst items = this.getSlottedNodes<SegmentedButtonItem>(\"items\");\n\t\tconst visibleItems = items.filter(item => !item.hidden);\n\t\tlet index = 1;\n\n\t\titems.forEach(item => {\n\t\t\titem.posInSet = item.hidden ? undefined : index++;\n\t\t\titem.sizeOfSet = item.hidden ? undefined : visibleItems.length;\n\t\t});\n\n\t\tthis.normalizeSelection();\n\n\t\tif (!this.itemsFitContent) {\n\t\t\tthis.style.setProperty(\"--_ui5_segmented_btn_items_count\", `${visibleItems.length}`);\n\t\t}\n\t}\n\n\tnormalizeSelection() {\n\t\tif (!this.items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (this.selectionMode) {\n\t\tcase SegmentedButtonSelectionMode.Single: {\n\t\t\tconst selectedItems = this.selectedItems;\n\t\t\tconst selectedItemIndex = this._selectedItem ? selectedItems.indexOf(this._selectedItem) : -1;\n\t\t\tif (this._selectedItem && selectedItems.length > 1) {\n\t\t\t\tselectedItems.splice(selectedItemIndex, 1);\n\t\t\t}\n\t\t\tconst selectedItem = selectedItems.pop() || this.items[0];\n\t\t\tthis._applySingleSelection(selectedItem);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t}\n\t}\n\n\tgetFocusDomRef(): HTMLElement | undefined {\n\t\treturn this._itemNavigation._getCurrentItem();\n\t}\n\n\t_selectItem(e: MouseEvent | KeyboardEvent) {\n\t\tconst target = e.target as SegmentedButtonItem;\n\t\tconst isTargetSegmentedButtonItem = target.hasAttribute(\"ui5-segmented-button-item\");\n\n\t\tif (target.disabled || target === this.getDomRef() || !isTargetSegmentedButtonItem) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if preventDefault was called on the native event (e.g., by item's semantic click handler)\n\t\tif (e.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (this.selectionMode) {\n\t\tcase SegmentedButtonSelectionMode.Multiple:\n\t\t\ttarget.selected = !target.selected;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthis._applySingleSelection(target as unknown as ISegmentedButtonItem);\n\t\t}\n\n\t\tthis.fireDecoratorEvent(\"selection-change\", {\n\t\t\tselectedItems: this.selectedItems,\n\t\t});\n\n\t\tthis._itemNavigation.setCurrentItem(target);\n\n\t\treturn this;\n\t}\n\n\t_applySingleSelection(item: ISegmentedButtonItem) {\n\t\tthis.items.forEach(currentItem => {\n\t\t\tcurrentItem.selected = false;\n\t\t});\n\t\titem.selected = true;\n\t\tthis._selectedItem = item;\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tthis._selectItem(e);\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (isEnter(e)) {\n\t\t\tthis._selectItem(e);\n\t\t} else if (isSpace(e)) {\n\t\t\te.preventDefault(); // Prevent scrolling\n\t\t\tthis._isSpacePressed = true;\n\t\t} else if (isShift(e) || isEscape(e)) {\n\t\t\tthis._cancelAction = true; // Set the flag to cancel the action\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tconst isSpaceKey = isSpace(e);\n\t\tconst isCancelKey = isShift(e) || isEscape(e);\n\n\t\tif (isSpaceKey || isSpaceShift(e)) {\n\t\t\tif (this._cancelAction) {\n\t\t\t\tthis._cancelAction = false;\n\t\t\t\tthis._isSpacePressed = false;\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._isSpacePressed = false;\n\t\t} else if (isCancelKey && !this._isSpacePressed) {\n\t\t\tthis._cancelAction = false;\n\t\t}\n\n\t\tif (isSpaceKey) {\n\t\t\tthis._selectItem(e);\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tconst eventTarget = e.target as SegmentedButtonItem;\n\t\tconst isTargetSegmentedButtonItem = eventTarget.hasAttribute(\"ui5-segmented-button-item\");\n\n\t\tif (isTargetSegmentedButtonItem) {\n\t\t\tthis._itemNavigation.setCurrentItem(eventTarget);\n\t\t\tthis.hasPreviouslyFocusedItem = true;\n\t\t}\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\t// If the component was previously focused,\n\t\t// update the ItemNavigation to sync the button's tabindex values\n\t\tif (this.hasPreviouslyFocusedItem) {\n\t\t\tthis._itemNavigation.setCurrentItem(e.target as SegmentedButtonItem);\n\t\t\treturn;\n\t\t}\n\n\t\t// If the component is focused for the first time\n\t\t// focus the selected item if such is present\n\t\tif (this.selectedItems.length) {\n\t\t\tthis._itemNavigation.setCurrentItem(this.selectedItems[0]);\n\t\t\tthis.selectedItems[0].focus();\n\t\t\tthis.hasPreviouslyFocusedItem = true;\n\t\t}\n\t}\n\n\t/**\n\t * Returns an array of the currently selected items.\n\t * @since 1.14.0\n\t * @public\n\t * @default []\n\t */\n\tget selectedItems(): Array<ISegmentedButtonItem> {\n\t\treturn this.items.filter(item => item.selected);\n\t}\n\n\tget navigatableItems() {\n\t\treturn this.getSlottedNodes<SegmentedButtonItem>(\"items\").filter(item => {\n\t\t\treturn !item.disabled;\n\t\t});\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn `${(getEffectiveAriaDescriptionText(this) || \"\")} ${SegmentedButton.i18nBundle.getText(SEGMENTEDBUTTON_ARIA_DESCRIBEDBY)}`.trim();\n\t}\n\n\tget ariaRoleDescription() {\n\t\treturn SegmentedButton.i18nBundle.getText(SEGMENTEDBUTTON_ARIA_DESCRIPTION);\n\t}\n}\n\nSegmentedButton.define();\n\nexport default SegmentedButton;\nexport type {\n\tSegmentedButtonSelectionChangeEventDetail,\n\tISegmentedButtonItem,\n};\n"]}
|
|
@@ -131,6 +131,7 @@ declare class SegmentedButtonItem extends UI5Element implements IButton, ISegmen
|
|
|
131
131
|
*/
|
|
132
132
|
text: DefaultSlot<Node>;
|
|
133
133
|
static i18nBundle: I18nBundle;
|
|
134
|
+
get ariaDescription(): string;
|
|
134
135
|
constructor();
|
|
135
136
|
_onclick(e: MouseEvent): void;
|
|
136
137
|
onEnterDOM(): void;
|
|
@@ -138,7 +139,7 @@ declare class SegmentedButtonItem extends UI5Element implements IButton, ISegmen
|
|
|
138
139
|
_onkeyup(e: KeyboardEvent): void;
|
|
139
140
|
get tabIndexValue(): string | undefined;
|
|
140
141
|
get ariaLabelText(): string | undefined;
|
|
141
|
-
get ariaDescriptionText(): string;
|
|
142
|
+
get ariaDescriptionText(): string | undefined;
|
|
142
143
|
get showIconTooltip(): boolean;
|
|
143
144
|
get slotTextContent(): string;
|
|
144
145
|
}
|
|
@@ -16,7 +16,7 @@ import { getEffectiveAriaLabelText, getAssociatedLabelForTexts, getEffectiveAria
|
|
|
16
16
|
import willShowContent from "@ui5/webcomponents-base/dist/util/willShowContent.js";
|
|
17
17
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
|
|
18
18
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
19
|
-
import {
|
|
19
|
+
import { SEGMENTEDBUTTONITEM_ARIA_DESCRIPTION } from "./generated/i18n/i18n-defaults.js";
|
|
20
20
|
import SegmentedButtonItemTemplate from "./SegmentedButtonItemTemplate.js";
|
|
21
21
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
22
22
|
import segmentedButtonItemCss from "./generated/themes/SegmentedButtonItem.css.js";
|
|
@@ -42,6 +42,9 @@ import segmentedButtonItemCss from "./generated/themes/SegmentedButtonItem.css.j
|
|
|
42
42
|
* @public
|
|
43
43
|
*/
|
|
44
44
|
let SegmentedButtonItem = SegmentedButtonItem_1 = class SegmentedButtonItem extends UI5Element {
|
|
45
|
+
get ariaDescription() {
|
|
46
|
+
return SegmentedButtonItem_1.i18nBundle.getText(SEGMENTEDBUTTONITEM_ARIA_DESCRIPTION);
|
|
47
|
+
}
|
|
45
48
|
constructor() {
|
|
46
49
|
super();
|
|
47
50
|
/**
|
|
@@ -128,7 +131,7 @@ let SegmentedButtonItem = SegmentedButtonItem_1 = class SegmentedButtonItem exte
|
|
|
128
131
|
return getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;
|
|
129
132
|
}
|
|
130
133
|
get ariaDescriptionText() {
|
|
131
|
-
return
|
|
134
|
+
return getEffectiveAriaDescriptionText(this) || undefined;
|
|
132
135
|
}
|
|
133
136
|
get showIconTooltip() {
|
|
134
137
|
return getEnableDefaultTooltips() && this.iconOnly && !this.tooltip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedButtonItem.js","sourceRoot":"","sources":["../src/SegmentedButtonItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAGpE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,GAC/B,MAAM,+DAA+D,CAAC;AACvE,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AAErF,OAAO,2BAA2B,MAAM,kCAAkC,CAAC;AAG3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAC5E,OAAO,sBAAsB,MAAM,+CAA+C,CAAC;AAMnF;;;;;;;;;;;;;;;;;;;;GAoBG;AAsBH,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAwI3C;QACC,KAAK,EAAE,CAAC;QArIT;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;WAIG;QAEH,aAAQ,GAAG,KAAK,CAAC;QA6DjB;;;WAGG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;WAGG;QAEH,mBAAc,GAAG,KAAK,CAAC;QASvB;;;;WAIG;QAEH,aAAQ,GA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2DACR;AAQxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACb;AAQd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACZ;AAMf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDACb;AASf;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;iDACb;AAGlB;IADN,IAAI,CAAC,oBAAoB,CAAC;6CACG;AAtIzB,mBAAmB;IArBxB,aAAa,CAAC;QACd,GAAG,EAAE,2BAA2B;QAChC,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,2BAA2B;QACrC,MAAM,EAAE,sBAAsB;KAC9B,CAAC;IAEF;;;;;;;;OAQG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GAEI,mBAAmB,CAiNxB;AAED,mBAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { isSpaceShift } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetEffectiveAriaDescriptionText,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport { SEGMENTEDBUTTON_ARIA_DESCRIBEDBY } from \"./generated/i18n/i18n-defaults.js\";\nimport type { ISegmentedButtonItem } from \"./SegmentedButton.js\";\nimport SegmentedButtonItemTemplate from \"./SegmentedButtonItemTemplate.js\";\n\nimport type { IButton } from \"./Button.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport segmentedButtonItemCss from \"./generated/themes/SegmentedButtonItem.css.js\";\n\ntype SegmentedButtonItemClickEventDetail = {\n\toriginalEvent: Event,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * Users can use the `ui5-segmented-button-item` as part of a `ui5-segmented-button`.\n *\n * Clicking or tapping on a `ui5-segmented-button-item` changes its state to `selected`.\n * The item returns to its initial state when the user clicks or taps on it again.\n * By applying additional custom CSS-styling classes, apps can give a different style to any\n * `ui5-segmented-button-item`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SegmentedButtonItem.js\";`\n * @constructor\n * @extends UI5Element\n * @implements { ISegmentedButtonItem }\n * @implements { IButton }\n * @public\n */\n@customElement({\n\ttag: \"ui5-segmented-button-item\",\n\trenderer: jsxRenderer,\n\ttemplate: SegmentedButtonItemTemplate,\n\tstyles: segmentedButtonItemCss,\n})\n\n/**\n * Fired when the component is activated either with a mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled` property is set to `true`.\n *\n * @param {Event} originalEvent The original DOM event that triggered the click. Use this to access modifier keys (altKey, ctrlKey, metaKey, shiftKey) and other native event properties.\n * @since 2.22.0\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\nclass SegmentedButtonItem extends UI5Element implements IButton, ISegmentedButtonItem {\n\teventDetails!: {\n\t\t\"click\": SegmentedButtonItemClickEventDetail,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be selected 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 * Determines whether the component is displayed as selected.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tselected = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that describe the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescriptionRef?: string;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within 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 if the button has icon and no text.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly = false;\n\n\t/**\n\t * Indicates if the element is focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive = false;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * Defines the index of the item inside of the SegmentedButton.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Number })\n\tposInSet? = 0;\n\n\t/**\n\t * Defines how many items are inside of the SegmentedButton.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Number })\n\tsizeOfSet? = 0;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thidden = false;\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tif (this.disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\te.stopImmediatePropagation();\n\n\t\t// Fire semantic click event (CustomEvent that bubbles)\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", {\n\t\t\toriginalEvent: e,\n\t\t});\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.iconOnly = !willShowContent(this.text);\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (isSpaceShift(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tget tabIndexValue() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn tabindex;\n\t\t}\n\n\t\treturn this.forcedTabIndex;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn `${(getEffectiveAriaDescriptionText(this) || \"\")} ${SegmentedButtonItem.i18nBundle.getText(SEGMENTEDBUTTON_ARIA_DESCRIBEDBY)}`.trim();\n\t}\n\n\tget showIconTooltip() {\n\t\treturn getEnableDefaultTooltips() && this.iconOnly && !this.tooltip;\n\t}\n\n\tget slotTextContent(): string {\n\t\treturn this.text\n\t\t\t.filter(node => node.nodeType === Node.TEXT_NODE)\n\t\t\t.map(node => node.textContent?.trim() || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" \");\n\t}\n}\n\nSegmentedButtonItem.define();\n\nexport default SegmentedButtonItem;\nexport type { SegmentedButtonItemClickEventDetail };\n"]}
|
|
1
|
+
{"version":3,"file":"SegmentedButtonItem.js","sourceRoot":"","sources":["../src/SegmentedButtonItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,UAAU,MAAM,4CAA4C,CAAC;AAGpE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,GAC/B,MAAM,+DAA+D,CAAC;AACvE,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,EAAE,oCAAoC,EAAE,MAAM,mCAAmC,CAAC;AAEzF,OAAO,2BAA2B,MAAM,kCAAkC,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QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACX;AAWjB;IADC,QAAQ,EAAE;oDACM;AASjB;IADC,QAAQ,EAAE;2DACa;AASxB;IADC,QAAQ,EAAE;8DACgB;AAS3B;IADC,QAAQ,EAAE;kEACoB;AAS/B;IADC,QAAQ,EAAE;qEACuB;AAYlC;IADC,QAAQ,EAAE;iDACG;AAOd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;qDACX;AAOjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2DACL;AAOvB;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;2DACR;AAQxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDACb;AAQd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDACZ;AAMf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDACb;AASf;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;iDACb;AAGlB;IADN,IAAI,CAAC,oBAAoB,CAAC;6CACG;AAtIzB,mBAAmB;IArBxB,aAAa,CAAC;QACd,GAAG,EAAE,2BAA2B;QAChC,QAAQ,EAAE,WAAW;QACrB,QAAQ,EAAE,2BAA2B;QACrC,MAAM,EAAE,sBAAsB;KAC9B,CAAC;IAEF;;;;;;;;OAQG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GAEI,mBAAmB,CAqNxB;AAED,mBAAmB,CAAC,MAAM,EAAE,CAAC;AAE7B,eAAe,mBAAmB,CAAC","sourcesContent":["import customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport i18n from \"@ui5/webcomponents-base/dist/decorators/i18n.js\";\nimport { getEnableDefaultTooltips } from \"@ui5/webcomponents-base/dist/config/Tooltips.js\";\nimport { isDesktop } from \"@ui5/webcomponents-base/dist/Device.js\";\nimport { isSpaceShift } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tgetEffectiveAriaDescriptionText,\n} from \"@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport { SEGMENTEDBUTTONITEM_ARIA_DESCRIPTION } from \"./generated/i18n/i18n-defaults.js\";\nimport type { ISegmentedButtonItem } from \"./SegmentedButton.js\";\nimport SegmentedButtonItemTemplate from \"./SegmentedButtonItemTemplate.js\";\n\nimport type { IButton } from \"./Button.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport segmentedButtonItemCss from \"./generated/themes/SegmentedButtonItem.css.js\";\n\ntype SegmentedButtonItemClickEventDetail = {\n\toriginalEvent: Event,\n};\n\n/**\n * @class\n *\n * ### Overview\n *\n * Users can use the `ui5-segmented-button-item` as part of a `ui5-segmented-button`.\n *\n * Clicking or tapping on a `ui5-segmented-button-item` changes its state to `selected`.\n * The item returns to its initial state when the user clicks or taps on it again.\n * By applying additional custom CSS-styling classes, apps can give a different style to any\n * `ui5-segmented-button-item`.\n *\n * ### ES6 Module Import\n *\n * `import \"@ui5/webcomponents/dist/SegmentedButtonItem.js\";`\n * @constructor\n * @extends UI5Element\n * @implements { ISegmentedButtonItem }\n * @implements { IButton }\n * @public\n */\n@customElement({\n\ttag: \"ui5-segmented-button-item\",\n\trenderer: jsxRenderer,\n\ttemplate: SegmentedButtonItemTemplate,\n\tstyles: segmentedButtonItemCss,\n})\n\n/**\n * Fired when the component is activated either with a mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled` property is set to `true`.\n *\n * @param {Event} originalEvent The original DOM event that triggered the click. Use this to access modifier keys (altKey, ctrlKey, metaKey, shiftKey) and other native event properties.\n * @since 2.22.0\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\nclass SegmentedButtonItem extends UI5Element implements IButton, ISegmentedButtonItem {\n\teventDetails!: {\n\t\t\"click\": SegmentedButtonItemClickEventDetail,\n\t}\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be selected 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 * Determines whether the component is displayed as selected.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tselected = false;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip?: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the accessible description of the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescription?: string;\n\n\t/**\n\t * Defines the IDs of the HTML Elements that describe the component.\n\t * @default undefined\n\t * @public\n\t * @since 2.15.0\n\t */\n\t@property()\n\taccessibleDescriptionRef?: string;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within 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 if the button has icon and no text.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly = false;\n\n\t/**\n\t * Indicates if the element is focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive = false;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tforcedTabIndex?: string;\n\n\t/**\n\t * Defines the index of the item inside of the SegmentedButton.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Number })\n\tposInSet? = 0;\n\n\t/**\n\t * Defines how many items are inside of the SegmentedButton.\n\t * @default 0\n\t * @private\n\t */\n\t@property({ type: Number })\n\tsizeOfSet? = 0;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thidden = false;\n\n\t/**\n\t * Defines the text of the component.\n\t *\n\t * **Note:** Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: DefaultSlot<Node>;\n\n\t@i18n(\"@ui5/webcomponents\")\n\tstatic i18nBundle: I18nBundle;\n\n\tget ariaDescription() {\n\t\treturn SegmentedButtonItem.i18nBundle.getText(SEGMENTEDBUTTONITEM_ARIA_DESCRIPTION);\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tif (this.disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\te.stopImmediatePropagation();\n\n\t\t// Fire semantic click event (CustomEvent that bubbles)\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", {\n\t\t\toriginalEvent: e,\n\t\t});\n\n\t\tif (prevented) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t}\n\n\tonEnterDOM() {\n\t\tif (isDesktop()) {\n\t\t\tthis.setAttribute(\"desktop\", \"\");\n\t\t}\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.iconOnly = !willShowContent(this.text);\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (isSpaceShift(e)) {\n\t\t\te.preventDefault();\n\t\t}\n\t}\n\n\tget tabIndexValue() {\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn tabindex;\n\t\t}\n\n\t\treturn this.forcedTabIndex;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this) || getAssociatedLabelForTexts(this) || undefined;\n\t}\n\n\tget ariaDescriptionText() {\n\t\treturn getEffectiveAriaDescriptionText(this) || undefined;\n\t}\n\n\tget showIconTooltip() {\n\t\treturn getEnableDefaultTooltips() && this.iconOnly && !this.tooltip;\n\t}\n\n\tget slotTextContent(): string {\n\t\treturn this.text\n\t\t\t.filter(node => node.nodeType === Node.TEXT_NODE)\n\t\t\t.map(node => node.textContent?.trim() || \"\")\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" \");\n\t}\n}\n\nSegmentedButtonItem.define();\n\nexport default SegmentedButtonItem;\nexport type { SegmentedButtonItemClickEventDetail };\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@ui5/webcomponents-base/jsx-runtime";
|
|
2
2
|
import Icon from "./Icon.js";
|
|
3
3
|
export default function SegmentedButtonItemTemplate() {
|
|
4
|
-
return (_jsxs("li", { role: "option", class: "ui5-segmented-button-item-root", "aria-posinset": this.posInSet, "aria-setsize": this.sizeOfSet, "aria-selected": this.selected, "aria-disabled": this.disabled, "data-sap-focus-ref": true, onClick: this._onclick, onKeyUp: this._onkeyup, tabindex: this.tabIndexValue ? parseInt(this.tabIndexValue) : undefined, "aria-label": this.ariaLabelText, "aria-description": this.ariaDescriptionText, title: this.tooltip || this.slotTextContent, children: [this.icon &&
|
|
4
|
+
return (_jsxs("li", { role: "option", class: "ui5-segmented-button-item-root", "aria-posinset": this.posInSet, "aria-setsize": this.sizeOfSet, "aria-selected": this.selected, "aria-disabled": this.disabled, "aria-roledescription": this.ariaDescription, "data-sap-focus-ref": true, onClick: this._onclick, onKeyUp: this._onkeyup, tabindex: this.tabIndexValue ? parseInt(this.tabIndexValue) : undefined, "aria-label": this.ariaLabelText, "aria-description": this.ariaDescriptionText, title: this.tooltip || this.slotTextContent, children: [this.icon &&
|
|
5
5
|
_jsx(Icon, { part: "icon", class: "ui5-segmented-button-item-icon", name: this.icon, showTooltip: this.showIconTooltip }), _jsx("span", { id: `${this._id}-content`, class: "ui5-segmented-button-item-text", children: _jsx("bdi", { children: _jsx("slot", {}) }) })] }));
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=SegmentedButtonItemTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedButtonItemTemplate.js","sourceRoot":"","sources":["../src/SegmentedButtonItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,2BAA2B;IAClD,OAAO,CACN,cACC,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,gCAAgC,mBACvB,IAAI,CAAC,QAAQ,kBACd,IAAI,CAAC,SAAS,mBACb,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"SegmentedButtonItemTemplate.js","sourceRoot":"","sources":["../src/SegmentedButtonItemTemplate.tsx"],"names":[],"mappings":";AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,2BAA2B;IAClD,OAAO,CACN,cACC,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,gCAAgC,mBACvB,IAAI,CAAC,QAAQ,kBACd,IAAI,CAAC,SAAS,mBACb,IAAI,CAAC,QAAQ,mBACb,IAAI,CAAC,QAAQ,0BACN,IAAI,CAAC,eAAe,8BAE1C,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,gBAC3D,IAAI,CAAC,aAAa,sBACZ,IAAI,CAAC,mBAAmB,EAC1C,KAAK,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,eAAe,aAE1C,IAAI,CAAC,IAAI;gBACT,KAAC,IAAI,IACJ,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,gCAAgC,EACtC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,eAAe,GAChC,EAEH,eAAM,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,UAAU,EAAE,KAAK,EAAC,gCAAgC,YACtE,wBACC,gBAAa,GACR,GACA,IACH,CACL,CAAC;AACH,CAAC","sourcesContent":["import type SegmentedButtonItem from \"./SegmentedButtonItem.js\";\nimport Icon from \"./Icon.js\";\n\nexport default function SegmentedButtonItemTemplate(this: SegmentedButtonItem) {\n\treturn (\n\t\t<li\n\t\t\trole=\"option\"\n\t\t\tclass=\"ui5-segmented-button-item-root\"\n\t\t\taria-posinset={this.posInSet}\n\t\t\taria-setsize={this.sizeOfSet}\n\t\t\taria-selected={this.selected}\n\t\t\taria-disabled={this.disabled}\n\t\t\taria-roledescription={this.ariaDescription}\n\t\t\tdata-sap-focus-ref\n\t\t\tonClick={this._onclick}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\ttabindex={this.tabIndexValue ? parseInt(this.tabIndexValue) : undefined }\n\t\t\taria-label={this.ariaLabelText}\n\t\t\taria-description={this.ariaDescriptionText}\n\t\t\ttitle={this.tooltip || this.slotTextContent}\n\t\t>\n\t\t\t{this.icon &&\n\t\t\t\t<Icon\n\t\t\t\t\tpart=\"icon\"\n\t\t\t\t\tclass=\"ui5-segmented-button-item-icon\"\n\t\t\t\t\tname={this.icon}\n\t\t\t\t\tshowTooltip={this.showIconTooltip}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t<span id={`${this._id}-content`} class=\"ui5-segmented-button-item-text\">\n\t\t\t\t<bdi>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</bdi>\n\t\t\t</span>\n\t\t</li>\n\t);\n}\n"]}
|
|
@@ -4,6 +4,6 @@ export default function SegmentedButtonTemplate() {
|
|
|
4
4
|
"ui5-segmented-button-root": true,
|
|
5
5
|
"ui5-segmented-button-root-equal-sized-items": !this.itemsFitContent,
|
|
6
6
|
"ui5-segmented-button-root-content-fit-items": this.itemsFitContent,
|
|
7
|
-
}, onClick: this._onclick, onMouseDown: this._onmousedown, onKeyDown: this._onkeydown, onKeyUp: this._onkeyup, onFocusIn: this._onfocusin, "aria-multiselectable": this.selectionMode === "Multiple" ? "true" : "false", "aria-orientation": "horizontal", "aria-description": this.ariaDescriptionText, "aria-label": this.ariaLabelText, children: _jsx("slot", {}) }));
|
|
7
|
+
}, onClick: this._onclick, onMouseDown: this._onmousedown, onKeyDown: this._onkeydown, onKeyUp: this._onkeyup, onFocusIn: this._onfocusin, "aria-multiselectable": this.selectionMode === "Multiple" ? "true" : "false", "aria-orientation": "horizontal", "aria-description": this.ariaDescriptionText, "aria-label": this.ariaLabelText, "aria-roledescription": this.ariaRoleDescription, children: _jsx("slot", {}) }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=SegmentedButtonTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedButtonTemplate.js","sourceRoot":"","sources":["../src/SegmentedButtonTemplate.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,OAAO,UAAU,uBAAuB;IAC9C,OAAO,CACN,aACC,IAAI,EAAC,SAAS,EACd,KAAK,EAAE;YACN,2BAA2B,EAAE,IAAI;YACjC,6CAA6C,EAAE,CAAC,IAAI,CAAC,eAAe;YACpE,6CAA6C,EAAE,IAAI,CAAC,eAAe;SACnE,EACD,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,UAAU,0BACJ,IAAI,CAAC,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,sBACzD,YAAY,sBACX,IAAI,CAAC,mBAAmB,gBAC9B,IAAI,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"SegmentedButtonTemplate.js","sourceRoot":"","sources":["../src/SegmentedButtonTemplate.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,OAAO,UAAU,uBAAuB;IAC9C,OAAO,CACN,aACC,IAAI,EAAC,SAAS,EACd,KAAK,EAAE;YACN,2BAA2B,EAAE,IAAI;YACjC,6CAA6C,EAAE,CAAC,IAAI,CAAC,eAAe;YACpE,6CAA6C,EAAE,IAAI,CAAC,eAAe;SACnE,EACD,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,WAAW,EAAE,IAAI,CAAC,YAAY,EAC9B,SAAS,EAAE,IAAI,CAAC,UAAU,EAC1B,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,SAAS,EAAE,IAAI,CAAC,UAAU,0BACJ,IAAI,CAAC,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,sBACzD,YAAY,sBACX,IAAI,CAAC,mBAAmB,gBAC9B,IAAI,CAAC,aAAa,0BACR,IAAI,CAAC,mBAAmB,YAE9C,gBAAa,GACT,CACL,CAAC;AACH,CAAC","sourcesContent":["import type SegmentedButton from \"./SegmentedButton.js\";\n\nexport default function SegmentedButtonTemplate(this: SegmentedButton) {\n\treturn (\n\t\t<ul\n\t\t\trole=\"listbox\"\n\t\t\tclass={{\n\t\t\t\t\"ui5-segmented-button-root\": true,\n\t\t\t\t\"ui5-segmented-button-root-equal-sized-items\": !this.itemsFitContent,\n\t\t\t\t\"ui5-segmented-button-root-content-fit-items\": this.itemsFitContent,\n\t\t\t}}\n\t\t\tonClick={this._onclick}\n\t\t\tonMouseDown={this._onmousedown}\n\t\t\tonKeyDown={this._onkeydown}\n\t\t\tonKeyUp={this._onkeyup}\n\t\t\tonFocusIn={this._onfocusin}\n\t\t\taria-multiselectable={this.selectionMode === \"Multiple\" ? \"true\" : \"false\"}\n\t\t\taria-orientation=\"horizontal\"\n\t\t\taria-description={this.ariaDescriptionText}\n\t\t\taria-label={this.ariaLabelText}\n\t\t\taria-roledescription={this.ariaRoleDescription}\n\t\t>\n\t\t\t<slot></slot>\n\t\t</ul>\n\t);\n}\n"]}
|