@angular/material 19.2.2 → 19.2.3
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/autocomplete/index.d.ts +83 -124
- package/autocomplete/testing/index.d.ts +5 -11
- package/badge/index.d.ts +17 -30
- package/badge/testing/index.d.ts +5 -8
- package/bottom-sheet/index.d.ts +88 -103
- package/bottom-sheet/testing/index.d.ts +4 -6
- package/button/index.d.ts +109 -148
- package/button/testing/index.d.ts +6 -10
- package/button-toggle/index.d.ts +116 -142
- package/button-toggle/testing/index.d.ts +34 -36
- package/card/index.d.ts +79 -117
- package/card/testing/index.d.ts +11 -15
- package/checkbox/index.d.ts +55 -85
- package/checkbox/testing/index.d.ts +6 -10
- package/chips/index.d.ts +592 -690
- package/chips/testing/index.d.ts +78 -93
- package/core/index.d.ts +565 -669
- package/core/testing/index.d.ts +28 -32
- package/datepicker/index.d.ts +1323 -1479
- package/datepicker/testing/index.d.ts +109 -119
- package/dialog/index.d.ts +194 -246
- package/dialog/testing/index.d.ts +17 -26
- package/divider/index.d.ts +4 -10
- package/divider/testing/index.d.ts +4 -6
- package/expansion/index.d.ts +137 -189
- package/expansion/testing/index.d.ts +25 -31
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +26 -17
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +3 -7
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +0 -4
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +5 -4
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +6 -6
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +0 -4
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +5 -5
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +0 -4
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +7 -7
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +42 -18
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +4 -8
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +0 -4
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +2 -6
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +0 -2
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +0 -4
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +0 -4
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +0 -4
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +15 -7
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input.mjs +0 -4
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +1 -1
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +2 -6
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +15 -7
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +10 -6
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs +0 -4
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +5 -5
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs +0 -4
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +5 -5
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +5 -4
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +14 -10
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs +1 -1
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +9 -9
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +0 -4
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +0 -4
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +5 -5
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +10 -6
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +10 -6
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs +0 -4
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +8 -15
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +1 -5
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +0 -4
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +15 -7
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +0 -4
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/index.d.ts +251 -318
- package/form-field/testing/control/index.d.ts +2 -2
- package/form-field/testing/index.d.ts +14 -21
- package/grid-list/index.d.ts +124 -150
- package/grid-list/testing/index.d.ts +39 -44
- package/icon/index.d.ts +87 -108
- package/icon/testing/index.d.ts +38 -43
- package/index.d.ts +2 -3
- package/input/index.d.ts +27 -61
- package/input/testing/index.d.ts +16 -19
- package/list/index.d.ts +158 -241
- package/list/testing/index.d.ts +157 -179
- package/menu/index.d.ts +180 -231
- package/menu/testing/index.d.ts +17 -23
- package/package.json +2 -2
- package/paginator/index.d.ts +84 -97
- package/paginator/testing/index.d.ts +10 -14
- package/progress-bar/index.d.ts +38 -58
- package/progress-bar/testing/index.d.ts +7 -10
- package/progress-spinner/index.d.ts +38 -51
- package/progress-spinner/testing/index.d.ts +7 -10
- package/radio/index.d.ts +145 -168
- package/radio/testing/index.d.ts +61 -67
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/theme-color/index_bundled.js +2 -2
- package/schematics/ng-generate/theme-color/schema.json +10 -0
- package/schematics/ng-update/index_bundled.js +31 -31
- package/select/index.d.ts +77 -130
- package/select/testing/index.d.ts +10 -15
- package/sidenav/index.d.ts +47 -91
- package/sidenav/testing/index.d.ts +58 -63
- package/slide-toggle/index.d.ts +51 -84
- package/slide-toggle/testing/index.d.ts +17 -21
- package/slider/index.d.ts +277 -327
- package/slider/testing/index.d.ts +42 -47
- package/snack-bar/index.d.ts +147 -185
- package/snack-bar/testing/index.d.ts +7 -9
- package/sort/index.d.ts +94 -124
- package/sort/testing/index.d.ts +21 -24
- package/stepper/index.d.ts +108 -165
- package/stepper/testing/index.d.ts +43 -52
- package/table/index.d.ts +87 -153
- package/table/testing/index.d.ts +64 -78
- package/tabs/index.d.ts +306 -382
- package/tabs/testing/index.d.ts +67 -76
- package/timepicker/index.d.ts +123 -159
- package/timepicker/testing/index.d.ts +20 -26
- package/toolbar/index.d.ts +13 -25
- package/toolbar/testing/index.d.ts +13 -16
- package/tooltip/index.d.ts +88 -117
- package/tooltip/testing/index.d.ts +7 -10
- package/tree/index.d.ts +116 -163
- package/tree/testing/index.d.ts +52 -58
package/expansion/index.d.ts
CHANGED
|
@@ -1,174 +1,89 @@
|
|
|
1
|
-
import { AfterContentInit } from '@angular/core';
|
|
2
|
-
import { AfterViewInit } from '@angular/core';
|
|
3
|
-
import { CdkAccordion } from '@angular/cdk/accordion';
|
|
4
|
-
import { CdkAccordionItem } from '@angular/cdk/accordion';
|
|
5
|
-
import { ElementRef } from '@angular/core';
|
|
6
|
-
import { EventEmitter } from '@angular/core';
|
|
7
|
-
import { FocusableOption } from '@angular/cdk/a11y';
|
|
8
|
-
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
9
1
|
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, TemplateRef, AfterContentInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, ElementRef, AfterViewInit, QueryList } from '@angular/core';
|
|
10
3
|
import * as i1 from '@angular/material/core';
|
|
11
4
|
import * as i2 from '@angular/cdk/accordion';
|
|
5
|
+
import { CdkAccordion, CdkAccordionItem } from '@angular/cdk/accordion';
|
|
12
6
|
import * as i3 from '@angular/cdk/portal';
|
|
13
|
-
import { InjectionToken } from '@angular/core';
|
|
14
|
-
import { OnChanges } from '@angular/core';
|
|
15
|
-
import { OnDestroy } from '@angular/core';
|
|
16
|
-
import { QueryList } from '@angular/core';
|
|
17
|
-
import { SimpleChanges } from '@angular/core';
|
|
18
|
-
import { Subject } from 'rxjs';
|
|
19
7
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
20
|
-
import {
|
|
8
|
+
import { FocusableOption, FocusOrigin } from '@angular/cdk/a11y';
|
|
9
|
+
import { Subject } from 'rxjs';
|
|
21
10
|
|
|
11
|
+
/** MatAccordion's display modes. */
|
|
12
|
+
type MatAccordionDisplayMode = 'default' | 'flat';
|
|
13
|
+
/** MatAccordion's toggle positions. */
|
|
14
|
+
type MatAccordionTogglePosition = 'before' | 'after';
|
|
22
15
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @breaking-change 21.0.0
|
|
16
|
+
* Base interface for a `MatAccordion`.
|
|
17
|
+
* @docs-private
|
|
26
18
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
MatExpansionPanelDefaultOptions,
|
|
39
|
-
MAT_EXPANSION_PANEL_DEFAULT_OPTIONS,
|
|
40
|
-
MatExpansionPanel,
|
|
41
|
-
MatExpansionPanelActionRow
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
declare namespace i6 {
|
|
46
|
-
export {
|
|
47
|
-
MatExpansionPanelHeader,
|
|
48
|
-
MatExpansionPanelDescription,
|
|
49
|
-
MatExpansionPanelTitle
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
declare namespace i7 {
|
|
54
|
-
export {
|
|
55
|
-
MatExpansionPanelContent
|
|
56
|
-
}
|
|
19
|
+
interface MatAccordionBase extends CdkAccordion {
|
|
20
|
+
/** Whether the expansion indicator should be hidden. */
|
|
21
|
+
hideToggle: boolean;
|
|
22
|
+
/** Display mode used for all expansion panels in the accordion. */
|
|
23
|
+
displayMode: MatAccordionDisplayMode;
|
|
24
|
+
/** The position of the expansion indicator. */
|
|
25
|
+
togglePosition: MatAccordionTogglePosition;
|
|
26
|
+
/** Handles keyboard events coming in from the panel headers. */
|
|
27
|
+
_handleHeaderKeydown: (event: KeyboardEvent) => void;
|
|
28
|
+
/** Handles focus events on the panel headers. */
|
|
29
|
+
_handleHeaderFocus: (header: any) => void;
|
|
57
30
|
}
|
|
58
|
-
|
|
59
31
|
/**
|
|
60
32
|
* Token used to provide a `MatAccordion` to `MatExpansionPanel`.
|
|
61
33
|
* Used primarily to avoid circular imports between `MatAccordion` and `MatExpansionPanel`.
|
|
62
34
|
*/
|
|
63
|
-
|
|
35
|
+
declare const MAT_ACCORDION: InjectionToken<MatAccordionBase>;
|
|
64
36
|
|
|
65
37
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
38
|
+
* Base interface for a `MatExpansionPanel`.
|
|
39
|
+
* @docs-private
|
|
68
40
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
interface MatExpansionPanelBase extends CdkAccordionItem {
|
|
42
|
+
/** Whether the toggle indicator should be hidden. */
|
|
43
|
+
hideToggle: boolean;
|
|
44
|
+
}
|
|
71
45
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
46
|
+
* Token used to provide a `MatExpansionPanel` to `MatExpansionPanelContent`.
|
|
47
|
+
* Used to avoid circular imports between `MatExpansionPanel` and `MatExpansionPanelContent`.
|
|
74
48
|
*/
|
|
75
|
-
|
|
49
|
+
declare const MAT_EXPANSION_PANEL: InjectionToken<MatExpansionPanelBase>;
|
|
76
50
|
|
|
77
51
|
/**
|
|
78
|
-
*
|
|
52
|
+
* Expansion panel content that will be rendered lazily
|
|
53
|
+
* after the panel is opened for the first time.
|
|
79
54
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/** Whether the expansion indicator should be hidden. */
|
|
87
|
-
hideToggle: boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Display mode used for all expansion panels in the accordion. Currently two display
|
|
90
|
-
* modes exist:
|
|
91
|
-
* default - a gutter-like spacing is placed around any expanded panel, placing the expanded
|
|
92
|
-
* panel at a different elevation from the rest of the accordion.
|
|
93
|
-
* flat - no spacing is placed around expanded panels, showing all panels at the same
|
|
94
|
-
* elevation.
|
|
95
|
-
*/
|
|
96
|
-
displayMode: MatAccordionDisplayMode;
|
|
97
|
-
/** The position of the expansion indicator. */
|
|
98
|
-
togglePosition: MatAccordionTogglePosition;
|
|
99
|
-
ngAfterContentInit(): void;
|
|
100
|
-
/** Handles keyboard events coming in from the panel headers. */
|
|
101
|
-
_handleHeaderKeydown(event: KeyboardEvent): void;
|
|
102
|
-
_handleHeaderFocus(header: MatExpansionPanelHeader): void;
|
|
103
|
-
ngOnDestroy(): void;
|
|
104
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MatAccordion, never>;
|
|
105
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatAccordion, "mat-accordion", ["matAccordion"], { "hideToggle": { "alias": "hideToggle"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, {}, ["_headers"], never, true, never>;
|
|
106
|
-
static ngAcceptInputType_hideToggle: unknown;
|
|
55
|
+
declare class MatExpansionPanelContent {
|
|
56
|
+
_template: TemplateRef<any>;
|
|
57
|
+
_expansionPanel: MatExpansionPanelBase | null;
|
|
58
|
+
constructor(...args: unknown[]);
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelContent, never>;
|
|
60
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelContent, "ng-template[matExpansionPanelContent]", never, {}, {}, never, never, true, never>;
|
|
107
61
|
}
|
|
108
62
|
|
|
63
|
+
/** MatExpansionPanel's states. */
|
|
64
|
+
type MatExpansionPanelState = 'expanded' | 'collapsed';
|
|
109
65
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
66
|
+
* Object that can be used to override the default options
|
|
67
|
+
* for all of the expansion panels in a module.
|
|
112
68
|
*/
|
|
113
|
-
|
|
114
|
-
/**
|
|
69
|
+
interface MatExpansionPanelDefaultOptions {
|
|
70
|
+
/** Height of the header while the panel is expanded. */
|
|
71
|
+
expandedHeight: string;
|
|
72
|
+
/** Height of the header while the panel is collapsed. */
|
|
73
|
+
collapsedHeight: string;
|
|
74
|
+
/** Whether the toggle indicator should be hidden. */
|
|
115
75
|
hideToggle: boolean;
|
|
116
|
-
/** Display mode used for all expansion panels in the accordion. */
|
|
117
|
-
displayMode: MatAccordionDisplayMode;
|
|
118
|
-
/** The position of the expansion indicator. */
|
|
119
|
-
togglePosition: MatAccordionTogglePosition;
|
|
120
|
-
/** Handles keyboard events coming in from the panel headers. */
|
|
121
|
-
_handleHeaderKeydown: (event: KeyboardEvent) => void;
|
|
122
|
-
/** Handles focus events on the panel headers. */
|
|
123
|
-
_handleHeaderFocus: (header: any) => void;
|
|
124
76
|
}
|
|
125
|
-
|
|
126
|
-
/** MatAccordion's display modes. */
|
|
127
|
-
export declare type MatAccordionDisplayMode = 'default' | 'flat';
|
|
128
|
-
|
|
129
|
-
/** MatAccordion's toggle positions. */
|
|
130
|
-
export declare type MatAccordionTogglePosition = 'before' | 'after';
|
|
131
|
-
|
|
132
77
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* A bug in angular animation's `state` when ViewContainers are moved using ViewContainerRef.move()
|
|
136
|
-
* causes the animation state of moved components to become `void` upon exit, and not update again
|
|
137
|
-
* upon reentry into the DOM. This can lead a to situation for the expansion panel where the state
|
|
138
|
-
* of the panel is `expanded` or `collapsed` but the animation state is `void`.
|
|
139
|
-
*
|
|
140
|
-
* To correctly handle animating to the next state, we animate between `void` and `collapsed` which
|
|
141
|
-
* are defined to have the same styles. Since angular animates from the current styles to the
|
|
142
|
-
* destination state's style definition, in situations where we are moving from `void`'s styles to
|
|
143
|
-
* `collapsed` this acts a noop since no style values change.
|
|
144
|
-
*
|
|
145
|
-
* In the case where angular's animation state is out of sync with the expansion panel's state, the
|
|
146
|
-
* expansion panel being `expanded` and angular animations being `void`, the animation from the
|
|
147
|
-
* `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
|
|
148
|
-
* occur as expected.
|
|
149
|
-
*
|
|
150
|
-
* Angular Bug: https://github.com/angular/angular/issues/18847
|
|
151
|
-
*
|
|
152
|
-
* @docs-private
|
|
153
|
-
* @deprecated No longer being used, to be removed.
|
|
154
|
-
* @breaking-change 21.0.0
|
|
78
|
+
* Injection token that can be used to configure the default
|
|
79
|
+
* options for the expansion panel component.
|
|
155
80
|
*/
|
|
156
|
-
|
|
157
|
-
readonly indicatorRotate: any;
|
|
158
|
-
readonly bodyExpansion: any;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export declare class MatExpansionModule {
|
|
162
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionModule, never>;
|
|
163
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatExpansionModule, never, [typeof i1.MatCommonModule, typeof i2.CdkAccordionModule, typeof i3.PortalModule, typeof i4.MatAccordion, typeof i5.MatExpansionPanel, typeof i5.MatExpansionPanelActionRow, typeof i6.MatExpansionPanelHeader, typeof i6.MatExpansionPanelTitle, typeof i6.MatExpansionPanelDescription, typeof i7.MatExpansionPanelContent], [typeof i4.MatAccordion, typeof i5.MatExpansionPanel, typeof i5.MatExpansionPanelActionRow, typeof i6.MatExpansionPanelHeader, typeof i6.MatExpansionPanelTitle, typeof i6.MatExpansionPanelDescription, typeof i7.MatExpansionPanelContent]>;
|
|
164
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<MatExpansionModule>;
|
|
165
|
-
}
|
|
166
|
-
|
|
81
|
+
declare const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS: InjectionToken<MatExpansionPanelDefaultOptions>;
|
|
167
82
|
/**
|
|
168
83
|
* This component can be used as a single element to show expandable content, or as one of
|
|
169
84
|
* multiple children of an element with the MatAccordion directive attached.
|
|
170
85
|
*/
|
|
171
|
-
|
|
86
|
+
declare class MatExpansionPanel extends CdkAccordionItem implements AfterContentInit, OnChanges, OnDestroy {
|
|
172
87
|
private _viewContainerRef;
|
|
173
88
|
private readonly _animationsDisabled;
|
|
174
89
|
private _document;
|
|
@@ -224,61 +139,18 @@ export declare class MatExpansionPanel extends CdkAccordionItem implements After
|
|
|
224
139
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanel, "mat-expansion-panel", ["matExpansionPanel"], { "hideToggle": { "alias": "hideToggle"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, { "afterExpand": "afterExpand"; "afterCollapse": "afterCollapse"; }, ["_lazyContent"], ["mat-expansion-panel-header", "*", "mat-action-row"], true, never>;
|
|
225
140
|
static ngAcceptInputType_hideToggle: unknown;
|
|
226
141
|
}
|
|
227
|
-
|
|
228
142
|
/**
|
|
229
143
|
* Actions of a `<mat-expansion-panel>`.
|
|
230
144
|
*/
|
|
231
|
-
|
|
145
|
+
declare class MatExpansionPanelActionRow {
|
|
232
146
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelActionRow, never>;
|
|
233
147
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelActionRow, "mat-action-row", never, {}, {}, never, never, true, never>;
|
|
234
148
|
}
|
|
235
149
|
|
|
236
|
-
/**
|
|
237
|
-
* Base interface for a `MatExpansionPanel`.
|
|
238
|
-
* @docs-private
|
|
239
|
-
*/
|
|
240
|
-
declare interface MatExpansionPanelBase extends CdkAccordionItem {
|
|
241
|
-
/** Whether the toggle indicator should be hidden. */
|
|
242
|
-
hideToggle: boolean;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Expansion panel content that will be rendered lazily
|
|
247
|
-
* after the panel is opened for the first time.
|
|
248
|
-
*/
|
|
249
|
-
export declare class MatExpansionPanelContent {
|
|
250
|
-
_template: TemplateRef<any>;
|
|
251
|
-
_expansionPanel: MatExpansionPanelBase | null;
|
|
252
|
-
constructor(...args: unknown[]);
|
|
253
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelContent, never>;
|
|
254
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelContent, "ng-template[matExpansionPanelContent]", never, {}, {}, never, never, true, never>;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Object that can be used to override the default options
|
|
259
|
-
* for all of the expansion panels in a module.
|
|
260
|
-
*/
|
|
261
|
-
export declare interface MatExpansionPanelDefaultOptions {
|
|
262
|
-
/** Height of the header while the panel is expanded. */
|
|
263
|
-
expandedHeight: string;
|
|
264
|
-
/** Height of the header while the panel is collapsed. */
|
|
265
|
-
collapsedHeight: string;
|
|
266
|
-
/** Whether the toggle indicator should be hidden. */
|
|
267
|
-
hideToggle: boolean;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Description element of a `<mat-expansion-panel-header>`.
|
|
272
|
-
*/
|
|
273
|
-
export declare class MatExpansionPanelDescription {
|
|
274
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelDescription, never>;
|
|
275
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelDescription, "mat-panel-description", never, {}, {}, never, never, true, never>;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
150
|
/**
|
|
279
151
|
* Header element of a `<mat-expansion-panel>`.
|
|
280
152
|
*/
|
|
281
|
-
|
|
153
|
+
declare class MatExpansionPanelHeader implements AfterViewInit, OnDestroy, FocusableOption {
|
|
282
154
|
panel: MatExpansionPanel;
|
|
283
155
|
private _element;
|
|
284
156
|
private _focusMonitor;
|
|
@@ -327,16 +199,92 @@ export declare class MatExpansionPanelHeader implements AfterViewInit, OnDestroy
|
|
|
327
199
|
static ɵcmp: i0.ɵɵComponentDeclaration<MatExpansionPanelHeader, "mat-expansion-panel-header", never, { "expandedHeight": { "alias": "expandedHeight"; "required": false; }; "collapsedHeight": { "alias": "collapsedHeight"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, never, ["mat-panel-title", "mat-panel-description", "*"], true, never>;
|
|
328
200
|
static ngAcceptInputType_tabIndex: unknown;
|
|
329
201
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Description element of a `<mat-expansion-panel-header>`.
|
|
204
|
+
*/
|
|
205
|
+
declare class MatExpansionPanelDescription {
|
|
206
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelDescription, never>;
|
|
207
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelDescription, "mat-panel-description", never, {}, {}, never, never, true, never>;
|
|
208
|
+
}
|
|
334
209
|
/**
|
|
335
210
|
* Title element of a `<mat-expansion-panel-header>`.
|
|
336
211
|
*/
|
|
337
|
-
|
|
212
|
+
declare class MatExpansionPanelTitle {
|
|
338
213
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionPanelTitle, never>;
|
|
339
214
|
static ɵdir: i0.ɵɵDirectiveDeclaration<MatExpansionPanelTitle, "mat-panel-title", never, {}, {}, never, never, true, never>;
|
|
340
215
|
}
|
|
341
216
|
|
|
342
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Directive for a Material Design Accordion.
|
|
219
|
+
*/
|
|
220
|
+
declare class MatAccordion extends CdkAccordion implements MatAccordionBase, AfterContentInit, OnDestroy {
|
|
221
|
+
private _keyManager;
|
|
222
|
+
/** Headers belonging to this accordion. */
|
|
223
|
+
private _ownHeaders;
|
|
224
|
+
/** All headers inside the accordion. Includes headers inside nested accordions. */
|
|
225
|
+
_headers: QueryList<MatExpansionPanelHeader>;
|
|
226
|
+
/** Whether the expansion indicator should be hidden. */
|
|
227
|
+
hideToggle: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Display mode used for all expansion panels in the accordion. Currently two display
|
|
230
|
+
* modes exist:
|
|
231
|
+
* default - a gutter-like spacing is placed around any expanded panel, placing the expanded
|
|
232
|
+
* panel at a different elevation from the rest of the accordion.
|
|
233
|
+
* flat - no spacing is placed around expanded panels, showing all panels at the same
|
|
234
|
+
* elevation.
|
|
235
|
+
*/
|
|
236
|
+
displayMode: MatAccordionDisplayMode;
|
|
237
|
+
/** The position of the expansion indicator. */
|
|
238
|
+
togglePosition: MatAccordionTogglePosition;
|
|
239
|
+
ngAfterContentInit(): void;
|
|
240
|
+
/** Handles keyboard events coming in from the panel headers. */
|
|
241
|
+
_handleHeaderKeydown(event: KeyboardEvent): void;
|
|
242
|
+
_handleHeaderFocus(header: MatExpansionPanelHeader): void;
|
|
243
|
+
ngOnDestroy(): void;
|
|
244
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatAccordion, never>;
|
|
245
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MatAccordion, "mat-accordion", ["matAccordion"], { "hideToggle": { "alias": "hideToggle"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "togglePosition": { "alias": "togglePosition"; "required": false; }; }, {}, ["_headers"], never, true, never>;
|
|
246
|
+
static ngAcceptInputType_hideToggle: unknown;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
declare class MatExpansionModule {
|
|
250
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MatExpansionModule, never>;
|
|
251
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatExpansionModule, never, [typeof i1.MatCommonModule, typeof i2.CdkAccordionModule, typeof i3.PortalModule, typeof MatAccordion, typeof MatExpansionPanel, typeof MatExpansionPanelActionRow, typeof MatExpansionPanelHeader, typeof MatExpansionPanelTitle, typeof MatExpansionPanelDescription, typeof MatExpansionPanelContent], [typeof MatAccordion, typeof MatExpansionPanel, typeof MatExpansionPanelActionRow, typeof MatExpansionPanelHeader, typeof MatExpansionPanelTitle, typeof MatExpansionPanelDescription, typeof MatExpansionPanelContent]>;
|
|
252
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<MatExpansionModule>;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Time and timing curve for expansion panel animations.
|
|
257
|
+
* @deprecated No longer used. Will be removed.
|
|
258
|
+
* @breaking-change 21.0.0
|
|
259
|
+
*/
|
|
260
|
+
declare const EXPANSION_PANEL_ANIMATION_TIMING = "225ms cubic-bezier(0.4,0.0,0.2,1)";
|
|
261
|
+
/**
|
|
262
|
+
* Animations used by the Material expansion panel.
|
|
263
|
+
*
|
|
264
|
+
* A bug in angular animation's `state` when ViewContainers are moved using ViewContainerRef.move()
|
|
265
|
+
* causes the animation state of moved components to become `void` upon exit, and not update again
|
|
266
|
+
* upon reentry into the DOM. This can lead a to situation for the expansion panel where the state
|
|
267
|
+
* of the panel is `expanded` or `collapsed` but the animation state is `void`.
|
|
268
|
+
*
|
|
269
|
+
* To correctly handle animating to the next state, we animate between `void` and `collapsed` which
|
|
270
|
+
* are defined to have the same styles. Since angular animates from the current styles to the
|
|
271
|
+
* destination state's style definition, in situations where we are moving from `void`'s styles to
|
|
272
|
+
* `collapsed` this acts a noop since no style values change.
|
|
273
|
+
*
|
|
274
|
+
* In the case where angular's animation state is out of sync with the expansion panel's state, the
|
|
275
|
+
* expansion panel being `expanded` and angular animations being `void`, the animation from the
|
|
276
|
+
* `expanded`'s effective styles (though in a `void` animation state) to the collapsed state will
|
|
277
|
+
* occur as expected.
|
|
278
|
+
*
|
|
279
|
+
* Angular Bug: https://github.com/angular/angular/issues/18847
|
|
280
|
+
*
|
|
281
|
+
* @docs-private
|
|
282
|
+
* @deprecated No longer being used, to be removed.
|
|
283
|
+
* @breaking-change 21.0.0
|
|
284
|
+
*/
|
|
285
|
+
declare const matExpansionAnimations: {
|
|
286
|
+
readonly indicatorRotate: any;
|
|
287
|
+
readonly bodyExpansion: any;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export { EXPANSION_PANEL_ANIMATION_TIMING, MAT_ACCORDION, MAT_EXPANSION_PANEL, MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, MatAccordion, type MatAccordionBase, type MatAccordionDisplayMode, type MatAccordionTogglePosition, MatExpansionModule, MatExpansionPanel, MatExpansionPanelActionRow, MatExpansionPanelContent, type MatExpansionPanelDefaultOptions, MatExpansionPanelDescription, MatExpansionPanelHeader, type MatExpansionPanelState, MatExpansionPanelTitle, matExpansionAnimations };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { BaseHarnessFilters } from '@angular/cdk/testing';
|
|
2
|
-
import { ComponentHarness } from '@angular/cdk/testing';
|
|
3
|
-
import { ContentContainerComponentHarness } from '@angular/cdk/testing';
|
|
4
|
-
import { HarnessLoader } from '@angular/cdk/testing';
|
|
5
|
-
import { HarnessPredicate } from '@angular/cdk/testing';
|
|
1
|
+
import { BaseHarnessFilters, ContentContainerComponentHarness, HarnessPredicate, HarnessLoader, ComponentHarness } from '@angular/cdk/testing';
|
|
6
2
|
|
|
7
|
-
|
|
3
|
+
interface AccordionHarnessFilters extends BaseHarnessFilters {
|
|
8
4
|
}
|
|
9
|
-
|
|
10
|
-
export declare interface ExpansionPanelHarnessFilters extends BaseHarnessFilters {
|
|
5
|
+
interface ExpansionPanelHarnessFilters extends BaseHarnessFilters {
|
|
11
6
|
title?: string | RegExp | null;
|
|
12
7
|
description?: string | RegExp | null;
|
|
13
8
|
content?: string | RegExp;
|
|
@@ -15,24 +10,15 @@ export declare interface ExpansionPanelHarnessFilters extends BaseHarnessFilters
|
|
|
15
10
|
disabled?: boolean;
|
|
16
11
|
}
|
|
17
12
|
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @param options Options for narrowing the search.
|
|
25
|
-
* @return a `HarnessPredicate` configured with the given options.
|
|
26
|
-
*/
|
|
27
|
-
static with(options?: AccordionHarnessFilters): HarnessPredicate<MatAccordionHarness>;
|
|
28
|
-
/** Gets all expansion panels which are part of the accordion. */
|
|
29
|
-
getExpansionPanels(filter?: ExpansionPanelHarnessFilters): Promise<MatExpansionPanelHarness[]>;
|
|
30
|
-
/** Whether the accordion allows multiple expanded panels simultaneously. */
|
|
31
|
-
isMulti(): Promise<boolean>;
|
|
13
|
+
/** Selectors for the various `mat-expansion-panel` sections that may contain user content. */
|
|
14
|
+
declare enum MatExpansionPanelSection {
|
|
15
|
+
HEADER = ".mat-expansion-panel-header",
|
|
16
|
+
TITLE = ".mat-expansion-panel-header-title",
|
|
17
|
+
DESCRIPTION = ".mat-expansion-panel-header-description",
|
|
18
|
+
CONTENT = ".mat-expansion-panel-content"
|
|
32
19
|
}
|
|
33
|
-
|
|
34
20
|
/** Harness for interacting with a standard mat-expansion-panel in tests. */
|
|
35
|
-
|
|
21
|
+
declare class MatExpansionPanelHarness extends ContentContainerComponentHarness<MatExpansionPanelSection> {
|
|
36
22
|
static hostSelector: string;
|
|
37
23
|
private _header;
|
|
38
24
|
private _title;
|
|
@@ -95,12 +81,20 @@ export declare class MatExpansionPanelHarness extends ContentContainerComponentH
|
|
|
95
81
|
getToggleIndicatorPosition(): Promise<'before' | 'after'>;
|
|
96
82
|
}
|
|
97
83
|
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
/** Harness for interacting with a standard mat-accordion in tests. */
|
|
85
|
+
declare class MatAccordionHarness extends ComponentHarness {
|
|
86
|
+
static hostSelector: string;
|
|
87
|
+
/**
|
|
88
|
+
* Gets a `HarnessPredicate` that can be used to search for an accordion
|
|
89
|
+
* with specific attributes.
|
|
90
|
+
* @param options Options for narrowing the search.
|
|
91
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
92
|
+
*/
|
|
93
|
+
static with(options?: AccordionHarnessFilters): HarnessPredicate<MatAccordionHarness>;
|
|
94
|
+
/** Gets all expansion panels which are part of the accordion. */
|
|
95
|
+
getExpansionPanels(filter?: ExpansionPanelHarnessFilters): Promise<MatExpansionPanelHarness[]>;
|
|
96
|
+
/** Whether the accordion allows multiple expanded panels simultaneously. */
|
|
97
|
+
isMulti(): Promise<boolean>;
|
|
104
98
|
}
|
|
105
99
|
|
|
106
|
-
export { }
|
|
100
|
+
export { type AccordionHarnessFilters, type ExpansionPanelHarnessFilters, MatAccordionHarness, MatExpansionPanelHarness, MatExpansionPanelSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/autocomplete/testing/autocomplete-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n TestElement,\n} from '@angular/cdk/testing';\nimport {\n MatOptgroupHarness,\n MatOptionHarness,\n OptgroupHarnessFilters,\n OptionHarnessFilters,\n} from '@angular/material/core/testing';\nimport {AutocompleteHarnessFilters} from './autocomplete-harness-filters';\n\nexport class MatAutocompleteHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n\n /** The selector for the host element of a `MatAutocomplete` instance. */\n static hostSelector = '.mat-mdc-autocomplete-trigger';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an autocomplete with specific\n * attributes.\n * @param options Options for filtering which autocomplete instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatAutocompleteHarness>(\n this: ComponentHarnessConstructor<T>,\n options: AutocompleteHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('value', options.value, (harness, value) =>\n HarnessPredicate.stringMatches(harness.getValue(), value),\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n });\n }\n\n /** Gets the value of the autocomplete input. */\n async getValue(): Promise<string> {\n return (await this.host()).getProperty<string>('value');\n }\n\n /** Whether the autocomplete input is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Focuses the autocomplete input. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the autocomplete input. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the autocomplete input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Enters text into the autocomplete. */\n async enterText(value: string): Promise<void> {\n return (await this.host()).sendKeys(value);\n }\n\n /** Clears the input value. */\n async clear(): Promise<void> {\n return (await this.host()).clear();\n }\n\n /** Gets the options inside the autocomplete panel. */\n async getOptions(filters?: Omit<OptionHarnessFilters, 'ancestor'>): Promise<MatOptionHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error('Unable to retrieve options for autocomplete. Autocomplete panel is closed.');\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptionHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptionHarnessFilters),\n )();\n }\n\n /** Gets the option groups inside the autocomplete panel. */\n async getOptionGroups(\n filters?: Omit<OptgroupHarnessFilters, 'ancestor'>,\n ): Promise<MatOptgroupHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error(\n 'Unable to retrieve option groups for autocomplete. Autocomplete panel is closed.',\n );\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptgroupHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptgroupHarnessFilters),\n )();\n }\n\n /** Selects the first option matching the given filters. */\n async selectOption(filters: OptionHarnessFilters): Promise<void> {\n await this.focus(); // Focus the input to make sure the autocomplete panel is shown.\n const options = await this.getOptions(filters);\n if (!options.length) {\n throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);\n }\n await options[0].click();\n }\n\n /** Whether the autocomplete is open. */\n async isOpen(): Promise<boolean> {\n const panel = await this._getPanel();\n return !!panel && (await panel.hasClass(`mat-mdc-autocomplete-visible`));\n }\n\n /** Gets the panel associated with this autocomplete trigger. */\n private async _getPanel(): Promise<TestElement | null> {\n // Technically this is static, but it needs to be in a\n // function, because the autocomplete's panel ID can changed.\n return this._documentRootLocator.locatorForOptional(await this._getPanelSelector())();\n }\n\n /** Gets the selector that can be used to find the autocomplete trigger's panel. */\n protected async _getPanelSelector(): Promise<string> {\n return `#${await (await this.host()).getAttribute('aria-controls')}`;\n }\n}\n"],"names":[],"mappings":";;;;AAuBM,MAAO,sBAAuB,SAAQ,gBAAgB,CAAA;AAClD,IAAA,oBAAoB,GAAG,IAAI,CAAC,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../src/material/autocomplete/testing/autocomplete-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n TestElement,\n} from '@angular/cdk/testing';\nimport {\n MatOptgroupHarness,\n MatOptionHarness,\n OptgroupHarnessFilters,\n OptionHarnessFilters,\n} from '@angular/material/core/testing';\nimport {AutocompleteHarnessFilters} from './autocomplete-harness-filters';\n\nexport class MatAutocompleteHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n\n /** The selector for the host element of a `MatAutocomplete` instance. */\n static hostSelector = '.mat-mdc-autocomplete-trigger';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an autocomplete with specific\n * attributes.\n * @param options Options for filtering which autocomplete instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatAutocompleteHarness>(\n this: ComponentHarnessConstructor<T>,\n options: AutocompleteHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('value', options.value, (harness, value) =>\n HarnessPredicate.stringMatches(harness.getValue(), value),\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n });\n }\n\n /** Gets the value of the autocomplete input. */\n async getValue(): Promise<string> {\n return (await this.host()).getProperty<string>('value');\n }\n\n /** Whether the autocomplete input is disabled. */\n async isDisabled(): Promise<boolean> {\n const disabled = (await this.host()).getAttribute('disabled');\n return coerceBooleanProperty(await disabled);\n }\n\n /** Focuses the autocomplete input. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Blurs the autocomplete input. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the autocomplete input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** Enters text into the autocomplete. */\n async enterText(value: string): Promise<void> {\n return (await this.host()).sendKeys(value);\n }\n\n /** Clears the input value. */\n async clear(): Promise<void> {\n return (await this.host()).clear();\n }\n\n /** Gets the options inside the autocomplete panel. */\n async getOptions(filters?: Omit<OptionHarnessFilters, 'ancestor'>): Promise<MatOptionHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error('Unable to retrieve options for autocomplete. Autocomplete panel is closed.');\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptionHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptionHarnessFilters),\n )();\n }\n\n /** Gets the option groups inside the autocomplete panel. */\n async getOptionGroups(\n filters?: Omit<OptgroupHarnessFilters, 'ancestor'>,\n ): Promise<MatOptgroupHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error(\n 'Unable to retrieve option groups for autocomplete. Autocomplete panel is closed.',\n );\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptgroupHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptgroupHarnessFilters),\n )();\n }\n\n /** Selects the first option matching the given filters. */\n async selectOption(filters: OptionHarnessFilters): Promise<void> {\n await this.focus(); // Focus the input to make sure the autocomplete panel is shown.\n const options = await this.getOptions(filters);\n if (!options.length) {\n throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);\n }\n await options[0].click();\n }\n\n /** Whether the autocomplete is open. */\n async isOpen(): Promise<boolean> {\n const panel = await this._getPanel();\n return !!panel && (await panel.hasClass(`mat-mdc-autocomplete-visible`));\n }\n\n /** Gets the panel associated with this autocomplete trigger. */\n private async _getPanel(): Promise<TestElement | null> {\n // Technically this is static, but it needs to be in a\n // function, because the autocomplete's panel ID can changed.\n return this._documentRootLocator.locatorForOptional(await this._getPanelSelector())();\n }\n\n /** Gets the selector that can be used to find the autocomplete trigger's panel. */\n protected async _getPanelSelector(): Promise<string> {\n return `#${await (await this.host()).getAttribute('aria-controls')}`;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ChangeDetectorRef, ElementRef, ANIMATION_MODULE_TYPE, EventEmitter, booleanAttribute, TemplateRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ContentChildren, Input, Output, Directive, forwardRef, EnvironmentInjector, ViewContainerRef, NgZone, Renderer2, afterNextRender, NgModule } from '@angular/core';
|
|
3
1
|
import { MAT_OPTION_PARENT_COMPONENT, MatOption, MAT_OPTGROUP, MatOptionSelectionChange, _countGroupLabelsBeforeOption, _getOptionScrollPosition, MatOptionModule, MatCommonModule } from '@angular/material/core';
|
|
4
2
|
export { MatOptgroup, MatOption } from '@angular/material/core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, ChangeDetectorRef, ElementRef, ANIMATION_MODULE_TYPE, EventEmitter, booleanAttribute, TemplateRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, ContentChildren, Input, Output, Directive, forwardRef, EnvironmentInjector, ViewContainerRef, NgZone, Renderer2, afterNextRender, NgModule } from '@angular/core';
|
|
5
5
|
import { ViewportRuler, CdkScrollableModule } from '@angular/cdk/scrolling';
|
|
6
6
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
7
7
|
import { _IdGenerator, ActiveDescendantKeyManager, removeAriaReferencedId, addAriaReferencedId } from '@angular/cdk/a11y';
|
|
8
|
-
import { Platform, _getEventTarget } from '@angular/cdk/platform';
|
|
8
|
+
import { Platform, _getFocusedElementPierceShadowDom, _getEventTarget } from '@angular/cdk/platform';
|
|
9
9
|
import { Subscription, Subject, merge, of, defer, Observable } from 'rxjs';
|
|
10
10
|
import { Directionality } from '@angular/cdk/bidi';
|
|
11
|
-
import { hasModifierKey, ESCAPE, ENTER, UP_ARROW, DOWN_ARROW
|
|
11
|
+
import { hasModifierKey, ESCAPE, ENTER, TAB, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
|
|
12
12
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
13
13
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
14
|
-
import { DOCUMENT } from '@angular/common';
|
|
15
14
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
16
15
|
import { MAT_FORM_FIELD } from '@angular/material/form-field';
|
|
17
16
|
import { filter, map, startWith, switchMap, tap, delay, take } from 'rxjs/operators';
|
|
@@ -34,7 +33,11 @@ const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS = new InjectionToken('mat-autocomplete-de
|
|
|
34
33
|
providedIn: 'root',
|
|
35
34
|
factory: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY,
|
|
36
35
|
});
|
|
37
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @docs-private
|
|
38
|
+
* @deprecated No longer used, will be removed.
|
|
39
|
+
* @breaking-change 21.0.0
|
|
40
|
+
*/
|
|
38
41
|
function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY() {
|
|
39
42
|
return {
|
|
40
43
|
autoActiveFirstOption: false,
|
|
@@ -325,11 +328,19 @@ const MAT_AUTOCOMPLETE_SCROLL_STRATEGY = new InjectionToken('mat-autocomplete-sc
|
|
|
325
328
|
return () => overlay.scrollStrategies.reposition();
|
|
326
329
|
},
|
|
327
330
|
});
|
|
328
|
-
/**
|
|
331
|
+
/**
|
|
332
|
+
* @docs-private
|
|
333
|
+
* @deprecated No longer used, will be removed.
|
|
334
|
+
* @breaking-change 21.0.0
|
|
335
|
+
*/
|
|
329
336
|
function MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY(overlay) {
|
|
330
337
|
return () => overlay.scrollStrategies.reposition();
|
|
331
338
|
}
|
|
332
|
-
/**
|
|
339
|
+
/**
|
|
340
|
+
* @docs-private
|
|
341
|
+
* @deprecated No longer used, will be removed.
|
|
342
|
+
* @breaking-change 21.0.0
|
|
343
|
+
*/
|
|
333
344
|
const MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER = {
|
|
334
345
|
provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY,
|
|
335
346
|
deps: [Overlay],
|
|
@@ -345,7 +356,6 @@ class MatAutocompleteTrigger {
|
|
|
345
356
|
_changeDetectorRef = inject(ChangeDetectorRef);
|
|
346
357
|
_dir = inject(Directionality, { optional: true });
|
|
347
358
|
_formField = inject(MAT_FORM_FIELD, { optional: true, host: true });
|
|
348
|
-
_document = inject(DOCUMENT);
|
|
349
359
|
_viewportRuler = inject(ViewportRuler);
|
|
350
360
|
_scrollStrategy = inject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY);
|
|
351
361
|
_renderer = inject(Renderer2);
|
|
@@ -397,8 +407,7 @@ class MatAutocompleteTrigger {
|
|
|
397
407
|
// If the user blurred the window while the autocomplete is focused, it means that it'll be
|
|
398
408
|
// refocused when they come back. In this case we want to skip the first focus event, if the
|
|
399
409
|
// pane was closed, in order to avoid reopening it unintentionally.
|
|
400
|
-
this._canOpenOnNextFocus =
|
|
401
|
-
this._document.activeElement !== this._element.nativeElement || this.panelOpen;
|
|
410
|
+
this._canOpenOnNextFocus = this.panelOpen || !this._hasFocus();
|
|
402
411
|
};
|
|
403
412
|
/** `View -> model callback called when value changes` */
|
|
404
413
|
_onChange = () => { };
|
|
@@ -559,7 +568,7 @@ class MatAutocompleteTrigger {
|
|
|
559
568
|
// true. Its main purpose is to handle the case where the input is focused from an
|
|
560
569
|
// outside click which propagates up to the `body` listener within the same sequence
|
|
561
570
|
// and causes the panel to close immediately (see #3106).
|
|
562
|
-
this.
|
|
571
|
+
!this._hasFocus() &&
|
|
563
572
|
(!formField || !formField.contains(clickTarget)) &&
|
|
564
573
|
(!customOrigin || !customOrigin.contains(clickTarget)) &&
|
|
565
574
|
!!this._overlayRef &&
|
|
@@ -665,7 +674,7 @@ class MatAutocompleteTrigger {
|
|
|
665
674
|
}
|
|
666
675
|
}
|
|
667
676
|
}
|
|
668
|
-
if (this._canOpen() && this.
|
|
677
|
+
if (this._canOpen() && this._hasFocus()) {
|
|
669
678
|
// When the `input` event fires, the input's value will have already changed. This means
|
|
670
679
|
// that if we take the `this._element.nativeElement.value` directly, it'll be one keystroke
|
|
671
680
|
// behind. This can be a problem when the user selects a value, changes a character while
|
|
@@ -692,6 +701,10 @@ class MatAutocompleteTrigger {
|
|
|
692
701
|
this._openPanelInternal();
|
|
693
702
|
}
|
|
694
703
|
}
|
|
704
|
+
/** Whether the input currently has focus. */
|
|
705
|
+
_hasFocus() {
|
|
706
|
+
return _getFocusedElementPierceShadowDom() === this._element.nativeElement;
|
|
707
|
+
}
|
|
695
708
|
/**
|
|
696
709
|
* In "auto" mode, the label will animate down as soon as focus is lost.
|
|
697
710
|
* This causes the value to jump when selecting an option with the mouse.
|
|
@@ -1221,9 +1234,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImpor
|
|
|
1221
1234
|
}]
|
|
1222
1235
|
}] });
|
|
1223
1236
|
|
|
1224
|
-
/**
|
|
1225
|
-
* Generated bundle index. Do not edit.
|
|
1226
|
-
*/
|
|
1227
|
-
|
|
1228
1237
|
export { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, MatAutocomplete, MatAutocompleteModule, MatAutocompleteOrigin, MatAutocompleteSelectedEvent, MatAutocompleteTrigger, getMatAutocompleteMissingPanelError };
|
|
1229
1238
|
//# sourceMappingURL=autocomplete.mjs.map
|