igniteui-angular 13.2.11 → 13.2.14

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.
@@ -7,7 +7,7 @@ import { NgModel, FormControlName, NG_VALUE_ACCESSOR, NG_VALIDATORS, CheckboxReq
7
7
  import * as i4 from '@angular/common';
8
8
  import { isPlatformBrowser, formatDate as formatDate$1, CurrencyPipe, formatPercent, formatNumber, getLocaleCurrencyCode, DatePipe, DOCUMENT, CommonModule, FormatWidth, getLocaleDateFormat, getLocaleNumberFormat, NumberFormatStyle, getCurrencySymbol } from '@angular/common';
9
9
  import { Observable, Subject, fromEvent, interval, animationFrameScheduler, noop, merge, Subscription, timer, pipe } from 'rxjs';
10
- import { takeUntil, filter, first as first$1, throttleTime, take, throttle, debounce, tap, switchMap, skipLast, map, debounceTime, shareReplay, takeWhile, pluck } from 'rxjs/operators';
10
+ import { takeUntil, filter, first as first$1, throttleTime, take, throttle, startWith, debounce, tap, switchMap, skipLast, map, debounceTime, shareReplay, takeWhile, pluck } from 'rxjs/operators';
11
11
  import mergeWith from 'lodash.mergewith';
12
12
  import * as JSZip from 'jszip';
13
13
  import * as i1$1 from '@angular/platform-browser';
@@ -15253,7 +15253,9 @@ class IgxDragDirective {
15253
15253
  }
15254
15254
  }
15255
15255
  get ghostLeft() {
15256
- return parseInt(this.ghostElement.style.left, 10) + this._ghostHostX;
15256
+ if (this.ghostElement) {
15257
+ return parseInt(this.ghostElement.style.left, 10) + this._ghostHostX;
15258
+ }
15257
15259
  }
15258
15260
  set ghostTop(pageY) {
15259
15261
  if (this.ghostElement) {
@@ -15264,7 +15266,9 @@ class IgxDragDirective {
15264
15266
  }
15265
15267
  }
15266
15268
  get ghostTop() {
15267
- return parseInt(this.ghostElement.style.top, 10) + this._ghostHostY;
15269
+ if (this.ghostElement) {
15270
+ return parseInt(this.ghostElement.style.top, 10) + this._ghostHostY;
15271
+ }
15268
15272
  }
15269
15273
  get windowScrollTop() {
15270
15274
  return document.documentElement.scrollTop || window.scrollY;
@@ -15827,7 +15831,7 @@ class IgxDragDirective {
15827
15831
  const ghostMarginLeft = parseInt(document.defaultView.getComputedStyle(this.ghostElement)['margin-left'], 10);
15828
15832
  const ghostMarginTop = parseInt(document.defaultView.getComputedStyle(this.ghostElement)['margin-top'], 10);
15829
15833
  this.ghostElement.style.left = (this._ghostStartX - ghostMarginLeft + totalMovedX - this._ghostHostX) + 'px';
15830
- this.ghostElement.style.top = (this._ghostStartY - ghostMarginTop + totalMovedY - this._ghostHostX) + 'px';
15834
+ this.ghostElement.style.top = (this._ghostStartY - ghostMarginTop + totalMovedY - this._ghostHostY) + 'px';
15831
15835
  if (this.pointerEventsEnabled) {
15832
15836
  // The ghostElement takes control for moving and dragging after it has been rendered.
15833
15837
  if (this._pointerDownId !== null) {
@@ -16014,7 +16018,7 @@ class IgxDragDirective {
16014
16018
  const elementHeight = this.ghost && this.ghostElement ? this.ghostElement.offsetHeight : this.element.nativeElement.offsetHeight;
16015
16019
  const bottomBorder = (!this.scrollContainer ? window.innerHeight : containerBounds.bottom) +
16016
16020
  this.windowScrollTop - this._scrollContainerThreshold - elementHeight;
16017
- // Same for window scroll left
16021
+ // Same for window scroll left
16018
16022
  const leftBorder = (!this.scrollContainer ? 0 : containerBounds.left) + this.windowScrollLeft + this._scrollContainerThreshold;
16019
16023
  // Subtract the element width again because we position it from top left corner.
16020
16024
  const elementWidth = this.ghost && this.ghostElement ? this.ghostElement.offsetWidth : this.element.nativeElement.offsetWidth;
@@ -17919,6 +17923,11 @@ let nextId$3 = 0;
17919
17923
  class IgxRadioComponent {
17920
17924
  constructor(cdr) {
17921
17925
  this.cdr = cdr;
17926
+ /**
17927
+ * @hidden
17928
+ * @internal
17929
+ */
17930
+ this.destroy$ = new Subject();
17922
17931
  /**
17923
17932
  * Sets/gets the `id` of the radio component.
17924
17933
  * If not set, the `id` of the first radio component will be `"igx-radio-0"`.
@@ -18092,6 +18101,14 @@ class IgxRadioComponent {
18092
18101
  set disabled(value) {
18093
18102
  this._disabled = (value === '') || value;
18094
18103
  }
18104
+ /**
18105
+ * @hidden
18106
+ * @internal
18107
+ */
18108
+ ngOnDestroy() {
18109
+ this.destroy$.next(true);
18110
+ this.destroy$.complete();
18111
+ }
18095
18112
  /**
18096
18113
  * @hidden
18097
18114
  * @internal
@@ -18391,6 +18408,11 @@ class IgxRadioGroupDirective {
18391
18408
  * @internal
18392
18409
  */
18393
18410
  this.destroy$ = new Subject();
18411
+ /**
18412
+ * @hidden
18413
+ * @internal
18414
+ */
18415
+ this.queryChange$ = new Subject();
18394
18416
  }
18395
18417
  /**
18396
18418
  * Sets/gets the `value` attribute.
@@ -18536,8 +18558,9 @@ class IgxRadioGroupDirective {
18536
18558
  // The initial value can possibly be set by NgModel and it is possible that
18537
18559
  // the OnInit of the NgModel occurs after the OnInit of this class.
18538
18560
  this._isInitialized = true;
18539
- setTimeout(() => {
18540
- this._initRadioButtons();
18561
+ this.radioButtons.changes.pipe(startWith(0), takeUntil(this.destroy$)).subscribe(() => {
18562
+ this.queryChange$.next();
18563
+ setTimeout(() => this._initRadioButtons());
18541
18564
  });
18542
18565
  }
18543
18566
  /**
@@ -18615,7 +18638,7 @@ class IgxRadioGroupDirective {
18615
18638
  button.checked = true;
18616
18639
  this._selected = button;
18617
18640
  }
18618
- button.change.pipe(takeUntil(this.destroy$)).subscribe((ev) => this._selectedRadioButtonChanged(ev));
18641
+ button.change.pipe(takeUntil(button.destroy$), takeUntil(this.destroy$), takeUntil(this.queryChange$)).subscribe((ev) => this._selectedRadioButtonChanged(ev));
18619
18642
  });
18620
18643
  }
18621
18644
  }
@@ -24210,9 +24233,13 @@ class IgxGridSelectionService {
24210
24233
  */
24211
24234
  this.pointerEventInGridBody = false;
24212
24235
  this._ranges = new Set();
24213
- this.pointerOriginHandler = () => {
24236
+ this.pointerOriginHandler = (event) => {
24214
24237
  this.pointerEventInGridBody = false;
24215
24238
  document.body.removeEventListener('pointerup', this.pointerOriginHandler);
24239
+ const targetTagName = event.target.tagName.toLowerCase();
24240
+ if (targetTagName !== 'igx-grid-cell' && targetTagName !== 'igx-tree-grid-cell') {
24241
+ this.pointerUp(this._lastSelectedNode, this.grid.rangeSelected, true);
24242
+ }
24216
24243
  };
24217
24244
  this.initPointerState();
24218
24245
  this.initKeyboardState();
@@ -24329,6 +24356,7 @@ class IgxGridSelectionService {
24329
24356
  * and the start node of the `state`.
24330
24357
  */
24331
24358
  generateRange(node, state) {
24359
+ this._lastSelectedNode = node;
24332
24360
  if (!state) {
24333
24361
  return {
24334
24362
  rowStart: node.row,
@@ -24446,8 +24474,8 @@ class IgxGridSelectionService {
24446
24474
  }
24447
24475
  return true;
24448
24476
  }
24449
- pointerUp(node, emitter) {
24450
- if (this.dragMode) {
24477
+ pointerUp(node, emitter, firedOutsideGrid) {
24478
+ if (this.dragMode || firedOutsideGrid) {
24451
24479
  this.restoreTextSelection();
24452
24480
  this.addRangeMeta(node, this.pointerState);
24453
24481
  this.mergeMap(this.selection, this.temp);
@@ -37586,7 +37614,12 @@ class IgxSimpleComboComponent extends IgxComboBaseDirective {
37586
37614
  }
37587
37615
  return current === this.selection[0];
37588
37616
  });
37589
- this.dropdown.navigateItem(index);
37617
+ if (!this.isRemote) {
37618
+ // navigate to item only if we have local data
37619
+ // as with remote data this will fiddle with igxFor's scroll handler
37620
+ // and will trigger another chunk load which will break the visualization
37621
+ this.dropdown.navigateItem(index);
37622
+ }
37590
37623
  }
37591
37624
  });
37592
37625
  this.dropdown.opening.pipe(takeUntil(this.destroy$)).subscribe(() => {
@@ -38426,6 +38459,7 @@ class IgxDatePickerComponent extends PickerBaseDirective {
38426
38459
  this._onTouchedCallback = noop;
38427
38460
  this._onValidatorChange = noop;
38428
38461
  this.onStatusChanged = () => {
38462
+ this.disabled = this._ngControl.disabled;
38429
38463
  this.updateValidity();
38430
38464
  this.inputGroup.isRequired = this.required;
38431
38465
  };
@@ -42383,7 +42417,8 @@ class IgxTimePickerComponent extends PickerBaseDirective {
42383
42417
  }
42384
42418
  onStatusChanged() {
42385
42419
  if ((this._ngControl.control.touched || this._ngControl.control.dirty) &&
42386
- (this._ngControl.control.validator || this._ngControl.control.asyncValidator)) {
42420
+ (this._ngControl.control.validator || this._ngControl.control.asyncValidator) &&
42421
+ !this._ngControl.disabled) {
42387
42422
  if (this._inputGroup.isFocused) {
42388
42423
  this.inputDirective.valid = this._ngControl.valid ? IgxInputState.VALID : IgxInputState.INVALID;
42389
42424
  }
@@ -58614,8 +58649,13 @@ class IgxGridNavigationService {
58614
58649
  if (shouldClearSelection || (this.grid.cellSelection !== GridSelectionMode.multiple)) {
58615
58650
  this.grid.clearCellSelection();
58616
58651
  this.grid.navigateTo(this.activeNode.row, this.activeNode.column, (obj) => {
58617
- obj.target?.activate(event);
58618
- this.grid.cdr.detectChanges();
58652
+ if (this.activeNode.row === obj.target.row.index) {
58653
+ obj.target?.activate(event);
58654
+ this.grid.cdr.detectChanges();
58655
+ }
58656
+ else {
58657
+ this.grid.navigateTo(this.activeNode.row, this.activeNode.column);
58658
+ }
58619
58659
  });
58620
58660
  }
58621
58661
  else {
@@ -83898,14 +83938,14 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
83898
83938
  this.onValidatorChange = noop;
83899
83939
  this.onStatusChanged = () => {
83900
83940
  if (this.inputGroup) {
83901
- this.inputDirective.valid = this.isTouchedOrDirty
83941
+ this.inputDirective.valid = this.isTouchedOrDirty && !this._ngControl.disabled
83902
83942
  ? this.getInputState(this.inputGroup.isFocused)
83903
83943
  : IgxInputState.INITIAL;
83904
83944
  }
83905
83945
  else if (this.hasProjectedInputs) {
83906
83946
  this.projectedInputs
83907
83947
  .forEach(i => {
83908
- i.inputDirective.valid = this.isTouchedOrDirty
83948
+ i.inputDirective.valid = this.isTouchedOrDirty && !this._ngControl.disabled
83909
83949
  ? this.getInputState(i.isFocused)
83910
83950
  : IgxInputState.INITIAL;
83911
83951
  ;