@clr/angular 13.14.2 → 13.14.3

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.
@@ -8757,10 +8757,10 @@ class ClrDaypicker {
8757
8757
  }
8758
8758
  }
8759
8759
  ClrDaypicker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDaypicker, deps: [{ token: ViewManagerService }, { token: DateNavigationService }, { token: LocaleHelperService }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
8760
- ClrDaypicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrDaypicker, selector: "clr-daypicker", host: { properties: { "class.daypicker": "true" } }, ngImport: i0, template: "<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n<div class=\"calendar-header\">\n <div class=\"calendar-pickers\">\n <button\n class=\"calendar-btn monthpicker-trigger\"\n type=\"button\"\n (click)=\"changeToMonthView()\"\n [attr.aria-label]=\"monthAttrString\"\n [attr.title]=\"monthAttrString\"\n >\n {{calendarMonth}}\n </button>\n <button\n class=\"calendar-btn yearpicker-trigger\"\n type=\"button\"\n (click)=\"changeToYearView()\"\n [attr.aria-label]=\"yearAttrString\"\n [attr.title]=\"yearAttrString\"\n >\n {{calendarYear}}\n </button>\n </div>\n <div class=\"calendar-switchers\">\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"previousMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerPreviousMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.datepickerPreviousMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"currentMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerCurrentMonth\"\n >\n <cds-icon shape=\"event\" [attr.title]=\"commonStrings.keys.datepickerCurrentMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"nextMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerNextMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"right\"></cds-icon>\n </button>\n </div>\n</div>\n<clr-calendar></clr-calendar>\n<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n", components: [{ type: ClrCalendar, selector: "clr-calendar" }], directives: [{ type: CdsIconCustomTag, selector: "cds-icon" }] });
8760
+ ClrDaypicker.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrDaypicker, selector: "clr-daypicker", host: { properties: { "class.daypicker": "true" } }, ngImport: i0, template: "<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n<div class=\"calendar-header\">\n <div class=\"calendar-pickers\">\n <button\n class=\"calendar-btn monthpicker-trigger\"\n type=\"button\"\n (click)=\"changeToMonthView()\"\n [attr.aria-label]=\"monthAttrString\"\n [attr.title]=\"monthAttrString\"\n >\n {{calendarMonth}}\n </button>\n <button\n class=\"calendar-btn yearpicker-trigger\"\n type=\"button\"\n (click)=\"changeToYearView()\"\n [attr.aria-label]=\"yearAttrString\"\n [attr.title]=\"yearAttrString\"\n >\n {{calendarYear}}\n </button>\n </div>\n <div class=\"calendar-switchers\">\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"previousMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerPreviousMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.datepickerPreviousMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"currentMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerCurrentMonth\"\n >\n <cds-icon shape=\"event\" [attr.title]=\"commonStrings.keys.datepickerCurrentMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"nextMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerNextMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"right\" [attr.title]=\"commonStrings.keys.datepickerNextMonth\"></cds-icon>\n </button>\n </div>\n</div>\n<clr-calendar></clr-calendar>\n<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n", components: [{ type: ClrCalendar, selector: "clr-calendar" }], directives: [{ type: CdsIconCustomTag, selector: "cds-icon" }] });
8761
8761
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDaypicker, decorators: [{
8762
8762
  type: Component,
8763
- args: [{ selector: 'clr-daypicker', host: { '[class.daypicker]': 'true' }, template: "<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n<div class=\"calendar-header\">\n <div class=\"calendar-pickers\">\n <button\n class=\"calendar-btn monthpicker-trigger\"\n type=\"button\"\n (click)=\"changeToMonthView()\"\n [attr.aria-label]=\"monthAttrString\"\n [attr.title]=\"monthAttrString\"\n >\n {{calendarMonth}}\n </button>\n <button\n class=\"calendar-btn yearpicker-trigger\"\n type=\"button\"\n (click)=\"changeToYearView()\"\n [attr.aria-label]=\"yearAttrString\"\n [attr.title]=\"yearAttrString\"\n >\n {{calendarYear}}\n </button>\n </div>\n <div class=\"calendar-switchers\">\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"previousMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerPreviousMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.datepickerPreviousMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"currentMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerCurrentMonth\"\n >\n <cds-icon shape=\"event\" [attr.title]=\"commonStrings.keys.datepickerCurrentMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"nextMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerNextMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"right\"></cds-icon>\n </button>\n </div>\n</div>\n<clr-calendar></clr-calendar>\n<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n" }]
8763
+ args: [{ selector: 'clr-daypicker', host: { '[class.daypicker]': 'true' }, template: "<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n<div class=\"calendar-header\">\n <div class=\"calendar-pickers\">\n <button\n class=\"calendar-btn monthpicker-trigger\"\n type=\"button\"\n (click)=\"changeToMonthView()\"\n [attr.aria-label]=\"monthAttrString\"\n [attr.title]=\"monthAttrString\"\n >\n {{calendarMonth}}\n </button>\n <button\n class=\"calendar-btn yearpicker-trigger\"\n type=\"button\"\n (click)=\"changeToYearView()\"\n [attr.aria-label]=\"yearAttrString\"\n [attr.title]=\"yearAttrString\"\n >\n {{calendarYear}}\n </button>\n </div>\n <div class=\"calendar-switchers\">\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"previousMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerPreviousMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.datepickerPreviousMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"currentMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerCurrentMonth\"\n >\n <cds-icon shape=\"event\" [attr.title]=\"commonStrings.keys.datepickerCurrentMonth\"></cds-icon>\n </button>\n <button\n class=\"calendar-btn switcher\"\n type=\"button\"\n (click)=\"nextMonth()\"\n [attr.aria-label]=\"commonStrings.keys.datepickerNextMonth\"\n >\n <cds-icon shape=\"angle\" direction=\"right\" [attr.title]=\"commonStrings.keys.datepickerNextMonth\"></cds-icon>\n </button>\n </div>\n</div>\n<clr-calendar></clr-calendar>\n<div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n" }]
8764
8764
  }], ctorParameters: function () { return [{ type: ViewManagerService }, { type: DateNavigationService }, { type: LocaleHelperService }, { type: ClrCommonStringsService }]; } });
8765
8765
 
8766
8766
  /*
@@ -13840,8 +13840,10 @@ class Items {
13840
13840
  this.loading = false;
13841
13841
  /**
13842
13842
  * Tracking function to identify objects. Default is reference equality.
13843
+ *
13844
+ * @deprecated in v15 and scheduled for removal in v17 (CDE-71)
13843
13845
  */
13844
- this.trackBy = (_index, item) => item;
13846
+ this.iteratorTrackBy = (_index, item) => item;
13845
13847
  /**
13846
13848
  * Whether we should use smart items for this datagrid or let the user handle
13847
13849
  * everything.
@@ -13915,6 +13917,22 @@ class Items {
13915
13917
  this._filterItems();
13916
13918
  }
13917
13919
  }
13920
+ canTrackBy() {
13921
+ // all items are needed unless `datagridTrackBy` is set because `iteratorTrackBy` requires the item's index
13922
+ return !!this.datagridTrackBy || Array.isArray(this.all);
13923
+ }
13924
+ trackBy(item, index) {
13925
+ if (this.datagridTrackBy) {
13926
+ return this.datagridTrackBy(item);
13927
+ }
13928
+ else if (Array.isArray(this.all)) {
13929
+ index = index ?? this.all.indexOf(item);
13930
+ return this.iteratorTrackBy(index, item);
13931
+ }
13932
+ else {
13933
+ throw new Error('improper call to Items#trackBy');
13934
+ }
13935
+ }
13918
13936
  get displayed() {
13919
13937
  // Ideally we could return an immutable array, but we don't have it in Clarity yet.
13920
13938
  return this._displayed;
@@ -14014,7 +14032,7 @@ class ClrDatagridItems {
14014
14032
  this._rawItems = items ? items : []; // local copy for ngOnChange diffing
14015
14033
  }
14016
14034
  set trackBy(value) {
14017
- this.items.trackBy = value;
14035
+ this.items.iteratorTrackBy = value;
14018
14036
  this.iterableProxy.ngForTrackBy = value;
14019
14037
  }
14020
14038
  /**
@@ -14532,17 +14550,15 @@ class Selection {
14532
14550
  }
14533
14551
  case SelectionType.Single: {
14534
14552
  let newSingle;
14535
- const trackBy = this._items.trackBy;
14536
14553
  let selectionUpdated = false;
14537
14554
  // if the currentSingle has been set before data was loaded, we look up and save the ref from current data set
14538
14555
  if (this.currentSingle && !this.prevSingleSelectionRef) {
14539
- if (this._items.all && this._items.trackBy) {
14540
- const lookup = this._items.all.findIndex(maybe => maybe === this.currentSingle);
14541
- this.prevSingleSelectionRef = this._items.trackBy(lookup, this.currentSingle);
14556
+ if (this._items.canTrackBy()) {
14557
+ this.prevSingleSelectionRef = this._items.trackBy(this.currentSingle);
14542
14558
  }
14543
14559
  }
14544
14560
  updatedItems.forEach((item, index) => {
14545
- const ref = trackBy(index, item);
14561
+ const ref = this._items.trackBy(item, index);
14546
14562
  // If one of the updated items is the previously selectedSingle, set it as the new one
14547
14563
  if (this.prevSingleSelectionRef === ref) {
14548
14564
  newSingle = item;
@@ -14572,15 +14588,13 @@ class Selection {
14572
14588
  }
14573
14589
  case SelectionType.Multi: {
14574
14590
  let leftOver = this.current.slice();
14575
- const trackBy = this._items.trackBy;
14576
14591
  let selectionUpdated = false;
14577
14592
  // if the current has been set before data was loaded, we look up and save the ref from current data set
14578
14593
  if (this.current.length > 0 && this.prevSelectionRefs.length !== this.current.length) {
14579
- if (this._items.all && this._items.trackBy) {
14594
+ if (this._items.canTrackBy()) {
14580
14595
  this.prevSelectionRefs = [];
14581
14596
  this.current.forEach(item => {
14582
- const lookup = this._items.all.findIndex(maybe => maybe === item);
14583
- this.prevSelectionRefs.push(this._items.trackBy(lookup, item));
14597
+ this.prevSelectionRefs.push(this._items.trackBy(item));
14584
14598
  });
14585
14599
  }
14586
14600
  }
@@ -14590,7 +14604,7 @@ class Selection {
14590
14604
  //
14591
14605
  // The both loops below that goes over updatedItems could be combined into one.
14592
14606
  updatedItems.forEach((item, index) => {
14593
- const ref = trackBy(index, item);
14607
+ const ref = this._items.trackBy(item, index);
14594
14608
  if (this.lockedRefs.indexOf(ref) > -1) {
14595
14609
  updateLockedRef.push(ref);
14596
14610
  }
@@ -14600,7 +14614,7 @@ class Selection {
14600
14614
  // the if statement below results in broken behavior.
14601
14615
  if (leftOver.length > 0) {
14602
14616
  updatedItems.forEach((item, index) => {
14603
- const ref = trackBy(index, item);
14617
+ const ref = this._items.trackBy(item, index);
14604
14618
  // Look in current selected refs array if item is selected, and update actual value
14605
14619
  const selectedIndex = this.prevSelectionRefs.indexOf(ref);
14606
14620
  if (selectedIndex > -1) {
@@ -14676,9 +14690,8 @@ class Selection {
14676
14690
  return;
14677
14691
  }
14678
14692
  this._currentSingle = value;
14679
- if (this._items.all && this._items.trackBy && value) {
14680
- const lookup = this._items.all.findIndex(maybe => maybe === value);
14681
- this.prevSingleSelectionRef = this._items.trackBy(lookup, value);
14693
+ if (this._items.canTrackBy() && value) {
14694
+ this.prevSingleSelectionRef = this._items.trackBy(value);
14682
14695
  }
14683
14696
  this.emitChange();
14684
14697
  }
@@ -14723,10 +14736,9 @@ class Selection {
14723
14736
  */
14724
14737
  selectItem(item) {
14725
14738
  this.current = this.current.concat(item);
14726
- if (this._items.trackBy && this._items.all) {
14739
+ if (this._items.canTrackBy()) {
14727
14740
  // Push selected ref onto array
14728
- const lookup = this._items.all.findIndex(maybe => maybe === item);
14729
- this.prevSelectionRefs.push(this._items.trackBy(lookup, item));
14741
+ this.prevSelectionRefs.push(this._items.trackBy(item));
14730
14742
  }
14731
14743
  }
14732
14744
  /**
@@ -14734,7 +14746,7 @@ class Selection {
14734
14746
  */
14735
14747
  deselectItem(indexOfItem) {
14736
14748
  this.current = this.current.slice(0, indexOfItem).concat(this.current.slice(indexOfItem + 1));
14737
- if (this._items.trackBy && indexOfItem < this.prevSelectionRefs.length) {
14749
+ if (indexOfItem < this.prevSelectionRefs.length) {
14738
14750
  // Keep selected refs array in sync
14739
14751
  const removedItems = this.prevSelectionRefs.splice(indexOfItem, 1);
14740
14752
  // locked reference is no longer needed (if any)
@@ -14784,21 +14796,16 @@ class Selection {
14784
14796
  }
14785
14797
  /**
14786
14798
  * Make sure that it could be locked
14787
- *
14788
- * @remark
14789
- * Check also is items.all an array, if not there is no nothing to lock or compare to
14790
- *
14791
14799
  */
14792
14800
  canItBeLocked() {
14793
- // We depend on the trackBy and all so there are part of the requirement of is item could be locked
14794
- return this._selectionType !== SelectionType.None && Array.isArray(this._items.all);
14801
+ return this._selectionType !== SelectionType.None && this._items.canTrackBy();
14795
14802
  }
14796
14803
  /**
14797
14804
  * Lock and unlock item
14798
14805
  */
14799
14806
  lockItem(item, lock) {
14800
14807
  if (this.canItBeLocked()) {
14801
- const ref = this._items.trackBy(this._items.all.findIndex(maybe => maybe === item), item);
14808
+ const ref = this._items.trackBy(item);
14802
14809
  if (lock === true) {
14803
14810
  // Add to lockedRef
14804
14811
  this.lockedRefs.push(ref);
@@ -14818,7 +14825,7 @@ class Selection {
14818
14825
  * into the array when there is no need for that.
14819
14826
  */
14820
14827
  if (this.canItBeLocked()) {
14821
- const ref = this._items.trackBy(this._items.all.findIndex(maybe => maybe === item), item);
14828
+ const ref = this._items.trackBy(item);
14822
14829
  return this.lockedRefs.indexOf(ref) > -1;
14823
14830
  }
14824
14831
  return false;
@@ -14943,6 +14950,8 @@ class ClrDatagridRow {
14943
14950
  this.SELECTION_TYPE = SelectionType;
14944
14951
  this.expandAnimationTrigger = false;
14945
14952
  this._selected = false;
14953
+ // By default, every item is selectable; it becomes not selectable only if it's explicitly set to false
14954
+ this._selectable = true;
14946
14955
  this.selectedChanged = new EventEmitter(false);
14947
14956
  this.expandedChange = new EventEmitter(false);
14948
14957
  this._detailOpenLabel = '';
@@ -14969,6 +14978,16 @@ class ClrDatagridRow {
14969
14978
  }
14970
14979
  }));
14971
14980
  }
14981
+ /**
14982
+ * Model of the row, to use for selection
14983
+ */
14984
+ set item(item) {
14985
+ this._item = item;
14986
+ this.clrDgSelectable = this._selectable;
14987
+ }
14988
+ get item() {
14989
+ return this._item;
14990
+ }
14972
14991
  /**
14973
14992
  * The default behavior in Chrome and Firefox for shift-clicking on a label is to perform text-selection.
14974
14993
  * This prevents our intended range-selection, because this text-selection overrides our shift-click event.
@@ -15012,9 +15031,12 @@ class ClrDatagridRow {
15012
15031
  this.selection.setSelected(this.item, value);
15013
15032
  }
15014
15033
  }
15015
- // By default every item is selectable; it becomes not selectable only if it's explicitly set to false
15016
15034
  set clrDgSelectable(value) {
15017
- this.selection.lockItem(this.item, value === false);
15035
+ if (this.item) {
15036
+ this.selection.lockItem(this.item, value === 'false' || value === false);
15037
+ }
15038
+ // Store this value locally, to be initialized when item is initialized
15039
+ this._selectable = value;
15018
15040
  }
15019
15041
  get clrDgSelectable() {
15020
15042
  return !this.selection.isLocked(this.item);
@@ -15590,6 +15612,9 @@ class ClrDatagrid {
15590
15612
  set rowSelectionMode(value) {
15591
15613
  this.selection.rowSelectionMode = value;
15592
15614
  }
15615
+ set trackBy(value) {
15616
+ this.items.datagridTrackBy = value;
15617
+ }
15593
15618
  /**
15594
15619
  * Indicates if all currently displayed items are selected
15595
15620
  */
@@ -15628,9 +15653,9 @@ class ClrDatagrid {
15628
15653
  });
15629
15654
  // Try to update only when there is something cached and its open.
15630
15655
  if (this.detailService.state && this.detailService.isOpen) {
15631
- const row = this.rows.find((row, index) => {
15632
- return this.items.trackBy(index, row.item) === this.items.trackBy(index, this.detailService.state);
15633
- });
15656
+ const row = this.items.canTrackBy()
15657
+ ? this.rows.find(row => this.items.trackBy(row.item) === this.items.trackBy(this.detailService.state))
15658
+ : undefined;
15634
15659
  /**
15635
15660
  * Reopen updated row or close it
15636
15661
  */
@@ -15723,7 +15748,7 @@ class ClrDatagrid {
15723
15748
  }
15724
15749
  }
15725
15750
  ClrDatagrid.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDatagrid, deps: [{ token: DatagridRenderOrganizer }, { token: Items }, { token: ExpandableRowsCount }, { token: Selection }, { token: RowActionService }, { token: StateProvider }, { token: DisplayModeService }, { token: i0.Renderer2 }, { token: DetailService }, { token: DOCUMENT }, { token: i0.ElementRef }, { token: Page }, { token: ClrCommonStringsService }, { token: ColumnsService }, { token: KeyNavigationGridController }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
15726
- ClrDatagrid.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrDatagrid, selector: "clr-datagrid", inputs: { loading: ["clrDgLoading", "loading"], selected: ["clrDgSelected", "selected"], singleSelected: ["clrDgSingleSelected", "singleSelected"], clrDgSingleSelectionAriaLabel: "clrDgSingleSelectionAriaLabel", clrDgSingleActionableAriaLabel: "clrDgSingleActionableAriaLabel", clrDetailExpandableAriaLabel: "clrDetailExpandableAriaLabel", clrDgDisablePageFocus: "clrDgDisablePageFocus", clrDgPreserveSelection: "clrDgPreserveSelection", rowSelectionMode: ["clrDgRowSelection", "rowSelectionMode"] }, outputs: { refresh: "clrDgRefresh", selectedChanged: "clrDgSelectedChange", singleSelectedChanged: "clrDgSingleSelectedChange" }, host: { properties: { "class.datagrid-host": "true", "class.datagrid-detail-open": "detailService.isOpen" } }, providers: [
15751
+ ClrDatagrid.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrDatagrid, selector: "clr-datagrid", inputs: { loading: ["clrDgLoading", "loading"], selected: ["clrDgSelected", "selected"], singleSelected: ["clrDgSingleSelected", "singleSelected"], clrDgSingleSelectionAriaLabel: "clrDgSingleSelectionAriaLabel", clrDgSingleActionableAriaLabel: "clrDgSingleActionableAriaLabel", clrDetailExpandableAriaLabel: "clrDetailExpandableAriaLabel", clrDgDisablePageFocus: "clrDgDisablePageFocus", clrDgPreserveSelection: "clrDgPreserveSelection", rowSelectionMode: ["clrDgRowSelection", "rowSelectionMode"], trackBy: ["clrDgItemsTrackBy", "trackBy"] }, outputs: { refresh: "clrDgRefresh", selectedChanged: "clrDgSelectedChange", singleSelectedChanged: "clrDgSingleSelectedChange" }, host: { properties: { "class.datagrid-host": "true", "class.datagrid-detail-open": "detailService.isOpen" } }, providers: [
15727
15752
  Selection,
15728
15753
  Sort,
15729
15754
  FiltersProvider,
@@ -15799,6 +15824,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
15799
15824
  }], rowSelectionMode: [{
15800
15825
  type: Input,
15801
15826
  args: ['clrDgRowSelection']
15827
+ }], trackBy: [{
15828
+ type: Input,
15829
+ args: ['clrDgItemsTrackBy']
15802
15830
  }], placeholder: [{
15803
15831
  type: ContentChild,
15804
15832
  args: [ClrDatagridPlaceholder]
@@ -16074,6 +16102,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
16074
16102
  }]
16075
16103
  }] });
16076
16104
 
16105
+ /*
16106
+ * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
16107
+ * This software is released under MIT license.
16108
+ * The full license information can be found in LICENSE in the root directory of this project.
16109
+ */
16110
+ const columnToggleTrackByFn = index => index;
16111
+
16077
16112
  /*
16078
16113
  * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
16079
16114
  * This software is released under MIT license.
@@ -16084,8 +16119,18 @@ class ClrDatagridItemsTrackBy {
16084
16119
  this._items = _items;
16085
16120
  }
16086
16121
  set trackBy(value) {
16122
+ /**
16123
+ * This is a workaround to prevent the items `trackBy` function from
16124
+ * being replaced when the "manage columns" button is clicked. This is
16125
+ * not a complete solution. If there is another `ngForTrackBy` function
16126
+ * within the datagrid in application code, it could sill replace the
16127
+ * items `trackBy` function whether it is the row iterator or not.
16128
+ */
16129
+ if (value === columnToggleTrackByFn) {
16130
+ return;
16131
+ }
16087
16132
  if (this._items) {
16088
- this._items.trackBy = value;
16133
+ this._items.iteratorTrackBy = value;
16089
16134
  }
16090
16135
  }
16091
16136
  }
@@ -16123,7 +16168,7 @@ class ClrDatagridColumnToggle {
16123
16168
  };
16124
16169
  // Without tracking the checkboxes get rerendered on model update, which leads
16125
16170
  // to loss of focus after checkbox toggle.
16126
- this.trackByFn = index => index;
16171
+ this.trackByFn = columnToggleTrackByFn;
16127
16172
  this.subscription = popoverToggleService.openChange.subscribe(change => (this.openState = change));
16128
16173
  }
16129
16174
  get allColumnsVisible() {