Skip to content

Commit 4f69de8

Browse files
authored
refactor(ui5-panel): remove ui5-icon from hbs template (#810)
1 parent 1d377ba commit 4f69de8

File tree

4 files changed

+6
-21
lines changed

4 files changed

+6
-21
lines changed

packages/main/src/Panel.hbs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@
2020
aria-expanded="{{expanded}}"
2121
?non-focusable="{{nonFocusableButton}}"
2222
@click="{{_toggleButtonClick}}"
23-
>
24-
25-
<ui5-icon
26-
src="sap-icon://navigation-right-arrow"
27-
class="ui5-panel-header-button-icon"
28-
accessible-name="{{toggleIconTitle}}"
29-
>
30-
</ui5-icon>
31-
</ui5-button>
23+
icon="sap-icon://navigation-right-arrow"
24+
title="{{toggleButtonTitle}}"
25+
></ui5-button>
3226
</div>
3327

3428
{{#if _hasHeader}}

packages/main/src/Panel.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import slideUp from "@ui5/webcomponents-base/dist/animations/slideUp.js";
55
import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/events/PseudoEvents.js";
66
import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
77
import Button from "./Button.js";
8-
import Icon from "./Icon.js";
98
import "./icons/navigation-right-arrow.js";
109
import PanelAccessibleRole from "./types/PanelAccessibleRole.js";
1110
import PanelTemplate from "./generated/templates/PanelTemplate.lit.js";
@@ -295,7 +294,7 @@ class Panel extends UI5Element {
295294
return target.classList.contains("sapMPanelWrappingDiv");
296295
}
297296

298-
get toggleIconTitle() {
297+
get toggleButtonTitle() {
299298
return this.i18nBundle.getText(PANEL_ICON);
300299
}
301300

@@ -335,7 +334,6 @@ class Panel extends UI5Element {
335334
await Promise.all([
336335
fetchI18nBundle("@ui5/webcomponents"),
337336
Button.define(),
338-
Icon.define(),
339337
]);
340338

341339
super.define(...params);

packages/main/src/themes/Panel.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,9 @@
3838
}
3939

4040
.ui5-panel-header-button {
41-
min-width: 2rem;
42-
width: 2rem;
43-
height: 2rem;
4441
transition: transform 0.4s ease-out;
4542
}
4643

47-
.ui5-panel-header-button-icon {
48-
pointer-events: none;
49-
color: inherit;
50-
}
51-
5244
:host(:not([_has-header])) .ui5-panel-header-button {
5345
pointer-events: none;
5446
}
@@ -82,6 +74,7 @@
8274
display: flex;
8375
justify-content: center;
8476
align-items: center;
77+
flex-shrink: 0;
8578
width: var(--_ui5_panel_button_root_width);
8679
margin-right: .25rem;
8780
}

packages/main/test/sap/ui/webcomponents/main/qunit/Panel.qunit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TestHelper.ready(function () {
4040
var panel = this.getPanelRoot();
4141

4242
assert.ok(panel.querySelector(".ui5-panel-header-content"), "header wrapping div exists");
43-
assert.ok(panel.querySelector("ui5-icon"), "expandable icon exists");
43+
assert.ok(panel.querySelector("ui5-button"), "expandable icon exists");
4444
});
4545

4646
QUnit.test("The default 'accessibleRole' is 'Form'", function (assert) {

0 commit comments

Comments
 (0)