fast-vue-multi-pages 1.0.23 → 1.0.25
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.
- package/dist/cjs/FastVueMultiTool.d.ts +5 -0
- package/dist/cjs/FastVueMultiTool.js +5 -0
- package/dist/cjs/other/FastVueMultiAnimate.d.ts +29 -0
- package/dist/cjs/other/FastVueMultiAnimate.js +79 -0
- package/dist/esm/FastVueMultiTool.d.ts +5 -0
- package/dist/esm/FastVueMultiTool.js +5 -1
- package/dist/esm/other/FastVueMultiAnimate.d.ts +29 -0
- package/dist/esm/other/FastVueMultiAnimate.js +87 -0
- package/package.json +3 -2
@@ -14,6 +14,7 @@ import { FastVueMultiBase64 } from "./other/FastVueMultiBase64";
|
|
14
14
|
import { FastVueMultiEventBus } from "./other/FastVueMultiEventBus";
|
15
15
|
import { FastVueMultiObject } from "./other/FastVueMultiObject";
|
16
16
|
import { FastVueMultiUUID } from "./other/FastVueMultiUUID";
|
17
|
+
import { FastVueMultiAnimate } from "./other/FastVueMultiAnimate";
|
17
18
|
/**
|
18
19
|
* FastVueMultiTool 工具类
|
19
20
|
*/
|
@@ -94,4 +95,8 @@ export declare class FastVueMultiTool {
|
|
94
95
|
* UUID操作
|
95
96
|
*/
|
96
97
|
static UUID: typeof FastVueMultiUUID;
|
98
|
+
/**
|
99
|
+
* 数值动画类
|
100
|
+
*/
|
101
|
+
static Animate: typeof FastVueMultiAnimate;
|
97
102
|
}
|
@@ -18,6 +18,7 @@ const FastVueMultiBase64_1 = require("./other/FastVueMultiBase64");
|
|
18
18
|
const FastVueMultiEventBus_1 = require("./other/FastVueMultiEventBus");
|
19
19
|
const FastVueMultiObject_1 = require("./other/FastVueMultiObject");
|
20
20
|
const FastVueMultiUUID_1 = require("./other/FastVueMultiUUID");
|
21
|
+
const FastVueMultiAnimate_1 = require("./other/FastVueMultiAnimate");
|
21
22
|
/**
|
22
23
|
* FastVueMultiTool 工具类
|
23
24
|
*/
|
@@ -98,5 +99,9 @@ class FastVueMultiTool {
|
|
98
99
|
* UUID操作
|
99
100
|
*/
|
100
101
|
static UUID = FastVueMultiUUID_1.FastVueMultiUUID;
|
102
|
+
/**
|
103
|
+
* 数值动画类
|
104
|
+
*/
|
105
|
+
static Animate = FastVueMultiAnimate_1.FastVueMultiAnimate;
|
101
106
|
}
|
102
107
|
exports.FastVueMultiTool = FastVueMultiTool;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare class FastVueMultiAnimate {
|
2
|
+
static animateMap: any;
|
3
|
+
/**
|
4
|
+
* 开启数值动画
|
5
|
+
* @param animateCode 动画唯一标识
|
6
|
+
* @param animateConfig 动画配置{@link ValueAnimateConfig}
|
7
|
+
*/
|
8
|
+
static startValueAnimate(animateCode: string, animateConfig: ValueAnimateConfig): void;
|
9
|
+
/**
|
10
|
+
* 清除动画
|
11
|
+
* @param animateCode
|
12
|
+
*/
|
13
|
+
static clearAnimate(animateCode: string): void;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* 动画配置,参考文档:https://animejs.com/documentation
|
17
|
+
*/
|
18
|
+
export declare class ValueAnimateConfig {
|
19
|
+
static newParam(param: any): ValueAnimateConfig;
|
20
|
+
from: number;
|
21
|
+
to: number;
|
22
|
+
duration: number;
|
23
|
+
easing: string;
|
24
|
+
delay: number;
|
25
|
+
update: (value: number) => void;
|
26
|
+
begin: (anim: any) => void;
|
27
|
+
complete: (anim: any) => void;
|
28
|
+
changeBegin: (anim: any) => void;
|
29
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ValueAnimateConfig = exports.FastVueMultiAnimate = void 0;
|
4
|
+
class FastVueMultiAnimate {
|
5
|
+
static animateMap = {};
|
6
|
+
/**
|
7
|
+
* 开启数值动画
|
8
|
+
* @param animateCode 动画唯一标识
|
9
|
+
* @param animateConfig 动画配置{@link ValueAnimateConfig}
|
10
|
+
*/
|
11
|
+
static startValueAnimate(animateCode, animateConfig) {
|
12
|
+
this.clearAnimate(animateCode);
|
13
|
+
let params = ValueAnimateConfig.newParam(animateConfig);
|
14
|
+
const anime = require('animejs');
|
15
|
+
this.animateMap[animateCode] = anime.default({
|
16
|
+
targets: {
|
17
|
+
value: params.from,
|
18
|
+
},
|
19
|
+
value: params.to,
|
20
|
+
easing: params.easing,
|
21
|
+
duration: params.duration,
|
22
|
+
delay: params.delay,
|
23
|
+
_params: params,
|
24
|
+
update: function () {
|
25
|
+
this._params.update(this.targets.value);
|
26
|
+
},
|
27
|
+
changeBegin: function (anim) {
|
28
|
+
this._params.changeBegin(anim);
|
29
|
+
},
|
30
|
+
begin: function (anim) {
|
31
|
+
this._params.begin(anim);
|
32
|
+
},
|
33
|
+
complete: function (anim) {
|
34
|
+
this._params.complete(anim);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* 清除动画
|
40
|
+
* @param animateCode
|
41
|
+
*/
|
42
|
+
static clearAnimate(animateCode) {
|
43
|
+
let animObj = FastVueMultiAnimate.animateMap[animateCode];
|
44
|
+
if (animObj) {
|
45
|
+
animObj.pause();
|
46
|
+
delete FastVueMultiAnimate.animateMap[animateCode];
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
exports.FastVueMultiAnimate = FastVueMultiAnimate;
|
51
|
+
/**
|
52
|
+
* 动画配置,参考文档:https://animejs.com/documentation
|
53
|
+
*/
|
54
|
+
class ValueAnimateConfig {
|
55
|
+
static newParam(param) {
|
56
|
+
let newParam = new ValueAnimateConfig();
|
57
|
+
if (param) {
|
58
|
+
for (let paramKey in param) {
|
59
|
+
newParam[paramKey] = param[paramKey];
|
60
|
+
}
|
61
|
+
}
|
62
|
+
return newParam;
|
63
|
+
}
|
64
|
+
from = 0;
|
65
|
+
to = 1;
|
66
|
+
duration = 500;
|
67
|
+
easing = "linear";
|
68
|
+
delay = 0;
|
69
|
+
//更新时的函数
|
70
|
+
update = function (value) {
|
71
|
+
};
|
72
|
+
begin = function (anim) {
|
73
|
+
};
|
74
|
+
complete = function (anim) {
|
75
|
+
};
|
76
|
+
changeBegin = function (anim) {
|
77
|
+
};
|
78
|
+
}
|
79
|
+
exports.ValueAnimateConfig = ValueAnimateConfig;
|
@@ -14,6 +14,7 @@ import { FastVueMultiBase64 } from "./other/FastVueMultiBase64";
|
|
14
14
|
import { FastVueMultiEventBus } from "./other/FastVueMultiEventBus";
|
15
15
|
import { FastVueMultiObject } from "./other/FastVueMultiObject";
|
16
16
|
import { FastVueMultiUUID } from "./other/FastVueMultiUUID";
|
17
|
+
import { FastVueMultiAnimate } from "./other/FastVueMultiAnimate";
|
17
18
|
/**
|
18
19
|
* FastVueMultiTool 工具类
|
19
20
|
*/
|
@@ -94,4 +95,8 @@ export declare class FastVueMultiTool {
|
|
94
95
|
* UUID操作
|
95
96
|
*/
|
96
97
|
static UUID: typeof FastVueMultiUUID;
|
98
|
+
/**
|
99
|
+
* 数值动画类
|
100
|
+
*/
|
101
|
+
static Animate: typeof FastVueMultiAnimate;
|
97
102
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
define(["require", "exports", "tslib", "lodash", "./http/FastVueMultiHttp", "./other/FastVueMultiStore", "./vue/FastVueMultiConfig", "./http/FastVueMultiCookie", "./other/FastVueMultiClipboard", "./other/FastVueMultiDate", "./other/FastVueMultiBoolean", "./other/FastVueMultiFunction", "./other/FastVueMultiElement", "./other/FastVueMultiWindow", "./other/FastVueMultiFile", "./other/FastVueMultiBase64", "./other/FastVueMultiEventBus", "./other/FastVueMultiObject", "./other/FastVueMultiUUID"], function (require, exports, tslib_1, lodash_1, FastVueMultiHttp_1, FastVueMultiStore_1, FastVueMultiConfig_1, FastVueMultiCookie_1, FastVueMultiClipboard_1, FastVueMultiDate_1, FastVueMultiBoolean_1, FastVueMultiFunction_1, FastVueMultiElement_1, FastVueMultiWindow_1, FastVueMultiFile_1, FastVueMultiBase64_1, FastVueMultiEventBus_1, FastVueMultiObject_1, FastVueMultiUUID_1) {
|
1
|
+
define(["require", "exports", "tslib", "lodash", "./http/FastVueMultiHttp", "./other/FastVueMultiStore", "./vue/FastVueMultiConfig", "./http/FastVueMultiCookie", "./other/FastVueMultiClipboard", "./other/FastVueMultiDate", "./other/FastVueMultiBoolean", "./other/FastVueMultiFunction", "./other/FastVueMultiElement", "./other/FastVueMultiWindow", "./other/FastVueMultiFile", "./other/FastVueMultiBase64", "./other/FastVueMultiEventBus", "./other/FastVueMultiObject", "./other/FastVueMultiUUID", "./other/FastVueMultiAnimate"], function (require, exports, tslib_1, lodash_1, FastVueMultiHttp_1, FastVueMultiStore_1, FastVueMultiConfig_1, FastVueMultiCookie_1, FastVueMultiClipboard_1, FastVueMultiDate_1, FastVueMultiBoolean_1, FastVueMultiFunction_1, FastVueMultiElement_1, FastVueMultiWindow_1, FastVueMultiFile_1, FastVueMultiBase64_1, FastVueMultiEventBus_1, FastVueMultiObject_1, FastVueMultiUUID_1, FastVueMultiAnimate_1) {
|
2
2
|
"use strict";
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.FastVueMultiTool = void 0;
|
@@ -85,6 +85,10 @@ define(["require", "exports", "tslib", "lodash", "./http/FastVueMultiHttp", "./o
|
|
85
85
|
* UUID操作
|
86
86
|
*/
|
87
87
|
FastVueMultiTool.UUID = FastVueMultiUUID_1.FastVueMultiUUID;
|
88
|
+
/**
|
89
|
+
* 数值动画类
|
90
|
+
*/
|
91
|
+
FastVueMultiTool.Animate = FastVueMultiAnimate_1.FastVueMultiAnimate;
|
88
92
|
return FastVueMultiTool;
|
89
93
|
}());
|
90
94
|
exports.FastVueMultiTool = FastVueMultiTool;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
export declare class FastVueMultiAnimate {
|
2
|
+
static animateMap: any;
|
3
|
+
/**
|
4
|
+
* 开启数值动画
|
5
|
+
* @param animateCode 动画唯一标识
|
6
|
+
* @param animateConfig 动画配置{@link ValueAnimateConfig}
|
7
|
+
*/
|
8
|
+
static startValueAnimate(animateCode: string, animateConfig: ValueAnimateConfig): void;
|
9
|
+
/**
|
10
|
+
* 清除动画
|
11
|
+
* @param animateCode
|
12
|
+
*/
|
13
|
+
static clearAnimate(animateCode: string): void;
|
14
|
+
}
|
15
|
+
/**
|
16
|
+
* 动画配置,参考文档:https://animejs.com/documentation
|
17
|
+
*/
|
18
|
+
export declare class ValueAnimateConfig {
|
19
|
+
static newParam(param: any): ValueAnimateConfig;
|
20
|
+
from: number;
|
21
|
+
to: number;
|
22
|
+
duration: number;
|
23
|
+
easing: string;
|
24
|
+
delay: number;
|
25
|
+
update: (value: number) => void;
|
26
|
+
begin: (anim: any) => void;
|
27
|
+
complete: (anim: any) => void;
|
28
|
+
changeBegin: (anim: any) => void;
|
29
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
define(["require", "exports"], function (require, exports) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.ValueAnimateConfig = exports.FastVueMultiAnimate = void 0;
|
5
|
+
var FastVueMultiAnimate = /** @class */ (function () {
|
6
|
+
function FastVueMultiAnimate() {
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* 开启数值动画
|
10
|
+
* @param animateCode 动画唯一标识
|
11
|
+
* @param animateConfig 动画配置{@link ValueAnimateConfig}
|
12
|
+
*/
|
13
|
+
FastVueMultiAnimate.startValueAnimate = function (animateCode, animateConfig) {
|
14
|
+
this.clearAnimate(animateCode);
|
15
|
+
var params = ValueAnimateConfig.newParam(animateConfig);
|
16
|
+
var anime = require('animejs');
|
17
|
+
this.animateMap[animateCode] = anime.default({
|
18
|
+
targets: {
|
19
|
+
value: params.from,
|
20
|
+
},
|
21
|
+
value: params.to,
|
22
|
+
easing: params.easing,
|
23
|
+
duration: params.duration,
|
24
|
+
delay: params.delay,
|
25
|
+
_params: params,
|
26
|
+
update: function () {
|
27
|
+
this._params.update(this.targets.value);
|
28
|
+
},
|
29
|
+
changeBegin: function (anim) {
|
30
|
+
this._params.changeBegin(anim);
|
31
|
+
},
|
32
|
+
begin: function (anim) {
|
33
|
+
this._params.begin(anim);
|
34
|
+
},
|
35
|
+
complete: function (anim) {
|
36
|
+
this._params.complete(anim);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
};
|
40
|
+
/**
|
41
|
+
* 清除动画
|
42
|
+
* @param animateCode
|
43
|
+
*/
|
44
|
+
FastVueMultiAnimate.clearAnimate = function (animateCode) {
|
45
|
+
var animObj = FastVueMultiAnimate.animateMap[animateCode];
|
46
|
+
if (animObj) {
|
47
|
+
animObj.pause();
|
48
|
+
delete FastVueMultiAnimate.animateMap[animateCode];
|
49
|
+
}
|
50
|
+
};
|
51
|
+
FastVueMultiAnimate.animateMap = {};
|
52
|
+
return FastVueMultiAnimate;
|
53
|
+
}());
|
54
|
+
exports.FastVueMultiAnimate = FastVueMultiAnimate;
|
55
|
+
/**
|
56
|
+
* 动画配置,参考文档:https://animejs.com/documentation
|
57
|
+
*/
|
58
|
+
var ValueAnimateConfig = /** @class */ (function () {
|
59
|
+
function ValueAnimateConfig() {
|
60
|
+
this.from = 0;
|
61
|
+
this.to = 1;
|
62
|
+
this.duration = 500;
|
63
|
+
this.easing = "linear";
|
64
|
+
this.delay = 0;
|
65
|
+
//更新时的函数
|
66
|
+
this.update = function (value) {
|
67
|
+
};
|
68
|
+
this.begin = function (anim) {
|
69
|
+
};
|
70
|
+
this.complete = function (anim) {
|
71
|
+
};
|
72
|
+
this.changeBegin = function (anim) {
|
73
|
+
};
|
74
|
+
}
|
75
|
+
ValueAnimateConfig.newParam = function (param) {
|
76
|
+
var newParam = new ValueAnimateConfig();
|
77
|
+
if (param) {
|
78
|
+
for (var paramKey in param) {
|
79
|
+
newParam[paramKey] = param[paramKey];
|
80
|
+
}
|
81
|
+
}
|
82
|
+
return newParam;
|
83
|
+
};
|
84
|
+
return ValueAnimateConfig;
|
85
|
+
}());
|
86
|
+
exports.ValueAnimateConfig = ValueAnimateConfig;
|
87
|
+
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "fast-vue-multi-pages",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.25",
|
4
4
|
"author": "janesen",
|
5
5
|
"description": "快速搭建VUE项目工具类的基本库,主要用于每个功能页面独立生成html",
|
6
6
|
"main": "./dist/cjs/index.js",
|
@@ -36,7 +36,8 @@
|
|
36
36
|
"file64": "^1.0.3",
|
37
37
|
"crypto-js": "^4.2.0",
|
38
38
|
"vue": "^3.2.13",
|
39
|
-
"js-cookie": "^3.0.5"
|
39
|
+
"js-cookie": "^3.0.5",
|
40
|
+
"animejs": "^3.2.2"
|
40
41
|
},
|
41
42
|
"devDependencies": {
|
42
43
|
"@typescript-eslint/eslint-plugin": "^7.16.0",
|