@eui/components 19.1.0-snapshot-1740057996064 → 19.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/components/EuiAccordionComponent.html +30 -0
- package/docs/components/EuiAccordionItemComponent.html +49 -0
- package/docs/components/EuiBlockContentComponent.html +71 -2
- package/docs/dependencies.html +2 -2
- package/docs/directives/EuiAccordionItemHeaderDirective.html +18 -0
- package/docs/js/menu-wc.js +22 -13
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/modules/EuiAccordionModule.html +28 -17
- package/docs/modules/EuiBlockContentModule.html +29 -4
- package/eui-accordion/eui-accordion-item.component.d.ts +45 -2
- package/eui-accordion/eui-accordion-item.component.d.ts.map +1 -1
- package/eui-accordion/eui-accordion.component.d.ts +27 -1
- package/eui-accordion/eui-accordion.component.d.ts.map +1 -1
- package/eui-accordion/eui-accordion.module.d.ts +27 -5
- package/eui-accordion/eui-accordion.module.d.ts.map +1 -1
- package/eui-block-content/eui-block-content.component.d.ts +52 -7
- package/eui-block-content/eui-block-content.component.d.ts.map +1 -1
- package/eui-block-content/eui-block-content.module.d.ts +23 -2
- package/eui-block-content/eui-block-content.module.d.ts.map +1 -1
- package/eui-datepicker/eui-datepicker.component.d.ts.map +1 -1
- package/fesm2022/eui-components-eui-accordion.mjs +112 -13
- package/fesm2022/eui-components-eui-accordion.mjs.map +1 -1
- package/fesm2022/eui-components-eui-block-content.mjs +81 -17
- package/fesm2022/eui-components-eui-block-content.mjs.map +1 -1
- package/fesm2022/eui-components-eui-datepicker.mjs +1 -0
- package/fesm2022/eui-components-eui-datepicker.mjs.map +1 -1
- package/package.json +4 -4
@@ -1,25 +1,51 @@
|
|
1
1
|
import * as i1 from '@angular/cdk/accordion';
|
2
|
-
import { CdkAccordion,
|
2
|
+
import { CdkAccordion, CdkAccordionModule, CdkAccordionItem } from '@angular/cdk/accordion';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { HostBinding, ChangeDetectionStrategy, Component, Directive, NgModule } from '@angular/core';
|
5
5
|
import { consumeEvent } from '@eui/core';
|
6
6
|
import { euiAnimationCollapse, BaseStatesDirective } from '@eui/components/shared';
|
7
|
+
import { CommonModule } from '@angular/common';
|
7
8
|
import * as i2 from '@eui/components/eui-icon';
|
8
9
|
import { EuiIconModule } from '@eui/components/eui-icon';
|
9
|
-
import { CommonModule } from '@angular/common';
|
10
10
|
|
11
|
+
/**
|
12
|
+
* Accordion container component that manages expandable items.
|
13
|
+
* Uses Angular CDK's accordion functionality for managing expansion state.
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* <!-- Single expansion mode -->
|
17
|
+
* <eui-accordion>
|
18
|
+
* <eui-accordion-item>First item</eui-accordion-item>
|
19
|
+
* <eui-accordion-item>Second item</eui-accordion-item>
|
20
|
+
* </eui-accordion>
|
21
|
+
*
|
22
|
+
* <!-- Multiple expansion mode -->
|
23
|
+
* <eui-accordion [isMulti]="true">
|
24
|
+
* <eui-accordion-item>First item</eui-accordion-item>
|
25
|
+
* <eui-accordion-item>Second item</eui-accordion-item>
|
26
|
+
* </eui-accordion>
|
27
|
+
*
|
28
|
+
* @property {boolean} isMulti - When true, allows multiple items to be expanded simultaneously.
|
29
|
+
* When false (default), only one item can be expanded at a time.
|
30
|
+
*/
|
11
31
|
class EuiAccordionComponent {
|
32
|
+
/**
|
33
|
+
* @description
|
34
|
+
* Computes and returns the CSS classes for the component based on its current state.
|
35
|
+
*
|
36
|
+
* @returns {string} Space-separated string of CSS class names
|
37
|
+
*/
|
12
38
|
get cssClasses() {
|
13
39
|
return [
|
14
40
|
'eui-accordion',
|
15
41
|
].join(' ').trim();
|
16
42
|
}
|
17
43
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: EuiAccordionComponent, isStandalone:
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.7", type: EuiAccordionComponent, isStandalone: true, selector: "eui-accordion", host: { properties: { "class": "this.cssClasses" } }, hostDirectives: [{ directive: i1.CdkAccordion, inputs: ["multi", "isMulti"] }], ngImport: i0, template: '<ng-content/>', isInline: true, styles: [".eui-19 :host.eui-accordion{display:flex;width:100%;flex-direction:column}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
19
45
|
}
|
20
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionComponent, decorators: [{
|
21
47
|
type: Component,
|
22
|
-
args: [{ selector: 'eui-accordion', template: '<ng-content/>', changeDetection: ChangeDetectionStrategy.OnPush,
|
48
|
+
args: [{ selector: 'eui-accordion', template: '<ng-content/>', changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
|
23
49
|
{
|
24
50
|
directive: CdkAccordion,
|
25
51
|
inputs: ['multi: isMulti'],
|
@@ -30,7 +56,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
30
56
|
args: ['class']
|
31
57
|
}] } });
|
32
58
|
|
59
|
+
/**
|
60
|
+
* Individual accordion item component that can be expanded/collapsed.
|
61
|
+
* Uses Angular CDK's accordion item functionality for managing expansion state
|
62
|
+
* and includes collapse animation.
|
63
|
+
*
|
64
|
+
* @example
|
65
|
+
* <eui-accordion-item [isExpanded]="true">
|
66
|
+
* <!-- Custom header using directive -->
|
67
|
+
* <eui-accordion-item-header>
|
68
|
+
* Custom Header Content
|
69
|
+
* </eui-accordion-item-header>
|
70
|
+
*
|
71
|
+
* <!-- Content -->
|
72
|
+
* <p>Accordion item content</p>
|
73
|
+
* </eui-accordion-item>
|
74
|
+
*
|
75
|
+
* @property {boolean} isExpanded - Controls whether the item is expanded or collapsed
|
76
|
+
*/
|
33
77
|
class EuiAccordionItemComponent {
|
78
|
+
/**
|
79
|
+
* @description
|
80
|
+
* Computes and returns the CSS classes for the component based on its current state.
|
81
|
+
*
|
82
|
+
* @returns {string} Space-separated string of CSS class names
|
83
|
+
*/
|
34
84
|
get cssClasses() {
|
35
85
|
return [
|
36
86
|
'eui-accordion-item',
|
@@ -39,18 +89,29 @@ class EuiAccordionItemComponent {
|
|
39
89
|
constructor(accItem) {
|
40
90
|
this.accItem = accItem;
|
41
91
|
}
|
92
|
+
/**
|
93
|
+
* Handles the toggle event for expanding/collapsing the accordion item
|
94
|
+
* Prevents event propagation to avoid interfering with parent handlers
|
95
|
+
*
|
96
|
+
* @param event - The toggle event
|
97
|
+
*/
|
42
98
|
onToggle(event) {
|
43
99
|
this.accItem.toggle();
|
44
100
|
consumeEvent(event);
|
45
101
|
}
|
46
102
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionItemComponent, deps: [{ token: i1.CdkAccordionItem }], target: i0.ɵɵFactoryTarget.Component }); }
|
47
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: EuiAccordionItemComponent, isStandalone:
|
103
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.7", type: EuiAccordionItemComponent, isStandalone: true, selector: "eui-accordion-item", host: { properties: { "class": "this.cssClasses" } }, hostDirectives: [{ directive: i1.CdkAccordionItem, inputs: ["expanded", "isExpanded"] }], ngImport: i0, template: "<button class=\"eui-accordion-item__header\" (click)=\"onToggle($event)\" (keydown.enter)=\"onToggle($event)\">\n <ng-content select=\"eui-accordion-item-header\"></ng-content>\n\n <div class=\"eui-accordion-item__header-expander\">\n @if (accItem.expanded) {\n <eui-icon-svg icon=\"eui-ecl-minus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n } @else {\n <eui-icon-svg icon=\"eui-ecl-plus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n }\n </div>\n</button>\n<div [@euiAnimationCollapse]=\"!accItem.expanded\" class=\"eui-accordion-item__body\">\n <ng-content></ng-content>\n</div>\n\n", styles: [":root{--_eui-scrollbars-foreground-color: var(--eui-c-neutral-lightest)}html.eui-t-dark{--_eui-scrollbars-foreground-color: var(--eui-c-neutral-light)}.eui-19 :host.eui-accordion-item{display:flex;flex-direction:column;width:100%;border-bottom:1px solid var(--eui-c-neutral-lightest)}.eui-19 :host.eui-accordion-item .eui-accordion-item__header{display:flex;align-items:center;width:100%;padding:var(--eui-s-l);outline:none;background-color:initial;border:var(--eui-bw-none);text-align:start;cursor:pointer}.eui-19 :host.eui-accordion-item .eui-accordion-item__header:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-accordion-item .eui-accordion-item__header:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-accordion-item .eui-accordion-item__header [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 :host.eui-accordion-item .eui-accordion-item__header:hover{background-color:var(--eui-c-primary-bg)}.eui-19 :host.eui-accordion-item .eui-accordion-item__header-expander{margin-left:auto;padding-left:var(--eui-s-m)}.eui-19 :host.eui-accordion-item .eui-accordion-item__body{padding:var(--eui-s-xs) var(--eui-s-l) var(--eui-s-l) var(--eui-s-l)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: EuiIconModule }, { kind: "component", type: i2.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "ngmodule", type: CdkAccordionModule }], animations: [
|
48
104
|
euiAnimationCollapse,
|
49
105
|
], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
50
106
|
}
|
51
107
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionItemComponent, decorators: [{
|
52
108
|
type: Component,
|
53
|
-
args: [{ selector: 'eui-accordion-item', changeDetection: ChangeDetectionStrategy.OnPush,
|
109
|
+
args: [{ selector: 'eui-accordion-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
110
|
+
CommonModule,
|
111
|
+
EuiIconModule,
|
112
|
+
CdkAccordionModule,
|
113
|
+
BaseStatesDirective,
|
114
|
+
], hostDirectives: [
|
54
115
|
{
|
55
116
|
directive: CdkAccordionItem,
|
56
117
|
inputs: [
|
@@ -64,27 +125,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
64
125
|
type: HostBinding,
|
65
126
|
args: ['class']
|
66
127
|
}] } });
|
67
|
-
|
128
|
+
/**
|
129
|
+
* Directive for customizing the header content of an accordion item.
|
130
|
+
*
|
131
|
+
* @example
|
132
|
+
* <eui-accordion-item>
|
133
|
+
* <eui-accordion-item-header>
|
134
|
+
* <div class="custom-header">
|
135
|
+
* <eui-icon name="info"></eui-icon>
|
136
|
+
* <span>Custom Header</span>
|
137
|
+
* </div>
|
138
|
+
* </eui-accordion-item-header>
|
139
|
+
* </eui-accordion-item>
|
140
|
+
*/
|
141
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
68
142
|
class EuiAccordionItemHeaderDirective {
|
69
143
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionItemHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
70
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.7", type: EuiAccordionItemHeaderDirective, isStandalone:
|
144
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.7", type: EuiAccordionItemHeaderDirective, isStandalone: true, selector: "eui-accordion-item-header", ngImport: i0 }); }
|
71
145
|
}
|
72
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionItemHeaderDirective, decorators: [{
|
73
147
|
type: Directive,
|
74
|
-
args: [{ selector: 'eui-accordion-item-header', standalone:
|
148
|
+
args: [{ selector: 'eui-accordion-item-header', standalone: true }]
|
75
149
|
}] });
|
76
150
|
|
151
|
+
/**
|
152
|
+
* Module providing accordion functionality with expandable items.
|
153
|
+
*
|
154
|
+
* Contains:
|
155
|
+
* - {@link EuiAccordionComponent} - Main accordion container
|
156
|
+
* - {@link EuiAccordionItemComponent} - Individual expandable items
|
157
|
+
* - {@link EuiAccordionItemHeaderDirective} - Custom header content for items
|
158
|
+
*
|
159
|
+
* @example
|
160
|
+
* import { EuiAccordionModule } from '@eui/components/eui-accordion';
|
161
|
+
*
|
162
|
+
* @NgModule({
|
163
|
+
* imports: [EuiAccordionModule]
|
164
|
+
* })
|
165
|
+
* export class MyModule {}
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* <eui-accordion>
|
169
|
+
* <eui-accordion-item>
|
170
|
+
* <ng-container euiAccordionItemHeader>
|
171
|
+
* Custom Header Content
|
172
|
+
* </ng-container>
|
173
|
+
* Item content
|
174
|
+
* </eui-accordion-item>
|
175
|
+
* </eui-accordion>
|
176
|
+
*/
|
77
177
|
class EuiAccordionModule {
|
78
178
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
79
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule,
|
80
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule, imports: [
|
179
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule, imports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective], exports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective] }); }
|
180
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule, imports: [EuiAccordionItemComponent] }); }
|
81
181
|
}
|
82
182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiAccordionModule, decorators: [{
|
83
183
|
type: NgModule,
|
84
184
|
args: [{
|
85
|
-
imports: [
|
185
|
+
imports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],
|
86
186
|
exports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],
|
87
|
-
declarations: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],
|
88
187
|
}]
|
89
188
|
}] });
|
90
189
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eui-components-eui-accordion.mjs","sources":["../../eui-accordion/eui-accordion.component.ts","../../eui-accordion/eui-accordion-item.component.ts","../../eui-accordion/eui-accordion-item.component.html","../../eui-accordion/eui-accordion.module.ts","../../eui-accordion/eui-components-eui-accordion.ts"],"sourcesContent":["import { CdkAccordion } from '@angular/cdk/accordion';\nimport { Component, HostBinding, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'eui-accordion',\n template: '<ng-content/>',\n styleUrls: ['./styles/accordion.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n hostDirectives: [\n {\n directive: CdkAccordion,\n inputs: [ 'multi: isMulti' ],\n },\n ],\n})\nexport class EuiAccordionComponent {\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n 'eui-accordion',\n ].join(' ').trim();\n }\n}\n","import { CdkAccordionItem } from '@angular/cdk/accordion';\nimport { Component, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Directive } from '@angular/core';\nimport { consumeEvent } from '@eui/core';\nimport { euiAnimationCollapse } from '@eui/components/shared';\n\n@Component({\n selector: 'eui-accordion-item',\n templateUrl: './eui-accordion-item.component.html',\n styleUrl: './styles/accordion-item.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n hostDirectives: [\n {\n directive: CdkAccordionItem,\n inputs: [\n 'expanded: isExpanded',\n ],\n },\n ],\n animations: [\n euiAnimationCollapse,\n ],\n})\nexport class EuiAccordionItemComponent {\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n 'eui-accordion-item',\n ].join(' ').trim();\n }\n\n constructor(\n protected accItem: CdkAccordionItem,\n ) {\n }\n\n onToggle(event: Event): void {\n this.accItem.toggle();\n consumeEvent(event);\n }\n\n}\n\n/* eslint-disable */\n@Directive({ selector: 'eui-accordion-item-header', standalone: false })\nexport class EuiAccordionItemHeaderDirective{ }\n/* eslint-enable */\n","<button class=\"eui-accordion-item__header\" (click)=\"onToggle($event)\" (keydown.enter)=\"onToggle($event)\">\n <ng-content select=\"eui-accordion-item-header\"></ng-content>\n\n <div class=\"eui-accordion-item__header-expander\">\n @if (accItem.expanded) {\n <eui-icon-svg icon=\"eui-ecl-minus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n } @else {\n <eui-icon-svg icon=\"eui-ecl-plus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n }\n </div>\n</button>\n<div [@euiAnimationCollapse]=\"!accItem.expanded\" class=\"eui-accordion-item__body\">\n <ng-content></ng-content>\n</div>\n\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CdkAccordionModule } from '@angular/cdk/accordion';\nimport { BaseStatesDirective } from '@eui/components/shared';\n\nimport { EuiAccordionComponent } from './eui-accordion.component';\nimport { EuiAccordionItemComponent, EuiAccordionItemHeaderDirective } from './eui-accordion-item.component';\nimport { EuiIconModule } from '@eui/components/eui-icon';\n\n@NgModule({\n imports: [CommonModule, EuiIconModule, CdkAccordionModule, BaseStatesDirective],\n exports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],\n declarations: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],\n})\nexport class EuiAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAgBa,qBAAqB,CAAA;AAC9B,IAAA,IACW,UAAU,GAAA;QACjB,OAAO;YACH,eAAe;AAClB,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;;8GALb,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,gNAXpB,eAAe,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,8EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAWhB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,SAAS;+BACI,eAAe,EAAA,QAAA,EACf,eAAe,EAER,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,KAAK,EACD,cAAA,EAAA;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,YAAY;4BACvB,MAAM,EAAE,CAAE,gBAAgB,CAAE;AAC/B,yBA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EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,iBAFZ,qBAAqB,EAAE,yBAAyB,EAAE,+BAA+B,aAFtF,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,CAAA,EAAA,OAAA,EAAA,CACpE,qBAAqB,EAAE,yBAAyB,EAAE,+BAA+B,CAAA,EAAA,CAAA,CAAA;AAGlF,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,EAJjB,OAAA,EAAA,CAAA,YAAY,EAAE,aAAa,EAAE,kBAAkB,CAAA,EAAA,CAAA,CAAA;;2FAIhD,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,CAAC;AAC/E,oBAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,+BAA+B,CAAC;AAC5F,oBAAA,YAAY,EAAE,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,+BAA+B,CAAC;AACpG,iBAAA;;;ACbD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"eui-components-eui-accordion.mjs","sources":["../../eui-accordion/eui-accordion.component.ts","../../eui-accordion/eui-accordion-item.component.ts","../../eui-accordion/eui-accordion-item.component.html","../../eui-accordion/eui-accordion.module.ts","../../eui-accordion/eui-components-eui-accordion.ts"],"sourcesContent":["import { CdkAccordion } from '@angular/cdk/accordion';\nimport { Component, HostBinding, ChangeDetectionStrategy } from '@angular/core';\n\n/**\n * Accordion container component that manages expandable items.\n * Uses Angular CDK's accordion functionality for managing expansion state.\n *\n * @example\n * <!-- Single expansion mode -->\n * <eui-accordion>\n * <eui-accordion-item>First item</eui-accordion-item>\n * <eui-accordion-item>Second item</eui-accordion-item>\n * </eui-accordion>\n *\n * <!-- Multiple expansion mode -->\n * <eui-accordion [isMulti]=\"true\">\n * <eui-accordion-item>First item</eui-accordion-item>\n * <eui-accordion-item>Second item</eui-accordion-item>\n * </eui-accordion>\n *\n * @property {boolean} isMulti - When true, allows multiple items to be expanded simultaneously.\n * When false (default), only one item can be expanded at a time.\n */\n@Component({\n selector: 'eui-accordion',\n template: '<ng-content/>',\n styleUrls: ['./styles/accordion.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: CdkAccordion,\n inputs: [ 'multi: isMulti' ],\n },\n ],\n})\nexport class EuiAccordionComponent {\n /**\n * @description\n * Computes and returns the CSS classes for the component based on its current state.\n *\n * @returns {string} Space-separated string of CSS class names\n */\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n 'eui-accordion',\n ].join(' ').trim();\n }\n}\n","import { CdkAccordionItem, CdkAccordionModule } from '@angular/cdk/accordion';\nimport { Component, HostBinding, ChangeDetectionStrategy, Directive } from '@angular/core';\nimport { consumeEvent } from '@eui/core';\nimport { euiAnimationCollapse } from '@eui/components/shared';\nimport { CommonModule } from '@angular/common';\nimport { EuiIconModule } from '@eui/components/eui-icon';\nimport { BaseStatesDirective } from '@eui/components/shared';\n\n/**\n * Individual accordion item component that can be expanded/collapsed.\n * Uses Angular CDK's accordion item functionality for managing expansion state\n * and includes collapse animation.\n *\n * @example\n * <eui-accordion-item [isExpanded]=\"true\">\n * <!-- Custom header using directive -->\n * <eui-accordion-item-header>\n * Custom Header Content\n * </eui-accordion-item-header>\n *\n * <!-- Content -->\n * <p>Accordion item content</p>\n * </eui-accordion-item>\n *\n * @property {boolean} isExpanded - Controls whether the item is expanded or collapsed\n */\n@Component({\n selector: 'eui-accordion-item',\n templateUrl: './eui-accordion-item.component.html',\n styleUrl: './styles/accordion-item.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n CommonModule,\n EuiIconModule,\n CdkAccordionModule,\n BaseStatesDirective,\n ],\n hostDirectives: [\n {\n directive: CdkAccordionItem,\n inputs: [\n 'expanded: isExpanded',\n ],\n },\n ],\n animations: [\n euiAnimationCollapse,\n ],\n})\nexport class EuiAccordionItemComponent {\n /**\n * @description\n * Computes and returns the CSS classes for the component based on its current state.\n *\n * @returns {string} Space-separated string of CSS class names\n */\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n 'eui-accordion-item',\n ].join(' ').trim();\n }\n\n constructor(\n protected accItem: CdkAccordionItem,\n ) {\n }\n\n /**\n * Handles the toggle event for expanding/collapsing the accordion item\n * Prevents event propagation to avoid interfering with parent handlers\n *\n * @param event - The toggle event\n */\n onToggle(event: Event): void {\n this.accItem.toggle();\n consumeEvent(event);\n }\n}\n\n/**\n * Directive for customizing the header content of an accordion item.\n *\n * @example\n * <eui-accordion-item>\n * <eui-accordion-item-header>\n * <div class=\"custom-header\">\n * <eui-icon name=\"info\"></eui-icon>\n * <span>Custom Header</span>\n * </div>\n * </eui-accordion-item-header>\n * </eui-accordion-item>\n */\n// eslint-disable-next-line @angular-eslint/directive-selector\n@Directive({ selector: 'eui-accordion-item-header', standalone: true })\nexport class EuiAccordionItemHeaderDirective { }\n","<button class=\"eui-accordion-item__header\" (click)=\"onToggle($event)\" (keydown.enter)=\"onToggle($event)\">\n <ng-content select=\"eui-accordion-item-header\"></ng-content>\n\n <div class=\"eui-accordion-item__header-expander\">\n @if (accItem.expanded) {\n <eui-icon-svg icon=\"eui-ecl-minus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n } @else {\n <eui-icon-svg icon=\"eui-ecl-plus\" size=\"s\" fillColor=\"primary\"></eui-icon-svg>\n }\n </div>\n</button>\n<div [@euiAnimationCollapse]=\"!accItem.expanded\" class=\"eui-accordion-item__body\">\n <ng-content></ng-content>\n</div>\n\n","import { NgModule } from '@angular/core';\nimport { EuiAccordionComponent } from './eui-accordion.component';\nimport { EuiAccordionItemComponent, EuiAccordionItemHeaderDirective } from './eui-accordion-item.component';\n\n/**\n * Module providing accordion functionality with expandable items.\n *\n * Contains:\n * - {@link EuiAccordionComponent} - Main accordion container\n * - {@link EuiAccordionItemComponent} - Individual expandable items\n * - {@link EuiAccordionItemHeaderDirective} - Custom header content for items\n *\n * @example\n * import { EuiAccordionModule } from '@eui/components/eui-accordion';\n *\n * @NgModule({\n * imports: [EuiAccordionModule]\n * })\n * export class MyModule {}\n *\n * @example\n * <eui-accordion>\n * <eui-accordion-item>\n * <ng-container euiAccordionItemHeader>\n * Custom Header Content\n * </ng-container>\n * Item content\n * </eui-accordion-item>\n * </eui-accordion>\n */\n@NgModule({\n imports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],\n exports: [EuiAccordionComponent, EuiAccordionItemComponent, EuiAccordionItemHeaderDirective],\n})\nexport class EuiAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;;;;;;;;;;;;;;;;;AAmBG;MAaU,qBAAqB,CAAA;AAC9B;;;;;AAKG;AACH,IAAA,IACW,UAAU,GAAA;QACjB,OAAO;YACH,eAAe;AAClB,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;;8GAXb,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,+MAVpB,eAAe,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,8EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUhB,q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{ booleanAttribute, Input, HostBinding, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
3
|
-
import { CommonModule } from '@angular/common';
|
4
3
|
|
4
|
+
/**
|
5
|
+
* @description
|
6
|
+
* Component that wraps content and manages focus state when content is blocked.
|
7
|
+
* Provides accessibility attributes and handles focus restoration when blocking/unblocking.
|
8
|
+
*
|
9
|
+
* @example
|
10
|
+
* <!-- Basic usage -->
|
11
|
+
* <eui-block-content>
|
12
|
+
* <div>Content that can be blocked</div>
|
13
|
+
* </eui-block-content>
|
14
|
+
*
|
15
|
+
* <!-- Blocked state with custom accessibility -->
|
16
|
+
* <eui-block-content
|
17
|
+
* [isBlocked]="true"
|
18
|
+
* role="dialog"
|
19
|
+
* ariaLabel="Loading content">
|
20
|
+
* <div>This content is blocked</div>
|
21
|
+
* </eui-block-content>
|
22
|
+
*/
|
5
23
|
class EuiBlockContentComponent {
|
24
|
+
/** CSS classes applied to the host element */
|
6
25
|
get cssClasses() {
|
7
26
|
return [
|
8
27
|
'eui-block-content',
|
@@ -12,16 +31,33 @@ class EuiBlockContentComponent {
|
|
12
31
|
constructor(elRef, renderer) {
|
13
32
|
this.elRef = elRef;
|
14
33
|
this.renderer = renderer;
|
34
|
+
/**
|
35
|
+
* ARIA role for the content wrapper
|
36
|
+
* @default 'region'
|
37
|
+
*/
|
15
38
|
this.role = 'region';
|
39
|
+
/**
|
40
|
+
* ARIA label for the content wrapper
|
41
|
+
* @default 'block content wrapper'
|
42
|
+
*/
|
16
43
|
this.ariaLabel = 'block content wrapper';
|
44
|
+
/**
|
45
|
+
* Whether the content is currently blocked
|
46
|
+
* When true, focused elements within will be blurred and state saved
|
47
|
+
* @default false
|
48
|
+
*/
|
17
49
|
this.isBlocked = false;
|
18
|
-
/**
|
50
|
+
/** Stores the element that was focused before content was blocked */
|
19
51
|
this.lastActiveElement = null;
|
20
52
|
}
|
53
|
+
/**
|
54
|
+
* Handles changes to the blocked state.
|
55
|
+
* Manages focus when content is blocked or unblocked.
|
56
|
+
*/
|
21
57
|
ngOnChanges(changes) {
|
22
58
|
if (changes['isBlocked']) {
|
23
59
|
const activeElement = this.getActiveElement();
|
24
|
-
const isBlocking = this.isAboutToBlock(changes);
|
60
|
+
const isBlocking = this.isAboutToBlock(changes['isBlocked']);
|
25
61
|
if (isBlocking) {
|
26
62
|
this.deactivateElement(activeElement);
|
27
63
|
}
|
@@ -31,7 +67,10 @@ class EuiBlockContentComponent {
|
|
31
67
|
}
|
32
68
|
}
|
33
69
|
/**
|
34
|
-
*
|
70
|
+
* Removes focus from the currently focused element when blocking
|
71
|
+
* Stores the element reference for later restoration
|
72
|
+
*
|
73
|
+
* @param activeElement - The currently focused element
|
35
74
|
*/
|
36
75
|
deactivateElement(activeElement) {
|
37
76
|
if (activeElement) {
|
@@ -43,7 +82,9 @@ class EuiBlockContentComponent {
|
|
43
82
|
}
|
44
83
|
}
|
45
84
|
/**
|
46
|
-
* focus
|
85
|
+
* Restores focus to the previously focused element when unblocking
|
86
|
+
*
|
87
|
+
* @param element - The element that was previously focused
|
47
88
|
*/
|
48
89
|
reactivateElement(element) {
|
49
90
|
if (element) {
|
@@ -51,26 +92,28 @@ class EuiBlockContentComponent {
|
|
51
92
|
}
|
52
93
|
}
|
53
94
|
/**
|
54
|
-
*
|
95
|
+
* Determines if the content is transitioning to a blocked state
|
55
96
|
*
|
56
|
-
* @param
|
97
|
+
* @param change - Angular SimpleChange object
|
98
|
+
* @returns true if the content is being blocked, false otherwise
|
57
99
|
*/
|
58
|
-
isAboutToBlock(
|
59
|
-
|
60
|
-
return isBlockedChange?.currentValue && !isBlockedChange.previousValue;
|
100
|
+
isAboutToBlock(change) {
|
101
|
+
return change?.currentValue && !change.previousValue;
|
61
102
|
}
|
62
103
|
/**
|
63
|
-
*
|
104
|
+
* Finds the currently focused element within the block content
|
105
|
+
*
|
106
|
+
* @returns The currently focused HTMLElement or null if none found
|
64
107
|
*/
|
65
108
|
getActiveElement() {
|
66
109
|
return this.elRef.nativeElement.querySelector(':focus');
|
67
110
|
}
|
68
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
69
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.7", type: EuiBlockContentComponent, isStandalone:
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.1.7", type: EuiBlockContentComponent, isStandalone: true, selector: "eui-block-content", inputs: { role: "role", ariaLabel: "ariaLabel", isBlocked: ["isBlocked", "isBlocked", booleanAttribute] }, host: { properties: { "class": "this.cssClasses", "attr.role": "this.role", "attr.aria-label": "this.ariaLabel" } }, usesOnChanges: true, ngImport: i0, template: '<ng-content/>', isInline: true, styles: [".eui-19 :host.eui-block-content{display:block;position:relative}.eui-19 :host.eui-block-content--blocked{min-height:114px}.eui-19 :host.eui-block-content--blocked:before{border-top:var(--eui-s-2xs) solid currentcolor;border-right:var(--eui-s-2xs) solid currentcolor;border-bottom-style:solid;border-left-style:solid;border-radius:var(--eui-br-max);border-bottom-width:var(--eui-s-2xs);border-left-width:var(--eui-s-2xs);border-bottom-color:var(--eui-c-neutral-lightest);border-left-color:var(--eui-c-neutral-lightest);color:var(--eui-c-primary);-webkit-animation:spin .65s linear infinite;animation:spin .65s linear infinite;display:block;height:80px;left:50%;margin:-40px 0 0 -40px;top:50%;content:\"\";position:absolute;width:80px;z-index:var(--eui-zi-overlay)}.eui-19 :host.eui-block-content--blocked:after{background-color:#fff6;content:\"\";height:100%;left:0;position:absolute;top:0;width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
70
113
|
}
|
71
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentComponent, decorators: [{
|
72
115
|
type: Component,
|
73
|
-
args: [{ selector: 'eui-block-content', template: '<ng-content/>', changeDetection: ChangeDetectionStrategy.OnPush,
|
116
|
+
args: [{ selector: 'eui-block-content', template: '<ng-content/>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [".eui-19 :host.eui-block-content{display:block;position:relative}.eui-19 :host.eui-block-content--blocked{min-height:114px}.eui-19 :host.eui-block-content--blocked:before{border-top:var(--eui-s-2xs) solid currentcolor;border-right:var(--eui-s-2xs) solid currentcolor;border-bottom-style:solid;border-left-style:solid;border-radius:var(--eui-br-max);border-bottom-width:var(--eui-s-2xs);border-left-width:var(--eui-s-2xs);border-bottom-color:var(--eui-c-neutral-lightest);border-left-color:var(--eui-c-neutral-lightest);color:var(--eui-c-primary);-webkit-animation:spin .65s linear infinite;animation:spin .65s linear infinite;display:block;height:80px;left:50%;margin:-40px 0 0 -40px;top:50%;content:\"\";position:absolute;width:80px;z-index:var(--eui-zi-overlay)}.eui-19 :host.eui-block-content--blocked:after{background-color:#fff6;content:\"\";height:100%;left:0;position:absolute;top:0;width:100%}\n"] }]
|
74
117
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { cssClasses: [{
|
75
118
|
type: HostBinding,
|
76
119
|
args: ['class']
|
@@ -89,17 +132,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
89
132
|
args: [{ transform: booleanAttribute }]
|
90
133
|
}] } });
|
91
134
|
|
135
|
+
/**
|
136
|
+
* @deprecated Import the standalone {@link EuiBlockContentComponent} instead.
|
137
|
+
* This module is maintained for backward compatibility.
|
138
|
+
*
|
139
|
+
* @example
|
140
|
+
* // Instead of importing the module:
|
141
|
+
* // import { EuiBlockContentModule } from '@eui/components/eui-block-content';
|
142
|
+
*
|
143
|
+
* // Import the standalone component:
|
144
|
+
* import { EuiBlockContentComponent } from '@eui/components/eui-block-content';
|
145
|
+
*
|
146
|
+
* @example
|
147
|
+
* // Instead of adding to NgModule imports:
|
148
|
+
* // @NgModule({
|
149
|
+
* // imports: [EuiBlockContentModule]
|
150
|
+
* // })
|
151
|
+
*
|
152
|
+
* // Add the standalone component:
|
153
|
+
* @NgModule({
|
154
|
+
* imports: [EuiBlockContentComponent]
|
155
|
+
* })
|
156
|
+
*/
|
92
157
|
class EuiBlockContentModule {
|
93
158
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
94
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule,
|
95
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule
|
159
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule, imports: [EuiBlockContentComponent], exports: [EuiBlockContentComponent] }); }
|
160
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule }); }
|
96
161
|
}
|
97
162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: EuiBlockContentModule, decorators: [{
|
98
163
|
type: NgModule,
|
99
164
|
args: [{
|
100
|
-
imports: [
|
165
|
+
imports: [EuiBlockContentComponent],
|
101
166
|
exports: [EuiBlockContentComponent],
|
102
|
-
declarations: [EuiBlockContentComponent],
|
103
167
|
}]
|
104
168
|
}] });
|
105
169
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"eui-components-eui-block-content.mjs","sources":["../../eui-block-content/eui-block-content.component.ts","../../eui-block-content/eui-block-content.module.ts","../../eui-block-content/eui-components-eui-block-content.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n ChangeDetectionStrategy,\n HostBinding,\n booleanAttribute,\n} from '@angular/core';\n\n@Component({\n selector: 'eui-block-content',\n template: '<ng-content/>',\n styleUrls: ['./eui-block-content.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n
|
1
|
+
{"version":3,"file":"eui-components-eui-block-content.mjs","sources":["../../eui-block-content/eui-block-content.component.ts","../../eui-block-content/eui-block-content.module.ts","../../eui-block-content/eui-components-eui-block-content.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n OnChanges,\n Renderer2,\n SimpleChanges,\n ChangeDetectionStrategy,\n HostBinding,\n booleanAttribute,\n SimpleChange,\n} from '@angular/core';\n\n/**\n * @description\n * Component that wraps content and manages focus state when content is blocked.\n * Provides accessibility attributes and handles focus restoration when blocking/unblocking.\n *\n * @example\n * <!-- Basic usage -->\n * <eui-block-content>\n * <div>Content that can be blocked</div>\n * </eui-block-content>\n *\n * <!-- Blocked state with custom accessibility -->\n * <eui-block-content\n * [isBlocked]=\"true\"\n * role=\"dialog\"\n * ariaLabel=\"Loading content\">\n * <div>This content is blocked</div>\n * </eui-block-content>\n */\n@Component({\n selector: 'eui-block-content',\n template: '<ng-content/>',\n styleUrls: ['./eui-block-content.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EuiBlockContentComponent implements OnChanges {\n /** CSS classes applied to the host element */\n @HostBinding('class')\n public get cssClasses(): string {\n return [\n 'eui-block-content',\n this.isBlocked ? 'eui-block-content--blocked' : '',\n ].join(' ').trim();\n }\n\n /**\n * ARIA role for the content wrapper\n * @default 'region'\n */\n @Input() @HostBinding('attr.role') role = 'region';\n\n /**\n * ARIA label for the content wrapper\n * @default 'block content wrapper'\n */\n @Input() @HostBinding('attr.aria-label') ariaLabel = 'block content wrapper';\n\n /**\n * Whether the content is currently blocked\n * When true, focused elements within will be blurred and state saved\n * @default false\n */\n @Input({ transform: booleanAttribute }) isBlocked = false;\n\n /** Stores the element that was focused before content was blocked */\n private lastActiveElement: HTMLElement = null;\n\n constructor(\n private elRef: ElementRef,\n private renderer: Renderer2,\n ) {}\n\n /**\n * Handles changes to the blocked state.\n * Manages focus when content is blocked or unblocked.\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['isBlocked']) {\n const activeElement = this.getActiveElement();\n const isBlocking = this.isAboutToBlock(changes['isBlocked']);\n\n if (isBlocking) {\n this.deactivateElement(activeElement);\n } else {\n this.reactivateElement(this.lastActiveElement);\n }\n }\n }\n\n /**\n * Removes focus from the currently focused element when blocking\n * Stores the element reference for later restoration\n *\n * @param activeElement - The currently focused element\n */\n deactivateElement(activeElement: HTMLElement): void {\n if (activeElement) {\n this.renderer.selectRootElement(activeElement, true).blur();\n this.lastActiveElement = activeElement;\n } else {\n this.lastActiveElement = null;\n }\n }\n\n /**\n * Restores focus to the previously focused element when unblocking\n *\n * @param element - The element that was previously focused\n */\n reactivateElement(element: HTMLElement): void {\n if (element) {\n this.renderer.selectRootElement(element, true).focus();\n }\n }\n\n /**\n * Determines if the content is transitioning to a blocked state\n *\n * @param change - Angular SimpleChange object\n * @returns true if the content is being blocked, false otherwise\n */\n private isAboutToBlock(change: SimpleChange): boolean {\n return change?.currentValue && !change.previousValue;\n }\n\n /**\n * Finds the currently focused element within the block content\n *\n * @returns The currently focused HTMLElement or null if none found\n */\n private getActiveElement(): HTMLElement {\n return this.elRef.nativeElement.querySelector(':focus');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { EuiBlockContentComponent } from './eui-block-content.component';\n\n/**\n * @deprecated Import the standalone {@link EuiBlockContentComponent} instead.\n * This module is maintained for backward compatibility.\n *\n * @example\n * // Instead of importing the module:\n * // import { EuiBlockContentModule } from '@eui/components/eui-block-content';\n *\n * // Import the standalone component:\n * import { EuiBlockContentComponent } from '@eui/components/eui-block-content';\n *\n * @example\n * // Instead of adding to NgModule imports:\n * // @NgModule({\n * // imports: [EuiBlockContentModule]\n * // })\n *\n * // Add the standalone component:\n * @NgModule({\n * imports: [EuiBlockContentComponent]\n * })\n */\n@NgModule({\n imports: [EuiBlockContentComponent],\n exports: [EuiBlockContentComponent],\n})\nexport class EuiBlockContentModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAaA;;;;;;;;;;;;;;;;;;AAkBG;MAOU,wBAAwB,CAAA;;AAEjC,IAAA,IACW,UAAU,GAAA;QACjB,OAAO;YACH,mBAAmB;YACnB,IAAI,CAAC,SAAS,GAAG,4BAA4B,GAAG,EAAE;AACrD,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;;IAyBtB,WACY,CAAA,KAAiB,EACjB,QAAmB,EAAA;QADnB,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAQ,CAAA,QAAA,GAAR,QAAQ;AAxBpB;;;AAGG;QACgC,IAAI,CAAA,IAAA,GAAG,QAAQ;AAElD;;;AAGG;QACsC,IAAS,CAAA,SAAA,GAAG,uBAAuB;AAE5E;;;;AAIG;QACqC,IAAS,CAAA,SAAA,GAAG,KAAK;;QAGjD,IAAiB,CAAA,iBAAA,GAAgB,IAAI;;AAO7C;;;AAGG;AACH,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE;AACtB,YAAA,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAE5D,IAAI,UAAU,EAAE;AACZ,gBAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC;;iBAClC;AACH,gBAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,iBAAiB,CAAC;;;;AAK1D;;;;;AAKG;AACH,IAAA,iBAAiB,CAAC,aAA0B,EAAA;QACxC,IAAI,aAAa,EAAE;AACf,YAAA,IAAI,CAAC,QAAQ,CAA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,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAIhB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBANpC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EACnB,QAAA,EAAA,eAAe,EAER,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,w4BAAA,CAAA,EAAA;uGAKpC,UAAU,EAAA,CAAA;sBADpB,WAAW;uBAAC,OAAO;gBAYe,IAAI,EAAA,CAAA;sBAAtC;;sBAAS,WAAW;uBAAC,WAAW;gBAMQ,SAAS,EAAA,CAAA;sBAAjD;;sBAAS,WAAW;uBAAC,iBAAiB;gBAOC,SAAS,EAAA,CAAA;sBAAhD,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;;;AC9D1C;;;;;;;;;;;;;;;;;;;;;AAqBG;MAKU,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAArB,qBAAqB,EAAA,OAAA,EAAA,CAHpB,wBAAwB,CAAA,EAAA,OAAA,EAAA,CACxB,wBAAwB,CAAA,EAAA,CAAA,CAAA;+GAEzB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACtC,iBAAA;;;AC5BD;;AAEG;;;;"}
|
@@ -314,6 +314,7 @@ class EuiDatepickerComponent {
|
|
314
314
|
if (this.euiActionButtons) {
|
315
315
|
this.calendar.registerActions(this.templatePortal);
|
316
316
|
}
|
317
|
+
this.calendar['_overlayRef']['_pane'].classList.add('eui-19');
|
317
318
|
this.calendar['_overlayRef']['_backdropClick'].pipe(takeUntil(this.destroy$)).subscribe(() => {
|
318
319
|
this.closeCalendar();
|
319
320
|
});
|