From 8746866c4379ebb812b1a38d47f2805f15c65fe7 Mon Sep 17 00:00:00 2001 From: Maximilian Koeller Date: Tue, 1 Oct 2024 15:39:43 +0200 Subject: [PATCH] refactor: remove useless vendor prefix Those prefixes are no longer need as transform and translate are widely available: See: https://caniuse.com/?search=css-transform BREAKING CHANGE: Vendor prefixes are no longer applied for css `transform`. The related helpers are removed from the public api. --- .../lib/components/body/body-row.component.ts | 1 - .../src/lib/components/body/body.component.ts | 7 +-- .../lib/components/header/header.component.ts | 3 +- .../ngx-datatable/src/lib/utils/prefixes.ts | 48 ------------------- .../ngx-datatable/src/lib/utils/translate.ts | 29 ----------- projects/ngx-datatable/src/public-api.ts | 2 - 6 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 projects/ngx-datatable/src/lib/utils/prefixes.ts delete mode 100644 projects/ngx-datatable/src/lib/utils/translate.ts diff --git a/projects/ngx-datatable/src/lib/components/body/body-row.component.ts b/projects/ngx-datatable/src/lib/components/body/body-row.component.ts index 7744abca7..4d33b1bb5 100644 --- a/projects/ngx-datatable/src/lib/components/body/body-row.component.ts +++ b/projects/ngx-datatable/src/lib/components/body/body-row.component.ts @@ -19,7 +19,6 @@ import { import { columnGroupWidths, columnsByPin, columnsByPinArr } from '../../utils/column'; import { Keys } from '../../utils/keys'; import { ScrollbarHelper } from '../../services/scrollbar-helper.service'; -import { translateXY } from '../../utils/translate'; import { BehaviorSubject } from 'rxjs'; import { ActivateEvent, RowOrGroup, TreeStatus } from '../../types/public.types'; import { NgStyle } from '@angular/common'; diff --git a/projects/ngx-datatable/src/lib/components/body/body.component.ts b/projects/ngx-datatable/src/lib/components/body/body.component.ts index deba66143..38bc93dc9 100644 --- a/projects/ngx-datatable/src/lib/components/body/body.component.ts +++ b/projects/ngx-datatable/src/lib/components/body/body.component.ts @@ -18,7 +18,6 @@ import { import { ScrollerComponent } from './scroller.component'; import { columnGroupWidths, columnsByPin } from '../../utils/column'; import { RowHeightCache } from '../../utils/row-height-cache'; -import { translateXY } from '../../utils/translate'; import { NgStyle } from '@angular/common'; import { TableColumn } from '../../types/table-column.type'; import { DatatableGroupHeaderDirective } from './body-group-header.directive'; @@ -740,9 +739,7 @@ export class DataTableBodyComponent { - if (typeof transform !== 'undefined' && hasCSSTransforms) { - if (!isSafari && hasCSS3DTransforms) { - return { - transform: `translate3d(${x}px, ${y}px, 0)`, - backfaceVisibility: 'hidden' - }; - } else { - return { [camelCase(transform)]: `translate(${x}px, ${y}px)` }; - } - } else { - return { - top: `${y}px`, - left: `${x}px` - }; - } -} diff --git a/projects/ngx-datatable/src/public-api.ts b/projects/ngx-datatable/src/public-api.ts index 0c532ac6d..d46426615 100644 --- a/projects/ngx-datatable/src/public-api.ts +++ b/projects/ngx-datatable/src/public-api.ts @@ -54,9 +54,7 @@ export * from './lib/utils/column-prop-getters'; export * from './lib/utils/camel-case'; export * from './lib/utils/keys'; export * from './lib/utils/math'; -export * from './lib/utils/prefixes'; export * from './lib/utils/selection'; -export * from './lib/utils/translate'; export * from './lib/utils/throttle'; export * from './lib/utils/sort'; export * from './lib/utils/row-height-cache';