Skip to content

Commit 9045bfb

Browse files
authored
refactor: align properties (SAP#9319)
1 parent 89d8431 commit 9045bfb

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

packages/fiori/src/ProductSwitchItem.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@keyup="{{_onkeyup}}"
99
tabindex={{forcedTabIndex}}
1010
href="{{targetSrc}}"
11-
target="{{target}}">
11+
target="{{_effectiveTarget}}">
1212
{{> item}}
1313
</a>
1414
{{else}}

packages/fiori/src/ProductSwitchItem.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ class ProductSwitchItem extends UI5Element implements IProductSwitchItem {
9292
* - `_blank`
9393
* - `_parent`
9494
* - `_search`
95-
* @default "_self"
95+
*
96+
* **Note:** By default target will be open in the same frame as it was clicked.
97+
* @default undefined
9698
* @public
9799
*/
98100
@property()
99-
target = "_self";
101+
target?: string;
100102

101103
/**
102104
* Defines the component target URI. Supports standard hyperlink behavior.
@@ -154,6 +156,10 @@ class ProductSwitchItem extends UI5Element implements IProductSwitchItem {
154156
this.active = true;
155157
}
156158

159+
get _effectiveTarget() {
160+
return this.target || "_self";
161+
}
162+
157163
_onkeydown(e: KeyboardEvent) {
158164
if (isSpace(e) || isEnter(e)) {
159165
this.active = true;

packages/main/src/ComboBoxItemGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import type { IComboBoxItem } from "./ComboBox.js";
1919
class ComboBoxItemGroup extends UI5Element implements IComboBoxItem {
2020
/**
2121
* Defines the text of the component.
22-
* @default ""
22+
* @default undefined
2323
* @public
2424
*/
2525
@property()
26-
headerText = "";
26+
headerText?: string;
2727

2828
/**
2929
* Indicates whether the item is focused

packages/main/src/MultiComboBoxItemGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import type MultiComboBoxItem from "./MultiComboBoxItem.js";
2020
class MultiComboBoxItemGroup extends UI5Element implements IMultiComboBoxItem {
2121
/**
2222
* Defines the text of the component.
23-
* @default ""
23+
* @default undefined
2424
* @public
2525
*/
2626
@property()
27-
headerText = "";
27+
headerText?: string;
2828

2929
/**
3030
* Defines the items of the <code>ui5-mcb-item-group</code>.

0 commit comments

Comments
 (0)