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.dev/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.2.7", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: NoopAnimationDriver }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: NoopAnimationDriver, decorators: [{
type: Injectable
}] });
/**
* @publicApi
*/
export class AnimationDriver {
/**
* @deprecated Use the NoopAnimationDriver class.
*/
static { this.NOOP = new N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