@tetacom/ng-components 1.0.61 → 1.0.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6600,13 +6600,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
6600
6600
 
6601
6601
  class NumberPipe {
6602
6602
  transform(value, decimalLength = 2, chunkDelimiter = '', decimalDelimiter = '.', chunkLength = 3) {
6603
- if (value === null || value === undefined) {
6603
+ if (value === null || value === undefined || value === '') {
6604
6604
  return '';
6605
6605
  }
6606
- if (value !== value / 1) {
6606
+ if (typeof value === 'string' && isNaN(parseFloat(value))) {
6607
6607
  return value.toString();
6608
6608
  }
6609
- value /= 1;
6609
+ value = Number(value);
6610
6610
  return formatNumber(value, decimalLength, chunkDelimiter, decimalDelimiter, chunkLength);
6611
6611
  }
6612
6612
  }
@@ -8953,13 +8953,6 @@ class HeadCellComponent {
8953
8953
  ngOnDestroy() {
8954
8954
  this._alive = false;
8955
8955
  }
8956
- // autosizeColumn() {
8957
- // this._svc.autosizeColumn(this.column, this._elementRef.nativeElement);
8958
- // }
8959
- //
8960
- // autosizeAllColumns() {
8961
- // this._svc.autosizeAllColumns(this._elementRef.nativeElement);
8962
- // }
8963
8956
  resizeStart(event) {
8964
8957
  const rect = this._elementRef.nativeElement.getBoundingClientRect();
8965
8958
  this._startPosition = rect.x;
@@ -8967,8 +8960,9 @@ class HeadCellComponent {
8967
8960
  }
8968
8961
  resizeProcess(event) {
8969
8962
  if (this._startPosition && event.pageX > 0) {
8963
+ const position = this._startPosition;
8970
8964
  requestAnimationFrame(() => {
8971
- this._svc.resizeColumn(new ColumnResizeEvent(this.column, event.pageX - this._startPosition));
8965
+ this._svc.resizeColumn(new ColumnResizeEvent(this.column, event.pageX - position));
8972
8966
  this._app.tick();
8973
8967
  });
8974
8968
  }
@@ -9896,40 +9890,43 @@ class TableComponent {
9896
9890
  }
9897
9891
  handleClickOutsideAnyRow(event) {
9898
9892
  const coordinates = this.getCoordinates(event);
9899
- if (coordinates) {
9900
- this.cellClick.emit({
9901
- ...this._svc.getCellInstance(coordinates),
9902
- event
9903
- });
9904
- if (this.editEvent === EditEvent.click) {
9905
- this.startEditRowOrCell(coordinates);
9906
- }
9907
- else {
9908
- if (this._svc.currentEditCell && (coordinates.row !== this._svc.currentEditCell.row || coordinates.column !== this._svc.currentEditCell.column)) {
9909
- this.startEditRowOrCell(null);
9910
- }
9911
- }
9912
- }
9913
9893
  const row = this.getRow(event);
9914
- if (row) {
9915
- if (event.ctrlKey) {
9916
- this._svc.selectOrDeselectRow(row);
9917
- }
9918
- else if (event.shiftKey) {
9919
- this._svc.selectRange(row);
9920
- }
9921
- else {
9922
- this._svc.selectRows([row]);
9894
+ const eventIsOnRow = this.eventIsOnRow(event);
9895
+ setTimeout(() => {
9896
+ if (coordinates) {
9897
+ this.cellClick.emit({
9898
+ ...this._svc.getCellInstance(coordinates),
9899
+ event
9900
+ });
9901
+ if (this.editEvent === EditEvent.click) {
9902
+ this.startEditRowOrCell(coordinates);
9903
+ }
9904
+ else {
9905
+ if (this._svc.currentEditCell && (coordinates.row !== this._svc.currentEditCell.row || coordinates.column !== this._svc.currentEditCell.column)) {
9906
+ this.startEditRowOrCell(null);
9907
+ }
9908
+ }
9923
9909
  }
9924
- }
9925
- if (!this.eventIsOnRow(event) && !event.defaultPrevented) {
9926
- if (this.editType === EditType.row) {
9927
- this._svc.startEditRow(null);
9910
+ if (row) {
9911
+ if (event.ctrlKey) {
9912
+ this._svc.selectOrDeselectRow(row);
9913
+ }
9914
+ else if (event.shiftKey) {
9915
+ this._svc.selectRange(row);
9916
+ }
9917
+ else {
9918
+ this._svc.selectRows([row]);
9919
+ }
9928
9920
  }
9929
- else {
9930
- this._svc.startEditCell(null);
9921
+ if (!eventIsOnRow && !event.defaultPrevented) {
9922
+ if (this.editType === EditType.row) {
9923
+ this._svc.startEditRow(null);
9924
+ }
9925
+ else {
9926
+ this._svc.startEditCell(null);
9927
+ }
9931
9928
  }
9932
- }
9929
+ });
9933
9930
  }
9934
9931
  focusIn(event) {
9935
9932
  const coordinates = this.getCoordinates(event);
@@ -9946,13 +9943,15 @@ class TableComponent {
9946
9943
  dblclick(event) {
9947
9944
  const coordinates = this.getCoordinates(event);
9948
9945
  if (coordinates) {
9949
- this.cellDoubleClick.emit({
9950
- ...this._svc.getCellInstance(coordinates),
9951
- event
9946
+ setTimeout(() => {
9947
+ this.cellDoubleClick.emit({
9948
+ ...this._svc.getCellInstance(coordinates),
9949
+ event
9950
+ });
9951
+ if (this.editEvent === EditEvent.doubleClick) {
9952
+ this.startEditRowOrCell(coordinates);
9953
+ }
9952
9954
  });
9953
- if (this.editEvent === EditEvent.doubleClick) {
9954
- this.startEditRowOrCell(coordinates);
9955
- }
9956
9955
  }
9957
9956
  }
9958
9957
  keydown(event) {