mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix CssAnimationProperty default value (#4510)
This commit is contained in:
@@ -113,7 +113,17 @@ export class CssAnimationProperty<T extends Style, U> {
|
||||
public register(cls: { prototype: T }): void;
|
||||
public isSet(instance: T): boolean;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public _initDefaultNativeValue(target: T): void;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public _valueConverter?: (value: string) => any;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
public static _getByCssName(name: string): CssAnimationProperty<any, any>;
|
||||
}
|
||||
|
||||
|
||||
@@ -694,7 +694,7 @@ export class CssAnimationProperty<T extends Style, U> {
|
||||
this.defaultValue = defaultValue;
|
||||
|
||||
const cssValue = Symbol(cssName);
|
||||
const styleValue = Symbol(propertyName);
|
||||
const styleValue = Symbol(`local:${propertyName}`);
|
||||
const keyframeValue = Symbol(keyframeName);
|
||||
const computedValue = Symbol("computed-value:" + propertyName);
|
||||
this.key = computedValue;
|
||||
@@ -792,6 +792,16 @@ export class CssAnimationProperty<T extends Style, U> {
|
||||
}
|
||||
}
|
||||
|
||||
public _initDefaultNativeValue(target: T): void {
|
||||
const defaultValueKey = this.defaultValueKey;
|
||||
|
||||
if (!(defaultValueKey in target)) {
|
||||
const view = target.view;
|
||||
const getDefault = this.getDefault;
|
||||
target[defaultValueKey] = view[getDefault] ? view[getDefault]() : this.defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static _getByCssName(name: string): CssAnimationProperty<any, any> {
|
||||
return this.properties[name];
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
|
||||
}
|
||||
|
||||
public _getValue(): never {
|
||||
throw new Error("The View._setValue is obsolete. There is a new property system.");
|
||||
throw new Error("The View._getValue is obsolete. There is a new property system.");
|
||||
}
|
||||
|
||||
public _setValue(): never {
|
||||
|
||||
Reference in New Issue
Block a user