@angular/material 17.0.4 → 17.0.6
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/LICENSE +1 -1
- package/_index.scss +1 -1
- package/core/tokens/m2/mat/_form-field.scss +50 -1
- package/core/tokens/m2/mat/_slider.scss +34 -8
- package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -2
- package/esm2022/autocomplete/autocomplete.mjs +2 -3
- package/esm2022/core/ripple/ripple-renderer.mjs +1 -1
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/expansion/accordion.mjs +2 -3
- package/esm2022/expansion/expansion-panel.mjs +3 -3
- package/esm2022/form-field/form-field.mjs +3 -3
- package/esm2022/list/tokens.mjs +2 -2
- package/esm2022/menu/menu.mjs +2 -3
- package/esm2022/progress-bar/progress-bar.mjs +2 -2
- package/esm2022/select/select.mjs +14 -14
- package/esm2022/sidenav/drawer.mjs +16 -12
- package/esm2022/sidenav/sidenav.mjs +4 -7
- package/esm2022/slider/slider-input.mjs +24 -19
- package/esm2022/slider/slider-interface.mjs +1 -1
- package/esm2022/slider/slider-thumb.mjs +9 -2
- package/esm2022/slider/slider.mjs +3 -4
- package/esm2022/snack-bar/snack-bar-container.mjs +6 -9
- package/esm2022/tabs/ink-bar.mjs +4 -4
- package/expansion/index.d.ts +2 -2
- package/fesm2022/autocomplete.mjs +4 -3
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/expansion.mjs +3 -4
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field.mjs +2 -2
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/list.mjs +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +1 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +2 -2
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/select.mjs +13 -13
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +18 -17
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slider.mjs +32 -22
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +6 -8
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/tabs.mjs +3 -3
- package/fesm2022/tabs.mjs.map +1 -1
- package/form-field/_form-field-subscript.scss +1 -2
- package/form-field/_form-field-theme.scss +4 -2
- package/form-field/_mdc-text-field-density-overrides.scss +60 -0
- package/list/index.d.ts +1 -1
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +5 -4
- 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/progress-bar/_progress-bar-theme.scss +2 -15
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
- package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +5 -3
- package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
- package/schematics/ng-generate/mdc-migration/schema.json +0 -1
- package/schematics/ng-generate/navigation/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +3 -3
- package/schematics/ng-update/index_bundled.js +31 -31
- package/slider/_slider-theme.scss +10 -12
- package/slider/index.d.ts +3 -12
- package/snack-bar/index.d.ts +2 -2
- package/tabs/index.d.ts +1 -1
- package/form-field/_form-field-density.scss +0 -118
- package/form-field/_form-field-sizing.scss +0 -40
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
@else {
|
|
16
16
|
// Add default values for tokens not related to color, typography, or density.
|
|
17
17
|
@include sass-utils.current-selector-or-root() {
|
|
18
|
+
$mat-tokens: tokens-mat-slider.get-unthemable-tokens();
|
|
19
|
+
@include token-utils.create-token-values(tokens-mat-slider.$prefix, $mat-tokens);
|
|
18
20
|
@include mdc-slider-theme.theme(tokens-mdc-slider.get-unthemable-tokens());
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -38,22 +40,27 @@
|
|
|
38
40
|
// Add values for MDC slider tokens.
|
|
39
41
|
@include sass-utils.current-selector-or-root() {
|
|
40
42
|
@include mdc-slider-theme.theme($mdc-color-tokens);
|
|
41
|
-
@include _slider-ripple-color($theme, primary);
|
|
42
43
|
@include token-utils.create-token-values(
|
|
43
44
|
tokens-mat-slider.$prefix,
|
|
44
45
|
$mat-slider-color-tokens
|
|
45
46
|
);
|
|
46
47
|
|
|
47
48
|
.mat-accent {
|
|
49
|
+
@include token-utils.create-token-values(
|
|
50
|
+
tokens-mat-slider.$prefix,
|
|
51
|
+
tokens-mat-slider.private-get-color-palette-color-tokens($theme, accent),
|
|
52
|
+
);
|
|
48
53
|
@include mdc-slider-theme.theme(
|
|
49
54
|
tokens-mdc-slider.private-get-color-palette-color-tokens($theme, accent));
|
|
50
|
-
@include _slider-ripple-color($theme, accent);
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
.mat-warn {
|
|
58
|
+
@include token-utils.create-token-values(
|
|
59
|
+
tokens-mat-slider.$prefix,
|
|
60
|
+
tokens-mat-slider.private-get-color-palette-color-tokens($theme, warn),
|
|
61
|
+
);
|
|
54
62
|
@include mdc-slider-theme.theme(
|
|
55
63
|
tokens-mdc-slider.private-get-color-palette-color-tokens($theme, warn));
|
|
56
|
-
@include _slider-ripple-color($theme, warn);
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
}
|
|
@@ -103,15 +110,6 @@
|
|
|
103
110
|
}
|
|
104
111
|
}
|
|
105
112
|
|
|
106
|
-
// Generated MDC ripple color tokens are not being calculated so needs to be set
|
|
107
|
-
@mixin _slider-ripple-color($theme, $palette-name) {
|
|
108
|
-
$color: inspection.get-theme-color($theme, $palette-name);
|
|
109
|
-
|
|
110
|
-
--mat-mdc-slider-ripple-color: #{$color};
|
|
111
|
-
--mat-mdc-slider-hover-ripple-color: #{rgba($color, 0.05)};
|
|
112
|
-
--mat-mdc-slider-focus-ripple-color: #{rgba($color, 0.2)};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
113
|
@mixin _theme-from-tokens($tokens) {
|
|
116
114
|
@if ($tokens != ()) {
|
|
117
115
|
@include mdc-slider-theme.theme(map.get($tokens, tokens-mdc-slider.$prefix));
|
package/slider/index.d.ts
CHANGED
|
@@ -141,7 +141,6 @@ export declare class MatSlider extends _MatSliderMixinBase implements AfterViewI
|
|
|
141
141
|
/** The radius of the native slider's knob. AFAIK there is no way to avoid hardcoding this. */
|
|
142
142
|
_knobRadius: number;
|
|
143
143
|
_inputPadding: number;
|
|
144
|
-
_inputOffset: number;
|
|
145
144
|
ngAfterViewInit(): void;
|
|
146
145
|
private _initUINonRange;
|
|
147
146
|
private _initUIRange;
|
|
@@ -238,17 +237,6 @@ declare interface _MatSlider {
|
|
|
238
237
|
* thumb ripple extends past the end of the slider track clickable.
|
|
239
238
|
*/
|
|
240
239
|
_inputPadding: number;
|
|
241
|
-
/**
|
|
242
|
-
* The offset represents left most translateX of the slider knob. Inversely,
|
|
243
|
-
* (slider width - offset) = the right most translateX of the slider knob.
|
|
244
|
-
*
|
|
245
|
-
* Note:
|
|
246
|
-
* * The native slider knob differs from the visual slider. It's knob cannot slide past
|
|
247
|
-
* the end of the track AT ALL.
|
|
248
|
-
* * The visual slider knob CAN slide past the end of the track slightly. It's knob can slide
|
|
249
|
-
* past the end of the track such that it's center lines up with the end of the track.
|
|
250
|
-
*/
|
|
251
|
-
_inputOffset: number;
|
|
252
240
|
/** The radius of the visual slider's ripple. */
|
|
253
241
|
_rippleRadius: number;
|
|
254
242
|
/** The global configuration for `matRipple` instances. */
|
|
@@ -418,6 +406,8 @@ export declare class MatSliderThumb implements _MatSliderThumb, OnDestroy, Contr
|
|
|
418
406
|
_valuetext: string;
|
|
419
407
|
/** The radius of a native html slider's knob. */
|
|
420
408
|
_knobRadius: number;
|
|
409
|
+
/** The distance in px from the start of the slider track to the first tick mark. */
|
|
410
|
+
_tickMarkOffset: number;
|
|
421
411
|
/** Whether user's cursor is currently in a mouse down state on the input. */
|
|
422
412
|
_isActive: boolean;
|
|
423
413
|
/** Whether the input is currently focused (either by tab or after clicking). */
|
|
@@ -626,6 +616,7 @@ export declare class MatSliderVisualThumb implements _MatSliderVisualThumb, Afte
|
|
|
626
616
|
_isValueIndicatorVisible: boolean;
|
|
627
617
|
/** The host native HTML input element. */
|
|
628
618
|
_hostElement: HTMLElement;
|
|
619
|
+
private _platform;
|
|
629
620
|
constructor(_cdr: ChangeDetectorRef, _ngZone: NgZone, _elementRef: ElementRef<HTMLElement>, _slider: _MatSlider);
|
|
630
621
|
ngAfterViewInit(): void;
|
|
631
622
|
ngOnDestroy(): void;
|
package/snack-bar/index.d.ts
CHANGED
|
@@ -256,8 +256,8 @@ export declare class MatSnackBarContainer extends BasePortalOutlet implements On
|
|
|
256
256
|
/** Makes sure the exit callbacks have been invoked when the element is destroyed. */
|
|
257
257
|
ngOnDestroy(): void;
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
259
|
+
* Removes the element in a microtask. Helps prevent errors where we end up
|
|
260
|
+
* removing an element which is in the middle of an animation.
|
|
261
261
|
*/
|
|
262
262
|
private _completeExit;
|
|
263
263
|
/**
|
package/tabs/index.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export declare class MatInkBar {
|
|
|
166
166
|
*/
|
|
167
167
|
declare interface MatInkBarItem extends OnInit, OnDestroy {
|
|
168
168
|
elementRef: ElementRef<HTMLElement>;
|
|
169
|
-
activateInkBar(previousIndicatorClientRect?:
|
|
169
|
+
activateInkBar(previousIndicatorClientRect?: DOMRect): void;
|
|
170
170
|
deactivateInkBar(): void;
|
|
171
171
|
fitInkBarToContent: boolean;
|
|
172
172
|
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
@use 'sass:map';
|
|
2
|
-
@use 'sass:math';
|
|
3
|
-
@use '@material/density' as mdc-density;
|
|
4
|
-
@use '@material/textfield' as mdc-textfield;
|
|
5
|
-
@use '../core/theming/inspection';
|
|
6
|
-
|
|
7
|
-
@use './form-field-sizing';
|
|
8
|
-
|
|
9
|
-
// Mixin that sets the vertical spacing for the infix container of filled form fields.
|
|
10
|
-
// We need to apply spacing to the infix container because we removed the input padding
|
|
11
|
-
// provided by MDC in order to support arbitrary form-field controls.
|
|
12
|
-
@mixin _infix-vertical-spacing-filled($with-label-padding, $no-label-padding) {
|
|
13
|
-
.mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-form-field-infix {
|
|
14
|
-
padding-top: map.get($with-label-padding, top);
|
|
15
|
-
padding-bottom: map.get($with-label-padding, bottom);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.mdc-text-field--no-label:not(.mdc-text-field--outlined):not(.mdc-text-field--textarea)
|
|
19
|
-
.mat-mdc-form-field-infix {
|
|
20
|
-
padding-top: map.get($no-label-padding, top);
|
|
21
|
-
padding-bottom: map.get($no-label-padding, bottom);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Mixin that sets the vertical spacing for the infix container of outlined form fields.
|
|
26
|
-
// We need to apply spacing to the infix container because we removed the input padding
|
|
27
|
-
// provided by MDC in order to support arbitrary form-field controls.
|
|
28
|
-
@mixin _infix-vertical-spacing-outlined($padding) {
|
|
29
|
-
.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix {
|
|
30
|
-
padding-top: map.get($padding, top);
|
|
31
|
-
padding-bottom: map.get($padding, bottom);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Mixin that includes the density styles for form fields. MDC provides their own density
|
|
36
|
-
// styles for MDC text-field which we cannot use. MDC relies on input elements to stretch
|
|
37
|
-
// vertically when the height is reduced as per density scale. This doesn't work for our
|
|
38
|
-
// form field since we support custom form field controls without a fixed height. Instead, we
|
|
39
|
-
// provide spacing that makes arbitrary controls align as specified in the Material Design
|
|
40
|
-
// specification. In order to support density, we need to adjust the vertical spacing to be
|
|
41
|
-
// based on the density scale.
|
|
42
|
-
@mixin private-form-field-density($theme) {
|
|
43
|
-
// Height of the form field that is based on the current density scale.
|
|
44
|
-
$height: mdc-density.prop-value(
|
|
45
|
-
$density-config: mdc-textfield.$density-config,
|
|
46
|
-
$density-scale: inspection.get-theme-density($theme),
|
|
47
|
-
$property-name: height,
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
// Whether floating labels for filled form fields should be hidden. MDC hides the label in
|
|
51
|
-
// their density styles when the height decreases too much. We match their density styles.
|
|
52
|
-
$hide-filled-floating-label: $height < mdc-textfield.$minimum-height-for-filled-label;
|
|
53
|
-
// We computed the desired height of the form-field using the density configuration. The
|
|
54
|
-
// spec only describes vertical spacing/alignment in non-dense mode. This means that we
|
|
55
|
-
// cannot update the spacing to explicit numbers based on the density scale. Instead, we
|
|
56
|
-
// determine the height reduction and equally subtract it from the default `top` and `bottom`
|
|
57
|
-
// padding that is provided by the Material Design specification.
|
|
58
|
-
$vertical-deduction: math.div(mdc-textfield.$height - $height, 2);
|
|
59
|
-
// Map that describes the padding for form-fields with label.
|
|
60
|
-
$with-label-padding: (
|
|
61
|
-
top: form-field-sizing.$mat-form-field-with-label-input-padding-top - $vertical-deduction,
|
|
62
|
-
bottom: form-field-sizing.$mat-form-field-with-label-input-padding-bottom - $vertical-deduction,
|
|
63
|
-
);
|
|
64
|
-
// Map that describes the padding for form-fields without label.
|
|
65
|
-
$no-label-padding: (
|
|
66
|
-
top: form-field-sizing.$mat-form-field-no-label-padding-top - $vertical-deduction,
|
|
67
|
-
bottom: form-field-sizing.$mat-form-field-no-label-padding-bottom - $vertical-deduction,
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
// We add a minimum height to the infix container in order to ensure that custom controls have
|
|
71
|
-
// the same default vertical space as text-field inputs (with respect to the vertical padding).
|
|
72
|
-
.mat-mdc-form-field-infix {
|
|
73
|
-
min-height: $height;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// By default, MDC aligns the label using percentage. This will be overwritten based
|
|
77
|
-
// on whether a textarea is used. This is not possible in our implementation of the
|
|
78
|
-
// form-field because we do not know what type of form-field control is set up. Hence
|
|
79
|
-
// we always use a fixed position for the label. This does not have any implications.
|
|
80
|
-
.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label {
|
|
81
|
-
top: math.div($height, 2);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// For the outline appearance, we re-create the active floating label transform. This is
|
|
85
|
-
// necessary because the transform for docked floating labels can be updated to account for
|
|
86
|
-
// the width of prefix container.
|
|
87
|
-
.mat-mdc-text-field-wrapper.mdc-text-field--outlined .mdc-notched-outline--upgraded
|
|
88
|
-
.mdc-floating-label--float-above {
|
|
89
|
-
--mat-mdc-form-field-label-transform: translateY(
|
|
90
|
-
-#{mdc-textfield.get-outlined-label-position-y($height)})
|
|
91
|
-
scale(var(--mat-mdc-form-field-floating-label-scale, 0.75));
|
|
92
|
-
transform: var(--mat-mdc-form-field-label-transform);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Add vertical spacing to the infix to ensure that outlined form fields have their controls
|
|
96
|
-
// aligned as if there is no label. This is done similarly in MDC and is specified in the
|
|
97
|
-
// Material Design specification. Outline form fields position the control as if there is no
|
|
98
|
-
// label. This is because the label overflows the form-field and doesn't need space at the top.
|
|
99
|
-
@include _infix-vertical-spacing-outlined($no-label-padding);
|
|
100
|
-
|
|
101
|
-
// MDC hides labels for filled form fields when the form field height decreases. We match
|
|
102
|
-
// this behavior in our custom density styles.
|
|
103
|
-
@if $hide-filled-floating-label {
|
|
104
|
-
// Update the spacing for filled form fields to account for the hidden floating label.
|
|
105
|
-
@include _infix-vertical-spacing-filled(
|
|
106
|
-
$no-label-padding, $no-label-padding);
|
|
107
|
-
.mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label {
|
|
108
|
-
display: none;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
@else {
|
|
112
|
-
// By default, filled form fields align their controls differently based on whether there
|
|
113
|
-
// is a label or not. MDC does this too, but we cannot rely on their styles as we support
|
|
114
|
-
// arbitrary form field controls and MDC only applies their spacing to the `<input>` elements.
|
|
115
|
-
@include _infix-vertical-spacing-filled(
|
|
116
|
-
$with-label-padding, $no-label-padding);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Top spacing of the form-field outline. MDC does not have a variable for this
|
|
2
|
-
// and just hard-codes it into their styles.
|
|
3
|
-
$mat-form-field-outline-top-spacing: 12px;
|
|
4
|
-
|
|
5
|
-
// Infix stretches to fit the container, but naturally wants to be this wide. We set
|
|
6
|
-
// this in order to have a consistent natural size for the various types of controls
|
|
7
|
-
// that can go in a form field.
|
|
8
|
-
$mat-form-field-default-infix-width: 180px !default;
|
|
9
|
-
|
|
10
|
-
// Minimum amount of space between start and end hints in the subscript. MDC does not
|
|
11
|
-
// have built-in support for hints.
|
|
12
|
-
$mat-form-field-hint-min-space: 1em !default;
|
|
13
|
-
|
|
14
|
-
// Vertical spacing of the text-field if there is no label. MDC hard-codes the spacing
|
|
15
|
-
// into their styles, but their spacing variables would not work for our form-field
|
|
16
|
-
// structure anyway. This is because MDC's input elements are larger than the text, and
|
|
17
|
-
// their padding variables are calculated with respect to the vertical empty space of the
|
|
18
|
-
// inputs. We take the explicit numbers provided by the Material Design specification.
|
|
19
|
-
// https://material.io/components/text-fields/#specs
|
|
20
|
-
|
|
21
|
-
// Vertical spacing of the text-field if there is a label. MDC hard-codes the spacing into
|
|
22
|
-
// their styles, but their spacing variables would not work for our form-field structure anyway.
|
|
23
|
-
// This is because MDC's alignment depends on the input element to expand to full infix height.
|
|
24
|
-
// We allow for arbitrary form controls and support dynamic height, so we manage the control
|
|
25
|
-
// infix alignment through padding on the infix that works for any control. We manually measure
|
|
26
|
-
// spacing as provided by the Material Design specification. The outlined dimensions in the
|
|
27
|
-
// spec section do not match with the text fields shown in the overview or the ones implemented
|
|
28
|
-
// by MDC. Note that we need to account for the input box offset. See above for more context.
|
|
29
|
-
$mat-form-field-with-label-input-padding-top: 24px;
|
|
30
|
-
$mat-form-field-with-label-input-padding-bottom: 8px;
|
|
31
|
-
|
|
32
|
-
// Vertical spacing of the text-field if there is no label. We manually measure the
|
|
33
|
-
// spacing in the specs. See comment above for padding for text fields with label. The
|
|
34
|
-
// same reasoning applies to the padding for text fields without label.
|
|
35
|
-
$mat-form-field-no-label-padding-bottom: 16px;
|
|
36
|
-
$mat-form-field-no-label-padding-top: 16px;
|
|
37
|
-
|
|
38
|
-
// The amount of padding between the icon prefix/suffix and the infix.
|
|
39
|
-
// This assumes that the icon will be a 24px square with 12px padding.
|
|
40
|
-
$mat-form-field-icon-prefix-infix-padding: 4px;
|