@visactor/vrender 1.0.0-alpha.1 → 1.0.0-alpha.2
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +73 -31
- package/dist/index.js +73 -31
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
|
|
22
22
|
const vrender_core_1 = require("@visactor/vrender-core"), vrender_kits_1 = require("@visactor/vrender-kits"), vrender_kits_2 = require("@visactor/vrender-kits");
|
|
23
23
|
|
|
24
|
-
exports.version = "1.0.0-alpha.
|
|
24
|
+
exports.version = "1.0.0-alpha.2", (0, vrender_core_1.preLoadAllModule)(), (0, vrender_core_1.isBrowserEnv)() ? (0,
|
|
25
25
|
vrender_kits_1.loadBrowserEnv)(vrender_core_1.container) : (0, vrender_core_1.isNodeEnv)() && (0,
|
|
26
26
|
vrender_kits_1.loadNodeEnv)(vrender_core_1.container), (0, vrender_kits_2.registerArc)(),
|
|
27
27
|
(0, vrender_kits_2.registerArc3d)(), (0, vrender_kits_2.registerArea)(), (0, vrender_kits_2.registerCircle)(),
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,eAAe,CAAC;AAEvC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"1.0.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAWgC;AAChC,yDAAqE;AACrE,yDAmBgC;AAEnB,QAAA,OAAO,GAAG,eAAe,CAAC;AAEvC,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAI,IAAA,2BAAY,GAAE,EAAE;IAClB,IAAA,6BAAc,EAAC,wBAAS,CAAC,CAAC;CAC3B;KAAM,IAAI,IAAA,wBAAS,GAAE,EAAE;IACtB,IAAA,0BAAW,EAAC,wBAAS,CAAC,CAAC;CACxB;AACD,IAAA,0BAAW,GAAE,CAAC;AACd,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,4BAAa,GAAE,CAAC;AAChB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,8BAAe,GAAE,CAAC;AAClB,IAAA,gCAAiB,GAAE,CAAC;AACpB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,+BAAgB,GAAE,CAAC;AACnB,IAAA,iCAAkB,GAAE,CAAC;AACrB,IAAA,6BAAc,GAAE,CAAC;AACjB,IAAA,2BAAY,GAAE,CAAC;AACf,IAAA,+BAAgB,GAAE,CAAC;AAEnB,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,4CAA6B,GAAE,CAAC;AAChC,IAAA,0CAA2B,GAAE,CAAC;AAC9B,IAAA,2CAA4B,GAAE,CAAC;AAC/B,IAAA,uCAAwB,GAAE,CAAC;AAC3B,IAAA,kCAAmB,GAAE,CAAC;AACtB,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C","file":"index.js","sourcesContent":["import '@visactor/vrender-core';\nimport {\n container,\n isBrowserEnv,\n isNodeEnv,\n preLoadAllModule,\n registerFlexLayoutPlugin,\n registerViewTransform3dPlugin,\n registerHtmlAttributePlugin,\n registerReactAttributePlugin,\n registerDirectionalLight,\n registerOrthoCamera\n} from '@visactor/vrender-core';\nimport { loadBrowserEnv, loadNodeEnv } from '@visactor/vrender-kits';\nimport {\n registerArc,\n registerArc3d,\n registerArea,\n registerCircle,\n registerGlyph,\n registerGroup,\n registerImage,\n registerLine,\n registerPath,\n registerPolygon,\n registerPyramid3d,\n registerRect,\n registerRect3d,\n registerRichtext,\n registerShadowRoot,\n registerSymbol,\n registerText,\n registerWrapText\n} from '@visactor/vrender-kits';\n// 导出版本号\nexport const version = \"1.0.0-alpha.2\";\n\npreLoadAllModule();\n\nif (isBrowserEnv()) {\n loadBrowserEnv(container);\n} else if (isNodeEnv()) {\n loadNodeEnv(container);\n}\nregisterArc();\nregisterArc3d();\nregisterArea();\nregisterCircle();\nregisterGlyph();\nregisterGroup();\nregisterImage();\nregisterLine();\nregisterPath();\nregisterPolygon();\nregisterPyramid3d();\nregisterRect();\nregisterRect3d();\nregisterRichtext();\nregisterShadowRoot();\nregisterSymbol();\nregisterText();\nregisterWrapText();\n\nregisterFlexLayoutPlugin();\nregisterViewTransform3dPlugin();\nregisterHtmlAttributePlugin();\nregisterReactAttributePlugin();\nregisterDirectionalLight();\nregisterOrthoCamera();\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -16883,7 +16883,7 @@ class Stage extends Group {
|
|
|
16883
16883
|
}
|
|
16884
16884
|
initAnimate(params) {
|
|
16885
16885
|
var _a;
|
|
16886
|
-
this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), "
|
|
16886
|
+
this.createTicker && this.createTimeline && (this.ticker = params.ticker || this.createTicker(this), "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) && this.ticker.setFPS(30), this.timeline = this.createTimeline(), this.ticker.addTimeline(this.timeline), this.ticker.on("tick", this.afterTickCb));
|
|
16887
16887
|
}
|
|
16888
16888
|
startAnimate() {
|
|
16889
16889
|
this.ticker && this.timeline && (this.ticker.start(), this.timeline.resume());
|
|
@@ -30093,10 +30093,12 @@ function commonInterpolateUpdate(key, from, to, ratio, step, target) {
|
|
|
30093
30093
|
function noop() {}
|
|
30094
30094
|
class Step {
|
|
30095
30095
|
constructor(type, props, duration, easing) {
|
|
30096
|
-
this._startTime = 0, this._hasFirstRun = !1, this.
|
|
30096
|
+
this._startTime = 0, this._hasFirstRun = !1, this._syncAttributeUpdate = () => {
|
|
30097
|
+
this.target.setAttributes(this.target.attribute);
|
|
30098
|
+
}, this.type = type, this.props = props, this.duration = duration, this.easing = easing ? "function" == typeof easing ? easing : Easing[easing] : Easing.linear, "wait" === type && (this.onUpdate = noop), this.id = Generator.GenAutoIncrementId(), this.syncAttributeUpdate = noop;
|
|
30097
30099
|
}
|
|
30098
30100
|
bind(target, animate) {
|
|
30099
|
-
this.target = target, this.animate = animate, this.onBind();
|
|
30101
|
+
this.target = target, this.animate = animate, this.onBind(), this.syncAttributeUpdate();
|
|
30100
30102
|
}
|
|
30101
30103
|
append(step) {
|
|
30102
30104
|
this.next = step, step.prev = this, step.setStartTime(this.getStartTime() + this.duration, !1);
|
|
@@ -30139,7 +30141,9 @@ class Step {
|
|
|
30139
30141
|
getStartTime() {
|
|
30140
30142
|
return this._startTime;
|
|
30141
30143
|
}
|
|
30142
|
-
onBind() {
|
|
30144
|
+
onBind() {
|
|
30145
|
+
"glyph" === this.target.type && (this.syncAttributeUpdate = this._syncAttributeUpdate);
|
|
30146
|
+
}
|
|
30143
30147
|
onFirstRun() {}
|
|
30144
30148
|
onStart() {
|
|
30145
30149
|
if (!this._hasFirstRun) {
|
|
@@ -30179,7 +30183,7 @@ class Step {
|
|
|
30179
30183
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
30180
30184
|
const key = this.propKeys[index];
|
|
30181
30185
|
func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
|
|
30182
|
-
}), this.onUpdate(end, easedRatio, out);
|
|
30186
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
30183
30187
|
}
|
|
30184
30188
|
onUpdate(end, ratio, out) {}
|
|
30185
30189
|
onEnd(cb) {
|
|
@@ -30880,6 +30884,7 @@ class AnimateExecutor {
|
|
|
30880
30884
|
delayAfterValue = isFunction$1(delayAfter) ? delayAfter(null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, {}) : delayAfter;
|
|
30881
30885
|
delayValue > 0 && animate.wait(delayValue);
|
|
30882
30886
|
(Array.isArray(effects) ? effects : [effects]).forEach(effect => {
|
|
30887
|
+
var _a, _b;
|
|
30883
30888
|
const {
|
|
30884
30889
|
type = "fromTo",
|
|
30885
30890
|
channel: channel,
|
|
@@ -30890,7 +30895,10 @@ class AnimateExecutor {
|
|
|
30890
30895
|
let parsedFromProps = null,
|
|
30891
30896
|
props = effect.to,
|
|
30892
30897
|
from = effect.from;
|
|
30893
|
-
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from)
|
|
30898
|
+
props || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), props = parsedFromProps.props), from || (parsedFromProps || (parsedFromProps = this.createPropsFromChannel(channel, graphic)), from = parsedFromProps.from);
|
|
30899
|
+
const custom = null !== (_a = effect.custom) && void 0 !== _a ? _a : AnimateExecutor.builtInAnimateMap[type],
|
|
30900
|
+
customType = null !== (_b = effect.customType) && void 0 !== _b ? _b : custom && isFunction$1(custom) ? /^class\s/.test(Function.prototype.toString.call(custom)) ? 1 : 2 : 0;
|
|
30901
|
+
this._handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, options, type, graphic);
|
|
30894
30902
|
}), delayAfterValue > 0 && animate.wait(delayAfterValue);
|
|
30895
30903
|
}
|
|
30896
30904
|
createCustomInterpolatorAnimation(animate, interpolator, props, duration, easing, customParams) {
|
|
@@ -31162,7 +31170,7 @@ class ACustomAnimate extends Step {
|
|
|
31162
31170
|
update(end, ratio, out) {
|
|
31163
31171
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
31164
31172
|
const easedRatio = this.easing(ratio);
|
|
31165
|
-
this.onUpdate(end, easedRatio, out);
|
|
31173
|
+
this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
31166
31174
|
}
|
|
31167
31175
|
setProps(props) {
|
|
31168
31176
|
this.props = props, this.propKeys = Object.keys(props), this.animate.reSyncProps();
|
|
@@ -31356,7 +31364,7 @@ class ClipGraphicAnimate extends ACustomAnimate {
|
|
|
31356
31364
|
super(null, null, duration, easing, params), this.clipFromAttribute = from, this.clipToAttribute = to, this._group = null == params ? void 0 : params.group, this._clipGraphic = null == params ? void 0 : params.clipGraphic;
|
|
31357
31365
|
}
|
|
31358
31366
|
onBind() {
|
|
31359
|
-
this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
|
|
31367
|
+
super.onBind(), this._group && this._clipGraphic && (this._lastClip = this._group.attribute.clip, this._lastPath = this._group.attribute.path, this._group.setAttributes({
|
|
31360
31368
|
clip: !0,
|
|
31361
31369
|
path: [this._clipGraphic]
|
|
31362
31370
|
}, !1, {
|
|
@@ -31514,6 +31522,7 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
31514
31522
|
return [];
|
|
31515
31523
|
}
|
|
31516
31524
|
onBind() {
|
|
31525
|
+
super.onBind();
|
|
31517
31526
|
const {
|
|
31518
31527
|
points: points,
|
|
31519
31528
|
segments: segments
|
|
@@ -31595,6 +31604,7 @@ class CommonIn extends ACustomAnimate {
|
|
|
31595
31604
|
}
|
|
31596
31605
|
onBind() {
|
|
31597
31606
|
var _a;
|
|
31607
|
+
super.onBind();
|
|
31598
31608
|
const attrs = this.target.getFinalAttribute(),
|
|
31599
31609
|
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {},
|
|
31600
31610
|
to = {},
|
|
@@ -31621,6 +31631,7 @@ class CommonOut extends ACustomAnimate {
|
|
|
31621
31631
|
super(from, to, duration, easing, params);
|
|
31622
31632
|
}
|
|
31623
31633
|
onBind() {
|
|
31634
|
+
super.onBind();
|
|
31624
31635
|
const attrs = this.target.attribute,
|
|
31625
31636
|
to = {},
|
|
31626
31637
|
from = {};
|
|
@@ -31664,7 +31675,9 @@ class RotateBySphereAnimate extends ACustomAnimate {
|
|
|
31664
31675
|
let theta = Math.acos((startX - center.x) / r / Math.sin(phi));
|
|
31665
31676
|
startZ - center.z < 0 && (theta = pi2 - theta), this.theta = theta, this.phi = phi;
|
|
31666
31677
|
}
|
|
31667
|
-
onBind() {
|
|
31678
|
+
onBind() {
|
|
31679
|
+
super.onBind();
|
|
31680
|
+
}
|
|
31668
31681
|
onEnd() {}
|
|
31669
31682
|
onUpdate(end, ratio, out) {
|
|
31670
31683
|
if (null == this.phi || null == this.theta) return;
|
|
@@ -31828,6 +31841,7 @@ class GrowAngleBase extends ACustomAnimate {
|
|
|
31828
31841
|
class GrowAngleIn extends GrowAngleBase {
|
|
31829
31842
|
onBind() {
|
|
31830
31843
|
var _a, _b;
|
|
31844
|
+
super.onBind();
|
|
31831
31845
|
const {
|
|
31832
31846
|
from: from,
|
|
31833
31847
|
to: to
|
|
@@ -31840,6 +31854,7 @@ class GrowAngleIn extends GrowAngleBase {
|
|
|
31840
31854
|
}
|
|
31841
31855
|
class GrowAngleOut extends GrowAngleBase {
|
|
31842
31856
|
onBind() {
|
|
31857
|
+
super.onBind();
|
|
31843
31858
|
const {
|
|
31844
31859
|
from: from,
|
|
31845
31860
|
to: to
|
|
@@ -31978,6 +31993,7 @@ class GrowCenterIn extends ACustomAnimate {
|
|
|
31978
31993
|
}
|
|
31979
31994
|
onBind() {
|
|
31980
31995
|
var _a, _b;
|
|
31996
|
+
super.onBind();
|
|
31981
31997
|
const {
|
|
31982
31998
|
from: from,
|
|
31983
31999
|
to: to
|
|
@@ -32002,6 +32018,7 @@ class GrowCenterOut extends ACustomAnimate {
|
|
|
32002
32018
|
super(from, to, duration, easing, params);
|
|
32003
32019
|
}
|
|
32004
32020
|
onBind() {
|
|
32021
|
+
super.onBind();
|
|
32005
32022
|
const {
|
|
32006
32023
|
from: from,
|
|
32007
32024
|
to: to
|
|
@@ -32083,6 +32100,7 @@ class GrowHeightIn extends ACustomAnimate {
|
|
|
32083
32100
|
}
|
|
32084
32101
|
onBind() {
|
|
32085
32102
|
var _a, _b;
|
|
32103
|
+
super.onBind();
|
|
32086
32104
|
const {
|
|
32087
32105
|
from: from,
|
|
32088
32106
|
to: to
|
|
@@ -32145,6 +32163,7 @@ class GrowHeightOut extends ACustomAnimate {
|
|
|
32145
32163
|
super(from, to, duration, easing, params);
|
|
32146
32164
|
}
|
|
32147
32165
|
onBind() {
|
|
32166
|
+
super.onBind();
|
|
32148
32167
|
const {
|
|
32149
32168
|
from: from,
|
|
32150
32169
|
to: to
|
|
@@ -32197,7 +32216,7 @@ class GworPointsBase extends ACustomAnimate {
|
|
|
32197
32216
|
}
|
|
32198
32217
|
class GrowPointsIn extends GworPointsBase {
|
|
32199
32218
|
onBind() {
|
|
32200
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32219
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32201
32220
|
const {
|
|
32202
32221
|
from: from,
|
|
32203
32222
|
to: to
|
|
@@ -32210,7 +32229,7 @@ class GrowPointsIn extends GworPointsBase {
|
|
|
32210
32229
|
}
|
|
32211
32230
|
class GrowPointsOut extends GworPointsBase {
|
|
32212
32231
|
onBind() {
|
|
32213
|
-
if (["area", "line"].includes(this.target.type)) {
|
|
32232
|
+
if (super.onBind(), ["area", "line"].includes(this.target.type)) {
|
|
32214
32233
|
const attrs = this.target.getFinalAttribute(),
|
|
32215
32234
|
{
|
|
32216
32235
|
from: from,
|
|
@@ -32261,7 +32280,7 @@ const changePointsX = (graphic, options, animationParameters) => graphic.getFina
|
|
|
32261
32280
|
};
|
|
32262
32281
|
class GrowPointsXIn extends GworPointsBase {
|
|
32263
32282
|
onBind() {
|
|
32264
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32283
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32265
32284
|
const {
|
|
32266
32285
|
from: from,
|
|
32267
32286
|
to: to
|
|
@@ -32274,7 +32293,7 @@ class GrowPointsXIn extends GworPointsBase {
|
|
|
32274
32293
|
}
|
|
32275
32294
|
class GrowPointsXOut extends GworPointsBase {
|
|
32276
32295
|
onBind() {
|
|
32277
|
-
if (["area", "line"].includes(this.target.type)) {
|
|
32296
|
+
if (super.onBind(), ["area", "line"].includes(this.target.type)) {
|
|
32278
32297
|
const attrs = this.target.getFinalAttribute(),
|
|
32279
32298
|
{
|
|
32280
32299
|
from: from,
|
|
@@ -32325,7 +32344,7 @@ const changePointsY = (graphic, options, animationParameters) => graphic.getFina
|
|
|
32325
32344
|
};
|
|
32326
32345
|
class GrowPointsYIn extends GworPointsBase {
|
|
32327
32346
|
onBind() {
|
|
32328
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32347
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32329
32348
|
const {
|
|
32330
32349
|
from: from,
|
|
32331
32350
|
to: to
|
|
@@ -32338,7 +32357,7 @@ class GrowPointsYIn extends GworPointsBase {
|
|
|
32338
32357
|
}
|
|
32339
32358
|
class GrowPointsYOut extends GworPointsBase {
|
|
32340
32359
|
onBind() {
|
|
32341
|
-
if (["area", "line", "polygon"].includes(this.target.type)) {
|
|
32360
|
+
if (super.onBind(), ["area", "line", "polygon"].includes(this.target.type)) {
|
|
32342
32361
|
const {
|
|
32343
32362
|
from: from,
|
|
32344
32363
|
to: to
|
|
@@ -32438,6 +32457,7 @@ class GrowPointsBase extends ACustomAnimate {
|
|
|
32438
32457
|
class GrowRadiusIn extends GrowPointsBase {
|
|
32439
32458
|
onBind() {
|
|
32440
32459
|
var _a, _b;
|
|
32460
|
+
super.onBind();
|
|
32441
32461
|
const {
|
|
32442
32462
|
from: from,
|
|
32443
32463
|
to: to
|
|
@@ -32450,6 +32470,7 @@ class GrowRadiusIn extends GrowPointsBase {
|
|
|
32450
32470
|
}
|
|
32451
32471
|
class GrowRadiusOut extends GrowPointsBase {
|
|
32452
32472
|
onBind() {
|
|
32473
|
+
super.onBind();
|
|
32453
32474
|
const {
|
|
32454
32475
|
to: to
|
|
32455
32476
|
} = (graphic = this.target, options = this.params.options, this.params, !1 !== (null !== (_a = null == options ? void 0 : options.overall) && void 0 !== _a && _a) ? growRadiusOutOverall(graphic, options) : growRadiusOutIndividual(graphic, options));
|
|
@@ -32560,6 +32581,7 @@ class GrowWidthIn extends ACustomAnimate {
|
|
|
32560
32581
|
}
|
|
32561
32582
|
onBind() {
|
|
32562
32583
|
var _a, _b;
|
|
32584
|
+
super.onBind();
|
|
32563
32585
|
const {
|
|
32564
32586
|
from: from,
|
|
32565
32587
|
to: to
|
|
@@ -32584,6 +32606,7 @@ class GrowWidthOut extends ACustomAnimate {
|
|
|
32584
32606
|
super(from, to, duration, easing, params);
|
|
32585
32607
|
}
|
|
32586
32608
|
onBind() {
|
|
32609
|
+
super.onBind();
|
|
32587
32610
|
const {
|
|
32588
32611
|
from: from,
|
|
32589
32612
|
to: to
|
|
@@ -32604,6 +32627,7 @@ class GrowWidthOut extends ACustomAnimate {
|
|
|
32604
32627
|
|
|
32605
32628
|
class LabelItemAppear extends AComponentAnimate {
|
|
32606
32629
|
onBind() {
|
|
32630
|
+
super.onBind();
|
|
32607
32631
|
const animator = createComponentAnimator(this.target);
|
|
32608
32632
|
this._animator = animator;
|
|
32609
32633
|
const duration = this.duration,
|
|
@@ -32742,6 +32766,7 @@ class LabelItemAppear extends AComponentAnimate {
|
|
|
32742
32766
|
}
|
|
32743
32767
|
class LabelItemDisappear extends AComponentAnimate {
|
|
32744
32768
|
onBind() {
|
|
32769
|
+
super.onBind();
|
|
32745
32770
|
const animator = createComponentAnimator(this.target);
|
|
32746
32771
|
this._animator = animator;
|
|
32747
32772
|
const duration = this.duration,
|
|
@@ -32824,6 +32849,7 @@ class LabelItemDisappear extends AComponentAnimate {
|
|
|
32824
32849
|
|
|
32825
32850
|
class PoptipAppear extends AComponentAnimate {
|
|
32826
32851
|
onBind() {
|
|
32852
|
+
super.onBind();
|
|
32827
32853
|
const animator = createComponentAnimator(this.target);
|
|
32828
32854
|
this._animator = animator;
|
|
32829
32855
|
const duration = this.duration,
|
|
@@ -32906,6 +32932,7 @@ class PoptipAppear extends AComponentAnimate {
|
|
|
32906
32932
|
}
|
|
32907
32933
|
class PoptipDisappear extends AComponentAnimate {
|
|
32908
32934
|
onBind() {
|
|
32935
|
+
super.onBind();
|
|
32909
32936
|
const animator = createComponentAnimator(this.target);
|
|
32910
32937
|
this._animator = animator;
|
|
32911
32938
|
const duration = this.duration,
|
|
@@ -33315,6 +33342,7 @@ class ScaleIn extends ACustomAnimate {
|
|
|
33315
33342
|
onBind() {
|
|
33316
33343
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
33317
33344
|
let from, to;
|
|
33345
|
+
super.onBind();
|
|
33318
33346
|
const attrs = this.target.getFinalAttribute(),
|
|
33319
33347
|
fromAttrs = null !== (_a = this.target.attribute) && void 0 !== _a ? _a : {};
|
|
33320
33348
|
switch (null === (_b = this.params) || void 0 === _b ? void 0 : _b.direction) {
|
|
@@ -33372,6 +33400,7 @@ class ScaleOut extends ACustomAnimate {
|
|
|
33372
33400
|
onBind() {
|
|
33373
33401
|
var _a, _b, _c, _d, _e;
|
|
33374
33402
|
let from, to;
|
|
33403
|
+
super.onBind();
|
|
33375
33404
|
const attrs = this.target.attribute;
|
|
33376
33405
|
switch (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) {
|
|
33377
33406
|
case "x":
|
|
@@ -33421,7 +33450,7 @@ class State extends ACustomAnimate {
|
|
|
33421
33450
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
33422
33451
|
const key = this.propKeys[index];
|
|
33423
33452
|
func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
|
|
33424
|
-
}), this.onUpdate(end, easedRatio, out);
|
|
33453
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
33425
33454
|
}
|
|
33426
33455
|
}
|
|
33427
33456
|
|
|
@@ -33431,6 +33460,7 @@ class SlideIn extends ACustomAnimate {
|
|
|
33431
33460
|
}
|
|
33432
33461
|
onBind() {
|
|
33433
33462
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
33463
|
+
super.onBind();
|
|
33434
33464
|
const attrs = this.target.getFinalAttribute(),
|
|
33435
33465
|
direction = (null === (_a = this.params) || void 0 === _a ? void 0 : _a.direction) || "right",
|
|
33436
33466
|
distance = (null === (_b = this.params) || void 0 === _b ? void 0 : _b.distance) || 50,
|
|
@@ -33458,6 +33488,7 @@ class GrowIn extends ACustomAnimate {
|
|
|
33458
33488
|
}
|
|
33459
33489
|
onBind() {
|
|
33460
33490
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33491
|
+
super.onBind();
|
|
33461
33492
|
const attrs = this.target.getFinalAttribute(),
|
|
33462
33493
|
fromScale = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromScale) && void 0 !== _b ? _b : 0,
|
|
33463
33494
|
direction = (null === (_c = this.params) || void 0 === _c ? void 0 : _c.direction) || "xy",
|
|
@@ -33485,6 +33516,7 @@ class SpinIn extends ACustomAnimate {
|
|
|
33485
33516
|
}
|
|
33486
33517
|
onBind() {
|
|
33487
33518
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
33519
|
+
super.onBind();
|
|
33488
33520
|
const attrs = this.target.getFinalAttribute(),
|
|
33489
33521
|
fromAngle = null !== (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.fromAngle) && void 0 !== _b ? _b : 2 * Math.PI,
|
|
33490
33522
|
fromScale = null !== (_d = null === (_c = this.params) || void 0 === _c ? void 0 : _c.fromScale) && void 0 !== _d ? _d : 0,
|
|
@@ -33521,6 +33553,7 @@ class MoveScaleIn extends ACustomAnimate {
|
|
|
33521
33553
|
}
|
|
33522
33554
|
onBind() {
|
|
33523
33555
|
var _a, _b, _c, _d, _e, _f;
|
|
33556
|
+
super.onBind();
|
|
33524
33557
|
const executor = new AnimateExecutor(this.target);
|
|
33525
33558
|
executor.execute({
|
|
33526
33559
|
type: "custom",
|
|
@@ -33556,6 +33589,7 @@ class MoveRotateIn extends ACustomAnimate {
|
|
|
33556
33589
|
}
|
|
33557
33590
|
onBind() {
|
|
33558
33591
|
var _a, _b, _c, _d, _e, _f;
|
|
33592
|
+
super.onBind();
|
|
33559
33593
|
const executor = new AnimateExecutor(this.target);
|
|
33560
33594
|
executor.execute({
|
|
33561
33595
|
type: "custom",
|
|
@@ -33751,6 +33785,7 @@ class Update extends ACustomAnimate {
|
|
|
33751
33785
|
}
|
|
33752
33786
|
onBind() {
|
|
33753
33787
|
var _a, _b;
|
|
33788
|
+
super.onBind();
|
|
33754
33789
|
let {
|
|
33755
33790
|
diffAttrs = {}
|
|
33756
33791
|
} = null !== (_a = this.target.context) && void 0 !== _a ? _a : {};
|
|
@@ -33883,6 +33918,7 @@ class MoveBase extends ACustomAnimate {
|
|
|
33883
33918
|
}
|
|
33884
33919
|
class MoveIn extends MoveBase {
|
|
33885
33920
|
onBind() {
|
|
33921
|
+
super.onBind();
|
|
33886
33922
|
const {
|
|
33887
33923
|
from: from,
|
|
33888
33924
|
to: to
|
|
@@ -33894,6 +33930,7 @@ class MoveIn extends MoveBase {
|
|
|
33894
33930
|
}
|
|
33895
33931
|
class MoveOut extends MoveBase {
|
|
33896
33932
|
onBind() {
|
|
33933
|
+
super.onBind();
|
|
33897
33934
|
const {
|
|
33898
33935
|
from: from,
|
|
33899
33936
|
to: to
|
|
@@ -33941,6 +33978,7 @@ class RotateBase extends ACustomAnimate {
|
|
|
33941
33978
|
}
|
|
33942
33979
|
class RotateIn extends RotateBase {
|
|
33943
33980
|
onBind() {
|
|
33981
|
+
super.onBind();
|
|
33944
33982
|
const {
|
|
33945
33983
|
from: from,
|
|
33946
33984
|
to: to
|
|
@@ -33952,6 +33990,7 @@ class RotateIn extends RotateBase {
|
|
|
33952
33990
|
}
|
|
33953
33991
|
class RotateOut extends RotateBase {
|
|
33954
33992
|
onBind() {
|
|
33993
|
+
super.onBind();
|
|
33955
33994
|
const {
|
|
33956
33995
|
from: from,
|
|
33957
33996
|
to: to
|
|
@@ -33962,33 +34001,36 @@ class RotateOut extends RotateBase {
|
|
|
33962
34001
|
|
|
33963
34002
|
class FromTo extends ACustomAnimate {
|
|
33964
34003
|
constructor(from, to, duration, easing, params) {
|
|
33965
|
-
super(from, to, duration, easing, params), this.from = from
|
|
34004
|
+
super(from, to, duration, easing, params), this.from = null != from ? from : {};
|
|
33966
34005
|
}
|
|
33967
34006
|
onBind() {
|
|
34007
|
+
super.onBind();
|
|
34008
|
+
const finalAttribute = this.target.getFinalAttribute();
|
|
34009
|
+
Object.keys(this.from).forEach(key => {
|
|
34010
|
+
null == this.props[key] && (this.props[key] = finalAttribute[key]);
|
|
34011
|
+
});
|
|
34012
|
+
}
|
|
34013
|
+
onFirstRun() {
|
|
33968
34014
|
var _a;
|
|
33969
|
-
|
|
33970
|
-
|
|
33971
|
-
|
|
33972
|
-
toKeys = Object.keys(this.to);
|
|
33973
|
-
if (fromKeys.forEach(key => {
|
|
33974
|
-
var _a;
|
|
33975
|
-
null == this.to[key] && (this.to[key] = null !== (_a = finalAttribute[key]) && void 0 !== _a ? _a : 0);
|
|
33976
|
-
}), toKeys.forEach(key => {
|
|
34015
|
+
this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
|
|
34016
|
+
const startProps = this.animate.getStartProps();
|
|
34017
|
+
if (this.propKeys && this.propKeys.forEach(key => {
|
|
33977
34018
|
var _a;
|
|
33978
|
-
|
|
33979
|
-
}),
|
|
34019
|
+
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
34020
|
+
}), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState)) {
|
|
33980
34021
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33981
34022
|
this.target.setAttributes(finalAttribute);
|
|
33982
34023
|
}
|
|
34024
|
+
this.target.setAttributes(this.from);
|
|
33983
34025
|
}
|
|
33984
34026
|
update(end, ratio, out) {
|
|
33985
34027
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
33986
34028
|
const easedRatio = this.easing(ratio);
|
|
33987
|
-
this.interpolateUpdateFunctions.forEach((func, index) => {
|
|
34029
|
+
this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.from, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach((func, index) => {
|
|
33988
34030
|
if (!this.animate.validAttr(this.propKeys[index])) return;
|
|
33989
34031
|
const key = this.propKeys[index];
|
|
33990
|
-
func(key, this.from[key], this.
|
|
33991
|
-
});
|
|
34032
|
+
func(key, this.from[key], this.props[key], easedRatio, this, this.target);
|
|
34033
|
+
}), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
|
|
33992
34034
|
}
|
|
33993
34035
|
}
|
|
33994
34036
|
|
|
@@ -33996,7 +34038,7 @@ const registerCustomAnimate = () => {
|
|
|
33996
34038
|
AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut);
|
|
33997
34039
|
};
|
|
33998
34040
|
|
|
33999
|
-
const version = "1.0.0-alpha.
|
|
34041
|
+
const version = "1.0.0-alpha.2";
|
|
34000
34042
|
preLoadAllModule();
|
|
34001
34043
|
if (isBrowserEnv()) {
|
|
34002
34044
|
loadBrowserEnv(container);
|