Skip to content

Commit a40b872

Browse files
AmitMYbrandyscarney
authored andcommitted
fix(rtl): add icon-start and icon-end attributes (#11737)
* feat(icon): add start/end * fix(icon): add all relevant deprecations * fix(deprecation): add deprecation to missing selector * revert(tests): revert icon-start/end from tests
1 parent 57dc22d commit a40b872

File tree

24 files changed

+98
-63
lines changed

24 files changed

+98
-63
lines changed

demos/src/button/pages/page-one/page-one.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ <h4>Outlines</h4>
3939

4040
<h4>Icons</h4>
4141

42-
<button ion-button icon-left color="dark">
42+
<button ion-button icon-start color="dark">
4343
<ion-icon name="star"></ion-icon>
4444
Left Icon
4545
</button>
4646

47-
<button ion-button icon-right color="dark">
47+
<button ion-button icon-end color="dark">
4848
Right Icon
4949
<ion-icon name="star"></ion-icon>
5050
</button>

demos/src/item-sliding/pages/page-one/page-one.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ <h2>{{login.name}}</h2>
6767
<ion-icon name="trash"></ion-icon>
6868
</button>
6969
</ion-item-options>
70-
<ion-item-options (ionSwipe)="download(item)" icon-left>
70+
<ion-item-options (ionSwipe)="download(item)" icon-start>
7171
<button ion-button color="dark" (click)="more(item)">
7272
<ion-icon name="volume-off"></ion-icon>
7373
Mute

demos/src/loading/pages/page-one/page-one.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
<ion-toolbar>
6060
<ion-buttons end>
61-
<button ion-button icon-right (click)="goToPage2()">
61+
<button ion-button icon-end (click)="goToPage2()">
6262
Show Loading and Navigate
6363
<ion-icon name="arrow-forward"></ion-icon>
6464
</button>

demos/src/navbar/pages/page-one/page-one.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</ion-buttons>
5656
<ion-title>Solid</ion-title>
5757
<ion-buttons end>
58-
<button ion-button icon-right solid color="secondary">
58+
<button ion-button icon-end solid color="secondary">
5959
Help
6060
<ion-icon name="help-circle"></ion-icon>
6161
</button>
@@ -69,7 +69,7 @@
6969
</button>
7070
</ion-buttons>
7171
<ion-buttons end>
72-
<button ion-button icon-right outline color="secondary">
72+
<button ion-button icon-end outline color="secondary">
7373
Help
7474
<ion-icon name="help-circle"></ion-icon>
7575
</button>

demos/src/tabs/pages/page-one/page-one.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141

4242

4343
<!-- Icons right of text -->
44-
<ion-tabs tabs-only tabsLayout="icon-right" selectedIndex="0" color="light">
44+
<ion-tabs tabs-only tabsLayout="icon-end" selectedIndex="0" color="light">
4545
<ion-tab tabTitle="Recents" tabIcon="call" [root]="root"></ion-tab>
4646
<ion-tab tabTitle="Favorites" tabIcon="heart" [root]="root"></ion-tab>
4747
<ion-tab tabTitle="Settings" tabIcon="settings" [root]="root" tabBadge="4" tabBadgeStyle="secondary"></ion-tab>
4848
</ion-tabs>
4949

5050

5151
<!-- Icons left of text -->
52-
<ion-tabs tabs-only tabsLayout="icon-left" color="dark">
52+
<ion-tabs tabs-only tabsLayout="icon-start" color="dark">
5353
<ion-tab tabTitle="Recents" tabIcon="call" [root]="root" tabBadge="1" tabBadgeStyle="danger"></ion-tab>
5454
<ion-tab tabTitle="Favorites" tabIcon="heart" [root]="root"></ion-tab>
5555
<ion-tab tabTitle="Settings" tabIcon="settings" [root]="root"></ion-tab>

demos/src/title/pages/page-one/page-one.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</ion-buttons>
5656
<ion-title>Solid</ion-title>
5757
<ion-buttons end>
58-
<button ion-button icon-right solid color="secondary">
58+
<button ion-button icon-end solid color="secondary">
5959
Help
6060
<ion-icon name="help-circle"></ion-icon>
6161
</button>
@@ -69,7 +69,7 @@
6969
</button>
7070
</ion-buttons>
7171
<ion-buttons end>
72-
<button ion-button icon-right outline color="secondary">
72+
<button ion-button icon-end outline color="secondary">
7373
Help
7474
<ion-icon name="help-circle"></ion-icon>
7575
</button>

demos/src/toolbar/pages/page-one/page-one.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</ion-buttons>
5656
<ion-title>Solid</ion-title>
5757
<ion-buttons end>
58-
<button ion-button icon-right solid color="secondary">
58+
<button ion-button icon-end solid color="secondary">
5959
Help
6060
<ion-icon name="help-circle"></ion-icon>
6161
</button>
@@ -69,7 +69,7 @@
6969
</button>
7070
</ion-buttons>
7171
<ion-buttons end>
72-
<button ion-button icon-right outline color="secondary">
72+
<button ion-button icon-end outline color="secondary">
7373
Help
7474
<ion-icon name="help-circle"></ion-icon>
7575
</button>

src/components/action-sheet/action-sheet-component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import { ViewController } from '../../navigation/view-controller';
2222
'<div class="action-sheet-group">' +
2323
'<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
2424
'<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
25-
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [attr.icon-left]="b.icon ? \'\' : null" [ngClass]="b.cssClass">' +
25+
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [attr.icon-start]="b.icon ? \'\' : null" [ngClass]="b.cssClass">' +
2626
'<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon>' +
2727
'{{b.text}}' +
2828
'</button>' +
2929
'</div>' +
3030
'<div class="action-sheet-group" *ngIf="cancelButton">' +
31-
'<button ion-button="action-sheet-button" (click)="click(cancelButton)" class="action-sheet-cancel disable-hover" [attr.icon-left]="cancelButton.icon ? \'\' : null" [ngClass]="cancelButton.cssClass">' +
31+
'<button ion-button="action-sheet-button" (click)="click(cancelButton)" class="action-sheet-cancel disable-hover" [attr.icon-start]="cancelButton.icon ? \'\' : null" [ngClass]="cancelButton.cssClass">' +
3232
'<ion-icon [name]="cancelButton.icon" *ngIf="cancelButton.icon" class="action-sheet-icon"></ion-icon>' +
3333
'{{cancelButton.text}}' +
3434
'</button>' +

src/components/alert/alert.ios.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,10 @@ $alert-ios-radio-min-width: 30px !default;
193193
/// @prop - Top of the icon in the radio alert
194194
$alert-ios-radio-icon-top: -7px !default;
195195

196-
/// @prop - Left of the icon in the radio alert
196+
// deprecated
197197
$alert-ios-radio-icon-left: 7px !default;
198+
/// @prop - Start of the icon in the radio alert
199+
$alert-ios-radio-icon-start: $alert-ios-radio-icon-left !default;
198200

199201
/// @prop - Width of the icon in the radio alert
200202
$alert-ios-radio-icon-width: 6px !default;
@@ -277,8 +279,10 @@ $alert-ios-checkbox-background-color-on: color($colors-ios, primary) !def
277279
/// @prop - Top of the icon in the checkbox alert
278280
$alert-ios-checkbox-icon-top: 4px !default;
279281

280-
/// @prop - Left of the icon in the checkbox alert
282+
// deprecated
281283
$alert-ios-checkbox-icon-left: 7px !default;
284+
/// @prop - Start of the icon in the checkbox alert
285+
$alert-ios-checkbox-icon-start: $alert-ios-checkbox-icon-left !default;
282286

283287
/// @prop - Width of the icon in the checkbox alert
284288
$alert-ios-checkbox-icon-width: 4px !default;
@@ -446,7 +450,7 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
446450
// -----------------------------------------
447451

448452
.alert-ios [aria-checked=true] .alert-radio-inner {
449-
@include position($alert-ios-radio-icon-top, null, null, $alert-ios-radio-icon-left);
453+
@include position($alert-ios-radio-icon-top, null, null, $alert-ios-radio-icon-start);
450454

451455
position: absolute;
452456

@@ -519,7 +523,7 @@ $alert-ios-checkbox-icon-transform: rotate(45deg) !default;
519523
// -----------------------------------------
520524

521525
.alert-ios [aria-checked=true] .alert-checkbox-inner {
522-
@include position($alert-ios-checkbox-icon-top, null, null, $alert-ios-checkbox-icon-left);
526+
@include position($alert-ios-checkbox-icon-top, null, null, $alert-ios-checkbox-icon-start);
523527

524528
position: absolute;
525529

src/components/alert/alert.md.scss

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ $alert-md-radio-border-color-on: $alert-md-button-text-color !defau
249249
/// @prop - Top of the icon in the alert radio
250250
$alert-md-radio-icon-top: 2px !default;
251251

252-
/// @prop - Left of the icon in the alert radio
252+
// deprecated
253253
$alert-md-radio-icon-left: 2px !default;
254+
/// @prop - Start of the icon in the radio alert
255+
$alert-md-radio-icon-start: $alert-md-radio-icon-left !default;
254256

255257
/// @prop - Width of the icon in the alert radio
256258
$alert-md-radio-icon-width: 8px !default;
@@ -323,8 +325,10 @@ $alert-md-checkbox-border-color-on: $alert-md-button-text-color !defau
323325
/// @prop - Top of the icon in the checkbox alert
324326
$alert-md-checkbox-icon-top: 0 !default;
325327

326-
/// @prop - Left of the icon in the checkbox alert
328+
// deprecated
327329
$alert-md-checkbox-icon-left: 3px !default;
330+
/// @prop - Start of the icon in the checkbox alert
331+
$alert-md-checkbox-icon-start: $alert-md-checkbox-icon-left !default;
328332

329333
/// @prop - Width of the icon in the checkbox alert
330334
$alert-md-checkbox-icon-width: 6px !default;
@@ -481,7 +485,7 @@ $alert-md-checkbox-icon-transform: rotate(45deg) !default;
481485
// ---------------------------------------------------
482486

483487
.alert-md .alert-radio-inner {
484-
@include position($alert-md-radio-icon-top, null, null, $alert-md-radio-icon-left);
488+
@include position($alert-md-radio-icon-top, null, null, $alert-md-radio-icon-start);
485489
@include border-radius($alert-md-radio-icon-border-radius);
486490

487491
position: absolute;
@@ -559,7 +563,7 @@ $alert-md-checkbox-icon-transform: rotate(45deg) !default;
559563
}
560564

561565
.alert-md [aria-checked=true] .alert-checkbox-inner {
562-
@include position($alert-md-checkbox-icon-top, null, null, $alert-md-checkbox-icon-left);
566+
@include position($alert-md-checkbox-icon-top, null, null, $alert-md-checkbox-icon-start);
563567

564568
position: absolute;
565569

0 commit comments

Comments
 (0)