igniteui-angular 17.2.7 → 17.2.8

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.
@@ -5,7 +5,7 @@ import { NgModel, NgControl, FormControlName, NG_VALUE_ACCESSOR, Validators, NG_
5
5
  import { Observable, Subject, fromEvent, interval, animationFrameScheduler, noop, merge, Subscription, timer, pipe } from 'rxjs';
6
6
  import { takeUntil, filter, first as first$2, throttle, throttleTime, startWith, take, debounce, tap, switchMap, skipLast, debounceTime, map, shareReplay, takeWhile, pluck } from 'rxjs/operators';
7
7
  import { isPlatformBrowser, formatDate as formatDate$1, CurrencyPipe, formatPercent, formatNumber, getLocaleCurrencyCode, DatePipe, getLocaleDateFormat, FormatWidth, getLocaleDateTimeFormat, DOCUMENT, NgTemplateOutlet, NgIf, NgClass, NgSwitch, NgSwitchCase, NgSwitchDefault, NgFor, TitleCasePipe, getLocaleFirstDayOfWeek, NgStyle, getLocaleCurrencySymbol, formatCurrency as formatCurrency$1, getLocaleNumberFormat, NumberFormatStyle, DecimalPipe, PercentPipe, getCurrencySymbol, AsyncPipe } from '@angular/common';
8
- import { mergeWith } from 'lodash-es';
8
+ import { mergeWith, isEqual as isEqual$1 } from 'lodash-es';
9
9
  import { strToU8, zip } from 'fflate';
10
10
  import * as i1 from '@angular/animations';
11
11
  import { style, animate, useAnimation } from '@angular/animations';
@@ -375,14 +375,6 @@ const isEqual = (obj1, obj2) => {
375
375
  }
376
376
  return obj1 === obj2;
377
377
  };
378
- /**
379
- * Checks if provided variable is the value NaN
380
- *
381
- * @param value Value to check
382
- * @returns true if provided variable is NaN
383
- * @hidden
384
- */
385
- const isNaNvalue = (value) => isNaN(value) && value !== undefined && typeof value !== 'string';
386
378
  /**
387
379
  * Utility service taking care of various utility functions such as
388
380
  * detecting browser features, general cross browser DOM manipulation, etc.
@@ -36569,9 +36561,7 @@ class IgxComboBaseDirective extends DisplayDensityBase {
36569
36561
  return keys;
36570
36562
  }
36571
36563
  return keys.map(key => {
36572
- const item = isNaNvalue(key)
36573
- ? this.data.find(entry => isNaNvalue(entry[this.valueKey]))
36574
- : this.data.find(entry => entry[this.valueKey] === key);
36564
+ const item = this.data.find(entry => isEqual$1(entry[this.valueKey], key));
36575
36565
  return item !== undefined ? item : { [this.valueKey]: key };
36576
36566
  });
36577
36567
  }
@@ -37698,7 +37688,6 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37698
37688
  this.filterValue = this.searchValue = this.comboInput.value;
37699
37689
  return;
37700
37690
  }
37701
- this.filterValue = this.searchValue = '';
37702
37691
  });
37703
37692
  this.dropdown.opened.pipe(takeUntil(this.destroy$)).subscribe(() => {
37704
37693
  if (this.composing) {
@@ -37736,12 +37725,12 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37736
37725
  }
37737
37726
  /** @hidden @internal */
37738
37727
  handleInputChange(event) {
37739
- if (event !== undefined) {
37740
- this.filterValue = this.searchValue = typeof event === 'string' ? event : event.target.value;
37741
- }
37742
37728
  if (this.collapsed && this.comboInput.focused) {
37743
37729
  this.open();
37744
37730
  }
37731
+ if (event !== undefined) {
37732
+ this.filterValue = this.searchValue = typeof event === 'string' ? event : event.target.value;
37733
+ }
37745
37734
  if (!this.comboInput.value.trim() && super.selection.length) {
37746
37735
  // handle clearing of input by space
37747
37736
  this.clearSelection();
@@ -37749,7 +37738,19 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37749
37738
  this.filterValue = '';
37750
37739
  }
37751
37740
  if (super.selection.length) {
37752
- this.selectionService.clear(this.id);
37741
+ const args = {
37742
+ newValue: undefined,
37743
+ oldValue: this.selectedItem,
37744
+ newSelection: undefined,
37745
+ oldSelection: this.selection,
37746
+ displayText: typeof event === 'string' ? event : event?.target?.value,
37747
+ owner: this,
37748
+ cancel: false
37749
+ };
37750
+ this.selectionChanging.emit(args);
37751
+ if (!args.cancel) {
37752
+ this.selectionService.select_items(this.id, [], true);
37753
+ }
37753
37754
  }
37754
37755
  // when filtering the focused item should be the first item or the currently selected item
37755
37756
  if (!this.dropdown.focusedItem || this.dropdown.focusedItem.id !== this.dropdown.items[0].id) {
@@ -37837,12 +37838,15 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37837
37838
  if (this.disabled) {
37838
37839
  return;
37839
37840
  }
37841
+ const oldSelection = this.selection;
37840
37842
  this.clearSelection(true);
37841
37843
  if (!this.collapsed) {
37842
37844
  this.focusSearchInput(true);
37843
37845
  }
37844
37846
  event.stopPropagation();
37845
- this.comboInput.value = this.filterValue = this.searchValue = '';
37847
+ if (this.selection !== oldSelection) {
37848
+ this.comboInput.value = this.filterValue = this.searchValue = '';
37849
+ }
37846
37850
  this.dropdown.focusedItem = null;
37847
37851
  this.composing = false;
37848
37852
  this.comboInput.focus();
@@ -37921,6 +37925,14 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37921
37925
  else if (this.isRemote) {
37922
37926
  this.registerRemoteEntries(newValueAsArray, false);
37923
37927
  }
37928
+ else {
37929
+ args.displayText = this.createDisplayText(oldItems, []);
37930
+ const oldSelectionArray = args.oldSelection ? [args.oldSelection] : [];
37931
+ this.comboInput.value = this._displayValue = this.searchValue = this.createDisplayText(oldSelectionArray, []);
37932
+ if (this.isRemote) {
37933
+ this.registerRemoteEntries(newValueAsArray, false);
37934
+ }
37935
+ }
37924
37936
  }
37925
37937
  createDisplayText(newSelection, oldSelection) {
37926
37938
  if (this.isRemote) {
@@ -37981,7 +37993,10 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37981
37993
  }
37982
37994
  clear() {
37983
37995
  this.clearSelection(true);
37984
- this.comboInput.value = this._displayValue = this.searchValue = '';
37996
+ const oldSelection = this.selection;
37997
+ if (this.selection !== oldSelection) {
37998
+ this.comboInput.value = this._displayValue = this.searchValue = '';
37999
+ }
37985
38000
  }
37986
38001
  isValid(value) {
37987
38002
  return this.required