@eui/components 17.0.0-rc.6 → 17.0.0-rc.7

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.
Files changed (128) hide show
  1. package/docs/components/EuiAlertComponent.html +141 -15
  2. package/docs/components/EuiAutocompleteComponent.html +28 -16
  3. package/docs/components/EuiAvatarComponent.html +15 -72
  4. package/docs/components/EuiBadgeComponent.html +61 -637
  5. package/docs/components/EuiBlockContentComponent.html +2 -2
  6. package/docs/components/EuiBlockDocumentComponent.html +18 -725
  7. package/docs/components/EuiCardContentComponent.html +69 -0
  8. package/docs/components/EuiDashboardButtonComponent.html +1 -1
  9. package/docs/components/EuiDashboardCardComponent.html +5 -5
  10. package/docs/components/EuiDialogContainerComponent.html +1 -1
  11. package/docs/components/EuiFieldsetComponent.html +6 -6
  12. package/docs/components/EuiMenuComponent.html +96 -961
  13. package/docs/components/EuiMenuItemComponent.html +1 -1
  14. package/docs/dependencies.html +2 -2
  15. package/docs/js/menu-wc.js +218 -187
  16. package/docs/js/menu-wc_es5.js +1 -1
  17. package/docs/js/search/search_index.js +2 -2
  18. package/docs/miscellaneous/variables.html +35 -0
  19. package/docs/modules/EuiAlertModule.html +4 -1
  20. package/docs/modules/EuiAppSidebarModule.html +4 -28
  21. package/docs/modules/EuiAppToolbarModule.html +4 -28
  22. package/docs/modules/EuiAvatarModule.html +7 -28
  23. package/docs/modules/EuiBadgeModule.html +11 -1
  24. package/docs/modules/EuiChartsModule.html +4 -28
  25. package/docs/modules/EuiFieldsetModule.html +3 -0
  26. package/docs/modules/EuiHeaderModule.html +4 -28
  27. package/docs/modules/EuiPageModule.html +4 -28
  28. package/docs/modules/EuiSidebarMenuModule.html +4 -28
  29. package/docs/modules/EuiSkeletonModule.html +4 -28
  30. package/docs/modules/EuiToolbarModule.html +4 -28
  31. package/docs/modules/EuiUserProfileModule.html +4 -28
  32. package/esm2022/eui-alert/eui-alert.component.mjs +75 -80
  33. package/esm2022/eui-alert/eui-alert.module.mjs +49 -0
  34. package/esm2022/eui-alert/index.mjs +2 -1
  35. package/esm2022/eui-autocomplete/eui-autocomplete.component.mjs +47 -76
  36. package/esm2022/eui-avatar/avatar-badge/avatar-badge.component.mjs +1 -4
  37. package/esm2022/eui-avatar/eui-avatar-list.component.mjs +1 -4
  38. package/esm2022/eui-avatar/eui-avatar.component.mjs +20 -39
  39. package/esm2022/eui-avatar/eui-avatar.module.mjs +5 -2
  40. package/esm2022/eui-badge/eui-badge.component.mjs +40 -35
  41. package/esm2022/eui-badge/eui-badge.module.mjs +19 -0
  42. package/esm2022/eui-badge/index.mjs +2 -1
  43. package/esm2022/eui-block-content/eui-block-content.component.mjs +10 -17
  44. package/esm2022/eui-block-document/eui-block-document.component.mjs +14 -19
  45. package/esm2022/eui-card/components/eui-card-content/eui-card-content.component.mjs +6 -2
  46. package/esm2022/eui-dashboard-button/eui-dashboard-button.component.mjs +6 -9
  47. package/esm2022/eui-dashboard-card/eui-dashboard-card.component.mjs +23 -33
  48. package/esm2022/eui-dialog/container/eui-dialog-container.component.mjs +3 -3
  49. package/esm2022/eui-fieldset/eui-fieldset.component.mjs +22 -39
  50. package/esm2022/eui-fieldset/eui-fieldset.module.mjs +4 -3
  51. package/esm2022/eui-menu/eui-menu-item.component.mjs +7 -3
  52. package/esm2022/eui-menu/eui-menu.component.mjs +51 -56
  53. package/esm2022/eui-overlay/components/eui-overlay-header/eui-overlay-header-title/eui-overlay-header-title.component.mjs +1 -1
  54. package/esm2022/eui-tree/eui-tree.component.mjs +1 -1
  55. package/esm2022/layout/eui-notifications/eui-notifications.component.mjs +1 -1
  56. package/esm2022/layout/eui-notifications-v2/eui-notifications.component.mjs +1 -1
  57. package/esm2022/layout/eui-user-profile/user-profile.component.mjs +1 -1
  58. package/eui-alert/eui-alert.component.d.ts +13 -23
  59. package/eui-alert/eui-alert.component.d.ts.map +1 -1
  60. package/eui-alert/eui-alert.module.d.ts +14 -0
  61. package/eui-alert/eui-alert.module.d.ts.map +1 -0
  62. package/eui-alert/index.d.ts +1 -0
  63. package/eui-alert/index.d.ts.map +1 -1
  64. package/eui-autocomplete/eui-autocomplete.component.d.ts +35 -19
  65. package/eui-autocomplete/eui-autocomplete.component.d.ts.map +1 -1
  66. package/eui-avatar/avatar-badge/avatar-badge.component.d.ts +0 -1
  67. package/eui-avatar/avatar-badge/avatar-badge.component.d.ts.map +1 -1
  68. package/eui-avatar/eui-avatar-list.component.d.ts +0 -1
  69. package/eui-avatar/eui-avatar-list.component.d.ts.map +1 -1
  70. package/eui-avatar/eui-avatar.component.d.ts +10 -10
  71. package/eui-avatar/eui-avatar.component.d.ts.map +1 -1
  72. package/eui-avatar/eui-avatar.module.d.ts +2 -1
  73. package/eui-avatar/eui-avatar.module.d.ts.map +1 -1
  74. package/eui-badge/eui-badge.component.d.ts +8 -14
  75. package/eui-badge/eui-badge.component.d.ts.map +1 -1
  76. package/eui-badge/eui-badge.module.d.ts +10 -0
  77. package/eui-badge/eui-badge.module.d.ts.map +1 -0
  78. package/eui-badge/index.d.ts +1 -0
  79. package/eui-badge/index.d.ts.map +1 -1
  80. package/eui-block-content/eui-block-content.component.d.ts +2 -3
  81. package/eui-block-content/eui-block-content.component.d.ts.map +1 -1
  82. package/eui-block-document/eui-block-document.component.d.ts +3 -7
  83. package/eui-block-document/eui-block-document.component.d.ts.map +1 -1
  84. package/eui-card/components/eui-card-content/eui-card-content.component.d.ts +1 -0
  85. package/eui-card/components/eui-card-content/eui-card-content.component.d.ts.map +1 -1
  86. package/eui-dashboard-button/eui-dashboard-button.component.d.ts +1 -2
  87. package/eui-dashboard-button/eui-dashboard-button.component.d.ts.map +1 -1
  88. package/eui-dashboard-card/eui-dashboard-card.component.d.ts +9 -7
  89. package/eui-dashboard-card/eui-dashboard-card.component.d.ts.map +1 -1
  90. package/eui-fieldset/eui-fieldset.component.d.ts +12 -8
  91. package/eui-fieldset/eui-fieldset.component.d.ts.map +1 -1
  92. package/eui-fieldset/eui-fieldset.module.d.ts +2 -1
  93. package/eui-fieldset/eui-fieldset.module.d.ts.map +1 -1
  94. package/eui-menu/eui-menu-item.component.d.ts +4 -0
  95. package/eui-menu/eui-menu-item.component.d.ts.map +1 -1
  96. package/eui-menu/eui-menu.component.d.ts +16 -19
  97. package/eui-menu/eui-menu.component.d.ts.map +1 -1
  98. package/fesm2022/eui-components-eui-alert.mjs +103 -68
  99. package/fesm2022/eui-components-eui-alert.mjs.map +1 -1
  100. package/fesm2022/eui-components-eui-autocomplete.mjs +47 -74
  101. package/fesm2022/eui-components-eui-autocomplete.mjs.map +1 -1
  102. package/fesm2022/eui-components-eui-avatar.mjs +22 -45
  103. package/fesm2022/eui-components-eui-avatar.mjs.map +1 -1
  104. package/fesm2022/eui-components-eui-badge.mjs +42 -22
  105. package/fesm2022/eui-components-eui-badge.mjs.map +1 -1
  106. package/fesm2022/eui-components-eui-block-content.mjs +9 -16
  107. package/fesm2022/eui-components-eui-block-content.mjs.map +1 -1
  108. package/fesm2022/eui-components-eui-block-document.mjs +13 -18
  109. package/fesm2022/eui-components-eui-block-document.mjs.map +1 -1
  110. package/fesm2022/eui-components-eui-card.mjs +5 -1
  111. package/fesm2022/eui-components-eui-card.mjs.map +1 -1
  112. package/fesm2022/eui-components-eui-dashboard-button.mjs +5 -8
  113. package/fesm2022/eui-components-eui-dashboard-button.mjs.map +1 -1
  114. package/fesm2022/eui-components-eui-dashboard-card.mjs +22 -32
  115. package/fesm2022/eui-components-eui-dashboard-card.mjs.map +1 -1
  116. package/fesm2022/eui-components-eui-dialog.mjs +2 -2
  117. package/fesm2022/eui-components-eui-dialog.mjs.map +1 -1
  118. package/fesm2022/eui-components-eui-fieldset.mjs +23 -40
  119. package/fesm2022/eui-components-eui-fieldset.mjs.map +1 -1
  120. package/fesm2022/eui-components-eui-menu.mjs +51 -55
  121. package/fesm2022/eui-components-eui-menu.mjs.map +1 -1
  122. package/fesm2022/eui-components-eui-overlay.mjs +1 -1
  123. package/fesm2022/eui-components-eui-overlay.mjs.map +1 -1
  124. package/fesm2022/eui-components-eui-tree.mjs +1 -1
  125. package/fesm2022/eui-components-eui-tree.mjs.map +1 -1
  126. package/fesm2022/eui-components-layout.mjs +3 -3
  127. package/fesm2022/eui-components-layout.mjs.map +1 -1
  128. package/package.json +7 -7
@@ -1,23 +1,28 @@
1
- import { __decorate } from 'tslib';
2
1
  import * as i0 from '@angular/core';
3
- import { Directive, HostBinding, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ContentChild, forwardRef, NgModule } from '@angular/core';
2
+ import { Directive, HostBinding, EventEmitter, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ContentChild, forwardRef, NgModule } from '@angular/core';
3
+ import * as uuid from 'uuid';
4
+ import * as i1 from '@eui/components/shared';
5
+ import { BaseStatesDirective } from '@eui/components/shared';
4
6
  import * as i2 from '@angular/common';
5
7
  import { CommonModule } from '@angular/common';
6
8
  import * as i3 from '@eui/components/eui-icon';
7
9
  import { EuiIconModule } from '@eui/components/eui-icon';
8
- import * as i1 from '@eui/components/shared';
9
- import { BaseStatesDirective } from '@eui/components/shared';
10
10
  import * as i4 from '@eui/components/eui-label';
11
11
  import { EuiLabelModule } from '@eui/components/eui-label';
12
- import { coerceBoolean } from '@eui/base';
13
12
  import * as i5 from '@eui/components/eui-button';
14
13
  import { EuiButtonModule } from '@eui/components/eui-button';
15
14
  import * as i6 from '@ngx-translate/core';
16
15
  import { TranslateModule } from '@ngx-translate/core';
17
16
 
17
+ // -------
18
+ // IMPORTS
19
+ // -------
20
+ // Angular
21
+ // Sub content directives for projection - keep the component files tight
18
22
  /* eslint-disable */
19
23
  class EuiAlertTitleDirective {
20
24
  constructor() {
25
+ // host binding class assignment for the content directive, avoiding extra DOM templates wrapper
21
26
  this.class = 'eui-alert__title';
22
27
  }
23
28
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -31,121 +36,151 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImpor
31
36
  args: ['class']
32
37
  }] } });
33
38
  /* eslint-enable */
39
+ // --------------
40
+ // MAIN COMPONENT
41
+ // --------------
34
42
  class EuiAlertComponent {
43
+ // class binding ALWAYS first (for binding against the baseStateDiretive)
35
44
  get cssClasses() {
36
- return this.getCssClasses();
45
+ return [
46
+ // Always refer to the baseStatesDirective
47
+ this.baseStatesDirective.getCssClasses('eui-alert'),
48
+ // own cmp state => reflected with the scss states
49
+ this.isMuted ? 'eui-alert--muted' : '',
50
+ this.isFocusable ? 'eui-alert--focusable' : '',
51
+ !this.isVisible ? 'eui-alert--hidden' : '',
52
+ ]
53
+ .join(' ')
54
+ .trim();
55
+ }
56
+ get ariaDescribedBy() {
57
+ return `alertContent-${this.uniqueId}`;
37
58
  }
59
+ get tabindex() {
60
+ return this.isFocusable ? '0' : '-1';
61
+ }
62
+ // CONSTRUCTOR
63
+ // -----------
38
64
  constructor(baseStatesDirective) {
39
65
  this.baseStatesDirective = baseStatesDirective;
66
+ // a11y bindings, ideally always on the host side / never in the sub wrapper within the HTML,
67
+ // cleaner and also attacking the host DOM element rather than its children
68
+ this.role = 'alert';
69
+ // for e2e unique attr to be defined / pass as input
40
70
  this.e2eAttr = 'eui-alert';
71
+ // component own states
72
+ // conventions if boolean : is / has prefix
73
+ // new v17 usage of transform / act like coerce and included in Angular natively now
41
74
  this.isMuted = false;
42
75
  this.isCloseable = false;
43
76
  this.isFocusable = false;
77
+ // Output event definition
78
+ // convention : verb(present)Component
44
79
  this.closeAlert = new EventEmitter();
80
+ // public variables used in the template
45
81
  this.isVisible = true;
46
82
  }
83
+ // HOOKS
84
+ // -----
47
85
  ngOnInit() {
48
86
  if (!this.baseStatesDirective.euiVariant) {
49
87
  this.baseStatesDirective.euiInfo = true;
50
88
  }
51
- this.randomStringId = this.generateUniqueId();
52
- }
53
- ngOnChanges() {
54
- this.setIcon();
55
- }
56
- ngAfterContentInit() {
57
- this.setIcon();
89
+ this.uniqueId = uuid.v4();
58
90
  }
91
+ // PUBLIC FUNCTIONS FROM TEMPLATE
92
+ // ------------------------------
59
93
  onCloseClick() {
60
94
  this.isVisible = false;
61
95
  this.closeAlert.emit();
62
96
  }
63
- getCssClasses() {
64
- return [
65
- this.baseStatesDirective.getCssClasses('eui-alert'),
66
- this.isMuted ? 'eui-alert--muted' : '',
67
- this.isFocusable ? 'eui-alert--focusable' : '',
68
- !this.isVisible ? 'eui-alert--hidden' : '',
69
- ]
70
- .join(' ')
71
- .trim();
72
- }
73
- setIcon() {
74
- this.alertIconType = 'eui-ecl-information';
75
- this.alertIconFillColor = 'info-100';
76
- if (this.baseStatesDirective.euiWarning) {
77
- this.alertIconType = 'eui-ecl-warning';
78
- this.alertIconFillColor = 'warning-100';
79
- }
80
- if (this.baseStatesDirective.euiDanger) {
81
- this.alertIconType = 'eui-ecl-error';
82
- this.alertIconFillColor = 'danger-100';
83
- }
84
- if (this.baseStatesDirective.euiSuccess) {
85
- this.alertIconType = 'eui-ecl-check-filled';
86
- this.alertIconFillColor = 'success-100';
87
- }
88
- if (this.baseStatesDirective.euiSecondary) {
89
- this.alertIconType = 'help-circle:sharp';
90
- this.alertIconFillColor = 'grey-100';
91
- }
92
- }
93
- generateUniqueId() {
94
- const dateStr = Date.now().toString(36);
95
- const randomStr = Math.random().toString(36).substring(2, 8); // start at index 2 to skip decimal point
96
- return `${dateStr}-${randomStr}`;
97
- }
98
97
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertComponent, deps: [{ token: i1.BaseStatesDirective }], target: i0.ɵɵFactoryTarget.Component }); }
99
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.2", type: EuiAlertComponent, selector: "div[euiAlert], eui-alert", inputs: { e2eAttr: "e2eAttr", isMuted: "isMuted", isCloseable: "isCloseable", isFocusable: "isFocusable" }, outputs: { closeAlert: "closeAlert" }, host: { properties: { "class": "this.cssClasses", "attr.data-e2e": "this.e2eAttr" } }, queries: [{ propertyName: "alertTitle", first: true, predicate: i0.forwardRef(() => EuiAlertTitleDirective), descendants: true }], usesOnChanges: true, hostDirectives: [{ directive: i1.BaseStatesDirective, inputs: ["euiSecondary", "euiSecondary", "euiSuccess", "euiSuccess", "euiInfo", "euiInfo", "euiWarning", "euiWarning", "euiDanger", "euiDanger", "euiVariant", "euiVariant"] }], ngImport: i0, template: "<div class=\"eui-alert__content-wrapper\" role=\"alert\" [tabindex]=\"isFocusable ? '0' : '-1'\" [attr.aria-describedby]=\"'alertContent-' + randomStringId\">\n <div class=\"eui-alert__type-container\" *ngIf=\"!isMuted\">\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"{{ alertIconType }}\" fillColor=\"{{ alertIconFillColor }}\"></eui-icon-svg>\n </div>\n <div id=\"alertContent-{{ randomStringId }}\" class=\"eui-alert__content\">\n <ng-container *ngIf=\"alertTitle; else alertNoTitle\">\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n </ng-container>\n <ng-template #alertNoTitle>\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n </ng-template>\n </div>\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div class=\"eui-u-display-block\" [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".eui-alert{--_border-color: var(--eui-alert-border-color, var(--eui-base-color-info-100));--_color: var(--eui-alert-color, var(--eui-base-color-info-130));--_bg-color: var(--eui-alert-type-container-bg-color, var(--eui-base-color-info-10))}.eui-alert{display:flex;background-color:var(--_bg-color);background-position:var(--eui-base-spacing-s);background-repeat:no-repeat;position:relative;border-left:var(--eui-base-spacing-2xs) solid var(--_border-color);border-radius:var(--eui-base-border-radius)}.eui-alert__type-container{align-items:center;display:flex;margin-right:var(--eui-base-spacing-s);height:var(--eui-base-spacing-l)}.eui-alert__content{display:flex;flex-direction:column;width:100%}.eui-alert__content-header{align-items:center;display:flex;flex:1 1 100%;justify-content:space-between;width:100%}.eui-alert__content-header--with-title{min-height:var(--eui-base-spacing-l)}.eui-alert__title{color:var(--_color);font:normal normal 400 1rem/1.25rem var(--eui-base-font-family);font-weight:700}.eui-alert__content-wrapper{display:flex;flex-basis:auto;flex-shrink:1;overflow:auto;padding:var(--eui-base-spacing-m);width:100%}.eui-alert__content-wrapper::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-base-color-grey-5)}.eui-alert__content-wrapper::-webkit-scrollbar-thumb{background-color:var(--eui-base-color-grey-20);border-radius:5rem}.eui-alert__content-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--eui-base-color-grey-50)}.eui-alert__content-wrapper::-webkit-scrollbar-track{background-color:var(--eui-base-color-grey-5);border-radius:0}.eui-alert__close{align-self:flex-start;display:flex;margin-left:auto}.eui-alert__close:hover{text-decoration:underline}.eui-alert--info{--_border-color: var(--eui-base-color-info-100);--_bg-color: var(--eui-base-color-info-10);--_color: var(--eui-base-color-info-130)}.eui-alert--success{--_border-color: var(--eui-base-color-success-100);--_bg-color: var(--eui-base-color-success-10);--_color: var(--eui-base-color-success-130)}.eui-alert--danger{--_border-color: var(--eui-base-color-danger-100);--_bg-color: var(--eui-base-color-danger-10);--_color: var(--eui-base-color-danger-130)}.eui-alert--warning{--_border-color: var(--eui-base-color-warning-100);--_bg-color: var(--eui-base-color-warning-10);--_color: var(--eui-base-color-warning-140)}.eui-alert--hidden{display:none}.eui-alert--focusable:active:not([readonly]),.eui-alert--focusable:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}.eui-alert--focusable [tabindex=\"0\"]:active:not([readonly]),.eui-alert--focusable [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "size", "fillColor", "set", "ariaLabelledby", "role", "style", "iconUrl", "transform", "aria-label", "ariaHidden", "focusable", "isLoading"] }, { kind: "component", type: i4.EuiLabelComponent, selector: "label[euiLabel], span[euiLabel], div[euiLabel], a[euiLabel], eui-label, label[euiSublabel], span[euiSublabel], div[euiSublabel], a[euiSublabel], eui-sublabel", inputs: ["euiRequired", "euiReadonly", "euiSublabel"] }, { kind: "component", type: i5.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiBlockButton", "isLoading", "euiIconButton", "euiLineWrap"], outputs: ["buttonClick"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
98
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.0.2", type: EuiAlertComponent, selector: "div[euiAlert], eui-alert", inputs: { ariaDescribedBy: "ariaDescribedBy", e2eAttr: "e2eAttr", isMuted: ["isMuted", "isMuted", booleanAttribute], isCloseable: ["isCloseable", "isCloseable", booleanAttribute], isFocusable: ["isFocusable", "isFocusable", booleanAttribute] }, outputs: { closeAlert: "closeAlert" }, host: { properties: { "class": "this.cssClasses", "attr.role": "this.role", "attr.aria-describedby": "this.ariaDescribedBy", "attr.tabindex": "this.tabindex", "attr.data-e2e": "this.e2eAttr" } }, queries: [{ propertyName: "alertTitle", first: true, predicate: i0.forwardRef(() => EuiAlertTitleDirective), descendants: true }], hostDirectives: [{ directive: i1.BaseStatesDirective, inputs: ["euiSuccess", "euiSuccess", "euiInfo", "euiInfo", "euiWarning", "euiWarning", "euiDanger", "euiDanger", "euiVariant", "euiVariant"] }], ngImport: i0, template: "@if (!isMuted) {\n <div class=\"eui-alert__type-container\">\n @switch(baseStatesDirective.euiVariant) {\n @case('info') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-information\" fillColor=\"info-100\"></eui-icon-svg>\n }\n @case('success') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-check-filled\" fillColor=\"success-100\"></eui-icon-svg>\n }\n @case('warning') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-warning\" fillColor=\"warning-100\"></eui-icon-svg>\n }\n @case('danger') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-error\" fillColor=\"danger-100\"></eui-icon-svg>\n }\n }\n </div>\n}\n\n<div id=\"{{ ariaDescribedBy }}\" class=\"eui-alert__content\">\n @if (alertTitle) {\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n } @else {\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n }\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".eui-alert{--_border-color: var(--eui-alert-border-color, var(--eui-base-color-info-100));--_color: var(--eui-alert-color, var(--eui-base-color-info-130));--_bg-color: var(--eui-alert-type-container-bg-color, var(--eui-base-color-info-10))}.eui-alert{display:flex;background-color:var(--_bg-color);background-position:var(--eui-base-spacing-s);background-repeat:no-repeat;position:relative;border-left:var(--eui-base-spacing-2xs) solid var(--_border-color);border-radius:var(--eui-base-border-radius);flex-basis:auto;flex-shrink:1;overflow:auto;padding:var(--eui-base-spacing-m);width:100%}.eui-alert::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-base-color-grey-5)}.eui-alert::-webkit-scrollbar-thumb{background-color:var(--eui-base-color-grey-20);border-radius:5rem}.eui-alert::-webkit-scrollbar-thumb:hover{background-color:var(--eui-base-color-grey-50)}.eui-alert::-webkit-scrollbar-track{background-color:var(--eui-base-color-grey-5);border-radius:0}.eui-alert__type-container{align-items:center;display:flex;margin-right:var(--eui-base-spacing-s);height:var(--eui-base-spacing-l)}.eui-alert__content{display:flex;flex-direction:column;width:100%}.eui-alert__content-header{align-items:center;display:flex;flex:1 1 100%;justify-content:space-between;width:100%}.eui-alert__content-header--with-title{min-height:var(--eui-base-spacing-l)}.eui-alert__title{color:var(--_color);font:normal normal 400 1rem/1.25rem var(--eui-base-font-family);font-weight:700}.eui-alert__close{align-self:flex-start;display:flex;margin-left:auto}.eui-alert__close:hover{text-decoration:underline}.eui-alert--info{--_border-color: var(--eui-base-color-info-100);--_bg-color: var(--eui-base-color-info-10);--_color: var(--eui-base-color-info-130)}.eui-alert--success{--_border-color: var(--eui-base-color-success-100);--_bg-color: var(--eui-base-color-success-10);--_color: var(--eui-base-color-success-130)}.eui-alert--danger{--_border-color: var(--eui-base-color-danger-100);--_bg-color: var(--eui-base-color-danger-10);--_color: var(--eui-base-color-danger-130)}.eui-alert--warning{--_border-color: var(--eui-base-color-warning-100);--_bg-color: var(--eui-base-color-warning-10);--_color: var(--eui-base-color-warning-140)}.eui-alert--hidden{display:none}.eui-alert--focusable:active:not([readonly]),.eui-alert--focusable:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}.eui-alert--focusable [tabindex=\"0\"]:active:not([readonly]),.eui-alert--focusable [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "size", "fillColor", "set", "ariaLabelledby", "role", "style", "iconUrl", "transform", "aria-label", "ariaHidden", "focusable", "isLoading"] }, { kind: "component", type: i4.EuiLabelComponent, selector: "label[euiLabel], span[euiLabel], div[euiLabel], a[euiLabel], eui-label, label[euiSublabel], span[euiSublabel], div[euiSublabel], a[euiSublabel], eui-sublabel", inputs: ["euiRequired", "euiReadonly", "euiSublabel"] }, { kind: "component", type: i5.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiBlockButton", "isLoading", "euiIconButton", "euiLineWrap"], outputs: ["buttonClick"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
100
99
  }
101
- __decorate([
102
- coerceBoolean
103
- ], EuiAlertComponent.prototype, "isMuted", void 0);
104
- __decorate([
105
- coerceBoolean
106
- ], EuiAlertComponent.prototype, "isCloseable", void 0);
107
- __decorate([
108
- coerceBoolean
109
- ], EuiAlertComponent.prototype, "isFocusable", void 0);
110
100
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertComponent, decorators: [{
111
101
  type: Component,
112
102
  args: [{ selector: 'div[euiAlert], eui-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, hostDirectives: [
113
103
  {
114
104
  directive: BaseStatesDirective,
115
- inputs: ['euiSecondary', 'euiSuccess', 'euiInfo', 'euiWarning', 'euiDanger', 'euiVariant'],
105
+ inputs: [
106
+ 'euiSuccess',
107
+ 'euiInfo',
108
+ 'euiWarning',
109
+ 'euiDanger',
110
+ // important to add the variant per type : euiVariant for colors / euiSizeVariant for sizes
111
+ 'euiVariant',
112
+ ],
116
113
  },
117
- ], template: "<div class=\"eui-alert__content-wrapper\" role=\"alert\" [tabindex]=\"isFocusable ? '0' : '-1'\" [attr.aria-describedby]=\"'alertContent-' + randomStringId\">\n <div class=\"eui-alert__type-container\" *ngIf=\"!isMuted\">\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"{{ alertIconType }}\" fillColor=\"{{ alertIconFillColor }}\"></eui-icon-svg>\n </div>\n <div id=\"alertContent-{{ randomStringId }}\" class=\"eui-alert__content\">\n <ng-container *ngIf=\"alertTitle; else alertNoTitle\">\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n </ng-container>\n <ng-template #alertNoTitle>\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n </ng-template>\n </div>\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div class=\"eui-u-display-block\" [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".eui-alert{--_border-color: var(--eui-alert-border-color, var(--eui-base-color-info-100));--_color: var(--eui-alert-color, var(--eui-base-color-info-130));--_bg-color: var(--eui-alert-type-container-bg-color, var(--eui-base-color-info-10))}.eui-alert{display:flex;background-color:var(--_bg-color);background-position:var(--eui-base-spacing-s);background-repeat:no-repeat;position:relative;border-left:var(--eui-base-spacing-2xs) solid var(--_border-color);border-radius:var(--eui-base-border-radius)}.eui-alert__type-container{align-items:center;display:flex;margin-right:var(--eui-base-spacing-s);height:var(--eui-base-spacing-l)}.eui-alert__content{display:flex;flex-direction:column;width:100%}.eui-alert__content-header{align-items:center;display:flex;flex:1 1 100%;justify-content:space-between;width:100%}.eui-alert__content-header--with-title{min-height:var(--eui-base-spacing-l)}.eui-alert__title{color:var(--_color);font:normal normal 400 1rem/1.25rem var(--eui-base-font-family);font-weight:700}.eui-alert__content-wrapper{display:flex;flex-basis:auto;flex-shrink:1;overflow:auto;padding:var(--eui-base-spacing-m);width:100%}.eui-alert__content-wrapper::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-base-color-grey-5)}.eui-alert__content-wrapper::-webkit-scrollbar-thumb{background-color:var(--eui-base-color-grey-20);border-radius:5rem}.eui-alert__content-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--eui-base-color-grey-50)}.eui-alert__content-wrapper::-webkit-scrollbar-track{background-color:var(--eui-base-color-grey-5);border-radius:0}.eui-alert__close{align-self:flex-start;display:flex;margin-left:auto}.eui-alert__close:hover{text-decoration:underline}.eui-alert--info{--_border-color: var(--eui-base-color-info-100);--_bg-color: var(--eui-base-color-info-10);--_color: var(--eui-base-color-info-130)}.eui-alert--success{--_border-color: var(--eui-base-color-success-100);--_bg-color: var(--eui-base-color-success-10);--_color: var(--eui-base-color-success-130)}.eui-alert--danger{--_border-color: var(--eui-base-color-danger-100);--_bg-color: var(--eui-base-color-danger-10);--_color: var(--eui-base-color-danger-130)}.eui-alert--warning{--_border-color: var(--eui-base-color-warning-100);--_bg-color: var(--eui-base-color-warning-10);--_color: var(--eui-base-color-warning-140)}.eui-alert--hidden{display:none}.eui-alert--focusable:active:not([readonly]),.eui-alert--focusable:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}.eui-alert--focusable [tabindex=\"0\"]:active:not([readonly]),.eui-alert--focusable [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}\n"] }]
114
+ ], template: "@if (!isMuted) {\n <div class=\"eui-alert__type-container\">\n @switch(baseStatesDirective.euiVariant) {\n @case('info') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-information\" fillColor=\"info-100\"></eui-icon-svg>\n }\n @case('success') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-check-filled\" fillColor=\"success-100\"></eui-icon-svg>\n }\n @case('warning') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-warning\" fillColor=\"warning-100\"></eui-icon-svg>\n }\n @case('danger') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-error\" fillColor=\"danger-100\"></eui-icon-svg>\n }\n }\n </div>\n}\n\n<div id=\"{{ ariaDescribedBy }}\" class=\"eui-alert__content\">\n @if (alertTitle) {\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n } @else {\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n }\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n", styles: [".eui-alert{--_border-color: var(--eui-alert-border-color, var(--eui-base-color-info-100));--_color: var(--eui-alert-color, var(--eui-base-color-info-130));--_bg-color: var(--eui-alert-type-container-bg-color, var(--eui-base-color-info-10))}.eui-alert{display:flex;background-color:var(--_bg-color);background-position:var(--eui-base-spacing-s);background-repeat:no-repeat;position:relative;border-left:var(--eui-base-spacing-2xs) solid var(--_border-color);border-radius:var(--eui-base-border-radius);flex-basis:auto;flex-shrink:1;overflow:auto;padding:var(--eui-base-spacing-m);width:100%}.eui-alert::-webkit-scrollbar{display:inherit;height:8px;width:8px;background-color:var(--eui-base-color-grey-5)}.eui-alert::-webkit-scrollbar-thumb{background-color:var(--eui-base-color-grey-20);border-radius:5rem}.eui-alert::-webkit-scrollbar-thumb:hover{background-color:var(--eui-base-color-grey-50)}.eui-alert::-webkit-scrollbar-track{background-color:var(--eui-base-color-grey-5);border-radius:0}.eui-alert__type-container{align-items:center;display:flex;margin-right:var(--eui-base-spacing-s);height:var(--eui-base-spacing-l)}.eui-alert__content{display:flex;flex-direction:column;width:100%}.eui-alert__content-header{align-items:center;display:flex;flex:1 1 100%;justify-content:space-between;width:100%}.eui-alert__content-header--with-title{min-height:var(--eui-base-spacing-l)}.eui-alert__title{color:var(--_color);font:normal normal 400 1rem/1.25rem var(--eui-base-font-family);font-weight:700}.eui-alert__close{align-self:flex-start;display:flex;margin-left:auto}.eui-alert__close:hover{text-decoration:underline}.eui-alert--info{--_border-color: var(--eui-base-color-info-100);--_bg-color: var(--eui-base-color-info-10);--_color: var(--eui-base-color-info-130)}.eui-alert--success{--_border-color: var(--eui-base-color-success-100);--_bg-color: var(--eui-base-color-success-10);--_color: var(--eui-base-color-success-130)}.eui-alert--danger{--_border-color: var(--eui-base-color-danger-100);--_bg-color: var(--eui-base-color-danger-10);--_color: var(--eui-base-color-danger-130)}.eui-alert--warning{--_border-color: var(--eui-base-color-warning-100);--_bg-color: var(--eui-base-color-warning-10);--_color: var(--eui-base-color-warning-140)}.eui-alert--hidden{display:none}.eui-alert--focusable:active:not([readonly]),.eui-alert--focusable:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}.eui-alert--focusable [tabindex=\"0\"]:active:not([readonly]),.eui-alert--focusable [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-base-color-accessible-focus);outline-offset:-2px;transition:none}\n"] }]
118
115
  }], ctorParameters: () => [{ type: i1.BaseStatesDirective }], propDecorators: { cssClasses: [{
119
116
  type: HostBinding,
120
117
  args: ['class']
118
+ }], role: [{
119
+ type: HostBinding,
120
+ args: ['attr.role']
121
+ }], ariaDescribedBy: [{
122
+ type: HostBinding,
123
+ args: ['attr.aria-describedby']
124
+ }, {
125
+ type: Input
126
+ }], tabindex: [{
127
+ type: HostBinding,
128
+ args: ['attr.tabindex']
121
129
  }], e2eAttr: [{
122
130
  type: HostBinding,
123
131
  args: ['attr.data-e2e']
124
132
  }, {
125
133
  type: Input
126
134
  }], isMuted: [{
127
- type: Input
135
+ type: Input,
136
+ args: [{ transform: booleanAttribute }]
128
137
  }], isCloseable: [{
129
- type: Input
138
+ type: Input,
139
+ args: [{ transform: booleanAttribute }]
130
140
  }], isFocusable: [{
131
- type: Input
141
+ type: Input,
142
+ args: [{ transform: booleanAttribute }]
132
143
  }], closeAlert: [{
133
144
  type: Output
134
145
  }], alertTitle: [{
135
146
  type: ContentChild,
136
147
  args: [forwardRef(() => EuiAlertTitleDirective), { static: false }]
137
148
  }] } });
149
+
150
+ // Angular
151
+ const COMPONENTS = [
152
+ EuiAlertComponent,
153
+ EuiAlertTitleDirective,
154
+ ];
155
+ // component main module
156
+ // Always same naming convention for all : Eui[CMP_NAME]Module
138
157
  class EuiAlertModule {
139
158
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
140
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, declarations: [EuiAlertComponent, EuiAlertTitleDirective], imports: [CommonModule, TranslateModule, EuiIconModule, EuiLabelModule, EuiButtonModule], exports: [EuiAlertComponent, EuiAlertTitleDirective] }); }
141
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, imports: [CommonModule, TranslateModule, EuiIconModule, EuiLabelModule, EuiButtonModule] }); }
159
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, declarations: [EuiAlertComponent,
160
+ EuiAlertTitleDirective], imports: [
161
+ // Angular and 3rd party
162
+ CommonModule, TranslateModule,
163
+ // eUI internals
164
+ BaseStatesDirective,
165
+ EuiIconModule, EuiLabelModule, EuiButtonModule], exports: [EuiAlertComponent,
166
+ EuiAlertTitleDirective] }); }
167
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, imports: [
168
+ // Angular and 3rd party
169
+ CommonModule, TranslateModule,
170
+ EuiIconModule, EuiLabelModule, EuiButtonModule] }); }
142
171
  }
143
172
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.2", ngImport: i0, type: EuiAlertModule, decorators: [{
144
173
  type: NgModule,
145
174
  args: [{
146
- imports: [CommonModule, TranslateModule, EuiIconModule, EuiLabelModule, EuiButtonModule],
147
- declarations: [EuiAlertComponent, EuiAlertTitleDirective],
148
- exports: [EuiAlertComponent, EuiAlertTitleDirective],
175
+ imports: [
176
+ // Angular and 3rd party
177
+ CommonModule, TranslateModule,
178
+ // eUI internals
179
+ BaseStatesDirective,
180
+ EuiIconModule, EuiLabelModule, EuiButtonModule,
181
+ ],
182
+ declarations: [...COMPONENTS],
183
+ exports: [...COMPONENTS],
149
184
  }]
150
185
  }] });
151
186
 
@@ -1 +1 @@
1
- {"version":3,"file":"eui-components-eui-alert.mjs","sources":["../../eui-alert/eui-alert.component.ts","../../eui-alert/eui-alert.component.html","../../eui-alert/eui-components-eui-alert.ts"],"sourcesContent":["import {\n NgModule,\n Component,\n HostBinding,\n EventEmitter,\n Input,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n AfterContentInit,\n Output,\n OnChanges,\n OnInit,\n Directive,\n ContentChild,\n forwardRef,\n QueryList,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BooleanInput } from '@angular/cdk/coercion';\n\nimport { EuiIconModule } from '@eui/components/eui-icon';\nimport { BaseStatesDirective } from '@eui/components/shared';\nimport { EuiLabelModule } from '@eui/components/eui-label';\nimport { coerceBoolean } from '@eui/base';\nimport { EuiButtonModule } from '@eui/components/eui-button';\nimport { TranslateModule } from '@ngx-translate/core';\n\n/* eslint-disable */\n@Directive({selector: 'eui-alert-title'})\nexport class EuiAlertTitleDirective {\n @HostBinding('class') class = 'eui-alert__title';\n}\n/* eslint-enable */\n\n@Component({\n templateUrl: './eui-alert.component.html',\n selector: 'div[euiAlert], eui-alert',\n styleUrls: ['./styles/_index.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [\n {\n directive: BaseStatesDirective,\n inputs: ['euiSecondary', 'euiSuccess', 'euiInfo', 'euiWarning', 'euiDanger', 'euiVariant'],\n },\n ],\n})\nexport class EuiAlertComponent implements OnInit, OnChanges, AfterContentInit {\n @HostBinding('class')\n public get cssClasses(): string {\n return this.getCssClasses();\n }\n @HostBinding('attr.data-e2e')\n @Input()\n e2eAttr = 'eui-alert';\n\n @Input()\n @coerceBoolean\n isMuted: BooleanInput = false;\n @Input()\n @coerceBoolean\n isCloseable: BooleanInput = false;\n @Input()\n @coerceBoolean\n isFocusable: BooleanInput = false;\n\n @Output() closeAlert = new EventEmitter<null>();\n\n @ContentChild(forwardRef(() => EuiAlertTitleDirective), { static: false }) alertTitle: QueryList<EuiAlertTitleDirective>;\n\n isVisible = true;\n alertIconType: string;\n alertIconFillColor: string;\n randomStringId: string;\n\n constructor(public baseStatesDirective: BaseStatesDirective) {}\n\n ngOnInit(): void {\n if (!this.baseStatesDirective.euiVariant) {\n this.baseStatesDirective.euiInfo = true;\n }\n this.randomStringId = this.generateUniqueId();\n }\n\n ngOnChanges(): void {\n this.setIcon();\n }\n\n ngAfterContentInit(): void {\n this.setIcon();\n }\n\n onCloseClick(): void {\n this.isVisible = false;\n this.closeAlert.emit();\n }\n\n private getCssClasses(): string {\n return [\n this.baseStatesDirective.getCssClasses('eui-alert'),\n this.isMuted ? 'eui-alert--muted' : '',\n this.isFocusable ? 'eui-alert--focusable': '',\n !this.isVisible ? 'eui-alert--hidden' : '',\n ]\n .join(' ')\n .trim();\n }\n\n private setIcon(): void {\n this.alertIconType = 'eui-ecl-information';\n this.alertIconFillColor = 'info-100';\n\n if (this.baseStatesDirective.euiWarning) {\n this.alertIconType = 'eui-ecl-warning';\n this.alertIconFillColor = 'warning-100';\n }\n if (this.baseStatesDirective.euiDanger) {\n this.alertIconType = 'eui-ecl-error';\n this.alertIconFillColor = 'danger-100';\n }\n if (this.baseStatesDirective.euiSuccess) {\n this.alertIconType = 'eui-ecl-check-filled';\n this.alertIconFillColor = 'success-100';\n }\n if (this.baseStatesDirective.euiSecondary) {\n this.alertIconType = 'help-circle:sharp';\n this.alertIconFillColor = 'grey-100';\n }\n }\n\n private generateUniqueId(): string {\n const dateStr = Date.now().toString(36);\n const randomStr = Math.random().toString(36).substring(2, 8); // start at index 2 to skip decimal point\n return `${dateStr}-${randomStr}`;\n }\n}\n\n@NgModule({\n imports: [CommonModule, TranslateModule, EuiIconModule, EuiLabelModule, EuiButtonModule],\n declarations: [EuiAlertComponent, EuiAlertTitleDirective],\n exports: [EuiAlertComponent, EuiAlertTitleDirective],\n})\nexport class EuiAlertModule {}\n","<div class=\"eui-alert__content-wrapper\" role=\"alert\" [tabindex]=\"isFocusable ? '0' : '-1'\" [attr.aria-describedby]=\"'alertContent-' + randomStringId\">\n <div class=\"eui-alert__type-container\" *ngIf=\"!isMuted\">\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"{{ alertIconType }}\" fillColor=\"{{ alertIconFillColor }}\"></eui-icon-svg>\n </div>\n <div id=\"alertContent-{{ randomStringId }}\" class=\"eui-alert__content\">\n <ng-container *ngIf=\"alertTitle; else alertNoTitle\">\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n </ng-container>\n <ng-template #alertNoTitle>\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n </ng-template>\n </div>\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div class=\"eui-u-display-block\" [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2BA;MAEa,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;QAE0B,IAAK,CAAA,KAAA,GAAG,kBAAkB,CAAC;AACpD,KAAA;iIAFY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;qHAAtB,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,SAAS;mBAAC,EAAC,QAAQ,EAAE,iBAAiB,EAAC,CAAA;8BAEd,KAAK,EAAA,CAAA;sBAA1B,WAAW;uBAAC,OAAO,CAAA;;AAExB;MAea,iBAAiB,CAAA;AAC1B,IAAA,IACW,UAAU,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;KAC/B;AAwBD,IAAA,WAAA,CAAmB,mBAAwC,EAAA;QAAxC,IAAmB,CAAA,mBAAA,GAAnB,mBAAmB,CAAqB;QArB3D,IAAO,CAAA,OAAA,GAAG,WAAW,CAAC;QAItB,IAAO,CAAA,OAAA,GAAiB,KAAK,CA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FAI9E,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,CAAC;AACxF,oBAAA,YAAY,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;AACzD,oBAAA,OAAO,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;AACvD,iBAAA,CAAA;;;AE7ID;;AAEG;;;;"}
1
+ {"version":3,"file":"eui-components-eui-alert.mjs","sources":["../../eui-alert/eui-alert.component.ts","../../eui-alert/eui-alert.component.html","../../eui-alert/eui-alert.module.ts","../../eui-alert/eui-components-eui-alert.ts"],"sourcesContent":["// -------\n// IMPORTS\n// -------\n\n// Angular\nimport {\n Component,\n HostBinding,\n EventEmitter,\n Input,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n Output,\n OnInit,\n Directive,\n ContentChild,\n forwardRef,\n QueryList,\n booleanAttribute,\n} from '@angular/core';\n\n// 3rd party\nimport * as uuid from 'uuid';\n\n// eUI internals\nimport { BaseStatesDirective } from '@eui/components/shared';\n\n// Sub content directives for projection - keep the component files tight\n\n/* eslint-disable */\n@Directive({ selector: 'eui-alert-title' })\nexport class EuiAlertTitleDirective {\n // host binding class assignment for the content directive, avoiding extra DOM templates wrapper\n @HostBinding('class') class = 'eui-alert__title';\n}\n/* eslint-enable */\n\n// --------------\n// MAIN COMPONENT\n// --------------\n@Component({\n templateUrl: './eui-alert.component.html', // respect component name convention\n selector: 'div[euiAlert], eui-alert', // if needed multi selectors\n styleUrl: './styles/_index.scss', // respect styles/_index.scss only import\n changeDetection: ChangeDetectionStrategy.OnPush, // OnPush by default for all\n encapsulation: ViewEncapsulation.None, // encapsulation.None by default for all\n\n // use of baseStatesDirective : defined here what the component needs as base props => reflected in styles / states.scss\n hostDirectives: [\n {\n directive: BaseStatesDirective,\n inputs: [\n 'euiSuccess',\n 'euiInfo',\n 'euiWarning',\n 'euiDanger',\n // important to add the variant per type : euiVariant for colors / euiSizeVariant for sizes\n 'euiVariant',\n ],\n },\n ],\n})\nexport class EuiAlertComponent implements OnInit {\n // class binding ALWAYS first (for binding against the baseStateDiretive)\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n // Always refer to the baseStatesDirective\n this.baseStatesDirective.getCssClasses('eui-alert'),\n\n // own cmp state => reflected with the scss states\n this.isMuted ? 'eui-alert--muted' : '',\n this.isFocusable ? 'eui-alert--focusable' : '',\n !this.isVisible ? 'eui-alert--hidden' : '',\n ]\n .join(' ')\n .trim();\n }\n\n // a11y bindings, ideally always on the host side / never in the sub wrapper within the HTML,\n // cleaner and also attacking the host DOM element rather than its children\n @HostBinding('attr.role') role = 'alert';\n @HostBinding('attr.aria-describedby')\n @Input()\n get ariaDescribedBy(): string {\n return `alertContent-${this.uniqueId}`;\n }\n @HostBinding('attr.tabindex')\n get tabindex(): string {\n return this.isFocusable ? '0' : '-1';\n }\n\n // for e2e unique attr to be defined / pass as input\n @HostBinding('attr.data-e2e')\n @Input()\n e2eAttr = 'eui-alert';\n\n // component own states\n // conventions if boolean : is / has prefix\n // new v17 usage of transform / act like coerce and included in Angular natively now\n @Input({ transform: booleanAttribute }) isMuted = false;\n @Input({ transform: booleanAttribute }) isCloseable = false;\n @Input({ transform: booleanAttribute }) isFocusable = false;\n\n // Output event definition\n // convention : verb(present)Component\n @Output() closeAlert = new EventEmitter<null>();\n\n // contentChild def / viewChild defs if needed\n @ContentChild(forwardRef(() => EuiAlertTitleDirective), { static: false }) alertTitle: QueryList<EuiAlertTitleDirective>;\n\n // public variables used in the template\n isVisible = true;\n alertIconType: string;\n alertIconFillColor: string;\n\n private uniqueId: string;\n\n // CONSTRUCTOR\n // -----------\n constructor(public baseStatesDirective: BaseStatesDirective) {}\n\n // HOOKS\n // -----\n ngOnInit(): void {\n if (!this.baseStatesDirective.euiVariant) {\n this.baseStatesDirective.euiInfo = true;\n }\n this.uniqueId = uuid.v4();\n }\n\n // PUBLIC FUNCTIONS FROM TEMPLATE\n // ------------------------------\n onCloseClick(): void {\n this.isVisible = false;\n this.closeAlert.emit();\n }\n\n // PRIVATES\n // --------\n\n}\n","@if (!isMuted) {\n <div class=\"eui-alert__type-container\">\n @switch(baseStatesDirective.euiVariant) {\n @case('info') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-information\" fillColor=\"info-100\"></eui-icon-svg>\n }\n @case('success') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-check-filled\" fillColor=\"success-100\"></eui-icon-svg>\n }\n @case('warning') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-warning\" fillColor=\"warning-100\"></eui-icon-svg>\n }\n @case('danger') {\n <eui-icon-svg class=\"eui-alert__icon-type\" icon=\"eui-ecl-error\" fillColor=\"danger-100\"></eui-icon-svg>\n }\n }\n </div>\n}\n\n<div id=\"{{ ariaDescribedBy }}\" class=\"eui-alert__content\">\n @if (alertTitle) {\n <ng-template *ngTemplateOutlet=\"contentWithTitle\"></ng-template>\n } @else {\n <ng-template *ngTemplateOutlet=\"contentNoTitle\"></ng-template>\n }\n</div>\n\n<ng-template #contentWithTitle>\n <div class=\"eui-alert__content-header eui-alert__content-header--with-title\">\n <ng-content select=\"eui-alert-title\"></ng-content>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n</ng-template>\n\n<ng-template #contentNoTitle>\n <div class=\"eui-alert__content-header\">\n <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n <ng-template *ngTemplateOutlet=\"closeButton\"></ng-template>\n </div>\n</ng-template>\n\n<ng-template #closeButton>\n <div class=\"eui-alert__close\">\n <button *ngIf=\"isCloseable\"\n euiButton\n euiBasicButton\n euiPrimary\n euiSizeS\n aria-label=\"Close alert button\"\n class=\"eui-u-ml-s\"\n (click)=\"onCloseClick()\">\n <span euiLabel class=\"eui-u-display-hidden-mobile\">{{ 'eui.CLOSE' | translate }}</span>\n <eui-icon-svg icon=\"eui-ecl-close\" class=\"eui-u-ml-xs\"></eui-icon-svg>\n </button>\n </div>\n</ng-template>\n\n<ng-template #content>\n <div [class.eui-u-mt-xs]=\"alertTitle\">\n <ng-content></ng-content>\n </div>\n</ng-template>\n","// Angular\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n// 3rd party\nimport { TranslateModule } from '@ngx-translate/core';\n\n// eUI internals\nimport { BaseStatesDirective } from '@eui/components/shared';\nimport { EuiIconModule } from '@eui/components/eui-icon';\nimport { EuiLabelModule } from '@eui/components/eui-label';\nimport { EuiButtonModule } from '@eui/components/eui-button';\n\n// component internals\nimport { EuiAlertComponent, EuiAlertTitleDirective } from './eui-alert.component';\n\nconst COMPONENTS = [\n EuiAlertComponent,\n EuiAlertTitleDirective,\n];\n\n// component main module\n@NgModule({\n imports: [\n // Angular and 3rd party\n CommonModule, TranslateModule,\n // eUI internals\n BaseStatesDirective,\n EuiIconModule, EuiLabelModule, EuiButtonModule,\n ],\n declarations: [...COMPONENTS],\n exports: [...COMPONENTS],\n})\n// Always same naming convention for all : Eui[CMP_NAME]Module\nexport class EuiAlertModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAuBA;AAEA;MAEa,sBAAsB,CAAA;AADnC,IAAA,WAAA,GAAA;;QAG0B,IAAK,CAAA,KAAA,GAAG,kBAAkB,CAAC;AACpD,KAAA;iIAHY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;qHAAtB,sBAAsB,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EA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