@tft/interact 12.4.3 → 12.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/bundles/tft-interact.umd.js +255 -120
  2. package/bundles/tft-interact.umd.js.map +1 -1
  3. package/esm2015/lib/directives/account-for-scale.directive.js +3 -11
  4. package/esm2015/lib/directives/account-for-scale.directive.js.map +1 -1
  5. package/esm2015/lib/directives/account-for-scale.directive.metadata.json +1 -1
  6. package/esm2015/lib/directives/account-for-scale.directive.ngfactory.js.map +1 -0
  7. package/esm2015/lib/directives/apply-scale.directive.js +4 -13
  8. package/esm2015/lib/directives/apply-scale.directive.js.map +1 -1
  9. package/esm2015/lib/directives/apply-scale.directive.metadata.json +1 -1
  10. package/esm2015/lib/directives/apply-scale.directive.ngfactory.js.map +1 -0
  11. package/esm2015/lib/directives/auto-scroll.directive.js +54 -0
  12. package/esm2015/lib/directives/auto-scroll.directive.js.map +1 -0
  13. package/esm2015/lib/directives/auto-scroll.directive.metadata.json +1 -0
  14. package/esm2015/lib/directives/auto-scroll.directive.ngfactory.js.map +1 -0
  15. package/esm2015/lib/directives/drag-preview.directive.ngfactory.js.map +1 -0
  16. package/esm2015/lib/directives/drag-root.directive.js +8 -11
  17. package/esm2015/lib/directives/drag-root.directive.js.map +1 -1
  18. package/esm2015/lib/directives/drag-root.directive.metadata.json +1 -1
  19. package/esm2015/lib/directives/drag-root.directive.ngfactory.js.map +1 -0
  20. package/esm2015/lib/directives/draggable.directive.js +45 -15
  21. package/esm2015/lib/directives/draggable.directive.js.map +1 -1
  22. package/esm2015/lib/directives/draggable.directive.metadata.json +1 -1
  23. package/esm2015/lib/directives/draggable.directive.ngfactory.js.map +1 -0
  24. package/esm2015/lib/directives/dropzone.directive.js +9 -6
  25. package/esm2015/lib/directives/dropzone.directive.js.map +1 -1
  26. package/esm2015/lib/directives/dropzone.directive.metadata.json +1 -1
  27. package/esm2015/lib/directives/dropzone.directive.ngfactory.js.map +1 -0
  28. package/esm2015/lib/directives/gesturable.directive.ngfactory.js.map +1 -0
  29. package/esm2015/lib/directives/index.js +1 -0
  30. package/esm2015/lib/directives/index.js.map +1 -1
  31. package/esm2015/lib/directives/index.metadata.json +1 -1
  32. package/esm2015/lib/directives/resizable.directive.js +62 -13
  33. package/esm2015/lib/directives/resizable.directive.js.map +1 -1
  34. package/esm2015/lib/directives/resizable.directive.metadata.json +1 -1
  35. package/esm2015/lib/directives/resizable.directive.ngfactory.js.map +1 -0
  36. package/esm2015/lib/interact.module.js +15 -1
  37. package/esm2015/lib/interact.module.js.map +1 -1
  38. package/esm2015/lib/interact.module.metadata.json +1 -1
  39. package/esm2015/lib/interact.module.ngfactory.js.map +1 -0
  40. package/esm2015/lib/models/interact.js +2 -0
  41. package/esm2015/lib/models/interact.js.map +1 -1
  42. package/esm2015/lib/models/interact.metadata.json +1 -1
  43. package/esm2015/lib/pipes/array-of-n.pipe.ngfactory.js.map +1 -0
  44. package/esm2015/lib/services/interact.service.js +31 -36
  45. package/esm2015/lib/services/interact.service.js.map +1 -1
  46. package/esm2015/lib/services/interact.service.metadata.json +1 -1
  47. package/esm2015/lib/services/interact.service.ngfactory.js.map +1 -0
  48. package/esm2015/tft-interact.js +2 -2
  49. package/esm2015/tft-interact.js.map +1 -1
  50. package/esm2015/tft-interact.metadata.json +1 -1
  51. package/fesm2015/tft-interact.js +223 -105
  52. package/fesm2015/tft-interact.js.map +1 -1
  53. package/lib/directives/account-for-scale.directive.d.ts +1 -3
  54. package/lib/directives/apply-scale.directive.d.ts +4 -7
  55. package/lib/directives/auto-scroll.directive.d.ts +31 -0
  56. package/lib/directives/drag-root.directive.d.ts +2 -1
  57. package/lib/directives/draggable.directive.d.ts +8 -2
  58. package/lib/directives/dropzone.directive.d.ts +7 -4
  59. package/lib/directives/index.d.ts +1 -0
  60. package/lib/directives/resizable.directive.d.ts +10 -3
  61. package/lib/interact.module.d.ts +3 -0
  62. package/lib/models/interact.d.ts +10 -0
  63. package/lib/services/interact.service.d.ts +6 -7
  64. package/package.json +1 -1
  65. package/tft-interact-12.5.3.tgz +0 -0
  66. package/tft-interact.d.ts +2 -2
  67. package/tft-interact.metadata.json +1 -1
  68. package/tft-interact-12.4.3.tgz +0 -0
@@ -2,20 +2,14 @@ import { Directive, ElementRef, HostBinding, Input } from '@angular/core';
2
2
  export class ApplyScaleDirective {
3
3
  constructor(el) {
4
4
  this.el = el;
5
- this.scaleX = 1;
6
- this.scaleY = 1;
7
- this.transformOrigin = '0 0';
5
+ this._scale = 1;
8
6
  }
9
7
  // this setup allows consumers to set x, y scale independently or just set them both with scale
10
8
  set scale(val) {
11
- this.scaleY = val;
12
- this.scaleX = val;
9
+ this._scale;
10
+ this.fontSize = `${val}px`;
13
11
  }
14
12
  ;
15
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
- ngOnChanges(_changes) {
17
- this.transform = `scaleX(${this.scaleX}) scaleY(${this.scaleY})`;
18
- }
19
13
  }
20
14
  ApplyScaleDirective.decorators = [
21
15
  { type: Directive, args: [{
@@ -27,9 +21,6 @@ ApplyScaleDirective.ctorParameters = () => [
27
21
  ];
28
22
  ApplyScaleDirective.propDecorators = {
29
23
  scale: [{ type: Input }],
30
- scaleX: [{ type: Input }],
31
- scaleY: [{ type: Input }],
32
- transform: [{ type: HostBinding, args: ['style.transform',] }],
33
- transformOrigin: [{ type: Input }, { type: HostBinding, args: ['style.transformOrigin',] }]
24
+ fontSize: [{ type: HostBinding, args: ['style.fontSize',] }]
34
25
  };
35
26
  //# sourceMappingURL=apply-scale.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply-scale.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/apply-scale.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAA4B,MAAM,eAAe,CAAC;AAKpG,MAAM,OAAO,mBAAmB;IAc9B,YACS,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAPd,WAAM,GAAG,CAAC,CAAC;QACX,WAAM,GAAG,CAAC,CAAC;QAG2B,oBAAe,GAAG,KAAK,CAAC;IAInE,CAAC;IAdJ,+FAA+F;IAChG,IAAa,KAAK,CAAC,GAAW;QAC5B,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAAA,CAAC;IAYF,6DAA6D;IAC7D,WAAW,CAAC,QAAuB;QACjC,IAAI,CAAC,SAAS,GAAG,UAAU,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,MAAM,GAAG,CAAC;IACnE,CAAC;;;YAxBF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;aAC5B;;;YAJmB,UAAU;;;oBAQ3B,KAAK;qBAKL,KAAK;qBACL,KAAK;wBAEL,WAAW,SAAC,iBAAiB;8BAC7B,KAAK,YAAI,WAAW,SAAC,uBAAuB","sourcesContent":["import { Directive, ElementRef, HostBinding, Input, OnChanges, SimpleChanges } from '@angular/core';\n\n@Directive({\n selector: '[tftApplyScale]'\n})\nexport class ApplyScaleDirective implements OnChanges {\n\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() set scale(val: number){\n this.scaleY = val;\n this.scaleX = val;\n };\n\n @Input() scaleX = 1;\n @Input() scaleY = 1;\n\n @HostBinding('style.transform') transform: string;\n @Input() @HostBinding('style.transformOrigin') transformOrigin = '0 0';\n\n constructor(\n public el: ElementRef\n ) { }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ngOnChanges(_changes: SimpleChanges) {\n this.transform = `scaleX(${this.scaleX}) scaleY(${this.scaleY})`;\n }\n}\n"]}
1
+ {"version":3,"file":"apply-scale.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/apply-scale.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAK1E,MAAM,OAAO,mBAAmB;IAW9B,YACS,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAVvB,WAAM,GAAG,CAAC,CAAC;IAWP,CAAC;IAVJ,+FAA+F;IAChG,IAAa,KAAK,CAAC,GAAW;QAC5B,IAAI,CAAC,MAAM,CAAC;QACZ,IAAI,CAAC,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC;IAC7B,CAAC;IAAA,CAAC;;;YAVH,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;aAC5B;;;YAJmB,UAAU;;;oBAS3B,KAAK;uBAKL,WAAW,SAAC,gBAAgB","sourcesContent":["import { Directive, ElementRef, HostBinding, Input } from '@angular/core';\n\n@Directive({\n selector: '[tftApplyScale]'\n})\nexport class ApplyScaleDirective {\n\n _scale = 1;\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() set scale(val: number){\n this._scale;\n this.fontSize = `${val}px`;\n };\n\n @HostBinding('style.fontSize') fontSize: string;\n\n constructor(\n public el: ElementRef\n ) { }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ApplyScaleDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[tftApplyScale]"}]}],"members":{"scale":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":8,"character":3}}]}],"scaleX":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"scaleY":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"transform":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":16,"character":3},"arguments":["style.transform"]}]}],"transformOrigin":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":12},"arguments":["style.transformOrigin"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":20,"character":15}]}],"ngOnChanges":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ApplyScaleDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":2,"character":1},"arguments":[{"selector":"[tftApplyScale]"}]}],"members":{"scale":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":9,"character":3}}]}],"fontSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":14,"character":3},"arguments":["style.fontSize"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":17,"character":15}]}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-scale.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/apply-scale.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -0,0 +1,54 @@
1
+ import { Directive, ElementRef, HostListener, Input } from '@angular/core';
2
+ import { BehaviorSubject, Subject } from 'rxjs';
3
+ import { scan, shareReplay } from 'rxjs/operators';
4
+ ;
5
+ /**
6
+ * Use to apply scale to the element and tell the drag and resize directives to account for the scale when
7
+ * @example <div tftAccountForScale [scale]="2.5"> <div tftDraggable> </div> </div>
8
+ * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag
9
+ * element accounts for scale
10
+ */
11
+ export class AutoScrollDirective {
12
+ constructor(el) {
13
+ this.el = el;
14
+ /**
15
+ * Limit minimum time between scroll events in milliseconds
16
+ */
17
+ this.autoScrollConfig = {
18
+ margin: 50,
19
+ distance: 3,
20
+ interval: 50,
21
+ speed: 300,
22
+ enabled: true
23
+ };
24
+ this.scrollDeltaObserver = new Subject();
25
+ const { scrollTop, scrollLeft } = el.nativeElement;
26
+ this.scrollSubject = new BehaviorSubject({ scrollTop, scrollLeft });
27
+ this.scrollObserver = this.scrollSubject.pipe(scan((previous, current) => {
28
+ const scrollTop = current.scrollTop - previous.scrollTop;
29
+ const scrollLeft = current.scrollLeft - previous.scrollLeft;
30
+ this.scrollDeltaObserver.next({ scrollTop, scrollLeft });
31
+ return current;
32
+ }), shareReplay(1));
33
+ this.scrollObserver.subscribe();
34
+ }
35
+ // this setup allows consumers to set x, y scale independently or just set them both with scale
36
+ scroll(scrollEvent) {
37
+ const target = scrollEvent.target;
38
+ const { scrollTop, scrollLeft } = target;
39
+ this.scrollSubject.next({ scrollTop, scrollLeft });
40
+ }
41
+ }
42
+ AutoScrollDirective.decorators = [
43
+ { type: Directive, args: [{
44
+ selector: '[tftAutoScroll]'
45
+ },] }
46
+ ];
47
+ AutoScrollDirective.ctorParameters = () => [
48
+ { type: ElementRef }
49
+ ];
50
+ AutoScrollDirective.propDecorators = {
51
+ autoScrollConfig: [{ type: Input }],
52
+ scroll: [{ type: HostListener, args: ['scroll', ['$event'],] }]
53
+ };
54
+ //# sourceMappingURL=auto-scroll.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-scroll.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/auto-scroll.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAAE,I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AAU,EAAC,CAAC,CAAA;IAClD,CAAC;;;YAtBF,SAAS,SAAC;gBACT,QAAQ,EAAE,iBAAiB;aAC5B;;;YAbmB,UAAU;;;+BAkB3B,KAAK;qBAWL,YAAY,SAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import { Directive, ElementRef, HostListener, Input } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { scan, shareReplay } from 'rxjs/operators';\n\ninterface ScrollObject {scrollTop: number, scrollLeft: number};\n/**\n * Use to apply scale to the element and tell the drag and resize directives to account for the scale when\n * @example <div tftAccountForScale [scale]=\"2.5\"> <div tftDraggable> </div> </div>\n * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag\n * element accounts for scale\n */\n@Directive({\n selector: '[tftAutoScroll]'\n})\nexport class AutoScrollDirective {\n /**\n * Limit minimum time between scroll events in milliseconds\n */\n @Input() autoScrollConfig = {\n margin: 50,\n distance: 3,\n interval: 50,\n speed: 300,\n enabled: true\n };\n private scrollSubject: BehaviorSubject<ScrollObject>;\n readonly scrollObserver: Observable<ScrollObject>;\n readonly scrollDeltaObserver = new Subject<ScrollObject>();\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @HostListener('scroll', ['$event']) scroll(scrollEvent: Event) {\n const target = (scrollEvent.target as HTMLElement);\n const { scrollTop, scrollLeft } = target;\n this.scrollSubject.next({scrollTop, scrollLeft})\n }\n\n\n constructor(\n public el: ElementRef\n ) {\n const { scrollTop, scrollLeft } = (el.nativeElement as HTMLElement);\n this.scrollSubject = new BehaviorSubject({scrollTop, scrollLeft});\n this.scrollObserver = this.scrollSubject.pipe(\n scan((previous, current) => {\n const scrollTop = current.scrollTop - previous.scrollTop;\n const scrollLeft = current.scrollLeft - previous.scrollLeft;\n this.scrollDeltaObserver.next({scrollTop, scrollLeft});\n return current;\n }),\n shareReplay(1),\n )\n this.scrollObserver.subscribe();\n }\n\n}\n"]}
@@ -0,0 +1 @@
1
+ [{"__symbolic":"module","version":4,"metadata":{"AutoScrollDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":11,"character":1},"arguments":[{"selector":"[tftAutoScroll]"}]}],"members":{"autoScrollConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"scroll":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":29,"character":3},"arguments":["scroll",["$event"]]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":37,"character":15}]}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-scroll.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/auto-scroll.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drag-preview.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/drag-preview.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -1,26 +1,23 @@
1
- import { Directive, ElementRef, Optional, Self } from '@angular/core';
2
1
  import { AccountForScaleDirective } from './account-for-scale.directive';
2
+ import { Directive, ElementRef, Optional, Self } from '@angular/core';
3
3
  /**
4
4
  * Use this directive to select which element to attach the element to while dragging
5
5
  * @example <div tftDragRoot><div tftDraggable> </div> </div>
6
6
  * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )
7
7
  */
8
8
  export class DragRootDirective {
9
- constructor(el, account_for_scale_dir) {
9
+ constructor(el,
10
+ // This is used when passing a dragRoot as in input to a draggable element that not a child of that dragRoot
11
+ // It allows the the interact service to check if the drag root has some scaling applied to it and account for it when the component is dragged
12
+ account_for_scale_dir) {
10
13
  this.el = el;
11
- // This accounts for a bug where drag element is misaligned when using a drag root
12
- // with a dropzone inside of it and a drag item inside the dropzone
13
- // e.g <div tftDragRoot> <div tftDropzone> <div tftDraggable</div> </div> </div>
14
- // TODO: This is a band-aid, root cause in misunderstood, it started after switching from
15
- // using `translate3d` to top/left for positioning
16
- if (!account_for_scale_dir) {
17
- el.nativeElement.style.transform = 'scale(1)';
18
- }
14
+ this.account_for_scale_dir = account_for_scale_dir;
19
15
  }
20
16
  }
21
17
  DragRootDirective.decorators = [
22
18
  { type: Directive, args: [{
23
- selector: '[tftDragRoot]'
19
+ selector: '[tftDragRoot]',
20
+ exportAs: 'tftDragRoot'
24
21
  },] }
25
22
  ];
26
23
  DragRootDirective.ctorParameters = () => [
@@ -1 +1 @@
1
- {"version":3,"file":"drag-root.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/drag-root.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;GAIG;AAIH,MAAM,OAAO,iBAAiB;IAE5B,YACS,EAAc,EACD,qBAAgD;QAD7D,OAAE,GAAF,EAAE,CAAY;QAGrB,kFAAkF;QAClF,mEAAmE;QACnE,gFAAgF;QAChF,yFAAyF;QACzF,kDAAkD;QAClD,IAAG,CAAC,qBAAqB,EAAE;YACxB,EAAE,CAAC,aAA6B,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC;SAChE;IACH,CAAC;;;YAjBF,SAAS,SAAC;gBACT,QAAQ,EAAE,eAAe;aAC1B;;;YAVmB,UAAU;YACrB,wBAAwB,uBAc5B,QAAQ,YAAI,IAAI","sourcesContent":["import { Directive, ElementRef, Optional, Self } from '@angular/core';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n\n/**\n * Use this directive to select which element to attach the element to while dragging\n * @example <div tftDragRoot><div tftDraggable> </div> </div>\n * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )\n */\n@Directive({\n selector: '[tftDragRoot]'\n})\nexport class DragRootDirective {\n\n constructor(\n public el: ElementRef,\n @Optional() @Self() account_for_scale_dir?: AccountForScaleDirective\n ) {\n // This accounts for a bug where drag element is misaligned when using a drag root\n // with a dropzone inside of it and a drag item inside the dropzone\n // e.g <div tftDragRoot> <div tftDropzone> <div tftDraggable</div> </div> </div>\n // TODO: This is a band-aid, root cause in misunderstood, it started after switching from\n // using `translate3d` to top/left for positioning\n if(!account_for_scale_dir) {\n (el.nativeElement as HTMLElement).style.transform = 'scale(1)';\n }\n }\n}\n"]}
1
+ {"version":3,"file":"drag-root.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/drag-root.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEtE;;;;GAIG;AAKH,MAAM,OAAO,iBAAiB;IAE5B,YACS,EAAc;IACrB,4GAA4G;IAC5G,+IAA+I;IACpH,qBAAgD;QAHpE,OAAE,GAAF,EAAE,CAAY;QAGM,0BAAqB,GAArB,qBAAqB,CAA2B;IACzE,CAAC;;;YAXN,SAAS,SAAC;gBACT,QAAQ,EAAE,eAAe;gBACzB,QAAQ,EAAE,aAAa;aACxB;;;YAVmB,UAAU;YADrB,wBAAwB,uBAkB5B,QAAQ,YAAI,IAAI","sourcesContent":["import { AccountForScaleDirective } from './account-for-scale.directive';\nimport { Directive, ElementRef, Optional, Self } from '@angular/core';\n\n/**\n * Use this directive to select which element to attach the element to while dragging\n * @example <div tftDragRoot><div tftDraggable> </div> </div>\n * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )\n */\n@Directive({\n selector: '[tftDragRoot]',\n exportAs: 'tftDragRoot'\n})\nexport class DragRootDirective {\n\n constructor(\n public el: ElementRef,\n // This is used when passing a dragRoot as in input to a draggable element that not a child of that dragRoot\n // It allows the the interact service to check if the drag root has some scaling applied to it and account for it when the component is dragged\n @Optional() @Self() public account_for_scale_dir?: AccountForScaleDirective\n ) { }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DragRootDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[tftDragRoot]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":15,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":15,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":14,"character":15},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":15,"character":48}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"DragRootDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[tftDragRoot]","exportAs":"tftDragRoot"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":18,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":18,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":15,"character":15},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":18,"character":55}]}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drag-root.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/drag-root.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -8,11 +8,11 @@ import { DragPreviewDirective } from './drag-preview.directive';
8
8
  import { getRootNode } from '../utils';
9
9
  import { DragRootDirective } from './drag-root.directive';
10
10
  import { AccountForScaleDirective } from './account-for-scale.directive';
11
+ import { AutoScrollDirective } from './auto-scroll.directive';
11
12
  /** @dynamic */
12
13
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
14
  export class DraggableDirective {
14
- // cache holding element to use as placeholder while dragging
15
- constructor(el, interactService, renderer, _viewContainerRef, _document, account_for_scale_dir, dropzone_dir, drag_root_dir) {
15
+ constructor(el, interactService, renderer, _viewContainerRef, _document, account_for_scale_dir, dropzone_dir, drag_root_dir, auto_scroll_dir) {
16
16
  this.el = el;
17
17
  this.interactService = interactService;
18
18
  this.renderer = renderer;
@@ -21,6 +21,7 @@ export class DraggableDirective {
21
21
  this.account_for_scale_dir = account_for_scale_dir;
22
22
  this.dropzone_dir = dropzone_dir;
23
23
  this.drag_root_dir = drag_root_dir;
24
+ this.auto_scroll_dir = auto_scroll_dir;
24
25
  /* zIndex while dragging*/
25
26
  this.dragZIndex = 10000;
26
27
  this.enableDragDefault = true;
@@ -36,13 +37,18 @@ export class DraggableDirective {
36
37
  this.dragInertiaStart = new EventEmitter();
37
38
  this.dragEnd = new EventEmitter();
38
39
  }
40
+ // check all the different places for scale
41
+ get scale() {
42
+ var _a, _b, _c, _d;
43
+ 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) || ((_d = (_c = this.dragRoot) === null || _c === void 0 ? void 0 : _c.account_for_scale_dir) === null || _d === void 0 ? void 0 : _d.scale);
44
+ }
39
45
  ngOnInit() {
40
- var _a, _b, _c;
46
+ var _a, _b, _c, _d, _e;
41
47
  this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);
42
- this.dragRoot = this.dragRoot || ((_b = (_a = this.drag_root_dir) === null || _a === void 0 ? void 0 : _a.el) === null || _b === void 0 ? void 0 : _b.nativeElement) || this._document.body;
48
+ this.dragRootEl = (((_b = (_a = this.dragRoot) === null || _a === void 0 ? void 0 : _a.el) === null || _b === void 0 ? void 0 : _b.nativeElement) || ((_d = (_c = this.drag_root_dir) === null || _c === void 0 ? void 0 : _c.el) === null || _d === void 0 ? void 0 : _d.nativeElement)) || this._document.body;
43
49
  // register with parent dropzone if it exists, otherwise use default
44
50
  // this gives us a place on the registry to store our drag items that don't have a dropzone
45
- this.registryId = ((_c = this.dropzone_dir) === null || _c === void 0 ? void 0 : _c.dropzoneId) || DEFAULT_REGISTRY_ID;
51
+ this.registryId = ((_e = this.dropzone_dir) === null || _e === void 0 ? void 0 : _e.dropzoneId) || DEFAULT_REGISTRY_ID;
46
52
  // add draggable to directory and store its id
47
53
  this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);
48
54
  this.alignPositionWithInputs(this.x, this.y);
@@ -93,12 +99,15 @@ export class DraggableDirective {
93
99
  }
94
100
  dragMoveListener(event, element) {
95
101
  const { dx, dy } = event;
96
- this.interactService.updateDeltas(this.interactableId, this.registryId, { deltaX: dx, deltaY: dy }, element);
102
+ const scale = this.scale;
103
+ const deltaX = scale ? dx / scale : dx;
104
+ const deltaY = scale ? dy / scale : dy;
105
+ this.interactService.updateDeltas(this.interactableId, this.registryId, { deltaX, deltaY }, element);
97
106
  }
98
107
  setDragStyles(dragElement) {
99
108
  this.renderer.setStyle(dragElement, 'touchAction', 'none');
100
109
  this.renderer.setStyle(dragElement, 'zIndex', this.dragZIndex);
101
- this.renderer.setStyle(dragElement, 'position', 'fixed');
110
+ this.renderer.setStyle(dragElement, 'position', 'absolute');
102
111
  }
103
112
  addDragPropertiesToElement(nativeElement) {
104
113
  this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);
@@ -109,8 +118,9 @@ export class DraggableDirective {
109
118
  var _a;
110
119
  const { target, dropzone } = event;
111
120
  const dropzoneElement = (dropzone === null || dropzone === void 0 ? void 0 : dropzone.target) || ((_a = target.dropTarget) === null || _a === void 0 ? void 0 : _a.el.nativeElement);
121
+ const scale = this.scale;
112
122
  const positionInDropTarget = target && dropzoneElement
113
- ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef)
123
+ ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef, scale)
114
124
  : null;
115
125
  return {
116
126
  interactEvent: event,
@@ -138,8 +148,12 @@ export class DraggableDirective {
138
148
  return typeof num === 'number' && !isNaN(num);
139
149
  }
140
150
  initiateDragEvents(dragConfig, nativeElement) {
141
- return interact(nativeElement).draggable(Object.assign(Object.assign({}, dragConfig), { enabled: !(this.disabled || this.dragDisabled) }))
151
+ const defaultDragConfig = Object.assign(Object.assign(Object.assign({}, dragConfig), { enabled: !(this.disabled || this.dragDisabled) }), (this.auto_scroll_dir && {
152
+ autoScroll: Object.assign(Object.assign({}, this.auto_scroll_dir.autoScrollConfig), { container: this.auto_scroll_dir.el.nativeElement })
153
+ }));
154
+ return interact(nativeElement).draggable(defaultDragConfig)
142
155
  .on('dragstart', (event) => {
156
+ var _a, _b, _c;
143
157
  const interaction = event.interaction;
144
158
  // check if we should append drag element to body
145
159
  if (this.enableDragDefault
@@ -157,13 +171,18 @@ export class DraggableDirective {
157
171
  }
158
172
  this.addDragPropertiesToElement(this.previewRef);
159
173
  this.setDragStyles(this.previewRef);
160
- this.dragRoot.prepend(this.previewRef);
161
- const { x, y } = this.interactService.calculatePositionInElement(this.dragRoot, nativeElement);
174
+ this.dragRootEl.prepend(this.previewRef);
175
+ const scale = ((_a = this.account_for_scale_dir) === null || _a === void 0 ? void 0 : _a.scale) || ((_c = (_b = this.dragRoot) === null || _b === void 0 ? void 0 : _b.account_for_scale_dir) === null || _c === void 0 ? void 0 : _c.scale) || 1;
176
+ const { x, y } = this.interactService.calculatePositionInElement(this.dragRootEl, nativeElement, scale);
162
177
  this.interactService.updatePosition(this.interactableId, this.registryId, { x, y }, this.previewRef);
163
178
  if (!this.showPlaceholder) {
164
179
  this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
165
180
  }
166
181
  }
182
+ // subscribe to scroll events if they are there, by only subscribing on dragstart we avoid wasting subscriptions on interactables that aren't be dragged
183
+ if (this.auto_scroll_dir) {
184
+ this.subscribeToScrollEvents();
185
+ }
167
186
  this.dragStart.emit(this.mapDragEvent(event));
168
187
  })
169
188
  .on('dragmove', (event) => {
@@ -185,15 +204,25 @@ export class DraggableDirective {
185
204
  }
186
205
  this.renderer.setStyle(this.el.nativeElement, 'display', '');
187
206
  this.dragEnd.emit(mappedEvent);
207
+ // unsubscribe from scroll events if subscribed
208
+ if (this.auto_scroll_dir) {
209
+ this.scrollEventsSubscription.unsubscribe();
210
+ }
188
211
  if (this.el.nativeElement !== this.previewRef) {
189
- // we do this in a timeout, so that we don't
190
- // remove before the dropzone can get the boundingElementRect
212
+ // we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect
191
213
  setTimeout(() => {
192
- this.dragRoot.removeChild(this.previewRef);
214
+ this.dragRootEl.removeChild(this.previewRef);
193
215
  });
194
216
  }
195
217
  });
196
218
  }
219
+ subscribeToScrollEvents() {
220
+ this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({ scrollLeft, scrollTop }) => {
221
+ const deltaX = this.scale ? scrollLeft / this.scale : scrollLeft;
222
+ const deltaY = this.scale ? scrollTop / this.scale : scrollTop;
223
+ this.interactService.updateDeltas(this.interactableId, this.registryId, { deltaX, deltaY }, this.previewRef);
224
+ });
225
+ }
197
226
  }
198
227
  DraggableDirective.decorators = [
199
228
  { type: Directive, args: [{
@@ -214,7 +243,8 @@ DraggableDirective.ctorParameters = () => [
214
243
  { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
215
244
  { type: AccountForScaleDirective, decorators: [{ type: Optional }] },
216
245
  { type: DropzoneDirective, decorators: [{ type: Optional }, { type: SkipSelf }] },
217
- { type: DragRootDirective, decorators: [{ type: Optional }, { type: SkipSelf }] }
246
+ { type: DragRootDirective, decorators: [{ type: Optional }, { type: SkipSelf }] },
247
+ { type: AutoScrollDirective, decorators: [{ type: Optional }, { type: SkipSelf }] }
218
248
  ];
219
249
  DraggableDirective.propDecorators = {
220
250
  x: [{ type: Input }],
@@ -1 +1 @@
1
- {"version":3,"file":"draggable.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/draggable.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAU,MAAM,EACvC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAA4B,YAAY,EAAE,gBAAgB,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAClK,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAA6B,mBAAmB,EAA4B,MAAM,WAAW,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,eAAe;AAUf,8DAA8D;AAC9D,MAAM,OAAO,kBAAkB;IAyC7B,6DAA6D;IAC7D,YACS,EAAc,EACb,eAAgC,EAChC,QAAmB,EACnB,iBAAmC,EACjB,SAAmB,EAC1B,qBAAgD,EACpC,YAAgC,EAChC,aAAiC;QAPzD,OAAE,GAAF,EAAE,CAAY;QACb,oBAAe,GAAf,eAAe,CAAiB;QAChC,aAAQ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AM;uBACN,MAAM;+BACN,MAAM;sBACN,MAAM;+BAEN,YAAY,SAAC,oBAAoB;;AAgNpC;;GAEG;AACH,6EAA6E;AAC7E,SAAS,YAAY,CAAC,OAAoB;IACxC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC;IACrD,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC;AACD,SAAS,wBAAwB,CAAC,WAAgB;IAChD,2DAA2D;IAC3D,gEAAgE;IAChE,OAAO,WAAW,CAAC,iBAAiB;QAC7B,WAAW,CAAC,uBAAuB;QACnC,WAAW,CAAC,oBAAoB;QAChC,WAAW,CAAC,mBAAmB;QAC/B,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC","sourcesContent":["import { Directive, ElementRef, Input, OnInit, Output,\n OnDestroy, EventEmitter, Optional, SkipSelf, Renderer2, SimpleChanges, OnChanges, ContentChild, ViewContainerRef, Inject, AfterViewInit } from '@angular/core';\nimport { DOCUMENT } from '@angular/common'\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { DraggableOptions, Interactable } from '@interactjs/types/index';\nimport { Subscription, Observable } from 'rxjs';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { NgDragEvent, TftDragEvent, DEFAULT_REGISTRY_ID, TftCoords, TftDragElement} from '../models';\nimport { DragPreviewDirective } from './drag-preview.directive';\nimport { getRootNode } from '../utils';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n\n/** @dynamic */\n@Directive({\n selector: '[tftDraggable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[style.touchAction]': 'this.dragDisabled ? \"auto\" : \"none\"',\n '[style.position]': '\"absolute\"',\n '[id]': 'interactableId',\n }\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DraggableDirective<D = any> implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n\n\n @Input() x: number;\n @Input() y: number;\n /* zIndex while dragging*/\n @Input() dragZIndex = 10000;\n /** zIndex while at rest */\n @Input() zIndex: number\n @Input() interactableId: string;\n @Input() dragData: D;\n @Input() enableDragDefault = true;\n /**\n * @deprecated replaced by 'dragDisabled' property, please migrate before v13\n */\n @Input() disabled = false;\n @Input() dragDisabled = false;\n @Input() dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n @Input() showPlaceholder = false;\n\n /**\n * The element we want to prepend the drag element to.\n * Use `tftDragRoot` directive on a parent element to set custom root element\n * @default document.body\n */\n @Input() dragRoot: HTMLElement;\n\n // pipes all interact events to event emitters\n @Output() dragStart = new EventEmitter<TftDragEvent>();\n @Output() dragMove = new EventEmitter<TftDragEvent>();\n @Output() dragInertiaStart = new EventEmitter<TftDragEvent>();\n @Output() dragEnd = new EventEmitter<TftDragEvent>();\n\n @ContentChild(DragPreviewDirective) _previewTemplate: DragPreviewDirective;\n // dragPreview: Interact.Element;\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n private registryId: string;\n private interactableSubscription: Subscription;\n // cache holding element to use as drag preview (the element the user sees being dragged around)\n previewRef: TftDragElement;\n // cache holding element to use as placeholder while dragging\n constructor(\n public el: ElementRef,\n private interactService: InteractService,\n private renderer: Renderer2,\n private _viewContainerRef: ViewContainerRef,\n @Inject(DOCUMENT) private _document: Document,\n @Optional() public account_for_scale_dir?: AccountForScaleDirective,\n @Optional() @SkipSelf() public dropzone_dir?: DropzoneDirective,\n @Optional() @SkipSelf() public drag_root_dir?: DragRootDirective\n ) { }\n\n ngOnInit() {\n this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);\n this.dragRoot = this.dragRoot || this.drag_root_dir?.el?.nativeElement as HTMLElement || this._document.body;\n // register with parent dropzone if it exists, otherwise use default\n // this gives us a place on the registry to store our drag items that don't have a dropzone\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n // add draggable to directory and store its id\n this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n this.alignPositionWithInputs(this.x, this.y);\n // cache subscription to interactable state so we can unsubscribe onDestroy\n this.interactableState = this.interactService\n .getInteractableState(this.interactableId, this.registryId);\n // keep our cached position values in line with our drag state\n this.interactableSubscription = this.interactableState.subscribe((state) => {\n this.y = state.y;\n this.x = state.x;\n });\n this.setDragConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.y || changes.x) {\n this.alignPositionWithInputs(this.x, this.y);\n }\n if(changes.dragConfig || changes.disabled || changes.dragDisabled) {\n if(!this.interactable) return;\n this.setDragConfig();\n }\n /**\n * @deprecated remove this in v13\n */\n if (changes.disabled) {\n console.warn(`It looks like your using the 'disabled' input on a tftDraggable directive, it has been deprecated and is replaced with 'dragDisabled', please migrate by v13`)\n }\n }\n\n setDragConfig() {\n const enabled = !(this.disabled || this.dragDisabled)\n const dragConfig = {...this.dragConfig, enabled};\n this.interactable.draggable(dragConfig);\n }\n\n ngAfterViewInit() {\n this.addDragPropertiesToElement(this.el.nativeElement);\n if (!this.dropzone_dir) {\n this.previewRef = this.el.nativeElement;\n }\n }\n\n ngOnDestroy() {\n // clean up state and subscriptions related to destroyed component\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n dragMoveListener(event: NgDragEvent, element: Interact.Element) {\n const { dx, dy } = event;\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX: dx, deltaY: dy},\n element\n );\n }\n\n setDragStyles(dragElement: HTMLElement) {\n this.renderer.setStyle(dragElement, 'touchAction', 'none')\n this.renderer.setStyle(dragElement, 'zIndex', this.dragZIndex)\n this.renderer.setStyle(dragElement, 'position', 'fixed')\n }\n\n addDragPropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragOrigin', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragRef', this);\n }\n\n mapDragEvent(event: NgDragEvent): TftDragEvent {\n const { target, dropzone } = event;\n const dropzoneElement = dropzone?.target || target.dropTarget?.el.nativeElement;\n const positionInDropTarget = target && dropzoneElement\n ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef)\n : null;\n return {\n interactEvent: event,\n dragRef: this,\n dragOrigin: target.dragOrigin,\n dropTarget: target.dropTarget,\n positionInDropTarget\n }\n }\n\n setPosition(x: number, y: number) {\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n alignPositionWithInputs(x: number, y: number) {\n // short circuit if positions aren't numbers or if they haven't changed\n if(!this.isValidPosition(x, y)) return;\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n isValidPosition(x: number, y: number) {\n return this.isNumeric(x) && this.isNumeric(y);\n }\n // We use use this instead of isNaN here to try and help performance\n // We should be able to reliably restrict to numbers or falsey values\n isNumeric(num: number) {\n return typeof num === 'number' && !isNaN(num);\n }\n\n initiateDragEvents(dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>, nativeElement: HTMLElement) {\n return interact(nativeElement).draggable({...dragConfig, enabled: !(this.disabled || this.dragDisabled) })\n .on('dragstart', (event: NgDragEvent) => {\n const interaction = event.interaction;\n\n // check if we should append drag element to body\n if ( this.enableDragDefault\n && interaction.pointerIsDown\n // TODO: probably don't need following condition checks anymore remove by 2022\n // && !!this.dropzone_dir\n // && !interaction.interacting()\n ) {\n if (this._previewTemplate) {\n const viewRef = this._viewContainerRef.createEmbeddedView(this._previewTemplate.templateRef);\n this.previewRef = getRootNode(viewRef, this._document);\n } else {\n this.previewRef = cloneElement(this.el.nativeElement);\n }\n this.addDragPropertiesToElement(this.previewRef);\n this.setDragStyles(this.previewRef)\n\n this.dragRoot.prepend(this.previewRef);\n\n const {x, y} = this.interactService.calculatePositionInElement(this.dragRoot, nativeElement);\n this.interactService.updatePosition(this.interactableId, this.registryId, {x, y}, this.previewRef);\n if (!this.showPlaceholder) {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'none');\n }\n }\n this.dragStart.emit(this.mapDragEvent(event));\n })\n .on('dragmove', (event: NgDragEvent) => {\n if (this.enableDragDefault) {\n const dragElement = this.dropzone_dir && this.previewRef || nativeElement\n this.dragMoveListener(event, dragElement);\n }\n const mappedEvent = this.mapDragEvent(event);\n this.dragMove.emit(mappedEvent);\n })\n .on('draginertiastart', (event: NgDragEvent) => {\n this.dragInertiaStart.emit(this.mapDragEvent(event))\n })\n .on('dragend', (event: NgDragEvent) => {\n const mappedEvent = this.mapDragEvent(event)\n if(!!this.dropzone_dir && this.dropzone_dir === event.target.dropTarget) {\n const { x, y} = mappedEvent.positionInDropTarget;\n this.setPosition(x, y);\n }\n this.renderer.setStyle(this.el.nativeElement, 'display', '');\n this.dragEnd.emit(mappedEvent);\n\n if ( this.el.nativeElement !== this.previewRef) {\n // we do this in a timeout, so that we don't\n // remove before the dropzone can get the boundingElementRect\n setTimeout(() => {\n this.dragRoot.removeChild(this.previewRef);\n })\n }\n });\n }\n\n\n}\n\n/**\n * Component utils\n */\n// create a clone of the component passed in and add it to the root component\nfunction cloneElement(element: HTMLElement) {\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n"]}
1
+ {"version":3,"file":"draggable.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/draggable.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,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B,QAAQ,YAAI,QAAQ;YAtEhB,mBAAmB,uBAuEvB,QAAQ,YAAI,QAAQ;;;gBAvDtB,KAAK;gBACL,KAAK;yBAEL,KAAK;qBAEL,KAAK;6BACL,KAAK;uBACL,KAAK;gCACL,KAAK;uBAIL,KAAK;2BACL,KAAK;yBACL,KAAK;8BACL,KAAK;uBAOL,KAAK;wBAIL,MAAM;uBACN,MAAM;+BACN,MAAM;sBACN,MAAM;+BAEN,YAAY,SAAC,oBAAoB;;AA0PpC;;GAEG;AACH,6EAA6E;AAC7E,SAAS,YAAY,CAAC,OAAoB;IACxC,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAgB,CAAC;IACrD,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC;AACD,SAAS,wBAAwB,CAAC,WAAgB;IAChD,2DAA2D;IAC3D,gEAAgE;IAChE,OAAO,WAAW,CAAC,iBAAiB;QAC7B,WAAW,CAAC,uBAAuB;QACnC,WAAW,CAAC,oBAAoB;QAChC,WAAW,CAAC,mBAAmB;QAC/B,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC","sourcesContent":["import { Directive, ElementRef, Input, OnInit, Output,\n OnDestroy, EventEmitter, Optional, SkipSelf, Renderer2, SimpleChanges, OnChanges, ContentChild, ViewContainerRef, Inject, AfterViewInit } from '@angular/core';\nimport { DOCUMENT } from '@angular/common'\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { DraggableOptions, Interactable } from '@interactjs/types/index';\nimport { Subscription, Observable } from 'rxjs';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { NgDragEvent, TftDragEvent, DEFAULT_REGISTRY_ID, TftCoords, TftDragElement} from '../models';\nimport { DragPreviewDirective } from './drag-preview.directive';\nimport { getRootNode } from '../utils';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\n/** @dynamic */\n@Directive({\n selector: '[tftDraggable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[style.touchAction]': 'this.dragDisabled ? \"auto\" : \"none\"',\n '[style.position]': '\"absolute\"',\n '[id]': 'interactableId',\n }\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DraggableDirective<D = any> implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n\n\n @Input() x: number;\n @Input() y: number;\n /* zIndex while dragging*/\n @Input() dragZIndex = 10000;\n /** zIndex while at rest */\n @Input() zIndex: number\n @Input() interactableId: string;\n @Input() dragData: D;\n @Input() enableDragDefault = true;\n /**\n * @deprecated replaced by 'dragDisabled' property, please migrate before v13\n */\n @Input() disabled = false;\n @Input() dragDisabled = false;\n @Input() dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n @Input() showPlaceholder = false;\n\n /**\n * The element we want to prepend the drag element to.\n * Use `tftDragRoot` directive on a parent element to set custom root element\n * @default document.body\n */\n @Input() dragRoot: DragRootDirective; // HTMLElement;\n\n private dragRootEl: HTMLElement;\n // pipes all interact events to event emitters\n @Output() dragStart = new EventEmitter<TftDragEvent>();\n @Output() dragMove = new EventEmitter<TftDragEvent>();\n @Output() dragInertiaStart = new EventEmitter<TftDragEvent>();\n @Output() dragEnd = new EventEmitter<TftDragEvent>();\n\n @ContentChild(DragPreviewDirective) _previewTemplate: DragPreviewDirective;\n // dragPreview: Interact.Element;\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n private registryId: string;\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n // cache holding element to use as drag preview (the element the user sees being dragged around)\n previewRef: TftDragElement;\n // check all the different places for scale\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir.scale || this.dragRoot?.account_for_scale_dir?.scale;\n }\n\n constructor(\n public el: ElementRef,\n private interactService: InteractService,\n private renderer: Renderer2,\n private _viewContainerRef: ViewContainerRef,\n @Inject(DOCUMENT) private _document: Document,\n @Optional() public account_for_scale_dir?: AccountForScaleDirective,\n @Optional() @SkipSelf() public dropzone_dir?: DropzoneDirective,\n @Optional() @SkipSelf() public drag_root_dir?: DragRootDirective,\n @Optional() @SkipSelf() public auto_scroll_dir?: AutoScrollDirective\n ) { }\n\n ngOnInit() {\n this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);\n this.dragRootEl = (this.dragRoot?.el?.nativeElement || this.drag_root_dir?.el?.nativeElement) as HTMLElement || this._document.body;\n // register with parent dropzone if it exists, otherwise use default\n // this gives us a place on the registry to store our drag items that don't have a dropzone\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n // add draggable to directory and store its id\n this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n this.alignPositionWithInputs(this.x, this.y);\n // cache subscription to interactable state so we can unsubscribe onDestroy\n this.interactableState = this.interactService\n .getInteractableState(this.interactableId, this.registryId);\n // keep our cached position values in line with our drag state\n this.interactableSubscription = this.interactableState.subscribe((state) => {\n this.y = state.y;\n this.x = state.x;\n });\n this.setDragConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.y || changes.x) {\n this.alignPositionWithInputs(this.x, this.y);\n }\n if(changes.dragConfig || changes.disabled || changes.dragDisabled) {\n if(!this.interactable) return;\n this.setDragConfig();\n }\n /**\n * @deprecated remove this in v13\n */\n if (changes.disabled) {\n console.warn(`It looks like your using the 'disabled' input on a tftDraggable directive, it has been deprecated and is replaced with 'dragDisabled', please migrate by v13`)\n }\n }\n\n setDragConfig() {\n const enabled = !(this.disabled || this.dragDisabled)\n const dragConfig = {...this.dragConfig, enabled};\n this.interactable.draggable(dragConfig);\n }\n\n ngAfterViewInit() {\n this.addDragPropertiesToElement(this.el.nativeElement);\n if (!this.dropzone_dir) {\n this.previewRef = this.el.nativeElement;\n }\n }\n\n ngOnDestroy() {\n // clean up state and subscriptions related to destroyed component\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n dragMoveListener(event: NgDragEvent, element: Interact.Element) {\n const { dx, dy } = event;\n const scale = this.scale;\n const deltaX = scale ? dx / scale : dx;\n const deltaY = scale ? dy / scale : dy;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n element\n );\n }\n\n setDragStyles(dragElement: HTMLElement) {\n this.renderer.setStyle(dragElement, 'touchAction', 'none')\n this.renderer.setStyle(dragElement, 'zIndex', this.dragZIndex)\n this.renderer.setStyle(dragElement, 'position', 'absolute')\n }\n\n addDragPropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragOrigin', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragRef', this);\n }\n\n mapDragEvent(event: NgDragEvent): TftDragEvent {\n const { target, dropzone } = event;\n const dropzoneElement = dropzone?.target || target.dropTarget?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && dropzoneElement\n ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: this,\n dragOrigin: target.dragOrigin,\n dropTarget: target.dropTarget,\n positionInDropTarget\n }\n }\n\n setPosition(x: number, y: number) {\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n alignPositionWithInputs(x: number, y: number) {\n // short circuit if positions aren't numbers or if they haven't changed\n if(!this.isValidPosition(x, y)) return;\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n isValidPosition(x: number, y: number) {\n return this.isNumeric(x) && this.isNumeric(y);\n }\n // We use use this instead of isNaN here to try and help performance\n // We should be able to reliably restrict to numbers or falsey values\n isNumeric(num: number) {\n return typeof num === 'number' && !isNaN(num);\n }\n\n initiateDragEvents(dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>, nativeElement: HTMLElement) {\n const defaultDragConfig = {\n ...dragConfig,\n enabled: !(this.disabled || this.dragDisabled),\n ...(this.auto_scroll_dir && {\n autoScroll:\n {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n }\n )\n };\n return interact(nativeElement).draggable(defaultDragConfig)\n .on('dragstart', (event: NgDragEvent) => {\n const interaction = event.interaction;\n // check if we should append drag element to body\n if ( this.enableDragDefault\n && interaction.pointerIsDown\n // TODO: probably don't need following condition checks anymore remove by 2022\n // && !!this.dropzone_dir\n // && !interaction.interacting()\n ) {\n if (this._previewTemplate) {\n const viewRef = this._viewContainerRef.createEmbeddedView(this._previewTemplate.templateRef);\n this.previewRef = getRootNode(viewRef, this._document);\n } else {\n this.previewRef = cloneElement(this.el.nativeElement);\n }\n this.addDragPropertiesToElement(this.previewRef);\n this.setDragStyles(this.previewRef)\n\n this.dragRootEl.prepend(this.previewRef);\n const scale = this.account_for_scale_dir?.scale || this.dragRoot?.account_for_scale_dir?.scale || 1;\n const {x, y} = this.interactService.calculatePositionInElement(this.dragRootEl, nativeElement, scale);\n this.interactService.updatePosition(this.interactableId, this.registryId, {x, y}, this.previewRef);\n if (!this.showPlaceholder) {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'none');\n }\n }\n // subscribe to scroll events if they are there, by only subscribing on dragstart we avoid wasting subscriptions on interactables that aren't be dragged\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.dragStart.emit(this.mapDragEvent(event));\n })\n .on('dragmove', (event: NgDragEvent) => {\n if (this.enableDragDefault) {\n const dragElement = this.dropzone_dir && this.previewRef || nativeElement\n this.dragMoveListener(event, dragElement);\n }\n const mappedEvent = this.mapDragEvent(event);\n this.dragMove.emit(mappedEvent);\n })\n .on('draginertiastart', (event: NgDragEvent) => {\n this.dragInertiaStart.emit(this.mapDragEvent(event))\n })\n .on('dragend', (event: NgDragEvent) => {\n const mappedEvent = this.mapDragEvent(event)\n if(!!this.dropzone_dir && this.dropzone_dir === event.target.dropTarget) {\n const { x, y} = mappedEvent.positionInDropTarget;\n this.setPosition(x, y);\n }\n this.renderer.setStyle(this.el.nativeElement, 'display', '');\n this.dragEnd.emit(mappedEvent);\n // unsubscribe from scroll events if subscribed\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n if ( this.el.nativeElement !== this.previewRef) {\n // we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect\n setTimeout(() => {\n this.dragRootEl.removeChild(this.previewRef);\n })\n }\n });\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const deltaX = this.scale ? scrollLeft / this.scale : scrollLeft;\n const deltaY = this.scale ? scrollTop / this.scale : scrollTop;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n this.previewRef\n );\n });\n\n }\n}\n\n/**\n * Component utils\n */\n// create a clone of the component passed in and add it to the root component\nfunction cloneElement(element: HTMLElement) {\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DraggableDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":15,"character":1},"arguments":[{"selector":"[tftDraggable]","host":{"[style.touchAction]":"this.dragDisabled ? \"auto\" : \"none\"","[style.position]":"\"absolute\"","[id]":"interactableId","$quoted$":["[style.touchAction]","[style.position]","[id]"]}}]}],"members":{"x":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}}]}],"y":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"dragZIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"zIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"interactableId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"enableDragDefault":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"dragDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"dragConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"showPlaceholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"dragRoot":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3}}]}],"dragStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":53,"character":3}}]}],"dragMove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":54,"character":3}}]}],"dragInertiaStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":55,"character":3}}]}],"dragEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":3}}]}],"_previewTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":58,"character":3},"arguments":[{"__symbolic":"reference","module":"./drag-preview.directive","name":"DragPreviewDirective","line":58,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":72,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":72,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":73,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":74,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":74,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":75,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":75,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":68,"character":15},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":69,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":70,"character":22},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":71,"character":31},{"__symbolic":"error","message":"Could not resolve type","line":72,"character":41,"context":{"typeName":"Document"}},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":73,"character":47},{"__symbolic":"reference","module":"./dropzone.directive","name":"DropzoneDirective","line":74,"character":50},{"__symbolic":"reference","module":"./drag-root.directive","name":"DragRootDirective","line":75,"character":51}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"setDragConfig":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"dragMoveListener":[{"__symbolic":"method"}],"setDragStyles":[{"__symbolic":"method"}],"addDragPropertiesToElement":[{"__symbolic":"method"}],"mapDragEvent":[{"__symbolic":"method"}],"setPosition":[{"__symbolic":"method"}],"alignPositionWithInputs":[{"__symbolic":"method"}],"isValidPosition":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"initiateDragEvents":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"DraggableDirective":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":16,"character":1},"arguments":[{"selector":"[tftDraggable]","host":{"[style.touchAction]":"this.dragDisabled ? \"auto\" : \"none\"","[style.position]":"\"absolute\"","[id]":"interactableId","$quoted$":["[style.touchAction]","[style.position]","[id]"]}}]}],"members":{"x":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"y":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"dragZIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"zIndex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"interactableId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"dragData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"enableDragDefault":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"dragDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"dragConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"showPlaceholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"dragRoot":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":51,"character":3}}]}],"dragStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":55,"character":3}}]}],"dragMove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":56,"character":3}}]}],"dragInertiaStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":57,"character":3}}]}],"dragEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":58,"character":3}}]}],"_previewTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":60,"character":3},"arguments":[{"__symbolic":"reference","module":"./drag-preview.directive","name":"DragPreviewDirective","line":60,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":80,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":80,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":81,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":82,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":82,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":83,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":83,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":84,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":84,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":76,"character":15},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":77,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":78,"character":22},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":79,"character":31},{"__symbolic":"error","message":"Could not resolve type","line":80,"character":41,"context":{"typeName":"Document"}},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":81,"character":47},{"__symbolic":"reference","module":"./dropzone.directive","name":"DropzoneDirective","line":82,"character":50},{"__symbolic":"reference","module":"./drag-root.directive","name":"DragRootDirective","line":83,"character":51},{"__symbolic":"reference","module":"./auto-scroll.directive","name":"AutoScrollDirective","line":84,"character":53}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"setDragConfig":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"dragMoveListener":[{"__symbolic":"method"}],"setDragStyles":[{"__symbolic":"method"}],"addDragPropertiesToElement":[{"__symbolic":"method"}],"mapDragEvent":[{"__symbolic":"method"}],"setPosition":[{"__symbolic":"method"}],"alignPositionWithInputs":[{"__symbolic":"method"}],"isValidPosition":[{"__symbolic":"method"}],"isNumeric":[{"__symbolic":"method"}],"initiateDragEvents":[{"__symbolic":"method"}],"subscribeToScrollEvents":[{"__symbolic":"method"}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draggable.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/draggable.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -1,4 +1,4 @@
1
- import { Directive, ElementRef, Input, Output, EventEmitter, Renderer2, Optional } from '@angular/core';
1
+ import { Directive, ElementRef, Input, Output, EventEmitter, Renderer2, Optional, HostBinding } from '@angular/core';
2
2
  import interact from 'interactjs';
3
3
  import { InteractService } from '../services/interact.service';
4
4
  import { AccountForScaleDirective } from './account-for-scale.directive';
@@ -9,12 +9,17 @@ export class DropzoneDirective {
9
9
  this.interactService = interactService;
10
10
  this.account_for_scale_dir = account_for_scale_dir;
11
11
  this.dropzoneConfig = {};
12
+ this.position = 'relative';
12
13
  // proxies to pass interact events through to consumer of directive
13
14
  this.dropActivate = new EventEmitter();
14
15
  this.dragEnter = new EventEmitter();
15
16
  this.dragLeave = new EventEmitter();
16
17
  this.dragDrop = new EventEmitter();
17
18
  }
19
+ get scale() {
20
+ var _a;
21
+ return (_a = this.account_for_scale_dir) === null || _a === void 0 ? void 0 : _a.scale;
22
+ }
18
23
  ngOnInit() {
19
24
  // connects
20
25
  this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);
@@ -60,10 +65,7 @@ export class DropzoneDirective {
60
65
  var _a, _b;
61
66
  const zoneElement = event.target;
62
67
  const dragElement = (_b = (_a = event.relatedTarget) === null || _a === void 0 ? void 0 : _a.dragRef) === null || _b === void 0 ? void 0 : _b.previewRef;
63
- const scale = this.account_for_scale_dir ? {
64
- x: this.account_for_scale_dir.scaleX,
65
- y: this.account_for_scale_dir.scaleY
66
- } : null;
68
+ const scale = this.scale;
67
69
  const positionInDropTarget = zoneElement && dragElement
68
70
  ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)
69
71
  : null;
@@ -80,7 +82,7 @@ DropzoneDirective.decorators = [
80
82
  { type: Directive, args: [{
81
83
  selector: '[tftDropzone]',
82
84
  host: {
83
- '[id]': 'dropzoneId',
85
+ '[id]': 'dropzoneId'
84
86
  }
85
87
  },] }
86
88
  ];
@@ -94,6 +96,7 @@ DropzoneDirective.propDecorators = {
94
96
  dropzoneId: [{ type: Input }],
95
97
  dropzoneConfig: [{ type: Input }],
96
98
  dropzoneData: [{ type: Input }],
99
+ position: [{ type: Input }, { type: HostBinding, args: ['style.position',] }],
97
100
  dropActivate: [{ type: Output }],
98
101
  dragEnter: [{ type: Output }],
99
102
  dragLeave: [{ type: Output }],