source: trip-planner-front/node_modules/@angular/cdk/drag-drop/directives/drop-list.d.ts@ ceaed42

Last change on this file since ceaed42 was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago

adding new components

  • Property mode set to 100644
File size: 6.9 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 { BooleanInput, NumberInput } from '@angular/cdk/coercion';
9import { ElementRef, EventEmitter, OnDestroy, ChangeDetectorRef, InjectionToken } from '@angular/core';
10import { Directionality } from '@angular/cdk/bidi';
11import { ScrollDispatcher } from '@angular/cdk/scrolling';
12import { CdkDrag } from './drag';
13import { CdkDragDrop, CdkDragEnter, CdkDragExit, CdkDragSortEvent } from '../drag-events';
14import { CdkDropListGroup } from './drop-list-group';
15import { DropListRef } from '../drop-list-ref';
16import { DragDrop } from '../drag-drop';
17import { DropListOrientation, DragAxis, DragDropConfig } from './config';
18/**
19 * Internal compile-time-only representation of a `CdkDropList`.
20 * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.
21 * @docs-private
22 */
23import * as ɵngcc0 from '@angular/core';
24export interface CdkDropListInternal extends CdkDropList {
25}
26/**
27 * Injection token that can be used to reference instances of `CdkDropList`. It serves as
28 * alternative token to the actual `CdkDropList` class which could cause unnecessary
29 * retention of the class and its directive metadata.
30 */
31export declare const CDK_DROP_LIST: InjectionToken<CdkDropList<any>>;
32/** Container that wraps a set of draggable items. */
33export declare class CdkDropList<T = any> implements OnDestroy {
34 /** Element that the drop list is attached to. */
35 element: ElementRef<HTMLElement>;
36 private _changeDetectorRef;
37 private _scrollDispatcher;
38 private _dir?;
39 private _group?;
40 /** Emits when the list has been destroyed. */
41 private readonly _destroyed;
42 /** Whether the element's scrollable parents have been resolved. */
43 private _scrollableParentsResolved;
44 /** Keeps track of the drop lists that are currently on the page. */
45 private static _dropLists;
46 /** Reference to the underlying drop list instance. */
47 _dropListRef: DropListRef<CdkDropList<T>>;
48 /**
49 * Other draggable containers that this container is connected to and into which the
50 * container's items can be transferred. Can either be references to other drop containers,
51 * or their unique IDs.
52 */
53 connectedTo: (CdkDropList | string)[] | CdkDropList | string;
54 /** Arbitrary data to attach to this container. */
55 data: T;
56 /** Direction in which the list is oriented. */
57 orientation: DropListOrientation;
58 /**
59 * Unique ID for the drop zone. Can be used as a reference
60 * in the `connectedTo` of another `CdkDropList`.
61 */
62 id: string;
63 /** Locks the position of the draggable elements inside the container along the specified axis. */
64 lockAxis: DragAxis;
65 /** Whether starting a dragging sequence from this container is disabled. */
66 get disabled(): boolean;
67 set disabled(value: boolean);
68 private _disabled;
69 /** Whether sorting within this drop list is disabled. */
70 sortingDisabled: boolean;
71 /**
72 * Function that is used to determine whether an item
73 * is allowed to be moved into a drop container.
74 */
75 enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean;
76 /** Functions that is used to determine whether an item can be sorted into a particular index. */
77 sortPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean;
78 /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */
79 autoScrollDisabled: boolean;
80 /** Number of pixels to scroll for each frame when auto-scrolling an element. */
81 autoScrollStep: number;
82 /** Emits when the user drops an item inside the container. */
83 readonly dropped: EventEmitter<CdkDragDrop<T, any>>;
84 /**
85 * Emits when the user has moved a new drag item into this container.
86 */
87 readonly entered: EventEmitter<CdkDragEnter<T>>;
88 /**
89 * Emits when the user removes an item from the container
90 * by dragging it into another container.
91 */
92 readonly exited: EventEmitter<CdkDragExit<T>>;
93 /** Emits as the user is swapping items while actively dragging. */
94 readonly sorted: EventEmitter<CdkDragSortEvent<T>>;
95 /**
96 * Keeps track of the items that are registered with this container. Historically we used to
97 * do this with a `ContentChildren` query, however queries don't handle transplanted views very
98 * well which means that we can't handle cases like dragging the headers of a `mat-table`
99 * correctly. What we do instead is to have the items register themselves with the container
100 * and then we sort them based on their position in the DOM.
101 */
102 private _unsortedItems;
103 constructor(
104 /** Element that the drop list is attached to. */
105 element: ElementRef<HTMLElement>, dragDrop: DragDrop, _changeDetectorRef: ChangeDetectorRef, _scrollDispatcher: ScrollDispatcher, _dir?: Directionality | undefined, _group?: CdkDropListGroup<CdkDropList<any>> | undefined, config?: DragDropConfig);
106 /** Registers an items with the drop list. */
107 addItem(item: CdkDrag): void;
108 /** Removes an item from the drop list. */
109 removeItem(item: CdkDrag): void;
110 /** Gets the registered items in the list, sorted by their position in the DOM. */
111 getSortedItems(): CdkDrag[];
112 ngOnDestroy(): void;
113 /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
114 private _setupInputSyncSubscription;
115 /** Handles events from the underlying DropListRef. */
116 private _handleEvents;
117 /** Assigns the default input values based on a provided config object. */
118 private _assignDefaults;
119 /** Syncs up the registered drag items with underlying drop list ref. */
120 private _syncItemsWithRef;
121 static ngAcceptInputType_disabled: BooleanInput;
122 static ngAcceptInputType_sortingDisabled: BooleanInput;
123 static ngAcceptInputType_autoScrollDisabled: BooleanInput;
124 static ngAcceptInputType_autoScrollStep: NumberInput;
125 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkDropList<any>, [null, null, null, null, { optional: true; }, { optional: true; skipSelf: true; }, { optional: true; }]>;
126 static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkDropList<any>, "[cdkDropList], cdk-drop-list", ["cdkDropList"], { "connectedTo": "cdkDropListConnectedTo"; "id": "id"; "enterPredicate": "cdkDropListEnterPredicate"; "sortPredicate": "cdkDropListSortPredicate"; "disabled": "cdkDropListDisabled"; "sortingDisabled": "cdkDropListSortingDisabled"; "autoScrollDisabled": "cdkDropListAutoScrollDisabled"; "orientation": "cdkDropListOrientation"; "lockAxis": "cdkDropListLockAxis"; "data": "cdkDropListData"; "autoScrollStep": "cdkDropListAutoScrollStep"; }, { "dropped": "cdkDropListDropped"; "entered": "cdkDropListEntered"; "exited": "cdkDropListExited"; "sorted": "cdkDropListSorted"; }, never>;
127}
128
129//# sourceMappingURL=drop-list.d.ts.map
Note: See TracBrowser for help on using the repository browser.