@angular/material 17.0.0-rc.0 → 17.0.0-rc.2

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 (295) hide show
  1. package/_index.scss +1 -1
  2. package/button/_button-base.scss +37 -18
  3. package/button/_button-theme.scss +86 -142
  4. package/button/_fab-theme.scss +21 -49
  5. package/button/_icon-button-theme.scss +25 -43
  6. package/button/index.d.ts +0 -2
  7. package/chips/index.d.ts +2 -3
  8. package/core/index.d.ts +2 -3
  9. package/core/theming/_theming.scss +0 -14
  10. package/core/tokens/m2/mat/_fab.scss +87 -0
  11. package/core/tokens/m2/mat/_filled-button.scss +76 -0
  12. package/core/tokens/m2/mat/_icon-button.scss +73 -0
  13. package/core/tokens/m2/mat/_outlined-button.scss +73 -0
  14. package/core/tokens/m2/mat/_protected-button.scss +76 -0
  15. package/core/tokens/m2/mat/_sort.scss +60 -0
  16. package/core/tokens/m2/mat/_text-button.scss +73 -0
  17. package/core/tokens/m2/mat/_tree.scss +62 -0
  18. package/core/tokens/m2/mdc/_extended-fab.scss +3 -0
  19. package/core/tokens/m2/mdc/_fab.scss +17 -3
  20. package/core/tokens/m2/mdc/_filled-button.scss +24 -18
  21. package/core/tokens/m2/mdc/_icon-button.scss +16 -6
  22. package/core/tokens/m2/mdc/_outlined-button.scss +120 -0
  23. package/core/tokens/m2/mdc/_protected-button.scss +24 -19
  24. package/dialog/index.d.ts +2 -1
  25. package/divider/_divider-theme.scss +4 -1
  26. package/esm2022/autocomplete/autocomplete-origin.mjs +4 -4
  27. package/esm2022/autocomplete/autocomplete-trigger.mjs +4 -4
  28. package/esm2022/autocomplete/autocomplete.mjs +4 -4
  29. package/esm2022/autocomplete/module.mjs +5 -5
  30. package/esm2022/badge/badge-module.mjs +5 -5
  31. package/esm2022/badge/badge.mjs +4 -4
  32. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +4 -4
  33. package/esm2022/bottom-sheet/bottom-sheet-module.mjs +5 -5
  34. package/esm2022/bottom-sheet/bottom-sheet.mjs +4 -4
  35. package/esm2022/button/button-base.mjs +19 -24
  36. package/esm2022/button/button.mjs +9 -9
  37. package/esm2022/button/fab.mjs +17 -17
  38. package/esm2022/button/icon-button.mjs +9 -9
  39. package/esm2022/button/module.mjs +5 -5
  40. package/esm2022/button-toggle/button-toggle-module.mjs +5 -5
  41. package/esm2022/button-toggle/button-toggle.mjs +8 -8
  42. package/esm2022/card/card.mjs +43 -43
  43. package/esm2022/card/module.mjs +5 -5
  44. package/esm2022/checkbox/checkbox-required-validator.mjs +4 -4
  45. package/esm2022/checkbox/checkbox.mjs +5 -5
  46. package/esm2022/checkbox/module.mjs +9 -9
  47. package/esm2022/chips/chip-action.mjs +4 -4
  48. package/esm2022/chips/chip-edit-input.mjs +4 -4
  49. package/esm2022/chips/chip-grid.mjs +4 -4
  50. package/esm2022/chips/chip-icons.mjs +10 -10
  51. package/esm2022/chips/chip-input.mjs +4 -4
  52. package/esm2022/chips/chip-listbox.mjs +4 -4
  53. package/esm2022/chips/chip-option.mjs +7 -8
  54. package/esm2022/chips/chip-row.mjs +8 -9
  55. package/esm2022/chips/chip-set.mjs +4 -4
  56. package/esm2022/chips/chip.mjs +6 -7
  57. package/esm2022/chips/module.mjs +8 -9
  58. package/esm2022/core/common-behaviors/common-module.mjs +5 -5
  59. package/esm2022/core/datetime/index.mjs +9 -9
  60. package/esm2022/core/datetime/native-date-adapter.mjs +4 -4
  61. package/esm2022/core/error/error-options.mjs +7 -7
  62. package/esm2022/core/line/line.mjs +8 -8
  63. package/esm2022/core/option/index.mjs +6 -7
  64. package/esm2022/core/option/optgroup.mjs +4 -4
  65. package/esm2022/core/option/option.mjs +8 -9
  66. package/esm2022/core/private/ripple-loader.mjs +4 -4
  67. package/esm2022/core/ripple/index.mjs +5 -5
  68. package/esm2022/core/ripple/ripple.mjs +4 -4
  69. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox-module.mjs +5 -5
  70. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +4 -4
  71. package/esm2022/core/version.mjs +1 -1
  72. package/esm2022/datepicker/calendar-body.mjs +5 -5
  73. package/esm2022/datepicker/calendar.mjs +13 -14
  74. package/esm2022/datepicker/date-range-input-parts.mjs +10 -10
  75. package/esm2022/datepicker/date-range-input.mjs +4 -4
  76. package/esm2022/datepicker/date-range-picker.mjs +4 -4
  77. package/esm2022/datepicker/date-range-selection-strategy.mjs +4 -4
  78. package/esm2022/datepicker/date-selection-model.mjs +10 -10
  79. package/esm2022/datepicker/datepicker-actions.mjs +10 -10
  80. package/esm2022/datepicker/datepicker-base.mjs +7 -7
  81. package/esm2022/datepicker/datepicker-input-base.mjs +4 -4
  82. package/esm2022/datepicker/datepicker-input.mjs +4 -4
  83. package/esm2022/datepicker/datepicker-intl.mjs +4 -4
  84. package/esm2022/datepicker/datepicker-module.mjs +5 -5
  85. package/esm2022/datepicker/datepicker-toggle.mjs +9 -10
  86. package/esm2022/datepicker/datepicker.mjs +4 -4
  87. package/esm2022/datepicker/month-view.mjs +6 -7
  88. package/esm2022/datepicker/multi-year-view.mjs +4 -4
  89. package/esm2022/datepicker/year-view.mjs +4 -4
  90. package/esm2022/dialog/dialog-container.mjs +4 -4
  91. package/esm2022/dialog/dialog-content-directives.mjs +13 -13
  92. package/esm2022/dialog/dialog.mjs +4 -4
  93. package/esm2022/dialog/module.mjs +5 -5
  94. package/esm2022/divider/divider-module.mjs +5 -5
  95. package/esm2022/divider/divider.mjs +5 -5
  96. package/esm2022/expansion/accordion.mjs +4 -4
  97. package/esm2022/expansion/expansion-module.mjs +7 -8
  98. package/esm2022/expansion/expansion-panel-content.mjs +4 -4
  99. package/esm2022/expansion/expansion-panel-header.mjs +11 -12
  100. package/esm2022/expansion/expansion-panel.mjs +7 -7
  101. package/esm2022/form-field/directives/error.mjs +4 -4
  102. package/esm2022/form-field/directives/floating-label.mjs +4 -4
  103. package/esm2022/form-field/directives/hint.mjs +4 -4
  104. package/esm2022/form-field/directives/label.mjs +4 -4
  105. package/esm2022/form-field/directives/line-ripple.mjs +4 -4
  106. package/esm2022/form-field/directives/notched-outline.mjs +4 -4
  107. package/esm2022/form-field/directives/prefix.mjs +4 -4
  108. package/esm2022/form-field/directives/suffix.mjs +4 -4
  109. package/esm2022/form-field/form-field-control.mjs +4 -4
  110. package/esm2022/form-field/form-field.mjs +6 -6
  111. package/esm2022/form-field/module.mjs +5 -5
  112. package/esm2022/grid-list/grid-list-module.mjs +5 -5
  113. package/esm2022/grid-list/grid-list.mjs +4 -4
  114. package/esm2022/grid-list/grid-tile.mjs +16 -16
  115. package/esm2022/icon/icon-module.mjs +5 -5
  116. package/esm2022/icon/icon-registry.mjs +4 -4
  117. package/esm2022/icon/icon.mjs +4 -4
  118. package/esm2022/icon/testing/fake-icon-registry.mjs +8 -8
  119. package/esm2022/input/input.mjs +4 -4
  120. package/esm2022/input/module.mjs +5 -5
  121. package/esm2022/list/action-list.mjs +4 -4
  122. package/esm2022/list/list-base.mjs +7 -7
  123. package/esm2022/list/list-item-sections.mjs +19 -19
  124. package/esm2022/list/list-module.mjs +5 -5
  125. package/esm2022/list/list-option.mjs +6 -6
  126. package/esm2022/list/list.mjs +7 -7
  127. package/esm2022/list/nav-list.mjs +4 -4
  128. package/esm2022/list/selection-list.mjs +4 -4
  129. package/esm2022/list/subheader.mjs +4 -4
  130. package/esm2022/menu/menu-content.mjs +4 -4
  131. package/esm2022/menu/menu-item.mjs +6 -7
  132. package/esm2022/menu/menu-trigger.mjs +4 -4
  133. package/esm2022/menu/menu.mjs +4 -4
  134. package/esm2022/menu/module.mjs +5 -5
  135. package/esm2022/paginator/module.mjs +6 -7
  136. package/esm2022/paginator/paginator-intl.mjs +4 -4
  137. package/esm2022/paginator/paginator.mjs +10 -11
  138. package/esm2022/progress-bar/module.mjs +5 -5
  139. package/esm2022/progress-bar/progress-bar.mjs +4 -4
  140. package/esm2022/progress-spinner/module.mjs +5 -5
  141. package/esm2022/progress-spinner/progress-spinner.mjs +4 -4
  142. package/esm2022/radio/module.mjs +5 -5
  143. package/esm2022/radio/radio.mjs +8 -8
  144. package/esm2022/select/module.mjs +5 -5
  145. package/esm2022/select/select.mjs +9 -9
  146. package/esm2022/sidenav/drawer.mjs +12 -13
  147. package/esm2022/sidenav/sidenav-module.mjs +7 -8
  148. package/esm2022/sidenav/sidenav.mjs +12 -13
  149. package/esm2022/slide-toggle/module.mjs +10 -11
  150. package/esm2022/slide-toggle/slide-toggle-required-validator.mjs +4 -4
  151. package/esm2022/slide-toggle/slide-toggle.mjs +5 -6
  152. package/esm2022/slider/module.mjs +6 -7
  153. package/esm2022/slider/slider-input.mjs +7 -7
  154. package/esm2022/slider/slider-thumb.mjs +6 -7
  155. package/esm2022/slider/slider.mjs +6 -7
  156. package/esm2022/snack-bar/module.mjs +5 -5
  157. package/esm2022/snack-bar/simple-snack-bar.mjs +5 -6
  158. package/esm2022/snack-bar/snack-bar-container.mjs +5 -5
  159. package/esm2022/snack-bar/snack-bar-content.mjs +10 -10
  160. package/esm2022/snack-bar/snack-bar.mjs +4 -4
  161. package/esm2022/sort/sort-header-intl.mjs +4 -4
  162. package/esm2022/sort/sort-header.mjs +5 -6
  163. package/esm2022/sort/sort-module.mjs +6 -7
  164. package/esm2022/sort/sort.mjs +4 -4
  165. package/esm2022/stepper/step-content.mjs +4 -4
  166. package/esm2022/stepper/step-header.mjs +5 -5
  167. package/esm2022/stepper/step-label.mjs +4 -4
  168. package/esm2022/stepper/stepper-button.mjs +7 -7
  169. package/esm2022/stepper/stepper-icon.mjs +4 -4
  170. package/esm2022/stepper/stepper-intl.mjs +4 -4
  171. package/esm2022/stepper/stepper-module.mjs +5 -5
  172. package/esm2022/stepper/stepper.mjs +8 -8
  173. package/esm2022/table/cell.mjs +22 -22
  174. package/esm2022/table/module.mjs +5 -5
  175. package/esm2022/table/row.mjs +22 -22
  176. package/esm2022/table/table.mjs +7 -7
  177. package/esm2022/table/text-column.mjs +4 -4
  178. package/esm2022/tabs/module.mjs +5 -5
  179. package/esm2022/tabs/paginated-tab-header.mjs +4 -4
  180. package/esm2022/tabs/tab-body.mjs +7 -7
  181. package/esm2022/tabs/tab-content.mjs +4 -4
  182. package/esm2022/tabs/tab-group.mjs +6 -6
  183. package/esm2022/tabs/tab-header.mjs +4 -4
  184. package/esm2022/tabs/tab-label-wrapper.mjs +4 -4
  185. package/esm2022/tabs/tab-label.mjs +4 -4
  186. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +10 -10
  187. package/esm2022/tabs/tab.mjs +4 -4
  188. package/esm2022/toolbar/toolbar-module.mjs +5 -5
  189. package/esm2022/toolbar/toolbar.mjs +7 -7
  190. package/esm2022/tooltip/module.mjs +5 -5
  191. package/esm2022/tooltip/tooltip.mjs +7 -7
  192. package/esm2022/tree/node.mjs +10 -10
  193. package/esm2022/tree/outlet.mjs +4 -4
  194. package/esm2022/tree/padding.mjs +4 -4
  195. package/esm2022/tree/toggle.mjs +4 -4
  196. package/esm2022/tree/tree-module.mjs +5 -5
  197. package/esm2022/tree/tree.mjs +5 -5
  198. package/expansion/index.d.ts +4 -5
  199. package/fesm2022/autocomplete.mjs +13 -13
  200. package/fesm2022/autocomplete.mjs.map +1 -1
  201. package/fesm2022/badge.mjs +7 -7
  202. package/fesm2022/badge.mjs.map +1 -1
  203. package/fesm2022/bottom-sheet.mjs +10 -10
  204. package/fesm2022/bottom-sheet.mjs.map +1 -1
  205. package/fesm2022/button-toggle.mjs +11 -11
  206. package/fesm2022/button-toggle.mjs.map +1 -1
  207. package/fesm2022/button.mjs +54 -59
  208. package/fesm2022/button.mjs.map +1 -1
  209. package/fesm2022/card.mjs +46 -46
  210. package/fesm2022/card.mjs.map +1 -1
  211. package/fesm2022/checkbox.mjs +15 -15
  212. package/fesm2022/checkbox.mjs.map +1 -1
  213. package/fesm2022/chips.mjs +53 -54
  214. package/fesm2022/chips.mjs.map +1 -1
  215. package/fesm2022/core.mjs +59 -60
  216. package/fesm2022/core.mjs.map +1 -1
  217. package/fesm2022/datepicker.mjs +89 -89
  218. package/fesm2022/datepicker.mjs.map +1 -1
  219. package/fesm2022/dialog.mjs +22 -22
  220. package/fesm2022/dialog.mjs.map +1 -1
  221. package/fesm2022/divider.mjs +8 -8
  222. package/fesm2022/divider.mjs.map +1 -1
  223. package/fesm2022/expansion.mjs +29 -30
  224. package/fesm2022/expansion.mjs.map +1 -1
  225. package/fesm2022/form-field.mjs +36 -36
  226. package/fesm2022/form-field.mjs.map +1 -1
  227. package/fesm2022/grid-list.mjs +22 -22
  228. package/fesm2022/grid-list.mjs.map +1 -1
  229. package/fesm2022/icon/testing.mjs +7 -7
  230. package/fesm2022/icon/testing.mjs.map +1 -1
  231. package/fesm2022/icon.mjs +10 -10
  232. package/fesm2022/icon.mjs.map +1 -1
  233. package/fesm2022/input.mjs +7 -7
  234. package/fesm2022/input.mjs.map +1 -1
  235. package/fesm2022/list.mjs +51 -51
  236. package/fesm2022/list.mjs.map +1 -1
  237. package/fesm2022/menu.mjs +23 -23
  238. package/fesm2022/menu.mjs.map +1 -1
  239. package/fesm2022/paginator.mjs +17 -19
  240. package/fesm2022/paginator.mjs.map +1 -1
  241. package/fesm2022/progress-bar.mjs +7 -7
  242. package/fesm2022/progress-bar.mjs.map +1 -1
  243. package/fesm2022/progress-spinner.mjs +7 -7
  244. package/fesm2022/progress-spinner.mjs.map +1 -1
  245. package/fesm2022/radio.mjs +11 -11
  246. package/fesm2022/radio.mjs.map +1 -1
  247. package/fesm2022/select.mjs +12 -12
  248. package/fesm2022/select.mjs.map +1 -1
  249. package/fesm2022/sidenav.mjs +29 -30
  250. package/fesm2022/sidenav.mjs.map +1 -1
  251. package/fesm2022/slide-toggle.mjs +16 -18
  252. package/fesm2022/slide-toggle.mjs.map +1 -1
  253. package/fesm2022/slider.mjs +22 -24
  254. package/fesm2022/slider.mjs.map +1 -1
  255. package/fesm2022/snack-bar.mjs +27 -28
  256. package/fesm2022/snack-bar.mjs.map +1 -1
  257. package/fesm2022/sort.mjs +15 -17
  258. package/fesm2022/sort.mjs.map +1 -1
  259. package/fesm2022/stepper.mjs +33 -33
  260. package/fesm2022/stepper.mjs.map +1 -1
  261. package/fesm2022/table.mjs +55 -55
  262. package/fesm2022/table.mjs.map +1 -1
  263. package/fesm2022/tabs.mjs +42 -42
  264. package/fesm2022/tabs.mjs.map +1 -1
  265. package/fesm2022/toolbar.mjs +10 -10
  266. package/fesm2022/toolbar.mjs.map +1 -1
  267. package/fesm2022/tooltip.mjs +10 -10
  268. package/fesm2022/tooltip.mjs.map +1 -1
  269. package/fesm2022/tree.mjs +26 -26
  270. package/fesm2022/tree.mjs.map +1 -1
  271. package/form-field/_form-field-theme.scss +11 -1
  272. package/package.json +2 -2
  273. package/paginator/index.d.ts +4 -5
  274. package/prebuilt-themes/deeppurple-amber.css +1 -1
  275. package/prebuilt-themes/indigo-pink.css +1 -1
  276. package/prebuilt-themes/pink-bluegrey.css +1 -1
  277. package/prebuilt-themes/purple-green.css +1 -1
  278. package/schematics/migration.json +1 -1
  279. package/schematics/ng-add/fonts/material-fonts.js +1 -3
  280. package/schematics/ng-add/fonts/material-fonts.mjs +1 -3
  281. package/schematics/ng-add/index.js +1 -1
  282. package/schematics/ng-add/index.mjs +1 -1
  283. package/schematics/ng-generate/mdc-migration/index_bundled.js +1183 -455
  284. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +4 -4
  285. package/schematics/ng-update/index_bundled.js +397 -2
  286. package/schematics/ng-update/index_bundled.js.map +4 -4
  287. package/sidenav/index.d.ts +3 -4
  288. package/slide-toggle/index.d.ts +1 -2
  289. package/slider/index.d.ts +1 -2
  290. package/sort/_sort-theme.scss +21 -23
  291. package/sort/index.d.ts +2 -3
  292. package/tree/_tree-theme.scss +13 -26
  293. package/button/_button-theme-private.scss +0 -67
  294. package/core/density/private/_compatibility.scss +0 -74
  295. package/tree/_tree-variables.scss +0 -14
@@ -24,6 +24,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var __async = (__this, __arguments, generator) => {
28
+ return new Promise((resolve, reject) => {
29
+ var fulfilled = (value) => {
30
+ try {
31
+ step(generator.next(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var rejected = (value) => {
37
+ try {
38
+ step(generator.throw(value));
39
+ } catch (e) {
40
+ reject(e);
41
+ }
42
+ };
43
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
44
+ step((generator = generator.apply(__this, __arguments)).next());
45
+ });
46
+ };
27
47
 
28
48
  // node_modules/tslib/tslib.js
29
49
  var require_tslib = __commonJS({
@@ -454,6 +474,75 @@ var require_tslib = __commonJS({
454
474
  }
455
475
  });
456
476
 
477
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/legacy-imports-error.js
478
+ var require_legacy_imports_error = __commonJS({
479
+ "bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/legacy-imports-error.js"(exports) {
480
+ "use strict";
481
+ Object.defineProperty(exports, "__esModule", { value: true });
482
+ exports.legacyImportsError = void 0;
483
+ var tslib_1 = require_tslib();
484
+ var tasks_1 = require("@angular-devkit/schematics/tasks");
485
+ var ts = tslib_1.__importStar(require("typescript"));
486
+ var LEGACY_IMPORTS_START = "@angular/material/legacy-";
487
+ var MAX_FILES_TO_PRINT = 50;
488
+ function legacyImportsError2(onSuccess) {
489
+ return (tree, context) => __async(this, null, function* () {
490
+ const filesUsingLegacyImports = /* @__PURE__ */ new Set();
491
+ tree.visit((path) => {
492
+ if (!path.endsWith(".ts")) {
493
+ return;
494
+ }
495
+ const content = tree.readText(path);
496
+ const sourceFile = ts.createSourceFile(path, content, ts.ScriptTarget.Latest);
497
+ sourceFile.forEachChild(function walk(node) {
498
+ const isImportOrExport = ts.isImportDeclaration(node) || ts.isExportDeclaration(node);
499
+ if (isImportOrExport && node.moduleSpecifier && ts.isStringLiteralLike(node.moduleSpecifier) && node.moduleSpecifier.text.startsWith(LEGACY_IMPORTS_START)) {
500
+ filesUsingLegacyImports.add(path);
501
+ }
502
+ node.forEachChild(walk);
503
+ });
504
+ });
505
+ if (filesUsingLegacyImports.size === 0) {
506
+ return onSuccess;
507
+ }
508
+ if (tree.exists("package.json")) {
509
+ let packageJson = null;
510
+ try {
511
+ packageJson = JSON.parse(tree.readText("package.json"));
512
+ } catch (e) {
513
+ }
514
+ if (packageJson !== null && packageJson["dependencies"]) {
515
+ packageJson["dependencies"]["@angular/material"] = "^16.2.0";
516
+ tree.overwrite("package.json", JSON.stringify(packageJson, null, 2));
517
+ context.addTask(new tasks_1.NodePackageInstallTask());
518
+ }
519
+ }
520
+ context.logger.fatal(formatErrorMessage(filesUsingLegacyImports));
521
+ return;
522
+ });
523
+ }
524
+ exports.legacyImportsError = legacyImportsError2;
525
+ function formatErrorMessage(filesUsingLegacyImports) {
526
+ const files = Array.from(filesUsingLegacyImports, (path) => " - " + path);
527
+ const filesMessage = files.length > MAX_FILES_TO_PRINT ? [
528
+ ...files.slice(0, MAX_FILES_TO_PRINT),
529
+ `${files.length - MAX_FILES_TO_PRINT} more...`,
530
+ `Search your project for "${LEGACY_IMPORTS_START}" to view all usages.`
531
+ ].join("\n") : files.join("\n");
532
+ return `Cannot update to Angular Material v17 because the project is using the legacy Material components
533
+ that have been deleted. While Angular Material v16 is compatible with Angular v17, it is recommended
534
+ to switch away from the legacy components as soon as possible because they no longer receive bug fixes,
535
+ accessibility improvements and new features.
536
+
537
+ Read more about migrating away from legacy components: https://material.angular.io/guide/mdc-migration
538
+
539
+ Files in the project using legacy Material components:
540
+ ${filesMessage}
541
+ `;
542
+ }
543
+ }
544
+ });
545
+
457
546
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/data/attribute-selectors.js
458
547
  var require_attribute_selectors = __commonJS({
459
548
  "bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/data/attribute-selectors.js"(exports) {
@@ -595,6 +684,310 @@ var require_upgrade_data = __commonJS({
595
684
  }
596
685
  });
597
686
 
687
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/theme-base-v17/migration.js
688
+ var require_migration = __commonJS({
689
+ "bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/theme-base-v17/migration.js"(exports) {
690
+ "use strict";
691
+ Object.defineProperty(exports, "__esModule", { value: true });
692
+ exports.addThemeBaseMixins = exports.checkThemeBaseMixins = void 0;
693
+ var MISSING_MIXIN_PREAMBLE_LINES = `
694
+ // The following mixins include base theme styles that are only needed once per application. These
695
+ // theme styles do not depend on the color, typography, or density settings in your theme. However,
696
+ // these styles may differ depending on the theme's design system. Currently all themes use the
697
+ // Material 2 design system, but in the future it may be possible to create theme based on other
698
+ // design systems, such as Material 3.
699
+ //
700
+ // Please note: you do not need to include the 'base' mixins, if you include the corresponding
701
+ // 'theme' mixin elsewhere in your Sass. The full 'theme' mixins already include the base styles.
702
+ //
703
+ // To learn more about "base" theme styles visit our theming guide:
704
+ // https://material.angular.io/guide/theming#theming-dimensions
705
+ //
706
+ // TODO(v17): Please move these @include statements to the preferred place in your Sass, and pass
707
+ // your theme to them. This will ensure the correct values for your app are included.`.split("\n");
708
+ var THEME_MIXIN_SETS = [
709
+ {
710
+ theme: "all-component-themes",
711
+ color: "all-component-colors",
712
+ typography: "all-component-typographies",
713
+ density: "all-component-densities",
714
+ base: "all-component-bases"
715
+ },
716
+ ...[
717
+ "core",
718
+ "card",
719
+ "progress-bar",
720
+ "tooltip",
721
+ "form-field",
722
+ "input",
723
+ "select",
724
+ "autocomplete",
725
+ "dialog",
726
+ "chips",
727
+ "slide-toggle",
728
+ "radio",
729
+ "slider",
730
+ "menu",
731
+ "list",
732
+ "paginator",
733
+ "tabs",
734
+ "checkbox",
735
+ "button",
736
+ "icon-button",
737
+ "fab",
738
+ "snack-bar",
739
+ "table",
740
+ "progress-spinner",
741
+ "badge",
742
+ "bottom-sheet",
743
+ "button-toggle",
744
+ "datepicker",
745
+ "divider",
746
+ "expansion",
747
+ "grid-list",
748
+ "icon",
749
+ "sidenav",
750
+ "stepper",
751
+ "sort",
752
+ "toolbar",
753
+ "tree"
754
+ ].map((comp) => ({
755
+ theme: `${comp}-theme`,
756
+ color: `${comp}-color`,
757
+ typography: `${comp}-typography`,
758
+ density: `${comp}-density`,
759
+ base: `${comp}-base`
760
+ }))
761
+ ];
762
+ var COMMENT_PAIRS = /* @__PURE__ */ new Map([
763
+ ["/*", "*/"],
764
+ ["//", "\n"]
765
+ ]);
766
+ var COMMENT_PLACEHOLDER_START = "__<<ngThemingMigrationEscapedComment";
767
+ var COMMENT_PLACEHOLDER_END = ">>__";
768
+ function escapeComments(content) {
769
+ const placeholders = {};
770
+ let commentCounter = 0;
771
+ let [openIndex, closeIndex] = findComment(content);
772
+ while (openIndex > -1 && closeIndex > -1) {
773
+ const placeholder = COMMENT_PLACEHOLDER_START + commentCounter++ + COMMENT_PLACEHOLDER_END;
774
+ placeholders[placeholder] = content.slice(openIndex, closeIndex);
775
+ content = content.slice(0, openIndex) + placeholder + content.slice(closeIndex);
776
+ [openIndex, closeIndex] = findComment(content);
777
+ }
778
+ return { content, placeholders };
779
+ }
780
+ function findComment(content) {
781
+ content += "\n";
782
+ for (const [open, close] of COMMENT_PAIRS.entries()) {
783
+ const openIndex = content.indexOf(open);
784
+ if (openIndex > -1) {
785
+ const closeIndex = content.indexOf(close, openIndex + 1);
786
+ return closeIndex > -1 ? [openIndex, closeIndex + close.length] : [-1, -1];
787
+ }
788
+ }
789
+ return [-1, -1];
790
+ }
791
+ function restoreComments(content, placeholders) {
792
+ Object.keys(placeholders).forEach((key) => content = content.replace(key, placeholders[key]));
793
+ return content;
794
+ }
795
+ function escapeRegExp(str) {
796
+ return str.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
797
+ }
798
+ function extractNamespaceFromUseStatement(fullImport) {
799
+ const closeQuoteIndex = Math.max(fullImport.lastIndexOf(`"`), fullImport.lastIndexOf(`'`));
800
+ if (closeQuoteIndex > -1) {
801
+ const asExpression = "as ";
802
+ const asIndex = fullImport.indexOf(asExpression, closeQuoteIndex);
803
+ if (asIndex > -1) {
804
+ return fullImport.slice(asIndex + asExpression.length).split(";")[0].trim();
805
+ }
806
+ const lastSlashIndex = fullImport.lastIndexOf("/", closeQuoteIndex);
807
+ if (lastSlashIndex > -1) {
808
+ const fileName = fullImport.slice(lastSlashIndex + 1, closeQuoteIndex).replace(/^_|(\.import)?\.scss$|\.import$/g, "");
809
+ if (fileName === "index") {
810
+ const nextSlashIndex = fullImport.lastIndexOf("/", lastSlashIndex - 1);
811
+ if (nextSlashIndex > -1) {
812
+ return fullImport.slice(nextSlashIndex + 1, lastSlashIndex);
813
+ }
814
+ } else {
815
+ return fileName;
816
+ }
817
+ }
818
+ }
819
+ throw Error(`Could not extract namespace from import "${fullImport}".`);
820
+ }
821
+ function getAtUseNamespaces(content, path) {
822
+ const namespaces = /* @__PURE__ */ new Set();
823
+ const pattern = new RegExp(`@use +['"]~?${escapeRegExp(path)}['"].*;?
824
+ `, "g");
825
+ let match = null;
826
+ while (match = pattern.exec(content)) {
827
+ namespaces.add(extractNamespaceFromUseStatement(match[0]));
828
+ }
829
+ return namespaces;
830
+ }
831
+ function getAtIncludes(content, namespace, mixin) {
832
+ const ending = "([^\\n\\w-][^\\n]*)?($|\\n)";
833
+ const pattern = new RegExp(`@include\\s+${escapeRegExp(namespace)}\\.${escapeRegExp(mixin)}${ending}`, "g");
834
+ return [...content.matchAll(pattern)];
835
+ }
836
+ function isMixinAtIncluded(content, namespace, mixin) {
837
+ return !!getAtIncludes(content, namespace, mixin).length;
838
+ }
839
+ function insertLinesAfterMatch(content, match, lines) {
840
+ const insertionPoint = match.index + match[0].length;
841
+ return content.substring(0, insertionPoint) + lines.join("\n") + "\n" + content.substring(insertionPoint);
842
+ }
843
+ function getIndentation(content, index) {
844
+ let indentationStart = 0;
845
+ let indentationEnd = index;
846
+ for (let i = index; i >= 0; i--) {
847
+ if (content[i] === "\n") {
848
+ indentationStart = i + 1;
849
+ break;
850
+ }
851
+ if (!/\s/.exec(content[i])) {
852
+ indentationEnd = i;
853
+ }
854
+ }
855
+ return content.slice(indentationStart, indentationEnd);
856
+ }
857
+ function getMissingMixinLines(namespace, mixins, indentation) {
858
+ return [
859
+ ...MISSING_MIXIN_PREAMBLE_LINES,
860
+ ...[...mixins].sort().map((mixin) => `@include ${namespace}.${mixin}(/* TODO(v17): pass $your-theme here */);`),
861
+ ""
862
+ ].map((line) => (indentation + line).trimRight());
863
+ }
864
+ function checkThemeBaseMixins(fileContent) {
865
+ const found = /* @__PURE__ */ new Set();
866
+ const missing = /* @__PURE__ */ new Set();
867
+ const { content } = escapeComments(fileContent);
868
+ const materialNamespaces = getAtUseNamespaces(content, "@angular/material");
869
+ for (const namespace of materialNamespaces) {
870
+ for (const mixins of THEME_MIXIN_SETS) {
871
+ if (isMixinAtIncluded(content, namespace, mixins.theme)) {
872
+ found.add(mixins.base);
873
+ missing.delete(mixins.base);
874
+ continue;
875
+ }
876
+ if (!found.has(mixins.base)) {
877
+ if (isMixinAtIncluded(content, namespace, mixins.color) || isMixinAtIncluded(content, namespace, mixins.typography) || isMixinAtIncluded(content, namespace, mixins.density)) {
878
+ missing.add(mixins.base);
879
+ }
880
+ }
881
+ }
882
+ }
883
+ return { found, missing };
884
+ }
885
+ exports.checkThemeBaseMixins = checkThemeBaseMixins;
886
+ function addThemeBaseMixins(fileContent, mixins) {
887
+ let { content, placeholders } = escapeComments(fileContent);
888
+ const materialNamespaces = getAtUseNamespaces(content, "@angular/material");
889
+ for (const namespace of materialNamespaces) {
890
+ const coreIncludes = getAtIncludes(content, namespace, "core").reverse();
891
+ for (const coreInclude of coreIncludes) {
892
+ if (coreInclude.index === void 0) {
893
+ throw Error(`Cannot find location of mat.core() match: ${coreInclude}`);
894
+ }
895
+ const indentation = getIndentation(content, coreInclude.index);
896
+ const lines = getMissingMixinLines(namespace, mixins, indentation);
897
+ content = insertLinesAfterMatch(content, coreInclude, lines);
898
+ }
899
+ }
900
+ return restoreComments(content, placeholders);
901
+ }
902
+ exports.addThemeBaseMixins = addThemeBaseMixins;
903
+ }
904
+ });
905
+
906
+ // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/theme-base-v17/index.js
907
+ var require_theme_base_v17 = __commonJS({
908
+ "bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/migrations/theme-base-v17/index.js"(exports) {
909
+ "use strict";
910
+ Object.defineProperty(exports, "__esModule", { value: true });
911
+ exports.ThemeBaseMigration = void 0;
912
+ var core_1 = require("@angular-devkit/core");
913
+ var schematics_1 = require("@angular/cdk/schematics");
914
+ var migration_1 = require_migration();
915
+ var _ThemeBaseMigration = class extends schematics_1.DevkitMigration {
916
+ constructor() {
917
+ super(...arguments);
918
+ this.enabled = this.targetVersion === schematics_1.TargetVersion.V17;
919
+ this.visitedSassStylesheets = [];
920
+ }
921
+ visitStylesheet(stylesheet) {
922
+ if ((0, core_1.extname)(stylesheet.filePath) === ".scss") {
923
+ this.visitedSassStylesheets.push(stylesheet);
924
+ const content = stylesheet.content;
925
+ const { found, missing } = (0, migration_1.checkThemeBaseMixins)(content);
926
+ for (const mixin of found) {
927
+ _ThemeBaseMigration.foundBaseMixins.add(mixin);
928
+ _ThemeBaseMigration.missingBaseMixins.delete(mixin);
929
+ }
930
+ for (const mixin of missing) {
931
+ if (!_ThemeBaseMigration.foundBaseMixins.has(mixin)) {
932
+ _ThemeBaseMigration.missingBaseMixins.add(mixin);
933
+ }
934
+ }
935
+ }
936
+ }
937
+ postAnalysis() {
938
+ if (_ThemeBaseMigration.missingBaseMixins.size === 0) {
939
+ return;
940
+ }
941
+ if (_ThemeBaseMigration.foundBaseMixins.has("all-component-bases")) {
942
+ return;
943
+ }
944
+ if (_ThemeBaseMigration.missingBaseMixins.has("all-component-bases")) {
945
+ _ThemeBaseMigration.missingBaseMixins = /* @__PURE__ */ new Set(["all-component-bases"]);
946
+ }
947
+ for (const stylesheet of this.visitedSassStylesheets) {
948
+ const content = stylesheet.content;
949
+ const migratedContent = content ? (0, migration_1.addThemeBaseMixins)(content, _ThemeBaseMigration.missingBaseMixins) : content;
950
+ if (migratedContent && migratedContent !== content) {
951
+ this.fileSystem.edit(stylesheet.filePath).remove(0, stylesheet.content.length).insertLeft(0, migratedContent);
952
+ _ThemeBaseMigration.migratedFileCount++;
953
+ }
954
+ }
955
+ if (_ThemeBaseMigration.migratedFileCount === 0) {
956
+ const mixinsText = [..._ThemeBaseMigration.missingBaseMixins].sort().map((m) => `mat.${m}($theme)`).join("\n");
957
+ this.failures.push({
958
+ filePath: this.context.tree.root.path,
959
+ message: `The following mixins could not be automatically added, please add them manually if needed:
960
+ ${mixinsText}`
961
+ });
962
+ }
963
+ }
964
+ static globalPostMigration(_tree, _targetVersion, context) {
965
+ const fileCount = _ThemeBaseMigration.migratedFileCount;
966
+ const mixinCount = _ThemeBaseMigration.missingBaseMixins.size;
967
+ if (fileCount > 0 && mixinCount > 0) {
968
+ const fileCountText = fileCount === 1 ? "1 file" : `${fileCount} files`;
969
+ const mixinCountText = mixinCount === 1 ? "1 theme base mixin" : `${mixinCount} theme base mixins`;
970
+ context.logger.info(`Added ${mixinCountText} to ${fileCountText}. Please search for, and address, any "TODO(v17)" comments.`);
971
+ }
972
+ _ThemeBaseMigration.migratedFileCount = 0;
973
+ _ThemeBaseMigration.missingBaseMixins = /* @__PURE__ */ new Set();
974
+ _ThemeBaseMigration.foundBaseMixins = /* @__PURE__ */ new Set();
975
+ }
976
+ };
977
+ var ThemeBaseMigration2 = _ThemeBaseMigration;
978
+ (() => {
979
+ _ThemeBaseMigration.migratedFileCount = 0;
980
+ })();
981
+ (() => {
982
+ _ThemeBaseMigration.foundBaseMixins = /* @__PURE__ */ new Set();
983
+ })();
984
+ (() => {
985
+ _ThemeBaseMigration.missingBaseMixins = /* @__PURE__ */ new Set();
986
+ })();
987
+ exports.ThemeBaseMigration = ThemeBaseMigration2;
988
+ }
989
+ });
990
+
598
991
  // bazel-out/k8-fastbuild/bin/src/material/schematics/ng-update/index.mjs
599
992
  var ng_update_exports = {};
600
993
  __export(ng_update_exports, {
@@ -602,10 +995,12 @@ __export(ng_update_exports, {
602
995
  });
603
996
  module.exports = __toCommonJS(ng_update_exports);
604
997
  var import_schematics = require("@angular/cdk/schematics");
998
+ var import_legacy_imports_error = __toESM(require_legacy_imports_error(), 1);
605
999
  var import_upgrade_data = __toESM(require_upgrade_data(), 1);
606
- var materialMigrations = [];
1000
+ var import_theme_base_v17 = __toESM(require_theme_base_v17(), 1);
1001
+ var materialMigrations = [import_theme_base_v17.ThemeBaseMigration];
607
1002
  function updateToV17() {
608
- return (0, import_schematics.createMigrationSchematicRule)(import_schematics.TargetVersion.V17, materialMigrations, import_upgrade_data.materialUpgradeData, onMigrationComplete);
1003
+ return (0, import_legacy_imports_error.legacyImportsError)((0, import_schematics.createMigrationSchematicRule)(import_schematics.TargetVersion.V17, materialMigrations, import_upgrade_data.materialUpgradeData, onMigrationComplete));
609
1004
  }
610
1005
  function onMigrationComplete(context, targetVersion, hasFailures) {
611
1006
  context.logger.info("");