@angular/cdk 8.0.0-beta.2 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/_overlay.scss +4 -4
- package/bundles/cdk-a11y.umd.js +227 -79
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +20 -8
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +5 -5
- package/bundles/cdk-bidi.umd.min.js +1 -1
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +5 -5
- package/bundles/cdk-collections.umd.js +38 -15
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +571 -180
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js +7 -3
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +83 -30
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +30 -11
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +229 -108
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +17 -10
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +32 -13
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +184 -62
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +30 -12
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +384 -74
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +61 -21
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +85 -29
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +2 -2
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/typings/directives/drag.d.ts +11 -2
- package/drag-drop/typings/drag-events.d.ts +17 -0
- package/drag-drop/typings/drag-ref.d.ts +9 -5
- package/drag-drop/typings/drop-list-ref.d.ts +9 -3
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +229 -81
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +22 -10
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/bidi.js +8 -8
- package/esm2015/cdk.js +4 -4
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +7 -7
- package/esm2015/collections.js +41 -18
- package/esm2015/collections.js.map +1 -1
- package/esm2015/drag-drop.js +540 -181
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/keycodes.js +9 -5
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +89 -36
- package/esm2015/layout.js.map +1 -1
- package/esm2015/observers.js +33 -14
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +232 -110
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +20 -13
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +34 -15
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +180 -58
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +32 -14
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +369 -69
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +64 -24
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js +86 -30
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +230 -82
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +22 -10
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/bidi.es5.js +8 -8
- package/esm5/cdk.es5.js +4 -4
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +7 -7
- package/esm5/collections.es5.js +42 -19
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +574 -183
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +9 -5
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +86 -33
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/observers.es5.js +33 -14
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +232 -111
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +20 -13
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +34 -15
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +187 -65
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +32 -14
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +386 -72
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +64 -24
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js +87 -31
- package/esm5/tree.es5.js.map +1 -1
- package/layout/typings/breakpoints-observer.d.ts +3 -3
- package/layout/typings/index.metadata.json +1 -1
- package/layout/typings/media-matcher.d.ts +2 -2
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/position/flexible-connected-position-strategy.d.ts +1 -3
- package/package.json +8 -8
- package/portal/typings/portal.d.ts +2 -2
- package/schematics/ng-update/data/attribute-selectors.js +1 -1
- package/schematics/ng-update/data/attribute-selectors.js.map +1 -1
- package/schematics/ng-update/data/class-names.js +3 -3
- package/schematics/ng-update/data/class-names.js.map +1 -1
- package/schematics/ng-update/data/constructor-checks.js +1 -1
- package/schematics/ng-update/data/constructor-checks.js.map +1 -1
- package/schematics/ng-update/data/input-names.js +1 -1
- package/schematics/ng-update/data/input-names.js.map +1 -1
- package/schematics/ng-update/data/method-call-checks.js +1 -1
- package/schematics/ng-update/data/method-call-checks.js.map +1 -1
- package/schematics/ng-update/data/property-names.js +4 -4
- package/schematics/ng-update/data/property-names.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js.map +1 -1
- package/schematics/tsconfig.tsbuildinfo +5811 -0
- package/schematics/utils/ast.d.ts +1 -1
- package/schematics/utils/build-component.js +1 -1
- package/schematics/utils/build-component.js.map +1 -1
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/project-main-file.d.ts +1 -1
- package/schematics/utils/project-style-file.d.ts +1 -1
- package/schematics/utils/project-targets.d.ts +1 -1
- package/schematics/utils/schematic-options.d.ts +1 -1
- package/table/typings/cell.d.ts +3 -2
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/public-api.d.ts +1 -0
- package/table/typings/row.d.ts +5 -4
- package/table/typings/sticky-styler.d.ts +5 -5
- package/table/typings/table-errors.d.ts +10 -0
- package/table/typings/text-column.d.ts +80 -0
- package/typings/drag-drop/directives/drag.d.ts +11 -2
- package/typings/drag-drop/drag-events.d.ts +17 -0
- package/typings/drag-drop/drag-ref.d.ts +9 -5
- package/typings/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/directives/drag.d.ts +11 -2
- package/typings/esm5/drag-drop/drag-events.d.ts +17 -0
- package/typings/esm5/drag-drop/drag-ref.d.ts +9 -5
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/layout/breakpoints-observer.d.ts +3 -3
- package/typings/esm5/layout/index.metadata.json +1 -1
- package/typings/esm5/layout/media-matcher.d.ts +2 -2
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/esm5/portal/portal.d.ts +2 -2
- package/typings/esm5/table/cell.d.ts +3 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/public-api.d.ts +1 -0
- package/typings/esm5/table/row.d.ts +5 -4
- package/typings/esm5/table/sticky-styler.d.ts +5 -5
- package/typings/esm5/table/table-errors.d.ts +10 -0
- package/typings/esm5/table/text-column.d.ts +80 -0
- package/typings/index.metadata.json +1 -1
- package/typings/layout/breakpoints-observer.d.ts +3 -3
- package/typings/layout/index.metadata.json +1 -1
- package/typings/layout/media-matcher.d.ts +2 -2
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/portal/portal.d.ts +2 -2
- package/typings/schematics/utils/ast.d.ts +1 -1
- package/typings/schematics/utils/get-project.d.ts +1 -1
- package/typings/schematics/utils/project-main-file.d.ts +1 -1
- package/typings/schematics/utils/project-style-file.d.ts +1 -1
- package/typings/schematics/utils/project-targets.d.ts +1 -1
- package/typings/schematics/utils/schematic-options.d.ts +1 -1
- package/typings/table/cell.d.ts +3 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/public-api.d.ts +1 -0
- package/typings/table/row.d.ts +5 -4
- package/typings/table/sticky-styler.d.ts +5 -5
- package/typings/table/table-errors.d.ts +10 -0
- package/typings/table/text-column.d.ts +80 -0
package/esm5/drag-drop.es5.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
9
9
|
import { coerceBooleanProperty, coerceElement, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';
|
|
10
10
|
import { Subscription, Subject, Observable, merge } from 'rxjs';
|
|
11
|
-
import { ElementRef, Injectable, NgZone, Inject, InjectionToken, NgModule, ContentChildren, EventEmitter, forwardRef, Input, Output, Optional, Directive, ChangeDetectorRef, SkipSelf, ContentChild, ViewContainerRef, TemplateRef,
|
|
11
|
+
import { ElementRef, Injectable, NgZone, Inject, InjectionToken, NgModule, ContentChildren, EventEmitter, forwardRef, Input, Output, Optional, Directive, ChangeDetectorRef, SkipSelf, ContentChild, ViewContainerRef, isDevMode, TemplateRef, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
|
|
12
12
|
import { DOCUMENT } from '@angular/common';
|
|
13
13
|
import { ViewportRuler } from '@angular/cdk/scrolling';
|
|
14
14
|
import { Directionality } from '@angular/cdk/bidi';
|
|
@@ -16,7 +16,7 @@ import { startWith, take, map, takeUntil, switchMap, tap } from 'rxjs/operators'
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview added by tsickle
|
|
19
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
19
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
20
20
|
*/
|
|
21
21
|
/**
|
|
22
22
|
* Shallow-extends a stylesheet object with another stylesheet object.
|
|
@@ -56,7 +56,7 @@ function toggleNativeDragInteractions(element, enable) {
|
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* @fileoverview added by tsickle
|
|
59
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
59
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -81,7 +81,11 @@ function getTransformTransitionDurationInMs(element) {
|
|
|
81
81
|
/** @type {?} */
|
|
82
82
|
var transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');
|
|
83
83
|
/** @type {?} */
|
|
84
|
-
var property = transitionedProperties.find(
|
|
84
|
+
var property = transitionedProperties.find((/**
|
|
85
|
+
* @param {?} prop
|
|
86
|
+
* @return {?}
|
|
87
|
+
*/
|
|
88
|
+
function (prop) { return prop === 'transform' || prop === 'all'; }));
|
|
85
89
|
// If there's no transition for `all` or `transform`, we shouldn't do anything.
|
|
86
90
|
if (!property) {
|
|
87
91
|
return 0;
|
|
@@ -106,12 +110,16 @@ function getTransformTransitionDurationInMs(element) {
|
|
|
106
110
|
function parseCssPropertyValue(computedStyle, name) {
|
|
107
111
|
/** @type {?} */
|
|
108
112
|
var value = computedStyle.getPropertyValue(name);
|
|
109
|
-
return value.split(',').map(
|
|
113
|
+
return value.split(',').map((/**
|
|
114
|
+
* @param {?} part
|
|
115
|
+
* @return {?}
|
|
116
|
+
*/
|
|
117
|
+
function (part) { return part.trim(); }));
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
/**
|
|
113
121
|
* @fileoverview added by tsickle
|
|
114
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
122
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
115
123
|
*/
|
|
116
124
|
/**
|
|
117
125
|
* Options that can be used to bind a passive event listener.
|
|
@@ -164,11 +172,6 @@ DragRef = /** @class */ (function () {
|
|
|
164
172
|
* Emits when the item is being moved.
|
|
165
173
|
*/
|
|
166
174
|
this._moveEvents = new Subject();
|
|
167
|
-
/**
|
|
168
|
-
* Amount of subscriptions to the move event. Used to avoid
|
|
169
|
-
* hitting the zone if the consumer didn't subscribe to it.
|
|
170
|
-
*/
|
|
171
|
-
this._moveEventSubscriptions = 0;
|
|
172
175
|
/**
|
|
173
176
|
* Subscription to pointer movement events.
|
|
174
177
|
*/
|
|
@@ -235,28 +238,28 @@ DragRef = /** @class */ (function () {
|
|
|
235
238
|
* Emits as the user is dragging the item. Use with caution,
|
|
236
239
|
* because this event will fire for every pixel that the user has dragged.
|
|
237
240
|
*/
|
|
238
|
-
this.moved =
|
|
239
|
-
/** @type {?} */
|
|
240
|
-
var subscription = _this._moveEvents.subscribe(observer);
|
|
241
|
-
_this._moveEventSubscriptions++;
|
|
242
|
-
return function () {
|
|
243
|
-
subscription.unsubscribe();
|
|
244
|
-
_this._moveEventSubscriptions--;
|
|
245
|
-
};
|
|
246
|
-
});
|
|
241
|
+
this.moved = this._moveEvents.asObservable();
|
|
247
242
|
/**
|
|
248
243
|
* Handler for the `mousedown`/`touchstart` events.
|
|
249
244
|
*/
|
|
250
|
-
this._pointerDown =
|
|
245
|
+
this._pointerDown = (/**
|
|
246
|
+
* @param {?} event
|
|
247
|
+
* @return {?}
|
|
248
|
+
*/
|
|
249
|
+
function (event) {
|
|
251
250
|
_this.beforeStarted.next();
|
|
252
251
|
// Delegate the event based on whether it started from a handle or the element itself.
|
|
253
252
|
if (_this._handles.length) {
|
|
254
253
|
/** @type {?} */
|
|
255
|
-
var targetHandle = _this._handles.find(
|
|
254
|
+
var targetHandle = _this._handles.find((/**
|
|
255
|
+
* @param {?} handle
|
|
256
|
+
* @return {?}
|
|
257
|
+
*/
|
|
258
|
+
function (handle) {
|
|
256
259
|
/** @type {?} */
|
|
257
260
|
var target = event.target;
|
|
258
261
|
return !!target && (target === handle || handle.contains((/** @type {?} */ (target))));
|
|
259
|
-
});
|
|
262
|
+
}));
|
|
260
263
|
if (targetHandle && !_this._disabledHandles.has(targetHandle) && !_this.disabled) {
|
|
261
264
|
_this._initializeDragSequence(targetHandle, event);
|
|
262
265
|
}
|
|
@@ -264,11 +267,15 @@ DragRef = /** @class */ (function () {
|
|
|
264
267
|
else if (!_this.disabled) {
|
|
265
268
|
_this._initializeDragSequence(_this._rootElement, event);
|
|
266
269
|
}
|
|
267
|
-
};
|
|
270
|
+
});
|
|
268
271
|
/**
|
|
269
272
|
* Handler that is invoked when the user moves their pointer after they've initiated a drag.
|
|
270
273
|
*/
|
|
271
|
-
this._pointerMove =
|
|
274
|
+
this._pointerMove = (/**
|
|
275
|
+
* @param {?} event
|
|
276
|
+
* @return {?}
|
|
277
|
+
*/
|
|
278
|
+
function (event) {
|
|
272
279
|
if (!_this._hasStartedDragging) {
|
|
273
280
|
/** @type {?} */
|
|
274
281
|
var pointerPosition = _this._getPointerPositionOnPage(event);
|
|
@@ -284,7 +291,10 @@ DragRef = /** @class */ (function () {
|
|
|
284
291
|
// per pixel of movement (e.g. if the user moves their pointer quickly).
|
|
285
292
|
if (isOverThreshold && (Date.now() >= _this._dragStartTime + (_this.dragStartDelay || 0))) {
|
|
286
293
|
_this._hasStartedDragging = true;
|
|
287
|
-
_this._ngZone.run(
|
|
294
|
+
_this._ngZone.run((/**
|
|
295
|
+
* @return {?}
|
|
296
|
+
*/
|
|
297
|
+
function () { return _this._startDragSequence(event); }));
|
|
288
298
|
}
|
|
289
299
|
return;
|
|
290
300
|
}
|
|
@@ -322,21 +332,29 @@ DragRef = /** @class */ (function () {
|
|
|
322
332
|
// Since this event gets fired for every pixel while dragging, we only
|
|
323
333
|
// want to fire it if the consumer opted into it. Also we have to
|
|
324
334
|
// re-enter the zone because we run all of the events on the outside.
|
|
325
|
-
if (_this.
|
|
326
|
-
_this._ngZone.run(
|
|
335
|
+
if (_this._moveEvents.observers.length) {
|
|
336
|
+
_this._ngZone.run((/**
|
|
337
|
+
* @return {?}
|
|
338
|
+
*/
|
|
339
|
+
function () {
|
|
327
340
|
_this._moveEvents.next({
|
|
328
341
|
source: _this,
|
|
329
342
|
pointerPosition: constrainedPointerPosition,
|
|
330
343
|
event: event,
|
|
344
|
+
distance: _this._getDragDistance(constrainedPointerPosition),
|
|
331
345
|
delta: _this._pointerDirectionDelta
|
|
332
346
|
});
|
|
333
|
-
});
|
|
347
|
+
}));
|
|
334
348
|
}
|
|
335
|
-
};
|
|
349
|
+
});
|
|
336
350
|
/**
|
|
337
351
|
* Handler that is invoked when the user lifts their pointer up, after initiating a drag.
|
|
338
352
|
*/
|
|
339
|
-
this._pointerUp =
|
|
353
|
+
this._pointerUp = (/**
|
|
354
|
+
* @param {?} event
|
|
355
|
+
* @return {?}
|
|
356
|
+
*/
|
|
357
|
+
function (event) {
|
|
340
358
|
// Note that here we use `isDragging` from the service, rather than from `this`.
|
|
341
359
|
// The difference is that the one from the service reflects whether a dragging sequence
|
|
342
360
|
// has been initiated, whereas the one on `this` includes whether the user has passed
|
|
@@ -359,15 +377,26 @@ DragRef = /** @class */ (function () {
|
|
|
359
377
|
// to the new passive transform.
|
|
360
378
|
_this._passiveTransform.x = _this._activeTransform.x;
|
|
361
379
|
_this._passiveTransform.y = _this._activeTransform.y;
|
|
362
|
-
_this._ngZone.run(
|
|
380
|
+
_this._ngZone.run((/**
|
|
381
|
+
* @return {?}
|
|
382
|
+
*/
|
|
383
|
+
function () {
|
|
384
|
+
_this.ended.next({
|
|
385
|
+
source: _this,
|
|
386
|
+
distance: _this._getDragDistance(_this._getPointerPositionOnPage(event))
|
|
387
|
+
});
|
|
388
|
+
}));
|
|
363
389
|
_this._dragDropRegistry.stopDragging(_this);
|
|
364
390
|
return;
|
|
365
391
|
}
|
|
366
|
-
_this._animatePreviewToPlaceholder().then(
|
|
392
|
+
_this._animatePreviewToPlaceholder().then((/**
|
|
393
|
+
* @return {?}
|
|
394
|
+
*/
|
|
395
|
+
function () {
|
|
367
396
|
_this._cleanupDragArtifacts(event);
|
|
368
397
|
_this._dragDropRegistry.stopDragging(_this);
|
|
369
|
-
});
|
|
370
|
-
};
|
|
398
|
+
}));
|
|
399
|
+
});
|
|
371
400
|
this.withRootElement(element);
|
|
372
401
|
_dragDropRegistry.registerDragItem(this);
|
|
373
402
|
}
|
|
@@ -440,8 +469,16 @@ DragRef = /** @class */ (function () {
|
|
|
440
469
|
* @return {THIS}
|
|
441
470
|
*/
|
|
442
471
|
function (handles) {
|
|
443
|
-
(/** @type {?} */ (this))._handles = handles.map(
|
|
444
|
-
|
|
472
|
+
(/** @type {?} */ (this))._handles = handles.map((/**
|
|
473
|
+
* @param {?} handle
|
|
474
|
+
* @return {?}
|
|
475
|
+
*/
|
|
476
|
+
function (handle) { return coerceElement(handle); }));
|
|
477
|
+
(/** @type {?} */ (this))._handles.forEach((/**
|
|
478
|
+
* @param {?} handle
|
|
479
|
+
* @return {?}
|
|
480
|
+
*/
|
|
481
|
+
function (handle) { return toggleNativeDragInteractions(handle, false); }));
|
|
445
482
|
(/** @type {?} */ (this))._toggleNativeDragInteractions();
|
|
446
483
|
return (/** @type {?} */ (this));
|
|
447
484
|
};
|
|
@@ -915,32 +952,39 @@ DragRef = /** @class */ (function () {
|
|
|
915
952
|
(/** @type {?} */ (this._nextSibling.parentNode)).insertBefore(this._rootElement, this._nextSibling);
|
|
916
953
|
}
|
|
917
954
|
else {
|
|
918
|
-
this._initialContainer.element.appendChild(this._rootElement);
|
|
955
|
+
coerceElement(this._initialContainer.element).appendChild(this._rootElement);
|
|
919
956
|
}
|
|
920
957
|
this._destroyPreview();
|
|
921
958
|
this._destroyPlaceholder();
|
|
922
959
|
this._boundaryRect = this._previewRect = undefined;
|
|
923
960
|
// Re-enter the NgZone since we bound `document` events on the outside.
|
|
924
|
-
this._ngZone.run(
|
|
961
|
+
this._ngZone.run((/**
|
|
962
|
+
* @return {?}
|
|
963
|
+
*/
|
|
964
|
+
function () {
|
|
925
965
|
/** @type {?} */
|
|
926
966
|
var container = (/** @type {?} */ (_this._dropContainer));
|
|
927
967
|
/** @type {?} */
|
|
928
968
|
var currentIndex = container.getItemIndex(_this);
|
|
929
|
-
var _a = _this._getPointerPositionOnPage(event), x = _a.x, y = _a.y;
|
|
930
969
|
/** @type {?} */
|
|
931
|
-
var
|
|
932
|
-
|
|
970
|
+
var pointerPosition = _this._getPointerPositionOnPage(event);
|
|
971
|
+
/** @type {?} */
|
|
972
|
+
var distance = _this._getDragDistance(_this._getPointerPositionOnPage(event));
|
|
973
|
+
/** @type {?} */
|
|
974
|
+
var isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y);
|
|
975
|
+
_this.ended.next({ source: _this, distance: distance });
|
|
933
976
|
_this.dropped.next({
|
|
934
977
|
item: _this,
|
|
935
978
|
currentIndex: currentIndex,
|
|
936
979
|
previousIndex: _this._initialContainer.getItemIndex(_this),
|
|
937
980
|
container: container,
|
|
938
981
|
previousContainer: _this._initialContainer,
|
|
939
|
-
isPointerOverContainer: isPointerOverContainer
|
|
982
|
+
isPointerOverContainer: isPointerOverContainer,
|
|
983
|
+
distance: distance
|
|
940
984
|
});
|
|
941
|
-
container.drop(_this, currentIndex, _this._initialContainer, isPointerOverContainer);
|
|
985
|
+
container.drop(_this, currentIndex, _this._initialContainer, isPointerOverContainer, distance);
|
|
942
986
|
_this._dropContainer = _this._initialContainer;
|
|
943
|
-
});
|
|
987
|
+
}));
|
|
944
988
|
};
|
|
945
989
|
/**
|
|
946
990
|
* Updates the item's position in its drop container, or moves it
|
|
@@ -965,8 +1009,7 @@ DragRef = /** @class */ (function () {
|
|
|
965
1009
|
var x = _a.x, y = _a.y;
|
|
966
1010
|
// Drop container that draggable has been moved into.
|
|
967
1011
|
/** @type {?} */
|
|
968
|
-
var newContainer =
|
|
969
|
-
this._initialContainer._getSiblingContainerFromPosition(this, x, y);
|
|
1012
|
+
var newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y);
|
|
970
1013
|
// If we couldn't find a new container to move the item into, and the item has left it's
|
|
971
1014
|
// initial container, check whether the it's over the initial container. This handles the
|
|
972
1015
|
// case where two containers are connected one way and the user tries to undo dragging an
|
|
@@ -976,15 +1019,22 @@ DragRef = /** @class */ (function () {
|
|
|
976
1019
|
newContainer = this._initialContainer;
|
|
977
1020
|
}
|
|
978
1021
|
if (newContainer && newContainer !== this._dropContainer) {
|
|
979
|
-
this._ngZone.run(
|
|
1022
|
+
this._ngZone.run((/**
|
|
1023
|
+
* @return {?}
|
|
1024
|
+
*/
|
|
1025
|
+
function () {
|
|
980
1026
|
// Notify the old container that the item has left.
|
|
981
1027
|
_this.exited.next({ item: _this, container: (/** @type {?} */ (_this._dropContainer)) });
|
|
982
1028
|
(/** @type {?} */ (_this._dropContainer)).exit(_this);
|
|
983
1029
|
// Notify the new container that the item has entered.
|
|
984
|
-
_this.entered.next({ item: _this, container: (/** @type {?} */ (newContainer)) });
|
|
985
1030
|
_this._dropContainer = (/** @type {?} */ (newContainer));
|
|
986
1031
|
_this._dropContainer.enter(_this, x, y);
|
|
987
|
-
|
|
1032
|
+
_this.entered.next({
|
|
1033
|
+
item: _this,
|
|
1034
|
+
container: (/** @type {?} */ (newContainer)),
|
|
1035
|
+
currentIndex: (/** @type {?} */ (newContainer)).getItemIndex(_this)
|
|
1036
|
+
});
|
|
1037
|
+
}));
|
|
988
1038
|
}
|
|
989
1039
|
(/** @type {?} */ (this._dropContainer))._sortItem(this, x, y, this._pointerDirectionDelta);
|
|
990
1040
|
this._preview.style.transform =
|
|
@@ -1080,24 +1130,35 @@ DragRef = /** @class */ (function () {
|
|
|
1080
1130
|
if (duration === 0) {
|
|
1081
1131
|
return Promise.resolve();
|
|
1082
1132
|
}
|
|
1083
|
-
return this._ngZone.runOutsideAngular(
|
|
1084
|
-
|
|
1133
|
+
return this._ngZone.runOutsideAngular((/**
|
|
1134
|
+
* @return {?}
|
|
1135
|
+
*/
|
|
1136
|
+
function () {
|
|
1137
|
+
return new Promise((/**
|
|
1138
|
+
* @param {?} resolve
|
|
1139
|
+
* @return {?}
|
|
1140
|
+
*/
|
|
1141
|
+
function (resolve) {
|
|
1085
1142
|
/** @type {?} */
|
|
1086
|
-
var handler = (/** @type {?} */ ((
|
|
1143
|
+
var handler = (/** @type {?} */ (((/**
|
|
1144
|
+
* @param {?} event
|
|
1145
|
+
* @return {?}
|
|
1146
|
+
*/
|
|
1147
|
+
function (event) {
|
|
1087
1148
|
if (!event || (event.target === _this._preview && event.propertyName === 'transform')) {
|
|
1088
1149
|
_this._preview.removeEventListener('transitionend', handler);
|
|
1089
1150
|
resolve();
|
|
1090
1151
|
clearTimeout(timeout);
|
|
1091
1152
|
}
|
|
1092
|
-
})));
|
|
1153
|
+
}))));
|
|
1093
1154
|
// If a transition is short enough, the browser might not fire the `transitionend` event.
|
|
1094
1155
|
// Since we know how long it's supposed to take, add a timeout with a 50% buffer that'll
|
|
1095
1156
|
// fire if the transition hasn't completed when it was supposed to.
|
|
1096
1157
|
/** @type {?} */
|
|
1097
1158
|
var timeout = setTimeout((/** @type {?} */ (handler)), duration * 1.5);
|
|
1098
1159
|
_this._preview.addEventListener('transitionend', handler);
|
|
1099
|
-
});
|
|
1100
|
-
});
|
|
1160
|
+
}));
|
|
1161
|
+
}));
|
|
1101
1162
|
};
|
|
1102
1163
|
/** Creates an element that will be shown instead of the current element while dragging. */
|
|
1103
1164
|
/**
|
|
@@ -1341,6 +1402,30 @@ DragRef = /** @class */ (function () {
|
|
|
1341
1402
|
this._rootElement.style.transform = this._initialTransform ?
|
|
1342
1403
|
transform + ' ' + this._initialTransform : transform;
|
|
1343
1404
|
};
|
|
1405
|
+
/**
|
|
1406
|
+
* Gets the distance that the user has dragged during the current drag sequence.
|
|
1407
|
+
* @param currentPosition Current position of the user's pointer.
|
|
1408
|
+
*/
|
|
1409
|
+
/**
|
|
1410
|
+
* Gets the distance that the user has dragged during the current drag sequence.
|
|
1411
|
+
* @private
|
|
1412
|
+
* @param {?} currentPosition Current position of the user's pointer.
|
|
1413
|
+
* @return {?}
|
|
1414
|
+
*/
|
|
1415
|
+
DragRef.prototype._getDragDistance = /**
|
|
1416
|
+
* Gets the distance that the user has dragged during the current drag sequence.
|
|
1417
|
+
* @private
|
|
1418
|
+
* @param {?} currentPosition Current position of the user's pointer.
|
|
1419
|
+
* @return {?}
|
|
1420
|
+
*/
|
|
1421
|
+
function (currentPosition) {
|
|
1422
|
+
/** @type {?} */
|
|
1423
|
+
var pickupPosition = this._pickupPositionOnPage;
|
|
1424
|
+
if (pickupPosition) {
|
|
1425
|
+
return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y };
|
|
1426
|
+
}
|
|
1427
|
+
return { x: 0, y: 0 };
|
|
1428
|
+
};
|
|
1344
1429
|
return DragRef;
|
|
1345
1430
|
}());
|
|
1346
1431
|
/**
|
|
@@ -1364,11 +1449,26 @@ function deepCloneNode(node) {
|
|
|
1364
1449
|
var clone = (/** @type {?} */ (node.cloneNode(true)));
|
|
1365
1450
|
/** @type {?} */
|
|
1366
1451
|
var descendantsWithId = clone.querySelectorAll('[id]');
|
|
1452
|
+
/** @type {?} */
|
|
1453
|
+
var descendantCanvases = node.querySelectorAll('canvas');
|
|
1367
1454
|
// Remove the `id` to avoid having multiple elements with the same id on the page.
|
|
1368
1455
|
clone.removeAttribute('id');
|
|
1369
1456
|
for (var i = 0; i < descendantsWithId.length; i++) {
|
|
1370
1457
|
descendantsWithId[i].removeAttribute('id');
|
|
1371
1458
|
}
|
|
1459
|
+
// `cloneNode` won't transfer the content of `canvas` elements so we have to do it ourselves.
|
|
1460
|
+
// We match up the cloned canvas to their sources using their index in the DOM.
|
|
1461
|
+
if (descendantCanvases.length) {
|
|
1462
|
+
/** @type {?} */
|
|
1463
|
+
var cloneCanvases = clone.querySelectorAll('canvas');
|
|
1464
|
+
for (var i = 0; i < descendantCanvases.length; i++) {
|
|
1465
|
+
/** @type {?} */
|
|
1466
|
+
var correspondingCloneContext = cloneCanvases[i].getContext('2d');
|
|
1467
|
+
if (correspondingCloneContext) {
|
|
1468
|
+
correspondingCloneContext.drawImage(descendantCanvases[i], 0, 0);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1372
1472
|
return clone;
|
|
1373
1473
|
}
|
|
1374
1474
|
/**
|
|
@@ -1417,7 +1517,7 @@ function getPreviewInsertionPoint(documentRef) {
|
|
|
1417
1517
|
|
|
1418
1518
|
/**
|
|
1419
1519
|
* @fileoverview added by tsickle
|
|
1420
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1520
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1421
1521
|
*/
|
|
1422
1522
|
|
|
1423
1523
|
/**
|
|
@@ -1493,7 +1593,7 @@ function clamp$1(value, max) {
|
|
|
1493
1593
|
|
|
1494
1594
|
/**
|
|
1495
1595
|
* @fileoverview added by tsickle
|
|
1496
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1596
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1497
1597
|
*/
|
|
1498
1598
|
/**
|
|
1499
1599
|
* Counter used to generate unique ids for drop refs.
|
|
@@ -1537,7 +1637,10 @@ DropListRef = /** @class */ (function () {
|
|
|
1537
1637
|
* Function that is used to determine whether an item
|
|
1538
1638
|
* is allowed to be moved into a drop container.
|
|
1539
1639
|
*/
|
|
1540
|
-
this.enterPredicate =
|
|
1640
|
+
this.enterPredicate = (/**
|
|
1641
|
+
* @return {?}
|
|
1642
|
+
*/
|
|
1643
|
+
function () { return true; });
|
|
1541
1644
|
/**
|
|
1542
1645
|
* Emits right before dragging has started.
|
|
1543
1646
|
*/
|
|
@@ -1635,10 +1738,12 @@ DropListRef = /** @class */ (function () {
|
|
|
1635
1738
|
var _this = this;
|
|
1636
1739
|
this.beforeStarted.next();
|
|
1637
1740
|
this._isDragging = true;
|
|
1638
|
-
this.
|
|
1639
|
-
this.
|
|
1640
|
-
|
|
1641
|
-
|
|
1741
|
+
this._cacheItems();
|
|
1742
|
+
this._siblings.forEach((/**
|
|
1743
|
+
* @param {?} sibling
|
|
1744
|
+
* @return {?}
|
|
1745
|
+
*/
|
|
1746
|
+
function (sibling) { return sibling._startReceiving(_this); }));
|
|
1642
1747
|
};
|
|
1643
1748
|
/**
|
|
1644
1749
|
* Emits an event to indicate that the user moved an item into the container.
|
|
@@ -1661,7 +1766,6 @@ DropListRef = /** @class */ (function () {
|
|
|
1661
1766
|
* @return {?}
|
|
1662
1767
|
*/
|
|
1663
1768
|
function (item, pointerX, pointerY) {
|
|
1664
|
-
this.entered.next({ item: item, container: this });
|
|
1665
1769
|
this.start();
|
|
1666
1770
|
// If sorting is disabled, we want the item to return to its starting
|
|
1667
1771
|
// position if the user is returning it to its initial container.
|
|
@@ -1700,7 +1804,7 @@ DropListRef = /** @class */ (function () {
|
|
|
1700
1804
|
activeDraggables.splice(newIndex, 0, item);
|
|
1701
1805
|
}
|
|
1702
1806
|
else {
|
|
1703
|
-
this.element.appendChild(placeholder);
|
|
1807
|
+
coerceElement(this.element).appendChild(placeholder);
|
|
1704
1808
|
activeDraggables.push(item);
|
|
1705
1809
|
}
|
|
1706
1810
|
// The transform needs to be cleared so it doesn't throw off the measurements.
|
|
@@ -1708,6 +1812,7 @@ DropListRef = /** @class */ (function () {
|
|
|
1708
1812
|
// Note that the positions were already cached when we called `start` above,
|
|
1709
1813
|
// but we need to refresh them since the amount of items has changed.
|
|
1710
1814
|
this._cacheItemPositions();
|
|
1815
|
+
this.entered.next({ item: item, container: this, currentIndex: this.getItemIndex(item) });
|
|
1711
1816
|
};
|
|
1712
1817
|
/**
|
|
1713
1818
|
* Removes an item from the container after it was dragged into another container by the user.
|
|
@@ -1734,26 +1839,33 @@ DropListRef = /** @class */ (function () {
|
|
|
1734
1839
|
* @param previousContainer Container from which the item got dragged in.
|
|
1735
1840
|
* @param isPointerOverContainer Whether the user's pointer was over the
|
|
1736
1841
|
* container when the item was dropped.
|
|
1842
|
+
* @param distance Distance the user has dragged since the start of the dragging sequence.
|
|
1843
|
+
* @breaking-change 9.0.0 `distance` parameter to become required.
|
|
1737
1844
|
*/
|
|
1738
1845
|
/**
|
|
1739
1846
|
* Drops an item into this container.
|
|
1847
|
+
* \@breaking-change 9.0.0 `distance` parameter to become required.
|
|
1740
1848
|
* @param {?} item Item being dropped into the container.
|
|
1741
1849
|
* @param {?} currentIndex Index at which the item should be inserted.
|
|
1742
1850
|
* @param {?} previousContainer Container from which the item got dragged in.
|
|
1743
1851
|
* @param {?} isPointerOverContainer Whether the user's pointer was over the
|
|
1744
1852
|
* container when the item was dropped.
|
|
1853
|
+
* @param {?=} distance Distance the user has dragged since the start of the dragging sequence.
|
|
1745
1854
|
* @return {?}
|
|
1746
1855
|
*/
|
|
1747
1856
|
DropListRef.prototype.drop = /**
|
|
1748
1857
|
* Drops an item into this container.
|
|
1858
|
+
* \@breaking-change 9.0.0 `distance` parameter to become required.
|
|
1749
1859
|
* @param {?} item Item being dropped into the container.
|
|
1750
1860
|
* @param {?} currentIndex Index at which the item should be inserted.
|
|
1751
1861
|
* @param {?} previousContainer Container from which the item got dragged in.
|
|
1752
1862
|
* @param {?} isPointerOverContainer Whether the user's pointer was over the
|
|
1753
1863
|
* container when the item was dropped.
|
|
1864
|
+
* @param {?=} distance Distance the user has dragged since the start of the dragging sequence.
|
|
1754
1865
|
* @return {?}
|
|
1755
1866
|
*/
|
|
1756
|
-
function (item, currentIndex, previousContainer, isPointerOverContainer) {
|
|
1867
|
+
function (item, currentIndex, previousContainer, isPointerOverContainer, distance) {
|
|
1868
|
+
if (distance === void 0) { distance = { x: 0, y: 0 }; }
|
|
1757
1869
|
this._reset();
|
|
1758
1870
|
this.dropped.next({
|
|
1759
1871
|
item: item,
|
|
@@ -1761,7 +1873,8 @@ DropListRef = /** @class */ (function () {
|
|
|
1761
1873
|
previousIndex: previousContainer.getItemIndex(item),
|
|
1762
1874
|
container: this,
|
|
1763
1875
|
previousContainer: previousContainer,
|
|
1764
|
-
isPointerOverContainer: isPointerOverContainer
|
|
1876
|
+
isPointerOverContainer: isPointerOverContainer,
|
|
1877
|
+
distance: distance
|
|
1765
1878
|
});
|
|
1766
1879
|
};
|
|
1767
1880
|
/**
|
|
@@ -1785,7 +1898,14 @@ DropListRef = /** @class */ (function () {
|
|
|
1785
1898
|
function (items) {
|
|
1786
1899
|
var _this = this;
|
|
1787
1900
|
(/** @type {?} */ (this))._draggables = items;
|
|
1788
|
-
items.forEach(
|
|
1901
|
+
items.forEach((/**
|
|
1902
|
+
* @param {?} item
|
|
1903
|
+
* @return {?}
|
|
1904
|
+
*/
|
|
1905
|
+
function (item) { return item._withDropContainer((/** @type {?} */ (_this))); }));
|
|
1906
|
+
if ((/** @type {?} */ (this)).isDragging()) {
|
|
1907
|
+
(/** @type {?} */ (this))._cacheItems();
|
|
1908
|
+
}
|
|
1789
1909
|
return (/** @type {?} */ (this));
|
|
1790
1910
|
};
|
|
1791
1911
|
/** Sets the layout direction of the drop list. */
|
|
@@ -1878,7 +1998,11 @@ DropListRef = /** @class */ (function () {
|
|
|
1878
1998
|
/** @type {?} */
|
|
1879
1999
|
var items = this._orientation === 'horizontal' && this._direction === 'rtl' ?
|
|
1880
2000
|
this._itemPositions.slice().reverse() : this._itemPositions;
|
|
1881
|
-
return findIndex(items,
|
|
2001
|
+
return findIndex(items, (/**
|
|
2002
|
+
* @param {?} currentItem
|
|
2003
|
+
* @return {?}
|
|
2004
|
+
*/
|
|
2005
|
+
function (currentItem) { return currentItem.drag === item; }));
|
|
1882
2006
|
};
|
|
1883
2007
|
/**
|
|
1884
2008
|
* Whether the list is able to receive the item that
|
|
@@ -1935,7 +2059,11 @@ DropListRef = /** @class */ (function () {
|
|
|
1935
2059
|
/** @type {?} */
|
|
1936
2060
|
var isHorizontal = this._orientation === 'horizontal';
|
|
1937
2061
|
/** @type {?} */
|
|
1938
|
-
var currentIndex = findIndex(siblings,
|
|
2062
|
+
var currentIndex = findIndex(siblings, (/**
|
|
2063
|
+
* @param {?} currentItem
|
|
2064
|
+
* @return {?}
|
|
2065
|
+
*/
|
|
2066
|
+
function (currentItem) { return currentItem.drag === item; }));
|
|
1939
2067
|
/** @type {?} */
|
|
1940
2068
|
var siblingAtNewPosition = siblings[newIndex];
|
|
1941
2069
|
/** @type {?} */
|
|
@@ -1964,7 +2092,12 @@ DropListRef = /** @class */ (function () {
|
|
|
1964
2092
|
container: this,
|
|
1965
2093
|
item: item
|
|
1966
2094
|
});
|
|
1967
|
-
siblings.forEach(
|
|
2095
|
+
siblings.forEach((/**
|
|
2096
|
+
* @param {?} sibling
|
|
2097
|
+
* @param {?} index
|
|
2098
|
+
* @return {?}
|
|
2099
|
+
*/
|
|
2100
|
+
function (sibling, index) {
|
|
1968
2101
|
// Don't do anything if the position hasn't changed.
|
|
1969
2102
|
if (oldOrder[index] === sibling) {
|
|
1970
2103
|
return;
|
|
@@ -1992,7 +2125,7 @@ DropListRef = /** @class */ (function () {
|
|
|
1992
2125
|
elementToOffset.style.transform = "translate3d(0, " + Math.round(sibling.offset) + "px, 0)";
|
|
1993
2126
|
adjustClientRect(sibling.clientRect, offset, 0);
|
|
1994
2127
|
}
|
|
1995
|
-
});
|
|
2128
|
+
}));
|
|
1996
2129
|
};
|
|
1997
2130
|
/** Caches the position of the drop list. */
|
|
1998
2131
|
/**
|
|
@@ -2006,7 +2139,7 @@ DropListRef = /** @class */ (function () {
|
|
|
2006
2139
|
* @return {?}
|
|
2007
2140
|
*/
|
|
2008
2141
|
function () {
|
|
2009
|
-
this._clientRect = this.element.getBoundingClientRect();
|
|
2142
|
+
this._clientRect = coerceElement(this.element).getBoundingClientRect();
|
|
2010
2143
|
};
|
|
2011
2144
|
/** Refreshes the position cache of the items and sibling containers. */
|
|
2012
2145
|
/**
|
|
@@ -2023,7 +2156,11 @@ DropListRef = /** @class */ (function () {
|
|
|
2023
2156
|
var _this = this;
|
|
2024
2157
|
/** @type {?} */
|
|
2025
2158
|
var isHorizontal = this._orientation === 'horizontal';
|
|
2026
|
-
this._itemPositions = this._activeDraggables.map(
|
|
2159
|
+
this._itemPositions = this._activeDraggables.map((/**
|
|
2160
|
+
* @param {?} drag
|
|
2161
|
+
* @return {?}
|
|
2162
|
+
*/
|
|
2163
|
+
function (drag) {
|
|
2027
2164
|
/** @type {?} */
|
|
2028
2165
|
var elementToMeasure = _this._dragDropRegistry.isDragging(drag) ?
|
|
2029
2166
|
// If the element is being dragged, we have to measure the
|
|
@@ -2048,10 +2185,15 @@ DropListRef = /** @class */ (function () {
|
|
|
2048
2185
|
height: clientRect.height
|
|
2049
2186
|
}
|
|
2050
2187
|
};
|
|
2051
|
-
}).sort(
|
|
2188
|
+
})).sort((/**
|
|
2189
|
+
* @param {?} a
|
|
2190
|
+
* @param {?} b
|
|
2191
|
+
* @return {?}
|
|
2192
|
+
*/
|
|
2193
|
+
function (a, b) {
|
|
2052
2194
|
return isHorizontal ? a.clientRect.left - b.clientRect.left :
|
|
2053
2195
|
a.clientRect.top - b.clientRect.top;
|
|
2054
|
-
});
|
|
2196
|
+
}));
|
|
2055
2197
|
};
|
|
2056
2198
|
/** Resets the container to its initial state. */
|
|
2057
2199
|
/**
|
|
@@ -2068,8 +2210,16 @@ DropListRef = /** @class */ (function () {
|
|
|
2068
2210
|
var _this = this;
|
|
2069
2211
|
this._isDragging = false;
|
|
2070
2212
|
// TODO(crisbeto): may have to wait for the animations to finish.
|
|
2071
|
-
this._activeDraggables.forEach(
|
|
2072
|
-
|
|
2213
|
+
this._activeDraggables.forEach((/**
|
|
2214
|
+
* @param {?} item
|
|
2215
|
+
* @return {?}
|
|
2216
|
+
*/
|
|
2217
|
+
function (item) { return item.getRootElement().style.transform = ''; }));
|
|
2218
|
+
this._siblings.forEach((/**
|
|
2219
|
+
* @param {?} sibling
|
|
2220
|
+
* @return {?}
|
|
2221
|
+
*/
|
|
2222
|
+
function (sibling) { return sibling._stopReceiving(_this); }));
|
|
2073
2223
|
this._activeDraggables = [];
|
|
2074
2224
|
this._itemPositions = [];
|
|
2075
2225
|
this._previousSwap.drag = null;
|
|
@@ -2216,7 +2366,13 @@ DropListRef = /** @class */ (function () {
|
|
|
2216
2366
|
var _this = this;
|
|
2217
2367
|
/** @type {?} */
|
|
2218
2368
|
var isHorizontal = this._orientation === 'horizontal';
|
|
2219
|
-
return findIndex(this._itemPositions,
|
|
2369
|
+
return findIndex(this._itemPositions, (/**
|
|
2370
|
+
* @param {?} __0
|
|
2371
|
+
* @param {?} _
|
|
2372
|
+
* @param {?} array
|
|
2373
|
+
* @return {?}
|
|
2374
|
+
*/
|
|
2375
|
+
function (_a, _, array) {
|
|
2220
2376
|
var drag = _a.drag, clientRect = _a.clientRect;
|
|
2221
2377
|
if (drag === item) {
|
|
2222
2378
|
// If there's only one item left in the container, it must be
|
|
@@ -2237,7 +2393,23 @@ DropListRef = /** @class */ (function () {
|
|
|
2237
2393
|
// sub-pixel precision, whereas the pointer coordinates are rounded to pixels.
|
|
2238
2394
|
pointerX >= Math.floor(clientRect.left) && pointerX <= Math.floor(clientRect.right) :
|
|
2239
2395
|
pointerY >= Math.floor(clientRect.top) && pointerY <= Math.floor(clientRect.bottom);
|
|
2240
|
-
});
|
|
2396
|
+
}));
|
|
2397
|
+
};
|
|
2398
|
+
/** Caches the current items in the list and their positions. */
|
|
2399
|
+
/**
|
|
2400
|
+
* Caches the current items in the list and their positions.
|
|
2401
|
+
* @private
|
|
2402
|
+
* @return {?}
|
|
2403
|
+
*/
|
|
2404
|
+
DropListRef.prototype._cacheItems = /**
|
|
2405
|
+
* Caches the current items in the list and their positions.
|
|
2406
|
+
* @private
|
|
2407
|
+
* @return {?}
|
|
2408
|
+
*/
|
|
2409
|
+
function () {
|
|
2410
|
+
this._activeDraggables = this._draggables.slice();
|
|
2411
|
+
this._cacheItemPositions();
|
|
2412
|
+
this._cacheOwnPosition();
|
|
2241
2413
|
};
|
|
2242
2414
|
/**
|
|
2243
2415
|
* Checks whether the user's pointer is positioned over the container.
|
|
@@ -2283,7 +2455,11 @@ DropListRef = /** @class */ (function () {
|
|
|
2283
2455
|
* @return {?}
|
|
2284
2456
|
*/
|
|
2285
2457
|
function (item, x, y) {
|
|
2286
|
-
return this._siblings.find(
|
|
2458
|
+
return this._siblings.find((/**
|
|
2459
|
+
* @param {?} sibling
|
|
2460
|
+
* @return {?}
|
|
2461
|
+
*/
|
|
2462
|
+
function (sibling) { return sibling._canReceive(item, x, y); }));
|
|
2287
2463
|
};
|
|
2288
2464
|
/**
|
|
2289
2465
|
* Checks whether the drop list can receive the passed-in item.
|
|
@@ -2310,19 +2486,21 @@ DropListRef = /** @class */ (function () {
|
|
|
2310
2486
|
return false;
|
|
2311
2487
|
}
|
|
2312
2488
|
/** @type {?} */
|
|
2313
|
-
var elementFromPoint = this._document.elementFromPoint(x, y);
|
|
2489
|
+
var elementFromPoint = (/** @type {?} */ (this._document.elementFromPoint(x, y)));
|
|
2314
2490
|
// If there's no element at the pointer position, then
|
|
2315
2491
|
// the client rect is probably scrolled out of the view.
|
|
2316
2492
|
if (!elementFromPoint) {
|
|
2317
2493
|
return false;
|
|
2318
2494
|
}
|
|
2495
|
+
/** @type {?} */
|
|
2496
|
+
var nativeElement = coerceElement(this.element);
|
|
2319
2497
|
// The `ClientRect`, that we're using to find the container over which the user is
|
|
2320
2498
|
// hovering, doesn't give us any information on whether the element has been scrolled
|
|
2321
2499
|
// out of the view or whether it's overlapping with other containers. This means that
|
|
2322
2500
|
// we could end up transferring the item into a container that's invisible or is positioned
|
|
2323
2501
|
// below another one. We use the result from `elementFromPoint` to get the top-most element
|
|
2324
2502
|
// at the pointer position and to find whether it's one of the intersecting drop containers.
|
|
2325
|
-
return elementFromPoint ===
|
|
2503
|
+
return elementFromPoint === nativeElement || nativeElement.contains(elementFromPoint);
|
|
2326
2504
|
};
|
|
2327
2505
|
/**
|
|
2328
2506
|
* Called by one of the connected drop lists when a dragging sequence has started.
|
|
@@ -2408,7 +2586,7 @@ function isInsideClientRect(clientRect, x, y) {
|
|
|
2408
2586
|
|
|
2409
2587
|
/**
|
|
2410
2588
|
* @fileoverview added by tsickle
|
|
2411
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2589
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2412
2590
|
*/
|
|
2413
2591
|
/**
|
|
2414
2592
|
* Event options that can be used to bind an active, capturing event.
|
|
@@ -2461,11 +2639,15 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2461
2639
|
* Event listener that will prevent the default browser action while the user is dragging.
|
|
2462
2640
|
* @param event Event whose default action should be prevented.
|
|
2463
2641
|
*/
|
|
2464
|
-
this._preventDefaultWhileDragging =
|
|
2642
|
+
this._preventDefaultWhileDragging = (/**
|
|
2643
|
+
* @param {?} event
|
|
2644
|
+
* @return {?}
|
|
2645
|
+
*/
|
|
2646
|
+
function (event) {
|
|
2465
2647
|
if (_this._activeDragInstances.size) {
|
|
2466
2648
|
event.preventDefault();
|
|
2467
2649
|
}
|
|
2468
|
-
};
|
|
2650
|
+
});
|
|
2469
2651
|
this._document = _document;
|
|
2470
2652
|
}
|
|
2471
2653
|
/** Adds a drop container to the registry. */
|
|
@@ -2505,11 +2687,14 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2505
2687
|
// won't preventDefault on a dynamically-added `touchmove` listener.
|
|
2506
2688
|
// See https://bugs.webkit.org/show_bug.cgi?id=184250.
|
|
2507
2689
|
if (this._dragInstances.size === 1) {
|
|
2508
|
-
this._ngZone.runOutsideAngular(
|
|
2690
|
+
this._ngZone.runOutsideAngular((/**
|
|
2691
|
+
* @return {?}
|
|
2692
|
+
*/
|
|
2693
|
+
function () {
|
|
2509
2694
|
// The event handler has to be explicitly active,
|
|
2510
2695
|
// because newer browsers make it passive by default.
|
|
2511
2696
|
_this._document.addEventListener('touchmove', _this._preventDefaultWhileDragging, activeCapturingEventOptions);
|
|
2512
|
-
});
|
|
2697
|
+
}));
|
|
2513
2698
|
}
|
|
2514
2699
|
};
|
|
2515
2700
|
/** Removes a drop container from the registry. */
|
|
@@ -2576,11 +2761,19 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2576
2761
|
// use `preventDefault` to prevent the page from scrolling while the user is dragging.
|
|
2577
2762
|
this._globalListeners
|
|
2578
2763
|
.set(moveEvent, {
|
|
2579
|
-
handler:
|
|
2764
|
+
handler: (/**
|
|
2765
|
+
* @param {?} e
|
|
2766
|
+
* @return {?}
|
|
2767
|
+
*/
|
|
2768
|
+
function (e) { return _this.pointerMove.next((/** @type {?} */ (e))); }),
|
|
2580
2769
|
options: activeCapturingEventOptions
|
|
2581
2770
|
})
|
|
2582
2771
|
.set(upEvent, {
|
|
2583
|
-
handler:
|
|
2772
|
+
handler: (/**
|
|
2773
|
+
* @param {?} e
|
|
2774
|
+
* @return {?}
|
|
2775
|
+
*/
|
|
2776
|
+
function (e) { return _this.pointerUp.next((/** @type {?} */ (e))); }),
|
|
2584
2777
|
options: true
|
|
2585
2778
|
})
|
|
2586
2779
|
// Preventing the default action on `mousemove` isn't enough to disable text selection
|
|
@@ -2599,11 +2792,19 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2599
2792
|
options: activeCapturingEventOptions
|
|
2600
2793
|
});
|
|
2601
2794
|
}
|
|
2602
|
-
this._ngZone.runOutsideAngular(
|
|
2603
|
-
|
|
2795
|
+
this._ngZone.runOutsideAngular((/**
|
|
2796
|
+
* @return {?}
|
|
2797
|
+
*/
|
|
2798
|
+
function () {
|
|
2799
|
+
_this._globalListeners.forEach((/**
|
|
2800
|
+
* @param {?} config
|
|
2801
|
+
* @param {?} name
|
|
2802
|
+
* @return {?}
|
|
2803
|
+
*/
|
|
2804
|
+
function (config, name) {
|
|
2604
2805
|
_this._document.addEventListener(name, config.handler, config.options);
|
|
2605
|
-
});
|
|
2606
|
-
});
|
|
2806
|
+
}));
|
|
2807
|
+
}));
|
|
2607
2808
|
}
|
|
2608
2809
|
};
|
|
2609
2810
|
/** Stops dragging a drag item instance. */
|
|
@@ -2657,7 +2858,11 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2657
2858
|
* @return {?}
|
|
2658
2859
|
*/
|
|
2659
2860
|
function (id) {
|
|
2660
|
-
return Array.from(this._dropInstances).find(
|
|
2861
|
+
return Array.from(this._dropInstances).find((/**
|
|
2862
|
+
* @param {?} instance
|
|
2863
|
+
* @return {?}
|
|
2864
|
+
*/
|
|
2865
|
+
function (instance) { return instance.id === id; }));
|
|
2661
2866
|
};
|
|
2662
2867
|
/**
|
|
2663
2868
|
* @return {?}
|
|
@@ -2667,8 +2872,16 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2667
2872
|
*/
|
|
2668
2873
|
function () {
|
|
2669
2874
|
var _this = this;
|
|
2670
|
-
this._dragInstances.forEach(
|
|
2671
|
-
|
|
2875
|
+
this._dragInstances.forEach((/**
|
|
2876
|
+
* @param {?} instance
|
|
2877
|
+
* @return {?}
|
|
2878
|
+
*/
|
|
2879
|
+
function (instance) { return _this.removeDragItem(instance); }));
|
|
2880
|
+
this._dropInstances.forEach((/**
|
|
2881
|
+
* @param {?} instance
|
|
2882
|
+
* @return {?}
|
|
2883
|
+
*/
|
|
2884
|
+
function (instance) { return _this.removeDropContainer(instance); }));
|
|
2672
2885
|
this._clearGlobalListeners();
|
|
2673
2886
|
this.pointerMove.complete();
|
|
2674
2887
|
this.pointerUp.complete();
|
|
@@ -2686,9 +2899,14 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2686
2899
|
*/
|
|
2687
2900
|
function () {
|
|
2688
2901
|
var _this = this;
|
|
2689
|
-
this._globalListeners.forEach(
|
|
2902
|
+
this._globalListeners.forEach((/**
|
|
2903
|
+
* @param {?} config
|
|
2904
|
+
* @param {?} name
|
|
2905
|
+
* @return {?}
|
|
2906
|
+
*/
|
|
2907
|
+
function (config, name) {
|
|
2690
2908
|
_this._document.removeEventListener(name, config.handler, config.options);
|
|
2691
|
-
});
|
|
2909
|
+
}));
|
|
2692
2910
|
this._globalListeners.clear();
|
|
2693
2911
|
};
|
|
2694
2912
|
DragDropRegistry.decorators = [
|
|
@@ -2699,13 +2917,13 @@ var DragDropRegistry = /** @class */ (function () {
|
|
|
2699
2917
|
{ type: NgZone },
|
|
2700
2918
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
2701
2919
|
]; };
|
|
2702
|
-
/** @nocollapse */ DragDropRegistry.ngInjectableDef =
|
|
2920
|
+
/** @nocollapse */ DragDropRegistry.ngInjectableDef = ɵɵdefineInjectable({ factory: function DragDropRegistry_Factory() { return new DragDropRegistry(ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: DragDropRegistry, providedIn: "root" });
|
|
2703
2921
|
return DragDropRegistry;
|
|
2704
2922
|
}());
|
|
2705
2923
|
|
|
2706
2924
|
/**
|
|
2707
2925
|
* @fileoverview added by tsickle
|
|
2708
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2926
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2709
2927
|
*/
|
|
2710
2928
|
/**
|
|
2711
2929
|
* Default configuration to be used when creating a `DragRef`.
|
|
@@ -2777,13 +2995,13 @@ var DragDrop = /** @class */ (function () {
|
|
|
2777
2995
|
{ type: ViewportRuler },
|
|
2778
2996
|
{ type: DragDropRegistry }
|
|
2779
2997
|
]; };
|
|
2780
|
-
/** @nocollapse */ DragDrop.ngInjectableDef =
|
|
2998
|
+
/** @nocollapse */ DragDrop.ngInjectableDef = ɵɵdefineInjectable({ factory: function DragDrop_Factory() { return new DragDrop(ɵɵinject(DOCUMENT), ɵɵinject(NgZone), ɵɵinject(ViewportRuler), ɵɵinject(DragDropRegistry)); }, token: DragDrop, providedIn: "root" });
|
|
2781
2999
|
return DragDrop;
|
|
2782
3000
|
}());
|
|
2783
3001
|
|
|
2784
3002
|
/**
|
|
2785
3003
|
* @fileoverview added by tsickle
|
|
2786
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3004
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2787
3005
|
*/
|
|
2788
3006
|
/**
|
|
2789
3007
|
* Injection token that is used to provide a CdkDropList instance to CdkDrag.
|
|
@@ -2802,12 +3020,12 @@ var CDK_DROP_LIST_CONTAINER = CDK_DROP_LIST;
|
|
|
2802
3020
|
|
|
2803
3021
|
/**
|
|
2804
3022
|
* @fileoverview added by tsickle
|
|
2805
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3023
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2806
3024
|
*/
|
|
2807
3025
|
|
|
2808
3026
|
/**
|
|
2809
3027
|
* @fileoverview added by tsickle
|
|
2810
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3028
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2811
3029
|
*/
|
|
2812
3030
|
/**
|
|
2813
3031
|
* Injection token that can be used for a `CdkDrag` to provide itself as a parent to the
|
|
@@ -2820,7 +3038,7 @@ var CDK_DRAG_PARENT = new InjectionToken('CDK_DRAG_PARENT');
|
|
|
2820
3038
|
|
|
2821
3039
|
/**
|
|
2822
3040
|
* @fileoverview added by tsickle
|
|
2823
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3041
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2824
3042
|
*/
|
|
2825
3043
|
/**
|
|
2826
3044
|
* Handle that can be used to drag and CdkDrag instance.
|
|
@@ -2884,7 +3102,7 @@ var CdkDragHandle = /** @class */ (function () {
|
|
|
2884
3102
|
|
|
2885
3103
|
/**
|
|
2886
3104
|
* @fileoverview added by tsickle
|
|
2887
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3105
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2888
3106
|
*/
|
|
2889
3107
|
/**
|
|
2890
3108
|
* Element that will be used as a template for the placeholder of a CdkDrag when
|
|
@@ -2912,7 +3130,7 @@ var CdkDragPlaceholder = /** @class */ (function () {
|
|
|
2912
3130
|
|
|
2913
3131
|
/**
|
|
2914
3132
|
* @fileoverview added by tsickle
|
|
2915
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3133
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2916
3134
|
*/
|
|
2917
3135
|
/**
|
|
2918
3136
|
* Element that will be used as a template for the preview
|
|
@@ -2940,7 +3158,7 @@ var CdkDragPreview = /** @class */ (function () {
|
|
|
2940
3158
|
|
|
2941
3159
|
/**
|
|
2942
3160
|
* @fileoverview added by tsickle
|
|
2943
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3161
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2944
3162
|
*/
|
|
2945
3163
|
/**
|
|
2946
3164
|
* Injection token that can be used to configure the behavior of `CdkDrag`.
|
|
@@ -3006,23 +3224,64 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3006
3224
|
* Emits as the user is dragging the item. Use with caution,
|
|
3007
3225
|
* because this event will fire for every pixel that the user has dragged.
|
|
3008
3226
|
*/
|
|
3009
|
-
this.moved = new Observable(
|
|
3227
|
+
this.moved = new Observable((/**
|
|
3228
|
+
* @param {?} observer
|
|
3229
|
+
* @return {?}
|
|
3230
|
+
*/
|
|
3231
|
+
function (observer) {
|
|
3010
3232
|
/** @type {?} */
|
|
3011
|
-
var subscription = _this._dragRef.moved.pipe(map(
|
|
3233
|
+
var subscription = _this._dragRef.moved.pipe(map((/**
|
|
3234
|
+
* @param {?} movedEvent
|
|
3235
|
+
* @return {?}
|
|
3236
|
+
*/
|
|
3237
|
+
function (movedEvent) { return ({
|
|
3012
3238
|
source: _this,
|
|
3013
3239
|
pointerPosition: movedEvent.pointerPosition,
|
|
3014
3240
|
event: movedEvent.event,
|
|
3015
|
-
delta: movedEvent.delta
|
|
3016
|
-
|
|
3017
|
-
|
|
3241
|
+
delta: movedEvent.delta,
|
|
3242
|
+
distance: movedEvent.distance
|
|
3243
|
+
}); }))).subscribe(observer);
|
|
3244
|
+
return (/**
|
|
3245
|
+
* @return {?}
|
|
3246
|
+
*/
|
|
3247
|
+
function () {
|
|
3018
3248
|
subscription.unsubscribe();
|
|
3019
|
-
};
|
|
3020
|
-
});
|
|
3249
|
+
});
|
|
3250
|
+
}));
|
|
3021
3251
|
this._dragRef = dragDrop.createDrag(element, config);
|
|
3022
3252
|
this._dragRef.data = this;
|
|
3023
3253
|
this._syncInputs(this._dragRef);
|
|
3024
3254
|
this._handleEvents(this._dragRef);
|
|
3025
3255
|
}
|
|
3256
|
+
Object.defineProperty(CdkDrag.prototype, "boundaryElementSelector", {
|
|
3257
|
+
/**
|
|
3258
|
+
* Selector that will be used to determine the element to which the draggable's position will
|
|
3259
|
+
* be constrained. Matching starts from the element's parent and goes up the DOM until a matching
|
|
3260
|
+
* element has been found
|
|
3261
|
+
* @deprecated Use `boundaryElement` instead.
|
|
3262
|
+
* @breaking-change 9.0.0
|
|
3263
|
+
*/
|
|
3264
|
+
get: /**
|
|
3265
|
+
* Selector that will be used to determine the element to which the draggable's position will
|
|
3266
|
+
* be constrained. Matching starts from the element's parent and goes up the DOM until a matching
|
|
3267
|
+
* element has been found
|
|
3268
|
+
* @deprecated Use `boundaryElement` instead.
|
|
3269
|
+
* \@breaking-change 9.0.0
|
|
3270
|
+
* @return {?}
|
|
3271
|
+
*/
|
|
3272
|
+
function () {
|
|
3273
|
+
return typeof this.boundaryElement === 'string' ? this.boundaryElement : (/** @type {?} */ (undefined));
|
|
3274
|
+
},
|
|
3275
|
+
set: /**
|
|
3276
|
+
* @param {?} selector
|
|
3277
|
+
* @return {?}
|
|
3278
|
+
*/
|
|
3279
|
+
function (selector) {
|
|
3280
|
+
this.boundaryElement = selector;
|
|
3281
|
+
},
|
|
3282
|
+
enumerable: true,
|
|
3283
|
+
configurable: true
|
|
3284
|
+
});
|
|
3026
3285
|
Object.defineProperty(CdkDrag.prototype, "disabled", {
|
|
3027
3286
|
/** Whether starting to drag this element is disabled. */
|
|
3028
3287
|
get: /**
|
|
@@ -3112,33 +3371,60 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3112
3371
|
// their original DOM position and then they get transferred to the portal.
|
|
3113
3372
|
this._ngZone.onStable.asObservable()
|
|
3114
3373
|
.pipe(take(1), takeUntil(this._destroyed))
|
|
3115
|
-
.subscribe(
|
|
3374
|
+
.subscribe((/**
|
|
3375
|
+
* @return {?}
|
|
3376
|
+
*/
|
|
3377
|
+
function () {
|
|
3116
3378
|
_this._updateRootElement();
|
|
3117
3379
|
// Listen for any newly-added handles.
|
|
3118
3380
|
_this._handles.changes.pipe(startWith(_this._handles),
|
|
3119
3381
|
// Sync the new handles with the DragRef.
|
|
3120
|
-
tap(
|
|
3382
|
+
tap((/**
|
|
3383
|
+
* @param {?} handles
|
|
3384
|
+
* @return {?}
|
|
3385
|
+
*/
|
|
3386
|
+
function (handles) {
|
|
3121
3387
|
/** @type {?} */
|
|
3122
3388
|
var childHandleElements = handles
|
|
3123
|
-
.filter(
|
|
3124
|
-
|
|
3389
|
+
.filter((/**
|
|
3390
|
+
* @param {?} handle
|
|
3391
|
+
* @return {?}
|
|
3392
|
+
*/
|
|
3393
|
+
function (handle) { return handle._parentDrag === _this; }))
|
|
3394
|
+
.map((/**
|
|
3395
|
+
* @param {?} handle
|
|
3396
|
+
* @return {?}
|
|
3397
|
+
*/
|
|
3398
|
+
function (handle) { return handle.element; }));
|
|
3125
3399
|
_this._dragRef.withHandles(childHandleElements);
|
|
3126
|
-
}),
|
|
3400
|
+
})),
|
|
3127
3401
|
// Listen if the state of any of the handles changes.
|
|
3128
|
-
switchMap(
|
|
3129
|
-
|
|
3130
|
-
|
|
3402
|
+
switchMap((/**
|
|
3403
|
+
* @param {?} handles
|
|
3404
|
+
* @return {?}
|
|
3405
|
+
*/
|
|
3406
|
+
function (handles) {
|
|
3407
|
+
return merge.apply(void 0, handles.map((/**
|
|
3408
|
+
* @param {?} item
|
|
3409
|
+
* @return {?}
|
|
3410
|
+
*/
|
|
3411
|
+
function (item) { return item._stateChanges; })));
|
|
3412
|
+
})), takeUntil(_this._destroyed)).subscribe((/**
|
|
3413
|
+
* @param {?} handleInstance
|
|
3414
|
+
* @return {?}
|
|
3415
|
+
*/
|
|
3416
|
+
function (handleInstance) {
|
|
3131
3417
|
// Enabled/disable the handle that changed in the DragRef.
|
|
3132
3418
|
/** @type {?} */
|
|
3133
3419
|
var dragRef = _this._dragRef;
|
|
3134
3420
|
/** @type {?} */
|
|
3135
3421
|
var handle = handleInstance.element.nativeElement;
|
|
3136
3422
|
handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle);
|
|
3137
|
-
});
|
|
3423
|
+
}));
|
|
3138
3424
|
if (_this.freeDragPosition) {
|
|
3139
3425
|
_this._dragRef.setFreeDragPosition(_this.freeDragPosition);
|
|
3140
3426
|
}
|
|
3141
|
-
});
|
|
3427
|
+
}));
|
|
3142
3428
|
};
|
|
3143
3429
|
/**
|
|
3144
3430
|
* @param {?} changes
|
|
@@ -3152,7 +3438,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3152
3438
|
/** @type {?} */
|
|
3153
3439
|
var rootSelectorChange = changes['rootElementSelector'];
|
|
3154
3440
|
/** @type {?} */
|
|
3155
|
-
var positionChange = changes['
|
|
3441
|
+
var positionChange = changes['freeDragPosition'];
|
|
3156
3442
|
// We don't have to react to the first change since it's being
|
|
3157
3443
|
// handled in `ngAfterViewInit` where it needs to be deferred.
|
|
3158
3444
|
if (rootSelectorChange && !rootSelectorChange.firstChange) {
|
|
@@ -3197,21 +3483,32 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3197
3483
|
}
|
|
3198
3484
|
this._dragRef.withRootElement(rootElement || element);
|
|
3199
3485
|
};
|
|
3200
|
-
/** Gets the boundary element, based on the `
|
|
3486
|
+
/** Gets the boundary element, based on the `boundaryElement` value. */
|
|
3201
3487
|
/**
|
|
3202
|
-
* Gets the boundary element, based on the `
|
|
3488
|
+
* Gets the boundary element, based on the `boundaryElement` value.
|
|
3203
3489
|
* @private
|
|
3204
3490
|
* @return {?}
|
|
3205
3491
|
*/
|
|
3206
3492
|
CdkDrag.prototype._getBoundaryElement = /**
|
|
3207
|
-
* Gets the boundary element, based on the `
|
|
3493
|
+
* Gets the boundary element, based on the `boundaryElement` value.
|
|
3208
3494
|
* @private
|
|
3209
3495
|
* @return {?}
|
|
3210
3496
|
*/
|
|
3211
3497
|
function () {
|
|
3212
3498
|
/** @type {?} */
|
|
3213
|
-
var
|
|
3214
|
-
|
|
3499
|
+
var boundary = this.boundaryElement;
|
|
3500
|
+
if (!boundary) {
|
|
3501
|
+
return null;
|
|
3502
|
+
}
|
|
3503
|
+
if (typeof boundary === 'string') {
|
|
3504
|
+
return getClosestMatchingAncestor(this.element.nativeElement, boundary);
|
|
3505
|
+
}
|
|
3506
|
+
/** @type {?} */
|
|
3507
|
+
var element = coerceElement(boundary);
|
|
3508
|
+
if (isDevMode() && !element.contains(this.element.nativeElement)) {
|
|
3509
|
+
throw Error('Draggable element is not inside of the node passed into cdkDragBoundary.');
|
|
3510
|
+
}
|
|
3511
|
+
return element;
|
|
3215
3512
|
};
|
|
3216
3513
|
/** Syncs the inputs of the CdkDrag with the options of the underlying DragRef. */
|
|
3217
3514
|
/**
|
|
@@ -3228,7 +3525,10 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3228
3525
|
*/
|
|
3229
3526
|
function (ref) {
|
|
3230
3527
|
var _this = this;
|
|
3231
|
-
ref.beforeStarted.subscribe(
|
|
3528
|
+
ref.beforeStarted.subscribe((/**
|
|
3529
|
+
* @return {?}
|
|
3530
|
+
*/
|
|
3531
|
+
function () {
|
|
3232
3532
|
if (!ref.isDragging()) {
|
|
3233
3533
|
/** @type {?} */
|
|
3234
3534
|
var dir = _this._dir;
|
|
@@ -3256,7 +3556,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3256
3556
|
ref.withDirection(dir.value);
|
|
3257
3557
|
}
|
|
3258
3558
|
}
|
|
3259
|
-
});
|
|
3559
|
+
}));
|
|
3260
3560
|
};
|
|
3261
3561
|
/** Handles the events from the underlying `DragRef`. */
|
|
3262
3562
|
/**
|
|
@@ -3273,43 +3573,67 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3273
3573
|
*/
|
|
3274
3574
|
function (ref) {
|
|
3275
3575
|
var _this = this;
|
|
3276
|
-
ref.started.subscribe(
|
|
3576
|
+
ref.started.subscribe((/**
|
|
3577
|
+
* @return {?}
|
|
3578
|
+
*/
|
|
3579
|
+
function () {
|
|
3277
3580
|
_this.started.emit({ source: _this });
|
|
3278
3581
|
// Since all of these events run outside of change detection,
|
|
3279
3582
|
// we need to ensure that everything is marked correctly.
|
|
3280
3583
|
_this._changeDetectorRef.markForCheck();
|
|
3281
|
-
});
|
|
3282
|
-
ref.released.subscribe(
|
|
3584
|
+
}));
|
|
3585
|
+
ref.released.subscribe((/**
|
|
3586
|
+
* @return {?}
|
|
3587
|
+
*/
|
|
3588
|
+
function () {
|
|
3283
3589
|
_this.released.emit({ source: _this });
|
|
3284
|
-
});
|
|
3285
|
-
ref.ended.subscribe(
|
|
3286
|
-
|
|
3590
|
+
}));
|
|
3591
|
+
ref.ended.subscribe((/**
|
|
3592
|
+
* @param {?} event
|
|
3593
|
+
* @return {?}
|
|
3594
|
+
*/
|
|
3595
|
+
function (event) {
|
|
3596
|
+
_this.ended.emit({ source: _this, distance: event.distance });
|
|
3287
3597
|
// Since all of these events run outside of change detection,
|
|
3288
3598
|
// we need to ensure that everything is marked correctly.
|
|
3289
3599
|
_this._changeDetectorRef.markForCheck();
|
|
3290
|
-
});
|
|
3291
|
-
ref.entered.subscribe(
|
|
3600
|
+
}));
|
|
3601
|
+
ref.entered.subscribe((/**
|
|
3602
|
+
* @param {?} event
|
|
3603
|
+
* @return {?}
|
|
3604
|
+
*/
|
|
3605
|
+
function (event) {
|
|
3292
3606
|
_this.entered.emit({
|
|
3293
3607
|
container: event.container.data,
|
|
3294
|
-
item: _this
|
|
3608
|
+
item: _this,
|
|
3609
|
+
currentIndex: event.currentIndex
|
|
3295
3610
|
});
|
|
3296
|
-
});
|
|
3297
|
-
ref.exited.subscribe(
|
|
3611
|
+
}));
|
|
3612
|
+
ref.exited.subscribe((/**
|
|
3613
|
+
* @param {?} event
|
|
3614
|
+
* @return {?}
|
|
3615
|
+
*/
|
|
3616
|
+
function (event) {
|
|
3298
3617
|
_this.exited.emit({
|
|
3299
3618
|
container: event.container.data,
|
|
3300
3619
|
item: _this
|
|
3301
3620
|
});
|
|
3302
|
-
});
|
|
3303
|
-
ref.dropped.subscribe(
|
|
3621
|
+
}));
|
|
3622
|
+
ref.dropped.subscribe((/**
|
|
3623
|
+
* @param {?} event
|
|
3624
|
+
* @return {?}
|
|
3625
|
+
*/
|
|
3626
|
+
function (event) {
|
|
3304
3627
|
_this.dropped.emit({
|
|
3305
3628
|
previousIndex: event.previousIndex,
|
|
3306
3629
|
currentIndex: event.currentIndex,
|
|
3307
3630
|
previousContainer: event.previousContainer.data,
|
|
3308
3631
|
container: event.container.data,
|
|
3309
3632
|
isPointerOverContainer: event.isPointerOverContainer,
|
|
3310
|
-
item: _this
|
|
3633
|
+
item: _this,
|
|
3634
|
+
distance: event.distance
|
|
3311
3635
|
});
|
|
3312
|
-
});
|
|
3636
|
+
}));
|
|
3313
3637
|
};
|
|
3314
3638
|
CdkDrag.decorators = [
|
|
3315
3639
|
{ type: Directive, args: [{
|
|
@@ -3342,7 +3666,7 @@ var CdkDrag = /** @class */ (function () {
|
|
|
3342
3666
|
data: [{ type: Input, args: ['cdkDragData',] }],
|
|
3343
3667
|
lockAxis: [{ type: Input, args: ['cdkDragLockAxis',] }],
|
|
3344
3668
|
rootElementSelector: [{ type: Input, args: ['cdkDragRootElement',] }],
|
|
3345
|
-
|
|
3669
|
+
boundaryElement: [{ type: Input, args: ['cdkDragBoundary',] }],
|
|
3346
3670
|
dragStartDelay: [{ type: Input, args: ['cdkDragStartDelay',] }],
|
|
3347
3671
|
freeDragPosition: [{ type: Input, args: ['cdkDragFreeDragPosition',] }],
|
|
3348
3672
|
disabled: [{ type: Input, args: ['cdkDragDisabled',] }],
|
|
@@ -3379,7 +3703,7 @@ function getClosestMatchingAncestor(element, selector) {
|
|
|
3379
3703
|
|
|
3380
3704
|
/**
|
|
3381
3705
|
* @fileoverview added by tsickle
|
|
3382
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3706
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3383
3707
|
*/
|
|
3384
3708
|
/**
|
|
3385
3709
|
* Declaratively connects sibling `cdkDropList` instances together. All of the `cdkDropList`
|
|
@@ -3436,7 +3760,7 @@ var CdkDropListGroup = /** @class */ (function () {
|
|
|
3436
3760
|
|
|
3437
3761
|
/**
|
|
3438
3762
|
* @fileoverview added by tsickle
|
|
3439
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3763
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3440
3764
|
*/
|
|
3441
3765
|
/**
|
|
3442
3766
|
* Counter used to generate unique ids for drop zones.
|
|
@@ -3483,7 +3807,10 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3483
3807
|
* Function that is used to determine whether an item
|
|
3484
3808
|
* is allowed to be moved into a drop container.
|
|
3485
3809
|
*/
|
|
3486
|
-
this.enterPredicate =
|
|
3810
|
+
this.enterPredicate = (/**
|
|
3811
|
+
* @return {?}
|
|
3812
|
+
*/
|
|
3813
|
+
function () { return true; });
|
|
3487
3814
|
/**
|
|
3488
3815
|
* Emits when the user drops an item inside the container.
|
|
3489
3816
|
*/
|
|
@@ -3503,9 +3830,14 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3503
3830
|
this.sorted = new EventEmitter();
|
|
3504
3831
|
this._dropListRef = dragDrop.createDropList(element);
|
|
3505
3832
|
this._dropListRef.data = this;
|
|
3506
|
-
this._dropListRef.enterPredicate =
|
|
3833
|
+
this._dropListRef.enterPredicate = (/**
|
|
3834
|
+
* @param {?} drag
|
|
3835
|
+
* @param {?} drop
|
|
3836
|
+
* @return {?}
|
|
3837
|
+
*/
|
|
3838
|
+
function (drag, drop) {
|
|
3507
3839
|
return _this.enterPredicate(drag.data, drop.data);
|
|
3508
|
-
};
|
|
3840
|
+
});
|
|
3509
3841
|
this._syncInputs(this._dropListRef);
|
|
3510
3842
|
this._handleEvents(this._dropListRef);
|
|
3511
3843
|
CdkDropList._dropLists.push(this);
|
|
@@ -3559,9 +3891,17 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3559
3891
|
var _this = this;
|
|
3560
3892
|
this._draggables.changes
|
|
3561
3893
|
.pipe(startWith(this._draggables), takeUntil(this._destroyed))
|
|
3562
|
-
.subscribe(
|
|
3563
|
-
|
|
3564
|
-
|
|
3894
|
+
.subscribe((/**
|
|
3895
|
+
* @param {?} items
|
|
3896
|
+
* @return {?}
|
|
3897
|
+
*/
|
|
3898
|
+
function (items) {
|
|
3899
|
+
_this._dropListRef.withItems(items.map((/**
|
|
3900
|
+
* @param {?} drag
|
|
3901
|
+
* @return {?}
|
|
3902
|
+
*/
|
|
3903
|
+
function (drag) { return drag._dragRef; })));
|
|
3904
|
+
}));
|
|
3565
3905
|
};
|
|
3566
3906
|
/**
|
|
3567
3907
|
* @return {?}
|
|
@@ -3772,28 +4112,55 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3772
4112
|
if (this._dir) {
|
|
3773
4113
|
this._dir.change
|
|
3774
4114
|
.pipe(startWith(this._dir.value), takeUntil(this._destroyed))
|
|
3775
|
-
.subscribe(
|
|
4115
|
+
.subscribe((/**
|
|
4116
|
+
* @param {?} value
|
|
4117
|
+
* @return {?}
|
|
4118
|
+
*/
|
|
4119
|
+
function (value) { return ref.withDirection(value); }));
|
|
3776
4120
|
}
|
|
3777
|
-
ref.beforeStarted.subscribe(
|
|
4121
|
+
ref.beforeStarted.subscribe((/**
|
|
4122
|
+
* @return {?}
|
|
4123
|
+
*/
|
|
4124
|
+
function () {
|
|
3778
4125
|
/** @type {?} */
|
|
3779
|
-
var siblings = coerceArray(_this.connectedTo).map(
|
|
4126
|
+
var siblings = coerceArray(_this.connectedTo).map((/**
|
|
4127
|
+
* @param {?} drop
|
|
4128
|
+
* @return {?}
|
|
4129
|
+
*/
|
|
4130
|
+
function (drop) {
|
|
3780
4131
|
return typeof drop === 'string' ?
|
|
3781
|
-
(/** @type {?} */ (CdkDropList._dropLists.find(
|
|
3782
|
-
|
|
4132
|
+
(/** @type {?} */ (CdkDropList._dropLists.find((/**
|
|
4133
|
+
* @param {?} list
|
|
4134
|
+
* @return {?}
|
|
4135
|
+
*/
|
|
4136
|
+
function (list) { return list.id === drop; })))) : drop;
|
|
4137
|
+
}));
|
|
3783
4138
|
if (_this._group) {
|
|
3784
|
-
_this._group._items.forEach(
|
|
4139
|
+
_this._group._items.forEach((/**
|
|
4140
|
+
* @param {?} drop
|
|
4141
|
+
* @return {?}
|
|
4142
|
+
*/
|
|
4143
|
+
function (drop) {
|
|
3785
4144
|
if (siblings.indexOf(drop) === -1) {
|
|
3786
4145
|
siblings.push(drop);
|
|
3787
4146
|
}
|
|
3788
|
-
});
|
|
4147
|
+
}));
|
|
3789
4148
|
}
|
|
3790
4149
|
ref.disabled = _this.disabled;
|
|
3791
4150
|
ref.lockAxis = _this.lockAxis;
|
|
3792
4151
|
ref.sortingDisabled = _this.sortingDisabled;
|
|
3793
4152
|
ref
|
|
3794
|
-
.connectedTo(siblings.filter(
|
|
4153
|
+
.connectedTo(siblings.filter((/**
|
|
4154
|
+
* @param {?} drop
|
|
4155
|
+
* @return {?}
|
|
4156
|
+
*/
|
|
4157
|
+
function (drop) { return drop && drop !== _this; })).map((/**
|
|
4158
|
+
* @param {?} list
|
|
4159
|
+
* @return {?}
|
|
4160
|
+
*/
|
|
4161
|
+
function (list) { return list._dropListRef; })))
|
|
3795
4162
|
.withOrientation(_this.orientation);
|
|
3796
|
-
});
|
|
4163
|
+
}));
|
|
3797
4164
|
};
|
|
3798
4165
|
/** Handles events from the underlying DropListRef. */
|
|
3799
4166
|
/**
|
|
@@ -3810,43 +4177,64 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3810
4177
|
*/
|
|
3811
4178
|
function (ref) {
|
|
3812
4179
|
var _this = this;
|
|
3813
|
-
ref.beforeStarted.subscribe(
|
|
4180
|
+
ref.beforeStarted.subscribe((/**
|
|
4181
|
+
* @return {?}
|
|
4182
|
+
*/
|
|
4183
|
+
function () {
|
|
3814
4184
|
_this._changeDetectorRef.markForCheck();
|
|
3815
|
-
});
|
|
3816
|
-
ref.entered.subscribe(
|
|
4185
|
+
}));
|
|
4186
|
+
ref.entered.subscribe((/**
|
|
4187
|
+
* @param {?} event
|
|
4188
|
+
* @return {?}
|
|
4189
|
+
*/
|
|
4190
|
+
function (event) {
|
|
3817
4191
|
_this.entered.emit({
|
|
3818
4192
|
container: _this,
|
|
3819
|
-
item: event.item.data
|
|
4193
|
+
item: event.item.data,
|
|
4194
|
+
currentIndex: event.currentIndex
|
|
3820
4195
|
});
|
|
3821
|
-
});
|
|
3822
|
-
ref.exited.subscribe(
|
|
4196
|
+
}));
|
|
4197
|
+
ref.exited.subscribe((/**
|
|
4198
|
+
* @param {?} event
|
|
4199
|
+
* @return {?}
|
|
4200
|
+
*/
|
|
4201
|
+
function (event) {
|
|
3823
4202
|
_this.exited.emit({
|
|
3824
4203
|
container: _this,
|
|
3825
4204
|
item: event.item.data
|
|
3826
4205
|
});
|
|
3827
4206
|
_this._changeDetectorRef.markForCheck();
|
|
3828
|
-
});
|
|
3829
|
-
ref.sorted.subscribe(
|
|
4207
|
+
}));
|
|
4208
|
+
ref.sorted.subscribe((/**
|
|
4209
|
+
* @param {?} event
|
|
4210
|
+
* @return {?}
|
|
4211
|
+
*/
|
|
4212
|
+
function (event) {
|
|
3830
4213
|
_this.sorted.emit({
|
|
3831
4214
|
previousIndex: event.previousIndex,
|
|
3832
4215
|
currentIndex: event.currentIndex,
|
|
3833
4216
|
container: _this,
|
|
3834
4217
|
item: event.item.data
|
|
3835
4218
|
});
|
|
3836
|
-
});
|
|
3837
|
-
ref.dropped.subscribe(
|
|
4219
|
+
}));
|
|
4220
|
+
ref.dropped.subscribe((/**
|
|
4221
|
+
* @param {?} event
|
|
4222
|
+
* @return {?}
|
|
4223
|
+
*/
|
|
4224
|
+
function (event) {
|
|
3838
4225
|
_this.dropped.emit({
|
|
3839
4226
|
previousIndex: event.previousIndex,
|
|
3840
4227
|
currentIndex: event.currentIndex,
|
|
3841
4228
|
previousContainer: event.previousContainer.data,
|
|
3842
4229
|
container: event.container.data,
|
|
3843
4230
|
item: event.item.data,
|
|
3844
|
-
isPointerOverContainer: event.isPointerOverContainer
|
|
4231
|
+
isPointerOverContainer: event.isPointerOverContainer,
|
|
4232
|
+
distance: event.distance
|
|
3845
4233
|
});
|
|
3846
4234
|
// Mark for check since all of these events run outside of change
|
|
3847
4235
|
// detection and we're not guaranteed for something else to have triggered it.
|
|
3848
4236
|
_this._changeDetectorRef.markForCheck();
|
|
3849
|
-
});
|
|
4237
|
+
}));
|
|
3850
4238
|
};
|
|
3851
4239
|
/**
|
|
3852
4240
|
* Keeps track of the drop lists that are currently on the page.
|
|
@@ -3879,7 +4267,10 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3879
4267
|
{ type: CdkDropListGroup, decorators: [{ type: Optional }, { type: SkipSelf }] }
|
|
3880
4268
|
]; };
|
|
3881
4269
|
CdkDropList.propDecorators = {
|
|
3882
|
-
_draggables: [{ type: ContentChildren, args: [forwardRef(
|
|
4270
|
+
_draggables: [{ type: ContentChildren, args: [forwardRef((/**
|
|
4271
|
+
* @return {?}
|
|
4272
|
+
*/
|
|
4273
|
+
function () { return CdkDrag; })), {
|
|
3883
4274
|
// Explicitly set to false since some of the logic below makes assumptions about it.
|
|
3884
4275
|
// The `.withItems` call below should be updated if we ever need to switch this to `true`.
|
|
3885
4276
|
descendants: false
|
|
@@ -3902,7 +4293,7 @@ var CdkDropList = /** @class */ (function () {
|
|
|
3902
4293
|
|
|
3903
4294
|
/**
|
|
3904
4295
|
* @fileoverview added by tsickle
|
|
3905
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4296
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3906
4297
|
*/
|
|
3907
4298
|
var DragDropModule = /** @class */ (function () {
|
|
3908
4299
|
function DragDropModule() {
|
|
@@ -3935,12 +4326,12 @@ var DragDropModule = /** @class */ (function () {
|
|
|
3935
4326
|
|
|
3936
4327
|
/**
|
|
3937
4328
|
* @fileoverview added by tsickle
|
|
3938
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4329
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3939
4330
|
*/
|
|
3940
4331
|
|
|
3941
4332
|
/**
|
|
3942
4333
|
* @fileoverview added by tsickle
|
|
3943
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4334
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
3944
4335
|
*/
|
|
3945
4336
|
|
|
3946
4337
|
export { DragDrop, DragRef, DropListRef, CdkDropList, CDK_DROP_LIST, CDK_DROP_LIST_CONTAINER, moveItemInArray, transferArrayItem, copyArrayItem, DragDropModule, DragDropRegistry, CdkDropListGroup, CDK_DRAG_CONFIG_FACTORY, CDK_DRAG_CONFIG, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder, CDK_DRAG_PARENT as ɵb };
|