igniteui-angular 15.1.23 → 15.1.25

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.
@@ -25746,7 +25746,7 @@ class IgxGridCRUDService extends IgxRowAddCrudState {
25746
25746
  });
25747
25747
  }
25748
25748
  /**
25749
- * Finishes the row transactions on the current row.
25749
+ * Finishes the row transactions on the current row and returns whether the grid editing was canceled.
25750
25750
  *
25751
25751
  * @remarks
25752
25752
  * If `commit === true`, passes them from the pending state to the data (or transaction service)
@@ -30223,20 +30223,25 @@ class IgxButtonGroupComponent extends DisplayDensityBase {
30223
30223
  */
30224
30224
  _clickHandler(index) {
30225
30225
  const button = this.buttons[index];
30226
+ const args = { cancel: false, button, index };
30226
30227
  if (!this.multiSelection) {
30227
30228
  this.buttons.forEach((b, i) => {
30228
30229
  if (i !== index && this.selectedIndexes.indexOf(i) !== -1) {
30229
- this.deselected.emit({ button: b, index: i });
30230
+ this.deselected.emit({ cancel: false, button: b, index: i });
30230
30231
  }
30231
30232
  });
30232
30233
  }
30233
30234
  if (this.selectedIndexes.indexOf(index) === -1) {
30234
- this.selectButton(index);
30235
- this.selected.emit({ button, index });
30235
+ this.selected.emit(args);
30236
+ if (!args.cancel) {
30237
+ this.selectButton(index);
30238
+ }
30236
30239
  }
30237
30240
  else {
30238
- this.deselectButton(index);
30239
- this.deselected.emit({ button, index });
30241
+ this.deselected.emit(args);
30242
+ if (!args.cancel) {
30243
+ this.deselectButton(index);
30244
+ }
30240
30245
  }
30241
30246
  }
30242
30247
  }
@@ -51102,12 +51107,7 @@ class IgxGridCell {
51102
51107
  this._row = row;
51103
51108
  this._rowIndex = row.index;
51104
51109
  }
51105
- if (typeof column === 'string') {
51106
- this._columnField = column;
51107
- }
51108
- else {
51109
- this._column = column;
51110
- }
51110
+ this._column = column;
51111
51111
  }
51112
51112
  /**
51113
51113
  * Returns the row containing the cell.
@@ -51129,7 +51129,7 @@ class IgxGridCell {
51129
51129
  * @memberof IgxGridCell
51130
51130
  */
51131
51131
  get column() {
51132
- return this._column || this.grid.getColumnByName(this._columnField);
51132
+ return this._column;
51133
51133
  }
51134
51134
  /**
51135
51135
  * Gets the current edit value while a cell is in edit mode.
@@ -52030,7 +52030,7 @@ class IgxColumnComponent {
52030
52030
  .map((rec, index) => {
52031
52031
  if (!this.grid.isGroupByRecord(rec) && !this.grid.isSummaryRow(rec)) {
52032
52032
  this.grid.pagingMode === 1 && this.grid.page !== 0 ? index = index + this.grid.perPage * this.grid.page : index = this.grid.dataRowList.first.index + index;
52033
- const cell = new IgxGridCell(this.grid, index, this.field);
52033
+ const cell = new IgxGridCell(this.grid, index, this);
52034
52034
  return cell;
52035
52035
  }
52036
52036
  }).filter(cell => cell);
@@ -52918,7 +52918,8 @@ class IgxColumnComponent {
52918
52918
  }
52919
52919
  }
52920
52920
  if (hasIndex) {
52921
- grid._moveColumns(this, targetColumn);
52921
+ index === grid._pinnedColumns.length - 1 ?
52922
+ grid._moveColumns(this, targetColumn, DropPosition.AfterDropTarget) : grid._moveColumns(this, targetColumn, DropPosition.BeforeDropTarget);
52922
52923
  }
52923
52924
  if (this.columnGroup) {
52924
52925
  this.allChildren.forEach(child => child.pin());
@@ -53247,7 +53248,7 @@ class IgxColumnComponent {
53247
53248
  const isPercentageWidth = colWidth && typeof colWidth === 'string' && colWidth.indexOf('%') !== -1;
53248
53249
  const isAutoWidth = colWidth && typeof colWidth === 'string' && colWidth === 'fit-content';
53249
53250
  if (isPercentageWidth) {
53250
- this._calcWidth = parseFloat(colWidth) / 100 * this.grid.calcWidth;
53251
+ this._calcWidth = Math.floor(parseFloat(colWidth) / 100 * this.grid.calcWidth);
53251
53252
  }
53252
53253
  else if (!colWidth || isAutoWidth && !this.autoSize) {
53253
53254
  // no width
@@ -54751,7 +54752,7 @@ class BaseRow {
54751
54752
  get cells() {
54752
54753
  const res = [];
54753
54754
  this.grid.columns.forEach(col => {
54754
- const cell = new IgxGridCell(this.grid, this.index, col.field);
54755
+ const cell = new IgxGridCell(this.grid, this.index, col);
54755
54756
  res.push(cell);
54756
54757
  });
54757
54758
  return res;
@@ -55058,7 +55059,7 @@ class IgxHierarchicalGridRow extends BaseRow {
55058
55059
  get cells() {
55059
55060
  const res = [];
55060
55061
  this.grid.columns.forEach(col => {
55061
- const cell = new IgxGridCell(this.grid, this.index, col.field);
55062
+ const cell = new IgxGridCell(this.grid, this.index, col);
55062
55063
  res.push(cell);
55063
55064
  });
55064
55065
  return res;
@@ -67506,7 +67507,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
67506
67507
  return this.unpinnedRecords.findIndex(x => x[this.primaryKey] === id);
67507
67508
  }
67508
67509
  /**
67509
- * Finishes the row transactions on the current row.
67510
+ * Finishes the row transactions on the current row and returns whether the grid editing was canceled.
67510
67511
  *
67511
67512
  * @remarks
67512
67513
  * If `commit === true`, passes them from the pending state to the data (or transaction service)
@@ -67519,7 +67520,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
67519
67520
  // TODO: Facade for crud service refactoring. To be removed
67520
67521
  // TODO: do not remove this, as it is used in rowEditTemplate, but mark is as internal and hidden
67521
67522
  endEdit(commit = true, event) {
67522
- this.crudService.endEdit(commit, event);
67523
+ return this.crudService.endEdit(commit, event);
67523
67524
  }
67524
67525
  /**
67525
67526
  * Enters add mode by spawning the UI under the specified row by rowID.
@@ -71185,7 +71186,7 @@ class IgxGridCellComponent {
71185
71186
  }
71186
71187
  getCellType(useRow) {
71187
71188
  const rowID = useRow ? this.grid.createRow(this.intRow.index, this.intRow.data) : this.intRow.index;
71188
- return new IgxGridCell(this.grid, rowID, this.column.field);
71189
+ return new IgxGridCell(this.grid, rowID, this.column);
71189
71190
  }
71190
71191
  }
71191
71192
  IgxGridCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: IgxGridCellComponent, deps: [{ token: IgxGridSelectionService }, { token: IGX_GRID_BASE }, { token: IgxOverlayService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: HammerGesturesManager }, { token: PlatformUtil }], target: i0.ɵɵFactoryTarget.Component });
@@ -72104,7 +72105,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
72104
72105
  const row = this.getRowByIndex(rowIndex);
72105
72106
  const column = this._columns.find((col) => col.visibleIndex === index);
72106
72107
  if (row && row instanceof IgxGridRow && !row.data?.detailsData && column) {
72107
- return new IgxGridCell(this, rowIndex, column.field);
72108
+ return new IgxGridCell(this, rowIndex, column);
72108
72109
  }
72109
72110
  }
72110
72111
  /**
@@ -72694,7 +72695,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
72694
72695
  if (this.pagingMode === 1 && this.page !== 0) {
72695
72696
  row.index = rowIndex + this.perPage * this.page;
72696
72697
  }
72697
- return new IgxGridCell(this, row.index, columnField);
72698
+ return new IgxGridCell(this, row.index, column);
72698
72699
  }
72699
72700
  }
72700
72701
  /**
@@ -72713,7 +72714,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
72713
72714
  const row = this.getRowByKey(rowSelector);
72714
72715
  const column = this._columns.find((col) => col.field === columnField);
72715
72716
  if (row && column) {
72716
- return new IgxGridCell(this, row.index, columnField);
72717
+ return new IgxGridCell(this, row.index, column);
72717
72718
  }
72718
72719
  }
72719
72720
  pinRow(rowID, index) {
@@ -75356,6 +75357,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
75356
75357
  * @hidden @internal
75357
75358
  */
75358
75359
  endEdit(_commit = true, _event) {
75360
+ return;
75359
75361
  }
75360
75362
  /**
75361
75363
  * @hidden @internal
@@ -80867,7 +80869,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
80867
80869
  const row = this.getRowByIndex(rowIndex);
80868
80870
  const column = this.columns.find((col) => col.visibleIndex === index);
80869
80871
  if (row && row instanceof IgxTreeGridRow && column) {
80870
- return new IgxGridCell(this, rowIndex, column.field);
80872
+ return new IgxGridCell(this, rowIndex, column);
80871
80873
  }
80872
80874
  }
80873
80875
  /**
@@ -81223,7 +81225,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
81223
81225
  const row = this.getRowByIndex(rowIndex);
81224
81226
  const column = this.columns.find((col) => col.field === columnField);
81225
81227
  if (row && row instanceof IgxTreeGridRow && column) {
81226
- return new IgxGridCell(this, rowIndex, columnField);
81228
+ return new IgxGridCell(this, rowIndex, column);
81227
81229
  }
81228
81230
  }
81229
81231
  /**
@@ -81242,7 +81244,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
81242
81244
  const row = this.getRowByKey(rowSelector);
81243
81245
  const column = this.columns.find((col) => col.field === columnField);
81244
81246
  if (row && column) {
81245
- return new IgxGridCell(this, row.index, columnField);
81247
+ return new IgxGridCell(this, row.index, column);
81246
81248
  }
81247
81249
  }
81248
81250
  pinRow(rowID, index) {
@@ -83429,7 +83431,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
83429
83431
  const row = this.getRowByIndex(rowIndex);
83430
83432
  const column = this.columns.find((col) => col.visibleIndex === index);
83431
83433
  if (row && row instanceof IgxHierarchicalGridRow && column) {
83432
- return new IgxGridCell(this, rowIndex, column.field);
83434
+ return new IgxGridCell(this, rowIndex, column);
83433
83435
  }
83434
83436
  }
83435
83437
  /**
@@ -83652,7 +83654,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
83652
83654
  const row = this.getRowByIndex(rowIndex);
83653
83655
  const column = this.columns.find((col) => col.field === columnField);
83654
83656
  if (row && row instanceof IgxHierarchicalGridRow && column) {
83655
- return new IgxGridCell(this, rowIndex, columnField);
83657
+ return new IgxGridCell(this, rowIndex, column);
83656
83658
  }
83657
83659
  }
83658
83660
  /**
@@ -83671,7 +83673,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
83671
83673
  const row = this.getRowByKey(rowSelector);
83672
83674
  const column = this.columns.find((col) => col.field === columnField);
83673
83675
  if (row && column) {
83674
- return new IgxGridCell(this, row.index, columnField);
83676
+ return new IgxGridCell(this, row.index, column);
83675
83677
  }
83676
83678
  }
83677
83679
  pinRow(rowID, index) {