Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
3.5 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | exports.createSpeedFactorConvertExpression = exports.convertSpeedFactorToDuration = void 0;
|
---|
11 | /** Converts the specified speed factor into the exact static enter duration. */
|
---|
12 | function convertSpeedFactorToDuration(factor) {
|
---|
13 | // Based on the numeric speed factor value that only affected the `enterDuration` we can
|
---|
14 | // now calculate the exact `enterDuration`. 450ms is the enter duration without factor.
|
---|
15 | return 450 / (factor || 1);
|
---|
16 | }
|
---|
17 | exports.convertSpeedFactorToDuration = convertSpeedFactorToDuration;
|
---|
18 | /**
|
---|
19 | * Creates a runtime TypeScript expression that can be used in order to calculate the duration
|
---|
20 | * from the speed factor expression that couldn't be statically analyzed.
|
---|
21 | *
|
---|
22 | * @param speedFactorValue Speed factor expression that couldn't be statically analyzed.
|
---|
23 | */
|
---|
24 | function createSpeedFactorConvertExpression(speedFactorValue) {
|
---|
25 | // To be sure that the speed factor value expression is calculated properly, we need to add
|
---|
26 | // the according parenthesis.
|
---|
27 | return `450 / (${speedFactorValue})`;
|
---|
28 | }
|
---|
29 | exports.createSpeedFactorConvertExpression = createSpeedFactorConvertExpression;
|
---|
30 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmlwcGxlLXNwZWVkLWZhY3Rvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9zY2hlbWF0aWNzL25nLXVwZGF0ZS9taWdyYXRp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