@clr/angular 17.2.0 → 17.2.1
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.
- package/clarity.api.md +26 -6
- package/data/datagrid/datagrid-detail-header.d.ts +4 -1
- package/data/datagrid/datagrid-detail.d.ts +5 -1
- package/data/datagrid/datagrid-filter.d.ts +4 -2
- package/data/datagrid/datagrid-if-detail.d.ts +9 -0
- package/data/datagrid/datagrid-virtual-scroll.directive.d.ts +5 -2
- package/data/datagrid/datagrid.d.ts +1 -0
- package/data/datagrid/enums/column-changes.enum.d.ts +2 -1
- package/data/datagrid/providers/columns.service.d.ts +1 -0
- package/data/datagrid/providers/detail.service.d.ts +3 -0
- package/data/datagrid/render/main-renderer.d.ts +1 -1
- package/data/datagrid/utils/key-navigation-grid.controller.d.ts +1 -0
- package/esm2020/data/datagrid/datagrid-action-overflow.mjs +3 -1
- package/esm2020/data/datagrid/datagrid-detail-header.mjs +12 -6
- package/esm2020/data/datagrid/datagrid-detail.mjs +36 -8
- package/esm2020/data/datagrid/datagrid-filter.mjs +22 -13
- package/esm2020/data/datagrid/datagrid-if-detail.mjs +30 -7
- package/esm2020/data/datagrid/datagrid-row.mjs +3 -3
- package/esm2020/data/datagrid/datagrid-virtual-scroll.directive.mjs +13 -5
- package/esm2020/data/datagrid/datagrid.mjs +17 -6
- package/esm2020/data/datagrid/enums/column-changes.enum.mjs +3 -2
- package/esm2020/data/datagrid/providers/columns.service.mjs +9 -3
- package/esm2020/data/datagrid/providers/detail.service.mjs +10 -5
- package/esm2020/data/datagrid/render/cell-renderer.mjs +1 -3
- package/esm2020/data/datagrid/render/main-renderer.mjs +21 -16
- package/esm2020/data/datagrid/utils/key-navigation-grid.controller.mjs +6 -3
- package/esm2020/forms/common/abstract-container.mjs +5 -2
- package/esm2020/timeline/timeline-step.mjs +3 -3
- package/esm2020/timeline/timeline.mjs +3 -3
- package/esm2020/utils/i18n/common-strings.default.mjs +2 -2
- package/fesm2015/clr-angular.mjs +354 -246
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +348 -241
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
package/fesm2020/clr-angular.mjs
CHANGED
|
@@ -325,7 +325,7 @@ const commonStringsDefault = {
|
|
|
325
325
|
singleSelectionAriaLabel: 'Single selection header',
|
|
326
326
|
singleActionableAriaLabel: 'Single actionable header',
|
|
327
327
|
detailExpandableAriaLabel: 'Toggle more row content',
|
|
328
|
-
datagridFilterAriaLabel: '
|
|
328
|
+
datagridFilterAriaLabel: '{COLUMN} filter',
|
|
329
329
|
datagridFilterDialogAriaLabel: 'Filter dialog',
|
|
330
330
|
columnSeparatorAriaLabel: 'Column resize handle',
|
|
331
331
|
columnSeparatorDescription: 'Use left or right key to resize the column',
|
|
@@ -4755,7 +4755,10 @@ class ClrAbstractContainer {
|
|
|
4755
4755
|
this.subscriptions = [];
|
|
4756
4756
|
this.subscriptions.push(this.ifControlStateService.statusChanges.subscribe((state) => {
|
|
4757
4757
|
this.state = state;
|
|
4758
|
-
|
|
4758
|
+
// Make sure everything is updated before dispatching the values for helpers
|
|
4759
|
+
setTimeout(() => {
|
|
4760
|
+
this.updateHelpers();
|
|
4761
|
+
});
|
|
4759
4762
|
}));
|
|
4760
4763
|
this.subscriptions.push(this.ngControlService.controlChanges.subscribe(control => {
|
|
4761
4764
|
this.control = control;
|
|
@@ -12093,6 +12096,191 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12093
12096
|
type: Directive
|
|
12094
12097
|
}], ctorParameters: function () { return [{ type: FiltersProvider }]; } });
|
|
12095
12098
|
|
|
12099
|
+
/*
|
|
12100
|
+
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12101
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
12102
|
+
* This software is released under MIT license.
|
|
12103
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
12104
|
+
*/
|
|
12105
|
+
function getTabableItems(el) {
|
|
12106
|
+
const tabableSelector = [
|
|
12107
|
+
'a[href]',
|
|
12108
|
+
'area[href]',
|
|
12109
|
+
'input:not([disabled])',
|
|
12110
|
+
'button:not([disabled])',
|
|
12111
|
+
'select:not([disabled])',
|
|
12112
|
+
'textarea:not([disabled])',
|
|
12113
|
+
'iframe',
|
|
12114
|
+
'object',
|
|
12115
|
+
'embed',
|
|
12116
|
+
'*[tabindex]',
|
|
12117
|
+
'*[contenteditable=true]',
|
|
12118
|
+
'[role=button]:not([disabled])',
|
|
12119
|
+
].join(',');
|
|
12120
|
+
return Array.from(el.querySelectorAll(tabableSelector));
|
|
12121
|
+
}
|
|
12122
|
+
class KeyNavigationGridController {
|
|
12123
|
+
constructor(zone) {
|
|
12124
|
+
this.zone = zone;
|
|
12125
|
+
this.skipItemFocus = false;
|
|
12126
|
+
this.listenersAdded = false;
|
|
12127
|
+
this.destroy$ = new Subject();
|
|
12128
|
+
this._activeCell = null;
|
|
12129
|
+
this.config = {
|
|
12130
|
+
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
12131
|
+
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
12132
|
+
keyGrid: '[role=grid]',
|
|
12133
|
+
};
|
|
12134
|
+
}
|
|
12135
|
+
get grid() {
|
|
12136
|
+
return this.host?.querySelector(this.config.keyGrid);
|
|
12137
|
+
}
|
|
12138
|
+
get rows() {
|
|
12139
|
+
return this.host?.querySelectorAll(this.config.keyGridRows);
|
|
12140
|
+
}
|
|
12141
|
+
get cells() {
|
|
12142
|
+
return this.host?.querySelectorAll(this.config.keyGridCells);
|
|
12143
|
+
}
|
|
12144
|
+
ngOnDestroy() {
|
|
12145
|
+
this.destroy$.next();
|
|
12146
|
+
this.destroy$.complete();
|
|
12147
|
+
}
|
|
12148
|
+
addListeners() {
|
|
12149
|
+
if (this.listenersAdded) {
|
|
12150
|
+
return;
|
|
12151
|
+
}
|
|
12152
|
+
this.zone.runOutsideAngular(() => {
|
|
12153
|
+
fromEvent(this.grid, 'mousedown')
|
|
12154
|
+
.pipe(takeUntil(this.destroy$))
|
|
12155
|
+
.subscribe((e) => {
|
|
12156
|
+
// preserve right click for context menus & keyboard mouse control https://apple.stackexchange.com/questions/32715/how-do-i-open-the-context-menu-from-a-mac-keyboard
|
|
12157
|
+
if (e.buttons === 1 && !e.ctrlKey) {
|
|
12158
|
+
const activeCell = this.cells
|
|
12159
|
+
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
12160
|
+
: null;
|
|
12161
|
+
if (activeCell) {
|
|
12162
|
+
this.setActiveCell(activeCell);
|
|
12163
|
+
}
|
|
12164
|
+
}
|
|
12165
|
+
});
|
|
12166
|
+
fromEvent(this.grid, 'wheel')
|
|
12167
|
+
.pipe(takeUntil(this.destroy$))
|
|
12168
|
+
.subscribe(() => {
|
|
12169
|
+
this.removeActiveCell();
|
|
12170
|
+
});
|
|
12171
|
+
fromEvent(this.grid, 'keydown')
|
|
12172
|
+
.pipe(takeUntil(this.destroy$))
|
|
12173
|
+
.subscribe((e) => {
|
|
12174
|
+
// Skip column resize events
|
|
12175
|
+
if (e.target.classList.contains('drag-handle') &&
|
|
12176
|
+
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
12177
|
+
return;
|
|
12178
|
+
}
|
|
12179
|
+
if (e.code === 'ArrowUp' ||
|
|
12180
|
+
e.code === 'ArrowDown' ||
|
|
12181
|
+
e.code === 'ArrowLeft' ||
|
|
12182
|
+
e.code === 'ArrowRight' ||
|
|
12183
|
+
e.code === 'End' ||
|
|
12184
|
+
e.code === 'Home' ||
|
|
12185
|
+
e.code === 'PageUp' ||
|
|
12186
|
+
e.code === 'PageDown') {
|
|
12187
|
+
const { x, y } = this.getNextItemCoordinate(e);
|
|
12188
|
+
const activeItem = this.rows
|
|
12189
|
+
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
12190
|
+
: null;
|
|
12191
|
+
if (activeItem) {
|
|
12192
|
+
this.setActiveCell(activeItem);
|
|
12193
|
+
}
|
|
12194
|
+
e.preventDefault();
|
|
12195
|
+
}
|
|
12196
|
+
});
|
|
12197
|
+
});
|
|
12198
|
+
this.listenersAdded = true;
|
|
12199
|
+
}
|
|
12200
|
+
initializeKeyGrid(host) {
|
|
12201
|
+
this.host = host;
|
|
12202
|
+
this.addListeners();
|
|
12203
|
+
this.resetKeyGrid();
|
|
12204
|
+
}
|
|
12205
|
+
resetKeyGrid() {
|
|
12206
|
+
this.cells?.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
12207
|
+
const firstCell = this.cells ? this.cells[0] : null;
|
|
12208
|
+
firstCell?.setAttribute('tabindex', '0');
|
|
12209
|
+
}
|
|
12210
|
+
removeActiveCell() {
|
|
12211
|
+
this._activeCell = null;
|
|
12212
|
+
}
|
|
12213
|
+
getActiveCell() {
|
|
12214
|
+
return this._activeCell;
|
|
12215
|
+
}
|
|
12216
|
+
setActiveCell(activeCell) {
|
|
12217
|
+
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
12218
|
+
if (prior) {
|
|
12219
|
+
prior.setAttribute('tabindex', '-1');
|
|
12220
|
+
}
|
|
12221
|
+
activeCell.setAttribute('tabindex', '0');
|
|
12222
|
+
this._activeCell = activeCell;
|
|
12223
|
+
const items = getTabableItems(activeCell);
|
|
12224
|
+
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
12225
|
+
if (!this.skipItemFocus) {
|
|
12226
|
+
item.focus();
|
|
12227
|
+
}
|
|
12228
|
+
}
|
|
12229
|
+
getNextItemCoordinate(e) {
|
|
12230
|
+
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
12231
|
+
if (e.code === 'Tab') {
|
|
12232
|
+
currentCell = document.activeElement;
|
|
12233
|
+
}
|
|
12234
|
+
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
12235
|
+
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
12236
|
+
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
12237
|
+
let x = currentRow && currentCell
|
|
12238
|
+
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
12239
|
+
: 0;
|
|
12240
|
+
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
12241
|
+
const dir = this.host.dir;
|
|
12242
|
+
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
12243
|
+
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
12244
|
+
const itemsPerPage = Math.floor(this.host?.querySelector('.datagrid').clientHeight / this.rows[0].clientHeight) - 1 || 0;
|
|
12245
|
+
if (e.code === 'ArrowUp' && y !== 0) {
|
|
12246
|
+
y = y - 1;
|
|
12247
|
+
}
|
|
12248
|
+
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
12249
|
+
y = y + 1;
|
|
12250
|
+
}
|
|
12251
|
+
else if (e.code === inlineStart && x !== 0) {
|
|
12252
|
+
x = x - 1;
|
|
12253
|
+
}
|
|
12254
|
+
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
12255
|
+
x = x + 1;
|
|
12256
|
+
}
|
|
12257
|
+
else if (e.code === 'End') {
|
|
12258
|
+
x = numOfColumns;
|
|
12259
|
+
if (e.ctrlKey) {
|
|
12260
|
+
y = numOfRows;
|
|
12261
|
+
}
|
|
12262
|
+
}
|
|
12263
|
+
else if (e.code === 'Home') {
|
|
12264
|
+
x = 0;
|
|
12265
|
+
if (e.ctrlKey) {
|
|
12266
|
+
y = 0;
|
|
12267
|
+
}
|
|
12268
|
+
}
|
|
12269
|
+
else if (e.code === 'PageUp') {
|
|
12270
|
+
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
12271
|
+
}
|
|
12272
|
+
else if (e.code === 'PageDown') {
|
|
12273
|
+
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
12274
|
+
}
|
|
12275
|
+
return { x, y };
|
|
12276
|
+
}
|
|
12277
|
+
}
|
|
12278
|
+
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12279
|
+
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
12280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
12281
|
+
type: Injectable
|
|
12282
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
12283
|
+
|
|
12096
12284
|
/*
|
|
12097
12285
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12098
12286
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -12105,12 +12293,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12105
12293
|
* since it can be anything (not just a text input).
|
|
12106
12294
|
*/
|
|
12107
12295
|
class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
12108
|
-
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef) {
|
|
12296
|
+
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef, keyNavigation) {
|
|
12109
12297
|
super(_filters);
|
|
12110
12298
|
this.commonStrings = commonStrings;
|
|
12111
12299
|
this.smartToggleService = smartToggleService;
|
|
12112
12300
|
this.platformId = platformId;
|
|
12113
12301
|
this.elementRef = elementRef;
|
|
12302
|
+
this.keyNavigation = keyNavigation;
|
|
12114
12303
|
this.openChange = new EventEmitter(false);
|
|
12115
12304
|
this.ariaExpanded = false;
|
|
12116
12305
|
this.popoverId = uniqueIdFactory();
|
|
@@ -12139,6 +12328,9 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12139
12328
|
if (!open && isPlatformBrowser(this.platformId)) {
|
|
12140
12329
|
this.anchor.nativeElement.focus();
|
|
12141
12330
|
}
|
|
12331
|
+
if (this.keyNavigation) {
|
|
12332
|
+
this.keyNavigation.skipItemFocus = open;
|
|
12333
|
+
}
|
|
12142
12334
|
// keep track of the state
|
|
12143
12335
|
this._open = open;
|
|
12144
12336
|
}
|
|
@@ -12153,7 +12345,9 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12153
12345
|
return !!this.filter && this.filter.isActive();
|
|
12154
12346
|
}
|
|
12155
12347
|
ngOnChanges() {
|
|
12156
|
-
|
|
12348
|
+
setTimeout(() => {
|
|
12349
|
+
this.setToggleButtonAriaLabel();
|
|
12350
|
+
});
|
|
12157
12351
|
}
|
|
12158
12352
|
ngOnDestroy() {
|
|
12159
12353
|
super.ngOnDestroy();
|
|
@@ -12172,7 +12366,7 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12172
12366
|
});
|
|
12173
12367
|
}
|
|
12174
12368
|
}
|
|
12175
|
-
ClrDatagridFilter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridFilter, deps: [{ token: FiltersProvider }, { token: ClrCommonStringsService }, { token: ClrPopoverToggleService }, { token: PLATFORM_ID }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
12369
|
+
ClrDatagridFilter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridFilter, deps: [{ token: FiltersProvider }, { token: ClrCommonStringsService }, { token: ClrPopoverToggleService }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: KeyNavigationGridController, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
12176
12370
|
ClrDatagridFilter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridFilter, selector: "clr-dg-filter", inputs: { open: ["clrDgFilterOpen", "open"], customFilter: ["clrDgFilter", "customFilter"] }, outputs: { openChange: "clrDgFilterOpenChange" }, providers: [{ provide: CustomFilter, useExisting: ClrDatagridFilter }], viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
12177
12371
|
<button
|
|
12178
12372
|
class="datagrid-filter-toggle"
|
|
@@ -12257,7 +12451,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12257
12451
|
}], ctorParameters: function () { return [{ type: FiltersProvider }, { type: ClrCommonStringsService }, { type: ClrPopoverToggleService }, { type: undefined, decorators: [{
|
|
12258
12452
|
type: Inject,
|
|
12259
12453
|
args: [PLATFORM_ID]
|
|
12260
|
-
}] }, { type: i0.ElementRef }
|
|
12454
|
+
}] }, { type: i0.ElementRef }, { type: KeyNavigationGridController, decorators: [{
|
|
12455
|
+
type: Optional
|
|
12456
|
+
}] }]; }, propDecorators: { openChange: [{
|
|
12261
12457
|
type: Output,
|
|
12262
12458
|
args: ['clrDgFilterOpenChange']
|
|
12263
12459
|
}], anchor: [{
|
|
@@ -13015,6 +13211,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
13015
13211
|
class DetailService {
|
|
13016
13212
|
constructor(modalStackService) {
|
|
13017
13213
|
this.modalStackService = modalStackService;
|
|
13214
|
+
this.preventScroll = false;
|
|
13018
13215
|
this.toggleState = false;
|
|
13019
13216
|
this._enabled = false;
|
|
13020
13217
|
this._state = new BehaviorSubject(this.toggleState);
|
|
@@ -13025,6 +13222,12 @@ class DetailService {
|
|
|
13025
13222
|
set enabled(state) {
|
|
13026
13223
|
this._enabled = state;
|
|
13027
13224
|
}
|
|
13225
|
+
get preventFocusScroll() {
|
|
13226
|
+
return this.preventScroll;
|
|
13227
|
+
}
|
|
13228
|
+
set preventFocusScroll(preventScroll) {
|
|
13229
|
+
this.preventScroll = preventScroll;
|
|
13230
|
+
}
|
|
13028
13231
|
get state() {
|
|
13029
13232
|
return this.cache;
|
|
13030
13233
|
}
|
|
@@ -13043,15 +13246,13 @@ class DetailService {
|
|
|
13043
13246
|
}
|
|
13044
13247
|
close() {
|
|
13045
13248
|
this.toggleState = false;
|
|
13249
|
+
this.returnFocus();
|
|
13046
13250
|
this._state.next(this.toggleState);
|
|
13047
13251
|
this.modalStackService.trackModalClose(this);
|
|
13048
|
-
// In the case of browser zoom greater than 250%, the detail pane toggle button is not visible on the page.
|
|
13049
|
-
// Wait for the detail pane to close, and return focus to the detail toggle button.
|
|
13050
|
-
setTimeout(() => this.returnFocus(), 0);
|
|
13051
13252
|
}
|
|
13052
13253
|
returnFocus() {
|
|
13053
13254
|
if (this.button) {
|
|
13054
|
-
this.button.focus();
|
|
13255
|
+
this.button.focus({ preventScroll: this.preventFocusScroll });
|
|
13055
13256
|
this.button = null;
|
|
13056
13257
|
}
|
|
13057
13258
|
}
|
|
@@ -15343,7 +15544,7 @@ ClrDatagridRow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
15343
15544
|
DatagridIfExpandService,
|
|
15344
15545
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15345
15546
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15346
|
-
], queries: [{ propertyName: "dgCells", predicate: ClrDatagridCell }], viewQueries: [{ propertyName: "expandAnimation", first: true, predicate: ClrExpandableAnimation, descendants: true }, { propertyName: "detailButton", first: true, predicate: ["detailButton"], descendants: true }, { propertyName: "_stickyCells", first: true, predicate: ["stickyCells"], descendants: true, read: ViewContainerRef }, { propertyName: "_scrollableCells", first: true, predicate: ["scrollableCells"], descendants: true, read: ViewContainerRef }, { propertyName: "_calculatedCells", first: true, predicate: ["calculatedCells"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n We need to wrap the #rowContent in label element if we are in rowSelectionMode.\n Clicking of that wrapper label will equate to clicking on the whole row, which triggers the checkbox to toggle.\n-->\n<div\n class=\"datagrid-row-clickable\"\n *ngIf=\"selection.rowSelectionMode\"\n (mousedown)=\"clearRanges($event)\"\n (click)=\"selectRow(!selected, $event)\"\n>\n <clr-expandable-animation [clrExpandTrigger]=\"expandAnimationTrigger\" *ngIf=\"expand.expandable\">\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n </clr-expandable-animation>\n <ng-template [ngTemplateOutlet]=\"rowContent\" *ngIf=\"!expand.expandable\"></ng-template>\n</div>\n\n<clr-expandable-animation\n *ngIf=\"!selection.rowSelectionMode && expand.expandable\"\n [clrExpandTrigger]=\"expandAnimationTrigger\"\n>\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n</clr-expandable-animation>\n\n<ng-template *ngIf=\"!selection.rowSelectionMode && !expand.expandable\" [ngTemplateOutlet]=\"rowContent\"></ng-template>\n\n<!--\n We need the \"project into template\" hacks because we need this in 2 different places\n depending on whether the details replace the row or not.\n-->\n<ng-template #detail>\n <ng-content select=\"clr-dg-row-detail\"></ng-content>\n</ng-template>\n\n<ng-template #rowContent>\n <div\n role=\"row\"\n [id]=\"id\"\n class=\"datagrid-row-master datagrid-row-flex\"\n [class.datagrid-row-detail-open]=\"detailService.isRowOpen(item)\"\n >\n <div class=\"datagrid-row-sticky\">\n <!-- Sticky elements here -->\n <ng-container #stickyCells>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-checkbox-wrapper>\n <input\n type=\"checkbox\"\n clrCheckbox\n [ngModel]=\"selected\"\n (ngModelChange)=\"toggle($event)\"\n [id]=\"checkboxId\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"checkboxId\" class=\"clr-control-label clr-col-null\" (click)=\"clearRanges($event)\">\n <span class=\"clr-sr-only\">{{clrDgRowSelectionLabel || commonStrings.keys.select}}</span>\n </label>\n </clr-checkbox-wrapper>\n </div>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-radio-wrapper>\n <input\n type=\"radio\"\n clrRadio\n [id]=\"radioId\"\n [name]=\"selection.id + '-radio'\"\n [value]=\"item\"\n [(ngModel)]=\"selection.currentSingle\"\n [checked]=\"selection.currentSingle === item\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <label class=\"clr-control-label clr-col-null\" [for]=\"radioId\">\n <span class=\"clr-sr-only\">{{ clrDgRowSelectionLabel || commonStrings.keys.select }}</span>\n </label>\n </clr-radio-wrapper>\n </div>\n <div\n *ngIf=\"rowActionService.hasActionableRow\"\n class=\"datagrid-row-actions datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-content select=\"clr-dg-action-overflow\"></ng-content>\n </div>\n <div\n *ngIf=\"globalExpandable.hasExpandableRow\"\n class=\"datagrid-expandable-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-container *ngIf=\"expand.expandable\">\n <button\n *ngIf=\"!expand.loading\"\n (click)=\"toggleExpand()\"\n type=\"button\"\n class=\"datagrid-expandable-caret-button\"\n [attr.aria-expanded]=\"expand.expanded\"\n [attr.aria-label]=\"expand.expanded ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-controls]=\"expandableId\"\n >\n <cds-icon\n shape=\"angle\"\n class=\"datagrid-expandable-caret-icon\"\n [attr.direction]=\"expand.expanded ? 'down' : 'right'\"\n [attr.title]=\"expand.expanded ? commonStrings.keys.collapse : commonStrings.keys.expand\"\n ></cds-icon>\n </button>\n <clr-spinner *ngIf=\"expand.loading\" clrSmall>{{ commonStrings.keys.loading }}</clr-spinner>\n </ng-container>\n </div>\n <div\n *ngIf=\"detailService.enabled\"\n class=\"datagrid-detail-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <button\n (click)=\"detailService.toggle(item, detailButton)\"\n type=\"button\"\n #detailButton\n class=\"datagrid-detail-caret-button\"\n [class.is-open]=\"detailService.isRowOpen(item)\"\n [attr.aria-label]=\"detailService.isRowOpen(item) ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-expanded]=\"detailService.isRowOpen(item)\"\n [attr.aria-controls]=\"detailService.id\"\n aria-haspopup=\"dialog\"\n >\n <cds-icon\n shape=\"angle-double\"\n [attr.direction]=\"detailService.isRowOpen(item) ? 'left' : 'right'\"\n class=\"datagrid-detail-caret-icon\"\n [attr.title]=\"detailService.isRowOpen(item) ? commonStrings.keys.close: commonStrings.keys.open\"\n ></cds-icon>\n </button>\n </div>\n </ng-container>\n <!-- placeholder for projecting other sticky cells as pinned-->\n </div>\n <div class=\"datagrid-row-scrollable\" [ngClass]=\"{'is-replaced': replaced && expanded}\">\n <div class=\"datagrid-scrolling-cells\">\n <ng-content select=\"clr-dg-cell\"></ng-content>\n <ng-container #scrollableCells></ng-container>\n </div>\n <!-- details here when replace, re-visit when sticky container is used for pinned cells -->\n <ng-template *ngIf=\"replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n <ng-template *ngIf=\"!replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n </div>\n </div>\n</ng-template>\n\n<ng-container #calculatedCells></ng-container>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdsIconCustomTag, selector: "cds-icon" }, { kind: "directive", type: ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: ClrRadio, selector: "[clrRadio]" }, { kind: "component", type: ClrRadioWrapper, selector: "clr-radio-wrapper" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ClrExpandableAnimation, selector: "clr-expandable-animation", inputs: ["clrExpandTrigger"] }, { kind: "component", type: ClrSpinner, selector: "clr-spinner", inputs: ["clrInline", "clrInverse", "clrSmall", "clrMedium"] }, { kind: "directive", type: ClrDatagridSelectionCellDirective, selector: ".datagrid-select" }] });
|
|
15547
|
+
], queries: [{ propertyName: "dgCells", predicate: ClrDatagridCell }], viewQueries: [{ propertyName: "expandAnimation", first: true, predicate: ClrExpandableAnimation, descendants: true }, { propertyName: "detailButton", first: true, predicate: ["detailButton"], descendants: true }, { propertyName: "_stickyCells", first: true, predicate: ["stickyCells"], descendants: true, read: ViewContainerRef }, { propertyName: "_scrollableCells", first: true, predicate: ["scrollableCells"], descendants: true, read: ViewContainerRef }, { propertyName: "_calculatedCells", first: true, predicate: ["calculatedCells"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n We need to wrap the #rowContent in label element if we are in rowSelectionMode.\n Clicking of that wrapper label will equate to clicking on the whole row, which triggers the checkbox to toggle.\n-->\n<div\n class=\"datagrid-row-clickable\"\n *ngIf=\"selection.rowSelectionMode\"\n (mousedown)=\"clearRanges($event)\"\n (click)=\"selectRow(!selected, $event)\"\n>\n <clr-expandable-animation [clrExpandTrigger]=\"expandAnimationTrigger\" *ngIf=\"expand.expandable\">\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n </clr-expandable-animation>\n <ng-template [ngTemplateOutlet]=\"rowContent\" *ngIf=\"!expand.expandable\"></ng-template>\n</div>\n\n<clr-expandable-animation\n *ngIf=\"!selection.rowSelectionMode && expand.expandable\"\n [clrExpandTrigger]=\"expandAnimationTrigger\"\n>\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n</clr-expandable-animation>\n\n<ng-template *ngIf=\"!selection.rowSelectionMode && !expand.expandable\" [ngTemplateOutlet]=\"rowContent\"></ng-template>\n\n<!--\n We need the \"project into template\" hacks because we need this in 2 different places\n depending on whether the details replace the row or not.\n-->\n<ng-template #detail>\n <ng-content select=\"clr-dg-row-detail\"></ng-content>\n</ng-template>\n\n<ng-template #rowContent>\n <div\n role=\"row\"\n [id]=\"id\"\n class=\"datagrid-row-master datagrid-row-flex\"\n [class.datagrid-row-detail-open]=\"detailService.isRowOpen(item)\"\n >\n <div class=\"datagrid-row-sticky\">\n <!-- Sticky elements here -->\n <ng-container #stickyCells>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-checkbox-wrapper>\n <input\n tabindex=\"-1\"\n type=\"checkbox\"\n clrCheckbox\n [ngModel]=\"selected\"\n (ngModelChange)=\"toggle($event)\"\n [id]=\"checkboxId\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"checkboxId\" class=\"clr-control-label clr-col-null\" (click)=\"clearRanges($event)\">\n <span class=\"clr-sr-only\">{{clrDgRowSelectionLabel || commonStrings.keys.select}}</span>\n </label>\n </clr-checkbox-wrapper>\n </div>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-radio-wrapper>\n <input\n tabindex=\"-1\"\n type=\"radio\"\n clrRadio\n [id]=\"radioId\"\n [name]=\"selection.id + '-radio'\"\n [value]=\"item\"\n [(ngModel)]=\"selection.currentSingle\"\n [checked]=\"selection.currentSingle === item\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <label class=\"clr-control-label clr-col-null\" [for]=\"radioId\">\n <span class=\"clr-sr-only\">{{ clrDgRowSelectionLabel || commonStrings.keys.select }}</span>\n </label>\n </clr-radio-wrapper>\n </div>\n <div\n *ngIf=\"rowActionService.hasActionableRow\"\n class=\"datagrid-row-actions datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-content select=\"clr-dg-action-overflow\"></ng-content>\n </div>\n <div\n *ngIf=\"globalExpandable.hasExpandableRow\"\n class=\"datagrid-expandable-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-container *ngIf=\"expand.expandable\">\n <button\n tabindex=\"-1\"\n *ngIf=\"!expand.loading\"\n (click)=\"toggleExpand()\"\n type=\"button\"\n class=\"datagrid-expandable-caret-button\"\n [attr.aria-expanded]=\"expand.expanded\"\n [attr.aria-label]=\"expand.expanded ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-controls]=\"expandableId\"\n >\n <cds-icon\n shape=\"angle\"\n class=\"datagrid-expandable-caret-icon\"\n [attr.direction]=\"expand.expanded ? 'down' : 'right'\"\n [attr.title]=\"expand.expanded ? commonStrings.keys.collapse : commonStrings.keys.expand\"\n ></cds-icon>\n </button>\n <clr-spinner *ngIf=\"expand.loading\" clrSmall>{{ commonStrings.keys.loading }}</clr-spinner>\n </ng-container>\n </div>\n <div\n *ngIf=\"detailService.enabled\"\n class=\"datagrid-detail-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <button\n tabindex=\"-1\"\n (click)=\"detailService.toggle(item, detailButton)\"\n type=\"button\"\n #detailButton\n class=\"datagrid-detail-caret-button\"\n [class.is-open]=\"detailService.isRowOpen(item)\"\n [attr.aria-label]=\"detailService.isRowOpen(item) ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-expanded]=\"detailService.isRowOpen(item)\"\n [attr.aria-controls]=\"detailService.id\"\n aria-haspopup=\"dialog\"\n >\n <cds-icon\n shape=\"angle-double\"\n [attr.direction]=\"detailService.isRowOpen(item) ? 'left' : 'right'\"\n class=\"datagrid-detail-caret-icon\"\n [attr.title]=\"detailService.isRowOpen(item) ? commonStrings.keys.close: commonStrings.keys.open\"\n ></cds-icon>\n </button>\n </div>\n </ng-container>\n <!-- placeholder for projecting other sticky cells as pinned-->\n </div>\n <div class=\"datagrid-row-scrollable\" [ngClass]=\"{'is-replaced': replaced && expanded}\">\n <div class=\"datagrid-scrolling-cells\">\n <ng-content select=\"clr-dg-cell\"></ng-content>\n <ng-container #scrollableCells></ng-container>\n </div>\n <!-- details here when replace, re-visit when sticky container is used for pinned cells -->\n <ng-template *ngIf=\"replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n <ng-template *ngIf=\"!replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n </div>\n </div>\n</ng-template>\n\n<ng-container #calculatedCells></ng-container>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CdsIconCustomTag, selector: "cds-icon" }, { kind: "directive", type: ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: ClrRadio, selector: "[clrRadio]" }, { kind: "component", type: ClrRadioWrapper, selector: "clr-radio-wrapper" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ClrExpandableAnimation, selector: "clr-expandable-animation", inputs: ["clrExpandTrigger"] }, { kind: "component", type: ClrSpinner, selector: "clr-spinner", inputs: ["clrInline", "clrInverse", "clrSmall", "clrMedium"] }, { kind: "directive", type: ClrDatagridSelectionCellDirective, selector: ".datagrid-select" }] });
|
|
15347
15548
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridRow, decorators: [{
|
|
15348
15549
|
type: Component,
|
|
15349
15550
|
args: [{ selector: 'clr-dg-row', host: {
|
|
@@ -15355,7 +15556,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15355
15556
|
DatagridIfExpandService,
|
|
15356
15557
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15357
15558
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15358
|
-
], template: "<!--\n We need to wrap the #rowContent in label element if we are in rowSelectionMode.\n Clicking of that wrapper label will equate to clicking on the whole row, which triggers the checkbox to toggle.\n-->\n<div\n class=\"datagrid-row-clickable\"\n *ngIf=\"selection.rowSelectionMode\"\n (mousedown)=\"clearRanges($event)\"\n (click)=\"selectRow(!selected, $event)\"\n>\n <clr-expandable-animation [clrExpandTrigger]=\"expandAnimationTrigger\" *ngIf=\"expand.expandable\">\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n </clr-expandable-animation>\n <ng-template [ngTemplateOutlet]=\"rowContent\" *ngIf=\"!expand.expandable\"></ng-template>\n</div>\n\n<clr-expandable-animation\n *ngIf=\"!selection.rowSelectionMode && expand.expandable\"\n [clrExpandTrigger]=\"expandAnimationTrigger\"\n>\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n</clr-expandable-animation>\n\n<ng-template *ngIf=\"!selection.rowSelectionMode && !expand.expandable\" [ngTemplateOutlet]=\"rowContent\"></ng-template>\n\n<!--\n We need the \"project into template\" hacks because we need this in 2 different places\n depending on whether the details replace the row or not.\n-->\n<ng-template #detail>\n <ng-content select=\"clr-dg-row-detail\"></ng-content>\n</ng-template>\n\n<ng-template #rowContent>\n <div\n role=\"row\"\n [id]=\"id\"\n class=\"datagrid-row-master datagrid-row-flex\"\n [class.datagrid-row-detail-open]=\"detailService.isRowOpen(item)\"\n >\n <div class=\"datagrid-row-sticky\">\n <!-- Sticky elements here -->\n <ng-container #stickyCells>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-checkbox-wrapper>\n <input\n type=\"checkbox\"\n clrCheckbox\n [ngModel]=\"selected\"\n (ngModelChange)=\"toggle($event)\"\n [id]=\"checkboxId\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"checkboxId\" class=\"clr-control-label clr-col-null\" (click)=\"clearRanges($event)\">\n <span class=\"clr-sr-only\">{{clrDgRowSelectionLabel || commonStrings.keys.select}}</span>\n </label>\n </clr-checkbox-wrapper>\n </div>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-radio-wrapper>\n <input\n type=\"radio\"\n clrRadio\n [id]=\"radioId\"\n [name]=\"selection.id + '-radio'\"\n [value]=\"item\"\n [(ngModel)]=\"selection.currentSingle\"\n [checked]=\"selection.currentSingle === item\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <label class=\"clr-control-label clr-col-null\" [for]=\"radioId\">\n <span class=\"clr-sr-only\">{{ clrDgRowSelectionLabel || commonStrings.keys.select }}</span>\n </label>\n </clr-radio-wrapper>\n </div>\n <div\n *ngIf=\"rowActionService.hasActionableRow\"\n class=\"datagrid-row-actions datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-content select=\"clr-dg-action-overflow\"></ng-content>\n </div>\n <div\n *ngIf=\"globalExpandable.hasExpandableRow\"\n class=\"datagrid-expandable-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-container *ngIf=\"expand.expandable\">\n <button\n *ngIf=\"!expand.loading\"\n (click)=\"toggleExpand()\"\n type=\"button\"\n class=\"datagrid-expandable-caret-button\"\n [attr.aria-expanded]=\"expand.expanded\"\n [attr.aria-label]=\"expand.expanded ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-controls]=\"expandableId\"\n >\n <cds-icon\n shape=\"angle\"\n class=\"datagrid-expandable-caret-icon\"\n [attr.direction]=\"expand.expanded ? 'down' : 'right'\"\n [attr.title]=\"expand.expanded ? commonStrings.keys.collapse : commonStrings.keys.expand\"\n ></cds-icon>\n </button>\n <clr-spinner *ngIf=\"expand.loading\" clrSmall>{{ commonStrings.keys.loading }}</clr-spinner>\n </ng-container>\n </div>\n <div\n *ngIf=\"detailService.enabled\"\n class=\"datagrid-detail-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <button\n (click)=\"detailService.toggle(item, detailButton)\"\n type=\"button\"\n #detailButton\n class=\"datagrid-detail-caret-button\"\n [class.is-open]=\"detailService.isRowOpen(item)\"\n [attr.aria-label]=\"detailService.isRowOpen(item) ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-expanded]=\"detailService.isRowOpen(item)\"\n [attr.aria-controls]=\"detailService.id\"\n aria-haspopup=\"dialog\"\n >\n <cds-icon\n shape=\"angle-double\"\n [attr.direction]=\"detailService.isRowOpen(item) ? 'left' : 'right'\"\n class=\"datagrid-detail-caret-icon\"\n [attr.title]=\"detailService.isRowOpen(item) ? commonStrings.keys.close: commonStrings.keys.open\"\n ></cds-icon>\n </button>\n </div>\n </ng-container>\n <!-- placeholder for projecting other sticky cells as pinned-->\n </div>\n <div class=\"datagrid-row-scrollable\" [ngClass]=\"{'is-replaced': replaced && expanded}\">\n <div class=\"datagrid-scrolling-cells\">\n <ng-content select=\"clr-dg-cell\"></ng-content>\n <ng-container #scrollableCells></ng-container>\n </div>\n <!-- details here when replace, re-visit when sticky container is used for pinned cells -->\n <ng-template *ngIf=\"replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n <ng-template *ngIf=\"!replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n </div>\n </div>\n</ng-template>\n\n<ng-container #calculatedCells></ng-container>\n" }]
|
|
15559
|
+
], template: "<!--\n We need to wrap the #rowContent in label element if we are in rowSelectionMode.\n Clicking of that wrapper label will equate to clicking on the whole row, which triggers the checkbox to toggle.\n-->\n<div\n class=\"datagrid-row-clickable\"\n *ngIf=\"selection.rowSelectionMode\"\n (mousedown)=\"clearRanges($event)\"\n (click)=\"selectRow(!selected, $event)\"\n>\n <clr-expandable-animation [clrExpandTrigger]=\"expandAnimationTrigger\" *ngIf=\"expand.expandable\">\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n </clr-expandable-animation>\n <ng-template [ngTemplateOutlet]=\"rowContent\" *ngIf=\"!expand.expandable\"></ng-template>\n</div>\n\n<clr-expandable-animation\n *ngIf=\"!selection.rowSelectionMode && expand.expandable\"\n [clrExpandTrigger]=\"expandAnimationTrigger\"\n>\n <ng-template [ngTemplateOutlet]=\"rowContent\"></ng-template>\n</clr-expandable-animation>\n\n<ng-template *ngIf=\"!selection.rowSelectionMode && !expand.expandable\" [ngTemplateOutlet]=\"rowContent\"></ng-template>\n\n<!--\n We need the \"project into template\" hacks because we need this in 2 different places\n depending on whether the details replace the row or not.\n-->\n<ng-template #detail>\n <ng-content select=\"clr-dg-row-detail\"></ng-content>\n</ng-template>\n\n<ng-template #rowContent>\n <div\n role=\"row\"\n [id]=\"id\"\n class=\"datagrid-row-master datagrid-row-flex\"\n [class.datagrid-row-detail-open]=\"detailService.isRowOpen(item)\"\n >\n <div class=\"datagrid-row-sticky\">\n <!-- Sticky elements here -->\n <ng-container #stickyCells>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-checkbox-wrapper>\n <input\n tabindex=\"-1\"\n type=\"checkbox\"\n clrCheckbox\n [ngModel]=\"selected\"\n (ngModelChange)=\"toggle($event)\"\n [id]=\"checkboxId\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"checkboxId\" class=\"clr-control-label clr-col-null\" (click)=\"clearRanges($event)\">\n <span class=\"clr-sr-only\">{{clrDgRowSelectionLabel || commonStrings.keys.select}}</span>\n </label>\n </clr-checkbox-wrapper>\n </div>\n <div\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n class=\"datagrid-select datagrid-fixed-column datagrid-cell\"\n [ngClass]=\"{ 'clr-form-control-disabled': !clrDgSelectable }\"\n role=\"gridcell\"\n >\n <clr-radio-wrapper>\n <input\n tabindex=\"-1\"\n type=\"radio\"\n clrRadio\n [id]=\"radioId\"\n [name]=\"selection.id + '-radio'\"\n [value]=\"item\"\n [(ngModel)]=\"selection.currentSingle\"\n [checked]=\"selection.currentSingle === item\"\n [disabled]=\"clrDgSelectable ? null : true\"\n [attr.aria-disabled]=\"clrDgSelectable ? null : true\"\n />\n <label class=\"clr-control-label clr-col-null\" [for]=\"radioId\">\n <span class=\"clr-sr-only\">{{ clrDgRowSelectionLabel || commonStrings.keys.select }}</span>\n </label>\n </clr-radio-wrapper>\n </div>\n <div\n *ngIf=\"rowActionService.hasActionableRow\"\n class=\"datagrid-row-actions datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-content select=\"clr-dg-action-overflow\"></ng-content>\n </div>\n <div\n *ngIf=\"globalExpandable.hasExpandableRow\"\n class=\"datagrid-expandable-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <ng-container *ngIf=\"expand.expandable\">\n <button\n tabindex=\"-1\"\n *ngIf=\"!expand.loading\"\n (click)=\"toggleExpand()\"\n type=\"button\"\n class=\"datagrid-expandable-caret-button\"\n [attr.aria-expanded]=\"expand.expanded\"\n [attr.aria-label]=\"expand.expanded ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-controls]=\"expandableId\"\n >\n <cds-icon\n shape=\"angle\"\n class=\"datagrid-expandable-caret-icon\"\n [attr.direction]=\"expand.expanded ? 'down' : 'right'\"\n [attr.title]=\"expand.expanded ? commonStrings.keys.collapse : commonStrings.keys.expand\"\n ></cds-icon>\n </button>\n <clr-spinner *ngIf=\"expand.loading\" clrSmall>{{ commonStrings.keys.loading }}</clr-spinner>\n </ng-container>\n </div>\n <div\n *ngIf=\"detailService.enabled\"\n class=\"datagrid-detail-caret datagrid-fixed-column datagrid-cell\"\n role=\"gridcell\"\n >\n <button\n tabindex=\"-1\"\n (click)=\"detailService.toggle(item, detailButton)\"\n type=\"button\"\n #detailButton\n class=\"datagrid-detail-caret-button\"\n [class.is-open]=\"detailService.isRowOpen(item)\"\n [attr.aria-label]=\"detailService.isRowOpen(item) ? clrDgDetailCloseLabel : clrDgDetailOpenLabel\"\n [attr.aria-expanded]=\"detailService.isRowOpen(item)\"\n [attr.aria-controls]=\"detailService.id\"\n aria-haspopup=\"dialog\"\n >\n <cds-icon\n shape=\"angle-double\"\n [attr.direction]=\"detailService.isRowOpen(item) ? 'left' : 'right'\"\n class=\"datagrid-detail-caret-icon\"\n [attr.title]=\"detailService.isRowOpen(item) ? commonStrings.keys.close: commonStrings.keys.open\"\n ></cds-icon>\n </button>\n </div>\n </ng-container>\n <!-- placeholder for projecting other sticky cells as pinned-->\n </div>\n <div class=\"datagrid-row-scrollable\" [ngClass]=\"{'is-replaced': replaced && expanded}\">\n <div class=\"datagrid-scrolling-cells\">\n <ng-content select=\"clr-dg-cell\"></ng-content>\n <ng-container #scrollableCells></ng-container>\n </div>\n <!-- details here when replace, re-visit when sticky container is used for pinned cells -->\n <ng-template *ngIf=\"replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n <ng-template *ngIf=\"!replaced && !expand.loading\" [ngTemplateOutlet]=\"detail\"></ng-template>\n </div>\n </div>\n</ng-template>\n\n<ng-container #calculatedCells></ng-container>\n" }]
|
|
15359
15560
|
}], ctorParameters: function () { return [{ type: Selection }, { type: RowActionService }, { type: ExpandableRowsCount }, { type: DatagridIfExpandService }, { type: DetailService }, { type: DisplayModeService }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: ClrCommonStringsService }, { type: Items }, { type: undefined, decorators: [{
|
|
15360
15561
|
type: Inject,
|
|
15361
15562
|
args: [DOCUMENT]
|
|
@@ -15413,10 +15614,11 @@ var DatagridColumnChanges;
|
|
|
15413
15614
|
(function (DatagridColumnChanges) {
|
|
15414
15615
|
DatagridColumnChanges[DatagridColumnChanges["WIDTH"] = 0] = "WIDTH";
|
|
15415
15616
|
DatagridColumnChanges[DatagridColumnChanges["HIDDEN"] = 1] = "HIDDEN";
|
|
15617
|
+
DatagridColumnChanges[DatagridColumnChanges["INITIALIZE"] = 2] = "INITIALIZE";
|
|
15416
15618
|
})(DatagridColumnChanges || (DatagridColumnChanges = {}));
|
|
15417
15619
|
const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
15418
15620
|
.map(key => DatagridColumnChanges[key])
|
|
15419
|
-
.filter(key => key === parseInt(key, 10)); // extracts only integer keys
|
|
15621
|
+
.filter(key => key === parseInt(key, 10) && key !== DatagridColumnChanges.INITIALIZE); // extracts only integer keys
|
|
15420
15622
|
|
|
15421
15623
|
/*
|
|
15422
15624
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -15427,6 +15629,7 @@ const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
|
15427
15629
|
class ColumnsService {
|
|
15428
15630
|
constructor() {
|
|
15429
15631
|
this.columns = [];
|
|
15632
|
+
this.columnsStateChange = new BehaviorSubject(null);
|
|
15430
15633
|
this._cache = [];
|
|
15431
15634
|
}
|
|
15432
15635
|
get columnStates() {
|
|
@@ -15448,7 +15651,9 @@ class ColumnsService {
|
|
|
15448
15651
|
resetToLastCache() {
|
|
15449
15652
|
this._cache.forEach((state, index) => {
|
|
15450
15653
|
// Just emit the exact value from the cache
|
|
15451
|
-
|
|
15654
|
+
const cachedState = { ...state, changes: ALL_COLUMN_CHANGES };
|
|
15655
|
+
this.columns[index].next(cachedState);
|
|
15656
|
+
this.columnsStateChange.next(cachedState);
|
|
15452
15657
|
});
|
|
15453
15658
|
this._cache = [];
|
|
15454
15659
|
}
|
|
@@ -15460,7 +15665,9 @@ class ColumnsService {
|
|
|
15460
15665
|
this.emitStateChange(this.columns[columnIndex], diff);
|
|
15461
15666
|
}
|
|
15462
15667
|
emitStateChange(column, diff) {
|
|
15463
|
-
|
|
15668
|
+
const changedState = { ...column.value, ...diff };
|
|
15669
|
+
column.next(changedState);
|
|
15670
|
+
this.columnsStateChange.next(changedState);
|
|
15464
15671
|
}
|
|
15465
15672
|
}
|
|
15466
15673
|
ColumnsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ColumnsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -15536,188 +15743,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15536
15743
|
type: Injectable
|
|
15537
15744
|
}], ctorParameters: function () { return [{ type: FiltersProvider }, { type: Sort }, { type: Page }, { type: StateDebouncer }]; } });
|
|
15538
15745
|
|
|
15539
|
-
/*
|
|
15540
|
-
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15541
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
15542
|
-
* This software is released under MIT license.
|
|
15543
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
15544
|
-
*/
|
|
15545
|
-
function getTabableItems(el) {
|
|
15546
|
-
const tabableSelector = [
|
|
15547
|
-
'a[href]',
|
|
15548
|
-
'area[href]',
|
|
15549
|
-
'input:not([disabled])',
|
|
15550
|
-
'button:not([disabled])',
|
|
15551
|
-
'select:not([disabled])',
|
|
15552
|
-
'textarea:not([disabled])',
|
|
15553
|
-
'iframe',
|
|
15554
|
-
'object',
|
|
15555
|
-
'embed',
|
|
15556
|
-
'*[tabindex]',
|
|
15557
|
-
'*[contenteditable=true]',
|
|
15558
|
-
'[role=button]:not([disabled])',
|
|
15559
|
-
].join(',');
|
|
15560
|
-
return Array.from(el.querySelectorAll(tabableSelector));
|
|
15561
|
-
}
|
|
15562
|
-
class KeyNavigationGridController {
|
|
15563
|
-
constructor(zone) {
|
|
15564
|
-
this.zone = zone;
|
|
15565
|
-
this.listenersAdded = false;
|
|
15566
|
-
this.destroy$ = new Subject();
|
|
15567
|
-
this._activeCell = null;
|
|
15568
|
-
this.config = {
|
|
15569
|
-
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
15570
|
-
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
15571
|
-
keyGrid: '[role=grid]',
|
|
15572
|
-
};
|
|
15573
|
-
}
|
|
15574
|
-
get grid() {
|
|
15575
|
-
return this.host?.querySelector(this.config.keyGrid);
|
|
15576
|
-
}
|
|
15577
|
-
get rows() {
|
|
15578
|
-
return this.host?.querySelectorAll(this.config.keyGridRows);
|
|
15579
|
-
}
|
|
15580
|
-
get cells() {
|
|
15581
|
-
return this.host?.querySelectorAll(this.config.keyGridCells);
|
|
15582
|
-
}
|
|
15583
|
-
ngOnDestroy() {
|
|
15584
|
-
this.destroy$.next();
|
|
15585
|
-
this.destroy$.complete();
|
|
15586
|
-
}
|
|
15587
|
-
addListeners() {
|
|
15588
|
-
if (this.listenersAdded) {
|
|
15589
|
-
return;
|
|
15590
|
-
}
|
|
15591
|
-
this.zone.runOutsideAngular(() => {
|
|
15592
|
-
fromEvent(this.grid, 'mousedown')
|
|
15593
|
-
.pipe(takeUntil(this.destroy$))
|
|
15594
|
-
.subscribe((e) => {
|
|
15595
|
-
// preserve right click for context menus & keyboard mouse control https://apple.stackexchange.com/questions/32715/how-do-i-open-the-context-menu-from-a-mac-keyboard
|
|
15596
|
-
if (e.buttons === 1 && !e.ctrlKey) {
|
|
15597
|
-
const activeCell = this.cells
|
|
15598
|
-
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
15599
|
-
: null;
|
|
15600
|
-
if (activeCell) {
|
|
15601
|
-
this.setActiveCell(activeCell);
|
|
15602
|
-
}
|
|
15603
|
-
}
|
|
15604
|
-
});
|
|
15605
|
-
fromEvent(this.grid, 'wheel')
|
|
15606
|
-
.pipe(takeUntil(this.destroy$))
|
|
15607
|
-
.subscribe(() => {
|
|
15608
|
-
this.removeActiveCell();
|
|
15609
|
-
});
|
|
15610
|
-
fromEvent(this.grid, 'keydown')
|
|
15611
|
-
.pipe(takeUntil(this.destroy$))
|
|
15612
|
-
.subscribe((e) => {
|
|
15613
|
-
// Skip column resize events
|
|
15614
|
-
if (e.target.classList.contains('drag-handle') &&
|
|
15615
|
-
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
15616
|
-
return;
|
|
15617
|
-
}
|
|
15618
|
-
if (e.code === 'ArrowUp' ||
|
|
15619
|
-
e.code === 'ArrowDown' ||
|
|
15620
|
-
e.code === 'ArrowLeft' ||
|
|
15621
|
-
e.code === 'ArrowRight' ||
|
|
15622
|
-
e.code === 'End' ||
|
|
15623
|
-
e.code === 'Home' ||
|
|
15624
|
-
e.code === 'PageUp' ||
|
|
15625
|
-
e.code === 'PageDown') {
|
|
15626
|
-
const { x, y } = this.getNextItemCoordinate(e);
|
|
15627
|
-
const activeItem = this.rows
|
|
15628
|
-
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
15629
|
-
: null;
|
|
15630
|
-
if (activeItem) {
|
|
15631
|
-
this.setActiveCell(activeItem);
|
|
15632
|
-
}
|
|
15633
|
-
e.preventDefault();
|
|
15634
|
-
}
|
|
15635
|
-
});
|
|
15636
|
-
});
|
|
15637
|
-
this.listenersAdded = true;
|
|
15638
|
-
}
|
|
15639
|
-
initializeKeyGrid(host) {
|
|
15640
|
-
this.host = host;
|
|
15641
|
-
this.addListeners();
|
|
15642
|
-
this.resetKeyGrid();
|
|
15643
|
-
}
|
|
15644
|
-
resetKeyGrid() {
|
|
15645
|
-
this.cells?.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
15646
|
-
const firstCell = this.cells ? this.cells[0] : null;
|
|
15647
|
-
firstCell?.setAttribute('tabindex', '0');
|
|
15648
|
-
}
|
|
15649
|
-
removeActiveCell() {
|
|
15650
|
-
this._activeCell = null;
|
|
15651
|
-
}
|
|
15652
|
-
getActiveCell() {
|
|
15653
|
-
return this._activeCell;
|
|
15654
|
-
}
|
|
15655
|
-
setActiveCell(activeCell) {
|
|
15656
|
-
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
15657
|
-
if (prior) {
|
|
15658
|
-
prior.setAttribute('tabindex', '-1');
|
|
15659
|
-
}
|
|
15660
|
-
activeCell.setAttribute('tabindex', '0');
|
|
15661
|
-
const items = getTabableItems(activeCell);
|
|
15662
|
-
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
15663
|
-
item.focus();
|
|
15664
|
-
this._activeCell = item;
|
|
15665
|
-
}
|
|
15666
|
-
getNextItemCoordinate(e) {
|
|
15667
|
-
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
15668
|
-
if (e.code === 'Tab') {
|
|
15669
|
-
currentCell = document.activeElement;
|
|
15670
|
-
}
|
|
15671
|
-
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
15672
|
-
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
15673
|
-
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
15674
|
-
let x = currentRow && currentCell
|
|
15675
|
-
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
15676
|
-
: 0;
|
|
15677
|
-
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
15678
|
-
const dir = this.host.dir;
|
|
15679
|
-
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
15680
|
-
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
15681
|
-
const itemsPerPage = Math.floor(this.host?.querySelector('.datagrid').clientHeight / this.rows[0].clientHeight) - 1 || 0;
|
|
15682
|
-
if (e.code === 'ArrowUp' && y !== 0) {
|
|
15683
|
-
y = y - 1;
|
|
15684
|
-
}
|
|
15685
|
-
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
15686
|
-
y = y + 1;
|
|
15687
|
-
}
|
|
15688
|
-
else if (e.code === inlineStart && x !== 0) {
|
|
15689
|
-
x = x - 1;
|
|
15690
|
-
}
|
|
15691
|
-
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
15692
|
-
x = x + 1;
|
|
15693
|
-
}
|
|
15694
|
-
else if (e.code === 'End') {
|
|
15695
|
-
x = numOfColumns;
|
|
15696
|
-
if (e.ctrlKey) {
|
|
15697
|
-
y = numOfRows;
|
|
15698
|
-
}
|
|
15699
|
-
}
|
|
15700
|
-
else if (e.code === 'Home') {
|
|
15701
|
-
x = 0;
|
|
15702
|
-
if (e.ctrlKey) {
|
|
15703
|
-
y = 0;
|
|
15704
|
-
}
|
|
15705
|
-
}
|
|
15706
|
-
else if (e.code === 'PageUp') {
|
|
15707
|
-
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
15708
|
-
}
|
|
15709
|
-
else if (e.code === 'PageDown') {
|
|
15710
|
-
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
15711
|
-
}
|
|
15712
|
-
return { x, y };
|
|
15713
|
-
}
|
|
15714
|
-
}
|
|
15715
|
-
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
15716
|
-
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
15717
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
15718
|
-
type: Injectable
|
|
15719
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
15720
|
-
|
|
15721
15746
|
/*
|
|
15722
15747
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15723
15748
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -15751,7 +15776,6 @@ class DatagridCellRenderer {
|
|
|
15751
15776
|
}
|
|
15752
15777
|
}
|
|
15753
15778
|
resetState(state) {
|
|
15754
|
-
state.changes = ALL_COLUMN_CHANGES;
|
|
15755
15779
|
this.setWidth(state);
|
|
15756
15780
|
this.setHidden(state);
|
|
15757
15781
|
}
|
|
@@ -15984,12 +16008,16 @@ class ClrDatagrid {
|
|
|
15984
16008
|
*/
|
|
15985
16009
|
if (row) {
|
|
15986
16010
|
this.detailService.open(row.item, row.detailButton.nativeElement);
|
|
16011
|
+
// always keep open when virtual scroll is available otherwise close it
|
|
15987
16012
|
}
|
|
15988
|
-
else if (!this.hasVirtualScroller
|
|
15989
|
-
|
|
16013
|
+
else if (!this.hasVirtualScroller) {
|
|
16014
|
+
// Using setTimeout to make sure the inner cycles in rows are done
|
|
16015
|
+
setTimeout(() => {
|
|
16016
|
+
this.detailService.close();
|
|
16017
|
+
});
|
|
15990
16018
|
}
|
|
15991
16019
|
}
|
|
15992
|
-
// retain active cell when navigating with PageUp and PageDown buttons in virtual scroller
|
|
16020
|
+
// retain active cell when navigating with Up/Down Arrows, PageUp and PageDown buttons in virtual scroller
|
|
15993
16021
|
const active = this.keyNavigation.getActiveCell();
|
|
15994
16022
|
if (active) {
|
|
15995
16023
|
this.zone.runOutsideAngular(() => {
|
|
@@ -16076,6 +16104,13 @@ class ClrDatagrid {
|
|
|
16076
16104
|
ngOnDestroy() {
|
|
16077
16105
|
this._subscriptions.forEach((sub) => sub.unsubscribe());
|
|
16078
16106
|
}
|
|
16107
|
+
toggleAllSelected($event) {
|
|
16108
|
+
$event.preventDefault();
|
|
16109
|
+
if (this.hasVirtualScroller) {
|
|
16110
|
+
return;
|
|
16111
|
+
}
|
|
16112
|
+
this.allSelected = !this.allSelected;
|
|
16113
|
+
}
|
|
16079
16114
|
resize() {
|
|
16080
16115
|
this.organizer.resize();
|
|
16081
16116
|
}
|
|
@@ -16103,7 +16138,7 @@ ClrDatagrid.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
|
16103
16138
|
ColumnsService,
|
|
16104
16139
|
DisplayModeService,
|
|
16105
16140
|
KeyNavigationGridController,
|
|
16106
|
-
], queries: [{ propertyName: "iterator", first: true, predicate: ClrDatagridItems, descendants: true }, { propertyName: "placeholder", first: true, predicate: ClrDatagridPlaceholder, descendants: true }, { propertyName: "columns", predicate: ClrDatagridColumn }, { propertyName: "rows", predicate: ClrDatagridRow }], viewQueries: [{ propertyName: "datagrid", first: true, predicate: ["datagrid"], descendants: true, read: ElementRef }, { propertyName: "datagridTable", first: true, predicate: ["datagridTable"], descendants: true, read: ElementRef }, { propertyName: "scrollableColumns", first: true, predicate: ["scrollableColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_projectedDisplayColumns", first: true, predicate: ["projectedDisplayColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_projectedCalculationColumns", first: true, predicate: ["projectedCalculationColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_displayedRows", first: true, predicate: ["displayedRows"], descendants: true, read: ViewContainerRef }, { propertyName: "_calculationRows", first: true, predicate: ["calculationRows"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2024 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-content select=\"clr-dg-action-bar\"></ng-content>\n<div class=\"datagrid-outer-wrapper\">\n <div class=\"datagrid-inner-wrapper\">\n <div class=\"datagrid\" #datagrid [attr.aria-hidden]=\"detailService.isOpen ? true : null\">\n <div class=\"datagrid-table-wrapper\">\n <div role=\"grid\" class=\"datagrid-table\" tabindex=\"-1\" #datagridTable>\n <div role=\"rowgroup\" class=\"datagrid-header\">\n <div role=\"row\" class=\"datagrid-row\">\n <div class=\"datagrid-row-master datagrid-row-flex\">\n <div class=\"datagrid-row-sticky\">\n <!--header for datagrid where you can select multiple rows -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n (keydown.space)=\"
|
|
16141
|
+
], queries: [{ propertyName: "iterator", first: true, predicate: ClrDatagridItems, descendants: true }, { propertyName: "placeholder", first: true, predicate: ClrDatagridPlaceholder, descendants: true }, { propertyName: "columns", predicate: ClrDatagridColumn }, { propertyName: "rows", predicate: ClrDatagridRow }], viewQueries: [{ propertyName: "datagrid", first: true, predicate: ["datagrid"], descendants: true, read: ElementRef }, { propertyName: "datagridTable", first: true, predicate: ["datagridTable"], descendants: true, read: ElementRef }, { propertyName: "scrollableColumns", first: true, predicate: ["scrollableColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_projectedDisplayColumns", first: true, predicate: ["projectedDisplayColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_projectedCalculationColumns", first: true, predicate: ["projectedCalculationColumns"], descendants: true, read: ViewContainerRef }, { propertyName: "_displayedRows", first: true, predicate: ["displayedRows"], descendants: true, read: ViewContainerRef }, { propertyName: "_calculationRows", first: true, predicate: ["calculationRows"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2024 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-content select=\"clr-dg-action-bar\"></ng-content>\n<div class=\"datagrid-outer-wrapper\">\n <div class=\"datagrid-inner-wrapper\">\n <div class=\"datagrid\" #datagrid [attr.aria-hidden]=\"detailService.isOpen ? true : null\">\n <div class=\"datagrid-table-wrapper\">\n <div role=\"grid\" class=\"datagrid-table\" tabindex=\"-1\" #datagridTable>\n <div role=\"rowgroup\" class=\"datagrid-header\">\n <div role=\"row\" class=\"datagrid-row\">\n <div class=\"datagrid-row-master datagrid-row-flex\">\n <div class=\"datagrid-row-sticky\">\n <!--header for datagrid where you can select multiple rows -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n (keydown.space)=\"toggleAllSelected($event)\"\n >\n <div *ngIf=\"!hasVirtualScroller\" class=\"clr-checkbox-wrapper\">\n <!-- We need to move focus and space-key handling to the parent because of keyboard arrow key navigation,\n which is not able to transfer focus directly on the input when focused with the tab key -->\n <input\n type=\"checkbox\"\n [id]=\"selectAllId\"\n [(ngModel)]=\"allSelected\"\n [attr.aria-label]=\"commonStrings.keys.selectAll\"\n tabindex=\"-1\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"selectAllId\" class=\"clr-control-label clr-col-null\">\n <span class=\"clr-sr-only\">{{commonStrings.keys.selectAll}}</span>\n </label>\n </div>\n\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for datagrid where you can select one row only -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n >\n <div class=\"clr-sr-only\">{{clrDgSingleSelectionAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for single row action; only displayType if we have at least one actionable row in datagrid -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-row-actions datagrid-fixed-column\"\n *ngIf=\"rowActionService.hasActionableRow\"\n >\n <div class=\"clr-sr-only\">{{clrDgSingleActionableAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for carets; only displayType if we have at least one expandable row in datagrid -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-expandable-caret datagrid-fixed-column\"\n *ngIf=\"expandableRows.hasExpandableRow || detailService.enabled\"\n >\n <div class=\"clr-sr-only\">{{clrDetailExpandableAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n </div>\n <div class=\"datagrid-row-scrollable\">\n <ng-container #projectedDisplayColumns></ng-container>\n </div>\n </div>\n </div>\n </div>\n\n <div role=\"presentation\" class=\"datagrid-rows\">\n <clr-dg-row class=\"datagrid-row-loading\" *ngIf=\"loadingMoreItems\">\n <clr-dg-cell>\n <clr-spinner clrMedium></clr-spinner>\n <span>{{ commonStrings.keys.loading }}</span>\n </clr-dg-cell>\n </clr-dg-row>\n\n <ng-container #displayedRows></ng-container>\n\n <clr-dg-row class=\"datagrid-row-loading\" *ngIf=\"loadingMoreItems\">\n <clr-dg-cell>\n <clr-spinner clrMedium></clr-spinner>\n <span>{{ commonStrings.keys.loading }}</span>\n </clr-dg-cell>\n </clr-dg-row>\n\n <!-- Custom placeholder overrides the default empty one -->\n <ng-content select=\"clr-dg-placeholder\"></ng-content>\n <clr-dg-placeholder *ngIf=\"!placeholder\"></clr-dg-placeholder>\n </div>\n </div>\n </div>\n </div>\n <ng-content select=\"clr-dg-footer\"></ng-content>\n <div class=\"datagrid-spinner\" *ngIf=\"loading\">\n <clr-spinner clrMedium>Loading</clr-spinner>\n </div>\n </div>\n <ng-content select=\"[clrIfDetail],clr-dg-detail\"></ng-content>\n</div>\n\n<div class=\"datagrid-calculation-table\">\n <div class=\"datagrid-calculation-header\">\n <ng-container #projectedCalculationColumns></ng-container>\n </div>\n <ng-container #calculationRows></ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: ClrLabel, selector: "label", inputs: ["for"] }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ClrSpinner, selector: "clr-spinner", inputs: ["clrInline", "clrInverse", "clrSmall", "clrMedium"] }, { kind: "component", type: ClrDatagridCell, selector: "clr-dg-cell" }, { kind: "component", type: ClrDatagridPlaceholder, selector: "clr-dg-placeholder" }, { kind: "component", type: ClrDatagridRow, selector: "clr-dg-row", inputs: ["clrDgItem", "clrDgSelectable", "clrDgSelected", "clrDgExpanded", "clrDgDetailOpenLabel", "clrDgDetailCloseLabel", "clrDgRowSelectionLabel"], outputs: ["clrDgSelectedChange", "clrDgExpandedChange"] }, { kind: "directive", type: ClrDatagridSelectionCellDirective, selector: ".datagrid-select" }, { kind: "directive", type: DatagridCellRenderer, selector: "clr-dg-cell" }, { kind: "directive", type: DatagridRowRenderer, selector: "clr-dg-row, clr-dg-row-detail" }, { kind: "directive", type: ActionableOompaLoompa, selector: "clr-datagrid, clr-dg-row" }, { kind: "directive", type: ExpandableOompaLoompa, selector: "clr-datagrid, clr-dg-row" }] });
|
|
16107
16142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagrid, decorators: [{
|
|
16108
16143
|
type: Component,
|
|
16109
16144
|
args: [{ selector: 'clr-datagrid', providers: [
|
|
@@ -16125,7 +16160,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16125
16160
|
], host: {
|
|
16126
16161
|
'[class.datagrid-host]': 'true',
|
|
16127
16162
|
'[class.datagrid-detail-open]': 'detailService.isOpen',
|
|
16128
|
-
}, template: "<!--\n ~ Copyright (c) 2016-2024 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-content select=\"clr-dg-action-bar\"></ng-content>\n<div class=\"datagrid-outer-wrapper\">\n <div class=\"datagrid-inner-wrapper\">\n <div class=\"datagrid\" #datagrid [attr.aria-hidden]=\"detailService.isOpen ? true : null\">\n <div class=\"datagrid-table-wrapper\">\n <div role=\"grid\" class=\"datagrid-table\" tabindex=\"-1\" #datagridTable>\n <div role=\"rowgroup\" class=\"datagrid-header\">\n <div role=\"row\" class=\"datagrid-row\">\n <div class=\"datagrid-row-master datagrid-row-flex\">\n <div class=\"datagrid-row-sticky\">\n <!--header for datagrid where you can select multiple rows -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n (keydown.space)=\"
|
|
16163
|
+
}, template: "<!--\n ~ Copyright (c) 2016-2024 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<ng-content select=\"clr-dg-action-bar\"></ng-content>\n<div class=\"datagrid-outer-wrapper\">\n <div class=\"datagrid-inner-wrapper\">\n <div class=\"datagrid\" #datagrid [attr.aria-hidden]=\"detailService.isOpen ? true : null\">\n <div class=\"datagrid-table-wrapper\">\n <div role=\"grid\" class=\"datagrid-table\" tabindex=\"-1\" #datagridTable>\n <div role=\"rowgroup\" class=\"datagrid-header\">\n <div role=\"row\" class=\"datagrid-row\">\n <div class=\"datagrid-row-master datagrid-row-flex\">\n <div class=\"datagrid-row-sticky\">\n <!--header for datagrid where you can select multiple rows -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Multi\"\n (keydown.space)=\"toggleAllSelected($event)\"\n >\n <div *ngIf=\"!hasVirtualScroller\" class=\"clr-checkbox-wrapper\">\n <!-- We need to move focus and space-key handling to the parent because of keyboard arrow key navigation,\n which is not able to transfer focus directly on the input when focused with the tab key -->\n <input\n type=\"checkbox\"\n [id]=\"selectAllId\"\n [(ngModel)]=\"allSelected\"\n [attr.aria-label]=\"commonStrings.keys.selectAll\"\n tabindex=\"-1\"\n />\n <!-- Usage of class clr-col-null here prevents clr-col-* classes from being added when a datagrid is wrapped inside clrForm -->\n <label [for]=\"selectAllId\" class=\"clr-control-label clr-col-null\">\n <span class=\"clr-sr-only\">{{commonStrings.keys.selectAll}}</span>\n </label>\n </div>\n\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for datagrid where you can select one row only -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-select datagrid-fixed-column\"\n *ngIf=\"selection.selectionType === SELECTION_TYPE.Single\"\n >\n <div class=\"clr-sr-only\">{{clrDgSingleSelectionAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for single row action; only displayType if we have at least one actionable row in datagrid -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-row-actions datagrid-fixed-column\"\n *ngIf=\"rowActionService.hasActionableRow\"\n >\n <div class=\"clr-sr-only\">{{clrDgSingleActionableAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n <!-- header for carets; only displayType if we have at least one expandable row in datagrid -->\n <div\n role=\"columnheader\"\n class=\"datagrid-column datagrid-expandable-caret datagrid-fixed-column\"\n *ngIf=\"expandableRows.hasExpandableRow || detailService.enabled\"\n >\n <div class=\"clr-sr-only\">{{clrDetailExpandableAriaLabel}}</div>\n <div class=\"datagrid-column-separator\"></div>\n </div>\n </div>\n <div class=\"datagrid-row-scrollable\">\n <ng-container #projectedDisplayColumns></ng-container>\n </div>\n </div>\n </div>\n </div>\n\n <div role=\"presentation\" class=\"datagrid-rows\">\n <clr-dg-row class=\"datagrid-row-loading\" *ngIf=\"loadingMoreItems\">\n <clr-dg-cell>\n <clr-spinner clrMedium></clr-spinner>\n <span>{{ commonStrings.keys.loading }}</span>\n </clr-dg-cell>\n </clr-dg-row>\n\n <ng-container #displayedRows></ng-container>\n\n <clr-dg-row class=\"datagrid-row-loading\" *ngIf=\"loadingMoreItems\">\n <clr-dg-cell>\n <clr-spinner clrMedium></clr-spinner>\n <span>{{ commonStrings.keys.loading }}</span>\n </clr-dg-cell>\n </clr-dg-row>\n\n <!-- Custom placeholder overrides the default empty one -->\n <ng-content select=\"clr-dg-placeholder\"></ng-content>\n <clr-dg-placeholder *ngIf=\"!placeholder\"></clr-dg-placeholder>\n </div>\n </div>\n </div>\n </div>\n <ng-content select=\"clr-dg-footer\"></ng-content>\n <div class=\"datagrid-spinner\" *ngIf=\"loading\">\n <clr-spinner clrMedium>Loading</clr-spinner>\n </div>\n </div>\n <ng-content select=\"[clrIfDetail],clr-dg-detail\"></ng-content>\n</div>\n\n<div class=\"datagrid-calculation-table\">\n <div class=\"datagrid-calculation-header\">\n <ng-container #projectedCalculationColumns></ng-container>\n </div>\n <ng-container #calculationRows></ng-container>\n</div>\n" }]
|
|
16129
16164
|
}], ctorParameters: function () { return [{ type: DatagridRenderOrganizer }, { type: Items }, { type: ExpandableRowsCount }, { type: Selection }, { type: RowActionService }, { type: StateProvider }, { type: DisplayModeService }, { type: i0.Renderer2 }, { type: DetailService }, { type: undefined, decorators: [{
|
|
16130
16165
|
type: Inject,
|
|
16131
16166
|
args: [DOCUMENT]
|
|
@@ -16294,6 +16329,7 @@ class ClrDatagridActionOverflow {
|
|
|
16294
16329
|
ClrDatagridActionOverflow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridActionOverflow, deps: [{ token: RowActionService }, { token: ClrCommonStringsService }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: ClrPopoverToggleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
16295
16330
|
ClrDatagridActionOverflow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridActionOverflow, selector: "clr-dg-action-overflow", inputs: { buttonLabel: ["clrDgActionOverflowButtonLabel", "buttonLabel"], open: ["clrDgActionOverflowOpen", "open"] }, outputs: { openChange: "clrDgActionOverflowOpenChange" }, viewQueries: [{ propertyName: "keyFocus", first: true, predicate: ClrKeyFocus, descendants: true }], hostDirectives: [{ directive: ClrPopoverHostDirective }], ngImport: i0, template: `
|
|
16296
16331
|
<button
|
|
16332
|
+
tabindex="-1"
|
|
16297
16333
|
class="datagrid-action-toggle"
|
|
16298
16334
|
type="button"
|
|
16299
16335
|
role="button"
|
|
@@ -16328,6 +16364,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16328
16364
|
hostDirectives: [ClrPopoverHostDirective],
|
|
16329
16365
|
template: `
|
|
16330
16366
|
<button
|
|
16367
|
+
tabindex="-1"
|
|
16331
16368
|
class="datagrid-action-toggle"
|
|
16332
16369
|
type="button"
|
|
16333
16370
|
role="button"
|
|
@@ -16633,10 +16670,13 @@ class ClrDatagridDetailHeader {
|
|
|
16633
16670
|
get titleId() {
|
|
16634
16671
|
return `${this.detailService.id}-title`;
|
|
16635
16672
|
}
|
|
16673
|
+
ngAfterViewInit() {
|
|
16674
|
+
this.title.nativeElement.focus();
|
|
16675
|
+
}
|
|
16636
16676
|
}
|
|
16637
16677
|
ClrDatagridDetailHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridDetailHeader, deps: [{ token: DetailService }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
16638
|
-
ClrDatagridDetailHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridDetailHeader, selector: "clr-dg-detail-header", host: { properties: { "class.datagrid-detail-header": "true" } }, ngImport: i0, template: `
|
|
16639
|
-
<div class="datagrid-detail-header-title"
|
|
16678
|
+
ClrDatagridDetailHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridDetailHeader, selector: "clr-dg-detail-header", host: { properties: { "class.datagrid-detail-header": "true" } }, viewQueries: [{ propertyName: "title", first: true, predicate: ["title"], descendants: true }], ngImport: i0, template: `
|
|
16679
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16640
16680
|
<ng-content></ng-content>
|
|
16641
16681
|
</div>
|
|
16642
16682
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16658,7 +16698,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16658
16698
|
'[class.datagrid-detail-header]': 'true',
|
|
16659
16699
|
},
|
|
16660
16700
|
template: `
|
|
16661
|
-
<div class="datagrid-detail-header-title"
|
|
16701
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16662
16702
|
<ng-content></ng-content>
|
|
16663
16703
|
</div>
|
|
16664
16704
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16673,7 +16713,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16673
16713
|
</div>
|
|
16674
16714
|
`,
|
|
16675
16715
|
}]
|
|
16676
|
-
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }
|
|
16716
|
+
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: { title: [{
|
|
16717
|
+
type: ViewChild,
|
|
16718
|
+
args: ['title']
|
|
16719
|
+
}] } });
|
|
16677
16720
|
|
|
16678
16721
|
/*
|
|
16679
16722
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -16686,21 +16729,42 @@ class ClrDatagridDetail {
|
|
|
16686
16729
|
this.detailService = detailService;
|
|
16687
16730
|
this.commonStrings = commonStrings;
|
|
16688
16731
|
}
|
|
16732
|
+
get labelledBy() {
|
|
16733
|
+
if (this.ariaLabelledBy) {
|
|
16734
|
+
return this.header ? `${this.header.titleId} ${this.ariaLabelledBy}` : this.ariaLabelledBy;
|
|
16735
|
+
}
|
|
16736
|
+
else if (this.ariaLabel) {
|
|
16737
|
+
// If aria-label is set by the end user, do not set aria-labelledby
|
|
16738
|
+
return null;
|
|
16739
|
+
}
|
|
16740
|
+
else {
|
|
16741
|
+
return this.header?.titleId || '';
|
|
16742
|
+
}
|
|
16743
|
+
}
|
|
16744
|
+
get label() {
|
|
16745
|
+
if (!this.ariaLabelledBy) {
|
|
16746
|
+
return this.ariaLabel || null;
|
|
16747
|
+
}
|
|
16748
|
+
else {
|
|
16749
|
+
return null;
|
|
16750
|
+
}
|
|
16751
|
+
}
|
|
16689
16752
|
close() {
|
|
16690
16753
|
this.detailService.close();
|
|
16691
16754
|
}
|
|
16692
16755
|
}
|
|
16693
16756
|
ClrDatagridDetail.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridDetail, deps: [{ token: DetailService }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
16694
|
-
ClrDatagridDetail.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridDetail, selector: "clr-dg-detail", host: { properties: { "class.datagrid-detail-pane": "true" } }, queries: [{ propertyName: "header", first: true, predicate: ClrDatagridDetailHeader, descendants: true }], ngImport: i0, template: `
|
|
16757
|
+
ClrDatagridDetail.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridDetail, selector: "clr-dg-detail", inputs: { ariaLabelledBy: ["clrDetailAriaLabelledBy", "ariaLabelledBy"], ariaLabel: ["clrDetailAriaLabel", "ariaLabel"] }, host: { properties: { "class.datagrid-detail-pane": "true" } }, queries: [{ propertyName: "header", first: true, predicate: ClrDatagridDetailHeader, descendants: true }], ngImport: i0, template: `
|
|
16695
16758
|
<div
|
|
16696
16759
|
cdkTrapFocus
|
|
16697
|
-
[cdkTrapFocusAutoCapture]="
|
|
16760
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16698
16761
|
class="datagrid-detail-pane-content"
|
|
16699
16762
|
*ngIf="detailService.isOpen"
|
|
16700
16763
|
role="dialog"
|
|
16701
16764
|
[id]="detailService.id"
|
|
16702
16765
|
aria-modal="true"
|
|
16703
|
-
[attr.aria-
|
|
16766
|
+
[attr.aria-labelledby]="labelledBy"
|
|
16767
|
+
[attr.aria-label]="label"
|
|
16704
16768
|
>
|
|
16705
16769
|
<div class="clr-sr-only">{{ commonStrings.keys.detailPaneStart }}</div>
|
|
16706
16770
|
<ng-content></ng-content>
|
|
@@ -16719,13 +16783,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16719
16783
|
template: `
|
|
16720
16784
|
<div
|
|
16721
16785
|
cdkTrapFocus
|
|
16722
|
-
[cdkTrapFocusAutoCapture]="
|
|
16786
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16723
16787
|
class="datagrid-detail-pane-content"
|
|
16724
16788
|
*ngIf="detailService.isOpen"
|
|
16725
16789
|
role="dialog"
|
|
16726
16790
|
[id]="detailService.id"
|
|
16727
16791
|
aria-modal="true"
|
|
16728
|
-
[attr.aria-
|
|
16792
|
+
[attr.aria-labelledby]="labelledBy"
|
|
16793
|
+
[attr.aria-label]="label"
|
|
16729
16794
|
>
|
|
16730
16795
|
<div class="clr-sr-only">{{ commonStrings.keys.detailPaneStart }}</div>
|
|
16731
16796
|
<ng-content></ng-content>
|
|
@@ -16733,7 +16798,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16733
16798
|
</div>
|
|
16734
16799
|
`,
|
|
16735
16800
|
}]
|
|
16736
|
-
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: {
|
|
16801
|
+
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: { ariaLabelledBy: [{
|
|
16802
|
+
type: Input,
|
|
16803
|
+
args: ['clrDetailAriaLabelledBy']
|
|
16804
|
+
}], ariaLabel: [{
|
|
16805
|
+
type: Input,
|
|
16806
|
+
args: ['clrDetailAriaLabel']
|
|
16807
|
+
}], header: [{
|
|
16737
16808
|
type: ContentChild,
|
|
16738
16809
|
args: [ClrDatagridDetailHeader]
|
|
16739
16810
|
}] } });
|
|
@@ -17007,6 +17078,9 @@ class ClrIfDetail {
|
|
|
17007
17078
|
}
|
|
17008
17079
|
this.skip = false;
|
|
17009
17080
|
}
|
|
17081
|
+
get viewContext() {
|
|
17082
|
+
return { $implicit: this.detailService.state };
|
|
17083
|
+
}
|
|
17010
17084
|
ngOnInit() {
|
|
17011
17085
|
this.subscriptions.push(this.detailService.stateChange.subscribe(state => {
|
|
17012
17086
|
if (state === true) {
|
|
@@ -17023,12 +17097,11 @@ class ClrIfDetail {
|
|
|
17023
17097
|
togglePanel(showPanel) {
|
|
17024
17098
|
let stateChangeParams = null;
|
|
17025
17099
|
if (showPanel === true) {
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
this.embeddedViewRef = this.viewContainer.createEmbeddedView(this.templateRef, embeddedViewContext);
|
|
17100
|
+
if (!this.embeddedViewRef) {
|
|
17101
|
+
// Create a context forward `Proxy` that will always bind to the user-specified context,
|
|
17102
|
+
// without having to re-assign it whenever changes.
|
|
17103
|
+
const viewContext = this._createContextForwardProxy();
|
|
17104
|
+
this.embeddedViewRef = this.viewContainer.createEmbeddedView(this.templateRef, viewContext);
|
|
17032
17105
|
}
|
|
17033
17106
|
this.skip = true;
|
|
17034
17107
|
stateChangeParams = this.detailService.state;
|
|
@@ -17039,6 +17112,27 @@ class ClrIfDetail {
|
|
|
17039
17112
|
}
|
|
17040
17113
|
this.stateChange.emit(stateChangeParams);
|
|
17041
17114
|
}
|
|
17115
|
+
/**
|
|
17116
|
+
* For a given outlet instance, we create a proxy object that delegates
|
|
17117
|
+
* to the user-specified context. This allows changing, or swapping out
|
|
17118
|
+
* the context object completely without having to destroy/re-create the view.
|
|
17119
|
+
*/
|
|
17120
|
+
_createContextForwardProxy() {
|
|
17121
|
+
return new Proxy({}, {
|
|
17122
|
+
set: (_target, prop, newValue) => {
|
|
17123
|
+
if (!this.viewContext) {
|
|
17124
|
+
return false;
|
|
17125
|
+
}
|
|
17126
|
+
return Reflect.set(this.viewContext, prop, newValue);
|
|
17127
|
+
},
|
|
17128
|
+
get: (_target, prop, receiver) => {
|
|
17129
|
+
if (!this.viewContext) {
|
|
17130
|
+
return undefined;
|
|
17131
|
+
}
|
|
17132
|
+
return Reflect.get(this.viewContext, prop, receiver);
|
|
17133
|
+
},
|
|
17134
|
+
});
|
|
17135
|
+
}
|
|
17042
17136
|
}
|
|
17043
17137
|
ClrIfDetail.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrIfDetail, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: DetailService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17044
17138
|
ClrIfDetail.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: ClrIfDetail, selector: "[clrIfDetail]", inputs: { state: ["clrIfDetail", "state"] }, outputs: { stateChange: "clrIfDetailChange" }, ngImport: i0 });
|
|
@@ -17571,7 +17665,7 @@ const defaultCdkFixedSizeVirtualScrollInputs = {
|
|
|
17571
17665
|
maxBufferPx: 400,
|
|
17572
17666
|
};
|
|
17573
17667
|
class ClrDatagridVirtualScrollDirective {
|
|
17574
|
-
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, injector) {
|
|
17668
|
+
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, columnsService, injector) {
|
|
17575
17669
|
this.changeDetectorRef = changeDetectorRef;
|
|
17576
17670
|
this.iterableDiffers = iterableDiffers;
|
|
17577
17671
|
this.items = items;
|
|
@@ -17582,6 +17676,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17582
17676
|
this.scrollDispatcher = scrollDispatcher;
|
|
17583
17677
|
this.viewportRuler = viewportRuler;
|
|
17584
17678
|
this.datagrid = datagrid;
|
|
17679
|
+
this.columnsService = columnsService;
|
|
17585
17680
|
this.injector = injector;
|
|
17586
17681
|
this.renderedRangeChange = new EventEmitter();
|
|
17587
17682
|
this._cdkFixedSizeVirtualScrollInputs = { ...defaultCdkFixedSizeVirtualScrollInputs };
|
|
@@ -17594,12 +17689,16 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17594
17689
|
}
|
|
17595
17690
|
});
|
|
17596
17691
|
});
|
|
17692
|
+
this.viewRepeater = new _RecycleViewRepeaterStrategy();
|
|
17597
17693
|
this.cdkVirtualForInputs = {
|
|
17598
17694
|
cdkVirtualForTrackBy: index => index,
|
|
17599
17695
|
};
|
|
17600
17696
|
this.items.smartenUp();
|
|
17601
17697
|
this.datagrid.hasVirtualScroller = true;
|
|
17698
|
+
this.datagrid.detailService.preventFocusScroll = true;
|
|
17602
17699
|
this.datagridElementRef = this.datagrid.el;
|
|
17700
|
+
// default
|
|
17701
|
+
this.cdkVirtualForTemplateCacheSize = 20;
|
|
17603
17702
|
this.mutationChanges.observe(this.datagridElementRef.nativeElement, {
|
|
17604
17703
|
attributeFilter: ['class'],
|
|
17605
17704
|
attributeOldValue: true,
|
|
@@ -17659,7 +17758,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17659
17758
|
ngAfterViewInit() {
|
|
17660
17759
|
this.injector.runInContext(() => {
|
|
17661
17760
|
this.virtualScrollViewport = this.createVirtualScrollViewportForDatagrid(this.changeDetectorRef, this.ngZone, this.directionality, this.scrollDispatcher, this.viewportRuler, this.datagridElementRef, this.virtualScrollStrategy);
|
|
17662
|
-
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers,
|
|
17761
|
+
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers, this.viewRepeater, this.virtualScrollViewport, this.ngZone);
|
|
17663
17762
|
this.virtualScrollViewport.ngOnInit();
|
|
17664
17763
|
});
|
|
17665
17764
|
this.gridRoleElement = this.datagridElementRef.nativeElement.querySelector('[role="grid"]');
|
|
@@ -17674,6 +17773,8 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17674
17773
|
if (datagridState.filters) {
|
|
17675
17774
|
this.virtualScrollViewport.scrollToIndex(0);
|
|
17676
17775
|
}
|
|
17776
|
+
}), this.columnsService.columnsStateChange.subscribe(() => {
|
|
17777
|
+
this.viewRepeater.detach();
|
|
17677
17778
|
}));
|
|
17678
17779
|
}
|
|
17679
17780
|
ngDoCheck() {
|
|
@@ -17745,7 +17846,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17745
17846
|
return virtualScrollViewport;
|
|
17746
17847
|
}
|
|
17747
17848
|
}
|
|
17748
|
-
ClrDatagridVirtualScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridVirtualScrollDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }, { token: Items, skipSelf: true }, { token: i0.NgZone }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i1$2.Directionality }, { token: i3$1.ScrollDispatcher }, { token: i3$1.ViewportRuler }, { token: ClrDatagrid }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17849
|
+
ClrDatagridVirtualScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridVirtualScrollDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.IterableDiffers }, { token: Items, skipSelf: true }, { token: i0.NgZone }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i1$2.Directionality }, { token: i3$1.ScrollDispatcher }, { token: i3$1.ViewportRuler }, { token: ClrDatagrid }, { token: ColumnsService }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17749
17850
|
ClrDatagridVirtualScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: ClrDatagridVirtualScrollDirective, selector: "[ClrVirtualScroll]", inputs: { cdkVirtualForOf: ["clrVirtualRowsOf", "cdkVirtualForOf"], cdkVirtualForTrackBy: ["clrVirtualRowsTrackBy", "cdkVirtualForTrackBy"], cdkVirtualForTemplate: ["clrVirtualRowsTemplate", "cdkVirtualForTemplate"], cdkVirtualForTemplateCacheSize: ["clrVirtualRowsTemplateCacheSize", "cdkVirtualForTemplateCacheSize"], itemSize: ["clrVirtualRowsItemSize", "itemSize"], minBufferPx: ["clrVirtualRowsMinBufferPx", "minBufferPx"], maxBufferPx: ["clrVirtualRowsMaxBufferPx", "maxBufferPx"] }, outputs: { renderedRangeChange: "renderedRangeChange" }, providers: [Items], ngImport: i0 });
|
|
17750
17851
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridVirtualScrollDirective, decorators: [{
|
|
17751
17852
|
type: Directive,
|
|
@@ -17755,7 +17856,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
17755
17856
|
}]
|
|
17756
17857
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }, { type: Items, decorators: [{
|
|
17757
17858
|
type: SkipSelf
|
|
17758
|
-
}] }, { type: i0.NgZone }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$2.Directionality }, { type: i3$1.ScrollDispatcher }, { type: i3$1.ViewportRuler }, { type: ClrDatagrid }, { type: i0.EnvironmentInjector }]; }, propDecorators: { renderedRangeChange: [{
|
|
17859
|
+
}] }, { type: i0.NgZone }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i1$2.Directionality }, { type: i3$1.ScrollDispatcher }, { type: i3$1.ViewportRuler }, { type: ClrDatagrid }, { type: ColumnsService }, { type: i0.EnvironmentInjector }]; }, propDecorators: { renderedRangeChange: [{
|
|
17759
17860
|
type: Output
|
|
17760
17861
|
}], cdkVirtualForOf: [{
|
|
17761
17862
|
type: Input,
|
|
@@ -17980,6 +18081,9 @@ class DatagridMainRenderer {
|
|
|
17980
18081
|
this.subscriptions.push(this.detailService.stateChange.subscribe(state => this.toggleDetailPane(state)));
|
|
17981
18082
|
this.subscriptions.push(this.items.change.subscribe(() => (this.shouldStabilizeColumns = true)));
|
|
17982
18083
|
}
|
|
18084
|
+
ngOnInit() {
|
|
18085
|
+
this.columnsService.columnsStateChange.subscribe(change => this.columnStateChanged(change));
|
|
18086
|
+
}
|
|
17983
18087
|
ngAfterContentInit() {
|
|
17984
18088
|
this.setupColumns();
|
|
17985
18089
|
this.subscriptions.push(this.headers.changes.subscribe(() => {
|
|
@@ -17989,7 +18093,6 @@ class DatagridMainRenderer {
|
|
|
17989
18093
|
this.columnsSizesStable = false;
|
|
17990
18094
|
this.stabilizeColumns();
|
|
17991
18095
|
}));
|
|
17992
|
-
this.listenForColumnChanges();
|
|
17993
18096
|
}
|
|
17994
18097
|
// Initialize and set Table width for horizontal scrolling here.
|
|
17995
18098
|
ngAfterViewInit() {
|
|
@@ -18031,7 +18134,10 @@ class DatagridMainRenderer {
|
|
|
18031
18134
|
setupColumns() {
|
|
18032
18135
|
this.headers.forEach((header, index) => header.setColumnState(index));
|
|
18033
18136
|
this.columnsService.columns.splice(this.headers.length); // Trim any old columns
|
|
18034
|
-
|
|
18137
|
+
// Sets columnIndex for each column
|
|
18138
|
+
this.columnsService.columns.forEach((column, index) => {
|
|
18139
|
+
this.columnsService.emitStateChange(column, { changes: [DatagridColumnChanges.INITIALIZE], columnIndex: index });
|
|
18140
|
+
});
|
|
18035
18141
|
}
|
|
18036
18142
|
shouldComputeHeight() {
|
|
18037
18143
|
if (!this._heightSet && this.page.size > 0) {
|
|
@@ -18088,6 +18194,10 @@ class DatagridMainRenderer {
|
|
|
18088
18194
|
});
|
|
18089
18195
|
}
|
|
18090
18196
|
columnStateChanged(state) {
|
|
18197
|
+
// eslint-disable-next-line eqeqeq
|
|
18198
|
+
if (!this.headers || state.columnIndex == null) {
|
|
18199
|
+
return;
|
|
18200
|
+
}
|
|
18091
18201
|
const columnIndex = state.columnIndex;
|
|
18092
18202
|
if (state.changes && state.changes.length) {
|
|
18093
18203
|
state.changes.forEach(change => {
|
|
@@ -18095,7 +18205,7 @@ class DatagridMainRenderer {
|
|
|
18095
18205
|
case DatagridColumnChanges.WIDTH:
|
|
18096
18206
|
this.headers.get(columnIndex).setWidth(state);
|
|
18097
18207
|
this.rows.forEach(row => {
|
|
18098
|
-
if (row.
|
|
18208
|
+
if (row?.cells.length === this.columnsService.columns.length) {
|
|
18099
18209
|
row.cells.get(columnIndex).setWidth(state);
|
|
18100
18210
|
}
|
|
18101
18211
|
});
|
|
@@ -18109,23 +18219,20 @@ class DatagridMainRenderer {
|
|
|
18109
18219
|
});
|
|
18110
18220
|
this.keyNavigation.resetKeyGrid();
|
|
18111
18221
|
break;
|
|
18222
|
+
case DatagridColumnChanges.INITIALIZE:
|
|
18223
|
+
if (state.hideable && state.hidden) {
|
|
18224
|
+
this.headers.get(columnIndex).setHidden(state);
|
|
18225
|
+
this.rows.forEach(row => {
|
|
18226
|
+
row.setCellsState();
|
|
18227
|
+
});
|
|
18228
|
+
}
|
|
18229
|
+
break;
|
|
18112
18230
|
default:
|
|
18113
18231
|
break;
|
|
18114
18232
|
}
|
|
18115
18233
|
});
|
|
18116
18234
|
}
|
|
18117
18235
|
}
|
|
18118
|
-
listenForColumnChanges() {
|
|
18119
|
-
this.columnsService.columns.forEach((column, index) => {
|
|
18120
|
-
this.columnsService.emitStateChange(column, { changes: [], columnIndex: index });
|
|
18121
|
-
});
|
|
18122
|
-
/*
|
|
18123
|
-
Merges all column subject so we can track them at once
|
|
18124
|
-
and receive only the changed column as result
|
|
18125
|
-
*/
|
|
18126
|
-
const columnChanges = merge(...this.columnsService.columns);
|
|
18127
|
-
this.subscriptions.push(columnChanges.subscribe(change => this.columnStateChanged(change)));
|
|
18128
|
-
}
|
|
18129
18236
|
/**
|
|
18130
18237
|
* Triggers a whole re-rendring cycle to set column sizes, if needed.
|
|
18131
18238
|
*/
|
|
@@ -24485,13 +24592,13 @@ class ClrTimeline {
|
|
|
24485
24592
|
}
|
|
24486
24593
|
}
|
|
24487
24594
|
ClrTimeline.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24488
|
-
ClrTimeline.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTimeline, selector: "clr-timeline", inputs: { layout: ["clrLayout", "layout"] }, host: { properties: { "class.clr-timeline": "true", "class.clr-timeline-vertical": "this.isVertical" } }, providers: [TimelineIconAttributeService], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
24595
|
+
ClrTimeline.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTimeline, selector: "clr-timeline", inputs: { layout: ["clrLayout", "layout"] }, host: { properties: { "class.clr-timeline": "true", "attr.role": "\"list\"", "class.clr-timeline-vertical": "this.isVertical" } }, providers: [TimelineIconAttributeService], ngImport: i0, template: `<ng-content></ng-content>`, isInline: true });
|
|
24489
24596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, decorators: [{
|
|
24490
24597
|
type: Component,
|
|
24491
24598
|
args: [{
|
|
24492
24599
|
selector: 'clr-timeline',
|
|
24493
24600
|
template: `<ng-content></ng-content>`,
|
|
24494
|
-
host: { '[class.clr-timeline]': 'true' },
|
|
24601
|
+
host: { '[class.clr-timeline]': 'true', '[attr.role]': '"list"' },
|
|
24495
24602
|
providers: [TimelineIconAttributeService],
|
|
24496
24603
|
}]
|
|
24497
24604
|
}], propDecorators: { layout: [{
|
|
@@ -24562,7 +24669,7 @@ class ClrTimelineStep {
|
|
|
24562
24669
|
}
|
|
24563
24670
|
}
|
|
24564
24671
|
ClrTimelineStep.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimelineStep, deps: [{ token: TimelineIconAttributeService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
24565
|
-
ClrTimelineStep.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTimelineStep, selector: "clr-timeline-step", inputs: { state: ["clrState", "state"] }, host: { properties: { "class.clr-timeline-step": "true" } }, queries: [{ propertyName: "stepTitle", first: true, predicate: ClrTimelineStepTitle, descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
24672
|
+
ClrTimelineStep.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrTimelineStep, selector: "clr-timeline-step", inputs: { state: ["clrState", "state"] }, host: { properties: { "class.clr-timeline-step": "true", "attr.role": "\"listitem\"" } }, queries: [{ propertyName: "stepTitle", first: true, predicate: ClrTimelineStepTitle, descendants: true, read: ElementRef }], ngImport: i0, template: `
|
|
24566
24673
|
<ng-content select="clr-timeline-step-header"></ng-content>
|
|
24567
24674
|
<span class="clr-sr-only">{{ stepTitleText }}</span>
|
|
24568
24675
|
<ng-container *ngIf="!isProcessing; else processing">
|
|
@@ -24606,7 +24713,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
24606
24713
|
<clr-spinner clrMedium [attr.aria-label]="iconAriaLabel"></clr-spinner>
|
|
24607
24714
|
</ng-template>
|
|
24608
24715
|
`,
|
|
24609
|
-
host: { '[class.clr-timeline-step]': 'true' },
|
|
24716
|
+
host: { '[class.clr-timeline-step]': 'true', '[attr.role]': '"listitem"' },
|
|
24610
24717
|
}]
|
|
24611
24718
|
}], ctorParameters: function () { return [{ type: TimelineIconAttributeService }, { type: undefined, decorators: [{
|
|
24612
24719
|
type: Inject,
|