@angular/material 18.0.2 → 18.0.4
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/_index.scss +1 -1
- package/autocomplete/index.d.ts +3 -0
- package/badge/index.d.ts +4 -1
- package/bottom-sheet/index.d.ts +0 -1
- package/button/index.d.ts +7 -1
- package/checkbox/index.d.ts +12 -2
- package/chips/index.d.ts +11 -3
- package/core/_core-theme.scss +8 -14
- package/core/_core.scss +18 -4
- package/core/m2/_typography.scss +1 -1
- package/core/theming/_palettes.scss +2 -0
- package/core/tokens/_density.scss +1 -0
- package/core/tokens/m2/mat/_app.scss +13 -1
- package/core/tokens/m2/mat/_menu.scss +3 -0
- package/core/tokens/m2/mat/_paginator.scss +1 -0
- package/core/tokens/m3/mat/_app.scss +9 -0
- package/core/tokens/m3/mat/_menu.scss +3 -0
- package/datepicker/index.d.ts +27 -3
- package/dialog/index.d.ts +0 -1
- package/dialog/testing/index.d.ts +1 -0
- package/esm2022/autocomplete/autocomplete-trigger.mjs +35 -7
- package/esm2022/badge/badge.mjs +5 -2
- package/esm2022/bottom-sheet/bottom-sheet-container.mjs +6 -7
- package/esm2022/button/button-base.mjs +1 -1
- package/esm2022/checkbox/checkbox-config.mjs +1 -1
- package/esm2022/checkbox/checkbox.mjs +3 -10
- package/esm2022/chips/chip-grid.mjs +11 -4
- package/esm2022/chips/chip-row.mjs +8 -13
- package/esm2022/chips/chip-set.mjs +7 -3
- package/esm2022/chips/chip.mjs +6 -6
- package/esm2022/core/option/optgroup.mjs +2 -2
- package/esm2022/core/option/option.mjs +3 -3
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/date-range-input-parts.mjs +14 -10
- package/esm2022/datepicker/date-range-input.mjs +17 -7
- package/esm2022/datepicker/datepicker-base.mjs +18 -17
- package/esm2022/datepicker/datepicker-input.mjs +16 -5
- package/esm2022/dialog/dialog-container.mjs +1 -6
- package/esm2022/dialog/testing/dialog-opener.mjs +4 -3
- package/esm2022/form-field/form-field.mjs +12 -6
- package/esm2022/icon/icon.mjs +8 -2
- package/esm2022/list/list-option.mjs +3 -3
- package/esm2022/list/selection-list.mjs +9 -2
- package/esm2022/menu/menu.mjs +13 -4
- package/esm2022/paginator/paginator.mjs +3 -3
- package/esm2022/radio/radio.mjs +4 -3
- package/esm2022/slide-toggle/slide-toggle.mjs +1 -1
- package/esm2022/slider/slider-interface.mjs +2 -2
- package/esm2022/stepper/step-header.mjs +1 -1
- package/esm2022/stepper/stepper.mjs +1 -1
- package/esm2022/tabs/tab-header.mjs +3 -3
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -4
- package/esm2022/toolbar/toolbar.mjs +1 -1
- package/fesm2022/autocomplete.mjs +28 -0
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge.mjs +4 -1
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +5 -6
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips.mjs +19 -13
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core.mjs +5 -5
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +42 -9
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +3 -2
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +0 -5
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/form-field.mjs +9 -3
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/icon.mjs +7 -1
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/list.mjs +10 -3
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu.mjs +12 -3
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator.mjs +2 -2
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/radio.mjs +3 -2
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider.mjs +1 -1
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/tabs.mjs +11 -5
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs.map +1 -1
- package/form-field/index.d.ts +12 -2
- package/icon/index.d.ts +14 -2
- package/list/_list-theme.scss +8 -5
- package/list/index.d.ts +8 -1
- package/package.json +2 -2
- package/paginator/index.d.ts +7 -1
- 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/radio/_radio-common.scss +238 -0
- package/radio/_radio-theme.scss +25 -32
- package/radio/index.d.ts +7 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/m3-theme/index_bundled.js +81 -2
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +3 -3
- package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +1 -1
- package/slide-toggle/index.d.ts +7 -1
- package/slider/index.d.ts +1 -1
- package/stepper/index.d.ts +21 -3
- package/tabs/index.d.ts +7 -1
- package/toolbar/index.d.ts +7 -1
package/radio/_radio-theme.scss
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use '@material/radio/radio-theme' as mdc-radio-theme;
|
|
2
1
|
@use '../core/style/sass-utils';
|
|
3
2
|
@use '../core/theming/theming';
|
|
4
3
|
@use '../core/theming/inspection';
|
|
@@ -16,11 +15,10 @@
|
|
|
16
15
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base));
|
|
17
16
|
} @else {
|
|
18
17
|
@include sass-utils.current-selector-or-root() {
|
|
19
|
-
@include
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
tokens-mat-radio.get-unthemable-tokens()
|
|
23
|
-
);
|
|
18
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
19
|
+
tokens-mdc-radio.get-unthemable-tokens());
|
|
20
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
21
|
+
tokens-mat-radio.get-unthemable-tokens());
|
|
24
22
|
}
|
|
25
23
|
}
|
|
26
24
|
}
|
|
@@ -36,27 +34,24 @@
|
|
|
36
34
|
} @else {
|
|
37
35
|
.mat-mdc-radio-button {
|
|
38
36
|
&.mat-primary {
|
|
39
|
-
@include
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
tokens-mat-radio.get-color-tokens($theme, primary)
|
|
43
|
-
);
|
|
37
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
38
|
+
tokens-mdc-radio.get-color-tokens($theme, primary));
|
|
39
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
40
|
+
tokens-mat-radio.get-color-tokens($theme, primary));
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
&.mat-accent {
|
|
47
|
-
@include
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
tokens-mat-radio.get-color-tokens($theme)
|
|
51
|
-
);
|
|
44
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
45
|
+
tokens-mdc-radio.get-color-tokens($theme));
|
|
46
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
47
|
+
tokens-mat-radio.get-color-tokens($theme));
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
&.mat-warn {
|
|
55
|
-
@include
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
tokens-mat-radio.get-color-tokens($theme, warn)
|
|
59
|
-
);
|
|
51
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
52
|
+
tokens-mdc-radio.get-color-tokens($theme, warn));
|
|
53
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
54
|
+
tokens-mat-radio.get-color-tokens($theme, warn));
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
}
|
|
@@ -69,11 +64,10 @@
|
|
|
69
64
|
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography));
|
|
70
65
|
} @else {
|
|
71
66
|
@include sass-utils.current-selector-or-root() {
|
|
72
|
-
@include
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
tokens-mat-radio.get-typography-tokens($theme)
|
|
76
|
-
);
|
|
67
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
68
|
+
tokens-mdc-radio.get-typography-tokens($theme));
|
|
69
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
70
|
+
tokens-mat-radio.get-typography-tokens($theme));
|
|
77
71
|
}
|
|
78
72
|
}
|
|
79
73
|
}
|
|
@@ -87,11 +81,10 @@
|
|
|
87
81
|
$density-scale: inspection.get-theme-density($theme);
|
|
88
82
|
|
|
89
83
|
@include sass-utils.current-selector-or-root() {
|
|
90
|
-
@include
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
tokens-mat-radio.get-density-tokens($theme)
|
|
94
|
-
);
|
|
84
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix,
|
|
85
|
+
tokens-mdc-radio.get-density-tokens($theme));
|
|
86
|
+
@include token-utils.create-token-values(tokens-mat-radio.$prefix,
|
|
87
|
+
tokens-mat-radio.get-density-tokens($theme));
|
|
95
88
|
}
|
|
96
89
|
}
|
|
97
90
|
}
|
|
@@ -142,6 +135,6 @@
|
|
|
142
135
|
);
|
|
143
136
|
$mdc-radio-tokens: token-utils.get-tokens-for($tokens, tokens-mdc-radio.$prefix, $options...);
|
|
144
137
|
$mat-radio-tokens: token-utils.get-tokens-for($tokens, tokens-mat-radio.$prefix, $options...);
|
|
145
|
-
@include mdc-radio
|
|
138
|
+
@include token-utils.create-token-values(tokens-mdc-radio.$prefix, $mdc-radio-tokens);
|
|
146
139
|
@include token-utils.create-token-values(tokens-mat-radio.$prefix, $mat-radio-tokens);
|
|
147
140
|
}
|
package/radio/index.d.ts
CHANGED
|
@@ -205,7 +205,13 @@ export declare class MatRadioGroup implements AfterContentInit, OnDestroy, Contr
|
|
|
205
205
|
readonly change: EventEmitter<MatRadioChange>;
|
|
206
206
|
/** Child radio buttons. */
|
|
207
207
|
_radios: QueryList<MatRadioButton>;
|
|
208
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* Theme color of the radio buttons in the group. This API is supported in M2
|
|
210
|
+
* themes only, it has no effect in M3 themes.
|
|
211
|
+
*
|
|
212
|
+
* For information on applying color variants in M3, see
|
|
213
|
+
* https://material.angular.io/guide/theming#using-component-color-variants.
|
|
214
|
+
*/
|
|
209
215
|
color: ThemePalette;
|
|
210
216
|
/** Name of the radio button group. All radio buttons inside this group will use this name. */
|
|
211
217
|
get name(): string;
|
|
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
|
|
|
18
18
|
* Note that the fallback version range does not use caret, but tilde because that is
|
|
19
19
|
* the default for Angular framework dependencies in CLI projects.
|
|
20
20
|
*/
|
|
21
|
-
const fallbackMaterialVersionRange = `~18.0.
|
|
21
|
+
const fallbackMaterialVersionRange = `~18.0.4`;
|
|
22
22
|
/**
|
|
23
23
|
* Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
|
|
24
24
|
* automatically executed if developers run `ng add @angular/material`.
|
|
@@ -18,7 +18,7 @@ const package_config_1 = require("./package-config");
|
|
|
18
18
|
* Note that the fallback version range does not use caret, but tilde because that is
|
|
19
19
|
* the default for Angular framework dependencies in CLI projects.
|
|
20
20
|
*/
|
|
21
|
-
const fallbackMaterialVersionRange = `~18.0.
|
|
21
|
+
const fallbackMaterialVersionRange = `~18.0.4`;
|
|
22
22
|
/**
|
|
23
23
|
* Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
|
|
24
24
|
* automatically executed if developers run `ng add @angular/material`.
|
|
@@ -2515,7 +2515,19 @@ function customColor(source, color) {
|
|
|
2515
2515
|
|
|
2516
2516
|
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
|
|
2517
2517
|
var HUE_TONES = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
|
|
2518
|
-
var
|
|
2518
|
+
var NEUTRAL_HUES = /* @__PURE__ */ new Map([
|
|
2519
|
+
[4, { prev: 0, next: 10 }],
|
|
2520
|
+
[6, { prev: 0, next: 10 }],
|
|
2521
|
+
[12, { prev: 10, next: 20 }],
|
|
2522
|
+
[17, { prev: 10, next: 20 }],
|
|
2523
|
+
[22, { prev: 20, next: 25 }],
|
|
2524
|
+
[24, { prev: 20, next: 25 }],
|
|
2525
|
+
[87, { prev: 80, next: 90 }],
|
|
2526
|
+
[92, { prev: 90, next: 95 }],
|
|
2527
|
+
[94, { prev: 90, next: 95 }],
|
|
2528
|
+
[96, { prev: 95, next: 98 }]
|
|
2529
|
+
]);
|
|
2530
|
+
var NEUTRAL_HUE_TONES = [...HUE_TONES, ...NEUTRAL_HUES.keys()];
|
|
2519
2531
|
function getMaterialTonalPalettes(color) {
|
|
2520
2532
|
try {
|
|
2521
2533
|
let argbColor = argbFromHex(color);
|
|
@@ -2567,7 +2579,7 @@ function generateSCSSTheme(colorPalettes, themeTypes, colorComment, useSystemVar
|
|
|
2567
2579
|
"@use '@angular/material' as mat;",
|
|
2568
2580
|
"",
|
|
2569
2581
|
"// Note: " + colorComment,
|
|
2570
|
-
"$_palettes: " + getColorPalettesSCSS(colorPalettes),
|
|
2582
|
+
"$_palettes: " + getColorPalettesSCSS(patchMissingHues(colorPalettes)),
|
|
2571
2583
|
"",
|
|
2572
2584
|
"$_rest: (",
|
|
2573
2585
|
" secondary: map.get($_palettes, secondary),",
|
|
@@ -2623,6 +2635,73 @@ function m3_theme_default(options) {
|
|
|
2623
2635
|
createThemeFile(themeScss, tree, options.directory);
|
|
2624
2636
|
});
|
|
2625
2637
|
}
|
|
2638
|
+
function patchMissingHues(palettes) {
|
|
2639
|
+
const neutral = palettes.get("neutral");
|
|
2640
|
+
if (!neutral) {
|
|
2641
|
+
return palettes;
|
|
2642
|
+
}
|
|
2643
|
+
let newNeutral = null;
|
|
2644
|
+
for (const [hue, { prev, next }] of NEUTRAL_HUES) {
|
|
2645
|
+
if (!neutral.has(hue) && neutral.has(prev) && neutral.has(next)) {
|
|
2646
|
+
const weight = (next - hue) / (next - prev);
|
|
2647
|
+
const result = mixColors(neutral.get(prev), neutral.get(next), weight);
|
|
2648
|
+
if (result !== null) {
|
|
2649
|
+
newNeutral != null ? newNeutral : newNeutral = new Map(neutral.entries());
|
|
2650
|
+
newNeutral.set(hue, result);
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
if (!newNeutral) {
|
|
2655
|
+
return palettes;
|
|
2656
|
+
}
|
|
2657
|
+
const newPalettes = /* @__PURE__ */ new Map();
|
|
2658
|
+
for (const [key, value] of palettes) {
|
|
2659
|
+
if (key === "neutral") {
|
|
2660
|
+
const sortedNeutral = Array.from(newNeutral.keys()).sort((a, b) => a - b).reduce((newHues, key2) => {
|
|
2661
|
+
newHues.set(key2, newNeutral.get(key2));
|
|
2662
|
+
return newHues;
|
|
2663
|
+
}, /* @__PURE__ */ new Map());
|
|
2664
|
+
newPalettes.set(key, sortedNeutral);
|
|
2665
|
+
} else {
|
|
2666
|
+
newPalettes.set(key, value);
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
return newPalettes;
|
|
2670
|
+
}
|
|
2671
|
+
function mixColors(c1, c2, weight) {
|
|
2672
|
+
const normalizedWeight = weight * 2 - 1;
|
|
2673
|
+
const weight1 = (normalizedWeight + 1) / 2;
|
|
2674
|
+
const weight2 = 1 - weight1;
|
|
2675
|
+
const color1 = parseHexColor(c1);
|
|
2676
|
+
const color2 = parseHexColor(c2);
|
|
2677
|
+
if (color1 === null || color2 === null) {
|
|
2678
|
+
return null;
|
|
2679
|
+
}
|
|
2680
|
+
const red = Math.round(color1.red * weight1 + color2.red * weight2);
|
|
2681
|
+
const green = Math.round(color1.green * weight1 + color2.green * weight2);
|
|
2682
|
+
const blue = Math.round(color1.blue * weight1 + color2.blue * weight2);
|
|
2683
|
+
const intToHex = (value) => value.toString(16).padStart(2, "0");
|
|
2684
|
+
return `#${intToHex(red)}${intToHex(green)}${intToHex(blue)}`;
|
|
2685
|
+
}
|
|
2686
|
+
function parseHexColor(value) {
|
|
2687
|
+
if (!/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value)) {
|
|
2688
|
+
return null;
|
|
2689
|
+
}
|
|
2690
|
+
const hexToInt = (value2) => parseInt(value2, 16);
|
|
2691
|
+
let red;
|
|
2692
|
+
let green;
|
|
2693
|
+
let blue;
|
|
2694
|
+
if (value.length === 4) {
|
|
2695
|
+
red = hexToInt(value[1] + value[1]);
|
|
2696
|
+
green = hexToInt(value[2] + value[2]);
|
|
2697
|
+
blue = hexToInt(value[3] + value[3]);
|
|
2698
|
+
} else {
|
|
2699
|
+
red = hexToInt(value.slice(1, 3));
|
|
2700
|
+
green = hexToInt(value.slice(3, 5));
|
|
2701
|
+
blue = hexToInt(value.slice(5, 7));
|
|
2702
|
+
}
|
|
2703
|
+
return { red, green, blue };
|
|
2704
|
+
}
|
|
2626
2705
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2627
2706
|
0 && (module.exports = {
|
|
2628
2707
|
generateSCSSTheme
|