@clr/angular 13.0.0-next.1 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18901,7 +18901,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImpor
18901
18901
  }], ctorParameters: function () { return [{ type: ClrCommonStringsService }]; } });
18902
18902
 
18903
18903
  /*
18904
- * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
18904
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
18905
18905
  * This software is released under MIT license.
18906
18906
  * The full license information can be found in LICENSE in the root directory of this project.
18907
18907
  */
@@ -18953,16 +18953,33 @@ class MultiAlertService {
18953
18953
  });
18954
18954
  }
18955
18955
  next() {
18956
- this.current = this.current === this.activeAlerts.length - 1 ? 0 : this.current + 1;
18956
+ this._current = this.current === this.activeAlerts.length - 1 ? 0 : this.current + 1;
18957
+ this._change.next(this._current);
18957
18958
  }
18958
18959
  previous() {
18959
18960
  if (this.activeAlerts.length === 0) {
18960
18961
  return;
18961
18962
  }
18962
- this.current = this.current === 0 ? this.activeAlerts.length - 1 : this.current - 1;
18963
+ this._current = this.current === 0 ? this.activeAlerts.length - 1 : this.current - 1;
18964
+ this._change.next(this._current);
18963
18965
  }
18964
- close() {
18965
- this.previous();
18966
+ open() {
18967
+ if (this.activeAlerts.length === 0) {
18968
+ return;
18969
+ }
18970
+ if (!this.currentAlert) {
18971
+ this._current = 0;
18972
+ }
18973
+ this._change.next(this._current);
18974
+ }
18975
+ close(isCurrentAlert) {
18976
+ if (this.activeAlerts.length === 0) {
18977
+ return;
18978
+ }
18979
+ if (isCurrentAlert) {
18980
+ this._current = Math.max(0, this.current - 1);
18981
+ }
18982
+ this._change.next(this._current);
18966
18983
  }
18967
18984
  destroy() {
18968
18985
  if (this.subscription) {
@@ -18977,7 +18994,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImpor
18977
18994
  }] });
18978
18995
 
18979
18996
  /*
18980
- * Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.
18997
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
18981
18998
  * This software is released under MIT license.
18982
18999
  * The full license information can be found in LICENSE in the root directory of this project.
18983
19000
  */
@@ -19006,6 +19023,14 @@ class ClrAlert {
19006
19023
  ngOnDestroy() {
19007
19024
  this.subscriptions.forEach(sub => sub.unsubscribe());
19008
19025
  }
19026
+ set closed(value) {
19027
+ if (value && !this._closed) {
19028
+ this.close();
19029
+ }
19030
+ else if (!value && this._closed) {
19031
+ this.open();
19032
+ }
19033
+ }
19009
19034
  set alertType(val) {
19010
19035
  this.iconService.alertType = val;
19011
19036
  }
@@ -19031,19 +19056,23 @@ class ClrAlert {
19031
19056
  if (!this.closable) {
19032
19057
  return;
19033
19058
  }
19059
+ const isCurrentAlert = this.multiAlertService?.currentAlert === this;
19034
19060
  this._closed = true;
19035
19061
  if (this.multiAlertService) {
19036
- this.multiAlertService.close();
19062
+ this.multiAlertService.close(isCurrentAlert);
19037
19063
  }
19038
19064
  this._closedChanged.emit(true);
19039
19065
  }
19040
19066
  open() {
19041
19067
  this._closed = false;
19068
+ if (this.multiAlertService) {
19069
+ this.multiAlertService.open();
19070
+ }
19042
19071
  this._closedChanged.emit(false);
19043
19072
  }
19044
19073
  }
19045
19074
  ClrAlert.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ClrAlert, deps: [{ token: AlertIconAndTypesService }, { token: i0.ChangeDetectorRef }, { token: MultiAlertService, optional: true }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
19046
- ClrAlert.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ClrAlert, selector: "clr-alert", inputs: { isSmall: ["clrAlertSizeSmall", "isSmall"], closable: ["clrAlertClosable", "closable"], isAppLevel: ["clrAlertAppLevel", "isAppLevel"], clrCloseButtonAriaLabel: "clrCloseButtonAriaLabel", _closed: ["clrAlertClosed", "_closed"], alertType: ["clrAlertType", "alertType"], alertIconShape: ["clrAlertIcon", "alertIconShape"] }, outputs: { _closedChanged: "clrAlertClosedChange" }, providers: [AlertIconAndTypesService], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n *ngIf=\"!_closed\"\n class=\"alert\"\n [ngClass]=\"alertClass\"\n [class.alert-hidden]=\"hidden\"\n [class.alert-sm]=\"isSmall\"\n [class.alert-app-level]=\"isAppLevel\"\n>\n <div class=\"alert-items\">\n <ng-content></ng-content>\n </div>\n <button type=\"button\" class=\"close\" *ngIf=\"closable\" (click)=\"close()\" [attr.aria-label]=\"clrCloseButtonAriaLabel\">\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n</div>\n", styles: [":host{display:block}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: CdsIconCustomTag, selector: "cds-icon" }] });
19075
+ ClrAlert.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ClrAlert, selector: "clr-alert", inputs: { isSmall: ["clrAlertSizeSmall", "isSmall"], closable: ["clrAlertClosable", "closable"], isAppLevel: ["clrAlertAppLevel", "isAppLevel"], clrCloseButtonAriaLabel: "clrCloseButtonAriaLabel", closed: ["clrAlertClosed", "closed"], alertType: ["clrAlertType", "alertType"], alertIconShape: ["clrAlertIcon", "alertIconShape"] }, outputs: { _closedChanged: "clrAlertClosedChange" }, providers: [AlertIconAndTypesService], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n *ngIf=\"!_closed\"\n class=\"alert\"\n [ngClass]=\"alertClass\"\n [class.alert-hidden]=\"hidden\"\n [class.alert-sm]=\"isSmall\"\n [class.alert-app-level]=\"isAppLevel\"\n>\n <div class=\"alert-items\">\n <ng-content></ng-content>\n </div>\n <button type=\"button\" class=\"close\" *ngIf=\"closable\" (click)=\"close()\" [attr.aria-label]=\"clrCloseButtonAriaLabel\">\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n</div>\n", styles: [":host{display:block}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: CdsIconCustomTag, selector: "cds-icon" }] });
19047
19076
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ClrAlert, decorators: [{
19048
19077
  type: Component,
19049
19078
  args: [{ selector: 'clr-alert', providers: [AlertIconAndTypesService], styles: [':host { display: block; }'], template: "<!--\n ~ Copyright (c) 2016-2021 VMware, Inc. All Rights Reserved.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n<div\n *ngIf=\"!_closed\"\n class=\"alert\"\n [ngClass]=\"alertClass\"\n [class.alert-hidden]=\"hidden\"\n [class.alert-sm]=\"isSmall\"\n [class.alert-app-level]=\"isAppLevel\"\n>\n <div class=\"alert-items\">\n <ng-content></ng-content>\n </div>\n <button type=\"button\" class=\"close\" *ngIf=\"closable\" (click)=\"close()\" [attr.aria-label]=\"clrCloseButtonAriaLabel\">\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n</div>\n" }]
@@ -19060,7 +19089,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImpor
19060
19089
  args: ['clrAlertAppLevel']
19061
19090
  }], clrCloseButtonAriaLabel: [{
19062
19091
  type: Input
19063
- }], _closed: [{
19092
+ }], closed: [{
19064
19093
  type: Input,
19065
19094
  args: ['clrAlertClosed']
19066
19095
  }], _closedChanged: [{