@angular/cdk 6.4.2 → 6.4.7

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 (185) hide show
  1. package/_text-field.scss +4 -3
  2. package/a11y/typings/focus-monitor/focus-monitor.d.ts +1 -1
  3. package/a11y/typings/focus-trap/focus-trap.d.ts +1 -1
  4. package/a11y/typings/index.metadata.json +1 -1
  5. package/a11y/typings/live-announcer/live-announcer.d.ts +1 -1
  6. package/accordion/typings/accordion.d.ts +6 -1
  7. package/accordion/typings/index.metadata.json +1 -1
  8. package/bundles/cdk-a11y.umd.js +17 -9
  9. package/bundles/cdk-a11y.umd.js.map +1 -1
  10. package/bundles/cdk-a11y.umd.min.js +1 -1
  11. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.js +28 -4
  13. package/bundles/cdk-accordion.umd.js.map +1 -1
  14. package/bundles/cdk-accordion.umd.min.js +1 -1
  15. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  16. package/bundles/cdk-bidi.umd.js +5 -4
  17. package/bundles/cdk-bidi.umd.js.map +1 -1
  18. package/bundles/cdk-bidi.umd.min.js +1 -1
  19. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  20. package/bundles/cdk-collections.umd.js +9 -3
  21. package/bundles/cdk-collections.umd.js.map +1 -1
  22. package/bundles/cdk-collections.umd.min.js +1 -1
  23. package/bundles/cdk-collections.umd.min.js.map +1 -1
  24. package/bundles/cdk-layout.umd.js +9 -3
  25. package/bundles/cdk-layout.umd.js.map +1 -1
  26. package/bundles/cdk-layout.umd.min.js +1 -1
  27. package/bundles/cdk-layout.umd.min.js.map +1 -1
  28. package/bundles/cdk-observers.umd.js +5 -10
  29. package/bundles/cdk-observers.umd.js.map +1 -1
  30. package/bundles/cdk-observers.umd.min.js +1 -1
  31. package/bundles/cdk-observers.umd.min.js.map +1 -1
  32. package/bundles/cdk-overlay.umd.js +23 -1
  33. package/bundles/cdk-overlay.umd.js.map +1 -1
  34. package/bundles/cdk-overlay.umd.min.js +2 -2
  35. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  36. package/bundles/cdk-scrolling.umd.js +1 -1
  37. package/bundles/cdk-scrolling.umd.js.map +1 -1
  38. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  39. package/bundles/cdk-stepper.umd.js +36 -6
  40. package/bundles/cdk-stepper.umd.js.map +1 -1
  41. package/bundles/cdk-stepper.umd.min.js +1 -1
  42. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  43. package/bundles/cdk-table.umd.js +34 -9
  44. package/bundles/cdk-table.umd.js.map +1 -1
  45. package/bundles/cdk-table.umd.min.js +1 -1
  46. package/bundles/cdk-table.umd.min.js.map +1 -1
  47. package/bundles/cdk-text-field.umd.js +12 -23
  48. package/bundles/cdk-text-field.umd.js.map +1 -1
  49. package/bundles/cdk-text-field.umd.min.js +1 -1
  50. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  51. package/bundles/cdk-tree.umd.js.map +1 -1
  52. package/bundles/cdk-tree.umd.min.js.map +1 -1
  53. package/bundles/cdk.umd.js +1 -1
  54. package/bundles/cdk.umd.js.map +1 -1
  55. package/bundles/cdk.umd.min.js +1 -1
  56. package/bundles/cdk.umd.min.js.map +1 -1
  57. package/collections/typings/index.metadata.json +1 -1
  58. package/collections/typings/selection.d.ts +6 -0
  59. package/esm2015/a11y.js +19 -7
  60. package/esm2015/a11y.js.map +1 -1
  61. package/esm2015/accordion.js +18 -1
  62. package/esm2015/accordion.js.map +1 -1
  63. package/esm2015/bidi.js +5 -4
  64. package/esm2015/bidi.js.map +1 -1
  65. package/esm2015/cdk.js +1 -1
  66. package/esm2015/cdk.js.map +1 -1
  67. package/esm2015/collections.js +9 -3
  68. package/esm2015/collections.js.map +1 -1
  69. package/esm2015/layout.js +10 -4
  70. package/esm2015/layout.js.map +1 -1
  71. package/esm2015/observers.js +4 -4
  72. package/esm2015/observers.js.map +1 -1
  73. package/esm2015/overlay.js +24 -3
  74. package/esm2015/overlay.js.map +1 -1
  75. package/esm2015/scrolling.js +1 -1
  76. package/esm2015/scrolling.js.map +1 -1
  77. package/esm2015/stepper.js +32 -4
  78. package/esm2015/stepper.js.map +1 -1
  79. package/esm2015/table.js +35 -8
  80. package/esm2015/table.js.map +1 -1
  81. package/esm2015/text-field.js +9 -9
  82. package/esm2015/text-field.js.map +1 -1
  83. package/esm2015/tree.js.map +1 -1
  84. package/esm5/a11y.es5.js +17 -9
  85. package/esm5/a11y.es5.js.map +1 -1
  86. package/esm5/accordion.es5.js +25 -1
  87. package/esm5/accordion.es5.js.map +1 -1
  88. package/esm5/bidi.es5.js +5 -4
  89. package/esm5/bidi.es5.js.map +1 -1
  90. package/esm5/cdk.es5.js +1 -1
  91. package/esm5/cdk.es5.js.map +1 -1
  92. package/esm5/collections.es5.js +9 -3
  93. package/esm5/collections.es5.js.map +1 -1
  94. package/esm5/layout.es5.js +9 -3
  95. package/esm5/layout.es5.js.map +1 -1
  96. package/esm5/observers.es5.js +5 -10
  97. package/esm5/observers.es5.js.map +1 -1
  98. package/esm5/overlay.es5.js +25 -3
  99. package/esm5/overlay.es5.js.map +1 -1
  100. package/esm5/scrolling.es5.js +1 -1
  101. package/esm5/scrolling.es5.js.map +1 -1
  102. package/esm5/stepper.es5.js +34 -4
  103. package/esm5/stepper.es5.js.map +1 -1
  104. package/esm5/table.es5.js +33 -7
  105. package/esm5/table.es5.js.map +1 -1
  106. package/esm5/text-field.es5.js +12 -23
  107. package/esm5/text-field.es5.js.map +1 -1
  108. package/esm5/tree.es5.js.map +1 -1
  109. package/layout/typings/breakpoints-observer.d.ts +7 -0
  110. package/layout/typings/index.metadata.json +1 -1
  111. package/observers/typings/index.metadata.json +1 -1
  112. package/observers/typings/observe-content.d.ts +6 -1
  113. package/overlay/typings/index.metadata.json +1 -1
  114. package/overlay/typings/overlay-ref.d.ts +5 -0
  115. package/overlay/typings/position/connected-position-strategy.d.ts +1 -1
  116. package/package.json +6 -3
  117. package/stepper/typings/index.metadata.json +1 -1
  118. package/stepper/typings/stepper.d.ts +10 -2
  119. package/table/typings/index.metadata.json +1 -1
  120. package/table/typings/sticky-styler.d.ts +3 -1
  121. package/table/typings/table.d.ts +10 -1
  122. package/text-field/typings/autofill.d.ts +13 -2
  123. package/text-field/typings/autosize.d.ts +1 -1
  124. package/text-field/typings/index.metadata.json +1 -1
  125. package/text-field-prebuilt.css +1 -1
  126. package/tree/typings/index.metadata.json +1 -1
  127. package/tree/typings/nested-node.d.ts +2 -2
  128. package/tree/typings/padding.d.ts +1 -1
  129. package/tree/typings/tree.d.ts +2 -2
  130. package/typings/a11y/focus-monitor/focus-monitor.d.ts +1 -1
  131. package/typings/a11y/focus-trap/focus-trap.d.ts +1 -1
  132. package/typings/a11y/index.metadata.json +1 -1
  133. package/typings/a11y/live-announcer/live-announcer.d.ts +1 -1
  134. package/typings/accordion/accordion.d.ts +6 -1
  135. package/typings/accordion/index.metadata.json +1 -1
  136. package/typings/collections/index.metadata.json +1 -1
  137. package/typings/collections/selection.d.ts +6 -0
  138. package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +1 -1
  139. package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +1 -1
  140. package/typings/esm5/a11y/index.metadata.json +1 -1
  141. package/typings/esm5/a11y/live-announcer/live-announcer.d.ts +1 -1
  142. package/typings/esm5/accordion/accordion.d.ts +6 -1
  143. package/typings/esm5/accordion/index.metadata.json +1 -1
  144. package/typings/esm5/collections/index.metadata.json +1 -1
  145. package/typings/esm5/collections/selection.d.ts +6 -0
  146. package/typings/esm5/index.metadata.json +1 -1
  147. package/typings/esm5/layout/breakpoints-observer.d.ts +7 -0
  148. package/typings/esm5/layout/index.metadata.json +1 -1
  149. package/typings/esm5/observers/index.metadata.json +1 -1
  150. package/typings/esm5/observers/observe-content.d.ts +6 -1
  151. package/typings/esm5/overlay/index.metadata.json +1 -1
  152. package/typings/esm5/overlay/overlay-ref.d.ts +5 -0
  153. package/typings/esm5/overlay/position/connected-position-strategy.d.ts +1 -1
  154. package/typings/esm5/stepper/index.metadata.json +1 -1
  155. package/typings/esm5/stepper/stepper.d.ts +10 -2
  156. package/typings/esm5/table/index.metadata.json +1 -1
  157. package/typings/esm5/table/sticky-styler.d.ts +3 -1
  158. package/typings/esm5/table/table.d.ts +10 -1
  159. package/typings/esm5/text-field/autofill.d.ts +13 -2
  160. package/typings/esm5/text-field/autosize.d.ts +1 -1
  161. package/typings/esm5/text-field/index.metadata.json +1 -1
  162. package/typings/esm5/tree/index.metadata.json +1 -1
  163. package/typings/esm5/tree/nested-node.d.ts +2 -2
  164. package/typings/esm5/tree/padding.d.ts +1 -1
  165. package/typings/esm5/tree/tree.d.ts +2 -2
  166. package/typings/index.metadata.json +1 -1
  167. package/typings/layout/breakpoints-observer.d.ts +7 -0
  168. package/typings/layout/index.metadata.json +1 -1
  169. package/typings/observers/index.metadata.json +1 -1
  170. package/typings/observers/observe-content.d.ts +6 -1
  171. package/typings/overlay/index.metadata.json +1 -1
  172. package/typings/overlay/overlay-ref.d.ts +5 -0
  173. package/typings/overlay/position/connected-position-strategy.d.ts +1 -1
  174. package/typings/stepper/index.metadata.json +1 -1
  175. package/typings/stepper/stepper.d.ts +10 -2
  176. package/typings/table/index.metadata.json +1 -1
  177. package/typings/table/sticky-styler.d.ts +3 -1
  178. package/typings/table/table.d.ts +10 -1
  179. package/typings/text-field/autofill.d.ts +13 -2
  180. package/typings/text-field/autosize.d.ts +1 -1
  181. package/typings/text-field/index.metadata.json +1 -1
  182. package/typings/tree/index.metadata.json +1 -1
  183. package/typings/tree/nested-node.d.ts +2 -2
  184. package/typings/tree/padding.d.ts +1 -1
  185. package/typings/tree/tree.d.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","sources":["../../../src/cdk/accordion/accordion-module.ts","../../../src/cdk/accordion/accordion-item.ts","../../../src/cdk/accordion/accordion.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 {CdkAccordion} from './accordion';\nimport {CdkAccordionItem} from './accordion-item';\n\n\n@NgModule({\n exports: [CdkAccordion, CdkAccordionItem],\n declarations: [CdkAccordion, CdkAccordionItem],\n})\nexport class CdkAccordionModule {}\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 Output,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n ChangeDetectorRef,\n SkipSelf,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {CdkAccordion} from './accordion';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Subscription} from 'rxjs';\n\n/** Used to generate unique ID for each accordion item. */\nlet nextId = 0;\n\n/**\n * An basic directive expected to be extended and decorated as a component. Sets up all\n * events and attributes needed to be managed by a CdkAccordion parent.\n */\n@Directive({\n selector: 'cdk-accordion-item, [cdkAccordionItem]',\n exportAs: 'cdkAccordionItem',\n providers: [\n // Provide CdkAccordion as undefined to prevent nested accordion items from registering\n // to the same accordion.\n {provide: CdkAccordion, useValue: undefined},\n ],\n})\nexport class CdkAccordionItem implements OnDestroy {\n /** Subscription to openAll/closeAll events. */\n private _openCloseAllSubscription = Subscription.EMPTY;\n /** Event emitted every time the AccordionItem is closed. */\n @Output() closed: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted every time the AccordionItem is opened. */\n @Output() opened: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted when the AccordionItem is destroyed. */\n @Output() destroyed: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Emits whenever the expanded state of the accordion changes.\n * Primarily used to facilitate two-way binding.\n * @docs-private\n */\n @Output() expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** The unique AccordionItem id. */\n readonly id: string = `cdk-accordion-child-${nextId++}`;\n\n /** Whether the AccordionItem is expanded. */\n @Input()\n get expanded(): any { return this._expanded; }\n set expanded(expanded: any) {\n expanded = coerceBooleanProperty(expanded);\n\n // Only emit events and update the internal value if the value changes.\n if (this._expanded !== expanded) {\n this._expanded = expanded;\n this.expandedChange.emit(expanded);\n\n if (expanded) {\n this.opened.emit();\n /**\n * In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,\n * the name value is the id of the accordion.\n */\n const accordionId = this.accordion ? this.accordion.id : this.id;\n this._expansionDispatcher.notify(this.id, accordionId);\n } else {\n this.closed.emit();\n }\n\n // Ensures that the animation will run when the value is set outside of an `@Input`.\n // This includes cases like the open, close and toggle methods.\n this._changeDetectorRef.markForCheck();\n }\n }\n private _expanded = false;\n\n /** Whether the AccordionItem is disabled. */\n @Input()\n get disabled() { return this._disabled; }\n set disabled(disabled: any) { this._disabled = coerceBooleanProperty(disabled); }\n private _disabled: boolean = false;\n\n /** Unregister function for _expansionDispatcher. */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n constructor(@Optional() @SkipSelf() public accordion: CdkAccordion,\n private _changeDetectorRef: ChangeDetectorRef,\n protected _expansionDispatcher: UniqueSelectionDispatcher) {\n this._removeUniqueSelectionListener =\n _expansionDispatcher.listen((id: string, accordionId: string) => {\n if (this.accordion && !this.accordion.multi &&\n this.accordion.id === accordionId && this.id !== id) {\n this.expanded = false;\n }\n });\n\n // When an accordion item is hosted in an accordion, subscribe to open/close events.\n if (this.accordion) {\n this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();\n }\n }\n\n /** Emits an event for the accordion item being destroyed. */\n ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }\n\n /** Toggles the expanded state of the accordion item. */\n toggle(): void {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }\n\n /** Sets the expanded state of the accordion item to false. */\n close(): void {\n if (!this.disabled) {\n this.expanded = false;\n }\n }\n\n /** Sets the expanded state of the accordion item to true. */\n open(): void {\n if (!this.disabled) {\n this.expanded = true;\n }\n }\n\n private _subscribeToOpenCloseAllActions(): Subscription {\n return this.accordion._openCloseAllActions.subscribe(expanded => {\n // Only change expanded state if item is enabled\n if (!this.disabled) {\n this.expanded = expanded;\n }\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 {Directive, Input} from '@angular/core';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Subject} from 'rxjs';\n\n/** Used to generate unique ID for each accordion. */\nlet nextId = 0;\n\n/**\n * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.\n */\n@Directive({\n selector: 'cdk-accordion, [cdkAccordion]',\n exportAs: 'cdkAccordion',\n})\nexport class CdkAccordion {\n /** Stream that emits true/false when openAll/closeAll is triggered. */\n readonly _openCloseAllActions: Subject<boolean> = new Subject<boolean>();\n\n /** A readonly id value to use for unique selection coordination. */\n readonly id = `cdk-accordion-${nextId++}`;\n\n /** Whether the accordion should allow multiple expanded accordion items simultaneously. */\n @Input()\n get multi(): boolean { return this._multi; }\n set multi(multi: boolean) { this._multi = coerceBooleanProperty(multi); }\n private _multi: boolean = false;\n\n /** Opens all enabled accordion items in an accordion where multi is enabled. */\n openAll(): void {\n this._openCloseAll(true);\n }\n\n /** Closes all enabled accordion items in an accordion where multi is enabled. */\n closeAll(): void {\n this._openCloseAll(false);\n }\n\n private _openCloseAll(expanded: boolean): void {\n if (this.multi) {\n this._openCloseAllActions.next(expanded);\n }\n }\n}\n"],"names":["nextId"],"mappings":";;;;;;;;;;;;;;;;;;;AEaA,qBAAI,MAAM,GAAG,CAAC,CAAC;;;;AASf,AAAA,MAAA,YAAA,CAAA;;;;;QAEA,IAAA,CAAA,oBAAA,GAAoD,IAAI,OAAO,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AY,EAAE,gBAAgB,CAAC;gBACzC,YAAY,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;aAC/C,EAAD,EAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"accordion.js","sources":["../../../src/cdk/accordion/accordion-module.ts","../../../src/cdk/accordion/accordion-item.ts","../../../src/cdk/accordion/accordion.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 {CdkAccordion} from './accordion';\nimport {CdkAccordionItem} from './accordion-item';\n\n\n@NgModule({\n exports: [CdkAccordion, CdkAccordionItem],\n declarations: [CdkAccordion, CdkAccordionItem],\n})\nexport class CdkAccordionModule {}\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 Output,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n ChangeDetectorRef,\n SkipSelf,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {CdkAccordion} from './accordion';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Subscription} from 'rxjs';\n\n/** Used to generate unique ID for each accordion item. */\nlet nextId = 0;\n\n/**\n * An basic directive expected to be extended and decorated as a component. Sets up all\n * events and attributes needed to be managed by a CdkAccordion parent.\n */\n@Directive({\n selector: 'cdk-accordion-item, [cdkAccordionItem]',\n exportAs: 'cdkAccordionItem',\n providers: [\n // Provide CdkAccordion as undefined to prevent nested accordion items from registering\n // to the same accordion.\n {provide: CdkAccordion, useValue: undefined},\n ],\n})\nexport class CdkAccordionItem implements OnDestroy {\n /** Subscription to openAll/closeAll events. */\n private _openCloseAllSubscription = Subscription.EMPTY;\n /** Event emitted every time the AccordionItem is closed. */\n @Output() closed: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted every time the AccordionItem is opened. */\n @Output() opened: EventEmitter<void> = new EventEmitter<void>();\n /** Event emitted when the AccordionItem is destroyed. */\n @Output() destroyed: EventEmitter<void> = new EventEmitter<void>();\n\n /**\n * Emits whenever the expanded state of the accordion changes.\n * Primarily used to facilitate two-way binding.\n * @docs-private\n */\n @Output() expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** The unique AccordionItem id. */\n readonly id: string = `cdk-accordion-child-${nextId++}`;\n\n /** Whether the AccordionItem is expanded. */\n @Input()\n get expanded(): any { return this._expanded; }\n set expanded(expanded: any) {\n expanded = coerceBooleanProperty(expanded);\n\n // Only emit events and update the internal value if the value changes.\n if (this._expanded !== expanded) {\n this._expanded = expanded;\n this.expandedChange.emit(expanded);\n\n if (expanded) {\n this.opened.emit();\n /**\n * In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,\n * the name value is the id of the accordion.\n */\n const accordionId = this.accordion ? this.accordion.id : this.id;\n this._expansionDispatcher.notify(this.id, accordionId);\n } else {\n this.closed.emit();\n }\n\n // Ensures that the animation will run when the value is set outside of an `@Input`.\n // This includes cases like the open, close and toggle methods.\n this._changeDetectorRef.markForCheck();\n }\n }\n private _expanded = false;\n\n /** Whether the AccordionItem is disabled. */\n @Input()\n get disabled() { return this._disabled; }\n set disabled(disabled: any) { this._disabled = coerceBooleanProperty(disabled); }\n private _disabled: boolean = false;\n\n /** Unregister function for _expansionDispatcher. */\n private _removeUniqueSelectionListener: () => void = () => {};\n\n constructor(@Optional() @SkipSelf() public accordion: CdkAccordion,\n private _changeDetectorRef: ChangeDetectorRef,\n protected _expansionDispatcher: UniqueSelectionDispatcher) {\n this._removeUniqueSelectionListener =\n _expansionDispatcher.listen((id: string, accordionId: string) => {\n if (this.accordion && !this.accordion.multi &&\n this.accordion.id === accordionId && this.id !== id) {\n this.expanded = false;\n }\n });\n\n // When an accordion item is hosted in an accordion, subscribe to open/close events.\n if (this.accordion) {\n this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions();\n }\n }\n\n /** Emits an event for the accordion item being destroyed. */\n ngOnDestroy() {\n this.opened.complete();\n this.closed.complete();\n this.destroyed.emit();\n this.destroyed.complete();\n this._removeUniqueSelectionListener();\n this._openCloseAllSubscription.unsubscribe();\n }\n\n /** Toggles the expanded state of the accordion item. */\n toggle(): void {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }\n\n /** Sets the expanded state of the accordion item to false. */\n close(): void {\n if (!this.disabled) {\n this.expanded = false;\n }\n }\n\n /** Sets the expanded state of the accordion item to true. */\n open(): void {\n if (!this.disabled) {\n this.expanded = true;\n }\n }\n\n private _subscribeToOpenCloseAllActions(): Subscription {\n return this.accordion._openCloseAllActions.subscribe(expanded => {\n // Only change expanded state if item is enabled\n if (!this.disabled) {\n this.expanded = expanded;\n }\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 {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, Input, OnChanges, OnDestroy, SimpleChanges} from '@angular/core';\nimport {Subject} from 'rxjs';\n\n/** Used to generate unique ID for each accordion. */\nlet nextId = 0;\n\n/**\n * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.\n */\n@Directive({\n selector: 'cdk-accordion, [cdkAccordion]',\n exportAs: 'cdkAccordion',\n})\nexport class CdkAccordion implements OnDestroy, OnChanges {\n /** Emits when the state of the accordion changes */\n readonly _stateChanges = new Subject<SimpleChanges>();\n\n /** Stream that emits true/false when openAll/closeAll is triggered. */\n readonly _openCloseAllActions: Subject<boolean> = new Subject<boolean>();\n\n /** A readonly id value to use for unique selection coordination. */\n readonly id = `cdk-accordion-${nextId++}`;\n\n /** Whether the accordion should allow multiple expanded accordion items simultaneously. */\n @Input()\n get multi(): boolean { return this._multi; }\n set multi(multi: boolean) { this._multi = coerceBooleanProperty(multi); }\n private _multi: boolean = false;\n\n /** Opens all enabled accordion items in an accordion where multi is enabled. */\n openAll(): void {\n this._openCloseAll(true);\n }\n\n /** Closes all enabled accordion items in an accordion where multi is enabled. */\n closeAll(): void {\n this._openCloseAll(false);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n this._stateChanges.next(changes);\n }\n\n ngOnDestroy() {\n this._stateChanges.complete();\n }\n\n private _openCloseAll(expanded: boolean): void {\n if (this.multi) {\n this._openCloseAllActions.next(expanded);\n }\n }\n}\n"],"names":["nextId"],"mappings":";;;;;;;;;;;;;;;;;;;AEaA,qBAAI,MAAM,GAAG,CAAC,CAAC;;;;AASf,AAAA,MAAA,YAAA,CAAA;;;;;QAEA,IAAA,CAAA,aAAA,GAA2B,IAAI,OAAO,EAAiB,CAAvD;;;;QAGA,IAAA,CAAA,oBAAA,GAAoD,IAAI,OAAO,EAAW,CAA1E;;;;QAGA,IAAA,CAAA,EAAA,GAAgB,CAAhB,cAAA,EAAiC,MAAM,EAAE,CAAzC,CAA2C,CAA3C;QAMA,IAAA,CAAA,MAAA,GAA4B,KAAK,CAAjC;;;;;;IAFA,IAAM,KAAK,GAAX,EAAyB,OAAO,IAAI,CAAC,MAAM,CAAC,EAA5C;;;;;IACE,IAAI,KAAK,CAAC,KAAc,EAA1B,EAA8B,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE;;;;;IAIzE,OAAO,GAAT;QACI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC1B;;;;;IAGD,QAAQ,GAAV;QACI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;KAC3B;;;;;IAED,WAAW,CAAC,OAAsB,EAApC;QACI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAClC;;;;IAED,WAAW,GAAb;QACI,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;KAC/B;;;;;IAEO,aAAa,CAAC,QAAiB,EAAzC;QACI,IAAI,IAAI,C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Q,YAAY,EAApB,UAAA,EAAA,CAAA,EAAA,IAAA,EA+Ee,QAAQ,EA/EvB,EAAA,EAAA,IAAA,EA+E2B,QAAQ,EA/EnC,EAAA,EAAA;IAJA,EAAA,IAAA,EAAE,iBAAiB,GAAnB;IAGA,EAAA,IAAA,EAAQ,yBAAyB,GAAjC;;;IAyBA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,EAAA;IAEA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,EAAA;IAEA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,EAAA;IAOA,gBAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,EAAA;IAMA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;IA8BA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;;;;;;;ADzEA,MAAA,kBAAA,CAAA;;;IAJA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;gBACzC,YAAY,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;aAC/C,EAAD,EAAA;;;;;;;;;;;;;;;"}
package/esm2015/bidi.js CHANGED
@@ -67,7 +67,8 @@ class Directionality {
67
67
  // but getComputedStyle return either "ltr" or "rtl". avoiding getComputedStyle for now
68
68
  const /** @type {?} */ bodyDir = _document.body ? _document.body.dir : null;
69
69
  const /** @type {?} */ htmlDir = _document.documentElement ? _document.documentElement.dir : null;
70
- this.value = /** @type {?} */ ((bodyDir || htmlDir || 'ltr'));
70
+ const /** @type {?} */ value = bodyDir || htmlDir;
71
+ this.value = (value === 'ltr' || value === 'rtl') ? value : 'ltr';
71
72
  }
72
73
  }
73
74
  /**
@@ -114,12 +115,12 @@ class Dir {
114
115
  */
115
116
  get dir() { return this._dir; }
116
117
  /**
117
- * @param {?} v
118
+ * @param {?} value
118
119
  * @return {?}
119
120
  */
120
- set dir(v) {
121
+ set dir(value) {
121
122
  const /** @type {?} */ old = this._dir;
122
- this._dir = v;
123
+ this._dir = (value === 'ltr' || value === 'rtl') ? value : 'ltr';
123
124
  if (old !== this._dir && this._isInitialized) {
124
125
  this.change.emit(this._dir);
125
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bidi.js","sources":["../../../src/cdk/bidi/bidi-module.ts","../../../src/cdk/bidi/dir.ts","../../../src/cdk/bidi/directionality.ts","../../../src/cdk/bidi/dir-document-token.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 {Dir} from './dir';\n\n\n@NgModule({\n exports: [Dir],\n declarations: [Dir],\n})\nexport class BidiModule { }\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 Directive,\n Output,\n Input,\n EventEmitter,\n AfterContentInit,\n OnDestroy,\n} from '@angular/core';\n\nimport {Direction, Directionality} from './directionality';\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\n@Directive({\n selector: '[dir]',\n providers: [{provide: Directionality, useExisting: Dir}],\n host: {'[dir]': 'dir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n _dir: Direction = 'ltr';\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Event emitted when the direction changes. */\n @Output('dirChange') change = new EventEmitter<Direction>();\n\n /** @docs-private */\n @Input()\n get dir(): Direction { return this._dir; }\n set dir(v: Direction) {\n const old = this._dir;\n this._dir = v;\n if (old !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n }\n\n /** Current layout direction of the element. */\n get value(): Direction { return this.dir; }\n\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n this.change.complete();\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 {EventEmitter, Inject, Injectable, Optional, OnDestroy} from '@angular/core';\nimport {DIR_DOCUMENT} from './dir-document-token';\n\n\nexport type Direction = 'ltr' | 'rtl';\n\n\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\n@Injectable({providedIn: 'root'})\nexport class Directionality implements OnDestroy {\n /** The current 'ltr' or 'rtl' value. */\n readonly value: Direction = 'ltr';\n\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n readonly change = new EventEmitter<Direction>();\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n if (_document) {\n // TODO: handle 'auto' value -\n // We still need to account for dir=\"auto\".\n // It looks like HTMLElemenet.dir is also \"auto\" when that's set to the attribute,\n // but getComputedStyle return either \"ltr\" or \"rtl\". avoiding getComputedStyle for now\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n this.value = (bodyDir || htmlDir || 'ltr') as Direction;\n }\n }\n\n ngOnDestroy() {\n this.change.complete();\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 {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nexport const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n\n/** @docs-private */\nexport function DIR_DOCUMENT_FACTORY(): Document {\n return inject(DOCUMENT);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AG2BA,AAAA,MAAA,iBAAa,YAAY,GAAG,IAAI,cAAc,CAAW,aAAa,EAAE;IACtE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAC;;;;;AAGH,AAAA,SAAA,oBAAA,GAAA;IACE,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CACzB;;;;;;;;;;ADfD,AAAA,MAAA,cAAA,CAAA;;;;IAOE,WAAF,CAAgD,SAAhD,EAAA;;;;QALA,IAAA,CAAA,KAAA,GAA8B,KAAK,CAAnC;;;;QAGA,IAAA,CAAA,MAAA,GAAoB,IAAI,YAAY,EAAa,CAAjD;QAGI,IAAI,SAAS,EAAE;;;;;YAKb,uBAAM,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAC3D,uBAAM,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC;YACjF,IAAI,CAAC,KAAK,sBAAI,OAAO,IAAI,OAAO,IAAI,KAAK,EAAc,CAAC;SACzD;KACF;;;;IAED,WAAW,GAAb;QACI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;KACxB;;;IAtBH,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;IAQA,EAAA,IAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,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A,CAAU,WAAW,EAArB,EAAA,EAAA;IAGA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;;;;;;;ADzBA,MAAA,UAAA,CAAA;;;IAJA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,GAAG,CAAC;gBACd,YAAY,EAAE,CAAC,GAAG,CAAC;aACpB,EAAD,EAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"bidi.js","sources":["../../../src/cdk/bidi/bidi-module.ts","../../../src/cdk/bidi/dir.ts","../../../src/cdk/bidi/directionality.ts","../../../src/cdk/bidi/dir-document-token.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 {Dir} from './dir';\n\n\n@NgModule({\n exports: [Dir],\n declarations: [Dir],\n})\nexport class BidiModule { }\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 Directive,\n Output,\n Input,\n EventEmitter,\n AfterContentInit,\n OnDestroy,\n} from '@angular/core';\n\nimport {Direction, Directionality} from './directionality';\n\n/**\n * Directive to listen for changes of direction of part of the DOM.\n *\n * Provides itself as Directionality such that descendant directives only need to ever inject\n * Directionality to get the closest direction.\n */\n@Directive({\n selector: '[dir]',\n providers: [{provide: Directionality, useExisting: Dir}],\n host: {'[dir]': 'dir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n _dir: Direction = 'ltr';\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Event emitted when the direction changes. */\n @Output('dirChange') change = new EventEmitter<Direction>();\n\n /** @docs-private */\n @Input()\n get dir(): Direction { return this._dir; }\n set dir(value: Direction) {\n const old = this._dir;\n this._dir = (value === 'ltr' || value === 'rtl') ? value : 'ltr';\n if (old !== this._dir && this._isInitialized) {\n this.change.emit(this._dir);\n }\n }\n\n /** Current layout direction of the element. */\n get value(): Direction { return this.dir; }\n\n /** Initialize once default value has been set. */\n ngAfterContentInit() {\n this._isInitialized = true;\n }\n\n ngOnDestroy() {\n this.change.complete();\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 {EventEmitter, Inject, Injectable, Optional, OnDestroy} from '@angular/core';\nimport {DIR_DOCUMENT} from './dir-document-token';\n\n\nexport type Direction = 'ltr' | 'rtl';\n\n\n/**\n * The directionality (LTR / RTL) context for the application (or a subtree of it).\n * Exposes the current direction and a stream of direction changes.\n */\n@Injectable({providedIn: 'root'})\nexport class Directionality implements OnDestroy {\n /** The current 'ltr' or 'rtl' value. */\n readonly value: Direction = 'ltr';\n\n /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */\n readonly change = new EventEmitter<Direction>();\n\n constructor(@Optional() @Inject(DIR_DOCUMENT) _document?: any) {\n if (_document) {\n // TODO: handle 'auto' value -\n // We still need to account for dir=\"auto\".\n // It looks like HTMLElemenet.dir is also \"auto\" when that's set to the attribute,\n // but getComputedStyle return either \"ltr\" or \"rtl\". avoiding getComputedStyle for now\n const bodyDir = _document.body ? _document.body.dir : null;\n const htmlDir = _document.documentElement ? _document.documentElement.dir : null;\n const value = bodyDir || htmlDir;\n this.value = (value === 'ltr' || value === 'rtl') ? value : 'ltr';\n }\n }\n\n ngOnDestroy() {\n this.change.complete();\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 {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\n\n\n/**\n * Injection token used to inject the document into Directionality.\n * This is used so that the value can be faked in tests.\n *\n * We can't use the real document in tests because changing the real `dir` causes geometry-based\n * tests in Safari to fail.\n *\n * We also can't re-provide the DOCUMENT token from platform-brower because the unit tests\n * themselves use things like `querySelector` in test code.\n *\n * This token is defined in a separate file from Directionality as a workaround for\n * https://github.com/angular/angular/issues/22559\n *\n * @docs-private\n */\nexport const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {\n providedIn: 'root',\n factory: DIR_DOCUMENT_FACTORY,\n});\n\n/** @docs-private */\nexport function DIR_DOCUMENT_FACTORY(): Document {\n return inject(DOCUMENT);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AG2BA,AAAA,MAAA,iBAAa,YAAY,GAAG,IAAI,cAAc,CAAW,aAAa,EAAE;IACtE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAC;;;;;AAGH,AAAA,SAAA,oBAAA,GAAA;IACE,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CACzB;;;;;;;;;;ADfD,AAAA,MAAA,cAAA,CAAA;;;;IAOE,WAAF,CAAgD,SAAhD,EAAA;;;;QALA,IAAA,CAAA,KAAA,GAA8B,KAAK,CAAnC;;;;QAGA,IAAA,CAAA,MAAA,GAAoB,IAAI,YAAY,EAAa,CAAjD;QAGI,IAAI,SAAS,EAAE;;;;;YAKb,uBAAM,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAC3D,uBAAM,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC;YACjF,uBAAM,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC;YACjC,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC;SACnE;KACF;;;;IAED,WAAW,GAAb;QACI,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AAW;gBACT,QAAQ,EAAE,OAAO;gBACjB,SAAS,EAAE,CAAC,EAAC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,EAAC,CAAC;gBACxD,IAAI,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC;gBACtB,QAAQ,EAAE,KAAK;aAChB,EAAD,EAAA;;;;IAQA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,IAAA,EAAA,CAAU,WAAW,EAArB,EAAA,EAAA;IAGA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;;;;;;;ADzBA,MAAA,UAAA,CAAA;;;IAJA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,GAAG,CAAC;gBACd,YAAY,EAAE,CAAC,GAAG,CAAC;aACpB,EAAD,EAAA;;;;;;;;;;;;;;;"}
package/esm2015/cdk.js CHANGED
@@ -14,7 +14,7 @@ import { Version } from '@angular/core';
14
14
  /**
15
15
  * Current version of the Angular Component Development Kit.
16
16
  */
17
- const /** @type {?} */ VERSION = new Version('6.4.2');
17
+ const /** @type {?} */ VERSION = new Version('6.4.7');
18
18
 
19
19
  /**
20
20
  * @fileoverview added by tsickle
@@ -1 +1 @@
1
- {"version":3,"file":"cdk.js","sources":["../../src/cdk/version.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 {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('6.4.2');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWA,AAAA,MAAA,iBAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cdk.js","sources":["../../src/cdk/version.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 {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('6.4.7');\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAWA,AAAA,MAAA,iBAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;"}
@@ -80,7 +80,13 @@ class SelectionModel {
80
80
  /**
81
81
  * Event emitted when the value has changed.
82
82
  */
83
- this.onChange = this._emitChanges ? new Subject() : null;
83
+ this.changed = this._emitChanges ? new Subject() : null;
84
+ /**
85
+ * Event emitted when the value has changed.
86
+ * @deprecated Use `changed` instead.
87
+ * \@breaking-change 8.0.0 To be changed to `changed`
88
+ */
89
+ this.onChange = this.changed;
84
90
  if (initiallySelectedValues && initiallySelectedValues.length) {
85
91
  if (_multiple) {
86
92
  initiallySelectedValues.forEach(value => this._markSelected(value));
@@ -185,8 +191,8 @@ class SelectionModel {
185
191
  // Clear the selected values so they can be re-cached.
186
192
  this._selected = null;
187
193
  if (this._selectedToEmit.length || this._deselectedToEmit.length) {
188
- if (this.onChange) {
189
- this.onChange.next({
194
+ if (this.changed) {
195
+ this.changed.next({
190
196
  source: this,
191
197
  added: this._selectedToEmit,
192
198
  removed: this._deselectedToEmit
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sources":["../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../src/cdk/collections/selection.ts","../../../src/cdk/collections/array-data-source.ts","../../../src/cdk/collections/data-source.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 {Injectable, OnDestroy} from '@angular/core';\n\n\n// Users of the Dispatcher never need to see this type, but TypeScript requires it to be exported.\nexport type UniqueSelectionDispatcherListener = (id: string, name: string) => void;\n\n/**\n * Class to coordinate unique selection based on name.\n * Intended to be consumed as an Angular service.\n * This service is needed because native radio change events are only fired on the item currently\n * being selected, and we still need to uncheck the previous selection.\n *\n * This service does not *store* any IDs and names because they may change at any time, so it is\n * less error-prone if they are simply passed through when the events occur.\n */\n@Injectable({providedIn: 'root'})\nexport class UniqueSelectionDispatcher implements OnDestroy {\n private _listeners: UniqueSelectionDispatcherListener[] = [];\n\n /**\n * Notify other items that selection for the given name has been set.\n * @param id ID of the item.\n * @param name Name of the item.\n */\n notify(id: string, name: string) {\n for (let listener of this._listeners) {\n listener(id, name);\n }\n }\n\n /**\n * Listen for future changes to item selection.\n * @return Function used to deregister listener\n */\n listen(listener: UniqueSelectionDispatcherListener): () => void {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered: UniqueSelectionDispatcherListener) => {\n return listener !== registered;\n });\n };\n }\n\n ngOnDestroy() {\n this._listeners = [];\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 {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n onChange: Subject<SelectionChange<T>> | null = this._emitChanges ? new Subject() : null;\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true) {\n\n if (initiallySelectedValues && initiallySelectedValues.length) {\n if (_multiple) {\n initiallySelectedValues.forEach(value => this._markSelected(value));\n } else {\n this._markSelected(initiallySelectedValues[0]);\n }\n\n // Clear the array in order to avoid firing the change event for preselected values.\n this._selectedToEmit.length = 0;\n }\n }\n\n /**\n * Selects a value or an array of values.\n */\n select(...values: T[]): void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n this._emitChangeEvent();\n }\n\n /**\n * Deselects a value or an array of values.\n */\n deselect(...values: T[]): void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n this._emitChangeEvent();\n }\n\n /**\n * Toggles a value between selected and deselected.\n */\n toggle(value: T): void {\n this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n */\n clear(): void {\n this._unmarkAll();\n this._emitChangeEvent();\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(value);\n }\n\n /**\n * Determines whether the model does not have a value.\n */\n isEmpty(): boolean {\n return this._selection.size === 0;\n }\n\n /**\n * Determines whether the model has a value.\n */\n hasValue(): boolean {\n return !this.isEmpty();\n }\n\n /**\n * Sorts the selected values based on a predicate function.\n */\n sort(predicate?: (a: T, b: T) => number): void {\n if (this._multiple && this.selected) {\n this._selected!.sort(predicate);\n }\n }\n\n /**\n * Gets whether multiple values can be selected.\n */\n isMultipleSelection() {\n return this._multiple;\n }\n\n /** Emits a change event and clears the records of selected and deselected values. */\n private _emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n if (this.onChange) {\n this.onChange.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\n });\n }\n\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }\n\n /** Selects a value. */\n private _markSelected(value: T) {\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n this._selection.add(value);\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n if (this.isSelected(value)) {\n this._selection.delete(value);\n\n if (this._emitChanges) {\n this._deselectedToEmit.push(value);\n }\n }\n }\n\n /** Clears out the selected values. */\n private _unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }\n\n /**\n * Verifies the value assignment and throws an error if the specified value array is\n * including multiple values while the selection model is not supporting multiple values.\n */\n private _verifyValueAssignment(values: T[]) {\n if (values.length > 1 && !this._multiple) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n}\n\n/**\n * Event emitted when the value of a MatSelectionModel has changed.\n * @docs-private\n */\nexport interface SelectionChange<T> {\n /** Model that dispatched the event. */\n source: SelectionModel<T>;\n /** Options that were added to the model. */\n added: T[];\n /** Options that were removed from the model. */\n removed: T[];\n}\n\n/**\n * Returns an error that reports that multiple values are passed into a selection model\n * with a single value.\n */\nexport function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\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 {Observable, of as observableOf} from 'rxjs';\nimport {DataSource} from './data-source';\n\n\n/** DataSource wrapper for a native array. */\nexport class ArrayDataSource<T> extends DataSource<T> {\n constructor(private _data: T[] | Observable<T[]>) {\n super();\n }\n\n connect(): Observable<T[]> {\n return this._data instanceof Observable ? this._data : observableOf(this._data);\n }\n\n disconnect() {}\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 {Observable} from 'rxjs';\nimport {CollectionViewer} from './collection-viewer';\n\nexport abstract class DataSource<T> {\n /**\n * Connects a collection viewer (such as a data-table) to this data source. Note that\n * the stream provided will be accessed during change detection and should not directly change\n * values that are bound in template views.\n * @param collectionViewer The component that exposes a view over the data provided by this\n * data source.\n * @returns Observable that emits a new value when the data changes.\n */\n abstract connect(collectionViewer: CollectionViewer): Observable<T[]>;\n\n /**\n * Disconnects a collection viewer (such as a data-table) from this data source. Can be used\n * to perform any clean-up or tear-down operations when a view is being destroyed.\n *\n * @param collectionViewer The component that exposes a view over the data provided by this\n * data source.\n */\n abstract disconnect(collectionViewer: CollectionViewer): void;\n}\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;;;;AGWA,AAAA,MAAA,UAAA,CAAA;CAmBC;;;;;;;;;;ADjBD,AAAA,MAAA,eAAgC,SAAQ,UAAa,CAArD;;;;IACE,WAAF,CAAsB,KAA4B,EAAlD;QACI,KAAK,EAAE,CAAC;QADU,IAAtB,CAAA,KAA2B,GAAL,KAAK,CAAuB;KAE/C;;;;IAED,OAAO,GAAT;QACI,OAAO,IAAI,CAAC,KAAK,YAAY,UAAU,GAAG,IAAI,CAAC,KAAK,GAAGA,EAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACjF;;;;IAED,UAAU,GAAZ,GAAiB;CAChB;;;;;;;;;;ADVD,AAAA,MAAA,cAAA,CAAA;;;;;;IAyBE,WAAF,CACY,SADZ,GACwB,KAAK,EACzB,uBAA6B,EACrB,YAHZ,GAG2B,IAAI,EAH/B;QACY,IAAZ,CAAA,SAAqB,GAAT,SAAS,CAArB;QAEY,IAAZ,CAAA,YAAwB,GAAZ,YAAY,CAAxB;;;;QA1BA,IAAA,CAAA,UAAA,GAAuB,IAAI,GAAG,EAAK,CAAnC;;;;QAGA,IAAA,CAAA,iBAAA,GAAmC,EAAE,CAArC;;;;QAGA,IAAA,CAAA,eAAA,GAAiC,EAAE,CAAnC;;;;QAeA,IAAA,CAAA,QAAA,GAAiD,IAAI,CAAC,YAAY,GAAG,IAAI,OAAO,EAAE,GAAG,IAAI,CAAzF;QAOI,IAAI,uBAAuB,IAAI,uBAAuB,CAAC,MAAM,EAAE;YAC7D,IAAI,SAAS,EAAE;gBACb,uBAAuB,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,a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;SACJ,CAAC;KACH;;;;IAED,WAAW,GAAb;QACI,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;KACtB;;;IA9BH,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"collections.js","sources":["../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../src/cdk/collections/selection.ts","../../../src/cdk/collections/array-data-source.ts","../../../src/cdk/collections/data-source.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 {Injectable, OnDestroy} from '@angular/core';\n\n\n// Users of the Dispatcher never need to see this type, but TypeScript requires it to be exported.\nexport type UniqueSelectionDispatcherListener = (id: string, name: string) => void;\n\n/**\n * Class to coordinate unique selection based on name.\n * Intended to be consumed as an Angular service.\n * This service is needed because native radio change events are only fired on the item currently\n * being selected, and we still need to uncheck the previous selection.\n *\n * This service does not *store* any IDs and names because they may change at any time, so it is\n * less error-prone if they are simply passed through when the events occur.\n */\n@Injectable({providedIn: 'root'})\nexport class UniqueSelectionDispatcher implements OnDestroy {\n private _listeners: UniqueSelectionDispatcherListener[] = [];\n\n /**\n * Notify other items that selection for the given name has been set.\n * @param id ID of the item.\n * @param name Name of the item.\n */\n notify(id: string, name: string) {\n for (let listener of this._listeners) {\n listener(id, name);\n }\n }\n\n /**\n * Listen for future changes to item selection.\n * @return Function used to deregister listener\n */\n listen(listener: UniqueSelectionDispatcherListener): () => void {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered: UniqueSelectionDispatcherListener) => {\n return listener !== registered;\n });\n };\n }\n\n ngOnDestroy() {\n this._listeners = [];\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 {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n changed: Subject<SelectionChange<T>> | null = this._emitChanges ? new Subject() : null;\n\n /**\n * Event emitted when the value has changed.\n * @deprecated Use `changed` instead.\n * @breaking-change 8.0.0 To be changed to `changed`\n */\n onChange: Subject<SelectionChange<T>> | null = this.changed;\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true) {\n\n if (initiallySelectedValues && initiallySelectedValues.length) {\n if (_multiple) {\n initiallySelectedValues.forEach(value => this._markSelected(value));\n } else {\n this._markSelected(initiallySelectedValues[0]);\n }\n\n // Clear the array in order to avoid firing the change event for preselected values.\n this._selectedToEmit.length = 0;\n }\n }\n\n /**\n * Selects a value or an array of values.\n */\n select(...values: T[]): void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n this._emitChangeEvent();\n }\n\n /**\n * Deselects a value or an array of values.\n */\n deselect(...values: T[]): void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n this._emitChangeEvent();\n }\n\n /**\n * Toggles a value between selected and deselected.\n */\n toggle(value: T): void {\n this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n */\n clear(): void {\n this._unmarkAll();\n this._emitChangeEvent();\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(value);\n }\n\n /**\n * Determines whether the model does not have a value.\n */\n isEmpty(): boolean {\n return this._selection.size === 0;\n }\n\n /**\n * Determines whether the model has a value.\n */\n hasValue(): boolean {\n return !this.isEmpty();\n }\n\n /**\n * Sorts the selected values based on a predicate function.\n */\n sort(predicate?: (a: T, b: T) => number): void {\n if (this._multiple && this.selected) {\n this._selected!.sort(predicate);\n }\n }\n\n /**\n * Gets whether multiple values can be selected.\n */\n isMultipleSelection() {\n return this._multiple;\n }\n\n /** Emits a change event and clears the records of selected and deselected values. */\n private _emitChangeEvent() {\n // Clear the selected values so they can be re-cached.\n this._selected = null;\n\n if (this._selectedToEmit.length || this._deselectedToEmit.length) {\n if (this.changed) {\n this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\n });\n }\n\n this._deselectedToEmit = [];\n this._selectedToEmit = [];\n }\n }\n\n /** Selects a value. */\n private _markSelected(value: T) {\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n this._selection.add(value);\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n if (this.isSelected(value)) {\n this._selection.delete(value);\n\n if (this._emitChanges) {\n this._deselectedToEmit.push(value);\n }\n }\n }\n\n /** Clears out the selected values. */\n private _unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }\n\n /**\n * Verifies the value assignment and throws an error if the specified value array is\n * including multiple values while the selection model is not supporting multiple values.\n */\n private _verifyValueAssignment(values: T[]) {\n if (values.length > 1 && !this._multiple) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n}\n\n/**\n * Event emitted when the value of a MatSelectionModel has changed.\n * @docs-private\n */\nexport interface SelectionChange<T> {\n /** Model that dispatched the event. */\n source: SelectionModel<T>;\n /** Options that were added to the model. */\n added: T[];\n /** Options that were removed from the model. */\n removed: T[];\n}\n\n/**\n * Returns an error that reports that multiple values are passed into a selection model\n * with a single value.\n */\nexport function getMultipleValuesInSingleSelectionError() {\n return Error('Cannot pass multiple values into SelectionModel with single-value mode.');\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 {Observable, of as observableOf} from 'rxjs';\nimport {DataSource} from './data-source';\n\n\n/** DataSource wrapper for a native array. */\nexport class ArrayDataSource<T> extends DataSource<T> {\n constructor(private _data: T[] | Observable<T[]>) {\n super();\n }\n\n connect(): Observable<T[]> {\n return this._data instanceof Observable ? this._data : observableOf(this._data);\n }\n\n disconnect() {}\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 {Observable} from 'rxjs';\nimport {CollectionViewer} from './collection-viewer';\n\nexport abstract class DataSource<T> {\n /**\n * Connects a collection viewer (such as a data-table) to this data source. Note that\n * the stream provided will be accessed during change detection and should not directly change\n * values that are bound in template views.\n * @param collectionViewer The component that exposes a view over the data provided by this\n * data source.\n * @returns Observable that emits a new value when the data changes.\n */\n abstract connect(collectionViewer: CollectionViewer): Observable<T[]>;\n\n /**\n * Disconnects a collection viewer (such as a data-table) from this data source. Can be used\n * to perform any clean-up or tear-down operations when a view is being destroyed.\n *\n * @param collectionViewer The component that exposes a view over the data provided by this\n * data source.\n */\n abstract disconnect(collectionViewer: CollectionViewer): void;\n}\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;;;;AGWA,AAAA,MAAA,UAAA,CAAA;CAmBC;;;;;;;;;;ADjBD,AAAA,MAAA,eAAgC,SAAQ,UAAa,CAArD;;;;IACE,WAAF,CAAsB,KAA4B,EAAlD;QACI,KAAK,EAAE,CAAC;QADU,IAAtB,CAAA,KAA2B,GAAL,KAAK,CAAuB;KAE/C;;;;IAED,OAAO,GAAT;QACI,OAAO,IAAI,CAAC,KAAK,YAAY,UAAU,GAAG,IAAI,CAAC,KAAK,GA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,sBAAsB,CAAC,MAAW,EAA5C;QACI,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACxC,MAAM,uCAAuC,EAAE,CAAC;SACjD;;CAEJ;;;;;;AAmBD,AAAA,SAAA,uCAAA,GAAA;IACE,OAAO,KAAK,CAAC,yEAAyE,CAAC,CAAC;CACzF;;;;;;;;;;;;;;;AD9LD,AAAA,MAAA,yBAAA,CAAA;;QACA,IAAA,CAAA,UAAA,GAA4D,EAAE,CAA9D;;;;;;;;IAOE,MAAM,CAAC,EAAU,EAAE,IAAY,EAAjC;QACI,KAAK,qBAAI,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE;YACpC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;SACpB;KACF;;;;;;IAMD,MAAM,CAAC,QAA2C,EAApD;QACI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,OAAO,MAAX;YACM,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAA6C,KAA7F;gBACQ,OAAO,QAAQ,KAAK,UAAU,CAAC;aAChC,CAAC,CAAC;SACJ,CAAC;KACH;;;;IAED,WAAW,GAAb;QACI,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;KACtB;;;IA9BH,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;;;;;;;;;;;;;"}
package/esm2015/layout.js CHANGED
@@ -162,9 +162,15 @@ class BreakpointObserver {
162
162
  const /** @type {?} */ queries = splitQueries(coerceArray(value));
163
163
  const /** @type {?} */ observables = queries.map(query => this._registerQuery(query).observable);
164
164
  return combineLatest(observables).pipe(map((breakpointStates) => {
165
- return {
166
- matches: breakpointStates.some(state => state && state.matches)
165
+ const /** @type {?} */ response = {
166
+ matches: false,
167
+ breakpoints: {},
167
168
  };
169
+ breakpointStates.forEach((state) => {
170
+ response.matches = response.matches || state.matches;
171
+ response.breakpoints[state.query] = state.matches;
172
+ });
173
+ return response;
168
174
  }));
169
175
  }
170
176
  /**
@@ -190,9 +196,9 @@ class BreakpointObserver {
190
196
  }, (listener) => {
191
197
  mql.removeListener((e) => this.zone.run(() => listener(e)));
192
198
  })
193
- .pipe(takeUntil(this._destroySubject), startWith(mql), map((nextMql) => ({ matches: nextMql.matches })));
199
+ .pipe(takeUntil(this._destroySubject), startWith(mql), map((nextMql) => ({ query, matches: nextMql.matches })));
194
200
  // Add the MediaQueryList to the set of queries.
195
- const /** @type {?} */ output = { observable: queryObservable, mql: mql };
201
+ const /** @type {?} */ output = { observable: queryObservable, mql };
196
202
  this._queries.set(query, output);
197
203
  return output;
198
204
  }
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../../../src/cdk/layout/breakpoints.ts","../../../src/cdk/layout/breakpoints-observer.ts","../../../src/cdk/layout/media-matcher.ts","../../../src/cdk/layout/layout-module.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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599px)',\n Small: '(min-width: 600px) and (max-width: 959px)',\n Medium: '(min-width: 960px) and (max-width: 1279px)',\n Large: '(min-width: 1280px) and (max-width: 1919px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599px) and (orientation: portrait), ' +\n '(max-width: 959px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {MediaMatcher} from './media-matcher';\nimport {combineLatest, fromEventPattern, Observable, Subject} from 'rxjs';\nimport {map, startWith, takeUntil} from 'rxjs/operators';\nimport {coerceArray} from '@angular/cdk/coercion';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n}\n\ninterface Query {\n observable: Observable<BreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries: Map<string, Query> = new Map();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject: Subject<{}> = new Subject();\n\n constructor(private mediaMatcher: MediaMatcher, private zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n return combineLatest(observables).pipe(map((breakpointStates: BreakpointState[]) => {\n return {\n matches: breakpointStates.some(state => state && state.matches)\n };\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql: MediaQueryList = this.mediaMatcher.matchMedia(query);\n // Create callback for match changes and add it is as a listener.\n const queryObservable = fromEventPattern(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n (listener: MediaQueryListListener) => {\n mql.addListener((e: MediaQueryList) => this.zone.run(() => listener(e)));\n },\n (listener: MediaQueryListListener) => {\n mql.removeListener((e: MediaQueryList) => this.zone.run(() => listener(e)));\n })\n .pipe(\n takeUntil(this._destroySubject),\n startWith(mql),\n map((nextMql: MediaQueryList) => ({matches: nextMql.matches}))\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql: mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: string[]): string[] {\n return queries.map((query: string) => query.split(','))\n .reduce((a1: string[], a2: string[]) => a1.concat(a2))\n .map(query => query.trim());\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 {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private platform: Platform) {\n this._matchMedia = this.platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\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 {NgModule} from '@angular/core';\n\n\n@NgModule()\nexport class LayoutModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AGOA,AAIA,MAAA,YAAA,CAAA;;;IADA,EAAA,IAAA,EAAC,QAAQ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IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC;;;;IAxElB,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;IAlBA,EAAA,IAAA,EAAQ,YAAY,GAApB;IADA,EAAA,IAAA,EAAoB,MAAM,GAA1B;;;;;;;;;AAmGA,SAAA,YAAA,CAAsB,OAAiB,EAAvC;IACE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAa,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACxC,MAAM,CAAC,CAAC,EAAY,EAAE,EAAY,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACrD,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;CAC3C;;;;;;;ADrGD,AAAA,MAAA,iBAAa,WAAW,GAAG;IACzB,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE,2CAA2C;IAClD,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,6CAA6C;IACpD,MAAM,EAAE,qBAAqB;IAE7B,OAAO,EAAE,kDAAkD;QAClD,iDAAiD;IAC1D,MAAM,EAAE,yEAAyE;QACzE,yEAAyE;IACjF,GAAG,EAAE,kDAAkD;QAClD,kDAAkD;IAEvD,eAAe,EAAE,gDAAgD;IACjE,cAAc,EAAE,uEAAuE;IACvF,WAAW,EAAE,gDAAgD;IAE7D,gBAAgB,EAAE,iDAAiD;IACnE,eAAe,EAAE,yEAAyE;IAC1F,YAAY,EAAE,kDAAkD;CACjE;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"layout.js","sources":["../../../src/cdk/layout/breakpoints.ts","../../../src/cdk/layout/breakpoints-observer.ts","../../../src/cdk/layout/media-matcher.ts","../../../src/cdk/layout/layout-module.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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599px)',\n Small: '(min-width: 600px) and (max-width: 959px)',\n Medium: '(min-width: 960px) and (max-width: 1279px)',\n Large: '(min-width: 1280px) and (max-width: 1919px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599px) and (orientation: portrait), ' +\n '(max-width: 959px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {MediaMatcher} from './media-matcher';\nimport {combineLatest, fromEventPattern, Observable, Subject} from 'rxjs';\nimport {map, startWith, takeUntil} from 'rxjs/operators';\nimport {coerceArray} from '@angular/cdk/coercion';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject = new Subject<void>();\n\n constructor(private mediaMatcher: MediaMatcher, private zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n return combineLatest(observables).pipe(map((breakpointStates: InternalBreakpointState[]) => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach((state: InternalBreakpointState) => {\n response.matches = response.matches || state.matches;\n response.breakpoints[state.query] = state.matches;\n });\n return response;\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql: MediaQueryList = this.mediaMatcher.matchMedia(query);\n // Create callback for match changes and add it is as a listener.\n const queryObservable = fromEventPattern(\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n (listener: MediaQueryListListener) => {\n mql.addListener((e: MediaQueryList) => this.zone.run(() => listener(e)));\n },\n (listener: MediaQueryListListener) => {\n mql.removeListener((e: MediaQueryList) => this.zone.run(() => listener(e)));\n })\n .pipe(\n takeUntil(this._destroySubject),\n startWith(mql),\n map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches}))\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: string[]): string[] {\n return queries.map((query: string) => query.split(','))\n .reduce((a1: string[], a2: string[]) => a1.concat(a2))\n .map(query => query.trim());\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 {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private platform: Platform) {\n this._matchMedia = this.platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this.platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\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 {NgModule} from '@angular/core';\n\n\n@NgModule()\nexport class LayoutModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AGOA,AAIA,MAAA,YAAA,CAAA;;;IADA,EAAA,IAAA,EAAC,QAAQ,EAAT;;;;;;;ADHA;;;AAIA,uBAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU,CAAC;;;;AAG1E,qBAAI,mBAAiD,CAAC;;;;AAItD,AAAA,MAAA,YAAA,CAAA;;;;IAIE,WAAF,CAAsB,QAAkB,EAAxC;QAAsB,IAAtB,CAAA,QAA8B,GAAR,QAAQ,CAAU;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU;;;YAG7D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KAClB;;;;;;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AAE,MAAM,EAAC,EAAhC,EAAA;;;;IAjCA,EAAA,IAAA,EAAQ,YAAY,GAApB;IADA,EAAA,IAAA,EAAoB,MAAM,GAA1B;;;;;;;;;AAwHA,SAAA,YAAA,CAAsB,OAAiB,EAAvC;IACE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAa,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACxC,MAAM,CAAC,CAAC,EAAY,EAAE,EAAY,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACrD,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;CAC3C;;;;;;;AD1HD,AAAA,MAAA,iBAAa,WAAW,GAAG;IACzB,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE,2CAA2C;IAClD,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,6CAA6C;IACpD,MAAM,EAAE,qBAAqB;IAE7B,OAAO,EAAE,kDAAkD;QAClD,iDAAiD;IAC1D,MAAM,EAAE,yEAAyE;QACzE,yEAAyE;IACjF,GAAG,EAAE,kDAAkD;QAClD,kDAAkD;IAEvD,eAAe,EAAE,gDAAgD;IACjE,cAAc,EAAE,uEAAuE;IACvF,WAAW,EAAE,gDAAgD;IAE7D,gBAAgB,EAAE,iDAAiD;IACnE,eAAe,EAAE,yEAAyE;IAC1F,YAAY,EAAE,kDAAkD;CACjE;;;;;;;;;;;;;;"}
@@ -52,11 +52,11 @@ class ContentObserver {
52
52
  this._observedElements.forEach((_, element) => this._cleanupObserver(element));
53
53
  }
54
54
  /**
55
- * Observe content changes on an element.
56
- * @param {?} element The element to observe for content changes.
55
+ * @param {?} elementOrRef
57
56
  * @return {?}
58
57
  */
59
- observe(element) {
58
+ observe(elementOrRef) {
59
+ const /** @type {?} */ element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
60
60
  return Observable.create(observer => {
61
61
  const /** @type {?} */ stream = this._observeElement(element);
62
62
  const /** @type {?} */ subscription = stream.subscribe(observer);
@@ -200,7 +200,7 @@ class CdkObserveContent {
200
200
  */
201
201
  _subscribe() {
202
202
  this._unsubscribe();
203
- const /** @type {?} */ stream = this._contentObserver.observe(this._elementRef.nativeElement);
203
+ const /** @type {?} */ stream = this._contentObserver.observe(this._elementRef);
204
204
  // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.
205
205
  // Consider brining it back inside the zone next time we're making breaking changes.
206
206
  // Bringing it back inside can cause things like infinite change detection loops and changed
@@ -1 +1 @@
1
- {"version":3,"file":"observers.js","sources":["../../../src/cdk/observers/observe-content.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 {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]> {\n return Observable.create(observer => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n if (this._disabled) {\n this._unsubscribe();\n } else {\n this._subscribe();\n }\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver, private _elementRef: ElementRef,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef.nativeElement);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,AAAA,MAAA,uBAAA,CAAA;;;;;IACE,MAAM,CAAC,QAA0B,EAAnC;QACI,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF;;;IAJH,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;;;AAUA,AAAA,MAAA,eAAA,CAAA;;;;IAQE,WAAF,CAAsB,wBAAiD,EAAvE;QAAsB,IAAtB,CAAA,wBAA8C,GAAxB,wBAAwB,CAAyB;;;;QANvE,IAAA,CAAA,iBAAA,GAA8B,IAAI,GAAG,EAI/B,CAJN;KAM2E;;;;IAEzE,W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AAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC/F,CAAC,CAAC;;;;;IAGG,YAAY,GAAtB;QACI,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,IAAI,CAAC,oBAAoB,CAAC,WAAW,EAAE,CAAC;SACzC;;;;IAjEL,EAAA,IAAA,EAAC,SAAS,EAAV,IAAA,EAAA,CAAW;gBACT,QAAQ,EAAE,qBAAqB;gBAC/B,QAAQ,EAAE,mBAAmB;aAC9B,EAAD,EAAA;;;;IAtFA,EAAA,IAAA,EAAa,eAAe,GAA5B;IA1BA,EAAA,IAAA,EAAE,UAAU,GAAZ;IAKA,EAAA,IAAA,EAAE,MAAM,GAAR;;;IA8GA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,IAAA,EAAA,CAAU,mBAAmB,EAA7B,EAAA,EAAA;IAMA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,2BAA2B,EAApC,EAAA,EAAA;IAaA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;;AAkDA,MAAA,eAAA,CAAA;;;IALA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACrC,EAAD,EAAA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"observers.js","sources":["../../../src/cdk/observers/observe-content.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 {coerceBooleanProperty, coerceNumberProperty} from '@angular/cdk/coercion';\nimport {\n AfterContentInit,\n Directive,\n ElementRef,\n EventEmitter,\n Injectable,\n Input,\n NgModule,\n NgZone,\n OnDestroy,\n Output,\n} from '@angular/core';\nimport {Observable, Subject, Subscription} from 'rxjs';\nimport {debounceTime} from 'rxjs/operators';\n\n/**\n * Factory that creates a new MutationObserver and allows us to stub it out in unit tests.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class MutationObserverFactory {\n create(callback: MutationCallback): MutationObserver | null {\n return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);\n }\n}\n\n\n/** An injectable service that allows watching elements for changes to their content. */\n@Injectable({providedIn: 'root'})\nexport class ContentObserver implements OnDestroy {\n /** Keeps track of the existing MutationObservers so they can be reused. */\n private _observedElements = new Map<Element, {\n observer: MutationObserver | null,\n stream: Subject<MutationRecord[]>,\n count: number\n }>();\n\n constructor(private _mutationObserverFactory: MutationObserverFactory) {}\n\n ngOnDestroy() {\n this._observedElements.forEach((_, element) => this._cleanupObserver(element));\n }\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: Element): Observable<MutationRecord[]>;\n\n /**\n * Observe content changes on an element.\n * @param element The element to observe for content changes.\n */\n observe(element: ElementRef<Element>): Observable<MutationRecord[]>;\n\n observe(elementOrRef: Element | ElementRef<Element>): Observable<MutationRecord[]> {\n const element = elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n\n return Observable.create(observer => {\n const stream = this._observeElement(element);\n const subscription = stream.subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n this._unobserveElement(element);\n };\n });\n }\n\n /**\n * Observes the given element by using the existing MutationObserver if available, or creating a\n * new one if not.\n */\n private _observeElement(element: Element): Subject<MutationRecord[]> {\n if (!this._observedElements.has(element)) {\n const stream = new Subject<MutationRecord[]>();\n const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations));\n if (observer) {\n observer.observe(element, {\n characterData: true,\n childList: true,\n subtree: true\n });\n }\n this._observedElements.set(element, {observer, stream, count: 1});\n } else {\n this._observedElements.get(element)!.count++;\n }\n return this._observedElements.get(element)!.stream;\n }\n\n /**\n * Un-observes the given element and cleans up the underlying MutationObserver if nobody else is\n * observing this element.\n */\n private _unobserveElement(element: Element) {\n if (this._observedElements.has(element)) {\n this._observedElements.get(element)!.count--;\n if (!this._observedElements.get(element)!.count) {\n this._cleanupObserver(element);\n }\n }\n }\n\n /** Clean up the underlying MutationObserver for the specified element. */\n private _cleanupObserver(element: Element) {\n if (this._observedElements.has(element)) {\n const {observer, stream} = this._observedElements.get(element)!;\n if (observer) {\n observer.disconnect();\n }\n stream.complete();\n this._observedElements.delete(element);\n }\n }\n}\n\n\n/**\n * Directive that triggers a callback whenever the content of\n * its associated element has changed.\n */\n@Directive({\n selector: '[cdkObserveContent]',\n exportAs: 'cdkObserveContent',\n})\nexport class CdkObserveContent implements AfterContentInit, OnDestroy {\n /** Event emitted for each change in the element's content. */\n @Output('cdkObserveContent') event = new EventEmitter<MutationRecord[]>();\n\n /**\n * Whether observing content is disabled. This option can be used\n * to disconnect the underlying MutationObserver until it is needed.\n */\n @Input('cdkObserveContentDisabled')\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n this._disabled = coerceBooleanProperty(value);\n if (this._disabled) {\n this._unsubscribe();\n } else {\n this._subscribe();\n }\n }\n private _disabled = false;\n\n /** Debounce interval for emitting the changes. */\n @Input()\n get debounce(): number { return this._debounce; }\n set debounce(value: number) {\n this._debounce = coerceNumberProperty(value);\n this._subscribe();\n }\n private _debounce: number;\n\n private _currentSubscription: Subscription | null = null;\n\n constructor(private _contentObserver: ContentObserver,\n private _elementRef: ElementRef<HTMLElement>,\n private _ngZone: NgZone) {}\n\n ngAfterContentInit() {\n if (!this._currentSubscription && !this.disabled) {\n this._subscribe();\n }\n }\n\n ngOnDestroy() {\n this._unsubscribe();\n }\n\n private _subscribe() {\n this._unsubscribe();\n const stream = this._contentObserver.observe(this._elementRef);\n\n // TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.\n // Consider brining it back inside the zone next time we're making breaking changes.\n // Bringing it back inside can cause things like infinite change detection loops and changed\n // after checked errors if people's code isn't handling it properly.\n this._ngZone.runOutsideAngular(() => {\n this._currentSubscription =\n (this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event);\n });\n }\n\n private _unsubscribe() {\n if (this._currentSubscription) {\n this._currentSubscription.unsubscribe();\n }\n }\n}\n\n\n@NgModule({\n exports: [CdkObserveContent],\n declarations: [CdkObserveContent],\n providers: [MutationObserverFactory]\n})\nexport class ObserversModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,AAAA,MAAA,uBAAA,CAAA;;;;;IACE,MAAM,CAAC,QAA0B,EAAnC;QACI,OAAO,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;KACxF;;;IAJH,EAAA,IAAA,EAAC,UAAU,EAAX,IAAA,EAAA,CAAY,EAAC,UAAU,EAAE,MAAM,EAAC,EAAhC,EAAA;;;;;;AAUA,AAAA,MAAA,eAAA,CAAA;;;;IAQE,WAAF,CAAsB,wBAAiD,EAAvE;QAAsB,IAAtB,CAAA,wBAA8C,GAAxB,wBAAwB,CAAyB;;;;QANvE,IAAA,CAAA,iBAAA,GAA8B,IAAI,GAAG,EAI/B,CAJN;KAM2E;;;;IAEzE,WAAW,GAAb;QACI,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;KAChF;;;;;IAcD,OAAO,CAAC,YAA2C,EAArD;QACI,uBAAM,OAAO,GAAG,YAAY,YAAY,UAAU,GAAG,YAAY,CAAC,aAAa,GAAG,YAAY,CAAC;QAE/F,OAAO,UAAU,CAAC,MAAM,CAAC,QAAQ,IAArC;YACM,uBAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC7C,uBAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC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A,IAAA,EAAE,UAAU,GAAZ;IAKA,EAAA,IAAA,EAAE,MAAM,GAAR;;;IAwHA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAG,MAAM,EAAT,IAAA,EAAA,CAAU,mBAAmB,EAA7B,EAAA,EAAA;IAMA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,IAAA,EAAA,CAAS,2BAA2B,EAApC,EAAA,EAAA;IAaA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAG,KAAK,EAAR,EAAA;;AAmDA,MAAA,eAAA,CAAA;;;IALA,EAAA,IAAA,EAAC,QAAQ,EAAT,IAAA,EAAA,CAAU;gBACR,OAAO,EAAE,CAAC,iBAAiB,CAAC;gBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;gBACjC,SAAS,EAAE,CAAC,uBAAuB,CAAC;aACrC,EAAD,EAAA;;;;;;;;;;;;;;;"}
@@ -10,8 +10,8 @@ import { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angula
10
10
  import { ScrollDispatcher, ViewportRuler, ScrollDispatchModule, VIEWPORT_RULER_PROVIDER } from '@angular/cdk/scrolling';
11
11
  export { ViewportRuler, VIEWPORT_RULER_PROVIDER, CdkScrollable, ScrollDispatcher } from '@angular/cdk/scrolling';
12
12
  import { DOCUMENT } from '@angular/common';
13
- import { Observable, Subject, Subscription } from 'rxjs';
14
- import { take } from 'rxjs/operators';
13
+ import { Observable, Subject, merge, Subscription } from 'rxjs';
14
+ import { take, takeUntil } from 'rxjs/operators';
15
15
  import { Platform } from '@angular/cdk/platform';
16
16
  import { Directionality, BidiModule } from '@angular/cdk/bidi';
17
17
  import { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';
@@ -796,6 +796,9 @@ class OverlayRef {
796
796
  this._config.positionStrategy.attach(this);
797
797
  }
798
798
  // Update the pane element with the given configuration.
799
+ if (!this._host.parentElement && this._previousHostParent) {
800
+ this._previousHostParent.appendChild(this._host);
801
+ }
799
802
  this._updateStackingOrder();
800
803
  this._updateElementSize();
801
804
  this._updateElementDirection();
@@ -855,6 +858,24 @@ class OverlayRef {
855
858
  this._detachments.next();
856
859
  // Remove this overlay from keyboard dispatcher tracking.
857
860
  this._keyboardDispatcher.remove(this);
861
+ // Keeping the host element in DOM the can cause scroll jank, because it still gets rendered,
862
+ // even though it's transparent and unclickable. We can't remove the host here immediately,
863
+ // because the overlay pane's content might still be animating. This stream helps us avoid
864
+ // interrupting the animation by waiting for the pane to become empty.
865
+ const /** @type {?} */ subscription = this._ngZone.onStable
866
+ .asObservable()
867
+ .pipe(takeUntil(merge(this._attachments, this._detachments)))
868
+ .subscribe(() => {
869
+ // Needs a couple of checks for the pane and host, because
870
+ // they may have been removed by the time the zone stabilizes.
871
+ if (!this._pane || !this._host || this._pane.children.length === 0) {
872
+ if (this._host && this._host.parentElement) {
873
+ this._previousHostParent = this._host.parentElement;
874
+ this._previousHostParent.removeChild(this._host);
875
+ }
876
+ subscription.unsubscribe();
877
+ }
878
+ });
858
879
  return detachmentResult;
859
880
  }
860
881
  /**
@@ -879,7 +900,7 @@ class OverlayRef {
879
900
  this._host.parentNode.removeChild(this._host);
880
901
  this._host = /** @type {?} */ ((null));
881
902
  }
882
- this._pane = /** @type {?} */ ((null));
903
+ this._previousHostParent = this._pane = /** @type {?} */ ((null));
883
904
  if (isAttached) {
884
905
  this._detachments.next();
885
906
  }