@rossigee/clarity-angular 18.2.1-fixed → 18.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/clr-angular-accordion.mjs +355 -0
- package/fesm2022/clr-angular-accordion.mjs.map +1 -0
- package/fesm2022/clr-angular-button.mjs +713 -0
- package/fesm2022/clr-angular-button.mjs.map +1 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs +201 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs.map +1 -0
- package/fesm2022/clr-angular-data-datagrid.mjs +7635 -0
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -0
- package/fesm2022/clr-angular-data-stack-view.mjs +442 -0
- package/fesm2022/clr-angular-data-stack-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data-tree-view.mjs +1106 -0
- package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data.mjs +40 -0
- package/fesm2022/clr-angular-data.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs +624 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs +69 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-common.mjs +25 -0
- package/fesm2022/clr-angular-emphasis-common.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-label.mjs +105 -0
- package/fesm2022/clr-angular-emphasis-label.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis.mjs +41 -0
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs +270 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-combobox.mjs +1775 -0
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-common.mjs +1251 -0
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datalist.mjs +263 -0
- package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs +3274 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-file-input.mjs +826 -0
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-input.mjs +153 -0
- package/fesm2022/clr-angular-forms-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-number-input.mjs +236 -0
- package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-password.mjs +233 -0
- package/fesm2022/clr-angular-forms-password.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-radio.mjs +231 -0
- package/fesm2022/clr-angular-forms-radio.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-range.mjs +186 -0
- package/fesm2022/clr-angular-forms-range.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-select.mjs +153 -0
- package/fesm2022/clr-angular-forms-select.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-textarea.mjs +136 -0
- package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -0
- package/fesm2022/clr-angular-forms.mjs +100 -0
- package/fesm2022/clr-angular-forms.mjs.map +1 -0
- package/fesm2022/clr-angular-icon.mjs +7397 -0
- package/fesm2022/clr-angular-icon.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs +120 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-main-container.mjs +100 -0
- package/fesm2022/clr-angular-layout-main-container.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-nav.mjs +582 -0
- package/fesm2022/clr-angular-layout-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-tabs.mjs +807 -0
- package/fesm2022/clr-angular-layout-tabs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs +507 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout.mjs +44 -0
- package/fesm2022/clr-angular-layout.mjs.map +1 -0
- package/fesm2022/clr-angular-modal.mjs +617 -0
- package/fesm2022/clr-angular-modal.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-common.mjs +1082 -0
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs +492 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-signpost.mjs +494 -0
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs +293 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -0
- package/fesm2022/clr-angular-popover.mjs +41 -0
- package/fesm2022/clr-angular-popover.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs +217 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-spinner.mjs +132 -0
- package/fesm2022/clr-angular-progress-spinner.mjs.map +1 -0
- package/fesm2022/clr-angular-stepper.mjs +694 -0
- package/fesm2022/clr-angular-stepper.mjs.map +1 -0
- package/fesm2022/clr-angular-timeline.mjs +316 -0
- package/fesm2022/clr-angular-timeline.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-conditional.mjs +351 -0
- package/fesm2022/clr-angular-utils-conditional.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-loading.mjs +107 -0
- package/fesm2022/clr-angular-utils-loading.mjs.map +1 -0
- package/fesm2022/clr-angular-utils.mjs +2079 -0
- package/fesm2022/clr-angular-utils.mjs.map +1 -0
- package/fesm2022/clr-angular-wizard.mjs +3074 -0
- package/fesm2022/clr-angular-wizard.mjs.map +1 -0
- package/fesm2022/{rossigee-clarity-angular.mjs → clr-angular.mjs} +2 -2
- package/fesm2022/clr-angular.mjs.map +1 -0
- package/package.json +105 -103
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +69 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/migrations/css-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/css-migration.js +177 -0
- package/schematics/ng-update/migrations/css-migration.js.map +1 -0
- package/schematics/ng-update/migrations/import-migration.d.ts +4 -0
- package/schematics/ng-update/migrations/import-migration.js +187 -0
- package/schematics/ng-update/migrations/import-migration.js.map +1 -0
- package/schematics/ng-update/migrations/template-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/template-migration.js +261 -0
- package/schematics/ng-update/migrations/template-migration.js.map +1 -0
- package/schematics/ng-update/replacements/css-replacements.d.ts +17 -0
- package/schematics/ng-update/replacements/css-replacements.js +74 -0
- package/schematics/ng-update/replacements/css-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/import-replacements.d.ts +13 -0
- package/schematics/ng-update/replacements/import-replacements.js +108 -0
- package/schematics/ng-update/replacements/import-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/symbol-replacements.d.ts +12 -0
- package/schematics/ng-update/replacements/symbol-replacements.js +67 -0
- package/schematics/ng-update/replacements/symbol-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/template-replacements.d.ts +19 -0
- package/schematics/ng-update/replacements/template-replacements.js +57 -0
- package/schematics/ng-update/replacements/template-replacements.js.map +1 -0
- package/schematics/ng-update/tests/test-helpers.d.ts +6 -0
- package/schematics/ng-update/tests/test-helpers.js +34 -0
- package/schematics/ng-update/tests/test-helpers.js.map +1 -0
- package/schematics/ng-update/utils/file-visitor.d.ts +8 -0
- package/schematics/ng-update/utils/file-visitor.js +44 -0
- package/schematics/ng-update/utils/file-visitor.js.map +1 -0
- package/schematics/ng-update/utils/regexp-utils.d.ts +16 -0
- package/schematics/ng-update/utils/regexp-utils.js +34 -0
- package/schematics/ng-update/utils/regexp-utils.js.map +1 -0
- package/schematics/vitest.config.d.ts +2 -0
- package/schematics/vitest.config.js +17 -0
- package/schematics/vitest.config.js.map +1 -0
- package/types/clr-angular-accordion.d.ts +100 -0
- package/types/clr-angular-button.d.ts +169 -0
- package/types/clr-angular-collapsible-panel.d.ts +73 -0
- package/types/clr-angular-data-datagrid.d.ts +1843 -0
- package/types/clr-angular-data-stack-view.d.ts +87 -0
- package/types/clr-angular-data-tree-view.d.ts +229 -0
- package/types/clr-angular-data.d.ts +15 -0
- package/types/clr-angular-emphasis-alert.d.ts +175 -0
- package/types/clr-angular-emphasis-badge.d.ts +25 -0
- package/types/clr-angular-emphasis-common.d.ts +6 -0
- package/types/clr-angular-emphasis-label.d.ts +29 -0
- package/types/clr-angular-emphasis.d.ts +15 -0
- package/types/clr-angular-forms-checkbox.d.ts +69 -0
- package/types/clr-angular-forms-combobox.d.ts +353 -0
- package/types/clr-angular-forms-common.d.ts +339 -0
- package/types/clr-angular-forms-datalist.d.ts +59 -0
- package/types/clr-angular-forms-datepicker.d.ts +986 -0
- package/types/clr-angular-forms-file-input.d.ts +193 -0
- package/types/clr-angular-forms-input.d.ts +29 -0
- package/types/clr-angular-forms-number-input.d.ts +43 -0
- package/types/clr-angular-forms-password.d.ts +52 -0
- package/types/clr-angular-forms-radio.d.ts +50 -0
- package/types/clr-angular-forms-range.d.ts +37 -0
- package/types/clr-angular-forms-select.d.ts +36 -0
- package/types/clr-angular-forms-textarea.d.ts +29 -0
- package/types/clr-angular-forms.d.ts +36 -0
- package/types/clr-angular-icon.d.ts +1498 -0
- package/types/clr-angular-layout-breadcrumbs.d.ts +45 -0
- package/types/clr-angular-layout-main-container.d.ts +28 -0
- package/types/clr-angular-layout-nav.d.ts +142 -0
- package/types/clr-angular-layout-tabs.d.ts +158 -0
- package/types/clr-angular-layout-vertical-nav.d.ts +128 -0
- package/types/clr-angular-layout.d.ts +19 -0
- package/types/clr-angular-modal.d.ts +160 -0
- package/types/clr-angular-popover-common.d.ts +254 -0
- package/types/clr-angular-popover-dropdown.d.ts +123 -0
- package/types/clr-angular-popover-signpost.d.ts +157 -0
- package/types/clr-angular-popover-tooltip.d.ts +83 -0
- package/types/clr-angular-popover.d.ts +16 -0
- package/types/clr-angular-progress-progress-bars.d.ts +57 -0
- package/types/clr-angular-progress-spinner.d.ts +44 -0
- package/types/clr-angular-stepper.d.ts +179 -0
- package/types/clr-angular-timeline.d.ts +86 -0
- package/types/clr-angular-utils-conditional.d.ts +132 -0
- package/types/clr-angular-utils-loading.d.ts +38 -0
- package/types/clr-angular-utils.d.ts +913 -0
- package/types/clr-angular-wizard.d.ts +1508 -0
- package/fesm2022/rossigee-clarity-angular.mjs.map +0 -1
- /package/types/{rossigee-clarity-angular.d.ts → clr-angular.d.ts} +0 -0
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Input, Output, Optional, Component, Directive, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@clr/angular/utils';
|
|
4
|
+
import { Subject } from 'rxjs';
|
|
5
|
+
import * as i4 from '@angular/common';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import * as i5 from '@clr/angular/icon';
|
|
8
|
+
import { ClarityIcons, errorStandardIcon, helpIcon, infoStandardIcon, noteIcon, successStandardIcon, warningStandardIcon, windowCloseIcon, ClrIcon } from '@clr/angular/icon';
|
|
9
|
+
import * as i3 from '@clr/angular/progress/spinner';
|
|
10
|
+
import { ClrSpinnerModule } from '@clr/angular/progress/spinner';
|
|
11
|
+
import { ClrDropdownModule } from '@clr/angular/popover/dropdown';
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
15
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
16
|
+
* This software is released under MIT license.
|
|
17
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
18
|
+
*/
|
|
19
|
+
// @TODO Make this an enum
|
|
20
|
+
const ALERT_TYPES = ['info', 'warning', 'danger', 'success', 'neutral', 'unknown', 'loading'];
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
24
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
25
|
+
* This software is released under MIT license.
|
|
26
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
27
|
+
*/
|
|
28
|
+
class AlertIconAndTypesService {
|
|
29
|
+
constructor(commonStrings) {
|
|
30
|
+
this.commonStrings = commonStrings;
|
|
31
|
+
this.defaultIconShape = 'info-standard';
|
|
32
|
+
this._alertIconShape = '';
|
|
33
|
+
this._alertType = 'info';
|
|
34
|
+
}
|
|
35
|
+
get alertType() {
|
|
36
|
+
return this._alertType;
|
|
37
|
+
}
|
|
38
|
+
set alertType(val) {
|
|
39
|
+
if (ALERT_TYPES.indexOf(val) > -1) {
|
|
40
|
+
this._alertType = val;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
get alertIconShape() {
|
|
44
|
+
if ('' === this._alertIconShape) {
|
|
45
|
+
return this.iconInfoFromType(this._alertType).shape;
|
|
46
|
+
}
|
|
47
|
+
return this._alertIconShape;
|
|
48
|
+
}
|
|
49
|
+
set alertIconShape(val) {
|
|
50
|
+
if (!val) {
|
|
51
|
+
this._alertIconShape = '';
|
|
52
|
+
}
|
|
53
|
+
else if (val !== this._alertIconShape) {
|
|
54
|
+
this._alertIconShape = val;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
get alertIconTitle() {
|
|
58
|
+
return this.iconInfoFromType(this._alertType).title;
|
|
59
|
+
}
|
|
60
|
+
iconInfoFromType(type) {
|
|
61
|
+
const returnObj = { shape: '', cssClass: '', title: '' };
|
|
62
|
+
switch (type) {
|
|
63
|
+
case 'warning':
|
|
64
|
+
returnObj.shape = 'warning-standard';
|
|
65
|
+
returnObj.cssClass = 'alert-warning';
|
|
66
|
+
returnObj.title = this.commonStrings.keys.warning;
|
|
67
|
+
break;
|
|
68
|
+
case 'danger':
|
|
69
|
+
returnObj.shape = 'error-standard';
|
|
70
|
+
returnObj.cssClass = 'alert-danger';
|
|
71
|
+
returnObj.title = this.commonStrings.keys.danger;
|
|
72
|
+
break;
|
|
73
|
+
case 'success':
|
|
74
|
+
returnObj.shape = 'success-standard';
|
|
75
|
+
returnObj.cssClass = 'alert-success';
|
|
76
|
+
returnObj.title = this.commonStrings.keys.success;
|
|
77
|
+
break;
|
|
78
|
+
case 'neutral':
|
|
79
|
+
returnObj.shape = 'note';
|
|
80
|
+
returnObj.cssClass = 'alert-neutral';
|
|
81
|
+
returnObj.title = this.commonStrings.keys.neutral;
|
|
82
|
+
break;
|
|
83
|
+
case 'unknown':
|
|
84
|
+
returnObj.shape = 'help';
|
|
85
|
+
returnObj.cssClass = 'alert-neutral';
|
|
86
|
+
returnObj.title = this.commonStrings.keys.unknown;
|
|
87
|
+
break;
|
|
88
|
+
case 'loading':
|
|
89
|
+
returnObj.shape = 'loading';
|
|
90
|
+
returnObj.cssClass = 'alert-neutral';
|
|
91
|
+
returnObj.title = this.commonStrings.keys.unknown;
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
returnObj.shape = this.defaultIconShape;
|
|
95
|
+
returnObj.cssClass = 'alert-info';
|
|
96
|
+
returnObj.title = this.commonStrings.keys.info;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
return returnObj;
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AlertIconAndTypesService, deps: [{ token: i1.ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
102
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AlertIconAndTypesService }); }
|
|
103
|
+
}
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AlertIconAndTypesService, decorators: [{
|
|
105
|
+
type: Injectable
|
|
106
|
+
}], ctorParameters: () => [{ type: i1.ClrCommonStringsService }] });
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
110
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
111
|
+
* This software is released under MIT license.
|
|
112
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
113
|
+
*/
|
|
114
|
+
class MultiAlertService {
|
|
115
|
+
constructor() {
|
|
116
|
+
this._change = new Subject();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The Observable that lets other classes subscribe to changes
|
|
120
|
+
*/
|
|
121
|
+
get changes() {
|
|
122
|
+
return this._change.asObservable();
|
|
123
|
+
}
|
|
124
|
+
get current() {
|
|
125
|
+
return this._current;
|
|
126
|
+
}
|
|
127
|
+
set current(index) {
|
|
128
|
+
if (index !== this._current) {
|
|
129
|
+
this._current = index;
|
|
130
|
+
this._change.next(index);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
get activeAlerts() {
|
|
134
|
+
return this.allAlerts && this.allAlerts.filter(alert => !alert._closed);
|
|
135
|
+
}
|
|
136
|
+
get currentAlert() {
|
|
137
|
+
return this.activeAlerts && this.activeAlerts[this.current];
|
|
138
|
+
}
|
|
139
|
+
set currentAlert(alert) {
|
|
140
|
+
this.current = this.activeAlerts.indexOf(alert);
|
|
141
|
+
}
|
|
142
|
+
get count() {
|
|
143
|
+
return (this.activeAlerts && this.activeAlerts.length) || 0;
|
|
144
|
+
}
|
|
145
|
+
manage(alerts) {
|
|
146
|
+
if (this.subscription) {
|
|
147
|
+
this.subscription.unsubscribe();
|
|
148
|
+
}
|
|
149
|
+
this.allAlerts = alerts;
|
|
150
|
+
// After receiving alerts' QueryList,
|
|
151
|
+
// we are picking index 0 as current by default if a user hasn't any index
|
|
152
|
+
this.current = typeof this._current === 'number' ? this._current : 0;
|
|
153
|
+
// we have to also broadcast that initial index
|
|
154
|
+
this._change.next(this.current);
|
|
155
|
+
this.subscription = this.allAlerts.changes.subscribe(() => {
|
|
156
|
+
if (this.current >= this.allAlerts.length) {
|
|
157
|
+
this.current = Math.max(0, this.allAlerts.length - 1);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
next() {
|
|
162
|
+
this._current = this.current === this.activeAlerts.length - 1 ? 0 : this.current + 1;
|
|
163
|
+
this._change.next(this._current);
|
|
164
|
+
}
|
|
165
|
+
previous() {
|
|
166
|
+
if (this.activeAlerts.length === 0) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this._current = this.current === 0 ? this.activeAlerts.length - 1 : this.current - 1;
|
|
170
|
+
this._change.next(this._current);
|
|
171
|
+
}
|
|
172
|
+
open() {
|
|
173
|
+
if (this.activeAlerts.length === 0) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (!this.currentAlert) {
|
|
177
|
+
this._current = 0;
|
|
178
|
+
}
|
|
179
|
+
this._change.next(this._current);
|
|
180
|
+
}
|
|
181
|
+
close(isCurrentAlert) {
|
|
182
|
+
if (this.activeAlerts.length === 0) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (isCurrentAlert) {
|
|
186
|
+
this._current = Math.max(0, this.current - 1);
|
|
187
|
+
}
|
|
188
|
+
this._change.next(this._current);
|
|
189
|
+
}
|
|
190
|
+
destroy() {
|
|
191
|
+
if (this.subscription) {
|
|
192
|
+
this.subscription.unsubscribe();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MultiAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
196
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MultiAlertService }); }
|
|
197
|
+
}
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: MultiAlertService, decorators: [{
|
|
199
|
+
type: Injectable
|
|
200
|
+
}] });
|
|
201
|
+
|
|
202
|
+
/*
|
|
203
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
204
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
205
|
+
* This software is released under MIT license.
|
|
206
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
207
|
+
*/
|
|
208
|
+
class ClrAlert {
|
|
209
|
+
constructor(iconService, cdr, multiAlertService, commonStrings, renderer, hostElement) {
|
|
210
|
+
this.iconService = iconService;
|
|
211
|
+
this.cdr = cdr;
|
|
212
|
+
this.multiAlertService = multiAlertService;
|
|
213
|
+
this.commonStrings = commonStrings;
|
|
214
|
+
this.renderer = renderer;
|
|
215
|
+
this.hostElement = hostElement;
|
|
216
|
+
this.isSmall = false;
|
|
217
|
+
this.closable = true;
|
|
218
|
+
this.isAppLevel = false;
|
|
219
|
+
this.clrCloseButtonAriaLabel = this.commonStrings.keys.alertCloseButtonAriaLabel;
|
|
220
|
+
this._closedChanged = new EventEmitter(false);
|
|
221
|
+
this._closed = false;
|
|
222
|
+
this.subscriptions = [];
|
|
223
|
+
this._isLightweight = false;
|
|
224
|
+
}
|
|
225
|
+
get isLightweight() {
|
|
226
|
+
return this._isLightweight;
|
|
227
|
+
}
|
|
228
|
+
set isLightweight(val) {
|
|
229
|
+
this._isLightweight = val;
|
|
230
|
+
this.configAlertType(this._origAlertType);
|
|
231
|
+
}
|
|
232
|
+
get alertType() {
|
|
233
|
+
return this.iconService.alertType;
|
|
234
|
+
}
|
|
235
|
+
set alertType(val) {
|
|
236
|
+
this._origAlertType = val;
|
|
237
|
+
this.configAlertType(val);
|
|
238
|
+
}
|
|
239
|
+
set alertIconShape(value) {
|
|
240
|
+
this.iconService.alertIconShape = value;
|
|
241
|
+
}
|
|
242
|
+
set closed(value) {
|
|
243
|
+
if (value && !this._closed) {
|
|
244
|
+
this.close();
|
|
245
|
+
}
|
|
246
|
+
else if (!value && this._closed) {
|
|
247
|
+
this.open();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
get alertClass() {
|
|
251
|
+
return this.iconService.iconInfoFromType(this.iconService.alertType).cssClass;
|
|
252
|
+
}
|
|
253
|
+
get hidden() {
|
|
254
|
+
return this._hidden;
|
|
255
|
+
}
|
|
256
|
+
set hidden(value) {
|
|
257
|
+
if (value !== this._hidden) {
|
|
258
|
+
this._hidden = value;
|
|
259
|
+
// CDE-1249 @HostBinding('class.alert-hidden') decoration will raise error in console https://angular.io/errors/NG0100
|
|
260
|
+
if (this._hidden) {
|
|
261
|
+
this.renderer.addClass(this.hostElement.nativeElement, 'alert-hidden');
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
this.renderer.removeClass(this.hostElement.nativeElement, 'alert-hidden');
|
|
265
|
+
}
|
|
266
|
+
this.cdr.detectChanges();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
ngOnInit() {
|
|
270
|
+
if (this.multiAlertService) {
|
|
271
|
+
this.subscriptions.push(this.multiAlertService.changes.subscribe(() => {
|
|
272
|
+
this.hidden = this.multiAlertService.currentAlert !== this;
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
ngOnDestroy() {
|
|
277
|
+
this.subscriptions.forEach(sub => sub.unsubscribe());
|
|
278
|
+
}
|
|
279
|
+
configAlertType(val) {
|
|
280
|
+
this.iconService.alertType = val;
|
|
281
|
+
}
|
|
282
|
+
open() {
|
|
283
|
+
this._closed = false;
|
|
284
|
+
if (this.multiAlertService) {
|
|
285
|
+
this.multiAlertService.open();
|
|
286
|
+
}
|
|
287
|
+
this._closedChanged.emit(false);
|
|
288
|
+
}
|
|
289
|
+
close() {
|
|
290
|
+
if (!this.closable) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const isCurrentAlert = this.multiAlertService?.currentAlert === this;
|
|
294
|
+
this._closed = true;
|
|
295
|
+
if (this.multiAlertService?.activeAlerts) {
|
|
296
|
+
this.multiAlertService.close(isCurrentAlert);
|
|
297
|
+
}
|
|
298
|
+
this._closedChanged.emit(true);
|
|
299
|
+
}
|
|
300
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlert, deps: [{ token: AlertIconAndTypesService }, { token: i0.ChangeDetectorRef }, { token: MultiAlertService, optional: true }, { token: i1.ClrCommonStringsService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
301
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrAlert, isStandalone: false, selector: "clr-alert", inputs: { isSmall: ["clrAlertSizeSmall", "isSmall"], closable: ["clrAlertClosable", "closable"], isAppLevel: ["clrAlertAppLevel", "isAppLevel"], clrCloseButtonAriaLabel: "clrCloseButtonAriaLabel", isLightweight: ["clrAlertLightweight", "isLightweight"], alertType: ["clrAlertType", "alertType"], alertIconShape: ["clrAlertIcon", "alertIconShape"], closed: ["clrAlertClosed", "closed"] }, outputs: { _closedChanged: "clrAlertClosedChange" }, providers: [AlertIconAndTypesService], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n@if (!_closed) {\n<div\n class=\"alert\"\n [ngClass]=\"alertClass\"\n [class.alert-sm]=\"isSmall\"\n [class.alert-lightweight]=\"isLightweight\"\n [class.alert-app-level]=\"isAppLevel\"\n>\n <div class=\"alert-items\">\n <ng-content></ng-content>\n </div>\n @if (closable) {\n <button type=\"button\" class=\"close\" (click)=\"close()\" [attr.aria-label]=\"clrCloseButtonAriaLabel\">\n <cds-icon shape=\"times\"></cds-icon>\n </button>\n }\n</div>\n}\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }] }); }
|
|
302
|
+
}
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlert, decorators: [{
|
|
304
|
+
type: Component,
|
|
305
|
+
args: [{ selector: 'clr-alert', providers: [AlertIconAndTypesService], standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n@if (!_closed) {\n<div\n class=\"alert\"\n [ngClass]=\"alertClass\"\n [class.alert-sm]=\"isSmall\"\n [class.alert-lightweight]=\"isLightweight\"\n [class.alert-app-level]=\"isAppLevel\"\n>\n <div class=\"alert-items\">\n <ng-content></ng-content>\n </div>\n @if (closable) {\n <button type=\"button\" class=\"close\" (click)=\"close()\" [attr.aria-label]=\"clrCloseButtonAriaLabel\">\n <cds-icon shape=\"times\"></cds-icon>\n </button>\n }\n</div>\n}\n" }]
|
|
306
|
+
}], ctorParameters: () => [{ type: AlertIconAndTypesService }, { type: i0.ChangeDetectorRef }, { type: MultiAlertService, decorators: [{
|
|
307
|
+
type: Optional
|
|
308
|
+
}] }, { type: i1.ClrCommonStringsService }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { isSmall: [{
|
|
309
|
+
type: Input,
|
|
310
|
+
args: ['clrAlertSizeSmall']
|
|
311
|
+
}], closable: [{
|
|
312
|
+
type: Input,
|
|
313
|
+
args: ['clrAlertClosable']
|
|
314
|
+
}], isAppLevel: [{
|
|
315
|
+
type: Input,
|
|
316
|
+
args: ['clrAlertAppLevel']
|
|
317
|
+
}], clrCloseButtonAriaLabel: [{
|
|
318
|
+
type: Input
|
|
319
|
+
}], _closedChanged: [{
|
|
320
|
+
type: Output,
|
|
321
|
+
args: ['clrAlertClosedChange']
|
|
322
|
+
}], isLightweight: [{
|
|
323
|
+
type: Input,
|
|
324
|
+
args: ['clrAlertLightweight']
|
|
325
|
+
}], alertType: [{
|
|
326
|
+
type: Input,
|
|
327
|
+
args: ['clrAlertType']
|
|
328
|
+
}], alertIconShape: [{
|
|
329
|
+
type: Input,
|
|
330
|
+
args: ['clrAlertIcon']
|
|
331
|
+
}], closed: [{
|
|
332
|
+
type: Input,
|
|
333
|
+
args: ['clrAlertClosed']
|
|
334
|
+
}] } });
|
|
335
|
+
|
|
336
|
+
/*
|
|
337
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
338
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
339
|
+
* This software is released under MIT license.
|
|
340
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
341
|
+
*/
|
|
342
|
+
class ClrAlertItem {
|
|
343
|
+
constructor(iconService) {
|
|
344
|
+
this.iconService = iconService;
|
|
345
|
+
}
|
|
346
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertItem, deps: [{ token: AlertIconAndTypesService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
347
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrAlertItem, isStandalone: false, selector: "clr-alert-item", host: { classAttribute: "alert-item" }, ngImport: i0, template: `
|
|
348
|
+
<div class="alert-icon-wrapper">
|
|
349
|
+
@if (iconService.alertIconShape === 'loading') {
|
|
350
|
+
<clr-spinner class="alert-spinner" clrInline></clr-spinner>
|
|
351
|
+
}
|
|
352
|
+
@if (iconService.alertIconShape !== 'loading') {
|
|
353
|
+
<cds-icon
|
|
354
|
+
class="alert-icon"
|
|
355
|
+
role="img"
|
|
356
|
+
[shape]="iconService.alertIconShape"
|
|
357
|
+
[attr.aria-label]="iconService.alertIconTitle"
|
|
358
|
+
></cds-icon>
|
|
359
|
+
}
|
|
360
|
+
</div>
|
|
361
|
+
<ng-content></ng-content>
|
|
362
|
+
`, isInline: true, dependencies: [{ kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i3.ClrSpinner, selector: "clr-spinner", inputs: ["clrInline", "clrInverse", "clrSmall", "clrMedium"] }] }); }
|
|
363
|
+
}
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertItem, decorators: [{
|
|
365
|
+
type: Component,
|
|
366
|
+
args: [{
|
|
367
|
+
selector: 'clr-alert-item',
|
|
368
|
+
template: `
|
|
369
|
+
<div class="alert-icon-wrapper">
|
|
370
|
+
@if (iconService.alertIconShape === 'loading') {
|
|
371
|
+
<clr-spinner class="alert-spinner" clrInline></clr-spinner>
|
|
372
|
+
}
|
|
373
|
+
@if (iconService.alertIconShape !== 'loading') {
|
|
374
|
+
<cds-icon
|
|
375
|
+
class="alert-icon"
|
|
376
|
+
role="img"
|
|
377
|
+
[shape]="iconService.alertIconShape"
|
|
378
|
+
[attr.aria-label]="iconService.alertIconTitle"
|
|
379
|
+
></cds-icon>
|
|
380
|
+
}
|
|
381
|
+
</div>
|
|
382
|
+
<ng-content></ng-content>
|
|
383
|
+
`,
|
|
384
|
+
host: { class: 'alert-item' },
|
|
385
|
+
standalone: false,
|
|
386
|
+
}]
|
|
387
|
+
}], ctorParameters: () => [{ type: AlertIconAndTypesService }] });
|
|
388
|
+
|
|
389
|
+
/*
|
|
390
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
391
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
392
|
+
* This software is released under MIT license.
|
|
393
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
394
|
+
*/
|
|
395
|
+
/**
|
|
396
|
+
* @remark
|
|
397
|
+
* This directive is used only of selectin alert text.
|
|
398
|
+
*/
|
|
399
|
+
class ClrAlertText {
|
|
400
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertText, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
401
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrAlertText, isStandalone: false, selector: ".alert-text", ngImport: i0 }); }
|
|
402
|
+
}
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertText, decorators: [{
|
|
404
|
+
type: Directive,
|
|
405
|
+
args: [{
|
|
406
|
+
selector: '.alert-text',
|
|
407
|
+
standalone: false,
|
|
408
|
+
}]
|
|
409
|
+
}] });
|
|
410
|
+
|
|
411
|
+
/*
|
|
412
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
413
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
414
|
+
* This software is released under MIT license.
|
|
415
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
416
|
+
*/
|
|
417
|
+
class ClrAlertsPager {
|
|
418
|
+
constructor(multiAlertService, commonStrings) {
|
|
419
|
+
this.multiAlertService = multiAlertService;
|
|
420
|
+
this.commonStrings = commonStrings;
|
|
421
|
+
this.currentAlertChange = new EventEmitter(false);
|
|
422
|
+
this.currentAlertIndexChange = new EventEmitter();
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Input/Output to support two way binding on current alert instance
|
|
426
|
+
*/
|
|
427
|
+
get currentAlert() {
|
|
428
|
+
return this.multiAlertService.currentAlert;
|
|
429
|
+
}
|
|
430
|
+
set currentAlert(alert) {
|
|
431
|
+
if (alert) {
|
|
432
|
+
this.multiAlertService.currentAlert = alert;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Input/Output to support two way binding on current alert index
|
|
437
|
+
*/
|
|
438
|
+
get currentAlertIndex() {
|
|
439
|
+
return this.multiAlertService.current;
|
|
440
|
+
}
|
|
441
|
+
set currentAlertIndex(index) {
|
|
442
|
+
this.multiAlertService.current = index;
|
|
443
|
+
}
|
|
444
|
+
get previousAlertAriaLabel() {
|
|
445
|
+
const CURRENT = this.currentAlertIndex + 1;
|
|
446
|
+
return this.commonStrings.parse(this.commonStrings.keys.alertPreviousAlertAriaLabel, {
|
|
447
|
+
CURRENT: (CURRENT === 1 ? this.multiAlertService.count : CURRENT - 1).toString(),
|
|
448
|
+
COUNT: this.multiAlertService.count.toString(),
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
get nextAlertAriaLabel() {
|
|
452
|
+
const CURRENT = this.currentAlertIndex + 1;
|
|
453
|
+
return this.commonStrings.parse(this.commonStrings.keys.alertNextAlertAriaLabel, {
|
|
454
|
+
CURRENT: (CURRENT === this.multiAlertService.count ? 1 : CURRENT + 1).toString(),
|
|
455
|
+
COUNT: this.multiAlertService.count.toString(),
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
ngOnInit() {
|
|
459
|
+
this.multiAlertServiceChanges = this.multiAlertService.changes.subscribe(index => {
|
|
460
|
+
this.currentAlertIndexChange.emit(index);
|
|
461
|
+
this.currentAlertChange.emit(this.multiAlertService.activeAlerts[index]);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
ngOnDestroy() {
|
|
465
|
+
this.multiAlertServiceChanges.unsubscribe();
|
|
466
|
+
}
|
|
467
|
+
pageUp() {
|
|
468
|
+
this.multiAlertService.next();
|
|
469
|
+
}
|
|
470
|
+
pageDown() {
|
|
471
|
+
this.multiAlertService.previous();
|
|
472
|
+
}
|
|
473
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertsPager, deps: [{ token: MultiAlertService }, { token: i1.ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
474
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrAlertsPager, isStandalone: false, selector: "clr-alerts-pager", inputs: { currentAlert: ["clrCurrentAlert", "currentAlert"], currentAlertIndex: ["clrCurrentAlertIndex", "currentAlertIndex"] }, outputs: { currentAlertChange: "clrCurrentAlertChange", currentAlertIndexChange: "clrCurrentAlertIndexChange" }, host: { properties: { "class.alerts-pager": "true" } }, ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div class=\"alerts-pager-control\">\n <div class=\"alerts-page-down\">\n <button class=\"alerts-pager-button\" type=\"button\" (click)=\"pageDown()\" [attr.aria-label]=\"previousAlertAriaLabel\">\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.previous\"></cds-icon>\n </button>\n </div>\n <div class=\"alerts-pager-text\">{{multiAlertService.current+1}} / {{multiAlertService.count}}</div>\n <div class=\"alerts-page-up\">\n <button class=\"alerts-pager-button\" type=\"button\" (click)=\"pageUp()\" [attr.aria-label]=\"nextAlertAriaLabel\">\n <cds-icon shape=\"angle\" direction=\"right\" [attr.title]=\"commonStrings.keys.next\"></cds-icon>\n </button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }] }); }
|
|
475
|
+
}
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertsPager, decorators: [{
|
|
477
|
+
type: Component,
|
|
478
|
+
args: [{ selector: 'clr-alerts-pager', host: { '[class.alerts-pager]': 'true' }, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div class=\"alerts-pager-control\">\n <div class=\"alerts-page-down\">\n <button class=\"alerts-pager-button\" type=\"button\" (click)=\"pageDown()\" [attr.aria-label]=\"previousAlertAriaLabel\">\n <cds-icon shape=\"angle\" direction=\"left\" [attr.title]=\"commonStrings.keys.previous\"></cds-icon>\n </button>\n </div>\n <div class=\"alerts-pager-text\">{{multiAlertService.current+1}} / {{multiAlertService.count}}</div>\n <div class=\"alerts-page-up\">\n <button class=\"alerts-pager-button\" type=\"button\" (click)=\"pageUp()\" [attr.aria-label]=\"nextAlertAriaLabel\">\n <cds-icon shape=\"angle\" direction=\"right\" [attr.title]=\"commonStrings.keys.next\"></cds-icon>\n </button>\n </div>\n</div>\n" }]
|
|
479
|
+
}], ctorParameters: () => [{ type: MultiAlertService }, { type: i1.ClrCommonStringsService }], propDecorators: { currentAlertChange: [{
|
|
480
|
+
type: Output,
|
|
481
|
+
args: ['clrCurrentAlertChange']
|
|
482
|
+
}], currentAlertIndexChange: [{
|
|
483
|
+
type: Output,
|
|
484
|
+
args: ['clrCurrentAlertIndexChange']
|
|
485
|
+
}], currentAlert: [{
|
|
486
|
+
type: Input,
|
|
487
|
+
args: ['clrCurrentAlert']
|
|
488
|
+
}], currentAlertIndex: [{
|
|
489
|
+
type: Input,
|
|
490
|
+
args: ['clrCurrentAlertIndex']
|
|
491
|
+
}] } });
|
|
492
|
+
|
|
493
|
+
/*
|
|
494
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
495
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
496
|
+
* This software is released under MIT license.
|
|
497
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
498
|
+
*/
|
|
499
|
+
class ClrAlerts {
|
|
500
|
+
constructor(multiAlertService) {
|
|
501
|
+
this.multiAlertService = multiAlertService;
|
|
502
|
+
this.currentAlertChange = new EventEmitter(false);
|
|
503
|
+
this.currentAlertIndexChange = new EventEmitter(false);
|
|
504
|
+
this.subscriptions = [];
|
|
505
|
+
}
|
|
506
|
+
set allAlerts(value) {
|
|
507
|
+
this.multiAlertService.manage(value); // provide alerts
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Input/Output to support two way binding on current alert index
|
|
511
|
+
*/
|
|
512
|
+
set _inputCurrentIndex(index) {
|
|
513
|
+
if (Number.isInteger(index) && index >= 0) {
|
|
514
|
+
this.multiAlertService.current = index;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
get currentAlertIndex() {
|
|
518
|
+
return this.multiAlertService.current;
|
|
519
|
+
}
|
|
520
|
+
set currentAlertIndex(index) {
|
|
521
|
+
this.multiAlertService.current = index;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Input/Output to support two way binding on current alert instance
|
|
525
|
+
*/
|
|
526
|
+
get currentAlert() {
|
|
527
|
+
return this.multiAlertService.currentAlert;
|
|
528
|
+
}
|
|
529
|
+
set currentAlert(alert) {
|
|
530
|
+
if (alert) {
|
|
531
|
+
this.multiAlertService.currentAlert = alert;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Ensure we are only dealing with alerts that have not been closed yet
|
|
536
|
+
*/
|
|
537
|
+
get alerts() {
|
|
538
|
+
return this.allAlerts.filter(alert => {
|
|
539
|
+
return alert.hidden === false;
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
get currentAlertType() {
|
|
543
|
+
if (this.multiAlertService.currentAlert) {
|
|
544
|
+
return this.multiAlertService.currentAlert.alertType;
|
|
545
|
+
}
|
|
546
|
+
return '';
|
|
547
|
+
}
|
|
548
|
+
ngAfterContentInit() {
|
|
549
|
+
this.subscriptions.push(this.multiAlertService.changes.subscribe(index => {
|
|
550
|
+
this.currentAlertIndexChange.emit(index);
|
|
551
|
+
this.currentAlertChange.emit(this.multiAlertService.currentAlert);
|
|
552
|
+
}));
|
|
553
|
+
}
|
|
554
|
+
ngOnDestroy() {
|
|
555
|
+
this.subscriptions.forEach(sub => sub.unsubscribe());
|
|
556
|
+
this.multiAlertService.destroy();
|
|
557
|
+
}
|
|
558
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlerts, deps: [{ token: MultiAlertService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
559
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrAlerts, isStandalone: false, selector: "clr-alerts", inputs: { _inputCurrentIndex: ["clrCurrentAlertIndex", "_inputCurrentIndex"], currentAlert: ["clrCurrentAlert", "currentAlert"] }, outputs: { currentAlertChange: "clrCurrentAlertChange", currentAlertIndexChange: "clrCurrentAlertIndexChange" }, host: { properties: { "class.alerts": "true", "class.alert-danger": "this.currentAlertType == 'danger'", "class.alert-info": "this.currentAlertType == 'info'", "class.alert-success": "this.currentAlertType == 'success'", "class.alert-warning": "this.currentAlertType == 'warning'", "class.alert-neutral": "this.currentAlertType == 'neutral'" } }, providers: [MultiAlertService], queries: [{ propertyName: "allAlerts", predicate: ClrAlert }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<div class=\"alerts-wrapper\">\n @if (multiAlertService.count > 1) {\n <clr-alerts-pager [clrCurrentAlertIndex]=\"currentAlertIndex\"></clr-alerts-pager>\n }\n <ng-content select=\"clr-alert\"></ng-content>\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: ClrAlertsPager, selector: "clr-alerts-pager", inputs: ["clrCurrentAlert", "clrCurrentAlertIndex"], outputs: ["clrCurrentAlertChange", "clrCurrentAlertIndexChange"] }] }); }
|
|
560
|
+
}
|
|
561
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlerts, decorators: [{
|
|
562
|
+
type: Component,
|
|
563
|
+
args: [{ selector: 'clr-alerts', providers: [MultiAlertService], host: {
|
|
564
|
+
'[class.alerts]': 'true',
|
|
565
|
+
'[class.alert-danger]': "this.currentAlertType == 'danger'",
|
|
566
|
+
'[class.alert-info]': "this.currentAlertType == 'info'",
|
|
567
|
+
'[class.alert-success]': "this.currentAlertType == 'success'",
|
|
568
|
+
'[class.alert-warning]': "this.currentAlertType == 'warning'",
|
|
569
|
+
'[class.alert-neutral]': "this.currentAlertType == 'neutral'",
|
|
570
|
+
}, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<div class=\"alerts-wrapper\">\n @if (multiAlertService.count > 1) {\n <clr-alerts-pager [clrCurrentAlertIndex]=\"currentAlertIndex\"></clr-alerts-pager>\n }\n <ng-content select=\"clr-alert\"></ng-content>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
571
|
+
}], ctorParameters: () => [{ type: MultiAlertService }], propDecorators: { currentAlertChange: [{
|
|
572
|
+
type: Output,
|
|
573
|
+
args: ['clrCurrentAlertChange']
|
|
574
|
+
}], currentAlertIndexChange: [{
|
|
575
|
+
type: Output,
|
|
576
|
+
args: ['clrCurrentAlertIndexChange']
|
|
577
|
+
}], allAlerts: [{
|
|
578
|
+
type: ContentChildren,
|
|
579
|
+
args: [ClrAlert]
|
|
580
|
+
}], _inputCurrentIndex: [{
|
|
581
|
+
type: Input,
|
|
582
|
+
args: ['clrCurrentAlertIndex']
|
|
583
|
+
}], currentAlert: [{
|
|
584
|
+
type: Input,
|
|
585
|
+
args: ['clrCurrentAlert']
|
|
586
|
+
}] } });
|
|
587
|
+
|
|
588
|
+
/*
|
|
589
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
590
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
591
|
+
* This software is released under MIT license.
|
|
592
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
593
|
+
*/
|
|
594
|
+
const CLR_ALERT_DIRECTIVES = [ClrAlert, ClrAlertItem, ClrAlerts, ClrAlertsPager, ClrAlertText];
|
|
595
|
+
class ClrAlertModule {
|
|
596
|
+
constructor() {
|
|
597
|
+
ClarityIcons.addIcons(errorStandardIcon, helpIcon, infoStandardIcon, noteIcon, successStandardIcon, warningStandardIcon, windowCloseIcon);
|
|
598
|
+
}
|
|
599
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
600
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertModule, declarations: [ClrAlert, ClrAlertItem, ClrAlerts, ClrAlertsPager, ClrAlertText], imports: [CommonModule, ClrIcon, ClrDropdownModule, ClrSpinnerModule], exports: [ClrAlert, ClrAlertItem, ClrAlerts, ClrAlertsPager, ClrAlertText] }); }
|
|
601
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertModule, imports: [CommonModule, ClrIcon, ClrDropdownModule, ClrSpinnerModule] }); }
|
|
602
|
+
}
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrAlertModule, decorators: [{
|
|
604
|
+
type: NgModule,
|
|
605
|
+
args: [{
|
|
606
|
+
imports: [CommonModule, ClrIcon, ClrDropdownModule, ClrSpinnerModule],
|
|
607
|
+
declarations: [CLR_ALERT_DIRECTIVES],
|
|
608
|
+
exports: [CLR_ALERT_DIRECTIVES],
|
|
609
|
+
}]
|
|
610
|
+
}], ctorParameters: () => [] });
|
|
611
|
+
|
|
612
|
+
/*
|
|
613
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
614
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
615
|
+
* This software is released under MIT license.
|
|
616
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
617
|
+
*/
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Generated bundle index. Do not edit.
|
|
621
|
+
*/
|
|
622
|
+
|
|
623
|
+
export { ALERT_TYPES, CLR_ALERT_DIRECTIVES, ClrAlert, ClrAlertItem, ClrAlertModule, ClrAlertText, ClrAlerts, ClrAlertsPager };
|
|
624
|
+
//# sourceMappingURL=clr-angular-emphasis-alert.mjs.map
|