@clr/angular 12.0.14 → 12.1.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/bundles/clr-angular.umd.js +251 -52
- package/bundles/clr-angular.umd.js.map +1 -1
- package/clarity.api.md +4 -3
- package/clr-angular.d.ts +39 -38
- package/clr-angular.metadata.json +1 -1
- package/data/datagrid/datagrid.d.ts +5 -1
- package/data/datagrid/utils/key-navigation-grid.controller.d.ts +24 -0
- package/esm2015/clr-angular.js +38 -37
- package/esm2015/data/datagrid/datagrid-placeholder.js +2 -2
- package/esm2015/data/datagrid/datagrid.js +18 -5
- package/esm2015/data/datagrid/utils/key-navigation-grid.controller.js +177 -0
- package/esm2015/forms/combobox/combobox.js +2 -2
- package/esm2015/forms/password/password-container.js +2 -6
- package/esm2015/layout/nav/nav-level.js +2 -3
- package/fesm2015/clr-angular.js +195 -15
- package/fesm2015/clr-angular.js.map +1 -1
- package/package.json +1 -1
|
@@ -6478,7 +6478,7 @@
|
|
|
6478
6478
|
ClrPasswordContainer.decorators = [
|
|
6479
6479
|
{ type: i0.Component, args: [{
|
|
6480
6480
|
selector: 'clr-password-container',
|
|
6481
|
-
template: "\n <ng-content select=\"label\"></ng-content>\n <label *ngIf=\"!label && addGrid()\"></label>\n <div class=\"clr-control-container\" [ngClass]=\"controlClass()\">\n <div class=\"clr-input-wrapper\">\n <div class=\"clr-input-group\" [class.clr-focus]=\"focus\">\n <ng-content select=\"[clrPassword]\"></ng-content>\n <button\n *ngIf=\"clrToggle\"\n (click)=\"toggle()\"\n [disabled]=\"control?.disabled\"\n class=\"clr-input-group-icon-action\"\n type=\"button\"\n >\n <cds-icon
|
|
6481
|
+
template: "\n <ng-content select=\"label\"></ng-content>\n <label *ngIf=\"!label && addGrid()\"></label>\n <div class=\"clr-control-container\" [ngClass]=\"controlClass()\">\n <div class=\"clr-input-wrapper\">\n <div class=\"clr-input-group\" [class.clr-focus]=\"focus\">\n <ng-content select=\"[clrPassword]\"></ng-content>\n <button\n *ngIf=\"clrToggle\"\n (click)=\"toggle()\"\n [disabled]=\"control?.disabled\"\n class=\"clr-input-group-icon-action\"\n type=\"button\"\n >\n <cds-icon status=\"info\" [attr.shape]=\"show ? 'eye-hide' : 'eye'\"></cds-icon>\n <span class=\"clr-sr-only\">{{\n show ? commonStrings.keys.passwordHide : commonStrings.keys.passwordShow\n }}</span>\n </button>\n </div>\n <cds-icon\n *ngIf=\"showInvalid\"\n class=\"clr-validate-icon\"\n status=\"danger\"\n shape=\"exclamation-circle\"\n aria-hidden=\"true\"\n ></cds-icon>\n <cds-icon\n *ngIf=\"showValid\"\n class=\"clr-validate-icon\"\n shape=\"check-circle\"\n status=\"success\"\n aria-hidden=\"true\"\n ></cds-icon>\n </div>\n <ng-content select=\"clr-control-helper\" *ngIf=\"showHelper\"></ng-content>\n <ng-content select=\"clr-control-error\" *ngIf=\"showInvalid\"></ng-content>\n <ng-content select=\"clr-control-success\" *ngIf=\"showValid\"></ng-content>\n </div>\n ",
|
|
6482
6482
|
host: {
|
|
6483
6483
|
'[class.clr-form-control]': 'true',
|
|
6484
6484
|
'[class.clr-form-control-disabled]': 'control?.disabled',
|
|
@@ -8360,7 +8360,7 @@
|
|
|
8360
8360
|
ClrCombobox.decorators = [
|
|
8361
8361
|
{ type: i0.Component, args: [{
|
|
8362
8362
|
selector: 'clr-combobox',
|
|
8363
|
-
template: "<!--\n* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\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<!-- The (click) handler is needed to auto-focus on input field which can not currently occupy the whole\n width of the component, after being wrapped to a new line -->\n<div\n class=\"clr-combobox-wrapper\"\n clrPopoverAnchor\n (click)=\"focusInput()\"\n [class.multi]=\"multiSelect\"\n [class.invalid]=\"invalid\"\n>\n <span\n *ngIf=\"multiSelect && optionSelectionService.selectionModel.model\"\n role=\"grid\"\n clrRovingTabindex\n [clrRovingTabindexDisabled]=\"control?.disabled\"\n clrDirection=\"both\"\n [attr.aria-label]=\"getSelectionAriaLabel()\"\n [attr.aria-disabled]=\"control?.disabled? true: null\"\n >\n <span *ngFor=\"let item of multiSelectModel; let i = index\" class=\"label label-combobox-pill\" role=\"row\">\n <span role=\"gridcell\">\n <span class=\"clr-combobox-pill-content\" clrKeyFocusItem>\n <ng-container\n *ngIf=\"optionSelected\"\n [ngTemplateOutlet]=\"optionSelected.template\"\n [ngTemplateOutletContext]=\"{$implicit: optionSelectionService.selectionModel.model[i]}\"\n >\n </ng-container>\n </span>\n </span>\n <span role=\"gridcell\">\n <button\n clrKeyFocusItem\n type=\"button\"\n class=\"clr-combobox-remove-btn\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxDelete + ' ' + optionSelectionService.selectionModel.toString(displayField, i)\"\n (click)=\"unselect(item)\"\n >\n <cds-icon shape=\"window-close\" size=\"12\"></cds-icon>\n </button>\n </span>\n </span>\n </span>\n\n <span class=\"clr-combobox-input-wrapper\">\n <input\n #textboxInput\n type=\"text\"\n [id]=\"inputId()\"\n
|
|
8363
|
+
template: "<!--\n* Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\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<!-- The (click) handler is needed to auto-focus on input field which can not currently occupy the whole\n width of the component, after being wrapped to a new line -->\n<div\n class=\"clr-combobox-wrapper\"\n clrPopoverAnchor\n (click)=\"focusInput()\"\n [class.multi]=\"multiSelect\"\n [class.invalid]=\"invalid\"\n>\n <span\n *ngIf=\"multiSelect && optionSelectionService.selectionModel.model\"\n role=\"grid\"\n clrRovingTabindex\n [clrRovingTabindexDisabled]=\"control?.disabled\"\n clrDirection=\"both\"\n [attr.aria-label]=\"getSelectionAriaLabel()\"\n [attr.aria-disabled]=\"control?.disabled? true: null\"\n >\n <span *ngFor=\"let item of multiSelectModel; let i = index\" class=\"label label-combobox-pill\" role=\"row\">\n <span role=\"gridcell\">\n <span class=\"clr-combobox-pill-content\" clrKeyFocusItem>\n <ng-container\n *ngIf=\"optionSelected\"\n [ngTemplateOutlet]=\"optionSelected.template\"\n [ngTemplateOutletContext]=\"{$implicit: optionSelectionService.selectionModel.model[i]}\"\n >\n </ng-container>\n </span>\n </span>\n <span role=\"gridcell\">\n <button\n clrKeyFocusItem\n type=\"button\"\n class=\"clr-combobox-remove-btn\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxDelete + ' ' + optionSelectionService.selectionModel.toString(displayField, i)\"\n (click)=\"unselect(item)\"\n >\n <cds-icon shape=\"window-close\" size=\"12\"></cds-icon>\n </button>\n </span>\n </span>\n </span>\n\n <span class=\"clr-combobox-input-wrapper\" role=\"combobox\">\n <input\n #textboxInput\n type=\"text\"\n [id]=\"inputId()\"\n class=\"clr-input clr-combobox-input\"\n [(ngModel)]=\"searchText\"\n (blur)=\"onBlur()\"\n (focus)=\"onFocus()\"\n [attr.aria-expanded]=\"openState\"\n [attr.aria-owns]=\"ariaOwns\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n [attr.aria-invalid]=\"control?.invalid? true: null\"\n [disabled]=\"control?.disabled? true: null\"\n [attr.aria-activedescendant]=\"getActiveDescendant()\"\n [attr.placeholder]=\"placeholder\"\n />\n </span>\n\n <!-- No click handler, as it uses the handler on the .clr-combobox-wrapper -->\n <button\n clrPopoverOpenCloseButton\n #trigger\n type=\"button\"\n class=\"clr-combobox-trigger\"\n tabindex=\"-1\"\n [disabled]=\"control?.disabled || null\"\n [attr.aria-label]=\"commonStrings.keys.comboboxOpen\"\n >\n <cds-icon shape=\"angle\" direction=\"down\" size=\"12\"></cds-icon>\n </button>\n\n <div class=\"clr-focus-indicator\" [class.clr-focus]=\"focused\"></div>\n</div>\n\n<!-- Both close handlers are handled manually due to issues in Edge browser.\n Additionally 'outsideClickToClose' has complex handling that's necessary\n to be manual due to the component architecture -->\n<div role=\"dialog\" *clrPopoverContent=\"openState at smartPosition; outsideClickToClose: false; scrollToClose: false\">\n <ng-content></ng-content>\n</div>\n",
|
|
8364
8364
|
providers: [
|
|
8365
8365
|
ClrPopoverToggleService,
|
|
8366
8366
|
{ provide: POPOVER_HOST_ANCHOR, useExisting: i0.ElementRef },
|
|
@@ -12584,7 +12584,7 @@
|
|
|
12584
12584
|
ClrDatagridPlaceholder.decorators = [
|
|
12585
12585
|
{ type: i0.Component, args: [{
|
|
12586
12586
|
selector: 'clr-dg-placeholder',
|
|
12587
|
-
template: "\n <div class=\"datagrid-placeholder\" [class.datagrid-empty]=\"emptyDatagrid\" role=\"row\">\n <div class=\"datagrid-placeholder-image\" *ngIf=\"emptyDatagrid\"></div>\n <span role=\"gridcell\"><ng-content *ngIf=\"emptyDatagrid\"></ng-content></span>\n </div>\n ",
|
|
12587
|
+
template: "\n <div class=\"datagrid-placeholder\" [class.datagrid-empty]=\"emptyDatagrid\" role=\"row\">\n <div class=\"datagrid-placeholder-image\" *ngIf=\"emptyDatagrid\"></div>\n <span role=\"gridcell\" class=\"datagrid-placeholder-content\"><ng-content *ngIf=\"emptyDatagrid\"></ng-content></span>\n </div>\n ",
|
|
12588
12588
|
host: { '[class.datagrid-placeholder-container]': 'true' }
|
|
12589
12589
|
},] }
|
|
12590
12590
|
];
|
|
@@ -13880,13 +13880,201 @@
|
|
|
13880
13880
|
{ type: i0.Injectable }
|
|
13881
13881
|
];
|
|
13882
13882
|
|
|
13883
|
+
/*
|
|
13884
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
13885
|
+
* This software is released under MIT license.
|
|
13886
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
13887
|
+
*/
|
|
13888
|
+
function getTabableItems(el) {
|
|
13889
|
+
var tabableSelector = [
|
|
13890
|
+
'a[href]',
|
|
13891
|
+
'area[href]',
|
|
13892
|
+
'input:not([disabled])',
|
|
13893
|
+
'button:not([disabled])',
|
|
13894
|
+
'select:not([disabled])',
|
|
13895
|
+
'textarea:not([disabled])',
|
|
13896
|
+
'iframe',
|
|
13897
|
+
'object',
|
|
13898
|
+
'embed',
|
|
13899
|
+
'*[tabindex]',
|
|
13900
|
+
'*[contenteditable=true]',
|
|
13901
|
+
'[role=button]:not([disabled])',
|
|
13902
|
+
].join(',');
|
|
13903
|
+
return Array.from(el.querySelectorAll(tabableSelector));
|
|
13904
|
+
}
|
|
13905
|
+
var KeyNavigationGridController = /** @class */ (function () {
|
|
13906
|
+
function KeyNavigationGridController(zone) {
|
|
13907
|
+
this.zone = zone;
|
|
13908
|
+
this.listenersAdded = false;
|
|
13909
|
+
this.destroy$ = new rxjs.Subject();
|
|
13910
|
+
this.config = {
|
|
13911
|
+
keyGridRows: '[role=row]:not(.datagrid-placeholder)',
|
|
13912
|
+
keyGridCells: '[role=gridcell]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), [role=columnheader]:not(.datagrid-hidden-column):not(.datagrid-placeholder-content), .datagrid-detail-caret',
|
|
13913
|
+
keyGrid: '[role=grid]',
|
|
13914
|
+
};
|
|
13915
|
+
}
|
|
13916
|
+
Object.defineProperty(KeyNavigationGridController.prototype, "grid", {
|
|
13917
|
+
get: function () {
|
|
13918
|
+
var _a;
|
|
13919
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector(this.config.keyGrid);
|
|
13920
|
+
},
|
|
13921
|
+
enumerable: false,
|
|
13922
|
+
configurable: true
|
|
13923
|
+
});
|
|
13924
|
+
Object.defineProperty(KeyNavigationGridController.prototype, "rows", {
|
|
13925
|
+
get: function () {
|
|
13926
|
+
var _a;
|
|
13927
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridRows);
|
|
13928
|
+
},
|
|
13929
|
+
enumerable: false,
|
|
13930
|
+
configurable: true
|
|
13931
|
+
});
|
|
13932
|
+
Object.defineProperty(KeyNavigationGridController.prototype, "cells", {
|
|
13933
|
+
get: function () {
|
|
13934
|
+
var _a;
|
|
13935
|
+
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.config.keyGridCells);
|
|
13936
|
+
},
|
|
13937
|
+
enumerable: false,
|
|
13938
|
+
configurable: true
|
|
13939
|
+
});
|
|
13940
|
+
KeyNavigationGridController.prototype.ngOnDestroy = function () {
|
|
13941
|
+
this.destroy$.next();
|
|
13942
|
+
this.destroy$.complete();
|
|
13943
|
+
};
|
|
13944
|
+
KeyNavigationGridController.prototype.addListeners = function () {
|
|
13945
|
+
var _this = this;
|
|
13946
|
+
if (this.listenersAdded) {
|
|
13947
|
+
return;
|
|
13948
|
+
}
|
|
13949
|
+
this.zone.runOutsideAngular(function () {
|
|
13950
|
+
rxjs.fromEvent(_this.grid, 'mousedown')
|
|
13951
|
+
.pipe(operators.takeUntil(_this.destroy$))
|
|
13952
|
+
.subscribe(function (e) {
|
|
13953
|
+
// 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
|
|
13954
|
+
if (e.buttons === 1 && !e.ctrlKey) {
|
|
13955
|
+
var activeCell = _this.cells
|
|
13956
|
+
? Array.from(_this.cells).find(function (c) { return c === e.target || c === e.target.closest(_this.config.keyGridCells); })
|
|
13957
|
+
: null;
|
|
13958
|
+
if (activeCell) {
|
|
13959
|
+
_this.setActiveCell(activeCell);
|
|
13960
|
+
}
|
|
13961
|
+
}
|
|
13962
|
+
});
|
|
13963
|
+
rxjs.fromEvent(_this.grid, 'keydown')
|
|
13964
|
+
.pipe(operators.takeUntil(_this.destroy$))
|
|
13965
|
+
.subscribe(function (e) {
|
|
13966
|
+
// Skip column resize events
|
|
13967
|
+
if (e.target.classList.contains('drag-handle') &&
|
|
13968
|
+
(e.code === 'ArrowLeft' || e.code === 'ArrowRight')) {
|
|
13969
|
+
return;
|
|
13970
|
+
}
|
|
13971
|
+
if (e.code === 'ArrowUp' ||
|
|
13972
|
+
e.code === 'ArrowDown' ||
|
|
13973
|
+
e.code === 'ArrowLeft' ||
|
|
13974
|
+
e.code === 'ArrowRight' ||
|
|
13975
|
+
e.code === 'End' ||
|
|
13976
|
+
e.code === 'Home' ||
|
|
13977
|
+
e.code === 'PageUp' ||
|
|
13978
|
+
e.code === 'PageDown') {
|
|
13979
|
+
var _b = _this.getNextItemCoordinate(e), x = _b.x, y = _b.y;
|
|
13980
|
+
var activeItem = _this.rows
|
|
13981
|
+
? Array.from(_this.rows[y].querySelectorAll(_this.config.keyGridCells))[x]
|
|
13982
|
+
: null;
|
|
13983
|
+
if (activeItem) {
|
|
13984
|
+
_this.setActiveCell(activeItem);
|
|
13985
|
+
}
|
|
13986
|
+
e.preventDefault();
|
|
13987
|
+
}
|
|
13988
|
+
});
|
|
13989
|
+
});
|
|
13990
|
+
this.listenersAdded = true;
|
|
13991
|
+
};
|
|
13992
|
+
KeyNavigationGridController.prototype.initializeKeyGrid = function (host) {
|
|
13993
|
+
this.host = host;
|
|
13994
|
+
this.addListeners();
|
|
13995
|
+
this.resetKeyGrid();
|
|
13996
|
+
};
|
|
13997
|
+
KeyNavigationGridController.prototype.resetKeyGrid = function () {
|
|
13998
|
+
var _a;
|
|
13999
|
+
(_a = this.cells) === null || _a === void 0 ? void 0 : _a.forEach(function (i) { return i.setAttribute('tabindex', '-1'); });
|
|
14000
|
+
var firstCell = this.cells ? this.cells[0] : null;
|
|
14001
|
+
firstCell === null || firstCell === void 0 ? void 0 : firstCell.setAttribute('tabindex', '0');
|
|
14002
|
+
};
|
|
14003
|
+
KeyNavigationGridController.prototype.setActiveCell = function (activeCell) {
|
|
14004
|
+
var prior = this.cells ? Array.from(this.cells).find(function (c) { return c.getAttribute('tabindex') === '0'; }) : null;
|
|
14005
|
+
if (prior) {
|
|
14006
|
+
prior.setAttribute('tabindex', '-1');
|
|
14007
|
+
}
|
|
14008
|
+
activeCell.setAttribute('tabindex', '0');
|
|
14009
|
+
var items = getTabableItems(activeCell);
|
|
14010
|
+
var item = activeCell.getAttribute('role') !== 'columnheader' && items[0] ? items[0] : activeCell;
|
|
14011
|
+
item.focus();
|
|
14012
|
+
};
|
|
14013
|
+
KeyNavigationGridController.prototype.getNextItemCoordinate = function (e) {
|
|
14014
|
+
var _a;
|
|
14015
|
+
var currentCell = this.cells ? Array.from(this.cells).find(function (i) { return i.getAttribute('tabindex') === '0'; }) : null;
|
|
14016
|
+
if (e.code === 'Tab') {
|
|
14017
|
+
currentCell = document.activeElement;
|
|
14018
|
+
}
|
|
14019
|
+
var currentRow = this.rows && currentCell ? Array.from(this.rows).find(function (r) { return r.contains(currentCell); }) : null;
|
|
14020
|
+
var numOfRows = this.rows ? this.rows.length - 1 : 0;
|
|
14021
|
+
var numOfColumns = this.cells ? this.cells.length / this.rows.length - 1 : 0;
|
|
14022
|
+
var x = currentRow && currentCell
|
|
14023
|
+
? Array.from(currentRow.querySelectorAll(this.config.keyGridCells)).indexOf(currentCell)
|
|
14024
|
+
: 0;
|
|
14025
|
+
var y = currentRow && currentCell && this.rows ? Array.from(this.rows).indexOf(currentRow) : 0;
|
|
14026
|
+
var dir = this.host.dir;
|
|
14027
|
+
var inlineStart = dir === 'rtl' ? 'ArrowRight' : 'ArrowLeft';
|
|
14028
|
+
var inlineEnd = dir === 'rtl' ? 'ArrowLeft' : 'ArrowRight';
|
|
14029
|
+
var itemsPerPage = Math.floor(((_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelector('.datagrid').clientHeight) / this.rows[0].clientHeight) - 1 || 0;
|
|
14030
|
+
if (e.code === 'ArrowUp' && y !== 0) {
|
|
14031
|
+
y = y - 1;
|
|
14032
|
+
}
|
|
14033
|
+
else if (e.code === 'ArrowDown' && y < numOfRows) {
|
|
14034
|
+
y = y + 1;
|
|
14035
|
+
}
|
|
14036
|
+
else if (e.code === inlineStart && x !== 0) {
|
|
14037
|
+
x = x - 1;
|
|
14038
|
+
}
|
|
14039
|
+
else if (e.code === inlineEnd && x < numOfColumns) {
|
|
14040
|
+
x = x + 1;
|
|
14041
|
+
}
|
|
14042
|
+
else if (e.code === 'End') {
|
|
14043
|
+
x = numOfColumns;
|
|
14044
|
+
if (e.ctrlKey) {
|
|
14045
|
+
y = numOfRows;
|
|
14046
|
+
}
|
|
14047
|
+
}
|
|
14048
|
+
else if (e.code === 'Home') {
|
|
14049
|
+
x = 0;
|
|
14050
|
+
if (e.ctrlKey) {
|
|
14051
|
+
y = 0;
|
|
14052
|
+
}
|
|
14053
|
+
}
|
|
14054
|
+
else if (e.code === 'PageUp') {
|
|
14055
|
+
y = y - itemsPerPage > 0 ? y - itemsPerPage : 0;
|
|
14056
|
+
}
|
|
14057
|
+
else if (e.code === 'PageDown') {
|
|
14058
|
+
y = y + itemsPerPage < numOfRows ? y + itemsPerPage : numOfRows;
|
|
14059
|
+
}
|
|
14060
|
+
return { x: x, y: y };
|
|
14061
|
+
};
|
|
14062
|
+
return KeyNavigationGridController;
|
|
14063
|
+
}());
|
|
14064
|
+
KeyNavigationGridController.decorators = [
|
|
14065
|
+
{ type: i0.Injectable }
|
|
14066
|
+
];
|
|
14067
|
+
KeyNavigationGridController.ctorParameters = function () { return [
|
|
14068
|
+
{ type: i0.NgZone }
|
|
14069
|
+
]; };
|
|
14070
|
+
|
|
13883
14071
|
/*
|
|
13884
14072
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
13885
14073
|
* This software is released under MIT license.
|
|
13886
14074
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
13887
14075
|
*/
|
|
13888
14076
|
var ClrDatagrid = /** @class */ (function () {
|
|
13889
|
-
function ClrDatagrid(organizer, items, expandableRows, selection, rowActionService, stateProvider, displayMode, renderer, detailService, datagridId, el, page, commonStrings) {
|
|
14077
|
+
function ClrDatagrid(organizer, items, expandableRows, selection, rowActionService, stateProvider, displayMode, renderer, detailService, datagridId, el, page, commonStrings, columnsService, keyNavigation) {
|
|
13890
14078
|
this.organizer = organizer;
|
|
13891
14079
|
this.items = items;
|
|
13892
14080
|
this.expandableRows = expandableRows;
|
|
@@ -13899,6 +14087,8 @@
|
|
|
13899
14087
|
this.el = el;
|
|
13900
14088
|
this.page = page;
|
|
13901
14089
|
this.commonStrings = commonStrings;
|
|
14090
|
+
this.columnsService = columnsService;
|
|
14091
|
+
this.keyNavigation = keyNavigation;
|
|
13902
14092
|
/* reference to the enum so that template can access */
|
|
13903
14093
|
this.SELECTION_TYPE = SelectionType;
|
|
13904
14094
|
/**
|
|
@@ -14050,6 +14240,7 @@
|
|
|
14050
14240
|
*/
|
|
14051
14241
|
ClrDatagrid.prototype.ngAfterViewInit = function () {
|
|
14052
14242
|
var _this = this;
|
|
14243
|
+
this.keyNavigation.initializeKeyGrid(this.el.nativeElement);
|
|
14053
14244
|
// TODO: determine if we can get rid of provider wiring in view init so that subscriptions can be done earlier
|
|
14054
14245
|
this.refresh.emit(this.stateProvider.state);
|
|
14055
14246
|
this._subscriptions.push(this.stateProvider.change.subscribe(function (state) { return _this.refresh.emit(state); }), this.selection.change.subscribe(function (s) {
|
|
@@ -14059,11 +14250,16 @@
|
|
|
14059
14250
|
else if (_this.selection.selectionType === SelectionType.Multi) {
|
|
14060
14251
|
_this.selectedChanged.emit(s);
|
|
14061
14252
|
}
|
|
14062
|
-
}),
|
|
14253
|
+
}),
|
|
14254
|
+
// Reinitialize arrow key navigation on page changes
|
|
14255
|
+
this.page.change.subscribe(function () {
|
|
14256
|
+
_this.keyNavigation.resetKeyGrid();
|
|
14063
14257
|
if (!_this.clrDgDisablePageFocus) {
|
|
14064
14258
|
_this.datagridTable.nativeElement.focus();
|
|
14065
14259
|
}
|
|
14066
14260
|
}),
|
|
14261
|
+
// Reinitialize arrow key navigation on hide/unhide columns
|
|
14262
|
+
rxjs.combineLatest(this.columnsService.columns).subscribe(function () { var _a; return (_a = _this.keyNavigation) === null || _a === void 0 ? void 0 : _a.resetKeyGrid(); }),
|
|
14067
14263
|
// A subscription that listens for displayMode changes on the datagrid
|
|
14068
14264
|
this.displayMode.view.subscribe(function (viewChange) {
|
|
14069
14265
|
// Remove any projected columns from the projectedDisplayColumns container
|
|
@@ -14115,7 +14311,7 @@
|
|
|
14115
14311
|
ClrDatagrid.decorators = [
|
|
14116
14312
|
{ type: i0.Component, args: [{
|
|
14117
14313
|
selector: 'clr-datagrid',
|
|
14118
|
-
template: "<!--\n ~ Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\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 >\n <div class=\"clr-checkbox-wrapper\">\n <input\n type=\"checkbox\"\n [id]=\"selectAllId\"\n [(ngModel)]=\"allSelected\"\n [attr.aria-label]=\"commonStrings.keys.selectAll\"\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 [attr.aria-label]=\"clrDgSingleSelectionAriaLabel\"\n >\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 [attr.aria-label]=\"clrDgSingleActionableAriaLabel\"\n >\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 [attr.aria-label]=\"clrDetailExpandableAriaLabel\"\n >\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 <ng-container #displayedRows></ng-container>\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 <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",
|
|
14314
|
+
template: "<!--\n ~ Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\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)=\"allSelected = !allSelected; $event.preventDefault()\"\n >\n <div 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 [attr.aria-label]=\"clrDgSingleSelectionAriaLabel\"\n >\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 [attr.aria-label]=\"clrDgSingleActionableAriaLabel\"\n >\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 [attr.aria-label]=\"clrDetailExpandableAriaLabel\"\n >\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 <ng-container #displayedRows></ng-container>\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 <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",
|
|
14119
14315
|
providers: [
|
|
14120
14316
|
Selection,
|
|
14121
14317
|
Sort,
|
|
@@ -14132,6 +14328,7 @@
|
|
|
14132
14328
|
TableSizeService,
|
|
14133
14329
|
ColumnsService,
|
|
14134
14330
|
DisplayModeService,
|
|
14331
|
+
KeyNavigationGridController,
|
|
14135
14332
|
],
|
|
14136
14333
|
host: {
|
|
14137
14334
|
'[class.datagrid-host]': 'true',
|
|
@@ -14152,7 +14349,9 @@
|
|
|
14152
14349
|
{ type: String, decorators: [{ type: i0.Inject, args: [UNIQUE_ID,] }] },
|
|
14153
14350
|
{ type: i0.ElementRef },
|
|
14154
14351
|
{ type: Page },
|
|
14155
|
-
{ type: ClrCommonStringsService }
|
|
14352
|
+
{ type: ClrCommonStringsService },
|
|
14353
|
+
{ type: ColumnsService },
|
|
14354
|
+
{ type: KeyNavigationGridController }
|
|
14156
14355
|
]; };
|
|
14157
14356
|
ClrDatagrid.propDecorators = {
|
|
14158
14357
|
loading: [{ type: i0.Input, args: ['clrDgLoading',] }],
|
|
@@ -19685,7 +19884,6 @@
|
|
|
19685
19884
|
var createCdsCloseButton = function (document, ariaLabel) {
|
|
19686
19885
|
var cdsCloseButton = document.createElement('cds-internal-close-button');
|
|
19687
19886
|
cdsCloseButton.setAttribute('icon-size', '32');
|
|
19688
|
-
console.log(ariaLabel);
|
|
19689
19887
|
cdsCloseButton.setAttribute('aria-label', ariaLabel);
|
|
19690
19888
|
cdsCloseButton.setAttribute('aria-hidden', 'true');
|
|
19691
19889
|
cdsCloseButton.setAttribute('type', 'button');
|
|
@@ -19823,7 +20021,7 @@
|
|
|
19823
20021
|
if (current === navHost) {
|
|
19824
20022
|
return;
|
|
19825
20023
|
}
|
|
19826
|
-
else if (current.classList.contains('nav-link')) {
|
|
20024
|
+
else if (current.classList.contains('nav-link') && this._document.body.clientWidth < LARGE_BREAKPOINT) {
|
|
19827
20025
|
this.close();
|
|
19828
20026
|
return;
|
|
19829
20027
|
}
|
|
@@ -26488,50 +26686,51 @@
|
|
|
26488
26686
|
exports["ɵd"] = FOCUS_TRAP_DIRECTIVES;
|
|
26489
26687
|
exports["ɵda"] = ColumnsService;
|
|
26490
26688
|
exports["ɵdb"] = DisplayModeService;
|
|
26491
|
-
exports["ɵdc"] =
|
|
26492
|
-
exports["ɵdd"] =
|
|
26493
|
-
exports["ɵde"] =
|
|
26494
|
-
exports["ɵdf"] =
|
|
26495
|
-
exports["ɵdg"] =
|
|
26496
|
-
exports["ɵdh"] =
|
|
26497
|
-
exports["ɵdi"] =
|
|
26498
|
-
exports["ɵdj"] =
|
|
26499
|
-
exports["ɵdk"] =
|
|
26500
|
-
exports["
|
|
26501
|
-
exports["ɵdn"] =
|
|
26502
|
-
exports["ɵdo"] =
|
|
26503
|
-
exports["ɵdp"] =
|
|
26504
|
-
exports["ɵdq"] =
|
|
26505
|
-
exports["ɵdr"] =
|
|
26506
|
-
exports["ɵds"] =
|
|
26507
|
-
exports["ɵdt"] =
|
|
26508
|
-
exports["ɵdu"] =
|
|
26509
|
-
exports["ɵdv"] =
|
|
26510
|
-
exports["ɵdw"] =
|
|
26511
|
-
exports["
|
|
26512
|
-
exports["ɵdz"] =
|
|
26689
|
+
exports["ɵdc"] = KeyNavigationGridController;
|
|
26690
|
+
exports["ɵdd"] = DatagridFilterRegistrar;
|
|
26691
|
+
exports["ɵde"] = CustomFilter;
|
|
26692
|
+
exports["ɵdf"] = DatagridIfExpandService;
|
|
26693
|
+
exports["ɵdg"] = SignpostFocusManager;
|
|
26694
|
+
exports["ɵdh"] = SignpostIdService;
|
|
26695
|
+
exports["ɵdi"] = ColumnResizerService;
|
|
26696
|
+
exports["ɵdj"] = COLUMN_STATE;
|
|
26697
|
+
exports["ɵdk"] = columnStateFactory;
|
|
26698
|
+
exports["ɵdl"] = COLUMN_STATE_PROVIDER;
|
|
26699
|
+
exports["ɵdn"] = WillyWonka;
|
|
26700
|
+
exports["ɵdo"] = OompaLoompa;
|
|
26701
|
+
exports["ɵdp"] = StackControl;
|
|
26702
|
+
exports["ɵdq"] = TreeFeaturesService;
|
|
26703
|
+
exports["ɵdr"] = treeFeaturesFactory;
|
|
26704
|
+
exports["ɵds"] = TREE_FEATURES_PROVIDER;
|
|
26705
|
+
exports["ɵdt"] = TreeFocusManagerService;
|
|
26706
|
+
exports["ɵdu"] = RecursiveChildren;
|
|
26707
|
+
exports["ɵdv"] = ScrollingService;
|
|
26708
|
+
exports["ɵdw"] = ButtonInGroupService;
|
|
26709
|
+
exports["ɵdx"] = ResponsiveNavigationService;
|
|
26710
|
+
exports["ɵdz"] = FocusTrap;
|
|
26513
26711
|
exports["ɵe"] = RootDropdownService;
|
|
26514
|
-
exports["ɵea"] =
|
|
26515
|
-
exports["ɵeb"] =
|
|
26516
|
-
exports["ɵec"] =
|
|
26517
|
-
exports["ɵed"] =
|
|
26518
|
-
exports["ɵee"] =
|
|
26519
|
-
exports["ɵef"] =
|
|
26520
|
-
exports["ɵeg"] =
|
|
26521
|
-
exports["ɵeh"] =
|
|
26522
|
-
exports["ɵei"] =
|
|
26523
|
-
exports["ɵej"] =
|
|
26524
|
-
exports["ɵek"] =
|
|
26525
|
-
exports["ɵel"] =
|
|
26526
|
-
exports["ɵem"] =
|
|
26527
|
-
exports["ɵen"] =
|
|
26528
|
-
exports["ɵeo"] =
|
|
26529
|
-
exports["ɵep"] =
|
|
26530
|
-
exports["ɵeq"] =
|
|
26531
|
-
exports["ɵer"] =
|
|
26532
|
-
exports["ɵes"] =
|
|
26533
|
-
exports["ɵet"] =
|
|
26534
|
-
exports["ɵeu"] =
|
|
26712
|
+
exports["ɵea"] = ClrTemplateRefModule;
|
|
26713
|
+
exports["ɵeb"] = TEMPLATE_REF_DIRECTIVES;
|
|
26714
|
+
exports["ɵec"] = TemplateRefContainer;
|
|
26715
|
+
exports["ɵed"] = TabsService;
|
|
26716
|
+
exports["ɵee"] = TABS_ID;
|
|
26717
|
+
exports["ɵef"] = tokenFactory;
|
|
26718
|
+
exports["ɵeg"] = TABS_ID_PROVIDER;
|
|
26719
|
+
exports["ɵeh"] = VerticalNavService;
|
|
26720
|
+
exports["ɵei"] = VerticalNavIconService;
|
|
26721
|
+
exports["ɵej"] = VerticalNavGroupRegistrationService;
|
|
26722
|
+
exports["ɵek"] = VerticalNavGroupService;
|
|
26723
|
+
exports["ɵel"] = TooltipIdService;
|
|
26724
|
+
exports["ɵem"] = WizardNavigationService;
|
|
26725
|
+
exports["ɵen"] = PageCollectionService;
|
|
26726
|
+
exports["ɵeo"] = ButtonHubService;
|
|
26727
|
+
exports["ɵep"] = HeaderActionService;
|
|
26728
|
+
exports["ɵeq"] = AccordionService;
|
|
26729
|
+
exports["ɵer"] = panelAnimation;
|
|
26730
|
+
exports["ɵes"] = stepAnimation;
|
|
26731
|
+
exports["ɵet"] = defaultAnimationTiming;
|
|
26732
|
+
exports["ɵeu"] = StepperService;
|
|
26733
|
+
exports["ɵev"] = TimelineIconAttributeService;
|
|
26535
26734
|
exports["ɵf"] = clrRootDropdownFactory;
|
|
26536
26735
|
exports["ɵg"] = ROOT_DROPDOWN_PROVIDER;
|
|
26537
26736
|
exports["ɵh"] = POPOVER_HOST_ANCHOR;
|