Skip to content

Commit

Permalink
We are now using Vue CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
s4l1h committed Jun 29, 2019
1 parent 88e5fef commit a18f3f9
Show file tree
Hide file tree
Showing 49 changed files with 9,997 additions and 5,432 deletions.
27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
/node_modules
.DS_Store
node_modules
public
dist/*.gz
dist/*.map
coverage
docs/.vuepress/dist

# local env files
.env.local
.env.*.local

# related test files
/tests/e2e/reports
/tests/e2e/videos
/tests/e2e/screenshots

# editor directories and files
.idea
.vscode
package-lock.json
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO: release log here ...
25 changes: 12 additions & 13 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
The MIT License (MIT)

Copyright (c) 2016 s4l1h
Copyright (c) 2019

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
205 changes: 17 additions & 188 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,206 +1,35 @@
# vue-toastr

> This is master branch vue-toastr which works only with **Vue 2.x**. vue-toastr@**latest**
## Project setup

> For the **Vue 1.x** see the [1.0 branch](https://github.com/s4l1h/vue-toastr/tree/1.0). vue-toastr@**1.0.4**

**Note:**:closeOnHover,onMouseOver,onMouseOut works only **2.x**


### With npm & babel

*Add the Toast into the package.json. #for vue **1.x***

npm install vue-toastr@^1.0.4 --save


*Add the Toast into the package.json. #for vue **2.x***

npm install vue-toastr@latest --save

*Add the toast in application and register component.*

// import Toastr
import Toastr from 'vue-toastr';
// import toastr scss file: need webpack sass-loader
require('vue-toastr/src/vue-toastr.scss');
// Register vue component
Vue.component('vue-toastr',Toastr);
***Plugin** mode (work only vue 2.x)*

// import Toastr
import Toastr from 'vue-toastr';
// import toastr scss file: need webpack sass-loader
require('vue-toastr/src/vue-toastr.scss');
// Register plugin
Vue.use(Toastr, { /* options */ });
***Plugin** Mode vue **2.x***

this.$toastr // use plugin mode autoamatic installed if you use browser.

*Add component html: for vue **1.x***

<vue-toastr v-ref:toastr></vue-toastr>

*Add component html: for vue **2.x***

<vue-toastr ref="toastr"></vue-toastr>

*Now you can manage toastr*

// use component
this.$root.$refs.toastr.e("ERRROR MESSAGE");
this.$root.$refs.toastr.s("SUCCESS MESSAGE");
// use plugin
this.$toastr.e("ERRROR MESSAGE");
this.$toastr.s("SUCCESS MESSAGE");

### without npm

http://s4l1h.github.io/vue-toastr/

### Development Setup

``` bash
# install deps
npm install

# serve examples at http://localhost:8080/
npm run dev
# build dist/vue-toastr.js dist/vue-toastr.css
npm run build
# build for production min version. dist/vue-toastr.min.js dist/vue-toastr.min.css
npm run build_min
# build for production js+css combine. dist/vue-toastr.combine.min.js
npm run build_combine
# clear All builds.. rm -rf dist/*
npm run clear
#Build all. npm run build && npm run build_min && npm run build_combine
npm run buildAll
```
yarn install
```

## Doc # Overwrite Settings

### Overwrite inside component
### Compiles and hot-reloads for development

#### Change Default Toast Timeout
```
this.$refs.toastr.defaultTimeout = 3000; // default timeout : 5000
```
#### Change Default Toast ProgressBar
```
this.$refs.toastr.defaultProgressBar = false; // default active : true
```
#### Change Default Toast ProgressBar Manual Value
```
this.$refs.toastr.defaultProgressBarValue = 0; // default value : null (managed by JS timer)
```
#### Change Default Toast Type
```
this.$refs.toastr.defaultType = "error"; // default type : success
```
#### Change Default Position
```
this.$refs.toastr.defaultPosition = "toast-bottom-left" // default position: toast-top-right
```
#### Change Default Close On Mouse Hover
```
this.$refs.toastr.defaultCloseOnHover = false // default close on hover: true
```
#### Change Default Style
```
this.$refs.toastr.defaultStyle = { "background-color": "red" } // default style: { }
yarn run demo
```

### Overwrite via plugin options
*You can also overwrite defaults by passing options object during plugin registration*
```
Vue.use(Toastr, {
defaultTimeout: 3000,
defaultProgressBar: false,
defaultProgressBarValue: 0,
defaultType: "error",
defaultPosition: "toast-bottom-left",
defaultCloseOnHover: false,
defaultStyle: { "background-color": "red" }
})
```
### Compiles and minifies for production

## Doc # method
#### New Error Type Toast Message
```
this.$refs.toastr.e("this.$refs.toastr.e message", "Error");
```
#### New Success Type Toast Message
```
this.$refs.toastr.s("this.$refs.toastr.s message");
```
#### New Warning Type Toast Message
```
this.$refs.toastr.w("this.$refs.toastr.w message", "Warning");
```
#### New Information Type Toast Message
```
this.$refs.toastr.i("this.$refs.toastr.i message", "Information");
```
#### Remove Toast Messages by type.
```
this.$refs.toastr.removeByType("error"); // error, warning, success, info
```
#### Remove Toast Messages by Name.
```
this.$refs.toastr.removeByName("UniqueToastName");
```
#### New Toast Message with default options.
```
this.$refs.toastr.Add("Working on the default options");
```
#### New Toast Message with options.
```
this.$root.$refs.toastr.Add({
name: "UniqueToastName", // Toast Name now you can remove by name
title: "Easy Toast", // Toast Title
msg: "Hi", // Message
clickClose: false, // Click Close Disable
timeout: 0, // Remember defaultTimeout is 5 sec..
progressBarValue: 0, // Manually update progress bar value later; null (not 0) is default
position: "toast-top-full-width", // Toast Position.
type: "error", // Toast type,
preventDuplicates: true, //Default is false,
style: { backgroundColor: 'blue',width:'150px' } // bind inline style to toast (check [Vue doc](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles) for more examples)
});
```
## Doc # Options
```
{
name: "Name Of The Toast",
title: "Toast Title",
msg: "Toast Msg",
position: Toast position string can be 'toast-top-right', 'toast-bottom-right', 'toast-bottom-left', 'toast-top-left', 'toast-top-full-width', 'toast-bottom-full-width', 'toast-top-center', 'toast-bottom-center' ; default toast-top-right
type: Toast type can be : info,warning,error,success ; default success
timeout: Toast Timeout for auto close can be integer ; default 5000
progressbar: Progress Bar option need timeout or progressBarValue. can be boolean; default true
progressBarValue: Initial value of the progress bar in percents (0..100), default null which does mean the progress bar is controlled by timeout; use this.$root.$refs.toastr.setProgress(aToast, newValue) later
style: Inline style option should be an object with key: value structure. default { } (empty object)
closeOnHover: On mouse over stop timeout can be boolean; default true
clickClose: On click toast close can be boolean; default false
onCreated: On created toast event can be function
onClicked: On clicked toast event can be function
onClosed: On closed toast event can be function
onMouseOver: On mouse over toast event can be function
onMouseOut: On mouse over toast event can be function
}
yarn run build
```

### Note:
Pls for more details and example:
https://github.com/s4l1h/vue-toastr/blob/master/demo.js
### Lints and fixes files

```
yarn run lint
```

Toastr for Vue.js no jquery dependencies https://github.com/s4l1h/vue-toastr
### Documentation

Demo: http://s4l1h.github.io/vue-toastr/
```
yarn run docs
```

### Customize configuration

Ported From Jquery Toastr : http://codeseven.github.io/toastr/
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}
19 changes: 7 additions & 12 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"name": "vue-toastr",
"main": "dist/vue-toastr.js",
"description": "Toastr for Vue.js",
"version": "2.0.16",
"homepage": "https://github.com/s4l1h/vue-toastr",
"license": "MIT",
"ignore": [
".*",
"build",
"docs",
"package.json"
]
"name": "vue-toastr",
"main": "dist/vue-toastr.umd.min.js",
"description": "Toastr for Vue.js",
"version": "2.1.0",
"homepage": "https://github.com/s4l1h/vue-toastr",
"license": "MIT",
"ignore": [".*", "build", "docs", "demo", "package.json"]
}
Loading

0 comments on commit a18f3f9

Please sign in to comment.