package.esm2022.browser.src.render.animation_driver.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of animations Show documentation
Show all versions of animations Show documentation
Angular - animations integration with web-animations
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { NoopAnimationPlayer } from '@angular/animations';
import { Injectable } from '@angular/core';
import { containsElement, getParentElement, invokeQuery, validateStyleProperty } from './shared';
import * as i0 from "@angular/core";
/**
* @publicApi
*
* `AnimationDriver` implentation for Noop animations
*/
export class NoopAnimationDriver {
/**
* @returns Whether `prop` is a valid CSS property
*/
validateStyleProperty(prop) {
return validateStyleProperty(prop);
}
/**
*
* @returns Whether elm1 contains elm2.
*/
containsElement(elm1, elm2) {
return containsElement(elm1, elm2);
}
/**
* @returns Rhe parent of the given element or `null` if the element is the `document`
*/
getParentElement(element) {
return getParentElement(element);
}
/**
* @returns The result of the query selector on the element. The array will contain up to 1 item
* if `multi` is `false`.
*/
query(element, selector, multi) {
return invokeQuery(element, selector, multi);
}
/**
* @returns The `defaultValue` or empty string
*/
computeStyle(element, prop, defaultValue) {
return defaultValue || '';
}
/**
* @returns An `NoopAnimationPlayer`
*/
animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
return new NoopAnimationPlayer(duration, delay);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: NoopAnimationDriver }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: NoopAnimationDriver, decorators: [{
type: Injectable
}] });
/**
* @publicApi
*/
export class AnimationDriver {
/**
* @deprecated Use the NoopAnimationDriver class.
*/
static { this.NOOP = new No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