From 0e6cdeb3707fe470646a06f413916017fd8d8a73 Mon Sep 17 00:00:00 2001 From: Stabzs Date: Tue, 1 Dec 2020 13:40:55 -0700 Subject: [PATCH] Added progress bar documentation --- CHANGELOG.md | 2 ++ README.md | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fbbc296..b284bd52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/README.md b/README.md index 66979ebb..c90bbc79 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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.