From c7c71e213fc1a2d499193d57d32e40bae1c56082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Fri, 4 Aug 2023 13:06:26 +0300 Subject: [PATCH] DomHandler hasCSSAnimation and hasCSSTransition added --- components/lib/utils/DomHandler.js | 22 ++++++++++++++++++++++ components/lib/utils/Utils.d.ts | 2 ++ 2 files changed, 24 insertions(+) diff --git a/components/lib/utils/DomHandler.js b/components/lib/utils/DomHandler.js index ed172c018..5f35d1c18 100755 --- a/components/lib/utils/DomHandler.js +++ b/components/lib/utils/DomHandler.js @@ -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;' diff --git a/components/lib/utils/Utils.d.ts b/components/lib/utils/Utils.d.ts index 3158229bf..fcff75af3 100644 --- a/components/lib/utils/Utils.d.ts +++ b/components/lib/utils/Utils.d.ts @@ -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; }