@clr/angular 16.5.3 → 16.5.4

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.
@@ -13366,6 +13366,19 @@ var ClrDatagridSortOrder;
13366
13366
  ClrDatagridSortOrder[ClrDatagridSortOrder["DESC"] = -1] = "DESC";
13367
13367
  })(ClrDatagridSortOrder || (ClrDatagridSortOrder = {}));
13368
13368
 
13369
+ /*
13370
+ * Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
13371
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
13372
+ * This software is released under MIT license.
13373
+ * The full license information can be found in LICENSE in the root directory of this project.
13374
+ */
13375
+ // @TODO The top two are not used now, which is probably a performance drag that was broken along the way.
13376
+ // There was a previous pattern to hide everything to do computation then display, for Firefox, needs revisiting.
13377
+ const NO_LAYOUT_CLASS = 'datagrid-no-layout';
13378
+ const COMPUTE_WIDTH_CLASS = 'datagrid-computing-columns-width';
13379
+ const STRICT_WIDTH_CLASS = 'datagrid-fixed-width';
13380
+ const HIDDEN_COLUMN_CLASS = 'datagrid-hidden-column';
13381
+
13369
13382
  /*
13370
13383
  * Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
13371
13384
  * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
@@ -13800,15 +13813,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
13800
13813
  * The full license information can be found in LICENSE in the root directory of this project.
13801
13814
  */
13802
13815
  class ClrDatagridColumn extends DatagridFilterRegistrar {
13803
- constructor(_sort, filters, vcr, detailService, changeDetectorRef) {
13816
+ constructor(el, _sort, filters, vcr, detailService, changeDetectorRef) {
13804
13817
  super(filters);
13818
+ this.el = el;
13805
13819
  this._sort = _sort;
13806
13820
  this.vcr = vcr;
13807
13821
  this.detailService = detailService;
13808
13822
  this.changeDetectorRef = changeDetectorRef;
13809
13823
  this.sortOrderChange = new EventEmitter();
13810
13824
  this.filterValueChange = new EventEmitter();
13811
- this.showSeparator = true;
13812
13825
  /**
13813
13826
  * A custom filter for this column that can be provided in the projected content
13814
13827
  */
@@ -13827,9 +13840,20 @@ class ClrDatagridColumn extends DatagridFilterRegistrar {
13827
13840
  * Subscription to the sort service changes
13828
13841
  */
13829
13842
  this.subscriptions = [];
13843
+ this._showSeparator = true;
13830
13844
  this.subscriptions.push(this.listenForSortingChanges());
13831
13845
  this.subscriptions.push(this.listenForDetailPaneChanges());
13832
13846
  }
13847
+ get isHidden() {
13848
+ return this.el.nativeElement.classList.contains(HIDDEN_COLUMN_CLASS);
13849
+ }
13850
+ get showSeparator() {
13851
+ return this._showSeparator;
13852
+ }
13853
+ set showSeparator(value) {
13854
+ this._showSeparator = value;
13855
+ this.changeDetectorRef.markForCheck();
13856
+ }
13833
13857
  // TODO: We might want to make this an enum in the future
13834
13858
  get colType() {
13835
13859
  return this._colType;
@@ -14005,8 +14029,6 @@ class ClrDatagridColumn extends DatagridFilterRegistrar {
14005
14029
  return this.detailService.stateChange.subscribe(state => {
14006
14030
  if (this.showSeparator !== !state) {
14007
14031
  this.showSeparator = !state;
14008
- // Have to manually change because of OnPush
14009
- this.changeDetectorRef.markForCheck();
14010
14032
  }
14011
14033
  });
14012
14034
  }
@@ -14039,7 +14061,7 @@ class ClrDatagridColumn extends DatagridFilterRegistrar {
14039
14061
  }
14040
14062
  }
14041
14063
  }
14042
- ClrDatagridColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridColumn, deps: [{ token: Sort }, { token: FiltersProvider }, { token: i0.ViewContainerRef }, { token: DetailService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
14064
+ ClrDatagridColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridColumn, deps: [{ token: i0.ElementRef }, { token: Sort }, { token: FiltersProvider }, { token: i0.ViewContainerRef }, { token: DetailService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
14043
14065
  ClrDatagridColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridColumn, selector: "clr-dg-column", inputs: { filterStringPlaceholder: ["clrFilterStringPlaceholder", "filterStringPlaceholder"], filterNumberMaxPlaceholder: ["clrFilterNumberMaxPlaceholder", "filterNumberMaxPlaceholder"], filterNumberMinPlaceholder: ["clrFilterNumberMinPlaceholder", "filterNumberMinPlaceholder"], colType: ["clrDgColType", "colType"], field: ["clrDgField", "field"], sortBy: ["clrDgSortBy", "sortBy"], sortOrder: ["clrDgSortOrder", "sortOrder"], updateFilterValue: ["clrFilterValue", "updateFilterValue"] }, outputs: { sortOrderChange: "clrDgSortOrderChange", filterValueChange: "clrFilterValueChange" }, host: { attributes: { "role": "columnheader" }, properties: { "class.datagrid-column": "true", "attr.aria-sort": "ariaSort" } }, queries: [{ propertyName: "projectedFilter", first: true, predicate: CustomFilter, descendants: true }], usesInheritance: true, usesOnChanges: true, hostDirectives: [{ directive: ClrPopoverHostDirective }], ngImport: i0, template: `
14044
14066
  <div class="datagrid-column-flex">
14045
14067
  <button class="datagrid-column-title" *ngIf="sortable" (click)="sort()" type="button">
@@ -14134,7 +14156,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
14134
14156
  },
14135
14157
  changeDetection: ChangeDetectionStrategy.OnPush,
14136
14158
  }]
14137
- }], ctorParameters: function () { return [{ type: Sort }, { type: FiltersProvider }, { type: i0.ViewContainerRef }, { type: DetailService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { filterStringPlaceholder: [{
14159
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: Sort }, { type: FiltersProvider }, { type: i0.ViewContainerRef }, { type: DetailService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { filterStringPlaceholder: [{
14138
14160
  type: Input,
14139
14161
  args: ['clrFilterStringPlaceholder']
14140
14162
  }], filterNumberMaxPlaceholder: [{
@@ -15735,19 +15757,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
15735
15757
  type: Injectable
15736
15758
  }], ctorParameters: function () { return [{ type: FiltersProvider }, { type: Sort }, { type: Page }, { type: StateDebouncer }]; } });
15737
15759
 
15738
- /*
15739
- * Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
15740
- * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
15741
- * This software is released under MIT license.
15742
- * The full license information can be found in LICENSE in the root directory of this project.
15743
- */
15744
- // @TODO The top two are not used now, which is probably a performance drag that was broken along the way.
15745
- // There was a previous pattern to hide everything to do computation then display, for Firefox, needs revisiting.
15746
- const NO_LAYOUT_CLASS = 'datagrid-no-layout';
15747
- const COMPUTE_WIDTH_CLASS = 'datagrid-computing-columns-width';
15748
- const STRICT_WIDTH_CLASS = 'datagrid-fixed-width';
15749
- const HIDDEN_COLUMN_CLASS = 'datagrid-hidden-column';
15750
-
15751
15760
  /*
15752
15761
  * Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
15753
15762
  * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
@@ -15848,7 +15857,7 @@ class DatagridRowRenderer {
15848
15857
  }
15849
15858
  }
15850
15859
  DatagridRowRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: DatagridRowRenderer, deps: [{ token: ColumnsService }], target: i0.ɵɵFactoryTarget.Directive });
15851
- DatagridRowRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: DatagridRowRenderer, selector: "clr-dg-row, clr-dg-row-detail", queries: [{ propertyName: "cells", predicate: DatagridCellRenderer }], ngImport: i0 });
15860
+ DatagridRowRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: DatagridRowRenderer, selector: "clr-dg-row, clr-dg-row-detail", queries: [{ propertyName: "expandableRow", first: true, predicate: i0.forwardRef(function () { return DatagridRowRenderer; }), descendants: true }, { propertyName: "cells", predicate: DatagridCellRenderer }], ngImport: i0 });
15852
15861
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: DatagridRowRenderer, decorators: [{
15853
15862
  type: Directive,
15854
15863
  args: [{
@@ -15857,6 +15866,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
15857
15866
  }], ctorParameters: function () { return [{ type: ColumnsService }]; }, propDecorators: { cells: [{
15858
15867
  type: ContentChildren,
15859
15868
  args: [DatagridCellRenderer]
15869
+ }], expandableRow: [{
15870
+ type: ContentChild,
15871
+ args: [forwardRef(() => DatagridRowRenderer)]
15860
15872
  }] } });
15861
15873
 
15862
15874
  /*
@@ -18201,6 +18213,7 @@ class DatagridMainRenderer {
18201
18213
  this.rows.forEach(row => {
18202
18214
  if (row?.cells.length === this.columnsService.columns.length) {
18203
18215
  row.cells.get(columnIndex).setWidth(state);
18216
+ row.expandableRow?.cells.get(columnIndex)?.setWidth(state);
18204
18217
  }
18205
18218
  });
18206
18219
  break;
@@ -18209,8 +18222,10 @@ class DatagridMainRenderer {
18209
18222
  this.rows.forEach(row => {
18210
18223
  if (row.cells && row.cells.length) {
18211
18224
  row.cells.get(columnIndex).setHidden(state);
18225
+ row.expandableRow?.cells.get(columnIndex)?.setHidden(state);
18212
18226
  }
18213
18227
  });
18228
+ this.updateColumnSeparatorsVisibility();
18214
18229
  this.keyNavigation.resetKeyGrid();
18215
18230
  break;
18216
18231
  case DatagridColumnChanges.INITIALIZE:
@@ -18218,6 +18233,7 @@ class DatagridMainRenderer {
18218
18233
  this.headers.get(columnIndex).setHidden(state);
18219
18234
  this.rows.forEach(row => {
18220
18235
  row.setCellsState();
18236
+ row.expandableRow?.setCellsState();
18221
18237
  });
18222
18238
  }
18223
18239
  break;
@@ -18252,9 +18268,20 @@ class DatagridMainRenderer {
18252
18268
  return false;
18253
18269
  }
18254
18270
  }
18271
+ updateColumnSeparatorsVisibility() {
18272
+ const visibleColumns = this.datagrid.columns.filter(column => !column.isHidden);
18273
+ visibleColumns.forEach((column, index) => {
18274
+ if (index === visibleColumns.length - 1) {
18275
+ column.showSeparator = false;
18276
+ }
18277
+ else if (!column.showSeparator) {
18278
+ column.showSeparator = true;
18279
+ }
18280
+ });
18281
+ }
18255
18282
  }
18256
18283
  DatagridMainRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: DatagridMainRenderer, deps: [{ token: ClrDatagrid }, { token: DatagridRenderOrganizer }, { token: Items }, { token: Page }, { token: DomAdapter }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: DetailService }, { token: TableSizeService }, { token: ColumnsService }, { token: i0.NgZone }, { token: KeyNavigationGridController }], target: i0.ɵɵFactoryTarget.Directive });
18257
- DatagridMainRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: DatagridMainRenderer, selector: "clr-datagrid", providers: [{ provide: DomAdapter, useFactory: domAdapterFactory, deps: [PLATFORM_ID] }], queries: [{ propertyName: "headers", predicate: DatagridHeaderRenderer }, { propertyName: "rows", predicate: DatagridRowRenderer, descendants: true }], ngImport: i0 });
18284
+ DatagridMainRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: DatagridMainRenderer, selector: "clr-datagrid", providers: [{ provide: DomAdapter, useFactory: domAdapterFactory, deps: [PLATFORM_ID] }], queries: [{ propertyName: "headers", predicate: DatagridHeaderRenderer }, { propertyName: "rows", predicate: DatagridRowRenderer }], ngImport: i0 });
18258
18285
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: DatagridMainRenderer, decorators: [{
18259
18286
  type: Directive,
18260
18287
  args: [{
@@ -18266,7 +18293,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
18266
18293
  args: [DatagridHeaderRenderer]
18267
18294
  }], rows: [{
18268
18295
  type: ContentChildren,
18269
- args: [DatagridRowRenderer, { descendants: true }]
18296
+ args: [DatagridRowRenderer]
18270
18297
  }] } });
18271
18298
 
18272
18299
  /*