@angular/material 16.2.0-next.4 → 16.2.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/badge/_badge-theme.scss +84 -118
- package/bottom-sheet/_bottom-sheet-theme.scss +10 -11
- package/bottom-sheet/index.d.ts +6 -0
- package/button-toggle/_button-toggle-theme.scss +20 -97
- package/button-toggle/_button-toggle-variables.scss +2 -0
- package/chips/index.d.ts +11 -4
- package/core/index.d.ts +1 -0
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss +1 -1
- package/core/tokens/_token-utils.scss +1 -0
- package/core/tokens/m2/mat/_badge.scss +78 -0
- package/core/tokens/m2/mat/_bottom-sheet.scss +56 -0
- package/core/tokens/m2/mat/_datepicker.scss +184 -0
- package/core/tokens/m2/mat/_divider.scss +45 -0
- package/core/tokens/m2/mat/_form-field.scss +44 -0
- package/core/tokens/m2/mat/_grid-list.scss +46 -0
- package/core/tokens/m2/mat/_icon.scss +45 -0
- package/core/tokens/m2/mat/_legacy-button-toggle.scss +63 -0
- package/core/tokens/m2/mat/_sidenav.scss +65 -0
- package/core/tokens/m2/mat/_slide-toggle.scss +1 -1
- package/core/tokens/m2/mat/_standard-button-toggle.scss +87 -0
- package/core/tokens/m2/mat/_tab-header.scss +1 -1
- package/core/tokens/m2/mat/_toolbar.scss +79 -0
- package/core/tokens/m2/mdc/_circular-progress.scss +1 -1
- package/core/tokens/m2/mdc/_filled-text-field.scss +175 -0
- package/core/tokens/m2/mdc/_outlined-text-field.scss +158 -0
- package/core/tokens/m2/mdc/_plain-tooltip.scss +2 -2
- package/datepicker/_datepicker-theme.scss +44 -203
- package/dialog/index.d.ts +6 -0
- package/divider/_divider-theme.scss +6 -8
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
- package/esm2022/bottom-sheet/bottom-sheet-ref.mjs +8 -1
- package/esm2022/button-toggle/button-toggle.mjs +2 -2
- package/esm2022/chips/chip-option.mjs +4 -5
- package/esm2022/chips/chip-row.mjs +15 -10
- package/esm2022/chips/chip.mjs +29 -12
- package/esm2022/core/private/ripple-loader.mjs +4 -1
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +2 -2
- package/esm2022/datepicker/calendar.mjs +2 -2
- package/esm2022/datepicker/date-range-input.mjs +2 -2
- package/esm2022/datepicker/datepicker-base.mjs +3 -3
- package/esm2022/datepicker/datepicker-toggle.mjs +2 -2
- package/esm2022/dialog/dialog-ref.mjs +1 -1
- package/esm2022/dialog/dialog.mjs +2 -1
- package/esm2022/divider/divider.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/grid-list/grid-list.mjs +2 -2
- package/esm2022/grid-list/grid-tile.mjs +2 -2
- package/esm2022/icon/icon.mjs +2 -2
- package/esm2022/menu/menu-item.mjs +4 -4
- package/esm2022/menu/menu.mjs +3 -3
- package/esm2022/radio/radio.mjs +13 -1
- package/esm2022/sidenav/drawer.mjs +3 -3
- package/esm2022/sidenav/sidenav.mjs +3 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +2 -2
- package/esm2022/tabs/ink-bar.mjs +1 -1
- package/esm2022/tabs/tab-group.mjs +2 -2
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
- package/esm2022/toolbar/toolbar.mjs +2 -2
- package/fesm2022/bottom-sheet.mjs +9 -2
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +2 -2
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/chips.mjs +41 -17
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +4 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +10 -10
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog.mjs +1 -0
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider.mjs +2 -2
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +4 -4
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon.mjs +2 -2
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/menu.mjs +5 -5
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/radio.mjs +12 -0
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +4 -4
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/tabs.mjs +4 -4
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +2 -2
- package/fesm2022/toolbar.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +37 -44
- package/form-field/_mdc-text-field-structure-overrides.scss +18 -0
- package/grid-list/_grid-list-theme.scss +7 -6
- package/icon/_icon-theme.scss +18 -8
- package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
- package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
- package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
- package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
- package/package.json +49 -49
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/radio/index.d.ts +4 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-update/index_bundled.js +25 -25
- package/sidenav/_sidenav-theme.scss +6 -69
- package/tabs/_tabs-common.scss +1 -1
- package/tabs/index.d.ts +1 -1
- package/toolbar/_toolbar-theme.scss +25 -71
package/badge/_badge-theme.scss
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
// This contains all of the styles for the badge
|
|
2
|
-
// rather than just the color/theme because of
|
|
3
|
-
// no style sheet support for directives.
|
|
4
1
|
@use 'sass:color';
|
|
5
2
|
@use 'sass:map';
|
|
6
|
-
@use 'sass:meta';
|
|
7
3
|
@use 'sass:math';
|
|
8
4
|
@use '@angular/cdk';
|
|
9
5
|
|
|
10
6
|
@use '../core/theming/theming';
|
|
11
7
|
@use '../core/typography/typography';
|
|
12
|
-
@use '../core/
|
|
8
|
+
@use '../core/tokens/m2/mat/badge' as tokens-mat-badge;
|
|
9
|
+
@use '../core/tokens/token-utils';
|
|
10
|
+
@use '../core/style/sass-utils';
|
|
13
11
|
|
|
12
|
+
// TODO(crisbeto): some of these variables aren't used anymore and should be deleted.
|
|
14
13
|
$font-size: 12px;
|
|
15
14
|
$font-weight: 600;
|
|
16
15
|
$default-size: 22px !default;
|
|
@@ -18,79 +17,71 @@ $small-size: $default-size - 6;
|
|
|
18
17
|
$large-size: $default-size + 6;
|
|
19
18
|
$_badge-structure-emitted: false !default;
|
|
20
19
|
|
|
20
|
+
// Internally there are some builds that throw an error if they can't figure out the values
|
|
21
|
+
// of CSS variables during compliation. This flag temporarily enables fallbacks for these builds.
|
|
22
|
+
// Eventually we should clean them up.
|
|
23
|
+
$_emit-fallback-vars: true;
|
|
24
|
+
|
|
21
25
|
// Mixin for building offset given different sizes
|
|
22
|
-
@mixin _badge-size($size) {
|
|
26
|
+
@mixin _badge-size($size, $font-size-token) {
|
|
23
27
|
// This mixin isn't used in the context of a theme so we can disable the ampersand check.
|
|
24
28
|
// stylelint-disable material/no-ampersand-beyond-selector-start
|
|
25
29
|
.mat-badge-content {
|
|
26
30
|
width: $size;
|
|
27
31
|
height: $size;
|
|
28
32
|
line-height: $size;
|
|
29
|
-
}
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
@if ($font-size-token) {
|
|
35
|
+
@include token-utils.use-tokens(tokens-mat-badge.$prefix,
|
|
36
|
+
tokens-mat-badge.get-token-slots()) {
|
|
37
|
+
@include token-utils.create-token-slot(font-size, $font-size-token, $_emit-fallback-vars);
|
|
38
|
+
}
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
&.mat-badge-
|
|
38
|
-
.
|
|
39
|
-
bottom: math.div(-$size, 2);
|
|
40
|
-
}
|
|
42
|
+
&.mat-badge-above .mat-badge-content {
|
|
43
|
+
top: math.div(-$size, 2);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
&.mat-badge-
|
|
44
|
-
.
|
|
45
|
-
left: -$size;
|
|
46
|
-
}
|
|
46
|
+
&.mat-badge-below .mat-badge-content {
|
|
47
|
+
bottom: math.div(-$size, 2);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
left: auto;
|
|
52
|
-
right: -$size;
|
|
53
|
-
}
|
|
50
|
+
&.mat-badge-before .mat-badge-content {
|
|
51
|
+
left: -$size;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
&.mat-badge-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
54
|
+
[dir='rtl'] &.mat-badge-before .mat-badge-content {
|
|
55
|
+
left: auto;
|
|
56
|
+
right: -$size;
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
&.mat-badge-after .mat-badge-content {
|
|
60
|
+
right: -$size;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[dir='rtl'] &.mat-badge-after .mat-badge-content {
|
|
64
|
+
right: auto;
|
|
65
|
+
left: -$size;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
&.mat-badge-overlap {
|
|
70
|
-
&.mat-badge-before {
|
|
71
|
-
.
|
|
72
|
-
left: math.div(-$size, 2);
|
|
73
|
-
}
|
|
69
|
+
&.mat-badge-before .mat-badge-content {
|
|
70
|
+
left: math.div(-$size, 2);
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
[dir='rtl'] &.mat-badge-before {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
right: math.div(-$size, 2);
|
|
80
|
-
}
|
|
73
|
+
[dir='rtl'] &.mat-badge-before .mat-badge-content {
|
|
74
|
+
left: auto;
|
|
75
|
+
right: math.div(-$size, 2);
|
|
81
76
|
}
|
|
82
77
|
|
|
83
|
-
&.mat-badge-after {
|
|
84
|
-
.
|
|
85
|
-
right: math.div(-$size, 2);
|
|
86
|
-
}
|
|
78
|
+
&.mat-badge-after .mat-badge-content {
|
|
79
|
+
right: math.div(-$size, 2);
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
[dir='rtl'] &.mat-badge-after {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
left: math.div(-$size, 2);
|
|
93
|
-
}
|
|
82
|
+
[dir='rtl'] &.mat-badge-after .mat-badge-content {
|
|
83
|
+
right: auto;
|
|
84
|
+
left: math.div(-$size, 2);
|
|
94
85
|
}
|
|
95
86
|
}
|
|
96
87
|
// stylelint-enable
|
|
@@ -101,19 +92,13 @@ $_badge-structure-emitted: false !default;
|
|
|
101
92
|
@mixin _badge-structure {
|
|
102
93
|
.mat-badge {
|
|
103
94
|
position: relative;
|
|
104
|
-
}
|
|
105
95
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.mat-badge-hidden {
|
|
115
|
-
.mat-badge-content {
|
|
116
|
-
display: none;
|
|
96
|
+
// The badge should make sure its host is overflow visible so that the badge content
|
|
97
|
+
// can be rendered outside of the element. Some components such as <mat-icon> explicitly
|
|
98
|
+
// style `overflow: hidden` so this requires extra specificity so that it does not
|
|
99
|
+
// depend on style load order.
|
|
100
|
+
&.mat-badge {
|
|
101
|
+
overflow: visible;
|
|
117
102
|
}
|
|
118
103
|
}
|
|
119
104
|
|
|
@@ -128,6 +113,30 @@ $_badge-structure-emitted: false !default;
|
|
|
128
113
|
white-space: nowrap;
|
|
129
114
|
text-overflow: ellipsis;
|
|
130
115
|
pointer-events: none;
|
|
116
|
+
|
|
117
|
+
@include token-utils.use-tokens(tokens-mat-badge.$prefix, tokens-mat-badge.get-token-slots()) {
|
|
118
|
+
@include token-utils.create-token-slot(background-color, background-color);
|
|
119
|
+
@include token-utils.create-token-slot(color, text-color);
|
|
120
|
+
@include token-utils.create-token-slot(font-family, text-font, $_emit-fallback-vars);
|
|
121
|
+
@include token-utils.create-token-slot(font-size, text-size, $_emit-fallback-vars);
|
|
122
|
+
@include token-utils.create-token-slot(font-weight, text-weight, $_emit-fallback-vars);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@include cdk.high-contrast(active, off) {
|
|
126
|
+
outline: solid 1px;
|
|
127
|
+
border-radius: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.mat-badge-disabled .mat-badge-content {
|
|
132
|
+
@include token-utils.use-tokens(tokens-mat-badge.$prefix, tokens-mat-badge.get-token-slots()) {
|
|
133
|
+
@include token-utils.create-token-slot(background-color, disabled-state-background-color);
|
|
134
|
+
@include token-utils.create-token-slot(color, disabled-state-text-color);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.mat-badge-hidden .mat-badge-content {
|
|
139
|
+
display: none;
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
.ng-animate-disabled .mat-badge-content,
|
|
@@ -143,15 +152,15 @@ $_badge-structure-emitted: false !default;
|
|
|
143
152
|
}
|
|
144
153
|
|
|
145
154
|
.mat-badge-small {
|
|
146
|
-
@include _badge-size($small-size);
|
|
155
|
+
@include _badge-size($small-size, small-size-text-size);
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
.mat-badge-medium {
|
|
150
|
-
@include _badge-size($default-size);
|
|
159
|
+
@include _badge-size($default-size, null);
|
|
151
160
|
}
|
|
152
161
|
|
|
153
162
|
.mat-badge-large {
|
|
154
|
-
@include _badge-size($large-size);
|
|
163
|
+
@include _badge-size($large-size, large-size-text-size);
|
|
155
164
|
}
|
|
156
165
|
}
|
|
157
166
|
|
|
@@ -159,73 +168,30 @@ $_badge-structure-emitted: false !default;
|
|
|
159
168
|
$config: theming.get-color-config($config-or-theme);
|
|
160
169
|
$accent: map.get($config, accent);
|
|
161
170
|
$warn: map.get($config, warn);
|
|
162
|
-
$primary: map.get($config, primary);
|
|
163
|
-
$background: map.get($config, background);
|
|
164
|
-
$foreground: map.get($config, foreground);
|
|
165
171
|
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
@include cdk.high-contrast(active, off) {
|
|
171
|
-
outline: solid 1px;
|
|
172
|
-
border-radius: 0;
|
|
173
|
-
}
|
|
172
|
+
@include sass-utils.current-selector-or-root() {
|
|
173
|
+
@include token-utils.create-token-values(tokens-mat-badge.$prefix,
|
|
174
|
+
tokens-mat-badge.get-color-tokens($config));
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
.mat-badge-accent {
|
|
177
|
-
.mat-badge
|
|
178
|
-
|
|
179
|
-
color: theming.get-color-from-palette($accent, default-contrast);
|
|
180
|
-
}
|
|
178
|
+
@include token-utils.create-token-values(tokens-mat-badge.$prefix,
|
|
179
|
+
tokens-mat-badge.private-get-color-palette-color-tokens($accent));
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
.mat-badge-warn {
|
|
184
|
-
.mat-badge
|
|
185
|
-
|
|
186
|
-
background: theming.get-color-from-palette($warn);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.mat-badge-disabled {
|
|
191
|
-
.mat-badge-content {
|
|
192
|
-
$app-background: theming.get-color-from-palette($background, 'background');
|
|
193
|
-
$badge-color: theming.get-color-from-palette($foreground, disabled-button);
|
|
194
|
-
|
|
195
|
-
// The disabled color usually has some kind of opacity, but because the badge is overlayed
|
|
196
|
-
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
|
|
197
|
-
// we convert it into a solid color by taking the opacity from the rgba value and using
|
|
198
|
-
// the value to determine the percentage of the background to put into foreground when
|
|
199
|
-
// mixing the colors together.
|
|
200
|
-
@if (meta.type-of($badge-color) == color and meta.type-of($app-background) == color) {
|
|
201
|
-
$badge-opacity: opacity($badge-color);
|
|
202
|
-
background: color.mix($app-background, rgba($badge-color, 1), (1 - $badge-opacity) * 100%);
|
|
203
|
-
}
|
|
204
|
-
@else {
|
|
205
|
-
background: $badge-color;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
color: theming.get-color-from-palette($foreground, disabled-text);
|
|
209
|
-
}
|
|
183
|
+
@include token-utils.create-token-values(tokens-mat-badge.$prefix,
|
|
184
|
+
tokens-mat-badge.private-get-color-palette-color-tokens($warn));
|
|
210
185
|
}
|
|
211
186
|
}
|
|
212
187
|
|
|
213
188
|
@mixin typography($config-or-theme) {
|
|
214
189
|
$config: typography.private-typography-to-2014-config(
|
|
215
190
|
theming.get-typography-config($config-or-theme));
|
|
216
|
-
.mat-badge-content {
|
|
217
|
-
font-weight: $font-weight;
|
|
218
|
-
font-size: $font-size;
|
|
219
|
-
font-family: typography-utils.font-family($config);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.mat-badge-small .mat-badge-content {
|
|
223
|
-
// Set the font size to 75% of the original.
|
|
224
|
-
font-size: $font-size * 0.75;
|
|
225
|
-
}
|
|
226
191
|
|
|
227
|
-
.
|
|
228
|
-
|
|
192
|
+
@include sass-utils.current-selector-or-root() {
|
|
193
|
+
@include token-utils.create-token-values(tokens-mat-badge.$prefix,
|
|
194
|
+
tokens-mat-badge.get-typography-tokens($config));
|
|
229
195
|
}
|
|
230
196
|
}
|
|
231
197
|
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use '../core/style/private';
|
|
3
1
|
@use '../core/typography/typography';
|
|
4
|
-
@use '../core/typography/typography-utils';
|
|
5
2
|
@use '../core/theming/theming';
|
|
3
|
+
@use '../core/style/sass-utils';
|
|
4
|
+
@use '../core/tokens/token-utils';
|
|
5
|
+
@use '../core/tokens/m2/mat/bottom-sheet' as tokens-mat-bottom-sheet;
|
|
6
6
|
|
|
7
7
|
@mixin color($config-or-theme) {
|
|
8
8
|
$config: theming.get-color-config($config-or-theme);
|
|
9
|
-
$background: map.get($config, background);
|
|
10
|
-
$foreground: map.get($config, foreground);
|
|
11
9
|
|
|
12
|
-
.
|
|
13
|
-
@include
|
|
14
|
-
|
|
15
|
-
color: theming.get-color-from-palette($foreground, text);
|
|
10
|
+
@include sass-utils.current-selector-or-root() {
|
|
11
|
+
@include token-utils.create-token-values(tokens-mat-bottom-sheet.$prefix,
|
|
12
|
+
tokens-mat-bottom-sheet.get-color-tokens($config));
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
@mixin typography($config-or-theme) {
|
|
20
17
|
$config: typography.private-typography-to-2014-config(
|
|
21
18
|
theming.get-typography-config($config-or-theme));
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
|
|
20
|
+
@include sass-utils.current-selector-or-root() {
|
|
21
|
+
@include token-utils.create-token-values(tokens-mat-bottom-sheet.$prefix,
|
|
22
|
+
tokens-mat-bottom-sheet.get-typography-tokens($config));
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
|
package/bottom-sheet/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AnimationTriggerMetadata } from '@angular/animations';
|
|
|
3
3
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
4
4
|
import { CdkDialogContainer } from '@angular/cdk/dialog';
|
|
5
5
|
import { ChangeDetectorRef } from '@angular/core';
|
|
6
|
+
import { ComponentRef } from '@angular/core';
|
|
6
7
|
import { ComponentType } from '@angular/cdk/portal';
|
|
7
8
|
import { DialogConfig } from '@angular/cdk/dialog';
|
|
8
9
|
import { DialogRef } from '@angular/cdk/dialog';
|
|
@@ -167,6 +168,11 @@ export declare class MatBottomSheetRef<T = any, R = any> {
|
|
|
167
168
|
private _ref;
|
|
168
169
|
/** Instance of the component making up the content of the bottom sheet. */
|
|
169
170
|
get instance(): T;
|
|
171
|
+
/**
|
|
172
|
+
* `ComponentRef` of the component opened into the bottom sheet. Will be
|
|
173
|
+
* null when the bottom sheet is opened using a `TemplateRef`.
|
|
174
|
+
*/
|
|
175
|
+
get componentRef(): ComponentRef<T> | null;
|
|
170
176
|
/**
|
|
171
177
|
* Instance of the component into which the bottom sheet content is projected.
|
|
172
178
|
* @docs-private
|
|
@@ -1,118 +1,41 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use '../core/style/private';
|
|
3
1
|
@use '../core/theming/theming';
|
|
4
2
|
@use '../core/typography/typography';
|
|
5
|
-
@use '../core/
|
|
6
|
-
@use '../core/
|
|
7
|
-
@use '
|
|
3
|
+
@use '../core/tokens/m2/mat/legacy-button-toggle' as tokens-mat-legacy-button-toggle;
|
|
4
|
+
@use '../core/tokens/m2/mat/standard-button-toggle' as tokens-mat-standard-button-toggle;
|
|
5
|
+
@use '../core/tokens/token-utils';
|
|
6
|
+
@use '../core/style/sass-utils';
|
|
8
7
|
|
|
9
8
|
@mixin color($config-or-theme) {
|
|
10
9
|
$config: theming.get-color-config($config-or-theme);
|
|
11
|
-
$foreground: map.get($config, foreground);
|
|
12
|
-
$background: map.get($config, background);
|
|
13
|
-
$divider-color: theming.get-color-from-palette($foreground, divider);
|
|
14
|
-
$theme-divider-color: map.get($foreground, divider);
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
theming.private-rgba-to-hex($theme-divider-color, map.get($background, card)),
|
|
22
|
-
$theme-divider-color
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
.mat-button-toggle-standalone,
|
|
26
|
-
.mat-button-toggle-group {
|
|
27
|
-
@include private.private-theme-overridable-elevation(2, $config);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,
|
|
31
|
-
.mat-button-toggle-group-appearance-standard {
|
|
32
|
-
&:not([class*='mat-elevation-z']) {
|
|
33
|
-
box-shadow: none;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.mat-button-toggle {
|
|
38
|
-
color: theming.get-color-from-palette($foreground, hint-text);
|
|
39
|
-
|
|
40
|
-
.mat-button-toggle-focus-overlay {
|
|
41
|
-
background-color: theming.get-color-from-palette($background, focused-button);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.mat-button-toggle-appearance-standard {
|
|
46
|
-
color: theming.get-color-from-palette($foreground, text);
|
|
47
|
-
background: theming.get-color-from-palette($background, card);
|
|
48
|
-
|
|
49
|
-
.mat-button-toggle-focus-overlay {
|
|
50
|
-
background-color: theming.get-color-from-palette($background, focused-button, 1);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.mat-button-toggle-group-appearance-standard .mat-button-toggle + .mat-button-toggle {
|
|
55
|
-
border-left: solid 1px $divider-color;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
[dir='rtl'] .mat-button-toggle-group-appearance-standard .mat-button-toggle + .mat-button-toggle {
|
|
59
|
-
border-left: none;
|
|
60
|
-
border-right: solid 1px $divider-color;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical {
|
|
64
|
-
.mat-button-toggle + .mat-button-toggle {
|
|
65
|
-
border-left: none;
|
|
66
|
-
border-right: none;
|
|
67
|
-
border-top: solid 1px $divider-color;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.mat-button-toggle-checked {
|
|
72
|
-
background-color: theming.get-color-from-palette($background, selected-button);
|
|
73
|
-
color: theming.get-color-from-palette($foreground, secondary-text);
|
|
74
|
-
|
|
75
|
-
&.mat-button-toggle-appearance-standard {
|
|
76
|
-
color: theming.get-color-from-palette($foreground, text);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.mat-button-toggle-disabled {
|
|
81
|
-
color: theming.get-color-from-palette($foreground, disabled-button);
|
|
82
|
-
background-color: theming.get-color-from-palette($background, disabled-button-toggle);
|
|
83
|
-
|
|
84
|
-
&.mat-button-toggle-appearance-standard {
|
|
85
|
-
background: theming.get-color-from-palette($background, card);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.mat-button-toggle-checked {
|
|
89
|
-
background-color: theming.get-color-from-palette($background, selected-disabled-button);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,
|
|
94
|
-
.mat-button-toggle-group-appearance-standard {
|
|
95
|
-
border: solid 1px $divider-color;
|
|
11
|
+
@include sass-utils.current-selector-or-root() {
|
|
12
|
+
@include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix,
|
|
13
|
+
tokens-mat-legacy-button-toggle.get-color-tokens($config));
|
|
14
|
+
@include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix,
|
|
15
|
+
tokens-mat-standard-button-toggle.get-color-tokens($config));
|
|
96
16
|
}
|
|
97
17
|
}
|
|
98
18
|
|
|
99
19
|
@mixin typography($config-or-theme) {
|
|
100
20
|
$config: typography.private-typography-to-2014-config(
|
|
101
21
|
theming.get-typography-config($config-or-theme));
|
|
102
|
-
|
|
103
|
-
|
|
22
|
+
|
|
23
|
+
@include sass-utils.current-selector-or-root() {
|
|
24
|
+
@include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix,
|
|
25
|
+
tokens-mat-legacy-button-toggle.get-typography-tokens($config));
|
|
26
|
+
@include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix,
|
|
27
|
+
tokens-mat-standard-button-toggle.get-typography-tokens($config));
|
|
104
28
|
}
|
|
105
29
|
}
|
|
106
30
|
|
|
107
31
|
@mixin density($config-or-theme) {
|
|
108
32
|
$density-scale: theming.get-density-config($config-or-theme);
|
|
109
|
-
$standard-height: compatibility.private-density-prop-value(
|
|
110
|
-
button-toggle-variables.$standard-density-config, $density-scale, height);
|
|
111
33
|
|
|
112
|
-
@include
|
|
113
|
-
.
|
|
114
|
-
|
|
115
|
-
|
|
34
|
+
@include sass-utils.current-selector-or-root() {
|
|
35
|
+
@include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix,
|
|
36
|
+
tokens-mat-legacy-button-toggle.get-density-tokens($density-scale));
|
|
37
|
+
@include token-utils.create-token-values(tokens-mat-standard-button-toggle.$prefix,
|
|
38
|
+
tokens-mat-standard-button-toggle.get-density-tokens($density-scale));
|
|
116
39
|
}
|
|
117
40
|
}
|
|
118
41
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// TODO(crisbeto): this file isn't used anymore and should be removed.
|
|
2
|
+
|
|
1
3
|
$standard-height: 48px !default;
|
|
2
4
|
// Minimum height for highest density can vary based on the content that developers
|
|
3
5
|
// project into button-toggle's. We use a minimum of `24px` though because commonly
|
package/chips/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { InjectionToken } from '@angular/core';
|
|
|
25
25
|
import { MatFormField } from '@angular/material/form-field';
|
|
26
26
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
27
27
|
import { MatRipple } from '@angular/material/core';
|
|
28
|
+
import { MatRippleLoader } from '@angular/material/core';
|
|
28
29
|
import { NgControl } from '@angular/forms';
|
|
29
30
|
import { NgForm } from '@angular/forms';
|
|
30
31
|
import { NgZone } from '@angular/core';
|
|
@@ -146,14 +147,12 @@ export declare const MAT_CHIPS_DEFAULT_OPTIONS: InjectionToken<MatChipsDefaultOp
|
|
|
146
147
|
*
|
|
147
148
|
* Extended by MatChipOption and MatChipRow for different interaction patterns.
|
|
148
149
|
*/
|
|
149
|
-
export declare class MatChip extends _MatChipMixinBase implements OnInit, AfterViewInit, AfterContentInit, CanColor, CanDisableRipple, CanDisable, HasTabIndex, OnDestroy {
|
|
150
|
+
export declare class MatChip extends _MatChipMixinBase implements OnInit, AfterViewInit, AfterContentInit, CanColor, CanDisableRipple, CanDisable, DoCheck, HasTabIndex, OnDestroy {
|
|
150
151
|
_changeDetectorRef: ChangeDetectorRef;
|
|
151
152
|
protected _ngZone: NgZone;
|
|
152
153
|
private _focusMonitor;
|
|
153
154
|
private _globalRippleOptions?;
|
|
154
155
|
protected _document: Document;
|
|
155
|
-
/** Whether the ripple is centered on the chip. */
|
|
156
|
-
readonly _isRippleCentered = false;
|
|
157
156
|
/** Emits when the chip is focused. */
|
|
158
157
|
readonly _onFocus: Subject<MatChipEvent>;
|
|
159
158
|
/** Emits when the chip is blurred. */
|
|
@@ -222,13 +221,20 @@ export declare class MatChip extends _MatChipMixinBase implements OnInit, AfterV
|
|
|
222
221
|
* @deprecated Considered an implementation detail. To be removed.
|
|
223
222
|
* @breaking-change 17.0.0
|
|
224
223
|
*/
|
|
225
|
-
ripple: MatRipple;
|
|
224
|
+
get ripple(): MatRipple;
|
|
225
|
+
set ripple(v: MatRipple);
|
|
226
226
|
/** Action receiving the primary set of user interactions. */
|
|
227
227
|
primaryAction: MatChipAction;
|
|
228
|
+
/**
|
|
229
|
+
* Handles the lazy creation of the MatChip ripple.
|
|
230
|
+
* Used to improve initial load time of large applications.
|
|
231
|
+
*/
|
|
232
|
+
_rippleLoader: MatRippleLoader;
|
|
228
233
|
constructor(_changeDetectorRef: ChangeDetectorRef, elementRef: ElementRef<HTMLElement>, _ngZone: NgZone, _focusMonitor: FocusMonitor, _document: any, animationMode?: string, _globalRippleOptions?: RippleGlobalOptions | undefined, tabIndex?: string);
|
|
229
234
|
ngOnInit(): void;
|
|
230
235
|
ngAfterViewInit(): void;
|
|
231
236
|
ngAfterContentInit(): void;
|
|
237
|
+
ngDoCheck(): void;
|
|
232
238
|
ngOnDestroy(): void;
|
|
233
239
|
/**
|
|
234
240
|
* Allows for programmatic removal of the chip.
|
|
@@ -868,6 +874,7 @@ export declare class MatChipRow extends MatChip implements AfterViewInit {
|
|
|
868
874
|
_handleDoubleclick(event: MouseEvent): void;
|
|
869
875
|
private _startEditing;
|
|
870
876
|
private _onEditFinish;
|
|
877
|
+
_isRippleDisabled(): boolean;
|
|
871
878
|
/**
|
|
872
879
|
* Gets the projected chip edit input, or the default input if none is projected in. One of these
|
|
873
880
|
* two values is guaranteed to be defined.
|
package/core/index.d.ts
CHANGED
|
@@ -820,6 +820,7 @@ export declare class MatRippleLoader implements OnDestroy {
|
|
|
820
820
|
configureRipple(host: HTMLElement, config: {
|
|
821
821
|
className?: string;
|
|
822
822
|
centered?: boolean;
|
|
823
|
+
disabled?: boolean;
|
|
823
824
|
}): void;
|
|
824
825
|
/** Returns the ripple instance for the given host element. */
|
|
825
826
|
getRipple(host: HTMLElement): MatRipple | undefined;
|
|
@@ -42,7 +42,7 @@ $padding: checkbox-common.$border-width * 2;
|
|
|
42
42
|
// `$box-size`: size of the checkbox.
|
|
43
43
|
// `$border-size`: size of the checkbox's border.
|
|
44
44
|
@mixin _checkbox-indeterminate-styles-with-size($box-size, $border-size) {
|
|
45
|
-
// Center the line in the
|
|
45
|
+
// Center the line in the checkbox. `$checkbox-common.$border-width` is the width of the line.
|
|
46
46
|
top: math.div($box-size - checkbox-common.$border-width, 2) - $border-size;
|
|
47
47
|
width: $box-size - checkbox-common.$border-width - (2 * $border-size);
|
|
48
48
|
}
|
|
@@ -40,6 +40,7 @@ $placeholder-typography-config: (
|
|
|
40
40
|
button: $_placeholder-typography-level-config,
|
|
41
41
|
overline: $_placeholder-typography-level-config,
|
|
42
42
|
subheading-1: $_placeholder-typography-level-config,
|
|
43
|
+
title: $_placeholder-typography-level-config,
|
|
43
44
|
);
|
|
44
45
|
|
|
45
46
|
// Placeholder density config that can be passed to token getter functions when generating token
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
@use 'sass:color';
|
|
4
|
+
@use '../../token-utils';
|
|
5
|
+
@use '../../../typography/typography-utils';
|
|
6
|
+
@use '../../../theming/theming';
|
|
7
|
+
@use '../../../style/sass-utils';
|
|
8
|
+
|
|
9
|
+
// The prefix used to generate the fully qualified name for tokens in this file.
|
|
10
|
+
$prefix: (mat, badge);
|
|
11
|
+
|
|
12
|
+
// Tokens that can't be configured through Angular Material's current theming API,
|
|
13
|
+
// but may be in a future version of the theming API.
|
|
14
|
+
@function get-unthemable-tokens() {
|
|
15
|
+
@return ();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Tokens that can be configured through Angular Material's color theming API.
|
|
19
|
+
@function get-color-tokens($config) {
|
|
20
|
+
$foreground: map.get($config, foreground);
|
|
21
|
+
$background: map.get($config, background);
|
|
22
|
+
$primary-color-tokens: private-get-color-palette-color-tokens(map.get($config, primary));
|
|
23
|
+
$app-background: theming.get-color-from-palette($background, 'background');
|
|
24
|
+
$disabled-background: theming.get-color-from-palette($foreground, disabled-button);
|
|
25
|
+
|
|
26
|
+
// The disabled color usually has some kind of opacity, but because the badge is overlayed
|
|
27
|
+
// on top of something else, it won't look good if it's opaque. If it is a color *type*,
|
|
28
|
+
// we convert it into a solid color by taking the opacity from the rgba value and using
|
|
29
|
+
// the value to determine the percentage of the background to put into foreground when
|
|
30
|
+
// mixing the colors together.
|
|
31
|
+
@if (meta.type-of($disabled-background) == color and meta.type-of($app-background) == color) {
|
|
32
|
+
$badge-opacity: opacity($disabled-background);
|
|
33
|
+
$disabled-background: color.mix($app-background,
|
|
34
|
+
rgba($disabled-background, 1), (1 - $badge-opacity) * 100%);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@return map.merge($primary-color-tokens, (
|
|
38
|
+
disabled-state-background-color: $disabled-background,
|
|
39
|
+
disabled-state-text-color: theming.get-color-from-palette($foreground, disabled-text),
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Generates the tokens used to theme the badge based on a palette.
|
|
44
|
+
@function private-get-color-palette-color-tokens($palette) {
|
|
45
|
+
@return (
|
|
46
|
+
background-color: theming.get-color-from-palette($palette),
|
|
47
|
+
text-color: theming.get-color-from-palette($palette, default-contrast),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Tokens that can be configured through Angular Material's typography theming API.
|
|
52
|
+
@function get-typography-tokens($config) {
|
|
53
|
+
$base-size: 12px;
|
|
54
|
+
|
|
55
|
+
@return (
|
|
56
|
+
text-font: typography-utils.font-family($config),
|
|
57
|
+
text-size: $base-size,
|
|
58
|
+
text-weight: 600,
|
|
59
|
+
small-size-text-size: $base-size * 0.75,
|
|
60
|
+
large-size-text-size: $base-size * 2,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Tokens that can be configured through Angular Material's density theming API.
|
|
65
|
+
@function get-density-tokens($config) {
|
|
66
|
+
@return ();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Combines the tokens generated by the above functions into a single map with placeholder values.
|
|
70
|
+
// This is used to create token slots.
|
|
71
|
+
@function get-token-slots() {
|
|
72
|
+
@return sass-utils.deep-merge-all(
|
|
73
|
+
get-unthemable-tokens(),
|
|
74
|
+
get-color-tokens(token-utils.$placeholder-color-config),
|
|
75
|
+
get-typography-tokens(token-utils.$placeholder-typography-config),
|
|
76
|
+
get-density-tokens(token-utils.$placeholder-density-config)
|
|
77
|
+
);
|
|
78
|
+
}
|