@angular/material 16.2.0-next.2 → 16.2.0-next.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.
Files changed (42) hide show
  1. package/core/tokens/_token-utils.scss +13 -0
  2. package/core/tokens/m2/mat/_menu.scss +62 -0
  3. package/core/tokens/m2/mat/_stepper.scss +118 -0
  4. package/core/typography/_typography-utils.scss +13 -0
  5. package/esm2022/button-toggle/button-toggle.mjs +2 -1
  6. package/esm2022/chips/chip-set.mjs +2 -2
  7. package/esm2022/core/version.mjs +1 -1
  8. package/esm2022/menu/menu-item.mjs +4 -4
  9. package/esm2022/menu/menu.mjs +3 -3
  10. package/esm2022/sidenav/drawer.mjs +15 -13
  11. package/esm2022/stepper/step-header.mjs +2 -2
  12. package/esm2022/stepper/stepper.mjs +3 -3
  13. package/fesm2022/button-toggle.mjs +1 -0
  14. package/fesm2022/button-toggle.mjs.map +1 -1
  15. package/fesm2022/chips.mjs +1 -1
  16. package/fesm2022/chips.mjs.map +1 -1
  17. package/fesm2022/core.mjs +1 -1
  18. package/fesm2022/core.mjs.map +1 -1
  19. package/fesm2022/menu.mjs +5 -5
  20. package/fesm2022/menu.mjs.map +1 -1
  21. package/fesm2022/sidenav.mjs +14 -12
  22. package/fesm2022/sidenav.mjs.map +1 -1
  23. package/fesm2022/stepper.mjs +4 -4
  24. package/fesm2022/stepper.mjs.map +1 -1
  25. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  26. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  27. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  28. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  29. package/menu/_menu-theme.scss +9 -52
  30. package/menu/index.d.ts +1 -1
  31. package/package.json +2 -2
  32. package/prebuilt-themes/deeppurple-amber.css +1 -1
  33. package/prebuilt-themes/indigo-pink.css +1 -1
  34. package/prebuilt-themes/pink-bluegrey.css +1 -1
  35. package/prebuilt-themes/purple-green.css +1 -1
  36. package/schematics/ng-add/index.js +1 -1
  37. package/schematics/ng-add/index.mjs +1 -1
  38. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +1 -1
  39. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
  40. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +1 -5
  41. package/sidenav/index.d.ts +1 -1
  42. package/stepper/_stepper-theme.scss +18 -147
@@ -17,7 +17,7 @@
17
17
  </table>
18
18
 
19
19
  <mat-paginator #paginator
20
- [length]="dataSource?.data?.length"
20
+ [length]="dataSource.data.length"
21
21
  [pageIndex]="0"
22
22
  [pageSize]="10"
23
23
  [pageSizeOptions]="[5, 10, 20]"
@@ -23,15 +23,11 @@ export class <%= classify(name) %>Component implements AfterViewInit {
23
23
  @ViewChild(MatPaginator) paginator!: MatPaginator;
24
24
  @ViewChild(MatSort) sort!: MatSort;
25
25
  @ViewChild(MatTable) table!: MatTable<<%= classify(name) %>Item>;
26
- dataSource: <%= classify(name) %>DataSource;
26
+ dataSource = new <%= classify(name) %>DataSource();
27
27
 
28
28
  /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
29
29
  displayedColumns = ['id', 'name'];
30
30
 
31
- constructor() {
32
- this.dataSource = new <%= classify(name) %>DataSource();
33
- }
34
-
35
31
  ngAfterViewInit(): void {
36
32
  this.dataSource.sort = this.sort;
37
33
  this.dataSource.paginator = this.paginator;
@@ -326,8 +326,8 @@ export declare class MatDrawerContainer implements AfterContentInit, DoCheck, On
326
326
  _onBackdropClicked(): void;
327
327
  _closeModalDrawersViaBackdrop(): void;
328
328
  _isShowingBackdrop(): boolean;
329
- private _canHaveBackdrop;
330
329
  private _isDrawerOpen;
330
+ private _drawerHasBackdrop;
331
331
  static ɵfac: i0.ɵɵFactoryDeclaration<MatDrawerContainer, [{ optional: true; }, null, null, null, null, null, { optional: true; }]>;
332
332
  static ɵcmp: i0.ɵɵComponentDeclaration<MatDrawerContainer, "mat-drawer-container", ["matDrawerContainer"], { "autosize": { "alias": "autosize"; "required": false; }; "hasBackdrop": { "alias": "hasBackdrop"; "required": false; }; }, { "backdropClick": "backdropClick"; }, ["_content", "_allDrawers"], ["mat-drawer", "mat-drawer-content", "*"], false, never>;
333
333
  }
@@ -2,142 +2,38 @@
2
2
  @use 'sass:math';
3
3
  @use '../core/theming/theming';
4
4
  @use '../core/typography/typography';
5
- @use '../core/typography/typography-utils';
6
5
  @use '../core/density/private/compatibility';
6
+ @use '../core/style/sass-utils';
7
+ @use '../core/tokens/token-utils';
8
+ @use '../core/tokens/m2/mat/stepper' as tokens-mat-stepper;
7
9
  @use './stepper-variables';
8
10
 
9
11
  @mixin color($config-or-theme) {
10
12
  $config: theming.get-color-config($config-or-theme);
11
- $foreground: map.get($config, foreground);
12
- $background: map.get($config, background);
13
- $primary: map.get($config, primary);
14
- $accent: map.get($config, accent);
15
- $warn: map.get($config, warn);
16
13
 
17
- .mat-step-header {
18
- &.cdk-keyboard-focused,
19
- &.cdk-program-focused,
20
- &:hover:not([aria-disabled]),
21
- &:hover[aria-disabled='false'] {
22
- background-color: theming.get-color-from-palette($background, hover);
23
- }
24
-
25
- &:hover[aria-disabled='true'] {
26
- cursor: default;
27
- }
14
+ @include sass-utils.current-selector-or-root() {
15
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
16
+ tokens-mat-stepper.get-color-tokens($config));
28
17
 
29
- // On touch devices the :hover state will linger on the element after a tap.
30
- // Reset it via `@media` after the declaration, because the media query isn't
31
- // supported by all browsers yet.
32
- @media (hover: none) {
33
- &:hover {
34
- background: none;
35
- }
18
+ .mat-step-header.mat-accent {
19
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
20
+ tokens-mat-stepper.private-get-color-palette-color-tokens(map.get($config, accent)));
36
21
  }
37
22
 
38
- .mat-step-label,
39
- .mat-step-optional {
40
- // TODO(josephperrott): Update to using a corrected disabled-text contrast
41
- // instead of secondary-text.
42
- color: theming.get-color-from-palette($foreground, secondary-text);
23
+ .mat-step-header.mat-warn {
24
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
25
+ tokens-mat-stepper.private-get-color-palette-color-tokens(map.get($config, warn)));
43
26
  }
44
-
45
- .mat-step-icon {
46
- // TODO(josephperrott): Update to using a corrected disabled-text contrast
47
- // instead of secondary-text.
48
- background-color: theming.get-color-from-palette($foreground, secondary-text);
49
- color: theming.get-color-from-palette($primary, default-contrast);
50
- }
51
-
52
- .mat-step-icon-selected,
53
- .mat-step-icon-state-done,
54
- .mat-step-icon-state-edit {
55
- background-color: theming.get-color-from-palette($primary);
56
- color: theming.get-color-from-palette($primary, default-contrast);
57
- }
58
-
59
- &.mat-accent {
60
- .mat-step-icon {
61
- color: theming.get-color-from-palette($accent, default-contrast);
62
- }
63
-
64
- .mat-step-icon-selected,
65
- .mat-step-icon-state-done,
66
- .mat-step-icon-state-edit {
67
- background-color: theming.get-color-from-palette($accent);
68
- color: theming.get-color-from-palette($accent, default-contrast);
69
- }
70
- }
71
-
72
- &.mat-warn {
73
- .mat-step-icon {
74
- color: theming.get-color-from-palette($warn, default-contrast);
75
- }
76
-
77
- .mat-step-icon-selected,
78
- .mat-step-icon-state-done,
79
- .mat-step-icon-state-edit {
80
- background-color: theming.get-color-from-palette($warn);
81
- color: theming.get-color-from-palette($warn, default-contrast);
82
- }
83
- }
84
-
85
- .mat-step-icon-state-error {
86
- background-color: transparent;
87
- color: theming.get-color-from-palette($warn, text);
88
- }
89
-
90
- .mat-step-label.mat-step-label-active {
91
- color: theming.get-color-from-palette($foreground, text);
92
- }
93
-
94
- .mat-step-label.mat-step-label-error {
95
- color: theming.get-color-from-palette($warn, text);
96
- }
97
- }
98
-
99
- .mat-stepper-horizontal, .mat-stepper-vertical {
100
- background-color: theming.get-color-from-palette($background, card);
101
- }
102
-
103
- .mat-stepper-vertical-line::before {
104
- border-left-color: theming.get-color-from-palette($foreground, divider);
105
- }
106
-
107
- .mat-horizontal-stepper-header::before,
108
- .mat-horizontal-stepper-header::after,
109
- .mat-stepper-horizontal-line {
110
- border-top-color: theming.get-color-from-palette($foreground, divider);
111
27
  }
112
28
  }
113
29
 
114
30
  @mixin typography($config-or-theme) {
115
31
  $config: typography.private-typography-to-2014-config(
116
32
  theming.get-typography-config($config-or-theme));
117
- .mat-stepper-vertical, .mat-stepper-horizontal {
118
- font-family: typography-utils.font-family($config);
119
- }
120
-
121
- .mat-step-label {
122
- font: {
123
- size: typography-utils.font-size($config, body-1);
124
- weight: typography-utils.font-weight($config, body-1);
125
- };
126
- }
127
-
128
- .mat-step-sub-label-error {
129
- font-weight: normal;
130
- }
131
-
132
- .mat-step-label-error {
133
- font-size: typography-utils.font-size($config, body-2);
134
- }
135
33
 
136
- .mat-step-label-selected {
137
- font: {
138
- size: typography-utils.font-size($config, body-2);
139
- weight: typography-utils.font-weight($config, body-2);
140
- };
34
+ @include sass-utils.current-selector-or-root() {
35
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
36
+ tokens-mat-stepper.get-typography-tokens($config));
141
37
  }
142
38
  }
143
39
 
@@ -147,34 +43,9 @@
147
43
  $density-scale, height);
148
44
  $vertical-padding: math.div($height - stepper-variables.$label-header-height, 2);
149
45
 
150
- @include compatibility.private-density-legacy-compatibility() {
151
- .mat-horizontal-stepper-header {
152
- height: $height;
153
- }
154
-
155
- .mat-stepper-label-position-bottom .mat-horizontal-stepper-header,
156
- .mat-vertical-stepper-header {
157
- padding: $vertical-padding stepper-variables.$side-gap;
158
- }
159
-
160
- // Ensures that the vertical lines for the step content exceed into the step
161
- // headers with a given distance (`$mat-stepper-line-gap`) to the step icon.
162
- .mat-stepper-vertical-line::before {
163
- top: stepper-variables.$line-gap - $vertical-padding;
164
- bottom: stepper-variables.$line-gap - $vertical-padding;
165
- }
166
-
167
- // Ensures that the horizontal lines for the step header are centered vertically.
168
- .mat-stepper-label-position-bottom .mat-horizontal-stepper-header {
169
- &::after, &::before {
170
- top: $vertical-padding + math.div(stepper-variables.$label-header-height, 2);
171
- }
172
- }
173
-
174
- // Ensures that the horizontal line for the step content is aligned centered vertically.
175
- .mat-stepper-label-position-bottom .mat-stepper-horizontal-line {
176
- top: $vertical-padding + math.div(stepper-variables.$label-header-height, 2);
177
- }
46
+ @include sass-utils.current-selector-or-root() {
47
+ @include token-utils.create-token-values(tokens-mat-stepper.$prefix,
48
+ tokens-mat-stepper.get-density-tokens($density-scale));
178
49
  }
179
50
  }
180
51