DomHandler hasCSSAnimation and hasCSSTransition added

pull/4243/head
Tuğçe Küçükoğlu 2023-08-04 13:06:26 +03:00
parent 5455aa896b
commit c7c71e213f
2 changed files with 24 additions and 0 deletions

View File

@ -705,6 +705,28 @@ export default {
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
},
hasCSSAnimation(element) {
if (element) {
const style = getComputedStyle(element);
const animationDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');
return animationDuration > 0;
}
return false;
},
hasCSSTransition(element) {
if (element) {
const style = getComputedStyle(element);
const transitionDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');
return transitionDuration > 0;
}
return false;
},
exportCSV(csv, filename) {
let blob = new Blob([csv], {
type: 'application/csv;charset=utf-8;'

View File

@ -60,6 +60,8 @@ export declare class DomHandler {
static isIOS(): boolean;
static isAndroid(): boolean;
static isTouchDevice(): boolean;
static hasCSSAnimation(el: HTMLElement): boolean;
static hasCSSTransition(el: HTMLElement): boolean;
static exportCSV(csv: any, filename: string): void;
}