igniteui-angular 17.0.10 → 17.0.12

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.
@@ -8300,12 +8300,10 @@ class IgxButtonDirective extends DisplayDensityBase {
8300
8300
  */
8301
8301
  set selected(value) {
8302
8302
  if (this._selected !== value) {
8303
- if (!this._selected) {
8304
- this.buttonSelected.emit({
8305
- button: this
8306
- });
8307
- }
8308
8303
  this._selected = value;
8304
+ this.buttonSelected.emit({
8305
+ button: this
8306
+ });
8309
8307
  }
8310
8308
  }
8311
8309
  get selected() {
@@ -10836,6 +10834,24 @@ class IgxDragDirective {
10836
10834
  if (!this._clicked) {
10837
10835
  return;
10838
10836
  }
10837
+ // When the base element is moved to previous index, angular reattaches the ghost template as a sibling by default.
10838
+ // This is the defaut place for the EmbededViewRef when recreated.
10839
+ // That's why we need to move it to the proper place and set pointer capture again.
10840
+ if (this._pointerDownId && this.ghostElement && this._dynamicGhostRef && !this._dynamicGhostRef.destroyed) {
10841
+ let ghostReattached = false;
10842
+ if (this.ghostHost && !Array.from(this.ghostHost.children).includes(this.ghostElement)) {
10843
+ ghostReattached = true;
10844
+ this.ghostHost.appendChild(this.ghostElement);
10845
+ }
10846
+ else if (!this.ghostHost && !Array.from(document.body.children).includes(this.ghostElement)) {
10847
+ ghostReattached = true;
10848
+ document.body.appendChild(this.ghostElement);
10849
+ }
10850
+ if (ghostReattached) {
10851
+ this.ghostElement.setPointerCapture(this._pointerDownId);
10852
+ return;
10853
+ }
10854
+ }
10839
10855
  const eventArgs = {
10840
10856
  originalEvent: event,
10841
10857
  owner: this,
@@ -25216,7 +25232,7 @@ class IgxGridSelectionService {
25216
25232
  /** Returns all data in the grid, with applied filtering and sorting and without deleted rows. */
25217
25233
  get allData() {
25218
25234
  let allData;
25219
- if (this.isFilteringApplied() || this.grid.sortingExpressions.length) {
25235
+ if (this.isFilteringApplied() || this.grid.sortingExpressions.length || this.grid.groupingExpressions?.length) {
25220
25236
  allData = this.grid.pinnedRecordsCount ? this.grid._filteredSortedUnpinnedData : this.grid.filteredSortedData;
25221
25237
  }
25222
25238
  else {
@@ -27550,19 +27566,24 @@ class IgxButtonGroupComponent extends DisplayDensityBase {
27550
27566
  if (this.selectedIndexes.indexOf(index) === -1) {
27551
27567
  this.selectedIndexes.push(index);
27552
27568
  }
27553
- this._renderer.setAttribute(button.nativeElement, 'aria-pressed', 'true');
27554
- this._renderer.addClass(button.nativeElement, 'igx-button-group__item--selected');
27555
- const indexInViewButtons = this.viewButtons.toArray().indexOf(button);
27556
- if (indexInViewButtons !== -1) {
27557
- this.values[indexInViewButtons].selected = true;
27569
+ if (button.selected) {
27570
+ this._renderer.setAttribute(button.nativeElement, 'aria-pressed', 'true');
27571
+ this._renderer.addClass(button.nativeElement, 'igx-button-group__item--selected');
27572
+ const indexInViewButtons = this.viewButtons.toArray().indexOf(button);
27573
+ if (indexInViewButtons !== -1) {
27574
+ this.values[indexInViewButtons].selected = true;
27575
+ }
27576
+ // deselect other buttons if selectionMode is not multi
27577
+ if (this.selectionMode !== 'multi' && this.selectedIndexes.length > 1) {
27578
+ this.buttons.forEach((_, i) => {
27579
+ if (i !== index && this.selectedIndexes.indexOf(i) !== -1) {
27580
+ this.deselectButton(i);
27581
+ }
27582
+ });
27583
+ }
27558
27584
  }
27559
- // deselect other buttons if selectionMode is not multi
27560
- if (this.selectionMode !== 'multi' && this.selectedIndexes.length > 1) {
27561
- this.buttons.forEach((_, i) => {
27562
- if (i !== index && this.selectedIndexes.indexOf(i) !== -1) {
27563
- this.deselectButton(i);
27564
- }
27565
- });
27585
+ else {
27586
+ this.deselectButton(index);
27566
27587
  }
27567
27588
  }
27568
27589
  /**
@@ -65489,7 +65510,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
65489
65510
  if (this.isPercentWidth) {
65490
65511
  /* width in %*/
65491
65512
  const computed = this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width');
65492
- width = computed.indexOf('%') === -1 ? parseInt(computed, 10) : null;
65513
+ width = computed.indexOf('%') === -1 ? parseFloat(computed) : null;
65493
65514
  }
65494
65515
  else {
65495
65516
  width = parseInt(this.width, 10);
@@ -77223,7 +77244,7 @@ class IgxTreeGridSelectionService extends IgxGridSelectionService {
77223
77244
  added, removed, event, cancel: false
77224
77245
  };
77225
77246
  this.calculateRowsNewSelectionState(args, !!this.grid.primaryKey);
77226
- args.newSelection = Array.from(this.allData.filter(r => this.rowsToBeSelected.has(this.grid.primaryKey ? r[this.grid.primaryKey] : r)));
77247
+ args.newSelection = Array.from(this.grid.gridAPI.get_all_data().filter(r => this.rowsToBeSelected.has(this.grid.primaryKey ? r[this.grid.primaryKey] : r)));
77227
77248
  // retrieve rows/parents/children which has been added/removed from the selection
77228
77249
  this.handleAddedAndRemovedArgs(args);
77229
77250
  this.grid.rowSelectionChanging.emit(args);