@clr/angular 16.5.0 → 16.5.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 +13 -5
- package/data/datagrid/datagrid-detail-header.d.ts +4 -1
- package/data/datagrid/datagrid-filter.d.ts +4 -2
- 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 +3 -3
- package/esm2020/data/datagrid/datagrid-filter.mjs +19 -12
- 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 +9 -2
- 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/fesm2015/clr-angular.mjs +287 -231
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +282 -226
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
package/fesm2015/clr-angular.mjs
CHANGED
|
@@ -4765,7 +4765,10 @@ class ClrAbstractContainer {
|
|
|
4765
4765
|
this.subscriptions = [];
|
|
4766
4766
|
this.subscriptions.push(this.ifControlStateService.statusChanges.subscribe((state) => {
|
|
4767
4767
|
this.state = state;
|
|
4768
|
-
|
|
4768
|
+
// Make sure everything is updated before dispatching the values for helpers
|
|
4769
|
+
setTimeout(() => {
|
|
4770
|
+
this.updateHelpers();
|
|
4771
|
+
});
|
|
4769
4772
|
}));
|
|
4770
4773
|
this.subscriptions.push(this.ngControlService.controlChanges.subscribe(control => {
|
|
4771
4774
|
this.control = control;
|
|
@@ -12145,6 +12148,196 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12145
12148
|
type: Directive
|
|
12146
12149
|
}], ctorParameters: function () { return [{ type: FiltersProvider }]; } });
|
|
12147
12150
|
|
|
12151
|
+
/*
|
|
12152
|
+
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12153
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
12154
|
+
* This software is released under MIT license.
|
|
12155
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
12156
|
+
*/
|
|
12157
|
+
function getTabableItems(el) {
|
|
12158
|
+
const tabableSelector = [
|
|
12159
|
+
'a[href]',
|
|
12160
|
+
'area[href]',
|
|
12161
|
+
'input:not([disabled])',
|
|
12162
|
+
'button:not([disabled])',
|
|
12163
|
+
'select:not([disabled])',
|
|
12164
|
+
'textarea:not([disabled])',
|
|
12165
|
+
'iframe',
|
|
12166
|
+
'object',
|
|
12167
|
+
'embed',
|
|
12168
|
+
'*[tabindex]',
|
|
12169
|
+
'*[contenteditable=true]',
|
|
12170
|
+
'[role=button]:not([disabled])',
|
|
12171
|
+
].join(',');
|
|
12172
|
+
return Array.from(el.querySelectorAll(tabableSelector));
|
|
12173
|
+
}
|
|
12174
|
+
class KeyNavigationGridController {
|
|
12175
|
+
constructor(zone) {
|
|
12176
|
+
this.zone = zone;
|
|
12177
|
+
this.skipItemFocus = false;
|
|
12178
|
+
this.listenersAdded = false;
|
|
12179
|
+
this.destroy$ = new Subject();
|
|
12180
|
+
this._activeCell = null;
|
|
12181
|
+
this.config = {
|
|
12182
|
+
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
12183
|
+
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
12184
|
+
keyGrid: '[role=grid]',
|
|
12185
|
+
};
|
|
12186
|
+
}
|
|
12187
|
+
get grid() {
|
|
12188
|
+
var _a;
|
|
12189
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector(this.config.keyGrid);
|
|
12190
|
+
}
|
|
12191
|
+
get rows() {
|
|
12192
|
+
var _a;
|
|
12193
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridRows);
|
|
12194
|
+
}
|
|
12195
|
+
get cells() {
|
|
12196
|
+
var _a;
|
|
12197
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridCells);
|
|
12198
|
+
}
|
|
12199
|
+
ngOnDestroy() {
|
|
12200
|
+
this.destroy$.next();
|
|
12201
|
+
this.destroy$.complete();
|
|
12202
|
+
}
|
|
12203
|
+
addListeners() {
|
|
12204
|
+
if (this.listenersAdded) {
|
|
12205
|
+
return;
|
|
12206
|
+
}
|
|
12207
|
+
this.zone.runOutsideAngular(() => {
|
|
12208
|
+
fromEvent(this.grid, 'mousedown')
|
|
12209
|
+
.pipe(takeUntil(this.destroy$))
|
|
12210
|
+
.subscribe((e) => {
|
|
12211
|
+
// 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
|
|
12212
|
+
if (e.buttons === 1 && !e.ctrlKey) {
|
|
12213
|
+
const activeCell = this.cells
|
|
12214
|
+
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
12215
|
+
: null;
|
|
12216
|
+
if (activeCell) {
|
|
12217
|
+
this.setActiveCell(activeCell);
|
|
12218
|
+
}
|
|
12219
|
+
}
|
|
12220
|
+
});
|
|
12221
|
+
fromEvent(this.grid, 'wheel')
|
|
12222
|
+
.pipe(takeUntil(this.destroy$))
|
|
12223
|
+
.subscribe(() => {
|
|
12224
|
+
this.removeActiveCell();
|
|
12225
|
+
});
|
|
12226
|
+
fromEvent(this.grid, 'keydown')
|
|
12227
|
+
.pipe(takeUntil(this.destroy$))
|
|
12228
|
+
.subscribe((e) => {
|
|
12229
|
+
// Skip column resize events
|
|
12230
|
+
if (e.target.classList.contains('drag-handle') &&
|
|
12231
|
+
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
12232
|
+
return;
|
|
12233
|
+
}
|
|
12234
|
+
if (e.code === 'ArrowUp' ||
|
|
12235
|
+
e.code === 'ArrowDown' ||
|
|
12236
|
+
e.code === 'ArrowLeft' ||
|
|
12237
|
+
e.code === 'ArrowRight' ||
|
|
12238
|
+
e.code === 'End' ||
|
|
12239
|
+
e.code === 'Home' ||
|
|
12240
|
+
e.code === 'PageUp' ||
|
|
12241
|
+
e.code === 'PageDown') {
|
|
12242
|
+
const { x, y } = this.getNextItemCoordinate(e);
|
|
12243
|
+
const activeItem = this.rows
|
|
12244
|
+
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
12245
|
+
: null;
|
|
12246
|
+
if (activeItem) {
|
|
12247
|
+
this.setActiveCell(activeItem);
|
|
12248
|
+
}
|
|
12249
|
+
e.preventDefault();
|
|
12250
|
+
}
|
|
12251
|
+
});
|
|
12252
|
+
});
|
|
12253
|
+
this.listenersAdded = true;
|
|
12254
|
+
}
|
|
12255
|
+
initializeKeyGrid(host) {
|
|
12256
|
+
this.host = host;
|
|
12257
|
+
this.addListeners();
|
|
12258
|
+
this.resetKeyGrid();
|
|
12259
|
+
}
|
|
12260
|
+
resetKeyGrid() {
|
|
12261
|
+
var _a;
|
|
12262
|
+
(_a = this.cells) === null || _a === void 0 ? void 0 : _a.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
12263
|
+
const firstCell = this.cells ? this.cells[0] : null;
|
|
12264
|
+
firstCell === null || firstCell === void 0 ? void 0 : firstCell.setAttribute('tabindex', '0');
|
|
12265
|
+
}
|
|
12266
|
+
removeActiveCell() {
|
|
12267
|
+
this._activeCell = null;
|
|
12268
|
+
}
|
|
12269
|
+
getActiveCell() {
|
|
12270
|
+
return this._activeCell;
|
|
12271
|
+
}
|
|
12272
|
+
setActiveCell(activeCell) {
|
|
12273
|
+
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
12274
|
+
if (prior) {
|
|
12275
|
+
prior.setAttribute('tabindex', '-1');
|
|
12276
|
+
}
|
|
12277
|
+
activeCell.setAttribute('tabindex', '0');
|
|
12278
|
+
this._activeCell = activeCell;
|
|
12279
|
+
const items = getTabableItems(activeCell);
|
|
12280
|
+
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
12281
|
+
if (!this.skipItemFocus) {
|
|
12282
|
+
item.focus();
|
|
12283
|
+
}
|
|
12284
|
+
}
|
|
12285
|
+
getNextItemCoordinate(e) {
|
|
12286
|
+
var _a;
|
|
12287
|
+
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
12288
|
+
if (e.code === 'Tab') {
|
|
12289
|
+
currentCell = document.activeElement;
|
|
12290
|
+
}
|
|
12291
|
+
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
12292
|
+
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
12293
|
+
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
12294
|
+
let x = currentRow && currentCell
|
|
12295
|
+
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
12296
|
+
: 0;
|
|
12297
|
+
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
12298
|
+
const dir = this.host.dir;
|
|
12299
|
+
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
12300
|
+
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
12301
|
+
const itemsPerPage = Math.floor(((_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector('.datagrid').clientHeight) / this.rows[0].clientHeight) - 1 || 0;
|
|
12302
|
+
if (e.code === 'ArrowUp' && y !== 0) {
|
|
12303
|
+
y = y - 1;
|
|
12304
|
+
}
|
|
12305
|
+
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
12306
|
+
y = y + 1;
|
|
12307
|
+
}
|
|
12308
|
+
else if (e.code === inlineStart && x !== 0) {
|
|
12309
|
+
x = x - 1;
|
|
12310
|
+
}
|
|
12311
|
+
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
12312
|
+
x = x + 1;
|
|
12313
|
+
}
|
|
12314
|
+
else if (e.code === 'End') {
|
|
12315
|
+
x = numOfColumns;
|
|
12316
|
+
if (e.ctrlKey) {
|
|
12317
|
+
y = numOfRows;
|
|
12318
|
+
}
|
|
12319
|
+
}
|
|
12320
|
+
else if (e.code === 'Home') {
|
|
12321
|
+
x = 0;
|
|
12322
|
+
if (e.ctrlKey) {
|
|
12323
|
+
y = 0;
|
|
12324
|
+
}
|
|
12325
|
+
}
|
|
12326
|
+
else if (e.code === 'PageUp') {
|
|
12327
|
+
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
12328
|
+
}
|
|
12329
|
+
else if (e.code === 'PageDown') {
|
|
12330
|
+
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
12331
|
+
}
|
|
12332
|
+
return { x, y };
|
|
12333
|
+
}
|
|
12334
|
+
}
|
|
12335
|
+
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
12336
|
+
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
12337
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
12338
|
+
type: Injectable
|
|
12339
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
12340
|
+
|
|
12148
12341
|
/*
|
|
12149
12342
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
12150
12343
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -12157,12 +12350,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12157
12350
|
* since it can be anything (not just a text input).
|
|
12158
12351
|
*/
|
|
12159
12352
|
class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
12160
|
-
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef) {
|
|
12353
|
+
constructor(_filters, commonStrings, smartToggleService, platformId, elementRef, keyNavigation) {
|
|
12161
12354
|
super(_filters);
|
|
12162
12355
|
this.commonStrings = commonStrings;
|
|
12163
12356
|
this.smartToggleService = smartToggleService;
|
|
12164
12357
|
this.platformId = platformId;
|
|
12165
12358
|
this.elementRef = elementRef;
|
|
12359
|
+
this.keyNavigation = keyNavigation;
|
|
12166
12360
|
this.openChange = new EventEmitter(false);
|
|
12167
12361
|
this.ariaExpanded = false;
|
|
12168
12362
|
this.popoverId = uniqueIdFactory();
|
|
@@ -12191,6 +12385,9 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12191
12385
|
if (!open && isPlatformBrowser(this.platformId)) {
|
|
12192
12386
|
this.anchor.nativeElement.focus();
|
|
12193
12387
|
}
|
|
12388
|
+
if (this.keyNavigation) {
|
|
12389
|
+
this.keyNavigation.skipItemFocus = open;
|
|
12390
|
+
}
|
|
12194
12391
|
// keep track of the state
|
|
12195
12392
|
this._open = open;
|
|
12196
12393
|
}
|
|
@@ -12225,7 +12422,7 @@ class ClrDatagridFilter extends DatagridFilterRegistrar {
|
|
|
12225
12422
|
});
|
|
12226
12423
|
}
|
|
12227
12424
|
}
|
|
12228
|
-
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 });
|
|
12425
|
+
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 });
|
|
12229
12426
|
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: `
|
|
12230
12427
|
<button
|
|
12231
12428
|
class="datagrid-filter-toggle"
|
|
@@ -12311,7 +12508,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
12311
12508
|
return [{ type: FiltersProvider }, { type: ClrCommonStringsService }, { type: ClrPopoverToggleService }, { type: undefined, decorators: [{
|
|
12312
12509
|
type: Inject,
|
|
12313
12510
|
args: [PLATFORM_ID]
|
|
12314
|
-
}] }, { type: i0.ElementRef }
|
|
12511
|
+
}] }, { type: i0.ElementRef }, { type: KeyNavigationGridController, decorators: [{
|
|
12512
|
+
type: Optional
|
|
12513
|
+
}] }];
|
|
12315
12514
|
}, propDecorators: { openChange: [{
|
|
12316
12515
|
type: Output,
|
|
12317
12516
|
args: ['clrDgFilterOpenChange']
|
|
@@ -13074,6 +13273,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
13074
13273
|
class DetailService {
|
|
13075
13274
|
constructor(modalStackService) {
|
|
13076
13275
|
this.modalStackService = modalStackService;
|
|
13276
|
+
this.preventScroll = false;
|
|
13077
13277
|
this.toggleState = false;
|
|
13078
13278
|
this._enabled = false;
|
|
13079
13279
|
this._state = new BehaviorSubject(this.toggleState);
|
|
@@ -13084,6 +13284,12 @@ class DetailService {
|
|
|
13084
13284
|
set enabled(state) {
|
|
13085
13285
|
this._enabled = state;
|
|
13086
13286
|
}
|
|
13287
|
+
get preventFocusScroll() {
|
|
13288
|
+
return this.preventScroll;
|
|
13289
|
+
}
|
|
13290
|
+
set preventFocusScroll(preventScroll) {
|
|
13291
|
+
this.preventScroll = preventScroll;
|
|
13292
|
+
}
|
|
13087
13293
|
get state() {
|
|
13088
13294
|
return this.cache;
|
|
13089
13295
|
}
|
|
@@ -13110,7 +13316,7 @@ class DetailService {
|
|
|
13110
13316
|
}
|
|
13111
13317
|
returnFocus() {
|
|
13112
13318
|
if (this.button) {
|
|
13113
|
-
this.button.focus();
|
|
13319
|
+
this.button.focus({ preventScroll: this.preventFocusScroll });
|
|
13114
13320
|
this.button = null;
|
|
13115
13321
|
}
|
|
13116
13322
|
}
|
|
@@ -15436,7 +15642,7 @@ ClrDatagridRow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
15436
15642
|
DatagridIfExpandService,
|
|
15437
15643
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15438
15644
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15439
|
-
], 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" }] });
|
|
15645
|
+
], 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" }] });
|
|
15440
15646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridRow, decorators: [{
|
|
15441
15647
|
type: Component,
|
|
15442
15648
|
args: [{ selector: 'clr-dg-row', host: {
|
|
@@ -15448,7 +15654,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15448
15654
|
DatagridIfExpandService,
|
|
15449
15655
|
{ provide: IfExpandService, useExisting: DatagridIfExpandService },
|
|
15450
15656
|
{ provide: LoadingListener, useExisting: DatagridIfExpandService },
|
|
15451
|
-
], 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" }]
|
|
15657
|
+
], 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" }]
|
|
15452
15658
|
}], ctorParameters: function () {
|
|
15453
15659
|
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: [{
|
|
15454
15660
|
type: Inject,
|
|
@@ -15508,10 +15714,11 @@ var DatagridColumnChanges;
|
|
|
15508
15714
|
(function (DatagridColumnChanges) {
|
|
15509
15715
|
DatagridColumnChanges[DatagridColumnChanges["WIDTH"] = 0] = "WIDTH";
|
|
15510
15716
|
DatagridColumnChanges[DatagridColumnChanges["HIDDEN"] = 1] = "HIDDEN";
|
|
15717
|
+
DatagridColumnChanges[DatagridColumnChanges["INITIALIZE"] = 2] = "INITIALIZE";
|
|
15511
15718
|
})(DatagridColumnChanges || (DatagridColumnChanges = {}));
|
|
15512
15719
|
const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
15513
15720
|
.map(key => DatagridColumnChanges[key])
|
|
15514
|
-
.filter(key => key === parseInt(key, 10)); // extracts only integer keys
|
|
15721
|
+
.filter(key => key === parseInt(key, 10) && key !== DatagridColumnChanges.INITIALIZE); // extracts only integer keys
|
|
15515
15722
|
|
|
15516
15723
|
/*
|
|
15517
15724
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -15522,6 +15729,7 @@ const ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
|
15522
15729
|
class ColumnsService {
|
|
15523
15730
|
constructor() {
|
|
15524
15731
|
this.columns = [];
|
|
15732
|
+
this.columnsStateChange = new BehaviorSubject(null);
|
|
15525
15733
|
this._cache = [];
|
|
15526
15734
|
}
|
|
15527
15735
|
get columnStates() {
|
|
@@ -15543,7 +15751,9 @@ class ColumnsService {
|
|
|
15543
15751
|
resetToLastCache() {
|
|
15544
15752
|
this._cache.forEach((state, index) => {
|
|
15545
15753
|
// Just emit the exact value from the cache
|
|
15546
|
-
|
|
15754
|
+
const cachedState = Object.assign(Object.assign({}, state), { changes: ALL_COLUMN_CHANGES });
|
|
15755
|
+
this.columns[index].next(cachedState);
|
|
15756
|
+
this.columnsStateChange.next(cachedState);
|
|
15547
15757
|
});
|
|
15548
15758
|
this._cache = [];
|
|
15549
15759
|
}
|
|
@@ -15555,7 +15765,9 @@ class ColumnsService {
|
|
|
15555
15765
|
this.emitStateChange(this.columns[columnIndex], diff);
|
|
15556
15766
|
}
|
|
15557
15767
|
emitStateChange(column, diff) {
|
|
15558
|
-
|
|
15768
|
+
const changedState = Object.assign(Object.assign({}, column.value), diff);
|
|
15769
|
+
column.next(changedState);
|
|
15770
|
+
this.columnsStateChange.next(changedState);
|
|
15559
15771
|
}
|
|
15560
15772
|
}
|
|
15561
15773
|
ColumnsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ColumnsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -15631,193 +15843,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
15631
15843
|
type: Injectable
|
|
15632
15844
|
}], ctorParameters: function () { return [{ type: FiltersProvider }, { type: Sort }, { type: Page }, { type: StateDebouncer }]; } });
|
|
15633
15845
|
|
|
15634
|
-
/*
|
|
15635
|
-
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15636
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
15637
|
-
* This software is released under MIT license.
|
|
15638
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
15639
|
-
*/
|
|
15640
|
-
function getTabableItems(el) {
|
|
15641
|
-
const tabableSelector = [
|
|
15642
|
-
'a[href]',
|
|
15643
|
-
'area[href]',
|
|
15644
|
-
'input:not([disabled])',
|
|
15645
|
-
'button:not([disabled])',
|
|
15646
|
-
'select:not([disabled])',
|
|
15647
|
-
'textarea:not([disabled])',
|
|
15648
|
-
'iframe',
|
|
15649
|
-
'object',
|
|
15650
|
-
'embed',
|
|
15651
|
-
'*[tabindex]',
|
|
15652
|
-
'*[contenteditable=true]',
|
|
15653
|
-
'[role=button]:not([disabled])',
|
|
15654
|
-
].join(',');
|
|
15655
|
-
return Array.from(el.querySelectorAll(tabableSelector));
|
|
15656
|
-
}
|
|
15657
|
-
class KeyNavigationGridController {
|
|
15658
|
-
constructor(zone) {
|
|
15659
|
-
this.zone = zone;
|
|
15660
|
-
this.listenersAdded = false;
|
|
15661
|
-
this.destroy$ = new Subject();
|
|
15662
|
-
this._activeCell = null;
|
|
15663
|
-
this.config = {
|
|
15664
|
-
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
15665
|
-
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
15666
|
-
keyGrid: '[role=grid]',
|
|
15667
|
-
};
|
|
15668
|
-
}
|
|
15669
|
-
get grid() {
|
|
15670
|
-
var _a;
|
|
15671
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector(this.config.keyGrid);
|
|
15672
|
-
}
|
|
15673
|
-
get rows() {
|
|
15674
|
-
var _a;
|
|
15675
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridRows);
|
|
15676
|
-
}
|
|
15677
|
-
get cells() {
|
|
15678
|
-
var _a;
|
|
15679
|
-
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridCells);
|
|
15680
|
-
}
|
|
15681
|
-
ngOnDestroy() {
|
|
15682
|
-
this.destroy$.next();
|
|
15683
|
-
this.destroy$.complete();
|
|
15684
|
-
}
|
|
15685
|
-
addListeners() {
|
|
15686
|
-
if (this.listenersAdded) {
|
|
15687
|
-
return;
|
|
15688
|
-
}
|
|
15689
|
-
this.zone.runOutsideAngular(() => {
|
|
15690
|
-
fromEvent(this.grid, 'mousedown')
|
|
15691
|
-
.pipe(takeUntil(this.destroy$))
|
|
15692
|
-
.subscribe((e) => {
|
|
15693
|
-
// 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
|
|
15694
|
-
if (e.buttons === 1 && !e.ctrlKey) {
|
|
15695
|
-
const activeCell = this.cells
|
|
15696
|
-
? Array.from(this.cells).find(c => c === e.target || c === e.target.closest(this.config.keyGridCells))
|
|
15697
|
-
: null;
|
|
15698
|
-
if (activeCell) {
|
|
15699
|
-
this.setActiveCell(activeCell);
|
|
15700
|
-
}
|
|
15701
|
-
}
|
|
15702
|
-
});
|
|
15703
|
-
fromEvent(this.grid, 'wheel')
|
|
15704
|
-
.pipe(takeUntil(this.destroy$))
|
|
15705
|
-
.subscribe(() => {
|
|
15706
|
-
this.removeActiveCell();
|
|
15707
|
-
});
|
|
15708
|
-
fromEvent(this.grid, 'keydown')
|
|
15709
|
-
.pipe(takeUntil(this.destroy$))
|
|
15710
|
-
.subscribe((e) => {
|
|
15711
|
-
// Skip column resize events
|
|
15712
|
-
if (e.target.classList.contains('drag-handle') &&
|
|
15713
|
-
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
15714
|
-
return;
|
|
15715
|
-
}
|
|
15716
|
-
if (e.code === 'ArrowUp' ||
|
|
15717
|
-
e.code === 'ArrowDown' ||
|
|
15718
|
-
e.code === 'ArrowLeft' ||
|
|
15719
|
-
e.code === 'ArrowRight' ||
|
|
15720
|
-
e.code === 'End' ||
|
|
15721
|
-
e.code === 'Home' ||
|
|
15722
|
-
e.code === 'PageUp' ||
|
|
15723
|
-
e.code === 'PageDown') {
|
|
15724
|
-
const { x, y } = this.getNextItemCoordinate(e);
|
|
15725
|
-
const activeItem = this.rows
|
|
15726
|
-
? Array.from(this.rows[y].querySelectorAll(this.config.keyGridCells))[x]
|
|
15727
|
-
: null;
|
|
15728
|
-
if (activeItem) {
|
|
15729
|
-
this.setActiveCell(activeItem);
|
|
15730
|
-
}
|
|
15731
|
-
e.preventDefault();
|
|
15732
|
-
}
|
|
15733
|
-
});
|
|
15734
|
-
});
|
|
15735
|
-
this.listenersAdded = true;
|
|
15736
|
-
}
|
|
15737
|
-
initializeKeyGrid(host) {
|
|
15738
|
-
this.host = host;
|
|
15739
|
-
this.addListeners();
|
|
15740
|
-
this.resetKeyGrid();
|
|
15741
|
-
}
|
|
15742
|
-
resetKeyGrid() {
|
|
15743
|
-
var _a;
|
|
15744
|
-
(_a = this.cells) === null || _a === void 0 ? void 0 : _a.forEach((i) => i.setAttribute('tabindex', '-1'));
|
|
15745
|
-
const firstCell = this.cells ? this.cells[0] : null;
|
|
15746
|
-
firstCell === null || firstCell === void 0 ? void 0 : firstCell.setAttribute('tabindex', '0');
|
|
15747
|
-
}
|
|
15748
|
-
removeActiveCell() {
|
|
15749
|
-
this._activeCell = null;
|
|
15750
|
-
}
|
|
15751
|
-
getActiveCell() {
|
|
15752
|
-
return this._activeCell;
|
|
15753
|
-
}
|
|
15754
|
-
setActiveCell(activeCell) {
|
|
15755
|
-
const prior = this.cells ? Array.from(this.cells).find(c => c.getAttribute('tabindex') === '0') : null;
|
|
15756
|
-
if (prior) {
|
|
15757
|
-
prior.setAttribute('tabindex', '-1');
|
|
15758
|
-
}
|
|
15759
|
-
activeCell.setAttribute('tabindex', '0');
|
|
15760
|
-
const items = getTabableItems(activeCell);
|
|
15761
|
-
const item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
15762
|
-
item.focus();
|
|
15763
|
-
this._activeCell = item;
|
|
15764
|
-
}
|
|
15765
|
-
getNextItemCoordinate(e) {
|
|
15766
|
-
var _a;
|
|
15767
|
-
let currentCell = this.cells ? Array.from(this.cells).find(i => i.getAttribute('tabindex') === '0') : null;
|
|
15768
|
-
if (e.code === 'Tab') {
|
|
15769
|
-
currentCell = document.activeElement;
|
|
15770
|
-
}
|
|
15771
|
-
const currentRow = this.rows && currentCell ? Array.from(this.rows).find(r => r.contains(currentCell)) : null;
|
|
15772
|
-
const numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
15773
|
-
const numOfColumns = this.cells ? Math.floor(this.cells.length / this.rows.length - 1) : 0;
|
|
15774
|
-
let x = currentRow && currentCell
|
|
15775
|
-
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
15776
|
-
: 0;
|
|
15777
|
-
let y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
15778
|
-
const dir = this.host.dir;
|
|
15779
|
-
const inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
15780
|
-
const inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
15781
|
-
const itemsPerPage = Math.floor(((_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector('.datagrid').clientHeight) / this.rows[0].clientHeight) - 1 || 0;
|
|
15782
|
-
if (e.code === 'ArrowUp' && y !== 0) {
|
|
15783
|
-
y = y - 1;
|
|
15784
|
-
}
|
|
15785
|
-
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
15786
|
-
y = y + 1;
|
|
15787
|
-
}
|
|
15788
|
-
else if (e.code === inlineStart && x !== 0) {
|
|
15789
|
-
x = x - 1;
|
|
15790
|
-
}
|
|
15791
|
-
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
15792
|
-
x = x + 1;
|
|
15793
|
-
}
|
|
15794
|
-
else if (e.code === 'End') {
|
|
15795
|
-
x = numOfColumns;
|
|
15796
|
-
if (e.ctrlKey) {
|
|
15797
|
-
y = numOfRows;
|
|
15798
|
-
}
|
|
15799
|
-
}
|
|
15800
|
-
else if (e.code === 'Home') {
|
|
15801
|
-
x = 0;
|
|
15802
|
-
if (e.ctrlKey) {
|
|
15803
|
-
y = 0;
|
|
15804
|
-
}
|
|
15805
|
-
}
|
|
15806
|
-
else if (e.code === 'PageUp') {
|
|
15807
|
-
y = y - itemsPerPage > 0 ? y - itemsPerPage + 1 : 1;
|
|
15808
|
-
}
|
|
15809
|
-
else if (e.code === 'PageDown') {
|
|
15810
|
-
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
15811
|
-
}
|
|
15812
|
-
return { x, y };
|
|
15813
|
-
}
|
|
15814
|
-
}
|
|
15815
|
-
KeyNavigationGridController.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
15816
|
-
KeyNavigationGridController.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController });
|
|
15817
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: KeyNavigationGridController, decorators: [{
|
|
15818
|
-
type: Injectable
|
|
15819
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
15820
|
-
|
|
15821
15846
|
/*
|
|
15822
15847
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
15823
15848
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -15851,7 +15876,6 @@ class DatagridCellRenderer {
|
|
|
15851
15876
|
}
|
|
15852
15877
|
}
|
|
15853
15878
|
resetState(state) {
|
|
15854
|
-
state.changes = ALL_COLUMN_CHANGES;
|
|
15855
15879
|
this.setWidth(state);
|
|
15856
15880
|
this.setHidden(state);
|
|
15857
15881
|
}
|
|
@@ -16086,12 +16110,16 @@ class ClrDatagrid {
|
|
|
16086
16110
|
*/
|
|
16087
16111
|
if (row) {
|
|
16088
16112
|
this.detailService.open(row.item, row.detailButton.nativeElement);
|
|
16113
|
+
// always keep open when virtual scroll is available otherwise close it
|
|
16089
16114
|
}
|
|
16090
|
-
else if (!this.hasVirtualScroller
|
|
16091
|
-
|
|
16115
|
+
else if (!this.hasVirtualScroller) {
|
|
16116
|
+
// Using setTimeout to make sure the inner cycles in rows are done
|
|
16117
|
+
setTimeout(() => {
|
|
16118
|
+
this.detailService.close();
|
|
16119
|
+
});
|
|
16092
16120
|
}
|
|
16093
16121
|
}
|
|
16094
|
-
// retain active cell when navigating with PageUp and PageDown buttons in virtual scroller
|
|
16122
|
+
// retain active cell when navigating with Up/Down Arrows, PageUp and PageDown buttons in virtual scroller
|
|
16095
16123
|
const active = this.keyNavigation.getActiveCell();
|
|
16096
16124
|
if (active) {
|
|
16097
16125
|
this.zone.runOutsideAngular(() => {
|
|
@@ -16178,6 +16206,13 @@ class ClrDatagrid {
|
|
|
16178
16206
|
ngOnDestroy() {
|
|
16179
16207
|
this._subscriptions.forEach((sub) => sub.unsubscribe());
|
|
16180
16208
|
}
|
|
16209
|
+
toggleAllSelected($event) {
|
|
16210
|
+
$event.preventDefault();
|
|
16211
|
+
if (this.hasVirtualScroller) {
|
|
16212
|
+
return;
|
|
16213
|
+
}
|
|
16214
|
+
this.allSelected = !this.allSelected;
|
|
16215
|
+
}
|
|
16181
16216
|
resize() {
|
|
16182
16217
|
this.organizer.resize();
|
|
16183
16218
|
}
|
|
@@ -16205,7 +16240,7 @@ ClrDatagrid.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
|
16205
16240
|
ColumnsService,
|
|
16206
16241
|
DisplayModeService,
|
|
16207
16242
|
KeyNavigationGridController,
|
|
16208
|
-
], 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)=\"
|
|
16243
|
+
], 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" }] });
|
|
16209
16244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagrid, decorators: [{
|
|
16210
16245
|
type: Component,
|
|
16211
16246
|
args: [{ selector: 'clr-datagrid', providers: [
|
|
@@ -16227,7 +16262,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16227
16262
|
], host: {
|
|
16228
16263
|
'[class.datagrid-host]': 'true',
|
|
16229
16264
|
'[class.datagrid-detail-open]': 'detailService.isOpen',
|
|
16230
|
-
}, 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)=\"
|
|
16265
|
+
}, 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" }]
|
|
16231
16266
|
}], ctorParameters: function () {
|
|
16232
16267
|
return [{ type: DatagridRenderOrganizer }, { type: Items }, { type: ExpandableRowsCount }, { type: Selection }, { type: RowActionService }, { type: StateProvider }, { type: DisplayModeService }, { type: i0.Renderer2 }, { type: DetailService }, { type: undefined, decorators: [{
|
|
16233
16268
|
type: Inject,
|
|
@@ -16398,6 +16433,7 @@ class ClrDatagridActionOverflow {
|
|
|
16398
16433
|
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 });
|
|
16399
16434
|
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: `
|
|
16400
16435
|
<button
|
|
16436
|
+
tabindex="-1"
|
|
16401
16437
|
class="datagrid-action-toggle"
|
|
16402
16438
|
type="button"
|
|
16403
16439
|
role="button"
|
|
@@ -16432,6 +16468,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16432
16468
|
hostDirectives: [ClrPopoverHostDirective],
|
|
16433
16469
|
template: `
|
|
16434
16470
|
<button
|
|
16471
|
+
tabindex="-1"
|
|
16435
16472
|
class="datagrid-action-toggle"
|
|
16436
16473
|
type="button"
|
|
16437
16474
|
role="button"
|
|
@@ -16781,10 +16818,13 @@ class ClrDatagridDetailHeader {
|
|
|
16781
16818
|
get titleId() {
|
|
16782
16819
|
return `${this.detailService.id}-title`;
|
|
16783
16820
|
}
|
|
16821
|
+
ngAfterViewInit() {
|
|
16822
|
+
this.title.nativeElement.focus();
|
|
16823
|
+
}
|
|
16784
16824
|
}
|
|
16785
16825
|
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 });
|
|
16786
|
-
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: `
|
|
16787
|
-
<div class="datagrid-detail-header-title"
|
|
16826
|
+
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: `
|
|
16827
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16788
16828
|
<ng-content></ng-content>
|
|
16789
16829
|
</div>
|
|
16790
16830
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16806,7 +16846,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16806
16846
|
'[class.datagrid-detail-header]': 'true',
|
|
16807
16847
|
},
|
|
16808
16848
|
template: `
|
|
16809
|
-
<div class="datagrid-detail-header-title"
|
|
16849
|
+
<div #title class="datagrid-detail-header-title" tabindex="-1" [id]="titleId">
|
|
16810
16850
|
<ng-content></ng-content>
|
|
16811
16851
|
</div>
|
|
16812
16852
|
<div class="datagrid-detail-pane-close">
|
|
@@ -16821,7 +16861,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16821
16861
|
</div>
|
|
16822
16862
|
`,
|
|
16823
16863
|
}]
|
|
16824
|
-
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }
|
|
16864
|
+
}], ctorParameters: function () { return [{ type: DetailService }, { type: ClrCommonStringsService }]; }, propDecorators: { title: [{
|
|
16865
|
+
type: ViewChild,
|
|
16866
|
+
args: ['title']
|
|
16867
|
+
}] } });
|
|
16825
16868
|
|
|
16826
16869
|
/*
|
|
16827
16870
|
* Copyright (c) 2016-2024 Broadcom. All Rights Reserved.
|
|
@@ -16842,7 +16885,7 @@ ClrDatagridDetail.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versio
|
|
|
16842
16885
|
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: `
|
|
16843
16886
|
<div
|
|
16844
16887
|
cdkTrapFocus
|
|
16845
|
-
[cdkTrapFocusAutoCapture]="
|
|
16888
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16846
16889
|
class="datagrid-detail-pane-content"
|
|
16847
16890
|
*ngIf="detailService.isOpen"
|
|
16848
16891
|
role="dialog"
|
|
@@ -16867,7 +16910,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
16867
16910
|
template: `
|
|
16868
16911
|
<div
|
|
16869
16912
|
cdkTrapFocus
|
|
16870
|
-
[cdkTrapFocusAutoCapture]="
|
|
16913
|
+
[cdkTrapFocusAutoCapture]="!header"
|
|
16871
16914
|
class="datagrid-detail-pane-content"
|
|
16872
16915
|
*ngIf="detailService.isOpen"
|
|
16873
16916
|
role="dialog"
|
|
@@ -17723,7 +17766,7 @@ const defaultCdkFixedSizeVirtualScrollInputs = {
|
|
|
17723
17766
|
maxBufferPx: 400,
|
|
17724
17767
|
};
|
|
17725
17768
|
class ClrDatagridVirtualScrollDirective {
|
|
17726
|
-
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, injector) {
|
|
17769
|
+
constructor(changeDetectorRef, iterableDiffers, items, ngZone, templateRef, viewContainerRef, directionality, scrollDispatcher, viewportRuler, datagrid, columnsService, injector) {
|
|
17727
17770
|
this.changeDetectorRef = changeDetectorRef;
|
|
17728
17771
|
this.iterableDiffers = iterableDiffers;
|
|
17729
17772
|
this.items = items;
|
|
@@ -17734,6 +17777,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17734
17777
|
this.scrollDispatcher = scrollDispatcher;
|
|
17735
17778
|
this.viewportRuler = viewportRuler;
|
|
17736
17779
|
this.datagrid = datagrid;
|
|
17780
|
+
this.columnsService = columnsService;
|
|
17737
17781
|
this.injector = injector;
|
|
17738
17782
|
this.renderedRangeChange = new EventEmitter();
|
|
17739
17783
|
this._cdkFixedSizeVirtualScrollInputs = Object.assign({}, defaultCdkFixedSizeVirtualScrollInputs);
|
|
@@ -17746,12 +17790,16 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17746
17790
|
}
|
|
17747
17791
|
});
|
|
17748
17792
|
});
|
|
17793
|
+
this.viewRepeater = new _RecycleViewRepeaterStrategy();
|
|
17749
17794
|
this.cdkVirtualForInputs = {
|
|
17750
17795
|
cdkVirtualForTrackBy: index => index,
|
|
17751
17796
|
};
|
|
17752
17797
|
this.items.smartenUp();
|
|
17753
17798
|
this.datagrid.hasVirtualScroller = true;
|
|
17799
|
+
this.datagrid.detailService.preventFocusScroll = true;
|
|
17754
17800
|
this.datagridElementRef = this.datagrid.el;
|
|
17801
|
+
// default
|
|
17802
|
+
this.cdkVirtualForTemplateCacheSize = 20;
|
|
17755
17803
|
this.mutationChanges.observe(this.datagridElementRef.nativeElement, {
|
|
17756
17804
|
attributeFilter: ['class'],
|
|
17757
17805
|
attributeOldValue: true,
|
|
@@ -17812,7 +17860,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17812
17860
|
ngAfterViewInit() {
|
|
17813
17861
|
this.injector.runInContext(() => {
|
|
17814
17862
|
this.virtualScrollViewport = this.createVirtualScrollViewportForDatagrid(this.changeDetectorRef, this.ngZone, this.directionality, this.scrollDispatcher, this.viewportRuler, this.datagridElementRef, this.virtualScrollStrategy);
|
|
17815
|
-
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers,
|
|
17863
|
+
this.cdkVirtualFor = new CdkVirtualForOf(this.viewContainerRef, this.templateRef, this.iterableDiffers, this.viewRepeater, this.virtualScrollViewport, this.ngZone);
|
|
17816
17864
|
this.virtualScrollViewport.ngOnInit();
|
|
17817
17865
|
});
|
|
17818
17866
|
this.gridRoleElement = this.datagridElementRef.nativeElement.querySelector('[role="grid"]');
|
|
@@ -17827,6 +17875,8 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17827
17875
|
if (datagridState.filters) {
|
|
17828
17876
|
this.virtualScrollViewport.scrollToIndex(0);
|
|
17829
17877
|
}
|
|
17878
|
+
}), this.columnsService.columnsStateChange.subscribe(() => {
|
|
17879
|
+
this.viewRepeater.detach();
|
|
17830
17880
|
}));
|
|
17831
17881
|
}
|
|
17832
17882
|
ngDoCheck() {
|
|
@@ -17902,7 +17952,7 @@ class ClrDatagridVirtualScrollDirective {
|
|
|
17902
17952
|
return virtualScrollViewport;
|
|
17903
17953
|
}
|
|
17904
17954
|
}
|
|
17905
|
-
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: i2.Directionality }, { token: i3$1.ScrollDispatcher }, { token: i3$1.ViewportRuler }, { token: ClrDatagrid }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17955
|
+
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: i2.Directionality }, { token: i3$1.ScrollDispatcher }, { token: i3$1.ViewportRuler }, { token: ClrDatagrid }, { token: ColumnsService }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Directive });
|
|
17906
17956
|
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 });
|
|
17907
17957
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrDatagridVirtualScrollDirective, decorators: [{
|
|
17908
17958
|
type: Directive,
|
|
@@ -17913,7 +17963,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
17913
17963
|
}], ctorParameters: function () {
|
|
17914
17964
|
return [{ type: i0.ChangeDetectorRef }, { type: i0.IterableDiffers }, { type: Items, decorators: [{
|
|
17915
17965
|
type: SkipSelf
|
|
17916
|
-
}] }, { type: i0.NgZone }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i2.Directionality }, { type: i3$1.ScrollDispatcher }, { type: i3$1.ViewportRuler }, { type: ClrDatagrid }, { type: i0.EnvironmentInjector }];
|
|
17966
|
+
}] }, { type: i0.NgZone }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i2.Directionality }, { type: i3$1.ScrollDispatcher }, { type: i3$1.ViewportRuler }, { type: ClrDatagrid }, { type: ColumnsService }, { type: i0.EnvironmentInjector }];
|
|
17917
17967
|
}, propDecorators: { renderedRangeChange: [{
|
|
17918
17968
|
type: Output
|
|
17919
17969
|
}], cdkVirtualForOf: [{
|
|
@@ -18141,6 +18191,9 @@ class DatagridMainRenderer {
|
|
|
18141
18191
|
this.subscriptions.push(this.detailService.stateChange.subscribe(state => this.toggleDetailPane(state)));
|
|
18142
18192
|
this.subscriptions.push(this.items.change.subscribe(() => (this.shouldStabilizeColumns = true)));
|
|
18143
18193
|
}
|
|
18194
|
+
ngOnInit() {
|
|
18195
|
+
this.columnsService.columnsStateChange.subscribe(change => this.columnStateChanged(change));
|
|
18196
|
+
}
|
|
18144
18197
|
ngAfterContentInit() {
|
|
18145
18198
|
this.setupColumns();
|
|
18146
18199
|
this.subscriptions.push(this.headers.changes.subscribe(() => {
|
|
@@ -18150,7 +18203,6 @@ class DatagridMainRenderer {
|
|
|
18150
18203
|
this.columnsSizesStable = false;
|
|
18151
18204
|
this.stabilizeColumns();
|
|
18152
18205
|
}));
|
|
18153
|
-
this.listenForColumnChanges();
|
|
18154
18206
|
}
|
|
18155
18207
|
// Initialize and set Table width for horizontal scrolling here.
|
|
18156
18208
|
ngAfterViewInit() {
|
|
@@ -18192,7 +18244,10 @@ class DatagridMainRenderer {
|
|
|
18192
18244
|
setupColumns() {
|
|
18193
18245
|
this.headers.forEach((header, index) => header.setColumnState(index));
|
|
18194
18246
|
this.columnsService.columns.splice(this.headers.length); // Trim any old columns
|
|
18195
|
-
|
|
18247
|
+
// Sets columnIndex for each column
|
|
18248
|
+
this.columnsService.columns.forEach((column, index) => {
|
|
18249
|
+
this.columnsService.emitStateChange(column, { changes: [DatagridColumnChanges.INITIALIZE], columnIndex: index });
|
|
18250
|
+
});
|
|
18196
18251
|
}
|
|
18197
18252
|
shouldComputeHeight() {
|
|
18198
18253
|
if (!this._heightSet && this.page.size > 0) {
|
|
@@ -18246,6 +18301,10 @@ class DatagridMainRenderer {
|
|
|
18246
18301
|
});
|
|
18247
18302
|
}
|
|
18248
18303
|
columnStateChanged(state) {
|
|
18304
|
+
// eslint-disable-next-line eqeqeq
|
|
18305
|
+
if (!this.headers || state.columnIndex == null) {
|
|
18306
|
+
return;
|
|
18307
|
+
}
|
|
18249
18308
|
const columnIndex = state.columnIndex;
|
|
18250
18309
|
if (state.changes && state.changes.length) {
|
|
18251
18310
|
state.changes.forEach(change => {
|
|
@@ -18253,7 +18312,7 @@ class DatagridMainRenderer {
|
|
|
18253
18312
|
case DatagridColumnChanges.WIDTH:
|
|
18254
18313
|
this.headers.get(columnIndex).setWidth(state);
|
|
18255
18314
|
this.rows.forEach(row => {
|
|
18256
|
-
if (row
|
|
18315
|
+
if ((row === null || row === void 0 ? void 0 : row.cells.length) === this.columnsService.columns.length) {
|
|
18257
18316
|
row.cells.get(columnIndex).setWidth(state);
|
|
18258
18317
|
}
|
|
18259
18318
|
});
|
|
@@ -18267,23 +18326,20 @@ class DatagridMainRenderer {
|
|
|
18267
18326
|
});
|
|
18268
18327
|
this.keyNavigation.resetKeyGrid();
|
|
18269
18328
|
break;
|
|
18329
|
+
case DatagridColumnChanges.INITIALIZE:
|
|
18330
|
+
if (state.hideable && state.hidden) {
|
|
18331
|
+
this.headers.get(columnIndex).setHidden(state);
|
|
18332
|
+
this.rows.forEach(row => {
|
|
18333
|
+
row.setCellsState();
|
|
18334
|
+
});
|
|
18335
|
+
}
|
|
18336
|
+
break;
|
|
18270
18337
|
default:
|
|
18271
18338
|
break;
|
|
18272
18339
|
}
|
|
18273
18340
|
});
|
|
18274
18341
|
}
|
|
18275
18342
|
}
|
|
18276
|
-
listenForColumnChanges() {
|
|
18277
|
-
this.columnsService.columns.forEach((column, index) => {
|
|
18278
|
-
this.columnsService.emitStateChange(column, { changes: [], columnIndex: index });
|
|
18279
|
-
});
|
|
18280
|
-
/*
|
|
18281
|
-
Merges all column subject so we can track them at once
|
|
18282
|
-
and receive only the changed column as result
|
|
18283
|
-
*/
|
|
18284
|
-
const columnChanges = merge(...this.columnsService.columns);
|
|
18285
|
-
this.subscriptions.push(columnChanges.subscribe(change => this.columnStateChanged(change)));
|
|
18286
|
-
}
|
|
18287
18343
|
/**
|
|
18288
18344
|
* Triggers a whole re-rendring cycle to set column sizes, if needed.
|
|
18289
18345
|
*/
|
|
@@ -24635,13 +24691,13 @@ class ClrTimeline {
|
|
|
24635
24691
|
}
|
|
24636
24692
|
}
|
|
24637
24693
|
ClrTimeline.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
24638
|
-
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 });
|
|
24694
|
+
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 });
|
|
24639
24695
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrTimeline, decorators: [{
|
|
24640
24696
|
type: Component,
|
|
24641
24697
|
args: [{
|
|
24642
24698
|
selector: 'clr-timeline',
|
|
24643
24699
|
template: `<ng-content></ng-content>`,
|
|
24644
|
-
host: { '[class.clr-timeline]': 'true' },
|
|
24700
|
+
host: { '[class.clr-timeline]': 'true', '[attr.role]': '"list"' },
|
|
24645
24701
|
providers: [TimelineIconAttributeService],
|
|
24646
24702
|
}]
|
|
24647
24703
|
}], propDecorators: { layout: [{
|
|
@@ -24712,7 +24768,7 @@ class ClrTimelineStep {
|
|
|
24712
24768
|
}
|
|
24713
24769
|
}
|
|
24714
24770
|
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 });
|
|
24715
|
-
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: `
|
|
24771
|
+
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: `
|
|
24716
24772
|
<ng-content select="clr-timeline-step-header"></ng-content>
|
|
24717
24773
|
<span class="clr-sr-only">{{ stepTitleText }}</span>
|
|
24718
24774
|
<ng-container *ngIf="!isProcessing; else processing">
|
|
@@ -24756,7 +24812,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
24756
24812
|
<clr-spinner clrMedium [attr.aria-label]="iconAriaLabel"></clr-spinner>
|
|
24757
24813
|
</ng-template>
|
|
24758
24814
|
`,
|
|
24759
|
-
host: { '[class.clr-timeline-step]': 'true' },
|
|
24815
|
+
host: { '[class.clr-timeline-step]': 'true', '[attr.role]': '"listitem"' },
|
|
24760
24816
|
}]
|
|
24761
24817
|
}], ctorParameters: function () {
|
|
24762
24818
|
return [{ type: TimelineIconAttributeService }, { type: undefined, decorators: [{
|