File tree Expand file tree Collapse file tree 4 files changed +24
-4
lines changed
Expand file tree Collapse file tree 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 44* ** toast:** A new ` tapToDismiss?: boolean ` property has been added to the toast object. This allows for
55each individual toast to override the global ` tapToDismiss ` config.
66Closes [ #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.
810This allows for more compact css and should make it easier for users to override styles. It also fixes close
911button layout issues in Firefox, resolving [ #192 ] ( https://github.com/Stabzs/Angular2-Toaster/issues/192 ) .
Original file line number Diff line number Diff 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
1111Version ^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
559577An onShow callback function can be attached to each toast instance. The callback will be invoked upon toast add.
560578
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff line change @@ -2,15 +2,15 @@ import { Injectable } from '@angular/core';
22import { BodyOutputType } from './bodyOutputType' ;
33import { 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' ,
You can’t perform that action at this time.
0 commit comments