Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: artemsky/vue-snotify
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: fireguard/vue-snotify
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 55 files changed
  • 1 contributor

Commits on Dec 10, 2020

  1. Add dist on package

    meneguite committed Dec 10, 2020
    Copy the full SHA
    2bb939a View commit details
  2. Copy the full SHA
    da895f4 View commit details
Showing with 9,612 additions and 1,006 deletions.
  1. +1 −1 .gitignore
  2. +51 −0 dist/README.md
  3. +285 −0 dist/SnotifyService.d.ts
  4. +52 −0 dist/components/toast.model.d.ts
  5. +12 −0 dist/decorators/set-toast-type.decorator.d.ts
  6. +12 −0 dist/decorators/transform-argument.decorator.d.ts
  7. +14 −0 dist/enums/SnotifyPosition.enum.d.ts
  8. +5 −0 dist/enums/SnotifyStyle.enum.d.ts
  9. +2 −0 dist/enums/index.d.ts
  10. +18 −0 dist/index.d.ts
  11. +25 −0 dist/interfaces/Snotify.interface.d.ts
  12. +26 −0 dist/interfaces/SnotifyAnimate.interface.d.ts
  13. +30 −0 dist/interfaces/SnotifyButton.interface.d.ts
  14. +11 −0 dist/interfaces/SnotifyDefaults.interface.d.ts
  15. +45 −0 dist/interfaces/SnotifyGlobalConfig.interface.d.ts
  16. +15 −0 dist/interfaces/SnotifyNotifications.interface.d.ts
  17. +14 −0 dist/interfaces/SnotifyStyles.interface.d.ts
  18. +111 −0 dist/interfaces/SnotifyToastConfig.interface.d.ts
  19. +8 −0 dist/interfaces/index.d.ts
  20. +5 −0 dist/package-lock.json
  21. +54 −0 dist/package.json
  22. +201 −0 dist/styles/_shared/animations.scss
  23. +53 −0 dist/styles/_shared/icons.scss
  24. +65 −0 dist/styles/_shared/snotify.scss
  25. +594 −0 dist/styles/dark.css
  26. +7 −0 dist/styles/dark.scss
  27. +41 −0 dist/styles/dark/buttons.scss
  28. +49 −0 dist/styles/dark/icon.scss
  29. +133 −0 dist/styles/dark/prompt.scss
  30. +91 −0 dist/styles/dark/toast.scss
  31. +710 −0 dist/styles/material.css
  32. +7 −0 dist/styles/material.scss
  33. +78 −0 dist/styles/material/buttons.scss
  34. +49 −0 dist/styles/material/icon.scss
  35. +133 −0 dist/styles/material/prompt.scss
  36. +242 −0 dist/styles/material/toast.scss
  37. +618 −0 dist/styles/simple.css
  38. +7 −0 dist/styles/simple.scss
  39. +41 −0 dist/styles/simple/buttons.scss
  40. +49 −0 dist/styles/simple/icon.scss
  41. +133 −0 dist/styles/simple/prompt.scss
  42. +134 −0 dist/styles/simple/toast.scss
  43. +75 −0 dist/toastDefaults.d.ts
  44. +4 −0 dist/types/event.type.d.ts
  45. +2 −0 dist/types/index.d.ts
  46. +1 −0 dist/types/snotify.type.d.ts
  47. +17 −0 dist/utils.d.ts
  48. +1,176 −0 dist/vue-snotify.common.js
  49. +1,169 −0 dist/vue-snotify.esm.js
  50. +1,180 −0 dist/vue-snotify.js
  51. +6 −0 dist/vue-snotify.min.js
  52. +1 −1 gulpfile.js
  53. +1,740 −992 package-lock.json
  54. +10 −11 package.json
  55. +0 −1 src/components/Snotify.vue
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ Desktop.ini


# Build files
dist/*
# dist/*
dist-example
/src/package-lock.json
/docs/_book
51 changes: 51 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# vue-snotify

[![Build Status](https://travis-ci.org/artemsky/vue-snotify.svg?branch=master)](https://travis-ci.org/artemsky/vue-snotify)
[![NPM Version](https://img.shields.io/npm/v/vue-snotify.svg)](https://www.npmjs.com/package/vue-snotify)
[![NPM Downloads](https://img.shields.io/npm/dt/vue-snotify.svg)](https://www.npmjs.com/package/vue-snotify)
[![Dev dependencies status list](https://david-dm.org/artemsky/vue-snotify/dev-status.svg)](https://david-dm.org/artemsky/vue-snotify?type=dev)

## Example
https://artemsky.github.io/vue-snotify/

## Features

- 9 types of toast notifications (async, confirm, prompt, html and more...)
- Many config options (icons, backdrop, timeout, position and much more...)
- Repository includes 3 different styles. So you can use on of them, or create your own.
- Callbacks
- 5KB minified and gzipped
- Typescript definitions
- ESM, CommonJS, UMD versions

###### Looking for an Angular version? [Here](https://github.com/artemsky/ng-snotify/)

![Snotify Gif](https://artemsky.github.io/vue-snotify/static/vue-snotify-demo.gif)

## Installation

###### NPM 5
`npm install vue-snotify`

###### yarn
`yarn add vue-snotify`

[see detailed instruction](https://artemsky.github.io/vue-snotify/documentation/installation.html)

## Documentation and Examples

Documentation - [here](https://artemsky.github.io/vue-snotify/documentation/index.html)
Example application source - [here](https://github.com/artemsky/vue-snotify/tree/master/example/src)
Change Log - [here](https://github.com/artemsky/vue-snotify/blob/master/CHANGELOG.md)

#### CDN
- JS
- [unpkg.com](https://unpkg.com/vue-snotify@latest/vue-snotify.min.js) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/vue-snotify.min.js)
- CSS
- material [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/material.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/material.css)
- simple [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/simple.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/simple.css)
- dark [unpkg.com](https://unpkg.com/vue-snotify@latest/styles/dark.css) | [jsDelivr.com](https://cdn.jsdelivr.net/npm/vue-snotify@latest/styles/dark.css)

## License

MIT © [artemsky](mailto:mr.artemsky@gmail.com)
285 changes: 285 additions & 0 deletions dist/SnotifyService.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
import Vue from 'vue';
import { SnotifyToast } from './components/toast.model';
import { SnotifyToastConfig, Snotify, SnotifyDefaults } from './interfaces';
import { SnotifyType } from './types';
/**
* this - create, remove, config toasts
*/
export declare class SnotifyService {
readonly emitter: object & Record<never, any> & Vue;
notifications: SnotifyToast[];
config: SnotifyDefaults;
/**
* emit changes in notifications array
*/
emit(): void;
/**
* returns SnotifyToast object
* @param id {Number}
* @return {SnotifyToast|undefined}
*/
get(id: number): SnotifyToast;
/**
* add SnotifyToast to notifications array
* @param toast {SnotifyToast}
*/
add(toast: SnotifyToast): void;
/**
* If ID passed, emits toast animation remove, if ID & REMOVE passed, removes toast from notifications array
* @param id {number}
* @param remove {boolean}
*/
remove(id?: number | string, remove?: boolean): void;
/**
* Clear notifications array
*/
clear(): void;
button(text: string, closeOnClick?: boolean, action?: (toast?: SnotifyToast) => void, bold?: boolean): {
text: string;
action: (toast?: SnotifyToast) => void;
bold: boolean;
};
/**
* Creates toast and add it to array, returns toast id
* @param snotify {Snotify}
* @return {number}
*/
create(snotify: Snotify): SnotifyToast;
setDefaults(defaults: SnotifyDefaults): SnotifyDefaults;
/**
* Create toast with simple style returns toast id;
* @param body {String}
* @returns {number}
*/
simple(body: string): SnotifyToast;
/**
* Create toast with simple style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
simple(body: string, title: string): SnotifyToast;
/**
* Create toast with simple style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
simple(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with simple style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
simple(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with success style returns toast id;
* @param body {String}
* @returns {number}
*/
success(body: string): SnotifyToast;
/**
* Create toast with success style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
success(body: string, title: string): SnotifyToast;
/**
* Create toast with success style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
success(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with success style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
success(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with error style returns toast id;
* @param body {String}
* @returns {number}
*/
error(body: string): SnotifyToast;
/**
* Create toast with error style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
error(body: string, title: string): SnotifyToast;
/**
* Create toast with error style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
error(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with error style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
error(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with info style returns toast id;
* @param body {String}
* @returns {number}
*/
info(body: string): SnotifyToast;
/**
* Create toast with info style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
info(body: string, title: string): SnotifyToast;
/**
* Create toast with info style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
info(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with info style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
info(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with warning style returns toast id;
* @param body {String}
* @returns {number}
*/
warning(body: string): SnotifyToast;
/**
* Create toast with warning style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
warning(body: string, title: string): SnotifyToast;
/**
* Create toast with warning style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
warning(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with warning style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
warning(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with confirm style returns toast id;
* @param body {String}
* @returns {number}
*/
confirm(body: string): SnotifyToast;
/**
* Create toast with confirm style returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
confirm(body: string, title: string): SnotifyToast;
/**
* Create toast with confirm style returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
confirm(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with confirm style returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
confirm(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with Prompt style {with two buttons}, returns toast id;
* @param body {String}
* @returns {number}
*/
prompt(body: string): SnotifyToast;
/**
* Create toast with Prompt style {with two buttons}, returns toast id;
* @param body {String}
* @param title {String}
* @returns {number}
*/
prompt(body: string, title: string): SnotifyToast;
/**
* Create toast with Prompt style {with two buttons}, returns toast id;
* @param body {String}
* @param config {SnotifyToastConfig}
* @returns {number}
*/
prompt(body: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Create toast with Prompt style {with two buttons}, returns toast id;
* @param [body] {String}
* @param [title] {String}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
prompt(body: string, title: string, config: SnotifyToastConfig): SnotifyToast;
/**
* Creates async toast with Info style. Pass action, and resolve or reject it.
* @param body {String}
* @param action {() => Promise<Snotify>}
* @returns {number}
*/
async(body: string, action: () => Promise<Snotify>): SnotifyToast;
/**
* Creates async toast with Info style. Pass action, and resolve or reject it.
* @param body {String}
* @param title {String}
* @param action {() => Promise<Snotify>}
* @returns {number}
*/
async(body: string, title: string, action: () => Promise<Snotify>): SnotifyToast;
/**
* Creates async toast with Info style. Pass action, and resolve or reject it.
* @param body {String}
* @param action {() => Promise<Snotify>}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
async(body: string, action: () => Promise<Snotify>, config: SnotifyToastConfig): SnotifyToast;
/**
* Creates async toast with Info style. Pass action, and resolve or reject it.
* @param body {String}
* @param title {String}
* @param action {() => Promise<Snotify>}
* @param [config] {SnotifyToastConfig}
* @returns {number}
*/
async(body: string, title: string, action: () => Promise<Snotify>, config: SnotifyToastConfig): SnotifyToast;
mergeToast(toast: any, next: any, type?: SnotifyType): void;
/**
* Creates empty toast with html string inside
* @param {string} html
* @param {SnotifyToastConfig} config
* @returns {number}
*/
html(html: string, config?: SnotifyToastConfig): SnotifyToast;
}
52 changes: 52 additions & 0 deletions dist/components/toast.model.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import Vue from 'vue';
import { SnotifyToastConfig } from '../interfaces';
import { SnotifyEvent } from '../types';
/**
* Toast model
*/
export declare class SnotifyToast {
id: number | string;
title: string;
body: string;
config: SnotifyToastConfig;
/**
* Emits {SnotifyEvent}
* @type {Vue}
*/
readonly eventEmitter: object & Record<never, any> & Vue;
/**
* Holds all subscribers because we need to unsubscribe from all before toast get destroyed
* @type {Vue[]}
* @private
*/
private _eventsHolder;
/**
* Toast prompt value
*/
value: string;
/**
* Toast validator
*/
valid: boolean;
/**
*
* @param {number|string} id
* @param {string} title
* @param {string} body
* @param {SnotifyToastConfig} [config]
*/
constructor(id: number | string, title: string, body: string, config: SnotifyToastConfig);
/**
* This callback is displayed as a global member.
* @callback action
* @param {toast} responseCode
* @returns {void}
*/
/**
* Subscribe to toast events
* @param {String<SnotifyEvent>} event
* @param {SnotifyToast~action} action
* @returns {SnotifyToast}
*/
on(event: SnotifyEvent, action: (toast: this) => void): this;
}
Loading