@angular/cdk 17.0.1 → 17.1.0-next.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/index.d.ts +2 -2
- package/collections/index.d.ts +1 -1
- package/esm2022/a11y/focus-monitor/focus-monitor.mjs +19 -4
- package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +14 -7
- package/esm2022/a11y/public-api.mjs +2 -2
- package/esm2022/collections/dispose-view-repeater-strategy.mjs +5 -4
- package/esm2022/collections/recycle-view-repeater-strategy.mjs +5 -4
- package/esm2022/collections/view-repeater.mjs +13 -1
- package/esm2022/drag-drop/drop-list-ref.mjs +37 -23
- package/esm2022/menu/menu-bar.mjs +5 -5
- package/esm2022/menu/menu-item.mjs +5 -5
- package/esm2022/menu/menu-stack.mjs +8 -1
- package/esm2022/menu/menu.mjs +6 -6
- package/esm2022/platform/features/scrolling.mjs +23 -4
- package/esm2022/scrolling/scrollable.mjs +7 -7
- package/esm2022/table/table.mjs +3 -3
- package/esm2022/tree/nested-node.mjs +2 -3
- package/esm2022/tree/padding.mjs +6 -7
- package/esm2022/tree/toggle.mjs +6 -13
- package/esm2022/tree/tree.mjs +3 -4
- package/esm2022/version.mjs +1 -1
- package/fesm2022/a11y.mjs +32 -10
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/collections.mjs +26 -14
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +36 -22
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/menu.mjs +18 -11
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/platform.mjs +23 -4
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +6 -6
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/table.mjs +2 -2
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tree.mjs +11 -19
- package/fesm2022/tree.mjs.map +1 -1
- package/menu/index.d.ts +1 -1
- package/package.json +3 -3
- package/platform/index.d.ts +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/update-tool/target-version.js +1 -2
- package/schematics/update-tool/target-version.mjs +1 -2
- package/tree/index.d.ts +6 -8
package/fesm2022/cdk.mjs
CHANGED
package/fesm2022/cdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('17.0.
|
|
1
|
+
{"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('17.1.0-next.0');\n"],"names":[],"mappings":";;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;;;"}
|
package/fesm2022/collections.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConnectableObservable, isObservable, of, Subject } from 'rxjs';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { InjectionToken, Injectable } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
class DataSource {
|
|
6
6
|
}
|
|
@@ -25,6 +25,24 @@ class ArrayDataSource extends DataSource {
|
|
|
25
25
|
disconnect() { }
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/** Indicates how a view was changed by a {@link _ViewRepeater}. */
|
|
29
|
+
var _ViewRepeaterOperation;
|
|
30
|
+
(function (_ViewRepeaterOperation) {
|
|
31
|
+
/** The content of an existing view was replaced with another item. */
|
|
32
|
+
_ViewRepeaterOperation[_ViewRepeaterOperation["REPLACED"] = 0] = "REPLACED";
|
|
33
|
+
/** A new view was created with `createEmbeddedView`. */
|
|
34
|
+
_ViewRepeaterOperation[_ViewRepeaterOperation["INSERTED"] = 1] = "INSERTED";
|
|
35
|
+
/** The position of a view changed, but the content remains the same. */
|
|
36
|
+
_ViewRepeaterOperation[_ViewRepeaterOperation["MOVED"] = 2] = "MOVED";
|
|
37
|
+
/** A view was detached from the view container. */
|
|
38
|
+
_ViewRepeaterOperation[_ViewRepeaterOperation["REMOVED"] = 3] = "REMOVED";
|
|
39
|
+
})(_ViewRepeaterOperation || (_ViewRepeaterOperation = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.
|
|
42
|
+
* @docs-private
|
|
43
|
+
*/
|
|
44
|
+
const _VIEW_REPEATER_STRATEGY = new InjectionToken('_ViewRepeater');
|
|
45
|
+
|
|
28
46
|
/**
|
|
29
47
|
* A repeater that destroys views when they are removed from a
|
|
30
48
|
* {@link ViewContainerRef}. When new items are inserted into the container,
|
|
@@ -42,16 +60,16 @@ class _DisposeViewRepeaterStrategy {
|
|
|
42
60
|
if (record.previousIndex == null) {
|
|
43
61
|
const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex);
|
|
44
62
|
view = viewContainerRef.createEmbeddedView(insertContext.templateRef, insertContext.context, insertContext.index);
|
|
45
|
-
operation =
|
|
63
|
+
operation = _ViewRepeaterOperation.INSERTED;
|
|
46
64
|
}
|
|
47
65
|
else if (currentIndex == null) {
|
|
48
66
|
viewContainerRef.remove(adjustedPreviousIndex);
|
|
49
|
-
operation =
|
|
67
|
+
operation = _ViewRepeaterOperation.REMOVED;
|
|
50
68
|
}
|
|
51
69
|
else {
|
|
52
70
|
view = viewContainerRef.get(adjustedPreviousIndex);
|
|
53
71
|
viewContainerRef.move(view, currentIndex);
|
|
54
|
-
operation =
|
|
72
|
+
operation = _ViewRepeaterOperation.MOVED;
|
|
55
73
|
}
|
|
56
74
|
if (itemViewChanged) {
|
|
57
75
|
itemViewChanged({
|
|
@@ -102,17 +120,17 @@ class _RecycleViewRepeaterStrategy {
|
|
|
102
120
|
// Item added.
|
|
103
121
|
const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex);
|
|
104
122
|
view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record));
|
|
105
|
-
operation = view ?
|
|
123
|
+
operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED;
|
|
106
124
|
}
|
|
107
125
|
else if (currentIndex == null) {
|
|
108
126
|
// Item removed.
|
|
109
127
|
this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef);
|
|
110
|
-
operation =
|
|
128
|
+
operation = _ViewRepeaterOperation.REMOVED;
|
|
111
129
|
}
|
|
112
130
|
else {
|
|
113
131
|
// Item moved.
|
|
114
132
|
view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record));
|
|
115
|
-
operation =
|
|
133
|
+
operation = _ViewRepeaterOperation.MOVED;
|
|
116
134
|
}
|
|
117
135
|
if (itemViewChanged) {
|
|
118
136
|
itemViewChanged({
|
|
@@ -448,15 +466,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImpor
|
|
|
448
466
|
args: [{ providedIn: 'root' }]
|
|
449
467
|
}] });
|
|
450
468
|
|
|
451
|
-
/**
|
|
452
|
-
* Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.
|
|
453
|
-
* @docs-private
|
|
454
|
-
*/
|
|
455
|
-
const _VIEW_REPEATER_STRATEGY = new InjectionToken('_ViewRepeater');
|
|
456
|
-
|
|
457
469
|
/**
|
|
458
470
|
* Generated bundle index. Do not edit.
|
|
459
471
|
*/
|
|
460
472
|
|
|
461
|
-
export { ArrayDataSource, DataSource, SelectionModel, UniqueSelectionDispatcher, _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY, getMultipleValuesInSingleSelectionError, isDataSource };
|
|
473
|
+
export { ArrayDataSource, DataSource, SelectionModel, UniqueSelectionDispatcher, _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY, _ViewRepeaterOperation, getMultipleValuesInSingleSelectionError, isDataSource };
|
|
462
474
|
//# sourceMappingURL=collections.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.mjs","sources":["../../../../../../src/cdk/collections/data-source.ts","../../../../../../src/cdk/collections/array-data-source.ts","../../../../../../src/cdk/collections/dispose-view-repeater-strategy.ts","../../../../../../src/cdk/collections/recycle-view-repeater-strategy.ts","../../../../../../src/cdk/collections/selection-model.ts","../../../../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../../../../src/cdk/collections/view-repeater.ts","../../../../../../src/cdk/collections/collections_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ConnectableObservable, 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<readonly 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. We also can't use `isObservable`\n // here, because of some internal apps.\n return value && typeof value.connect === 'function' && !(value instanceof ConnectableObservable);\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/** DataSource wrapper for a native array. */\nexport class ArrayDataSource<T> extends DataSource<T> {\n constructor(private _data: readonly T[] | Observable<readonly T[]>) {\n super();\n }\n\n connect(): Observable<readonly 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 {\n EmbeddedViewRef,\n IterableChangeRecord,\n IterableChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n _ViewRepeater,\n _ViewRepeaterItemChanged,\n _ViewRepeaterItemContext,\n _ViewRepeaterItemContextFactory,\n _ViewRepeaterItemValueResolver,\n _ViewRepeaterOperation,\n} from './view-repeater';\n\n/**\n * A repeater that destroys views when they are removed from a\n * {@link ViewContainerRef}. When new items are inserted into the container,\n * the repeater will always construct a new embedded view for each item.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport class _DisposeViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>>\n implements _ViewRepeater<T, R, C>\n{\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ) {\n changes.forEachOperation(\n (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => {\n let view: EmbeddedViewRef<C> | undefined;\n let operation: _ViewRepeaterOperation;\n if (record.previousIndex == null) {\n const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = viewContainerRef.createEmbeddedView(\n insertContext.templateRef,\n insertContext.context,\n insertContext.index,\n );\n operation = _ViewRepeaterOperation.INSERTED;\n } else if (currentIndex == null) {\n viewContainerRef.remove(adjustedPreviousIndex!);\n operation = _ViewRepeaterOperation.REMOVED;\n } else {\n view = viewContainerRef.get(adjustedPreviousIndex!) as EmbeddedViewRef<C>;\n viewContainerRef.move(view!, currentIndex);\n operation = _ViewRepeaterOperation.MOVED;\n }\n\n if (itemViewChanged) {\n itemViewChanged({\n context: view?.context,\n operation,\n record,\n });\n }\n },\n );\n }\n\n detach() {}\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 EmbeddedViewRef,\n IterableChangeRecord,\n IterableChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n _ViewRepeater,\n _ViewRepeaterItemChanged,\n _ViewRepeaterItemContext,\n _ViewRepeaterItemContextFactory,\n _ViewRepeaterItemInsertArgs,\n _ViewRepeaterItemValueResolver,\n _ViewRepeaterOperation,\n} from './view-repeater';\n\n/**\n * A repeater that caches views when they are removed from a\n * {@link ViewContainerRef}. When new items are inserted into the container,\n * the repeater will reuse one of the cached views instead of creating a new\n * embedded view. Recycling cached views reduces the quantity of expensive DOM\n * inserts.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport class _RecycleViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>>\n implements _ViewRepeater<T, R, C>\n{\n /**\n * The size of the cache used to store unused views.\n * Setting the cache size to `0` will disable caching. Defaults to 20 views.\n */\n viewCacheSize: number = 20;\n\n /**\n * View cache that stores embedded view instances that have been previously stamped out,\n * but don't are not currently rendered. The view repeater will reuse these views rather than\n * creating brand new ones.\n *\n * TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance.\n */\n private _viewCache: EmbeddedViewRef<C>[] = [];\n\n /** Apply changes to the DOM. */\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation(\n (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => {\n let view: EmbeddedViewRef<C> | undefined;\n let operation: _ViewRepeaterOperation;\n if (record.previousIndex == null) {\n // Item added.\n const viewArgsFactory = () =>\n itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(\n viewArgsFactory,\n currentIndex!,\n viewContainerRef,\n itemValueResolver(record),\n );\n operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED;\n } else if (currentIndex == null) {\n // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex!, viewContainerRef);\n operation = _ViewRepeaterOperation.REMOVED;\n } else {\n // Item moved.\n view = this._moveView(\n adjustedPreviousIndex!,\n currentIndex!,\n viewContainerRef,\n itemValueResolver(record),\n );\n operation = _ViewRepeaterOperation.MOVED;\n }\n\n if (itemViewChanged) {\n itemViewChanged({\n context: view?.context,\n operation,\n record,\n });\n }\n },\n );\n }\n\n detach() {\n for (const view of this._viewCache) {\n view.destroy();\n }\n this._viewCache = [];\n }\n\n /**\n * Inserts a view for a new item, either from the cache or by creating a new\n * one. Returns `undefined` if the item was inserted into a cached view.\n */\n private _insertView(\n viewArgsFactory: () => _ViewRepeaterItemInsertArgs<C>,\n currentIndex: number,\n viewContainerRef: ViewContainerRef,\n value: T,\n ): EmbeddedViewRef<C> | undefined {\n const cachedView = this._insertViewFromCache(currentIndex!, viewContainerRef);\n if (cachedView) {\n cachedView.context.$implicit = value;\n return undefined;\n }\n\n const viewArgs = viewArgsFactory();\n return viewContainerRef.createEmbeddedView(\n viewArgs.templateRef,\n viewArgs.context,\n viewArgs.index,\n );\n }\n\n /** Detaches the view at the given index and inserts into the view cache. */\n private _detachAndCacheView(index: number, viewContainerRef: ViewContainerRef) {\n const detachedView = viewContainerRef.detach(index) as EmbeddedViewRef<C>;\n this._maybeCacheView(detachedView, viewContainerRef);\n }\n\n /** Moves view at the previous index to the current index. */\n private _moveView(\n adjustedPreviousIndex: number,\n currentIndex: number,\n viewContainerRef: ViewContainerRef,\n value: T,\n ): EmbeddedViewRef<C> {\n const view = viewContainerRef.get(adjustedPreviousIndex!) as EmbeddedViewRef<C>;\n viewContainerRef.move(view, currentIndex);\n view.context.$implicit = value;\n return view;\n }\n\n /**\n * Cache the given detached view. If the cache is full, the view will be\n * destroyed.\n */\n private _maybeCacheView(view: EmbeddedViewRef<C>, viewContainerRef: ViewContainerRef) {\n if (this._viewCache.length < this.viewCacheSize) {\n this._viewCache.push(view);\n } else {\n const index = viewContainerRef.indexOf(view);\n\n // The host component could remove views from the container outside of\n // the view repeater. It's unlikely this will occur, but just in case,\n // destroy the view on its own, otherwise destroy it through the\n // container to ensure that all the references are removed.\n if (index === -1) {\n view.destroy();\n } else {\n viewContainerRef.remove(index);\n }\n }\n }\n\n /** Inserts a recycled view from the cache at the given index. */\n private _insertViewFromCache(\n index: number,\n viewContainerRef: ViewContainerRef,\n ): EmbeddedViewRef<C> | null {\n const cachedView = this._viewCache.pop();\n if (cachedView) {\n viewContainerRef.insert(cachedView, index);\n }\n return cachedView || null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n readonly changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true,\n public compareWith?: (o1: T, o2: T) => boolean,\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 * @param values The values to select\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n select(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Deselects a value or an array of values.\n * @param values The values to deselect\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n deselect(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Sets the selected values\n * @param values The new selected values\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n setSelection(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n const oldValues = this.selected;\n const newSelectedSet = new Set(values);\n values.forEach(value => this._markSelected(value));\n oldValues\n .filter(value => !newSelectedSet.has(value))\n .forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Toggles a value between selected and deselected.\n * @param value The value to toggle\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n toggle(value: T): boolean | void {\n return this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n * @param flushEvent Whether to flush the changes in an event.\n * If false, the changes to the selection will be flushed along with the next event.\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n clear(flushEvent = true): boolean | void {\n this._unmarkAll();\n const changed = this._hasQueuedChanges();\n if (flushEvent) {\n this._emitChangeEvent();\n }\n return changed;\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(this._getConcreteValue(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 value = this._getConcreteValue(value);\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n if (!this.isSelected(value)) {\n this._selection.add(value);\n }\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n value = this._getConcreteValue(value);\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 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n\n /** Whether there are queued up change to be emitted. */\n private _hasQueuedChanges() {\n return !!(this._deselectedToEmit.length || this._selectedToEmit.length);\n }\n\n /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */\n private _getConcreteValue(inputValue: T): T {\n if (!this.compareWith) {\n return inputValue;\n } else {\n for (let selectedValue of this._selection) {\n if (this.compareWith!(inputValue, selectedValue)) {\n return selectedValue;\n }\n }\n return inputValue;\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// 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 {\n InjectionToken,\n IterableChangeRecord,\n IterableChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * The context for an embedded view in the repeater's view container.\n *\n * @template T The type for the embedded view's $implicit property.\n */\nexport interface _ViewRepeaterItemContext<T> {\n $implicit?: T;\n}\n\n/**\n * The arguments needed to construct an embedded view for an item in a view\n * container.\n *\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeaterItemInsertArgs<C> {\n templateRef: TemplateRef<C>;\n context?: C;\n index?: number;\n}\n\n/**\n * A factory that derives the embedded view context for an item in a view\n * container.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport type _ViewRepeaterItemContextFactory<T, R, C extends _ViewRepeaterItemContext<T>> = (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n) => _ViewRepeaterItemInsertArgs<C>;\n\n/**\n * Extracts the value of an item from an {@link IterableChangeRecord}.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n */\nexport type _ViewRepeaterItemValueResolver<T, R> = (record: IterableChangeRecord<R>) => T;\n\n/** Indicates how a view was changed by a {@link _ViewRepeater}. */\nexport const enum _ViewRepeaterOperation {\n /** The content of an existing view was replaced with another item. */\n REPLACED,\n /** A new view was created with `createEmbeddedView`. */\n INSERTED,\n /** The position of a view changed, but the content remains the same. */\n MOVED,\n /** A view was detached from the view container. */\n REMOVED,\n}\n\n/**\n * Meta data describing the state of a view after it was updated by a\n * {@link _ViewRepeater}.\n *\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeaterItemChange<R, C> {\n /** The view's context after it was changed. */\n context?: C;\n /** Indicates how the view was changed. */\n operation: _ViewRepeaterOperation;\n /** The view's corresponding change record. */\n record: IterableChangeRecord<R>;\n}\n\n/**\n * Type for a callback to be executed after a view has changed.\n *\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport type _ViewRepeaterItemChanged<R, C> = (change: _ViewRepeaterItemChange<R, C>) => void;\n\n/**\n * Describes a strategy for rendering items in a {@link ViewContainerRef}.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeater<T, R, C extends _ViewRepeaterItemContext<T>> {\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ): void;\n\n detach(): void;\n}\n\n/**\n * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.\n * @docs-private\n */\nexport const _VIEW_REPEATER_STRATEGY = new InjectionToken<\n _ViewRepeater<unknown, unknown, _ViewRepeaterItemContext<unknown>>\n>('_ViewRepeater');\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;MAWsB,UAAU,CAAA;AAmB/B,CAAA;AAED;AACM,SAAU,YAAY,CAAC,KAAU,EAAA;;;;;AAKrC,IAAA,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,IAAI,EAAE,KAAK,YAAY,qBAAqB,CAAC,CAAC;AACnG;;AC5BA;AACM,MAAO,eAAmB,SAAQ,UAAa,CAAA;AACnD,IAAA,WAAA,CAAoB,KAA8C,EAAA;AAChE,QAAA,KAAK,EAAE,CAAC;QADU,IAAK,CAAA,KAAA,GAAL,KAAK,CAAyC;KAEjE;IAED,OAAO,GAAA;QACL,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,GAAGA,EAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACzE;AAED,IAAA,UAAU,MAAK;AAChB;;ACCD;;;;;;;;AAQG;MACU,4BAA4B,CAAA;IAGvC,YAAY,CACV,OAA2B,EAC3B,gBAAkC,EAClC,kBAA4D,EAC5D,iBAAuD,EACvD,eAAgD,EAAA;QAEhD,OAAO,CAAC,gBAAgB,CACtB,CACE,MAA+B,EAC/B,qBAAoC,EACpC,YAA2B,KACzB;AACF,YAAA,IAAI,IAAoC,CAAC;AACzC,YAAA,IAAI,SAAiC,CAAC;AACtC,YAAA,IAAI,MAAM,CAAC,aAAa,IAAI,IAAI,EAAE;gBAChC,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,EAAE,YAAY,CAAC,CAAC;AACtF,gBAAA,IAAI,GAAG,gBAAgB,CAAC,kBAAkB,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.ts","../../../../../../src/cdk/collections/array-data-source.ts","../../../../../../src/cdk/collections/view-repeater.ts","../../../../../../src/cdk/collections/dispose-view-repeater-strategy.ts","../../../../../../src/cdk/collections/recycle-view-repeater-strategy.ts","../../../../../../src/cdk/collections/selection-model.ts","../../../../../../src/cdk/collections/unique-selection-dispatcher.ts","../../../../../../src/cdk/collections/collections_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ConnectableObservable, 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<readonly 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. We also can't use `isObservable`\n // here, because of some internal apps.\n return value && typeof value.connect === 'function' && !(value instanceof ConnectableObservable);\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/** DataSource wrapper for a native array. */\nexport class ArrayDataSource<T> extends DataSource<T> {\n constructor(private _data: readonly T[] | Observable<readonly T[]>) {\n super();\n }\n\n connect(): Observable<readonly 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 {\n InjectionToken,\n IterableChangeRecord,\n IterableChanges,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\n\n/**\n * The context for an embedded view in the repeater's view container.\n *\n * @template T The type for the embedded view's $implicit property.\n */\nexport interface _ViewRepeaterItemContext<T> {\n $implicit?: T;\n}\n\n/**\n * The arguments needed to construct an embedded view for an item in a view\n * container.\n *\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeaterItemInsertArgs<C> {\n templateRef: TemplateRef<C>;\n context?: C;\n index?: number;\n}\n\n/**\n * A factory that derives the embedded view context for an item in a view\n * container.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport type _ViewRepeaterItemContextFactory<T, R, C extends _ViewRepeaterItemContext<T>> = (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n) => _ViewRepeaterItemInsertArgs<C>;\n\n/**\n * Extracts the value of an item from an {@link IterableChangeRecord}.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n */\nexport type _ViewRepeaterItemValueResolver<T, R> = (record: IterableChangeRecord<R>) => T;\n\n/** Indicates how a view was changed by a {@link _ViewRepeater}. */\nexport enum _ViewRepeaterOperation {\n /** The content of an existing view was replaced with another item. */\n REPLACED,\n /** A new view was created with `createEmbeddedView`. */\n INSERTED,\n /** The position of a view changed, but the content remains the same. */\n MOVED,\n /** A view was detached from the view container. */\n REMOVED,\n}\n\n/**\n * Meta data describing the state of a view after it was updated by a\n * {@link _ViewRepeater}.\n *\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeaterItemChange<R, C> {\n /** The view's context after it was changed. */\n context?: C;\n /** Indicates how the view was changed. */\n operation: _ViewRepeaterOperation;\n /** The view's corresponding change record. */\n record: IterableChangeRecord<R>;\n}\n\n/**\n * Type for a callback to be executed after a view has changed.\n *\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport type _ViewRepeaterItemChanged<R, C> = (change: _ViewRepeaterItemChange<R, C>) => void;\n\n/**\n * Describes a strategy for rendering items in a {@link ViewContainerRef}.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport interface _ViewRepeater<T, R, C extends _ViewRepeaterItemContext<T>> {\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ): void;\n\n detach(): void;\n}\n\n/**\n * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.\n * @docs-private\n */\nexport const _VIEW_REPEATER_STRATEGY = new InjectionToken<\n _ViewRepeater<unknown, unknown, _ViewRepeaterItemContext<unknown>>\n>('_ViewRepeater');\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 EmbeddedViewRef,\n IterableChangeRecord,\n IterableChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n _ViewRepeater,\n _ViewRepeaterItemChanged,\n _ViewRepeaterItemContext,\n _ViewRepeaterItemContextFactory,\n _ViewRepeaterItemValueResolver,\n _ViewRepeaterOperation,\n} from './view-repeater';\n\n/**\n * A repeater that destroys views when they are removed from a\n * {@link ViewContainerRef}. When new items are inserted into the container,\n * the repeater will always construct a new embedded view for each item.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport class _DisposeViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>>\n implements _ViewRepeater<T, R, C>\n{\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ) {\n changes.forEachOperation(\n (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => {\n let view: EmbeddedViewRef<C> | undefined;\n let operation: _ViewRepeaterOperation;\n if (record.previousIndex == null) {\n const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = viewContainerRef.createEmbeddedView(\n insertContext.templateRef,\n insertContext.context,\n insertContext.index,\n );\n operation = _ViewRepeaterOperation.INSERTED;\n } else if (currentIndex == null) {\n viewContainerRef.remove(adjustedPreviousIndex!);\n operation = _ViewRepeaterOperation.REMOVED;\n } else {\n view = viewContainerRef.get(adjustedPreviousIndex!) as EmbeddedViewRef<C>;\n viewContainerRef.move(view!, currentIndex);\n operation = _ViewRepeaterOperation.MOVED;\n }\n\n if (itemViewChanged) {\n itemViewChanged({\n context: view?.context,\n operation,\n record,\n });\n }\n },\n );\n }\n\n detach() {}\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 EmbeddedViewRef,\n IterableChangeRecord,\n IterableChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n _ViewRepeater,\n _ViewRepeaterItemChanged,\n _ViewRepeaterItemContext,\n _ViewRepeaterItemContextFactory,\n _ViewRepeaterItemInsertArgs,\n _ViewRepeaterItemValueResolver,\n _ViewRepeaterOperation,\n} from './view-repeater';\n\n/**\n * A repeater that caches views when they are removed from a\n * {@link ViewContainerRef}. When new items are inserted into the container,\n * the repeater will reuse one of the cached views instead of creating a new\n * embedded view. Recycling cached views reduces the quantity of expensive DOM\n * inserts.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport class _RecycleViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>>\n implements _ViewRepeater<T, R, C>\n{\n /**\n * The size of the cache used to store unused views.\n * Setting the cache size to `0` will disable caching. Defaults to 20 views.\n */\n viewCacheSize: number = 20;\n\n /**\n * View cache that stores embedded view instances that have been previously stamped out,\n * but don't are not currently rendered. The view repeater will reuse these views rather than\n * creating brand new ones.\n *\n * TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance.\n */\n private _viewCache: EmbeddedViewRef<C>[] = [];\n\n /** Apply changes to the DOM. */\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation(\n (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => {\n let view: EmbeddedViewRef<C> | undefined;\n let operation: _ViewRepeaterOperation;\n if (record.previousIndex == null) {\n // Item added.\n const viewArgsFactory = () =>\n itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = this._insertView(\n viewArgsFactory,\n currentIndex!,\n viewContainerRef,\n itemValueResolver(record),\n );\n operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED;\n } else if (currentIndex == null) {\n // Item removed.\n this._detachAndCacheView(adjustedPreviousIndex!, viewContainerRef);\n operation = _ViewRepeaterOperation.REMOVED;\n } else {\n // Item moved.\n view = this._moveView(\n adjustedPreviousIndex!,\n currentIndex!,\n viewContainerRef,\n itemValueResolver(record),\n );\n operation = _ViewRepeaterOperation.MOVED;\n }\n\n if (itemViewChanged) {\n itemViewChanged({\n context: view?.context,\n operation,\n record,\n });\n }\n },\n );\n }\n\n detach() {\n for (const view of this._viewCache) {\n view.destroy();\n }\n this._viewCache = [];\n }\n\n /**\n * Inserts a view for a new item, either from the cache or by creating a new\n * one. Returns `undefined` if the item was inserted into a cached view.\n */\n private _insertView(\n viewArgsFactory: () => _ViewRepeaterItemInsertArgs<C>,\n currentIndex: number,\n viewContainerRef: ViewContainerRef,\n value: T,\n ): EmbeddedViewRef<C> | undefined {\n const cachedView = this._insertViewFromCache(currentIndex!, viewContainerRef);\n if (cachedView) {\n cachedView.context.$implicit = value;\n return undefined;\n }\n\n const viewArgs = viewArgsFactory();\n return viewContainerRef.createEmbeddedView(\n viewArgs.templateRef,\n viewArgs.context,\n viewArgs.index,\n );\n }\n\n /** Detaches the view at the given index and inserts into the view cache. */\n private _detachAndCacheView(index: number, viewContainerRef: ViewContainerRef) {\n const detachedView = viewContainerRef.detach(index) as EmbeddedViewRef<C>;\n this._maybeCacheView(detachedView, viewContainerRef);\n }\n\n /** Moves view at the previous index to the current index. */\n private _moveView(\n adjustedPreviousIndex: number,\n currentIndex: number,\n viewContainerRef: ViewContainerRef,\n value: T,\n ): EmbeddedViewRef<C> {\n const view = viewContainerRef.get(adjustedPreviousIndex!) as EmbeddedViewRef<C>;\n viewContainerRef.move(view, currentIndex);\n view.context.$implicit = value;\n return view;\n }\n\n /**\n * Cache the given detached view. If the cache is full, the view will be\n * destroyed.\n */\n private _maybeCacheView(view: EmbeddedViewRef<C>, viewContainerRef: ViewContainerRef) {\n if (this._viewCache.length < this.viewCacheSize) {\n this._viewCache.push(view);\n } else {\n const index = viewContainerRef.indexOf(view);\n\n // The host component could remove views from the container outside of\n // the view repeater. It's unlikely this will occur, but just in case,\n // destroy the view on its own, otherwise destroy it through the\n // container to ensure that all the references are removed.\n if (index === -1) {\n view.destroy();\n } else {\n viewContainerRef.remove(index);\n }\n }\n }\n\n /** Inserts a recycled view from the cache at the given index. */\n private _insertViewFromCache(\n index: number,\n viewContainerRef: ViewContainerRef,\n ): EmbeddedViewRef<C> | null {\n const cachedView = this._viewCache.pop();\n if (cachedView) {\n viewContainerRef.insert(cachedView, index);\n }\n return cachedView || null;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Subject} from 'rxjs';\n\n/**\n * Class to be used to power selecting one or more options from a list.\n */\nexport class SelectionModel<T> {\n /** Currently-selected values. */\n private _selection = new Set<T>();\n\n /** Keeps track of the deselected options that haven't been emitted by the change event. */\n private _deselectedToEmit: T[] = [];\n\n /** Keeps track of the selected options that haven't been emitted by the change event. */\n private _selectedToEmit: T[] = [];\n\n /** Cache for the array value of the selected items. */\n private _selected: T[] | null;\n\n /** Selected values. */\n get selected(): T[] {\n if (!this._selected) {\n this._selected = Array.from(this._selection.values());\n }\n\n return this._selected;\n }\n\n /** Event emitted when the value has changed. */\n readonly changed = new Subject<SelectionChange<T>>();\n\n constructor(\n private _multiple = false,\n initiallySelectedValues?: T[],\n private _emitChanges = true,\n public compareWith?: (o1: T, o2: T) => boolean,\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 * @param values The values to select\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n select(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Deselects a value or an array of values.\n * @param values The values to deselect\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n deselect(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n values.forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Sets the selected values\n * @param values The new selected values\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n setSelection(...values: T[]): boolean | void {\n this._verifyValueAssignment(values);\n const oldValues = this.selected;\n const newSelectedSet = new Set(values);\n values.forEach(value => this._markSelected(value));\n oldValues\n .filter(value => !newSelectedSet.has(value))\n .forEach(value => this._unmarkSelected(value));\n const changed = this._hasQueuedChanges();\n this._emitChangeEvent();\n return changed;\n }\n\n /**\n * Toggles a value between selected and deselected.\n * @param value The value to toggle\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n toggle(value: T): boolean | void {\n return this.isSelected(value) ? this.deselect(value) : this.select(value);\n }\n\n /**\n * Clears all of the selected values.\n * @param flushEvent Whether to flush the changes in an event.\n * If false, the changes to the selection will be flushed along with the next event.\n * @return Whether the selection changed as a result of this call\n * @breaking-change 16.0.0 make return type boolean\n */\n clear(flushEvent = true): boolean | void {\n this._unmarkAll();\n const changed = this._hasQueuedChanges();\n if (flushEvent) {\n this._emitChangeEvent();\n }\n return changed;\n }\n\n /**\n * Determines whether a value is selected.\n */\n isSelected(value: T): boolean {\n return this._selection.has(this._getConcreteValue(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 value = this._getConcreteValue(value);\n if (!this.isSelected(value)) {\n if (!this._multiple) {\n this._unmarkAll();\n }\n\n if (!this.isSelected(value)) {\n this._selection.add(value);\n }\n\n if (this._emitChanges) {\n this._selectedToEmit.push(value);\n }\n }\n }\n\n /** Deselects a value. */\n private _unmarkSelected(value: T) {\n value = this._getConcreteValue(value);\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 && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getMultipleValuesInSingleSelectionError();\n }\n }\n\n /** Whether there are queued up change to be emitted. */\n private _hasQueuedChanges() {\n return !!(this._deselectedToEmit.length || this._selectedToEmit.length);\n }\n\n /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */\n private _getConcreteValue(inputValue: T): T {\n if (!this.compareWith) {\n return inputValue;\n } else {\n for (let selectedValue of this._selection) {\n if (this.compareWith!(inputValue, selectedValue)) {\n return selectedValue;\n }\n }\n return inputValue;\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// 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 * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observableOf"],"mappings":";;;;MAWsB,UAAU,CAAA;AAmB/B,CAAA;AAED;AACM,SAAU,YAAY,CAAC,KAAU,EAAA;;;;;AAKrC,IAAA,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU,IAAI,EAAE,KAAK,YAAY,qBAAqB,CAAC,CAAC;AACnG;;AC5BA;AACM,MAAO,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AClB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAA;;;ACtBhC;;AAEG;;;;"}
|
package/fesm2022/drag-drop.mjs
CHANGED
|
@@ -1813,6 +1813,20 @@ const DROP_PROXIMITY_THRESHOLD = 0.05;
|
|
|
1813
1813
|
* viewport. The value comes from trying it out manually until it feels right.
|
|
1814
1814
|
*/
|
|
1815
1815
|
const SCROLL_PROXIMITY_THRESHOLD = 0.05;
|
|
1816
|
+
/** Vertical direction in which we can auto-scroll. */
|
|
1817
|
+
var AutoScrollVerticalDirection;
|
|
1818
|
+
(function (AutoScrollVerticalDirection) {
|
|
1819
|
+
AutoScrollVerticalDirection[AutoScrollVerticalDirection["NONE"] = 0] = "NONE";
|
|
1820
|
+
AutoScrollVerticalDirection[AutoScrollVerticalDirection["UP"] = 1] = "UP";
|
|
1821
|
+
AutoScrollVerticalDirection[AutoScrollVerticalDirection["DOWN"] = 2] = "DOWN";
|
|
1822
|
+
})(AutoScrollVerticalDirection || (AutoScrollVerticalDirection = {}));
|
|
1823
|
+
/** Horizontal direction in which we can auto-scroll. */
|
|
1824
|
+
var AutoScrollHorizontalDirection;
|
|
1825
|
+
(function (AutoScrollHorizontalDirection) {
|
|
1826
|
+
AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["NONE"] = 0] = "NONE";
|
|
1827
|
+
AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["LEFT"] = 1] = "LEFT";
|
|
1828
|
+
AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["RIGHT"] = 2] = "RIGHT";
|
|
1829
|
+
})(AutoScrollHorizontalDirection || (AutoScrollHorizontalDirection = {}));
|
|
1816
1830
|
/**
|
|
1817
1831
|
* Reference to a drop list. Used to manipulate or dispose of the container.
|
|
1818
1832
|
*/
|
|
@@ -1869,9 +1883,9 @@ class DropListRef {
|
|
|
1869
1883
|
/** Subscription to the window being scrolled. */
|
|
1870
1884
|
this._viewportScrollSubscription = Subscription.EMPTY;
|
|
1871
1885
|
/** Vertical direction in which the list is currently scrolling. */
|
|
1872
|
-
this._verticalScrollDirection =
|
|
1886
|
+
this._verticalScrollDirection = AutoScrollVerticalDirection.NONE;
|
|
1873
1887
|
/** Horizontal direction in which the list is currently scrolling. */
|
|
1874
|
-
this._horizontalScrollDirection =
|
|
1888
|
+
this._horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
|
|
1875
1889
|
/** Used to signal to the current auto-scroll sequence when to stop. */
|
|
1876
1890
|
this._stopScrollTimers = new Subject();
|
|
1877
1891
|
/** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */
|
|
@@ -1884,16 +1898,16 @@ class DropListRef {
|
|
|
1884
1898
|
.subscribe(() => {
|
|
1885
1899
|
const node = this._scrollNode;
|
|
1886
1900
|
const scrollStep = this.autoScrollStep;
|
|
1887
|
-
if (this._verticalScrollDirection ===
|
|
1901
|
+
if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {
|
|
1888
1902
|
node.scrollBy(0, -scrollStep);
|
|
1889
1903
|
}
|
|
1890
|
-
else if (this._verticalScrollDirection ===
|
|
1904
|
+
else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {
|
|
1891
1905
|
node.scrollBy(0, scrollStep);
|
|
1892
1906
|
}
|
|
1893
|
-
if (this._horizontalScrollDirection ===
|
|
1907
|
+
if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {
|
|
1894
1908
|
node.scrollBy(-scrollStep, 0);
|
|
1895
1909
|
}
|
|
1896
|
-
else if (this._horizontalScrollDirection ===
|
|
1910
|
+
else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {
|
|
1897
1911
|
node.scrollBy(scrollStep, 0);
|
|
1898
1912
|
}
|
|
1899
1913
|
});
|
|
@@ -2102,8 +2116,8 @@ class DropListRef {
|
|
|
2102
2116
|
return;
|
|
2103
2117
|
}
|
|
2104
2118
|
let scrollNode;
|
|
2105
|
-
let verticalScrollDirection =
|
|
2106
|
-
let horizontalScrollDirection =
|
|
2119
|
+
let verticalScrollDirection = AutoScrollVerticalDirection.NONE;
|
|
2120
|
+
let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
|
|
2107
2121
|
// Check whether we should start scrolling any of the parent containers.
|
|
2108
2122
|
this._parentPositions.positions.forEach((position, element) => {
|
|
2109
2123
|
// We have special handling for the `document` below. Also this would be
|
|
@@ -2313,12 +2327,12 @@ function getVerticalScrollDirection(clientRect, pointerY) {
|
|
|
2313
2327
|
const { top, bottom, height } = clientRect;
|
|
2314
2328
|
const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;
|
|
2315
2329
|
if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {
|
|
2316
|
-
return
|
|
2330
|
+
return AutoScrollVerticalDirection.UP;
|
|
2317
2331
|
}
|
|
2318
2332
|
else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {
|
|
2319
|
-
return
|
|
2333
|
+
return AutoScrollVerticalDirection.DOWN;
|
|
2320
2334
|
}
|
|
2321
|
-
return
|
|
2335
|
+
return AutoScrollVerticalDirection.NONE;
|
|
2322
2336
|
}
|
|
2323
2337
|
/**
|
|
2324
2338
|
* Gets whether the horizontal auto-scroll direction of a node.
|
|
@@ -2329,12 +2343,12 @@ function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
|
2329
2343
|
const { left, right, width } = clientRect;
|
|
2330
2344
|
const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
|
|
2331
2345
|
if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
|
|
2332
|
-
return
|
|
2346
|
+
return AutoScrollHorizontalDirection.LEFT;
|
|
2333
2347
|
}
|
|
2334
2348
|
else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
|
|
2335
|
-
return
|
|
2349
|
+
return AutoScrollHorizontalDirection.RIGHT;
|
|
2336
2350
|
}
|
|
2337
|
-
return
|
|
2351
|
+
return AutoScrollHorizontalDirection.NONE;
|
|
2338
2352
|
}
|
|
2339
2353
|
/**
|
|
2340
2354
|
* Gets the directions in which an element node should be scrolled,
|
|
@@ -2347,32 +2361,32 @@ function getHorizontalScrollDirection(clientRect, pointerX) {
|
|
|
2347
2361
|
function getElementScrollDirections(element, clientRect, pointerX, pointerY) {
|
|
2348
2362
|
const computedVertical = getVerticalScrollDirection(clientRect, pointerY);
|
|
2349
2363
|
const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);
|
|
2350
|
-
let verticalScrollDirection =
|
|
2351
|
-
let horizontalScrollDirection =
|
|
2364
|
+
let verticalScrollDirection = AutoScrollVerticalDirection.NONE;
|
|
2365
|
+
let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
|
|
2352
2366
|
// Note that we here we do some extra checks for whether the element is actually scrollable in
|
|
2353
2367
|
// a certain direction and we only assign the scroll direction if it is. We do this so that we
|
|
2354
2368
|
// can allow other elements to be scrolled, if the current element can't be scrolled anymore.
|
|
2355
2369
|
// This allows us to handle cases where the scroll regions of two scrollable elements overlap.
|
|
2356
2370
|
if (computedVertical) {
|
|
2357
2371
|
const scrollTop = element.scrollTop;
|
|
2358
|
-
if (computedVertical ===
|
|
2372
|
+
if (computedVertical === AutoScrollVerticalDirection.UP) {
|
|
2359
2373
|
if (scrollTop > 0) {
|
|
2360
|
-
verticalScrollDirection =
|
|
2374
|
+
verticalScrollDirection = AutoScrollVerticalDirection.UP;
|
|
2361
2375
|
}
|
|
2362
2376
|
}
|
|
2363
2377
|
else if (element.scrollHeight - scrollTop > element.clientHeight) {
|
|
2364
|
-
verticalScrollDirection =
|
|
2378
|
+
verticalScrollDirection = AutoScrollVerticalDirection.DOWN;
|
|
2365
2379
|
}
|
|
2366
2380
|
}
|
|
2367
2381
|
if (computedHorizontal) {
|
|
2368
2382
|
const scrollLeft = element.scrollLeft;
|
|
2369
|
-
if (computedHorizontal ===
|
|
2383
|
+
if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {
|
|
2370
2384
|
if (scrollLeft > 0) {
|
|
2371
|
-
horizontalScrollDirection =
|
|
2385
|
+
horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;
|
|
2372
2386
|
}
|
|
2373
2387
|
}
|
|
2374
2388
|
else if (element.scrollWidth - scrollLeft > element.clientWidth) {
|
|
2375
|
-
horizontalScrollDirection =
|
|
2389
|
+
horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;
|
|
2376
2390
|
}
|
|
2377
2391
|
}
|
|
2378
2392
|
return [verticalScrollDirection, horizontalScrollDirection];
|