@angular/cdk 11.0.2 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/LICENSE +1 -1
  2. package/a11y/aria-describer/aria-describer.d.ts +9 -14
  3. package/a11y/focus-monitor/focus-monitor.d.ts +6 -0
  4. package/a11y/index.metadata.json +1 -1
  5. package/bundles/cdk-a11y.umd.js +83 -66
  6. package/bundles/cdk-a11y.umd.js.map +1 -1
  7. package/bundles/cdk-a11y.umd.min.js +13 -21
  8. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.js.map +1 -1
  10. package/bundles/cdk-bidi.umd.js.map +1 -1
  11. package/bundles/cdk-coercion.umd.js +9 -1
  12. package/bundles/cdk-coercion.umd.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-collections.umd.js +9 -1
  15. package/bundles/cdk-collections.umd.js.map +1 -1
  16. package/bundles/cdk-collections.umd.min.js +1 -1
  17. package/bundles/cdk-collections.umd.min.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.js +96 -50
  19. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  20. package/bundles/cdk-drag-drop.umd.min.js +8 -8
  21. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.js +48 -10
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +18 -25
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-platform.umd.js +1 -0
  27. package/bundles/cdk-platform.umd.js.map +1 -1
  28. package/bundles/cdk-platform.umd.min.js +1 -1
  29. package/bundles/cdk-platform.umd.min.js.map +1 -1
  30. package/bundles/cdk-portal.umd.js +9 -1
  31. package/bundles/cdk-portal.umd.js.map +1 -1
  32. package/bundles/cdk-portal.umd.min.js +2 -2
  33. package/bundles/cdk-portal.umd.min.js.map +1 -1
  34. package/bundles/cdk-scrolling.umd.js +25 -11
  35. package/bundles/cdk-scrolling.umd.js.map +1 -1
  36. package/bundles/cdk-scrolling.umd.min.js +4 -4
  37. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  38. package/bundles/cdk-table.umd.js +99 -30
  39. package/bundles/cdk-table.umd.js.map +1 -1
  40. package/bundles/cdk-table.umd.min.js +7 -7
  41. package/bundles/cdk-table.umd.min.js.map +1 -1
  42. package/bundles/cdk-testing-protractor.umd.js +59 -13
  43. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  44. package/bundles/cdk-testing-protractor.umd.min.js +2 -2
  45. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  46. package/bundles/cdk-testing-testbed.umd.js +40 -15
  47. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  48. package/bundles/cdk-testing-testbed.umd.min.js +7 -7
  49. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  50. package/bundles/cdk-testing.umd.js +11 -10
  51. package/bundles/cdk-testing.umd.js.map +1 -1
  52. package/bundles/cdk-testing.umd.min.js +2 -2
  53. package/bundles/cdk-testing.umd.min.js.map +1 -1
  54. package/bundles/cdk-tree.umd.js +9 -1
  55. package/bundles/cdk-tree.umd.js.map +1 -1
  56. package/bundles/cdk-tree.umd.min.js +5 -5
  57. package/bundles/cdk-tree.umd.min.js.map +1 -1
  58. package/bundles/cdk.umd.js +1 -1
  59. package/bundles/cdk.umd.js.map +1 -1
  60. package/bundles/cdk.umd.min.js +1 -1
  61. package/bundles/cdk.umd.min.js.map +1 -1
  62. package/drag-drop/directives/drag.d.ts +1 -1
  63. package/drag-drop/directives/drop-list.d.ts +4 -1
  64. package/drag-drop/drag-drop-registry.d.ts +8 -1
  65. package/drag-drop/drag-ref.d.ts +2 -0
  66. package/drag-drop/drop-list-ref.d.ts +7 -1
  67. package/drag-drop/index.metadata.json +1 -1
  68. package/esm2015/a11y/aria-describer/aria-describer.js +50 -55
  69. package/esm2015/a11y/focus-monitor/focus-monitor.js +18 -3
  70. package/esm2015/drag-drop/directives/drag.js +6 -4
  71. package/esm2015/drag-drop/directives/drop-list.js +4 -2
  72. package/esm2015/drag-drop/drag-drop-registry.js +25 -12
  73. package/esm2015/drag-drop/drag-ref.js +10 -8
  74. package/esm2015/drag-drop/drop-list-ref.js +46 -28
  75. package/esm2015/overlay/position/flexible-connected-position-strategy.js +25 -3
  76. package/esm2015/overlay/scroll/block-scroll-strategy.js +13 -4
  77. package/esm2015/platform/features/scrolling.js +2 -1
  78. package/esm2015/scrolling/fixed-size-virtual-scroll.js +3 -2
  79. package/esm2015/scrolling/scroll-dispatcher.js +9 -8
  80. package/esm2015/scrolling/virtual-for-of.js +8 -4
  81. package/esm2015/scrolling/virtual-scroll-viewport.js +1 -1
  82. package/esm2015/table/public-api.js +2 -1
  83. package/esm2015/table/sticky-position-listener.js +11 -0
  84. package/esm2015/table/sticky-styler.js +60 -14
  85. package/esm2015/table/table.js +9 -4
  86. package/esm2015/testing/change-detection.js +1 -8
  87. package/esm2015/testing/harness-environment.js +3 -3
  88. package/esm2015/testing/protractor/protractor-element.js +29 -13
  89. package/esm2015/testing/test-element.js +1 -1
  90. package/esm2015/testing/testbed/fake-events/dispatch-events.js +3 -3
  91. package/esm2015/testing/testbed/fake-events/event-objects.js +6 -6
  92. package/esm2015/testing/testbed/unit-test-element.js +21 -9
  93. package/esm2015/tree/nested-node.js +1 -1
  94. package/esm2015/tree/padding.js +1 -1
  95. package/esm2015/tree/toggle.js +1 -1
  96. package/esm2015/tree/tree.js +1 -1
  97. package/esm2015/version.js +1 -1
  98. package/fesm2015/a11y.js +67 -55
  99. package/fesm2015/a11y.js.map +1 -1
  100. package/fesm2015/accordion.js.map +1 -1
  101. package/fesm2015/bidi.js.map +1 -1
  102. package/fesm2015/cdk.js +1 -1
  103. package/fesm2015/cdk.js.map +1 -1
  104. package/fesm2015/drag-drop.js +85 -48
  105. package/fesm2015/drag-drop.js.map +1 -1
  106. package/fesm2015/overlay.js +36 -6
  107. package/fesm2015/overlay.js.map +1 -1
  108. package/fesm2015/platform.js +1 -0
  109. package/fesm2015/platform.js.map +1 -1
  110. package/fesm2015/scrolling.js +17 -12
  111. package/fesm2015/scrolling.js.map +1 -1
  112. package/fesm2015/table.js +77 -17
  113. package/fesm2015/table.js.map +1 -1
  114. package/fesm2015/testing/protractor.js +27 -11
  115. package/fesm2015/testing/protractor.js.map +1 -1
  116. package/fesm2015/testing/testbed.js +25 -13
  117. package/fesm2015/testing/testbed.js.map +1 -1
  118. package/fesm2015/testing.js +2 -9
  119. package/fesm2015/testing.js.map +1 -1
  120. package/fesm2015/tree.js.map +1 -1
  121. package/overlay/index.metadata.json +1 -1
  122. package/package.json +1 -1
  123. package/schematics/ng-add/index.js +1 -1
  124. package/scrolling/index.metadata.json +1 -1
  125. package/scrolling/scroll-dispatcher.d.ts +3 -3
  126. package/table/index.metadata.json +1 -1
  127. package/table/public-api.d.ts +1 -0
  128. package/table/sticky-position-listener.d.ts +28 -0
  129. package/table/sticky-styler.d.ts +7 -2
  130. package/table/table.d.ts +4 -2
  131. package/testing/change-detection.d.ts +44 -1
  132. package/testing/protractor/protractor-element.d.ts +12 -4
  133. package/testing/test-element.d.ts +11 -5
  134. package/testing/testbed/fake-events/dispatch-events.d.ts +1 -1
  135. package/testing/testbed/fake-events/event-objects.d.ts +1 -1
  136. package/testing/testbed/unit-test-element.d.ts +12 -4
  137. package/tree/index.metadata.json +1 -1
  138. package/tree/nested-node.d.ts +3 -3
  139. package/tree/padding.d.ts +2 -2
  140. package/tree/toggle.d.ts +4 -4
  141. package/tree/tree.d.ts +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"accordion.js","sources":["../../../../../../src/cdk/accordion/accordion.ts","../../../../../../src/cdk/accordion/accordion-item.ts","../../../../../../src/cdk/accordion/accordion-module.ts","../../../../../../src/cdk/accordion/public-api.ts","../../../../../../src/cdk/accordion/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, InjectionToken, 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 * Injection token that can be used to reference instances of `CdkAccordion`. It serves\n * as alternative token to the actual `CdkAccordion` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_ACCORDION = new InjectionToken<CdkAccordion>('CdkAccordion');\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 providers: [{provide: CDK_ACCORDION, useExisting: 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 static ngAcceptInputType_multi: BooleanInput;\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 {\n Output,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n ChangeDetectorRef,\n SkipSelf,\n Inject,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {CDK_ACCORDION, CdkAccordion} from './accordion';\nimport {BooleanInput, 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 `CDK_ACCORDION` as undefined to prevent nested accordion items from\n // registering to the same accordion.\n {provide: CDK_ACCORDION, 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() @Inject(CDK_ACCORDION) @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 static ngAcceptInputType_expanded: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\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\nexport {CdkAccordionItem} from './accordion-item';\nexport {CdkAccordion} from './accordion';\nexport * from './accordion-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {CDK_ACCORDION as ɵangular_material_src_cdk_accordion_accordion_a} from './accordion';"],"names":["nextId"],"mappings":";;;;;AAAA;;;;;;;AAQA,AAIA;AACA,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;;AAOf,MAAa,aAAa,GAAG,IAAI,cAAc,CAAe,cAAc,CAAC,CAAC;;;;AAU9E,MAAa,YAAY;IALzB;;QAOW,kBAAa,GAAG,IAAI,OAAO,EAAiB,CAAC;;QAG7C,yBAAoB,GAAqB,IAAI,OAAO,EAAW,CAAC;;QAGhE,OAAE,GAAG,iBAAiB,MAAM,EAAE,EAAE,CAAC;QAMlC,WAAM,GAAY,KAAK,CAAC;KA2BjC;;IA9BC,IACI,KAAK,KAAc,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE;IAC5C,IAAI,KAAK,CAAC,KAAc,IAAI,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE;;IAIzE,OAAO;QACL,IAAI,CAAC,aAA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BAEN,MAAM;wBAEN,MAAM;6BAON,MAAM;uBAMN,KAAK;uBA8BL,KAAK;;;AC3FR;;;;;;;AAQA,MASa,kBAAkB;;;YAJ9B,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;gBACzC,YAAY,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;aAC/C;;;AChBD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
1
+ {"version":3,"file":"accordion.js","sources":["../../../../../../src/cdk/accordion/accordion.ts","../../../../../../src/cdk/accordion/accordion-item.ts","../../../../../../src/cdk/accordion/accordion-module.ts","../../../../../../src/cdk/accordion/public-api.ts","../../../../../../src/cdk/accordion/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {Directive, InjectionToken, 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 * Injection token that can be used to reference instances of `CdkAccordion`. It serves\n * as alternative token to the actual `CdkAccordion` class which could cause unnecessary\n * retention of the class and its directive metadata.\n */\nexport const CDK_ACCORDION = new InjectionToken<CdkAccordion>('CdkAccordion');\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 providers: [{provide: CDK_ACCORDION, useExisting: 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 static ngAcceptInputType_multi: BooleanInput;\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 {\n Output,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n ChangeDetectorRef,\n SkipSelf,\n Inject,\n} from '@angular/core';\nimport {UniqueSelectionDispatcher} from '@angular/cdk/collections';\nimport {CDK_ACCORDION, CdkAccordion} from './accordion';\nimport {BooleanInput, 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 `CDK_ACCORDION` as undefined to prevent nested accordion items from\n // registering to the same accordion.\n {provide: CDK_ACCORDION, 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() @Inject(CDK_ACCORDION) @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 static ngAcceptInputType_expanded: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\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\nexport {CdkAccordionItem} from './accordion-item';\nexport {CdkAccordion} from './accordion';\nexport * from './accordion-module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {CDK_ACCORDION as ɵangular_material_src_cdk_accordion_accordion_a} from './accordion';"],"names":["nextId"],"mappings":";;;;;AAAA;;;;;;;AAQA,AAIA;AACA,IAAI,MAAM,GAAG,CAAC,CAAC;;;;;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O,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,SAAS,CAAC,QAAQ;;YAE3D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;aAC1B;SACF,CAAC,CAAC;KACJ;;;YA3HF,SAAS,SAAC;gBACT,QAAQ,EAAE,wCAAwC;gBAClD,QAAQ,EAAE,kBAAkB;gBAC5B,SAAS,EAAE;;;oBAGT,EAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,IAAW,EAAC;iBAC9C;aACF;;;YAnBsB,YAAY,uBA+EpB,QAAQ,YAAI,MAAM,SAAC,aAAa,cAAG,QAAQ;YApFxD,iBAAiB;YAIX,yBAAyB;;;qBAyB9B,MAAM;qBAEN,MAAM;wBAEN,MAAM;6BAON,MAAM;uBAMN,KAAK;uBA8BL,KAAK;;;AC3FR;;;;;;;AAQA,MASa,kBAAkB;;;YAJ9B,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;gBACzC,YAAY,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;aAC/C;;;AChBD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"bidi.js","sources":["../../../../../../src/cdk/bidi/dir-document-token.ts","../../../../../../src/cdk/bidi/directionality.ts","../../../../../../src/cdk/bidi/dir.ts","../../../../../../src/cdk/bidi/bidi-module.ts","../../../../../../src/cdk/bidi/public-api.ts","../../../../../../src/cdk/bidi/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {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","/**\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 {\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: {'[attr.dir]': '_rawDir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n /** Normalized direction that accounts for invalid/unsupported values. */\n private _dir: Direction = 'ltr';\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Direction as passed in by the consumer. */\n _rawDir: string;\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 const normalizedValue = value ? value.toLowerCase() : value;\n\n this._rawDir = value;\n this._dir = (normalizedValue === 'ltr' || normalizedValue === 'rtl') ? normalizedValue : 'ltr';\n\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 {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\nexport {Directionality, Direction} from './directionality';\nexport {DIR_DOCUMENT} from './dir-document-token';\nexport {Dir} from './dir';\nexport * from './bidi-module';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {DIR_DOCUMENT_FACTORY as ɵangular_material_src_cdk_bidi_bidi_a} from './dir-document-token';"],"names":[],"mappings":";;;AAAA;;;;;;;AAQA,AAIA;;;;;;;;;;;;;;;AAeA,MAAa,YAAY,GAAG,IAAI,cAAc,CAAW,aAAa,EAAE;IACtE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAC;;AAGH,SAAgB,oBAAoB;IAClC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CACzB;;ACnCD;;;;;;;AAQA,AAOA;;;;AAKA,MAAa,cAAc;IAOzB,YAA8C,SAAe;;QALpD,UAAK,GAAc,KAAK,CAAC;;QAGzB,WAAM,GAAG,IAAI,YAAY,EAAa,CAAC;QAG9C,IAAI,SAAS,EAAE;;;;;YAKb,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC;YACjF,MAAM,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;QACT,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;KACxB;;;;YAvBF,UAAU,SAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;4CAQjB,QAAQ,YAAI,MAAM,SAAC,YAAY;;;AC3B9C;;;;;;;AAQA,AAWA;;;;;;AAYA,MAAa,GAAG;IANhB;;QAQU,SAAI,GAAc,KAAK,CAAC;;QAGxB,mBAAc,GAAY,KAAK,CAAC;;QAMnB,WAAM,GAAG,IAAI,YAAY,EAAa,CAAC;KA4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../src/cdk/bidi/directionality.ts","../../../../../../src/cdk/bidi/dir.ts","../../../../../../src/cdk/bidi/bidi-module.ts","../../../../../../src/cdk/bidi/public-api.ts","../../../../../../src/cdk/bidi/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {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","/**\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 {\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: {'[attr.dir]': '_rawDir'},\n exportAs: 'dir',\n})\nexport class Dir implements Directionality, AfterContentInit, OnDestroy {\n /** Normalized direction that accounts for invalid/unsupported values. */\n private _dir: Direction = 'ltr';\n\n /** Whether the `value` has been set to its initial value. */\n private _isInitialized: boolean = false;\n\n /** Direction as passed in by the consumer. */\n _rawDir: string;\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 const normalizedValue = value ? value.toLowerCase() : value;\n\n this._rawDir = value;\n this._dir = (normalizedValue === 'ltr' || normalizedValue === 'rtl') ? normalizedValue : 'ltr';\n\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 {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\nexport {Directionality, Direction} from './directionality';\nexport {DIR_DOCUMENT} from './dir-document-token';\nexport {Dir} from './dir';\nexport * from './bidi-module';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {DIR_DOCUMENT_FACTORY as ɵangular_material_src_cdk_bidi_bidi_a} from './dir-document-token';"],"names":[],"mappings":";;;AAAA;;;;;;;AAQA,AAIA;;;;;;;;;;;;;;;AAeA,MAAa,YAAY,GAAG,IAAI,cAAc,CAAW,aAAa,EAAE;IACtE,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,oBAAoB;CAC9B,CAAC,CAAC;;AAGH,SAAgB,oBAAoB;IAClC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;CACzB;;ACnCD;;;;;;;AAQA,AAOA;;;;AAKA,MAAa,cAAc;IAOzB,YAA8C,SAAe;;QALpD,UAAK,GAAc,KAAK,CAAC;;QAGzB,WAAM,GAAG,IAAI,YAAY,EAAa,CAAC;QAG9C,IAAI,SAAS,EAAE;;;;;YAKb,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC;YACjF,MAAM,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC;YACjC,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,KAAK,K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AE,WAAW,EAAE,GAAG,EAAC,CAAC;gBACxD,IAAI,EAAE,EAAC,YAAY,EAAE,SAAS,EAAC;gBAC/B,QAAQ,EAAE,KAAK;aAChB;;;qBAYE,MAAM,SAAC,WAAW;kBAGlB,KAAK;;;AC7CR;;;;;;;AAQA,MAQa,UAAU;;;YAJtB,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,GAAG,CAAC;gBACd,YAAY,EAAE,CAAC,GAAG,CAAC;aACpB;;;ACfD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
package/fesm2015/cdk.js CHANGED
@@ -8,7 +8,7 @@ import { Version } from '@angular/core';
8
8
  * found in the LICENSE file at https://angular.io/license
9
9
  */
10
10
  /** Current version of the Angular Component Development Kit. */
11
- const VERSION = new Version('11.0.2');
11
+ const VERSION = new Version('11.1.0');
12
12
 
13
13
  /**
14
14
  * @license
@@ -1 +1 @@
1
- {"version":3,"file":"cdk.js","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.0.2');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAQA,AAEA;AACA,MAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;ACXvD;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
1
+ {"version":3,"file":"cdk.js","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('11.1.0');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAQA,AAEA;AACA,MAAa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB,CAAC;;ACXvD;;;;;;GAMG;;ACNH;;;;;;GAMG;;;;"}
@@ -389,9 +389,6 @@ class DragRef {
389
389
  };
390
390
  /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */
391
391
  this._pointerMove = (event) => {
392
- // Prevent the default action as early as possible in order to block
393
- // native actions like dragging the selected text or images with the mouse.
394
- event.preventDefault();
395
392
  const pointerPosition = this._getPointerPositionOnPage(event);
396
393
  if (!this._hasStartedDragging) {
397
394
  const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x);
@@ -426,6 +423,10 @@ class DragRef {
426
423
  this._previewRect = (this._preview || this._rootElement).getBoundingClientRect();
427
424
  }
428
425
  }
426
+ // We prevent the default action down here so that we know that dragging has started. This is
427
+ // important for touch devices where doing this too early can unnecessarily block scrolling,
428
+ // if there's a dragging delay.
429
+ event.preventDefault();
429
430
  const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition);
430
431
  this._hasMoved = true;
431
432
  this._lastKnownPointerPosition = pointerPosition;
@@ -782,10 +783,11 @@ class DragRef {
782
783
  * @param event Browser event object that started the sequence.
783
784
  */
784
785
  _initializeDragSequence(referenceElement, event) {
785
- // Always stop propagation for the event that initializes
786
- // the dragging sequence, in order to prevent it from potentially
787
- // starting another sequence for a draggable parent somewhere up the DOM tree.
788
- event.stopPropagation();
786
+ // Stop propagation if the item is inside another
787
+ // draggable so we don't start multiple drag sequences.
788
+ if (this._config.parentDragRef) {
789
+ event.stopPropagation();
790
+ }
789
791
  const isDragging = this.isDragging();
790
792
  const isTouchSequence = isTouchEvent(event);
791
793
  const isAuxiliaryMouseButton = !isTouchSequence && event.button !== 0;
@@ -1404,11 +1406,6 @@ const DROP_PROXIMITY_THRESHOLD = 0.05;
1404
1406
  * viewport. The value comes from trying it out manually until it feels right.
1405
1407
  */
1406
1408
  const SCROLL_PROXIMITY_THRESHOLD = 0.05;
1407
- /**
1408
- * Number of pixels to scroll for each frame when auto-scrolling an element.
1409
- * The value comes from trying it out manually until it feels right.
1410
- */
1411
- const AUTO_SCROLL_STEP = 2;
1412
1409
  /**
1413
1410
  * Reference to a drop list. Used to manipulate or dispose of the container.
1414
1411
  */
@@ -1426,6 +1423,8 @@ class DropListRef {
1426
1423
  * moves their pointer close to the edges is disabled.
1427
1424
  */
1428
1425
  this.autoScrollDisabled = false;
1426
+ /** Number of pixels to scroll for each frame when auto-scrolling an element. */
1427
+ this.autoScrollStep = 2;
1429
1428
  /**
1430
1429
  * Function that is used to determine whether an item
1431
1430
  * is allowed to be moved into a drop container.
@@ -1458,6 +1457,8 @@ class DropListRef {
1458
1457
  * overlap with the swapped item after the swapping occurred.
1459
1458
  */
1460
1459
  this._previousSwap = { drag: null, delta: 0, overlaps: false };
1460
+ /** Draggable items in the container. */
1461
+ this._draggables = [];
1461
1462
  /** Drop lists that are connected to the current one. */
1462
1463
  this._siblings = [];
1463
1464
  /** Direction in which the list is oriented. */
@@ -1483,17 +1484,18 @@ class DropListRef {
1483
1484
  .pipe(takeUntil(this._stopScrollTimers))
1484
1485
  .subscribe(() => {
1485
1486
  const node = this._scrollNode;
1487
+ const scrollStep = this.autoScrollStep;
1486
1488
  if (this._verticalScrollDirection === 1 /* UP */) {
1487
- incrementVerticalScroll(node, -AUTO_SCROLL_STEP);
1489
+ incrementVerticalScroll(node, -scrollStep);
1488
1490
  }
1489
1491
  else if (this._verticalScrollDirection === 2 /* DOWN */) {
1490
- incrementVerticalScroll(node, AUTO_SCROLL_STEP);
1492
+ incrementVerticalScroll(node, scrollStep);
1491
1493
  }
1492
1494
  if (this._horizontalScrollDirection === 1 /* LEFT */) {
1493
- incrementHorizontalScroll(node, -AUTO_SCROLL_STEP);
1495
+ incrementHorizontalScroll(node, -scrollStep);
1494
1496
  }
1495
1497
  else if (this._horizontalScrollDirection === 2 /* RIGHT */) {
1496
- incrementHorizontalScroll(node, AUTO_SCROLL_STEP);
1498
+ incrementHorizontalScroll(node, scrollStep);
1497
1499
  }
1498
1500
  });
1499
1501
  };
@@ -1524,18 +1526,8 @@ class DropListRef {
1524
1526
  }
1525
1527
  /** Starts dragging an item. */
1526
1528
  start() {
1527
- const styles = coerceElement(this.element).style;
1528
- this.beforeStarted.next();
1529
- this._isDragging = true;
1530
- // We need to disable scroll snapping while the user is dragging, because it breaks automatic
1531
- // scrolling. The browser seems to round the value based on the snapping points which means
1532
- // that we can't increment/decrement the scroll position.
1533
- this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';
1534
- styles.scrollSnapType = styles.msScrollSnapType = 'none';
1535
- this._cacheItems();
1536
- this._siblings.forEach(sibling => sibling._startReceiving(this));
1537
- this._viewportScrollSubscription.unsubscribe();
1538
- this._listenToScrollEvents();
1529
+ this._draggingStarted();
1530
+ this._notifyReceivingSiblings();
1539
1531
  }
1540
1532
  /**
1541
1533
  * Emits an event to indicate that the user moved an item into the container.
@@ -1546,7 +1538,7 @@ class DropListRef {
1546
1538
  * out automatically.
1547
1539
  */
1548
1540
  enter(item, pointerX, pointerY, index) {
1549
- this.start();
1541
+ this._draggingStarted();
1550
1542
  // If sorting is disabled, we want the item to return to its starting
1551
1543
  // position if the user is returning it to its initial container.
1552
1544
  let newIndex;
@@ -1598,6 +1590,8 @@ class DropListRef {
1598
1590
  // but we need to refresh them since the amount of items has changed and also parent rects.
1599
1591
  this._cacheItemPositions();
1600
1592
  this._cacheParentPositions();
1593
+ // Notify siblings at the end so that the item has been inserted into the `activeDraggables`.
1594
+ this._notifyReceivingSiblings();
1601
1595
  this.entered.next({ item, container: this, currentIndex: this.getItemIndex(item) });
1602
1596
  }
1603
1597
  /**
@@ -1720,7 +1714,7 @@ class DropListRef {
1720
1714
  */
1721
1715
  _sortItem(item, pointerX, pointerY, pointerDelta) {
1722
1716
  // Don't sort the item if sorting is disabled or it's out of range.
1723
- if (this.sortingDisabled ||
1717
+ if (this.sortingDisabled || !this._clientRect ||
1724
1718
  !isPointerNearClientRect(this._clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) {
1725
1719
  return;
1726
1720
  }
@@ -1834,6 +1828,20 @@ class DropListRef {
1834
1828
  _stopScrolling() {
1835
1829
  this._stopScrollTimers.next();
1836
1830
  }
1831
+ /** Starts the dragging sequence within the list. */
1832
+ _draggingStarted() {
1833
+ const styles = coerceElement(this.element).style;
1834
+ this.beforeStarted.next();
1835
+ this._isDragging = true;
1836
+ // We need to disable scroll snapping while the user is dragging, because it breaks automatic
1837
+ // scrolling. The browser seems to round the value based on the snapping points which means
1838
+ // that we can't increment/decrement the scroll position.
1839
+ this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || '';
1840
+ styles.scrollSnapType = styles.msScrollSnapType = 'none';
1841
+ this._cacheItems();
1842
+ this._viewportScrollSubscription.unsubscribe();
1843
+ this._listenToScrollEvents();
1844
+ }
1837
1845
  /** Caches the positions of the configured scrollable parents. */
1838
1846
  _cacheParentPositions() {
1839
1847
  const element = coerceElement(this.element);
@@ -1987,7 +1995,7 @@ class DropListRef {
1987
1995
  * @param y Pointer position along the Y axis.
1988
1996
  */
1989
1997
  _isOverContainer(x, y) {
1990
- return isInsideClientRect(this._clientRect, x, y);
1998
+ return this._clientRect != null && isInsideClientRect(this._clientRect, x, y);
1991
1999
  }
1992
2000
  /**
1993
2001
  * Figures out whether an item should be moved into a sibling
@@ -2006,7 +2014,8 @@ class DropListRef {
2006
2014
  * @param y Position of the item along the Y axis.
2007
2015
  */
2008
2016
  _canReceive(item, x, y) {
2009
- if (!isInsideClientRect(this._clientRect, x, y) || !this.enterPredicate(item, this)) {
2017
+ if (!this._clientRect || !isInsideClientRect(this._clientRect, x, y) ||
2018
+ !this.enterPredicate(item, this)) {
2010
2019
  return false;
2011
2020
  }
2012
2021
  const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y);
@@ -2028,9 +2037,15 @@ class DropListRef {
2028
2037
  * Called by one of the connected drop lists when a dragging sequence has started.
2029
2038
  * @param sibling Sibling in which dragging has started.
2030
2039
  */
2031
- _startReceiving(sibling) {
2040
+ _startReceiving(sibling, items) {
2032
2041
  const activeSiblings = this._activeSiblings;
2033
- if (!activeSiblings.has(sibling)) {
2042
+ if (!activeSiblings.has(sibling) && items.every(item => {
2043
+ // Note that we have to add an exception to the `enterPredicate` for items that started off
2044
+ // in this drop list. The drag ref has logic that allows an item to return to its initial
2045
+ // container, if it has left the initial container and none of the connected containers
2046
+ // allow it to enter. See `DragRef._updateActiveDropContainer` for more context.
2047
+ return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1;
2048
+ })) {
2034
2049
  activeSiblings.add(sibling);
2035
2050
  this._cacheParentPositions();
2036
2051
  this._listenToScrollEvents();
@@ -2089,6 +2104,11 @@ class DropListRef {
2089
2104
  }
2090
2105
  return this._cachedShadowRoot;
2091
2106
  }
2107
+ /** Notifies any siblings that may potentially receive the item. */
2108
+ _notifyReceivingSiblings() {
2109
+ const draggedItems = this._activeDraggables.filter(item => item.isDragging());
2110
+ this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));
2111
+ }
2092
2112
  }
2093
2113
  /**
2094
2114
  * Finds the index of an item that matches a predicate function. Used as an equivalent
@@ -2234,9 +2254,14 @@ class DragDropRegistry {
2234
2254
  /** Registered drag item instances. */
2235
2255
  this._dragInstances = new Set();
2236
2256
  /** Drag item instances that are currently being dragged. */
2237
- this._activeDragInstances = new Set();
2257
+ this._activeDragInstances = [];
2238
2258
  /** Keeps track of the event listeners that we've bound to the `document`. */
2239
2259
  this._globalListeners = new Map();
2260
+ /**
2261
+ * Predicate function to check if an item is being dragged. Moved out into a property,
2262
+ * because it'll be called a lot and we don't want to create a new function every time.
2263
+ */
2264
+ this._draggingPredicate = (item) => item.isDragging();
2240
2265
  /**
2241
2266
  * Emits the `touchmove` or `mousemove` events that are dispatched
2242
2267
  * while the user is dragging a drag item instance.
@@ -2254,14 +2279,19 @@ class DragDropRegistry {
2254
2279
  * @param event Event whose default action should be prevented.
2255
2280
  */
2256
2281
  this._preventDefaultWhileDragging = (event) => {
2257
- if (this._activeDragInstances.size) {
2282
+ if (this._activeDragInstances.length > 0) {
2258
2283
  event.preventDefault();
2259
2284
  }
2260
2285
  };
2261
2286
  /** Event listener for `touchmove` that is bound even if no dragging is happening. */
2262
2287
  this._persistentTouchmoveListener = (event) => {
2263
- if (this._activeDragInstances.size) {
2264
- event.preventDefault();
2288
+ if (this._activeDragInstances.length > 0) {
2289
+ // Note that we only want to prevent the default action after dragging has actually started.
2290
+ // Usually this is the same time at which the item is added to the `_activeDragInstances`,
2291
+ // but it could be pushed back if the user has set up a drag delay or threshold.
2292
+ if (this._activeDragInstances.some(this._draggingPredicate)) {
2293
+ event.preventDefault();
2294
+ }
2265
2295
  this.pointerMove.next(event);
2266
2296
  }
2267
2297
  };
@@ -2306,11 +2336,11 @@ class DragDropRegistry {
2306
2336
  */
2307
2337
  startDragging(drag, event) {
2308
2338
  // Do not process the same drag twice to avoid memory leaks and redundant listeners
2309
- if (this._activeDragInstances.has(drag)) {
2339
+ if (this._activeDragInstances.indexOf(drag) > -1) {
2310
2340
  return;
2311
2341
  }
2312
- this._activeDragInstances.add(drag);
2313
- if (this._activeDragInstances.size === 1) {
2342
+ this._activeDragInstances.push(drag);
2343
+ if (this._activeDragInstances.length === 1) {
2314
2344
  const isTouchEvent = event.type.startsWith('touch');
2315
2345
  // We explicitly bind __active__ listeners here, because newer browsers will default to
2316
2346
  // passive ones for `mousemove` and `touchmove`. The events need to be active, because we
@@ -2351,14 +2381,17 @@ class DragDropRegistry {
2351
2381
  }
2352
2382
  /** Stops dragging a drag item instance. */
2353
2383
  stopDragging(drag) {
2354
- this._activeDragInstances.delete(drag);
2355
- if (this._activeDragInstances.size === 0) {
2356
- this._clearGlobalListeners();
2384
+ const index = this._activeDragInstances.indexOf(drag);
2385
+ if (index > -1) {
2386
+ this._activeDragInstances.splice(index, 1);
2387
+ if (this._activeDragInstances.length === 0) {
2388
+ this._clearGlobalListeners();
2389
+ }
2357
2390
  }
2358
2391
  }
2359
2392
  /** Gets whether a drag item instance is currently being dragged. */
2360
2393
  isDragging(drag) {
2361
- return this._activeDragInstances.has(drag);
2394
+ return this._activeDragInstances.indexOf(drag) > -1;
2362
2395
  }
2363
2396
  ngOnDestroy() {
2364
2397
  this._dragInstances.forEach(instance => this.removeDragItem(instance));
@@ -2710,6 +2743,7 @@ class CdkDropList {
2710
2743
  ref.lockAxis = this.lockAxis;
2711
2744
  ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);
2712
2745
  ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);
2746
+ ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);
2713
2747
  ref
2714
2748
  .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))
2715
2749
  .withOrientation(this.orientation);
@@ -2814,6 +2848,7 @@ CdkDropList.propDecorators = {
2814
2848
  enterPredicate: [{ type: Input, args: ['cdkDropListEnterPredicate',] }],
2815
2849
  sortPredicate: [{ type: Input, args: ['cdkDropListSortPredicate',] }],
2816
2850
  autoScrollDisabled: [{ type: Input, args: ['cdkDropListAutoScrollDisabled',] }],
2851
+ autoScrollStep: [{ type: Input, args: ['cdkDropListAutoScrollStep',] }],
2817
2852
  dropped: [{ type: Output, args: ['cdkDropListDropped',] }],
2818
2853
  entered: [{ type: Output, args: ['cdkDropListEntered',] }],
2819
2854
  exited: [{ type: Output, args: ['cdkDropListExited',] }],
@@ -2965,7 +3000,7 @@ class CdkDrag {
2965
3000
  * @deprecated `_document` parameter no longer being used and will be removed.
2966
3001
  * @breaking-change 12.0.0
2967
3002
  */
2968
- _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef, _selfHandle) {
3003
+ _document, _ngZone, _viewContainerRef, config, _dir, dragDrop, _changeDetectorRef, _selfHandle, parentDrag) {
2969
3004
  this.element = element;
2970
3005
  this.dropContainer = dropContainer;
2971
3006
  this._ngZone = _ngZone;
@@ -3007,7 +3042,8 @@ class CdkDrag {
3007
3042
  config.dragStartThreshold : 5,
3008
3043
  pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ?
3009
3044
  config.pointerDirectionChangeThreshold : 5,
3010
- zIndex: config === null || config === void 0 ? void 0 : config.zIndex
3045
+ zIndex: config === null || config === void 0 ? void 0 : config.zIndex,
3046
+ parentDragRef: parentDrag === null || parentDrag === void 0 ? void 0 : parentDrag._dragRef
3011
3047
  });
3012
3048
  this._dragRef.data = this;
3013
3049
  if (config) {
@@ -3262,7 +3298,8 @@ CdkDrag.ctorParameters = () => [
3262
3298
  { type: Directionality, decorators: [{ type: Optional }] },
3263
3299
  { type: DragDrop },
3264
3300
  { type: ChangeDetectorRef },
3265
- { type: CdkDragHandle, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [CDK_DRAG_HANDLE,] }] }
3301
+ { type: CdkDragHandle, decorators: [{ type: Optional }, { type: Self }, { type: Inject, args: [CDK_DRAG_HANDLE,] }] },
3302
+ { type: CdkDrag, decorators: [{ type: Optional }, { type: SkipSelf }, { type: Inject, args: [CDK_DRAG_PARENT,] }] }
3266
3303
  ];
3267
3304
  CdkDrag.propDecorators = {
3268
3305
  _handles: [{ type: ContentChildren, args: [CDK_DRAG_HANDLE, { descendants: true },] }],