@angular/material 7.1.1 → 7.2.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 (194) hide show
  1. package/_theming.scss +1 -1
  2. package/autocomplete/typings/index.d.ts +1 -1
  3. package/autocomplete/typings/index.metadata.json +1 -1
  4. package/badge/typings/index.metadata.json +1 -1
  5. package/bundles/material-autocomplete.umd.js +1 -1
  6. package/bundles/material-autocomplete.umd.min.js +1 -1
  7. package/bundles/material-badge.umd.js +6 -0
  8. package/bundles/material-badge.umd.js.map +1 -1
  9. package/bundles/material-badge.umd.min.js +1 -1
  10. package/bundles/material-badge.umd.min.js.map +1 -1
  11. package/bundles/material-bottom-sheet.umd.js +4 -1
  12. package/bundles/material-bottom-sheet.umd.js.map +1 -1
  13. package/bundles/material-bottom-sheet.umd.min.js +1 -1
  14. package/bundles/material-bottom-sheet.umd.min.js.map +1 -1
  15. package/bundles/material-button.umd.js +6 -2
  16. package/bundles/material-button.umd.js.map +1 -1
  17. package/bundles/material-button.umd.min.js +1 -1
  18. package/bundles/material-button.umd.min.js.map +1 -1
  19. package/bundles/material-chips.umd.js +9 -4
  20. package/bundles/material-chips.umd.js.map +1 -1
  21. package/bundles/material-chips.umd.min.js +1 -1
  22. package/bundles/material-chips.umd.min.js.map +1 -1
  23. package/bundles/material-datepicker.umd.js +1 -1
  24. package/bundles/material-datepicker.umd.js.map +1 -1
  25. package/bundles/material-datepicker.umd.min.js +1 -1
  26. package/bundles/material-datepicker.umd.min.js.map +1 -1
  27. package/bundles/material-form-field.umd.js +65 -11
  28. package/bundles/material-form-field.umd.js.map +1 -1
  29. package/bundles/material-form-field.umd.min.js +1 -1
  30. package/bundles/material-form-field.umd.min.js.map +1 -1
  31. package/bundles/material-grid-list.umd.js +4 -2
  32. package/bundles/material-grid-list.umd.js.map +1 -1
  33. package/bundles/material-grid-list.umd.min.js +1 -1
  34. package/bundles/material-grid-list.umd.min.js.map +1 -1
  35. package/bundles/material-icon.umd.js +1 -0
  36. package/bundles/material-icon.umd.js.map +1 -1
  37. package/bundles/material-icon.umd.min.js +1 -1
  38. package/bundles/material-icon.umd.min.js.map +1 -1
  39. package/bundles/material-input.umd.js +4 -2
  40. package/bundles/material-input.umd.js.map +1 -1
  41. package/bundles/material-input.umd.min.js +1 -1
  42. package/bundles/material-input.umd.min.js.map +1 -1
  43. package/bundles/material-menu.umd.js +7 -7
  44. package/bundles/material-menu.umd.js.map +1 -1
  45. package/bundles/material-menu.umd.min.js +1 -1
  46. package/bundles/material-menu.umd.min.js.map +1 -1
  47. package/bundles/material-sidenav.umd.js +22 -3
  48. package/bundles/material-sidenav.umd.js.map +1 -1
  49. package/bundles/material-sidenav.umd.min.js +1 -1
  50. package/bundles/material-sidenav.umd.min.js.map +1 -1
  51. package/bundles/material-stepper.umd.js +1 -1
  52. package/bundles/material-stepper.umd.js.map +1 -1
  53. package/bundles/material-stepper.umd.min.js +1 -1
  54. package/bundles/material-stepper.umd.min.js.map +1 -1
  55. package/bundles/material-tabs.umd.js +11 -11
  56. package/bundles/material-tabs.umd.min.js +1 -1
  57. package/bundles/material-tree.umd.js +9 -7
  58. package/bundles/material-tree.umd.js.map +1 -1
  59. package/bundles/material-tree.umd.min.js +1 -1
  60. package/bundles/material-tree.umd.min.js.map +1 -1
  61. package/bundles/material.umd.js +152 -54
  62. package/bundles/material.umd.js.map +1 -1
  63. package/bundles/material.umd.min.js +12 -12
  64. package/bundles/material.umd.min.js.map +1 -1
  65. package/button/typings/button.d.ts +0 -5
  66. package/button/typings/index.metadata.json +1 -1
  67. package/chips/typings/index.metadata.json +1 -1
  68. package/datepicker/typings/index.metadata.json +1 -1
  69. package/esm2015/autocomplete.js +1 -1
  70. package/esm2015/badge.js +6 -0
  71. package/esm2015/badge.js.map +1 -1
  72. package/esm2015/bottom-sheet.js +4 -1
  73. package/esm2015/bottom-sheet.js.map +1 -1
  74. package/esm2015/button.js +6 -2
  75. package/esm2015/button.js.map +1 -1
  76. package/esm2015/chips.js +9 -4
  77. package/esm2015/chips.js.map +1 -1
  78. package/esm2015/datepicker.js +1 -1
  79. package/esm2015/datepicker.js.map +1 -1
  80. package/esm2015/form-field.js +59 -12
  81. package/esm2015/form-field.js.map +1 -1
  82. package/esm2015/grid-list.js +4 -2
  83. package/esm2015/grid-list.js.map +1 -1
  84. package/esm2015/icon.js +1 -0
  85. package/esm2015/icon.js.map +1 -1
  86. package/esm2015/input.js +4 -2
  87. package/esm2015/input.js.map +1 -1
  88. package/esm2015/material.js +4 -4
  89. package/esm2015/material.js.map +1 -1
  90. package/esm2015/menu.js +2 -2
  91. package/esm2015/menu.js.map +1 -1
  92. package/esm2015/sidenav.js +24 -4
  93. package/esm2015/sidenav.js.map +1 -1
  94. package/esm2015/stepper.js +2 -2
  95. package/esm2015/stepper.js.map +1 -1
  96. package/esm2015/tabs.js +1 -1
  97. package/esm2015/tree.js +9 -7
  98. package/esm2015/tree.js.map +1 -1
  99. package/esm5/autocomplete.es5.js +1 -1
  100. package/esm5/badge.es5.js +6 -0
  101. package/esm5/badge.es5.js.map +1 -1
  102. package/esm5/bottom-sheet.es5.js +4 -1
  103. package/esm5/bottom-sheet.es5.js.map +1 -1
  104. package/esm5/button.es5.js +6 -2
  105. package/esm5/button.es5.js.map +1 -1
  106. package/esm5/chips.es5.js +10 -5
  107. package/esm5/chips.es5.js.map +1 -1
  108. package/esm5/datepicker.es5.js +1 -1
  109. package/esm5/datepicker.es5.js.map +1 -1
  110. package/esm5/form-field.es5.js +67 -13
  111. package/esm5/form-field.es5.js.map +1 -1
  112. package/esm5/grid-list.es5.js +4 -2
  113. package/esm5/grid-list.es5.js.map +1 -1
  114. package/esm5/icon.es5.js +1 -0
  115. package/esm5/icon.es5.js.map +1 -1
  116. package/esm5/input.es5.js +4 -2
  117. package/esm5/input.es5.js.map +1 -1
  118. package/esm5/material.es5.js +4 -4
  119. package/esm5/material.es5.js.map +1 -1
  120. package/esm5/menu.es5.js +2 -2
  121. package/esm5/menu.es5.js.map +1 -1
  122. package/esm5/sidenav.es5.js +23 -4
  123. package/esm5/sidenav.es5.js.map +1 -1
  124. package/esm5/stepper.es5.js +2 -2
  125. package/esm5/stepper.es5.js.map +1 -1
  126. package/esm5/tabs.es5.js +1 -1
  127. package/esm5/tree.es5.js +9 -7
  128. package/esm5/tree.es5.js.map +1 -1
  129. package/form-field/typings/form-field.d.ts +15 -4
  130. package/form-field/typings/index.metadata.json +1 -1
  131. package/icon/typings/index.metadata.json +1 -1
  132. package/material.d.ts +1 -1
  133. package/material.metadata.json +3 -3
  134. package/menu/typings/index.d.ts +4 -4
  135. package/menu/typings/index.metadata.json +1 -1
  136. package/package.json +5 -5
  137. package/prebuilt-themes/deeppurple-amber.css +1 -1
  138. package/prebuilt-themes/indigo-pink.css +1 -1
  139. package/prebuilt-themes/pink-bluegrey.css +1 -1
  140. package/prebuilt-themes/purple-green.css +1 -1
  141. package/schematics/ng-add/theming/theming.js +10 -9
  142. package/schematics/ng-add/theming/theming.js.map +1 -1
  143. package/schematics/ng-generate/address-form/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  144. package/schematics/ng-generate/dashboard/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  145. package/schematics/ng-generate/nav/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  146. package/schematics/ng-generate/table/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  147. package/schematics/ng-generate/tree/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts +2 -2
  148. package/sidenav/typings/drawer.d.ts +9 -2
  149. package/sidenav/typings/index.metadata.json +1 -1
  150. package/stepper/typings/index.metadata.json +1 -1
  151. package/tabs/typings/index.d.ts +5 -5
  152. package/tabs/typings/index.metadata.json +1 -1
  153. package/tree/typings/data-source/flat-data-source.d.ts +2 -2
  154. package/tree/typings/index.metadata.json +1 -1
  155. package/typings/autocomplete/index.d.ts +1 -1
  156. package/typings/autocomplete/index.metadata.json +1 -1
  157. package/typings/badge/index.metadata.json +1 -1
  158. package/typings/button/button.d.ts +0 -5
  159. package/typings/button/index.metadata.json +1 -1
  160. package/typings/chips/index.metadata.json +1 -1
  161. package/typings/datepicker/index.metadata.json +1 -1
  162. package/typings/esm5/autocomplete/index.d.ts +1 -1
  163. package/typings/esm5/autocomplete/index.metadata.json +1 -1
  164. package/typings/esm5/badge/index.metadata.json +1 -1
  165. package/typings/esm5/button/button.d.ts +0 -5
  166. package/typings/esm5/button/index.metadata.json +1 -1
  167. package/typings/esm5/chips/index.metadata.json +1 -1
  168. package/typings/esm5/datepicker/index.metadata.json +1 -1
  169. package/typings/esm5/form-field/form-field.d.ts +15 -4
  170. package/typings/esm5/form-field/index.metadata.json +1 -1
  171. package/typings/esm5/icon/index.metadata.json +1 -1
  172. package/typings/esm5/index.metadata.json +1 -1
  173. package/typings/esm5/menu/index.d.ts +4 -4
  174. package/typings/esm5/menu/index.metadata.json +1 -1
  175. package/typings/esm5/sidenav/drawer.d.ts +9 -2
  176. package/typings/esm5/sidenav/index.metadata.json +1 -1
  177. package/typings/esm5/stepper/index.metadata.json +1 -1
  178. package/typings/esm5/tabs/index.d.ts +5 -5
  179. package/typings/esm5/tabs/index.metadata.json +1 -1
  180. package/typings/esm5/tree/data-source/flat-data-source.d.ts +2 -2
  181. package/typings/esm5/tree/index.metadata.json +1 -1
  182. package/typings/form-field/form-field.d.ts +15 -4
  183. package/typings/form-field/index.metadata.json +1 -1
  184. package/typings/icon/index.metadata.json +1 -1
  185. package/typings/index.metadata.json +1 -1
  186. package/typings/menu/index.d.ts +4 -4
  187. package/typings/menu/index.metadata.json +1 -1
  188. package/typings/sidenav/drawer.d.ts +9 -2
  189. package/typings/sidenav/index.metadata.json +1 -1
  190. package/typings/stepper/index.metadata.json +1 -1
  191. package/typings/tabs/index.d.ts +5 -5
  192. package/typings/tabs/index.metadata.json +1 -1
  193. package/typings/tree/data-source/flat-data-source.d.ts +2 -2
  194. package/typings/tree/index.metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tree.js","sources":["../../../src/lib/tree/data-source/nested-data-source.ts","../../../src/lib/tree/data-source/flat-data-source.ts","../../../src/lib/tree/tree-module.ts","../../../src/lib/tree/toggle.ts","../../../src/lib/tree/tree.ts","../../../src/lib/tree/padding.ts","../../../src/lib/tree/node.ts","../../../src/lib/tree/outlet.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 {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {BehaviorSubject, merge, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n\n/**\n * Data source for nested tree.\n *\n * The data source for nested tree doesn't have to consider node flattener, or the way to expand\n * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.\n */\nexport class MatTreeNestedDataSource<T> extends DataSource<T> {\n _data = new BehaviorSubject<T[]>([]);\n\n /**\n * Data for the nested tree\n */\n get data() { return this._data.value; }\n set data(value: T[]) { this._data.next(value); }\n\n connect(collectionViewer: CollectionViewer): Observable<T[]> {\n return merge(...[collectionViewer.viewChange, this._data])\n .pipe(map(() => {\n return this.data;\n }));\n }\n\n disconnect() {\n // no op\n }\n}\n\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 {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {FlatTreeControl, TreeControl} from '@angular/cdk/tree';\nimport {BehaviorSubject, merge, Observable} from 'rxjs';\nimport {map, take} from 'rxjs/operators';\n\n/**\n * Tree flattener to convert a normal type of node to node with children & level information.\n * Transform nested nodes of type `T` to flattened nodes of type `F`.\n *\n * For example, the input data of type `T` is nested, and contains its children data:\n * SomeNode: {\n * key: 'Fruits',\n * children: [\n * NodeOne: {\n * key: 'Apple',\n * },\n * NodeTwo: {\n * key: 'Pear',\n * }\n * ]\n * }\n * After flattener flatten the tree, the structure will become\n * SomeNode: {\n * key: 'Fruits',\n * expandable: true,\n * level: 1\n * },\n * NodeOne: {\n * key: 'Apple',\n * expandable: false,\n * level: 2\n * },\n * NodeTwo: {\n * key: 'Pear',\n * expandable: false,\n * level: 2\n * }\n * and the output flattened type is `F` with additional information.\n */\nexport class MatTreeFlattener<T, F> {\n\n constructor(public transformFunction: (node: T, level: number) => F,\n public getLevel: (node: F) => number,\n public isExpandable: (node: F) => boolean,\n public getChildren: (node: T) => Observable<T[]> | T[]) {}\n\n _flattenNode(node: T, level: number,\n resultNodes: F[], parentMap: boolean[]): F[] {\n const flatNode = this.transformFunction(node, level);\n resultNodes.push(flatNode);\n\n if (this.isExpandable(flatNode)) {\n const childrenNodes = this.getChildren(node);\n if (Array.isArray(childrenNodes)) {\n this._flattenChildren(childrenNodes, level, resultNodes, parentMap);\n } else {\n childrenNodes.pipe(take(1)).subscribe(children => {\n this._flattenChildren(children, level, resultNodes, parentMap);\n });\n }\n }\n return resultNodes;\n }\n\n _flattenChildren(children: T[], level: number,\n resultNodes: F[], parentMap: boolean[]): void {\n children.forEach((child, index) => {\n let childParentMap: boolean[] = parentMap.slice();\n childParentMap.push(index != children.length - 1);\n this._flattenNode(child, level + 1, resultNodes, childParentMap);\n });\n }\n\n /**\n * Flatten a list of node type T to flattened version of node F.\n * Please note that type T may be nested, and the length of `structuredData` may be different\n * from that of returned list `F[]`.\n */\n flattenNodes(structuredData: T[]): F[] {\n let resultNodes: F[] = [];\n structuredData.forEach(node => this._flattenNode(node, 0, resultNodes, []));\n return resultNodes;\n }\n\n /**\n * Expand flattened node with current expansion status.\n * The returned list may have different length.\n */\n expandFlattenedNodes(nodes: F[], treeControl: TreeControl<F>): F[] {\n let results: F[] = [];\n let currentExpand: boolean[] = [];\n currentExpand[0] = true;\n\n nodes.forEach(node => {\n let expand = true;\n for (let i = 0; i <= this.getLevel(node); i++) {\n expand = expand && currentExpand[i];\n }\n if (expand) {\n results.push(node);\n }\n if (this.isExpandable(node)) {\n currentExpand[this.getLevel(node) + 1] = treeControl.isExpanded(node);\n }\n });\n return results;\n }\n}\n\n\n/**\n * Data source for flat tree.\n * The data source need to handle expansion/collapsion of the tree node and change the data feed\n * to `MatTree`.\n * The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted\n * to type `F` for `MatTree` to consume.\n */\nexport class MatTreeFlatDataSource<T, F> extends DataSource<F> {\n _flattenedData = new BehaviorSubject<F[]>([]);\n\n _expandedData = new BehaviorSubject<F[]>([]);\n\n _data: BehaviorSubject<T[]>;\n get data() { return this._data.value; }\n set data(value: T[]) {\n this._data.next(value);\n this._flattenedData.next(this.treeFlattener.flattenNodes(this.data));\n this.treeControl.dataNodes = this._flattenedData.value;\n }\n\n constructor(private treeControl: FlatTreeControl<F>,\n private treeFlattener: MatTreeFlattener<T, F>,\n initialData: T[] = []) {\n super();\n this._data = new BehaviorSubject<T[]>(initialData);\n }\n\n connect(collectionViewer: CollectionViewer): Observable<F[]> {\n const changes = [\n collectionViewer.viewChange,\n this.treeControl.expansionModel.onChange,\n this._flattenedData\n ];\n return merge(...changes).pipe(map(() => {\n this._expandedData.next(\n this.treeFlattener.expandFlattenedNodes(this._flattenedData.value, this.treeControl));\n return this._expandedData.value;\n }));\n }\n\n disconnect() {\n // no op\n }\n}\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';\n\nimport {CdkTreeModule} from '@angular/cdk/tree';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatNestedTreeNode, MatTreeNodeDef, MatTreeNode} from './node';\nimport {MatTree} from './tree';\nimport {MatTreeNodeToggle} from './toggle';\nimport {MatTreeNodeOutlet} from './outlet';\nimport {MatTreeNodePadding} from './padding';\n\nconst MAT_TREE_DIRECTIVES = [\n MatNestedTreeNode,\n MatTreeNodeDef,\n MatTreeNodePadding,\n MatTreeNodeToggle,\n MatTree,\n MatTreeNode,\n MatTreeNodeOutlet\n];\n\n@NgModule({\n imports: [CdkTreeModule, CommonModule, MatCommonModule],\n exports: MAT_TREE_DIRECTIVES,\n declarations: MAT_TREE_DIRECTIVES,\n})\nexport class MatTreeModule {}\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 {CdkTreeNodeToggle} from '@angular/cdk/tree';\nimport {Directive, Input} from '@angular/core';\n\n/**\n * Wrapper for the CdkTree's toggle with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodeToggle]',\n host: {\n '(click)': '_toggle($event)',\n },\n providers: [{provide: CdkTreeNodeToggle, useExisting: MatTreeNodeToggle}]\n})\nexport class MatTreeNodeToggle<T> extends CdkTreeNodeToggle<T> {\n @Input('matTreeNodeToggleRecursive') recursive: boolean = false;\n}\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 {CdkTree} from '@angular/cdk/tree';\nimport {ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {MatTreeNodeOutlet} from './outlet';\n\n/**\n * Wrapper for the CdkTable with Material design styles.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-tree',\n exportAs: 'matTree',\n template: `<ng-container matTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'mat-tree',\n 'role': 'tree',\n },\n styleUrls: ['tree.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{provide: CdkTree, useExisting: MatTree}]\n})\nexport class MatTree<T> extends CdkTree<T> {\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(MatTreeNodeOutlet) _nodeOutlet: MatTreeNodeOutlet;\n}\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 */\nimport {CdkTreeNodePadding} from '@angular/cdk/tree';\nimport {Directive, Input} from '@angular/core';\n\n/**\n * Wrapper for the CdkTree padding with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodePadding]',\n providers: [{provide: CdkTreeNodePadding, useExisting: MatTreeNodePadding}]\n})\nexport class MatTreeNodePadding<T> extends CdkTreeNodePadding<T> {\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('matTreeNodePadding') level: number;\n\n /** The indent for each level. Default number 40px from material design menu sub-menu spec. */\n @Input('matTreeNodePaddingIndent') indent: number;\n}\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 {CdkNestedTreeNode, CdkTree, CdkTreeNode, CdkTreeNodeDef} from '@angular/cdk/tree';\nimport {\n AfterContentInit,\n Attribute,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {\n CanDisable, CanDisableCtor,\n HasTabIndex,\n HasTabIndexCtor,\n mixinDisabled,\n mixinTabIndex,\n} from '@angular/material/core';\nimport {MatTreeNodeOutlet} from './outlet';\n\nexport const _MatTreeNodeMixinBase: HasTabIndexCtor & CanDisableCtor & typeof CdkTreeNode =\n mixinTabIndex(mixinDisabled(CdkTreeNode));\n\nexport const _MatNestedTreeNodeMixinBase:\n HasTabIndexCtor & CanDisableCtor & typeof CdkNestedTreeNode =\n mixinTabIndex(mixinDisabled(CdkNestedTreeNode));\n\n/**\n * Wrapper for the CdkTree node with Material design styles.\n */\n@Directive({\n selector: 'mat-tree-node',\n exportAs: 'matTreeNode',\n inputs: ['disabled', 'tabIndex'],\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'mat-tree-node'\n },\n providers: [{provide: CdkTreeNode, useExisting: MatTreeNode}]\n})\nexport class MatTreeNode<T> extends _MatTreeNodeMixinBase<T>\n implements CanDisable, HasTabIndex {\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n @Attribute('tabindex') tabIndex: string) {\n super(_elementRef, _tree);\n\n this.tabIndex = Number(tabIndex) || 0;\n }\n}\n\n/**\n * Wrapper for the CdkTree node definition with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodeDef]',\n inputs: [\n 'when: matTreeNodeDefWhen'\n ],\n providers: [{provide: CdkTreeNodeDef, useExisting: MatTreeNodeDef}]\n})\nexport class MatTreeNodeDef<T> extends CdkTreeNodeDef<T> {\n @Input('matTreeNode') data: T;\n}\n\n/**\n * Wrapper for the CdkTree nested node with Material design styles.\n */\n@Directive({\n selector: 'mat-nested-tree-node',\n exportAs: 'matNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'mat-nested-tree-node',\n },\n inputs: ['disabled', 'tabIndex'],\n providers: [\n {provide: CdkNestedTreeNode, useExisting: MatNestedTreeNode},\n {provide: CdkTreeNode, useExisting: MatNestedTreeNode}\n ]\n})\nexport class MatNestedTreeNode<T> extends _MatNestedTreeNodeMixinBase<T>\n implements AfterContentInit, CanDisable, HasTabIndex, OnDestroy {\n\n @Input('matNestedTreeNode') node: T;\n\n @ContentChildren(MatTreeNodeOutlet) nodeOutlet: QueryList<MatTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers,\n @Attribute('tabindex') tabIndex: string) {\n super(_elementRef, _tree, _differs);\n\n this.tabIndex = Number(tabIndex) || 0;\n }\n\n // This is a workaround for https://github.com/angular/angular/issues/23091\n // In aot mode, the lifecycle hooks from parent class are not called.\n // TODO(tinayuangao): Remove when the angular issue #23091 is fixed\n ngAfterContentInit() {\n super.ngAfterContentInit();\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\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 */\nimport {CdkTreeNodeOutlet} from '@angular/cdk/tree';\nimport {\n Directive,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Outlet for nested CdkNode. Put `[matTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[matTreeNodeOutlet]'\n})\nexport class MatTreeNodeOutlet implements CdkTreeNodeOutlet {\n constructor(public viewContainer: ViewContainerRef) {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AOQA;;;;AAYA,AAAA,MAAa,iBAAiB,CAA9B;;;;IACE,WAAF,CAAqB,aAA+B,EAApD;QAAqB,IAArB,CAAA,aAAkC,GAAb,aAAa,CAAkB;KAAI;;;IAJxD,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,qBAAqB;aAChC,EAAD,EAAA;;;;IATA,EAAA,IAAA,EAAE,gBAAgB,EAAlB;;;;;;;;ADmBA,AAAA,MAAa,qBAAqB,GAC9B,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAD7C;;AAGA,AAAA,MAAa,2BAA2B,GAEhC,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAFvD;;;;;AAmBA,AAAA,MAAa,WAAe,SAAQ,qBAAwB,CAA5D;;;;;;IAIE,WAAF,CAAwB,WAAoC,EACpC,KAAiB,EACJ,QAAgB,EAFrD;QAGI,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAHN,IAAxB,CAAA,WAAmC,GAAX,WAAW,CAAyB;QACpC,IAAxB,CAAA,KAA6B,GAAL,KAAK,CAAY;QAH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C,KAAK,CAAC,CAAC,EAAE;;;;;IAEhD,OAAO,CAAC,gBAAkC,EAA5C;QACI,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;aACvD,IAAI,CAAC,GAAG,CAAC,MAAhB;YACQ,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB,CAAC,CAAC,CAAC;KACP;;;;IAED,UAAU,GAAZ;;KAEG;CACF;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tree.js","sources":["../../../src/lib/tree/data-source/nested-data-source.ts","../../../src/lib/tree/data-source/flat-data-source.ts","../../../src/lib/tree/tree-module.ts","../../../src/lib/tree/toggle.ts","../../../src/lib/tree/tree.ts","../../../src/lib/tree/padding.ts","../../../src/lib/tree/node.ts","../../../src/lib/tree/outlet.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 {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {BehaviorSubject, merge, Observable} from 'rxjs';\nimport {map} from 'rxjs/operators';\n\n\n/**\n * Data source for nested tree.\n *\n * The data source for nested tree doesn't have to consider node flattener, or the way to expand\n * or collapse. The expansion/collapsion will be handled by TreeControl and each non-leaf node.\n */\nexport class MatTreeNestedDataSource<T> extends DataSource<T> {\n _data = new BehaviorSubject<T[]>([]);\n\n /**\n * Data for the nested tree\n */\n get data() { return this._data.value; }\n set data(value: T[]) { this._data.next(value); }\n\n connect(collectionViewer: CollectionViewer): Observable<T[]> {\n return merge(...[collectionViewer.viewChange, this._data])\n .pipe(map(() => {\n return this.data;\n }));\n }\n\n disconnect() {\n // no op\n }\n}\n\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 {CollectionViewer, DataSource} from '@angular/cdk/collections';\nimport {FlatTreeControl, TreeControl} from '@angular/cdk/tree';\nimport {BehaviorSubject, merge, Observable} from 'rxjs';\nimport {map, take} from 'rxjs/operators';\n\n/**\n * Tree flattener to convert a normal type of node to node with children & level information.\n * Transform nested nodes of type `T` to flattened nodes of type `F`.\n *\n * For example, the input data of type `T` is nested, and contains its children data:\n * SomeNode: {\n * key: 'Fruits',\n * children: [\n * NodeOne: {\n * key: 'Apple',\n * },\n * NodeTwo: {\n * key: 'Pear',\n * }\n * ]\n * }\n * After flattener flatten the tree, the structure will become\n * SomeNode: {\n * key: 'Fruits',\n * expandable: true,\n * level: 1\n * },\n * NodeOne: {\n * key: 'Apple',\n * expandable: false,\n * level: 2\n * },\n * NodeTwo: {\n * key: 'Pear',\n * expandable: false,\n * level: 2\n * }\n * and the output flattened type is `F` with additional information.\n */\nexport class MatTreeFlattener<T, F> {\n\n constructor(public transformFunction: (node: T, level: number) => F,\n public getLevel: (node: F) => number,\n public isExpandable: (node: F) => boolean,\n public getChildren: (node: T) =>\n Observable<T[]> | T[] | undefined | null) {}\n\n _flattenNode(node: T, level: number,\n resultNodes: F[], parentMap: boolean[]): F[] {\n const flatNode = this.transformFunction(node, level);\n resultNodes.push(flatNode);\n\n if (this.isExpandable(flatNode)) {\n const childrenNodes = this.getChildren(node);\n if (childrenNodes) {\n if (Array.isArray(childrenNodes)) {\n this._flattenChildren(childrenNodes, level, resultNodes, parentMap);\n } else {\n childrenNodes.pipe(take(1)).subscribe(children => {\n this._flattenChildren(children, level, resultNodes, parentMap);\n });\n }\n }\n }\n return resultNodes;\n }\n\n _flattenChildren(children: T[], level: number,\n resultNodes: F[], parentMap: boolean[]): void {\n children.forEach((child, index) => {\n let childParentMap: boolean[] = parentMap.slice();\n childParentMap.push(index != children.length - 1);\n this._flattenNode(child, level + 1, resultNodes, childParentMap);\n });\n }\n\n /**\n * Flatten a list of node type T to flattened version of node F.\n * Please note that type T may be nested, and the length of `structuredData` may be different\n * from that of returned list `F[]`.\n */\n flattenNodes(structuredData: T[]): F[] {\n let resultNodes: F[] = [];\n structuredData.forEach(node => this._flattenNode(node, 0, resultNodes, []));\n return resultNodes;\n }\n\n /**\n * Expand flattened node with current expansion status.\n * The returned list may have different length.\n */\n expandFlattenedNodes(nodes: F[], treeControl: TreeControl<F>): F[] {\n let results: F[] = [];\n let currentExpand: boolean[] = [];\n currentExpand[0] = true;\n\n nodes.forEach(node => {\n let expand = true;\n for (let i = 0; i <= this.getLevel(node); i++) {\n expand = expand && currentExpand[i];\n }\n if (expand) {\n results.push(node);\n }\n if (this.isExpandable(node)) {\n currentExpand[this.getLevel(node) + 1] = treeControl.isExpanded(node);\n }\n });\n return results;\n }\n}\n\n\n/**\n * Data source for flat tree.\n * The data source need to handle expansion/collapsion of the tree node and change the data feed\n * to `MatTree`.\n * The nested tree nodes of type `T` are flattened through `MatTreeFlattener`, and converted\n * to type `F` for `MatTree` to consume.\n */\nexport class MatTreeFlatDataSource<T, F> extends DataSource<F> {\n _flattenedData = new BehaviorSubject<F[]>([]);\n\n _expandedData = new BehaviorSubject<F[]>([]);\n\n _data: BehaviorSubject<T[]>;\n get data() { return this._data.value; }\n set data(value: T[]) {\n this._data.next(value);\n this._flattenedData.next(this.treeFlattener.flattenNodes(this.data));\n this.treeControl.dataNodes = this._flattenedData.value;\n }\n\n constructor(private treeControl: FlatTreeControl<F>,\n private treeFlattener: MatTreeFlattener<T, F>,\n initialData: T[] = []) {\n super();\n this._data = new BehaviorSubject<T[]>(initialData);\n }\n\n connect(collectionViewer: CollectionViewer): Observable<F[]> {\n const changes = [\n collectionViewer.viewChange,\n this.treeControl.expansionModel.onChange,\n this._flattenedData\n ];\n return merge(...changes).pipe(map(() => {\n this._expandedData.next(\n this.treeFlattener.expandFlattenedNodes(this._flattenedData.value, this.treeControl));\n return this._expandedData.value;\n }));\n }\n\n disconnect() {\n // no op\n }\n}\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';\n\nimport {CdkTreeModule} from '@angular/cdk/tree';\nimport {CommonModule} from '@angular/common';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatNestedTreeNode, MatTreeNodeDef, MatTreeNode} from './node';\nimport {MatTree} from './tree';\nimport {MatTreeNodeToggle} from './toggle';\nimport {MatTreeNodeOutlet} from './outlet';\nimport {MatTreeNodePadding} from './padding';\n\nconst MAT_TREE_DIRECTIVES = [\n MatNestedTreeNode,\n MatTreeNodeDef,\n MatTreeNodePadding,\n MatTreeNodeToggle,\n MatTree,\n MatTreeNode,\n MatTreeNodeOutlet\n];\n\n@NgModule({\n imports: [CdkTreeModule, CommonModule, MatCommonModule],\n exports: MAT_TREE_DIRECTIVES,\n declarations: MAT_TREE_DIRECTIVES,\n})\nexport class MatTreeModule {}\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 {CdkTreeNodeToggle} from '@angular/cdk/tree';\nimport {Directive, Input} from '@angular/core';\n\n/**\n * Wrapper for the CdkTree's toggle with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodeToggle]',\n host: {\n '(click)': '_toggle($event)',\n },\n providers: [{provide: CdkTreeNodeToggle, useExisting: MatTreeNodeToggle}]\n})\nexport class MatTreeNodeToggle<T> extends CdkTreeNodeToggle<T> {\n @Input('matTreeNodeToggleRecursive') recursive: boolean = false;\n}\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 {CdkTree} from '@angular/cdk/tree';\nimport {ChangeDetectionStrategy, Component, ViewChild, ViewEncapsulation} from '@angular/core';\nimport {MatTreeNodeOutlet} from './outlet';\n\n/**\n * Wrapper for the CdkTable with Material design styles.\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-tree',\n exportAs: 'matTree',\n template: `<ng-container matTreeNodeOutlet></ng-container>`,\n host: {\n 'class': 'mat-tree',\n 'role': 'tree',\n },\n styleUrls: ['tree.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{provide: CdkTree, useExisting: MatTree}]\n})\nexport class MatTree<T> extends CdkTree<T> {\n // Outlets within the tree's template where the dataNodes will be inserted.\n @ViewChild(MatTreeNodeOutlet) _nodeOutlet: MatTreeNodeOutlet;\n}\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 */\nimport {CdkTreeNodePadding} from '@angular/cdk/tree';\nimport {Directive, Input} from '@angular/core';\n\n/**\n * Wrapper for the CdkTree padding with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodePadding]',\n providers: [{provide: CdkTreeNodePadding, useExisting: MatTreeNodePadding}]\n})\nexport class MatTreeNodePadding<T> extends CdkTreeNodePadding<T> {\n\n /** The level of depth of the tree node. The padding will be `level * indent` pixels. */\n @Input('matTreeNodePadding') level: number;\n\n /** The indent for each level. Default number 40px from material design menu sub-menu spec. */\n @Input('matTreeNodePaddingIndent') indent: number;\n}\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 {CdkNestedTreeNode, CdkTree, CdkTreeNode, CdkTreeNodeDef} from '@angular/cdk/tree';\nimport {\n AfterContentInit,\n Attribute,\n ContentChildren,\n Directive,\n ElementRef,\n Input,\n IterableDiffers,\n OnDestroy,\n QueryList,\n} from '@angular/core';\nimport {\n CanDisable, CanDisableCtor,\n HasTabIndex,\n HasTabIndexCtor,\n mixinDisabled,\n mixinTabIndex,\n} from '@angular/material/core';\nimport {MatTreeNodeOutlet} from './outlet';\n\nexport const _MatTreeNodeMixinBase: HasTabIndexCtor & CanDisableCtor & typeof CdkTreeNode =\n mixinTabIndex(mixinDisabled(CdkTreeNode));\n\nexport const _MatNestedTreeNodeMixinBase:\n HasTabIndexCtor & CanDisableCtor & typeof CdkNestedTreeNode =\n mixinTabIndex(mixinDisabled(CdkNestedTreeNode));\n\n/**\n * Wrapper for the CdkTree node with Material design styles.\n */\n@Directive({\n selector: 'mat-tree-node',\n exportAs: 'matTreeNode',\n inputs: ['disabled', 'tabIndex'],\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.aria-level]': 'role === \"treeitem\" ? level : null',\n '[attr.role]': 'role',\n 'class': 'mat-tree-node'\n },\n providers: [{provide: CdkTreeNode, useExisting: MatTreeNode}]\n})\nexport class MatTreeNode<T> extends _MatTreeNodeMixinBase<T>\n implements CanDisable, HasTabIndex {\n @Input() role: 'treeitem' | 'group' = 'treeitem';\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n @Attribute('tabindex') tabIndex: string) {\n super(_elementRef, _tree);\n\n this.tabIndex = Number(tabIndex) || 0;\n }\n}\n\n/**\n * Wrapper for the CdkTree node definition with Material design styles.\n */\n@Directive({\n selector: '[matTreeNodeDef]',\n inputs: [\n 'when: matTreeNodeDefWhen'\n ],\n providers: [{provide: CdkTreeNodeDef, useExisting: MatTreeNodeDef}]\n})\nexport class MatTreeNodeDef<T> extends CdkTreeNodeDef<T> {\n @Input('matTreeNode') data: T;\n}\n\n/**\n * Wrapper for the CdkTree nested node with Material design styles.\n */\n@Directive({\n selector: 'mat-nested-tree-node',\n exportAs: 'matNestedTreeNode',\n host: {\n '[attr.aria-expanded]': 'isExpanded',\n '[attr.role]': 'role',\n 'class': 'mat-nested-tree-node',\n },\n inputs: ['disabled', 'tabIndex'],\n providers: [\n {provide: CdkNestedTreeNode, useExisting: MatNestedTreeNode},\n {provide: CdkTreeNode, useExisting: MatNestedTreeNode}\n ]\n})\nexport class MatNestedTreeNode<T> extends _MatNestedTreeNodeMixinBase<T>\n implements AfterContentInit, CanDisable, HasTabIndex, OnDestroy {\n\n @Input('matNestedTreeNode') node: T;\n\n @ContentChildren(MatTreeNodeOutlet) nodeOutlet: QueryList<MatTreeNodeOutlet>;\n\n constructor(protected _elementRef: ElementRef<HTMLElement>,\n protected _tree: CdkTree<T>,\n protected _differs: IterableDiffers,\n @Attribute('tabindex') tabIndex: string) {\n super(_elementRef, _tree, _differs);\n\n this.tabIndex = Number(tabIndex) || 0;\n }\n\n // This is a workaround for https://github.com/angular/angular/issues/23091\n // In aot mode, the lifecycle hooks from parent class are not called.\n // TODO(tinayuangao): Remove when the angular issue #23091 is fixed\n ngAfterContentInit() {\n super.ngAfterContentInit();\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\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 */\nimport {CdkTreeNodeOutlet} from '@angular/cdk/tree';\nimport {\n Directive,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * Outlet for nested CdkNode. Put `[matTreeNodeOutlet]` on a tag to place children dataNodes\n * inside the outlet.\n */\n@Directive({\n selector: '[matTreeNodeOutlet]'\n})\nexport class MatTreeNodeOutlet implements CdkTreeNodeOutlet {\n constructor(public viewContainer: ViewContainerRef) {}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AOQA;;;;AAYA,AAAA,MAAa,iBAAiB,CAA9B;;;;IACE,WAAF,CAAqB,aAA+B,EAApD;QAAqB,IAArB,CAAA,aAAkC,GAAb,aAAa,CAAkB;KAAI;;;IAJxD,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,qBAAqB;aAChC,EAAD,EAAA;;;;IATA,EAAA,IAAA,EAAE,gBAAgB,EAAlB;;;;;;;;ADmBA,AAAA,MAAa,qBAAqB,GAC9B,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAD7C;;AAGA,AAAA,MAAa,2BAA2B,GAEhC,aAA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U,GAAZ;;KAEG;CACF;;;;;;;;;;;;;ADjJD,AAAA,MAAa,uBAA2B,SAAQ,UAAa,CAA7D;IAAA,WAAA,GAAA;;QACE,IAAF,CAAA,KAAO,GAAG,IAAI,eAAe,CAAM,EAAE,CAAC,CAAC;KAkBtC;;;;;IAbC,IAAI,IAAI,GAAV,EAAe,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;;;;;IACvC,IAAI,IAAI,CAAC,KAAU,EAArB,EAAyB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;;;;;IAEhD,OAAO,CAAC,gBAAkC,EAA5C;QACI,OAAO,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;aACvD,IAAI,CAAC,GAAG,CAAC,MAAhB;YACQ,OAAO,IAAI,CAAC,IAAI,CAAC;SAClB,CAAC,CAAC,CAAC;KACP;;;;IAED,UAAU,GAAZ;;KAEG;CACF;;;;;;;;;;;;;;"}
@@ -1243,5 +1243,5 @@ var MatAutocompleteModule = /** @class */ (function () {
1243
1243
  * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1244
1244
  */
1245
1245
 
1246
- export { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MatAutocompleteSelectedEvent, MatAutocompleteBase, _MatAutocompleteMixinBase, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MatAutocomplete, MatAutocompleteModule, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, getMatAutocompleteMissingPanelError, AUTOCOMPLETE_OPTION_HEIGHT, AUTOCOMPLETE_PANEL_HEIGHT, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, MatAutocompleteTrigger, MatAutocompleteOrigin as ɵa28 };
1246
+ export { MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY, MatAutocompleteSelectedEvent, MatAutocompleteBase, _MatAutocompleteMixinBase, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, MatAutocomplete, MatAutocompleteModule, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY, getMatAutocompleteMissingPanelError, AUTOCOMPLETE_OPTION_HEIGHT, AUTOCOMPLETE_PANEL_HEIGHT, MAT_AUTOCOMPLETE_SCROLL_STRATEGY, MAT_AUTOCOMPLETE_SCROLL_STRATEGY_FACTORY_PROVIDER, MAT_AUTOCOMPLETE_VALUE_ACCESSOR, MatAutocompleteTrigger, MatAutocompleteOrigin as ɵa30 };
1247
1247
  //# sourceMappingURL=autocomplete.es5.js.map
package/esm5/badge.es5.js CHANGED
@@ -134,8 +134,14 @@ var MatBadge = /** @class */ (function (_super) {
134
134
  */
135
135
  function (newDescription) {
136
136
  if (newDescription !== this._description) {
137
+ /** @type {?} */
138
+ var badgeElement = this._badgeElement;
137
139
  this._updateHostAriaDescription(newDescription, this._description);
138
140
  this._description = newDescription;
141
+ if (badgeElement) {
142
+ newDescription ? badgeElement.setAttribute('aria-label', newDescription) :
143
+ badgeElement.removeAttribute('aria-label');
144
+ }
139
145
  }
140
146
  },
141
147
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"badge.es5.js","sources":["../../../src/lib/badge/badge-module.ts","../../../src/lib/badge/badge.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 {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {MatBadge} from './badge';\n\n\n@NgModule({\n imports: [\n A11yModule,\n MatCommonModule\n ],\n exports: [MatBadge],\n declarations: [MatBadge],\n})\nexport class MatBadgeModule {}\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 {AriaDescriber} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Renderer2,\n} from '@angular/core';\nimport {ThemePalette, mixinDisabled, CanDisableCtor, CanDisable} from '@angular/material/core';\n\n\nlet nextId = 0;\n\n// Boilerplate for applying mixins to MatBadge.\n/** @docs-private */\nexport class MatBadgeBase {}\n\nexport const _MatBadgeMixinBase:\n CanDisableCtor & typeof MatBadgeBase = mixinDisabled(MatBadgeBase);\n\nexport type MatBadgePosition = 'above after' | 'above before' | 'below before' | 'below after';\nexport type MatBadgeSize = 'small' | 'medium' | 'large';\n\n/** Directive to display a text badge. */\n@Directive({\n selector: '[matBadge]',\n inputs: ['disabled: matBadgeDisabled'],\n host: {\n 'class': 'mat-badge',\n '[class.mat-badge-overlap]': 'overlap',\n '[class.mat-badge-above]': 'isAbove()',\n '[class.mat-badge-below]': '!isAbove()',\n '[class.mat-badge-before]': '!isAfter()',\n '[class.mat-badge-after]': 'isAfter()',\n '[class.mat-badge-small]': 'size === \"small\"',\n '[class.mat-badge-medium]': 'size === \"medium\"',\n '[class.mat-badge-large]': 'size === \"large\"',\n '[class.mat-badge-hidden]': 'hidden || !_hasContent',\n '[class.mat-badge-disabled]': 'disabled',\n },\n})\nexport class MatBadge extends _MatBadgeMixinBase implements OnDestroy, CanDisable {\n /** Whether the badge has any content. */\n _hasContent = false;\n\n /** The color of the badge. Can be `primary`, `accent`, or `warn`. */\n @Input('matBadgeColor')\n get color(): ThemePalette { return this._color; }\n set color(value: ThemePalette) {\n this._setColor(value);\n this._color = value;\n }\n private _color: ThemePalette = 'primary';\n\n /** Whether the badge should overlap its contents or not */\n @Input('matBadgeOverlap')\n get overlap(): boolean { return this._overlap; }\n set overlap(val: boolean) {\n this._overlap = coerceBooleanProperty(val);\n }\n private _overlap: boolean = true;\n\n /**\n * Position the badge should reside.\n * Accepts any combination of 'above'|'below' and 'before'|'after'\n */\n @Input('matBadgePosition') position: MatBadgePosition = 'above after';\n\n /** The content for the badge */\n @Input('matBadge')\n get content(): string { return this._content; }\n set content(value: string) {\n this._content = value;\n this._hasContent = value != null && `${value}`.trim().length > 0;\n this._updateTextContent();\n }\n private _content: string;\n\n /** Message used to describe the decorated element via aria-describedby */\n @Input('matBadgeDescription')\n get description(): string { return this._description; }\n set description(newDescription: string) {\n if (newDescription !== this._description) {\n this._updateHostAriaDescription(newDescription, this._description);\n this._description = newDescription;\n }\n }\n private _description: string;\n\n /** Size of the badge. Can be 'small', 'medium', or 'large'. */\n @Input('matBadgeSize') size: MatBadgeSize = 'medium';\n\n /** Whether the badge is hidden. */\n @Input('matBadgeHidden')\n get hidden(): boolean { return this._hidden; }\n set hidden(val: boolean) {\n this._hidden = coerceBooleanProperty(val);\n }\n private _hidden: boolean;\n\n /** Unique id for the badge */\n _id: number = nextId++;\n\n private _badgeElement: HTMLElement;\n\n constructor(\n @Optional() @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _elementRef: ElementRef<HTMLElement>,\n private _ariaDescriber: AriaDescriber,\n /** @breaking-change 8.0.0 Make _renderer a required param and remove _document. */\n private _renderer?: Renderer2) {\n super();\n }\n\n /** Whether the badge is above the host or not */\n isAbove(): boolean {\n return this.position.indexOf('below') === -1;\n }\n\n /** Whether the badge is after the host or not */\n isAfter(): boolean {\n return this.position.indexOf('before') === -1;\n }\n\n ngOnDestroy() {\n const badgeElement = this._badgeElement;\n\n if (badgeElement) {\n if (this.description) {\n this._ariaDescriber.removeDescription(badgeElement, this.description);\n }\n\n // When creating a badge through the Renderer, Angular will keep it in an index.\n // We have to destroy it ourselves, otherwise it'll be retained in memory.\n // @breaking-change 8.0.0 remove _renderer from null.\n if (this._renderer && this._renderer.destroyNode) {\n this._renderer.destroyNode(badgeElement);\n }\n }\n }\n\n /** Injects a span element into the DOM with the content. */\n private _updateTextContent(): HTMLSpanElement {\n if (!this._badgeElement) {\n this._badgeElement = this._createBadgeElement();\n } else {\n this._badgeElement.textContent = this.content;\n }\n return this._badgeElement;\n }\n\n /** Creates the badge element */\n private _createBadgeElement(): HTMLElement {\n // @breaking-change 8.0.0 Remove null check for _renderer\n const rootNode = this._renderer || this._document;\n const badgeElement = rootNode.createElement('span');\n const activeClass = 'mat-badge-active';\n\n badgeElement.setAttribute('id', `mat-badge-content-${this._id}`);\n badgeElement.classList.add('mat-badge-content');\n badgeElement.textContent = this.content;\n\n if (this.description) {\n badgeElement.setAttribute('aria-label', this.description);\n }\n\n this._elementRef.nativeElement.appendChild(badgeElement);\n\n // animate in after insertion\n if (typeof requestAnimationFrame === 'function') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n badgeElement.classList.add(activeClass);\n });\n });\n } else {\n badgeElement.classList.add(activeClass);\n }\n\n return badgeElement;\n }\n\n /** Sets the aria-label property on the element */\n private _updateHostAriaDescription(newDescription: string, oldDescription: string): void {\n // ensure content available before setting label\n const content = this._updateTextContent();\n\n if (oldDescription) {\n this._ariaDescriber.removeDescription(content, oldDescription);\n }\n\n if (newDescription) {\n this._ariaDescriber.describe(content, newDescription);\n }\n }\n\n /** Adds css theme class given the color to the component host */\n private _setColor(colorPalette: ThemePalette) {\n if (colorPalette !== this._color) {\n if (this._color) {\n this._elementRef.nativeElement.classList.remove(`mat-badge-${this._color}`);\n }\n if (colorPalette) {\n this._elementRef.nativeElement.classList.add(`mat-badge-${colorPalette}`);\n }\n }\n }\n\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;ACwBA,IAAI,MAAM,GAAG,CAAC,CAAd;;;;;AAIA,AAAA,IAAA;;;;;;IAAA,SAAA,YAAA,GAAA;KAA4B;IAAD,OAA3B,YAA4B,CAA5B;CAA4B,EAA5B,CAAA,CAA4B;;AA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AS,iBAAiB,EAA1B,EAAA,CAAA;QAWA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,kBAAkB,EAA3B,EAAA,CAAA;QAGA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,UAAU,EAAnB,EAAA,CAAA;QAUA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,qBAAqB,EAA9B,EAAA,CAAA;QAWA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,cAAc,EAAvB,EAAA,CAAA;QAGA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,gBAAgB,EAAzB,EAAA,CAAA;;IAoHA,OAAA,QAAC,CAAD;CAAC,CAxK6B,kBAAkB,CAwKhD,CAAA;;;;;;ADhNA,IAAA,cAAA,kBAAA,YAAA;IAAA,SAAA,cAAA,GAAA;KAQ8B;;QAR9B,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE;wBACP,UAAU;wBACV,eAAe;qBAChB;oBACD,OAAO,EAAE,CAAC,QAAQ,CAAC;oBACnB,YAAY,EAAE,CAAC,QAAQ,CAAC;iBACzB,EAAD,EAAA;;IAC6B,OAA7B,cAA8B,CAA9B;CAA8B,EAA9B,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"badge.es5.js","sources":["../../../src/lib/badge/badge-module.ts","../../../src/lib/badge/badge.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 {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {MatBadge} from './badge';\n\n\n@NgModule({\n imports: [\n A11yModule,\n MatCommonModule\n ],\n exports: [MatBadge],\n declarations: [MatBadge],\n})\nexport class MatBadgeModule {}\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 {AriaDescriber} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {DOCUMENT} from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Renderer2,\n} from '@angular/core';\nimport {ThemePalette, mixinDisabled, CanDisableCtor, CanDisable} from '@angular/material/core';\n\n\nlet nextId = 0;\n\n// Boilerplate for applying mixins to MatBadge.\n/** @docs-private */\nexport class MatBadgeBase {}\n\nexport const _MatBadgeMixinBase:\n CanDisableCtor & typeof MatBadgeBase = mixinDisabled(MatBadgeBase);\n\nexport type MatBadgePosition = 'above after' | 'above before' | 'below before' | 'below after';\nexport type MatBadgeSize = 'small' | 'medium' | 'large';\n\n/** Directive to display a text badge. */\n@Directive({\n selector: '[matBadge]',\n inputs: ['disabled: matBadgeDisabled'],\n host: {\n 'class': 'mat-badge',\n '[class.mat-badge-overlap]': 'overlap',\n '[class.mat-badge-above]': 'isAbove()',\n '[class.mat-badge-below]': '!isAbove()',\n '[class.mat-badge-before]': '!isAfter()',\n '[class.mat-badge-after]': 'isAfter()',\n '[class.mat-badge-small]': 'size === \"small\"',\n '[class.mat-badge-medium]': 'size === \"medium\"',\n '[class.mat-badge-large]': 'size === \"large\"',\n '[class.mat-badge-hidden]': 'hidden || !_hasContent',\n '[class.mat-badge-disabled]': 'disabled',\n },\n})\nexport class MatBadge extends _MatBadgeMixinBase implements OnDestroy, CanDisable {\n /** Whether the badge has any content. */\n _hasContent = false;\n\n /** The color of the badge. Can be `primary`, `accent`, or `warn`. */\n @Input('matBadgeColor')\n get color(): ThemePalette { return this._color; }\n set color(value: ThemePalette) {\n this._setColor(value);\n this._color = value;\n }\n private _color: ThemePalette = 'primary';\n\n /** Whether the badge should overlap its contents or not */\n @Input('matBadgeOverlap')\n get overlap(): boolean { return this._overlap; }\n set overlap(val: boolean) {\n this._overlap = coerceBooleanProperty(val);\n }\n private _overlap: boolean = true;\n\n /**\n * Position the badge should reside.\n * Accepts any combination of 'above'|'below' and 'before'|'after'\n */\n @Input('matBadgePosition') position: MatBadgePosition = 'above after';\n\n /** The content for the badge */\n @Input('matBadge')\n get content(): string { return this._content; }\n set content(value: string) {\n this._content = value;\n this._hasContent = value != null && `${value}`.trim().length > 0;\n this._updateTextContent();\n }\n private _content: string;\n\n /** Message used to describe the decorated element via aria-describedby */\n @Input('matBadgeDescription')\n get description(): string { return this._description; }\n set description(newDescription: string) {\n if (newDescription !== this._description) {\n const badgeElement = this._badgeElement;\n this._updateHostAriaDescription(newDescription, this._description);\n this._description = newDescription;\n\n if (badgeElement) {\n newDescription ? badgeElement.setAttribute('aria-label', newDescription) :\n badgeElement.removeAttribute('aria-label');\n }\n }\n }\n private _description: string;\n\n /** Size of the badge. Can be 'small', 'medium', or 'large'. */\n @Input('matBadgeSize') size: MatBadgeSize = 'medium';\n\n /** Whether the badge is hidden. */\n @Input('matBadgeHidden')\n get hidden(): boolean { return this._hidden; }\n set hidden(val: boolean) {\n this._hidden = coerceBooleanProperty(val);\n }\n private _hidden: boolean;\n\n /** Unique id for the badge */\n _id: number = nextId++;\n\n private _badgeElement: HTMLElement;\n\n constructor(\n @Optional() @Inject(DOCUMENT) private _document: any,\n private _ngZone: NgZone,\n private _elementRef: ElementRef<HTMLElement>,\n private _ariaDescriber: AriaDescriber,\n /** @breaking-change 8.0.0 Make _renderer a required param and remove _document. */\n private _renderer?: Renderer2) {\n super();\n }\n\n /** Whether the badge is above the host or not */\n isAbove(): boolean {\n return this.position.indexOf('below') === -1;\n }\n\n /** Whether the badge is after the host or not */\n isAfter(): boolean {\n return this.position.indexOf('before') === -1;\n }\n\n ngOnDestroy() {\n const badgeElement = this._badgeElement;\n\n if (badgeElement) {\n if (this.description) {\n this._ariaDescriber.removeDescription(badgeElement, this.description);\n }\n\n // When creating a badge through the Renderer, Angular will keep it in an index.\n // We have to destroy it ourselves, otherwise it'll be retained in memory.\n // @breaking-change 8.0.0 remove _renderer from null.\n if (this._renderer && this._renderer.destroyNode) {\n this._renderer.destroyNode(badgeElement);\n }\n }\n }\n\n /** Injects a span element into the DOM with the content. */\n private _updateTextContent(): HTMLSpanElement {\n if (!this._badgeElement) {\n this._badgeElement = this._createBadgeElement();\n } else {\n this._badgeElement.textContent = this.content;\n }\n return this._badgeElement;\n }\n\n /** Creates the badge element */\n private _createBadgeElement(): HTMLElement {\n // @breaking-change 8.0.0 Remove null check for _renderer\n const rootNode = this._renderer || this._document;\n const badgeElement = rootNode.createElement('span');\n const activeClass = 'mat-badge-active';\n\n badgeElement.setAttribute('id', `mat-badge-content-${this._id}`);\n badgeElement.classList.add('mat-badge-content');\n badgeElement.textContent = this.content;\n\n if (this.description) {\n badgeElement.setAttribute('aria-label', this.description);\n }\n\n this._elementRef.nativeElement.appendChild(badgeElement);\n\n // animate in after insertion\n if (typeof requestAnimationFrame === 'function') {\n this._ngZone.runOutsideAngular(() => {\n requestAnimationFrame(() => {\n badgeElement.classList.add(activeClass);\n });\n });\n } else {\n badgeElement.classList.add(activeClass);\n }\n\n return badgeElement;\n }\n\n /** Sets the aria-label property on the element */\n private _updateHostAriaDescription(newDescription: string, oldDescription: string): void {\n // ensure content available before setting label\n const content = this._updateTextContent();\n\n if (oldDescription) {\n this._ariaDescriber.removeDescription(content, oldDescription);\n }\n\n if (newDescription) {\n this._ariaDescriber.describe(content, newDescription);\n }\n }\n\n /** Adds css theme class given the color to the component host */\n private _setColor(colorPalette: ThemePalette) {\n if (colorPalette !== this._color) {\n if (this._color) {\n this._elementRef.nativeElement.classList.remove(`mat-badge-${this._color}`);\n }\n if (colorPalette) {\n this._elementRef.nativeElement.classList.add(`mat-badge-${colorPalette}`);\n }\n }\n }\n\n}\n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AAE,CAAC,QAAQ,CAAC;iBACzB,EAAD,EAAA;;IAC6B,OAA7B,cAA8B,CAA9B;CAA8B,EAA9B,CAAA;;;;;;;;;;;;;;"}
@@ -60,10 +60,13 @@ MatBottomSheetConfig = /** @class */ (function () {
60
60
  * the `HashLocationStrategy`).
61
61
  */
62
62
  this.closeOnNavigation = true;
63
+ // Note that this is disabled by default, because while the a11y recommendations are to focus
64
+ // the first focusable element, doing so prevents screen readers from reading out the
65
+ // rest of the bottom sheet content.
63
66
  /**
64
67
  * Whether the bottom sheet should focus the first focusable element on open.
65
68
  */
66
- this.autoFocus = true;
69
+ this.autoFocus = false;
67
70
  /**
68
71
  * Whether the bottom sheet should restore focus to the
69
72
  * previously-focused element, after it's closed.
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-sheet.es5.js","sources":["../../../src/lib/bottom-sheet/bottom-sheet.ts","../../../src/lib/bottom-sheet/bottom-sheet-ref.ts","../../../src/lib/bottom-sheet/bottom-sheet-module.ts","../../../src/lib/bottom-sheet/bottom-sheet-container.ts","../../../src/lib/bottom-sheet/bottom-sheet-animations.ts","../../../src/lib/bottom-sheet/bottom-sheet-config.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 {Directionality} from '@angular/cdk/bidi';\nimport {Overlay, OverlayConfig, OverlayRef} from '@angular/cdk/overlay';\nimport {ComponentPortal, ComponentType, PortalInjector, TemplatePortal} from '@angular/cdk/portal';\nimport {\n ComponentRef,\n Injectable,\n Injector,\n Optional,\n SkipSelf,\n TemplateRef,\n InjectionToken,\n Inject,\n OnDestroy,\n} from '@angular/core';\nimport {Location} from '@angular/common';\nimport {of as observableOf} from 'rxjs';\nimport {MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheetModule} from './bottom-sheet-module';\nimport {MatBottomSheetRef} from './bottom-sheet-ref';\n\n\n/** Injection token that can be used to specify default bottom sheet options. */\nexport const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS =\n new InjectionToken<MatBottomSheetConfig>('mat-bottom-sheet-default-options');\n\n/**\n * Service to trigger Material Design bottom sheets.\n */\n@Injectable({providedIn: MatBottomSheetModule})\nexport class MatBottomSheet implements OnDestroy {\n private _bottomSheetRefAtThisLevel: MatBottomSheetRef<any> | null = null;\n\n /** Reference to the currently opened bottom sheet. */\n get _openedBottomSheetRef(): MatBottomSheetRef<any> | null {\n const parent = this._parentBottomSheet;\n return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;\n }\n\n set _openedBottomSheetRef(value: MatBottomSheetRef<any> | null) {\n if (this._parentBottomSheet) {\n this._parentBottomSheet._openedBottomSheetRef = value;\n } else {\n this._bottomSheetRefAtThisLevel = value;\n }\n }\n\n constructor(\n private _overlay: Overlay,\n private _injector: Injector,\n @Optional() @SkipSelf() private _parentBottomSheet: MatBottomSheet,\n @Optional() private _location?: Location,\n @Optional() @Inject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS)\n private _defaultOptions?: MatBottomSheetConfig) {}\n\n open<T, D = any, R = any>(component: ComponentType<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;\n open<T, D = any, R = any>(template: TemplateRef<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;\n\n open<T, D = any, R = any>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R> {\n\n const _config =\n _applyConfigDefaults(this._defaultOptions || new MatBottomSheetConfig(), config);\n const overlayRef = this._createOverlay(_config);\n const container = this._attachContainer(overlayRef, _config);\n const ref = new MatBottomSheetRef<T, R>(container, overlayRef, this._location);\n\n if (componentOrTemplateRef instanceof TemplateRef) {\n container.attachTemplatePortal(new TemplatePortal<T>(componentOrTemplateRef, null!, {\n $implicit: _config.data,\n bottomSheetRef: ref\n } as any));\n } else {\n const portal = new ComponentPortal(componentOrTemplateRef, undefined,\n this._createInjector(_config, ref));\n const contentRef = container.attachComponentPortal(portal);\n ref.instance = contentRef.instance;\n }\n\n // When the bottom sheet is dismissed, clear the reference to it.\n ref.afterDismissed().subscribe(() => {\n // Clear the bottom sheet ref if it hasn't already been replaced by a newer one.\n if (this._openedBottomSheetRef == ref) {\n this._openedBottomSheetRef = null;\n }\n });\n\n if (this._openedBottomSheetRef) {\n // If a bottom sheet is already in view, dismiss it and enter the\n // new bottom sheet after exit animation is complete.\n this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance.enter());\n this._openedBottomSheetRef.dismiss();\n } else {\n // If no bottom sheet is in view, enter the new bottom sheet.\n ref.containerInstance.enter();\n }\n\n this._openedBottomSheetRef = ref;\n\n return ref;\n }\n\n /**\n * Dismisses the currently-visible bottom sheet.\n */\n dismiss(): void {\n if (this._openedBottomSheetRef) {\n this._openedBottomSheetRef.dismiss();\n }\n }\n\n ngOnDestroy() {\n if (this._bottomSheetRefAtThisLevel) {\n this._bottomSheetRefAtThisLevel.dismiss();\n }\n }\n\n /**\n * Attaches the bottom sheet container component to the overlay.\n */\n private _attachContainer(overlayRef: OverlayRef,\n config: MatBottomSheetConfig): MatBottomSheetContainer {\n\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n const injector = new PortalInjector(userInjector || this._injector, new WeakMap([\n [MatBottomSheetConfig, config]\n ]));\n\n const containerPortal =\n new ComponentPortal(MatBottomSheetContainer, config.viewContainerRef, injector);\n const containerRef: ComponentRef<MatBottomSheetContainer> = overlayRef.attach(containerPortal);\n return containerRef.instance;\n }\n\n /**\n * Creates a new overlay and places it in the correct location.\n * @param config The user-specified bottom sheet config.\n */\n private _createOverlay(config: MatBottomSheetConfig): OverlayRef {\n const overlayConfig = new OverlayConfig({\n direction: config.direction,\n hasBackdrop: config.hasBackdrop,\n disposeOnNavigation: config.closeOnNavigation,\n maxWidth: '100%',\n scrollStrategy: this._overlay.scrollStrategies.block(),\n positionStrategy: this._overlay.position()\n .global()\n .centerHorizontally()\n .bottom('0')\n });\n\n if (config.backdropClass) {\n overlayConfig.backdropClass = config.backdropClass;\n }\n\n return this._overlay.create(overlayConfig);\n }\n\n /**\n * Creates an injector to be used inside of a bottom sheet component.\n * @param config Config that was used to create the bottom sheet.\n * @param bottomSheetRef Reference to the bottom sheet.\n */\n private _createInjector<T>(config: MatBottomSheetConfig,\n bottomSheetRef: MatBottomSheetRef<T>): PortalInjector {\n\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n const injectionTokens = new WeakMap<any, any>([\n [MatBottomSheetRef, bottomSheetRef],\n [MAT_BOTTOM_SHEET_DATA, config.data]\n ]);\n\n if (config.direction &&\n (!userInjector || !userInjector.get<Directionality | null>(Directionality, null))) {\n injectionTokens.set(Directionality, {\n value: config.direction,\n change: observableOf()\n });\n }\n\n return new PortalInjector(userInjector || this._injector, injectionTokens);\n }\n}\n\n/**\n * Applies default options to the bottom sheet config.\n * @param defaults Object containing the default values to which to fall back.\n * @param config The configuration to which the defaults will be applied.\n * @returns The new configuration object with defaults applied.\n */\nfunction _applyConfigDefaults(defaults: MatBottomSheetConfig,\n config?: MatBottomSheetConfig): MatBottomSheetConfig {\n return {...defaults, ...config};\n}\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 {Location} from '@angular/common';\nimport {ESCAPE} from '@angular/cdk/keycodes';\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {merge, Observable, Subject} from 'rxjs';\nimport {filter, take} from 'rxjs/operators';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n\n/**\n * Reference to a bottom sheet dispatched from the bottom sheet service.\n */\nexport class MatBottomSheetRef<T = any, R = any> {\n /** Instance of the component making up the content of the bottom sheet. */\n instance: T;\n\n /**\n * Instance of the component into which the bottom sheet content is projected.\n * @docs-private\n */\n containerInstance: MatBottomSheetContainer;\n\n /** Subject for notifying the user that the bottom sheet has been dismissed. */\n private readonly _afterDismissed = new Subject<R | undefined>();\n\n /** Subject for notifying the user that the bottom sheet has opened and appeared. */\n private readonly _afterOpened = new Subject<void>();\n\n /** Result to be passed down to the `afterDismissed` stream. */\n private _result: R | undefined;\n\n constructor(\n containerInstance: MatBottomSheetContainer,\n private _overlayRef: OverlayRef,\n // @breaking-change 8.0.0 `_location` parameter to be removed.\n _location?: Location) {\n this.containerInstance = containerInstance;\n\n // Emit when opening animation completes\n containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'done' && event.toState === 'visible'),\n take(1)\n )\n .subscribe(() => {\n this._afterOpened.next();\n this._afterOpened.complete();\n });\n\n // Dispose overlay when closing animation is complete\n containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'done' && event.toState === 'hidden'),\n take(1)\n )\n .subscribe(() => {\n this._overlayRef.dispose();\n this._afterDismissed.next(this._result);\n this._afterDismissed.complete();\n });\n\n if (!containerInstance.bottomSheetConfig.disableClose) {\n merge(\n _overlayRef.backdropClick(),\n _overlayRef.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE))\n ).subscribe(() => this.dismiss());\n }\n }\n\n /**\n * Dismisses the bottom sheet.\n * @param result Data to be passed back to the bottom sheet opener.\n */\n dismiss(result?: R): void {\n if (!this._afterDismissed.closed) {\n // Transition the backdrop in parallel to the bottom sheet.\n this.containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'start'),\n take(1)\n ).subscribe(() => this._overlayRef.detachBackdrop());\n\n this._result = result;\n this.containerInstance.exit();\n }\n }\n\n /** Gets an observable that is notified when the bottom sheet is finished closing. */\n afterDismissed(): Observable<R | undefined> {\n return this._afterDismissed.asObservable();\n }\n\n /** Gets an observable that is notified when the bottom sheet has opened and appeared. */\n afterOpened(): Observable<void> {\n return this._afterOpened.asObservable();\n }\n\n /**\n * Gets an observable that emits when the overlay's backdrop has been clicked.\n */\n backdropClick(): Observable<MouseEvent> {\n return this._overlayRef.backdropClick();\n }\n\n /**\n * Gets an observable that emits when keydown events are targeted on the overlay.\n */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._overlayRef.keydownEvents();\n }\n}\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 {OverlayModule} from '@angular/cdk/overlay';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n MatCommonModule,\n PortalModule,\n ],\n exports: [MatBottomSheetContainer, MatCommonModule],\n declarations: [MatBottomSheetContainer],\n entryComponents: [MatBottomSheetContainer],\n})\nexport class MatBottomSheetModule {}\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 {\n Component,\n ComponentRef,\n EmbeddedViewRef,\n ViewChild,\n OnDestroy,\n ElementRef,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n ChangeDetectorRef,\n EventEmitter,\n Inject,\n Optional,\n} from '@angular/core';\nimport {AnimationEvent} from '@angular/animations';\nimport {\n BasePortalOutlet,\n ComponentPortal,\n TemplatePortal,\n CdkPortalOutlet,\n} from '@angular/cdk/portal';\nimport {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {MatBottomSheetConfig} from './bottom-sheet-config';\nimport {matBottomSheetAnimations} from './bottom-sheet-animations';\nimport {Subscription} from 'rxjs';\nimport {DOCUMENT} from '@angular/common';\nimport {FocusTrap, FocusTrapFactory} from '@angular/cdk/a11y';\n\n// TODO(crisbeto): consolidate some logic between this, MatDialog and MatSnackBar\n\n/**\n * Internal component that wraps user-provided bottom sheet content.\n * @docs-private\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-bottom-sheet-container',\n templateUrl: 'bottom-sheet-container.html',\n styleUrls: ['bottom-sheet-container.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n animations: [matBottomSheetAnimations.bottomSheetState],\n host: {\n 'class': 'mat-bottom-sheet-container',\n 'tabindex': '-1',\n 'role': 'dialog',\n 'aria-modal': 'true',\n '[attr.aria-label]': 'bottomSheetConfig?.ariaLabel',\n '[@state]': '_animationState',\n '(@state.start)': '_onAnimationStart($event)',\n '(@state.done)': '_onAnimationDone($event)'\n },\n})\nexport class MatBottomSheetContainer extends BasePortalOutlet implements OnDestroy {\n private _breakpointSubscription: Subscription;\n\n /** The portal outlet inside of this container into which the content will be loaded. */\n @ViewChild(CdkPortalOutlet) _portalOutlet: CdkPortalOutlet;\n\n /** The state of the bottom sheet animations. */\n _animationState: 'void' | 'visible' | 'hidden' = 'void';\n\n /** Emits whenever the state of the animation changes. */\n _animationStateChanged = new EventEmitter<AnimationEvent>();\n\n /** The class that traps and manages focus within the bottom sheet. */\n private _focusTrap: FocusTrap;\n\n /** Element that was focused before the bottom sheet was opened. */\n private _elementFocusedBeforeOpened: HTMLElement | null = null;\n\n /** Server-side rendering-compatible reference to the global document object. */\n private _document: Document;\n\n /** Whether the component has been destroyed. */\n private _destroyed: boolean;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n private _focusTrapFactory: FocusTrapFactory,\n breakpointObserver: BreakpointObserver,\n @Optional() @Inject(DOCUMENT) document: any,\n /** The bottom sheet configuration. */\n public bottomSheetConfig: MatBottomSheetConfig) {\n super();\n\n this._document = document;\n this._breakpointSubscription = breakpointObserver\n .observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe(() => {\n this._toggleClass('mat-bottom-sheet-container-medium',\n breakpointObserver.isMatched(Breakpoints.Medium));\n this._toggleClass('mat-bottom-sheet-container-large',\n breakpointObserver.isMatched(Breakpoints.Large));\n this._toggleClass('mat-bottom-sheet-container-xlarge',\n breakpointObserver.isMatched(Breakpoints.XLarge));\n });\n }\n\n /** Attach a component portal as content to this bottom sheet container. */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachComponentPortal(portal);\n }\n\n /** Attach a template portal as content to this bottom sheet container. */\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachTemplatePortal(portal);\n }\n\n /** Begin animation of bottom sheet entrance into view. */\n enter(): void {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.detectChanges();\n }\n }\n\n /** Begin animation of the bottom sheet exiting from view. */\n exit(): void {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }\n\n ngOnDestroy() {\n this._breakpointSubscription.unsubscribe();\n this._destroyed = true;\n }\n\n _onAnimationDone(event: AnimationEvent) {\n if (event.toState === 'hidden') {\n this._restoreFocus();\n } else if (event.toState === 'visible' && this.bottomSheetConfig.autoFocus) {\n this._trapFocus();\n }\n\n this._animationStateChanged.emit(event);\n }\n\n _onAnimationStart(event: AnimationEvent) {\n this._animationStateChanged.emit(event);\n }\n\n private _toggleClass(cssClass: string, add: boolean) {\n const classList = this._elementRef.nativeElement.classList;\n add ? classList.add(cssClass) : classList.remove(cssClass);\n }\n\n private _validatePortalAttached() {\n if (this._portalOutlet.hasAttached()) {\n throw Error('Attempting to attach bottom sheet content after content is already attached');\n }\n }\n\n private _setPanelClass() {\n const element: HTMLElement = this._elementRef.nativeElement;\n const panelClass = this.bottomSheetConfig.panelClass;\n\n if (Array.isArray(panelClass)) {\n // Note that we can't use a spread here, because IE doesn't support multiple arguments.\n panelClass.forEach(cssClass => element.classList.add(cssClass));\n } else if (panelClass) {\n element.classList.add(panelClass);\n }\n }\n\n\n /** Moves the focus inside the focus trap. */\n private _trapFocus() {\n if (!this._focusTrap) {\n this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);\n }\n\n this._focusTrap.focusInitialElementWhenReady();\n }\n\n /** Restores focus to the element that was focused before the bottom sheet was opened. */\n private _restoreFocus() {\n const toFocus = this._elementFocusedBeforeOpened;\n\n // We need the extra check, because IE can set the `activeElement` to null in some cases.\n if (this.bottomSheetConfig.restoreFocus && toFocus && typeof toFocus.focus === 'function') {\n toFocus.focus();\n }\n\n if (this._focusTrap) {\n this._focusTrap.destroy();\n }\n }\n\n /** Saves a reference to the element that was focused before the bottom sheet was opened. */\n private _savePreviouslyFocusedElement() {\n this._elementFocusedBeforeOpened = this._document.activeElement as HTMLElement;\n\n // The `focus` method isn't available during server-side rendering.\n if (this._elementRef.nativeElement.focus) {\n Promise.resolve().then(() => this._elementRef.nativeElement.focus());\n }\n }\n}\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 */\nimport {\n animate,\n state,\n style,\n transition,\n trigger,\n AnimationTriggerMetadata,\n} from '@angular/animations';\nimport {AnimationCurves, AnimationDurations} from '@angular/material/core';\n\n/** Animations used by the Material bottom sheet. */\nexport const matBottomSheetAnimations: {\n readonly bottomSheetState: AnimationTriggerMetadata;\n} = {\n /** Animation that shows and hides a bottom sheet. */\n bottomSheetState: trigger('state', [\n state('void, hidden', style({transform: 'translateY(100%)'})),\n state('visible', style({transform: 'translateY(0%)'})),\n transition('visible => void, visible => hidden',\n animate(`${AnimationDurations.COMPLEX} ${AnimationCurves.ACCELERATION_CURVE}`)),\n transition('void => visible',\n animate(`${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`)),\n ])\n};\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 {ViewContainerRef, InjectionToken} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\n\n/** Injection token that can be used to access the data that was passed in to a bottom sheet. */\nexport const MAT_BOTTOM_SHEET_DATA = new InjectionToken<any>('MatBottomSheetData');\n\n/**\n * Configuration used when opening a bottom sheet.\n */\nexport class MatBottomSheetConfig<D = any> {\n /** The view container to place the overlay for the bottom sheet into. */\n viewContainerRef?: ViewContainerRef;\n\n /** Extra CSS classes to be added to the bottom sheet container. */\n panelClass?: string | string[];\n\n /** Text layout direction for the bottom sheet. */\n direction?: Direction;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Whether the bottom sheet has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Custom class for the backdrop. */\n backdropClass?: string;\n\n /** Whether the user can use escape or clicking outside to close the bottom sheet. */\n disableClose?: boolean = false;\n\n /** Aria label to assign to the bottom sheet element. */\n ariaLabel?: string | null = null;\n\n /**\n * Whether the bottom sheet should close when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n closeOnNavigation?: boolean = true;\n\n /** Whether the bottom sheet should focus the first focusable element on open. */\n autoFocus?: boolean = true;\n\n /**\n * Whether the bottom sheet should restore focus to the\n * previously-focused element, after it's closed.\n */\n restoreFocus?: boolean = true;\n}\n"],"names":["tslib_1.__assign","observableOf","tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AKYA,AAAA,IAAa,qBAAqB,GAAG,IAAI,cAAc,CAAM,oBAAoB,CAAC,CAAlF;;;;;AAKA,AAAA,IAAA;;;;;IAAA,SAAA,oBAAA,GAAA;;;;QAWE,IAAF,CAAA,IAAM,GAAc,IAAI,CAAC;;;;QAGvB,IAAF,CAAA,WAAa,GAAa,IAAI,CAAC;;;;QAM7B,IAAF,CAAA,YAAc,GA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A,EAA+B,oBAAoB,EAAnD,UAAA,EAAA,CAAA,EAAA,IAAA,EAoCO,QAAQ,EApCf,EAAA,EAAA,IAAA,EAoCmB,MAAM,EApCzB,IAAA,EAAA,CAoC0B,gCAAgC,EApC1D,EAAA,CAAA,EAAA;;;IAxBA,OAAA,cAAA,CAAA;CAgMC,EAAD,CAAA,CAAC;AA1JD;;;;;;AAkKA,SAAS,oBAAoB,CAAC,QAA8B,EAC9B,MAA6B,EAD3D;IAEE,OAAFD,QAAA,CAAA,EAAA,EAAa,QAAQ,EAAK,MAAM,CAAhC,CAAkC;CACjC;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"bottom-sheet.es5.js","sources":["../../../src/lib/bottom-sheet/bottom-sheet.ts","../../../src/lib/bottom-sheet/bottom-sheet-ref.ts","../../../src/lib/bottom-sheet/bottom-sheet-module.ts","../../../src/lib/bottom-sheet/bottom-sheet-container.ts","../../../src/lib/bottom-sheet/bottom-sheet-animations.ts","../../../src/lib/bottom-sheet/bottom-sheet-config.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 {Directionality} from '@angular/cdk/bidi';\nimport {Overlay, OverlayConfig, OverlayRef} from '@angular/cdk/overlay';\nimport {ComponentPortal, ComponentType, PortalInjector, TemplatePortal} from '@angular/cdk/portal';\nimport {\n ComponentRef,\n Injectable,\n Injector,\n Optional,\n SkipSelf,\n TemplateRef,\n InjectionToken,\n Inject,\n OnDestroy,\n} from '@angular/core';\nimport {Location} from '@angular/common';\nimport {of as observableOf} from 'rxjs';\nimport {MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig} from './bottom-sheet-config';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\nimport {MatBottomSheetModule} from './bottom-sheet-module';\nimport {MatBottomSheetRef} from './bottom-sheet-ref';\n\n\n/** Injection token that can be used to specify default bottom sheet options. */\nexport const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS =\n new InjectionToken<MatBottomSheetConfig>('mat-bottom-sheet-default-options');\n\n/**\n * Service to trigger Material Design bottom sheets.\n */\n@Injectable({providedIn: MatBottomSheetModule})\nexport class MatBottomSheet implements OnDestroy {\n private _bottomSheetRefAtThisLevel: MatBottomSheetRef<any> | null = null;\n\n /** Reference to the currently opened bottom sheet. */\n get _openedBottomSheetRef(): MatBottomSheetRef<any> | null {\n const parent = this._parentBottomSheet;\n return parent ? parent._openedBottomSheetRef : this._bottomSheetRefAtThisLevel;\n }\n\n set _openedBottomSheetRef(value: MatBottomSheetRef<any> | null) {\n if (this._parentBottomSheet) {\n this._parentBottomSheet._openedBottomSheetRef = value;\n } else {\n this._bottomSheetRefAtThisLevel = value;\n }\n }\n\n constructor(\n private _overlay: Overlay,\n private _injector: Injector,\n @Optional() @SkipSelf() private _parentBottomSheet: MatBottomSheet,\n @Optional() private _location?: Location,\n @Optional() @Inject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS)\n private _defaultOptions?: MatBottomSheetConfig) {}\n\n open<T, D = any, R = any>(component: ComponentType<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;\n open<T, D = any, R = any>(template: TemplateRef<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;\n\n open<T, D = any, R = any>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R> {\n\n const _config =\n _applyConfigDefaults(this._defaultOptions || new MatBottomSheetConfig(), config);\n const overlayRef = this._createOverlay(_config);\n const container = this._attachContainer(overlayRef, _config);\n const ref = new MatBottomSheetRef<T, R>(container, overlayRef, this._location);\n\n if (componentOrTemplateRef instanceof TemplateRef) {\n container.attachTemplatePortal(new TemplatePortal<T>(componentOrTemplateRef, null!, {\n $implicit: _config.data,\n bottomSheetRef: ref\n } as any));\n } else {\n const portal = new ComponentPortal(componentOrTemplateRef, undefined,\n this._createInjector(_config, ref));\n const contentRef = container.attachComponentPortal(portal);\n ref.instance = contentRef.instance;\n }\n\n // When the bottom sheet is dismissed, clear the reference to it.\n ref.afterDismissed().subscribe(() => {\n // Clear the bottom sheet ref if it hasn't already been replaced by a newer one.\n if (this._openedBottomSheetRef == ref) {\n this._openedBottomSheetRef = null;\n }\n });\n\n if (this._openedBottomSheetRef) {\n // If a bottom sheet is already in view, dismiss it and enter the\n // new bottom sheet after exit animation is complete.\n this._openedBottomSheetRef.afterDismissed().subscribe(() => ref.containerInstance.enter());\n this._openedBottomSheetRef.dismiss();\n } else {\n // If no bottom sheet is in view, enter the new bottom sheet.\n ref.containerInstance.enter();\n }\n\n this._openedBottomSheetRef = ref;\n\n return ref;\n }\n\n /**\n * Dismisses the currently-visible bottom sheet.\n */\n dismiss(): void {\n if (this._openedBottomSheetRef) {\n this._openedBottomSheetRef.dismiss();\n }\n }\n\n ngOnDestroy() {\n if (this._bottomSheetRefAtThisLevel) {\n this._bottomSheetRefAtThisLevel.dismiss();\n }\n }\n\n /**\n * Attaches the bottom sheet container component to the overlay.\n */\n private _attachContainer(overlayRef: OverlayRef,\n config: MatBottomSheetConfig): MatBottomSheetContainer {\n\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n const injector = new PortalInjector(userInjector || this._injector, new WeakMap([\n [MatBottomSheetConfig, config]\n ]));\n\n const containerPortal =\n new ComponentPortal(MatBottomSheetContainer, config.viewContainerRef, injector);\n const containerRef: ComponentRef<MatBottomSheetContainer> = overlayRef.attach(containerPortal);\n return containerRef.instance;\n }\n\n /**\n * Creates a new overlay and places it in the correct location.\n * @param config The user-specified bottom sheet config.\n */\n private _createOverlay(config: MatBottomSheetConfig): OverlayRef {\n const overlayConfig = new OverlayConfig({\n direction: config.direction,\n hasBackdrop: config.hasBackdrop,\n disposeOnNavigation: config.closeOnNavigation,\n maxWidth: '100%',\n scrollStrategy: this._overlay.scrollStrategies.block(),\n positionStrategy: this._overlay.position()\n .global()\n .centerHorizontally()\n .bottom('0')\n });\n\n if (config.backdropClass) {\n overlayConfig.backdropClass = config.backdropClass;\n }\n\n return this._overlay.create(overlayConfig);\n }\n\n /**\n * Creates an injector to be used inside of a bottom sheet component.\n * @param config Config that was used to create the bottom sheet.\n * @param bottomSheetRef Reference to the bottom sheet.\n */\n private _createInjector<T>(config: MatBottomSheetConfig,\n bottomSheetRef: MatBottomSheetRef<T>): PortalInjector {\n\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n const injectionTokens = new WeakMap<any, any>([\n [MatBottomSheetRef, bottomSheetRef],\n [MAT_BOTTOM_SHEET_DATA, config.data]\n ]);\n\n if (config.direction &&\n (!userInjector || !userInjector.get<Directionality | null>(Directionality, null))) {\n injectionTokens.set(Directionality, {\n value: config.direction,\n change: observableOf()\n });\n }\n\n return new PortalInjector(userInjector || this._injector, injectionTokens);\n }\n}\n\n/**\n * Applies default options to the bottom sheet config.\n * @param defaults Object containing the default values to which to fall back.\n * @param config The configuration to which the defaults will be applied.\n * @returns The new configuration object with defaults applied.\n */\nfunction _applyConfigDefaults(defaults: MatBottomSheetConfig,\n config?: MatBottomSheetConfig): MatBottomSheetConfig {\n return {...defaults, ...config};\n}\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 {Location} from '@angular/common';\nimport {ESCAPE} from '@angular/cdk/keycodes';\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {merge, Observable, Subject} from 'rxjs';\nimport {filter, take} from 'rxjs/operators';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n\n/**\n * Reference to a bottom sheet dispatched from the bottom sheet service.\n */\nexport class MatBottomSheetRef<T = any, R = any> {\n /** Instance of the component making up the content of the bottom sheet. */\n instance: T;\n\n /**\n * Instance of the component into which the bottom sheet content is projected.\n * @docs-private\n */\n containerInstance: MatBottomSheetContainer;\n\n /** Subject for notifying the user that the bottom sheet has been dismissed. */\n private readonly _afterDismissed = new Subject<R | undefined>();\n\n /** Subject for notifying the user that the bottom sheet has opened and appeared. */\n private readonly _afterOpened = new Subject<void>();\n\n /** Result to be passed down to the `afterDismissed` stream. */\n private _result: R | undefined;\n\n constructor(\n containerInstance: MatBottomSheetContainer,\n private _overlayRef: OverlayRef,\n // @breaking-change 8.0.0 `_location` parameter to be removed.\n _location?: Location) {\n this.containerInstance = containerInstance;\n\n // Emit when opening animation completes\n containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'done' && event.toState === 'visible'),\n take(1)\n )\n .subscribe(() => {\n this._afterOpened.next();\n this._afterOpened.complete();\n });\n\n // Dispose overlay when closing animation is complete\n containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'done' && event.toState === 'hidden'),\n take(1)\n )\n .subscribe(() => {\n this._overlayRef.dispose();\n this._afterDismissed.next(this._result);\n this._afterDismissed.complete();\n });\n\n if (!containerInstance.bottomSheetConfig.disableClose) {\n merge(\n _overlayRef.backdropClick(),\n _overlayRef.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE))\n ).subscribe(() => this.dismiss());\n }\n }\n\n /**\n * Dismisses the bottom sheet.\n * @param result Data to be passed back to the bottom sheet opener.\n */\n dismiss(result?: R): void {\n if (!this._afterDismissed.closed) {\n // Transition the backdrop in parallel to the bottom sheet.\n this.containerInstance._animationStateChanged.pipe(\n filter(event => event.phaseName === 'start'),\n take(1)\n ).subscribe(() => this._overlayRef.detachBackdrop());\n\n this._result = result;\n this.containerInstance.exit();\n }\n }\n\n /** Gets an observable that is notified when the bottom sheet is finished closing. */\n afterDismissed(): Observable<R | undefined> {\n return this._afterDismissed.asObservable();\n }\n\n /** Gets an observable that is notified when the bottom sheet has opened and appeared. */\n afterOpened(): Observable<void> {\n return this._afterOpened.asObservable();\n }\n\n /**\n * Gets an observable that emits when the overlay's backdrop has been clicked.\n */\n backdropClick(): Observable<MouseEvent> {\n return this._overlayRef.backdropClick();\n }\n\n /**\n * Gets an observable that emits when keydown events are targeted on the overlay.\n */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._overlayRef.keydownEvents();\n }\n}\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 {OverlayModule} from '@angular/cdk/overlay';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule} from '@angular/material/core';\nimport {MatBottomSheetContainer} from './bottom-sheet-container';\n\n\n@NgModule({\n imports: [\n CommonModule,\n OverlayModule,\n MatCommonModule,\n PortalModule,\n ],\n exports: [MatBottomSheetContainer, MatCommonModule],\n declarations: [MatBottomSheetContainer],\n entryComponents: [MatBottomSheetContainer],\n})\nexport class MatBottomSheetModule {}\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 {\n Component,\n ComponentRef,\n EmbeddedViewRef,\n ViewChild,\n OnDestroy,\n ElementRef,\n ChangeDetectionStrategy,\n ViewEncapsulation,\n ChangeDetectorRef,\n EventEmitter,\n Inject,\n Optional,\n} from '@angular/core';\nimport {AnimationEvent} from '@angular/animations';\nimport {\n BasePortalOutlet,\n ComponentPortal,\n TemplatePortal,\n CdkPortalOutlet,\n} from '@angular/cdk/portal';\nimport {BreakpointObserver, Breakpoints} from '@angular/cdk/layout';\nimport {MatBottomSheetConfig} from './bottom-sheet-config';\nimport {matBottomSheetAnimations} from './bottom-sheet-animations';\nimport {Subscription} from 'rxjs';\nimport {DOCUMENT} from '@angular/common';\nimport {FocusTrap, FocusTrapFactory} from '@angular/cdk/a11y';\n\n// TODO(crisbeto): consolidate some logic between this, MatDialog and MatSnackBar\n\n/**\n * Internal component that wraps user-provided bottom sheet content.\n * @docs-private\n */\n@Component({\n moduleId: module.id,\n selector: 'mat-bottom-sheet-container',\n templateUrl: 'bottom-sheet-container.html',\n styleUrls: ['bottom-sheet-container.css'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n animations: [matBottomSheetAnimations.bottomSheetState],\n host: {\n 'class': 'mat-bottom-sheet-container',\n 'tabindex': '-1',\n 'role': 'dialog',\n 'aria-modal': 'true',\n '[attr.aria-label]': 'bottomSheetConfig?.ariaLabel',\n '[@state]': '_animationState',\n '(@state.start)': '_onAnimationStart($event)',\n '(@state.done)': '_onAnimationDone($event)'\n },\n})\nexport class MatBottomSheetContainer extends BasePortalOutlet implements OnDestroy {\n private _breakpointSubscription: Subscription;\n\n /** The portal outlet inside of this container into which the content will be loaded. */\n @ViewChild(CdkPortalOutlet) _portalOutlet: CdkPortalOutlet;\n\n /** The state of the bottom sheet animations. */\n _animationState: 'void' | 'visible' | 'hidden' = 'void';\n\n /** Emits whenever the state of the animation changes. */\n _animationStateChanged = new EventEmitter<AnimationEvent>();\n\n /** The class that traps and manages focus within the bottom sheet. */\n private _focusTrap: FocusTrap;\n\n /** Element that was focused before the bottom sheet was opened. */\n private _elementFocusedBeforeOpened: HTMLElement | null = null;\n\n /** Server-side rendering-compatible reference to the global document object. */\n private _document: Document;\n\n /** Whether the component has been destroyed. */\n private _destroyed: boolean;\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n private _focusTrapFactory: FocusTrapFactory,\n breakpointObserver: BreakpointObserver,\n @Optional() @Inject(DOCUMENT) document: any,\n /** The bottom sheet configuration. */\n public bottomSheetConfig: MatBottomSheetConfig) {\n super();\n\n this._document = document;\n this._breakpointSubscription = breakpointObserver\n .observe([Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe(() => {\n this._toggleClass('mat-bottom-sheet-container-medium',\n breakpointObserver.isMatched(Breakpoints.Medium));\n this._toggleClass('mat-bottom-sheet-container-large',\n breakpointObserver.isMatched(Breakpoints.Large));\n this._toggleClass('mat-bottom-sheet-container-xlarge',\n breakpointObserver.isMatched(Breakpoints.XLarge));\n });\n }\n\n /** Attach a component portal as content to this bottom sheet container. */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachComponentPortal(portal);\n }\n\n /** Attach a template portal as content to this bottom sheet container. */\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachTemplatePortal(portal);\n }\n\n /** Begin animation of bottom sheet entrance into view. */\n enter(): void {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.detectChanges();\n }\n }\n\n /** Begin animation of the bottom sheet exiting from view. */\n exit(): void {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n }\n }\n\n ngOnDestroy() {\n this._breakpointSubscription.unsubscribe();\n this._destroyed = true;\n }\n\n _onAnimationDone(event: AnimationEvent) {\n if (event.toState === 'hidden') {\n this._restoreFocus();\n } else if (event.toState === 'visible' && this.bottomSheetConfig.autoFocus) {\n this._trapFocus();\n }\n\n this._animationStateChanged.emit(event);\n }\n\n _onAnimationStart(event: AnimationEvent) {\n this._animationStateChanged.emit(event);\n }\n\n private _toggleClass(cssClass: string, add: boolean) {\n const classList = this._elementRef.nativeElement.classList;\n add ? classList.add(cssClass) : classList.remove(cssClass);\n }\n\n private _validatePortalAttached() {\n if (this._portalOutlet.hasAttached()) {\n throw Error('Attempting to attach bottom sheet content after content is already attached');\n }\n }\n\n private _setPanelClass() {\n const element: HTMLElement = this._elementRef.nativeElement;\n const panelClass = this.bottomSheetConfig.panelClass;\n\n if (Array.isArray(panelClass)) {\n // Note that we can't use a spread here, because IE doesn't support multiple arguments.\n panelClass.forEach(cssClass => element.classList.add(cssClass));\n } else if (panelClass) {\n element.classList.add(panelClass);\n }\n }\n\n\n /** Moves the focus inside the focus trap. */\n private _trapFocus() {\n if (!this._focusTrap) {\n this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);\n }\n\n this._focusTrap.focusInitialElementWhenReady();\n }\n\n /** Restores focus to the element that was focused before the bottom sheet was opened. */\n private _restoreFocus() {\n const toFocus = this._elementFocusedBeforeOpened;\n\n // We need the extra check, because IE can set the `activeElement` to null in some cases.\n if (this.bottomSheetConfig.restoreFocus && toFocus && typeof toFocus.focus === 'function') {\n toFocus.focus();\n }\n\n if (this._focusTrap) {\n this._focusTrap.destroy();\n }\n }\n\n /** Saves a reference to the element that was focused before the bottom sheet was opened. */\n private _savePreviouslyFocusedElement() {\n this._elementFocusedBeforeOpened = this._document.activeElement as HTMLElement;\n\n // The `focus` method isn't available during server-side rendering.\n if (this._elementRef.nativeElement.focus) {\n Promise.resolve().then(() => this._elementRef.nativeElement.focus());\n }\n }\n}\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 */\nimport {\n animate,\n state,\n style,\n transition,\n trigger,\n AnimationTriggerMetadata,\n} from '@angular/animations';\nimport {AnimationCurves, AnimationDurations} from '@angular/material/core';\n\n/** Animations used by the Material bottom sheet. */\nexport const matBottomSheetAnimations: {\n readonly bottomSheetState: AnimationTriggerMetadata;\n} = {\n /** Animation that shows and hides a bottom sheet. */\n bottomSheetState: trigger('state', [\n state('void, hidden', style({transform: 'translateY(100%)'})),\n state('visible', style({transform: 'translateY(0%)'})),\n transition('visible => void, visible => hidden',\n animate(`${AnimationDurations.COMPLEX} ${AnimationCurves.ACCELERATION_CURVE}`)),\n transition('void => visible',\n animate(`${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`)),\n ])\n};\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 {ViewContainerRef, InjectionToken} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\n\n/** Injection token that can be used to access the data that was passed in to a bottom sheet. */\nexport const MAT_BOTTOM_SHEET_DATA = new InjectionToken<any>('MatBottomSheetData');\n\n/**\n * Configuration used when opening a bottom sheet.\n */\nexport class MatBottomSheetConfig<D = any> {\n /** The view container to place the overlay for the bottom sheet into. */\n viewContainerRef?: ViewContainerRef;\n\n /** Extra CSS classes to be added to the bottom sheet container. */\n panelClass?: string | string[];\n\n /** Text layout direction for the bottom sheet. */\n direction?: Direction;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Whether the bottom sheet has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Custom class for the backdrop. */\n backdropClass?: string;\n\n /** Whether the user can use escape or clicking outside to close the bottom sheet. */\n disableClose?: boolean = false;\n\n /** Aria label to assign to the bottom sheet element. */\n ariaLabel?: string | null = null;\n\n /**\n * Whether the bottom sheet should close when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n closeOnNavigation?: boolean = true;\n\n // Note that this is disabled by default, because while the a11y recommendations are to focus\n // the first focusable element, doing so prevents screen readers from reading out the\n // rest of the bottom sheet content.\n /** Whether the bottom sheet should focus the first focusable element on open. */\n autoFocus?: boolean = false;\n\n /**\n * Whether the bottom sheet should restore focus to the\n * previously-focused element, after it's closed.\n */\n restoreFocus?: boolean = true;\n}\n"],"names":["tslib_1.__assign","observableOf","tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AKYA,AAAA,IAAa,qBAAqB,GAAG,IAAI,cAAc,CAAM,oBAAoB,CAAC,CAAlF;;;;;AAKA,AAAA,IAAA;;;;;IAAA,SAAA,oBAAA,GAAA;;;;QAWE,IAAF,CAAA,IAAM,GAAc,IAAI,CAAC;;;;QAGvB,IAAF,CAAA,WAAa,GAAa,IAAI,CAAC;;;;QAM7B,IAAF,CAAA,YAAc,GAA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AAA,EAA+B,oBAAoB,EAAnD,UAAA,EAAA,CAAA,EAAA,IAAA,EAoCO,QAAQ,EApCf,EAAA,EAAA,IAAA,EAoCmB,MAAM,EApCzB,IAAA,EAAA,CAoC0B,gCAAgC,EApC1D,EAAA,CAAA,EAAA;;;IAxBA,OAAA,cAAA,CAAA;CAgMC,EAAD,CAAA,CAAC;AA1JD;;;;;;AAkKA,SAAS,oBAAoB,CAAC,QAA8B,EAC9B,MAA6B,EAD3D;IAEE,OAAFD,QAAA,CAAA,EAAA,EAAa,QAAQ,EAAK,MAAM,CAAhC,CAAkC;CACjC;;;;;;;;;;;;;;"}
@@ -58,9 +58,13 @@ var _MatButtonMixinBase = mixinColor(mixinDisabled(mixinDisableRipple(MatButtonB
58
58
  */
59
59
  var MatButton = /** @class */ (function (_super) {
60
60
  __extends(MatButton, _super);
61
- function MatButton(elementRef, _platform, _focusMonitor, _animationMode) {
61
+ function MatButton(elementRef,
62
+ /**
63
+ * @deprecated Platform checks for SSR are no longer needed
64
+ * @breaking-change 8.0.0
65
+ */
66
+ _platform, _focusMonitor, _animationMode) {
62
67
  var _this = _super.call(this, elementRef) || this;
63
- _this._platform = _platform;
64
68
  _this._focusMonitor = _focusMonitor;
65
69
  _this._animationMode = _animationMode;
66
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"button.es5.js","sources":["../../../src/lib/button/button-module.ts","../../../src/lib/button/button.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 {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatAnchor, MatButton} from './button';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MatRippleModule,\n MatCommonModule,\n ],\n exports: [\n MatButton,\n MatAnchor,\n MatCommonModule,\n ],\n declarations: [\n MatButton,\n MatAnchor,\n ],\n})\nexport class MatButtonModule {}\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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {Platform} from '@angular/cdk/platform';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n ViewChild,\n ViewEncapsulation,\n Optional,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n CanColor,\n CanDisable,\n CanDisableRipple,\n CanColorCtor,\n CanDisableCtor,\n CanDisableRippleCtor,\n MatRipple,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n/** Default color palette for round buttons (mat-fab and mat-mini-fab) */\nconst DEFAULT_ROUND_BUTTON_COLOR = 'accent';\n\n/**\n * List of classes to add to MatButton instances based on host attributes to\n * style as different variants.\n */\nconst BUTTON_HOST_ATTRIBUTES = [\n 'mat-button',\n 'mat-flat-button',\n 'mat-icon-button',\n 'mat-raised-button',\n 'mat-stroked-button',\n 'mat-mini-fab',\n 'mat-fab',\n];\n\n// Boilerplate for applying mixins to MatButton.\n/** @docs-private */\nexport class MatButtonBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nexport const _MatButtonMixinBase:\n CanDisableRippleCtor & CanDisableCtor & CanColorCtor & typeof MatButtonBase =\n mixinColor(mixinDisabled(mixinDisableRipple(MatButtonBase)));\n\n/**\n * Material design button.\n */\n@Component({\n moduleId: module.id,\n selector: `button[mat-button], button[mat-raised-button], button[mat-icon-button],\n button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],\n button[mat-flat-button]`,\n exportAs: 'matButton',\n host: {\n '[disabled]': 'disabled || null',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n inputs: ['disabled', 'disableRipple', 'color'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatButton extends _MatButtonMixinBase\n implements OnDestroy, CanDisable, CanColor, CanDisableRipple {\n\n /** Whether the button is round. */\n readonly isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');\n\n /** Whether the button is icon button. */\n readonly isIconButton: boolean = this._hasHostAttributes('mat-icon-button');\n\n /** Reference to the MatRipple instance of the button. */\n @ViewChild(MatRipple) ripple: MatRipple;\n\n constructor(elementRef: ElementRef,\n /**\n * @deprecated Platform checks for SSR are no longer needed\n * @breaking-change 8.0.0\n */\n // tslint:disable-next-line:no-unused-variable\n private _platform: Platform,\n private _focusMonitor: FocusMonitor,\n // @breaking-change 8.0.0 `_animationMode` parameter to be made required.\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string) {\n super(elementRef);\n\n // For each of the variant selectors that is prevent in the button's host\n // attributes, add the correct corresponding class.\n for (const attr of BUTTON_HOST_ATTRIBUTES) {\n if (this._hasHostAttributes(attr)) {\n (elementRef.nativeElement as HTMLElement).classList.add(attr);\n }\n }\n\n this._focusMonitor.monitor(this._elementRef, true);\n\n if (this.isRoundButton) {\n this.color = DEFAULT_ROUND_BUTTON_COLOR;\n }\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /** Focuses the button. */\n focus(): void {\n this._getHostElement().focus();\n }\n\n _getHostElement() {\n return this._elementRef.nativeElement;\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n /** Gets whether the button has one of the given attributes. */\n _hasHostAttributes(...attributes: string[]) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }\n}\n\n/**\n * Raised Material design button.\n */\n@Component({\n moduleId: module.id,\n selector: `a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab],\n a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]`,\n exportAs: 'matButton, matAnchor',\n host: {\n // Note that we ignore the user-specified tabindex when it's disabled for\n // consistency with the `mat-button` applied on native buttons where even\n // though they have an index, they're not tabbable.\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '(click)': '_haltDisabledEvents($event)',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n inputs: ['disabled', 'disableRipple', 'color'],\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatAnchor extends MatButton {\n /** Tabindex of the button. */\n @Input() tabIndex: number;\n\n constructor(\n platform: Platform,\n focusMonitor: FocusMonitor,\n elementRef: ElementRef,\n // @breaking-change 8.0.0 `animationMode` parameter to be made required.\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {\n super(elementRef, platform, focusMonitor, animationMode);\n }\n\n _haltDisabledEvents(event: Event) {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;ACoCA,IAAM,0BAA0B,GAAG,QAAQ,CAA3C;;;;;;AAMA,IAAM,sBAAsB,GAAG;IAC7B,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,oBAAoB;IACpB,cAAc;IACd,SAAS;CACV,CAAD;;;;;AAIA,AAAA,IAAA;;;;;;IACE,SAAF,aAAA,CAAqB,WAAuB,EAA5C;QAAqB,IAArB,CAAA,WAAgC,GAAX,WAAW,CAAY;KAAI;IAChD,OAAA,aAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;AAED,AAAA,IAAa,mBAAmB,GAExB,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC,CAFpE;;;;AAOA,AAAA,IAAA,SAAA,kBAAA,UAAA,MAAA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AF,CAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;KAmKA,CAAA;;;;;;;;ADlKA,IAAA,eAAA,kBAAA,YAAA;IAAA,SAAA,eAAA,GAAA;KAgB+B;;QAhB/B,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;oBACR,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;wBACf,eAAe;qBAChB;oBACD,OAAO,EAAE;wBACP,SAAS;wBACT,SAAS;wBACT,eAAe;qBAChB;oBACD,YAAY,EAAE;wBACZ,SAAS;wBACT,SAAS;qBACV;iBACF,EAAD,EAAA;;IAC8B,OAA9B,eAA+B,CAA/B;CAA+B,EAA/B,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button.es5.js","sources":["../../../src/lib/button/button-module.ts","../../../src/lib/button/button.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 {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatAnchor, MatButton} from './button';\n\n\n@NgModule({\n imports: [\n CommonModule,\n MatRippleModule,\n MatCommonModule,\n ],\n exports: [\n MatButton,\n MatAnchor,\n MatCommonModule,\n ],\n declarations: [\n MatButton,\n MatAnchor,\n ],\n})\nexport class MatButtonModule {}\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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {Platform} from '@angular/cdk/platform';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n ViewChild,\n ViewEncapsulation,\n Optional,\n Inject,\n Input,\n} from '@angular/core';\nimport {\n CanColor,\n CanDisable,\n CanDisableRipple,\n CanColorCtor,\n CanDisableCtor,\n CanDisableRippleCtor,\n MatRipple,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\n\n/** Default color palette for round buttons (mat-fab and mat-mini-fab) */\nconst DEFAULT_ROUND_BUTTON_COLOR = 'accent';\n\n/**\n * List of classes to add to MatButton instances based on host attributes to\n * style as different variants.\n */\nconst BUTTON_HOST_ATTRIBUTES = [\n 'mat-button',\n 'mat-flat-button',\n 'mat-icon-button',\n 'mat-raised-button',\n 'mat-stroked-button',\n 'mat-mini-fab',\n 'mat-fab',\n];\n\n// Boilerplate for applying mixins to MatButton.\n/** @docs-private */\nexport class MatButtonBase {\n constructor(public _elementRef: ElementRef) {}\n}\n\nexport const _MatButtonMixinBase:\n CanDisableRippleCtor & CanDisableCtor & CanColorCtor & typeof MatButtonBase =\n mixinColor(mixinDisabled(mixinDisableRipple(MatButtonBase)));\n\n/**\n * Material design button.\n */\n@Component({\n moduleId: module.id,\n selector: `button[mat-button], button[mat-raised-button], button[mat-icon-button],\n button[mat-fab], button[mat-mini-fab], button[mat-stroked-button],\n button[mat-flat-button]`,\n exportAs: 'matButton',\n host: {\n '[disabled]': 'disabled || null',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n inputs: ['disabled', 'disableRipple', 'color'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatButton extends _MatButtonMixinBase\n implements OnDestroy, CanDisable, CanColor, CanDisableRipple {\n\n /** Whether the button is round. */\n readonly isRoundButton: boolean = this._hasHostAttributes('mat-fab', 'mat-mini-fab');\n\n /** Whether the button is icon button. */\n readonly isIconButton: boolean = this._hasHostAttributes('mat-icon-button');\n\n /** Reference to the MatRipple instance of the button. */\n @ViewChild(MatRipple) ripple: MatRipple;\n\n constructor(elementRef: ElementRef,\n /**\n * @deprecated Platform checks for SSR are no longer needed\n * @breaking-change 8.0.0\n */\n _platform: Platform,\n private _focusMonitor: FocusMonitor,\n // @breaking-change 8.0.0 `_animationMode` parameter to be made required.\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string) {\n super(elementRef);\n\n // For each of the variant selectors that is prevent in the button's host\n // attributes, add the correct corresponding class.\n for (const attr of BUTTON_HOST_ATTRIBUTES) {\n if (this._hasHostAttributes(attr)) {\n (elementRef.nativeElement as HTMLElement).classList.add(attr);\n }\n }\n\n this._focusMonitor.monitor(this._elementRef, true);\n\n if (this.isRoundButton) {\n this.color = DEFAULT_ROUND_BUTTON_COLOR;\n }\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /** Focuses the button. */\n focus(): void {\n this._getHostElement().focus();\n }\n\n _getHostElement() {\n return this._elementRef.nativeElement;\n }\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n /** Gets whether the button has one of the given attributes. */\n _hasHostAttributes(...attributes: string[]) {\n return attributes.some(attribute => this._getHostElement().hasAttribute(attribute));\n }\n}\n\n/**\n * Raised Material design button.\n */\n@Component({\n moduleId: module.id,\n selector: `a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab],\n a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]`,\n exportAs: 'matButton, matAnchor',\n host: {\n // Note that we ignore the user-specified tabindex when it's disabled for\n // consistency with the `mat-button` applied on native buttons where even\n // though they have an index, they're not tabbable.\n '[attr.tabindex]': 'disabled ? -1 : (tabIndex || 0)',\n '[attr.disabled]': 'disabled || null',\n '[attr.aria-disabled]': 'disabled.toString()',\n '(click)': '_haltDisabledEvents($event)',\n '[class._mat-animation-noopable]': '_animationMode === \"NoopAnimations\"',\n },\n inputs: ['disabled', 'disableRipple', 'color'],\n templateUrl: 'button.html',\n styleUrls: ['button.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatAnchor extends MatButton {\n /** Tabindex of the button. */\n @Input() tabIndex: number;\n\n constructor(\n platform: Platform,\n focusMonitor: FocusMonitor,\n elementRef: ElementRef,\n // @breaking-change 8.0.0 `animationMode` parameter to be made required.\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {\n super(elementRef, platform, focusMonitor, animationMode);\n }\n\n _haltDisabledEvents(event: Event) {\n // A disabled button shouldn't apply any actions\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n"],"names":["tslib_1.__extends"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;ACoCA,IAAM,0BAA0B,GAAG,QAAQ,CAA3C;;;;;;AAMA,IAAM,sBAAsB,GAAG;IAC7B,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,oBAAoB;IACpB,cAAc;IACd,SAAS;CACV,CAAD;;;;;AAIA,AAAA,IAAA;;;;;;IACE,SAAF,aAAA,CAAqB,WAAuB,EAA5C;QAAqB,IAArB,CAAA,WAAgC,GAAX,WAAW,CAAY;KAAI;IAChD,OAAA,aAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;AAED,AAAA,IAAa,mBAAmB,GAExB,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,CAAC,CAFpE;;;;AAOA,AAAA,IAAA,SAAA,kBAAA,UAAA,MAAA,EAAA;IAgB+BA,SAA/B,CAAA,SAAA,EAAA,MAAA,CAAA,CAAkD;IAYhD,SAAF,SAAA,CAAc,UAAsB;;;;;IAKtB,SAAmB,EACX,aAA2B,EAEe,cAAuB,EAHvF;QALE,IAAF,KAAA,GASI,MATJ,CAAA,IAAA,CAAA,IAAA,EASU,UAAU,CAAC,IATrB,IAAA,CAwBG;QAlBmB,KAAtB,CAAA,aAAmC,GAAb,aAAa,CAAc;QAEe,KAAhE,CAAA,cAA8E,GAAd,cAAc,CAAS;;;;QAhB5E,KAAX,CAAA,aAAwB,GAAY,KAAI,CAAC,kBA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A/B,CAAA;;;;;;;;;;;;;;"}
package/esm5/chips.es5.js CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { __extends } from 'tslib';
9
9
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
10
- import { BACKSPACE, DELETE, SPACE, END, HOME, ENTER } from '@angular/cdk/keycodes';
10
+ import { BACKSPACE, DELETE, SPACE, END, HOME, hasModifierKey, ENTER } from '@angular/cdk/keycodes';
11
11
  import { Platform } from '@angular/cdk/platform';
12
12
  import { ContentChild, Directive, ElementRef, EventEmitter, forwardRef, Inject, Input, NgZone, Optional, Output, InjectionToken, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, Self, ViewEncapsulation, NgModule } from '@angular/core';
13
13
  import { MAT_RIPPLE_GLOBAL_OPTIONS, mixinColor, mixinDisabled, mixinDisableRipple, RippleRenderer, ErrorStateMatcher, mixinErrorState } from '@angular/material/core';
@@ -1945,7 +1945,7 @@ var MatChipInput = /** @class */ (function () {
1945
1945
  if (!this._inputElement.value && !!event) {
1946
1946
  this._chipList._keydown(event);
1947
1947
  }
1948
- if (!event || this._isSeparatorKey(event.keyCode)) {
1948
+ if (!event || this._isSeparatorKey(event)) {
1949
1949
  this.chipEnd.emit({ input: this._inputElement, value: this._inputElement.value });
1950
1950
  if (event) {
1951
1951
  event.preventDefault();
@@ -1978,18 +1978,23 @@ var MatChipInput = /** @class */ (function () {
1978
1978
  /**
1979
1979
  * Checks whether a keycode is one of the configured separators.
1980
1980
  * @private
1981
- * @param {?} keyCode
1981
+ * @param {?} event
1982
1982
  * @return {?}
1983
1983
  */
1984
1984
  MatChipInput.prototype._isSeparatorKey = /**
1985
1985
  * Checks whether a keycode is one of the configured separators.
1986
1986
  * @private
1987
- * @param {?} keyCode
1987
+ * @param {?} event
1988
1988
  * @return {?}
1989
1989
  */
1990
- function (keyCode) {
1990
+ function (event) {
1991
+ if (hasModifierKey(event)) {
1992
+ return false;
1993
+ }
1991
1994
  /** @type {?} */
1992
1995
  var separators = this.separatorKeyCodes;
1996
+ /** @type {?} */
1997
+ var keyCode = event.keyCode;
1993
1998
  return Array.isArray(separators) ? separators.indexOf(keyCode) > -1 : separators.has(keyCode);
1994
1999
  };
1995
2000
  MatChipInput.decorators = [