@tft/interact 12.5.2 → 14.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/esm2020/index.mjs +6 -0
- package/esm2020/lib/directives/account-for-scale.directive.mjs +26 -0
- package/esm2020/lib/directives/apply-scale.directive.mjs +28 -0
- package/esm2020/lib/directives/auto-scroll.directive.mjs +56 -0
- package/esm2020/lib/directives/drag-preview.directive.mjs +20 -0
- package/esm2020/lib/directives/drag-root.directive.mjs +32 -0
- package/esm2020/lib/directives/draggable.directive.mjs +320 -0
- package/esm2020/lib/directives/dropzone.directive.mjs +114 -0
- package/esm2020/lib/directives/gesturable.directive.mjs +82 -0
- package/esm2020/lib/directives/index.mjs +10 -0
- package/esm2020/lib/directives/resizable.directive.mjs +228 -0
- package/esm2020/lib/interact.module.mjs +66 -0
- package/esm2020/lib/models/index.mjs +2 -0
- package/esm2020/lib/models/interact.mjs +28 -0
- package/esm2020/lib/pipes/array-of-n.pipe.mjs +22 -0
- package/esm2020/lib/pipes/index.mjs +2 -0
- package/esm2020/lib/services/interact.service.mjs +197 -0
- package/esm2020/lib/utils/helpers.mjs +35 -0
- package/esm2020/lib/utils/index.mjs +2 -0
- package/esm2020/tft-interact.mjs +5 -0
- package/fesm2015/{tft-interact.js → tft-interact.mjs} +464 -267
- package/fesm2015/tft-interact.mjs.map +1 -0
- package/fesm2020/tft-interact.mjs +1192 -0
- package/fesm2020/tft-interact.mjs.map +1 -0
- package/lib/directives/account-for-scale.directive.d.ts +3 -0
- package/lib/directives/apply-scale.directive.d.ts +3 -0
- package/lib/directives/auto-scroll.directive.d.ts +34 -0
- package/lib/directives/drag-preview.directive.d.ts +3 -0
- package/lib/directives/drag-root.directive.d.ts +3 -0
- package/lib/directives/draggable.directive.d.ts +8 -1
- package/lib/directives/dropzone.directive.d.ts +5 -0
- package/lib/directives/gesturable.directive.d.ts +3 -0
- package/lib/directives/index.d.ts +1 -0
- package/lib/directives/resizable.directive.d.ts +10 -2
- package/lib/interact.module.d.ts +15 -0
- package/lib/pipes/array-of-n.pipe.d.ts +3 -0
- package/lib/services/interact.service.d.ts +3 -0
- package/package.json +24 -11
- package/tft-interact-14.0.0.tgz +0 -0
- package/bundles/tft-interact.umd.js +0 -1419
- package/bundles/tft-interact.umd.js.map +0 -1
- package/esm2015/index.js +0 -6
- package/esm2015/index.js.map +0 -1
- package/esm2015/index.metadata.json +0 -1
- package/esm2015/lib/directives/account-for-scale.directive.js +0 -26
- package/esm2015/lib/directives/account-for-scale.directive.js.map +0 -1
- package/esm2015/lib/directives/account-for-scale.directive.metadata.json +0 -1
- package/esm2015/lib/directives/apply-scale.directive.js +0 -26
- package/esm2015/lib/directives/apply-scale.directive.js.map +0 -1
- package/esm2015/lib/directives/apply-scale.directive.metadata.json +0 -1
- package/esm2015/lib/directives/drag-preview.directive.js +0 -20
- package/esm2015/lib/directives/drag-preview.directive.js.map +0 -1
- package/esm2015/lib/directives/drag-preview.directive.metadata.json +0 -1
- package/esm2015/lib/directives/drag-root.directive.js +0 -27
- package/esm2015/lib/directives/drag-root.directive.js.map +0 -1
- package/esm2015/lib/directives/drag-root.directive.metadata.json +0 -1
- package/esm2015/lib/directives/draggable.directive.js +0 -265
- package/esm2015/lib/directives/draggable.directive.js.map +0 -1
- package/esm2015/lib/directives/draggable.directive.metadata.json +0 -1
- package/esm2015/lib/directives/dropzone.directive.js +0 -103
- package/esm2015/lib/directives/dropzone.directive.js.map +0 -1
- package/esm2015/lib/directives/dropzone.directive.metadata.json +0 -1
- package/esm2015/lib/directives/gesturable.directive.js +0 -77
- package/esm2015/lib/directives/gesturable.directive.js.map +0 -1
- package/esm2015/lib/directives/gesturable.directive.metadata.json +0 -1
- package/esm2015/lib/directives/index.js +0 -9
- package/esm2015/lib/directives/index.js.map +0 -1
- package/esm2015/lib/directives/index.metadata.json +0 -1
- package/esm2015/lib/directives/resizable.directive.js +0 -175
- package/esm2015/lib/directives/resizable.directive.js.map +0 -1
- package/esm2015/lib/directives/resizable.directive.metadata.json +0 -1
- package/esm2015/lib/interact.module.js +0 -42
- package/esm2015/lib/interact.module.js.map +0 -1
- package/esm2015/lib/interact.module.metadata.json +0 -1
- package/esm2015/lib/models/index.js +0 -2
- package/esm2015/lib/models/index.js.map +0 -1
- package/esm2015/lib/models/index.metadata.json +0 -1
- package/esm2015/lib/models/interact.js +0 -28
- package/esm2015/lib/models/interact.js.map +0 -1
- package/esm2015/lib/models/interact.metadata.json +0 -1
- package/esm2015/lib/pipes/array-of-n.pipe.js +0 -18
- package/esm2015/lib/pipes/array-of-n.pipe.js.map +0 -1
- package/esm2015/lib/pipes/array-of-n.pipe.metadata.json +0 -1
- package/esm2015/lib/pipes/index.js +0 -2
- package/esm2015/lib/pipes/index.js.map +0 -1
- package/esm2015/lib/pipes/index.metadata.json +0 -1
- package/esm2015/lib/services/interact.service.js +0 -196
- package/esm2015/lib/services/interact.service.js.map +0 -1
- package/esm2015/lib/services/interact.service.metadata.json +0 -1
- package/esm2015/lib/utils/helpers.js +0 -35
- package/esm2015/lib/utils/helpers.js.map +0 -1
- package/esm2015/lib/utils/helpers.metadata.json +0 -1
- package/esm2015/lib/utils/index.js +0 -2
- package/esm2015/lib/utils/index.js.map +0 -1
- package/esm2015/lib/utils/index.metadata.json +0 -1
- package/esm2015/tft-interact.js +0 -7
- package/esm2015/tft-interact.js.map +0 -1
- package/esm2015/tft-interact.metadata.json +0 -1
- package/fesm2015/tft-interact.js.map +0 -1
- package/tft-interact-12.5.2.tgz +0 -0
- package/tft-interact.d.ts +0 -6
- package/tft-interact.metadata.json +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, InjectionToken,
|
|
2
|
+
import { Pipe, InjectionToken, Directive, Input, Injectable, Optional, Inject, EventEmitter, HostBinding, Output, Self, HostListener, SkipSelf, ContentChild, NgModule } from '@angular/core';
|
|
3
3
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
4
4
|
import interact from 'interactjs';
|
|
5
|
-
import { BehaviorSubject, combineLatest } from 'rxjs';
|
|
6
|
-
import { shareReplay, tap, map } from 'rxjs/operators';
|
|
5
|
+
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
|
|
6
|
+
import { shareReplay, tap, map, scan } from 'rxjs/operators';
|
|
7
7
|
|
|
8
8
|
class ArrayOfNPipe {
|
|
9
9
|
/**
|
|
@@ -16,11 +16,14 @@ class ArrayOfNPipe {
|
|
|
16
16
|
return new Array(length).fill(length).map((x, i) => i);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
ArrayOfNPipe
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
ArrayOfNPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ArrayOfNPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
20
|
+
ArrayOfNPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: ArrayOfNPipe, name: "arrayOfN" });
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ArrayOfNPipe, decorators: [{
|
|
22
|
+
type: Pipe,
|
|
23
|
+
args: [{
|
|
24
|
+
name: 'arrayOfN'
|
|
25
|
+
}]
|
|
26
|
+
}] });
|
|
24
27
|
|
|
25
28
|
const INTERACT_ROOT_CONFIG = new InjectionToken('INTERACT_ROOT_CONFIG_PARAMS');
|
|
26
29
|
const DEFAULT_REGISTRY_ID = 'DEFAULT';
|
|
@@ -49,6 +52,59 @@ const defaultPosition = {
|
|
|
49
52
|
targetElement: null
|
|
50
53
|
};
|
|
51
54
|
|
|
55
|
+
const TFT_DRAG_PREVIEW = new InjectionToken('DragPreviewDirective');
|
|
56
|
+
class DragPreviewDirective {
|
|
57
|
+
constructor(templateRef) {
|
|
58
|
+
this.templateRef = templateRef;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
DragPreviewDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DragPreviewDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
62
|
+
DragPreviewDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: DragPreviewDirective, selector: "ng-template[tftDragPreview]", inputs: { dragData: "dragData" }, ngImport: i0 });
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DragPreviewDirective, decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{
|
|
66
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
67
|
+
selector: 'ng-template[tftDragPreview]',
|
|
68
|
+
}]
|
|
69
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { dragData: [{
|
|
70
|
+
type: Input
|
|
71
|
+
}] } });
|
|
72
|
+
|
|
73
|
+
/** Gets the closest ancestor of an element that matches a selector. */
|
|
74
|
+
function getClosestMatchingAncestor(element, selector) {
|
|
75
|
+
let currentElement = element.parentElement;
|
|
76
|
+
while (currentElement) {
|
|
77
|
+
// IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.
|
|
78
|
+
if (currentElement.matches ? currentElement.matches(selector) :
|
|
79
|
+
currentElement.msMatchesSelector(selector)) {
|
|
80
|
+
return currentElement;
|
|
81
|
+
}
|
|
82
|
+
currentElement = currentElement.parentElement;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create a copy of the HTML Element
|
|
88
|
+
*/
|
|
89
|
+
function cloneElement$1(element) {
|
|
90
|
+
const clone = element.cloneNode(true);
|
|
91
|
+
clone.removeAttribute('id');
|
|
92
|
+
return clone;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Gets the root HTML element of an embedded view.
|
|
96
|
+
* If the root is not an HTML element it gets wrapped in one.
|
|
97
|
+
*/
|
|
98
|
+
function getRootNode(viewRef, _document) {
|
|
99
|
+
const rootNodes = viewRef.rootNodes;
|
|
100
|
+
if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {
|
|
101
|
+
return rootNodes[0];
|
|
102
|
+
}
|
|
103
|
+
const wrapper = _document.createElement('div');
|
|
104
|
+
rootNodes.forEach(node => wrapper.appendChild(node));
|
|
105
|
+
return wrapper;
|
|
106
|
+
}
|
|
107
|
+
|
|
52
108
|
class InteractService {
|
|
53
109
|
constructor(rendererFactory, ngZone, rootConfig) {
|
|
54
110
|
this.rendererFactory = rendererFactory;
|
|
@@ -229,15 +285,19 @@ class InteractService {
|
|
|
229
285
|
return position;
|
|
230
286
|
}
|
|
231
287
|
}
|
|
232
|
-
InteractService.ɵ
|
|
233
|
-
InteractService
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
288
|
+
InteractService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractService, deps: [{ token: i0.RendererFactory2 }, { token: i0.NgZone }, { token: INTERACT_ROOT_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
289
|
+
InteractService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractService, providedIn: 'root' });
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractService, decorators: [{
|
|
291
|
+
type: Injectable,
|
|
292
|
+
args: [{ providedIn: 'root' }]
|
|
293
|
+
}], ctorParameters: function () {
|
|
294
|
+
return [{ type: i0.RendererFactory2 }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
295
|
+
type: Optional
|
|
296
|
+
}, {
|
|
297
|
+
type: Inject,
|
|
298
|
+
args: [INTERACT_ROOT_CONFIG]
|
|
299
|
+
}] }];
|
|
300
|
+
} });
|
|
241
301
|
|
|
242
302
|
/**
|
|
243
303
|
* Use to apply scale to the element and tell the drag and resize directives to account for the scale when
|
|
@@ -252,17 +312,16 @@ class AccountForScaleDirective {
|
|
|
252
312
|
this.scale = 1;
|
|
253
313
|
}
|
|
254
314
|
}
|
|
255
|
-
AccountForScaleDirective
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
];
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
};
|
|
315
|
+
AccountForScaleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AccountForScaleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
316
|
+
AccountForScaleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: AccountForScaleDirective, selector: "[tftAccountForScale]", inputs: { scale: "scale" }, ngImport: i0 });
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AccountForScaleDirective, decorators: [{
|
|
318
|
+
type: Directive,
|
|
319
|
+
args: [{
|
|
320
|
+
selector: '[tftAccountForScale]'
|
|
321
|
+
}]
|
|
322
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { scale: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}] } });
|
|
266
325
|
|
|
267
326
|
class DropzoneDirective {
|
|
268
327
|
constructor(el, renderer, interactService, account_for_scale_dir) {
|
|
@@ -271,6 +330,7 @@ class DropzoneDirective {
|
|
|
271
330
|
this.interactService = interactService;
|
|
272
331
|
this.account_for_scale_dir = account_for_scale_dir;
|
|
273
332
|
this.dropzoneConfig = {};
|
|
333
|
+
this.position = 'relative';
|
|
274
334
|
// proxies to pass interact events through to consumer of directive
|
|
275
335
|
this.dropActivate = new EventEmitter();
|
|
276
336
|
this.dragEnter = new EventEmitter();
|
|
@@ -339,83 +399,40 @@ class DropzoneDirective {
|
|
|
339
399
|
};
|
|
340
400
|
}
|
|
341
401
|
}
|
|
342
|
-
DropzoneDirective
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
]
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
];
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
},] }
|
|
377
|
-
];
|
|
378
|
-
DragPreviewDirective.ctorParameters = () => [
|
|
379
|
-
{ type: TemplateRef }
|
|
380
|
-
];
|
|
381
|
-
DragPreviewDirective.propDecorators = {
|
|
382
|
-
dragData: [{ type: Input }]
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
/** Gets the closest ancestor of an element that matches a selector. */
|
|
386
|
-
function getClosestMatchingAncestor(element, selector) {
|
|
387
|
-
let currentElement = element.parentElement;
|
|
388
|
-
while (currentElement) {
|
|
389
|
-
// IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.
|
|
390
|
-
if (currentElement.matches ? currentElement.matches(selector) :
|
|
391
|
-
currentElement.msMatchesSelector(selector)) {
|
|
392
|
-
return currentElement;
|
|
393
|
-
}
|
|
394
|
-
currentElement = currentElement.parentElement;
|
|
395
|
-
}
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Create a copy of the HTML Element
|
|
400
|
-
*/
|
|
401
|
-
function cloneElement$1(element) {
|
|
402
|
-
const clone = element.cloneNode(true);
|
|
403
|
-
clone.removeAttribute('id');
|
|
404
|
-
return clone;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Gets the root HTML element of an embedded view.
|
|
408
|
-
* If the root is not an HTML element it gets wrapped in one.
|
|
409
|
-
*/
|
|
410
|
-
function getRootNode(viewRef, _document) {
|
|
411
|
-
const rootNodes = viewRef.rootNodes;
|
|
412
|
-
if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {
|
|
413
|
-
return rootNodes[0];
|
|
414
|
-
}
|
|
415
|
-
const wrapper = _document.createElement('div');
|
|
416
|
-
rootNodes.forEach(node => wrapper.appendChild(node));
|
|
417
|
-
return wrapper;
|
|
418
|
-
}
|
|
402
|
+
DropzoneDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DropzoneDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: InteractService }, { token: AccountForScaleDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
403
|
+
DropzoneDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: DropzoneDirective, selector: "[tftDropzone]", inputs: { dropzoneId: "dropzoneId", dropzoneConfig: "dropzoneConfig", dropzoneData: "dropzoneData", position: "position" }, outputs: { dropActivate: "dropActivate", dragEnter: "dragEnter", dragLeave: "dragLeave", dragDrop: "dragDrop" }, host: { properties: { "id": "dropzoneId", "style.position": "this.position" } }, usesOnChanges: true, ngImport: i0 });
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DropzoneDirective, decorators: [{
|
|
405
|
+
type: Directive,
|
|
406
|
+
args: [{
|
|
407
|
+
selector: '[tftDropzone]',
|
|
408
|
+
host: {
|
|
409
|
+
'[id]': 'dropzoneId'
|
|
410
|
+
}
|
|
411
|
+
}]
|
|
412
|
+
}], ctorParameters: function () {
|
|
413
|
+
return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: InteractService }, { type: AccountForScaleDirective, decorators: [{
|
|
414
|
+
type: Optional
|
|
415
|
+
}] }];
|
|
416
|
+
}, propDecorators: { dropzoneId: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}], dropzoneConfig: [{
|
|
419
|
+
type: Input
|
|
420
|
+
}], dropzoneData: [{
|
|
421
|
+
type: Input
|
|
422
|
+
}], position: [{
|
|
423
|
+
type: Input
|
|
424
|
+
}, {
|
|
425
|
+
type: HostBinding,
|
|
426
|
+
args: ['style.position']
|
|
427
|
+
}], dropActivate: [{
|
|
428
|
+
type: Output
|
|
429
|
+
}], dragEnter: [{
|
|
430
|
+
type: Output
|
|
431
|
+
}], dragLeave: [{
|
|
432
|
+
type: Output
|
|
433
|
+
}], dragDrop: [{
|
|
434
|
+
type: Output
|
|
435
|
+
}] } });
|
|
419
436
|
|
|
420
437
|
/**
|
|
421
438
|
* Use this directive to select which element to attach the element to while dragging
|
|
@@ -431,21 +448,78 @@ class DragRootDirective {
|
|
|
431
448
|
this.account_for_scale_dir = account_for_scale_dir;
|
|
432
449
|
}
|
|
433
450
|
}
|
|
434
|
-
DragRootDirective
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
]
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
451
|
+
DragRootDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DragRootDirective, deps: [{ token: i0.ElementRef }, { token: AccountForScaleDirective, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
452
|
+
DragRootDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: DragRootDirective, selector: "[tftDragRoot]", exportAs: ["tftDragRoot"], ngImport: i0 });
|
|
453
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DragRootDirective, decorators: [{
|
|
454
|
+
type: Directive,
|
|
455
|
+
args: [{
|
|
456
|
+
selector: '[tftDragRoot]',
|
|
457
|
+
exportAs: 'tftDragRoot'
|
|
458
|
+
}]
|
|
459
|
+
}], ctorParameters: function () {
|
|
460
|
+
return [{ type: i0.ElementRef }, { type: AccountForScaleDirective, decorators: [{
|
|
461
|
+
type: Optional
|
|
462
|
+
}, {
|
|
463
|
+
type: Self
|
|
464
|
+
}] }];
|
|
465
|
+
} });
|
|
466
|
+
|
|
467
|
+
;
|
|
468
|
+
/**
|
|
469
|
+
* Use to apply scale to the element and tell the drag and resize directives to account for the scale when
|
|
470
|
+
* @example <div tftAccountForScale [scale]="2.5"> <div tftDraggable> </div> </div>
|
|
471
|
+
* @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag
|
|
472
|
+
* element accounts for scale
|
|
473
|
+
*/
|
|
474
|
+
class AutoScrollDirective {
|
|
475
|
+
constructor(el) {
|
|
476
|
+
this.el = el;
|
|
477
|
+
/**
|
|
478
|
+
* Limit minimum time between scroll events in milliseconds
|
|
479
|
+
*/
|
|
480
|
+
this.autoScrollConfig = {
|
|
481
|
+
margin: 50,
|
|
482
|
+
distance: 3,
|
|
483
|
+
interval: 50,
|
|
484
|
+
speed: 300,
|
|
485
|
+
enabled: true
|
|
486
|
+
};
|
|
487
|
+
this.scrollDeltaObserver = new Subject();
|
|
488
|
+
const { scrollTop, scrollLeft } = el.nativeElement;
|
|
489
|
+
this.scrollSubject = new BehaviorSubject({ scrollTop, scrollLeft });
|
|
490
|
+
this.scrollObserver = this.scrollSubject.pipe(scan((previous, current) => {
|
|
491
|
+
const scrollTop = current.scrollTop - previous.scrollTop;
|
|
492
|
+
const scrollLeft = current.scrollLeft - previous.scrollLeft;
|
|
493
|
+
this.scrollDeltaObserver.next({ scrollTop, scrollLeft });
|
|
494
|
+
return current;
|
|
495
|
+
}), shareReplay(1));
|
|
496
|
+
this.scrollObserver.subscribe();
|
|
497
|
+
}
|
|
498
|
+
// this setup allows consumers to set x, y scale independently or just set them both with scale
|
|
499
|
+
scroll(scrollEvent) {
|
|
500
|
+
const target = scrollEvent.target;
|
|
501
|
+
const { scrollTop, scrollLeft } = target;
|
|
502
|
+
this.scrollSubject.next({ scrollTop, scrollLeft });
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
AutoScrollDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutoScrollDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
506
|
+
AutoScrollDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: AutoScrollDirective, selector: "[tftAutoScroll]", inputs: { autoScrollConfig: "autoScrollConfig" }, host: { listeners: { "scroll": "scroll($event)" } }, ngImport: i0 });
|
|
507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: AutoScrollDirective, decorators: [{
|
|
508
|
+
type: Directive,
|
|
509
|
+
args: [{
|
|
510
|
+
selector: '[tftAutoScroll]'
|
|
511
|
+
}]
|
|
512
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { autoScrollConfig: [{
|
|
513
|
+
type: Input
|
|
514
|
+
}], scroll: [{
|
|
515
|
+
type: HostListener,
|
|
516
|
+
args: ['scroll', ['$event']]
|
|
517
|
+
}] } });
|
|
444
518
|
|
|
445
519
|
/** @dynamic */
|
|
446
520
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
447
521
|
class DraggableDirective {
|
|
448
|
-
constructor(el, interactService, renderer, _viewContainerRef, _document, account_for_scale_dir, dropzone_dir, drag_root_dir) {
|
|
522
|
+
constructor(el, interactService, renderer, _viewContainerRef, _document, account_for_scale_dir, dropzone_dir, drag_root_dir, auto_scroll_dir) {
|
|
449
523
|
this.el = el;
|
|
450
524
|
this.interactService = interactService;
|
|
451
525
|
this.renderer = renderer;
|
|
@@ -454,6 +528,7 @@ class DraggableDirective {
|
|
|
454
528
|
this.account_for_scale_dir = account_for_scale_dir;
|
|
455
529
|
this.dropzone_dir = dropzone_dir;
|
|
456
530
|
this.drag_root_dir = drag_root_dir;
|
|
531
|
+
this.auto_scroll_dir = auto_scroll_dir;
|
|
457
532
|
/* zIndex while dragging*/
|
|
458
533
|
this.dragZIndex = 10000;
|
|
459
534
|
this.enableDragDefault = true;
|
|
@@ -471,8 +546,8 @@ class DraggableDirective {
|
|
|
471
546
|
}
|
|
472
547
|
// check all the different places for scale
|
|
473
548
|
get scale() {
|
|
474
|
-
var _a, _b, _c, _d;
|
|
475
|
-
return ((_a = this.account_for_scale_dir) === null || _a === void 0 ? void 0 : _a.scale) || ((_b = this.drag_root_dir) === null || _b === void 0 ? void 0 : _b.account_for_scale_dir.scale) || ((
|
|
549
|
+
var _a, _b, _c, _d, _e;
|
|
550
|
+
return ((_a = this.account_for_scale_dir) === null || _a === void 0 ? void 0 : _a.scale) || ((_c = (_b = this.drag_root_dir) === null || _b === void 0 ? void 0 : _b.account_for_scale_dir) === null || _c === void 0 ? void 0 : _c.scale) || ((_e = (_d = this.dragRoot) === null || _d === void 0 ? void 0 : _d.account_for_scale_dir) === null || _e === void 0 ? void 0 : _e.scale) || 1;
|
|
476
551
|
}
|
|
477
552
|
ngOnInit() {
|
|
478
553
|
var _a, _b, _c, _d, _e;
|
|
@@ -580,7 +655,10 @@ class DraggableDirective {
|
|
|
580
655
|
return typeof num === 'number' && !isNaN(num);
|
|
581
656
|
}
|
|
582
657
|
initiateDragEvents(dragConfig, nativeElement) {
|
|
583
|
-
|
|
658
|
+
const defaultDragConfig = Object.assign(Object.assign(Object.assign({}, dragConfig), { enabled: !(this.disabled || this.dragDisabled) }), (this.auto_scroll_dir && {
|
|
659
|
+
autoScroll: Object.assign(Object.assign({}, this.auto_scroll_dir.autoScrollConfig), { container: this.auto_scroll_dir.el.nativeElement })
|
|
660
|
+
}));
|
|
661
|
+
return interact(nativeElement).draggable(defaultDragConfig)
|
|
584
662
|
.on('dragstart', (event) => {
|
|
585
663
|
var _a, _b, _c;
|
|
586
664
|
const interaction = event.interaction;
|
|
@@ -608,6 +686,10 @@ class DraggableDirective {
|
|
|
608
686
|
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
609
687
|
}
|
|
610
688
|
}
|
|
689
|
+
// subscribe to scroll events if they are there, by only subscribing on dragstart we avoid wasting subscriptions on interactables that aren't be dragged
|
|
690
|
+
if (this.auto_scroll_dir) {
|
|
691
|
+
this.subscribeToScrollEvents();
|
|
692
|
+
}
|
|
611
693
|
this.dragStart.emit(this.mapDragEvent(event));
|
|
612
694
|
})
|
|
613
695
|
.on('dragmove', (event) => {
|
|
@@ -629,6 +711,10 @@ class DraggableDirective {
|
|
|
629
711
|
}
|
|
630
712
|
this.renderer.setStyle(this.el.nativeElement, 'display', '');
|
|
631
713
|
this.dragEnd.emit(mappedEvent);
|
|
714
|
+
// unsubscribe from scroll events if subscribed
|
|
715
|
+
if (this.auto_scroll_dir) {
|
|
716
|
+
this.scrollEventsSubscription.unsubscribe();
|
|
717
|
+
}
|
|
632
718
|
if (this.el.nativeElement !== this.previewRef) {
|
|
633
719
|
// we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect
|
|
634
720
|
setTimeout(() => {
|
|
@@ -637,47 +723,82 @@ class DraggableDirective {
|
|
|
637
723
|
}
|
|
638
724
|
});
|
|
639
725
|
}
|
|
726
|
+
subscribeToScrollEvents() {
|
|
727
|
+
this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({ scrollLeft, scrollTop }) => {
|
|
728
|
+
const deltaX = this.scale ? scrollLeft / this.scale : scrollLeft;
|
|
729
|
+
const deltaY = this.scale ? scrollTop / this.scale : scrollTop;
|
|
730
|
+
this.interactService.updateDeltas(this.interactableId, this.registryId, { deltaX, deltaY }, this.previewRef);
|
|
731
|
+
});
|
|
732
|
+
}
|
|
640
733
|
}
|
|
641
|
-
DraggableDirective
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
'[
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
]
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
734
|
+
DraggableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DraggableDirective, deps: [{ token: i0.ElementRef }, { token: InteractService }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: DOCUMENT }, { token: AccountForScaleDirective, optional: true }, { token: DropzoneDirective, optional: true, skipSelf: true }, { token: DragRootDirective, optional: true, skipSelf: true }, { token: AutoScrollDirective, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
735
|
+
DraggableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: DraggableDirective, selector: "[tftDraggable]", inputs: { x: "x", y: "y", dragZIndex: "dragZIndex", zIndex: "zIndex", interactableId: "interactableId", dragData: "dragData", enableDragDefault: "enableDragDefault", disabled: "disabled", dragDisabled: "dragDisabled", dragConfig: "dragConfig", showPlaceholder: "showPlaceholder", dragRoot: "dragRoot" }, outputs: { dragStart: "dragStart", dragMove: "dragMove", dragInertiaStart: "dragInertiaStart", dragEnd: "dragEnd" }, host: { properties: { "style.touchAction": "this.dragDisabled ? \"auto\" : \"none\"", "style.position": "\"absolute\"", "id": "interactableId" } }, queries: [{ propertyName: "_previewTemplate", first: true, predicate: DragPreviewDirective, descendants: true }], usesOnChanges: true, ngImport: i0 });
|
|
736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: DraggableDirective, decorators: [{
|
|
737
|
+
type: Directive,
|
|
738
|
+
args: [{
|
|
739
|
+
selector: '[tftDraggable]',
|
|
740
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
741
|
+
host: {
|
|
742
|
+
'[style.touchAction]': 'this.dragDisabled ? "auto" : "none"',
|
|
743
|
+
'[style.position]': '"absolute"',
|
|
744
|
+
'[id]': 'interactableId',
|
|
745
|
+
}
|
|
746
|
+
}]
|
|
747
|
+
}], ctorParameters: function () {
|
|
748
|
+
return [{ type: i0.ElementRef }, { type: InteractService }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: Document, decorators: [{
|
|
749
|
+
type: Inject,
|
|
750
|
+
args: [DOCUMENT]
|
|
751
|
+
}] }, { type: AccountForScaleDirective, decorators: [{
|
|
752
|
+
type: Optional
|
|
753
|
+
}] }, { type: DropzoneDirective, decorators: [{
|
|
754
|
+
type: Optional
|
|
755
|
+
}, {
|
|
756
|
+
type: SkipSelf
|
|
757
|
+
}] }, { type: DragRootDirective, decorators: [{
|
|
758
|
+
type: Optional
|
|
759
|
+
}, {
|
|
760
|
+
type: SkipSelf
|
|
761
|
+
}] }, { type: AutoScrollDirective, decorators: [{
|
|
762
|
+
type: Optional
|
|
763
|
+
}, {
|
|
764
|
+
type: SkipSelf
|
|
765
|
+
}] }];
|
|
766
|
+
}, propDecorators: { x: [{
|
|
767
|
+
type: Input
|
|
768
|
+
}], y: [{
|
|
769
|
+
type: Input
|
|
770
|
+
}], dragZIndex: [{
|
|
771
|
+
type: Input
|
|
772
|
+
}], zIndex: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], interactableId: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], dragData: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], enableDragDefault: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], disabled: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}], dragDisabled: [{
|
|
783
|
+
type: Input
|
|
784
|
+
}], dragConfig: [{
|
|
785
|
+
type: Input
|
|
786
|
+
}], showPlaceholder: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], dragRoot: [{
|
|
789
|
+
type: Input
|
|
790
|
+
}], dragStart: [{
|
|
791
|
+
type: Output
|
|
792
|
+
}], dragMove: [{
|
|
793
|
+
type: Output
|
|
794
|
+
}], dragInertiaStart: [{
|
|
795
|
+
type: Output
|
|
796
|
+
}], dragEnd: [{
|
|
797
|
+
type: Output
|
|
798
|
+
}], _previewTemplate: [{
|
|
799
|
+
type: ContentChild,
|
|
800
|
+
args: [DragPreviewDirective]
|
|
801
|
+
}] } });
|
|
681
802
|
/**
|
|
682
803
|
* Component utils
|
|
683
804
|
*/
|
|
@@ -699,7 +820,7 @@ function getPreviewInsertionPoint(documentRef) {
|
|
|
699
820
|
|
|
700
821
|
/** @dynamic */
|
|
701
822
|
class ResizableDirective {
|
|
702
|
-
constructor(el, _document, interactService, renderer, drag_root_dir, account_for_scale_dir, draggable_dir, dropzone_dir) {
|
|
823
|
+
constructor(el, _document, interactService, renderer, drag_root_dir, account_for_scale_dir, draggable_dir, dropzone_dir, auto_scroll_dir) {
|
|
703
824
|
var _a;
|
|
704
825
|
this.el = el;
|
|
705
826
|
this._document = _document;
|
|
@@ -709,6 +830,7 @@ class ResizableDirective {
|
|
|
709
830
|
this.account_for_scale_dir = account_for_scale_dir;
|
|
710
831
|
this.draggable_dir = draggable_dir;
|
|
711
832
|
this.dropzone_dir = dropzone_dir;
|
|
833
|
+
this.auto_scroll_dir = auto_scroll_dir;
|
|
712
834
|
this.enableResizeDefault = true;
|
|
713
835
|
// TODO: should this be an input with default or should consuming user set display in styles each time
|
|
714
836
|
this.position = 'absolute';
|
|
@@ -720,6 +842,7 @@ class ResizableDirective {
|
|
|
720
842
|
this.defaultConfig = {
|
|
721
843
|
edges: { left: true, right: true, bottom: true, top: true }
|
|
722
844
|
};
|
|
845
|
+
this.activeEdges = { left: false, right: false, top: false, bottom: false };
|
|
723
846
|
this.dragRootEl = ((_a = drag_root_dir === null || drag_root_dir === void 0 ? void 0 : drag_root_dir.el) === null || _a === void 0 ? void 0 : _a.nativeElement) || this._document.body;
|
|
724
847
|
}
|
|
725
848
|
get scale() {
|
|
@@ -753,23 +876,16 @@ class ResizableDirective {
|
|
|
753
876
|
this.interactService.destroyInteractable(this.interactableId, this.registryId);
|
|
754
877
|
}
|
|
755
878
|
resizeListener(event) {
|
|
879
|
+
const element = this.el.nativeElement;
|
|
756
880
|
const scale = this.scale;
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
width = event.rect.width / scale;
|
|
766
|
-
}
|
|
767
|
-
else {
|
|
768
|
-
deltaX = event.deltaRect.left;
|
|
769
|
-
deltaY = event.deltaRect.top;
|
|
770
|
-
width = event.rect.width;
|
|
771
|
-
height = event.rect.height;
|
|
772
|
-
}
|
|
881
|
+
const { deltaRect } = event;
|
|
882
|
+
const deltaX = deltaRect.left / scale;
|
|
883
|
+
const deltaY = deltaRect.top / scale;
|
|
884
|
+
// We get the width and height directly from the native element because
|
|
885
|
+
// the event dimension can get out of sync when resizing with autoScroll
|
|
886
|
+
const rect = element.getBoundingClientRect();
|
|
887
|
+
const width = (rect.width + deltaRect.width) / scale;
|
|
888
|
+
const height = (rect.height + deltaRect.height) / scale;
|
|
773
889
|
this.interactService.updateSize(this.interactableId, this.registryId, { deltaX, deltaY, width, height }, this.el.nativeElement);
|
|
774
890
|
}
|
|
775
891
|
/**
|
|
@@ -782,9 +898,18 @@ class ResizableDirective {
|
|
|
782
898
|
initiateResizeEvents(resizeConfig, nativeElement) {
|
|
783
899
|
var _a;
|
|
784
900
|
// TODO: This should try and get interactable from tft_draggable if it exists
|
|
901
|
+
const defaultResizeConfig = Object.assign(Object.assign(Object.assign({}, resizeConfig), { enabled: !this.resizeDisabled }), (this.auto_scroll_dir && {
|
|
902
|
+
autoScroll: Object.assign(Object.assign({}, this.auto_scroll_dir.autoScrollConfig), { container: this.auto_scroll_dir.el.nativeElement })
|
|
903
|
+
}));
|
|
785
904
|
const interactable = ((_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.interactable) || interact(nativeElement);
|
|
786
|
-
return interactable.resizable(
|
|
787
|
-
.on('resizestart', (event) => {
|
|
905
|
+
return interactable.resizable(defaultResizeConfig)
|
|
906
|
+
.on('resizestart', (event) => {
|
|
907
|
+
this.activeEdges = event.edges;
|
|
908
|
+
if (this.auto_scroll_dir) {
|
|
909
|
+
this.subscribeToScrollEvents();
|
|
910
|
+
}
|
|
911
|
+
this.resizeStart.emit(this.mapResizeEvent(event));
|
|
912
|
+
})
|
|
788
913
|
.on('resizemove', (event) => {
|
|
789
914
|
if (this.enableResizeDefault) {
|
|
790
915
|
this.resizeListener(event);
|
|
@@ -793,11 +918,17 @@ class ResizableDirective {
|
|
|
793
918
|
this.resizeMove.emit(mappedEvent);
|
|
794
919
|
})
|
|
795
920
|
.on('resizeinertiastart', (event) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))
|
|
796
|
-
.on('resizeend', (event) =>
|
|
921
|
+
.on('resizeend', (event) => {
|
|
922
|
+
if (this.auto_scroll_dir) {
|
|
923
|
+
this.scrollEventsSubscription.unsubscribe();
|
|
924
|
+
}
|
|
925
|
+
this.activeEdges = { left: false, right: false, top: false, bottom: false };
|
|
926
|
+
this.resizeEnd.emit(this.mapResizeEvent(event));
|
|
927
|
+
});
|
|
797
928
|
}
|
|
798
929
|
mapResizeEvent(event) {
|
|
799
930
|
var _a, _b;
|
|
800
|
-
const target =
|
|
931
|
+
const target = this.el.nativeElement;
|
|
801
932
|
const relatedTarget = (_b = (_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.dropzone_dir) === null || _b === void 0 ? void 0 : _b.el.nativeElement;
|
|
802
933
|
const scale = this.scale;
|
|
803
934
|
const positionInDropTarget = target && relatedTarget
|
|
@@ -822,46 +953,81 @@ class ResizableDirective {
|
|
|
822
953
|
addResizePropertiesToElement(nativeElement) {
|
|
823
954
|
this.renderer.setProperty(nativeElement, 'resizeRef', this);
|
|
824
955
|
}
|
|
956
|
+
subscribeToScrollEvents() {
|
|
957
|
+
this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({ scrollLeft, scrollTop }) => {
|
|
958
|
+
const scale = this.scale;
|
|
959
|
+
const target = this.el.nativeElement;
|
|
960
|
+
const { width: prevWidth, height: prevHeight } = target.getBoundingClientRect();
|
|
961
|
+
const deltaHeight = scrollTop * (this.activeEdges.top ? -1 : this.activeEdges.bottom ? 1 : 0);
|
|
962
|
+
const deltaWidth = scrollLeft * (this.activeEdges.left ? -1 : this.activeEdges.right ? 1 : 0);
|
|
963
|
+
const height = (prevHeight + deltaHeight) / scale;
|
|
964
|
+
const width = (prevWidth + deltaWidth) / scale;
|
|
965
|
+
const deltaX = this.activeEdges.left ? (scrollLeft / scale) : 0;
|
|
966
|
+
const deltaY = this.activeEdges.top ? (scrollTop / scale) : 0;
|
|
967
|
+
this.interactService.updateSize(this.interactableId, this.registryId, { deltaX, deltaY, width, height }, this.el.nativeElement);
|
|
968
|
+
});
|
|
969
|
+
}
|
|
825
970
|
}
|
|
826
|
-
ResizableDirective
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
//
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
]
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
971
|
+
ResizableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ResizableDirective, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }, { token: InteractService }, { token: i0.Renderer2 }, { token: DragRootDirective, optional: true }, { token: AccountForScaleDirective, optional: true }, { token: DraggableDirective, optional: true }, { token: DropzoneDirective, optional: true, skipSelf: true }, { token: AutoScrollDirective, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
972
|
+
ResizableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: ResizableDirective, selector: "[tftResizable]", inputs: { enableResizeDefault: "enableResizeDefault", position: "position", resizeConfig: "resizeConfig", interactableId: "interactableId", width: "width", height: "height", resizeDisabled: "resizeDisabled" }, outputs: { resizeStart: "resizeStart", resizeMove: "resizeMove", resizeInertiaStart: "resizeInertiaStart", resizeEnd: "resizeEnd" }, host: { properties: { "style.touchAction": "this.resizeDisabled ? \"auto\" : \"none\"", "style.position": "position", "style.boxSizing": "\"border-box\"" } }, usesOnChanges: true, ngImport: i0 });
|
|
973
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ResizableDirective, decorators: [{
|
|
974
|
+
type: Directive,
|
|
975
|
+
args: [{
|
|
976
|
+
selector: '[tftResizable]',
|
|
977
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
978
|
+
host: {
|
|
979
|
+
// prevents touch events from colliding with with mouse events
|
|
980
|
+
// on touch screen
|
|
981
|
+
'[style.touchAction]': 'this.resizeDisabled ? "auto" : "none"',
|
|
982
|
+
// default to absolute here to accommodate likely use cases
|
|
983
|
+
// consuming component can easily over ride with position input
|
|
984
|
+
'[style.position]': 'position',
|
|
985
|
+
// follows interactjs suggested practices
|
|
986
|
+
'[style.boxSizing]': '"border-box"',
|
|
987
|
+
}
|
|
988
|
+
}]
|
|
989
|
+
}], ctorParameters: function () {
|
|
990
|
+
return [{ type: i0.ElementRef }, { type: Document, decorators: [{
|
|
991
|
+
type: Inject,
|
|
992
|
+
args: [DOCUMENT]
|
|
993
|
+
}] }, { type: InteractService }, { type: i0.Renderer2 }, { type: DragRootDirective, decorators: [{
|
|
994
|
+
type: Optional
|
|
995
|
+
}] }, { type: AccountForScaleDirective, decorators: [{
|
|
996
|
+
type: Optional
|
|
997
|
+
}] }, { type: DraggableDirective, decorators: [{
|
|
998
|
+
type: Optional
|
|
999
|
+
}] }, { type: DropzoneDirective, decorators: [{
|
|
1000
|
+
type: Optional
|
|
1001
|
+
}, {
|
|
1002
|
+
type: SkipSelf
|
|
1003
|
+
}] }, { type: AutoScrollDirective, decorators: [{
|
|
1004
|
+
type: Optional
|
|
1005
|
+
}, {
|
|
1006
|
+
type: SkipSelf
|
|
1007
|
+
}] }];
|
|
1008
|
+
}, propDecorators: { enableResizeDefault: [{
|
|
1009
|
+
type: Input
|
|
1010
|
+
}], position: [{
|
|
1011
|
+
type: Input
|
|
1012
|
+
}], resizeConfig: [{
|
|
1013
|
+
type: Input
|
|
1014
|
+
}], interactableId: [{
|
|
1015
|
+
type: Input
|
|
1016
|
+
}], width: [{
|
|
1017
|
+
type: Input
|
|
1018
|
+
}], height: [{
|
|
1019
|
+
type: Input
|
|
1020
|
+
}], resizeDisabled: [{
|
|
1021
|
+
type: Input
|
|
1022
|
+
}], resizeStart: [{
|
|
1023
|
+
type: Output
|
|
1024
|
+
}], resizeMove: [{
|
|
1025
|
+
type: Output
|
|
1026
|
+
}], resizeInertiaStart: [{
|
|
1027
|
+
type: Output
|
|
1028
|
+
}], resizeEnd: [{
|
|
1029
|
+
type: Output
|
|
1030
|
+
}] } });
|
|
865
1031
|
|
|
866
1032
|
/** @dynamic */
|
|
867
1033
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -914,28 +1080,35 @@ class GesturableDirective {
|
|
|
914
1080
|
});
|
|
915
1081
|
}
|
|
916
1082
|
}
|
|
917
|
-
GesturableDirective
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
]
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1083
|
+
GesturableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: GesturableDirective, deps: [{ token: i0.ElementRef }, { token: DraggableDirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1084
|
+
GesturableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: GesturableDirective, selector: "[tftGesturable]", inputs: { gesturableId: "gesturableId", gestureDisabled: "gestureDisabled", gestureConfig: "gestureConfig" }, outputs: { gestureStart: "gestureStart", gestureMove: "gestureMove", gestureEnd: "gestureEnd" }, host: { properties: { "id": "gesturableId" } }, usesOnChanges: true, ngImport: i0 });
|
|
1085
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: GesturableDirective, decorators: [{
|
|
1086
|
+
type: Directive,
|
|
1087
|
+
args: [{
|
|
1088
|
+
selector: '[tftGesturable]',
|
|
1089
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
1090
|
+
host: {
|
|
1091
|
+
// '[style.touchAction]': 'this.gestureDisabled ? "auto" : "none"',
|
|
1092
|
+
'[id]': 'gesturableId',
|
|
1093
|
+
}
|
|
1094
|
+
}]
|
|
1095
|
+
}], ctorParameters: function () {
|
|
1096
|
+
return [{ type: i0.ElementRef }, { type: DraggableDirective, decorators: [{
|
|
1097
|
+
type: Optional
|
|
1098
|
+
}] }];
|
|
1099
|
+
}, propDecorators: { gesturableId: [{
|
|
1100
|
+
type: Input
|
|
1101
|
+
}], gestureDisabled: [{
|
|
1102
|
+
type: Input
|
|
1103
|
+
}], gestureConfig: [{
|
|
1104
|
+
type: Input
|
|
1105
|
+
}], gestureStart: [{
|
|
1106
|
+
type: Output
|
|
1107
|
+
}], gestureMove: [{
|
|
1108
|
+
type: Output
|
|
1109
|
+
}], gestureEnd: [{
|
|
1110
|
+
type: Output
|
|
1111
|
+
}] } });
|
|
939
1112
|
|
|
940
1113
|
class ApplyScaleDirective {
|
|
941
1114
|
constructor(el) {
|
|
@@ -949,18 +1122,19 @@ class ApplyScaleDirective {
|
|
|
949
1122
|
}
|
|
950
1123
|
;
|
|
951
1124
|
}
|
|
952
|
-
ApplyScaleDirective
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
];
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1125
|
+
ApplyScaleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ApplyScaleDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1126
|
+
ApplyScaleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: ApplyScaleDirective, selector: "[tftApplyScale]", inputs: { scale: "scale" }, host: { properties: { "style.fontSize": "this.fontSize" } }, ngImport: i0 });
|
|
1127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ApplyScaleDirective, decorators: [{
|
|
1128
|
+
type: Directive,
|
|
1129
|
+
args: [{
|
|
1130
|
+
selector: '[tftApplyScale]'
|
|
1131
|
+
}]
|
|
1132
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { scale: [{
|
|
1133
|
+
type: Input
|
|
1134
|
+
}], fontSize: [{
|
|
1135
|
+
type: HostBinding,
|
|
1136
|
+
args: ['style.fontSize']
|
|
1137
|
+
}] } });
|
|
964
1138
|
|
|
965
1139
|
const EXPORTS = [
|
|
966
1140
|
DraggableDirective,
|
|
@@ -968,6 +1142,7 @@ const EXPORTS = [
|
|
|
968
1142
|
DropzoneDirective,
|
|
969
1143
|
GesturableDirective,
|
|
970
1144
|
DragRootDirective,
|
|
1145
|
+
AutoScrollDirective,
|
|
971
1146
|
AccountForScaleDirective,
|
|
972
1147
|
ApplyScaleDirective,
|
|
973
1148
|
DragPreviewDirective,
|
|
@@ -985,22 +1160,44 @@ class InteractModule {
|
|
|
985
1160
|
};
|
|
986
1161
|
}
|
|
987
1162
|
}
|
|
988
|
-
InteractModule
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1163
|
+
InteractModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1164
|
+
InteractModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: InteractModule, declarations: [DraggableDirective,
|
|
1165
|
+
ResizableDirective,
|
|
1166
|
+
DropzoneDirective,
|
|
1167
|
+
GesturableDirective,
|
|
1168
|
+
DragRootDirective,
|
|
1169
|
+
AutoScrollDirective,
|
|
1170
|
+
AccountForScaleDirective,
|
|
1171
|
+
ApplyScaleDirective,
|
|
1172
|
+
DragPreviewDirective,
|
|
1173
|
+
ArrayOfNPipe], imports: [CommonModule], exports: [DraggableDirective,
|
|
1174
|
+
ResizableDirective,
|
|
1175
|
+
DropzoneDirective,
|
|
1176
|
+
GesturableDirective,
|
|
1177
|
+
DragRootDirective,
|
|
1178
|
+
AutoScrollDirective,
|
|
1179
|
+
AccountForScaleDirective,
|
|
1180
|
+
ApplyScaleDirective,
|
|
1181
|
+
DragPreviewDirective,
|
|
1182
|
+
ArrayOfNPipe] });
|
|
1183
|
+
InteractModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractModule, imports: [CommonModule] });
|
|
1184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: InteractModule, decorators: [{
|
|
1185
|
+
type: NgModule,
|
|
1186
|
+
args: [{
|
|
1187
|
+
imports: [CommonModule],
|
|
1188
|
+
// providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],
|
|
1189
|
+
declarations: [
|
|
1190
|
+
...EXPORTS,
|
|
1191
|
+
],
|
|
1192
|
+
exports: [
|
|
1193
|
+
...EXPORTS
|
|
1194
|
+
]
|
|
1195
|
+
}]
|
|
1196
|
+
}] });
|
|
1000
1197
|
|
|
1001
1198
|
/**
|
|
1002
1199
|
* Generated bundle index. Do not edit.
|
|
1003
1200
|
*/
|
|
1004
1201
|
|
|
1005
|
-
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement$1 as cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode
|
|
1006
|
-
//# sourceMappingURL=tft-interact.
|
|
1202
|
+
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, AutoScrollDirective, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement$1 as cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode };
|
|
1203
|
+
//# sourceMappingURL=tft-interact.mjs.map
|