source: trip-planner-front/node_modules/@angular/cdk/esm2015/drag-drop/directives/drop-list.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 44.3 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { coerceArray, coerceNumberProperty, coerceBooleanProperty, } from '@angular/cdk/coercion';
9import { ElementRef, EventEmitter, Input, Output, Optional, Directive, ChangeDetectorRef, SkipSelf, Inject, InjectionToken, } from '@angular/core';
10import { Directionality } from '@angular/cdk/bidi';
11import { ScrollDispatcher } from '@angular/cdk/scrolling';
12import { CDK_DROP_LIST_GROUP, CdkDropListGroup } from './drop-list-group';
13import { DragDrop } from '../drag-drop';
14import { CDK_DRAG_CONFIG } from './config';
15import { Subject } from 'rxjs';
16import { startWith, takeUntil } from 'rxjs/operators';
17import { assertElementNode } from './assertions';
18/** Counter used to generate unique ids for drop zones. */
19let _uniqueIdCounter = 0;
20/**
21 * Injection token that can be used to reference instances of `CdkDropList`. It serves as
22 * alternative token to the actual `CdkDropList` class which could cause unnecessary
23 * retention of the class and its directive metadata.
24 */
25export const CDK_DROP_LIST = new InjectionToken('CdkDropList');
26const ɵ0 = undefined;
27/** Container that wraps a set of draggable items. */
28export class CdkDropList {
29 constructor(
30 /** Element that the drop list is attached to. */
31 element, dragDrop, _changeDetectorRef, _scrollDispatcher, _dir, _group, config) {
32 this.element = element;
33 this._changeDetectorRef = _changeDetectorRef;
34 this._scrollDispatcher = _scrollDispatcher;
35 this._dir = _dir;
36 this._group = _group;
37 /** Emits when the list has been destroyed. */
38 this._destroyed = new Subject();
39 /**
40 * Other draggable containers that this container is connected to and into which the
41 * container's items can be transferred. Can either be references to other drop containers,
42 * or their unique IDs.
43 */
44 this.connectedTo = [];
45 /**
46 * Unique ID for the drop zone. Can be used as a reference
47 * in the `connectedTo` of another `CdkDropList`.
48 */
49 this.id = `cdk-drop-list-${_uniqueIdCounter++}`;
50 /**
51 * Function that is used to determine whether an item
52 * is allowed to be moved into a drop container.
53 */
54 this.enterPredicate = () => true;
55 /** Functions that is used to determine whether an item can be sorted into a particular index. */
56 this.sortPredicate = () => true;
57 /** Emits when the user drops an item inside the container. */
58 this.dropped = new EventEmitter();
59 /**
60 * Emits when the user has moved a new drag item into this container.
61 */
62 this.entered = new EventEmitter();
63 /**
64 * Emits when the user removes an item from the container
65 * by dragging it into another container.
66 */
67 this.exited = new EventEmitter();
68 /** Emits as the user is swapping items while actively dragging. */
69 this.sorted = new EventEmitter();
70 /**
71 * Keeps track of the items that are registered with this container. Historically we used to
72 * do this with a `ContentChildren` query, however queries don't handle transplanted views very
73 * well which means that we can't handle cases like dragging the headers of a `mat-table`
74 * correctly. What we do instead is to have the items register themselves with the container
75 * and then we sort them based on their position in the DOM.
76 */
77 this._unsortedItems = new Set();
78 if (typeof ngDevMode === 'undefined' || ngDevMode) {
79 assertElementNode(element.nativeElement, 'cdkDropList');
80 }
81 this._dropListRef = dragDrop.createDropList(element);
82 this._dropListRef.data = this;
83 if (config) {
84 this._assignDefaults(config);
85 }
86 this._dropListRef.enterPredicate = (drag, drop) => {
87 return this.enterPredicate(drag.data, drop.data);
88 };
89 this._dropListRef.sortPredicate =
90 (index, drag, drop) => {
91 return this.sortPredicate(index, drag.data, drop.data);
92 };
93 this._setupInputSyncSubscription(this._dropListRef);
94 this._handleEvents(this._dropListRef);
95 CdkDropList._dropLists.push(this);
96 if (_group) {
97 _group._items.add(this);
98 }
99 }
100 /** Whether starting a dragging sequence from this container is disabled. */
101 get disabled() {
102 return this._disabled || (!!this._group && this._group.disabled);
103 }
104 set disabled(value) {
105 // Usually we sync the directive and ref state right before dragging starts, in order to have
106 // a single point of failure and to avoid having to use setters for everything. `disabled` is
107 // a special case, because it can prevent the `beforeStarted` event from firing, which can lock
108 // the user in a disabled state, so we also need to sync it as it's being set.
109 this._dropListRef.disabled = this._disabled = coerceBooleanProperty(value);
110 }
111 /** Registers an items with the drop list. */
112 addItem(item) {
113 this._unsortedItems.add(item);
114 if (this._dropListRef.isDragging()) {
115 this._syncItemsWithRef();
116 }
117 }
118 /** Removes an item from the drop list. */
119 removeItem(item) {
120 this._unsortedItems.delete(item);
121 if (this._dropListRef.isDragging()) {
122 this._syncItemsWithRef();
123 }
124 }
125 /** Gets the registered items in the list, sorted by their position in the DOM. */
126 getSortedItems() {
127 return Array.from(this._unsortedItems).sort((a, b) => {
128 const documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement());
129 // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.
130 // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
131 // tslint:disable-next-line:no-bitwise
132 return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
133 });
134 }
135 ngOnDestroy() {
136 const index = CdkDropList._dropLists.indexOf(this);
137 if (index > -1) {
138 CdkDropList._dropLists.splice(index, 1);
139 }
140 if (this._group) {
141 this._group._items.delete(this);
142 }
143 this._unsortedItems.clear();
144 this._dropListRef.dispose();
145 this._destroyed.next();
146 this._destroyed.complete();
147 }
148 /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
149 _setupInputSyncSubscription(ref) {
150 if (this._dir) {
151 this._dir.change
152 .pipe(startWith(this._dir.value), takeUntil(this._destroyed))
153 .subscribe(value => ref.withDirection(value));
154 }
155 ref.beforeStarted.subscribe(() => {
156 const siblings = coerceArray(this.connectedTo).map(drop => {
157 if (typeof drop === 'string') {
158 const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop);
159 if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) {
160 console.warn(`CdkDropList could not find connected drop list with id "${drop}"`);
161 }
162 return correspondingDropList;
163 }
164 return drop;
165 });
166 if (this._group) {
167 this._group._items.forEach(drop => {
168 if (siblings.indexOf(drop) === -1) {
169 siblings.push(drop);
170 }
171 });
172 }
173 // Note that we resolve the scrollable parents here so that we delay the resolution
174 // as long as possible, ensuring that the element is in its final place in the DOM.
175 if (!this._scrollableParentsResolved) {
176 const scrollableParents = this._scrollDispatcher
177 .getAncestorScrollContainers(this.element)
178 .map(scrollable => scrollable.getElementRef().nativeElement);
179 this._dropListRef.withScrollableParents(scrollableParents);
180 // Only do this once since it involves traversing the DOM and the parents
181 // shouldn't be able to change without the drop list being destroyed.
182 this._scrollableParentsResolved = true;
183 }
184 ref.disabled = this.disabled;
185 ref.lockAxis = this.lockAxis;
186 ref.sortingDisabled = coerceBooleanProperty(this.sortingDisabled);
187 ref.autoScrollDisabled = coerceBooleanProperty(this.autoScrollDisabled);
188 ref.autoScrollStep = coerceNumberProperty(this.autoScrollStep, 2);
189 ref
190 .connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef))
191 .withOrientation(this.orientation);
192 });
193 }
194 /** Handles events from the underlying DropListRef. */
195 _handleEvents(ref) {
196 ref.beforeStarted.subscribe(() => {
197 this._syncItemsWithRef();
198 this._changeDetectorRef.markForCheck();
199 });
200 ref.entered.subscribe(event => {
201 this.entered.emit({
202 container: this,
203 item: event.item.data,
204 currentIndex: event.currentIndex
205 });
206 });
207 ref.exited.subscribe(event => {
208 this.exited.emit({
209 container: this,
210 item: event.item.data
211 });
212 this._changeDetectorRef.markForCheck();
213 });
214 ref.sorted.subscribe(event => {
215 this.sorted.emit({
216 previousIndex: event.previousIndex,
217 currentIndex: event.currentIndex,
218 container: this,
219 item: event.item.data
220 });
221 });
222 ref.dropped.subscribe(event => {
223 this.dropped.emit({
224 previousIndex: event.previousIndex,
225 currentIndex: event.currentIndex,
226 previousContainer: event.previousContainer.data,
227 container: event.container.data,
228 item: event.item.data,
229 isPointerOverContainer: event.isPointerOverContainer,
230 distance: event.distance,
231 dropPoint: event.dropPoint
232 });
233 // Mark for check since all of these events run outside of change
234 // detection and we're not guaranteed for something else to have triggered it.
235 this._changeDetectorRef.markForCheck();
236 });
237 }
238 /** Assigns the default input values based on a provided config object. */
239 _assignDefaults(config) {
240 const { lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation } = config;
241 this.disabled = draggingDisabled == null ? false : draggingDisabled;
242 this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled;
243 this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled;
244 this.orientation = listOrientation || 'vertical';
245 if (lockAxis) {
246 this.lockAxis = lockAxis;
247 }
248 }
249 /** Syncs up the registered drag items with underlying drop list ref. */
250 _syncItemsWithRef() {
251 this._dropListRef.withItems(this.getSortedItems().map(item => item._dragRef));
252 }
253}
254/** Keeps track of the drop lists that are currently on the page. */
255CdkDropList._dropLists = [];
256CdkDropList.decorators = [
257 { type: Directive, args: [{
258 selector: '[cdkDropList], cdk-drop-list',
259 exportAs: 'cdkDropList',
260 providers: [
261 // Prevent child drop lists from picking up the same group as their parent.
262 { provide: CDK_DROP_LIST_GROUP, useValue: ɵ0 },
263 { provide: CDK_DROP_LIST, useExisting: CdkDropList },
264 ],
265 host: {
266 'class': 'cdk-drop-list',
267 '[attr.id]': 'id',
268 '[class.cdk-drop-list-disabled]': 'disabled',
269 '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()',
270 '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()',
271 }
272 },] }
273];
274CdkDropList.ctorParameters = () => [
275 { type: ElementRef },
276 { type: DragDrop },
277 { type: ChangeDetectorRef },
278 { type: ScrollDispatcher },
279 { type: Directionality, decorators: [{ type: Optional }] },
280 { type: CdkDropListGroup, decorators: [{ type: Optional }, { type: Inject, args: [CDK_DROP_LIST_GROUP,] }, { type: SkipSelf }] },
281 { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CDK_DRAG_CONFIG,] }] }
282];
283CdkDropList.propDecorators = {
284 connectedTo: [{ type: Input, args: ['cdkDropListConnectedTo',] }],
285 data: [{ type: Input, args: ['cdkDropListData',] }],
286 orientation: [{ type: Input, args: ['cdkDropListOrientation',] }],
287 id: [{ type: Input }],
288 lockAxis: [{ type: Input, args: ['cdkDropListLockAxis',] }],
289 disabled: [{ type: Input, args: ['cdkDropListDisabled',] }],
290 sortingDisabled: [{ type: Input, args: ['cdkDropListSortingDisabled',] }],
291 enterPredicate: [{ type: Input, args: ['cdkDropListEnterPredicate',] }],
292 sortPredicate: [{ type: Input, args: ['cdkDropListSortPredicate',] }],
293 autoScrollDisabled: [{ type: Input, args: ['cdkDropListAutoScrollDisabled',] }],
294 autoScrollStep: [{ type: Input, args: ['cdkDropListAutoScrollStep',] }],
295 dropped: [{ type: Output, args: ['cdkDropListDropped',] }],
296 entered: [{ type: Output, args: ['cdkDropListEntered',] }],
297 exited: [{ type: Output, args: ['cdkDropListExited',] }],
298 sorted: [{ type: Output, args: ['cdkDropListSorted',] }]
299};
300export { ɵ0 };
301//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcC1saXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay9kcmFnLWRyb3AvZGlyZWN0aXZlcy9kcm9wLWxpc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUVMLFdBQVcsRUFDWCxvQkFBb0IsRUFDcEIscUJBQXFCLEdBRXRCLE1BQU0sdUJBQXVCLENBQUM7QUFDL0IsT0FBTyxFQUNMLFVBQVUsRUFDVixZQUFZLEVBQ1osS0FBSyxFQUVMLE1BQU0sRUFDTixRQUFRLEVBQ1IsU0FBUyxFQUNULGlCQUFpQixFQUNqQixRQUFRLEVBQ1IsTUFBTSxFQUNOLGNBQWMsR0FDZixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUMsY0FBYyxFQUFDLE1BQU0sbUJBQW1CLENBQUM7QUFDakQsT0FBTyxFQUFDLGdCQUFnQixFQUF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