@angular/cdk 10.0.0-rc.3 → 10.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.
- package/a11y/aria-describer/aria-describer.d.ts +10 -1
- package/a11y/focus-trap/focus-trap.d.ts +4 -2
- package/a11y/index.metadata.json +1 -1
- package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
- package/a11y/key-manager/list-key-manager.d.ts +6 -0
- package/accordion/accordion.d.ts +7 -1
- package/accordion/index.d.ts +1 -0
- package/accordion/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +78 -15
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +11 -11
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +12 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +2 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +717 -641
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -16
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +199 -42
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +11 -18
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +0 -1
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +2 -2
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +26 -4
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +11 -4
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +8 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +32 -0
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +5 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +6 -2
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +3 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/directives/drag-handle.d.ts +7 -1
- package/drag-drop/directives/drag-placeholder.d.ts +7 -1
- package/drag-drop/directives/drag-preview.d.ts +7 -1
- package/drag-drop/directives/drag.d.ts +4 -14
- package/drag-drop/directives/drop-list-group.d.ts +7 -1
- package/drag-drop/directives/drop-list.d.ts +7 -1
- package/drag-drop/drag-ref.d.ts +6 -0
- package/drag-drop/drop-list-ref.d.ts +3 -2
- package/drag-drop/index.d.ts +2 -2
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/a11y-module.js +15 -19
- package/esm2015/a11y/aria-describer/aria-describer.js +177 -167
- package/esm2015/a11y/focus-monitor/focus-monitor.js +337 -345
- package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +30 -34
- package/esm2015/a11y/focus-trap/focus-trap-manager.js +36 -40
- package/esm2015/a11y/focus-trap/focus-trap.js +85 -82
- package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +56 -60
- package/esm2015/a11y/interactivity-checker/interactivity-checker.js +113 -104
- package/esm2015/a11y/key-manager/list-key-manager.js +29 -4
- package/esm2015/a11y/live-announcer/live-announcer.js +138 -146
- package/esm2015/accordion/accordion-item.js +119 -123
- package/esm2015/accordion/accordion-module.js +9 -13
- package/esm2015/accordion/accordion.js +49 -46
- package/esm2015/accordion/index.js +2 -1
- package/esm2015/bidi/bidi-module.js +9 -13
- package/esm2015/bidi/dir.js +41 -45
- package/esm2015/bidi/directionality.js +27 -31
- package/esm2015/clipboard/clipboard-module.js +9 -13
- package/esm2015/clipboard/clipboard.js +36 -40
- package/esm2015/clipboard/copy-to-clipboard.js +71 -75
- package/esm2015/collections/unique-selection-dispatcher.js +33 -37
- package/esm2015/drag-drop/directives/drag-handle.js +42 -39
- package/esm2015/drag-drop/directives/drag-placeholder.js +24 -21
- package/esm2015/drag-drop/directives/drag-preview.js +29 -26
- package/esm2015/drag-drop/directives/drag.js +313 -319
- package/esm2015/drag-drop/directives/drop-list-group.js +32 -29
- package/esm2015/drag-drop/directives/drop-list.js +251 -250
- package/esm2015/drag-drop/drag-drop-module.js +27 -31
- package/esm2015/drag-drop/drag-drop-registry.js +139 -143
- package/esm2015/drag-drop/drag-drop.js +33 -37
- package/esm2015/drag-drop/drag-ref.js +59 -25
- package/esm2015/drag-drop/drop-list-ref.js +15 -9
- package/esm2015/drag-drop/index.js +3 -2
- package/esm2015/layout/breakpoints-observer.js +81 -85
- package/esm2015/layout/layout-module.js +6 -10
- package/esm2015/layout/media-matcher.js +28 -32
- package/esm2015/observers/observe-content.js +147 -163
- package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
- package/esm2015/overlay/dispatchers/index.js +10 -0
- package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
- package/esm2015/overlay/fullscreen-overlay-container.js +70 -74
- package/esm2015/overlay/index.js +5 -4
- package/esm2015/overlay/overlay-config.js +5 -1
- package/esm2015/overlay/overlay-container.js +69 -73
- package/esm2015/overlay/overlay-directives.js +245 -243
- package/esm2015/overlay/overlay-module.js +15 -19
- package/esm2015/overlay/overlay-ref.js +24 -2
- package/esm2015/overlay/overlay-reference.js +1 -1
- package/esm2015/overlay/overlay.js +93 -92
- package/esm2015/overlay/position/connected-position.js +14 -18
- package/esm2015/overlay/position/overlay-position-builder.js +43 -47
- package/esm2015/overlay/public-api.js +2 -2
- package/esm2015/overlay/scroll/scroll-strategy-options.js +33 -37
- package/esm2015/platform/features/scrolling.js +1 -2
- package/esm2015/platform/platform-module.js +6 -10
- package/esm2015/platform/platform.js +48 -52
- package/esm2015/portal/portal-directives.js +181 -201
- package/esm2015/scrolling/fixed-size-virtual-scroll.js +57 -47
- package/esm2015/scrolling/public-api.js +2 -1
- package/esm2015/scrolling/scroll-dispatcher.js +139 -143
- package/esm2015/scrolling/scrollable.js +135 -139
- package/esm2015/scrolling/scrolling-module.js +32 -40
- package/esm2015/scrolling/viewport-ruler.js +105 -109
- package/esm2015/scrolling/virtual-for-of.js +264 -268
- package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
- package/esm2015/scrolling/virtual-scroll-viewport.js +318 -322
- package/esm2015/stepper/step-header.js +20 -24
- package/esm2015/stepper/step-label.js +13 -17
- package/esm2015/stepper/stepper-button.js +59 -67
- package/esm2015/stepper/stepper-module.js +24 -28
- package/esm2015/stepper/stepper.js +313 -321
- package/esm2015/table/cell.js +129 -157
- package/esm2015/table/row.js +183 -219
- package/esm2015/table/table-module.js +9 -13
- package/esm2015/table/table.js +765 -785
- package/esm2015/table/text-column.js +85 -89
- package/esm2015/testing/component-harness.js +19 -1
- package/esm2015/testing/harness-environment.js +7 -1
- package/esm2015/text-field/autofill.js +89 -97
- package/esm2015/text-field/autosize.js +225 -229
- package/esm2015/text-field/text-field-module.js +10 -14
- package/esm2015/tree/control/nested-tree-control.js +7 -3
- package/esm2015/tree/nested-node.js +79 -83
- package/esm2015/tree/node.js +17 -21
- package/esm2015/tree/outlet.js +15 -19
- package/esm2015/tree/padding.js +88 -92
- package/esm2015/tree/toggle.js +32 -36
- package/esm2015/tree/tree-module.js +10 -14
- package/esm2015/tree/tree.js +266 -274
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +1021 -996
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/accordion.js +173 -175
- package/fesm2015/accordion.js.map +1 -1
- package/fesm2015/bidi.js +74 -83
- package/fesm2015/bidi.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/clipboard.js +113 -122
- package/fesm2015/clipboard.js.map +1 -1
- package/fesm2015/collections.js +32 -35
- package/fesm2015/collections.js.map +1 -1
- package/fesm2015/drag-drop.js +1005 -961
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/layout.js +111 -120
- package/fesm2015/layout.js.map +1 -1
- package/fesm2015/observers.js +146 -158
- package/fesm2015/observers.js.map +1 -1
- package/fesm2015/overlay.js +793 -659
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +52 -59
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/portal.js +180 -195
- package/fesm2015/portal.js.map +1 -1
- package/fesm2015/scrolling.js +1058 -1060
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/stepper.js +424 -445
- package/fesm2015/stepper.js.map +1 -1
- package/fesm2015/table.js +1178 -1247
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing.js +25 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/text-field.js +318 -330
- package/fesm2015/text-field.js.map +1 -1
- package/fesm2015/tree.js +517 -537
- package/fesm2015/tree.js.map +1 -1
- package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
- package/overlay/dispatchers/index.d.ts +9 -0
- package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
- package/overlay/index.d.ts +4 -3
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-config.d.ts +4 -0
- package/overlay/overlay-directives.d.ts +4 -0
- package/overlay/overlay-ref.d.ts +8 -2
- package/overlay/overlay-reference.d.ts +1 -0
- package/overlay/overlay.d.ts +4 -2
- package/overlay/public-api.d.ts +1 -1
- package/package.json +3 -3
- package/schematics/index.js +1 -1
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/data/index.js +1 -1
- package/schematics/ng-update/devkit-file-system.d.ts +5 -5
- package/schematics/ng-update/devkit-file-system.js +21 -16
- package/schematics/ng-update/devkit-migration-rule.js +13 -20
- package/schematics/ng-update/devkit-migration.d.ts +0 -2
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/find-stylesheets.d.ts +10 -0
- package/schematics/ng-update/find-stylesheets.js +31 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/migrations/attribute-selectors.js +3 -3
- package/schematics/ng-update/migrations/css-selectors.js +3 -3
- package/schematics/ng-update/migrations/element-selectors.js +3 -3
- package/schematics/ng-update/public-api.js +1 -1
- package/schematics/update-tool/component-resource-collector.d.ts +1 -1
- package/schematics/update-tool/component-resource-collector.js +18 -14
- package/schematics/update-tool/file-system.d.ts +19 -14
- package/schematics/update-tool/file-system.js +1 -1
- package/schematics/update-tool/index.d.ts +21 -3
- package/schematics/update-tool/index.js +29 -23
- package/schematics/update-tool/public-api.js +1 -1
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +5 -3
- package/schematics/update-tool/utils/parse-tsconfig.d.ts +2 -1
- package/schematics/update-tool/utils/parse-tsconfig.js +6 -10
- package/schematics/update-tool/utils/virtual-host.d.ts +34 -0
- package/schematics/update-tool/utils/virtual-host.js +62 -0
- package/schematics/update-tool/version-changes.js +4 -6
- package/schematics/utils/index.js +1 -1
- package/schematics/utils/project-tsconfig-paths.d.ts +2 -1
- package/schematics/utils/project-tsconfig-paths.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/public-api.d.ts +1 -0
- package/scrolling/virtual-for-of.d.ts +2 -1
- package/scrolling/virtual-scroll-repeater.d.ts +16 -0
- package/scrolling/virtual-scroll-viewport.d.ts +4 -4
- package/testing/component-harness.d.ts +12 -0
- package/testing/harness-environment.d.ts +1 -0
- package/tree/control/nested-tree-control.d.ts +7 -2
- package/tree/index.metadata.json +1 -1
- package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -100
package/fesm2015/collections.js
CHANGED
|
@@ -222,43 +222,40 @@ function getMultipleValuesInSingleSelectionError() {
|
|
|
222
222
|
* This service does not *store* any IDs and names because they may change at any time, so it is
|
|
223
223
|
* less error-prone if they are simply passed through when the events occur.
|
|
224
224
|
*/
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
listener(id, name);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Listen for future changes to item selection.
|
|
242
|
-
* @return Function used to deregister listener
|
|
243
|
-
*/
|
|
244
|
-
listen(listener) {
|
|
245
|
-
this._listeners.push(listener);
|
|
246
|
-
return () => {
|
|
247
|
-
this._listeners = this._listeners.filter((registered) => {
|
|
248
|
-
return listener !== registered;
|
|
249
|
-
});
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
ngOnDestroy() {
|
|
253
|
-
this._listeners = [];
|
|
225
|
+
class UniqueSelectionDispatcher {
|
|
226
|
+
constructor() {
|
|
227
|
+
this._listeners = [];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Notify other items that selection for the given name has been set.
|
|
231
|
+
* @param id ID of the item.
|
|
232
|
+
* @param name Name of the item.
|
|
233
|
+
*/
|
|
234
|
+
notify(id, name) {
|
|
235
|
+
for (let listener of this._listeners) {
|
|
236
|
+
listener(id, name);
|
|
254
237
|
}
|
|
255
238
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Listen for future changes to item selection.
|
|
241
|
+
* @return Function used to deregister listener
|
|
242
|
+
*/
|
|
243
|
+
listen(listener) {
|
|
244
|
+
this._listeners.push(listener);
|
|
245
|
+
return () => {
|
|
246
|
+
this._listeners = this._listeners.filter((registered) => {
|
|
247
|
+
return listener !== registered;
|
|
248
|
+
});
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
ngOnDestroy() {
|
|
252
|
+
this._listeners = [];
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
UniqueSelectionDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function UniqueSelectionDispatcher_Factory() { return new UniqueSelectionDispatcher(); }, token: UniqueSelectionDispatcher, providedIn: "root" });
|
|
256
|
+
UniqueSelectionDispatcher.decorators = [
|
|
257
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
258
|
+
];
|
|
262
259
|
|
|
263
260
|
/**
|
|
264
261
|
* @license
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","sources":["../../../../../../src/cdk/collections/data-source.ts","../../../../../../src/cdk/collections/array-data-source.ts","../../../../../../src/cdk/collections/collection-viewer.ts","../../../../../../src/cdk/collections/selection-model.ts","../../../../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../../../../src/cdk/collections/tree-adapter.ts","../../../../../../src/cdk/collections/public-api.ts","../../../../../../src/cdk/collections/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 {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[] | ReadonlyArray<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\n/** Checks whether an object is a data source. */\nexport function isDataSource(value: any): value is DataSource<any> {\n // Check if the value is a DataSource by observing if it has a connect function. Cannot\n // be checked as an `instanceof DataSource` since people could create their own sources\n // that match the interface, but don't extend DataSource.\n return value && typeof value.connect === 'function';\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, isObservable, 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[] | ReadonlyArray<T> | Observable<T[] | ReadonlyArray<T>>) {\n super();\n }\n\n connect(): Observable<T[] | ReadonlyArray<T>> {\n return isObservable(this._data) ? 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';\n\n\n/** Represents a range of numbers with a specified start and end. */\nexport type ListRange = {start: number, end: number};\n\n\n/**\n * Interface for any component that provides a view of some data collection and wants to provide\n * information regarding the view and any changes made.\n */\nexport interface CollectionViewer {\n /**\n * A stream that emits whenever the `CollectionViewer` starts looking at a new portion of the\n * data. The `start` index is inclusive, while the `end` is exclusive.\n */\n viewChange: Observable<ListRange>;\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>> = new Subject();\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 this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\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 * @docs-private\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 {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 {SelectionModel} from './selection-model';\n\n\n/**\n * Interface for a class that can flatten hierarchical structured data and re-expand the flattened\n * data back into its original structure. Should be used in conjunction with the cdk-tree.\n */\nexport interface TreeDataNodeFlattener<T> {\n /** Transforms a set of hierarchical structured data into a flattened data array. */\n flattenNodes(structuredData: any[]): T[];\n\n /**\n * Expands a flattened array of data into its hierarchical form using the provided expansion\n * model.\n */\n expandFlattenedNodes(nodes: T[], expansionModel: SelectionModel<T>): T[];\n\n /**\n * Put node descendants of node in array.\n * If `onlyExpandable` is true, then only process expandable descendants.\n */\n nodeDescendents(node: T, nodes: T[], onlyExpandable: boolean): void;\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\nexport * from './array-data-source';\nexport * from './collection-viewer';\nexport * from './data-source';\nexport * from './selection-model';\nexport {\n UniqueSelectionDispatcher,\n UniqueSelectionDispatcherListener,\n} from './unique-selection-dispatcher';\nexport * from './tree-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;AAAA;;;;;;;AAWA,MAAsB,UAAU;CAmB/B;;AAGD,SAAgB,YAAY,CAAC,KAAU;;;;IAIrC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,CAAC;CACrD;;ACtCD;;;;;;;AAQA,AAIA;AACA,MAAa,eAAmB,SAAQ,UAAa;IACnD,YAAoB,KAAkE;QACpF,KAAK,EAAE,CAAC;QADU,UAAK,GAAL,KAAK,CAA6D;KAErF;IAED,OAAO;QACL,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,GAAGA,EAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzE;IAED,UAAU,MAAK;CAChB;;ACvBD;;;;;;GAMG;;ACNH;;;;;;;AAQA,AAEA;;;AAGA,MAAa,cAAc;IAyBzB,YACU,YAAY,KAAK,EACzB,uBAA6B,EACrB,eAAe,IAAI;QAFnB,cAAS,GAAT,SAAS,CAAQ;QAEjB,iBAAY,GAAZ,YAAY,CAAO;;QA1BrB,eAAU,GAAG,IAAI,GAAG,EAAK,CAAC;;QAG1B,sBAAiB,GAAQ,EAAE,CAAC;;QAG5B,oBAAe,GAAQ,EAAE,CAAC;;QAelC,YAAO,GAAgC,IAAI,OAAO,EAAE,CAAC;QAOnD,IAAI,uBAAuB,IAAI,uBAAuB,CAAC,MAAM,EAAE;YAC7D,IAAI,SAAS,EAAE;gBACb,uBAAuB,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;aACrE;iBAAM;gBACL,IAAI,CAAC,aAAa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/collections/data-source.ts","../../../../../../src/cdk/collections/array-data-source.ts","../../../../../../src/cdk/collections/collection-viewer.ts","../../../../../../src/cdk/collections/selection-model.ts","../../../../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../../../../src/cdk/collections/tree-adapter.ts","../../../../../../src/cdk/collections/public-api.ts","../../../../../../src/cdk/collections/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 {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[] | ReadonlyArray<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\n/** Checks whether an object is a data source. */\nexport function isDataSource(value: any): value is DataSource<any> {\n // Check if the value is a DataSource by observing if it has a connect function. Cannot\n // be checked as an `instanceof DataSource` since people could create their own sources\n // that match the interface, but don't extend DataSource.\n return value && typeof value.connect === 'function';\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, isObservable, 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[] | ReadonlyArray<T> | Observable<T[] | ReadonlyArray<T>>) {\n super();\n }\n\n connect(): Observable<T[] | ReadonlyArray<T>> {\n return isObservable(this._data) ? 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';\n\n\n/** Represents a range of numbers with a specified start and end. */\nexport type ListRange = {start: number, end: number};\n\n\n/**\n * Interface for any component that provides a view of some data collection and wants to provide\n * information regarding the view and any changes made.\n */\nexport interface CollectionViewer {\n /**\n * A stream that emits whenever the `CollectionViewer` starts looking at a new portion of the\n * data. The `start` index is inclusive, while the `end` is exclusive.\n */\n viewChange: Observable<ListRange>;\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>> = new Subject();\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 this.changed.next({\n source: this,\n added: this._selectedToEmit,\n removed: this._deselectedToEmit\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 * @docs-private\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 {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 {SelectionModel} from './selection-model';\n\n\n/**\n * Interface for a class that can flatten hierarchical structured data and re-expand the flattened\n * data back into its original structure. Should be used in conjunction with the cdk-tree.\n */\nexport interface TreeDataNodeFlattener<T> {\n /** Transforms a set of hierarchical structured data into a flattened data array. */\n flattenNodes(structuredData: any[]): T[];\n\n /**\n * Expands a flattened array of data into its hierarchical form using the provided expansion\n * model.\n */\n expandFlattenedNodes(nodes: T[], expansionModel: SelectionModel<T>): T[];\n\n /**\n * Put node descendants of node in array.\n * If `onlyExpandable` is true, then only process expandable descendants.\n */\n nodeDescendents(node: T, nodes: T[], onlyExpandable: boolean): void;\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\nexport * from './array-data-source';\nexport * from './collection-viewer';\nexport * from './data-source';\nexport * from './selection-model';\nexport {\n UniqueSelectionDispatcher,\n UniqueSelectionDispatcherListener,\n} from './unique-selection-dispatcher';\nexport * from './tree-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["observableOf"],"mappings":";;;AAAA;;;;;;;AAWA,MAAsB,UAAU;CAmB/B;;AAGD,SAAgB,YAAY,CAAC,KAAU;;;;IAIrC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,CAAC;CACrD;;ACtCD;;;;;;;AAQA,AAIA;AACA,MAAa,eAAmB,SAAQ,UAAa;IACnD,YAAoB,KAAkE;QACpF,KAAK,EAAE,CAAC;QADU,UAAK,GAAL,KAAK,CAA6D;KAErF;IAED,OAAO;QACL,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,GAAGA,EAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzE;IA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