Skip to content

Commit dc27781

Browse files
committed
apply requested changes; edit ChangeLog & ReadMe
1 parent 90cf9b0 commit dc27781

File tree

7 files changed

+23
-14
lines changed

7 files changed

+23
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ All notable changes for each version of this project will be documented in this
4646
- `IgxCombo`:
4747
- Added `autoFocusSearch` input that allows to manipulate the combo's opening behavior. When the property is `true` (by default), the combo's search input is focused on open. When set to `false`, the focus goes to the combo items container, which can be used to prevent the software keyboard from activating on mobile devices when opening the combo.
4848

49+
- `IgxToast`:
50+
- Added functionality for displaying various content into the toast component. It also allows users to access toast styles through its host element.
51+
4952
### RTL Support
5053
- `igxSlider` have full right-to-left (RTL) support.
5154

projects/igniteui-angular/src/lib/core/styles/components/toast/_toast-theme.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121

122122
%igx-toast--top {
123123
top: 0;
124+
margin-top: 16px;
124125
}
125126

126127
%igx-toast--middle {
@@ -130,6 +131,7 @@
130131

131132
%igx-toast--bottom {
132133
bottom: 0;
134+
margin-bottom: 16px;
133135
}
134136
}
135137

@@ -143,7 +145,7 @@
143145
@mixin igx-toast-typography($type-scale, $categories: (text: 'body-2')) {
144146
$text: map-get($categories, 'text');
145147

146-
%igx-toast-display {
148+
%igx-toast-display > *{
147149
@include igx-type-style($type-scale, $text) {
148150
margin: 0;
149151
}

projects/igniteui-angular/src/lib/toast/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ You can show hide toast by using `toast.hide()` method.
3636

3737
You can modify the position of the toast by setting `postion="IgxToastPosition.Top"`.
3838

39+
## Toast with different content
40+
41+
```html
42+
<igx-toast #toast [position]="toastPosition">
43+
<igx-icon>notifications</igx-icon>
44+
This message will self-destruct in 4 seconds.
45+
</igx-toast>
46+
```
47+
48+
You can display various content by placing it between the igx-toast tags. If so, the message property will be overwritten.
49+
3950
## Toast with events
4051

4152
```html
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div #content>
22
<ng-content></ng-content>
33
</div>
4-
<span *ngIf="content.children.length == 0">{{ message }}</span>
4+
<span *ngIf="content.childNodes.length == 0">{{ message }}</span>
55

projects/igniteui-angular/src/lib/toast/toast.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,17 +307,17 @@ export class IgxToastComponent implements IToggleView, OnInit, OnDestroy {
307307
}
308308

309309
@HostBinding('class.igx-toast--top')
310-
public get cssClassTop(): boolean {
310+
public get cssClassTop() {
311311
return this.position === IgxToastPosition.Top;
312312
}
313313

314314
@HostBinding('class.igx-toast--middle')
315-
public get cssClassMiddle(): boolean {
315+
public get cssClassMiddle() {
316316
return this.position === IgxToastPosition.Middle;
317317
}
318318

319319
@HostBinding('class.igx-toast--bottom')
320-
public get cssClassBottom(): boolean {
320+
public get cssClassBottom() {
321321
return this.position === IgxToastPosition.Bottom;
322322
}
323323

src/app/toast/toast.sample.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,3 @@
88
margin-top: 16px;
99
justify-content: space-between;
1010
}
11-
12-
.igx-toast--bottom {
13-
margin-bottom: 16px;
14-
}
15-
16-
.igx-toast--top {
17-
margin-top: 16px;
18-
}

src/app/toast/toast.sample.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ <h4 class="sample-title">Middle Position</h4>
2323
<h4 class="sample-title">Top Position</h4>
2424
<div class="preview top"></div>
2525
<div class="btn-group">
26-
<button igxButton="raised" igxRipple="white" (click)="toast.toggle()">Toggle Toast</button>
26+
<button igxButton="raised" igxRipple="white" (click)="showToast(toast, 'top')" [disabled]="toast.isVisible">Show Toast</button>
27+
<button igxButton="raised" igxRipple="white" (click)="toast.hide()" [disabled]="!toast.isVisible">Hide Toast</button>
2728
</div>
2829
</article>
2930
</section>

0 commit comments

Comments
 (0)