Skip to content

Commit

Permalink
Merge pull request #223 from Stabzs/release/11.0.0
Browse files Browse the repository at this point in the history
Release/11.0.0
  • Loading branch information
Stabzs authored Dec 1, 2020
2 parents 86f9147 + ec877d6 commit 9a293ca
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* **toast:** A new `tapToDismiss?: boolean` property has been added to the toast object. This allows for
each individual toast to override the global `tapToDismiss` config.
Closes [#178](https://github.com/Stabzs/Angular2-Toaster/issues/178).
* **toast:** A progress bar has been added on a toast-by-toast basis with two progress directions:
decreasing and increasing. By default, the progress bar is disabled.
* **toaster.css:** Styles have been rebuilt around flexbox and have removed IE and webkit-specific prefixes.
This allows for more compact css and should make it easier for users to override styles. It also fixes close
button layout issues in Firefox, resolving [#192](https://github.com/Stabzs/Angular2-Toaster/issues/192).
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ largely based off of [AngularJS-Toaster](https://github.com/jirikavi/AngularJS-T
[![npm](https://img.shields.io/npm/v/angular2-toaster.svg?maxAge=3600?800=true)](https://www.npmjs.com/package/angular2-toaster)
[![npm](https://img.shields.io/npm/dt/angular2-toaster.svg?cache=true)](https://www.npmjs.com/package/angular2-toaster)
[![Build Status](https://travis-ci.org/Stabzs/Angular2-Toaster.svg?branch=master)](https://travis-ci.org/Stabzs/Angular2-Toaster)
[![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)
[![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)

Version ^11.0.0 has a number of new features, type definitions, and break changesing. Please review the
[CHANGELOG](CHANGELOG.md/#11.0.0) for a list of features and breaking changes before upgrading.
Expand Down Expand Up @@ -555,6 +555,24 @@ of the toast.
Mutation of the toast instance is not recommended.
### Progress Bar
A progress bar can be enabled per toast via the `progressBar` property. If set to true, a progress bar will be
displayed that indicates how much time is remaining for the toast before it is automatically dismissed.
The progress bar has two directions: `decreasing` or right-to-left and `increasing`, or left-to-right. While defaulted
to `decreasing`, it can be overridden per toast:
```typescript
var toast: Toast = {
type: 'success',
progressBar: true,
progressBarDirection: 'increasing'
};

this.toasterService.pop(toast);
```
### On Show Callback
An onShow callback function can be attached to each toast instance. The callback will be invoked upon toast add.
Expand Down
2 changes: 1 addition & 1 deletion src/angular2-toaster/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular2-toaster",
"description": "An Angular Toaster Notification library based on AngularJS-Toaster",
"version": "11.0.0",
"version": "11.0.1",
"author": "Stabzs",
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/angular2-toaster/src/lib/toaster-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { Injectable } from '@angular/core';
import { BodyOutputType } from './bodyOutputType';
import { ToastType } from './toast';

export const DefaultTypeClasses : { [key in ToastType] } = {
export const DefaultTypeClasses : { [key in ToastType]? : string } = {
error: 'toast-error',
info: 'toast-info',
wait: 'toast-wait',
success: 'toast-success',
warning: 'toast-warning'
};

export const DefaultIconClasses : { [key in ToastType] } = {
export const DefaultIconClasses : { [key in ToastType]? : string } = {
error: 'icon-error',
info: 'icon-info',
wait: 'icon-wait',
Expand Down

0 comments on commit 9a293ca

Please sign in to comment.