Skip to content

Commit

Permalink
refactor: remove useless vendor prefix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spike-rabbit authored and timowolf committed Oct 31, 2024
1 parent 265196d commit 8746866
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -740,9 +739,7 @@ export class DataTableBodyComponent<TRow extends { treeStatus?: TreeStatus } = a
// const pos = idx * rowHeight;
// The position of this row would be the sum of all row heights
// until the previous row position.
const pos = this.rowHeightsCache().query(idx - 1);

Object.assign(styles, translateXY(0, pos));
styles.transform = `translateY(${this.rowHeightsCache().query(idx - 1)}px)`;
}
rowsStyles.push(styles);
});
Expand All @@ -765,7 +762,7 @@ export class DataTableBodyComponent<TRow extends { treeStatus?: TreeStatus } = a

const pos = this.rowHeightsCache().query(this.rows.length - 1);
return {
...translateXY(0, pos),
transform: `translateY(${pos}px)`,
position: 'absolute'
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
PinnedColumns,
TargetChangedEvent
} from '../../types/internal.types';
import { translateXY } from '../../utils/translate';

@Component({
selector: 'datatable-header',
Expand Down Expand Up @@ -360,7 +359,7 @@ export class DataTableHeaderComponent implements OnDestroy, OnChanges {

if (group === 'center') {
return {
...translateXY(this.offsetX * -1, 0),
transform: `translateX(${this.offsetX * -1}px)`,
width: `${widths[group]}px`,
willChange: 'transform'
};
Expand Down
48 changes: 0 additions & 48 deletions projects/ngx-datatable/src/lib/utils/prefixes.ts

This file was deleted.

29 changes: 0 additions & 29 deletions projects/ngx-datatable/src/lib/utils/translate.ts

This file was deleted.

2 changes: 0 additions & 2 deletions projects/ngx-datatable/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 8746866

Please sign in to comment.