@dugararchit/cdk 0.0.0-dugararchit

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/_index.scss +8 -0
  2. package/a11y/_index.import.scss +2 -0
  3. package/a11y/_index.scss +102 -0
  4. package/a11y/a11y-prebuilt.scss +3 -0
  5. package/fesm2022/stagefright5-cdk-a11y.mjs +2381 -0
  6. package/fesm2022/stagefright5-cdk-a11y.mjs.map +1 -0
  7. package/fesm2022/stagefright5-cdk-accordion.mjs +267 -0
  8. package/fesm2022/stagefright5-cdk-accordion.mjs.map +1 -0
  9. package/fesm2022/stagefright5-cdk-bidi.mjs +185 -0
  10. package/fesm2022/stagefright5-cdk-bidi.mjs.map +1 -0
  11. package/fesm2022/stagefright5-cdk-clipboard.mjs +250 -0
  12. package/fesm2022/stagefright5-cdk-clipboard.mjs.map +1 -0
  13. package/fesm2022/stagefright5-cdk-coercion.mjs +128 -0
  14. package/fesm2022/stagefright5-cdk-coercion.mjs.map +1 -0
  15. package/fesm2022/stagefright5-cdk-collections.mjs +472 -0
  16. package/fesm2022/stagefright5-cdk-collections.mjs.map +1 -0
  17. package/fesm2022/stagefright5-cdk-drag-drop.mjs +3690 -0
  18. package/fesm2022/stagefright5-cdk-drag-drop.mjs.map +1 -0
  19. package/fesm2022/stagefright5-cdk-keycodes.mjs +159 -0
  20. package/fesm2022/stagefright5-cdk-keycodes.mjs.map +1 -0
  21. package/fesm2022/stagefright5-cdk-layout.mjs +246 -0
  22. package/fesm2022/stagefright5-cdk-layout.mjs.map +1 -0
  23. package/fesm2022/stagefright5-cdk-observers.mjs +203 -0
  24. package/fesm2022/stagefright5-cdk-observers.mjs.map +1 -0
  25. package/fesm2022/stagefright5-cdk-overlay.mjs +3033 -0
  26. package/fesm2022/stagefright5-cdk-overlay.mjs.map +1 -0
  27. package/fesm2022/stagefright5-cdk-platform.mjs +375 -0
  28. package/fesm2022/stagefright5-cdk-platform.mjs.map +1 -0
  29. package/fesm2022/stagefright5-cdk-portal.mjs +672 -0
  30. package/fesm2022/stagefright5-cdk-portal.mjs.map +1 -0
  31. package/fesm2022/stagefright5-cdk-scrolling.mjs +1399 -0
  32. package/fesm2022/stagefright5-cdk-scrolling.mjs.map +1 -0
  33. package/fesm2022/stagefright5-cdk-stepper.mjs +624 -0
  34. package/fesm2022/stagefright5-cdk-stepper.mjs.map +1 -0
  35. package/fesm2022/stagefright5-cdk-table.mjs +2346 -0
  36. package/fesm2022/stagefright5-cdk-table.mjs.map +1 -0
  37. package/fesm2022/stagefright5-cdk-testing-protractor.mjs +324 -0
  38. package/fesm2022/stagefright5-cdk-testing-protractor.mjs.map +1 -0
  39. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs +364 -0
  40. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs.map +1 -0
  41. package/fesm2022/stagefright5-cdk-testing-testbed.mjs +806 -0
  42. package/fesm2022/stagefright5-cdk-testing-testbed.mjs.map +1 -0
  43. package/fesm2022/stagefright5-cdk-testing.mjs +740 -0
  44. package/fesm2022/stagefright5-cdk-testing.mjs.map +1 -0
  45. package/fesm2022/stagefright5-cdk-text-field.mjs +453 -0
  46. package/fesm2022/stagefright5-cdk-text-field.mjs.map +1 -0
  47. package/fesm2022/stagefright5-cdk-tree.mjs +945 -0
  48. package/fesm2022/stagefright5-cdk-tree.mjs.map +1 -0
  49. package/fesm2022/stagefright5-cdk.mjs +26 -0
  50. package/fesm2022/stagefright5-cdk.mjs.map +1 -0
  51. package/overlay/_index-deprecated.scss +13 -0
  52. package/overlay/_index.import.scss +13 -0
  53. package/overlay/_index.scss +148 -0
  54. package/overlay/overlay-prebuilt.scss +3 -0
  55. package/package.json +159 -0
  56. package/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  57. package/schematics/schematics/BUILD.bazel +104 -0
  58. package/schematics/schematics/README.md +4 -0
  59. package/schematics/schematics/collection.json +18 -0
  60. package/schematics/schematics/index.ts +22 -0
  61. package/schematics/schematics/migration.json +50 -0
  62. package/schematics/schematics/ng-add/index.spec.ts +50 -0
  63. package/schematics/schematics/ng-add/index.ts +39 -0
  64. package/schematics/schematics/ng-add/package-config.ts +62 -0
  65. package/schematics/schematics/ng-add/schema.json +16 -0
  66. package/schematics/schematics/ng-add/schema.ts +12 -0
  67. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
  68. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +17 -0
  69. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +29 -0
  70. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +43 -0
  71. package/schematics/schematics/ng-generate/drag-drop/index.spec.ts +205 -0
  72. package/schematics/schematics/ng-generate/drag-drop/index.ts +35 -0
  73. package/schematics/schematics/ng-generate/drag-drop/schema.json +93 -0
  74. package/schematics/schematics/ng-generate/drag-drop/schema.ts +11 -0
  75. package/schematics/schematics/ng-update/data/attribute-selectors.ts +29 -0
  76. package/schematics/schematics/ng-update/data/class-names.ts +50 -0
  77. package/schematics/schematics/ng-update/data/constructor-checks.ts +75 -0
  78. package/schematics/schematics/ng-update/data/css-selectors.ts +33 -0
  79. package/schematics/schematics/ng-update/data/element-selectors.ts +21 -0
  80. package/schematics/schematics/ng-update/data/index.ts +18 -0
  81. package/schematics/schematics/ng-update/data/input-names.ts +118 -0
  82. package/schematics/schematics/ng-update/data/method-call-checks.ts +63 -0
  83. package/schematics/schematics/ng-update/data/output-names.ts +42 -0
  84. package/schematics/schematics/ng-update/data/property-names.ts +151 -0
  85. package/schematics/schematics/ng-update/data/symbol-removal.ts +22 -0
  86. package/schematics/schematics/ng-update/devkit-file-system.ts +87 -0
  87. package/schematics/schematics/ng-update/devkit-migration-rule.ts +185 -0
  88. package/schematics/schematics/ng-update/devkit-migration.ts +47 -0
  89. package/schematics/schematics/ng-update/find-stylesheets.ts +43 -0
  90. package/schematics/schematics/ng-update/html-parsing/angular.ts +49 -0
  91. package/schematics/schematics/ng-update/html-parsing/elements.ts +66 -0
  92. package/schematics/schematics/ng-update/index.ts +113 -0
  93. package/schematics/schematics/ng-update/migrations/attribute-selectors.ts +83 -0
  94. package/schematics/schematics/ng-update/migrations/class-inheritance.ts +63 -0
  95. package/schematics/schematics/ng-update/migrations/class-names.ts +107 -0
  96. package/schematics/schematics/ng-update/migrations/constructor-signature.ts +170 -0
  97. package/schematics/schematics/ng-update/migrations/css-selectors.ts +83 -0
  98. package/schematics/schematics/ng-update/migrations/element-selectors.ts +75 -0
  99. package/schematics/schematics/ng-update/migrations/input-names.ts +83 -0
  100. package/schematics/schematics/ng-update/migrations/method-call-arguments.ts +70 -0
  101. package/schematics/schematics/ng-update/migrations/misc-template.ts +36 -0
  102. package/schematics/schematics/ng-update/migrations/output-names.ts +61 -0
  103. package/schematics/schematics/ng-update/migrations/property-names.ts +61 -0
  104. package/schematics/schematics/ng-update/migrations/symbol-removal.ts +51 -0
  105. package/schematics/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.ts +40 -0
  106. package/schematics/schematics/ng-update/public-api.ts +18 -0
  107. package/schematics/schematics/ng-update/test-cases/index.spec.ts +18 -0
  108. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution.spec.ts +32 -0
  109. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution_input.ts +22 -0
  110. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  111. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts +50 -0
  112. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets_input.ts +8 -0
  113. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts +20 -0
  114. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks_input.ts +18 -0
  115. package/schematics/schematics/ng-update/test-cases/misc/module-resolution.spec.ts +27 -0
  116. package/schematics/schematics/ng-update/test-cases/v13/misc/tilde-import-v13.spec.ts +149 -0
  117. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_expected_output.ts +36 -0
  118. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_input.ts +36 -0
  119. package/schematics/schematics/ng-update/test-cases/v6/class-names_expected_output.ts +8 -0
  120. package/schematics/schematics/ng-update/test-cases/v6/class-names_input.ts +8 -0
  121. package/schematics/schematics/ng-update/test-cases/v6/input-names_expected_output.ts +22 -0
  122. package/schematics/schematics/ng-update/test-cases/v6/input-names_input.ts +22 -0
  123. package/schematics/schematics/ng-update/test-cases/v6/property-names_expected_output.ts +64 -0
  124. package/schematics/schematics/ng-update/test-cases/v6/property-names_input.ts +64 -0
  125. package/schematics/schematics/ng-update/test-cases/v7/property-names_expected_output.ts +28 -0
  126. package/schematics/schematics/ng-update/test-cases/v7/property-names_input.ts +28 -0
  127. package/schematics/schematics/ng-update/typescript/base-types.ts +22 -0
  128. package/schematics/schematics/ng-update/typescript/imports.ts +54 -0
  129. package/schematics/schematics/ng-update/typescript/literal.ts +32 -0
  130. package/schematics/schematics/ng-update/typescript/module-specifiers.ts +39 -0
  131. package/schematics/schematics/ng-update/update-schematic.md +209 -0
  132. package/schematics/schematics/ng-update/upgrade-data.ts +79 -0
  133. package/schematics/schematics/paths.ts +15 -0
  134. package/schematics/schematics/testing/BUILD.bazel +27 -0
  135. package/schematics/schematics/testing/file-content.ts +20 -0
  136. package/schematics/schematics/testing/index.ts +14 -0
  137. package/schematics/schematics/testing/post-scheduled-tasks.ts +45 -0
  138. package/schematics/schematics/testing/resolve-bazel-path.ts +46 -0
  139. package/schematics/schematics/testing/test-app.ts +21 -0
  140. package/schematics/schematics/testing/test-case-setup.ts +236 -0
  141. package/schematics/schematics/testing/test-library.ts +21 -0
  142. package/schematics/schematics/testing/test-project.ts +40 -0
  143. package/schematics/schematics/testing/tsconfig.json +7 -0
  144. package/schematics/schematics/tsconfig.json +28 -0
  145. package/schematics/schematics/update-tool/BUILD.bazel +19 -0
  146. package/schematics/schematics/update-tool/component-resource-collector.ts +195 -0
  147. package/schematics/schematics/update-tool/file-system.ts +78 -0
  148. package/schematics/schematics/update-tool/index.ts +191 -0
  149. package/schematics/schematics/update-tool/logger.ts +23 -0
  150. package/schematics/schematics/update-tool/migration.ts +88 -0
  151. package/schematics/schematics/update-tool/public-api.ts +16 -0
  152. package/schematics/schematics/update-tool/target-version.ts +31 -0
  153. package/schematics/schematics/update-tool/tsconfig.json +7 -0
  154. package/schematics/schematics/update-tool/update-recorder.ts +14 -0
  155. package/schematics/schematics/update-tool/utils/decorators.ts +54 -0
  156. package/schematics/schematics/update-tool/utils/functions.ts +18 -0
  157. package/schematics/schematics/update-tool/utils/imports.ts +128 -0
  158. package/schematics/schematics/update-tool/utils/line-mappings.ts +84 -0
  159. package/schematics/schematics/update-tool/utils/parse-tsconfig.ts +25 -0
  160. package/schematics/schematics/update-tool/utils/property-name.ts +28 -0
  161. package/schematics/schematics/update-tool/utils/virtual-host.ts +116 -0
  162. package/schematics/schematics/update-tool/version-changes.ts +49 -0
  163. package/schematics/schematics/utils/ast/ng-module-imports.spec.ts +43 -0
  164. package/schematics/schematics/utils/ast/ng-module-imports.ts +102 -0
  165. package/schematics/schematics/utils/ast.ts +88 -0
  166. package/schematics/schematics/utils/build-component.ts +252 -0
  167. package/schematics/schematics/utils/get-project.ts +27 -0
  168. package/schematics/schematics/utils/html-manipulation.ts +105 -0
  169. package/schematics/schematics/utils/index.ts +19 -0
  170. package/schematics/schematics/utils/parse5-element.ts +34 -0
  171. package/schematics/schematics/utils/project-index-file.ts +21 -0
  172. package/schematics/schematics/utils/project-main-file.ts +26 -0
  173. package/schematics/schematics/utils/project-style-file.ts +53 -0
  174. package/schematics/schematics/utils/project-targets.ts +43 -0
  175. package/schematics/schematics/utils/project-tsconfig-paths.spec.ts +91 -0
  176. package/schematics/schematics/utils/project-tsconfig-paths.ts +49 -0
  177. package/schematics/schematics/utils/schematic-options.ts +65 -0
  178. package/schematics/schematics/utils/vendored-ast-utils/index.ts +599 -0
  179. package/scrolling/virtual-scroll-viewport.scss +87 -0
  180. package/table/table.scss +3 -0
  181. package/text-field/_index.import.scss +2 -0
  182. package/text-field/_index.scss +89 -0
  183. package/text-field/text-field-prebuilt.scss +4 -0
  184. package/types/stagefright5-cdk-a11y.d.ts +1160 -0
  185. package/types/stagefright5-cdk-accordion.d.ts +95 -0
  186. package/types/stagefright5-cdk-bidi.d.ts +95 -0
  187. package/types/stagefright5-cdk-clipboard.d.ts +116 -0
  188. package/types/stagefright5-cdk-coercion.d.ts +101 -0
  189. package/types/stagefright5-cdk-collections.d.ts +405 -0
  190. package/types/stagefright5-cdk-drag-drop.d.ts +1471 -0
  191. package/types/stagefright5-cdk-keycodes.d.ts +142 -0
  192. package/types/stagefright5-cdk-layout.d.ts +96 -0
  193. package/types/stagefright5-cdk-observers.d.ts +91 -0
  194. package/types/stagefright5-cdk-overlay.d.ts +1258 -0
  195. package/types/stagefright5-cdk-platform.d.ts +130 -0
  196. package/types/stagefright5-cdk-portal.d.ts +327 -0
  197. package/types/stagefright5-cdk-scrolling.d.ts +631 -0
  198. package/types/stagefright5-cdk-stepper.d.ts +302 -0
  199. package/types/stagefright5-cdk-table.d.ts +1128 -0
  200. package/types/stagefright5-cdk-testing-protractor.d.ts +146 -0
  201. package/types/stagefright5-cdk-testing-selenium-webdriver.d.ts +161 -0
  202. package/types/stagefright5-cdk-testing-testbed.d.ts +168 -0
  203. package/types/stagefright5-cdk-testing.d.ts +735 -0
  204. package/types/stagefright5-cdk-text-field.d.ts +171 -0
  205. package/types/stagefright5-cdk-tree.d.ts +522 -0
  206. package/types/stagefright5-cdk.d.ts +14 -0
@@ -0,0 +1,1471 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnDestroy, NgZone, ElementRef, TemplateRef, ViewContainerRef, InjectionToken, EventEmitter, ChangeDetectorRef, AfterViewInit, OnChanges, QueryList, SimpleChanges } from '@angular/core';
3
+ import * as i7 from '@dugararchit/cdk/scrolling';
4
+ import { ViewportRuler, ScrollDispatcher } from '@dugararchit/cdk/scrolling';
5
+ import { Direction, Directionality } from '@dugararchit/cdk/bidi';
6
+ import { Subject, Observable } from 'rxjs';
7
+ import { BooleanInput, NumberInput } from '@dugararchit/cdk/coercion';
8
+
9
+ /**
10
+ * @license
11
+ * Copyright Google LLC All Rights Reserved.
12
+ *
13
+ * Use of this source code is governed by an MIT-style license that can be
14
+ * found in the LICENSE file at https://angular.io/license
15
+ */
16
+
17
+ /**
18
+ * Service that keeps track of all the drag item and drop container
19
+ * instances, and manages global event listeners on the `document`.
20
+ * @docs-private
21
+ */
22
+ declare class DragDropRegistry<I extends {
23
+ isDragging(): boolean;
24
+ }, C> implements OnDestroy {
25
+ private _ngZone;
26
+ private _document;
27
+ /** Registered drop container instances. */
28
+ private _dropInstances;
29
+ /** Registered drag item instances. */
30
+ private _dragInstances;
31
+ /** Drag item instances that are currently being dragged. */
32
+ private _activeDragInstances;
33
+ /** Keeps track of the event listeners that we've bound to the `document`. */
34
+ private _globalListeners;
35
+ /**
36
+ * Predicate function to check if an item is being dragged. Moved out into a property,
37
+ * because it'll be called a lot and we don't want to create a new function every time.
38
+ */
39
+ private _draggingPredicate;
40
+ /**
41
+ * Emits the `touchmove` or `mousemove` events that are dispatched
42
+ * while the user is dragging a drag item instance.
43
+ */
44
+ readonly pointerMove: Subject<TouchEvent | MouseEvent>;
45
+ /**
46
+ * Emits the `touchend` or `mouseup` events that are dispatched
47
+ * while the user is dragging a drag item instance.
48
+ */
49
+ readonly pointerUp: Subject<TouchEvent | MouseEvent>;
50
+ /**
51
+ * Emits when the viewport has been scrolled while the user is dragging an item.
52
+ * @deprecated To be turned into a private member. Use the `scrolled` method instead.
53
+ * @breaking-change 13.0.0
54
+ */
55
+ readonly scroll: Subject<Event>;
56
+ constructor(_ngZone: NgZone, _document: any);
57
+ /** Adds a drop container to the registry. */
58
+ registerDropContainer(drop: C): void;
59
+ /** Adds a drag item instance to the registry. */
60
+ registerDragItem(drag: I): void;
61
+ /** Removes a drop container from the registry. */
62
+ removeDropContainer(drop: C): void;
63
+ /** Removes a drag item instance from the registry. */
64
+ removeDragItem(drag: I): void;
65
+ /**
66
+ * Starts the dragging sequence for a drag instance.
67
+ * @param drag Drag instance which is being dragged.
68
+ * @param event Event that initiated the dragging.
69
+ */
70
+ startDragging(drag: I, event: TouchEvent | MouseEvent): void;
71
+ /** Stops dragging a drag item instance. */
72
+ stopDragging(drag: I): void;
73
+ /** Gets whether a drag item instance is currently being dragged. */
74
+ isDragging(drag: I): boolean;
75
+ /**
76
+ * Gets a stream that will emit when any element on the page is scrolled while an item is being
77
+ * dragged.
78
+ * @param shadowRoot Optional shadow root that the current dragging sequence started from.
79
+ * Top-level listeners won't pick up events coming from the shadow DOM so this parameter can
80
+ * be used to include an additional top-level listener at the shadow root level.
81
+ */
82
+ scrolled(shadowRoot?: DocumentOrShadowRoot | null): Observable<Event>;
83
+ ngOnDestroy(): void;
84
+ /**
85
+ * Event listener that will prevent the default browser action while the user is dragging.
86
+ * @param event Event whose default action should be prevented.
87
+ */
88
+ private _preventDefaultWhileDragging;
89
+ /** Event listener for `touchmove` that is bound even if no dragging is happening. */
90
+ private _persistentTouchmoveListener;
91
+ /** Clears out the global event listeners from the `document`. */
92
+ private _clearGlobalListeners;
93
+ static ɵfac: i0.ɵɵFactoryDeclaration<DragDropRegistry<any, any>, never>;
94
+ static ɵprov: i0.ɵɵInjectableDeclaration<DragDropRegistry<any, any>>;
95
+ }
96
+
97
+ /**
98
+ * @license
99
+ * Copyright Google LLC All Rights Reserved.
100
+ *
101
+ * Use of this source code is governed by an MIT-style license that can be
102
+ * found in the LICENSE file at https://angular.io/license
103
+ */
104
+
105
+ /**
106
+ * Internal compile-time-only representation of a `DropListRef`.
107
+ * Used to avoid circular import issues between the `DropListRef` and the `DragRef`.
108
+ * @docs-private
109
+ */
110
+ interface DropListRefInternal extends DropListRef {
111
+ }
112
+ /**
113
+ * Reference to a drop list. Used to manipulate or dispose of the container.
114
+ */
115
+ declare class DropListRef<T = any> {
116
+ private _dragDropRegistry;
117
+ private _ngZone;
118
+ private _viewportRuler;
119
+ /** Element that the drop list is attached to. */
120
+ element: HTMLElement | ElementRef<HTMLElement>;
121
+ /** Whether starting a dragging sequence from this container is disabled. */
122
+ disabled: boolean;
123
+ /** Whether sorting items within the list is disabled. */
124
+ sortingDisabled: boolean;
125
+ /** Locks the position of the draggable elements inside the container along the specified axis. */
126
+ lockAxis: 'x' | 'y';
127
+ /**
128
+ * Whether auto-scrolling the view when the user
129
+ * moves their pointer close to the edges is disabled.
130
+ */
131
+ autoScrollDisabled: boolean;
132
+ /** Number of pixels to scroll for each frame when auto-scrolling an element. */
133
+ autoScrollStep: number;
134
+ /**
135
+ * Function that is used to determine whether an item
136
+ * is allowed to be moved into a drop container.
137
+ */
138
+ enterPredicate: (drag: DragRefInternal, drop: DropListRef) => boolean;
139
+ /** Functions that is used to determine whether an item can be sorted into a particular index. */
140
+ sortPredicate: (index: number, drag: DragRefInternal, drop: DropListRef) => boolean;
141
+ /** Emits right before dragging has started. */
142
+ readonly beforeStarted: Subject<void>;
143
+ /**
144
+ * Emits when the user has moved a new drag item into this container.
145
+ */
146
+ readonly entered: Subject<{
147
+ item: DragRefInternal;
148
+ container: DropListRef;
149
+ currentIndex: number;
150
+ }>;
151
+ /**
152
+ * Emits when the user removes an item from the container
153
+ * by dragging it into another container.
154
+ */
155
+ readonly exited: Subject<{
156
+ item: DragRefInternal;
157
+ container: DropListRef;
158
+ }>;
159
+ /** Emits when the user drops an item inside the container. */
160
+ readonly dropped: Subject<{
161
+ item: DragRefInternal;
162
+ currentIndex: number;
163
+ previousIndex: number;
164
+ container: DropListRef;
165
+ previousContainer: DropListRef;
166
+ isPointerOverContainer: boolean;
167
+ distance: Point;
168
+ dropPoint: Point;
169
+ }>;
170
+ /** Emits as the user is swapping items while actively dragging. */
171
+ readonly sorted: Subject<{
172
+ previousIndex: number;
173
+ currentIndex: number;
174
+ container: DropListRef;
175
+ item: DragRefInternal;
176
+ }>;
177
+ /** Arbitrary data that can be attached to the drop list. */
178
+ data: T;
179
+ /** Whether an item in the list is being dragged. */
180
+ private _isDragging;
181
+ /** Cache of the dimensions of all the items inside the container. */
182
+ private _itemPositions;
183
+ /** Keeps track of the positions of any parent scrollable elements. */
184
+ private _parentPositions;
185
+ /** Cached `ClientRect` of the drop list. */
186
+ private _clientRect;
187
+ /**
188
+ * Draggable items that are currently active inside the container. Includes the items
189
+ * from `_draggables`, as well as any items that have been dragged in, but haven't
190
+ * been dropped yet.
191
+ */
192
+ private _activeDraggables;
193
+ /**
194
+ * Keeps track of the item that was last swapped with the dragged item, as well as what direction
195
+ * the pointer was moving in when the swap occured and whether the user's pointer continued to
196
+ * overlap with the swapped item after the swapping occurred.
197
+ */
198
+ private _previousSwap;
199
+ /** Draggable items in the container. */
200
+ private _draggables;
201
+ /** Drop lists that are connected to the current one. */
202
+ private _siblings;
203
+ /** Direction in which the list is oriented. */
204
+ private _orientation;
205
+ /** Connected siblings that currently have a dragged item. */
206
+ private _activeSiblings;
207
+ /** Layout direction of the drop list. */
208
+ private _direction;
209
+ /** Subscription to the window being scrolled. */
210
+ private _viewportScrollSubscription;
211
+ /** Vertical direction in which the list is currently scrolling. */
212
+ private _verticalScrollDirection;
213
+ /** Horizontal direction in which the list is currently scrolling. */
214
+ private _horizontalScrollDirection;
215
+ /** Node that is being auto-scrolled. */
216
+ private _scrollNode;
217
+ /** Used to signal to the current auto-scroll sequence when to stop. */
218
+ private readonly _stopScrollTimers;
219
+ /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */
220
+ private _cachedShadowRoot;
221
+ /** Reference to the document. */
222
+ private _document;
223
+ /** Elements that can be scrolled while the user is dragging. */
224
+ private _scrollableElements;
225
+ /** Initial value for the element's `scroll-snap-type` style. */
226
+ private _initialScrollSnap;
227
+ constructor(element: ElementRef<HTMLElement> | HTMLElement, _dragDropRegistry: DragDropRegistry<DragRefInternal, DropListRef>, _document: any, _ngZone: NgZone, _viewportRuler: ViewportRuler);
228
+ /** Removes the drop list functionality from the DOM element. */
229
+ dispose(): void;
230
+ /** Whether an item from this list is currently being dragged. */
231
+ isDragging(): boolean;
232
+ /** Starts dragging an item. */
233
+ start(): void;
234
+ /**
235
+ * Emits an event to indicate that the user moved an item into the container.
236
+ * @param item Item that was moved into the container.
237
+ * @param pointerX Position of the item along the X axis.
238
+ * @param pointerY Position of the item along the Y axis.
239
+ * @param index Index at which the item entered. If omitted, the container will try to figure it
240
+ * out automatically.
241
+ */
242
+ enter(item: DragRefInternal, pointerX: number, pointerY: number, index?: number): void;
243
+ /**
244
+ * Removes an item from the container after it was dragged into another container by the user.
245
+ * @param item Item that was dragged out.
246
+ */
247
+ exit(item: DragRefInternal): void;
248
+ /**
249
+ * Drops an item into this container.
250
+ * @param item Item being dropped into the container.
251
+ * @param currentIndex Index at which the item should be inserted.
252
+ * @param previousIndex Index of the item when dragging started.
253
+ * @param previousContainer Container from which the item got dragged in.
254
+ * @param isPointerOverContainer Whether the user's pointer was over the
255
+ * container when the item was dropped.
256
+ * @param distance Distance the user has dragged since the start of the dragging sequence.
257
+ */
258
+ drop(item: DragRefInternal, currentIndex: number, previousIndex: number, previousContainer: DropListRef, isPointerOverContainer: boolean, distance: Point, dropPoint: Point): void;
259
+ /**
260
+ * Sets the draggable items that are a part of this list.
261
+ * @param items Items that are a part of this list.
262
+ */
263
+ withItems(items: DragRefInternal[]): this;
264
+ /** Sets the layout direction of the drop list. */
265
+ withDirection(direction: Direction): this;
266
+ /**
267
+ * Sets the containers that are connected to this one. When two or more containers are
268
+ * connected, the user will be allowed to transfer items between them.
269
+ * @param connectedTo Other containers that the current containers should be connected to.
270
+ */
271
+ connectedTo(connectedTo: DropListRef[]): this;
272
+ /**
273
+ * Sets the orientation of the container.
274
+ * @param orientation New orientation for the container.
275
+ */
276
+ withOrientation(orientation: 'vertical' | 'horizontal'): this;
277
+ /**
278
+ * Sets which parent elements are can be scrolled while the user is dragging.
279
+ * @param elements Elements that can be scrolled.
280
+ */
281
+ withScrollableParents(elements: HTMLElement[]): this;
282
+ /** Gets the scrollable parents that are registered with this drop container. */
283
+ getScrollableParents(): readonly HTMLElement[];
284
+ /**
285
+ * Figures out the index of an item in the container.
286
+ * @param item Item whose index should be determined.
287
+ */
288
+ getItemIndex(item: DragRefInternal): number;
289
+ /**
290
+ * Whether the list is able to receive the item that
291
+ * is currently being dragged inside a connected drop list.
292
+ */
293
+ isReceiving(): boolean;
294
+ /**
295
+ * Sorts an item inside the container based on its position.
296
+ * @param item Item to be sorted.
297
+ * @param pointerX Position of the item along the X axis.
298
+ * @param pointerY Position of the item along the Y axis.
299
+ * @param pointerDelta Direction in which the pointer is moving along each axis.
300
+ */
301
+ _sortItem(item: DragRefInternal, pointerX: number, pointerY: number, pointerDelta: {
302
+ x: number;
303
+ y: number;
304
+ }): void;
305
+ /**
306
+ * Checks whether the user's pointer is close to the edges of either the
307
+ * viewport or the drop list and starts the auto-scroll sequence.
308
+ * @param pointerX User's pointer position along the x axis.
309
+ * @param pointerY User's pointer position along the y axis.
310
+ */
311
+ _startScrollingIfNecessary(pointerX: number, pointerY: number): void;
312
+ /** Stops any currently-running auto-scroll sequences. */
313
+ _stopScrolling(): void;
314
+ /** Starts the dragging sequence within the list. */
315
+ private _draggingStarted;
316
+ /** Caches the positions of the configured scrollable parents. */
317
+ private _cacheParentPositions;
318
+ /** Refreshes the position cache of the items and sibling containers. */
319
+ private _cacheItemPositions;
320
+ /** Resets the container to its initial state. */
321
+ private _reset;
322
+ /**
323
+ * Gets the offset in pixels by which the items that aren't being dragged should be moved.
324
+ * @param currentIndex Index of the item currently being dragged.
325
+ * @param siblings All of the items in the list.
326
+ * @param delta Direction in which the user is moving.
327
+ */
328
+ private _getSiblingOffsetPx;
329
+ /**
330
+ * Gets the offset in pixels by which the item that is being dragged should be moved.
331
+ * @param currentPosition Current position of the item.
332
+ * @param newPosition Position of the item where the current item should be moved.
333
+ * @param delta Direction in which the user is moving.
334
+ */
335
+ private _getItemOffsetPx;
336
+ /**
337
+ * Checks if pointer is entering in the first position
338
+ * @param pointerX Position of the user's pointer along the X axis.
339
+ * @param pointerY Position of the user's pointer along the Y axis.
340
+ */
341
+ private _shouldEnterAsFirstChild;
342
+ /**
343
+ * Gets the index of an item in the drop container, based on the position of the user's pointer.
344
+ * @param item Item that is being sorted.
345
+ * @param pointerX Position of the user's pointer along the X axis.
346
+ * @param pointerY Position of the user's pointer along the Y axis.
347
+ * @param delta Direction in which the user is moving their pointer.
348
+ */
349
+ private _getItemIndexFromPointerPosition;
350
+ /** Caches the current items in the list and their positions. */
351
+ private _cacheItems;
352
+ /** Starts the interval that'll auto-scroll the element. */
353
+ private _startScrollInterval;
354
+ /**
355
+ * Checks whether the user's pointer is positioned over the container.
356
+ * @param x Pointer position along the X axis.
357
+ * @param y Pointer position along the Y axis.
358
+ */
359
+ _isOverContainer(x: number, y: number): boolean;
360
+ /**
361
+ * Figures out whether an item should be moved into a sibling
362
+ * drop container, based on its current position.
363
+ * @param item Drag item that is being moved.
364
+ * @param x Position of the item along the X axis.
365
+ * @param y Position of the item along the Y axis.
366
+ */
367
+ _getSiblingContainerFromPosition(item: DragRefInternal, x: number, y: number): DropListRef | undefined;
368
+ /**
369
+ * Checks whether the drop list can receive the passed-in item.
370
+ * @param item Item that is being dragged into the list.
371
+ * @param x Position of the item along the X axis.
372
+ * @param y Position of the item along the Y axis.
373
+ */
374
+ _canReceive(item: DragRefInternal, x: number, y: number): boolean;
375
+ /**
376
+ * Called by one of the connected drop lists when a dragging sequence has started.
377
+ * @param sibling Sibling in which dragging has started.
378
+ */
379
+ _startReceiving(sibling: DropListRef, items: DragRefInternal[]): void;
380
+ /**
381
+ * Called by a connected drop list when dragging has stopped.
382
+ * @param sibling Sibling whose dragging has stopped.
383
+ */
384
+ _stopReceiving(sibling: DropListRef): void;
385
+ /**
386
+ * Starts listening to scroll events on the viewport.
387
+ * Used for updating the internal state of the list.
388
+ */
389
+ private _listenToScrollEvents;
390
+ /**
391
+ * Lazily resolves and returns the shadow root of the element. We do this in a function, rather
392
+ * than saving it in property directly on init, because we want to resolve it as late as possible
393
+ * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the
394
+ * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.
395
+ */
396
+ private _getShadowRoot;
397
+ /** Notifies any siblings that may potentially receive the item. */
398
+ private _notifyReceivingSiblings;
399
+ }
400
+
401
+ /**
402
+ * @license
403
+ * Copyright Google LLC All Rights Reserved.
404
+ *
405
+ * Use of this source code is governed by an MIT-style license that can be
406
+ * found in the LICENSE file at https://angular.io/license
407
+ */
408
+
409
+ /** Object that can be used to configure the behavior of DragRef. */
410
+ interface DragRefConfig {
411
+ /**
412
+ * Minimum amount of pixels that the user should
413
+ * drag, before the CDK initiates a drag sequence.
414
+ */
415
+ dragStartThreshold: number;
416
+ /**
417
+ * Amount the pixels the user should drag before the CDK
418
+ * considers them to have changed the drag direction.
419
+ */
420
+ pointerDirectionChangeThreshold: number;
421
+ /** `z-index` for the absolutely-positioned elements that are created by the drag item. */
422
+ zIndex?: number;
423
+ /** Ref that the current drag item is nested in. */
424
+ parentDragRef?: DragRef;
425
+ }
426
+ /**
427
+ * Internal compile-time-only representation of a `DragRef`.
428
+ * Used to avoid circular import issues between the `DragRef` and the `DropListRef`.
429
+ * @docs-private
430
+ */
431
+ interface DragRefInternal extends DragRef {
432
+ }
433
+ /** Template that can be used to create a drag helper element (e.g. a preview or a placeholder). */
434
+ interface DragHelperTemplate<T = any> {
435
+ template: TemplateRef<T> | null;
436
+ viewContainer: ViewContainerRef;
437
+ context: T;
438
+ }
439
+ /** Template that can be used to create a drag preview element. */
440
+ interface DragPreviewTemplate<T = any> extends DragHelperTemplate<T> {
441
+ matchSize?: boolean;
442
+ }
443
+ /** Point on the page or within an element. */
444
+ interface Point {
445
+ x: number;
446
+ y: number;
447
+ }
448
+ /**
449
+ * Possible places into which the preview of a drag item can be inserted.
450
+ * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that
451
+ * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain
452
+ * its inherited styles.
453
+ * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that
454
+ * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be
455
+ * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors
456
+ * like `:nth-child` and some flexbox configurations.
457
+ * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.
458
+ * Same advantages and disadvantages as `parent`.
459
+ */
460
+ type PreviewContainer = 'global' | 'parent' | ElementRef<HTMLElement> | HTMLElement;
461
+ /**
462
+ * Reference to a draggable item. Used to manipulate or dispose of the item.
463
+ */
464
+ declare class DragRef<T = any> {
465
+ private _config;
466
+ private _document;
467
+ private _ngZone;
468
+ private _viewportRuler;
469
+ private _dragDropRegistry;
470
+ /** Element displayed next to the user's pointer while the element is dragged. */
471
+ private _preview;
472
+ /** Reference to the view of the preview element. */
473
+ private _previewRef;
474
+ /** Container into which to insert the preview. */
475
+ private _previewContainer;
476
+ /** Reference to the view of the placeholder element. */
477
+ private _placeholderRef;
478
+ /** Element that is rendered instead of the draggable item while it is being sorted. */
479
+ private _placeholder;
480
+ /** Coordinates within the element at which the user picked up the element. */
481
+ private _pickupPositionInElement;
482
+ /** Coordinates on the page at which the user picked up the element. */
483
+ private _pickupPositionOnPage;
484
+ /**
485
+ * Anchor node used to save the place in the DOM where the element was
486
+ * picked up so that it can be restored at the end of the drag sequence.
487
+ */
488
+ private _anchor;
489
+ /**
490
+ * CSS `transform` applied to the element when it isn't being dragged. We need a
491
+ * passive transform in order for the dragged element to retain its new position
492
+ * after the user has stopped dragging and because we need to know the relative
493
+ * position in case they start dragging again. This corresponds to `element.style.transform`.
494
+ */
495
+ private _passiveTransform;
496
+ /** CSS `transform` that is applied to the element while it's being dragged. */
497
+ private _activeTransform;
498
+ /** Inline `transform` value that the element had before the first dragging sequence. */
499
+ private _initialTransform?;
500
+ /**
501
+ * Whether the dragging sequence has been started. Doesn't
502
+ * necessarily mean that the element has been moved.
503
+ */
504
+ private _hasStartedDragging;
505
+ /** Whether the element has moved since the user started dragging it. */
506
+ private _hasMoved;
507
+ /** Drop container in which the DragRef resided when dragging began. */
508
+ private _initialContainer;
509
+ /** Index at which the item started in its initial container. */
510
+ private _initialIndex;
511
+ /** Cached positions of scrollable parent elements. */
512
+ private _parentPositions;
513
+ /** Emits when the item is being moved. */
514
+ private readonly _moveEvents;
515
+ /** Keeps track of the direction in which the user is dragging along each axis. */
516
+ private _pointerDirectionDelta;
517
+ /** Pointer position at which the last change in the delta occurred. */
518
+ private _pointerPositionAtLastDirectionChange;
519
+ /** Position of the pointer at the last pointer event. */
520
+ private _lastKnownPointerPosition;
521
+ /**
522
+ * Root DOM node of the drag instance. This is the element that will
523
+ * be moved around as the user is dragging.
524
+ */
525
+ private _rootElement;
526
+ /**
527
+ * Nearest ancestor SVG, relative to which coordinates are calculated if dragging SVGElement
528
+ */
529
+ private _ownerSVGElement;
530
+ /**
531
+ * Inline style value of `-webkit-tap-highlight-color` at the time the
532
+ * dragging was started. Used to restore the value once we're done dragging.
533
+ */
534
+ private _rootElementTapHighlight;
535
+ /** Subscription to pointer movement events. */
536
+ private _pointerMoveSubscription;
537
+ /** Subscription to the event that is dispatched when the user lifts their pointer. */
538
+ private _pointerUpSubscription;
539
+ /** Subscription to the viewport being scrolled. */
540
+ private _scrollSubscription;
541
+ /** Subscription to the viewport being resized. */
542
+ private _resizeSubscription;
543
+ /**
544
+ * Time at which the last touch event occurred. Used to avoid firing the same
545
+ * events multiple times on touch devices where the browser will fire a fake
546
+ * mouse event for each touch event, after a certain time.
547
+ */
548
+ private _lastTouchEventTime;
549
+ /** Time at which the last dragging sequence was started. */
550
+ private _dragStartTime;
551
+ /** Cached reference to the boundary element. */
552
+ private _boundaryElement;
553
+ /** Whether the native dragging interactions have been enabled on the root element. */
554
+ private _nativeInteractionsEnabled;
555
+ /** Cached dimensions of the preview element. Should be read via `_getPreviewRect`. */
556
+ private _previewRect?;
557
+ /** Cached dimensions of the boundary element. */
558
+ private _boundaryRect?;
559
+ /** Element that will be used as a template to create the draggable item's preview. */
560
+ private _previewTemplate?;
561
+ /** Template for placeholder element rendered to show where a draggable would be dropped. */
562
+ private _placeholderTemplate?;
563
+ /** Elements that can be used to drag the draggable item. */
564
+ private _handles;
565
+ /** Registered handles that are currently disabled. */
566
+ private _disabledHandles;
567
+ /** Droppable container that the draggable is a part of. */
568
+ private _dropContainer?;
569
+ /** Layout direction of the item. */
570
+ private _direction;
571
+ /** Ref that the current drag item is nested in. */
572
+ private _parentDragRef;
573
+ /**
574
+ * Cached shadow root that the element is placed in. `null` means that the element isn't in
575
+ * the shadow DOM and `undefined` means that it hasn't been resolved yet. Should be read via
576
+ * `_getShadowRoot`, not directly.
577
+ */
578
+ private _cachedShadowRoot;
579
+ /** Axis along which dragging is locked. */
580
+ lockAxis: 'x' | 'y';
581
+ /**
582
+ * Amount of milliseconds to wait after the user has put their
583
+ * pointer down before starting to drag the element.
584
+ */
585
+ dragStartDelay: number | {
586
+ touch: number;
587
+ mouse: number;
588
+ };
589
+ /** Class to be added to the preview element. */
590
+ previewClass: string | string[] | undefined;
591
+ /** Whether starting to drag this element is disabled. */
592
+ get disabled(): boolean;
593
+ set disabled(value: boolean);
594
+ private _disabled;
595
+ /** Emits as the drag sequence is being prepared. */
596
+ readonly beforeStarted: Subject<void>;
597
+ /** Emits when the user starts dragging the item. */
598
+ readonly started: Subject<{
599
+ source: DragRef;
600
+ }>;
601
+ /** Emits when the user has released a drag item, before any animations have started. */
602
+ readonly released: Subject<{
603
+ source: DragRef;
604
+ }>;
605
+ /** Emits when the user stops dragging an item in the container. */
606
+ readonly ended: Subject<{
607
+ source: DragRef;
608
+ distance: Point;
609
+ dropPoint: Point;
610
+ }>;
611
+ /** Emits when the user has moved the item into a new container. */
612
+ readonly entered: Subject<{
613
+ container: DropListRefInternal;
614
+ item: DragRef;
615
+ currentIndex: number;
616
+ }>;
617
+ /** Emits when the user removes the item its container by dragging it into another container. */
618
+ readonly exited: Subject<{
619
+ container: DropListRefInternal;
620
+ item: DragRef;
621
+ }>;
622
+ /** Emits when the user drops the item inside a container. */
623
+ readonly dropped: Subject<{
624
+ previousIndex: number;
625
+ currentIndex: number;
626
+ item: DragRef;
627
+ container: DropListRefInternal;
628
+ previousContainer: DropListRefInternal;
629
+ distance: Point;
630
+ dropPoint: Point;
631
+ isPointerOverContainer: boolean;
632
+ }>;
633
+ /**
634
+ * Emits as the user is dragging the item. Use with caution,
635
+ * because this event will fire for every pixel that the user has dragged.
636
+ */
637
+ readonly moved: Observable<{
638
+ source: DragRef;
639
+ pointerPosition: {
640
+ x: number;
641
+ y: number;
642
+ };
643
+ event: MouseEvent | TouchEvent;
644
+ distance: Point;
645
+ delta: {
646
+ x: -1 | 0 | 1;
647
+ y: -1 | 0 | 1;
648
+ };
649
+ }>;
650
+ /** Arbitrary data that can be attached to the drag item. */
651
+ data: T;
652
+ /**
653
+ * Function that can be used to customize the logic of how the position of the drag item
654
+ * is limited while it's being dragged. Gets called with a point containing the current position
655
+ * of the user's pointer on the page and should return a point describing where the item should
656
+ * be rendered.
657
+ */
658
+ constrainPosition?: (point: Point, dragRef: DragRef) => Point;
659
+ constructor(element: ElementRef<HTMLElement> | HTMLElement, _config: DragRefConfig, _document: Document, _ngZone: NgZone, _viewportRuler: ViewportRuler, _dragDropRegistry: DragDropRegistry<DragRef, DropListRefInternal>);
660
+ /**
661
+ * Returns the element that is being used as a placeholder
662
+ * while the current element is being dragged.
663
+ */
664
+ getPlaceholderElement(): HTMLElement;
665
+ /** Returns the root draggable element. */
666
+ getRootElement(): HTMLElement;
667
+ /**
668
+ * Gets the currently-visible element that represents the drag item.
669
+ * While dragging this is the placeholder, otherwise it's the root element.
670
+ */
671
+ getVisibleElement(): HTMLElement;
672
+ /** Registers the handles that can be used to drag the element. */
673
+ withHandles(handles: (HTMLElement | ElementRef<HTMLElement>)[]): this;
674
+ /**
675
+ * Registers the template that should be used for the drag preview.
676
+ * @param template Template that from which to stamp out the preview.
677
+ */
678
+ withPreviewTemplate(template: DragPreviewTemplate | null): this;
679
+ /**
680
+ * Registers the template that should be used for the drag placeholder.
681
+ * @param template Template that from which to stamp out the placeholder.
682
+ */
683
+ withPlaceholderTemplate(template: DragHelperTemplate | null): this;
684
+ /**
685
+ * Sets an alternate drag root element. The root element is the element that will be moved as
686
+ * the user is dragging. Passing an alternate root element is useful when trying to enable
687
+ * dragging on an element that you might not have access to.
688
+ */
689
+ withRootElement(rootElement: ElementRef<HTMLElement> | HTMLElement): this;
690
+ /**
691
+ * Element to which the draggable's position will be constrained.
692
+ */
693
+ withBoundaryElement(boundaryElement: ElementRef<HTMLElement> | HTMLElement | null): this;
694
+ /** Sets the parent ref that the ref is nested in. */
695
+ withParent(parent: DragRef<unknown> | null): this;
696
+ /** Removes the dragging functionality from the DOM element. */
697
+ dispose(): void;
698
+ /** Checks whether the element is currently being dragged. */
699
+ isDragging(): boolean;
700
+ /** Resets a standalone drag item to its initial position. */
701
+ reset(): void;
702
+ /**
703
+ * Sets a handle as disabled. While a handle is disabled, it'll capture and interrupt dragging.
704
+ * @param handle Handle element that should be disabled.
705
+ */
706
+ disableHandle(handle: HTMLElement): void;
707
+ /**
708
+ * Enables a handle, if it has been disabled.
709
+ * @param handle Handle element to be enabled.
710
+ */
711
+ enableHandle(handle: HTMLElement): void;
712
+ /** Sets the layout direction of the draggable item. */
713
+ withDirection(direction: Direction): this;
714
+ /** Sets the container that the item is part of. */
715
+ _withDropContainer(container: DropListRefInternal): void;
716
+ /**
717
+ * Gets the current position in pixels the draggable outside of a drop container.
718
+ */
719
+ getFreeDragPosition(): Readonly<Point>;
720
+ /**
721
+ * Sets the current position in pixels the draggable outside of a drop container.
722
+ * @param value New position to be set.
723
+ */
724
+ setFreeDragPosition(value: Point): this;
725
+ /**
726
+ * Sets the container into which to insert the preview element.
727
+ * @param value Container into which to insert the preview.
728
+ */
729
+ withPreviewContainer(value: PreviewContainer): this;
730
+ /** Updates the item's sort order based on the last-known pointer position. */
731
+ _sortFromLastPointerPosition(): void;
732
+ /** Unsubscribes from the global subscriptions. */
733
+ private _removeSubscriptions;
734
+ /** Destroys the preview element and its ViewRef. */
735
+ private _destroyPreview;
736
+ /** Destroys the placeholder element and its ViewRef. */
737
+ private _destroyPlaceholder;
738
+ /** Handler for the `mousedown`/`touchstart` events. */
739
+ private _pointerDown;
740
+ /** Handler that is invoked when the user moves their pointer after they've initiated a drag. */
741
+ private _pointerMove;
742
+ /** Handler that is invoked when the user lifts their pointer up, after initiating a drag. */
743
+ private _pointerUp;
744
+ /**
745
+ * Clears subscriptions and stops the dragging sequence.
746
+ * @param event Browser event object that ended the sequence.
747
+ */
748
+ private _endDragSequence;
749
+ /** Starts the dragging sequence. */
750
+ private _startDragSequence;
751
+ /**
752
+ * Sets up the different variables and subscriptions
753
+ * that will be necessary for the dragging sequence.
754
+ * @param referenceElement Element that started the drag sequence.
755
+ * @param event Browser event object that started the sequence.
756
+ */
757
+ private _initializeDragSequence;
758
+ /** Cleans up the DOM artifacts that were added to facilitate the element being dragged. */
759
+ private _cleanupDragArtifacts;
760
+ /**
761
+ * Updates the item's position in its drop container, or moves it
762
+ * into a new one, depending on its current drag position.
763
+ */
764
+ private _updateActiveDropContainer;
765
+ /**
766
+ * Creates the element that will be rendered next to the user's pointer
767
+ * and will be used as a preview of the element that is being dragged.
768
+ */
769
+ private _createPreviewElement;
770
+ /**
771
+ * Animates the preview element from its current position to the location of the drop placeholder.
772
+ * @returns Promise that resolves when the animation completes.
773
+ */
774
+ private _animatePreviewToPlaceholder;
775
+ /** Creates an element that will be shown instead of the current element while dragging. */
776
+ private _createPlaceholderElement;
777
+ /**
778
+ * Figures out the coordinates at which an element was picked up.
779
+ * @param referenceElement Element that initiated the dragging.
780
+ * @param event Event that initiated the dragging.
781
+ */
782
+ private _getPointerPositionInElement;
783
+ /** Determines the point of the page that was touched by the user. */
784
+ private _getPointerPositionOnPage;
785
+ /** Gets the pointer position on the page, accounting for any position constraints. */
786
+ private _getConstrainedPointerPosition;
787
+ /** Updates the current drag delta, based on the user's current pointer position on the page. */
788
+ private _updatePointerDirectionDelta;
789
+ /** Toggles the native drag interactions, based on how many handles are registered. */
790
+ private _toggleNativeDragInteractions;
791
+ /** Removes the manually-added event listeners from the root element. */
792
+ private _removeRootElementListeners;
793
+ /**
794
+ * Applies a `transform` to the root element, taking into account any existing transforms on it.
795
+ * @param x New transform value along the X axis.
796
+ * @param y New transform value along the Y axis.
797
+ */
798
+ private _applyRootElementTransform;
799
+ /**
800
+ * Applies a `transform` to the preview, taking into account any existing transforms on it.
801
+ * @param x New transform value along the X axis.
802
+ * @param y New transform value along the Y axis.
803
+ */
804
+ private _applyPreviewTransform;
805
+ /**
806
+ * Gets the distance that the user has dragged during the current drag sequence.
807
+ * @param currentPosition Current position of the user's pointer.
808
+ */
809
+ private _getDragDistance;
810
+ /** Cleans up any cached element dimensions that we don't need after dragging has stopped. */
811
+ private _cleanupCachedDimensions;
812
+ /**
813
+ * Checks whether the element is still inside its boundary after the viewport has been resized.
814
+ * If not, the position is adjusted so that the element fits again.
815
+ */
816
+ private _containInsideBoundaryOnResize;
817
+ /** Gets the drag start delay, based on the event type. */
818
+ private _getDragStartDelay;
819
+ /** Updates the internal state of the draggable element when scrolling has occurred. */
820
+ private _updateOnScroll;
821
+ /** Gets the scroll position of the viewport. */
822
+ private _getViewportScrollPosition;
823
+ /**
824
+ * Lazily resolves and returns the shadow root of the element. We do this in a function, rather
825
+ * than saving it in property directly on init, because we want to resolve it as late as possible
826
+ * in order to ensure that the element has been moved into the shadow DOM. Doing it inside the
827
+ * constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.
828
+ */
829
+ private _getShadowRoot;
830
+ /** Gets the element into which the drag preview should be inserted. */
831
+ private _getPreviewInsertionPoint;
832
+ /** Lazily resolves and returns the dimensions of the preview. */
833
+ private _getPreviewRect;
834
+ /** Handles a native `dragstart` event. */
835
+ private _nativeDragStart;
836
+ /** Gets a handle that is the target of an event. */
837
+ private _getTargetHandle;
838
+ }
839
+
840
+ /**
841
+ * @license
842
+ * Copyright Google LLC All Rights Reserved.
843
+ *
844
+ * Use of this source code is governed by an MIT-style license that can be
845
+ * found in the LICENSE file at https://angular.io/license
846
+ */
847
+
848
+ /**
849
+ * Service that allows for drag-and-drop functionality to be attached to DOM elements.
850
+ */
851
+ declare class DragDrop {
852
+ private _document;
853
+ private _ngZone;
854
+ private _viewportRuler;
855
+ private _dragDropRegistry;
856
+ constructor(_document: any, _ngZone: NgZone, _viewportRuler: ViewportRuler, _dragDropRegistry: DragDropRegistry<DragRef, DropListRef>);
857
+ /**
858
+ * Turns an element into a draggable item.
859
+ * @param element Element to which to attach the dragging functionality.
860
+ * @param config Object used to configure the dragging behavior.
861
+ */
862
+ createDrag<T = any>(element: ElementRef<HTMLElement> | HTMLElement, config?: DragRefConfig): DragRef<T>;
863
+ /**
864
+ * Turns an element into a drop list.
865
+ * @param element Element to which to attach the drop list functionality.
866
+ */
867
+ createDropList<T = any>(element: ElementRef<HTMLElement> | HTMLElement): DropListRef<T>;
868
+ static ɵfac: i0.ɵɵFactoryDeclaration<DragDrop, never>;
869
+ static ɵprov: i0.ɵɵInjectableDeclaration<DragDrop>;
870
+ }
871
+
872
+ /**
873
+ * @license
874
+ * Copyright Google LLC All Rights Reserved.
875
+ *
876
+ * Use of this source code is governed by an MIT-style license that can be
877
+ * found in the LICENSE file at https://angular.io/license
878
+ */
879
+
880
+ /**
881
+ * Injection token that can be used for a `CdkDrag` to provide itself as a parent to the
882
+ * drag-specific child directive (`CdkDragHandle`, `CdkDragPreview` etc.). Used primarily
883
+ * to avoid circular imports.
884
+ * @docs-private
885
+ */
886
+ declare const CDK_DRAG_PARENT: InjectionToken<{}>;
887
+
888
+ /**
889
+ * @license
890
+ * Copyright Google LLC All Rights Reserved.
891
+ *
892
+ * Use of this source code is governed by an MIT-style license that can be
893
+ * found in the LICENSE file at https://angular.io/license
894
+ */
895
+
896
+ /**
897
+ * Injection token that can be used to reference instances of `CdkDragHandle`. It serves as
898
+ * alternative token to the actual `CdkDragHandle` class which could cause unnecessary
899
+ * retention of the class and its directive metadata.
900
+ */
901
+ declare const CDK_DRAG_HANDLE: InjectionToken<CdkDragHandle>;
902
+ /** Handle that can be used to drag a CdkDrag instance. */
903
+ declare class CdkDragHandle implements OnDestroy {
904
+ element: ElementRef<HTMLElement>;
905
+ /** Closest parent draggable instance. */
906
+ _parentDrag: {} | undefined;
907
+ /** Emits when the state of the handle has changed. */
908
+ readonly _stateChanges: Subject<CdkDragHandle>;
909
+ /** Whether starting to drag through this handle is disabled. */
910
+ get disabled(): boolean;
911
+ set disabled(value: BooleanInput);
912
+ private _disabled;
913
+ constructor(element: ElementRef<HTMLElement>, parentDrag?: any);
914
+ ngOnDestroy(): void;
915
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDragHandle, [null, { optional: true; skipSelf: true; }]>;
916
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDragHandle, "[cdkDragHandle]", never, { "disabled": { "alias": "cdkDragHandleDisabled"; "required": false; }; }, {}, never, never, false, never>;
917
+ }
918
+
919
+ /**
920
+ * @license
921
+ * Copyright Google LLC All Rights Reserved.
922
+ *
923
+ * Use of this source code is governed by an MIT-style license that can be
924
+ * found in the LICENSE file at https://angular.io/license
925
+ */
926
+
927
+ /**
928
+ * Injection token that can be used to reference instances of `CdkDragPlaceholder`. It serves as
929
+ * alternative token to the actual `CdkDragPlaceholder` class which could cause unnecessary
930
+ * retention of the class and its directive metadata.
931
+ */
932
+ declare const CDK_DRAG_PLACEHOLDER: InjectionToken<CdkDragPlaceholder<any>>;
933
+ /**
934
+ * Element that will be used as a template for the placeholder of a CdkDrag when
935
+ * it is being dragged. The placeholder is displayed in place of the element being dragged.
936
+ */
937
+ declare class CdkDragPlaceholder<T = any> {
938
+ templateRef: TemplateRef<T>;
939
+ /** Context data to be added to the placeholder template instance. */
940
+ data: T;
941
+ constructor(templateRef: TemplateRef<T>);
942
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDragPlaceholder<any>, never>;
943
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDragPlaceholder<any>, "ng-template[cdkDragPlaceholder]", never, { "data": { "alias": "data"; "required": false; }; }, {}, never, never, false, never>;
944
+ }
945
+
946
+ /**
947
+ * @license
948
+ * Copyright Google LLC All Rights Reserved.
949
+ *
950
+ * Use of this source code is governed by an MIT-style license that can be
951
+ * found in the LICENSE file at https://angular.io/license
952
+ */
953
+
954
+ /**
955
+ * Injection token that can be used to reference instances of `CdkDragPreview`. It serves as
956
+ * alternative token to the actual `CdkDragPreview` class which could cause unnecessary
957
+ * retention of the class and its directive metadata.
958
+ */
959
+ declare const CDK_DRAG_PREVIEW: InjectionToken<CdkDragPreview<any>>;
960
+ /**
961
+ * Element that will be used as a template for the preview
962
+ * of a CdkDrag when it is being dragged.
963
+ */
964
+ declare class CdkDragPreview<T = any> {
965
+ templateRef: TemplateRef<T>;
966
+ /** Context data to be added to the preview template instance. */
967
+ data: T;
968
+ /** Whether the preview should preserve the same size as the item that is being dragged. */
969
+ get matchSize(): boolean;
970
+ set matchSize(value: BooleanInput);
971
+ private _matchSize;
972
+ constructor(templateRef: TemplateRef<T>);
973
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDragPreview<any>, never>;
974
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDragPreview<any>, "ng-template[cdkDragPreview]", never, { "data": { "alias": "data"; "required": false; }; "matchSize": { "alias": "matchSize"; "required": false; }; }, {}, never, never, false, never>;
975
+ }
976
+
977
+ /**
978
+ * @license
979
+ * Copyright Google LLC All Rights Reserved.
980
+ *
981
+ * Use of this source code is governed by an MIT-style license that can be
982
+ * found in the LICENSE file at https://angular.io/license
983
+ */
984
+
985
+ /**
986
+ * Injection token that can be used to reference instances of `CdkDropListGroup`. It serves as
987
+ * alternative token to the actual `CdkDropListGroup` class which could cause unnecessary
988
+ * retention of the class and its directive metadata.
989
+ */
990
+ declare const CDK_DROP_LIST_GROUP: InjectionToken<CdkDropListGroup<unknown>>;
991
+ /**
992
+ * Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`
993
+ * elements that are placed inside a `cdkDropListGroup` will be connected to each other
994
+ * automatically. Can be used as an alternative to the `cdkDropListConnectedTo` input
995
+ * from `cdkDropList`.
996
+ */
997
+ declare class CdkDropListGroup<T> implements OnDestroy {
998
+ /** Drop lists registered inside the group. */
999
+ readonly _items: Set<T>;
1000
+ /** Whether starting a dragging sequence from inside this group is disabled. */
1001
+ get disabled(): boolean;
1002
+ set disabled(value: BooleanInput);
1003
+ private _disabled;
1004
+ ngOnDestroy(): void;
1005
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDropListGroup<any>, never>;
1006
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDropListGroup<any>, "[cdkDropListGroup]", ["cdkDropListGroup"], { "disabled": { "alias": "cdkDropListGroupDisabled"; "required": false; }; }, {}, never, never, false, never>;
1007
+ }
1008
+
1009
+ /**
1010
+ * @license
1011
+ * Copyright Google LLC All Rights Reserved.
1012
+ *
1013
+ * Use of this source code is governed by an MIT-style license that can be
1014
+ * found in the LICENSE file at https://angular.io/license
1015
+ */
1016
+
1017
+ /** Possible values that can be used to configure the drag start delay. */
1018
+ type DragStartDelay = number | {
1019
+ touch: number;
1020
+ mouse: number;
1021
+ };
1022
+ /** Possible axis along which dragging can be locked. */
1023
+ type DragAxis = 'x' | 'y';
1024
+ /** Function that can be used to constrain the position of a dragged element. */
1025
+ type DragConstrainPosition = (point: Point, dragRef: DragRef) => Point;
1026
+ /** Possible orientations for a drop list. */
1027
+ type DropListOrientation = 'horizontal' | 'vertical';
1028
+ /**
1029
+ * Injection token that can be used to configure the
1030
+ * behavior of the drag&drop-related components.
1031
+ */
1032
+ declare const CDK_DRAG_CONFIG: InjectionToken<DragDropConfig>;
1033
+ /**
1034
+ * Object that can be used to configure the drag
1035
+ * items and drop lists within a module or a component.
1036
+ */
1037
+ interface DragDropConfig extends Partial<DragRefConfig> {
1038
+ lockAxis?: DragAxis;
1039
+ dragStartDelay?: DragStartDelay;
1040
+ constrainPosition?: DragConstrainPosition;
1041
+ previewClass?: string | string[];
1042
+ boundaryElement?: string;
1043
+ rootElementSelector?: string;
1044
+ draggingDisabled?: boolean;
1045
+ sortingDisabled?: boolean;
1046
+ listAutoScrollDisabled?: boolean;
1047
+ listOrientation?: DropListOrientation;
1048
+ zIndex?: number;
1049
+ previewContainer?: 'global' | 'parent';
1050
+ }
1051
+
1052
+ /**
1053
+ * @license
1054
+ * Copyright Google LLC All Rights Reserved.
1055
+ *
1056
+ * Use of this source code is governed by an MIT-style license that can be
1057
+ * found in the LICENSE file at https://angular.io/license
1058
+ */
1059
+
1060
+ /**
1061
+ * Internal compile-time-only representation of a `CdkDropList`.
1062
+ * Used to avoid circular import issues between the `CdkDropList` and the `CdkDrag`.
1063
+ * @docs-private
1064
+ */
1065
+ interface CdkDropListInternal extends CdkDropList {
1066
+ }
1067
+ /**
1068
+ * Injection token that can be used to reference instances of `CdkDropList`. It serves as
1069
+ * alternative token to the actual `CdkDropList` class which could cause unnecessary
1070
+ * retention of the class and its directive metadata.
1071
+ */
1072
+ declare const CDK_DROP_LIST: InjectionToken<CdkDropList<any>>;
1073
+ /** Container that wraps a set of draggable items. */
1074
+ declare class CdkDropList<T = any> implements OnDestroy {
1075
+ /** Element that the drop list is attached to. */
1076
+ element: ElementRef<HTMLElement>;
1077
+ private _changeDetectorRef;
1078
+ private _scrollDispatcher;
1079
+ private _dir?;
1080
+ private _group?;
1081
+ /** Emits when the list has been destroyed. */
1082
+ private readonly _destroyed;
1083
+ /** Whether the element's scrollable parents have been resolved. */
1084
+ private _scrollableParentsResolved;
1085
+ /** Keeps track of the drop lists that are currently on the page. */
1086
+ private static _dropLists;
1087
+ /** Reference to the underlying drop list instance. */
1088
+ _dropListRef: DropListRef<CdkDropList<T>>;
1089
+ /**
1090
+ * Other draggable containers that this container is connected to and into which the
1091
+ * container's items can be transferred. Can either be references to other drop containers,
1092
+ * or their unique IDs.
1093
+ */
1094
+ connectedTo: (CdkDropList | string)[] | CdkDropList | string;
1095
+ /** Arbitrary data to attach to this container. */
1096
+ data: T;
1097
+ /** Direction in which the list is oriented. */
1098
+ orientation: DropListOrientation;
1099
+ /**
1100
+ * Unique ID for the drop zone. Can be used as a reference
1101
+ * in the `connectedTo` of another `CdkDropList`.
1102
+ */
1103
+ id: string;
1104
+ /** Locks the position of the draggable elements inside the container along the specified axis. */
1105
+ lockAxis: DragAxis;
1106
+ /** Whether starting a dragging sequence from this container is disabled. */
1107
+ get disabled(): boolean;
1108
+ set disabled(value: BooleanInput);
1109
+ private _disabled;
1110
+ /** Whether sorting within this drop list is disabled. */
1111
+ sortingDisabled: BooleanInput;
1112
+ /**
1113
+ * Function that is used to determine whether an item
1114
+ * is allowed to be moved into a drop container.
1115
+ */
1116
+ enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean;
1117
+ /** Functions that is used to determine whether an item can be sorted into a particular index. */
1118
+ sortPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean;
1119
+ /** Whether to auto-scroll the view when the user moves their pointer close to the edges. */
1120
+ autoScrollDisabled: BooleanInput;
1121
+ /** Number of pixels to scroll for each frame when auto-scrolling an element. */
1122
+ autoScrollStep: NumberInput;
1123
+ /** Emits when the user drops an item inside the container. */
1124
+ readonly dropped: EventEmitter<CdkDragDrop<T, any>>;
1125
+ /**
1126
+ * Emits when the user has moved a new drag item into this container.
1127
+ */
1128
+ readonly entered: EventEmitter<CdkDragEnter<T>>;
1129
+ /**
1130
+ * Emits when the user removes an item from the container
1131
+ * by dragging it into another container.
1132
+ */
1133
+ readonly exited: EventEmitter<CdkDragExit<T>>;
1134
+ /** Emits as the user is swapping items while actively dragging. */
1135
+ readonly sorted: EventEmitter<CdkDragSortEvent<T>>;
1136
+ /**
1137
+ * Keeps track of the items that are registered with this container. Historically we used to
1138
+ * do this with a `ContentChildren` query, however queries don't handle transplanted views very
1139
+ * well which means that we can't handle cases like dragging the headers of a `mat-table`
1140
+ * correctly. What we do instead is to have the items register themselves with the container
1141
+ * and then we sort them based on their position in the DOM.
1142
+ */
1143
+ private _unsortedItems;
1144
+ constructor(
1145
+ /** Element that the drop list is attached to. */
1146
+ element: ElementRef<HTMLElement>, dragDrop: DragDrop, _changeDetectorRef: ChangeDetectorRef, _scrollDispatcher: ScrollDispatcher, _dir?: Directionality | undefined, _group?: CdkDropListGroup<CdkDropList> | undefined, config?: DragDropConfig);
1147
+ /** Registers an items with the drop list. */
1148
+ addItem(item: CdkDrag): void;
1149
+ /** Removes an item from the drop list. */
1150
+ removeItem(item: CdkDrag): void;
1151
+ /** Gets the registered items in the list, sorted by their position in the DOM. */
1152
+ getSortedItems(): CdkDrag[];
1153
+ ngOnDestroy(): void;
1154
+ /** Syncs the inputs of the CdkDropList with the options of the underlying DropListRef. */
1155
+ private _setupInputSyncSubscription;
1156
+ /** Handles events from the underlying DropListRef. */
1157
+ private _handleEvents;
1158
+ /** Assigns the default input values based on a provided config object. */
1159
+ private _assignDefaults;
1160
+ /** Syncs up the registered drag items with underlying drop list ref. */
1161
+ private _syncItemsWithRef;
1162
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDropList<any>, [null, null, null, null, { optional: true; }, { optional: true; skipSelf: true; }, { optional: true; }]>;
1163
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDropList<any>, "[cdkDropList], cdk-drop-list", ["cdkDropList"], { "connectedTo": { "alias": "cdkDropListConnectedTo"; "required": false; }; "data": { "alias": "cdkDropListData"; "required": false; }; "orientation": { "alias": "cdkDropListOrientation"; "required": false; }; "id": { "alias": "id"; "required": false; }; "lockAxis": { "alias": "cdkDropListLockAxis"; "required": false; }; "disabled": { "alias": "cdkDropListDisabled"; "required": false; }; "sortingDisabled": { "alias": "cdkDropListSortingDisabled"; "required": false; }; "enterPredicate": { "alias": "cdkDropListEnterPredicate"; "required": false; }; "sortPredicate": { "alias": "cdkDropListSortPredicate"; "required": false; }; "autoScrollDisabled": { "alias": "cdkDropListAutoScrollDisabled"; "required": false; }; "autoScrollStep": { "alias": "cdkDropListAutoScrollStep"; "required": false; }; }, { "dropped": "cdkDropListDropped"; "entered": "cdkDropListEntered"; "exited": "cdkDropListExited"; "sorted": "cdkDropListSorted"; }, never, never, false, never>;
1164
+ }
1165
+
1166
+ /**
1167
+ * @license
1168
+ * Copyright Google LLC All Rights Reserved.
1169
+ *
1170
+ * Use of this source code is governed by an MIT-style license that can be
1171
+ * found in the LICENSE file at https://angular.io/license
1172
+ */
1173
+
1174
+ /** Element that can be moved inside a CdkDropList container. */
1175
+ declare class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
1176
+ /** Element that the draggable is attached to. */
1177
+ element: ElementRef<HTMLElement>;
1178
+ /** Droppable container that the draggable is a part of. */
1179
+ dropContainer: CdkDropListInternal;
1180
+ private _ngZone;
1181
+ private _viewContainerRef;
1182
+ private _dir;
1183
+ private _changeDetectorRef;
1184
+ private _selfHandle?;
1185
+ private _parentDrag?;
1186
+ private readonly _destroyed;
1187
+ private static _dragInstances;
1188
+ /** Reference to the underlying drag instance. */
1189
+ _dragRef: DragRef<CdkDrag<T>>;
1190
+ /** Elements that can be used to drag the draggable item. */
1191
+ _handles: QueryList<CdkDragHandle>;
1192
+ /** Element that will be used as a template to create the draggable item's preview. */
1193
+ _previewTemplate: CdkDragPreview;
1194
+ /** Template for placeholder element rendered to show where a draggable would be dropped. */
1195
+ _placeholderTemplate: CdkDragPlaceholder;
1196
+ /** Arbitrary data to attach to this drag instance. */
1197
+ data: T;
1198
+ /** Locks the position of the dragged element along the specified axis. */
1199
+ lockAxis: DragAxis;
1200
+ /**
1201
+ * Selector that will be used to determine the root draggable element, starting from
1202
+ * the `cdkDrag` element and going up the DOM. Passing an alternate root element is useful
1203
+ * when trying to enable dragging on an element that you might not have access to.
1204
+ */
1205
+ rootElementSelector: string;
1206
+ /**
1207
+ * Node or selector that will be used to determine the element to which the draggable's
1208
+ * position will be constrained. If a string is passed in, it'll be used as a selector that
1209
+ * will be matched starting from the element's parent and going up the DOM until a match
1210
+ * has been found.
1211
+ */
1212
+ boundaryElement: string | ElementRef<HTMLElement> | HTMLElement;
1213
+ /**
1214
+ * Amount of milliseconds to wait after the user has put their
1215
+ * pointer down before starting to drag the element.
1216
+ */
1217
+ dragStartDelay: DragStartDelay;
1218
+ /**
1219
+ * Sets the position of a `CdkDrag` that is outside of a drop container.
1220
+ * Can be used to restore the element's position for a returning user.
1221
+ */
1222
+ freeDragPosition: {
1223
+ x: number;
1224
+ y: number;
1225
+ };
1226
+ /** Whether starting to drag this element is disabled. */
1227
+ get disabled(): boolean;
1228
+ set disabled(value: BooleanInput);
1229
+ private _disabled;
1230
+ /**
1231
+ * Function that can be used to customize the logic of how the position of the drag item
1232
+ * is limited while it's being dragged. Gets called with a point containing the current position
1233
+ * of the user's pointer on the page and should return a point describing where the item should
1234
+ * be rendered.
1235
+ */
1236
+ constrainPosition?: (point: Point, dragRef: DragRef) => Point;
1237
+ /** Class to be added to the preview element. */
1238
+ previewClass: string | string[];
1239
+ /**
1240
+ * Configures the place into which the preview of the item will be inserted. Can be configured
1241
+ * globally through `CDK_DROP_LIST`. Possible values:
1242
+ * - `global` - Preview will be inserted at the bottom of the `<body>`. The advantage is that
1243
+ * you don't have to worry about `overflow: hidden` or `z-index`, but the item won't retain
1244
+ * its inherited styles.
1245
+ * - `parent` - Preview will be inserted into the parent of the drag item. The advantage is that
1246
+ * inherited styles will be preserved, but it may be clipped by `overflow: hidden` or not be
1247
+ * visible due to `z-index`. Furthermore, the preview is going to have an effect over selectors
1248
+ * like `:nth-child` and some flexbox configurations.
1249
+ * - `ElementRef<HTMLElement> | HTMLElement` - Preview will be inserted into a specific element.
1250
+ * Same advantages and disadvantages as `parent`.
1251
+ */
1252
+ previewContainer: PreviewContainer;
1253
+ /** Emits when the user starts dragging the item. */
1254
+ readonly started: EventEmitter<CdkDragStart>;
1255
+ /** Emits when the user has released a drag item, before any animations have started. */
1256
+ readonly released: EventEmitter<CdkDragRelease>;
1257
+ /** Emits when the user stops dragging an item in the container. */
1258
+ readonly ended: EventEmitter<CdkDragEnd>;
1259
+ /** Emits when the user has moved the item into a new container. */
1260
+ readonly entered: EventEmitter<CdkDragEnter<any>>;
1261
+ /** Emits when the user removes the item its container by dragging it into another container. */
1262
+ readonly exited: EventEmitter<CdkDragExit<any>>;
1263
+ /** Emits when the user drops the item inside a container. */
1264
+ readonly dropped: EventEmitter<CdkDragDrop<any>>;
1265
+ /**
1266
+ * Emits as the user is dragging the item. Use with caution,
1267
+ * because this event will fire for every pixel that the user has dragged.
1268
+ */
1269
+ readonly moved: Observable<CdkDragMove<T>>;
1270
+ constructor(
1271
+ /** Element that the draggable is attached to. */
1272
+ element: ElementRef<HTMLElement>,
1273
+ /** Droppable container that the draggable is a part of. */
1274
+ dropContainer: CdkDropListInternal,
1275
+ /**
1276
+ * @deprecated `_document` parameter no longer being used and will be removed.
1277
+ * @breaking-change 12.0.0
1278
+ */
1279
+ _document: any, _ngZone: NgZone, _viewContainerRef: ViewContainerRef, config: DragDropConfig, _dir: Directionality, dragDrop: DragDrop, _changeDetectorRef: ChangeDetectorRef, _selfHandle?: CdkDragHandle | undefined, _parentDrag?: CdkDrag | undefined);
1280
+ /**
1281
+ * Returns the element that is being used as a placeholder
1282
+ * while the current element is being dragged.
1283
+ */
1284
+ getPlaceholderElement(): HTMLElement;
1285
+ /** Returns the root draggable element. */
1286
+ getRootElement(): HTMLElement;
1287
+ /** Resets a standalone drag item to its initial position. */
1288
+ reset(): void;
1289
+ /**
1290
+ * Gets the pixel coordinates of the draggable outside of a drop container.
1291
+ */
1292
+ getFreeDragPosition(): {
1293
+ readonly x: number;
1294
+ readonly y: number;
1295
+ };
1296
+ ngAfterViewInit(): void;
1297
+ ngOnChanges(changes: SimpleChanges): void;
1298
+ ngOnDestroy(): void;
1299
+ /** Syncs the root element with the `DragRef`. */
1300
+ private _updateRootElement;
1301
+ /** Gets the boundary element, based on the `boundaryElement` value. */
1302
+ private _getBoundaryElement;
1303
+ /** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */
1304
+ private _syncInputs;
1305
+ /** Handles the events from the underlying `DragRef`. */
1306
+ private _handleEvents;
1307
+ /** Assigns the default input values based on a provided config object. */
1308
+ private _assignDefaults;
1309
+ /** Sets up the listener that syncs the handles with the drag ref. */
1310
+ private _setupHandlesListener;
1311
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkDrag<any>, [null, { optional: true; skipSelf: true; }, null, null, null, { optional: true; }, { optional: true; }, null, null, { optional: true; self: true; }, { optional: true; skipSelf: true; }]>;
1312
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkDrag<any>, "[cdkDrag]", ["cdkDrag"], { "data": { "alias": "cdkDragData"; "required": false; }; "lockAxis": { "alias": "cdkDragLockAxis"; "required": false; }; "rootElementSelector": { "alias": "cdkDragRootElement"; "required": false; }; "boundaryElement": { "alias": "cdkDragBoundary"; "required": false; }; "dragStartDelay": { "alias": "cdkDragStartDelay"; "required": false; }; "freeDragPosition": { "alias": "cdkDragFreeDragPosition"; "required": false; }; "disabled": { "alias": "cdkDragDisabled"; "required": false; }; "constrainPosition": { "alias": "cdkDragConstrainPosition"; "required": false; }; "previewClass": { "alias": "cdkDragPreviewClass"; "required": false; }; "previewContainer": { "alias": "cdkDragPreviewContainer"; "required": false; }; }, { "started": "cdkDragStarted"; "released": "cdkDragReleased"; "ended": "cdkDragEnded"; "entered": "cdkDragEntered"; "exited": "cdkDragExited"; "dropped": "cdkDragDropped"; "moved": "cdkDragMoved"; }, ["_previewTemplate", "_placeholderTemplate", "_handles"], never, false, never>;
1313
+ }
1314
+
1315
+ /**
1316
+ * @license
1317
+ * Copyright Google LLC All Rights Reserved.
1318
+ *
1319
+ * Use of this source code is governed by an MIT-style license that can be
1320
+ * found in the LICENSE file at https://angular.io/license
1321
+ */
1322
+
1323
+ /** Event emitted when the user starts dragging a draggable. */
1324
+ interface CdkDragStart<T = any> {
1325
+ /** Draggable that emitted the event. */
1326
+ source: CdkDrag<T>;
1327
+ }
1328
+ /** Event emitted when the user releases an item, before any animations have started. */
1329
+ interface CdkDragRelease<T = any> {
1330
+ /** Draggable that emitted the event. */
1331
+ source: CdkDrag<T>;
1332
+ }
1333
+ /** Event emitted when the user stops dragging a draggable. */
1334
+ interface CdkDragEnd<T = any> {
1335
+ /** Draggable that emitted the event. */
1336
+ source: CdkDrag<T>;
1337
+ /** Distance in pixels that the user has dragged since the drag sequence started. */
1338
+ distance: {
1339
+ x: number;
1340
+ y: number;
1341
+ };
1342
+ /** Position where the pointer was when the item was dropped */
1343
+ dropPoint: {
1344
+ x: number;
1345
+ y: number;
1346
+ };
1347
+ }
1348
+ /** Event emitted when the user moves an item into a new drop container. */
1349
+ interface CdkDragEnter<T = any, I = T> {
1350
+ /** Container into which the user has moved the item. */
1351
+ container: CdkDropList<T>;
1352
+ /** Item that was moved into the container. */
1353
+ item: CdkDrag<I>;
1354
+ /** Index at which the item has entered the container. */
1355
+ currentIndex: number;
1356
+ }
1357
+ /**
1358
+ * Event emitted when the user removes an item from a
1359
+ * drop container by moving it into another one.
1360
+ */
1361
+ interface CdkDragExit<T = any, I = T> {
1362
+ /** Container from which the user has a removed an item. */
1363
+ container: CdkDropList<T>;
1364
+ /** Item that was removed from the container. */
1365
+ item: CdkDrag<I>;
1366
+ }
1367
+ /** Event emitted when the user drops a draggable item inside a drop container. */
1368
+ interface CdkDragDrop<T, O = T, I = any> {
1369
+ /** Index of the item when it was picked up. */
1370
+ previousIndex: number;
1371
+ /** Current index of the item. */
1372
+ currentIndex: number;
1373
+ /** Item that is being dropped. */
1374
+ item: CdkDrag<I>;
1375
+ /** Container in which the item was dropped. */
1376
+ container: CdkDropList<T>;
1377
+ /** Container from which the item was picked up. Can be the same as the `container`. */
1378
+ previousContainer: CdkDropList<O>;
1379
+ /** Whether the user's pointer was over the container when the item was dropped. */
1380
+ isPointerOverContainer: boolean;
1381
+ /** Distance in pixels that the user has dragged since the drag sequence started. */
1382
+ distance: {
1383
+ x: number;
1384
+ y: number;
1385
+ };
1386
+ /** Position where the pointer was when the item was dropped */
1387
+ dropPoint: {
1388
+ x: number;
1389
+ y: number;
1390
+ };
1391
+ }
1392
+ /** Event emitted as the user is dragging a draggable item. */
1393
+ interface CdkDragMove<T = any> {
1394
+ /** Item that is being dragged. */
1395
+ source: CdkDrag<T>;
1396
+ /** Position of the user's pointer on the page. */
1397
+ pointerPosition: {
1398
+ x: number;
1399
+ y: number;
1400
+ };
1401
+ /** Native event that is causing the dragging. */
1402
+ event: MouseEvent | TouchEvent;
1403
+ /** Distance in pixels that the user has dragged since the drag sequence started. */
1404
+ distance: {
1405
+ x: number;
1406
+ y: number;
1407
+ };
1408
+ /**
1409
+ * Indicates the direction in which the user is dragging the element along each axis.
1410
+ * `1` means that the position is increasing (e.g. the user is moving to the right or downwards),
1411
+ * whereas `-1` means that it's decreasing (they're moving to the left or upwards). `0` means
1412
+ * that the position hasn't changed.
1413
+ */
1414
+ delta: {
1415
+ x: -1 | 0 | 1;
1416
+ y: -1 | 0 | 1;
1417
+ };
1418
+ }
1419
+ /** Event emitted when the user swaps the position of two drag items. */
1420
+ interface CdkDragSortEvent<T = any, I = T> {
1421
+ /** Index from which the item was sorted previously. */
1422
+ previousIndex: number;
1423
+ /** Index that the item is currently in. */
1424
+ currentIndex: number;
1425
+ /** Container that the item belongs to. */
1426
+ container: CdkDropList<T>;
1427
+ /** Item that is being sorted. */
1428
+ item: CdkDrag<I>;
1429
+ }
1430
+
1431
+ /**
1432
+ * @license
1433
+ * Copyright Google LLC All Rights Reserved.
1434
+ *
1435
+ * Use of this source code is governed by an MIT-style license that can be
1436
+ * found in the LICENSE file at https://angular.io/license
1437
+ */
1438
+ /**
1439
+ * Moves an item one index in an array to another.
1440
+ * @param array Array in which to move the item.
1441
+ * @param fromIndex Starting index of the item.
1442
+ * @param toIndex Index to which the item should be moved.
1443
+ */
1444
+ declare function moveItemInArray<T = any>(array: T[], fromIndex: number, toIndex: number): void;
1445
+ /**
1446
+ * Moves an item from one array to another.
1447
+ * @param currentArray Array from which to transfer the item.
1448
+ * @param targetArray Array into which to put the item.
1449
+ * @param currentIndex Index of the item in its current array.
1450
+ * @param targetIndex Index at which to insert the item.
1451
+ */
1452
+ declare function transferArrayItem<T = any>(currentArray: T[], targetArray: T[], currentIndex: number, targetIndex: number): void;
1453
+ /**
1454
+ * Copies an item from one array to another, leaving it in its
1455
+ * original position in current array.
1456
+ * @param currentArray Array from which to copy the item.
1457
+ * @param targetArray Array into which is copy the item.
1458
+ * @param currentIndex Index of the item in its current array.
1459
+ * @param targetIndex Index at which to insert the item.
1460
+ *
1461
+ */
1462
+ declare function copyArrayItem<T = any>(currentArray: T[], targetArray: T[], currentIndex: number, targetIndex: number): void;
1463
+
1464
+ declare class DragDropModule {
1465
+ static ɵfac: i0.ɵɵFactoryDeclaration<DragDropModule, never>;
1466
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DragDropModule, [typeof CdkDropList, typeof CdkDropListGroup, typeof CdkDrag, typeof CdkDragHandle, typeof CdkDragPreview, typeof CdkDragPlaceholder], never, [typeof i7.CdkScrollableModule, typeof CdkDropList, typeof CdkDropListGroup, typeof CdkDrag, typeof CdkDragHandle, typeof CdkDragPreview, typeof CdkDragPlaceholder]>;
1467
+ static ɵinj: i0.ɵɵInjectorDeclaration<DragDropModule>;
1468
+ }
1469
+
1470
+ export { CDK_DRAG_CONFIG, CDK_DRAG_HANDLE, CDK_DRAG_PARENT, CDK_DRAG_PLACEHOLDER, CDK_DRAG_PREVIEW, CDK_DROP_LIST, CDK_DROP_LIST_GROUP, CdkDrag, CdkDragHandle, CdkDragPlaceholder, CdkDragPreview, CdkDropList, CdkDropListGroup, DragDrop, DragDropModule, DragDropRegistry, DragRef, DropListRef, copyArrayItem, moveItemInArray, transferArrayItem };
1471
+ export type { CdkDragDrop, CdkDragEnd, CdkDragEnter, CdkDragExit, CdkDragMove, CdkDragRelease, CdkDragSortEvent, CdkDragStart, DragAxis, DragConstrainPosition, DragDropConfig, DragRefConfig, DragStartDelay, DropListOrientation, Point, PreviewContainer };