@angular/material 19.0.0-next.9 → 19.0.0-rc.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/autocomplete/_autocomplete-theme.scss +8 -4
- package/autocomplete/index.d.ts +5 -6
- package/badge/_badge-theme.scss +10 -6
- package/bottom-sheet/_bottom-sheet-theme.scss +8 -4
- package/button/_button-theme.scss +10 -6
- package/button/_fab-theme.scss +10 -6
- package/button/_icon-button-theme.scss +8 -4
- package/button/index.d.ts +1 -1
- package/button-toggle/_button-toggle-theme.scss +11 -6
- package/card/_card-theme.scss +8 -4
- package/card/index.d.ts +2 -3
- package/checkbox/_checkbox-theme.scss +10 -6
- package/chips/_chips-theme.scss +10 -6
- package/core/_core-theme.scss +4 -7
- package/core/_core.scss +2 -5
- package/core/option/_optgroup-theme.scss +8 -4
- package/core/option/_option-theme.scss +10 -6
- package/core/ripple/_ripple-theme.scss +8 -4
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +10 -6
- package/core/theming/_config-validation.scss +4 -4
- package/core/theming/_definition.scss +12 -2
- package/core/tokens/_m3-system.scss +55 -39
- package/datepicker/_datepicker-theme.scss +10 -6
- package/datepicker/index.d.ts +32 -33
- package/dialog/_dialog-theme.scss +8 -4
- package/divider/_divider-theme.scss +8 -4
- package/expansion/_expansion-theme.scss +8 -4
- package/fesm2022/autocomplete/testing.mjs +2 -5
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +220 -141
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs +2 -5
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +41 -30
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +76 -54
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +2 -2
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs +4 -7
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +78 -40
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +87 -60
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs +3 -6
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +38 -40
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs +4 -7
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +99 -56
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs +11 -14
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +303 -251
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +5 -11
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +217 -160
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs +13 -22
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +788 -533
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +15 -9
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +210 -140
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +7 -9
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs +7 -10
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +76 -65
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +12 -15
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +165 -111
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs +11 -17
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +65 -43
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +6 -6
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +62 -42
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input/testing.mjs +3 -3
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input.mjs +101 -69
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +21 -38
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +175 -164
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +3 -6
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +171 -118
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +10 -13
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +79 -54
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +33 -32
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +25 -11
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs +6 -12
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +119 -82
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +6 -9
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +215 -177
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs +6 -6
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +125 -112
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs +3 -6
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +72 -41
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs +2 -2
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +255 -185
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs +4 -7
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +133 -98
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs +3 -6
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +89 -68
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs +4 -4
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +133 -95
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table/testing.mjs +13 -25
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs +164 -159
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +5 -5
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +308 -225
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs +7 -16
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +152 -146
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs +2 -5
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +22 -12
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs +6 -9
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +93 -69
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs +3 -6
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +48 -46
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +9 -5
- package/form-field/index.d.ts +8 -9
- package/grid-list/_grid-list-theme.scss +8 -4
- package/icon/_icon-theme.scss +10 -6
- package/input/_input-theme.scss +8 -4
- package/list/_list-theme.scss +8 -4
- package/list/index.d.ts +20 -21
- package/menu/_menu-theme.scss +8 -4
- package/menu/index.d.ts +8 -9
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +8 -4
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +11 -9
- package/progress-spinner/_progress-spinner-theme.scss +11 -9
- package/progress-spinner/index.d.ts +3 -4
- package/radio/_radio-theme.scss +10 -6
- package/radio/index.d.ts +2 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js +1 -6
- package/schematics/ng-add/theming/create-custom-theme.mjs +1 -6
- package/schematics/ng-generate/theme-color/index_bundled.js +35 -9
- package/schematics/ng-generate/theme-color/index_bundled.js.map +2 -2
- package/schematics/ng-update/index_bundled.js +6 -1
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/_select-theme.scss +10 -6
- package/select/index.d.ts +6 -7
- package/sidenav/_sidenav-theme.scss +8 -4
- package/slide-toggle/_slide-toggle-theme.scss +10 -6
- package/slider/_slider-theme.scss +10 -6
- package/snack-bar/_snack-bar-theme.scss +10 -6
- package/sort/_sort-theme.scss +8 -4
- package/stepper/_stepper-theme.scss +10 -6
- package/stepper/index.d.ts +14 -15
- package/table/_table-theme.scss +8 -4
- package/tabs/_tabs-theme.scss +10 -6
- package/timepicker/_timepicker-theme.scss +10 -6
- package/toolbar/_toolbar-theme.scss +10 -6
- package/tooltip/_tooltip-theme.scss +8 -4
- package/tooltip/index.d.ts +5 -6
- package/tree/_tree-theme.scss +8 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use '../style/elevation';
|
|
2
2
|
@use '../style/sass-utils';
|
|
3
|
+
@use '../theming/config-validation';
|
|
3
4
|
@use '../theming/definition';
|
|
4
5
|
@use './m3/definitions';
|
|
5
6
|
@use 'sass:map';
|
|
@@ -7,22 +8,15 @@
|
|
|
7
8
|
@use 'sass:list';
|
|
8
9
|
@use './m3-tokens';
|
|
9
10
|
|
|
10
|
-
// Prefix used for component token fallback variables, e.g.
|
|
11
|
-
// `color: var(--mdc-text-button-label-text-color, var(--mat-sys-primary));`
|
|
12
|
-
$_system-fallback-prefix: mat-sys;
|
|
13
|
-
|
|
14
|
-
// Default system level prefix to use when directly calling the `system-level-*` mixins
|
|
15
|
-
$_system-level-prefix: sys;
|
|
16
|
-
|
|
17
11
|
/// Emits necessary CSS variables for Material's system level values for the values defined in the
|
|
18
12
|
/// config map. The config map can have values color, typography, and/or density.
|
|
19
13
|
///
|
|
20
14
|
/// If the config map's color value is an Angular Material color palette, it will be used as the
|
|
21
|
-
/// primary and tertiary colors with a
|
|
22
|
-
/// it must have a `primary` value containing an Angular Material color palette, and
|
|
23
|
-
/// a different `tertiary` palette (defaults to primary palette) and `theme-type` that
|
|
24
|
-
/// `light` or `
|
|
25
|
-
/// are no color values in the config.
|
|
15
|
+
/// primary and tertiary colors with a `color-scheme` theme type. Otherwise if the color value is a
|
|
16
|
+
/// map, it must have a `primary` value containing an Angular Material color palette, and
|
|
17
|
+
/// optionally a different `tertiary` palette (defaults to primary palette) and `theme-type` that
|
|
18
|
+
/// is either `light`, `dark`, or 'color-scheme` (defaults to `color-scheme`). Color variable
|
|
19
|
+
/// definitions will not be emitted if there are no color values in the config.
|
|
26
20
|
///
|
|
27
21
|
/// If the config map's typography value is a font family string, it will be used as the
|
|
28
22
|
/// plain and brand font family with default bold, medium, and regular weights of 700, 500, and 400,
|
|
@@ -44,11 +38,19 @@ $_system-level-prefix: sys;
|
|
|
44
38
|
$color: map.get($config, color);
|
|
45
39
|
$color-config: null;
|
|
46
40
|
@if ($color) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@
|
|
41
|
+
// validate-palette returns null if it is a valid M3 palette
|
|
42
|
+
$is-palette: config-validation.validate-palette($color) == null;
|
|
43
|
+
|
|
44
|
+
// Default to "color-scheme" theme type if the config's color does not provide one.
|
|
45
|
+
@if (not $is-palette and not map.has-key($color, theme-type)) {
|
|
46
|
+
$color: map.set($color, theme-type, color-scheme);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$color-config: if($is-palette,
|
|
50
|
+
definition.define-colors((primary: $color, theme-type: color-scheme)),
|
|
51
|
+
definition.define-colors($color));
|
|
52
|
+
@include system-level-colors($color-config, $overrides, definition.$system-fallback-prefix);
|
|
53
|
+
@include system-level-elevation($color-config, $overrides, definition.$system-fallback-prefix);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
$typography: map.get($config, typography);
|
|
@@ -57,7 +59,8 @@ $_system-level-prefix: sys;
|
|
|
57
59
|
$typography-config: if(meta.type-of($typography) == 'map',
|
|
58
60
|
definition.define-typography($typography),
|
|
59
61
|
definition.define-typography((plain-family: $typography)));
|
|
60
|
-
@include system-level-typography(
|
|
62
|
+
@include system-level-typography(
|
|
63
|
+
$typography-config, $overrides, definition.$system-fallback-prefix);
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
$density: map.get($config, density);
|
|
@@ -79,14 +82,13 @@ $_system-level-prefix: sys;
|
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
|
|
82
|
-
@include system-level-shape($overrides: $overrides, $prefix:
|
|
83
|
-
@include system-level-
|
|
84
|
-
@include system-level-state($overrides: $overrides, $prefix: $_system-fallback-prefix);
|
|
85
|
+
@include system-level-shape($overrides: $overrides, $prefix: definition.$system-fallback-prefix);
|
|
86
|
+
@include system-level-state($overrides: $overrides, $prefix: definition.$system-fallback-prefix);
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/// Emits the system-level CSS variables for each of the provided override values. E.g. to
|
|
88
90
|
/// change the primary color to red, use `mat.theme-overrides((primary: red));`
|
|
89
|
-
@mixin theme-overrides($overrides, $prefix:
|
|
91
|
+
@mixin theme-overrides($overrides, $prefix: definition.$system-fallback-prefix) {
|
|
90
92
|
$sys-names: map-merge-all(
|
|
91
93
|
definitions.md-sys-color-values-light(),
|
|
92
94
|
definitions.md-sys-typescale-values(),
|
|
@@ -119,16 +121,14 @@ $_system-level-prefix: sys;
|
|
|
119
121
|
|
|
120
122
|
@if (not $prefix) {
|
|
121
123
|
$prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
122
|
-
color-system-variables-prefix) or
|
|
124
|
+
color-system-variables-prefix) or definition.$system-level-prefix;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
$ref: (
|
|
126
128
|
md-ref-palette: m3-tokens.generate-ref-palette-tokens($primary, $tertiary, $error)
|
|
127
129
|
);
|
|
128
130
|
|
|
129
|
-
$sys-colors:
|
|
130
|
-
definitions.md-sys-color-values-dark($ref),
|
|
131
|
-
definitions.md-sys-color-values-light($ref));
|
|
131
|
+
$sys-colors: _generate-sys-colors($ref, $type);
|
|
132
132
|
|
|
133
133
|
// Manually insert a subset of palette values that are used directly by components
|
|
134
134
|
// instead of system variables.
|
|
@@ -144,6 +144,30 @@ $_system-level-prefix: sys;
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
@function _generate-sys-colors($ref, $type) {
|
|
148
|
+
$light-sys-colors: definitions.md-sys-color-values-light($ref);
|
|
149
|
+
@if ($type == light) {
|
|
150
|
+
@return $light-sys-colors;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
$dark-sys-colors: definitions.md-sys-color-values-dark($ref);
|
|
154
|
+
@if ($type == dark) {
|
|
155
|
+
@return $dark-sys-colors;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@if ($type == color-scheme) {
|
|
159
|
+
$light-dark-sys-colors: ();
|
|
160
|
+
@each $name, $light-value in $light-sys-colors {
|
|
161
|
+
$dark-value: map.get($dark-sys-colors, $name);
|
|
162
|
+
$light-dark-sys-colors:
|
|
163
|
+
map.set($light-dark-sys-colors, $name, light-dark($light-value, $dark-value));
|
|
164
|
+
}
|
|
165
|
+
@return $light-dark-sys-colors;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@error 'Unknown theme-type provided: #{$type}';
|
|
169
|
+
}
|
|
170
|
+
|
|
147
171
|
@mixin system-level-typography($theme, $overrides: (), $prefix: null) {
|
|
148
172
|
$font-definition: map.get($theme, _mat-theming-internals-do-not-access, font-definition);
|
|
149
173
|
$brand: map.get($font-definition, brand);
|
|
@@ -157,7 +181,7 @@ $_system-level-prefix: sys;
|
|
|
157
181
|
|
|
158
182
|
@if (not $prefix) {
|
|
159
183
|
$prefix: map.get($theme, _mat-theming-internals-do-not-access,
|
|
160
|
-
typography-system-variables-prefix) or
|
|
184
|
+
typography-system-variables-prefix) or definition.$system-level-prefix;
|
|
161
185
|
}
|
|
162
186
|
|
|
163
187
|
& {
|
|
@@ -167,7 +191,7 @@ $_system-level-prefix: sys;
|
|
|
167
191
|
}
|
|
168
192
|
}
|
|
169
193
|
|
|
170
|
-
@mixin system-level-elevation($theme, $overrides: (), $prefix:
|
|
194
|
+
@mixin system-level-elevation($theme, $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
171
195
|
$shadow-color: map.get(
|
|
172
196
|
$theme, _mat-theming-internals-do-not-access, color-tokens, (mdc, theme), shadow);
|
|
173
197
|
|
|
@@ -180,7 +204,7 @@ $_system-level-prefix: sys;
|
|
|
180
204
|
}
|
|
181
205
|
}
|
|
182
206
|
|
|
183
|
-
@mixin system-level-shape($theme: (), $overrides: (), $prefix:
|
|
207
|
+
@mixin system-level-shape($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
184
208
|
& {
|
|
185
209
|
@each $name, $value in definitions.md-sys-shape-values() {
|
|
186
210
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
@@ -188,7 +212,7 @@ $_system-level-prefix: sys;
|
|
|
188
212
|
}
|
|
189
213
|
}
|
|
190
214
|
|
|
191
|
-
@mixin system-level-state($theme: (), $overrides: (), $prefix:
|
|
215
|
+
@mixin system-level-state($theme: (), $overrides: (), $prefix: definition.$system-level-prefix) {
|
|
192
216
|
& {
|
|
193
217
|
@each $name, $value in definitions.md-sys-state-values() {
|
|
194
218
|
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
@@ -196,21 +220,13 @@ $_system-level-prefix: sys;
|
|
|
196
220
|
}
|
|
197
221
|
}
|
|
198
222
|
|
|
199
|
-
@mixin system-level-motion($theme: (), $overrides: (), $prefix: $_system-level-prefix) {
|
|
200
|
-
& {
|
|
201
|
-
@each $name, $value in definitions.md-sys-motion-values() {
|
|
202
|
-
--#{$prefix}-#{$name}: #{map.get($overrides, $name) or $value};
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
223
|
// Return a new map where the values are the same as the provided map's
|
|
208
224
|
// keys, prefixed with "--mat-sys-". For example:
|
|
209
225
|
// (key1: '', key2: '') --> (key1: --mat-sys-key1, key2: --mat-sys-key2)
|
|
210
226
|
@function _create-system-app-vars-map($map) {
|
|
211
227
|
$new-map: ();
|
|
212
228
|
@each $key, $value in $map {
|
|
213
|
-
$new-map: map.set($new-map, $key, --#{
|
|
229
|
+
$new-map: map.set($new-map, $key, --#{definition.$system-fallback-prefix}-#{$key});
|
|
214
230
|
}
|
|
215
231
|
@return $new-map;
|
|
216
232
|
}
|
|
@@ -145,18 +145,22 @@ $calendar-weekday-table-font-size: 11px !default;
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
///
|
|
149
|
-
|
|
150
|
-
@
|
|
151
|
-
@include token-utils.batch-create-token-values(
|
|
152
|
-
$tokens,
|
|
148
|
+
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
149
|
+
@function _define-overrides() {
|
|
150
|
+
@return (
|
|
153
151
|
(
|
|
154
152
|
namespace: tokens-mat-datepicker.$prefix,
|
|
155
153
|
tokens: tokens-mat-datepicker.get-token-slots(),
|
|
156
|
-
)
|
|
154
|
+
),
|
|
157
155
|
);
|
|
158
156
|
}
|
|
159
157
|
|
|
158
|
+
/// Outputs the CSS variable values for the given tokens.
|
|
159
|
+
/// @param {Map} $tokens The token values to emit.
|
|
160
|
+
@mixin overrides($tokens: ()) {
|
|
161
|
+
@include token-utils.batch-create-token-values($tokens, _define-overrides()...);
|
|
162
|
+
}
|
|
163
|
+
|
|
160
164
|
/// Outputs all (base, color, typography, and density) theme styles for the mat-datepicker.
|
|
161
165
|
/// @param {Map} $theme The theme to generate styles for.
|
|
162
166
|
/// @param {ArgList} Additional optional arguments (only supported for M3 themes):
|
package/datepicker/index.d.ts
CHANGED
|
@@ -17,13 +17,12 @@ import { FactoryProvider } from '@angular/core';
|
|
|
17
17
|
import { FocusOrigin } from '@angular/cdk/a11y';
|
|
18
18
|
import { FormGroupDirective } from '@angular/forms';
|
|
19
19
|
import * as i0 from '@angular/core';
|
|
20
|
-
import * as i1 from '@angular/
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
23
|
-
import * as i3 from '@angular/cdk/
|
|
24
|
-
import * as i4 from '@angular/cdk/
|
|
25
|
-
import * as i5 from '@angular/
|
|
26
|
-
import * as i6 from '@angular/material/core';
|
|
20
|
+
import * as i1 from '@angular/material/button';
|
|
21
|
+
import * as i19 from '@angular/cdk/scrolling';
|
|
22
|
+
import * as i2 from '@angular/cdk/overlay';
|
|
23
|
+
import * as i3 from '@angular/cdk/a11y';
|
|
24
|
+
import * as i4 from '@angular/cdk/portal';
|
|
25
|
+
import * as i5 from '@angular/material/core';
|
|
27
26
|
import { InjectionToken } from '@angular/core';
|
|
28
27
|
import { MatButton } from '@angular/material/button';
|
|
29
28
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
@@ -116,20 +115,6 @@ export declare type ExtractDateTypeFromSelection<T> = T extends DateRange<infer
|
|
|
116
115
|
declare function getActiveOffset<D>(dateAdapter: DateAdapter<D>, activeDate: D, minDate: D | null, maxDate: D | null): number;
|
|
117
116
|
|
|
118
117
|
declare namespace i10 {
|
|
119
|
-
export {
|
|
120
|
-
MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY,
|
|
121
|
-
MAT_DATEPICKER_SCROLL_STRATEGY,
|
|
122
|
-
DatepickerDropdownPositionX,
|
|
123
|
-
DatepickerDropdownPositionY,
|
|
124
|
-
MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER,
|
|
125
|
-
MatDatepickerContent,
|
|
126
|
-
MatDatepickerControl,
|
|
127
|
-
MatDatepickerPanel,
|
|
128
|
-
MatDatepickerBase
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
declare namespace i11 {
|
|
133
118
|
export {
|
|
134
119
|
MAT_DATEPICKER_VALUE_ACCESSOR,
|
|
135
120
|
MAT_DATEPICKER_VALIDATORS,
|
|
@@ -137,26 +122,26 @@ declare namespace i11 {
|
|
|
137
122
|
}
|
|
138
123
|
}
|
|
139
124
|
|
|
140
|
-
declare namespace
|
|
125
|
+
declare namespace i11 {
|
|
141
126
|
export {
|
|
142
127
|
MatDatepickerToggleIcon,
|
|
143
128
|
MatDatepickerToggle
|
|
144
129
|
}
|
|
145
130
|
}
|
|
146
131
|
|
|
147
|
-
declare namespace
|
|
132
|
+
declare namespace i12 {
|
|
148
133
|
export {
|
|
149
134
|
MatMonthView
|
|
150
135
|
}
|
|
151
136
|
}
|
|
152
137
|
|
|
153
|
-
declare namespace
|
|
138
|
+
declare namespace i13 {
|
|
154
139
|
export {
|
|
155
140
|
MatYearView
|
|
156
141
|
}
|
|
157
142
|
}
|
|
158
143
|
|
|
159
|
-
declare namespace
|
|
144
|
+
declare namespace i14 {
|
|
160
145
|
export {
|
|
161
146
|
isSameMultiYearView,
|
|
162
147
|
getActiveOffset,
|
|
@@ -166,13 +151,13 @@ declare namespace i15 {
|
|
|
166
151
|
}
|
|
167
152
|
}
|
|
168
153
|
|
|
169
|
-
declare namespace
|
|
154
|
+
declare namespace i15 {
|
|
170
155
|
export {
|
|
171
156
|
MatDateRangeInput
|
|
172
157
|
}
|
|
173
158
|
}
|
|
174
159
|
|
|
175
|
-
declare namespace
|
|
160
|
+
declare namespace i16 {
|
|
176
161
|
export {
|
|
177
162
|
MatDateRangeInputParent,
|
|
178
163
|
MAT_DATE_RANGE_INPUT_PARENT,
|
|
@@ -181,14 +166,14 @@ declare namespace i17 {
|
|
|
181
166
|
}
|
|
182
167
|
}
|
|
183
168
|
|
|
184
|
-
declare namespace
|
|
169
|
+
declare namespace i17 {
|
|
185
170
|
export {
|
|
186
171
|
MatDateRangePickerInput,
|
|
187
172
|
MatDateRangePicker
|
|
188
173
|
}
|
|
189
174
|
}
|
|
190
175
|
|
|
191
|
-
declare namespace
|
|
176
|
+
declare namespace i18 {
|
|
192
177
|
export {
|
|
193
178
|
MatDatepickerApply,
|
|
194
179
|
MatDatepickerCancel,
|
|
@@ -196,7 +181,7 @@ declare namespace i19 {
|
|
|
196
181
|
}
|
|
197
182
|
}
|
|
198
183
|
|
|
199
|
-
declare namespace
|
|
184
|
+
declare namespace i6 {
|
|
200
185
|
export {
|
|
201
186
|
MatCalendarView,
|
|
202
187
|
MatCalendarHeader,
|
|
@@ -204,7 +189,7 @@ declare namespace i7 {
|
|
|
204
189
|
}
|
|
205
190
|
}
|
|
206
191
|
|
|
207
|
-
declare namespace
|
|
192
|
+
declare namespace i7 {
|
|
208
193
|
export {
|
|
209
194
|
MatCalendarCellCssClasses,
|
|
210
195
|
MatCalendarCellClassFunction,
|
|
@@ -214,12 +199,26 @@ declare namespace i8 {
|
|
|
214
199
|
}
|
|
215
200
|
}
|
|
216
201
|
|
|
217
|
-
declare namespace
|
|
202
|
+
declare namespace i8 {
|
|
218
203
|
export {
|
|
219
204
|
MatDatepicker
|
|
220
205
|
}
|
|
221
206
|
}
|
|
222
207
|
|
|
208
|
+
declare namespace i9 {
|
|
209
|
+
export {
|
|
210
|
+
MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY,
|
|
211
|
+
MAT_DATEPICKER_SCROLL_STRATEGY,
|
|
212
|
+
DatepickerDropdownPositionX,
|
|
213
|
+
DatepickerDropdownPositionY,
|
|
214
|
+
MAT_DATEPICKER_SCROLL_STRATEGY_FACTORY_PROVIDER,
|
|
215
|
+
MatDatepickerContent,
|
|
216
|
+
MatDatepickerControl,
|
|
217
|
+
MatDatepickerPanel,
|
|
218
|
+
MatDatepickerBase
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
223
222
|
declare function isSameMultiYearView<D>(dateAdapter: DateAdapter<D>, date1: D, date2: D, minDate: D | null, maxDate: D | null): boolean;
|
|
224
223
|
|
|
225
224
|
/**
|
|
@@ -1148,7 +1147,7 @@ export declare class MatDatepickerIntl {
|
|
|
1148
1147
|
|
|
1149
1148
|
export declare class MatDatepickerModule {
|
|
1150
1149
|
static ɵfac: i0.ɵɵFactoryDeclaration<MatDatepickerModule, never>;
|
|
1151
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatDatepickerModule, never, [typeof i1.
|
|
1150
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatDatepickerModule, never, [typeof i1.MatButtonModule, typeof i2.OverlayModule, typeof i3.A11yModule, typeof i4.PortalModule, typeof i5.MatCommonModule, typeof i6.MatCalendar, typeof i7.MatCalendarBody, typeof i8.MatDatepicker, typeof i9.MatDatepickerContent, typeof i10.MatDatepickerInput, typeof i11.MatDatepickerToggle, typeof i11.MatDatepickerToggleIcon, typeof i12.MatMonthView, typeof i13.MatYearView, typeof i14.MatMultiYearView, typeof i6.MatCalendarHeader, typeof i15.MatDateRangeInput, typeof i16.MatStartDate, typeof i16.MatEndDate, typeof i17.MatDateRangePicker, typeof i18.MatDatepickerActions, typeof i18.MatDatepickerCancel, typeof i18.MatDatepickerApply], [typeof i19.CdkScrollableModule, typeof i6.MatCalendar, typeof i7.MatCalendarBody, typeof i8.MatDatepicker, typeof i9.MatDatepickerContent, typeof i10.MatDatepickerInput, typeof i11.MatDatepickerToggle, typeof i11.MatDatepickerToggleIcon, typeof i12.MatMonthView, typeof i13.MatYearView, typeof i14.MatMultiYearView, typeof i6.MatCalendarHeader, typeof i15.MatDateRangeInput, typeof i16.MatStartDate, typeof i16.MatEndDate, typeof i17.MatDateRangePicker, typeof i18.MatDatepickerActions, typeof i18.MatDatepickerCancel, typeof i18.MatDatepickerApply]>;
|
|
1152
1151
|
static ɵinj: i0.ɵɵInjectorDeclaration<MatDatepickerModule>;
|
|
1153
1152
|
}
|
|
1154
1153
|
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
71
|
+
@function _define-overrides() {
|
|
72
|
+
@return (
|
|
73
73
|
(
|
|
74
74
|
namespace: tokens-mdc-dialog.$prefix,
|
|
75
75
|
tokens: tokens-mdc-dialog.get-token-slots(),
|
|
@@ -77,10 +77,14 @@
|
|
|
77
77
|
(
|
|
78
78
|
namespace: tokens-mat-dialog.$prefix,
|
|
79
79
|
tokens: tokens-mat-dialog.get-token-slots(),
|
|
80
|
-
)
|
|
80
|
+
),
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
@mixin overrides($tokens: ()) {
|
|
85
|
+
@include token-utils.batch-create-token-values($tokens, _define-overrides()...);
|
|
86
|
+
}
|
|
87
|
+
|
|
84
88
|
@mixin theme($theme) {
|
|
85
89
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-dialog') {
|
|
86
90
|
@if inspection.get-theme-version($theme) == 1 {
|
|
@@ -46,16 +46,20 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
50
|
+
@function _define-overrides() {
|
|
51
|
+
@return (
|
|
52
52
|
(
|
|
53
53
|
namespace: tokens-mat-divider.$prefix,
|
|
54
54
|
tokens: tokens-mat-divider.get-token-slots(),
|
|
55
|
-
)
|
|
55
|
+
),
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
@mixin overrides($tokens: ()) {
|
|
60
|
+
@include token-utils.batch-create-token-values($tokens, _define-overrides()...);
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
@mixin theme($theme) {
|
|
60
64
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-divider') {
|
|
61
65
|
@if inspection.get-theme-version($theme) == 1 {
|
|
@@ -62,16 +62,20 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
/// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
|
|
66
|
+
@function _define-overrides() {
|
|
67
|
+
@return (
|
|
68
68
|
(
|
|
69
69
|
namespace: tokens-mat-expansion.$prefix,
|
|
70
70
|
tokens: tokens-mat-expansion.get-token-slots(),
|
|
71
|
-
)
|
|
71
|
+
),
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
@mixin overrides($tokens: ()) {
|
|
76
|
+
@include token-utils.batch-create-token-values($tokens, _define-overrides()...);
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
@mixin theme($theme) {
|
|
76
80
|
@include theming.private-check-duplicate-theme-styles($theme, 'mat-expansion') {
|
|
77
81
|
@if inspection.get-theme-version($theme) == 1 {
|
|
@@ -3,12 +3,9 @@ import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
|
3
3
|
import { MatOptionHarness, MatOptgroupHarness } from '@angular/material/core/testing';
|
|
4
4
|
|
|
5
5
|
class MatAutocompleteHarness extends ComponentHarness {
|
|
6
|
-
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this._documentRootLocator = this.documentRootLocatorFactory();
|
|
9
|
-
}
|
|
6
|
+
_documentRootLocator = this.documentRootLocatorFactory();
|
|
10
7
|
/** The selector for the host element of a `MatAutocomplete` instance. */
|
|
11
|
-
static
|
|
8
|
+
static hostSelector = '.mat-mdc-autocomplete-trigger';
|
|
12
9
|
/**
|
|
13
10
|
* Gets a `HarnessPredicate` that can be used to search for an autocomplete with specific
|
|
14
11
|
* attributes.
|
|
@@ -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;
|
|
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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"}
|