@tarojs/plugin-platform-harmony-ets 4.0.0-beta.41 → 4.0.0-beta.43
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/apis/storage/index.ts +3 -3
- package/dist/apis/ui/animation/animation.ts +70 -28
- package/dist/components-harmony-ets/style.ets +73 -39
- package/dist/runtime-ets/dom/document.ts +0 -1
- package/dist/runtime-utils.js +73 -25
- package/dist/runtime-utils.js.map +1 -1
- package/dist/runtime.js +73 -25
- package/dist/runtime.js.map +1 -1
- package/package.json +9 -9
|
@@ -100,7 +100,7 @@ export function getStorage<T = any> (options: Taro.getStorage.Option<T>) {
|
|
|
100
100
|
|
|
101
101
|
kvStore = kvStore as distributedKVStore.SingleKVStore
|
|
102
102
|
kvStore.get(key, (err, data) => {
|
|
103
|
-
if (
|
|
103
|
+
if (err) {
|
|
104
104
|
handle.fail({ errMsg: `Failed to get data. Code:${err.code},message:${err.message}` }, { resolve, reject })
|
|
105
105
|
return
|
|
106
106
|
}
|
|
@@ -131,7 +131,7 @@ export function setStorage (options: Taro.setStorage.Option) {
|
|
|
131
131
|
|
|
132
132
|
kvStore = kvStore as distributedKVStore.SingleKVStore
|
|
133
133
|
kvStore.put(key, data, (err) => {
|
|
134
|
-
if (
|
|
134
|
+
if (err) {
|
|
135
135
|
handle.fail({ errMsg: `Failed to put data. Code:${err.code},message:${err.message}` }, { resolve, reject })
|
|
136
136
|
return
|
|
137
137
|
}
|
|
@@ -162,7 +162,7 @@ export function removeStorage (options: Taro.removeStorage.Option) {
|
|
|
162
162
|
|
|
163
163
|
kvStore = kvStore as distributedKVStore.SingleKVStore
|
|
164
164
|
kvStore.delete(key, (err) => {
|
|
165
|
-
if (
|
|
165
|
+
if (err) {
|
|
166
166
|
handle.fail({ errMsg: `Failed to delete data. Code:${err.code},message:${err.message}` }, { resolve, reject })
|
|
167
167
|
return
|
|
168
168
|
}
|
|
@@ -72,6 +72,9 @@ export class Animation implements Taro.Animation {
|
|
|
72
72
|
transformOrigin,
|
|
73
73
|
rule: Object.assign({}, this.rule)
|
|
74
74
|
})
|
|
75
|
+
if (this.rule.transform) {
|
|
76
|
+
this.rule.transform = Object.assign({}, this.rule.transform)
|
|
77
|
+
}
|
|
75
78
|
return this
|
|
76
79
|
}
|
|
77
80
|
|
|
@@ -86,92 +89,137 @@ export class Animation implements Taro.Animation {
|
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
rotate (angle: number): Taro.Animation {
|
|
89
|
-
this.rule.
|
|
92
|
+
if (!this.rule.transform) {
|
|
93
|
+
this.rule.transform = {}
|
|
94
|
+
}
|
|
95
|
+
this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle }
|
|
90
96
|
return this
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
rotate3d (x: number, y?: number | undefined, z?: number | undefined, angle?: number | undefined): Taro.Animation {
|
|
94
|
-
this.rule.
|
|
100
|
+
if (!this.rule.transform) {
|
|
101
|
+
this.rule.transform = {}
|
|
102
|
+
}
|
|
103
|
+
this.rule.transform.Rotate = { x, y, z, angle }
|
|
95
104
|
return this
|
|
96
105
|
}
|
|
97
106
|
|
|
98
107
|
rotateX (angle: number): Taro.Animation {
|
|
99
|
-
this.rule.
|
|
108
|
+
if (!this.rule.transform) {
|
|
109
|
+
this.rule.transform = {}
|
|
110
|
+
}
|
|
111
|
+
this.rule.transform.Rotate = { x: 1, y: 0, z: 0, angle }
|
|
100
112
|
return this
|
|
101
113
|
}
|
|
102
114
|
|
|
103
115
|
rotateY (angle: number): Taro.Animation {
|
|
104
|
-
this.rule.
|
|
116
|
+
if (!this.rule.transform) {
|
|
117
|
+
this.rule.transform = {}
|
|
118
|
+
}
|
|
119
|
+
this.rule.transform.Rotate = { x: 0, y: 1, z: 0, angle }
|
|
105
120
|
return this
|
|
106
121
|
}
|
|
107
122
|
|
|
108
123
|
rotateZ (angle: number): Taro.Animation {
|
|
109
|
-
this.rule.
|
|
124
|
+
if (!this.rule.transform) {
|
|
125
|
+
this.rule.transform = {}
|
|
126
|
+
}
|
|
127
|
+
this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle }
|
|
110
128
|
return this
|
|
111
129
|
}
|
|
112
130
|
|
|
113
131
|
scale (sx: number, sy?: number | undefined): Taro.Animation {
|
|
114
|
-
this.rule.
|
|
132
|
+
if (!this.rule.transform) {
|
|
133
|
+
this.rule.transform = {}
|
|
134
|
+
}
|
|
135
|
+
this.rule.transform.Scale = { x: sx, y: isUndefined(sy) ? sx : sy }
|
|
115
136
|
return this
|
|
116
137
|
}
|
|
117
138
|
|
|
118
139
|
scale3d (sx: number, sy: number, sz: number): Taro.Animation {
|
|
119
|
-
this.rule.
|
|
140
|
+
if (!this.rule.transform) {
|
|
141
|
+
this.rule.transform = {}
|
|
142
|
+
}
|
|
143
|
+
this.rule.transform.Scale = { x: sx, y: sy, z: sz }
|
|
120
144
|
return this
|
|
121
145
|
}
|
|
122
146
|
|
|
123
147
|
scaleX (scale: number): Taro.Animation {
|
|
124
|
-
this.rule.
|
|
148
|
+
if (!this.rule.transform) {
|
|
149
|
+
this.rule.transform = {}
|
|
150
|
+
}
|
|
151
|
+
this.rule.transform.Scale = { x: scale }
|
|
125
152
|
return this
|
|
126
153
|
}
|
|
127
154
|
|
|
128
155
|
scaleY (scale: number): Taro.Animation {
|
|
129
|
-
this.rule.
|
|
156
|
+
if (!this.rule.transform) {
|
|
157
|
+
this.rule.transform = {}
|
|
158
|
+
}
|
|
159
|
+
this.rule.transform.Scale = { y: scale }
|
|
130
160
|
return this
|
|
131
161
|
}
|
|
132
162
|
|
|
133
163
|
scaleZ (scale: number): Taro.Animation {
|
|
134
|
-
this.rule.
|
|
164
|
+
if (!this.rule.transform) {
|
|
165
|
+
this.rule.transform = {}
|
|
166
|
+
}
|
|
167
|
+
this.rule.transform.Scale = { z: scale }
|
|
135
168
|
return this
|
|
136
169
|
}
|
|
137
170
|
|
|
138
171
|
skew (ax: number, ay: number): Taro.Animation {
|
|
139
|
-
|
|
172
|
+
temporarilyNotSupport('animation.skew:' + `${ax}, ${ay}`)(ax, ay)
|
|
140
173
|
return this
|
|
141
174
|
}
|
|
142
175
|
|
|
143
176
|
skewX (angle: number): Taro.Animation {
|
|
144
|
-
|
|
177
|
+
temporarilyNotSupport('animation.skewX:' + angle)(angle)
|
|
145
178
|
return this
|
|
146
179
|
}
|
|
147
180
|
|
|
148
181
|
skewY (angle: number): Taro.Animation {
|
|
149
|
-
|
|
182
|
+
temporarilyNotSupport('animation.skewY:' + angle)(angle)
|
|
150
183
|
return this
|
|
151
184
|
}
|
|
152
185
|
|
|
153
186
|
translate (tx?: number | undefined, ty?: number | undefined): Taro.Animation {
|
|
154
|
-
this.rule.
|
|
187
|
+
if (!this.rule.transform) {
|
|
188
|
+
this.rule.transform = {}
|
|
189
|
+
}
|
|
190
|
+
this.rule.transform.Translate = { x: tx, y: ty }
|
|
155
191
|
return this
|
|
156
192
|
}
|
|
157
193
|
|
|
158
194
|
translate3d (tx?: number | undefined, ty?: number | undefined, tz?: number | undefined): Taro.Animation {
|
|
159
|
-
this.rule.
|
|
195
|
+
if (!this.rule.transform) {
|
|
196
|
+
this.rule.transform = {}
|
|
197
|
+
}
|
|
198
|
+
this.rule.transform.Translate = { x: tx, y: ty, z: tz }
|
|
160
199
|
return this
|
|
161
200
|
}
|
|
162
201
|
|
|
163
202
|
translateX (translation: number): Taro.Animation {
|
|
164
|
-
this.rule.
|
|
203
|
+
if (!this.rule.transform) {
|
|
204
|
+
this.rule.transform = {}
|
|
205
|
+
}
|
|
206
|
+
this.rule.transform.Translate = { x: translation }
|
|
165
207
|
return this
|
|
166
208
|
}
|
|
167
209
|
|
|
168
210
|
translateY (translation: number): Taro.Animation {
|
|
169
|
-
this.rule.
|
|
211
|
+
if (!this.rule.transform) {
|
|
212
|
+
this.rule.transform = {}
|
|
213
|
+
}
|
|
214
|
+
this.rule.transform.Translate = { y: translation }
|
|
170
215
|
return this
|
|
171
216
|
}
|
|
172
217
|
|
|
173
218
|
translateZ (translation: number): Taro.Animation {
|
|
174
|
-
this.rule.
|
|
219
|
+
if (!this.rule.transform) {
|
|
220
|
+
this.rule.transform = {}
|
|
221
|
+
}
|
|
222
|
+
this.rule.transform.Translate = { z: translation }
|
|
175
223
|
return this
|
|
176
224
|
}
|
|
177
225
|
|
|
@@ -186,23 +234,17 @@ export class Animation implements Taro.Animation {
|
|
|
186
234
|
}
|
|
187
235
|
|
|
188
236
|
width (value: string | number): Taro.Animation {
|
|
189
|
-
this.rule.
|
|
190
|
-
...this.rule.size,
|
|
191
|
-
width: value
|
|
192
|
-
}
|
|
237
|
+
this.rule.width = value
|
|
193
238
|
return this
|
|
194
239
|
}
|
|
195
240
|
|
|
196
241
|
height (value: string | number): Taro.Animation {
|
|
197
|
-
this.rule.
|
|
198
|
-
...this.rule.size,
|
|
199
|
-
height: value
|
|
200
|
-
}
|
|
242
|
+
this.rule.height = value
|
|
201
243
|
return this
|
|
202
244
|
}
|
|
203
245
|
|
|
204
246
|
left (value: string | number): Taro.Animation {
|
|
205
|
-
|
|
247
|
+
this.rule.left = value
|
|
206
248
|
return this
|
|
207
249
|
}
|
|
208
250
|
|
|
@@ -212,7 +254,7 @@ export class Animation implements Taro.Animation {
|
|
|
212
254
|
}
|
|
213
255
|
|
|
214
256
|
top (value: string | number): Taro.Animation {
|
|
215
|
-
|
|
257
|
+
this.rule.top = value
|
|
216
258
|
return this
|
|
217
259
|
}
|
|
218
260
|
|
|
@@ -10,21 +10,12 @@ class TextStyleModify implements AttributeModifier<TextAttribute> {
|
|
|
10
10
|
node: TaroTextElement | null = null
|
|
11
11
|
style: HarmonyStyle | null = null
|
|
12
12
|
overwriteStyle: Record<string, TaroAny> = {}
|
|
13
|
-
withNormal = false
|
|
14
|
-
|
|
15
|
-
withNormalStyle () {
|
|
16
|
-
this.withNormal = true
|
|
17
|
-
return this
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
21
|
-
this.overwriteStyle = overwriteStyle
|
|
22
|
-
|
|
23
|
-
return this
|
|
24
|
-
}
|
|
13
|
+
withNormal: boolean = false
|
|
25
14
|
|
|
26
15
|
setNode (node: TaroTextElement, initStyle?: HarmonyStyle) {
|
|
27
16
|
this.node = node
|
|
17
|
+
this.withNormal = false
|
|
18
|
+
this.overwriteStyle = {}
|
|
28
19
|
this.style = getNormalAttributes(this.node)
|
|
29
20
|
this.initStyle = initStyle
|
|
30
21
|
// 覆盖初始化样式
|
|
@@ -38,6 +29,16 @@ class TextStyleModify implements AttributeModifier<TextAttribute> {
|
|
|
38
29
|
return this
|
|
39
30
|
}
|
|
40
31
|
|
|
32
|
+
withNormalStyle () {
|
|
33
|
+
this.withNormal = true
|
|
34
|
+
return this
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
38
|
+
this.overwriteStyle = overwriteStyle
|
|
39
|
+
return this
|
|
40
|
+
}
|
|
41
|
+
|
|
41
42
|
applyNormalAttribute(instance: TextAttribute): void {
|
|
42
43
|
if (this.node && this.style) {
|
|
43
44
|
if (this.withNormal) {
|
|
@@ -55,18 +56,13 @@ class CommonStyleModify implements AttributeModifier<CommonAttribute> {
|
|
|
55
56
|
initStyle?: TaroStyleType
|
|
56
57
|
node: TaroElement | null = null
|
|
57
58
|
style: TaroStyleType | null = null
|
|
58
|
-
overwriteStyle:
|
|
59
|
-
|
|
60
|
-
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
61
|
-
this.overwriteStyle = overwriteStyle
|
|
62
|
-
|
|
63
|
-
return this
|
|
64
|
-
}
|
|
59
|
+
overwriteStyle: TaroStyleType = {}
|
|
65
60
|
|
|
66
61
|
setNode (node: TaroElement, initStyle?: TaroStyleType) {
|
|
67
62
|
this.node = node
|
|
68
63
|
this.style = getNormalAttributes(this.node)
|
|
69
64
|
this.initStyle = initStyle
|
|
65
|
+
this.overwriteStyle = {}
|
|
70
66
|
// 覆盖初始化样式
|
|
71
67
|
if (initStyle) {
|
|
72
68
|
Object.keys(initStyle).forEach(key => {
|
|
@@ -77,6 +73,16 @@ class CommonStyleModify implements AttributeModifier<CommonAttribute> {
|
|
|
77
73
|
}
|
|
78
74
|
return this
|
|
79
75
|
}
|
|
76
|
+
|
|
77
|
+
setAnimationStyle (overwriteStyle: Record<string, TaroAny>) {
|
|
78
|
+
this.overwriteStyle = overwriteStyle
|
|
79
|
+
if (this.style && this.overwriteStyle) {
|
|
80
|
+
Object.keys(this.overwriteStyle).forEach(key => {
|
|
81
|
+
this.style![key] = this.overwriteStyle[key]
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
return this
|
|
85
|
+
}
|
|
80
86
|
|
|
81
87
|
applyNormalAttribute(instance: CommonAttribute): void {
|
|
82
88
|
if (this.node && this.style) {
|
|
@@ -145,26 +151,26 @@ class ColumnStyleModify extends CommonStyleModify {
|
|
|
145
151
|
|
|
146
152
|
export function setAnimationAttributeIntoInstance(instance: CommonAttribute, overwriteStyle: Record<string, TaroAny>, style: TaroStyleType) {
|
|
147
153
|
// Animation 需要提前和 @State 变量绑定才能产生动画效果,因此不能做 if else 判断
|
|
148
|
-
instance.translate({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
})
|
|
153
|
-
instance.scale({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})
|
|
160
|
-
instance.rotate({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
})
|
|
154
|
+
// instance.translate({
|
|
155
|
+
// x: overwriteStyle.translate?.x || style.transform?.Translate?.x,
|
|
156
|
+
// y: overwriteStyle.translate?.y || style.transform?.Translate?.y,
|
|
157
|
+
// z: overwriteStyle.translate?.z || style.transform?.Translate?.z,
|
|
158
|
+
// })
|
|
159
|
+
// instance.scale({
|
|
160
|
+
// x: overwriteStyle.scale?.x || style.transform?.Scale?.x,
|
|
161
|
+
// y: overwriteStyle.scale?.y || style.transform?.Scale?.y,
|
|
162
|
+
// z: overwriteStyle.scale?.z || style.transform?.Scale?.z,
|
|
163
|
+
// centerX: overwriteStyle.transformOrigin?.x || style.transformOrigin?.x || 0,
|
|
164
|
+
// centerY: overwriteStyle.transformOrigin?.y || style.transformOrigin?.y || 0,
|
|
165
|
+
// })
|
|
166
|
+
// instance.rotate({
|
|
167
|
+
// x: overwriteStyle.rotate?.x || style.transform?.Rotate?.x,
|
|
168
|
+
// y: overwriteStyle.rotate?.y || style.transform?.Rotate?.y,
|
|
169
|
+
// z: overwriteStyle.rotate?.z || style.transform?.Rotate?.z,
|
|
170
|
+
// centerX: overwriteStyle.transformOrigin?.x || style.transformOrigin?.x || 0,
|
|
171
|
+
// centerY: overwriteStyle.transformOrigin?.y || style.transformOrigin?.y || 0,
|
|
172
|
+
// angle: overwriteStyle.rotate?.angle || style.transform?.Rotate?.angle || 0,
|
|
173
|
+
// })
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
export function setNormalTextAttributeIntoInstance(instance: TextAttribute | SpanAttribute, style: HarmonyStyle, node?: TaroTextElement | null) {
|
|
@@ -360,6 +366,34 @@ export function setNormalAttributeIntoInstance(instance: CommonAttribute, style:
|
|
|
360
366
|
// 为了适应position不设置z-index也能高于同层级组件,估且让设置了z-index的会更高一级
|
|
361
367
|
instance.zIndex(style.zIndex + 1)
|
|
362
368
|
}
|
|
369
|
+
if (!isUndefined(style.transform)) {
|
|
370
|
+
if (style.transform.Translate) {
|
|
371
|
+
instance.translate({
|
|
372
|
+
x: style.transform.Translate.x || 0,
|
|
373
|
+
y: style.transform.Translate.y || 0,
|
|
374
|
+
z: style.transform.Translate.z || 0,
|
|
375
|
+
})
|
|
376
|
+
}
|
|
377
|
+
if (style.transform.Scale) {
|
|
378
|
+
instance.scale({
|
|
379
|
+
x: style.transform.Scale.x || 0,
|
|
380
|
+
y: style.transform.Scale.y || 0,
|
|
381
|
+
z: style.transform.Scale.z || 0,
|
|
382
|
+
centerX: style.transformOrigin?.x || 0,
|
|
383
|
+
centerY: style.transformOrigin?.y || 0,
|
|
384
|
+
})
|
|
385
|
+
}
|
|
386
|
+
if (style.transform.Rotate) {
|
|
387
|
+
instance.rotate({
|
|
388
|
+
x: style.transform.Rotate.x || 0,
|
|
389
|
+
y: style.transform.Rotate.y || 0,
|
|
390
|
+
z: style.transform.Rotate.z || 0,
|
|
391
|
+
centerX: style.transformOrigin?.x || 0,
|
|
392
|
+
centerY: style.transformOrigin?.y || 0,
|
|
393
|
+
angle: style.transform.Rotate.angle
|
|
394
|
+
})
|
|
395
|
+
}
|
|
396
|
+
}
|
|
363
397
|
}
|
|
364
398
|
|
|
365
399
|
export const pseudoModify = new PseudoStyleModify()
|
|
@@ -5,7 +5,6 @@ import { Current } from '../current'
|
|
|
5
5
|
import { findChildNodeWithDFS, getPageScrollerOrNode } from '../utils'
|
|
6
6
|
import { TaroComment } from './comment'
|
|
7
7
|
import { TaroElement } from './element/element'
|
|
8
|
-
import { FixedLayer } from './element/normal'
|
|
9
8
|
import { NodeType, TaroNode, TaroTextNode } from './node'
|
|
10
9
|
|
|
11
10
|
import type { Window } from '../bom/window'
|
package/dist/runtime-utils.js
CHANGED
|
@@ -3311,7 +3311,7 @@ function getStorage(options) {
|
|
|
3311
3311
|
}
|
|
3312
3312
|
kvStore = kvStore;
|
|
3313
3313
|
kvStore.get(key, (err, data) => {
|
|
3314
|
-
if (
|
|
3314
|
+
if (err) {
|
|
3315
3315
|
handle.fail({ errMsg: `Failed to get data. Code:${err.code},message:${err.message}` }, { resolve, reject });
|
|
3316
3316
|
return;
|
|
3317
3317
|
}
|
|
@@ -3337,7 +3337,7 @@ function setStorage(options) {
|
|
|
3337
3337
|
}
|
|
3338
3338
|
kvStore = kvStore;
|
|
3339
3339
|
kvStore.put(key, data, (err) => {
|
|
3340
|
-
if (
|
|
3340
|
+
if (err) {
|
|
3341
3341
|
handle.fail({ errMsg: `Failed to put data. Code:${err.code},message:${err.message}` }, { resolve, reject });
|
|
3342
3342
|
return;
|
|
3343
3343
|
}
|
|
@@ -3363,7 +3363,7 @@ function removeStorage(options) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
kvStore = kvStore;
|
|
3365
3365
|
kvStore.delete(key, (err) => {
|
|
3366
|
-
if (
|
|
3366
|
+
if (err) {
|
|
3367
3367
|
handle.fail({ errMsg: `Failed to delete data. Code:${err.code},message:${err.message}` }, { resolve, reject });
|
|
3368
3368
|
return;
|
|
3369
3369
|
}
|
|
@@ -3416,6 +3416,9 @@ class Animation {
|
|
|
3416
3416
|
transformOrigin,
|
|
3417
3417
|
rule: Object.assign({}, this.rule)
|
|
3418
3418
|
});
|
|
3419
|
+
if (this.rule.transform) {
|
|
3420
|
+
this.rule.transform = Object.assign({}, this.rule.transform);
|
|
3421
|
+
}
|
|
3419
3422
|
return this;
|
|
3420
3423
|
}
|
|
3421
3424
|
matrix(a, b, c, d, tx, ty) {
|
|
@@ -3427,75 +3430,120 @@ class Animation {
|
|
|
3427
3430
|
return this;
|
|
3428
3431
|
}
|
|
3429
3432
|
rotate(angle) {
|
|
3430
|
-
this.rule.
|
|
3433
|
+
if (!this.rule.transform) {
|
|
3434
|
+
this.rule.transform = {};
|
|
3435
|
+
}
|
|
3436
|
+
this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle };
|
|
3431
3437
|
return this;
|
|
3432
3438
|
}
|
|
3433
3439
|
rotate3d(x, y, z, angle) {
|
|
3434
|
-
this.rule.
|
|
3440
|
+
if (!this.rule.transform) {
|
|
3441
|
+
this.rule.transform = {};
|
|
3442
|
+
}
|
|
3443
|
+
this.rule.transform.Rotate = { x, y, z, angle };
|
|
3435
3444
|
return this;
|
|
3436
3445
|
}
|
|
3437
3446
|
rotateX(angle) {
|
|
3438
|
-
this.rule.
|
|
3447
|
+
if (!this.rule.transform) {
|
|
3448
|
+
this.rule.transform = {};
|
|
3449
|
+
}
|
|
3450
|
+
this.rule.transform.Rotate = { x: 1, y: 0, z: 0, angle };
|
|
3439
3451
|
return this;
|
|
3440
3452
|
}
|
|
3441
3453
|
rotateY(angle) {
|
|
3442
|
-
this.rule.
|
|
3454
|
+
if (!this.rule.transform) {
|
|
3455
|
+
this.rule.transform = {};
|
|
3456
|
+
}
|
|
3457
|
+
this.rule.transform.Rotate = { x: 0, y: 1, z: 0, angle };
|
|
3443
3458
|
return this;
|
|
3444
3459
|
}
|
|
3445
3460
|
rotateZ(angle) {
|
|
3446
|
-
this.rule.
|
|
3461
|
+
if (!this.rule.transform) {
|
|
3462
|
+
this.rule.transform = {};
|
|
3463
|
+
}
|
|
3464
|
+
this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle };
|
|
3447
3465
|
return this;
|
|
3448
3466
|
}
|
|
3449
3467
|
scale(sx, sy) {
|
|
3450
|
-
this.rule.
|
|
3468
|
+
if (!this.rule.transform) {
|
|
3469
|
+
this.rule.transform = {};
|
|
3470
|
+
}
|
|
3471
|
+
this.rule.transform.Scale = { x: sx, y: isUndefined(sy) ? sx : sy };
|
|
3451
3472
|
return this;
|
|
3452
3473
|
}
|
|
3453
3474
|
scale3d(sx, sy, sz) {
|
|
3454
|
-
this.rule.
|
|
3475
|
+
if (!this.rule.transform) {
|
|
3476
|
+
this.rule.transform = {};
|
|
3477
|
+
}
|
|
3478
|
+
this.rule.transform.Scale = { x: sx, y: sy, z: sz };
|
|
3455
3479
|
return this;
|
|
3456
3480
|
}
|
|
3457
3481
|
scaleX(scale) {
|
|
3458
|
-
this.rule.
|
|
3482
|
+
if (!this.rule.transform) {
|
|
3483
|
+
this.rule.transform = {};
|
|
3484
|
+
}
|
|
3485
|
+
this.rule.transform.Scale = { x: scale };
|
|
3459
3486
|
return this;
|
|
3460
3487
|
}
|
|
3461
3488
|
scaleY(scale) {
|
|
3462
|
-
this.rule.
|
|
3489
|
+
if (!this.rule.transform) {
|
|
3490
|
+
this.rule.transform = {};
|
|
3491
|
+
}
|
|
3492
|
+
this.rule.transform.Scale = { y: scale };
|
|
3463
3493
|
return this;
|
|
3464
3494
|
}
|
|
3465
3495
|
scaleZ(scale) {
|
|
3466
|
-
this.rule.
|
|
3496
|
+
if (!this.rule.transform) {
|
|
3497
|
+
this.rule.transform = {};
|
|
3498
|
+
}
|
|
3499
|
+
this.rule.transform.Scale = { z: scale };
|
|
3467
3500
|
return this;
|
|
3468
3501
|
}
|
|
3469
3502
|
skew(ax, ay) {
|
|
3470
|
-
|
|
3503
|
+
temporarilyNotSupport('animation.skew:' + `${ax}, ${ay}`)(ax, ay);
|
|
3471
3504
|
return this;
|
|
3472
3505
|
}
|
|
3473
3506
|
skewX(angle) {
|
|
3474
|
-
|
|
3507
|
+
temporarilyNotSupport('animation.skewX:' + angle)(angle);
|
|
3475
3508
|
return this;
|
|
3476
3509
|
}
|
|
3477
3510
|
skewY(angle) {
|
|
3478
|
-
|
|
3511
|
+
temporarilyNotSupport('animation.skewY:' + angle)(angle);
|
|
3479
3512
|
return this;
|
|
3480
3513
|
}
|
|
3481
3514
|
translate(tx, ty) {
|
|
3482
|
-
this.rule.
|
|
3515
|
+
if (!this.rule.transform) {
|
|
3516
|
+
this.rule.transform = {};
|
|
3517
|
+
}
|
|
3518
|
+
this.rule.transform.Translate = { x: tx, y: ty };
|
|
3483
3519
|
return this;
|
|
3484
3520
|
}
|
|
3485
3521
|
translate3d(tx, ty, tz) {
|
|
3486
|
-
this.rule.
|
|
3522
|
+
if (!this.rule.transform) {
|
|
3523
|
+
this.rule.transform = {};
|
|
3524
|
+
}
|
|
3525
|
+
this.rule.transform.Translate = { x: tx, y: ty, z: tz };
|
|
3487
3526
|
return this;
|
|
3488
3527
|
}
|
|
3489
3528
|
translateX(translation) {
|
|
3490
|
-
this.rule.
|
|
3529
|
+
if (!this.rule.transform) {
|
|
3530
|
+
this.rule.transform = {};
|
|
3531
|
+
}
|
|
3532
|
+
this.rule.transform.Translate = { x: translation };
|
|
3491
3533
|
return this;
|
|
3492
3534
|
}
|
|
3493
3535
|
translateY(translation) {
|
|
3494
|
-
this.rule.
|
|
3536
|
+
if (!this.rule.transform) {
|
|
3537
|
+
this.rule.transform = {};
|
|
3538
|
+
}
|
|
3539
|
+
this.rule.transform.Translate = { y: translation };
|
|
3495
3540
|
return this;
|
|
3496
3541
|
}
|
|
3497
3542
|
translateZ(translation) {
|
|
3498
|
-
this.rule.
|
|
3543
|
+
if (!this.rule.transform) {
|
|
3544
|
+
this.rule.transform = {};
|
|
3545
|
+
}
|
|
3546
|
+
this.rule.transform.Translate = { z: translation };
|
|
3499
3547
|
return this;
|
|
3500
3548
|
}
|
|
3501
3549
|
opacity(value) {
|
|
@@ -3507,15 +3555,15 @@ class Animation {
|
|
|
3507
3555
|
return this;
|
|
3508
3556
|
}
|
|
3509
3557
|
width(value) {
|
|
3510
|
-
this.rule.
|
|
3558
|
+
this.rule.width = value;
|
|
3511
3559
|
return this;
|
|
3512
3560
|
}
|
|
3513
3561
|
height(value) {
|
|
3514
|
-
this.rule.
|
|
3562
|
+
this.rule.height = value;
|
|
3515
3563
|
return this;
|
|
3516
3564
|
}
|
|
3517
3565
|
left(value) {
|
|
3518
|
-
|
|
3566
|
+
this.rule.left = value;
|
|
3519
3567
|
return this;
|
|
3520
3568
|
}
|
|
3521
3569
|
right(value) {
|
|
@@ -3523,7 +3571,7 @@ class Animation {
|
|
|
3523
3571
|
return this;
|
|
3524
3572
|
}
|
|
3525
3573
|
top(value) {
|
|
3526
|
-
|
|
3574
|
+
this.rule.top = value;
|
|
3527
3575
|
return this;
|
|
3528
3576
|
}
|
|
3529
3577
|
bottom(value) {
|