@trudb/tru-common-lib 0.1.973 → 0.1.974
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.
|
@@ -5946,10 +5946,10 @@ class TruDataGridHeader {
|
|
|
5946
5946
|
this.params.column.getColDef().headerComponentParams = this.params;
|
|
5947
5947
|
this.params.showColumnMenu(event.target, () => {
|
|
5948
5948
|
this.columnMenuIsOpen = false;
|
|
5949
|
-
this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
|
|
5950
5949
|
this.filterIsActive = this.params.column.isFilterActive();
|
|
5951
5950
|
this.ascSort = this.params.column.isSortAscending();
|
|
5952
5951
|
this.descSort = this.params.column.isSortDescending();
|
|
5952
|
+
this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
|
|
5953
5953
|
});
|
|
5954
5954
|
this.columnMenuIsOpen = true;
|
|
5955
5955
|
}
|
|
@@ -6154,78 +6154,115 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImpor
|
|
|
6154
6154
|
}], ctorParameters: () => [] });
|
|
6155
6155
|
|
|
6156
6156
|
class TruDataGridRefHeader {
|
|
6157
|
+
headerRef;
|
|
6157
6158
|
params;
|
|
6158
|
-
ascSort =
|
|
6159
|
-
descSort =
|
|
6160
|
-
|
|
6159
|
+
ascSort = false;
|
|
6160
|
+
descSort = false;
|
|
6161
|
+
isHovering = false;
|
|
6162
|
+
columnMenuIsOpen = false;
|
|
6163
|
+
showFilterMenu = false;
|
|
6164
|
+
filterIsActive = false;
|
|
6161
6165
|
agInit(params) {
|
|
6162
6166
|
this.params = params;
|
|
6163
|
-
this.params.
|
|
6164
|
-
|
|
6167
|
+
this.params.api.addEventListener('cellFocused', this.onCellFocused.bind(this));
|
|
6168
|
+
}
|
|
6169
|
+
getHeaderParams() {
|
|
6170
|
+
return this.params;
|
|
6165
6171
|
}
|
|
6166
6172
|
refresh(params) {
|
|
6167
6173
|
return false;
|
|
6168
6174
|
}
|
|
6169
|
-
|
|
6170
|
-
this.
|
|
6171
|
-
|
|
6172
|
-
|
|
6175
|
+
onSelectAllIconClicked() {
|
|
6176
|
+
this.params.api.selectAll();
|
|
6177
|
+
}
|
|
6178
|
+
onCellFocused(event) {
|
|
6179
|
+
var column = event.column;
|
|
6180
|
+
if (column?.getColDef().pinned) {
|
|
6181
|
+
this.headerRef.nativeElement.classList.add('ag-column-focus');
|
|
6173
6182
|
}
|
|
6174
|
-
else
|
|
6175
|
-
this.
|
|
6183
|
+
else {
|
|
6184
|
+
if (this.params.column.getColId() === column.getColId()) {
|
|
6185
|
+
this.headerRef.nativeElement.classList.add('ag-column-focus');
|
|
6186
|
+
}
|
|
6187
|
+
else {
|
|
6188
|
+
this.headerRef.nativeElement.classList.remove('ag-column-focus');
|
|
6189
|
+
}
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6192
|
+
onFilterMenuButtonClicked(event) {
|
|
6193
|
+
if (!this.columnMenuIsOpen) {
|
|
6194
|
+
this.params.column.getColDef().headerComponentParams = this.params;
|
|
6195
|
+
this.params.showColumnMenu(event.target, () => {
|
|
6196
|
+
this.columnMenuIsOpen = false;
|
|
6197
|
+
this.filterIsActive = this.params.column.isFilterActive();
|
|
6198
|
+
this.ascSort = this.params.column.isSortAscending();
|
|
6199
|
+
this.descSort = this.params.column.isSortDescending();
|
|
6200
|
+
this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
|
|
6201
|
+
});
|
|
6202
|
+
this.columnMenuIsOpen = true;
|
|
6176
6203
|
}
|
|
6177
6204
|
else {
|
|
6178
|
-
this.
|
|
6205
|
+
this.params.api.hidePopupMenu();
|
|
6206
|
+
this.columnMenuIsOpen = false;
|
|
6179
6207
|
}
|
|
6180
6208
|
}
|
|
6181
|
-
|
|
6182
|
-
this.
|
|
6209
|
+
onHeaderMouseEnter(event) {
|
|
6210
|
+
this.isHovering = true;
|
|
6211
|
+
this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
|
|
6212
|
+
this.filterIsActive = this.params.column.isFilterActive();
|
|
6183
6213
|
}
|
|
6184
|
-
|
|
6185
|
-
this.
|
|
6214
|
+
onHeaderMouseLeave(event) {
|
|
6215
|
+
this.isHovering = false;
|
|
6216
|
+
this.showFilterMenu = this.isHovering && this.params.api.getDisplayedRowCount() > 0 || this.columnMenuIsOpen || this.params.column.isFilterActive() || this.ascSort || this.descSort;
|
|
6217
|
+
this.filterIsActive = this.params.column.isFilterActive();
|
|
6186
6218
|
}
|
|
6187
6219
|
ngOnDestroy() {
|
|
6188
|
-
this.params.
|
|
6220
|
+
this.params.api.removeEventListener('cellFocused', this.onCellFocused.bind(this));
|
|
6189
6221
|
}
|
|
6190
6222
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridRefHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6191
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridRefHeader, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
|
|
6223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.3", type: TruDataGridRefHeader, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "headerRef", first: true, predicate: ["header"], descendants: true }], ngImport: i0, template: `
|
|
6192
6224
|
<div #header class="ag-cell-label-container" role="presentation">
|
|
6193
|
-
<div ref="eLabel" class="ag-header-cell-label" role="presentation">
|
|
6225
|
+
<div ref="eLabel" class="ag-header-cell-label" role="presentation" (mouseenter)="onHeaderMouseEnter($event)" (mouseleave)="onHeaderMouseLeave($event)">
|
|
6194
6226
|
<span ref="eText" class="ag-header-cell-text">{{params.displayName}}</span>
|
|
6195
|
-
<
|
|
6196
|
-
<
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6227
|
+
<div class="ag-header-control-filter-container" *ngIf="showFilterMenu">
|
|
6228
|
+
<span ref="eFilterButton" class="ag-filter-icon" (click)="onFilterMenuButtonClicked($event)">
|
|
6229
|
+
<mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive && !ascSort && !descSort"></mat-icon>
|
|
6230
|
+
<mat-icon class="ag-header-asc" [svgIcon]="'asc-sort-icon'" [ngClass]="{'filtering': filterIsActive}" *ngIf="ascSort"></mat-icon>
|
|
6231
|
+
<mat-icon class="ag-header-desc" [svgIcon]="'desc-sort-icon'" [ngClass]="{'filtering': filterIsActive}" *ngIf="descSort"></mat-icon>
|
|
6232
|
+
<mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive"></mat-icon>
|
|
6233
|
+
</span>
|
|
6234
|
+
</div>
|
|
6202
6235
|
</div>
|
|
6203
6236
|
<mat-icon [svgIcon]="'select-all-icon'"
|
|
6204
6237
|
(click)="onSelectAllIconClicked()"
|
|
6205
6238
|
class="tru-data-grid-select-all-icon"
|
|
6206
6239
|
title="Select All (Ctrl+A)"></mat-icon>
|
|
6207
|
-
</div>`, isInline: true, styles: [".ag-sort-icon{height:100%;width:100
|
|
6240
|
+
</div>`, isInline: true, styles: [".ag-header-control-container{display:flex}.ag-header-control-filter-container{position:absolute;top:1px;right:3px;width:20px;height:20px;display:table}.ag-header-cell-text{position:relative;pointer-events:none;vertical-align:middle;vertical-align:-webkit-baseline-middle}.ag-sort-icon{height:100%;width:100%;margin-left:0!important}.ag-sort-icon mat-icon{height:16px;width:16px;padding-top:4px}.ag-column-focus .ag-header-cell-text{color:#3f51b5;font-weight:700}.ag-column-focus{background-color:#ddd;border-bottom:1px solid #3f51b5}::ng-deep .ag-header-control-filter-container mat-icon{height:20px!important;width:20px!important;padding-top:2px!important}::ng-deep .ag-filter-icon .ag-header-asc.filtering{position:relative;right:-7px}::ng-deep .ag-filter-icon .ag-header-desc.filtering{position:relative;right:-7px}::ng-deep .ag-filter-icon mat-icon{height:18px!important;width:18px!important;color:#ddd}::ng-deep .ag-filter-icon mat-icon svg{fill:#949494!important}.tru-data-grid-select-all-icon{width:16px;font-size:28px;color:#ddd;float:right;position:absolute;top:-1px;right:4px}::ng-deep .tru-data-grid-select-all-icon path{fill:#d3d3d3;position:relative;z-index:100;pointer-events:all}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
6208
6241
|
}
|
|
6209
6242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.3", ngImport: i0, type: TruDataGridRefHeader, decorators: [{
|
|
6210
6243
|
type: Component,
|
|
6211
|
-
args: [{ standalone: true, imports: [NgIf, NgClass, MatIconModule], template: `
|
|
6244
|
+
args: [{ standalone: true, imports: [NgIf, NgClass, CommonModule, MatIconModule], template: `
|
|
6212
6245
|
<div #header class="ag-cell-label-container" role="presentation">
|
|
6213
|
-
<div ref="eLabel" class="ag-header-cell-label" role="presentation">
|
|
6246
|
+
<div ref="eLabel" class="ag-header-cell-label" role="presentation" (mouseenter)="onHeaderMouseEnter($event)" (mouseleave)="onHeaderMouseLeave($event)">
|
|
6214
6247
|
<span ref="eText" class="ag-header-cell-text">{{params.displayName}}</span>
|
|
6215
|
-
<
|
|
6216
|
-
<
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6248
|
+
<div class="ag-header-control-filter-container" *ngIf="showFilterMenu">
|
|
6249
|
+
<span ref="eFilterButton" class="ag-filter-icon" (click)="onFilterMenuButtonClicked($event)">
|
|
6250
|
+
<mat-icon class="ag-header-more" [svgIcon]="'more-icon'" *ngIf="!filterIsActive && !ascSort && !descSort"></mat-icon>
|
|
6251
|
+
<mat-icon class="ag-header-asc" [svgIcon]="'asc-sort-icon'" [ngClass]="{'filtering': filterIsActive}" *ngIf="ascSort"></mat-icon>
|
|
6252
|
+
<mat-icon class="ag-header-desc" [svgIcon]="'desc-sort-icon'" [ngClass]="{'filtering': filterIsActive}" *ngIf="descSort"></mat-icon>
|
|
6253
|
+
<mat-icon class="ag-header-filter" [svgIcon]="'filter-icon'" *ngIf="filterIsActive"></mat-icon>
|
|
6254
|
+
</span>
|
|
6255
|
+
</div>
|
|
6222
6256
|
</div>
|
|
6223
6257
|
<mat-icon [svgIcon]="'select-all-icon'"
|
|
6224
6258
|
(click)="onSelectAllIconClicked()"
|
|
6225
6259
|
class="tru-data-grid-select-all-icon"
|
|
6226
6260
|
title="Select All (Ctrl+A)"></mat-icon>
|
|
6227
|
-
</div>`, styles: [".ag-sort-icon{height:100%;width:100
|
|
6228
|
-
}]
|
|
6261
|
+
</div>`, styles: [".ag-header-control-container{display:flex}.ag-header-control-filter-container{position:absolute;top:1px;right:3px;width:20px;height:20px;display:table}.ag-header-cell-text{position:relative;pointer-events:none;vertical-align:middle;vertical-align:-webkit-baseline-middle}.ag-sort-icon{height:100%;width:100%;margin-left:0!important}.ag-sort-icon mat-icon{height:16px;width:16px;padding-top:4px}.ag-column-focus .ag-header-cell-text{color:#3f51b5;font-weight:700}.ag-column-focus{background-color:#ddd;border-bottom:1px solid #3f51b5}::ng-deep .ag-header-control-filter-container mat-icon{height:20px!important;width:20px!important;padding-top:2px!important}::ng-deep .ag-filter-icon .ag-header-asc.filtering{position:relative;right:-7px}::ng-deep .ag-filter-icon .ag-header-desc.filtering{position:relative;right:-7px}::ng-deep .ag-filter-icon mat-icon{height:18px!important;width:18px!important;color:#ddd}::ng-deep .ag-filter-icon mat-icon svg{fill:#949494!important}.tru-data-grid-select-all-icon{width:16px;font-size:28px;color:#ddd;float:right;position:absolute;top:-1px;right:4px}::ng-deep .tru-data-grid-select-all-icon path{fill:#d3d3d3;position:relative;z-index:100;pointer-events:all}\n"] }]
|
|
6262
|
+
}], propDecorators: { headerRef: [{
|
|
6263
|
+
type: ViewChild,
|
|
6264
|
+
args: ['header', { static: false }]
|
|
6265
|
+
}] } });
|
|
6229
6266
|
|
|
6230
6267
|
class TruDataGridUtil {
|
|
6231
6268
|
getColumnIndexByColId = (api, colId) => {
|