Skip to content

Commit 9a293ca

Browse files
authored
Merge pull request #223 from Stabzs/release/11.0.0
Release/11.0.0
2 parents 86f9147 + ec877d6 commit 9a293ca

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* **toast:** A new `tapToDismiss?: boolean` property has been added to the toast object. This allows for
55
each individual toast to override the global `tapToDismiss` config.
66
Closes [#178](https://github.com/Stabzs/Angular2-Toaster/issues/178).
7+
* **toast:** A progress bar has been added on a toast-by-toast basis with two progress directions:
8+
decreasing and increasing. By default, the progress bar is disabled.
79
* **toaster.css:** Styles have been rebuilt around flexbox and have removed IE and webkit-specific prefixes.
810
This allows for more compact css and should make it easier for users to override styles. It also fixes close
911
button layout issues in Firefox, resolving [#192](https://github.com/Stabzs/Angular2-Toaster/issues/192).

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ largely based off of [AngularJS-Toaster](https://github.com/jirikavi/AngularJS-T
66
[![npm](https://img.shields.io/npm/v/angular2-toaster.svg?maxAge=3600?800=true)](https://www.npmjs.com/package/angular2-toaster)
77
[![npm](https://img.shields.io/npm/dt/angular2-toaster.svg?cache=true)](https://www.npmjs.com/package/angular2-toaster)
88
[![Build Status](https://travis-ci.org/Stabzs/Angular2-Toaster.svg?branch=master)](https://travis-ci.org/Stabzs/Angular2-Toaster)
9-
[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=8.0.0)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master)
9+
[![Coverage Status](https://coveralls.io/repos/github/Stabzs/Angular2-Toaster/badge.svg?branch=master&b=11.0.0)](https://coveralls.io/github/Stabzs/Angular2-Toaster?branch=master)
1010

1111
Version ^11.0.0 has a number of new features, type definitions, and break changesing. Please review the
1212
[CHANGELOG](CHANGELOG.md/#11.0.0) for a list of features and breaking changes before upgrading.
@@ -555,6 +555,24 @@ of the toast.
555555
Mutation of the toast instance is not recommended.
556556
557557
558+
### Progress Bar
559+
A progress bar can be enabled per toast via the `progressBar` property. If set to true, a progress bar will be
560+
displayed that indicates how much time is remaining for the toast before it is automatically dismissed.
561+
562+
The progress bar has two directions: `decreasing` or right-to-left and `increasing`, or left-to-right. While defaulted
563+
to `decreasing`, it can be overridden per toast:
564+
565+
```typescript
566+
var toast: Toast = {
567+
type: 'success',
568+
progressBar: true,
569+
progressBarDirection: 'increasing'
570+
};
571+
572+
this.toasterService.pop(toast);
573+
```
574+
575+
558576
### On Show Callback
559577
An onShow callback function can be attached to each toast instance. The callback will be invoked upon toast add.
560578

src/angular2-toaster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular2-toaster",
33
"description": "An Angular Toaster Notification library based on AngularJS-Toaster",
4-
"version": "11.0.0",
4+
"version": "11.0.1",
55
"author": "Stabzs",
66
"license": "MIT",
77
"repository": {

src/angular2-toaster/src/lib/toaster-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import { Injectable } from '@angular/core';
22
import { BodyOutputType } from './bodyOutputType';
33
import { ToastType } from './toast';
44

5-
export const DefaultTypeClasses : { [key in ToastType] } = {
5+
export const DefaultTypeClasses : { [key in ToastType]? : string } = {
66
error: 'toast-error',
77
info: 'toast-info',
88
wait: 'toast-wait',
99
success: 'toast-success',
1010
warning: 'toast-warning'
1111
};
1212

13-
export const DefaultIconClasses : { [key in ToastType] } = {
13+
export const DefaultIconClasses : { [key in ToastType]? : string } = {
1414
error: 'icon-error',
1515
info: 'icon-info',
1616
wait: 'icon-wait',

0 commit comments

Comments
 (0)