@clr/angular 12.0.13 → 12.1.0
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 +1051 -552
- package/bundles/clr-angular.umd.js.map +1 -1
- package/clarity.api.md +4011 -0
- package/clr-angular.d.ts +39 -37
- 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 -36
- package/esm2015/data/datagrid/datagrid-column-toggle.js +4 -2
- 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/datepicker/calendar.js +1 -1
- package/esm2015/forms/password/password-container.js +5 -6
- package/esm2015/layout/nav/header.js +25 -5
- package/esm2015/layout/nav/nav-level.js +106 -6
- package/esm2015/utils/breakpoints/breakpoints.js +15 -1
- package/esm2015/utils/focus-trap/focus-trap.js +144 -0
- package/esm2015/utils/i18n/common-strings.default.js +14 -1
- package/esm2015/utils/i18n/common-strings.interface.js +1 -1
- package/esm2015/wizard/providers/wizard-navigation.service.js +1 -1
- package/esm2015/wizard/wizard.js +9 -2
- package/fesm2015/clr-angular.js +1016 -541
- package/fesm2015/clr-angular.js.map +1 -1
- package/layout/nav/header.d.ts +6 -0
- package/layout/nav/nav-level.d.ts +15 -3
- package/package.json +5 -5
- package/utils/breakpoints/breakpoints.d.ts +14 -0
- package/utils/focus-trap/focus-trap.d.ts +26 -0
- package/utils/i18n/common-strings.interface.d.ts +21 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@cds/core/icon'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@angular/forms'), require('@cds/core/icon/register')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@clr/angular', ['exports', '@angular/core', '@cds/core/icon', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/animations', '@angular/forms', '@cds/core/icon/register'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.clr = global.clr || {}, global.clr.angular = {}), global.ng.core, global.icon, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.animations, global.ng.forms));
|
|
5
|
-
})(this, (function (exports, i0, icon, i1, rxjs, operators, animations, forms) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@cds/core/icon'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@angular/forms'), require('@cds/core/internal'), require('@cds/core/internal-components/close-button/register.js'), require('@cds/core/icon/register')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@clr/angular', ['exports', '@angular/core', '@cds/core/icon', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/animations', '@angular/forms', '@cds/core/internal', '@cds/core/internal-components/close-button/register.js', '@cds/core/icon/register'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.clr = global.clr || {}, global.clr.angular = {}), global.ng.core, global.icon, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.animations, global.ng.forms, global.internal));
|
|
5
|
+
})(this, (function (exports, i0, icon, i1, rxjs, operators, animations, forms, internal) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -1417,6 +1417,19 @@
|
|
|
1417
1417
|
datagridExpandableEndOf: 'End of',
|
|
1418
1418
|
datagridExpandableRowContent: 'Expandable row content',
|
|
1419
1419
|
datagridExpandableRowsHelperText: "Screen reader table commands may not work for viewing expanded content, please use your screen reader's browse mode to read the content exposed by this button",
|
|
1420
|
+
responsiveNavToggleOpen: 'Navigation menu',
|
|
1421
|
+
responsiveNavToggleClose: 'Navigation menu',
|
|
1422
|
+
responsiveNavOverflowOpen: 'Navigation overflow menu',
|
|
1423
|
+
responsiveNavOverflowClose: 'Navigation overflow menu',
|
|
1424
|
+
// Wizard
|
|
1425
|
+
wizardStepSuccess: 'Completed',
|
|
1426
|
+
wizardStepError: 'Error',
|
|
1427
|
+
/**
|
|
1428
|
+
* Password Input
|
|
1429
|
+
* Screen-reader text for the hide/show password field button
|
|
1430
|
+
*/
|
|
1431
|
+
passwordHide: 'Hide password',
|
|
1432
|
+
passwordShow: 'Show password',
|
|
1420
1433
|
};
|
|
1421
1434
|
|
|
1422
1435
|
/*
|
|
@@ -5126,7 +5139,7 @@
|
|
|
5126
5139
|
return ClrCalendar;
|
|
5127
5140
|
}());
|
|
5128
5141
|
ClrCalendar.decorators = [
|
|
5129
|
-
{ type: i0.Component, args: [{ selector: 'clr-calendar', template: "<table class=\"calendar-table\">\n <tr class=\"calendar-row weekdays\">\n <
|
|
5142
|
+
{ type: i0.Component, args: [{ selector: 'clr-calendar', template: "<table class=\"calendar-table\">\n <tr class=\"calendar-row weekdays\">\n <th *ngFor=\"let day of localeDays\" class=\"calendar-cell weekday\" role=\"heading\" [attr.aria-label]=\"day.day\">\n {{day.narrow}}\n </th>\n </tr>\n <tr class=\"calendar-row\" *ngFor=\"let row of calendarViewModel.calendarView\">\n <td *ngFor=\"let dayView of row\" class=\"calendar-cell\">\n <clr-day [clrDayView]=\"dayView\"></clr-day>\n </td>\n </tr>\n</table>\n" },] }
|
|
5130
5143
|
];
|
|
5131
5144
|
ClrCalendar.ctorParameters = function () { return [
|
|
5132
5145
|
{ type: LocaleHelperService },
|
|
@@ -5213,9 +5226,23 @@
|
|
|
5213
5226
|
* This software is released under MIT license.
|
|
5214
5227
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
5215
5228
|
*/
|
|
5229
|
+
/**
|
|
5230
|
+
* TODO:
|
|
5231
|
+
* Using core functions like:
|
|
5232
|
+
* - pluckPixelValue
|
|
5233
|
+
* - getCssPropertyValue
|
|
5234
|
+
*
|
|
5235
|
+
* to get the value of the design token.
|
|
5236
|
+
*
|
|
5237
|
+
* Note: Memoization/Cache usage possible.
|
|
5238
|
+
*/
|
|
5216
5239
|
// iPad mini screen width
|
|
5217
5240
|
// http://stephen.io/mediaqueries/#iPadMini
|
|
5218
5241
|
var DATEPICKER_ENABLE_BREAKPOINT = 768;
|
|
5242
|
+
var SMALL_BREAKPOINT = 576;
|
|
5243
|
+
var MEDIUM_BREAKPOINT = 768;
|
|
5244
|
+
var LARGE_BREAKPOINT = 992;
|
|
5245
|
+
var EXTRA_LARGE_BREAKPOINT = 1200;
|
|
5219
5246
|
|
|
5220
5247
|
/*
|
|
5221
5248
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -6451,7 +6478,7 @@
|
|
|
6451
6478
|
ClrPasswordContainer.decorators = [
|
|
6452
6479
|
{ type: i0.Component, args: [{
|
|
6453
6480
|
selector: 'clr-password-container',
|
|
6454
|
-
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 ",
|
|
6455
6482
|
host: {
|
|
6456
6483
|
'[class.clr-form-control]': 'true',
|
|
6457
6484
|
'[class.clr-form-control-disabled]': 'control?.disabled',
|
|
@@ -8333,7 +8360,7 @@
|
|
|
8333
8360
|
ClrCombobox.decorators = [
|
|
8334
8361
|
{ type: i0.Component, args: [{
|
|
8335
8362
|
selector: 'clr-combobox',
|
|
8336
|
-
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",
|
|
8337
8364
|
providers: [
|
|
8338
8365
|
ClrPopoverToggleService,
|
|
8339
8366
|
{ provide: POPOVER_HOST_ANCHOR, useExisting: i0.ElementRef },
|
|
@@ -12557,7 +12584,7 @@
|
|
|
12557
12584
|
ClrDatagridPlaceholder.decorators = [
|
|
12558
12585
|
{ type: i0.Component, args: [{
|
|
12559
12586
|
selector: 'clr-dg-placeholder',
|
|
12560
|
-
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 ",
|
|
12561
12588
|
host: { '[class.datagrid-placeholder-container]': 'true' }
|
|
12562
12589
|
},] }
|
|
12563
12590
|
];
|
|
@@ -13790,10 +13817,10 @@
|
|
|
13790
13817
|
DatagridColumnChanges[DatagridColumnChanges["WIDTH"] = 0] = "WIDTH";
|
|
13791
13818
|
DatagridColumnChanges[DatagridColumnChanges["HIDDEN"] = 1] = "HIDDEN";
|
|
13792
13819
|
})(DatagridColumnChanges || (DatagridColumnChanges = {}));
|
|
13793
|
-
var ɵ1 = function (key) { return DatagridColumnChanges[key]; }, ɵ0 = function (key) { return key === parseInt(key, 10); };
|
|
13820
|
+
var ɵ1 = function (key) { return DatagridColumnChanges[key]; }, ɵ0$1 = function (key) { return key === parseInt(key, 10); };
|
|
13794
13821
|
var ALL_COLUMN_CHANGES = Object.keys(DatagridColumnChanges)
|
|
13795
13822
|
.map(ɵ1)
|
|
13796
|
-
.filter(ɵ0); // extracts only integer keys
|
|
13823
|
+
.filter(ɵ0$1); // extracts only integer keys
|
|
13797
13824
|
|
|
13798
13825
|
/*
|
|
13799
13826
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -13853,13 +13880,201 @@
|
|
|
13853
13880
|
{ type: i0.Injectable }
|
|
13854
13881
|
];
|
|
13855
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
|
+
|
|
13856
14071
|
/*
|
|
13857
14072
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
13858
14073
|
* This software is released under MIT license.
|
|
13859
14074
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
13860
14075
|
*/
|
|
13861
14076
|
var ClrDatagrid = /** @class */ (function () {
|
|
13862
|
-
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) {
|
|
13863
14078
|
this.organizer = organizer;
|
|
13864
14079
|
this.items = items;
|
|
13865
14080
|
this.expandableRows = expandableRows;
|
|
@@ -13872,6 +14087,8 @@
|
|
|
13872
14087
|
this.el = el;
|
|
13873
14088
|
this.page = page;
|
|
13874
14089
|
this.commonStrings = commonStrings;
|
|
14090
|
+
this.columnsService = columnsService;
|
|
14091
|
+
this.keyNavigation = keyNavigation;
|
|
13875
14092
|
/* reference to the enum so that template can access */
|
|
13876
14093
|
this.SELECTION_TYPE = SelectionType;
|
|
13877
14094
|
/**
|
|
@@ -14023,6 +14240,7 @@
|
|
|
14023
14240
|
*/
|
|
14024
14241
|
ClrDatagrid.prototype.ngAfterViewInit = function () {
|
|
14025
14242
|
var _this = this;
|
|
14243
|
+
this.keyNavigation.initializeKeyGrid(this.el.nativeElement);
|
|
14026
14244
|
// TODO: determine if we can get rid of provider wiring in view init so that subscriptions can be done earlier
|
|
14027
14245
|
this.refresh.emit(this.stateProvider.state);
|
|
14028
14246
|
this._subscriptions.push(this.stateProvider.change.subscribe(function (state) { return _this.refresh.emit(state); }), this.selection.change.subscribe(function (s) {
|
|
@@ -14032,11 +14250,16 @@
|
|
|
14032
14250
|
else if (_this.selection.selectionType === SelectionType.Multi) {
|
|
14033
14251
|
_this.selectedChanged.emit(s);
|
|
14034
14252
|
}
|
|
14035
|
-
}),
|
|
14253
|
+
}),
|
|
14254
|
+
// Reinitialize arrow key navigation on page changes
|
|
14255
|
+
this.page.change.subscribe(function () {
|
|
14256
|
+
_this.keyNavigation.resetKeyGrid();
|
|
14036
14257
|
if (!_this.clrDgDisablePageFocus) {
|
|
14037
14258
|
_this.datagridTable.nativeElement.focus();
|
|
14038
14259
|
}
|
|
14039
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(); }),
|
|
14040
14263
|
// A subscription that listens for displayMode changes on the datagrid
|
|
14041
14264
|
this.displayMode.view.subscribe(function (viewChange) {
|
|
14042
14265
|
// Remove any projected columns from the projectedDisplayColumns container
|
|
@@ -14088,7 +14311,7 @@
|
|
|
14088
14311
|
ClrDatagrid.decorators = [
|
|
14089
14312
|
{ type: i0.Component, args: [{
|
|
14090
14313
|
selector: 'clr-datagrid',
|
|
14091
|
-
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",
|
|
14092
14315
|
providers: [
|
|
14093
14316
|
Selection,
|
|
14094
14317
|
Sort,
|
|
@@ -14105,6 +14328,7 @@
|
|
|
14105
14328
|
TableSizeService,
|
|
14106
14329
|
ColumnsService,
|
|
14107
14330
|
DisplayModeService,
|
|
14331
|
+
KeyNavigationGridController,
|
|
14108
14332
|
],
|
|
14109
14333
|
host: {
|
|
14110
14334
|
'[class.datagrid-host]': 'true',
|
|
@@ -14125,7 +14349,9 @@
|
|
|
14125
14349
|
{ type: String, decorators: [{ type: i0.Inject, args: [UNIQUE_ID,] }] },
|
|
14126
14350
|
{ type: i0.ElementRef },
|
|
14127
14351
|
{ type: Page },
|
|
14128
|
-
{ type: ClrCommonStringsService }
|
|
14352
|
+
{ type: ClrCommonStringsService },
|
|
14353
|
+
{ type: ColumnsService },
|
|
14354
|
+
{ type: KeyNavigationGridController }
|
|
14129
14355
|
]; };
|
|
14130
14356
|
ClrDatagrid.propDecorators = {
|
|
14131
14357
|
loading: [{ type: i0.Input, args: ['clrDgLoading',] }],
|
|
@@ -14615,7 +14841,7 @@
|
|
|
14615
14841
|
ClrDatagridColumnToggle.decorators = [
|
|
14616
14842
|
{ type: i0.Component, args: [{
|
|
14617
14843
|
selector: 'clr-dg-column-toggle',
|
|
14618
|
-
template: "\n <button\n role=\"button\"\n type=\"button\"\n class=\"btn btn-sm btn-link column-toggle--action\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-owns]=\"popoverId\"\n [attr.title]=\"commonStrings.keys.pickColumns\"\n >\n <cds-icon shape=\"view-columns\" aria-hidden=\"true\" [attr.title]=\"commonStrings.keys.pickColumns\"></cds-icon>\n </button>\n <div\n class=\"column-switch\"\n role=\"dialog\"\n [attr.aria-label]=\"commonStrings.keys.showColumnsMenuDescription\"\n [id]=\"popoverId\"\n clrFocusTrap\n *clrPopoverContent=\"openState; at: smartPosition; outsideClickToClose: true; scrollToClose: true\"\n >\n <div class=\"switch-header\">\n <div class=\"clr-sr-only\" tabindex=\"-1\" #allSelected>{{ commonStrings.keys.allColumnsSelected }}</div>\n <ng-container *ngIf=\"!customToggleTitle\">{{ commonStrings.keys.showColumns }}</ng-container>\n <ng-content select=\"clr-dg-column-toggle-title\"></ng-content>\n <button\n class=\"btn btn-sm btn-link toggle-switch-close-button\"\n clrPopoverCloseButton\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.close\"\n [attr.title]=\"commonStrings.keys.close\"\n >\n <cds-icon shape=\"window-close\" aria-hidden=\"true\" [attr.title]=\"commonStrings.keys.close\"></cds-icon>\n </button>\n </div>\n <ul class=\"switch-content list-unstyled\">\n <li *ngFor=\"let columnState of hideableColumnStates; trackBy: trackByFn\">\n <clr-checkbox-wrapper>\n <input\n clrCheckbox\n type=\"checkbox\"\n [disabled]=\"hasOnlyOneVisibleColumn && !columnState.hidden\"\n [ngModel]=\"!columnState.hidden\"\n (ngModelChange)=\"toggleColumnState(columnState, !$event)\"\n />\n <label>\n <ng-template [ngTemplateOutlet]=\"columnState.titleTemplateRef\"></ng-template>\n </label>\n </clr-checkbox-wrapper>\n </li>\n </ul>\n <div class=\"switch-footer\">\n <ng-content select=\"clr-dg-column-toggle-button\"></ng-content>\n <clr-dg-column-toggle-button *ngIf=\"!customToggleButton\" (clrAllSelected)=\"allColumnsSelected()\">\n {{ commonStrings.keys.selectAll }}\n </clr-dg-column-toggle-button>\n </div>\n </div>\n ",
|
|
14844
|
+
template: "\n <button\n role=\"button\"\n type=\"button\"\n class=\"btn btn-sm btn-link column-toggle--action\"\n clrPopoverAnchor\n clrPopoverOpenCloseButton\n [attr.aria-controls]=\"popoverId\"\n [attr.aria-owns]=\"popoverId\"\n [attr.title]=\"commonStrings.keys.pickColumns\"\n >\n <cds-icon shape=\"view-columns\" aria-hidden=\"true\" [attr.title]=\"commonStrings.keys.pickColumns\"></cds-icon>\n </button>\n <div\n class=\"column-switch\"\n role=\"dialog\"\n [attr.aria-label]=\"commonStrings.keys.showColumnsMenuDescription\"\n [id]=\"popoverId\"\n clrFocusTrap\n *clrPopoverContent=\"openState; at: smartPosition; outsideClickToClose: true; scrollToClose: true\"\n >\n <div class=\"switch-header\">\n <div class=\"clr-sr-only\" tabindex=\"-1\" #allSelected>{{ commonStrings.keys.allColumnsSelected }}</div>\n <ng-container *ngIf=\"!customToggleTitle\">\n <h2>{{ commonStrings.keys.showColumns }}</h2>\n </ng-container>\n <ng-content select=\"clr-dg-column-toggle-title\"></ng-content>\n <button\n class=\"btn btn-sm btn-link toggle-switch-close-button\"\n clrPopoverCloseButton\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.close\"\n [attr.title]=\"commonStrings.keys.close\"\n >\n <cds-icon shape=\"window-close\" aria-hidden=\"true\" [attr.title]=\"commonStrings.keys.close\"></cds-icon>\n </button>\n </div>\n <ul class=\"switch-content list-unstyled\">\n <li *ngFor=\"let columnState of hideableColumnStates; trackBy: trackByFn\">\n <clr-checkbox-wrapper>\n <input\n clrCheckbox\n type=\"checkbox\"\n [disabled]=\"hasOnlyOneVisibleColumn && !columnState.hidden\"\n [ngModel]=\"!columnState.hidden\"\n (ngModelChange)=\"toggleColumnState(columnState, !$event)\"\n />\n <label>\n <ng-template [ngTemplateOutlet]=\"columnState.titleTemplateRef\"></ng-template>\n </label>\n </clr-checkbox-wrapper>\n </li>\n </ul>\n <div class=\"switch-footer\">\n <ng-content select=\"clr-dg-column-toggle-button\"></ng-content>\n <clr-dg-column-toggle-button *ngIf=\"!customToggleButton\" (clrAllSelected)=\"allColumnsSelected()\">\n {{ commonStrings.keys.selectAll }}\n </clr-dg-column-toggle-button>\n </div>\n </div>\n ",
|
|
14619
14845
|
host: { '[class.column-switch-wrapper]': 'true', '[class.active]': 'openState' },
|
|
14620
14846
|
providers: [UNIQUE_ID_PROVIDER, ClrPopoverEventsService, ClrPopoverPositionService, ClrPopoverToggleService]
|
|
14621
14847
|
},] }
|
|
@@ -19108,6 +19334,14 @@
|
|
|
19108
19334
|
_this.initializeNavTriggers(navLevelList);
|
|
19109
19335
|
},
|
|
19110
19336
|
});
|
|
19337
|
+
this._subscription.add(this.responsiveNavService.navControl
|
|
19338
|
+
.pipe(operators.filter(function (_a) {
|
|
19339
|
+
var controlCode = _a.controlCode;
|
|
19340
|
+
return controlCode === ResponsiveNavCodes.NAV_CLOSE || controlCode === ResponsiveNavCodes.NAV_CLOSE_ALL;
|
|
19341
|
+
}))
|
|
19342
|
+
.subscribe(function () {
|
|
19343
|
+
_this.openNavLevel = null;
|
|
19344
|
+
}));
|
|
19111
19345
|
}
|
|
19112
19346
|
// reset triggers. handles cases when an application has different nav levels on different pages.
|
|
19113
19347
|
ClrHeader.prototype.resetNavTriggers = function () {
|
|
@@ -19135,10 +19369,21 @@
|
|
|
19135
19369
|
ClrHeader.prototype.closeOpenNav = function () {
|
|
19136
19370
|
this.responsiveNavService.closeAllNavs();
|
|
19137
19371
|
};
|
|
19138
|
-
|
|
19372
|
+
/**
|
|
19373
|
+
* @deprecated Will be removed in with @clr/angular v15.0.0
|
|
19374
|
+
*
|
|
19375
|
+
* Use `openNav(navLevel)` instead to open the navigation and ResponsiveNavService to close it.
|
|
19376
|
+
*/
|
|
19139
19377
|
ClrHeader.prototype.toggleNav = function (navLevel) {
|
|
19140
|
-
|
|
19141
|
-
|
|
19378
|
+
if (this.openNavLevel === navLevel) {
|
|
19379
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_CLOSE, navLevel);
|
|
19380
|
+
return;
|
|
19381
|
+
}
|
|
19382
|
+
this.openNav(navLevel);
|
|
19383
|
+
};
|
|
19384
|
+
ClrHeader.prototype.openNav = function (navLevel) {
|
|
19385
|
+
this.openNavLevel = navLevel;
|
|
19386
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_OPEN, navLevel);
|
|
19142
19387
|
};
|
|
19143
19388
|
ClrHeader.prototype.ngOnDestroy = function () {
|
|
19144
19389
|
this._subscription.unsubscribe();
|
|
@@ -19148,7 +19393,7 @@
|
|
|
19148
19393
|
ClrHeader.decorators = [
|
|
19149
19394
|
{ type: i0.Component, args: [{
|
|
19150
19395
|
selector: 'clr-header',
|
|
19151
|
-
template: "\n <button\n type=\"button\"\n *ngIf=\"isNavLevel1OnPage\"\n class=\"header-hamburger-trigger\"\n [attr.aria-label]=\"\n openNavLevel !== responsiveNavCodes.NAV_LEVEL_1 ? commonStrings.keys.open : commonStrings.keys.close\n \"\n (click)=\"toggleNav(responsiveNavCodes.NAV_LEVEL_1)\"\n >\n <span></span>\n </button>\n <ng-content></ng-content>\n <button\n type=\"button\"\n *ngIf=\"isNavLevel2OnPage\"\n class=\"header-overflow-trigger\"\n [attr.aria-label]=\"\n openNavLevel !== responsiveNavCodes.NAV_LEVEL_2 ? commonStrings.keys.open : commonStrings.keys.close\n \"\n (click)=\"
|
|
19396
|
+
template: "\n <button\n type=\"button\"\n *ngIf=\"isNavLevel1OnPage\"\n class=\"header-hamburger-trigger\"\n [attr.aria-label]=\"\n openNavLevel !== responsiveNavCodes.NAV_LEVEL_1 ? commonStrings.keys.open : commonStrings.keys.close\n \"\n (click)=\"toggleNav(responsiveNavCodes.NAV_LEVEL_1)\"\n [attr.aria-expanded]=\"openNavLevel === 1 ? 'true' : 'false'\"\n (click)=\"openNav(responsiveNavCodes.NAV_LEVEL_1)\"\n >\n <span></span>\n </button>\n <ng-content></ng-content>\n <button\n type=\"button\"\n *ngIf=\"isNavLevel2OnPage\"\n class=\"header-overflow-trigger\"\n [attr.aria-label]=\"\n openNavLevel !== responsiveNavCodes.NAV_LEVEL_2 ? commonStrings.keys.open : commonStrings.keys.close\n \"\n [attr.aria-expanded]=\"openNavLevel === 2 ? 'true' : 'false'\"\n (click)=\"openNav(responsiveNavCodes.NAV_LEVEL_2)\"\n >\n <span></span>\n </button>\n <div class=\"header-backdrop\" (click)=\"closeOpenNav()\"></div>\n ",
|
|
19152
19397
|
host: { '[class.header]': 'true' }
|
|
19153
19398
|
},] }
|
|
19154
19399
|
];
|
|
@@ -19162,176 +19407,756 @@
|
|
|
19162
19407
|
* This software is released under MIT license.
|
|
19163
19408
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19164
19409
|
*/
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19410
|
+
function refocusIfOutsideFocusTrapElement(focusedElement, focusTrapElement, elementToRefocus) {
|
|
19411
|
+
var focusTrapIsCurrent = internal.FocusTrapTrackerService.getCurrent() === focusTrapElement;
|
|
19412
|
+
var elementToFocusIsOutsideFocusTrap = elementIsOutsideFocusTrapElement(focusedElement, focusTrapElement);
|
|
19413
|
+
if (focusTrapIsCurrent && elementToFocusIsOutsideFocusTrap) {
|
|
19414
|
+
elementToRefocus = elementToRefocus || focusTrapElement;
|
|
19415
|
+
elementToRefocus.focus();
|
|
19169
19416
|
}
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19417
|
+
else {
|
|
19418
|
+
focusedElement.focus();
|
|
19419
|
+
}
|
|
19420
|
+
}
|
|
19421
|
+
function elementIsOutsideFocusTrapElement(focusedElement, focusTrapElement) {
|
|
19422
|
+
if (focusedElement === focusTrapElement.topReboundElement ||
|
|
19423
|
+
focusedElement === focusTrapElement.bottomReboundElement) {
|
|
19424
|
+
return true;
|
|
19425
|
+
}
|
|
19426
|
+
var elementIsInFocusTrapLightDom = focusTrapElement.contains(focusedElement);
|
|
19427
|
+
if (elementIsInFocusTrapLightDom) {
|
|
19428
|
+
return false;
|
|
19429
|
+
}
|
|
19430
|
+
if (focusTrapElement !== null && focusTrapElement.contains(focusedElement)) {
|
|
19431
|
+
return false;
|
|
19432
|
+
}
|
|
19433
|
+
return true;
|
|
19434
|
+
}
|
|
19435
|
+
function createFocusTrapReboundElement(document) {
|
|
19436
|
+
var offScreenSpan = document.createElement('span');
|
|
19437
|
+
offScreenSpan.setAttribute('tabindex', '0');
|
|
19438
|
+
offScreenSpan.classList.add('offscreen-focus-rebounder');
|
|
19439
|
+
return offScreenSpan;
|
|
19440
|
+
}
|
|
19441
|
+
function addReboundElementsToFocusTrapElement(document, focusTrapElement) {
|
|
19442
|
+
if (focusTrapElement && !focusTrapElement.topReboundElement && !focusTrapElement.bottomReboundElement) {
|
|
19443
|
+
focusTrapElement.topReboundElement = createFocusTrapReboundElement(document);
|
|
19444
|
+
focusTrapElement.bottomReboundElement = createFocusTrapReboundElement(document);
|
|
19445
|
+
var parent = focusTrapElement.parentElement;
|
|
19446
|
+
var sibling = focusTrapElement.nextSibling;
|
|
19447
|
+
if (parent) {
|
|
19448
|
+
parent.insertBefore(focusTrapElement.topReboundElement, focusTrapElement);
|
|
19449
|
+
if (sibling) {
|
|
19450
|
+
parent.insertBefore(focusTrapElement.bottomReboundElement, sibling);
|
|
19451
|
+
}
|
|
19452
|
+
else {
|
|
19453
|
+
parent.appendChild(focusTrapElement.bottomReboundElement);
|
|
19454
|
+
}
|
|
19185
19455
|
}
|
|
19186
|
-
}
|
|
19187
|
-
|
|
19188
|
-
|
|
19189
|
-
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
|
|
19193
|
-
|
|
19194
|
-
|
|
19195
|
-
|
|
19196
|
-
get: function () {
|
|
19197
|
-
return ResponsiveNavCodes;
|
|
19198
|
-
},
|
|
19199
|
-
enumerable: false,
|
|
19200
|
-
configurable: true
|
|
19201
|
-
});
|
|
19202
|
-
ClrNavLevel.prototype.open = function () {
|
|
19203
|
-
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_OPEN, this.level);
|
|
19204
|
-
};
|
|
19205
|
-
ClrNavLevel.prototype.close = function () {
|
|
19206
|
-
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_CLOSE, this.level);
|
|
19207
|
-
};
|
|
19208
|
-
// TODO: Figure out whats the best way to do this. Possible methods
|
|
19209
|
-
// 1. HostListener (current solution)
|
|
19210
|
-
// 2. Directives on the .nav-link class. We discussed on moving away from class selectors but I forget the reason
|
|
19211
|
-
// why
|
|
19212
|
-
ClrNavLevel.prototype.onMouseClick = function (target) {
|
|
19213
|
-
var current = target; // Get the element in the DOM on which the mouse was clicked
|
|
19214
|
-
var navHost = this.elementRef.nativeElement; // Get the current nav native HTML element
|
|
19215
|
-
// Start checking if current and navHost are equal.
|
|
19216
|
-
// If not traverse to the parentNode and check again.
|
|
19217
|
-
while (current) {
|
|
19218
|
-
if (current === navHost) {
|
|
19219
|
-
return;
|
|
19456
|
+
}
|
|
19457
|
+
}
|
|
19458
|
+
function removeReboundElementsFromFocusTrapElement(focusTrapElement) {
|
|
19459
|
+
if (focusTrapElement) {
|
|
19460
|
+
var parent = focusTrapElement.parentElement;
|
|
19461
|
+
if (parent) {
|
|
19462
|
+
var topRebound = focusTrapElement.topReboundElement;
|
|
19463
|
+
var bottomRebound = focusTrapElement.bottomReboundElement;
|
|
19464
|
+
if (topRebound) {
|
|
19465
|
+
parent.removeChild(topRebound);
|
|
19220
19466
|
}
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
return;
|
|
19467
|
+
if (bottomRebound) {
|
|
19468
|
+
parent.removeChild(bottomRebound);
|
|
19224
19469
|
}
|
|
19225
|
-
|
|
19470
|
+
}
|
|
19471
|
+
// These are here to to make sure that we completely delete all traces of the removed DOM objects.
|
|
19472
|
+
delete focusTrapElement.topReboundElement;
|
|
19473
|
+
delete focusTrapElement.bottomReboundElement;
|
|
19474
|
+
}
|
|
19475
|
+
}
|
|
19476
|
+
// this helper exists to enable the focus trap class to handle vanilla html elements
|
|
19477
|
+
// it's primary concern is to keep TS happy.
|
|
19478
|
+
function castHtmlElementToFocusTrapElement(el) {
|
|
19479
|
+
return el;
|
|
19480
|
+
}
|
|
19481
|
+
var FocusTrap = /** @class */ (function () {
|
|
19482
|
+
function FocusTrap(renderer, injector, platformId, hostElement) {
|
|
19483
|
+
this.renderer = renderer;
|
|
19484
|
+
this.active = false;
|
|
19485
|
+
if (i1.isPlatformBrowser(platformId)) {
|
|
19486
|
+
this._document = injector.get(i1.DOCUMENT);
|
|
19487
|
+
}
|
|
19488
|
+
hostElement = castHtmlElementToFocusTrapElement(hostElement);
|
|
19489
|
+
if (!hostElement.focusTrapId) {
|
|
19490
|
+
hostElement.focusTrapId = internal.createId();
|
|
19491
|
+
}
|
|
19492
|
+
this.focusTrapElement = hostElement;
|
|
19493
|
+
}
|
|
19494
|
+
FocusTrap.prototype.enableFocusTrap = function () {
|
|
19495
|
+
var _this = this;
|
|
19496
|
+
var fte = this.focusTrapElement;
|
|
19497
|
+
var firstFocusElement = fte.querySelector('[cds-first-focus]');
|
|
19498
|
+
var activeEl = this._document.activeElement;
|
|
19499
|
+
if (internal.FocusTrapTrackerService.getCurrent() === fte) {
|
|
19500
|
+
throw new Error('Focus trap is already enabled for this instance.');
|
|
19501
|
+
}
|
|
19502
|
+
this.firstFocusElement = firstFocusElement || this.focusTrapElement;
|
|
19503
|
+
addReboundElementsToFocusTrapElement(this._document, fte);
|
|
19504
|
+
if (!internal.isFocusable(fte)) {
|
|
19505
|
+
fte.setAttribute('tabindex', '-1');
|
|
19506
|
+
}
|
|
19507
|
+
if (activeEl && internal.isHTMLElement(activeEl)) {
|
|
19508
|
+
this.previousFocus = activeEl;
|
|
19509
|
+
}
|
|
19510
|
+
internal.FocusTrapTrackerService.setCurrent(fte);
|
|
19511
|
+
// setTimeout here is required for Safari which may try to set focus on
|
|
19512
|
+
// element before it is visible...
|
|
19513
|
+
var focusTimer = setTimeout(function () {
|
|
19514
|
+
_this.firstFocusElement.focus();
|
|
19515
|
+
clearTimeout(focusTimer);
|
|
19516
|
+
}, 10);
|
|
19517
|
+
this.onFocusInEvent = this.onFocusIn.bind(this);
|
|
19518
|
+
this.unlisten = this.renderer.listen(this._document, 'focusin', this.onFocusInEvent);
|
|
19519
|
+
this.active = true;
|
|
19520
|
+
};
|
|
19521
|
+
FocusTrap.prototype.removeFocusTrap = function () {
|
|
19522
|
+
if (this.unlisten) {
|
|
19523
|
+
this.unlisten();
|
|
19524
|
+
}
|
|
19525
|
+
removeReboundElementsFromFocusTrapElement(this.focusTrapElement);
|
|
19526
|
+
this.renderer.removeAttribute(this.focusTrapElement, 'tabindex');
|
|
19527
|
+
internal.FocusTrapTrackerService.activatePreviousCurrent();
|
|
19528
|
+
this.active = false;
|
|
19529
|
+
if (this.previousFocus) {
|
|
19530
|
+
this.previousFocus.focus();
|
|
19226
19531
|
}
|
|
19227
19532
|
};
|
|
19228
|
-
|
|
19229
|
-
|
|
19533
|
+
FocusTrap.prototype.onFocusIn = function (event) {
|
|
19534
|
+
refocusIfOutsideFocusTrapElement(event.composedPath()[0], this.focusTrapElement, this.firstFocusElement);
|
|
19230
19535
|
};
|
|
19231
|
-
return
|
|
19536
|
+
return FocusTrap;
|
|
19232
19537
|
}());
|
|
19233
|
-
|
|
19234
|
-
{ type: i0.
|
|
19538
|
+
FocusTrap.decorators = [
|
|
19539
|
+
{ type: i0.Injectable }
|
|
19235
19540
|
];
|
|
19236
|
-
|
|
19237
|
-
{ type:
|
|
19238
|
-
{ type: i0.
|
|
19541
|
+
FocusTrap.ctorParameters = function () { return [
|
|
19542
|
+
{ type: i0.Renderer2 },
|
|
19543
|
+
{ type: i0.Injector },
|
|
19544
|
+
{ type: undefined },
|
|
19545
|
+
{ type: undefined }
|
|
19239
19546
|
]; };
|
|
19240
|
-
ClrNavLevel.propDecorators = {
|
|
19241
|
-
_level: [{ type: i0.Input, args: ['clr-nav-level',] }],
|
|
19242
|
-
onMouseClick: [{ type: i0.HostListener, args: ['click', ['$event.target'],] }]
|
|
19243
|
-
};
|
|
19244
19547
|
|
|
19245
19548
|
/*
|
|
19246
19549
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19247
19550
|
* This software is released under MIT license.
|
|
19248
19551
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19249
19552
|
*/
|
|
19250
|
-
var
|
|
19251
|
-
ClrHeader,
|
|
19252
|
-
ClrNavLevel,
|
|
19253
|
-
NavDetectionOompaLoompa,
|
|
19254
|
-
MainContainerWillyWonka,
|
|
19255
|
-
];
|
|
19256
|
-
var ClrNavigationModule = /** @class */ (function () {
|
|
19257
|
-
function ClrNavigationModule() {
|
|
19258
|
-
}
|
|
19259
|
-
return ClrNavigationModule;
|
|
19260
|
-
}());
|
|
19261
|
-
ClrNavigationModule.decorators = [
|
|
19262
|
-
{ type: i0.NgModule, args: [{
|
|
19263
|
-
imports: [i1.CommonModule, ClrIconModule, ClrDropdownModule],
|
|
19264
|
-
declarations: [CLR_NAVIGATION_DIRECTIVES],
|
|
19265
|
-
exports: [CLR_NAVIGATION_DIRECTIVES],
|
|
19266
|
-
},] }
|
|
19267
|
-
];
|
|
19553
|
+
var defaultAnimationTiming = '0.2s ease-in-out';
|
|
19268
19554
|
|
|
19269
19555
|
/*
|
|
19270
19556
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19271
19557
|
* This software is released under MIT license.
|
|
19272
19558
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19273
19559
|
*/
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
},] }
|
|
19283
|
-
];
|
|
19284
|
-
TemplateRefContainer.propDecorators = {
|
|
19285
|
-
template: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
|
|
19286
|
-
};
|
|
19560
|
+
function collapse() {
|
|
19561
|
+
'use strict';
|
|
19562
|
+
return [
|
|
19563
|
+
animations.state('true', animations.style({ height: 0, 'overflow-y': 'hidden' })),
|
|
19564
|
+
animations.transition('true => false', [animations.animate(defaultAnimationTiming, animations.style({ height: '*', 'overflow-y': 'hidden' }))]),
|
|
19565
|
+
animations.transition('false => true', [animations.style({ height: '*', 'overflow-y': 'hidden' }), animations.animate(defaultAnimationTiming)]),
|
|
19566
|
+
];
|
|
19567
|
+
}
|
|
19287
19568
|
|
|
19288
19569
|
/*
|
|
19289
19570
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19290
19571
|
* This software is released under MIT license.
|
|
19291
19572
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19292
19573
|
*/
|
|
19293
|
-
var TEMPLATE_REF_DIRECTIVES = [TemplateRefContainer];
|
|
19294
19574
|
|
|
19295
19575
|
/*
|
|
19296
19576
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19297
19577
|
* This software is released under MIT license.
|
|
19298
19578
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19299
19579
|
*/
|
|
19300
|
-
|
|
19301
|
-
|
|
19302
|
-
|
|
19303
|
-
|
|
19304
|
-
|
|
19305
|
-
|
|
19306
|
-
|
|
19307
|
-
imports: [i1.CommonModule],
|
|
19308
|
-
declarations: [TEMPLATE_REF_DIRECTIVES],
|
|
19309
|
-
entryComponents: [TEMPLATE_REF_DIRECTIVES],
|
|
19310
|
-
exports: [TEMPLATE_REF_DIRECTIVES],
|
|
19311
|
-
},] }
|
|
19312
|
-
];
|
|
19580
|
+
function fade(opacity) {
|
|
19581
|
+
if (opacity === void 0) { opacity = 1; }
|
|
19582
|
+
return [
|
|
19583
|
+
animations.transition('void => *', [animations.style({ opacity: 0 }), animations.animate(defaultAnimationTiming, animations.style({ opacity: opacity }))]),
|
|
19584
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0 }))]),
|
|
19585
|
+
];
|
|
19586
|
+
}
|
|
19313
19587
|
|
|
19314
|
-
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
|
|
19319
|
-
return TabsWillyWonka;
|
|
19320
|
-
}(WillyWonka));
|
|
19321
|
-
TabsWillyWonka.decorators = [
|
|
19322
|
-
{ type: i0.Directive, args: [{ selector: 'clr-tabs' },] }
|
|
19323
|
-
];
|
|
19588
|
+
/*
|
|
19589
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19590
|
+
* This software is released under MIT license.
|
|
19591
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19592
|
+
*/
|
|
19324
19593
|
|
|
19325
|
-
|
|
19326
|
-
|
|
19327
|
-
|
|
19328
|
-
|
|
19329
|
-
|
|
19330
|
-
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19334
|
-
|
|
19594
|
+
/*
|
|
19595
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19596
|
+
* This software is released under MIT license.
|
|
19597
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19598
|
+
*/
|
|
19599
|
+
function fadeSlide(direction) {
|
|
19600
|
+
var transform = null;
|
|
19601
|
+
if (direction === 'up') {
|
|
19602
|
+
transform = 'translate(0, 25%)';
|
|
19603
|
+
}
|
|
19604
|
+
else if (direction === 'down') {
|
|
19605
|
+
transform = 'translate(0, -25%)';
|
|
19606
|
+
}
|
|
19607
|
+
else if (direction === 'left') {
|
|
19608
|
+
transform = 'translate(25%, 0)';
|
|
19609
|
+
}
|
|
19610
|
+
else if (direction === 'right') {
|
|
19611
|
+
transform = 'translate(-25%, 0)';
|
|
19612
|
+
}
|
|
19613
|
+
else {
|
|
19614
|
+
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
19615
|
+
}
|
|
19616
|
+
return [
|
|
19617
|
+
animations.transition('void => *', [animations.style({ opacity: 0, transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
19618
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0, transform: transform }))]),
|
|
19619
|
+
];
|
|
19620
|
+
}
|
|
19621
|
+
|
|
19622
|
+
/*
|
|
19623
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19624
|
+
* This software is released under MIT license.
|
|
19625
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19626
|
+
*/
|
|
19627
|
+
|
|
19628
|
+
/*
|
|
19629
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19630
|
+
* This software is released under MIT license.
|
|
19631
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19632
|
+
*/
|
|
19633
|
+
function slide(direction) {
|
|
19634
|
+
var transform = null;
|
|
19635
|
+
if (direction === 'up') {
|
|
19636
|
+
transform = 'translate(0, 25%)';
|
|
19637
|
+
}
|
|
19638
|
+
else if (direction === 'down') {
|
|
19639
|
+
transform = 'translate(0, -25%)';
|
|
19640
|
+
}
|
|
19641
|
+
else if (direction === 'left') {
|
|
19642
|
+
transform = 'translate(25%, 0)';
|
|
19643
|
+
}
|
|
19644
|
+
else if (direction === 'right') {
|
|
19645
|
+
transform = 'translate(-25%, 0)';
|
|
19646
|
+
}
|
|
19647
|
+
else {
|
|
19648
|
+
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
19649
|
+
}
|
|
19650
|
+
return [
|
|
19651
|
+
animations.transition('void => *', [animations.style({ transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
19652
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ transform: transform }))]),
|
|
19653
|
+
];
|
|
19654
|
+
}
|
|
19655
|
+
|
|
19656
|
+
/*
|
|
19657
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19658
|
+
* This software is released under MIT license.
|
|
19659
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19660
|
+
*/
|
|
19661
|
+
|
|
19662
|
+
/*
|
|
19663
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19664
|
+
* This software is released under MIT license.
|
|
19665
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19666
|
+
*/
|
|
19667
|
+
|
|
19668
|
+
/*
|
|
19669
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19670
|
+
* This software is released under MIT license.
|
|
19671
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19672
|
+
*/
|
|
19673
|
+
|
|
19674
|
+
/*
|
|
19675
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19676
|
+
* This software is released under MIT license.
|
|
19677
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19678
|
+
*/
|
|
19679
|
+
|
|
19680
|
+
/*
|
|
19681
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19682
|
+
* This software is released under MIT license.
|
|
19683
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19684
|
+
*/
|
|
19685
|
+
|
|
19686
|
+
/*
|
|
19687
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19688
|
+
* This software is released under MIT license.
|
|
19689
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19690
|
+
*/
|
|
19691
|
+
exports.ClrAriaLivePoliteness = void 0;
|
|
19692
|
+
(function (ClrAriaLivePoliteness) {
|
|
19693
|
+
ClrAriaLivePoliteness["off"] = "off";
|
|
19694
|
+
ClrAriaLivePoliteness["polite"] = "polite";
|
|
19695
|
+
ClrAriaLivePoliteness["assertive"] = "assertive";
|
|
19696
|
+
})(exports.ClrAriaLivePoliteness || (exports.ClrAriaLivePoliteness = {}));
|
|
19697
|
+
/**
|
|
19698
|
+
* Time in milliseconds before inserting the content into the container
|
|
19699
|
+
*/
|
|
19700
|
+
var ARIA_LIVE_TICK = 100;
|
|
19701
|
+
/**
|
|
19702
|
+
* @deprecated
|
|
19703
|
+
*
|
|
19704
|
+
* -- ClrAriaLiveService is deprecated in 5.0 to be removed in 6.0 --
|
|
19705
|
+
* Please consider using the LiveAnnouncer in the Angular Material CDK
|
|
19706
|
+
* if your project needs this functionality.
|
|
19707
|
+
* More info: https://material.angular.io/cdk/a11y/overview#example-1
|
|
19708
|
+
*
|
|
19709
|
+
* This service handle `aria-live` accessibility attribute. The issue is that you need
|
|
19710
|
+
* to have the DOM Element with attribute `aria-live` before you could insert content
|
|
19711
|
+
* and SR (Screen Reader) pick the change and announce it.
|
|
19712
|
+
*
|
|
19713
|
+
* ```typescript
|
|
19714
|
+
* import { ClrAriaLiveService } from 'src/clr-angular/utils/a11y/aria-live.service';
|
|
19715
|
+
*
|
|
19716
|
+
* @Component({
|
|
19717
|
+
* selector: 'clr-demo-component',
|
|
19718
|
+
* providers: [ClrAriaLiveService],
|
|
19719
|
+
* template: `
|
|
19720
|
+
* <ng-content></ng-content>
|
|
19721
|
+
* `,
|
|
19722
|
+
* })
|
|
19723
|
+
* export class DemoComponent {
|
|
19724
|
+
* constructor(ariaLiveService: ClrAriaLiveService) {}
|
|
19725
|
+
*
|
|
19726
|
+
* public actionThatWillTriggerChange() {
|
|
19727
|
+
* this.ariaLiveService.announce('message that I want to announce to SR');
|
|
19728
|
+
* }
|
|
19729
|
+
* }
|
|
19730
|
+
* ```
|
|
19731
|
+
*
|
|
19732
|
+
*/
|
|
19733
|
+
var ClrAriaLiveService = /** @class */ (function () {
|
|
19734
|
+
function ClrAriaLiveService(ngZone, _document, platformId) {
|
|
19735
|
+
this.ngZone = ngZone;
|
|
19736
|
+
this.platformId = platformId;
|
|
19737
|
+
this._id = "clr-aria-live-element-" + uniqueIdFactory();
|
|
19738
|
+
this.document = _document;
|
|
19739
|
+
}
|
|
19740
|
+
Object.defineProperty(ClrAriaLiveService.prototype, "id", {
|
|
19741
|
+
/**
|
|
19742
|
+
* get access to the internal HTML `id` that gonna be used for the AriaLive container.
|
|
19743
|
+
* @return ID of the DOM Element as string.
|
|
19744
|
+
*/
|
|
19745
|
+
get: function () {
|
|
19746
|
+
return this._id;
|
|
19747
|
+
},
|
|
19748
|
+
enumerable: false,
|
|
19749
|
+
configurable: true
|
|
19750
|
+
});
|
|
19751
|
+
/**
|
|
19752
|
+
* Append text content inside the AriaLive Container. This method will check if the
|
|
19753
|
+
* DOM Element is existing if not it will create one for us and the will apply the text.
|
|
19754
|
+
*
|
|
19755
|
+
* ```typescript
|
|
19756
|
+
* this.ariaLiveService.announce(this.el.nativeElement);
|
|
19757
|
+
* // or
|
|
19758
|
+
* this.ariaLiveService.announce('Message to announce to SR');
|
|
19759
|
+
* ```
|
|
19760
|
+
*
|
|
19761
|
+
* @remark
|
|
19762
|
+
* When second argument is `AriaLivePoliteness.off` we won't create aria container or update it.
|
|
19763
|
+
* The reason for that is that we don't want to do additional work if the SR will ignore it.
|
|
19764
|
+
*
|
|
19765
|
+
* @param message - This could be simple string or HTMLElement
|
|
19766
|
+
* @param politeness - 'polite', 'assertive' or 'off'
|
|
19767
|
+
*/
|
|
19768
|
+
ClrAriaLiveService.prototype.announce = function (message, politeness) {
|
|
19769
|
+
var _this = this;
|
|
19770
|
+
if (politeness === void 0) { politeness = exports.ClrAriaLivePoliteness.polite; }
|
|
19771
|
+
if (politeness === exports.ClrAriaLivePoliteness.off) {
|
|
19772
|
+
return;
|
|
19773
|
+
}
|
|
19774
|
+
if (!this.ariaLiveElement && i1.isPlatformBrowser(this.platformId)) {
|
|
19775
|
+
this.ariaLiveElement = this.createContainer();
|
|
19776
|
+
}
|
|
19777
|
+
message = typeof message !== 'string' && i1.isPlatformBrowser(this.platformId) ? message.textContent : message;
|
|
19778
|
+
// when there is no message do NOTHING!
|
|
19779
|
+
if (!message) {
|
|
19780
|
+
return;
|
|
19781
|
+
}
|
|
19782
|
+
this.ariaLiveElement.setAttribute('aria-live', politeness);
|
|
19783
|
+
// This 100ms timeout is necessary for some browser + screen-reader combinations:
|
|
19784
|
+
// - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.
|
|
19785
|
+
// - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
|
|
19786
|
+
// second time without clearing and then using a non-zero delay.
|
|
19787
|
+
// (using JAWS 17 at time of this writing).
|
|
19788
|
+
this.ngZone.runOutsideAngular(function () {
|
|
19789
|
+
// This clearTimeout will stop all older messages from announcing
|
|
19790
|
+
// in the case where the messages are comming too fast we gonna try to append only
|
|
19791
|
+
// the last one. That's what the SR will try to do anyway.
|
|
19792
|
+
clearTimeout(_this.previousTimeout);
|
|
19793
|
+
_this.previousTimeout = setTimeout(function () {
|
|
19794
|
+
_this.ariaLiveElement.textContent = message;
|
|
19795
|
+
}, ARIA_LIVE_TICK);
|
|
19796
|
+
});
|
|
19797
|
+
};
|
|
19798
|
+
/**
|
|
19799
|
+
* onDestroy life cycle - must stop all active setTimeouts and remove the AriaLive
|
|
19800
|
+
* container from the document.
|
|
19801
|
+
*/
|
|
19802
|
+
ClrAriaLiveService.prototype.ngOnDestroy = function () {
|
|
19803
|
+
clearTimeout(this.previousTimeout);
|
|
19804
|
+
if (i1.isPlatformBrowser(this.platformId) && this.ariaLiveElement) {
|
|
19805
|
+
this.document.body.removeChild(this.ariaLiveElement);
|
|
19806
|
+
this.ariaLiveElement = null;
|
|
19807
|
+
}
|
|
19808
|
+
};
|
|
19809
|
+
/**
|
|
19810
|
+
* Create AriaLive DOM element as a last child of the document.
|
|
19811
|
+
* After the element is created, we gonna apply Clarity class to hide it from
|
|
19812
|
+
* the screen and set the `aria-live` politness.
|
|
19813
|
+
*
|
|
19814
|
+
* `clr-sr-only` is the CSS class that is used to hide the element from the screen.
|
|
19815
|
+
*
|
|
19816
|
+
* @remark
|
|
19817
|
+
* Calling this method multiple times will create multiple DOM Elements, that
|
|
19818
|
+
* won't be tracked and will be GC after the service is destroyed.
|
|
19819
|
+
*
|
|
19820
|
+
* @return AriaLive container as HTMLElement
|
|
19821
|
+
*
|
|
19822
|
+
*/
|
|
19823
|
+
ClrAriaLiveService.prototype.createContainer = function () {
|
|
19824
|
+
var ariaLiveElement = this.document.createElement('div');
|
|
19825
|
+
ariaLiveElement.setAttribute('id', this.id);
|
|
19826
|
+
// Use clarity screen reader class to hide the dom element
|
|
19827
|
+
// and fix the scrollbar shake
|
|
19828
|
+
ariaLiveElement.classList.add('clr-sr-only');
|
|
19829
|
+
ariaLiveElement.setAttribute('aria-atomic', 'true');
|
|
19830
|
+
ariaLiveElement.setAttribute('aria-live', exports.ClrAriaLivePoliteness.polite);
|
|
19831
|
+
this.document.body.appendChild(ariaLiveElement);
|
|
19832
|
+
return ariaLiveElement;
|
|
19833
|
+
};
|
|
19834
|
+
return ClrAriaLiveService;
|
|
19835
|
+
}());
|
|
19836
|
+
ClrAriaLiveService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ClrAriaLiveService_Factory() { return new ClrAriaLiveService(i0__namespace.ɵɵinject(i0__namespace.NgZone), i0__namespace.ɵɵinject(i1__namespace.DOCUMENT), i0__namespace.ɵɵinject(i0__namespace.PLATFORM_ID)); }, token: ClrAriaLiveService, providedIn: "root" });
|
|
19837
|
+
ClrAriaLiveService.decorators = [
|
|
19838
|
+
{ type: i0.Injectable, args: [{
|
|
19839
|
+
providedIn: 'root',
|
|
19840
|
+
},] }
|
|
19841
|
+
];
|
|
19842
|
+
ClrAriaLiveService.ctorParameters = function () { return [
|
|
19843
|
+
{ type: i0.NgZone },
|
|
19844
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
|
|
19845
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
|
19846
|
+
]; };
|
|
19847
|
+
|
|
19848
|
+
/*
|
|
19849
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19850
|
+
* This software is released under MIT license.
|
|
19851
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19852
|
+
*/
|
|
19853
|
+
|
|
19854
|
+
/*
|
|
19855
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19856
|
+
* This software is released under MIT license.
|
|
19857
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19858
|
+
*/
|
|
19859
|
+
|
|
19860
|
+
/*
|
|
19861
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19862
|
+
* This software is released under MIT license.
|
|
19863
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19864
|
+
*/
|
|
19865
|
+
|
|
19866
|
+
/*
|
|
19867
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19868
|
+
* This software is released under MIT license.
|
|
19869
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19870
|
+
*/
|
|
19871
|
+
|
|
19872
|
+
/*
|
|
19873
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19874
|
+
* This software is released under MIT license.
|
|
19875
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19876
|
+
*/
|
|
19877
|
+
|
|
19878
|
+
/*
|
|
19879
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19880
|
+
* This software is released under MIT license.
|
|
19881
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19882
|
+
*/
|
|
19883
|
+
|
|
19884
|
+
var createCdsCloseButton = function (document, ariaLabel) {
|
|
19885
|
+
var cdsCloseButton = document.createElement('cds-internal-close-button');
|
|
19886
|
+
cdsCloseButton.setAttribute('icon-size', '32');
|
|
19887
|
+
cdsCloseButton.setAttribute('aria-label', ariaLabel);
|
|
19888
|
+
cdsCloseButton.setAttribute('aria-hidden', 'true');
|
|
19889
|
+
cdsCloseButton.setAttribute('type', 'button');
|
|
19890
|
+
/**
|
|
19891
|
+
* The button is hidden by default based on our Desktop-first approach.
|
|
19892
|
+
*/
|
|
19893
|
+
cdsCloseButton.setAttribute('hidden', 'true');
|
|
19894
|
+
cdsCloseButton.className = 'clr-nav-close';
|
|
19895
|
+
return cdsCloseButton;
|
|
19896
|
+
};
|
|
19897
|
+
var ɵ0 = createCdsCloseButton;
|
|
19898
|
+
var ClrNavLevel = /** @class */ (function (_super) {
|
|
19899
|
+
__extends(ClrNavLevel, _super);
|
|
19900
|
+
function ClrNavLevel(platformId, responsiveNavService, elementRef, renderer, injector) {
|
|
19901
|
+
var _this = _super.call(this, renderer, injector, platformId, elementRef.nativeElement) || this;
|
|
19902
|
+
_this.responsiveNavService = responsiveNavService;
|
|
19903
|
+
_this.elementRef = elementRef;
|
|
19904
|
+
_this._isOpen = false;
|
|
19905
|
+
if (i1.isPlatformBrowser(platformId)) {
|
|
19906
|
+
_this._document = injector.get(i1.DOCUMENT);
|
|
19907
|
+
}
|
|
19908
|
+
_this._subscription = responsiveNavService.navControl
|
|
19909
|
+
.pipe(operators.filter(function (x) { return x.navLevel === _this.level; }), operators.filter(function (_a) {
|
|
19910
|
+
var controlCode = _a.controlCode;
|
|
19911
|
+
return (controlCode === ResponsiveNavCodes.NAV_OPEN && !_this.isOpen) ||
|
|
19912
|
+
(controlCode === ResponsiveNavCodes.NAV_CLOSE && _this.isOpen);
|
|
19913
|
+
}))
|
|
19914
|
+
.subscribe(function (_a) {
|
|
19915
|
+
var controlCode = _a.controlCode;
|
|
19916
|
+
if (controlCode === ResponsiveNavCodes.NAV_OPEN) {
|
|
19917
|
+
_this.open();
|
|
19918
|
+
return;
|
|
19919
|
+
}
|
|
19920
|
+
_this.close();
|
|
19921
|
+
});
|
|
19922
|
+
_this._subscription.add(responsiveNavService.navControl
|
|
19923
|
+
.pipe(operators.filter(function (_a) {
|
|
19924
|
+
var controlCode = _a.controlCode;
|
|
19925
|
+
return controlCode === ResponsiveNavCodes.NAV_CLOSE_ALL;
|
|
19926
|
+
}))
|
|
19927
|
+
.subscribe(function () { return _this.close(); }));
|
|
19928
|
+
return _this;
|
|
19929
|
+
}
|
|
19930
|
+
ClrNavLevel.prototype.ngOnInit = function () {
|
|
19931
|
+
if (!this.closeButtonAriaLabel) {
|
|
19932
|
+
this.closeButtonAriaLabel =
|
|
19933
|
+
this._level === ResponsiveNavCodes.NAV_LEVEL_1
|
|
19934
|
+
? commonStringsDefault.responsiveNavToggleClose
|
|
19935
|
+
: commonStringsDefault.responsiveNavOverflowClose;
|
|
19936
|
+
}
|
|
19937
|
+
if (this.level !== ResponsiveNavCodes.NAV_LEVEL_1 && this.level !== ResponsiveNavCodes.NAV_LEVEL_2) {
|
|
19938
|
+
console.error('Nav Level can only be 1 or 2');
|
|
19939
|
+
return;
|
|
19940
|
+
}
|
|
19941
|
+
this.responsiveNavService.registerNav(this.level);
|
|
19942
|
+
this.addNavClass(this.level);
|
|
19943
|
+
};
|
|
19944
|
+
ClrNavLevel.prototype.ngAfterViewInit = function () {
|
|
19945
|
+
var closeButton = createCdsCloseButton(this._document, this.closeButtonAriaLabel);
|
|
19946
|
+
this.renderer.listen(closeButton, 'click', this.close.bind(this));
|
|
19947
|
+
this.renderer.insertBefore(this.elementRef.nativeElement, closeButton, this.elementRef.nativeElement.firstChild); // Adding the button at the top of the nav
|
|
19948
|
+
if (this._document.body.clientWidth < LARGE_BREAKPOINT) {
|
|
19949
|
+
/**
|
|
19950
|
+
* Close if the document body is smaller than the large breakpoint for example:
|
|
19951
|
+
* - Refreshing the page
|
|
19952
|
+
* - Browser window size is changed when opening the applicaiton
|
|
19953
|
+
* - Browser zoom is turned on and zoomed to a size that makes the document smaller than the large breakpoint
|
|
19954
|
+
*/
|
|
19955
|
+
this.close();
|
|
19956
|
+
}
|
|
19957
|
+
};
|
|
19958
|
+
ClrNavLevel.prototype.addNavClass = function (level) {
|
|
19959
|
+
var navHostClassList = this.elementRef.nativeElement.classList;
|
|
19960
|
+
if (level === ResponsiveNavCodes.NAV_LEVEL_1) {
|
|
19961
|
+
navHostClassList.add(ResponsiveNavCodes.NAV_CLASS_LEVEL_1);
|
|
19962
|
+
}
|
|
19963
|
+
else if (level === ResponsiveNavCodes.NAV_LEVEL_2) {
|
|
19964
|
+
navHostClassList.add(ResponsiveNavCodes.NAV_CLASS_LEVEL_2);
|
|
19965
|
+
}
|
|
19966
|
+
};
|
|
19967
|
+
Object.defineProperty(ClrNavLevel.prototype, "level", {
|
|
19968
|
+
get: function () {
|
|
19969
|
+
return this._level;
|
|
19970
|
+
},
|
|
19971
|
+
enumerable: false,
|
|
19972
|
+
configurable: true
|
|
19973
|
+
});
|
|
19974
|
+
Object.defineProperty(ClrNavLevel.prototype, "responsiveNavCodes", {
|
|
19975
|
+
// getter to access the responsive navigation codes from the template
|
|
19976
|
+
get: function () {
|
|
19977
|
+
return ResponsiveNavCodes;
|
|
19978
|
+
},
|
|
19979
|
+
enumerable: false,
|
|
19980
|
+
configurable: true
|
|
19981
|
+
});
|
|
19982
|
+
Object.defineProperty(ClrNavLevel.prototype, "isOpen", {
|
|
19983
|
+
get: function () {
|
|
19984
|
+
return this._isOpen;
|
|
19985
|
+
},
|
|
19986
|
+
enumerable: false,
|
|
19987
|
+
configurable: true
|
|
19988
|
+
});
|
|
19989
|
+
ClrNavLevel.prototype.onResize = function (event) {
|
|
19990
|
+
var target = event.target;
|
|
19991
|
+
if (target.innerWidth < LARGE_BREAKPOINT && this.isOpen) {
|
|
19992
|
+
this.close();
|
|
19993
|
+
return;
|
|
19994
|
+
}
|
|
19995
|
+
this.showNavigation();
|
|
19996
|
+
};
|
|
19997
|
+
ClrNavLevel.prototype.open = function () {
|
|
19998
|
+
this._isOpen = true;
|
|
19999
|
+
this.showNavigation();
|
|
20000
|
+
this.enableFocusTrap();
|
|
20001
|
+
this.showCloseButton();
|
|
20002
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_OPEN, this.level);
|
|
20003
|
+
};
|
|
20004
|
+
ClrNavLevel.prototype.close = function () {
|
|
20005
|
+
this._isOpen = false;
|
|
20006
|
+
this.hideNavigation();
|
|
20007
|
+
this.removeFocusTrap();
|
|
20008
|
+
this.hideCloseButton();
|
|
20009
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_CLOSE, this.level);
|
|
20010
|
+
};
|
|
20011
|
+
// TODO: Figure out whats the best way to do this. Possible methods
|
|
20012
|
+
// 1. HostListener (current solution)
|
|
20013
|
+
// 2. Directives on the .nav-link class. We discussed on moving away from class selectors but I forget the reason
|
|
20014
|
+
// why
|
|
20015
|
+
ClrNavLevel.prototype.onMouseClick = function (target) {
|
|
20016
|
+
var current = target; // Get the element in the DOM on which the mouse was clicked
|
|
20017
|
+
var navHost = this.elementRef.nativeElement; // Get the current nav native HTML element
|
|
20018
|
+
// Start checking if current and navHost are equal.
|
|
20019
|
+
// If not traverse to the parentNode and check again.
|
|
20020
|
+
while (current) {
|
|
20021
|
+
if (current === navHost) {
|
|
20022
|
+
return;
|
|
20023
|
+
}
|
|
20024
|
+
else if (current.classList.contains('nav-link') && this._document.body.clientWidth < LARGE_BREAKPOINT) {
|
|
20025
|
+
this.close();
|
|
20026
|
+
return;
|
|
20027
|
+
}
|
|
20028
|
+
current = current.parentNode;
|
|
20029
|
+
}
|
|
20030
|
+
};
|
|
20031
|
+
ClrNavLevel.prototype.hideNavigation = function () {
|
|
20032
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'true');
|
|
20033
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', 'true');
|
|
20034
|
+
};
|
|
20035
|
+
ClrNavLevel.prototype.showNavigation = function () {
|
|
20036
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'false');
|
|
20037
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'hidden');
|
|
20038
|
+
};
|
|
20039
|
+
ClrNavLevel.prototype.hideCloseButton = function () {
|
|
20040
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'true');
|
|
20041
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'hidden', 'true');
|
|
20042
|
+
};
|
|
20043
|
+
ClrNavLevel.prototype.showCloseButton = function () {
|
|
20044
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'aria-hidden', 'false');
|
|
20045
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'hidden');
|
|
20046
|
+
};
|
|
20047
|
+
ClrNavLevel.prototype.ngOnDestroy = function () {
|
|
20048
|
+
this.responsiveNavService.unregisterNav(this.level);
|
|
20049
|
+
this._subscription.unsubscribe();
|
|
20050
|
+
};
|
|
20051
|
+
return ClrNavLevel;
|
|
20052
|
+
}(FocusTrap));
|
|
20053
|
+
ClrNavLevel.decorators = [
|
|
20054
|
+
{ type: i0.Directive, args: [{ selector: '[clr-nav-level]' },] }
|
|
20055
|
+
];
|
|
20056
|
+
ClrNavLevel.ctorParameters = function () { return [
|
|
20057
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
|
20058
|
+
{ type: ResponsiveNavigationService },
|
|
20059
|
+
{ type: i0.ElementRef },
|
|
20060
|
+
{ type: i0.Renderer2 },
|
|
20061
|
+
{ type: i0.Injector }
|
|
20062
|
+
]; };
|
|
20063
|
+
ClrNavLevel.propDecorators = {
|
|
20064
|
+
_level: [{ type: i0.Input, args: ['clr-nav-level',] }],
|
|
20065
|
+
closeButtonAriaLabel: [{ type: i0.Input, args: ['closeAriaLabel',] }],
|
|
20066
|
+
onResize: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }],
|
|
20067
|
+
onMouseClick: [{ type: i0.HostListener, args: ['click', ['$event.target'],] }]
|
|
20068
|
+
};
|
|
20069
|
+
|
|
20070
|
+
/*
|
|
20071
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
20072
|
+
* This software is released under MIT license.
|
|
20073
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
20074
|
+
*/
|
|
20075
|
+
var CLR_NAVIGATION_DIRECTIVES = [
|
|
20076
|
+
ClrHeader,
|
|
20077
|
+
ClrNavLevel,
|
|
20078
|
+
NavDetectionOompaLoompa,
|
|
20079
|
+
MainContainerWillyWonka,
|
|
20080
|
+
];
|
|
20081
|
+
var ClrNavigationModule = /** @class */ (function () {
|
|
20082
|
+
function ClrNavigationModule() {
|
|
20083
|
+
}
|
|
20084
|
+
return ClrNavigationModule;
|
|
20085
|
+
}());
|
|
20086
|
+
ClrNavigationModule.decorators = [
|
|
20087
|
+
{ type: i0.NgModule, args: [{
|
|
20088
|
+
imports: [i1.CommonModule, ClrIconModule, ClrDropdownModule],
|
|
20089
|
+
declarations: [CLR_NAVIGATION_DIRECTIVES],
|
|
20090
|
+
exports: [CLR_NAVIGATION_DIRECTIVES],
|
|
20091
|
+
},] }
|
|
20092
|
+
];
|
|
20093
|
+
|
|
20094
|
+
/*
|
|
20095
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
20096
|
+
* This software is released under MIT license.
|
|
20097
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
20098
|
+
*/
|
|
20099
|
+
var TemplateRefContainer = /** @class */ (function () {
|
|
20100
|
+
function TemplateRefContainer() {
|
|
20101
|
+
}
|
|
20102
|
+
return TemplateRefContainer;
|
|
20103
|
+
}());
|
|
20104
|
+
TemplateRefContainer.decorators = [
|
|
20105
|
+
{ type: i0.Component, args: [{
|
|
20106
|
+
template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
|
|
20107
|
+
},] }
|
|
20108
|
+
];
|
|
20109
|
+
TemplateRefContainer.propDecorators = {
|
|
20110
|
+
template: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
|
|
20111
|
+
};
|
|
20112
|
+
|
|
20113
|
+
/*
|
|
20114
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
20115
|
+
* This software is released under MIT license.
|
|
20116
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
20117
|
+
*/
|
|
20118
|
+
var TEMPLATE_REF_DIRECTIVES = [TemplateRefContainer];
|
|
20119
|
+
|
|
20120
|
+
/*
|
|
20121
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
20122
|
+
* This software is released under MIT license.
|
|
20123
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
20124
|
+
*/
|
|
20125
|
+
var ClrTemplateRefModule = /** @class */ (function () {
|
|
20126
|
+
function ClrTemplateRefModule() {
|
|
20127
|
+
}
|
|
20128
|
+
return ClrTemplateRefModule;
|
|
20129
|
+
}());
|
|
20130
|
+
ClrTemplateRefModule.decorators = [
|
|
20131
|
+
{ type: i0.NgModule, args: [{
|
|
20132
|
+
imports: [i1.CommonModule],
|
|
20133
|
+
declarations: [TEMPLATE_REF_DIRECTIVES],
|
|
20134
|
+
entryComponents: [TEMPLATE_REF_DIRECTIVES],
|
|
20135
|
+
exports: [TEMPLATE_REF_DIRECTIVES],
|
|
20136
|
+
},] }
|
|
20137
|
+
];
|
|
20138
|
+
|
|
20139
|
+
var TabsWillyWonka = /** @class */ (function (_super) {
|
|
20140
|
+
__extends(TabsWillyWonka, _super);
|
|
20141
|
+
function TabsWillyWonka() {
|
|
20142
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
20143
|
+
}
|
|
20144
|
+
return TabsWillyWonka;
|
|
20145
|
+
}(WillyWonka));
|
|
20146
|
+
TabsWillyWonka.decorators = [
|
|
20147
|
+
{ type: i0.Directive, args: [{ selector: 'clr-tabs' },] }
|
|
20148
|
+
];
|
|
20149
|
+
|
|
20150
|
+
var ActiveOompaLoompa = /** @class */ (function (_super) {
|
|
20151
|
+
__extends(ActiveOompaLoompa, _super);
|
|
20152
|
+
function ActiveOompaLoompa(cdr, willyWonka, id, ifActive) {
|
|
20153
|
+
var _this = this;
|
|
20154
|
+
if (!willyWonka) {
|
|
20155
|
+
throw new Error('clrTabLink and clr-tab-content should only be used inside of a clr-tabs');
|
|
20156
|
+
}
|
|
20157
|
+
_this = _super.call(this, cdr, willyWonka) || this;
|
|
20158
|
+
_this.ifActive = ifActive;
|
|
20159
|
+
_this.id = id;
|
|
19335
20160
|
return _this;
|
|
19336
20161
|
}
|
|
19337
20162
|
Object.defineProperty(ActiveOompaLoompa.prototype, "flavor", {
|
|
@@ -23422,7 +24247,14 @@
|
|
|
23422
24247
|
};
|
|
23423
24248
|
ClrWizard.prototype.listenForPageChanges = function () {
|
|
23424
24249
|
var _this = this;
|
|
23425
|
-
return this.navService.currentPageChanged.subscribe(function () {
|
|
24250
|
+
return this.navService.currentPageChanged.subscribe(function () {
|
|
24251
|
+
var _a;
|
|
24252
|
+
// Added to address VPAT-749:
|
|
24253
|
+
// When clicking on a wizard tab, focus should move to that
|
|
24254
|
+
// tabs content to make the wizard more accessible.
|
|
24255
|
+
(_a = _this.wizardTitle) === null || _a === void 0 ? void 0 : _a.nativeElement.focus();
|
|
24256
|
+
_this.currentPageChanged.emit();
|
|
24257
|
+
});
|
|
23426
24258
|
};
|
|
23427
24259
|
ClrWizard.prototype.updateNavOnPageChanges = function () {
|
|
23428
24260
|
var _this = this;
|
|
@@ -23980,13 +24812,6 @@
|
|
|
23980
24812
|
{ type: i0.Injectable }
|
|
23981
24813
|
];
|
|
23982
24814
|
|
|
23983
|
-
/*
|
|
23984
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
23985
|
-
* This software is released under MIT license.
|
|
23986
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
23987
|
-
*/
|
|
23988
|
-
var defaultAnimationTiming = '0.2s ease-in-out';
|
|
23989
|
-
|
|
23990
24815
|
/*
|
|
23991
24816
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
23992
24817
|
* This software is released under MIT license.
|
|
@@ -25251,119 +26076,17 @@
|
|
|
25251
26076
|
ClrButtonModule,
|
|
25252
26077
|
ClrFormsModule,
|
|
25253
26078
|
ClrLayoutModule,
|
|
25254
|
-
ClrPopoverModule,
|
|
25255
|
-
ClrWizardModule,
|
|
25256
|
-
ClrDragAndDropModule,
|
|
25257
|
-
ClrStepperModule,
|
|
25258
|
-
ClrSpinnerModule,
|
|
25259
|
-
ClrProgressBarModule,
|
|
25260
|
-
ClrPopoverModuleNext,
|
|
25261
|
-
ClrTimelineModule,
|
|
25262
|
-
],
|
|
25263
|
-
},] }
|
|
25264
|
-
];
|
|
25265
|
-
|
|
25266
|
-
/*
|
|
25267
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25268
|
-
* This software is released under MIT license.
|
|
25269
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25270
|
-
*/
|
|
25271
|
-
|
|
25272
|
-
/*
|
|
25273
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25274
|
-
* This software is released under MIT license.
|
|
25275
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25276
|
-
*/
|
|
25277
|
-
|
|
25278
|
-
/*
|
|
25279
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25280
|
-
* This software is released under MIT license.
|
|
25281
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25282
|
-
*/
|
|
25283
|
-
|
|
25284
|
-
/*
|
|
25285
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25286
|
-
* This software is released under MIT license.
|
|
25287
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25288
|
-
*/
|
|
25289
|
-
|
|
25290
|
-
/*
|
|
25291
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25292
|
-
* This software is released under MIT license.
|
|
25293
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25294
|
-
*/
|
|
25295
|
-
|
|
25296
|
-
/*
|
|
25297
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25298
|
-
* This software is released under MIT license.
|
|
25299
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25300
|
-
*/
|
|
25301
|
-
|
|
25302
|
-
/*
|
|
25303
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25304
|
-
* This software is released under MIT license.
|
|
25305
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25306
|
-
*/
|
|
25307
|
-
|
|
25308
|
-
/*
|
|
25309
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25310
|
-
* This software is released under MIT license.
|
|
25311
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25312
|
-
*/
|
|
25313
|
-
|
|
25314
|
-
/*
|
|
25315
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25316
|
-
* This software is released under MIT license.
|
|
25317
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25318
|
-
*/
|
|
25319
|
-
|
|
25320
|
-
/*
|
|
25321
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25322
|
-
* This software is released under MIT license.
|
|
25323
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25324
|
-
*/
|
|
25325
|
-
|
|
25326
|
-
/*
|
|
25327
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25328
|
-
* This software is released under MIT license.
|
|
25329
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25330
|
-
*/
|
|
25331
|
-
|
|
25332
|
-
/*
|
|
25333
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25334
|
-
* This software is released under MIT license.
|
|
25335
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25336
|
-
*/
|
|
25337
|
-
|
|
25338
|
-
/*
|
|
25339
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25340
|
-
* This software is released under MIT license.
|
|
25341
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25342
|
-
*/
|
|
25343
|
-
|
|
25344
|
-
/*
|
|
25345
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25346
|
-
* This software is released under MIT license.
|
|
25347
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25348
|
-
*/
|
|
25349
|
-
|
|
25350
|
-
/*
|
|
25351
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25352
|
-
* This software is released under MIT license.
|
|
25353
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25354
|
-
*/
|
|
25355
|
-
|
|
25356
|
-
/*
|
|
25357
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25358
|
-
* This software is released under MIT license.
|
|
25359
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25360
|
-
*/
|
|
25361
|
-
|
|
25362
|
-
/*
|
|
25363
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25364
|
-
* This software is released under MIT license.
|
|
25365
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25366
|
-
*/
|
|
26079
|
+
ClrPopoverModule,
|
|
26080
|
+
ClrWizardModule,
|
|
26081
|
+
ClrDragAndDropModule,
|
|
26082
|
+
ClrStepperModule,
|
|
26083
|
+
ClrSpinnerModule,
|
|
26084
|
+
ClrProgressBarModule,
|
|
26085
|
+
ClrPopoverModuleNext,
|
|
26086
|
+
ClrTimelineModule,
|
|
26087
|
+
],
|
|
26088
|
+
},] }
|
|
26089
|
+
];
|
|
25367
26090
|
|
|
25368
26091
|
/*
|
|
25369
26092
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25442,16 +26165,6 @@
|
|
|
25442
26165
|
* This software is released under MIT license.
|
|
25443
26166
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25444
26167
|
*/
|
|
25445
|
-
var CLR_MENU_POSITIONS = [
|
|
25446
|
-
'bottom-left',
|
|
25447
|
-
'bottom-right',
|
|
25448
|
-
'top-left',
|
|
25449
|
-
'top-right',
|
|
25450
|
-
'left-bottom',
|
|
25451
|
-
'left-top',
|
|
25452
|
-
'right-bottom',
|
|
25453
|
-
'right-top',
|
|
25454
|
-
];
|
|
25455
26168
|
|
|
25456
26169
|
/*
|
|
25457
26170
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25482,14 +26195,6 @@
|
|
|
25482
26195
|
* This software is released under MIT license.
|
|
25483
26196
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25484
26197
|
*/
|
|
25485
|
-
function collapse() {
|
|
25486
|
-
'use strict';
|
|
25487
|
-
return [
|
|
25488
|
-
animations.state('true', animations.style({ height: 0, 'overflow-y': 'hidden' })),
|
|
25489
|
-
animations.transition('true => false', [animations.animate(defaultAnimationTiming, animations.style({ height: '*', 'overflow-y': 'hidden' }))]),
|
|
25490
|
-
animations.transition('false => true', [animations.style({ height: '*', 'overflow-y': 'hidden' }), animations.animate(defaultAnimationTiming)]),
|
|
25491
|
-
];
|
|
25492
|
-
}
|
|
25493
26198
|
|
|
25494
26199
|
/*
|
|
25495
26200
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25502,13 +26207,6 @@
|
|
|
25502
26207
|
* This software is released under MIT license.
|
|
25503
26208
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25504
26209
|
*/
|
|
25505
|
-
function fade(opacity) {
|
|
25506
|
-
if (opacity === void 0) { opacity = 1; }
|
|
25507
|
-
return [
|
|
25508
|
-
animations.transition('void => *', [animations.style({ opacity: 0 }), animations.animate(defaultAnimationTiming, animations.style({ opacity: opacity }))]),
|
|
25509
|
-
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0 }))]),
|
|
25510
|
-
];
|
|
25511
|
-
}
|
|
25512
26210
|
|
|
25513
26211
|
/*
|
|
25514
26212
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25521,28 +26219,6 @@
|
|
|
25521
26219
|
* This software is released under MIT license.
|
|
25522
26220
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25523
26221
|
*/
|
|
25524
|
-
function fadeSlide(direction) {
|
|
25525
|
-
var transform = null;
|
|
25526
|
-
if (direction === 'up') {
|
|
25527
|
-
transform = 'translate(0, 25%)';
|
|
25528
|
-
}
|
|
25529
|
-
else if (direction === 'down') {
|
|
25530
|
-
transform = 'translate(0, -25%)';
|
|
25531
|
-
}
|
|
25532
|
-
else if (direction === 'left') {
|
|
25533
|
-
transform = 'translate(25%, 0)';
|
|
25534
|
-
}
|
|
25535
|
-
else if (direction === 'right') {
|
|
25536
|
-
transform = 'translate(-25%, 0)';
|
|
25537
|
-
}
|
|
25538
|
-
else {
|
|
25539
|
-
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
25540
|
-
}
|
|
25541
|
-
return [
|
|
25542
|
-
animations.transition('void => *', [animations.style({ opacity: 0, transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
25543
|
-
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0, transform: transform }))]),
|
|
25544
|
-
];
|
|
25545
|
-
}
|
|
25546
26222
|
|
|
25547
26223
|
/*
|
|
25548
26224
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25555,28 +26231,6 @@
|
|
|
25555
26231
|
* This software is released under MIT license.
|
|
25556
26232
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25557
26233
|
*/
|
|
25558
|
-
function slide(direction) {
|
|
25559
|
-
var transform = null;
|
|
25560
|
-
if (direction === 'up') {
|
|
25561
|
-
transform = 'translate(0, 25%)';
|
|
25562
|
-
}
|
|
25563
|
-
else if (direction === 'down') {
|
|
25564
|
-
transform = 'translate(0, -25%)';
|
|
25565
|
-
}
|
|
25566
|
-
else if (direction === 'left') {
|
|
25567
|
-
transform = 'translate(25%, 0)';
|
|
25568
|
-
}
|
|
25569
|
-
else if (direction === 'right') {
|
|
25570
|
-
transform = 'translate(-25%, 0)';
|
|
25571
|
-
}
|
|
25572
|
-
else {
|
|
25573
|
-
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
25574
|
-
}
|
|
25575
|
-
return [
|
|
25576
|
-
animations.transition('void => *', [animations.style({ transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
25577
|
-
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ transform: transform }))]),
|
|
25578
|
-
];
|
|
25579
|
-
}
|
|
25580
26234
|
|
|
25581
26235
|
/*
|
|
25582
26236
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25613,174 +26267,16 @@
|
|
|
25613
26267
|
* This software is released under MIT license.
|
|
25614
26268
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25615
26269
|
*/
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
|
|
25619
|
-
|
|
25620
|
-
|
|
25621
|
-
|
|
25622
|
-
|
|
25623
|
-
|
|
25624
|
-
|
|
25625
|
-
var ARIA_LIVE_TICK = 100;
|
|
25626
|
-
/**
|
|
25627
|
-
* @deprecated
|
|
25628
|
-
*
|
|
25629
|
-
* -- ClrAriaLiveService is deprecated in 5.0 to be removed in 6.0 --
|
|
25630
|
-
* Please consider using the LiveAnnouncer in the Angular Material CDK
|
|
25631
|
-
* if your project needs this functionality.
|
|
25632
|
-
* More info: https://material.angular.io/cdk/a11y/overview#example-1
|
|
25633
|
-
*
|
|
25634
|
-
* This service handle `aria-live` accessibility attribute. The issue is that you need
|
|
25635
|
-
* to have the DOM Element with attribute `aria-live` before you could insert content
|
|
25636
|
-
* and SR (Screen Reader) pick the change and announce it.
|
|
25637
|
-
*
|
|
25638
|
-
* ```typescript
|
|
25639
|
-
* import { ClrAriaLiveService } from 'src/clr-angular/utils/a11y/aria-live.service';
|
|
25640
|
-
*
|
|
25641
|
-
* @Component({
|
|
25642
|
-
* selector: 'clr-demo-component',
|
|
25643
|
-
* providers: [ClrAriaLiveService],
|
|
25644
|
-
* template: `
|
|
25645
|
-
* <ng-content></ng-content>
|
|
25646
|
-
* `,
|
|
25647
|
-
* })
|
|
25648
|
-
* export class DemoComponent {
|
|
25649
|
-
* constructor(ariaLiveService: ClrAriaLiveService) {}
|
|
25650
|
-
*
|
|
25651
|
-
* public actionThatWillTriggerChange() {
|
|
25652
|
-
* this.ariaLiveService.announce('message that I want to announce to SR');
|
|
25653
|
-
* }
|
|
25654
|
-
* }
|
|
25655
|
-
* ```
|
|
25656
|
-
*
|
|
25657
|
-
*/
|
|
25658
|
-
var ClrAriaLiveService = /** @class */ (function () {
|
|
25659
|
-
function ClrAriaLiveService(ngZone, _document, platformId) {
|
|
25660
|
-
this.ngZone = ngZone;
|
|
25661
|
-
this.platformId = platformId;
|
|
25662
|
-
this._id = "clr-aria-live-element-" + uniqueIdFactory();
|
|
25663
|
-
this.document = _document;
|
|
25664
|
-
}
|
|
25665
|
-
Object.defineProperty(ClrAriaLiveService.prototype, "id", {
|
|
25666
|
-
/**
|
|
25667
|
-
* get access to the internal HTML `id` that gonna be used for the AriaLive container.
|
|
25668
|
-
* @return ID of the DOM Element as string.
|
|
25669
|
-
*/
|
|
25670
|
-
get: function () {
|
|
25671
|
-
return this._id;
|
|
25672
|
-
},
|
|
25673
|
-
enumerable: false,
|
|
25674
|
-
configurable: true
|
|
25675
|
-
});
|
|
25676
|
-
/**
|
|
25677
|
-
* Append text content inside the AriaLive Container. This method will check if the
|
|
25678
|
-
* DOM Element is existing if not it will create one for us and the will apply the text.
|
|
25679
|
-
*
|
|
25680
|
-
* ```typescript
|
|
25681
|
-
* this.ariaLiveService.announce(this.el.nativeElement);
|
|
25682
|
-
* // or
|
|
25683
|
-
* this.ariaLiveService.announce('Message to announce to SR');
|
|
25684
|
-
* ```
|
|
25685
|
-
*
|
|
25686
|
-
* @remark
|
|
25687
|
-
* When second argument is `AriaLivePoliteness.off` we won't create aria container or update it.
|
|
25688
|
-
* The reason for that is that we don't want to do additional work if the SR will ignore it.
|
|
25689
|
-
*
|
|
25690
|
-
* @param message - This could be simple string or HTMLElement
|
|
25691
|
-
* @param politeness - 'polite', 'assertive' or 'off'
|
|
25692
|
-
*/
|
|
25693
|
-
ClrAriaLiveService.prototype.announce = function (message, politeness) {
|
|
25694
|
-
var _this = this;
|
|
25695
|
-
if (politeness === void 0) { politeness = exports.ClrAriaLivePoliteness.polite; }
|
|
25696
|
-
if (politeness === exports.ClrAriaLivePoliteness.off) {
|
|
25697
|
-
return;
|
|
25698
|
-
}
|
|
25699
|
-
if (!this.ariaLiveElement && i1.isPlatformBrowser(this.platformId)) {
|
|
25700
|
-
this.ariaLiveElement = this.createContainer();
|
|
25701
|
-
}
|
|
25702
|
-
message = typeof message !== 'string' && i1.isPlatformBrowser(this.platformId) ? message.textContent : message;
|
|
25703
|
-
// when there is no message do NOTHING!
|
|
25704
|
-
if (!message) {
|
|
25705
|
-
return;
|
|
25706
|
-
}
|
|
25707
|
-
this.ariaLiveElement.setAttribute('aria-live', politeness);
|
|
25708
|
-
// This 100ms timeout is necessary for some browser + screen-reader combinations:
|
|
25709
|
-
// - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.
|
|
25710
|
-
// - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
|
|
25711
|
-
// second time without clearing and then using a non-zero delay.
|
|
25712
|
-
// (using JAWS 17 at time of this writing).
|
|
25713
|
-
this.ngZone.runOutsideAngular(function () {
|
|
25714
|
-
// This clearTimeout will stop all older messages from announcing
|
|
25715
|
-
// in the case where the messages are comming too fast we gonna try to append only
|
|
25716
|
-
// the last one. That's what the SR will try to do anyway.
|
|
25717
|
-
clearTimeout(_this.previousTimeout);
|
|
25718
|
-
_this.previousTimeout = setTimeout(function () {
|
|
25719
|
-
_this.ariaLiveElement.textContent = message;
|
|
25720
|
-
}, ARIA_LIVE_TICK);
|
|
25721
|
-
});
|
|
25722
|
-
};
|
|
25723
|
-
/**
|
|
25724
|
-
* onDestroy life cycle - must stop all active setTimeouts and remove the AriaLive
|
|
25725
|
-
* container from the document.
|
|
25726
|
-
*/
|
|
25727
|
-
ClrAriaLiveService.prototype.ngOnDestroy = function () {
|
|
25728
|
-
clearTimeout(this.previousTimeout);
|
|
25729
|
-
if (i1.isPlatformBrowser(this.platformId) && this.ariaLiveElement) {
|
|
25730
|
-
this.document.body.removeChild(this.ariaLiveElement);
|
|
25731
|
-
this.ariaLiveElement = null;
|
|
25732
|
-
}
|
|
25733
|
-
};
|
|
25734
|
-
/**
|
|
25735
|
-
* Create AriaLive DOM element as a last child of the document.
|
|
25736
|
-
* After the element is created, we gonna apply Clarity class to hide it from
|
|
25737
|
-
* the screen and set the `aria-live` politness.
|
|
25738
|
-
*
|
|
25739
|
-
* `clr-sr-only` is the CSS class that is used to hide the element from the screen.
|
|
25740
|
-
*
|
|
25741
|
-
* @remark
|
|
25742
|
-
* Calling this method multiple times will create multiple DOM Elements, that
|
|
25743
|
-
* won't be tracked and will be GC after the service is destroyed.
|
|
25744
|
-
*
|
|
25745
|
-
* @return AriaLive container as HTMLElement
|
|
25746
|
-
*
|
|
25747
|
-
*/
|
|
25748
|
-
ClrAriaLiveService.prototype.createContainer = function () {
|
|
25749
|
-
var ariaLiveElement = this.document.createElement('div');
|
|
25750
|
-
ariaLiveElement.setAttribute('id', this.id);
|
|
25751
|
-
// Use clarity screen reader class to hide the dom element
|
|
25752
|
-
// and fix the scrollbar shake
|
|
25753
|
-
ariaLiveElement.classList.add('clr-sr-only');
|
|
25754
|
-
ariaLiveElement.setAttribute('aria-atomic', 'true');
|
|
25755
|
-
ariaLiveElement.setAttribute('aria-live', exports.ClrAriaLivePoliteness.polite);
|
|
25756
|
-
this.document.body.appendChild(ariaLiveElement);
|
|
25757
|
-
return ariaLiveElement;
|
|
25758
|
-
};
|
|
25759
|
-
return ClrAriaLiveService;
|
|
25760
|
-
}());
|
|
25761
|
-
ClrAriaLiveService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ClrAriaLiveService_Factory() { return new ClrAriaLiveService(i0__namespace.ɵɵinject(i0__namespace.NgZone), i0__namespace.ɵɵinject(i1__namespace.DOCUMENT), i0__namespace.ɵɵinject(i0__namespace.PLATFORM_ID)); }, token: ClrAriaLiveService, providedIn: "root" });
|
|
25762
|
-
ClrAriaLiveService.decorators = [
|
|
25763
|
-
{ type: i0.Injectable, args: [{
|
|
25764
|
-
providedIn: 'root',
|
|
25765
|
-
},] }
|
|
26270
|
+
var CLR_MENU_POSITIONS = [
|
|
26271
|
+
'bottom-left',
|
|
26272
|
+
'bottom-right',
|
|
26273
|
+
'top-left',
|
|
26274
|
+
'top-right',
|
|
26275
|
+
'left-bottom',
|
|
26276
|
+
'left-top',
|
|
26277
|
+
'right-bottom',
|
|
26278
|
+
'right-top',
|
|
25766
26279
|
];
|
|
25767
|
-
ClrAriaLiveService.ctorParameters = function () { return [
|
|
25768
|
-
{ type: i0.NgZone },
|
|
25769
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
|
|
25770
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
|
25771
|
-
]; };
|
|
25772
|
-
|
|
25773
|
-
/*
|
|
25774
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25775
|
-
* This software is released under MIT license.
|
|
25776
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25777
|
-
*/
|
|
25778
|
-
|
|
25779
|
-
/*
|
|
25780
|
-
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
25781
|
-
* This software is released under MIT license.
|
|
25782
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25783
|
-
*/
|
|
25784
26280
|
|
|
25785
26281
|
/*
|
|
25786
26282
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -26131,6 +26627,7 @@
|
|
|
26131
26627
|
exports["ÇlrWrappedCell"] = WrappedCell;
|
|
26132
26628
|
exports["ÇlrWrappedColumn"] = WrappedColumn;
|
|
26133
26629
|
exports["ÇlrWrappedRow"] = WrappedRow;
|
|
26630
|
+
exports["ɵ0"] = ɵ0;
|
|
26134
26631
|
exports["ɵa"] = domAdapterFactory;
|
|
26135
26632
|
exports["ɵb"] = LayoutService;
|
|
26136
26633
|
exports["ɵba"] = AlertIconAndTypesService;
|
|
@@ -26189,49 +26686,51 @@
|
|
|
26189
26686
|
exports["ɵd"] = FOCUS_TRAP_DIRECTIVES;
|
|
26190
26687
|
exports["ɵda"] = ColumnsService;
|
|
26191
26688
|
exports["ɵdb"] = DisplayModeService;
|
|
26192
|
-
exports["ɵdc"] =
|
|
26193
|
-
exports["ɵdd"] =
|
|
26194
|
-
exports["ɵde"] =
|
|
26195
|
-
exports["ɵdf"] =
|
|
26196
|
-
exports["ɵdg"] =
|
|
26197
|
-
exports["ɵdh"] =
|
|
26198
|
-
exports["ɵdi"] =
|
|
26199
|
-
exports["ɵdj"] =
|
|
26200
|
-
exports["ɵdk"] =
|
|
26201
|
-
exports["
|
|
26202
|
-
exports["ɵdn"] =
|
|
26203
|
-
exports["ɵdo"] =
|
|
26204
|
-
exports["ɵdp"] =
|
|
26205
|
-
exports["ɵdq"] =
|
|
26206
|
-
exports["ɵdr"] =
|
|
26207
|
-
exports["ɵds"] =
|
|
26208
|
-
exports["ɵdt"] =
|
|
26209
|
-
exports["ɵdu"] =
|
|
26210
|
-
exports["ɵdv"] =
|
|
26211
|
-
exports["ɵdw"] =
|
|
26212
|
-
exports["ɵdx"] =
|
|
26213
|
-
exports["
|
|
26214
|
-
exports["ɵdz"] = TemplateRefContainer;
|
|
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;
|
|
26215
26711
|
exports["ɵe"] = RootDropdownService;
|
|
26216
|
-
exports["ɵea"] =
|
|
26217
|
-
exports["ɵeb"] =
|
|
26218
|
-
exports["ɵec"] =
|
|
26219
|
-
exports["ɵed"] =
|
|
26220
|
-
exports["ɵee"] =
|
|
26221
|
-
exports["ɵef"] =
|
|
26222
|
-
exports["ɵeg"] =
|
|
26223
|
-
exports["ɵeh"] =
|
|
26224
|
-
exports["ɵei"] =
|
|
26225
|
-
exports["ɵej"] =
|
|
26226
|
-
exports["ɵek"] =
|
|
26227
|
-
exports["ɵel"] =
|
|
26228
|
-
exports["ɵem"] =
|
|
26229
|
-
exports["ɵen"] =
|
|
26230
|
-
exports["ɵeo"] =
|
|
26231
|
-
exports["ɵep"] =
|
|
26232
|
-
exports["ɵeq"] =
|
|
26233
|
-
exports["ɵer"] =
|
|
26234
|
-
exports["ɵes"] =
|
|
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;
|
|
26235
26734
|
exports["ɵf"] = clrRootDropdownFactory;
|
|
26236
26735
|
exports["ɵg"] = ROOT_DROPDOWN_PROVIDER;
|
|
26237
26736
|
exports["ɵh"] = POPOVER_HOST_ANCHOR;
|