@angular/material 18.2.0 → 19.0.0-next.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/esm2022/core/version.mjs +1 -1
- package/fesm2022/core.mjs +1 -1
- package/fesm2022/core.mjs.map +1 -1
- package/package.json +7 -7
- package/schematics/migration.json +4 -4
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-add/index.mjs +2 -2
- package/schematics/ng-update/index_bundled.js +6 -251
- package/schematics/ng-update/index_bundled.js.map +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/material",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0-next.0",
|
|
4
4
|
"description": "Angular Material",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -489,12 +489,12 @@
|
|
|
489
489
|
}
|
|
490
490
|
},
|
|
491
491
|
"peerDependencies": {
|
|
492
|
-
"@angular/animations": "^
|
|
493
|
-
"@angular/cdk": "
|
|
494
|
-
"@angular/core": "^
|
|
495
|
-
"@angular/common": "^
|
|
496
|
-
"@angular/forms": "^
|
|
497
|
-
"@angular/platform-browser": "^
|
|
492
|
+
"@angular/animations": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
|
|
493
|
+
"@angular/cdk": "19.0.0-next.0",
|
|
494
|
+
"@angular/core": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
|
|
495
|
+
"@angular/common": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
|
|
496
|
+
"@angular/forms": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
|
|
497
|
+
"@angular/platform-browser": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
|
|
498
498
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
499
499
|
},
|
|
500
500
|
"dependencies": {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
3
|
"schematics": {
|
|
4
|
-
"migration-
|
|
5
|
-
"version": "
|
|
6
|
-
"description": "Updates Angular Material to
|
|
7
|
-
"factory": "./ng-update/index_bundled#
|
|
4
|
+
"migration-v19": {
|
|
5
|
+
"version": "19.0.0-0",
|
|
6
|
+
"description": "Updates Angular Material to v19",
|
|
7
|
+
"factory": "./ng-update/index_bundled#updateToV19"
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -19,7 +19,7 @@ const package_config_1 = require("./package-config");
|
|
|
19
19
|
* Note that the fallback version range does not use caret, but tilde because that is
|
|
20
20
|
* the default for Angular framework dependencies in CLI projects.
|
|
21
21
|
*/
|
|
22
|
-
const fallbackMaterialVersionRange = `~
|
|
22
|
+
const fallbackMaterialVersionRange = `~19.0.0-next.0`;
|
|
23
23
|
/**
|
|
24
24
|
* Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
|
|
25
25
|
* automatically executed if developers run `ng add @angular/material`.
|
|
@@ -34,7 +34,7 @@ function default_1(options) {
|
|
|
34
34
|
// have the same version tag if possible.
|
|
35
35
|
const ngCoreVersionTag = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/core');
|
|
36
36
|
const materialVersionRange = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/material');
|
|
37
|
-
const angularDependencyVersion = ngCoreVersionTag || `^
|
|
37
|
+
const angularDependencyVersion = ngCoreVersionTag || `^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0`;
|
|
38
38
|
// The CLI inserts `@angular/material` into the `package.json` before this schematic runs.
|
|
39
39
|
// This means that we do not need to insert Angular Material into `package.json` files again.
|
|
40
40
|
// In some cases though, it could happen that this schematic runs outside of the CLI `ng add`
|
|
@@ -19,7 +19,7 @@ const package_config_1 = require("./package-config");
|
|
|
19
19
|
* Note that the fallback version range does not use caret, but tilde because that is
|
|
20
20
|
* the default for Angular framework dependencies in CLI projects.
|
|
21
21
|
*/
|
|
22
|
-
const fallbackMaterialVersionRange = `~
|
|
22
|
+
const fallbackMaterialVersionRange = `~19.0.0-next.0`;
|
|
23
23
|
/**
|
|
24
24
|
* Schematic factory entry-point for the `ng-add` schematic. The ng-add schematic will be
|
|
25
25
|
* automatically executed if developers run `ng add @angular/material`.
|
|
@@ -34,7 +34,7 @@ function default_1(options) {
|
|
|
34
34
|
// have the same version tag if possible.
|
|
35
35
|
const ngCoreVersionTag = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/core');
|
|
36
36
|
const materialVersionRange = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/material');
|
|
37
|
-
const angularDependencyVersion = ngCoreVersionTag || `^
|
|
37
|
+
const angularDependencyVersion = ngCoreVersionTag || `^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0`;
|
|
38
38
|
// The CLI inserts `@angular/material` into the `package.json` before this schematic runs.
|
|
39
39
|
// This means that we do not need to insert Angular Material into `package.json` files again.
|
|
40
40
|
// In some cases though, it could happen that this schematic runs outside of the CLI `ng add`
|
|
@@ -651,40 +651,7 @@ var require_css_tokens = __commonJS({
|
|
|
651
651
|
"use strict";
|
|
652
652
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
653
653
|
exports.cssTokens = void 0;
|
|
654
|
-
|
|
655
|
-
exports.cssTokens = {
|
|
656
|
-
[schematics_1.TargetVersion.V18]: [
|
|
657
|
-
{
|
|
658
|
-
pr: "https://github.com/angular/components/pull/29026",
|
|
659
|
-
changes: [
|
|
660
|
-
{
|
|
661
|
-
replace: "--mdc-form-field-label-text-color",
|
|
662
|
-
replaceWith: "--mat-checkbox-label-text-color"
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
replace: "--mdc-form-field-label-text-font",
|
|
666
|
-
replaceWith: "--mat-checkbox-label-text-font"
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
replace: "--mdc-form-field-label-text-line-height",
|
|
670
|
-
replaceWith: "--mat-checkbox-label-text-line-height"
|
|
671
|
-
},
|
|
672
|
-
{
|
|
673
|
-
replace: "--mdc-form-field-label-text-size",
|
|
674
|
-
replaceWith: "--mat-checkbox-label-text-size"
|
|
675
|
-
},
|
|
676
|
-
{
|
|
677
|
-
replace: "--mdc-form-field-label-text-tracking",
|
|
678
|
-
replaceWith: "--mat-checkbox-label-text-tracking"
|
|
679
|
-
},
|
|
680
|
-
{
|
|
681
|
-
replace: "--mdc-form-field-label-text-weight",
|
|
682
|
-
replaceWith: "--mat-checkbox-label-text-weight"
|
|
683
|
-
}
|
|
684
|
-
]
|
|
685
|
-
}
|
|
686
|
-
]
|
|
687
|
-
};
|
|
654
|
+
exports.cssTokens = {};
|
|
688
655
|
}
|
|
689
656
|
});
|
|
690
657
|
|
|
@@ -791,229 +758,17 @@ var require_upgrade_data = __commonJS({
|
|
|
791
758
|
}
|
|
792
759
|
});
|
|
793
760
|
|
|
794
|
-
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/m2-theming-v18/migration.js
|
|
795
|
-
var require_migration = __commonJS({
|
|
796
|
-
"bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/m2-theming-v18/migration.js"(exports) {
|
|
797
|
-
"use strict";
|
|
798
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
799
|
-
exports.migrateM2ThemingApiUsages = migrateM2ThemingApiUsages;
|
|
800
|
-
var RENAMED_FUNCTIONS = [
|
|
801
|
-
"define-light-theme",
|
|
802
|
-
"define-dark-theme",
|
|
803
|
-
"define-palette",
|
|
804
|
-
"get-contrast-color-from-palette",
|
|
805
|
-
"get-color-from-palette",
|
|
806
|
-
"get-color-config",
|
|
807
|
-
"get-typography-config",
|
|
808
|
-
"get-density-config",
|
|
809
|
-
"define-typography-level",
|
|
810
|
-
"define-rem-typography-config",
|
|
811
|
-
"define-typography-config",
|
|
812
|
-
"define-legacy-typography-config",
|
|
813
|
-
"typography-level",
|
|
814
|
-
"font-size",
|
|
815
|
-
"line-height",
|
|
816
|
-
"font-weight",
|
|
817
|
-
"letter-spacing",
|
|
818
|
-
"font-family"
|
|
819
|
-
];
|
|
820
|
-
var RENAMED_VARIABLES = [
|
|
821
|
-
"red-palette",
|
|
822
|
-
"pink-palette",
|
|
823
|
-
"indigo-palette",
|
|
824
|
-
"purple-palette",
|
|
825
|
-
"deep-purple-palette",
|
|
826
|
-
"blue-palette",
|
|
827
|
-
"light-blue-palette",
|
|
828
|
-
"cyan-palette",
|
|
829
|
-
"teal-palette",
|
|
830
|
-
"green-palette",
|
|
831
|
-
"light-green-palette",
|
|
832
|
-
"lime-palette",
|
|
833
|
-
"yellow-palette",
|
|
834
|
-
"amber-palette",
|
|
835
|
-
"orange-palette",
|
|
836
|
-
"deep-orange-palette",
|
|
837
|
-
"brown-palette",
|
|
838
|
-
"grey-palette",
|
|
839
|
-
"gray-palette",
|
|
840
|
-
"blue-grey-palette",
|
|
841
|
-
"blue-gray-palette",
|
|
842
|
-
"light-theme-background-palette",
|
|
843
|
-
"dark-theme-background-palette",
|
|
844
|
-
"light-theme-foreground-palette",
|
|
845
|
-
"dark-theme-foreground-palette"
|
|
846
|
-
];
|
|
847
|
-
var M3_FUNCTIONS = ["define-theme", "define-colors", "define-typography", "define-density"];
|
|
848
|
-
var M3_VARIABLES = [
|
|
849
|
-
"red-palette",
|
|
850
|
-
"green-palette",
|
|
851
|
-
"blue-palette",
|
|
852
|
-
"yellow-palette",
|
|
853
|
-
"cyan-palette",
|
|
854
|
-
"magenta-palette",
|
|
855
|
-
"orange-palette",
|
|
856
|
-
"chartreuse-palette",
|
|
857
|
-
"azure-palette",
|
|
858
|
-
"violet-palette",
|
|
859
|
-
"rose-palette"
|
|
860
|
-
];
|
|
861
|
-
var COMMENT_PAIRS = /* @__PURE__ */ new Map([
|
|
862
|
-
["/*", "*/"],
|
|
863
|
-
["//", "\n"]
|
|
864
|
-
]);
|
|
865
|
-
var COMMENT_PLACEHOLDER_START = "__<<ngM2ThemingMigrationEscapedComment";
|
|
866
|
-
var COMMENT_PLACEHOLDER_END = ">>__";
|
|
867
|
-
function migrateM2ThemingApiUsages(fileContent) {
|
|
868
|
-
let { content, placeholders } = escapeComments(fileContent);
|
|
869
|
-
const materialNamespaces = getNamespaces("@angular/material", content);
|
|
870
|
-
const experimentalNamespaces = getNamespaces("@angular/material-experimental", content);
|
|
871
|
-
for (const namespace of materialNamespaces) {
|
|
872
|
-
for (const name of RENAMED_FUNCTIONS) {
|
|
873
|
-
content = migrateFunction(content, namespace, name, namespace, "m2-" + name);
|
|
874
|
-
}
|
|
875
|
-
for (const name of RENAMED_VARIABLES) {
|
|
876
|
-
content = migrateVariable(content, namespace, name, namespace, "m2-" + name);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
if (experimentalNamespaces.length > 0) {
|
|
880
|
-
const preExperimentalContent = content;
|
|
881
|
-
const stableNamespace = materialNamespaces.length === 0 ? "mat" : materialNamespaces[0];
|
|
882
|
-
for (const namespace of experimentalNamespaces) {
|
|
883
|
-
content = migrateMixin(content, namespace, "color-variants-back-compat", stableNamespace, "color-variants-backwards-compatibility");
|
|
884
|
-
for (const name of M3_FUNCTIONS) {
|
|
885
|
-
content = migrateFunction(content, namespace, name, stableNamespace, name);
|
|
886
|
-
}
|
|
887
|
-
for (const name of M3_VARIABLES) {
|
|
888
|
-
content = migrateVariable(content, namespace, "m3-" + name, stableNamespace, name);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
if (materialNamespaces.length === 0 && content !== preExperimentalContent) {
|
|
892
|
-
content = `@use '@angular/material' as ${stableNamespace};
|
|
893
|
-
` + content;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
return restoreComments(content, placeholders);
|
|
897
|
-
}
|
|
898
|
-
function migrateFunction(fileContent, oldNamespace, oldName, newNamespace, newName) {
|
|
899
|
-
return fileContent.replace(new RegExp(`${oldNamespace}\\.${oldName}\\(`, "g"), `${newNamespace}.${newName}(`);
|
|
900
|
-
}
|
|
901
|
-
function migrateVariable(fileContent, oldNamespace, oldName, newNamespace, newName) {
|
|
902
|
-
return fileContent.replace(new RegExp(`${oldNamespace}\\.\\$${oldName}(?!\\s+:|[-_a-zA-Z0-9:])`, "g"), `${newNamespace}.$${newName}`);
|
|
903
|
-
}
|
|
904
|
-
function migrateMixin(fileContent, oldNamespace, oldName, newNamespace, newName) {
|
|
905
|
-
const pattern = new RegExp(`@include +${oldNamespace}\\.${oldName}`, "g");
|
|
906
|
-
return fileContent.replace(pattern, `@include ${newNamespace}.${newName}`);
|
|
907
|
-
}
|
|
908
|
-
function escapeComments(content) {
|
|
909
|
-
const placeholders = {};
|
|
910
|
-
let commentCounter = 0;
|
|
911
|
-
let [openIndex, closeIndex] = findComment(content);
|
|
912
|
-
while (openIndex > -1 && closeIndex > -1) {
|
|
913
|
-
const placeholder = COMMENT_PLACEHOLDER_START + commentCounter++ + COMMENT_PLACEHOLDER_END;
|
|
914
|
-
placeholders[placeholder] = content.slice(openIndex, closeIndex);
|
|
915
|
-
content = content.slice(0, openIndex) + placeholder + content.slice(closeIndex);
|
|
916
|
-
[openIndex, closeIndex] = findComment(content);
|
|
917
|
-
}
|
|
918
|
-
return { content, placeholders };
|
|
919
|
-
}
|
|
920
|
-
function findComment(content) {
|
|
921
|
-
content += "\n";
|
|
922
|
-
for (const [open, close] of COMMENT_PAIRS.entries()) {
|
|
923
|
-
const openIndex = content.indexOf(open);
|
|
924
|
-
if (openIndex > -1) {
|
|
925
|
-
const closeIndex = content.indexOf(close, openIndex + 1);
|
|
926
|
-
return closeIndex > -1 ? [openIndex, closeIndex + close.length] : [-1, -1];
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
return [-1, -1];
|
|
930
|
-
}
|
|
931
|
-
function restoreComments(content, placeholders) {
|
|
932
|
-
Object.keys(placeholders).forEach((key) => content = content.replace(key, placeholders[key]));
|
|
933
|
-
return content;
|
|
934
|
-
}
|
|
935
|
-
function extractNamespaceFromUseStatement(fullImport) {
|
|
936
|
-
const closeQuoteIndex = Math.max(fullImport.lastIndexOf(`"`), fullImport.lastIndexOf(`'`));
|
|
937
|
-
if (closeQuoteIndex > -1) {
|
|
938
|
-
const asExpression = "as ";
|
|
939
|
-
const asIndex = fullImport.indexOf(asExpression, closeQuoteIndex);
|
|
940
|
-
if (asIndex > -1) {
|
|
941
|
-
return fullImport.slice(asIndex + asExpression.length).split(";")[0].trim();
|
|
942
|
-
}
|
|
943
|
-
const lastSlashIndex = fullImport.lastIndexOf("/", closeQuoteIndex);
|
|
944
|
-
if (lastSlashIndex > -1) {
|
|
945
|
-
const fileName = fullImport.slice(lastSlashIndex + 1, closeQuoteIndex).replace(/^_|(\.import)?\.scss$|\.import$/g, "");
|
|
946
|
-
if (fileName === "index") {
|
|
947
|
-
const nextSlashIndex = fullImport.lastIndexOf("/", lastSlashIndex - 1);
|
|
948
|
-
if (nextSlashIndex > -1) {
|
|
949
|
-
return fullImport.slice(nextSlashIndex + 1, lastSlashIndex);
|
|
950
|
-
}
|
|
951
|
-
} else {
|
|
952
|
-
return fileName;
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
throw Error(`Could not extract namespace from import "${fullImport}".`);
|
|
957
|
-
}
|
|
958
|
-
function getNamespaces(moduleName, content) {
|
|
959
|
-
const namespaces = /* @__PURE__ */ new Set();
|
|
960
|
-
const escapedName = moduleName.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
|
|
961
|
-
const pattern = new RegExp(`@use +['"]${escapedName}['"].*;?\\r?\\n`, "g");
|
|
962
|
-
let match = null;
|
|
963
|
-
while (match = pattern.exec(content)) {
|
|
964
|
-
namespaces.add(extractNamespaceFromUseStatement(match[0]));
|
|
965
|
-
}
|
|
966
|
-
return Array.from(namespaces);
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
});
|
|
970
|
-
|
|
971
|
-
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/m2-theming-v18/index.js
|
|
972
|
-
var require_m2_theming_v18 = __commonJS({
|
|
973
|
-
"bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/m2-theming-v18/index.js"(exports) {
|
|
974
|
-
"use strict";
|
|
975
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
976
|
-
exports.M2ThemingMigration = void 0;
|
|
977
|
-
var core_1 = require("@angular-devkit/core");
|
|
978
|
-
var schematics_1 = require("@angular/cdk/schematics");
|
|
979
|
-
var migration_1 = require_migration();
|
|
980
|
-
var M2ThemingMigration2 = class extends schematics_1.DevkitMigration {
|
|
981
|
-
constructor() {
|
|
982
|
-
super(...arguments);
|
|
983
|
-
this._potentialThemes = [];
|
|
984
|
-
this.enabled = this.targetVersion === schematics_1.TargetVersion.V18;
|
|
985
|
-
}
|
|
986
|
-
visitStylesheet(stylesheet) {
|
|
987
|
-
if ((0, core_1.extname)(stylesheet.filePath) === ".scss" && stylesheet.content.includes("@angular/material")) {
|
|
988
|
-
this._potentialThemes.push(stylesheet);
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
postAnalysis() {
|
|
992
|
-
for (const theme of this._potentialThemes) {
|
|
993
|
-
const migrated = (0, migration_1.migrateM2ThemingApiUsages)(theme.content);
|
|
994
|
-
if (migrated !== theme.content) {
|
|
995
|
-
this.fileSystem.edit(theme.filePath).remove(0, theme.content.length).insertLeft(0, migrated);
|
|
996
|
-
this.fileSystem.commitEdits();
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
exports.M2ThemingMigration = M2ThemingMigration2;
|
|
1002
|
-
}
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
761
|
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/index.mjs
|
|
1006
762
|
var ng_update_exports = {};
|
|
1007
763
|
__export(ng_update_exports, {
|
|
1008
|
-
|
|
764
|
+
updateToV19: () => updateToV19
|
|
1009
765
|
});
|
|
1010
766
|
module.exports = __toCommonJS(ng_update_exports);
|
|
1011
767
|
var import_schematics = require("@angular/cdk/schematics");
|
|
1012
768
|
var import_upgrade_data = __toESM(require_upgrade_data(), 1);
|
|
1013
|
-
var
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
return (0, import_schematics.createMigrationSchematicRule)(import_schematics.TargetVersion.V18, materialMigrations, import_upgrade_data.materialUpgradeData, onMigrationComplete);
|
|
769
|
+
var materialMigrations = [];
|
|
770
|
+
function updateToV19() {
|
|
771
|
+
return (0, import_schematics.createMigrationSchematicRule)(import_schematics.TargetVersion.V19, materialMigrations, import_upgrade_data.materialUpgradeData, onMigrationComplete);
|
|
1017
772
|
}
|
|
1018
773
|
function onMigrationComplete(context, targetVersion, hasFailures) {
|
|
1019
774
|
context.logger.info("");
|
|
@@ -1025,7 +780,7 @@ function onMigrationComplete(context, targetVersion, hasFailures) {
|
|
|
1025
780
|
}
|
|
1026
781
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1027
782
|
0 && (module.exports = {
|
|
1028
|
-
|
|
783
|
+
updateToV19
|
|
1029
784
|
});
|
|
1030
785
|
/**
|
|
1031
786
|
* @license
|