@angular/material 15.0.2 → 15.0.3

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 (72) hide show
  1. package/card/_card-theme.scss +10 -3
  2. package/chips/_chips-theme.scss +11 -1
  3. package/chips/testing/index.d.ts +8 -0
  4. package/core/mdc-helpers/_mdc-helpers.scss +35 -19
  5. package/esm2020/chips/testing/chip-grid-harness.mjs +4 -2
  6. package/esm2020/chips/testing/chip-harness-filters.mjs +1 -1
  7. package/esm2020/chips/testing/chip-harness.mjs +6 -2
  8. package/esm2020/chips/testing/chip-input-harness.mjs +4 -1
  9. package/esm2020/chips/testing/chip-listbox-harness.mjs +4 -2
  10. package/esm2020/core/version.mjs +1 -1
  11. package/esm2020/form-field/form-field.mjs +3 -3
  12. package/esm2020/form-field/testing/form-field-harness-filters.mjs +1 -1
  13. package/esm2020/form-field/testing/form-field-harness.mjs +3 -2
  14. package/esm2020/legacy-form-field/testing/form-field-harness.mjs +3 -2
  15. package/esm2020/menu/menu-item.mjs +3 -3
  16. package/esm2020/slider/slider-input.mjs +11 -10
  17. package/esm2020/tabs/tab-group.mjs +2 -2
  18. package/esm2020/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  19. package/esm2020/toolbar/toolbar.mjs +2 -2
  20. package/fesm2015/chips/testing.mjs +15 -4
  21. package/fesm2015/chips/testing.mjs.map +1 -1
  22. package/fesm2015/core.mjs +1 -1
  23. package/fesm2015/core.mjs.map +1 -1
  24. package/fesm2015/form-field/testing.mjs +2 -1
  25. package/fesm2015/form-field/testing.mjs.map +1 -1
  26. package/fesm2015/form-field.mjs +2 -2
  27. package/fesm2015/form-field.mjs.map +1 -1
  28. package/fesm2015/legacy-form-field/testing.mjs +2 -1
  29. package/fesm2015/legacy-form-field/testing.mjs.map +1 -1
  30. package/fesm2015/menu.mjs +2 -2
  31. package/fesm2015/menu.mjs.map +1 -1
  32. package/fesm2015/slider.mjs +10 -9
  33. package/fesm2015/slider.mjs.map +1 -1
  34. package/fesm2015/tabs.mjs +4 -4
  35. package/fesm2015/tabs.mjs.map +1 -1
  36. package/fesm2015/toolbar.mjs +2 -2
  37. package/fesm2015/toolbar.mjs.map +1 -1
  38. package/fesm2020/chips/testing.mjs +14 -3
  39. package/fesm2020/chips/testing.mjs.map +1 -1
  40. package/fesm2020/core.mjs +1 -1
  41. package/fesm2020/core.mjs.map +1 -1
  42. package/fesm2020/form-field/testing.mjs +2 -1
  43. package/fesm2020/form-field/testing.mjs.map +1 -1
  44. package/fesm2020/form-field.mjs +2 -2
  45. package/fesm2020/form-field.mjs.map +1 -1
  46. package/fesm2020/legacy-form-field/testing.mjs +2 -1
  47. package/fesm2020/legacy-form-field/testing.mjs.map +1 -1
  48. package/fesm2020/menu.mjs +2 -2
  49. package/fesm2020/menu.mjs.map +1 -1
  50. package/fesm2020/slider.mjs +10 -9
  51. package/fesm2020/slider.mjs.map +1 -1
  52. package/fesm2020/tabs.mjs +4 -4
  53. package/fesm2020/tabs.mjs.map +1 -1
  54. package/fesm2020/toolbar.mjs +2 -2
  55. package/fesm2020/toolbar.mjs.map +1 -1
  56. package/form-field/_form-field-focus-overlay.scss +2 -0
  57. package/form-field/_mdc-text-field-theme-variable-refresh.scss +40 -15
  58. package/form-field/testing/index.d.ts +2 -0
  59. package/menu/index.d.ts +1 -1
  60. package/package.json +2 -2
  61. package/progress-bar/_progress-bar-theme.scss +9 -2
  62. package/schematics/ng-add/index.js +1 -1
  63. package/schematics/ng-add/index.mjs +1 -1
  64. package/schematics/ng-generate/mdc-migration/index_bundled.js +12 -9
  65. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +2 -2
  66. package/schematics/ng-generate/mdc-migration/mdc_migration_bundle_metadata.json +1 -1
  67. package/schematics/ng-update/index_bundled.js +1 -1
  68. package/schematics/ng-update/index_bundled.js.map +2 -2
  69. package/schematics/ng-update/ng_update_index_metadata.json +1 -1
  70. package/slider/index.d.ts +2 -2
  71. package/snack-bar/_snack-bar-theme.scss +11 -7
  72. package/tabs/_tabs-common.scss +1 -3
@@ -61,14 +61,14 @@ class MatToolbar extends _MatToolbarBase {
61
61
  }
62
62
  }
63
63
  MatToolbar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: MatToolbar, deps: [{ token: i0.ElementRef }, { token: i1.Platform }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
64
- MatToolbar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", 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{--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 });
64
+ MatToolbar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.0", 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 });
65
65
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0", ngImport: i0, type: MatToolbar, decorators: [{
66
66
  type: Component,
67
67
  args: [{ selector: 'mat-toolbar', exportAs: 'matToolbar', inputs: ['color'], host: {
68
68
  'class': 'mat-toolbar',
69
69
  '[class.mat-toolbar-multiple-rows]': '_toolbarRows.length > 0',
70
70
  '[class.mat-toolbar-single-row]': '_toolbarRows.length === 0',
71
- }, 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{--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%}"] }]
71
+ }, 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%}"] }]
72
72
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.Platform }, { type: undefined, decorators: [{
73
73
  type: Inject,
74
74
  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/public-api.ts","../../../../../../src/material/toolbar/index.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 * @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\nexport * from './toolbar-module';\nexport * from './toolbar';\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\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AAiBH;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;;0GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;8FAAb,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;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,EAAE,EAAC,OAAO,EAAE,iBAAiB,EAAC;AACnC,iBAAA,CAAA;;AAiBK,MAAO,UAAW,SAAQ,eAAe,CAAA;AAM7C,IAAA,WAAA,CACE,UAAsB,EACd,SAAmB,EACT,QAAc,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A,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;;AEzGA;;;;;;AAMG;MAWU,gBAAgB,CAAA;;6GAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;8GAAhB,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;8GAGzC,gBAAgB,EAAA,OAAA,EAAA,CAJjB,eAAe,EACY,eAAe,CAAA,EAAA,CAAA,CAAA;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;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;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/public-api.ts","../../../../../../src/material/toolbar/index.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 * @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\nexport * from './toolbar-module';\nexport * from './toolbar';\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\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;AAMG;AAiBH;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,CAC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AAA,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;;;;;;AAMG;;ACNH;;;;;;AAMG;;ACNH;;AAEG;;;;"}
@@ -13,6 +13,8 @@
13
13
  .mat-mdc-form-field-focus-overlay {
14
14
  @include layout-common.fill;
15
15
  opacity: 0;
16
+ // Make sure we don't block click on the prefix/suffix.
17
+ pointer-events: none;
16
18
  }
17
19
  }
18
20
 
@@ -1,6 +1,7 @@
1
1
  @use '@material/textfield' as mdc-textfield;
2
2
  @use '@material/theme/variables' as mdc-theme-variables;
3
3
  @use 'sass:color';
4
+ @use 'sass:meta';
4
5
 
5
6
  // Mixin that refreshes the MDC text-field theming variables. This mixin should be used when
6
7
  // the base MDC theming variables have been explicitly updated, but the component specific
@@ -8,38 +9,48 @@
8
9
  // restores the previous values for the variables to avoid unexpected global side effects.
9
10
  @mixin private-text-field-refresh-theme-variables() {
10
11
  $_disabled-border: mdc-textfield.$disabled-border;
11
- mdc-textfield.$disabled-border: rgba(mdc-theme-variables.prop-value(on-surface), 0.06);
12
+ mdc-textfield.$disabled-border:
13
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.06);
12
14
  $_bottom-line-hover: mdc-textfield.$bottom-line-hover;
13
- mdc-textfield.$bottom-line-hover: rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
15
+ mdc-textfield.$bottom-line-hover:
16
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
14
17
  $_bottom-line-idle: mdc-textfield.$bottom-line-idle;
15
- mdc-textfield.$bottom-line-idle: rgba(mdc-theme-variables.prop-value(on-surface), 0.42);
18
+ mdc-textfield.$bottom-line-idle:
19
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.42);
16
20
  $_label: mdc-textfield.$label;
17
- mdc-textfield.$label: rgba(mdc-theme-variables.prop-value(on-surface), 0.6);
21
+ mdc-textfield.$label: _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.6);
18
22
  $_ink-color: mdc-textfield.$ink-color;
19
- mdc-textfield.$ink-color: rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
23
+ mdc-textfield.$ink-color: _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
20
24
  $_focused-label-color: mdc-textfield.$focused-label-color;
21
- mdc-textfield.$focused-label-color: rgba(mdc-theme-variables.prop-value(primary), 0.87);
25
+ mdc-textfield.$focused-label-color:
26
+ _variable-safe-rgba(mdc-theme-variables.prop-value(primary), 0.87);
22
27
  $_placeholder-ink-color: mdc-textfield.$placeholder-ink-color;
23
- mdc-textfield.$placeholder-ink-color: rgba(mdc-theme-variables.prop-value(on-surface), 0.6);
28
+ mdc-textfield.$placeholder-ink-color:
29
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.6);
24
30
  $_disabled-label-color: mdc-textfield.$disabled-label-color;
25
- mdc-textfield.$disabled-label-color: rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
31
+ mdc-textfield.$disabled-label-color:
32
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
26
33
  $_disabled-ink-color: mdc-textfield.$disabled-ink-color;
27
- mdc-textfield.$disabled-ink-color: rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
34
+ mdc-textfield.$disabled-ink-color:
35
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
28
36
  $_disabled-placeholder-ink-color: mdc-textfield.$disabled-placeholder-ink-color;
29
37
  mdc-textfield.$disabled-placeholder-ink-color:
30
- rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
38
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
31
39
  $_background: mdc-textfield.$background;
32
- mdc-textfield.$background: color.mix(mdc-theme-variables.prop-value(on-surface),
40
+ mdc-textfield.$background: _variable-safe-mix(mdc-theme-variables.prop-value(on-surface),
33
41
  mdc-theme-variables.prop-value(surface), 4%);
34
42
  $_disabled-background: mdc-textfield.$disabled-background;
35
- mdc-textfield.$disabled-background: color.mix(mdc-theme-variables.prop-value(on-surface),
43
+ mdc-textfield.$disabled-background: _variable-safe-mix(mdc-theme-variables.prop-value(on-surface),
36
44
  mdc-theme-variables.prop-value(surface), 2%);
37
45
  $_outlined-idle-border: mdc-textfield.$outlined-idle-border;
38
- mdc-textfield.$outlined-idle-border: rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
46
+ mdc-textfield.$outlined-idle-border:
47
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.38);
39
48
  $_outlined-disabled-border: mdc-textfield.$outlined-disabled-border;
40
- mdc-textfield.$outlined-disabled-border: rgba(mdc-theme-variables.prop-value(on-surface), 0.06);
49
+ mdc-textfield.$outlined-disabled-border:
50
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.06);
41
51
  $_outlined-hover-border: mdc-textfield.$outlined-hover-border;
42
- mdc-textfield.$outlined-hover-border: rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
52
+ mdc-textfield.$outlined-hover-border:
53
+ _variable-safe-rgba(mdc-theme-variables.prop-value(on-surface), 0.87);
43
54
 
44
55
  // The content will be generated with the refreshed MDC text-field theming variables.
45
56
  @content;
@@ -61,3 +72,17 @@
61
72
  mdc-textfield.$outlined-disabled-border: $_outlined-disabled-border;
62
73
  mdc-textfield.$outlined-hover-border: $_outlined-hover-border;
63
74
  }
75
+
76
+ @function _variable-safe-rgba($color, $opacity) {
77
+ @if (meta.type-of($color) == color) {
78
+ @return rgba($color, $opacity);
79
+ }
80
+ @return $color;
81
+ }
82
+
83
+ @function _variable-safe-mix($first-color, $second-color, $amount) {
84
+ @if (meta.type-of($first-color) == color and meta.type-of($second-color) == color) {
85
+ @return color.mix($first-color, $second-color, $amount);
86
+ }
87
+ @return $first-color;
88
+ }
@@ -29,6 +29,8 @@ export declare interface FormFieldHarnessFilters extends BaseHarnessFilters {
29
29
  floatingLabelText?: string | RegExp;
30
30
  /** Filters based on whether the form field has error messages. */
31
31
  hasErrors?: boolean;
32
+ /** Filters based on whether the form field value is valid. */
33
+ isValid?: boolean;
32
34
  }
33
35
 
34
36
  /** Harness for interacting with an MDC-based `mat-error` in tests. */
package/menu/index.d.ts CHANGED
@@ -383,7 +383,7 @@ export declare class MatMenuItem extends _MatMenuItemBase implements FocusableOp
383
383
  _setTriggersSubmenu(triggersSubmenu: boolean): void;
384
384
  _hasFocus(): boolean;
385
385
  static ɵfac: i0.ɵɵFactoryDeclaration<MatMenuItem, [null, null, null, { optional: true; }, null]>;
386
- static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon", "*"], false, never>;
386
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon, [matMenuItemIcon]", "*"], false, never>;
387
387
  }
388
388
 
389
389
  /** @docs-private */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/material",
3
- "version": "15.0.2",
3
+ "version": "15.0.3",
4
4
  "description": "Angular Material",
5
5
  "repository": {
6
6
  "type": "git",
@@ -989,7 +989,7 @@
989
989
  },
990
990
  "peerDependencies": {
991
991
  "@angular/animations": "^15.0.0 || ^16.0.0",
992
- "@angular/cdk": "15.0.2",
992
+ "@angular/cdk": "15.0.3",
993
993
  "@angular/core": "^15.0.0 || ^16.0.0",
994
994
  "@angular/common": "^15.0.0 || ^16.0.0",
995
995
  "@angular/forms": "^15.0.0 || ^16.0.0",
@@ -3,9 +3,12 @@
3
3
  @use '@material/theme/theme-color' as mdc-theme-color;
4
4
  @use '@material/linear-progress/linear-progress-theme' as mdc-linear-progress-theme;
5
5
  @use 'sass:color';
6
+ @use 'sass:meta';
6
7
 
7
8
 
8
9
  @mixin _palette-styles($color) {
10
+ $color-value: mdc-theme-color.prop-value($color);
11
+
9
12
  // We can't set the `track-color` using `theme`, because it isn't possible for it to use a CSS
10
13
  // variable since MDC's buffer animation works by constructing an SVG string from this color.
11
14
  @include mdc-linear-progress-theme.theme-styles((
@@ -13,11 +16,15 @@
13
16
  // writing, their buffer color is hardcoded to #e6e6e6 which both doesn't account for theming
14
17
  // and doesn't match the Material design spec. For now we approximate the buffer background by
15
18
  // applying an opacity to the color of the bar.
16
- track-color: color.adjust(mdc-theme-color.prop-value($color), $alpha: -0.75),
19
+ track-color: if(
20
+ meta.type-of($color-value) == color,
21
+ color.adjust($color-value, $alpha: -0.75),
22
+ $color-value
23
+ ),
17
24
  ));
18
25
 
19
26
  @include mdc-linear-progress-theme.theme((
20
- active-indicator-color: mdc-theme-color.prop-value($color),
27
+ active-indicator-color: $color-value,
21
28
  ));
22
29
  }
23
30
 
@@ -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 = `~15.0.2`;
21
+ const fallbackMaterialVersionRange = `~15.0.3`;
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 = `~15.0.2`;
21
+ const fallbackMaterialVersionRange = `~15.0.3`;
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`.
@@ -21461,16 +21461,19 @@ function updateAttribute(html, node, name, update) {
21461
21461
  const prefix = html.slice(0, index2);
21462
21462
  const suffix = html.slice(index2);
21463
21463
  const attrText = newValue ? `${name}="${newValue}"` : `${name}`;
21464
- if (node.startSourceSpan.start.line === node.startSourceSpan.end.line) {
21465
- return `${prefix} ${attrText}${suffix}`;
21466
- }
21467
- const attr = node.attributes[0];
21468
- if (attr) {
21469
- const ctx = attr.sourceSpan.start.getContext(attr.sourceSpan.start.col + 1, 1);
21470
- const indentation = ctx.before;
21471
- return prefix + indentation + attrText + suffix;
21464
+ const indentation = parseIndentation(html, node);
21465
+ return prefix + indentation + attrText + suffix;
21466
+ }
21467
+ function parseIndentation(html, node) {
21468
+ let whitespace = "";
21469
+ let startOffset = node.startSourceSpan.start.offset + node.name.length + 1;
21470
+ for (let i = startOffset; i < node.startSourceSpan.end.offset - 1; i++) {
21471
+ if (!/\s/.test(html.charAt(i))) {
21472
+ break;
21473
+ }
21474
+ whitespace += html.charAt(i);
21472
21475
  }
21473
- return prefix + attrText + suffix;
21476
+ return whitespace || " ";
21474
21477
  }
21475
21478
  function replaceAt(str, offset, oldSubstr, newSubstr) {
21476
21479
  const index2 = offset;