@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.
Files changed (113) hide show
  1. package/badge/_badge-theme.scss +84 -118
  2. package/bottom-sheet/_bottom-sheet-theme.scss +10 -11
  3. package/bottom-sheet/index.d.ts +6 -0
  4. package/button-toggle/_button-toggle-theme.scss +20 -97
  5. package/button-toggle/_button-toggle-variables.scss +2 -0
  6. package/chips/index.d.ts +11 -4
  7. package/core/index.d.ts +1 -0
  8. package/core/selection/pseudo-checkbox/_pseudo-checkbox-common.scss +1 -1
  9. package/core/tokens/_token-utils.scss +1 -0
  10. package/core/tokens/m2/mat/_badge.scss +78 -0
  11. package/core/tokens/m2/mat/_bottom-sheet.scss +56 -0
  12. package/core/tokens/m2/mat/_datepicker.scss +184 -0
  13. package/core/tokens/m2/mat/_divider.scss +45 -0
  14. package/core/tokens/m2/mat/_form-field.scss +44 -0
  15. package/core/tokens/m2/mat/_grid-list.scss +46 -0
  16. package/core/tokens/m2/mat/_icon.scss +45 -0
  17. package/core/tokens/m2/mat/_legacy-button-toggle.scss +63 -0
  18. package/core/tokens/m2/mat/_sidenav.scss +65 -0
  19. package/core/tokens/m2/mat/_slide-toggle.scss +1 -1
  20. package/core/tokens/m2/mat/_standard-button-toggle.scss +87 -0
  21. package/core/tokens/m2/mat/_tab-header.scss +1 -1
  22. package/core/tokens/m2/mat/_toolbar.scss +79 -0
  23. package/core/tokens/m2/mdc/_circular-progress.scss +1 -1
  24. package/core/tokens/m2/mdc/_filled-text-field.scss +175 -0
  25. package/core/tokens/m2/mdc/_outlined-text-field.scss +158 -0
  26. package/core/tokens/m2/mdc/_plain-tooltip.scss +2 -2
  27. package/datepicker/_datepicker-theme.scss +44 -203
  28. package/dialog/index.d.ts +6 -0
  29. package/divider/_divider-theme.scss +6 -8
  30. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  31. package/esm2022/bottom-sheet/bottom-sheet-ref.mjs +8 -1
  32. package/esm2022/button-toggle/button-toggle.mjs +2 -2
  33. package/esm2022/chips/chip-option.mjs +4 -5
  34. package/esm2022/chips/chip-row.mjs +15 -10
  35. package/esm2022/chips/chip.mjs +29 -12
  36. package/esm2022/core/private/ripple-loader.mjs +4 -1
  37. package/esm2022/core/version.mjs +1 -1
  38. package/esm2022/datepicker/calendar-body.mjs +2 -2
  39. package/esm2022/datepicker/calendar.mjs +2 -2
  40. package/esm2022/datepicker/date-range-input.mjs +2 -2
  41. package/esm2022/datepicker/datepicker-base.mjs +3 -3
  42. package/esm2022/datepicker/datepicker-toggle.mjs +2 -2
  43. package/esm2022/dialog/dialog-ref.mjs +1 -1
  44. package/esm2022/dialog/dialog.mjs +2 -1
  45. package/esm2022/divider/divider.mjs +2 -2
  46. package/esm2022/form-field/form-field.mjs +3 -3
  47. package/esm2022/grid-list/grid-list.mjs +2 -2
  48. package/esm2022/grid-list/grid-tile.mjs +2 -2
  49. package/esm2022/icon/icon.mjs +2 -2
  50. package/esm2022/menu/menu-item.mjs +4 -4
  51. package/esm2022/menu/menu.mjs +3 -3
  52. package/esm2022/radio/radio.mjs +13 -1
  53. package/esm2022/sidenav/drawer.mjs +3 -3
  54. package/esm2022/sidenav/sidenav.mjs +3 -3
  55. package/esm2022/slide-toggle/slide-toggle.mjs +2 -2
  56. package/esm2022/tabs/ink-bar.mjs +1 -1
  57. package/esm2022/tabs/tab-group.mjs +2 -2
  58. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  59. package/esm2022/toolbar/toolbar.mjs +2 -2
  60. package/fesm2022/bottom-sheet.mjs +9 -2
  61. package/fesm2022/bottom-sheet.mjs.map +1 -1
  62. package/fesm2022/button-toggle.mjs +2 -2
  63. package/fesm2022/button-toggle.mjs.map +1 -1
  64. package/fesm2022/chips.mjs +41 -17
  65. package/fesm2022/chips.mjs.map +1 -1
  66. package/fesm2022/core.mjs +4 -1
  67. package/fesm2022/core.mjs.map +1 -1
  68. package/fesm2022/datepicker.mjs +10 -10
  69. package/fesm2022/datepicker.mjs.map +1 -1
  70. package/fesm2022/dialog.mjs +1 -0
  71. package/fesm2022/dialog.mjs.map +1 -1
  72. package/fesm2022/divider.mjs +2 -2
  73. package/fesm2022/divider.mjs.map +1 -1
  74. package/fesm2022/form-field.mjs +2 -2
  75. package/fesm2022/form-field.mjs.map +1 -1
  76. package/fesm2022/grid-list.mjs +4 -4
  77. package/fesm2022/grid-list.mjs.map +1 -1
  78. package/fesm2022/icon.mjs +2 -2
  79. package/fesm2022/icon.mjs.map +1 -1
  80. package/fesm2022/menu.mjs +5 -5
  81. package/fesm2022/menu.mjs.map +1 -1
  82. package/fesm2022/radio.mjs +12 -0
  83. package/fesm2022/radio.mjs.map +1 -1
  84. package/fesm2022/sidenav.mjs +4 -4
  85. package/fesm2022/sidenav.mjs.map +1 -1
  86. package/fesm2022/slide-toggle.mjs +2 -2
  87. package/fesm2022/slide-toggle.mjs.map +1 -1
  88. package/fesm2022/tabs.mjs +4 -4
  89. package/fesm2022/tabs.mjs.map +1 -1
  90. package/fesm2022/toolbar.mjs +2 -2
  91. package/fesm2022/toolbar.mjs.map +1 -1
  92. package/form-field/_form-field-theme.scss +37 -44
  93. package/form-field/_mdc-text-field-structure-overrides.scss +18 -0
  94. package/grid-list/_grid-list-theme.scss +7 -6
  95. package/icon/_icon-theme.scss +18 -8
  96. package/legacy-prebuilt-themes/legacy-deeppurple-amber.css +1 -1
  97. package/legacy-prebuilt-themes/legacy-indigo-pink.css +1 -1
  98. package/legacy-prebuilt-themes/legacy-pink-bluegrey.css +1 -1
  99. package/legacy-prebuilt-themes/legacy-purple-green.css +1 -1
  100. package/package.json +49 -49
  101. package/prebuilt-themes/deeppurple-amber.css +1 -1
  102. package/prebuilt-themes/indigo-pink.css +1 -1
  103. package/prebuilt-themes/pink-bluegrey.css +1 -1
  104. package/prebuilt-themes/purple-green.css +1 -1
  105. package/radio/index.d.ts +4 -1
  106. package/schematics/ng-add/index.js +1 -1
  107. package/schematics/ng-add/index.mjs +1 -1
  108. package/schematics/ng-generate/mdc-migration/index_bundled.js +44 -44
  109. package/schematics/ng-update/index_bundled.js +25 -25
  110. package/sidenav/_sidenav-theme.scss +6 -69
  111. package/tabs/_tabs-common.scss +1 -1
  112. package/tabs/index.d.ts +1 -1
  113. package/toolbar/_toolbar-theme.scss +25 -71
@@ -53,7 +53,7 @@ class MatToolbar extends _MatToolbarBase {
53
53
  }
54
54
  }
55
55
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatToolbar, deps: [{ token: i0.ElementRef }, { token: i1.Platform }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
56
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: MatToolbar, selector: "mat-toolbar", inputs: { color: "color" }, host: { properties: { "class.mat-toolbar-multiple-rows": "_toolbarRows.length > 0", "class.mat-toolbar-single-row": "_toolbarRows.length === 0" }, classAttribute: "mat-toolbar" }, queries: [{ propertyName: "_toolbarRows", predicate: MatToolbarRow, descendants: true }], exportAs: ["matToolbar"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar .mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color: inherit;--mdc-outlined-button-label-text-color: inherit}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
56
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.1", type: MatToolbar, selector: "mat-toolbar", inputs: { color: "color" }, host: { properties: { "class.mat-toolbar-multiple-rows": "_toolbarRows.length > 0", "class.mat-toolbar-single-row": "_toolbarRows.length === 0" }, classAttribute: "mat-toolbar" }, queries: [{ propertyName: "_toolbarRows", predicate: MatToolbarRow, descendants: true }], exportAs: ["matToolbar"], usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".mat-toolbar{background:var(--mat-toolbar-container-background-color);color:var(--mat-toolbar-container-text-color)}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font);font-size:var(--mat-toolbar-title-text-size);line-height:var(--mat-toolbar-title-text-line-height);font-weight:var(--mat-toolbar-title-text-weight);letter-spacing:var(--mat-toolbar-title-text-tracking);margin:0}.cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color: inherit;--mdc-outlined-button-label-text-color: inherit}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height)}}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
57
57
  }
58
58
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatToolbar, decorators: [{
59
59
  type: Component,
@@ -61,7 +61,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImpor
61
61
  'class': 'mat-toolbar',
62
62
  '[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',
63
63
  '[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',
64
- }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar .mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color: inherit;--mdc-outlined-button-label-text-color: inherit}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%}"] }]
64
+ }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n", styles: [".mat-toolbar{background:var(--mat-toolbar-container-background-color);color:var(--mat-toolbar-container-text-color)}.mat-toolbar,.mat-toolbar h1,.mat-toolbar h2,.mat-toolbar h3,.mat-toolbar h4,.mat-toolbar h5,.mat-toolbar h6{font-family:var(--mat-toolbar-title-text-font);font-size:var(--mat-toolbar-title-text-size);line-height:var(--mat-toolbar-title-text-line-height);font-weight:var(--mat-toolbar-title-text-weight);letter-spacing:var(--mat-toolbar-title-text-tracking);margin:0}.cdk-high-contrast-active .mat-toolbar{outline:solid 1px}.mat-toolbar .mat-form-field-underline,.mat-toolbar .mat-form-field-ripple,.mat-toolbar .mat-focused .mat-form-field-ripple{background-color:currentColor}.mat-toolbar .mat-form-field-label,.mat-toolbar .mat-focused .mat-form-field-label,.mat-toolbar .mat-select-value,.mat-toolbar .mat-select-arrow,.mat-toolbar .mat-form-field.mat-focused .mat-select-arrow{color:inherit}.mat-toolbar .mat-input-element{caret-color:currentColor}.mat-toolbar .mat-mdc-button-base.mat-unthemed{--mdc-text-button-label-text-color: inherit;--mdc-outlined-button-label-text-color: inherit}.mat-toolbar-row,.mat-toolbar-single-row{display:flex;box-sizing:border-box;padding:0 16px;width:100%;flex-direction:row;align-items:center;white-space:nowrap;height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-row,.mat-toolbar-single-row{height:var(--mat-toolbar-mobile-height)}}.mat-toolbar-multiple-rows{display:flex;box-sizing:border-box;flex-direction:column;width:100%;min-height:var(--mat-toolbar-standard-height)}@media(max-width: 599px){.mat-toolbar-multiple-rows{min-height:var(--mat-toolbar-mobile-height)}}"] }]
65
65
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.Platform }, { type: undefined, decorators: [{
66
66
  type: Inject,
67
67
  args: [DOCUMENT]
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar.mjs","sources":["../../../../../../src/material/toolbar/toolbar.ts","../../../../../../src/material/toolbar/toolbar.html","../../../../../../src/material/toolbar/toolbar-module.ts","../../../../../../src/material/toolbar/toolbar_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Inject,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, mixinColor} from '@angular/material/core';\n\n// Boilerplate for applying mixins to MatToolbar.\n/** @docs-private */\nconst _MatToolbarBase = mixinColor(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n);\n\n@Directive({\n selector: 'mat-toolbar-row',\n exportAs: 'matToolbarRow',\n host: {'class': 'mat-toolbar-row'},\n})\nexport class MatToolbarRow {}\n\n@Component({\n selector: 'mat-toolbar',\n exportAs: 'matToolbar',\n templateUrl: 'toolbar.html',\n styleUrls: ['toolbar.css'],\n inputs: ['color'],\n host: {\n 'class': 'mat-toolbar',\n '[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',\n '[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatToolbar extends _MatToolbarBase implements CanColor, AfterViewInit {\n private _document: Document;\n\n /** Reference to all toolbar row elements that have been projected. */\n @ContentChildren(MatToolbarRow, {descendants: true}) _toolbarRows: QueryList<MatToolbarRow>;\n\n constructor(\n elementRef: ElementRef,\n private _platform: Platform,\n @Inject(DOCUMENT) document?: any,\n ) {\n super(elementRef);\n\n // TODO: make the document a required param when doing breaking changes.\n this._document = document;\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n this._checkToolbarMixedModes();\n this._toolbarRows.changes.subscribe(() => this._checkToolbarMixedModes());\n }\n }\n\n /**\n * Throws an exception when developers are attempting to combine the different toolbar row modes.\n */\n private _checkToolbarMixedModes() {\n if (this._toolbarRows.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n // Check if there are any other DOM nodes that can display content but aren't inside of\n // a <mat-toolbar-row> element.\n const isCombinedUsage = Array.from<HTMLElement>(this._elementRef.nativeElement.childNodes)\n .filter(node => !(node.classList && node.classList.contains('mat-toolbar-row')))\n .filter(node => node.nodeType !== (this._document ? this._document.COMMENT_NODE : 8))\n .some(node => !!(node.textContent && node.textContent.trim()));\n\n if (isCombinedUsage) {\n throwToolbarMixedModesError();\n }\n }\n }\n}\n\n/**\n * Throws an exception when attempting to combine the different toolbar row modes.\n * @docs-private\n */\nexport function throwToolbarMixedModesError() {\n throw Error(\n 'MatToolbar: Attempting to combine different toolbar modes. ' +\n 'Either specify multiple `<mat-toolbar-row>` elements explicitly or just place content ' +\n 'inside of a `<mat-toolbar>` for a single row.',\n );\n}\n","<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatToolbar, MatToolbarRow} from './toolbar';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatToolbar, MatToolbarRow, MatCommonModule],\n declarations: [MatToolbar, MatToolbarRow],\n})\nexport class MatToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAuBA;AACA;AACA,MAAM,eAAe,GAAG,UAAU,CAChC,MAAA;AACE,IAAA,WAAA,CAAmB,WAAuB,EAAA;QAAvB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;KAAI;AAC/C,CAAA,CACF,CAAC;MAOW,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAb,aAAa,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,iBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAA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AAA,QAAA,EAAA,mFAAA,EAAA,MAAA,EAAA,CAAA,ocAAA,CAAA,EAAA,CAAA;;0BAWlC,MAAM;2BAAC,QAAQ,CAAA;4CALmC,YAAY,EAAA,CAAA;sBAAhE,eAAe;AAAC,gBAAA,IAAA,EAAA,CAAA,aAAa,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAA;;AAuCrD;;;AAGG;SACa,2BAA2B,GAAA;IACzC,MAAM,KAAK,CACT,6DAA6D;QAC3D,wFAAwF;AACxF,QAAA,+CAA+C,CAClD,CAAC;AACJ;;MExFa,gBAAgB,CAAA;8GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;+GAAhB,gBAAgB,EAAA,YAAA,EAAA,CAFZ,UAAU,EAAE,aAAa,CAAA,EAAA,OAAA,EAAA,CAF9B,eAAe,CAAA,EAAA,OAAA,EAAA,CACf,UAAU,EAAE,aAAa,EAAE,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGzC,gBAAgB,EAAA,OAAA,EAAA,CAJjB,eAAe,EACY,eAAe,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAGzC,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;AAC1B,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,CAAC;AACrD,oBAAA,YAAY,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;AAC1C,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
1
+ {"version":3,"file":"toolbar.mjs","sources":["../../../../../../src/material/toolbar/toolbar.ts","../../../../../../src/material/toolbar/toolbar.html","../../../../../../src/material/toolbar/toolbar-module.ts","../../../../../../src/material/toolbar/toolbar_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Platform} from '@angular/cdk/platform';\nimport {DOCUMENT} from '@angular/common';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n Inject,\n QueryList,\n ViewEncapsulation,\n} from '@angular/core';\nimport {CanColor, mixinColor} from '@angular/material/core';\n\n// Boilerplate for applying mixins to MatToolbar.\n/** @docs-private */\nconst _MatToolbarBase = mixinColor(\n class {\n constructor(public _elementRef: ElementRef) {}\n },\n);\n\n@Directive({\n selector: 'mat-toolbar-row',\n exportAs: 'matToolbarRow',\n host: {'class': 'mat-toolbar-row'},\n})\nexport class MatToolbarRow {}\n\n@Component({\n selector: 'mat-toolbar',\n exportAs: 'matToolbar',\n templateUrl: 'toolbar.html',\n styleUrls: ['toolbar.css'],\n inputs: ['color'],\n host: {\n 'class': 'mat-toolbar',\n '[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',\n '[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class MatToolbar extends _MatToolbarBase implements CanColor, AfterViewInit {\n private _document: Document;\n\n /** Reference to all toolbar row elements that have been projected. */\n @ContentChildren(MatToolbarRow, {descendants: true}) _toolbarRows: QueryList<MatToolbarRow>;\n\n constructor(\n elementRef: ElementRef,\n private _platform: Platform,\n @Inject(DOCUMENT) document?: any,\n ) {\n super(elementRef);\n\n // TODO: make the document a required param when doing breaking changes.\n this._document = document;\n }\n\n ngAfterViewInit() {\n if (this._platform.isBrowser) {\n this._checkToolbarMixedModes();\n this._toolbarRows.changes.subscribe(() => this._checkToolbarMixedModes());\n }\n }\n\n /**\n * Throws an exception when developers are attempting to combine the different toolbar row modes.\n */\n private _checkToolbarMixedModes() {\n if (this._toolbarRows.length && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n // Check if there are any other DOM nodes that can display content but aren't inside of\n // a <mat-toolbar-row> element.\n const isCombinedUsage = Array.from<HTMLElement>(this._elementRef.nativeElement.childNodes)\n .filter(node => !(node.classList && node.classList.contains('mat-toolbar-row')))\n .filter(node => node.nodeType !== (this._document ? this._document.COMMENT_NODE : 8))\n .some(node => !!(node.textContent && node.textContent.trim()));\n\n if (isCombinedUsage) {\n throwToolbarMixedModesError();\n }\n }\n }\n}\n\n/**\n * Throws an exception when attempting to combine the different toolbar row modes.\n * @docs-private\n */\nexport function throwToolbarMixedModesError() {\n throw Error(\n 'MatToolbar: Attempting to combine different toolbar modes. ' +\n 'Either specify multiple `<mat-toolbar-row>` elements explicitly or just place content ' +\n 'inside of a `<mat-toolbar>` for a single row.',\n );\n}\n","<ng-content></ng-content>\n<ng-content select=\"mat-toolbar-row\"></ng-content>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatToolbar, MatToolbarRow} from './toolbar';\n\n@NgModule({\n imports: [MatCommonModule],\n exports: [MatToolbar, MatToolbarRow, MatCommonModule],\n declarations: [MatToolbar, MatToolbarRow],\n})\nexport class MatToolbarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAuBA;AACA;AACA,MAAM,eAAe,GAAG,UAAU,CAChC,MAAA;AACE,IAAA,WAAA,CAAmB,WAAuB,EAAA;QAAvB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;KAAI;AAC/C,CAAA,CACF,CAAC;MAOW,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAb,aAAa,EAAA,QAAA,EAAA,iBAAA,EAAA,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aAAa,EAAE,eAAe,CAAC;AACrD,oBAAA,YAAY,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;AAC1C,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
@@ -1,63 +1,51 @@
1
- @use '@material/textfield' as mdc-textfield;
2
- @use '@material/floating-label' as mdc-floating-label;
3
- @use '@material/notched-outline' as mdc-notched-outline;
4
- @use '@material/line-ripple' as mdc-line-ripple;
5
- @use '@material/theme/theme-color' as mdc-theme-color;
1
+ @use '@material/textfield/filled-text-field-theme' as mdc-filled-text-field-theme;
2
+ @use '@material/textfield/outlined-text-field-theme' as mdc-outlined-text-field-theme;
6
3
  @use '@material/typography/typography' as mdc-typography;
7
4
 
5
+ @use '../core/tokens/m2/mdc/filled-text-field' as tokens-mdc-filled-text-field;
6
+ @use '../core/tokens/m2/mdc/outlined-text-field' as tokens-mdc-outlined-text-field;
7
+ @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field;
8
8
  @use '../core/theming/theming';
9
9
  @use '../core/typography/typography';
10
10
  @use '../core/mdc-helpers/mdc-helpers';
11
+ @use '../core/style/sass-utils';
12
+ @use '../core/tokens/token-utils';
11
13
  @use './form-field-density';
12
14
  @use './form-field-subscript';
13
15
  @use './form-field-focus-overlay';
14
16
  @use './form-field-native-select';
15
17
  @use './mdc-text-field-theme-variable-refresh';
16
18
 
19
+ @mixin color($config-or-theme) {
20
+ $config: theming.get-color-config($config-or-theme);
17
21
 
18
- // Mixin that overwrites the default MDC text-field color styles to be based on
19
- // the given theme palette. The MDC text-field is styled using `primary` by default.
20
- @mixin _color-styles($palette-name,
21
- $query: mdc-helpers.$mdc-theme-styles-query) {
22
- $orig-focused-label-color: mdc-textfield.$focused-label-color;
23
- mdc-textfield.$focused-label-color: rgba(mdc-theme-color.prop-value($palette-name), 0.87);
24
-
25
- @include mdc-textfield.caret-color($palette-name, $query);
26
- @include mdc-textfield.line-ripple-color($palette-name, $query);
27
-
28
- .mdc-text-field--focused {
29
- @include mdc-textfield.focused_($query);
30
- }
31
-
32
- .mdc-text-field--invalid {
33
- @include mdc-textfield.invalid_($query);
34
- }
35
-
36
- .mdc-text-field--outlined {
37
- @include mdc-textfield.focused-outline-color($palette-name, $query);
22
+ @include sass-utils.current-selector-or-root() {
23
+ @include mdc-filled-text-field-theme.theme(
24
+ tokens-mdc-filled-text-field.get-color-tokens($config));
25
+ @include mdc-outlined-text-field-theme.theme(
26
+ tokens-mdc-outlined-text-field.get-color-tokens($config));
27
+ @include token-utils.create-token-values(tokens-mat-form-field.$prefix,
28
+ tokens-mat-form-field.get-color-tokens($config));
38
29
  }
39
30
 
40
- mdc-textfield.$focused-label-color: $orig-focused-label-color;
41
- }
42
-
43
- @mixin color($config-or-theme) {
44
- $config: theming.get-color-config($config-or-theme);
45
31
  @include mdc-helpers.using-mdc-theme($config) {
46
32
  @include mdc-text-field-theme-variable-refresh.private-text-field-refresh-theme-variables() {
47
- @include mdc-textfield.without-ripple($query: mdc-helpers.$mdc-theme-styles-query);
48
- @include mdc-floating-label.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
49
- @include mdc-notched-outline.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
50
- @include mdc-line-ripple.core-styles($query: mdc-helpers.$mdc-theme-styles-query);
51
33
  @include form-field-subscript.private-form-field-subscript-color();
52
34
  @include form-field-focus-overlay.private-form-field-focus-overlay-color();
53
35
  @include form-field-native-select.private-form-field-native-select-color($config);
54
36
 
55
37
  .mat-mdc-form-field.mat-accent {
56
- @include _color-styles(secondary);
38
+ @include mdc-filled-text-field-theme.theme(
39
+ tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($config, accent));
40
+ @include mdc-outlined-text-field-theme.theme(
41
+ tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($config, accent));
57
42
  }
58
43
 
59
44
  .mat-mdc-form-field.mat-warn {
60
- @include _color-styles(error);
45
+ @include mdc-filled-text-field-theme.theme(
46
+ tokens-mdc-filled-text-field.private-get-color-palette-color-tokens($config, warn));
47
+ @include mdc-outlined-text-field-theme.theme(
48
+ tokens-mdc-outlined-text-field.private-get-color-palette-color-tokens($config, warn));
61
49
  }
62
50
 
63
51
  // This fixes an issue where the notch appears to be thicker than the rest of the outline when
@@ -68,15 +56,16 @@
68
56
  // Note: class name is repeated to achieve sufficient specificity over the various MDC states.
69
57
  // (hover, focus, etc.)
70
58
  // TODO(mmalerba): port this fix into MDC
59
+ // TODO(crisbeto): move this into the structural styles
71
60
  .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field {
72
- &.mat-mdc-form-field .mdc-notched-outline__notch {
61
+ &.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch {
73
62
  border-left: 1px solid transparent;
74
63
  }
75
64
  }
76
65
 
77
66
  [dir='rtl'] {
78
67
  .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field {
79
- &.mat-mdc-form-field .mdc-notched-outline__notch {
68
+ &.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch {
80
69
  border-left: none;
81
70
  border-right: 1px solid transparent;
82
71
  }
@@ -89,21 +78,25 @@
89
78
  @mixin typography($config-or-theme) {
90
79
  $config: typography.private-typography-to-2018-config(
91
80
  theming.get-typography-config($config-or-theme));
81
+
82
+ @include sass-utils.current-selector-or-root() {
83
+ @include mdc-filled-text-field-theme.theme(
84
+ tokens-mdc-filled-text-field.get-typography-tokens($config));
85
+ @include mdc-outlined-text-field-theme.theme(
86
+ tokens-mdc-outlined-text-field.get-typography-tokens($config));
87
+ }
88
+
92
89
  @include mdc-helpers.using-mdc-typography($config) {
93
- @include mdc-textfield.without-ripple($query: mdc-helpers.$mdc-typography-styles-query);
94
- @include mdc-floating-label.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
95
- @include mdc-notched-outline.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
96
- @include mdc-line-ripple.core-styles($query: mdc-helpers.$mdc-typography-styles-query);
97
90
  @include form-field-subscript.private-form-field-subscript-typography($config);
98
91
 
99
92
  // MDC uses `subtitle1` for the input value, placeholder and floating label. The spec
100
93
  // shows `body1` for text fields though, so we manually override the typography.
101
94
  // Note: Form controls inherit the typography from the parent form field.
102
- .mat-mdc-form-field,
103
- .mat-mdc-floating-label {
95
+ .mat-mdc-form-field {
104
96
  @include mdc-typography.typography(body1, $query: mdc-helpers.$mdc-typography-styles-query);
105
97
  }
106
98
 
99
+ // TODO(crisbeto): we may be able to set this style with the `label-text-populated-size` token.
107
100
  // Above, we updated the floating label to use the `body1` typography level. The MDC notched
108
101
  // outline overrides this accidentally (only when the label floats) to a `rem`-based value.
109
102
  // This results in different label widths when floated/docked and ultimately breaks the notch
@@ -1,4 +1,8 @@
1
1
  @use '@material/textfield/variables' as mdc-textfield-variables;
2
+ @use '@material/typography/typography' as mdc-typography;
3
+ @use '../core/tokens/m2/mat/form-field' as tokens-mat-form-field;
4
+ @use '../core/tokens/token-utils';
5
+ @use '../core/style/vendor-prefixes';
2
6
 
3
7
  // Mixin that can be included to override the default MDC text-field
4
8
  // styles to fit our needs. See individual comments for context on why
@@ -13,6 +17,7 @@
13
17
  // Note: We increase specificity here because the MDC textfield seems to override this,
14
18
  // depending on the CSS order, with an affix selector joint with the input.
15
19
  .mat-mdc-form-field-input-control.mat-mdc-form-field-input-control {
20
+ @include mdc-typography.smooth-font();
16
21
  font: inherit;
17
22
  letter-spacing: inherit;
18
23
  text-decoration: inherit;
@@ -21,6 +26,8 @@
21
26
  }
22
27
 
23
28
  .mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label {
29
+ @include mdc-typography.smooth-font();
30
+
24
31
  // In order to ensure proper alignment of the floating label, we reset its line-height.
25
32
  // The line-height is not important as the element is absolutely positioned and only has one
26
33
  // line of text.
@@ -86,6 +93,17 @@
86
93
  }
87
94
  }
88
95
 
96
+ // Before the switch to the tokens MDC was setting a specific placeholder color when the input
97
+ // is disabled, but now there's no token for it so we need to implement it ourselves.
98
+ .mat-form-field-disabled .mdc-text-field__input {
99
+ @include vendor-prefixes.input-placeholder {
100
+ @include token-utils.use-tokens(
101
+ tokens-mat-form-field.$prefix, tokens-mat-form-field.get-token-slots()) {
102
+ @include token-utils.create-token-slot(color, disabled-input-text-placeholder-color);
103
+ }
104
+ }
105
+ }
106
+
89
107
  // The default MDC text-field implementation does not support labels which always float.
90
108
  // MDC only renders the placeholder if the input is focused. We extend this to show the
91
109
  // placeholder if the form-field label is set to always float.
@@ -1,7 +1,8 @@
1
1
  @use '../core/theming/theming';
2
2
  @use '../core/typography/typography';
3
- @use '../core/typography/typography-utils';
4
- @use '../core/style/list-common';
3
+ @use '../core/tokens/m2/mat/grid-list' as tokens-mat-grid-list;
4
+ @use '../core/style/sass-utils';
5
+ @use '../core/tokens/token-utils';
5
6
 
6
7
 
7
8
  // Include this empty mixin for consistency with the other components.
@@ -10,10 +11,10 @@
10
11
  @mixin typography($config-or-theme) {
11
12
  $config: typography.private-typography-to-2014-config(
12
13
  theming.get-typography-config($config-or-theme));
13
- .mat-grid-tile-header,
14
- .mat-grid-tile-footer {
15
- @include list-common.base(typography-utils.font-size($config, caption));
16
- font-size: typography-utils.font-size($config, body-1);
14
+
15
+ @include sass-utils.current-selector-or-root() {
16
+ @include token-utils.create-token-values(tokens-mat-grid-list.$prefix,
17
+ tokens-mat-grid-list.get-typography-tokens($config));
17
18
  }
18
19
  }
19
20
 
@@ -1,25 +1,35 @@
1
1
  @use 'sass:map';
2
2
  @use '../core/theming/theming';
3
+ @use '../core/tokens/m2/mat/icon' as tokens-mat-icon;
4
+ @use '../core/tokens/token-utils';
5
+ @use '../core/style/sass-utils';
6
+
7
+ @mixin _palette-colors($config, $palette-name) {
8
+ $palette: map.get($config, $palette-name);
9
+ $color: theming.get-color-from-palette($palette, text);
10
+ $tokens: tokens-mat-icon.private-get-icon-color-tokens($color);
11
+ @include token-utils.create-token-values(tokens-mat-icon.$prefix, $tokens);
12
+ }
3
13
 
4
14
  @mixin color($config-or-theme) {
5
15
  $config: theming.get-color-config($config-or-theme);
6
- $primary: map.get($config, primary);
7
- $accent: map.get($config, accent);
8
- $warn: map.get($config, warn);
9
- $background: map.get($config, background);
10
- $foreground: map.get($config, foreground);
16
+
17
+ @include sass-utils.current-selector-or-root() {
18
+ @include token-utils.create-token-values(tokens-mat-icon.$prefix,
19
+ tokens-mat-icon.get-color-tokens($config));
20
+ }
11
21
 
12
22
  .mat-icon {
13
23
  &.mat-primary {
14
- color: theming.get-color-from-palette($primary, text);
24
+ @include _palette-colors($config, primary);
15
25
  }
16
26
 
17
27
  &.mat-accent {
18
- color: theming.get-color-from-palette($accent, text);
28
+ @include _palette-colors($config, accent);
19
29
  }
20
30
 
21
31
  &.mat-warn {
22
- color: theming.get-color-from-palette($warn, text);
32
+ @include _palette-colors($config, warn);
23
33
  }
24
34
  }
25
35
  }