@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/fesm2015/clr-angular.mjs
CHANGED
|
@@ -327,7 +327,7 @@ const commonStringsDefault = {
|
|
|
327
327
|
singleSelectionAriaLabel: 'Single selection header',
|
|
328
328
|
singleActionableAriaLabel: 'Single actionable header',
|
|
329
329
|
detailExpandableAriaLabel: 'Toggle more row content',
|
|
330
|
-
datagridFilterAriaLabel: '
|
|
330
|
+
datagridFilterAriaLabel: '{COLUMN} filter',
|
|
331
331
|
datagridFilterDialogAriaLabel: 'Filter dialog',
|
|
332
332
|
columnSeparatorAriaLabel: 'Column resize handle',
|
|
333
333
|
columnSeparatorDescription: 'Use left or right key to resize the column',
|
|
@@ -4771,7 +4771,10 @@ class ClrAbstractContainer {
|
|
|
4771
4771
|
this.subscriptions = [];
|
|
4772
4772
|
this.subscriptions.push(this.ifControlStateService.statusChanges.subscribe((state) => {
|
|
4773
4773
|
this.state = state;
|
|
4774
|
-
|
|
4774
|
+
// Make sure everything is updated before dispatching the values for helpers
|
|
4775
|
+
setTimeout(() => {
|
|
4776
|
+
this.updateHelpers();
|
|
4777
|
+
});
|
|
4775
4778
|
}));
|
|
4776
4779
|
this.subscriptions.push(this.ngControlService.controlChanges.subscribe(control => {
|
|
4777
4780
|
this.control = control;
|
|
@@ -12187,6 +12190,196 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12187
12190
|
type: Directive
|
|
12188
12191
|
}], ctorParameters: function () { return [{ type: FiltersProvider }]; } });
|
|
12189
12192
|
|
|
12193
|
+
/*
|
|
12194
|
+
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12195
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
12196
|
+
* This software is released under MIT license.
|
|
12197
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
12198
|
+
*/
|
|
12199
|
+
function getTabableItems(el) {
|
|
12200
|
+
const tabableSelector = [
|
|
12201
|
+
'a[href]',
|
|
12202
|
+
'area[href]',
|
|
12203
|
+
'input:not([disabled])',
|
|
12204
|
+
'button:not([disabled])',
|
|
12205
|
+
'select:not([disabled])',
|
|
12206
|
+
'textarea:not([disabled])',
|
|
12207
|
+
'iframe',
|
|
12208
|
+
'object',
|
|
12209
|
+
'embed',
|
|
12210
|
+
'*[tabindex]',
|
|
12211
|
+
'*[contenteditable=true]',
|
|
12212
|
+
'[role=button]:not([disabled])',
|
|
12213
|
+
].join(',');
|
|
12214
|
+
return Array.from(el.querySelectorAll(tabableSelector));
|
|
12215
|
+
}
|
|
12216
|
+
class KeyNavigationGridController {
|
|
12217
|
+
constructor(zone) {
|
|
12218
|
+
this.zone = zone;
|
|
12219
|
+
this.skipItemFocus = false;
|
|
12220
|
+
this.listenersAdded = false;
|
|
12221
|
+
this.destroy$ = new Subject();
|
|
12222
|
+
this._activeCell = null;
|
|
12223
|
+
this.config = {
|
|
12224
|
+
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
12225
|
+
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
12226
|
+
keyGrid: '[role=grid]',
|
|
12227
|
+
};
|
|
12228
|
+
}
|
|
12229
|
+
get grid() {
|
|
12230
|
+
var _a;
|
|
12231
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector(this.config.keyGrid);
|
|
12232
|
+
}
|
|
12233
|
+
get rows() {
|
|
12234
|
+
var _a;
|
|
12235
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridRows);
|
|
12236
|
+
}
|
|
12237
|
+
get cells() {
|
|
12238
|
+
var _a;
|
|
12239
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridCells);
|
|
12240
|
+
}
|
|
12241
|
+
ngOnDestroy() {
|
|
12242
|
+
this.destroy$.next();
|
|
12243
|
+
this.destroy$.complete();
|
|
12244
|
+
}
|
|
12245
|
+
addListeners() {
|
|
12246
|
+
if (this.listenersAdded) {
|
|
12247
|
+
return;
|
|
12248
|
+
}
|
|
12249
|
+
this.zone.runOutsideAngular(() => {
|
|
12250
|
+
fromEvent(this.grid, 'mousedown')
|
|
12251
|
+
.pipe(takeUntil(this.destroy$))
|
|
12252
|
+
.subscribe((e) => {
|
|
12253
|
+
// 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
|
|
12254
|
+
if (e.buttons === 1 && !e.ctrlKey) {
|
|
12255
|
+
const activeCell = this.cells
|
|
12256
|
+
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
12257
|
+
: null;
|
|
12258
|
+
if (activeCell) {
|
|
12259
|
+
this.setActiveCell(activeCell);
|
|
12260
|
+
}
|
|
12261
|
+
}
|
|
12262
|
+
});
|
|
12263
|
+
fromEvent(this.grid, 'wheel')
|
|
12264
|
+
.pipe(takeUntil(this.destroy$))
|
|
12265
|
+
.subscribe(() => {
|
|
12266
|
+
this.removeActiveCell();
|
|
12267
|
+
});
|
|
12268
|
+
fromEvent(this.grid, 'keydown')
|
|
12269
|
+
.pipe(takeUntil(this.destroy$))
|
|
12270
|
+
.subscribe((e) => {
|
|
12271
|
+
// Skip column resize events
|
|
12272
|
+
if (e.target.classList.contains('drag-handle') &&
|
|
12273
|
+
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
12274
|
+
return;
|
|
12275
|
+
}
|
|
12276
|
+
if (e.code === 'ArrowUp' ||
|
|
12277
|
+
e.code === 'ArrowDown' ||
|
|
12278
|
+
e.code === 'ArrowLeft' ||
|
|
12279
|
+
e.code === 'ArrowRight' ||
|
|
12280
|
+
e.code === 'End' ||
|
|
12281
|
+
e.code === 'Home' ||
|
|
12282
|
+
e.code === 'PageUp' ||
|
|
12283
|
+
e.code === 'PageDown') {
|
|
12284
|
+
const { x, y } = this.getNextItemCoordinate(e);
|
|
12285
|
+
const activeItem = this.rows
|
|
12286
|
+
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
12287
|
+
: null;
|
|
12288
|
+
if (activeItem) {
|
|
12289
|
+
this.setActiveCell(activeItem);
|
|
12290
|
+
}
|
|
12291
|
+
e.preventDefault();
|
|
12292
|
+
}
|
|
12293
|
+
});
|
|
12294
|
+
});
|
|
12295
|
+
this.listenersAdded = true;
|
|
12296
|
+
}
|
|
12297
|
+
initializeKeyGrid(host) {
|
|
12298
|
+
this.host = host;
|
|
12299
|
+
this.addListeners();
|
|
12300
|
+
this.resetKeyGrid();
|
|
12301
|
+
}
|
|
12302
|
+
resetKeyGrid() {
|
|
12303
|
+
var _a;
|
|
12304
|
+
(_a = this.cells) === null || _a === void 0 ? void 0 : _a.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
12305
|
+
const firstCell = this.cells ? this.cells[0] : null;
|
|
12306
|
+
firstCell === null || firstCell === void 0 ? void 0 : firstCell.setAttribute('tabindex', '0');
|
|
12307
|
+
}
|
|
12308
|
+
removeActiveCell() {
|
|
12309
|
+
this._activeCell = null;
|
|
12310
|
+
}
|
|
12311
|
+
getActiveCell() {
|
|
12312
|
+
return this._activeCell;
|
|
12313
|
+
}
|
|
12314
|
+
setActiveCell(activeCell) {
|
|
12315
|
+
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
12316
|
+
if (prior) {
|
|
12317
|
+
prior.setAttribute('tabindex', '-1');
|
|
12318
|
+
}
|
|
12319
|
+
activeCell.setAttribute('tabindex', '0');
|
|
12320
|
+
this._activeCell = activeCell;
|
|
12321
|
+
const items = getTabableItems(activeCell);
|
|
12322
|
+
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
12323
|
+
if (!this.skipItemFocus) {
|
|
12324
|
+
item.focus();
|
|
12325
|
+
}
|
|
12326
|
+
}
|
|
12327
|
+
getNextItemCoordinate(e) {
|
|
12328
|
+
var _a;
|
|
12329
|
+
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
12330
|
+
if (e.code === 'Tab') {
|
|
12331
|
+
currentCell = document.activeElement;
|
|
12332
|
+
}
|
|
12333
|
+
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
12334
|
+
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
12335
|
+
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
12336
|
+
let x = currentRow && currentCell
|
|
12337
|
+
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
12338
|
+
: 0;
|
|
12339
|
+
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
12340
|
+
const dir = this.host.dir;
|
|
12341
|
+
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
12342
|
+
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
12343
|
+
const itemsPerPage = Math.floor(((_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector('.datagrid').clientHeight) / this.rows[0].clientHeight) - 1 || 0;
|
|
12344
|
+
if (e.code === 'ArrowUp' && y !== 0) {
|
|
12345
|
+
y = y - 1;
|
|
12346
|
+
}
|
|
12347
|
+
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
12348
|
+
y = y + 1;
|
|
12349
|
+
}
|
|
12350
|
+
else if (e.code === inlineStart && x !== 0) {
|
|
12351
|
+
x = x - 1;
|
|
12352
|
+
}
|
|
12353
|
+
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
12354
|
+
x = x + 1;
|
|
12355
|
+
}
|
|
12356
|
+
else if (e.code === 'End') {
|
|
12357
|
+
x = numOfColumns;
|
|
12358
|
+
if (e.ctrlKey) {
|
|
12359
|
+
y = numOfRows;
|
|
12360
|
+
}
|
|
12361
|
+
}
|
|
12362
|
+
else if (e.code === 'Home') {
|
|
12363
|
+
x = 0;
|
|
12364
|
+
if (e.ctrlKey) {
|
|
12365
|
+
y = 0;
|
|
12366
|
+
}
|
|
12367
|
+
}
|
|
12368
|
+
else if (e.code === 'PageUp') {
|
|
12369
|
+
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
12370
|
+
}
|
|
12371
|
+
else if (e.code === 'PageDown') {
|
|
12372
|
+
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
12373
|
+
}
|
|
12374
|
+
return { x, y };
|
|
12375
|
+
}
|
|
12376
|
+
}
|
|
12377
|
+
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12378
|
+
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
12379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
12380
|
+
type: Injectable
|
|
12381
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
12382
|
+
|
|
12190
12383
|
/*
|
|
12191
12384
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12192
12385
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -12199,12 +12392,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12199
12392
|
* since it can be anything (not just a text input).
|
|
12200
12393
|
*/
|
|
12201
12394
|
class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
12202
|
-
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef) {
|
|
12395
|
+
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef, keyNavigation) {
|
|
12203
12396
|
super(_filters);
|
|
12204
12397
|
this.commonStrings = commonStrings;
|
|
12205
12398
|
this.smartToggleService = smartToggleService;
|
|
12206
12399
|
this.platformId = platformId;
|
|
12207
12400
|
this.elementRef = elementRef;
|
|
12401
|
+
this.keyNavigation = keyNavigation;
|
|
12208
12402
|
this.openChange = new EventEmitter(false);
|
|
12209
12403
|
this.ariaExpanded = false;
|
|
12210
12404
|
this.popoverId = uniqueIdFactory();
|
|
@@ -12233,6 +12427,9 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12233
12427
|
if (!open && isPlatformBrowser(this.platformId)) {
|
|
12234
12428
|
this.anchor.nativeElement.focus();
|
|
12235
12429
|
}
|
|
12430
|
+
if (this.keyNavigation) {
|
|
12431
|
+
this.keyNavigation.skipItemFocus = open;
|
|
12432
|
+
}
|
|
12236
12433
|
// keep track of the state
|
|
12237
12434
|
this._open = open;
|
|
12238
12435
|
}
|
|
@@ -12247,7 +12444,9 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12247
12444
|
return !!this.filter && this.filter.isActive();
|
|
12248
12445
|
}
|
|
12249
12446
|
ngOnChanges() {
|
|
12250
|
-
|
|
12447
|
+
setTimeout(() => {
|
|
12448
|
+
this.setToggleButtonAriaLabel();
|
|
12449
|
+
});
|
|
12251
12450
|
}
|
|
12252
12451
|
ngOnDestroy() {
|
|
12253
12452
|
super.ngOnDestroy();
|
|
@@ -12267,7 +12466,7 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12267
12466
|
});
|
|
12268
12467
|
}
|
|
12269
12468
|
}
|
|
12270
|
-
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 });
|
|
12469
|
+
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 });
|
|
12271
12470
|
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: `
|
|
12272
12471
|
<button
|
|
12273
12472
|
class="datagrid-filter-toggle"
|
|
@@ -12353,7 +12552,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12353
12552
|
return [{ type: FiltersProvider }, { type: ClrCommonStringsService }, { type: ClrPopoverToggleService }, { type: undefined, decorators: [{
|
|
12354
12553
|
type: Inject,
|
|
12355
12554
|
args: [PLATFORM_ID]
|
|
12356
|
-
}] }, { type: i0.ElementRef }
|
|
12555
|
+
}] }, { type: i0.ElementRef }, { type: KeyNavigationGridController, decorators: [{
|
|
12556
|
+
type: Optional
|
|
12557
|
+
}] }];
|
|
12357
12558
|
}, propDecorators: { openChange: [{
|
|
12358
12559
|
type: Output,
|
|
12359
12560
|
args: ['clrDgFilterOpenChange']
|
|
@@ -13116,6 +13317,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
13116
13317
|
class DetailService {
|
|
13117
13318
|
constructor(modalStackService) {
|
|
13118
13319
|
this.modalStackService = modalStackService;
|
|
13320
|
+
this.preventScroll = false;
|
|
13119
13321
|
this.toggleState = false;
|
|
13120
13322
|
this._enabled = false;
|
|
13121
13323
|
this._state = new BehaviorSubject(this.toggleState);
|
|
@@ -13126,6 +13328,12 @@ class DetailService {
|
|
|
13126
13328
|
set enabled(state) {
|
|
13127
13329
|
this._enabled = state;
|
|
13128
13330
|
}
|
|
13331
|
+
get preventFocusScroll() {
|
|
13332
|
+
return this.preventScroll;
|
|
13333
|
+
}
|
|
13334
|
+
set preventFocusScroll(preventScroll) {
|
|
13335
|
+
this.preventScroll = preventScroll;
|
|
13336
|
+
}
|
|
13129
13337
|
get state() {
|
|
13130
13338
|
return this.cache;
|
|
13131
13339
|
}
|
|
@@ -13144,15 +13352,13 @@ class DetailService {
|
|
|
13144
13352
|
}
|
|
13145
13353
|
close() {
|
|
13146
13354
|
this.toggleState = false;
|
|
13355
|
+
this.returnFocus();
|
|
13147
13356
|
this._state.next(this.toggleState);
|
|
13148
13357
|
this.modalStackService.trackModalClose(this);
|
|
13149
|
-
// In the case of browser zoom greater than 250%, the detail pane toggle button is not visible on the page.
|
|
13150
|
-
// Wait for the detail pane to close, and return focus to the detail toggle button.
|
|
13151
|
-
setTimeout(() => this.returnFocus(), 0);
|
|
13152
13358
|
}
|
|
13153
13359
|
returnFocus() {
|
|
13154
13360
|
if (this.button) {
|
|
13155
|
-
this.button.focus();
|
|
13361
|
+
this.button.focus({ preventScroll: this.preventFocusScroll });
|
|
13156
13362
|
this.button = null;
|
|
13157
13363
|
}
|
|
13158
13364
|
}
|
|
@@ -15453,7 +15659,7 @@ ClrDatagridRow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
15453
15659
|
DatagridIfExpandService,
|
|
15454
15660
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15455
15661
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15456
|
-
], 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" }] });
|
|
15662
|
+
], 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" }] });
|
|
15457
15663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridRow, decorators: [{
|
|
15458
15664
|
type: Component,
|
|
15459
15665
|
args: [{ selector: 'clr-dg-row', host: {
|
|
@@ -15465,7 +15671,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15465
15671
|
DatagridIfExpandService,
|
|
15466
15672
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15467
15673
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15468
|
-
], 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" }]
|
|
15674
|
+
], 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" }]
|
|
15469
15675
|
}], ctorParameters: function () {
|
|
15470
15676
|
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: [{
|
|
15471
15677
|
type: Inject,
|
|
@@ -15525,10 +15731,11 @@ var DatagridColumnChanges;
|
|
|
15525
15731
|
(function (DatagridColumnChanges) {
|
|
15526
15732
|
DatagridColumnChanges[DatagridColumnChanges["WIDTH"] = 0] = "WIDTH";
|
|
15527
15733
|
DatagridColumnChanges[DatagridColumnChanges["HIDDEN"] = 1] = "HIDDEN";
|
|
15734
|
+
DatagridColumnChanges[DatagridColumnChanges["INITIALIZE"] = 2] = "INITIALIZE";
|
|
15528
15735
|
})(DatagridColumnChanges || (DatagridColumnChanges = {}));
|
|
15529
15736
|
const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
15530
15737
|
.map(key => DatagridColumnChanges[key])
|
|
15531
|
-
.filter(key => key === parseInt(key, 10)); // extracts only integer keys
|
|
15738
|
+
.filter(key => key === parseInt(key, 10) && key !== DatagridColumnChanges.INITIALIZE); // extracts only integer keys
|
|
15532
15739
|
|
|
15533
15740
|
/*
|
|
15534
15741
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -15539,6 +15746,7 @@ const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
|
15539
15746
|
class ColumnsService {
|
|
15540
15747
|
constructor() {
|
|
15541
15748
|
this.columns = [];
|
|
15749
|
+
this.columnsStateChange = new BehaviorSubject(null);
|
|
15542
15750
|
this._cache = [];
|
|
15543
15751
|
}
|
|
15544
15752
|
get columnStates() {
|
|
@@ -15560,7 +15768,9 @@ class ColumnsService {
|
|
|
15560
15768
|
resetToLastCache() {
|
|
15561
15769
|
this._cache.forEach((state, index) => {
|
|
15562
15770
|
// Just emit the exact value from the cache
|
|
15563
|
-
|
|
15771
|
+
const cachedState = Object.assign(Object.assign({}, state), { changes: ALL_COLUMN_CHANGES });
|
|
15772
|
+
this.columns[index].next(cachedState);
|
|
15773
|
+
this.columnsStateChange.next(cachedState);
|
|
15564
15774
|
});
|
|
15565
15775
|
this._cache = [];
|
|
15566
15776
|
}
|
|
@@ -15572,7 +15782,9 @@ class ColumnsService {
|
|
|
15572
15782
|
this.emitStateChange(this.columns[columnIndex], diff);
|
|
15573
15783
|
}
|
|
15574
15784
|
emitStateChange(column, diff) {
|
|
15575
|
-
|
|
15785
|
+
const changedState = Object.assign(Object.assign({}, column.value), diff);
|
|
15786
|
+
column.next(changedState);
|
|
15787
|
+
this.columnsStateChange.next(changedState);
|
|
15576
15788
|
}
|
|
15577
15789
|
}
|
|
15578
15790
|
ColumnsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ColumnsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -15648,193 +15860,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15648
15860
|
type: Injectable
|
|
15649
15861
|
}], ctorParameters: function () { return [{ type: FiltersProvider }, { type: Sort }, { type: Page }, { type: StateDebouncer }]; } });
|
|
15650
15862
|
|
|
15651
|
-
/*
|
|
15652
|
-
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15653
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
15654
|
-
* This software is released under MIT license.
|
|
15655
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
15656
|
-
*/
|
|
15657
|
-
function getTabableItems(el) {
|
|
15658
|
-
const tabableSelector = [
|
|
15659
|
-
'a[href]',
|
|
15660
|
-
'area[href]',
|
|
15661
|
-
'input:not([disabled])',
|
|
15662
|
-
'button:not([disabled])',
|
|
15663
|
-
'select:not([disabled])',
|
|
15664
|
-
'textarea:not([disabled])',
|
|
15665
|
-
'iframe',
|
|
15666
|
-
'object',
|
|
15667
|
-
'embed',
|
|
15668
|
-
'*[tabindex]',
|
|
15669
|
-
'*[contenteditable=true]',
|
|
15670
|
-
'[role=button]:not([disabled])',
|
|
15671
|
-
].join(',');
|
|
15672
|
-
return Array.from(el.querySelectorAll(tabableSelector));
|
|
15673
|
-
}
|
|
15674
|
-
class KeyNavigationGridController {
|
|
15675
|
-
constructor(zone) {
|
|
15676
|
-
this.zone = zone;
|
|
15677
|
-
this.listenersAdded = false;
|
|
15678
|
-
this.destroy$ = new Subject();
|
|
15679
|
-
this._activeCell = null;
|
|
15680
|
-
this.config = {
|
|
15681
|
-
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
15682
|
-
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
15683
|
-
keyGrid: '[role=grid]',
|
|
15684
|
-
};
|
|
15685
|
-
}
|
|
15686
|
-
get grid() {
|
|
15687
|
-
var _a;
|
|
15688
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector(this.config.keyGrid);
|
|
15689
|
-
}
|
|
15690
|
-
get rows() {
|
|
15691
|
-
var _a;
|
|
15692
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridRows);
|
|
15693
|
-
}
|
|
15694
|
-
get cells() {
|
|
15695
|
-
var _a;
|
|
15696
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridCells);
|
|
15697
|
-
}
|
|
15698
|
-
ngOnDestroy() {
|
|
15699
|
-
this.destroy$.next();
|
|
15700
|
-
this.destroy$.complete();
|
|
15701
|
-
}
|
|
15702
|
-
addListeners() {
|
|
15703
|
-
if (this.listenersAdded) {
|
|
15704
|
-
return;
|
|
15705
|
-
}
|
|
15706
|
-
this.zone.runOutsideAngular(() => {
|
|
15707
|
-
fromEvent(this.grid, 'mousedown')
|
|
15708
|
-
.pipe(takeUntil(this.destroy$))
|
|
15709
|
-
.subscribe((e) => {
|
|
15710
|
-
// 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
|
|
15711
|
-
if (e.buttons === 1 && !e.ctrlKey) {
|
|
15712
|
-
const activeCell = this.cells
|
|
15713
|
-
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
15714
|
-
: null;
|
|
15715
|
-
if (activeCell) {
|
|
15716
|
-
this.setActiveCell(activeCell);
|
|
15717
|
-
}
|
|
15718
|
-
}
|
|
15719
|
-
});
|
|
15720
|
-
fromEvent(this.grid, 'wheel')
|
|
15721
|
-
.pipe(takeUntil(this.destroy$))
|
|
15722
|
-
.subscribe(() => {
|
|
15723
|
-
this.removeActiveCell();
|
|
15724
|
-
});
|
|
15725
|
-
fromEvent(this.grid, 'keydown')
|
|
15726
|
-
.pipe(takeUntil(this.destroy$))
|
|
15727
|
-
.subscribe((e) => {
|
|
15728
|
-
// Skip column resize events
|
|
15729
|
-
if (e.target.classList.contains('drag-handle') &&
|
|
15730
|
-
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
15731
|
-
return;
|
|
15732
|
-
}
|
|
15733
|
-
if (e.code === 'ArrowUp' ||
|
|
15734
|
-
e.code === 'ArrowDown' ||
|
|
15735
|
-
e.code === 'ArrowLeft' ||
|
|
15736
|
-
e.code === 'ArrowRight' ||
|
|
15737
|
-
e.code === 'End' ||
|
|
15738
|
-
e.code === 'Home' ||
|
|
15739
|
-
e.code === 'PageUp' ||
|
|
15740
|
-
e.code === 'PageDown') {
|
|
15741
|
-
const { x, y } = this.getNextItemCoordinate(e);
|
|
15742
|
-
const activeItem = this.rows
|
|
15743
|
-
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
15744
|
-
: null;
|
|
15745
|
-
if (activeItem) {
|
|
15746
|
-
this.setActiveCell(activeItem);
|
|
15747
|
-
}
|
|
15748
|
-
e.preventDefault();
|
|
15749
|
-
}
|
|
15750
|
-
});
|
|
15751
|
-
});
|
|
15752
|
-
this.listenersAdded = true;
|
|
15753
|
-
}
|
|
15754
|
-
initializeKeyGrid(host) {
|
|
15755
|
-
this.host = host;
|
|
15756
|
-
this.addListeners();
|
|
15757
|
-
this.resetKeyGrid();
|
|
15758
|
-
}
|
|
15759
|
-
resetKeyGrid() {
|
|
15760
|
-
var _a;
|
|
15761
|
-
(_a = this.cells) === null || _a === void 0 ? void 0 : _a.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
15762
|
-
const firstCell = this.cells ? this.cells[0] : null;
|
|
15763
|
-
firstCell === null || firstCell === void 0 ? void 0 : firstCell.setAttribute('tabindex', '0');
|
|
15764
|
-
}
|
|
15765
|
-
removeActiveCell() {
|
|
15766
|
-
this._activeCell = null;
|
|
15767
|
-
}
|
|
15768
|
-
getActiveCell() {
|
|
15769
|
-
return this._activeCell;
|
|
15770
|
-
}
|
|
15771
|
-
setActiveCell(activeCell) {
|
|
15772
|
-
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
15773
|
-
if (prior) {
|
|
15774
|
-
prior.setAttribute('tabindex', '-1');
|
|
15775
|
-
}
|
|
15776
|
-
activeCell.setAttribute('tabindex', '0');
|
|
15777
|
-
const items = getTabableItems(activeCell);
|
|
15778
|
-
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
15779
|
-
item.focus();
|
|
15780
|
-
this._activeCell = item;
|
|
15781
|
-
}
|
|
15782
|
-
getNextItemCoordinate(e) {
|
|
15783
|
-
var _a;
|
|
15784
|
-
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
15785
|
-
if (e.code === 'Tab') {
|
|
15786
|
-
currentCell = document.activeElement;
|
|
15787
|
-
}
|
|
15788
|
-
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
15789
|
-
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
15790
|
-
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
15791
|
-
let x = currentRow && currentCell
|
|
15792
|
-
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
15793
|
-
: 0;
|
|
15794
|
-
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
15795
|
-
const dir = this.host.dir;
|
|
15796
|
-
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
15797
|
-
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
15798
|
-
const itemsPerPage = Math.floor(((_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector('.datagrid').clientHeight) / this.rows[0].clientHeight) - 1 || 0;
|
|
15799
|
-
if (e.code === 'ArrowUp' && y !== 0) {
|
|
15800
|
-
y = y - 1;
|
|
15801
|
-
}
|
|
15802
|
-
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
15803
|
-
y = y + 1;
|
|
15804
|
-
}
|
|
15805
|
-
else if (e.code === inlineStart && x !== 0) {
|
|
15806
|
-
x = x - 1;
|
|
15807
|
-
}
|
|
15808
|
-
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
15809
|
-
x = x + 1;
|
|
15810
|
-
}
|
|
15811
|
-
else if (e.code === 'End') {
|
|
15812
|
-
x = numOfColumns;
|
|
15813
|
-
if (e.ctrlKey) {
|
|
15814
|
-
y = numOfRows;
|
|
15815
|
-
}
|
|
15816
|
-
}
|
|
15817
|
-
else if (e.code === 'Home') {
|
|
15818
|
-
x = 0;
|
|
15819
|
-
if (e.ctrlKey) {
|
|
15820
|
-
y = 0;
|
|
15821
|
-
}
|
|
15822
|
-
}
|
|
15823
|
-
else if (e.code === 'PageUp') {
|
|
15824
|
-
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
15825
|
-
}
|
|
15826
|
-
else if (e.code === 'PageDown') {
|
|
15827
|
-
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
15828
|
-
}
|
|
15829
|
-
return { x, y };
|
|
15830
|
-
}
|
|
15831
|
-
}
|
|
15832
|
-
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
15833
|
-
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
15834
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
15835
|
-
type: Injectable
|
|
15836
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
15837
|
-
|
|
15838
15863
|
/*
|
|
15839
15864
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15840
15865
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -15868,7 +15893,6 @@ class DatagridCellRenderer {
|
|
|
15868
15893
|
}
|
|
15869
15894
|
}
|
|
15870
15895
|
resetState(state) {
|
|
15871
|
-
state.changes = ALL_COLUMN_CHANGES;
|
|
15872
15896
|
this.setWidth(state);
|
|
15873
15897
|
this.setHidden(state);
|
|
15874
15898
|
}
|
|
@@ -16101,12 +16125,16 @@ class ClrDatagrid {
|
|
|
16101
16125
|
*/
|
|
16102
16126
|
if (row) {
|
|
16103
16127
|
this.detailService.open(row.item, row.detailButton.nativeElement);
|
|
16128
|
+
// always keep open when virtual scroll is available otherwise close it
|
|
16104
16129
|
}
|
|
16105
|
-
else if (!this.hasVirtualScroller
|
|
16106
|
-
|
|
16130
|
+
else if (!this.hasVirtualScroller) {
|
|
16131
|
+
// Using setTimeout to make sure the inner cycles in rows are done
|
|
16132
|
+
setTimeout(() => {
|
|
16133
|
+
this.detailService.close();
|
|
16134
|
+
});
|
|
16107
16135
|
}
|
|
16108
16136
|
}
|
|
16109
|
-
// retain active cell when navigating with PageUp and PageDown buttons in virtual scroller
|
|
16137
|
+
// retain active cell when navigating with Up/Down Arrows, PageUp and PageDown buttons in virtual scroller
|
|
16110
16138
|
const active = this.keyNavigation.getActiveCell();
|
|
16111
16139
|
if (active) {
|
|
16112
16140
|
this.zone.runOutsideAngular(() => {
|
|
@@ -16193,6 +16221,13 @@ class ClrDatagrid {
|
|
|
16193
16221
|
ngOnDestroy() {
|
|
16194
16222
|
this._subscriptions.forEach((sub) => sub.unsubscribe());
|
|
16195
16223
|
}
|
|
16224
|
+
toggleAllSelected($event) {
|
|
16225
|
+
$event.preventDefault();
|
|
16226
|
+
if (this.hasVirtualScroller) {
|
|
16227
|
+
return;
|
|
16228
|
+
}
|
|
16229
|
+
this.allSelected = !this.allSelected;
|
|
16230
|
+
}
|
|
16196
16231
|
resize() {
|
|
16197
16232
|
this.organizer.resize();
|
|
16198
16233
|
}
|
|
@@ -16220,7 +16255,7 @@ ClrDatagrid.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
|
16220
16255
|
ColumnsService,
|
|
16221
16256
|
DisplayModeService,
|
|
16222
16257
|
KeyNavigationGridController,
|
|
16223
|
-
], 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)=\"
|
|
16258
|
+
], 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" }] });
|
|
16224
16259
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagrid, decorators: [{
|
|
16225
16260
|
type: Component,
|
|
16226
16261
|
args: [{ selector: 'clr-datagrid', providers: [
|
|
@@ -16242,7 +16277,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16242
16277
|
], host: {
|
|
16243
16278
|
'[class.datagrid-host]': 'true',
|
|
16244
16279
|
'[class.datagrid-detail-open]': 'detailService.isOpen',
|
|
16245
|
-
}, 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)=\"
|
|
16280
|
+
}, 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" }]
|
|
16246
16281
|
}], ctorParameters: function () {
|
|
16247
16282
|
return [{ type: DatagridRenderOrganizer }, { type: Items }, { type: ExpandableRowsCount }, { type: Selection }, { type: RowActionService }, { type: StateProvider }, { type: DisplayModeService }, { type: i0.Renderer2 }, { type: DetailService }, { type: undefined, decorators: [{
|
|
16248
16283
|
type: Inject,
|
|
@@ -16413,6 +16448,7 @@ class ClrDatagridActionOverflow {
|
|
|
16413
16448
|
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 });
|
|
16414
16449
|
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: `
|
|
16415
16450
|
<button
|
|
16451
|
+
tabindex="-1"
|
|
16416
16452
|
class="datagrid-action-toggle"
|
|
16417
16453
|
type="button"
|
|
16418
16454
|
role="button"
|
|
@@ -16447,6 +16483,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16447
16483
|
hostDirectives: [ClrPopoverHostDirective],
|
|
16448
16484
|
template: `
|
|
16449
16485
|
<button
|
|
16486
|
+
tabindex="-1"
|
|
16450
16487
|
class="datagrid-action-toggle"
|
|
16451
16488
|
type="button"
|
|
16452
16489
|
role="button"
|
|
@@ -16754,10 +16791,13 @@ class ClrDatagridDetailHeader {
|
|
|
16754
16791
|
get titleId() {
|
|
16755
16792
|
return `${this.detailService.id}-title`;
|
|
16756
16793
|
}
|
|
16794
|
+
ngAfterViewInit() {
|
|
16795
|
+
this.title.nativeElement.focus();
|
|
16796
|
+
}
|
|
16757
16797
|
}
|
|
16758
16798
|
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 });
|
|
16759
|
-
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: `
|
|
16760
|
-
<div class="datagrid-detail-header-title"
|
|
16799
|
+
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: `
|
|
16800
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16761
16801
|
<ng-content></ng-content>
|
|
16762
16802
|
</div>
|
|
16763
16803
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16779,7 +16819,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16779
16819
|
'[class.datagrid-detail-header]': 'true',
|
|
16780
16820
|
},
|
|
16781
16821
|
template: `
|
|
16782
|
-
<div class="datagrid-detail-header-title"
|
|
16822
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16783
16823
|
<ng-content></ng-content>
|
|
16784
16824
|
</div>
|
|
16785
16825
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16794,7 +16834,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16794
16834
|
</div>
|
|
16795
16835
|
`,
|
|
16796
16836
|
}]
|
|
16797
|
-
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }
|
|
16837
|
+
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: { title: [{
|
|
16838
|
+
type: ViewChild,
|
|
16839
|
+
args: ['title']
|
|
16840
|
+
}] } });
|
|
16798
16841
|
|
|
16799
16842
|
/*
|
|
16800
16843
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -16807,21 +16850,43 @@ class ClrDatagridDetail {
|
|
|
16807
16850
|
this.detailService = detailService;
|
|
16808
16851
|
this.commonStrings = commonStrings;
|
|
16809
16852
|
}
|
|
16853
|
+
get labelledBy() {
|
|
16854
|
+
var _a;
|
|
16855
|
+
if (this.ariaLabelledBy) {
|
|
16856
|
+
return this.header ? `${this.header.titleId} ${this.ariaLabelledBy}` : this.ariaLabelledBy;
|
|
16857
|
+
}
|
|
16858
|
+
else if (this.ariaLabel) {
|
|
16859
|
+
// If aria-label is set by the end user, do not set aria-labelledby
|
|
16860
|
+
return null;
|
|
16861
|
+
}
|
|
16862
|
+
else {
|
|
16863
|
+
return ((_a = this.header) === null || _a === void 0 ? void 0 : _a.titleId) || '';
|
|
16864
|
+
}
|
|
16865
|
+
}
|
|
16866
|
+
get label() {
|
|
16867
|
+
if (!this.ariaLabelledBy) {
|
|
16868
|
+
return this.ariaLabel || null;
|
|
16869
|
+
}
|
|
16870
|
+
else {
|
|
16871
|
+
return null;
|
|
16872
|
+
}
|
|
16873
|
+
}
|
|
16810
16874
|
close() {
|
|
16811
16875
|
this.detailService.close();
|
|
16812
16876
|
}
|
|
16813
16877
|
}
|
|
16814
16878
|
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 });
|
|
16815
|
-
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: `
|
|
16879
|
+
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: `
|
|
16816
16880
|
<div
|
|
16817
16881
|
cdkTrapFocus
|
|
16818
|
-
[cdkTrapFocusAutoCapture]="
|
|
16882
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16819
16883
|
class="datagrid-detail-pane-content"
|
|
16820
16884
|
*ngIf="detailService.isOpen"
|
|
16821
16885
|
role="dialog"
|
|
16822
16886
|
[id]="detailService.id"
|
|
16823
16887
|
aria-modal="true"
|
|
16824
|
-
[attr.aria-
|
|
16888
|
+
[attr.aria-labelledby]="labelledBy"
|
|
16889
|
+
[attr.aria-label]="label"
|
|
16825
16890
|
>
|
|
16826
16891
|
<div class="clr-sr-only">{{ commonStrings.keys.detailPaneStart }}</div>
|
|
16827
16892
|
<ng-content></ng-content>
|
|
@@ -16840,13 +16905,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16840
16905
|
template: `
|
|
16841
16906
|
<div
|
|
16842
16907
|
cdkTrapFocus
|
|
16843
|
-
[cdkTrapFocusAutoCapture]="
|
|
16908
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16844
16909
|
class="datagrid-detail-pane-content"
|
|
16845
16910
|
*ngIf="detailService.isOpen"
|
|
16846
16911
|
role="dialog"
|
|
16847
16912
|
[id]="detailService.id"
|
|
16848
16913
|
aria-modal="true"
|
|
16849
|
-
[attr.aria-
|
|
16914
|
+
[attr.aria-labelledby]="labelledBy"
|
|
16915
|
+
[attr.aria-label]="label"
|
|
16850
16916
|
>
|
|
16851
16917
|
<div class="clr-sr-only">{{ commonStrings.keys.detailPaneStart }}</div>
|
|
16852
16918
|
<ng-content></ng-content>
|
|
@@ -16854,7 +16920,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16854
16920
|
</div>
|
|
16855
16921
|
`,
|
|
16856
16922
|
}]
|
|
16857
|
-
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: {
|
|
16923
|
+
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: { ariaLabelledBy: [{
|
|
16924
|
+
type: Input,
|
|
16925
|
+
args: ['clrDetailAriaLabelledBy']
|
|
16926
|
+
}], ariaLabel: [{
|
|
16927
|
+
type: Input,
|
|
16928
|
+
args: ['clrDetailAriaLabel']
|
|
16929
|
+
}], header: [{
|
|
16858
16930
|
type: ContentChild,
|
|
16859
16931
|
args: [ClrDatagridDetailHeader]
|
|
16860
16932
|
}] } });
|
|
@@ -17132,6 +17204,9 @@ class ClrIfDetail {
|
|
|
17132
17204
|
}
|
|
17133
17205
|
this.skip = false;
|
|
17134
17206
|
}
|
|
17207
|
+
get viewContext() {
|
|
17208
|
+
return { $implicit: this.detailService.state };
|
|
17209
|
+
}
|
|
17135
17210
|
ngOnInit() {
|
|
17136
17211
|
this.subscriptions.push(this.detailService.stateChange.subscribe(state => {
|
|
17137
17212
|
if (state === true) {
|
|
@@ -17148,12 +17223,11 @@ class ClrIfDetail {
|
|
|
17148
17223
|
togglePanel(showPanel) {
|
|
17149
17224
|
let stateChangeParams = null;
|
|
17150
17225
|
if (showPanel === true) {
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
this.embeddedViewRef = this.viewContainer.createEmbeddedView(this.templateRef, embeddedViewContext);
|
|
17226
|
+
if (!this.embeddedViewRef) {
|
|
17227
|
+
// Create a context forward `Proxy` that will always bind to the user-specified context,
|
|
17228
|
+
// without having to re-assign it whenever changes.
|
|
17229
|
+
const viewContext = this._createContextForwardProxy();
|
|
17230
|
+
this.embeddedViewRef = this.viewContainer.createEmbeddedView(this.templateRef, viewContext);
|
|
17157
17231
|
}
|
|
17158
17232
|
this.skip = true;
|
|
17159
17233
|
stateChangeParams = this.detailService.state;
|
|
@@ -17164,6 +17238,27 @@ class ClrIfDetail {
|
|
|
17164
17238
|
}
|
|
17165
17239
|
this.stateChange.emit(stateChangeParams);
|
|
17166
17240
|
}
|
|
17241
|
+
/**
|
|
17242
|
+
* For a given outlet instance, we create a proxy object that delegates
|
|
17243
|
+
* to the user-specified context. This allows changing, or swapping out
|
|
17244
|
+
* the context object completely without having to destroy/re-create the view.
|
|
17245
|
+
*/
|
|
17246
|
+
_createContextForwardProxy() {
|
|
17247
|
+
return new Proxy({}, {
|
|
17248
|
+
set: (_target, prop, newValue) => {
|
|
17249
|
+
if (!this.viewContext) {
|
|
17250
|
+
return false;
|
|
17251
|
+
}
|
|
17252
|
+
return Reflect.set(this.viewContext, prop, newValue);
|
|
17253
|
+
},
|
|
17254
|
+
get: (_target, prop, receiver) => {
|
|
17255
|
+
if (!this.viewContext) {
|
|
17256
|
+
return undefined;
|
|
17257
|
+
}
|
|
17258
|
+
return Reflect.get(this.viewContext, prop, receiver);
|
|
17259
|
+
},
|
|
17260
|
+
});
|
|
17261
|
+
}
|
|
17167
17262
|
}
|
|
17168
17263
|
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 });
|
|
17169
17264
|
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 });
|
|
@@ -17696,7 +17791,7 @@ const defaultCdkFixedSizeVirtualScrollInputs = {
|
|
|
17696
17791
|
maxBufferPx: 400,
|
|
17697
17792
|
};
|
|
17698
17793
|
class ClrDatagridVirtualScrollDirective {
|
|
17699
|
-
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, injector) {
|
|
17794
|
+
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, columnsService, injector) {
|
|
17700
17795
|
this.changeDetectorRef = changeDetectorRef;
|
|
17701
17796
|
this.iterableDiffers = iterableDiffers;
|
|
17702
17797
|
this.items = items;
|
|
@@ -17707,6 +17802,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17707
17802
|
this.scrollDispatcher = scrollDispatcher;
|
|
17708
17803
|
this.viewportRuler = viewportRuler;
|
|
17709
17804
|
this.datagrid = datagrid;
|
|
17805
|
+
this.columnsService = columnsService;
|
|
17710
17806
|
this.injector = injector;
|
|
17711
17807
|
this.renderedRangeChange = new EventEmitter();
|
|
17712
17808
|
this._cdkFixedSizeVirtualScrollInputs = Object.assign({}, defaultCdkFixedSizeVirtualScrollInputs);
|
|
@@ -17719,12 +17815,16 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17719
17815
|
}
|
|
17720
17816
|
});
|
|
17721
17817
|
});
|
|
17818
|
+
this.viewRepeater = new _RecycleViewRepeaterStrategy();
|
|
17722
17819
|
this.cdkVirtualForInputs = {
|
|
17723
17820
|
cdkVirtualForTrackBy: index => index,
|
|
17724
17821
|
};
|
|
17725
17822
|
this.items.smartenUp();
|
|
17726
17823
|
this.datagrid.hasVirtualScroller = true;
|
|
17824
|
+
this.datagrid.detailService.preventFocusScroll = true;
|
|
17727
17825
|
this.datagridElementRef = this.datagrid.el;
|
|
17826
|
+
// default
|
|
17827
|
+
this.cdkVirtualForTemplateCacheSize = 20;
|
|
17728
17828
|
this.mutationChanges.observe(this.datagridElementRef.nativeElement, {
|
|
17729
17829
|
attributeFilter: ['class'],
|
|
17730
17830
|
attributeOldValue: true,
|
|
@@ -17785,7 +17885,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17785
17885
|
ngAfterViewInit() {
|
|
17786
17886
|
this.injector.runInContext(() => {
|
|
17787
17887
|
this.virtualScrollViewport = this.createVirtualScrollViewportForDatagrid(this.changeDetectorRef, this.ngZone, this.directionality, this.scrollDispatcher, this.viewportRuler, this.datagridElementRef, this.virtualScrollStrategy);
|
|
17788
|
-
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers,
|
|
17888
|
+
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers, this.viewRepeater, this.virtualScrollViewport, this.ngZone);
|
|
17789
17889
|
this.virtualScrollViewport.ngOnInit();
|
|
17790
17890
|
});
|
|
17791
17891
|
this.gridRoleElement = this.datagridElementRef.nativeElement.querySelector('[role="grid"]');
|
|
@@ -17800,6 +17900,8 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17800
17900
|
if (datagridState.filters) {
|
|
17801
17901
|
this.virtualScrollViewport.scrollToIndex(0);
|
|
17802
17902
|
}
|
|
17903
|
+
}), this.columnsService.columnsStateChange.subscribe(() => {
|
|
17904
|
+
this.viewRepeater.detach();
|
|
17803
17905
|
}));
|
|
17804
17906
|
}
|
|
17805
17907
|
ngDoCheck() {
|
|
@@ -17875,7 +17977,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17875
17977
|
return virtualScrollViewport;
|
|
17876
17978
|
}
|
|
17877
17979
|
}
|
|
17878
|
-
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 });
|
|
17980
|
+
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 });
|
|
17879
17981
|
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 });
|
|
17880
17982
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridVirtualScrollDirective, decorators: [{
|
|
17881
17983
|
type: Directive,
|
|
@@ -17886,7 +17988,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
17886
17988
|
}], ctorParameters: function () {
|
|
17887
17989
|
return [{ type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }, { type: Items, decorators: [{
|
|
17888
17990
|
type: SkipSelf
|
|
17889
|
-
}] }, { 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 }];
|
|
17991
|
+
}] }, { 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 }];
|
|
17890
17992
|
}, propDecorators: { renderedRangeChange: [{
|
|
17891
17993
|
type: Output
|
|
17892
17994
|
}], cdkVirtualForOf: [{
|
|
@@ -18114,6 +18216,9 @@ class DatagridMainRenderer {
|
|
|
18114
18216
|
this.subscriptions.push(this.detailService.stateChange.subscribe(state => this.toggleDetailPane(state)));
|
|
18115
18217
|
this.subscriptions.push(this.items.change.subscribe(() => (this.shouldStabilizeColumns = true)));
|
|
18116
18218
|
}
|
|
18219
|
+
ngOnInit() {
|
|
18220
|
+
this.columnsService.columnsStateChange.subscribe(change => this.columnStateChanged(change));
|
|
18221
|
+
}
|
|
18117
18222
|
ngAfterContentInit() {
|
|
18118
18223
|
this.setupColumns();
|
|
18119
18224
|
this.subscriptions.push(this.headers.changes.subscribe(() => {
|
|
@@ -18123,7 +18228,6 @@ class DatagridMainRenderer {
|
|
|
18123
18228
|
this.columnsSizesStable = false;
|
|
18124
18229
|
this.stabilizeColumns();
|
|
18125
18230
|
}));
|
|
18126
|
-
this.listenForColumnChanges();
|
|
18127
18231
|
}
|
|
18128
18232
|
// Initialize and set Table width for horizontal scrolling here.
|
|
18129
18233
|
ngAfterViewInit() {
|
|
@@ -18165,7 +18269,10 @@ class DatagridMainRenderer {
|
|
|
18165
18269
|
setupColumns() {
|
|
18166
18270
|
this.headers.forEach((header, index) => header.setColumnState(index));
|
|
18167
18271
|
this.columnsService.columns.splice(this.headers.length); // Trim any old columns
|
|
18168
|
-
|
|
18272
|
+
// Sets columnIndex for each column
|
|
18273
|
+
this.columnsService.columns.forEach((column, index) => {
|
|
18274
|
+
this.columnsService.emitStateChange(column, { changes: [DatagridColumnChanges.INITIALIZE], columnIndex: index });
|
|
18275
|
+
});
|
|
18169
18276
|
}
|
|
18170
18277
|
shouldComputeHeight() {
|
|
18171
18278
|
if (!this._heightSet && this.page.size > 0) {
|
|
@@ -18219,6 +18326,10 @@ class DatagridMainRenderer {
|
|
|
18219
18326
|
});
|
|
18220
18327
|
}
|
|
18221
18328
|
columnStateChanged(state) {
|
|
18329
|
+
// eslint-disable-next-line eqeqeq
|
|
18330
|
+
if (!this.headers || state.columnIndex == null) {
|
|
18331
|
+
return;
|
|
18332
|
+
}
|
|
18222
18333
|
const columnIndex = state.columnIndex;
|
|
18223
18334
|
if (state.changes && state.changes.length) {
|
|
18224
18335
|
state.changes.forEach(change => {
|
|
@@ -18226,7 +18337,7 @@ class DatagridMainRenderer {
|
|
|
18226
18337
|
case DatagridColumnChanges.WIDTH:
|
|
18227
18338
|
this.headers.get(columnIndex).setWidth(state);
|
|
18228
18339
|
this.rows.forEach(row => {
|
|
18229
|
-
if (row
|
|
18340
|
+
if ((row === null || row === void 0 ? void 0 : row.cells.length) === this.columnsService.columns.length) {
|
|
18230
18341
|
row.cells.get(columnIndex).setWidth(state);
|
|
18231
18342
|
}
|
|
18232
18343
|
});
|
|
@@ -18240,23 +18351,20 @@ class DatagridMainRenderer {
|
|
|
18240
18351
|
});
|
|
18241
18352
|
this.keyNavigation.resetKeyGrid();
|
|
18242
18353
|
break;
|
|
18354
|
+
case DatagridColumnChanges.INITIALIZE:
|
|
18355
|
+
if (state.hideable && state.hidden) {
|
|
18356
|
+
this.headers.get(columnIndex).setHidden(state);
|
|
18357
|
+
this.rows.forEach(row => {
|
|
18358
|
+
row.setCellsState();
|
|
18359
|
+
});
|
|
18360
|
+
}
|
|
18361
|
+
break;
|
|
18243
18362
|
default:
|
|
18244
18363
|
break;
|
|
18245
18364
|
}
|
|
18246
18365
|
});
|
|
18247
18366
|
}
|
|
18248
18367
|
}
|
|
18249
|
-
listenForColumnChanges() {
|
|
18250
|
-
this.columnsService.columns.forEach((column, index) => {
|
|
18251
|
-
this.columnsService.emitStateChange(column, { changes: [], columnIndex: index });
|
|
18252
|
-
});
|
|
18253
|
-
/*
|
|
18254
|
-
Merges all column subject so we can track them at once
|
|
18255
|
-
and receive only the changed column as result
|
|
18256
|
-
*/
|
|
18257
|
-
const columnChanges = merge(...this.columnsService.columns);
|
|
18258
|
-
this.subscriptions.push(columnChanges.subscribe(change => this.columnStateChanged(change)));
|
|
18259
|
-
}
|
|
18260
18368
|
/**
|
|
18261
18369
|
* Triggers a whole re-rendring cycle to set column sizes, if needed.
|
|
18262
18370
|
*/
|
|
@@ -24663,13 +24771,13 @@ class ClrTimeline {
|
|
|
24663
24771
|
}
|
|
24664
24772
|
}
|
|
24665
24773
|
ClrTimeline.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24666
|
-
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 });
|
|
24774
|
+
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 });
|
|
24667
24775
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, decorators: [{
|
|
24668
24776
|
type: Component,
|
|
24669
24777
|
args: [{
|
|
24670
24778
|
selector: 'clr-timeline',
|
|
24671
24779
|
template: `<ng-content></ng-content>`,
|
|
24672
|
-
host: { '[class.clr-timeline]': 'true' },
|
|
24780
|
+
host: { '[class.clr-timeline]': 'true', '[attr.role]': '"list"' },
|
|
24673
24781
|
providers: [TimelineIconAttributeService],
|
|
24674
24782
|
}]
|
|
24675
24783
|
}], propDecorators: { layout: [{
|
|
@@ -24740,7 +24848,7 @@ class ClrTimelineStep {
|
|
|
24740
24848
|
}
|
|
24741
24849
|
}
|
|
24742
24850
|
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 });
|
|
24743
|
-
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: `
|
|
24851
|
+
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: `
|
|
24744
24852
|
<ng-content select="clr-timeline-step-header"></ng-content>
|
|
24745
24853
|
<span class="clr-sr-only">{{ stepTitleText }}</span>
|
|
24746
24854
|
<ng-container *ngIf="!isProcessing; else processing">
|
|
@@ -24784,7 +24892,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
24784
24892
|
<clr-spinner clrMedium [attr.aria-label]="iconAriaLabel"></clr-spinner>
|
|
24785
24893
|
</ng-template>
|
|
24786
24894
|
`,
|
|
24787
|
-
host: { '[class.clr-timeline-step]': 'true' },
|
|
24895
|
+
host: { '[class.clr-timeline-step]': 'true', '[attr.role]': '"listitem"' },
|
|
24788
24896
|
}]
|
|
24789
24897
|
}], ctorParameters: function () {
|
|
24790
24898
|
return [{ type: TimelineIconAttributeService }, { type: undefined, decorators: [{
|