
committed by
Miško Hevery

parent
1ae77da609
commit
6ab5f3648a
@ -244,12 +244,12 @@ export class AnimationAstBuilderVisitor implements AnimationDslVisitor {
|
||||
(metadata.styles as(ɵStyleData | string)[]).forEach(styleTuple => {
|
||||
if (typeof styleTuple == 'string') {
|
||||
if (styleTuple == AUTO_STYLE) {
|
||||
styles.push(styleTuple as string);
|
||||
styles.push(styleTuple);
|
||||
} else {
|
||||
context.errors.push(`The provided style string value ${styleTuple} is not allowed.`);
|
||||
}
|
||||
} else {
|
||||
styles.push(styleTuple as ɵStyleData);
|
||||
styles.push(styleTuple);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@ -518,7 +518,7 @@ function consumeOffset(styles: ɵStyleData | string | (ɵStyleData | string)[]):
|
||||
}
|
||||
});
|
||||
} else if (isObject(styles) && styles.hasOwnProperty('offset')) {
|
||||
const obj = styles as ɵStyleData;
|
||||
const obj = styles;
|
||||
offset = parseFloat(obj['offset'] as string);
|
||||
delete obj['offset'];
|
||||
}
|
||||
@ -534,8 +534,8 @@ function constructTimingAst(value: string | number | AnimateTimings, errors: any
|
||||
if (value.hasOwnProperty('duration')) {
|
||||
timings = value as AnimateTimings;
|
||||
} else if (typeof value == 'number') {
|
||||
const duration = resolveTiming(value as number, errors).duration;
|
||||
return makeTimingAst(duration as number, 0, '');
|
||||
const duration = resolveTiming(value, errors).duration;
|
||||
return makeTimingAst(duration, 0, '');
|
||||
}
|
||||
|
||||
const strValue = value as string;
|
||||
|
@ -13,9 +13,8 @@ export function parseTransitionExpr(
|
||||
transitionValue: string | TransitionMatcherFn, errors: string[]): TransitionMatcherFn[] {
|
||||
const expressions: TransitionMatcherFn[] = [];
|
||||
if (typeof transitionValue == 'string') {
|
||||
(<string>transitionValue)
|
||||
.split(/\s*,\s*/)
|
||||
.forEach(str => parseInnerTransitionStr(str, expressions, errors));
|
||||
transitionValue.split(/\s*,\s*/).forEach(
|
||||
str => parseInnerTransitionStr(str, expressions, errors));
|
||||
} else {
|
||||
expressions.push(<TransitionMatcherFn>transitionValue);
|
||||
}
|
||||
@ -30,7 +29,7 @@ function parseInnerTransitionStr(
|
||||
expressions.push(result);
|
||||
return;
|
||||
}
|
||||
eventStr = result as string;
|
||||
eventStr = result;
|
||||
}
|
||||
|
||||
const match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
|
||||
|
@ -1708,7 +1708,7 @@ function _flattenGroupPlayersRecur(players: AnimationPlayer[], finalPlayers: Ani
|
||||
if (player instanceof AnimationGroupPlayer) {
|
||||
_flattenGroupPlayersRecur(player.players, finalPlayers);
|
||||
} else {
|
||||
finalPlayers.push(player as AnimationPlayer);
|
||||
finalPlayers.push(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export const NG_ANIMATING_SELECTOR = '.ng-animating';
|
||||
export function resolveTimingValue(value: string | number) {
|
||||
if (typeof value == 'number') return value;
|
||||
|
||||
const matches = (value as string).match(/^(-?[\.\d]+)(m?s)/);
|
||||
const matches = value.match(/^(-?[\.\d]+)(m?s)/);
|
||||
if (!matches || matches.length < 2) return 0;
|
||||
|
||||
return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
|
||||
@ -73,7 +73,7 @@ function parseTimeExpression(
|
||||
easing = easingVal;
|
||||
}
|
||||
} else {
|
||||
duration = <number>exp;
|
||||
duration = exp;
|
||||
}
|
||||
|
||||
if (!allowNegativeValues) {
|
||||
@ -214,10 +214,8 @@ const PARAM_REGEX =
|
||||
export function extractStyleParams(value: string | number): string[] {
|
||||
let params: string[] = [];
|
||||
if (typeof value === 'string') {
|
||||
const val = value.toString();
|
||||
|
||||
let match: any;
|
||||
while (match = PARAM_REGEX.exec(val)) {
|
||||
while (match = PARAM_REGEX.exec(value)) {
|
||||
params.push(match[1] as string);
|
||||
}
|
||||
PARAM_REGEX.lastIndex = 0;
|
||||
|
Reference in New Issue
Block a user