Skip to content

Commit a18f3f9

Browse files
committed
We are now using Vue CLI
1 parent 88e5fef commit a18f3f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+9997
-5432
lines changed

.eslintrc.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
/node_modules
21
.DS_Store
2+
node_modules
3+
public
4+
dist/*.gz
5+
dist/*.map
6+
coverage
7+
docs/.vuepress/dist
8+
9+
# local env files
10+
.env.local
11+
.env.*.local
12+
13+
# related test files
14+
/tests/e2e/reports
15+
/tests/e2e/videos
16+
/tests/e2e/screenshots
17+
18+
# editor directories and files
19+
.idea
320
.vscode
4-
package-lock.json
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw*

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// TODO: release log here ...

LICENSE

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 s4l1h
3+
Copyright (c) 2019
44

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

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

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 17 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,35 @@
11
# vue-toastr
22

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

5-
> For the **Vue 1.x** see the [1.0 branch](https://github.com/s4l1h/vue-toastr/tree/1.0). vue-toastr@**1.0.4**
6-
7-
8-
**Note:**:closeOnHover,onMouseOver,onMouseOut works only **2.x**
9-
10-
11-
### With npm & babel
12-
13-
*Add the Toast into the package.json. #for vue **1.x***
14-
15-
npm install vue-toastr@^1.0.4 --save
16-
17-
18-
*Add the Toast into the package.json. #for vue **2.x***
19-
20-
npm install vue-toastr@latest --save
21-
22-
*Add the toast in application and register component.*
23-
24-
// import Toastr
25-
import Toastr from 'vue-toastr';
26-
// import toastr scss file: need webpack sass-loader
27-
require('vue-toastr/src/vue-toastr.scss');
28-
// Register vue component
29-
Vue.component('vue-toastr',Toastr);
30-
***Plugin** mode (work only vue 2.x)*
31-
32-
// import Toastr
33-
import Toastr from 'vue-toastr';
34-
// import toastr scss file: need webpack sass-loader
35-
require('vue-toastr/src/vue-toastr.scss');
36-
// Register plugin
37-
Vue.use(Toastr, { /* options */ });
38-
***Plugin** Mode vue **2.x***
39-
40-
this.$toastr // use plugin mode autoamatic installed if you use browser.
41-
42-
*Add component html: for vue **1.x***
43-
44-
<vue-toastr v-ref:toastr></vue-toastr>
45-
46-
*Add component html: for vue **2.x***
47-
48-
<vue-toastr ref="toastr"></vue-toastr>
49-
50-
*Now you can manage toastr*
51-
52-
// use component
53-
this.$root.$refs.toastr.e("ERRROR MESSAGE");
54-
this.$root.$refs.toastr.s("SUCCESS MESSAGE");
55-
// use plugin
56-
this.$toastr.e("ERRROR MESSAGE");
57-
this.$toastr.s("SUCCESS MESSAGE");
58-
59-
### without npm
60-
61-
http://s4l1h.github.io/vue-toastr/
62-
63-
### Development Setup
64-
65-
``` bash
66-
# install deps
67-
npm install
68-
69-
# serve examples at http://localhost:8080/
70-
npm run dev
71-
# build dist/vue-toastr.js dist/vue-toastr.css
72-
npm run build
73-
# build for production min version. dist/vue-toastr.min.js dist/vue-toastr.min.css
74-
npm run build_min
75-
# build for production js+css combine. dist/vue-toastr.combine.min.js
76-
npm run build_combine
77-
# clear All builds.. rm -rf dist/*
78-
npm run clear
79-
#Build all. npm run build && npm run build_min && npm run build_combine
80-
npm run buildAll
5+
```
6+
yarn install
817
```
828

83-
## Doc # Overwrite Settings
84-
85-
### Overwrite inside component
9+
### Compiles and hot-reloads for development
8610

87-
#### Change Default Toast Timeout
88-
```
89-
this.$refs.toastr.defaultTimeout = 3000; // default timeout : 5000
90-
```
91-
#### Change Default Toast ProgressBar
92-
```
93-
this.$refs.toastr.defaultProgressBar = false; // default active : true
94-
```
95-
#### Change Default Toast ProgressBar Manual Value
9611
```
97-
this.$refs.toastr.defaultProgressBarValue = 0; // default value : null (managed by JS timer)
98-
```
99-
#### Change Default Toast Type
100-
```
101-
this.$refs.toastr.defaultType = "error"; // default type : success
102-
```
103-
#### Change Default Position
104-
```
105-
this.$refs.toastr.defaultPosition = "toast-bottom-left" // default position: toast-top-right
106-
```
107-
#### Change Default Close On Mouse Hover
108-
```
109-
this.$refs.toastr.defaultCloseOnHover = false // default close on hover: true
110-
```
111-
#### Change Default Style
112-
```
113-
this.$refs.toastr.defaultStyle = { "background-color": "red" } // default style: { }
12+
yarn run demo
11413
```
11514

116-
### Overwrite via plugin options
117-
*You can also overwrite defaults by passing options object during plugin registration*
118-
```
119-
Vue.use(Toastr, {
120-
defaultTimeout: 3000,
121-
defaultProgressBar: false,
122-
defaultProgressBarValue: 0,
123-
defaultType: "error",
124-
defaultPosition: "toast-bottom-left",
125-
defaultCloseOnHover: false,
126-
defaultStyle: { "background-color": "red" }
127-
})
128-
```
15+
### Compiles and minifies for production
12916

130-
## Doc # method
131-
#### New Error Type Toast Message
132-
```
133-
this.$refs.toastr.e("this.$refs.toastr.e message", "Error");
134-
```
135-
#### New Success Type Toast Message
136-
```
137-
this.$refs.toastr.s("this.$refs.toastr.s message");
138-
```
139-
#### New Warning Type Toast Message
140-
```
141-
this.$refs.toastr.w("this.$refs.toastr.w message", "Warning");
14217
```
143-
#### New Information Type Toast Message
144-
```
145-
this.$refs.toastr.i("this.$refs.toastr.i message", "Information");
146-
```
147-
#### Remove Toast Messages by type.
148-
```
149-
this.$refs.toastr.removeByType("error"); // error, warning, success, info
150-
```
151-
#### Remove Toast Messages by Name.
152-
```
153-
this.$refs.toastr.removeByName("UniqueToastName");
154-
```
155-
#### New Toast Message with default options.
156-
```
157-
this.$refs.toastr.Add("Working on the default options");
158-
```
159-
#### New Toast Message with options.
160-
```
161-
this.$root.$refs.toastr.Add({
162-
name: "UniqueToastName", // Toast Name now you can remove by name
163-
title: "Easy Toast", // Toast Title
164-
msg: "Hi", // Message
165-
clickClose: false, // Click Close Disable
166-
timeout: 0, // Remember defaultTimeout is 5 sec..
167-
progressBarValue: 0, // Manually update progress bar value later; null (not 0) is default
168-
position: "toast-top-full-width", // Toast Position.
169-
type: "error", // Toast type,
170-
preventDuplicates: true, //Default is false,
171-
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)
172-
});
173-
```
174-
## Doc # Options
175-
```
176-
{
177-
name: "Name Of The Toast",
178-
title: "Toast Title",
179-
msg: "Toast Msg",
180-
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
181-
type: Toast type can be : info,warning,error,success ; default success
182-
timeout: Toast Timeout for auto close can be integer ; default 5000
183-
progressbar: Progress Bar option need timeout or progressBarValue. can be boolean; default true
184-
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
185-
style: Inline style option should be an object with key: value structure. default { } (empty object)
186-
closeOnHover: On mouse over stop timeout can be boolean; default true
187-
clickClose: On click toast close can be boolean; default false
188-
onCreated: On created toast event can be function
189-
onClicked: On clicked toast event can be function
190-
onClosed: On closed toast event can be function
191-
onMouseOver: On mouse over toast event can be function
192-
onMouseOut: On mouse over toast event can be function
193-
}
18+
yarn run build
19419
```
19520

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

23+
```
24+
yarn run lint
25+
```
20026

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

203-
Demo: http://s4l1h.github.io/vue-toastr/
29+
```
30+
yarn run docs
31+
```
20432

33+
### Customize configuration
20534

206-
Ported From Jquery Toastr : http://codeseven.github.io/toastr/
35+
See [Configuration Reference](https://cli.vuejs.org/config/).

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/app'
4+
]
5+
}

bower.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
{
2-
"name": "vue-toastr",
3-
"main": "dist/vue-toastr.js",
4-
"description": "Toastr for Vue.js",
5-
"version": "2.0.16",
6-
"homepage": "https://github.com/s4l1h/vue-toastr",
7-
"license": "MIT",
8-
"ignore": [
9-
".*",
10-
"build",
11-
"docs",
12-
"package.json"
13-
]
2+
"name": "vue-toastr",
3+
"main": "dist/vue-toastr.umd.min.js",
4+
"description": "Toastr for Vue.js",
5+
"version": "2.1.0",
6+
"homepage": "https://github.com/s4l1h/vue-toastr",
7+
"license": "MIT",
8+
"ignore": [".*", "build", "docs", "demo", "package.json"]
149
}

0 commit comments

Comments
 (0)