@94ai/nf-toast-demo 9.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- declare const toast: (options: any) => any;
2
- declare const success: (options: any) => void;
3
- declare const errorFunc: (options: any) => void;
4
- declare const warning: (options: any) => void;
5
- declare const info: (options: any) => void;
6
- export { toast, success, errorFunc, warning, info };
1
+ declare const toast: (options: any) => any;
2
+ declare const success: (options: any) => any;
3
+ declare const errorFunc: (options: any) => any;
4
+ declare const warning: (options: any) => any;
5
+ declare const info: (options: any) => any;
6
+ export { toast, success, errorFunc, warning, info };
package/lib/index.d.ts CHANGED
@@ -1,124 +1,124 @@
1
- import { PluginObject } from 'vue-demi';
2
- declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{
3
- isShow: boolean;
4
- live: boolean;
5
- }, Readonly<import("vue-demi").ExtractPropTypes<{
6
- message: {
7
- type: StringConstructor;
8
- default: () => string;
9
- };
10
- tip: {
11
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
12
- default: () => string;
13
- };
14
- closable: {
15
- type: BooleanConstructor;
16
- default: () => true;
17
- };
18
- closend: {
19
- type: FunctionConstructor;
20
- };
21
- }>>, Readonly<import("vue-demi").ExtractPropTypes<{
22
- message: {
23
- type: StringConstructor;
24
- default: () => string;
25
- };
26
- tip: {
27
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
28
- default: () => string;
29
- };
30
- closable: {
31
- type: BooleanConstructor;
32
- default: () => true;
33
- };
34
- closend: {
35
- type: FunctionConstructor;
36
- };
37
- }>>, {}, {
38
- message: string;
39
- tip: "success" | "info" | "warning" | "error";
40
- closable: boolean;
41
- }, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
42
- message: {
43
- type: StringConstructor;
44
- default: () => string;
45
- };
46
- tip: {
47
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
48
- default: () => string;
49
- };
50
- closable: {
51
- type: BooleanConstructor;
52
- default: () => true;
53
- };
54
- closend: {
55
- type: FunctionConstructor;
56
- };
57
- }>>> & import("vue-demi").ShallowUnwrapRef<{}> & {
58
- isShow: boolean;
59
- live: boolean;
60
- } & import("vue/types/v3-component-options").ExtractComputedReturns<{
61
- getIcon(): Record<string, any>;
62
- style(): {};
63
- }> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
64
- message: {
65
- type: StringConstructor;
66
- default: () => string;
67
- };
68
- tip: {
69
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
70
- default: () => string;
71
- };
72
- closable: {
73
- type: BooleanConstructor;
74
- default: () => true;
75
- };
76
- closend: {
77
- type: FunctionConstructor;
78
- };
79
- }>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
80
- message: {
81
- type: StringConstructor;
82
- default: () => string;
83
- };
84
- tip: {
85
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
86
- default: () => string;
87
- };
88
- closable: {
89
- type: BooleanConstructor;
90
- default: () => true;
91
- };
92
- closend: {
93
- type: FunctionConstructor;
94
- };
95
- }>>, {}, {
96
- isShow: boolean;
97
- live: boolean;
98
- }, {
99
- getIcon(): Record<string, any>;
100
- style(): {};
101
- }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {
102
- message: string;
103
- tip: "success" | "info" | "warning" | "error";
104
- closable: boolean;
105
- }> & {
106
- props: {
107
- message: {
108
- type: StringConstructor;
109
- default: () => string;
110
- };
111
- tip: {
112
- type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
113
- default: () => string;
114
- };
115
- closable: {
116
- type: BooleanConstructor;
117
- default: () => true;
118
- };
119
- closend: {
120
- type: FunctionConstructor;
121
- };
122
- };
123
- } & PluginObject<undefined>;
124
- export default _default;
1
+ import { PluginObject } from 'vue-demi';
2
+ declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{
3
+ isShow: boolean;
4
+ live: boolean;
5
+ }, Readonly<import("vue-demi").ExtractPropTypes<{
6
+ message: {
7
+ type: StringConstructor;
8
+ default: () => string;
9
+ };
10
+ tip: {
11
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
12
+ default: () => string;
13
+ };
14
+ closable: {
15
+ type: BooleanConstructor;
16
+ default: () => true;
17
+ };
18
+ closend: {
19
+ type: FunctionConstructor;
20
+ };
21
+ }>>, Readonly<import("vue-demi").ExtractPropTypes<{
22
+ message: {
23
+ type: StringConstructor;
24
+ default: () => string;
25
+ };
26
+ tip: {
27
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
28
+ default: () => string;
29
+ };
30
+ closable: {
31
+ type: BooleanConstructor;
32
+ default: () => true;
33
+ };
34
+ closend: {
35
+ type: FunctionConstructor;
36
+ };
37
+ }>>, {}, {
38
+ message: string;
39
+ tip: "success" | "info" | "warning" | "error";
40
+ closable: boolean;
41
+ }, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
42
+ message: {
43
+ type: StringConstructor;
44
+ default: () => string;
45
+ };
46
+ tip: {
47
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
48
+ default: () => string;
49
+ };
50
+ closable: {
51
+ type: BooleanConstructor;
52
+ default: () => true;
53
+ };
54
+ closend: {
55
+ type: FunctionConstructor;
56
+ };
57
+ }>>> & import("vue-demi").ShallowUnwrapRef<{}> & {
58
+ isShow: boolean;
59
+ live: boolean;
60
+ } & import("vue/types/v3-component-options").ExtractComputedReturns<{
61
+ getIcon(): Record<string, any>;
62
+ style(): {};
63
+ }> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
64
+ message: {
65
+ type: StringConstructor;
66
+ default: () => string;
67
+ };
68
+ tip: {
69
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
70
+ default: () => string;
71
+ };
72
+ closable: {
73
+ type: BooleanConstructor;
74
+ default: () => true;
75
+ };
76
+ closend: {
77
+ type: FunctionConstructor;
78
+ };
79
+ }>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
80
+ message: {
81
+ type: StringConstructor;
82
+ default: () => string;
83
+ };
84
+ tip: {
85
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
86
+ default: () => string;
87
+ };
88
+ closable: {
89
+ type: BooleanConstructor;
90
+ default: () => true;
91
+ };
92
+ closend: {
93
+ type: FunctionConstructor;
94
+ };
95
+ }>>, {}, {
96
+ isShow: boolean;
97
+ live: boolean;
98
+ }, {
99
+ getIcon(): Record<string, any>;
100
+ style(): {};
101
+ }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {
102
+ message: string;
103
+ tip: "success" | "info" | "warning" | "error";
104
+ closable: boolean;
105
+ }> & {
106
+ props: {
107
+ message: {
108
+ type: StringConstructor;
109
+ default: () => string;
110
+ };
111
+ tip: {
112
+ type: import("vue-demi").PropType<"success" | "info" | "warning" | "error">;
113
+ default: () => string;
114
+ };
115
+ closable: {
116
+ type: BooleanConstructor;
117
+ default: () => true;
118
+ };
119
+ closend: {
120
+ type: FunctionConstructor;
121
+ };
122
+ };
123
+ } & PluginObject<undefined>;
124
+ export default _default;
@@ -175,8 +175,6 @@ const NotificationConstructor = vueDemi.Vue2.extend(Component);
175
175
  const instances = [];
176
176
  let seed = 1;
177
177
  const removeInstance = (instance) => {
178
- if (!instance)
179
- return;
180
178
  const len = instances.length;
181
179
  const index = instances.findIndex((inst) => instance.id === inst.id);
182
180
  instances.splice(index, 1);
@@ -224,16 +222,16 @@ const toast = (options) => {
224
222
  return instance.vm;
225
223
  };
226
224
  const success = (options) => {
227
- toast(Object.assign(options, { type: "success" }));
225
+ return toast(Object.assign({}, options, { tip: "success" }));
228
226
  };
229
227
  const errorFunc = (options) => {
230
- toast(Object.assign(options, { type: "error" }));
228
+ return toast(Object.assign({}, options, { tip: "error" }));
231
229
  };
232
230
  const warning = (options) => {
233
- toast(Object.assign(options, { type: "warning" }));
231
+ return toast(Object.assign({}, options, { tip: "warning" }));
234
232
  };
235
233
  const info = (options) => {
236
- toast(Object.assign(options, { type: "info" }));
234
+ return toast(Object.assign({}, options, { tip: "info" }));
237
235
  };
238
236
  NfToastDemo.install = (app) => {
239
237
  app.component("nf-toast-demo", NfToastDemo);
@@ -173,8 +173,6 @@ const NotificationConstructor = Vue2.extend(Component);
173
173
  const instances = [];
174
174
  let seed = 1;
175
175
  const removeInstance = (instance) => {
176
- if (!instance)
177
- return;
178
176
  const len = instances.length;
179
177
  const index = instances.findIndex((inst) => instance.id === inst.id);
180
178
  instances.splice(index, 1);
@@ -222,16 +220,16 @@ const toast = (options) => {
222
220
  return instance.vm;
223
221
  };
224
222
  const success = (options) => {
225
- toast(Object.assign(options, { type: "success" }));
223
+ return toast(Object.assign({}, options, { tip: "success" }));
226
224
  };
227
225
  const errorFunc = (options) => {
228
- toast(Object.assign(options, { type: "error" }));
226
+ return toast(Object.assign({}, options, { tip: "error" }));
229
227
  };
230
228
  const warning = (options) => {
231
- toast(Object.assign(options, { type: "warning" }));
229
+ return toast(Object.assign({}, options, { tip: "warning" }));
232
230
  };
233
231
  const info = (options) => {
234
- toast(Object.assign(options, { type: "info" }));
232
+ return toast(Object.assign({}, options, { tip: "info" }));
235
233
  };
236
234
  NfToastDemo.install = (app) => {
237
235
  app.component("nf-toast-demo", NfToastDemo);
@@ -1,45 +1,45 @@
1
- import { PropType } from 'vue-demi';
2
- declare const _default: import("vue-demi").DefineComponent<{
3
- message: {
4
- type: StringConstructor;
5
- default: () => string;
6
- };
7
- tip: {
8
- type: PropType<"success" | "info" | "warning" | "error">;
9
- default: () => string;
10
- };
11
- closable: {
12
- type: BooleanConstructor;
13
- default: () => true;
14
- };
15
- closend: {
16
- type: FunctionConstructor;
17
- };
18
- }, {}, {
19
- isShow: boolean;
20
- live: boolean;
21
- }, {
22
- getIcon(): Record<string, any>;
23
- style(): {};
24
- }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{
25
- message: {
26
- type: StringConstructor;
27
- default: () => string;
28
- };
29
- tip: {
30
- type: PropType<"success" | "info" | "warning" | "error">;
31
- default: () => string;
32
- };
33
- closable: {
34
- type: BooleanConstructor;
35
- default: () => true;
36
- };
37
- closend: {
38
- type: FunctionConstructor;
39
- };
40
- }>>, {
41
- message: string;
42
- tip: "success" | "info" | "warning" | "error";
43
- closable: boolean;
44
- }>;
45
- export default _default;
1
+ import { PropType } from 'vue-demi';
2
+ declare const _default: import("vue-demi").DefineComponent<{
3
+ message: {
4
+ type: StringConstructor;
5
+ default: () => string;
6
+ };
7
+ tip: {
8
+ type: PropType<"success" | "info" | "warning" | "error">;
9
+ default: () => string;
10
+ };
11
+ closable: {
12
+ type: BooleanConstructor;
13
+ default: () => true;
14
+ };
15
+ closend: {
16
+ type: FunctionConstructor;
17
+ };
18
+ }, {}, {
19
+ isShow: boolean;
20
+ live: boolean;
21
+ }, {
22
+ getIcon(): Record<string, any>;
23
+ style(): {};
24
+ }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{
25
+ message: {
26
+ type: StringConstructor;
27
+ default: () => string;
28
+ };
29
+ tip: {
30
+ type: PropType<"success" | "info" | "warning" | "error">;
31
+ default: () => string;
32
+ };
33
+ closable: {
34
+ type: BooleanConstructor;
35
+ default: () => true;
36
+ };
37
+ closend: {
38
+ type: FunctionConstructor;
39
+ };
40
+ }>>, {
41
+ message: string;
42
+ tip: "success" | "info" | "warning" | "error";
43
+ closable: boolean;
44
+ }>;
45
+ export default _default;
@@ -0,0 +1 @@
1
+
@@ -0,0 +1 @@
1
+
@@ -1,64 +1,64 @@
1
- declare const _default: {
2
- extends: import("vue").DefineComponent<{
3
- message: {
4
- type: StringConstructor;
5
- default: () => string;
6
- };
7
- tip: {
8
- type: import("vue").PropType<"success" | "info" | "warning" | "error">;
9
- default: () => string;
10
- };
11
- closable: {
12
- type: BooleanConstructor;
13
- default: () => true;
14
- };
15
- closend: {
16
- type: FunctionConstructor;
17
- };
18
- }, {}, {
19
- isShow: boolean;
20
- live: boolean;
21
- }, {
22
- getIcon(): Record<string, any>;
23
- style(): {};
24
- }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
25
- message: {
26
- type: StringConstructor;
27
- default: () => string;
28
- };
29
- tip: {
30
- type: import("vue").PropType<"success" | "info" | "warning" | "error">;
31
- default: () => string;
32
- };
33
- closable: {
34
- type: BooleanConstructor;
35
- default: () => true;
36
- };
37
- closend: {
38
- type: FunctionConstructor;
39
- };
40
- }>>, {
41
- message: string;
42
- tip: "success" | "info" | "warning" | "error";
43
- closable: boolean;
44
- }>;
45
- data(): {
46
- timer: undefined;
47
- verticalOffset: number;
48
- autoClose: number;
49
- height: number;
50
- isShow: boolean;
51
- functionCall: boolean;
52
- };
53
- mounted(): void;
54
- computed: {
55
- style(): any;
56
- };
57
- methods: {
58
- createTimer(): void;
59
- clearTimer(): void;
60
- afterEnter(): void;
61
- };
62
- beforeDestroy(): void;
63
- };
64
- export default _default;
1
+ declare const _default: {
2
+ extends: import("vue").DefineComponent<{
3
+ message: {
4
+ type: StringConstructor;
5
+ default: () => string;
6
+ };
7
+ tip: {
8
+ type: import("vue").PropType<"success" | "info" | "warning" | "error">;
9
+ default: () => string;
10
+ };
11
+ closable: {
12
+ type: BooleanConstructor;
13
+ default: () => true;
14
+ };
15
+ closend: {
16
+ type: FunctionConstructor;
17
+ };
18
+ }, {}, {
19
+ isShow: boolean;
20
+ live: boolean;
21
+ }, {
22
+ getIcon(): Record<string, any>;
23
+ style(): {};
24
+ }, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
25
+ message: {
26
+ type: StringConstructor;
27
+ default: () => string;
28
+ };
29
+ tip: {
30
+ type: import("vue").PropType<"success" | "info" | "warning" | "error">;
31
+ default: () => string;
32
+ };
33
+ closable: {
34
+ type: BooleanConstructor;
35
+ default: () => true;
36
+ };
37
+ closend: {
38
+ type: FunctionConstructor;
39
+ };
40
+ }>>, {
41
+ message: string;
42
+ tip: "success" | "info" | "warning" | "error";
43
+ closable: boolean;
44
+ }>;
45
+ data(): {
46
+ timer: undefined;
47
+ verticalOffset: number;
48
+ autoClose: number;
49
+ height: number;
50
+ isShow: boolean;
51
+ functionCall: boolean;
52
+ };
53
+ mounted(): void;
54
+ computed: {
55
+ style(): any;
56
+ };
57
+ methods: {
58
+ createTimer(): void;
59
+ clearTimer(): void;
60
+ afterEnter(): void;
61
+ };
62
+ beforeDestroy(): void;
63
+ };
64
+ export default _default;
@@ -4,7 +4,6 @@ const NotificationConstructor = Vue2!.extend(Component) as any
4
4
  const instances = []
5
5
  let seed = 1
6
6
  const removeInstance = (instance) => {
7
- if (!instance) return
8
7
  const len = instances.length
9
8
  // @ts-ignore
10
9
  const index = instances.findIndex((inst) => instance.id === inst.id)
@@ -56,16 +55,16 @@ const toast = (options) => {
56
55
  }
57
56
 
58
57
  const success = (options) => {
59
- toast(Object.assign(options, { type: 'success' }))
58
+ return toast(Object.assign({}, options, { tip: 'success' }))
60
59
  }
61
60
  const errorFunc = (options) => {
62
- toast(Object.assign(options, { type: 'error' }))
61
+ return toast(Object.assign({}, options, { tip: 'error' }))
63
62
  }
64
63
  const warning = (options) => {
65
- toast(Object.assign(options, { type: 'warning' }))
64
+ return toast(Object.assign({}, options, { tip: 'warning' }))
66
65
  }
67
66
  const info = (options) => {
68
- toast(Object.assign(options, { type: 'info' }))
67
+ return toast(Object.assign({}, options, { tip: 'info' }))
69
68
  }
70
69
 
71
70
  export { toast, success, errorFunc, warning, info }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-toast-demo",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "description": "toast示例组件",
5
5
  "keywords": [
6
6
  "toast"
@@ -16,8 +16,9 @@
16
16
  "url": "http://gitlab.94ai.pro/zoujiahe/common-ui.git"
17
17
  },
18
18
  "dependencies": {
19
- "@94ai/nf-theme-chalk": "^9.0.0",
20
- "vue-demi": "^0.14.5"
19
+ "@94ai/nf-theme-chalk": "^10.0.0",
20
+ "vue-demi": "^0.14.5",
21
+ "@94ai/vue2-runtime-helpers": "1.0.1"
21
22
  },
22
23
  "peerDependenciesMeta": {
23
24
  "@vue/composition-api": {
@@ -26,11 +27,10 @@
26
27
  },
27
28
  "peerDependencies": {
28
29
  "@vue/composition-api": "^1.0.0-rc.1",
29
- "element-ui": ">=2.13.2",
30
- "vue": "^2.0.0 || >=3.0.0"
30
+ "vue": "^2.0.0 || >=3.0.0",
31
+ "element-ui": ">=2.13.2"
31
32
  },
32
33
  "types": "lib/index.d.ts",
33
34
  "main": "lib/nf-toast-demo.cjs.js",
34
- "module": "lib/nf-toast-demo.esm-bundler.js",
35
- "gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
35
+ "module": "lib/nf-toast-demo.esm-bundler.js"
36
36
  }