@clr/angular 12.0.13 → 12.0.14
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 +857 -557
- package/bundles/clr-angular.umd.js.map +1 -1
- package/clarity.api.md +4010 -0
- package/clr-angular.d.ts +21 -20
- package/clr-angular.metadata.json +1 -1
- package/esm2015/clr-angular.js +21 -20
- package/esm2015/data/datagrid/datagrid-column-toggle.js +4 -2
- package/esm2015/forms/datepicker/calendar.js +1 -1
- package/esm2015/forms/password/password-container.js +4 -1
- package/esm2015/layout/nav/header.js +25 -5
- package/esm2015/layout/nav/nav-level.js +106 -5
- 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 +862 -567
- 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\n status=\"info\"\n [attr.shape]=\"show ? 'eye-hide' : 'eye'\"\n [attr.title]=\"show ? commonStrings.keys.hide : commonStrings.keys.show\"\n ></cds-icon>\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 ",
|
|
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\n status=\"info\"\n [attr.shape]=\"show ? 'eye-hide' : 'eye'\"\n [attr.title]=\"show ? commonStrings.keys.hide : commonStrings.keys.show\"\n ></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',
|
|
@@ -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.
|
|
@@ -14615,7 +14642,7 @@
|
|
|
14615
14642
|
ClrDatagridColumnToggle.decorators = [
|
|
14616
14643
|
{ type: i0.Component, args: [{
|
|
14617
14644
|
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 ",
|
|
14645
|
+
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
14646
|
host: { '[class.column-switch-wrapper]': 'true', '[class.active]': 'openState' },
|
|
14620
14647
|
providers: [UNIQUE_ID_PROVIDER, ClrPopoverEventsService, ClrPopoverPositionService, ClrPopoverToggleService]
|
|
14621
14648
|
},] }
|
|
@@ -19108,6 +19135,14 @@
|
|
|
19108
19135
|
_this.initializeNavTriggers(navLevelList);
|
|
19109
19136
|
},
|
|
19110
19137
|
});
|
|
19138
|
+
this._subscription.add(this.responsiveNavService.navControl
|
|
19139
|
+
.pipe(operators.filter(function (_a) {
|
|
19140
|
+
var controlCode = _a.controlCode;
|
|
19141
|
+
return controlCode === ResponsiveNavCodes.NAV_CLOSE || controlCode === ResponsiveNavCodes.NAV_CLOSE_ALL;
|
|
19142
|
+
}))
|
|
19143
|
+
.subscribe(function () {
|
|
19144
|
+
_this.openNavLevel = null;
|
|
19145
|
+
}));
|
|
19111
19146
|
}
|
|
19112
19147
|
// reset triggers. handles cases when an application has different nav levels on different pages.
|
|
19113
19148
|
ClrHeader.prototype.resetNavTriggers = function () {
|
|
@@ -19135,10 +19170,21 @@
|
|
|
19135
19170
|
ClrHeader.prototype.closeOpenNav = function () {
|
|
19136
19171
|
this.responsiveNavService.closeAllNavs();
|
|
19137
19172
|
};
|
|
19138
|
-
|
|
19173
|
+
/**
|
|
19174
|
+
* @deprecated Will be removed in with @clr/angular v15.0.0
|
|
19175
|
+
*
|
|
19176
|
+
* Use `openNav(navLevel)` instead to open the navigation and ResponsiveNavService to close it.
|
|
19177
|
+
*/
|
|
19139
19178
|
ClrHeader.prototype.toggleNav = function (navLevel) {
|
|
19140
|
-
|
|
19141
|
-
|
|
19179
|
+
if (this.openNavLevel === navLevel) {
|
|
19180
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_CLOSE, navLevel);
|
|
19181
|
+
return;
|
|
19182
|
+
}
|
|
19183
|
+
this.openNav(navLevel);
|
|
19184
|
+
};
|
|
19185
|
+
ClrHeader.prototype.openNav = function (navLevel) {
|
|
19186
|
+
this.openNavLevel = navLevel;
|
|
19187
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_OPEN, navLevel);
|
|
19142
19188
|
};
|
|
19143
19189
|
ClrHeader.prototype.ngOnDestroy = function () {
|
|
19144
19190
|
this._subscription.unsubscribe();
|
|
@@ -19148,7 +19194,7 @@
|
|
|
19148
19194
|
ClrHeader.decorators = [
|
|
19149
19195
|
{ type: i0.Component, args: [{
|
|
19150
19196
|
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)=\"
|
|
19197
|
+
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
19198
|
host: { '[class.header]': 'true' }
|
|
19153
19199
|
},] }
|
|
19154
19200
|
];
|
|
@@ -19162,220 +19208,801 @@
|
|
|
19162
19208
|
* This software is released under MIT license.
|
|
19163
19209
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19164
19210
|
*/
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19168
|
-
|
|
19211
|
+
function refocusIfOutsideFocusTrapElement(focusedElement, focusTrapElement, elementToRefocus) {
|
|
19212
|
+
var focusTrapIsCurrent = internal.FocusTrapTrackerService.getCurrent() === focusTrapElement;
|
|
19213
|
+
var elementToFocusIsOutsideFocusTrap = elementIsOutsideFocusTrapElement(focusedElement, focusTrapElement);
|
|
19214
|
+
if (focusTrapIsCurrent && elementToFocusIsOutsideFocusTrap) {
|
|
19215
|
+
elementToRefocus = elementToRefocus || focusTrapElement;
|
|
19216
|
+
elementToRefocus.focus();
|
|
19169
19217
|
}
|
|
19170
|
-
|
|
19171
|
-
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19218
|
+
else {
|
|
19219
|
+
focusedElement.focus();
|
|
19220
|
+
}
|
|
19221
|
+
}
|
|
19222
|
+
function elementIsOutsideFocusTrapElement(focusedElement, focusTrapElement) {
|
|
19223
|
+
if (focusedElement === focusTrapElement.topReboundElement ||
|
|
19224
|
+
focusedElement === focusTrapElement.bottomReboundElement) {
|
|
19225
|
+
return true;
|
|
19226
|
+
}
|
|
19227
|
+
var elementIsInFocusTrapLightDom = focusTrapElement.contains(focusedElement);
|
|
19228
|
+
if (elementIsInFocusTrapLightDom) {
|
|
19229
|
+
return false;
|
|
19230
|
+
}
|
|
19231
|
+
if (focusTrapElement !== null && focusTrapElement.contains(focusedElement)) {
|
|
19232
|
+
return false;
|
|
19233
|
+
}
|
|
19234
|
+
return true;
|
|
19235
|
+
}
|
|
19236
|
+
function createFocusTrapReboundElement(document) {
|
|
19237
|
+
var offScreenSpan = document.createElement('span');
|
|
19238
|
+
offScreenSpan.setAttribute('tabindex', '0');
|
|
19239
|
+
offScreenSpan.classList.add('offscreen-focus-rebounder');
|
|
19240
|
+
return offScreenSpan;
|
|
19241
|
+
}
|
|
19242
|
+
function addReboundElementsToFocusTrapElement(document, focusTrapElement) {
|
|
19243
|
+
if (focusTrapElement && !focusTrapElement.topReboundElement && !focusTrapElement.bottomReboundElement) {
|
|
19244
|
+
focusTrapElement.topReboundElement = createFocusTrapReboundElement(document);
|
|
19245
|
+
focusTrapElement.bottomReboundElement = createFocusTrapReboundElement(document);
|
|
19246
|
+
var parent = focusTrapElement.parentElement;
|
|
19247
|
+
var sibling = focusTrapElement.nextSibling;
|
|
19248
|
+
if (parent) {
|
|
19249
|
+
parent.insertBefore(focusTrapElement.topReboundElement, focusTrapElement);
|
|
19250
|
+
if (sibling) {
|
|
19251
|
+
parent.insertBefore(focusTrapElement.bottomReboundElement, sibling);
|
|
19252
|
+
}
|
|
19253
|
+
else {
|
|
19254
|
+
parent.appendChild(focusTrapElement.bottomReboundElement);
|
|
19255
|
+
}
|
|
19185
19256
|
}
|
|
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;
|
|
19257
|
+
}
|
|
19258
|
+
}
|
|
19259
|
+
function removeReboundElementsFromFocusTrapElement(focusTrapElement) {
|
|
19260
|
+
if (focusTrapElement) {
|
|
19261
|
+
var parent = focusTrapElement.parentElement;
|
|
19262
|
+
if (parent) {
|
|
19263
|
+
var topRebound = focusTrapElement.topReboundElement;
|
|
19264
|
+
var bottomRebound = focusTrapElement.bottomReboundElement;
|
|
19265
|
+
if (topRebound) {
|
|
19266
|
+
parent.removeChild(topRebound);
|
|
19220
19267
|
}
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
return;
|
|
19268
|
+
if (bottomRebound) {
|
|
19269
|
+
parent.removeChild(bottomRebound);
|
|
19224
19270
|
}
|
|
19225
|
-
|
|
19271
|
+
}
|
|
19272
|
+
// These are here to to make sure that we completely delete all traces of the removed DOM objects.
|
|
19273
|
+
delete focusTrapElement.topReboundElement;
|
|
19274
|
+
delete focusTrapElement.bottomReboundElement;
|
|
19275
|
+
}
|
|
19276
|
+
}
|
|
19277
|
+
// this helper exists to enable the focus trap class to handle vanilla html elements
|
|
19278
|
+
// it's primary concern is to keep TS happy.
|
|
19279
|
+
function castHtmlElementToFocusTrapElement(el) {
|
|
19280
|
+
return el;
|
|
19281
|
+
}
|
|
19282
|
+
var FocusTrap = /** @class */ (function () {
|
|
19283
|
+
function FocusTrap(renderer, injector, platformId, hostElement) {
|
|
19284
|
+
this.renderer = renderer;
|
|
19285
|
+
this.active = false;
|
|
19286
|
+
if (i1.isPlatformBrowser(platformId)) {
|
|
19287
|
+
this._document = injector.get(i1.DOCUMENT);
|
|
19288
|
+
}
|
|
19289
|
+
hostElement = castHtmlElementToFocusTrapElement(hostElement);
|
|
19290
|
+
if (!hostElement.focusTrapId) {
|
|
19291
|
+
hostElement.focusTrapId = internal.createId();
|
|
19292
|
+
}
|
|
19293
|
+
this.focusTrapElement = hostElement;
|
|
19294
|
+
}
|
|
19295
|
+
FocusTrap.prototype.enableFocusTrap = function () {
|
|
19296
|
+
var _this = this;
|
|
19297
|
+
var fte = this.focusTrapElement;
|
|
19298
|
+
var firstFocusElement = fte.querySelector('[cds-first-focus]');
|
|
19299
|
+
var activeEl = this._document.activeElement;
|
|
19300
|
+
if (internal.FocusTrapTrackerService.getCurrent() === fte) {
|
|
19301
|
+
throw new Error('Focus trap is already enabled for this instance.');
|
|
19302
|
+
}
|
|
19303
|
+
this.firstFocusElement = firstFocusElement || this.focusTrapElement;
|
|
19304
|
+
addReboundElementsToFocusTrapElement(this._document, fte);
|
|
19305
|
+
if (!internal.isFocusable(fte)) {
|
|
19306
|
+
fte.setAttribute('tabindex', '-1');
|
|
19307
|
+
}
|
|
19308
|
+
if (activeEl && internal.isHTMLElement(activeEl)) {
|
|
19309
|
+
this.previousFocus = activeEl;
|
|
19310
|
+
}
|
|
19311
|
+
internal.FocusTrapTrackerService.setCurrent(fte);
|
|
19312
|
+
// setTimeout here is required for Safari which may try to set focus on
|
|
19313
|
+
// element before it is visible...
|
|
19314
|
+
var focusTimer = setTimeout(function () {
|
|
19315
|
+
_this.firstFocusElement.focus();
|
|
19316
|
+
clearTimeout(focusTimer);
|
|
19317
|
+
}, 10);
|
|
19318
|
+
this.onFocusInEvent = this.onFocusIn.bind(this);
|
|
19319
|
+
this.unlisten = this.renderer.listen(this._document, 'focusin', this.onFocusInEvent);
|
|
19320
|
+
this.active = true;
|
|
19321
|
+
};
|
|
19322
|
+
FocusTrap.prototype.removeFocusTrap = function () {
|
|
19323
|
+
if (this.unlisten) {
|
|
19324
|
+
this.unlisten();
|
|
19325
|
+
}
|
|
19326
|
+
removeReboundElementsFromFocusTrapElement(this.focusTrapElement);
|
|
19327
|
+
this.renderer.removeAttribute(this.focusTrapElement, 'tabindex');
|
|
19328
|
+
internal.FocusTrapTrackerService.activatePreviousCurrent();
|
|
19329
|
+
this.active = false;
|
|
19330
|
+
if (this.previousFocus) {
|
|
19331
|
+
this.previousFocus.focus();
|
|
19226
19332
|
}
|
|
19227
19333
|
};
|
|
19228
|
-
|
|
19229
|
-
|
|
19334
|
+
FocusTrap.prototype.onFocusIn = function (event) {
|
|
19335
|
+
refocusIfOutsideFocusTrapElement(event.composedPath()[0], this.focusTrapElement, this.firstFocusElement);
|
|
19230
19336
|
};
|
|
19231
|
-
return
|
|
19337
|
+
return FocusTrap;
|
|
19232
19338
|
}());
|
|
19233
|
-
|
|
19234
|
-
{ type: i0.
|
|
19339
|
+
FocusTrap.decorators = [
|
|
19340
|
+
{ type: i0.Injectable }
|
|
19235
19341
|
];
|
|
19236
|
-
|
|
19237
|
-
{ type:
|
|
19238
|
-
{ type: i0.
|
|
19342
|
+
FocusTrap.ctorParameters = function () { return [
|
|
19343
|
+
{ type: i0.Renderer2 },
|
|
19344
|
+
{ type: i0.Injector },
|
|
19345
|
+
{ type: undefined },
|
|
19346
|
+
{ type: undefined }
|
|
19239
19347
|
]; };
|
|
19240
|
-
ClrNavLevel.propDecorators = {
|
|
19241
|
-
_level: [{ type: i0.Input, args: ['clr-nav-level',] }],
|
|
19242
|
-
onMouseClick: [{ type: i0.HostListener, args: ['click', ['$event.target'],] }]
|
|
19243
|
-
};
|
|
19244
19348
|
|
|
19245
19349
|
/*
|
|
19246
19350
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19247
19351
|
* This software is released under MIT license.
|
|
19248
19352
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19249
19353
|
*/
|
|
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
|
-
];
|
|
19354
|
+
var defaultAnimationTiming = '0.2s ease-in-out';
|
|
19268
19355
|
|
|
19269
19356
|
/*
|
|
19270
19357
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19271
19358
|
* This software is released under MIT license.
|
|
19272
19359
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19273
19360
|
*/
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19277
|
-
|
|
19278
|
-
|
|
19279
|
-
|
|
19280
|
-
|
|
19281
|
-
|
|
19282
|
-
},] }
|
|
19283
|
-
];
|
|
19284
|
-
TemplateRefContainer.propDecorators = {
|
|
19285
|
-
template: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
|
|
19286
|
-
};
|
|
19361
|
+
function collapse() {
|
|
19362
|
+
'use strict';
|
|
19363
|
+
return [
|
|
19364
|
+
animations.state('true', animations.style({ height: 0, 'overflow-y': 'hidden' })),
|
|
19365
|
+
animations.transition('true => false', [animations.animate(defaultAnimationTiming, animations.style({ height: '*', 'overflow-y': 'hidden' }))]),
|
|
19366
|
+
animations.transition('false => true', [animations.style({ height: '*', 'overflow-y': 'hidden' }), animations.animate(defaultAnimationTiming)]),
|
|
19367
|
+
];
|
|
19368
|
+
}
|
|
19287
19369
|
|
|
19288
19370
|
/*
|
|
19289
19371
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19290
19372
|
* This software is released under MIT license.
|
|
19291
19373
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19292
19374
|
*/
|
|
19293
|
-
var TEMPLATE_REF_DIRECTIVES = [TemplateRefContainer];
|
|
19294
19375
|
|
|
19295
19376
|
/*
|
|
19296
19377
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19297
19378
|
* This software is released under MIT license.
|
|
19298
19379
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19299
19380
|
*/
|
|
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
|
-
];
|
|
19381
|
+
function fade(opacity) {
|
|
19382
|
+
if (opacity === void 0) { opacity = 1; }
|
|
19383
|
+
return [
|
|
19384
|
+
animations.transition('void => *', [animations.style({ opacity: 0 }), animations.animate(defaultAnimationTiming, animations.style({ opacity: opacity }))]),
|
|
19385
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0 }))]),
|
|
19386
|
+
];
|
|
19387
|
+
}
|
|
19313
19388
|
|
|
19314
|
-
|
|
19315
|
-
|
|
19316
|
-
|
|
19317
|
-
|
|
19318
|
-
|
|
19319
|
-
return TabsWillyWonka;
|
|
19320
|
-
}(WillyWonka));
|
|
19321
|
-
TabsWillyWonka.decorators = [
|
|
19322
|
-
{ type: i0.Directive, args: [{ selector: 'clr-tabs' },] }
|
|
19323
|
-
];
|
|
19389
|
+
/*
|
|
19390
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19391
|
+
* This software is released under MIT license.
|
|
19392
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19393
|
+
*/
|
|
19324
19394
|
|
|
19325
|
-
|
|
19326
|
-
|
|
19327
|
-
|
|
19328
|
-
|
|
19329
|
-
|
|
19330
|
-
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19334
|
-
_this.id = id;
|
|
19335
|
-
return _this;
|
|
19395
|
+
/*
|
|
19396
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19397
|
+
* This software is released under MIT license.
|
|
19398
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19399
|
+
*/
|
|
19400
|
+
function fadeSlide(direction) {
|
|
19401
|
+
var transform = null;
|
|
19402
|
+
if (direction === 'up') {
|
|
19403
|
+
transform = 'translate(0, 25%)';
|
|
19336
19404
|
}
|
|
19337
|
-
|
|
19338
|
-
|
|
19339
|
-
|
|
19340
|
-
|
|
19341
|
-
|
|
19342
|
-
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19346
|
-
|
|
19347
|
-
|
|
19348
|
-
|
|
19349
|
-
|
|
19350
|
-
|
|
19351
|
-
|
|
19352
|
-
|
|
19353
|
-
|
|
19354
|
-
]; };
|
|
19405
|
+
else if (direction === 'down') {
|
|
19406
|
+
transform = 'translate(0, -25%)';
|
|
19407
|
+
}
|
|
19408
|
+
else if (direction === 'left') {
|
|
19409
|
+
transform = 'translate(25%, 0)';
|
|
19410
|
+
}
|
|
19411
|
+
else if (direction === 'right') {
|
|
19412
|
+
transform = 'translate(-25%, 0)';
|
|
19413
|
+
}
|
|
19414
|
+
else {
|
|
19415
|
+
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
19416
|
+
}
|
|
19417
|
+
return [
|
|
19418
|
+
animations.transition('void => *', [animations.style({ opacity: 0, transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
19419
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ opacity: 0, transform: transform }))]),
|
|
19420
|
+
];
|
|
19421
|
+
}
|
|
19355
19422
|
|
|
19356
19423
|
/*
|
|
19357
19424
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19358
19425
|
* This software is released under MIT license.
|
|
19359
19426
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19360
19427
|
*/
|
|
19361
|
-
var TabsLayout;
|
|
19362
|
-
(function (TabsLayout) {
|
|
19363
|
-
TabsLayout["HORIZONTAL"] = "horizontal";
|
|
19364
|
-
TabsLayout["VERTICAL"] = "vertical";
|
|
19365
|
-
})(TabsLayout || (TabsLayout = {}));
|
|
19366
19428
|
|
|
19367
19429
|
/*
|
|
19368
19430
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19369
19431
|
* This software is released under MIT license.
|
|
19370
19432
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19371
19433
|
*/
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
}
|
|
19377
|
-
|
|
19378
|
-
|
|
19434
|
+
function slide(direction) {
|
|
19435
|
+
var transform = null;
|
|
19436
|
+
if (direction === 'up') {
|
|
19437
|
+
transform = 'translate(0, 25%)';
|
|
19438
|
+
}
|
|
19439
|
+
else if (direction === 'down') {
|
|
19440
|
+
transform = 'translate(0, -25%)';
|
|
19441
|
+
}
|
|
19442
|
+
else if (direction === 'left') {
|
|
19443
|
+
transform = 'translate(25%, 0)';
|
|
19444
|
+
}
|
|
19445
|
+
else if (direction === 'right') {
|
|
19446
|
+
transform = 'translate(-25%, 0)';
|
|
19447
|
+
}
|
|
19448
|
+
else {
|
|
19449
|
+
throw new Error('Unknown direction ' + direction + ' for slide animation.');
|
|
19450
|
+
}
|
|
19451
|
+
return [
|
|
19452
|
+
animations.transition('void => *', [animations.style({ transform: transform }), animations.animate(defaultAnimationTiming)]),
|
|
19453
|
+
animations.transition('* => void', [animations.animate(defaultAnimationTiming, animations.style({ transform: transform }))]),
|
|
19454
|
+
];
|
|
19455
|
+
}
|
|
19456
|
+
|
|
19457
|
+
/*
|
|
19458
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19459
|
+
* This software is released under MIT license.
|
|
19460
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19461
|
+
*/
|
|
19462
|
+
|
|
19463
|
+
/*
|
|
19464
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19465
|
+
* This software is released under MIT license.
|
|
19466
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19467
|
+
*/
|
|
19468
|
+
|
|
19469
|
+
/*
|
|
19470
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19471
|
+
* This software is released under MIT license.
|
|
19472
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19473
|
+
*/
|
|
19474
|
+
|
|
19475
|
+
/*
|
|
19476
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19477
|
+
* This software is released under MIT license.
|
|
19478
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19479
|
+
*/
|
|
19480
|
+
|
|
19481
|
+
/*
|
|
19482
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19483
|
+
* This software is released under MIT license.
|
|
19484
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19485
|
+
*/
|
|
19486
|
+
|
|
19487
|
+
/*
|
|
19488
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19489
|
+
* This software is released under MIT license.
|
|
19490
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19491
|
+
*/
|
|
19492
|
+
exports.ClrAriaLivePoliteness = void 0;
|
|
19493
|
+
(function (ClrAriaLivePoliteness) {
|
|
19494
|
+
ClrAriaLivePoliteness["off"] = "off";
|
|
19495
|
+
ClrAriaLivePoliteness["polite"] = "polite";
|
|
19496
|
+
ClrAriaLivePoliteness["assertive"] = "assertive";
|
|
19497
|
+
})(exports.ClrAriaLivePoliteness || (exports.ClrAriaLivePoliteness = {}));
|
|
19498
|
+
/**
|
|
19499
|
+
* Time in milliseconds before inserting the content into the container
|
|
19500
|
+
*/
|
|
19501
|
+
var ARIA_LIVE_TICK = 100;
|
|
19502
|
+
/**
|
|
19503
|
+
* @deprecated
|
|
19504
|
+
*
|
|
19505
|
+
* -- ClrAriaLiveService is deprecated in 5.0 to be removed in 6.0 --
|
|
19506
|
+
* Please consider using the LiveAnnouncer in the Angular Material CDK
|
|
19507
|
+
* if your project needs this functionality.
|
|
19508
|
+
* More info: https://material.angular.io/cdk/a11y/overview#example-1
|
|
19509
|
+
*
|
|
19510
|
+
* This service handle `aria-live` accessibility attribute. The issue is that you need
|
|
19511
|
+
* to have the DOM Element with attribute `aria-live` before you could insert content
|
|
19512
|
+
* and SR (Screen Reader) pick the change and announce it.
|
|
19513
|
+
*
|
|
19514
|
+
* ```typescript
|
|
19515
|
+
* import { ClrAriaLiveService } from 'src/clr-angular/utils/a11y/aria-live.service';
|
|
19516
|
+
*
|
|
19517
|
+
* @Component({
|
|
19518
|
+
* selector: 'clr-demo-component',
|
|
19519
|
+
* providers: [ClrAriaLiveService],
|
|
19520
|
+
* template: `
|
|
19521
|
+
* <ng-content></ng-content>
|
|
19522
|
+
* `,
|
|
19523
|
+
* })
|
|
19524
|
+
* export class DemoComponent {
|
|
19525
|
+
* constructor(ariaLiveService: ClrAriaLiveService) {}
|
|
19526
|
+
*
|
|
19527
|
+
* public actionThatWillTriggerChange() {
|
|
19528
|
+
* this.ariaLiveService.announce('message that I want to announce to SR');
|
|
19529
|
+
* }
|
|
19530
|
+
* }
|
|
19531
|
+
* ```
|
|
19532
|
+
*
|
|
19533
|
+
*/
|
|
19534
|
+
var ClrAriaLiveService = /** @class */ (function () {
|
|
19535
|
+
function ClrAriaLiveService(ngZone, _document, platformId) {
|
|
19536
|
+
this.ngZone = ngZone;
|
|
19537
|
+
this.platformId = platformId;
|
|
19538
|
+
this._id = "clr-aria-live-element-" + uniqueIdFactory();
|
|
19539
|
+
this.document = _document;
|
|
19540
|
+
}
|
|
19541
|
+
Object.defineProperty(ClrAriaLiveService.prototype, "id", {
|
|
19542
|
+
/**
|
|
19543
|
+
* get access to the internal HTML `id` that gonna be used for the AriaLive container.
|
|
19544
|
+
* @return ID of the DOM Element as string.
|
|
19545
|
+
*/
|
|
19546
|
+
get: function () {
|
|
19547
|
+
return this._id;
|
|
19548
|
+
},
|
|
19549
|
+
enumerable: false,
|
|
19550
|
+
configurable: true
|
|
19551
|
+
});
|
|
19552
|
+
/**
|
|
19553
|
+
* Append text content inside the AriaLive Container. This method will check if the
|
|
19554
|
+
* DOM Element is existing if not it will create one for us and the will apply the text.
|
|
19555
|
+
*
|
|
19556
|
+
* ```typescript
|
|
19557
|
+
* this.ariaLiveService.announce(this.el.nativeElement);
|
|
19558
|
+
* // or
|
|
19559
|
+
* this.ariaLiveService.announce('Message to announce to SR');
|
|
19560
|
+
* ```
|
|
19561
|
+
*
|
|
19562
|
+
* @remark
|
|
19563
|
+
* When second argument is `AriaLivePoliteness.off` we won't create aria container or update it.
|
|
19564
|
+
* The reason for that is that we don't want to do additional work if the SR will ignore it.
|
|
19565
|
+
*
|
|
19566
|
+
* @param message - This could be simple string or HTMLElement
|
|
19567
|
+
* @param politeness - 'polite', 'assertive' or 'off'
|
|
19568
|
+
*/
|
|
19569
|
+
ClrAriaLiveService.prototype.announce = function (message, politeness) {
|
|
19570
|
+
var _this = this;
|
|
19571
|
+
if (politeness === void 0) { politeness = exports.ClrAriaLivePoliteness.polite; }
|
|
19572
|
+
if (politeness === exports.ClrAriaLivePoliteness.off) {
|
|
19573
|
+
return;
|
|
19574
|
+
}
|
|
19575
|
+
if (!this.ariaLiveElement && i1.isPlatformBrowser(this.platformId)) {
|
|
19576
|
+
this.ariaLiveElement = this.createContainer();
|
|
19577
|
+
}
|
|
19578
|
+
message = typeof message !== 'string' && i1.isPlatformBrowser(this.platformId) ? message.textContent : message;
|
|
19579
|
+
// when there is no message do NOTHING!
|
|
19580
|
+
if (!message) {
|
|
19581
|
+
return;
|
|
19582
|
+
}
|
|
19583
|
+
this.ariaLiveElement.setAttribute('aria-live', politeness);
|
|
19584
|
+
// This 100ms timeout is necessary for some browser + screen-reader combinations:
|
|
19585
|
+
// - Both JAWS and NVDA over IE11 will not announce anything without a non-zero timeout.
|
|
19586
|
+
// - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
|
|
19587
|
+
// second time without clearing and then using a non-zero delay.
|
|
19588
|
+
// (using JAWS 17 at time of this writing).
|
|
19589
|
+
this.ngZone.runOutsideAngular(function () {
|
|
19590
|
+
// This clearTimeout will stop all older messages from announcing
|
|
19591
|
+
// in the case where the messages are comming too fast we gonna try to append only
|
|
19592
|
+
// the last one. That's what the SR will try to do anyway.
|
|
19593
|
+
clearTimeout(_this.previousTimeout);
|
|
19594
|
+
_this.previousTimeout = setTimeout(function () {
|
|
19595
|
+
_this.ariaLiveElement.textContent = message;
|
|
19596
|
+
}, ARIA_LIVE_TICK);
|
|
19597
|
+
});
|
|
19598
|
+
};
|
|
19599
|
+
/**
|
|
19600
|
+
* onDestroy life cycle - must stop all active setTimeouts and remove the AriaLive
|
|
19601
|
+
* container from the document.
|
|
19602
|
+
*/
|
|
19603
|
+
ClrAriaLiveService.prototype.ngOnDestroy = function () {
|
|
19604
|
+
clearTimeout(this.previousTimeout);
|
|
19605
|
+
if (i1.isPlatformBrowser(this.platformId) && this.ariaLiveElement) {
|
|
19606
|
+
this.document.body.removeChild(this.ariaLiveElement);
|
|
19607
|
+
this.ariaLiveElement = null;
|
|
19608
|
+
}
|
|
19609
|
+
};
|
|
19610
|
+
/**
|
|
19611
|
+
* Create AriaLive DOM element as a last child of the document.
|
|
19612
|
+
* After the element is created, we gonna apply Clarity class to hide it from
|
|
19613
|
+
* the screen and set the `aria-live` politness.
|
|
19614
|
+
*
|
|
19615
|
+
* `clr-sr-only` is the CSS class that is used to hide the element from the screen.
|
|
19616
|
+
*
|
|
19617
|
+
* @remark
|
|
19618
|
+
* Calling this method multiple times will create multiple DOM Elements, that
|
|
19619
|
+
* won't be tracked and will be GC after the service is destroyed.
|
|
19620
|
+
*
|
|
19621
|
+
* @return AriaLive container as HTMLElement
|
|
19622
|
+
*
|
|
19623
|
+
*/
|
|
19624
|
+
ClrAriaLiveService.prototype.createContainer = function () {
|
|
19625
|
+
var ariaLiveElement = this.document.createElement('div');
|
|
19626
|
+
ariaLiveElement.setAttribute('id', this.id);
|
|
19627
|
+
// Use clarity screen reader class to hide the dom element
|
|
19628
|
+
// and fix the scrollbar shake
|
|
19629
|
+
ariaLiveElement.classList.add('clr-sr-only');
|
|
19630
|
+
ariaLiveElement.setAttribute('aria-atomic', 'true');
|
|
19631
|
+
ariaLiveElement.setAttribute('aria-live', exports.ClrAriaLivePoliteness.polite);
|
|
19632
|
+
this.document.body.appendChild(ariaLiveElement);
|
|
19633
|
+
return ariaLiveElement;
|
|
19634
|
+
};
|
|
19635
|
+
return ClrAriaLiveService;
|
|
19636
|
+
}());
|
|
19637
|
+
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" });
|
|
19638
|
+
ClrAriaLiveService.decorators = [
|
|
19639
|
+
{ type: i0.Injectable, args: [{
|
|
19640
|
+
providedIn: 'root',
|
|
19641
|
+
},] }
|
|
19642
|
+
];
|
|
19643
|
+
ClrAriaLiveService.ctorParameters = function () { return [
|
|
19644
|
+
{ type: i0.NgZone },
|
|
19645
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] },
|
|
19646
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
|
19647
|
+
]; };
|
|
19648
|
+
|
|
19649
|
+
/*
|
|
19650
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19651
|
+
* This software is released under MIT license.
|
|
19652
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19653
|
+
*/
|
|
19654
|
+
|
|
19655
|
+
/*
|
|
19656
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19657
|
+
* This software is released under MIT license.
|
|
19658
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19659
|
+
*/
|
|
19660
|
+
|
|
19661
|
+
/*
|
|
19662
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19663
|
+
* This software is released under MIT license.
|
|
19664
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19665
|
+
*/
|
|
19666
|
+
|
|
19667
|
+
/*
|
|
19668
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19669
|
+
* This software is released under MIT license.
|
|
19670
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19671
|
+
*/
|
|
19672
|
+
|
|
19673
|
+
/*
|
|
19674
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19675
|
+
* This software is released under MIT license.
|
|
19676
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19677
|
+
*/
|
|
19678
|
+
|
|
19679
|
+
/*
|
|
19680
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19681
|
+
* This software is released under MIT license.
|
|
19682
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19683
|
+
*/
|
|
19684
|
+
|
|
19685
|
+
var createCdsCloseButton = function (document, ariaLabel) {
|
|
19686
|
+
var cdsCloseButton = document.createElement('cds-internal-close-button');
|
|
19687
|
+
cdsCloseButton.setAttribute('icon-size', '32');
|
|
19688
|
+
console.log(ariaLabel);
|
|
19689
|
+
cdsCloseButton.setAttribute('aria-label', ariaLabel);
|
|
19690
|
+
cdsCloseButton.setAttribute('aria-hidden', 'true');
|
|
19691
|
+
cdsCloseButton.setAttribute('type', 'button');
|
|
19692
|
+
/**
|
|
19693
|
+
* The button is hidden by default based on our Desktop-first approach.
|
|
19694
|
+
*/
|
|
19695
|
+
cdsCloseButton.setAttribute('hidden', 'true');
|
|
19696
|
+
cdsCloseButton.className = 'clr-nav-close';
|
|
19697
|
+
return cdsCloseButton;
|
|
19698
|
+
};
|
|
19699
|
+
var ɵ0 = createCdsCloseButton;
|
|
19700
|
+
var ClrNavLevel = /** @class */ (function (_super) {
|
|
19701
|
+
__extends(ClrNavLevel, _super);
|
|
19702
|
+
function ClrNavLevel(platformId, responsiveNavService, elementRef, renderer, injector) {
|
|
19703
|
+
var _this = _super.call(this, renderer, injector, platformId, elementRef.nativeElement) || this;
|
|
19704
|
+
_this.responsiveNavService = responsiveNavService;
|
|
19705
|
+
_this.elementRef = elementRef;
|
|
19706
|
+
_this._isOpen = false;
|
|
19707
|
+
if (i1.isPlatformBrowser(platformId)) {
|
|
19708
|
+
_this._document = injector.get(i1.DOCUMENT);
|
|
19709
|
+
}
|
|
19710
|
+
_this._subscription = responsiveNavService.navControl
|
|
19711
|
+
.pipe(operators.filter(function (x) { return x.navLevel === _this.level; }), operators.filter(function (_a) {
|
|
19712
|
+
var controlCode = _a.controlCode;
|
|
19713
|
+
return (controlCode === ResponsiveNavCodes.NAV_OPEN && !_this.isOpen) ||
|
|
19714
|
+
(controlCode === ResponsiveNavCodes.NAV_CLOSE && _this.isOpen);
|
|
19715
|
+
}))
|
|
19716
|
+
.subscribe(function (_a) {
|
|
19717
|
+
var controlCode = _a.controlCode;
|
|
19718
|
+
if (controlCode === ResponsiveNavCodes.NAV_OPEN) {
|
|
19719
|
+
_this.open();
|
|
19720
|
+
return;
|
|
19721
|
+
}
|
|
19722
|
+
_this.close();
|
|
19723
|
+
});
|
|
19724
|
+
_this._subscription.add(responsiveNavService.navControl
|
|
19725
|
+
.pipe(operators.filter(function (_a) {
|
|
19726
|
+
var controlCode = _a.controlCode;
|
|
19727
|
+
return controlCode === ResponsiveNavCodes.NAV_CLOSE_ALL;
|
|
19728
|
+
}))
|
|
19729
|
+
.subscribe(function () { return _this.close(); }));
|
|
19730
|
+
return _this;
|
|
19731
|
+
}
|
|
19732
|
+
ClrNavLevel.prototype.ngOnInit = function () {
|
|
19733
|
+
if (!this.closeButtonAriaLabel) {
|
|
19734
|
+
this.closeButtonAriaLabel =
|
|
19735
|
+
this._level === ResponsiveNavCodes.NAV_LEVEL_1
|
|
19736
|
+
? commonStringsDefault.responsiveNavToggleClose
|
|
19737
|
+
: commonStringsDefault.responsiveNavOverflowClose;
|
|
19738
|
+
}
|
|
19739
|
+
if (this.level !== ResponsiveNavCodes.NAV_LEVEL_1 && this.level !== ResponsiveNavCodes.NAV_LEVEL_2) {
|
|
19740
|
+
console.error('Nav Level can only be 1 or 2');
|
|
19741
|
+
return;
|
|
19742
|
+
}
|
|
19743
|
+
this.responsiveNavService.registerNav(this.level);
|
|
19744
|
+
this.addNavClass(this.level);
|
|
19745
|
+
};
|
|
19746
|
+
ClrNavLevel.prototype.ngAfterViewInit = function () {
|
|
19747
|
+
var closeButton = createCdsCloseButton(this._document, this.closeButtonAriaLabel);
|
|
19748
|
+
this.renderer.listen(closeButton, 'click', this.close.bind(this));
|
|
19749
|
+
this.renderer.insertBefore(this.elementRef.nativeElement, closeButton, this.elementRef.nativeElement.firstChild); // Adding the button at the top of the nav
|
|
19750
|
+
if (this._document.body.clientWidth < LARGE_BREAKPOINT) {
|
|
19751
|
+
/**
|
|
19752
|
+
* Close if the document body is smaller than the large breakpoint for example:
|
|
19753
|
+
* - Refreshing the page
|
|
19754
|
+
* - Browser window size is changed when opening the applicaiton
|
|
19755
|
+
* - Browser zoom is turned on and zoomed to a size that makes the document smaller than the large breakpoint
|
|
19756
|
+
*/
|
|
19757
|
+
this.close();
|
|
19758
|
+
}
|
|
19759
|
+
};
|
|
19760
|
+
ClrNavLevel.prototype.addNavClass = function (level) {
|
|
19761
|
+
var navHostClassList = this.elementRef.nativeElement.classList;
|
|
19762
|
+
if (level === ResponsiveNavCodes.NAV_LEVEL_1) {
|
|
19763
|
+
navHostClassList.add(ResponsiveNavCodes.NAV_CLASS_LEVEL_1);
|
|
19764
|
+
}
|
|
19765
|
+
else if (level === ResponsiveNavCodes.NAV_LEVEL_2) {
|
|
19766
|
+
navHostClassList.add(ResponsiveNavCodes.NAV_CLASS_LEVEL_2);
|
|
19767
|
+
}
|
|
19768
|
+
};
|
|
19769
|
+
Object.defineProperty(ClrNavLevel.prototype, "level", {
|
|
19770
|
+
get: function () {
|
|
19771
|
+
return this._level;
|
|
19772
|
+
},
|
|
19773
|
+
enumerable: false,
|
|
19774
|
+
configurable: true
|
|
19775
|
+
});
|
|
19776
|
+
Object.defineProperty(ClrNavLevel.prototype, "responsiveNavCodes", {
|
|
19777
|
+
// getter to access the responsive navigation codes from the template
|
|
19778
|
+
get: function () {
|
|
19779
|
+
return ResponsiveNavCodes;
|
|
19780
|
+
},
|
|
19781
|
+
enumerable: false,
|
|
19782
|
+
configurable: true
|
|
19783
|
+
});
|
|
19784
|
+
Object.defineProperty(ClrNavLevel.prototype, "isOpen", {
|
|
19785
|
+
get: function () {
|
|
19786
|
+
return this._isOpen;
|
|
19787
|
+
},
|
|
19788
|
+
enumerable: false,
|
|
19789
|
+
configurable: true
|
|
19790
|
+
});
|
|
19791
|
+
ClrNavLevel.prototype.onResize = function (event) {
|
|
19792
|
+
var target = event.target;
|
|
19793
|
+
if (target.innerWidth < LARGE_BREAKPOINT && this.isOpen) {
|
|
19794
|
+
this.close();
|
|
19795
|
+
return;
|
|
19796
|
+
}
|
|
19797
|
+
this.showNavigation();
|
|
19798
|
+
};
|
|
19799
|
+
ClrNavLevel.prototype.open = function () {
|
|
19800
|
+
this._isOpen = true;
|
|
19801
|
+
this.showNavigation();
|
|
19802
|
+
this.enableFocusTrap();
|
|
19803
|
+
this.showCloseButton();
|
|
19804
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_OPEN, this.level);
|
|
19805
|
+
};
|
|
19806
|
+
ClrNavLevel.prototype.close = function () {
|
|
19807
|
+
this._isOpen = false;
|
|
19808
|
+
this.hideNavigation();
|
|
19809
|
+
this.removeFocusTrap();
|
|
19810
|
+
this.hideCloseButton();
|
|
19811
|
+
this.responsiveNavService.sendControlMessage(ResponsiveNavCodes.NAV_CLOSE, this.level);
|
|
19812
|
+
};
|
|
19813
|
+
// TODO: Figure out whats the best way to do this. Possible methods
|
|
19814
|
+
// 1. HostListener (current solution)
|
|
19815
|
+
// 2. Directives on the .nav-link class. We discussed on moving away from class selectors but I forget the reason
|
|
19816
|
+
// why
|
|
19817
|
+
ClrNavLevel.prototype.onMouseClick = function (target) {
|
|
19818
|
+
var current = target; // Get the element in the DOM on which the mouse was clicked
|
|
19819
|
+
var navHost = this.elementRef.nativeElement; // Get the current nav native HTML element
|
|
19820
|
+
// Start checking if current and navHost are equal.
|
|
19821
|
+
// If not traverse to the parentNode and check again.
|
|
19822
|
+
while (current) {
|
|
19823
|
+
if (current === navHost) {
|
|
19824
|
+
return;
|
|
19825
|
+
}
|
|
19826
|
+
else if (current.classList.contains('nav-link')) {
|
|
19827
|
+
this.close();
|
|
19828
|
+
return;
|
|
19829
|
+
}
|
|
19830
|
+
current = current.parentNode;
|
|
19831
|
+
}
|
|
19832
|
+
};
|
|
19833
|
+
ClrNavLevel.prototype.hideNavigation = function () {
|
|
19834
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'true');
|
|
19835
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'hidden', 'true');
|
|
19836
|
+
};
|
|
19837
|
+
ClrNavLevel.prototype.showNavigation = function () {
|
|
19838
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'false');
|
|
19839
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'hidden');
|
|
19840
|
+
};
|
|
19841
|
+
ClrNavLevel.prototype.hideCloseButton = function () {
|
|
19842
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-hidden', 'true');
|
|
19843
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'hidden', 'true');
|
|
19844
|
+
};
|
|
19845
|
+
ClrNavLevel.prototype.showCloseButton = function () {
|
|
19846
|
+
this.renderer.setAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'aria-hidden', 'false');
|
|
19847
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement.querySelector('.clr-nav-close'), 'hidden');
|
|
19848
|
+
};
|
|
19849
|
+
ClrNavLevel.prototype.ngOnDestroy = function () {
|
|
19850
|
+
this.responsiveNavService.unregisterNav(this.level);
|
|
19851
|
+
this._subscription.unsubscribe();
|
|
19852
|
+
};
|
|
19853
|
+
return ClrNavLevel;
|
|
19854
|
+
}(FocusTrap));
|
|
19855
|
+
ClrNavLevel.decorators = [
|
|
19856
|
+
{ type: i0.Directive, args: [{ selector: '[clr-nav-level]' },] }
|
|
19857
|
+
];
|
|
19858
|
+
ClrNavLevel.ctorParameters = function () { return [
|
|
19859
|
+
{ type: undefined, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] },
|
|
19860
|
+
{ type: ResponsiveNavigationService },
|
|
19861
|
+
{ type: i0.ElementRef },
|
|
19862
|
+
{ type: i0.Renderer2 },
|
|
19863
|
+
{ type: i0.Injector }
|
|
19864
|
+
]; };
|
|
19865
|
+
ClrNavLevel.propDecorators = {
|
|
19866
|
+
_level: [{ type: i0.Input, args: ['clr-nav-level',] }],
|
|
19867
|
+
closeButtonAriaLabel: [{ type: i0.Input, args: ['closeAriaLabel',] }],
|
|
19868
|
+
onResize: [{ type: i0.HostListener, args: ['window:resize', ['$event'],] }],
|
|
19869
|
+
onMouseClick: [{ type: i0.HostListener, args: ['click', ['$event.target'],] }]
|
|
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
|
+
var CLR_NAVIGATION_DIRECTIVES = [
|
|
19878
|
+
ClrHeader,
|
|
19879
|
+
ClrNavLevel,
|
|
19880
|
+
NavDetectionOompaLoompa,
|
|
19881
|
+
MainContainerWillyWonka,
|
|
19882
|
+
];
|
|
19883
|
+
var ClrNavigationModule = /** @class */ (function () {
|
|
19884
|
+
function ClrNavigationModule() {
|
|
19885
|
+
}
|
|
19886
|
+
return ClrNavigationModule;
|
|
19887
|
+
}());
|
|
19888
|
+
ClrNavigationModule.decorators = [
|
|
19889
|
+
{ type: i0.NgModule, args: [{
|
|
19890
|
+
imports: [i1.CommonModule, ClrIconModule, ClrDropdownModule],
|
|
19891
|
+
declarations: [CLR_NAVIGATION_DIRECTIVES],
|
|
19892
|
+
exports: [CLR_NAVIGATION_DIRECTIVES],
|
|
19893
|
+
},] }
|
|
19894
|
+
];
|
|
19895
|
+
|
|
19896
|
+
/*
|
|
19897
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19898
|
+
* This software is released under MIT license.
|
|
19899
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19900
|
+
*/
|
|
19901
|
+
var TemplateRefContainer = /** @class */ (function () {
|
|
19902
|
+
function TemplateRefContainer() {
|
|
19903
|
+
}
|
|
19904
|
+
return TemplateRefContainer;
|
|
19905
|
+
}());
|
|
19906
|
+
TemplateRefContainer.decorators = [
|
|
19907
|
+
{ type: i0.Component, args: [{
|
|
19908
|
+
template: "\n <ng-template>\n <ng-content></ng-content>\n </ng-template>\n "
|
|
19909
|
+
},] }
|
|
19910
|
+
];
|
|
19911
|
+
TemplateRefContainer.propDecorators = {
|
|
19912
|
+
template: [{ type: i0.ViewChild, args: [i0.TemplateRef,] }]
|
|
19913
|
+
};
|
|
19914
|
+
|
|
19915
|
+
/*
|
|
19916
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19917
|
+
* This software is released under MIT license.
|
|
19918
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19919
|
+
*/
|
|
19920
|
+
var TEMPLATE_REF_DIRECTIVES = [TemplateRefContainer];
|
|
19921
|
+
|
|
19922
|
+
/*
|
|
19923
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19924
|
+
* This software is released under MIT license.
|
|
19925
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19926
|
+
*/
|
|
19927
|
+
var ClrTemplateRefModule = /** @class */ (function () {
|
|
19928
|
+
function ClrTemplateRefModule() {
|
|
19929
|
+
}
|
|
19930
|
+
return ClrTemplateRefModule;
|
|
19931
|
+
}());
|
|
19932
|
+
ClrTemplateRefModule.decorators = [
|
|
19933
|
+
{ type: i0.NgModule, args: [{
|
|
19934
|
+
imports: [i1.CommonModule],
|
|
19935
|
+
declarations: [TEMPLATE_REF_DIRECTIVES],
|
|
19936
|
+
entryComponents: [TEMPLATE_REF_DIRECTIVES],
|
|
19937
|
+
exports: [TEMPLATE_REF_DIRECTIVES],
|
|
19938
|
+
},] }
|
|
19939
|
+
];
|
|
19940
|
+
|
|
19941
|
+
var TabsWillyWonka = /** @class */ (function (_super) {
|
|
19942
|
+
__extends(TabsWillyWonka, _super);
|
|
19943
|
+
function TabsWillyWonka() {
|
|
19944
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
19945
|
+
}
|
|
19946
|
+
return TabsWillyWonka;
|
|
19947
|
+
}(WillyWonka));
|
|
19948
|
+
TabsWillyWonka.decorators = [
|
|
19949
|
+
{ type: i0.Directive, args: [{ selector: 'clr-tabs' },] }
|
|
19950
|
+
];
|
|
19951
|
+
|
|
19952
|
+
var ActiveOompaLoompa = /** @class */ (function (_super) {
|
|
19953
|
+
__extends(ActiveOompaLoompa, _super);
|
|
19954
|
+
function ActiveOompaLoompa(cdr, willyWonka, id, ifActive) {
|
|
19955
|
+
var _this = this;
|
|
19956
|
+
if (!willyWonka) {
|
|
19957
|
+
throw new Error('clrTabLink and clr-tab-content should only be used inside of a clr-tabs');
|
|
19958
|
+
}
|
|
19959
|
+
_this = _super.call(this, cdr, willyWonka) || this;
|
|
19960
|
+
_this.ifActive = ifActive;
|
|
19961
|
+
_this.id = id;
|
|
19962
|
+
return _this;
|
|
19963
|
+
}
|
|
19964
|
+
Object.defineProperty(ActiveOompaLoompa.prototype, "flavor", {
|
|
19965
|
+
get: function () {
|
|
19966
|
+
return this.ifActive.current === this.id;
|
|
19967
|
+
},
|
|
19968
|
+
enumerable: false,
|
|
19969
|
+
configurable: true
|
|
19970
|
+
});
|
|
19971
|
+
return ActiveOompaLoompa;
|
|
19972
|
+
}(OompaLoompa));
|
|
19973
|
+
ActiveOompaLoompa.decorators = [
|
|
19974
|
+
{ type: i0.Directive, args: [{ selector: '[clrTabLink], clr-tab-content' },] }
|
|
19975
|
+
];
|
|
19976
|
+
ActiveOompaLoompa.ctorParameters = function () { return [
|
|
19977
|
+
{ type: i0.ChangeDetectorRef },
|
|
19978
|
+
{ type: TabsWillyWonka, decorators: [{ type: i0.Optional }] },
|
|
19979
|
+
{ type: Number, decorators: [{ type: i0.Inject, args: [IF_ACTIVE_ID,] }] },
|
|
19980
|
+
{ type: IfActiveService }
|
|
19981
|
+
]; };
|
|
19982
|
+
|
|
19983
|
+
/*
|
|
19984
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19985
|
+
* This software is released under MIT license.
|
|
19986
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19987
|
+
*/
|
|
19988
|
+
var TabsLayout;
|
|
19989
|
+
(function (TabsLayout) {
|
|
19990
|
+
TabsLayout["HORIZONTAL"] = "horizontal";
|
|
19991
|
+
TabsLayout["VERTICAL"] = "vertical";
|
|
19992
|
+
})(TabsLayout || (TabsLayout = {}));
|
|
19993
|
+
|
|
19994
|
+
/*
|
|
19995
|
+
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
19996
|
+
* This software is released under MIT license.
|
|
19997
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
19998
|
+
*/
|
|
19999
|
+
var TabsService = /** @class */ (function () {
|
|
20000
|
+
function TabsService() {
|
|
20001
|
+
this._children = [];
|
|
20002
|
+
this.layout = TabsLayout.HORIZONTAL;
|
|
20003
|
+
}
|
|
20004
|
+
TabsService.prototype.register = function (tab) {
|
|
20005
|
+
this._children.push(tab);
|
|
19379
20006
|
};
|
|
19380
20007
|
Object.defineProperty(TabsService.prototype, "children", {
|
|
19381
20008
|
get: function () {
|
|
@@ -23422,7 +24049,14 @@
|
|
|
23422
24049
|
};
|
|
23423
24050
|
ClrWizard.prototype.listenForPageChanges = function () {
|
|
23424
24051
|
var _this = this;
|
|
23425
|
-
return this.navService.currentPageChanged.subscribe(function () {
|
|
24052
|
+
return this.navService.currentPageChanged.subscribe(function () {
|
|
24053
|
+
var _a;
|
|
24054
|
+
// Added to address VPAT-749:
|
|
24055
|
+
// When clicking on a wizard tab, focus should move to that
|
|
24056
|
+
// tabs content to make the wizard more accessible.
|
|
24057
|
+
(_a = _this.wizardTitle) === null || _a === void 0 ? void 0 : _a.nativeElement.focus();
|
|
24058
|
+
_this.currentPageChanged.emit();
|
|
24059
|
+
});
|
|
23426
24060
|
};
|
|
23427
24061
|
ClrWizard.prototype.updateNavOnPageChanges = function () {
|
|
23428
24062
|
var _this = this;
|
|
@@ -23980,13 +24614,6 @@
|
|
|
23980
24614
|
{ type: i0.Injectable }
|
|
23981
24615
|
];
|
|
23982
24616
|
|
|
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
24617
|
/*
|
|
23991
24618
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
23992
24619
|
* This software is released under MIT license.
|
|
@@ -25251,119 +25878,17 @@
|
|
|
25251
25878
|
ClrButtonModule,
|
|
25252
25879
|
ClrFormsModule,
|
|
25253
25880
|
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
|
-
*/
|
|
25881
|
+
ClrPopoverModule,
|
|
25882
|
+
ClrWizardModule,
|
|
25883
|
+
ClrDragAndDropModule,
|
|
25884
|
+
ClrStepperModule,
|
|
25885
|
+
ClrSpinnerModule,
|
|
25886
|
+
ClrProgressBarModule,
|
|
25887
|
+
ClrPopoverModuleNext,
|
|
25888
|
+
ClrTimelineModule,
|
|
25889
|
+
],
|
|
25890
|
+
},] }
|
|
25891
|
+
];
|
|
25367
25892
|
|
|
25368
25893
|
/*
|
|
25369
25894
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25442,16 +25967,6 @@
|
|
|
25442
25967
|
* This software is released under MIT license.
|
|
25443
25968
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25444
25969
|
*/
|
|
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
25970
|
|
|
25456
25971
|
/*
|
|
25457
25972
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25482,14 +25997,6 @@
|
|
|
25482
25997
|
* This software is released under MIT license.
|
|
25483
25998
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25484
25999
|
*/
|
|
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
26000
|
|
|
25494
26001
|
/*
|
|
25495
26002
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25502,13 +26009,6 @@
|
|
|
25502
26009
|
* This software is released under MIT license.
|
|
25503
26010
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25504
26011
|
*/
|
|
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
26012
|
|
|
25513
26013
|
/*
|
|
25514
26014
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25521,28 +26021,6 @@
|
|
|
25521
26021
|
* This software is released under MIT license.
|
|
25522
26022
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25523
26023
|
*/
|
|
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
26024
|
|
|
25547
26025
|
/*
|
|
25548
26026
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25555,28 +26033,6 @@
|
|
|
25555
26033
|
* This software is released under MIT license.
|
|
25556
26034
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25557
26035
|
*/
|
|
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
26036
|
|
|
25581
26037
|
/*
|
|
25582
26038
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -25613,174 +26069,16 @@
|
|
|
25613
26069
|
* This software is released under MIT license.
|
|
25614
26070
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
25615
26071
|
*/
|
|
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
|
-
},] }
|
|
26072
|
+
var CLR_MENU_POSITIONS = [
|
|
26073
|
+
'bottom-left',
|
|
26074
|
+
'bottom-right',
|
|
26075
|
+
'top-left',
|
|
26076
|
+
'top-right',
|
|
26077
|
+
'left-bottom',
|
|
26078
|
+
'left-top',
|
|
26079
|
+
'right-bottom',
|
|
26080
|
+
'right-top',
|
|
25766
26081
|
];
|
|
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
26082
|
|
|
25785
26083
|
/*
|
|
25786
26084
|
* Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
|
|
@@ -26131,6 +26429,7 @@
|
|
|
26131
26429
|
exports["ÇlrWrappedCell"] = WrappedCell;
|
|
26132
26430
|
exports["ÇlrWrappedColumn"] = WrappedColumn;
|
|
26133
26431
|
exports["ÇlrWrappedRow"] = WrappedRow;
|
|
26432
|
+
exports["ɵ0"] = ɵ0;
|
|
26134
26433
|
exports["ɵa"] = domAdapterFactory;
|
|
26135
26434
|
exports["ɵb"] = LayoutService;
|
|
26136
26435
|
exports["ɵba"] = AlertIconAndTypesService;
|
|
@@ -26209,29 +26508,30 @@
|
|
|
26209
26508
|
exports["ɵdu"] = ScrollingService;
|
|
26210
26509
|
exports["ɵdv"] = ButtonInGroupService;
|
|
26211
26510
|
exports["ɵdw"] = ResponsiveNavigationService;
|
|
26212
|
-
exports["
|
|
26213
|
-
exports["
|
|
26214
|
-
exports["ɵdz"] = TemplateRefContainer;
|
|
26511
|
+
exports["ɵdy"] = FocusTrap;
|
|
26512
|
+
exports["ɵdz"] = ClrTemplateRefModule;
|
|
26215
26513
|
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"] =
|
|
26514
|
+
exports["ɵea"] = TEMPLATE_REF_DIRECTIVES;
|
|
26515
|
+
exports["ɵeb"] = TemplateRefContainer;
|
|
26516
|
+
exports["ɵec"] = TabsService;
|
|
26517
|
+
exports["ɵed"] = TABS_ID;
|
|
26518
|
+
exports["ɵee"] = tokenFactory;
|
|
26519
|
+
exports["ɵef"] = TABS_ID_PROVIDER;
|
|
26520
|
+
exports["ɵeg"] = VerticalNavService;
|
|
26521
|
+
exports["ɵeh"] = VerticalNavIconService;
|
|
26522
|
+
exports["ɵei"] = VerticalNavGroupRegistrationService;
|
|
26523
|
+
exports["ɵej"] = VerticalNavGroupService;
|
|
26524
|
+
exports["ɵek"] = TooltipIdService;
|
|
26525
|
+
exports["ɵel"] = WizardNavigationService;
|
|
26526
|
+
exports["ɵem"] = PageCollectionService;
|
|
26527
|
+
exports["ɵen"] = ButtonHubService;
|
|
26528
|
+
exports["ɵeo"] = HeaderActionService;
|
|
26529
|
+
exports["ɵep"] = AccordionService;
|
|
26530
|
+
exports["ɵeq"] = panelAnimation;
|
|
26531
|
+
exports["ɵer"] = stepAnimation;
|
|
26532
|
+
exports["ɵes"] = defaultAnimationTiming;
|
|
26533
|
+
exports["ɵet"] = StepperService;
|
|
26534
|
+
exports["ɵeu"] = TimelineIconAttributeService;
|
|
26235
26535
|
exports["ɵf"] = clrRootDropdownFactory;
|
|
26236
26536
|
exports["ɵg"] = ROOT_DROPDOWN_PROVIDER;
|
|
26237
26537
|
exports["ɵh"] = POPOVER_HOST_ANCHOR;
|