@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
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/dropzone.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAU,MAAM,EAAE,YAAY,EAA4B,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1I,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAOzE,MAAM,OAAO,iBAAiB;IAa5B,YACS,EAAc,EACb,QAAmB,EACnB,eAAgC,EACpB,qBAAgD;QAH7D,OAAE,GAAF,EAAE,CAAY;QACb,aAAQ,GAAR,QAAQ,CAAW;QACnB,oBAAe,GAAf,eAAe,CAAiB;QACpB,0BAAqB,GAArB,qBAAqB,CAA2B;QAd7D,mBAAc,GAAoB,EAAE,CAAC;QAG9C,mEAAmE;QACzD,iBAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QAClC,cAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,cAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,aAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;IAQpC,CAAC;IAEL,QAAQ;QACN,WAAW;QACX,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACvF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,C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AAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC;IACD;;;OAGG;IACH,gBAAgB,CAAC,KAAkB;;QACjC,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,MAAM,WAAW,GAAG,MAAA,MAAA,KAAK,CAAC,aAAa,0CAAE,OAAO,0CAAE,UAA4B,CAAC;QAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC;YACvC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,MAAM;YACpC,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,MAAM;SACrC,CAAC,CAAC,CAAC,IAAI,CAAC;QACX,MAAM,oBAAoB,GAAG,WAAW,IAAI,WAAW;YACvD,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,0BAA0B,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC;YAClF,CAAC,CAAC,IAAI,CAAC;QACP,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,UAAU,EAAE,WAAW,CAAC,UAAU;YAClC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU;YAC1C,oBAAoB;SACrB,CAAA;IACH,CAAC;;;YApFF,SAAS,SAAC;gBACT,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE;oBACJ,MAAM,EAAE,YAAY;iBACrB;aACF;;;YAXmB,UAAU;YAAiE,SAAS;YAG/F,eAAe;YAEf,wBAAwB,uBAwB5B,QAAQ;;;yBAfV,KAAK;6BACL,KAAK;2BAEL,KAAK;2BAEL,MAAM;wBACN,MAAM;wBACN,MAAM;uBACN,MAAM","sourcesContent":["import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, Renderer2, Optional } from '@angular/core';\nimport interact from 'interactjs';\nimport { DropzoneOptions, Interactable } from '@interactjs/types/index';\nimport { InteractService } from '../services/interact.service';\nimport { NgDropEvent, TftDragElement, TftDropEvent } from '../models';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n@Directive({\n selector: '[tftDropzone]',\n host: {\n '[id]': 'dropzoneId',\n }\n})\nexport class DropzoneDirective implements OnInit, OnChanges {\n\n @Input() dropzoneId: string;\n @Input() dropzoneConfig: DropzoneOptions = {};\n // tslint:disable-next-line: no-input-rename\n @Input() dropzoneData: any;\n // proxies to pass interact events through to consumer of directive\n @Output() dropActivate = new EventEmitter();\n @Output() dragEnter = new EventEmitter();\n @Output() dragLeave = new EventEmitter();\n @Output() dragDrop = new EventEmitter();\n\n dropzone: Interactable;\n constructor(\n public el: ElementRef,\n private renderer: Renderer2,\n private interactService: InteractService,\n @Optional() private account_for_scale_dir?: AccountForScaleDirective\n ) { }\n\n ngOnInit() {\n // connects\n this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);\n this.dropzoneId = this.interactService.addRegistryToSystem(this.dropzoneId);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(!changes.dropzoneConfig || !this.dropzone) return;\n // this.dropzone.unset();\n // this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig)\n this.dropzone.dropzone(this.dropzoneConfig)\n }\n /**\n * Connects element to interacts dropzone events and returns a reference to the interactable\n * @param nativeElement the element to tie drop events to\n * @param dropzoneConfig the interact configuration to use when connecting\n */\n connectDropzoneEvents(nativeElement, dropzoneConfig: DropzoneOptions) {\n return interact(nativeElement).dropzone(dropzoneConfig)\n // TODO: investigate when this fires in different scenarios\n .on('dropactivate', (event: NgDropEvent) => {\n this.dropActivate.emit(this.mapDropzoneEvent(event));\n })\n .on('dragenter', (event: NgDropEvent) => {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', this)\n this.dragEnter.emit(this.mapDropzoneEvent(event));\n })\n .on('dragleave', (event: NgDropEvent) => {\n if ( event.relatedTarget.dropTarget === this) {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', null)\n }\n this.dragLeave.emit(this.mapDropzoneEvent(event));\n })\n .on('drop', (event: NgDropEvent) => {\n this.dragDrop.emit(this.mapDropzoneEvent(event));\n });\n }\n /**\n * Maps the drop event emitted by interact to something a little easier to use\n * @param event the drop event emitted by interact, extended with extra fields we added to\n */\n mapDropzoneEvent(event: NgDropEvent): TftDropEvent {\n const zoneElement = event.target;\n const dragElement = event.relatedTarget?.dragRef?.previewRef as TftDragElement;\n const scale = this.account_for_scale_dir ? {\n x: this.account_for_scale_dir.scaleX,\n y: this.account_for_scale_dir.scaleY\n } : null;\n const positionInDropTarget = zoneElement && dragElement\n ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: dragElement.dragRef,\n dragOrigin: dragElement.dragOrigin,\n dropTarget: event.relatedTarget.dropTarget,\n positionInDropTarget\n }\n }\n}\n"]}
1
+ {"version":3,"file":"dropzone.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/dropzone.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAU,MAAM,EAAE,YAAY,EAA4B,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvJ,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AASzE,MAAM,OAAO,iBAAiB;IAoB5B,YACS,EAAc,EACb,QAAmB,EACnB,eAAgC,EACpB,qBAAgD;QAH7D,OAAE,GAAF,EAAE,CAAY;QACb,aAAQ,GAAR,QAAQ,CAAW;QACnB,oBAAe,GAAf,eAAe,CAAiB;QACpB,0BAAqB,GAArB,qBAAqB,CAA2B;QArB7D,mBAAc,GAAoB,EAAE,CAAC;QAKf,aAAQ,GAAmB,UAAU,CAAC;QACrE,mEAAmE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,eAAe;gBACzB,IAAI,EAAE;oBACJ,MAAM,EAAE,YAAY;iBACrB;aACF;;;YAbmB,UAAU;YAAiE,SAAS;YAG/F,eAAe;YAEf,wBAAwB,uBAiC5B,QAAQ;;;yBAtBV,KAAK;6BACL,KAAK;2BAEL,KAAK;uBAEL,KAAK,YACL,WAAW,SAAC,gBAAgB;2BAE5B,MAAM;wBACN,MAAM;wBACN,MAAM;uBACN,MAAM","sourcesContent":["import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, Renderer2, Optional, HostBinding } from '@angular/core';\nimport interact from 'interactjs';\nimport { DropzoneOptions, Interactable } from '@interactjs/types/index';\nimport { InteractService } from '../services/interact.service';\nimport { NgDropEvent, TftDragElement, TftDropEvent } from '../models';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n\nexport type PositionOption = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky' | 'unset' | 'inherit' | 'initial' | 'revert'\n@Directive({\n selector: '[tftDropzone]',\n host: {\n '[id]': 'dropzoneId'\n }\n})\nexport class DropzoneDirective implements OnInit, OnChanges {\n\n @Input() dropzoneId: string;\n @Input() dropzoneConfig: DropzoneOptions = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() dropzoneData: any;\n\n @Input()\n @HostBinding('style.position') position: PositionOption = 'relative';\n // proxies to pass interact events through to consumer of directive\n @Output() dropActivate = new EventEmitter<TftDropEvent>();\n @Output() dragEnter = new EventEmitter<TftDropEvent>();\n @Output() dragLeave = new EventEmitter<TftDropEvent>();\n @Output() dragDrop = new EventEmitter<TftDropEvent>();\n\n dropzone: Interactable;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale;\n }\n constructor(\n public el: ElementRef,\n private renderer: Renderer2,\n private interactService: InteractService,\n @Optional() private account_for_scale_dir?: AccountForScaleDirective\n ) { }\n\n ngOnInit() {\n // connects\n this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);\n this.dropzoneId = this.interactService.addRegistryToSystem(this.dropzoneId);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(!changes.dropzoneConfig || !this.dropzone) return;\n // this.dropzone.unset();\n // this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig)\n this.dropzone.dropzone(this.dropzoneConfig)\n }\n /**\n * Connects element to interacts dropzone events and returns a reference to the interactable\n * @param nativeElement the element to tie drop events to\n * @param dropzoneConfig the interact configuration to use when connecting\n */\n connectDropzoneEvents(nativeElement, dropzoneConfig: DropzoneOptions) {\n return interact(nativeElement).dropzone(dropzoneConfig)\n // TODO: investigate when this fires in different scenarios\n .on('dropactivate', (event: NgDropEvent) => {\n this.dropActivate.emit(this.mapDropzoneEvent(event));\n })\n .on('dragenter', (event: NgDropEvent) => {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', this)\n this.dragEnter.emit(this.mapDropzoneEvent(event));\n })\n .on('dragleave', (event: NgDropEvent) => {\n if ( event.relatedTarget.dropTarget === this) {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', null)\n }\n this.dragLeave.emit(this.mapDropzoneEvent(event));\n })\n .on('drop', (event: NgDropEvent) => {\n this.dragDrop.emit(this.mapDropzoneEvent(event));\n });\n }\n /**\n * Maps the drop event emitted by interact to something a little easier to use\n * @param event the drop event emitted by interact, extended with extra fields we added to\n */\n mapDropzoneEvent(event: NgDropEvent): TftDropEvent {\n const zoneElement = event.target;\n const dragElement = event.relatedTarget?.dragRef?.previewRef as TftDragElement;\n const scale = this.scale;\n const positionInDropTarget = zoneElement && dragElement\n ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: dragElement.dragRef,\n dragOrigin: dragElement.dragOrigin,\n dropTarget: event.relatedTarget.dropTarget,\n positionInDropTarget\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DropzoneDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":6,"character":1},"arguments":[{"selector":"[tftDropzone]","host":{"[id]":"dropzoneId","$quoted$":["[id]"]}}]}],"members":{"dropzoneId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"dropzoneConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"dropzoneData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"dropActivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":19,"character":3}}]}],"dragEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":20,"character":3}}]}],"dragLeave":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":21,"character":3}}]}],"dragDrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":22,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":29,"character":5}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":26,"character":15},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":27,"character":22},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":28,"character":29},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":29,"character":48}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"connectDropzoneEvents":[{"__symbolic":"method"}],"mapDropzoneEvent":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"PositionOption":{"__symbolic":"interface"},"DropzoneDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":8,"character":1},"arguments":[{"selector":"[tftDropzone]","host":{"[id]":"dropzoneId","$quoted$":["[id]"]}}]}],"members":{"dropzoneId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"dropzoneConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"dropzoneData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"position":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":22,"character":3},"arguments":["style.position"]}]}],"dropActivate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":24,"character":3}}]}],"dragEnter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":25,"character":3}}]}],"dragLeave":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":26,"character":3}}]}],"dragDrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":27,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":38,"character":5}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":35,"character":15},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":36,"character":22},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":37,"character":29},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":38,"character":48}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"connectDropzoneEvents":[{"__symbolic":"method"}],"mapDropzoneEvent":[{"__symbolic":"method"}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropzone.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/dropzone.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gesturable.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/gesturable.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -6,4 +6,5 @@ export * from './gesturable.directive';
6
6
  export * from './drag-root.directive';
7
7
  export * from './account-for-scale.directive';
8
8
  export * from './apply-scale.directive';
9
+ export * from './auto-scroll.directive';
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './draggable.directive';\r\nexport * from './dropzone.directive';\r\nexport * from './resizable.directive';\r\nexport * from './drag-preview.directive';\r\nexport * from './gesturable.directive';\r\nexport * from './drag-root.directive';\r\nexport * from './account-for-scale.directive';\r\nexport * from './apply-scale.directive';\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './draggable.directive';\nexport * from './dropzone.directive';\nexport * from './resizable.directive';\nexport * from './drag-preview.directive';\nexport * from './gesturable.directive';\nexport * from './drag-root.directive';\nexport * from './account-for-scale.directive';\nexport * from './apply-scale.directive';\nexport * from './auto-scroll.directive';\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./draggable.directive"},{"from":"./dropzone.directive"},{"from":"./resizable.directive"},{"from":"./drag-preview.directive"},{"from":"./gesturable.directive"},{"from":"./drag-root.directive"},{"from":"./account-for-scale.directive"},{"from":"./apply-scale.directive"}]}]
1
+ [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./draggable.directive"},{"from":"./dropzone.directive"},{"from":"./resizable.directive"},{"from":"./drag-preview.directive"},{"from":"./gesturable.directive"},{"from":"./drag-root.directive"},{"from":"./account-for-scale.directive"},{"from":"./apply-scale.directive"},{"from":"./auto-scroll.directive"}]}]
@@ -7,17 +7,20 @@ import { DropzoneDirective } from './dropzone.directive';
7
7
  import { DragRootDirective } from './drag-root.directive';
8
8
  import { AccountForScaleDirective } from './account-for-scale.directive';
9
9
  import { DEFAULT_REGISTRY_ID } from '../models';
10
+ import { AutoScrollDirective } from './auto-scroll.directive';
10
11
  /** @dynamic */
11
12
  export class ResizableDirective {
12
- constructor(el, _document, interactService, renderer, drag_root_dir, account_for_scale_dir, draggable_dir, dropzone_dir) {
13
+ constructor(el, _document, interactService, renderer, drag_root_dir, account_for_scale_dir, draggable_dir, dropzone_dir, auto_scroll_dir) {
13
14
  var _a;
14
15
  this.el = el;
15
16
  this._document = _document;
16
17
  this.interactService = interactService;
17
18
  this.renderer = renderer;
19
+ this.drag_root_dir = drag_root_dir;
18
20
  this.account_for_scale_dir = account_for_scale_dir;
19
21
  this.draggable_dir = draggable_dir;
20
22
  this.dropzone_dir = dropzone_dir;
23
+ this.auto_scroll_dir = auto_scroll_dir;
21
24
  this.enableResizeDefault = true;
22
25
  // TODO: should this be an input with default or should consuming user set display in styles each time
23
26
  this.position = 'absolute';
@@ -29,7 +32,12 @@ export class ResizableDirective {
29
32
  this.defaultConfig = {
30
33
  edges: { left: true, right: true, bottom: true, top: true }
31
34
  };
32
- this.dragRoot = ((_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;
35
+ this.activeEdges = { left: false, right: false, top: false, bottom: false };
36
+ 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;
37
+ }
38
+ get scale() {
39
+ var _a, _b, _c;
40
+ 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);
33
41
  }
34
42
  ngOnInit() {
35
43
  var _a, _b;
@@ -58,9 +66,16 @@ export class ResizableDirective {
58
66
  this.interactService.destroyInteractable(this.interactableId, this.registryId);
59
67
  }
60
68
  resizeListener(event) {
61
- const deltaX = event.deltaRect.left;
62
- const deltaY = event.deltaRect.top;
63
- const { width, height } = event.rect;
69
+ const element = this.el.nativeElement;
70
+ const scale = this.scale;
71
+ const { deltaRect } = event;
72
+ const deltaX = deltaRect.left / scale;
73
+ const deltaY = deltaRect.top / scale;
74
+ // We get the width and height directly from the native element because
75
+ // the event dimension can get out of sync when resizing with autoScroll
76
+ const rect = element.getBoundingClientRect();
77
+ const width = (rect.width + deltaRect.width) / scale;
78
+ const height = (rect.height + deltaRect.height) / scale;
64
79
  this.interactService.updateSize(this.interactableId, this.registryId, { deltaX, deltaY, width, height }, this.el.nativeElement);
65
80
  }
66
81
  /**
@@ -73,9 +88,18 @@ export class ResizableDirective {
73
88
  initiateResizeEvents(resizeConfig, nativeElement) {
74
89
  var _a;
75
90
  // TODO: This should try and get interactable from tft_draggable if it exists
91
+ const defaultResizeConfig = Object.assign(Object.assign(Object.assign({}, resizeConfig), { enabled: !this.resizeDisabled }), (this.auto_scroll_dir && {
92
+ autoScroll: Object.assign(Object.assign({}, this.auto_scroll_dir.autoScrollConfig), { container: this.auto_scroll_dir.el.nativeElement })
93
+ }));
76
94
  const interactable = ((_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.interactable) || interact(nativeElement);
77
- return interactable.resizable(Object.assign(Object.assign({}, resizeConfig), { enabled: !this.resizeDisabled }))
78
- .on('resizestart', (event) => { this.resizeStart.emit(this.mapResizeEvent(event)); })
95
+ return interactable.resizable(defaultResizeConfig)
96
+ .on('resizestart', (event) => {
97
+ this.activeEdges = event.edges;
98
+ if (this.auto_scroll_dir) {
99
+ this.subscribeToScrollEvents();
100
+ }
101
+ this.resizeStart.emit(this.mapResizeEvent(event));
102
+ })
79
103
  .on('resizemove', (event) => {
80
104
  if (this.enableResizeDefault) {
81
105
  this.resizeListener(event);
@@ -84,23 +108,33 @@ export class ResizableDirective {
84
108
  this.resizeMove.emit(mappedEvent);
85
109
  })
86
110
  .on('resizeinertiastart', (event) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))
87
- .on('resizeend', (event) => this.resizeEnd.emit(this.mapResizeEvent(event)));
111
+ .on('resizeend', (event) => {
112
+ if (this.auto_scroll_dir) {
113
+ this.scrollEventsSubscription.unsubscribe();
114
+ }
115
+ this.activeEdges = { left: false, right: false, top: false, bottom: false };
116
+ this.resizeEnd.emit(this.mapResizeEvent(event));
117
+ });
88
118
  }
89
119
  mapResizeEvent(event) {
90
120
  var _a, _b;
91
- const target = event.target;
121
+ const target = this.el.nativeElement;
92
122
  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;
123
+ const scale = this.scale;
93
124
  const positionInDropTarget = target && relatedTarget
94
- ? this.interactService.calculatePositionInElement(relatedTarget, target)
125
+ ? this.interactService.calculatePositionInElement(relatedTarget, target, scale)
95
126
  : null;
96
127
  return {
97
128
  interactEvent: event,
98
129
  resizeRef: this,
99
- // should I remove this?
100
130
  dragRef: this.draggable_dir,
101
131
  dragOrigin: this.dropzone_dir,
102
132
  dropTarget: this.el.nativeElement.dropTarget,
103
- positionInDropTarget
133
+ positionInDropTarget,
134
+ size: {
135
+ width: target.clientWidth / scale,
136
+ height: target.clientHeight / scale
137
+ }
104
138
  };
105
139
  }
106
140
  alignDimensionsWithInputs(width, height) {
@@ -109,6 +143,20 @@ export class ResizableDirective {
109
143
  addResizePropertiesToElement(nativeElement) {
110
144
  this.renderer.setProperty(nativeElement, 'resizeRef', this);
111
145
  }
146
+ subscribeToScrollEvents() {
147
+ this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({ scrollLeft, scrollTop }) => {
148
+ const scale = this.scale;
149
+ const target = this.el.nativeElement;
150
+ const { width: prevWidth, height: prevHeight } = target.getBoundingClientRect();
151
+ const deltaHeight = scrollTop * (this.activeEdges.top ? -1 : this.activeEdges.bottom ? 1 : 0);
152
+ const deltaWidth = scrollLeft * (this.activeEdges.left ? -1 : this.activeEdges.right ? 1 : 0);
153
+ const height = (prevHeight + deltaHeight) / scale;
154
+ const width = (prevWidth + deltaWidth) / scale;
155
+ const deltaX = this.activeEdges.left ? (scrollLeft / scale) : 0;
156
+ const deltaY = this.activeEdges.top ? (scrollTop / scale) : 0;
157
+ this.interactService.updateSize(this.interactableId, this.registryId, { deltaX, deltaY, width, height }, this.el.nativeElement);
158
+ });
159
+ }
112
160
  }
113
161
  ResizableDirective.decorators = [
114
162
  { type: Directive, args: [{
@@ -134,7 +182,8 @@ ResizableDirective.ctorParameters = () => [
134
182
  { type: DragRootDirective, decorators: [{ type: Optional }] },
135
183
  { type: AccountForScaleDirective, decorators: [{ type: Optional }] },
136
184
  { type: DraggableDirective, decorators: [{ type: Optional }] },
137
- { type: DropzoneDirective, decorators: [{ type: Optional }, { type: SkipSelf }] }
185
+ { type: DropzoneDirective, decorators: [{ type: Optional }, { type: SkipSelf }] },
186
+ { type: AutoScrollDirective, decorators: [{ type: Optional }, { type: SkipSelf }] }
138
187
  ];
139
188
  ResizableDirective.propDecorators = {
140
189
  enableResizeDefault: [{ type: Input }],
@@ -1 +1 @@
1
- {"version":3,"file":"resizable.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/resizable.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAA4B,SAAS,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACtK,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAiC,mBAAmB,EAAkB,MAAM,WAAW,CAAC;AAE/F,eAAe;AAgBf,MAAM,OAAO,kBAAkB;IA2B7B,YACS,EAAc,EACK,SAAmB,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U;oBAC9B,yCAAyC;oBACzC,mBAAmB,EAAE,cAAc;iBAEpC;aACF;;;YA3BsC,UAAU;YAyDR,QAAQ,uBAA5C,MAAM,SAAC,QAAQ;YAtDX,eAAe;YAHsG,SAAS;YAQ9H,iBAAiB,uBAoDrB,QAAQ;YAnDJ,wBAAwB,uBAoD5B,QAAQ;YAvDJ,kBAAkB,uBAwDtB,QAAQ;YAvDJ,iBAAiB,uBAwDrB,QAAQ,YAAI,QAAQ;;;kCAjCtB,KAAK;uBAEL,KAAK;2BACL,KAAK;6BACL,KAAK;oBAEL,KAAK;qBACL,KAAK;6BACL,KAAK;0BAEL,MAAM;yBACN,MAAM;iCACN,MAAM;wBACN,MAAM","sourcesContent":["import { Directive, OnInit, OnDestroy, ElementRef, Input, Optional, SkipSelf, Output, EventEmitter, OnChanges, SimpleChanges, Renderer2, Inject} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { ResizableOptions, ResizeEvent, Interactable } from '@interactjs/types/index';\nimport { Subscription } from 'rxjs';\nimport { DraggableDirective } from './draggable.directive';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { NgResizeEvent, TftResizeEvent, DEFAULT_REGISTRY_ID, TftDragElement } from '../models';\n\n/** @dynamic */\n@Directive({\n selector: '[tftResizable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // prevents touch events from colliding with with mouse events\n // on touch screen\n '[style.touchAction]': 'this.resizeDisabled ? \"auto\" : \"none\"',\n // default to absolute here to accommodate likely use cases\n // consuming component can easily over ride with position input\n '[style.position]': 'position',\n // follows interactjs suggested practices\n '[style.boxSizing]': '\"border-box\"',\n\n }\n})\nexport class ResizableDirective implements OnInit, OnDestroy, OnChanges {\n\n @Input() enableResizeDefault = true;\n // TODO: should this be an input with default or should consuming user set display in styles each time\n @Input() position = 'absolute';\n @Input() resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>;\n @Input() interactableId: string;\n\n @Input() width: number;\n @Input() height: number;\n @Input() resizeDisabled = false;\n\n @Output() resizeStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeMove = new EventEmitter<TftResizeEvent>();\n @Output() resizeInertiaStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeEnd = new EventEmitter<TftResizeEvent>();\n\n defaultConfig: Partial<Interact.OrBoolean<ResizableOptions>> = {\n edges: { left: true, right: true, bottom: true, top: true }\n };\n registryId: string;\n interactable: Interactable;\n // The\n dragRoot: HTMLElement;\n\n private interactableSubscription: Subscription;\n\n constructor(\n public el: ElementRef,\n @Inject(DOCUMENT) private _document: Document,\n private interactService: InteractService,\n private renderer: Renderer2,\n @Optional() drag_root_dir?: DragRootDirective,\n @Optional() public account_for_scale_dir?: AccountForScaleDirective,\n @Optional() private draggable_dir?: DraggableDirective,\n @Optional() @SkipSelf() private dropzone_dir?: DropzoneDirective\n ) {\n this.dragRoot = (drag_root_dir?.el?.nativeElement as HTMLElement) || this._document.body;\n }\n\n ngOnInit() {\n this.addResizePropertiesToElement(this.el.nativeElement);\n\n // we check for a dropzone, we use its id as the registry id if there is on\n // otherwise, we use DEFAULT_REGISTRY_ID as a registry id. This allows us to keep our interactable\n // drag state organized by dropzones.\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n\n this.interactableId = this.draggable_dir?.interactableId || this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n\n this.interactable = this.initiateResizeEvents(\n {...this.defaultConfig, ...this.resizeConfig },\n this.el.nativeElement\n );\n\n this.alignDimensionsWithInputs(this.width, this.height);\n\n this.interactableSubscription = this.interactService\n .getInteractableState(this.interactableId, this.registryId)\n .subscribe();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.resizeConfig || changes.resizeDisabled) && this.interactable) {\n this.interactable.resizable({...this.resizeConfig, enabled: !this.resizeDisabled,});\n }\n if (changes.width || changes.height) {\n this.alignDimensionsWithInputs(this.width, this.height);\n }\n }\n\n ngOnDestroy() {\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n resizeListener(event: ResizeEvent) {\n const deltaX = event.deltaRect.left;\n const deltaY = event.deltaRect.top;\n const { width, height } = event.rect;\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement\n );\n }\n /**\n * hook elements into interacts resize event listeners\n * we spread the configs so that the consuming component only overwrites the\n * pieces that it explicitly indicates\n * @param resizeConfig\n * @param nativeElement\n */\n initiateResizeEvents(resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>, nativeElement: any) {\n // TODO: This should try and get interactable from tft_draggable if it exists\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n return interactable.resizable({...resizeConfig, enabled: !this.resizeDisabled})\n .on('resizestart', (event: NgResizeEvent) => { this.resizeStart.emit(this.mapResizeEvent(event))})\n .on('resizemove', (event: NgResizeEvent) => {\n if (this.enableResizeDefault) {\n this.resizeListener(event)\n }\n const mappedEvent = this.mapResizeEvent(event);\n this.resizeMove.emit(mappedEvent)\n })\n .on('resizeinertiastart', (event: NgResizeEvent) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))\n .on('resizeend', (event: NgResizeEvent) => this.resizeEnd.emit(this.mapResizeEvent(event)));\n }\n\n mapResizeEvent(event: NgResizeEvent ): TftResizeEvent {\n const target = event.target as TftDragElement;\n const relatedTarget = this.draggable_dir?.dropzone_dir?.el.nativeElement\n const positionInDropTarget = target && relatedTarget\n ? this.interactService.calculatePositionInElement(relatedTarget, target)\n : null;\n return {\n interactEvent: event,\n resizeRef: this,\n // should I remove this?\n dragRef: this.draggable_dir,\n dragOrigin: this.dropzone_dir,\n dropTarget: this.el.nativeElement.dropTarget,\n positionInDropTarget\n }\n }\n\n alignDimensionsWithInputs(width: number, height: number) {\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX: 0, deltaY: 0, width, height},\n this.el.nativeElement\n );\n }\n\n addResizePropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'resizeRef', this);\n }\n}\n"]}
1
+ {"version":3,"file":"resizable.directive.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/resizable.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAA4B,SAAS,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACtK,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAiC,mBAAmB,EAAkB,MAAM,WAAW,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAQ9D,eAAe;AAgBf,MAAM,OAAO,kBAAkB;IAiC7B,YACS,EAAc,EACK,SAAmB,EACrC,eAAgC,EAChC,QAAmB,EACP,aAAiC,EAClC,qBAAgD,EAC/C,aAAkC,EACtB,YAAgC,EACjC,eAAqC;;QAR7D,OAAE,GAAF,EAAE,CAAY;QACK,cAAS,GAAT,SAAS,CAAU;QACrC,oBAAe,GAAf,eAAe,CAAiB;QAChC,aAAQ,GAAR,QAAQ,CAAW;QACP,kBAAa,GAAb,aAAa,CAAoB;QAClC,0BAAqB,GAArB,qBAAqB,CAA2B;QAC/C,kBAAa,GA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AQ,EAAE,gBAAgB;gBAC1B,qEAAqE;gBACrE,IAAI,EAAE;oBACJ,8DAA8D;oBAC9D,kBAAkB;oBAClB,qBAAqB,EAAE,uCAAuC;oBAC9D,2DAA2D;oBAC3D,+DAA+D;oBAC/D,kBAAkB,EAAE,UAAU;oBAC9B,yCAAyC;oBACzC,mBAAmB,EAAE,cAAc;iBAEpC;aACF;;;YAlCsC,UAAU;YAsER,QAAQ,uBAA5C,MAAM,SAAC,QAAQ;YAnEX,eAAe;YAHsG,SAAS;YAQ9H,iBAAiB,uBAiErB,QAAQ;YAhEJ,wBAAwB,uBAiE5B,QAAQ;YApEJ,kBAAkB,uBAqEtB,QAAQ;YApEJ,iBAAiB,uBAqErB,QAAQ,YAAI,QAAQ;YAjEhB,mBAAmB,uBAkEvB,QAAQ,YAAI,QAAQ;;;kCAxCtB,KAAK;uBAEL,KAAK;2BACL,KAAK;6BACL,KAAK;oBAEL,KAAK;qBACL,KAAK;6BACL,KAAK;0BAEL,MAAM;yBACN,MAAM;iCACN,MAAM;wBACN,MAAM","sourcesContent":["import { Directive, OnInit, OnDestroy, ElementRef, Input, Optional, SkipSelf, Output, EventEmitter, OnChanges, SimpleChanges, Renderer2, Inject} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { ResizableOptions, ResizeEvent, Interactable } from '@interactjs/types/index';\nimport { Subscription } from 'rxjs';\nimport { DraggableDirective } from './draggable.directive';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { NgResizeEvent, TftResizeEvent, DEFAULT_REGISTRY_ID, TftDragElement } from '../models';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\ninterface ActiveEdges {\n top: boolean;\n bottom: boolean;\n left: boolean;\n right: boolean;\n}\n/** @dynamic */\n@Directive({\n selector: '[tftResizable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // prevents touch events from colliding with with mouse events\n // on touch screen\n '[style.touchAction]': 'this.resizeDisabled ? \"auto\" : \"none\"',\n // default to absolute here to accommodate likely use cases\n // consuming component can easily over ride with position input\n '[style.position]': 'position',\n // follows interactjs suggested practices\n '[style.boxSizing]': '\"border-box\"',\n\n }\n})\nexport class ResizableDirective implements OnInit, OnDestroy, OnChanges {\n\n @Input() enableResizeDefault = true;\n // TODO: should this be an input with default or should consuming user set display in styles each time\n @Input() position = 'absolute';\n @Input() resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>;\n @Input() interactableId: string;\n\n @Input() width: number;\n @Input() height: number;\n @Input() resizeDisabled = false;\n\n @Output() resizeStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeMove = new EventEmitter<TftResizeEvent>();\n @Output() resizeInertiaStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeEnd = new EventEmitter<TftResizeEvent>();\n\n defaultConfig: Partial<Interact.OrBoolean<ResizableOptions>> = {\n edges: { left: true, right: true, bottom: true, top: true }\n };\n registryId: string;\n interactable: Interactable;\n // The\n dragRootEl: HTMLElement;\n\n private activeEdges: ActiveEdges = {left: false, right: false, top: false, bottom: false}\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir?.scale;\n }\n\n constructor(\n public el: ElementRef,\n @Inject(DOCUMENT) private _document: Document,\n private interactService: InteractService,\n private renderer: Renderer2,\n @Optional() private drag_root_dir?: DragRootDirective,\n @Optional() public account_for_scale_dir?: AccountForScaleDirective,\n @Optional() private draggable_dir?: DraggableDirective,\n @Optional() @SkipSelf() private dropzone_dir?: DropzoneDirective,\n @Optional() @SkipSelf() public auto_scroll_dir?: AutoScrollDirective\n\n\n ) {\n this.dragRootEl = (drag_root_dir?.el?.nativeElement as HTMLElement) || this._document.body;\n }\n\n ngOnInit() {\n this.addResizePropertiesToElement(this.el.nativeElement);\n\n // we check for a dropzone, we use its id as the registry id if there is on\n // otherwise, we use DEFAULT_REGISTRY_ID as a registry id. This allows us to keep our interactable\n // drag state organized by dropzones.\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n\n this.interactableId = this.draggable_dir?.interactableId || this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n\n this.interactable = this.initiateResizeEvents(\n {...this.defaultConfig, ...this.resizeConfig },\n this.el.nativeElement\n );\n\n this.alignDimensionsWithInputs(this.width, this.height);\n\n this.interactableSubscription = this.interactService\n .getInteractableState(this.interactableId, this.registryId)\n .subscribe();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.resizeConfig || changes.resizeDisabled) && this.interactable) {\n this.interactable.resizable({...this.resizeConfig, enabled: !this.resizeDisabled,});\n }\n if (changes.width || changes.height) {\n this.alignDimensionsWithInputs(this.width, this.height);\n }\n }\n\n ngOnDestroy() {\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n resizeListener(event: ResizeEvent) {\n const element: TftDragElement = this.el.nativeElement;\n const scale = this.scale;\n const {deltaRect} = event;\n const deltaX = deltaRect.left/scale;\n const deltaY = deltaRect.top/scale;\n // We get the width and height directly from the native element because\n // the event dimension can get out of sync when resizing with autoScroll\n const rect = element.getBoundingClientRect();\n const width = (rect.width + deltaRect.width)/scale;\n const height = (rect.height + deltaRect.height)/scale;\n\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement\n );\n }\n /**\n * hook elements into interacts resize event listeners\n * we spread the configs so that the consuming component only overwrites the\n * pieces that it explicitly indicates\n * @param resizeConfig\n * @param nativeElement\n */\n initiateResizeEvents(resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>, nativeElement: TftDragElement) {\n // TODO: This should try and get interactable from tft_draggable if it exists\n const defaultResizeConfig = {\n ...resizeConfig,\n enabled: !this.resizeDisabled,\n ...(this.auto_scroll_dir && {\n autoScroll: {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n })\n };\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n return interactable.resizable(defaultResizeConfig)\n .on('resizestart', (event: NgResizeEvent) => {\n this.activeEdges = event.edges as ActiveEdges;\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.resizeStart.emit(this.mapResizeEvent(event))\n })\n .on('resizemove', (event: NgResizeEvent) => {\n if (this.enableResizeDefault) {\n this.resizeListener(event)\n }\n const mappedEvent = this.mapResizeEvent(event);\n this.resizeMove.emit(mappedEvent)\n })\n .on('resizeinertiastart', (event: NgResizeEvent) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))\n .on('resizeend', (event: NgResizeEvent) => {\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n this.activeEdges = {left: false, right: false, top: false, bottom: false}\n\n this.resizeEnd.emit(this.mapResizeEvent(event));\n });\n }\n\n mapResizeEvent(event: NgResizeEvent ): TftResizeEvent {\n const target = this.el.nativeElement as TftDragElement;\n const relatedTarget = this.draggable_dir?.dropzone_dir?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && relatedTarget\n ? this.interactService.calculatePositionInElement(relatedTarget, target, scale)\n : null;\n return {\n interactEvent: event,\n resizeRef: this,\n dragRef: this.draggable_dir,\n dragOrigin: this.dropzone_dir,\n dropTarget: this.el.nativeElement.dropTarget,\n positionInDropTarget,\n size: {\n width: target.clientWidth / scale,\n height: target.clientHeight / scale\n }\n }\n }\n\n alignDimensionsWithInputs(width: number, height: number) {\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX: 0, deltaY: 0, width, height},\n this.el.nativeElement\n );\n }\n\n addResizePropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'resizeRef', this);\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const scale = this.scale;\n const target = this.el.nativeElement as HTMLElement;\n const {width: prevWidth, height: prevHeight} = target.getBoundingClientRect();\n\n const deltaHeight = scrollTop * (this.activeEdges.top ? -1 : this.activeEdges.bottom ? 1 : 0);\n const deltaWidth = scrollLeft * (this.activeEdges.left ? -1 : this.activeEdges.right ? 1 : 0);\n\n const height = (prevHeight + deltaHeight) / scale;\n const width = (prevWidth + deltaWidth) / scale;\n const deltaX = this.activeEdges.left ? (scrollLeft / scale) : 0;\n const deltaY = this.activeEdges.top ? (scrollTop / scale) : 0;\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement as HTMLElement\n );\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ResizableDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":13,"character":1},"arguments":[{"selector":"[tftResizable]","host":{"[style.touchAction]":"this.resizeDisabled ? \"auto\" : \"none\"","[style.position]":"position","[style.boxSizing]":"\"border-box\"","$quoted$":["[style.touchAction]","[style.position]","[style.boxSizing]"]}}]}],"members":{"enableResizeDefault":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"position":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"resizeConfig":[{"__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}}]}],"width":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"resizeDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}}]}],"resizeStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":40,"character":3}}]}],"resizeMove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":41,"character":3}}]}],"resizeInertiaStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":42,"character":3}}]}],"resizeEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":43,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":57,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":57,"character":12}]}],null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":60,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":61,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":62,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":63,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":63,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":56,"character":15},{"__symbolic":"error","message":"Could not resolve type","line":57,"character":41,"context":{"typeName":"Document"}},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":58,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":59,"character":22},{"__symbolic":"reference","module":"./drag-root.directive","name":"DragRootDirective","line":60,"character":32},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":61,"character":47},{"__symbolic":"reference","module":"./draggable.directive","name":"DraggableDirective","line":62,"character":40},{"__symbolic":"reference","module":"./dropzone.directive","name":"DropzoneDirective","line":63,"character":51}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"resizeListener":[{"__symbolic":"method"}],"initiateResizeEvents":[{"__symbolic":"method"}],"mapResizeEvent":[{"__symbolic":"method"}],"alignDimensionsWithInputs":[{"__symbolic":"method"}],"addResizePropertiesToElement":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ResizableDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":20,"character":1},"arguments":[{"selector":"[tftResizable]","host":{"[style.touchAction]":"this.resizeDisabled ? \"auto\" : \"none\"","[style.position]":"position","[style.boxSizing]":"\"border-box\"","$quoted$":["[style.touchAction]","[style.position]","[style.boxSizing]"]}}]}],"members":{"enableResizeDefault":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"position":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}}]}],"resizeConfig":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"interactableId":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"width":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"resizeDisabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"resizeStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":47,"character":3}}]}],"resizeMove":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":48,"character":3}}]}],"resizeInertiaStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"resizeEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":50,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":70,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":70,"character":12}]}],null,null,[{"__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":"Optional","line":75,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":76,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":76,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":77,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":77,"character":17}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":69,"character":15},{"__symbolic":"error","message":"Could not resolve type","line":70,"character":41,"context":{"typeName":"Document"}},{"__symbolic":"reference","module":"../services/interact.service","name":"InteractService","line":71,"character":29},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":72,"character":22},{"__symbolic":"reference","module":"./drag-root.directive","name":"DragRootDirective","line":73,"character":40},{"__symbolic":"reference","module":"./account-for-scale.directive","name":"AccountForScaleDirective","line":74,"character":47},{"__symbolic":"reference","module":"./draggable.directive","name":"DraggableDirective","line":75,"character":40},{"__symbolic":"reference","module":"./dropzone.directive","name":"DropzoneDirective","line":76,"character":51},{"__symbolic":"reference","module":"./auto-scroll.directive","name":"AutoScrollDirective","line":77,"character":53}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"resizeListener":[{"__symbolic":"method"}],"initiateResizeEvents":[{"__symbolic":"method"}],"mapResizeEvent":[{"__symbolic":"method"}],"alignDimensionsWithInputs":[{"__symbolic":"method"}],"addResizePropertiesToElement":[{"__symbolic":"method"}],"subscribeToScrollEvents":[{"__symbolic":"method"}]}}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.directive.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/directives/resizable.directive.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
@@ -1,23 +1,37 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { ArrayOfNPipe } from './pipes/array-of-n.pipe';
4
- import { ApplyScaleDirective, DraggableDirective, DragRootDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective } from './directives';
4
+ import { ApplyScaleDirective, DraggableDirective, DragRootDirective, AutoScrollDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective } from './directives';
5
+ import { InteractService } from './services/interact.service';
6
+ import { INTERACT_ROOT_CONFIG } from './models';
5
7
  const EXPORTS = [
6
8
  DraggableDirective,
7
9
  ResizableDirective,
8
10
  DropzoneDirective,
9
11
  GesturableDirective,
10
12
  DragRootDirective,
13
+ AutoScrollDirective,
11
14
  AccountForScaleDirective,
12
15
  ApplyScaleDirective,
13
16
  DragPreviewDirective,
14
17
  ArrayOfNPipe,
15
18
  ];
16
19
  export class InteractModule {
20
+ static forRoot(config) {
21
+ const defaultConfig = { cssDimensionUnit: 'px' };
22
+ return {
23
+ ngModule: InteractModule,
24
+ providers: [
25
+ { provide: INTERACT_ROOT_CONFIG, useValue: Object.assign(Object.assign({}, defaultConfig), config) },
26
+ InteractService
27
+ ]
28
+ };
29
+ }
17
30
  }
18
31
  InteractModule.decorators = [
19
32
  { type: NgModule, args: [{
20
33
  imports: [CommonModule],
34
+ // providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],
21
35
  declarations: [
22
36
  ...EXPORTS,
23
37
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"interact.module.js","sourceRoot":"","sources":["../../../../../libs/interact/src/lib/interact.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEtM,MAAM,OAAO,GAAG;IACd,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,wBAAwB;IACxB,mBAAmB;IACnB,oBAAoB;IACpB,YAAY;CACb,CAAC;AAYF,MAAM,OAAO,cAAc;;;YAT1B,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,YAAY,EAAE;oBACZ,GAAG,OAAO;iBACX;gBACD,OAAO,EAAE;oBACP,GAAG,OAAO;iBACX;aACF","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ArrayOfNPipe } from './pipes/array-of-n.pipe';\nimport { ApplyScaleDirective, DraggableDirective, DragRootDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective } from './directives';\n\nconst EXPORTS = [\n DraggableDirective,\n ResizableDirective,\n DropzoneDirective,\n GesturableDirective,\n DragRootDirective,\n AccountForScaleDirective,\n ApplyScaleDirective,\n DragPreviewDirective,\n ArrayOfNPipe,\n];\n\n\n@NgModule({\n imports: [CommonModule],\n declarations: [\n ...EXPORTS,\n ],\n exports: [\n ...EXPORTS\n ]\n})\nexport class InteractModule {}\n"]}
1
+ {"version":3,"file":"interact.module.js","sourceRoot":"","sources":["../../../../../libs/interact/src/lib/interact.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC3N,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAsB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIpE,MAAM,OAAO,GAAG;IACd,kBAAkB;IAClB,kBAAkB;IAClB,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,oBAAoB;IACpB,YAAY;CACb,CAAC;AAaF,MAAM,OAAO,cAAc;IACzB,MAAM,CAAC,OAAO,CAAC,MAA0B;QACvC,MAAM,aAAa,GAAuB,EAAC,gBAAgB,EAAE,IAAI,EAAC,CAAA;QAClE,OAAO;YACL,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,kCAAM,aAAa,GAAK,MAAM,CAAC,EAAE;gBAC1E,eAAe;aAChB;SACF,CAAC;IACJ,CAAC;;;YApBF,QAAQ,SAAC;gBACR,OAAO,EAAE,CAAC,YAAY,CAAC;gBACvB,kEAAkE;gBAClE,YAAY,EAAE;oBACZ,GAAG,OAAO;iBACX;gBACD,OAAO,EAAE;oBACP,GAAG,OAAO;iBACX;aACF","sourcesContent":["import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ArrayOfNPipe } from './pipes/array-of-n.pipe';\nimport { ApplyScaleDirective, DraggableDirective, DragRootDirective, AutoScrollDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective } from './directives';\nimport { InteractService } from './services/interact.service';\nimport { InteractRootConfig, INTERACT_ROOT_CONFIG } from './models';\n\n\n\nconst EXPORTS = [\n DraggableDirective,\n ResizableDirective,\n DropzoneDirective,\n GesturableDirective,\n DragRootDirective,\n AutoScrollDirective,\n AccountForScaleDirective,\n ApplyScaleDirective,\n DragPreviewDirective,\n ArrayOfNPipe,\n];\n\n\n@NgModule({\n imports: [CommonModule],\n // providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],\n declarations: [\n ...EXPORTS,\n ],\n exports: [\n ...EXPORTS\n ]\n})\nexport class InteractModule {\n static forRoot(config: InteractRootConfig): ModuleWithProviders<InteractModule> {\n const defaultConfig: InteractRootConfig = {cssDimensionUnit: 'px'}\n return {\n ngModule: InteractModule,\n providers: [\n { provide: INTERACT_ROOT_CONFIG, useValue: {...defaultConfig, ...config} },\n InteractService\n ]\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"InteractModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":18,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":19,"character":12}],"declarations":[{"__symbolic":"reference","module":"./directives","name":"DraggableDirective","line":6,"character":2},{"__symbolic":"reference","module":"./directives","name":"ResizableDirective","line":7,"character":2},{"__symbolic":"reference","module":"./directives","name":"DropzoneDirective","line":8,"character":2},{"__symbolic":"reference","module":"./directives","name":"GesturableDirective","line":9,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragRootDirective","line":10,"character":2},{"__symbolic":"reference","module":"./directives","name":"AccountForScaleDirective","line":11,"character":2},{"__symbolic":"reference","module":"./directives","name":"ApplyScaleDirective","line":12,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragPreviewDirective","line":13,"character":2},{"__symbolic":"reference","module":"./pipes/array-of-n.pipe","name":"ArrayOfNPipe","line":14,"character":2}],"exports":[{"__symbolic":"reference","module":"./directives","name":"DraggableDirective","line":6,"character":2},{"__symbolic":"reference","module":"./directives","name":"ResizableDirective","line":7,"character":2},{"__symbolic":"reference","module":"./directives","name":"DropzoneDirective","line":8,"character":2},{"__symbolic":"reference","module":"./directives","name":"GesturableDirective","line":9,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragRootDirective","line":10,"character":2},{"__symbolic":"reference","module":"./directives","name":"AccountForScaleDirective","line":11,"character":2},{"__symbolic":"reference","module":"./directives","name":"ApplyScaleDirective","line":12,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragPreviewDirective","line":13,"character":2},{"__symbolic":"reference","module":"./pipes/array-of-n.pipe","name":"ArrayOfNPipe","line":14,"character":2}]}]}]}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"InteractModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":23,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":24,"character":12}],"declarations":[{"__symbolic":"reference","module":"./directives","name":"DraggableDirective","line":10,"character":2},{"__symbolic":"reference","module":"./directives","name":"ResizableDirective","line":11,"character":2},{"__symbolic":"reference","module":"./directives","name":"DropzoneDirective","line":12,"character":2},{"__symbolic":"reference","module":"./directives","name":"GesturableDirective","line":13,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragRootDirective","line":14,"character":2},{"__symbolic":"reference","module":"./directives","name":"AutoScrollDirective","line":15,"character":2},{"__symbolic":"reference","module":"./directives","name":"AccountForScaleDirective","line":16,"character":2},{"__symbolic":"reference","module":"./directives","name":"ApplyScaleDirective","line":17,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragPreviewDirective","line":18,"character":2},{"__symbolic":"reference","module":"./pipes/array-of-n.pipe","name":"ArrayOfNPipe","line":19,"character":2}],"exports":[{"__symbolic":"reference","module":"./directives","name":"DraggableDirective","line":10,"character":2},{"__symbolic":"reference","module":"./directives","name":"ResizableDirective","line":11,"character":2},{"__symbolic":"reference","module":"./directives","name":"DropzoneDirective","line":12,"character":2},{"__symbolic":"reference","module":"./directives","name":"GesturableDirective","line":13,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragRootDirective","line":14,"character":2},{"__symbolic":"reference","module":"./directives","name":"AutoScrollDirective","line":15,"character":2},{"__symbolic":"reference","module":"./directives","name":"AccountForScaleDirective","line":16,"character":2},{"__symbolic":"reference","module":"./directives","name":"ApplyScaleDirective","line":17,"character":2},{"__symbolic":"reference","module":"./directives","name":"DragPreviewDirective","line":18,"character":2},{"__symbolic":"reference","module":"./pipes/array-of-n.pipe","name":"ArrayOfNPipe","line":19,"character":2}]}]}]}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interact.module.ngfactory.js","sourceRoot":"","sources":["../../../../../libs/interact/src/lib/interact.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './interact.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from './directives/draggable.directive';\nimport * as i4 from './directives/resizable.directive';\nimport * as i5 from './directives/dropzone.directive';\nimport * as i6 from './directives/gesturable.directive';\nimport * as i7 from './directives/drag-root.directive';\nimport * as i8 from './directives/auto-scroll.directive';\nimport * as i9 from './directives/account-for-scale.directive';\nimport * as i10 from './directives/apply-scale.directive';\nimport * as i11 from './directives/drag-preview.directive';\nimport * as i12 from './pipes/array-of-n.pipe';\nexport const InteractModuleNgFactory:i0.NgModuleFactory<i1.InteractModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any,any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf<any> = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.DraggableDirective<any> = (<any>(null as any));\nvar _decl0_12:i4.ResizableDirective = (<any>(null as any));\nvar _decl0_13:i5.DropzoneDirective = (<any>(null as any));\nvar _decl0_14:i6.GesturableDirective<any> = (<any>(null as any));\nvar _decl0_15:i7.DragRootDirective = (<any>(null as any));\nvar _decl0_16:i8.AutoScrollDirective = (<any>(null as any));\nvar _decl0_17:i9.AccountForScaleDirective = (<any>(null as any));\nvar _decl0_18:i10.ApplyScaleDirective = (<any>(null as any));\nvar _decl0_19:i11.DragPreviewDirective<any> = (<any>(null as any));\nvar _decl0_20:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_21:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_22:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_23:i2.JsonPipe = (<any>(null as any));\nvar _decl0_24:i2.SlicePipe = (<any>(null as any));\nvar _decl0_25:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_26:i2.PercentPipe = (<any>(null as any));\nvar _decl0_27:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_28:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_29:i2.DatePipe = (<any>(null as any));\nvar _decl0_30:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_31:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_32:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_34:i12.ArrayOfNPipe = (<any>(null as any));\nvar _decl0_35:i2.CommonModule = (<any>(null as any));\nvar _decl0_36:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_37:i0.ElementRef<any> = (<any>(null as any));\n"]}
@@ -1,3 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ export const INTERACT_ROOT_CONFIG = new InjectionToken('INTERACT_ROOT_CONFIG_PARAMS');
1
3
  export const DEFAULT_REGISTRY_ID = 'DEFAULT';
2
4
  /**
3
5
  * Default initial value for Delta BehaviorSubject
@@ -1 +1 @@
1
- {"version":3,"file":"interact.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/models/interact.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,aAAa,EAAE,IAAI;CACpB,CAAC;AACF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;CACpB,CAAA;AACD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAa;IACvC,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,aAAa,EAAE,IAAI;CACpB,CAAA","sourcesContent":["import { DropzoneDirective, DraggableDirective, GesturableDirective, ResizableDirective } from '../directives';\nimport { Point, DragEvent, ResizeEvent, Interactable, DropEvent, GestureEvent } from '@interactjs/types';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nexport const DEFAULT_REGISTRY_ID = 'DEFAULT';\n/**\n * Default initial value for Delta BehaviorSubject\n */\nexport const defaultDelta: Delta = {\n deltaX: 0,\n deltaY: 0,\n targetElement: null\n};\n/**\n * Default initial value for Size BehaviorSubject\n */\nexport const defaultSize: Size = {\n width: null,\n height: null,\n targetElement: null\n}\n/**\n * Default initial value for Position BehaviorSubject\n */\nexport const defaultPosition: Position = {\n x: 0,\n y: 0,\n targetElement: null\n}\n/**\n * The shape of the state/events/behavior system for each dropzone\n * and the DEFAULT_REGISTRY_ID system (for drop components initialized outside\n * of a dropzone).\n */\nexport interface InteractableSystem {\n deltas$: BehaviorSubject<Delta>;\n position$: BehaviorSubject<Position>;\n size$: BehaviorSubject<Size & Delta>;\n\n interactable$: Observable<TftCoords>;\n}\n/**\n * The key map of InteractableSystems. One for the drag components\n * that originated outside of a dropzone, plus one for each dropzone.\n */\nexport interface InteractableRegistry {\n [key: string]: InteractableSystem\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\nexport type TftDragElement = HTMLElement & {\n dragRef?: DraggableDirective\n dragOrigin?: DropzoneDirective\n dropTarget?: DropzoneDirective\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\n export type TftResizeElement = HTMLElement & {\n resizeRef?: ResizableDirective\n}\n\n/**\n * Extends the interact drop events by adding reference to the dropped components drag\n * directive to the html element. This gives the dropzone access to things like data\n * and parent dropzone of the dropped component.\n */\nexport type NgDropEvent = DropEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n relatedTarget: TftDragElement;\n};\n/**\n * Extends the interact resize events by adding a reference to the dragRef\n * directive to the html element.\n */\nexport type NgResizeEvent = ResizeEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n};\n/**\n * We extend the interact DragEvent a little here, adding to the target element references for:\n * - the component we are dragging (dragRef)\n * - the dropzone component where the drag component originated (dragOrigin)\n * - the dropzone component that it was dropped in (dropTarget)\n * This helps us to pass references to directive classes as events like dragenter and drag exit happens.\n * We use these references to emit a (mostly) consistent event across drag, drop, resize event.\n */\nexport type NgDragEvent = DragEvent & {\n dropzone: { target: HTMLElement},\n target: TftDragElement\n};\n/**\n * Event emitted when resizing, dragging, dropping\n */\nexport interface TftInteractableEvent {\n dragRef: DraggableDirective;\n dragOrigin?: DropzoneDirective;\n dropTarget?: DropzoneDirective;\n positionInDropTarget: Point;\n}\n/**\n * Event emitted on drop\n */\nexport interface TftDropEvent extends TftInteractableEvent {\n interactEvent: NgDropEvent\n}\n/**\n * Event emitted on drag\n */\nexport interface TftDragEvent extends TftInteractableEvent {\n interactEvent: NgDragEvent\n}\n/**\n * Event emitted on resize\n */\nexport interface TftResizeEvent extends TftInteractableEvent {\n interactEvent: ResizeEvent,\n resizeRef: ResizableDirective\n}\n\nexport type TftCoords= Delta & Position & Size;\n\nexport interface Delta {\n deltaX: number | null;\n deltaY: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Position {\n x: number | null;\n y: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Size {\n width: number | null;\n height: number | null;\n targetElement: TftResizeElement | null;\n}\n\nexport interface TftGestureEvent {\n gestureRef: GesturableDirective;\n interactEvent: GestureEvent;\n}\n"]}
1
+ {"version":3,"file":"interact.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/models/interact.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,cAAc,CAAqB,6BAA6B,CAAC,CAAC;AAE1G,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAC7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,aAAa,EAAE,IAAI;CACpB,CAAC;AACF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,aAAa,EAAE,IAAI;CACpB,CAAA;AACD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAa;IACvC,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,aAAa,EAAE,IAAI;CACpB,CAAA","sourcesContent":["import { DropzoneDirective, DraggableDirective, GesturableDirective, ResizableDirective } from '../directives';\nimport { Point, DragEvent, ResizeEvent, Interactable, DropEvent, GestureEvent } from '@interactjs/types';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { InjectionToken } from '@angular/core';\n\n\n\nexport type CssDimensionUnit = 'px' | 'em';\nexport interface InteractRootConfig {\n cssDimensionUnit: CssDimensionUnit;\n}\nexport const INTERACT_ROOT_CONFIG = new InjectionToken<InteractRootConfig>('INTERACT_ROOT_CONFIG_PARAMS');\n\nexport const DEFAULT_REGISTRY_ID = 'DEFAULT';\n/**\n * Default initial value for Delta BehaviorSubject\n */\nexport const defaultDelta: Delta = {\n deltaX: 0,\n deltaY: 0,\n targetElement: null\n};\n/**\n * Default initial value for Size BehaviorSubject\n */\nexport const defaultSize: Size = {\n width: null,\n height: null,\n targetElement: null\n}\n/**\n * Default initial value for Position BehaviorSubject\n */\nexport const defaultPosition: Position = {\n x: 0,\n y: 0,\n targetElement: null\n}\n/**\n * The shape of the state/events/behavior system for each dropzone\n * and the DEFAULT_REGISTRY_ID system (for drop components initialized outside\n * of a dropzone).\n */\nexport interface InteractableSystem {\n deltas$: BehaviorSubject<Delta>;\n position$: BehaviorSubject<Position>;\n size$: BehaviorSubject<Size & Delta>;\n\n interactable$: Observable<TftCoords>;\n}\n/**\n * The key map of InteractableSystems. One for the drag components\n * that originated outside of a dropzone, plus one for each dropzone.\n */\nexport interface InteractableRegistry {\n [key: string]: InteractableSystem\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\nexport type TftDragElement = HTMLElement & {\n dragRef?: DraggableDirective\n dragOrigin?: DropzoneDirective\n dropTarget?: DropzoneDirective\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\n export type TftResizeElement = HTMLElement & {\n resizeRef?: ResizableDirective\n}\n\n/**\n * Extends the interact drop events by adding reference to the dropped components drag\n * directive to the html element. This gives the dropzone access to things like data\n * and parent dropzone of the dropped component.\n */\nexport type NgDropEvent = DropEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n relatedTarget: TftDragElement;\n};\n/**\n * Extends the interact resize events by adding a reference to the dragRef\n * directive to the html element.\n */\nexport type NgResizeEvent = ResizeEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n};\n/**\n * We extend the interact DragEvent a little here, adding to the target element references for:\n * - the component we are dragging (dragRef)\n * - the dropzone component where the drag component originated (dragOrigin)\n * - the dropzone component that it was dropped in (dropTarget)\n * This helps us to pass references to directive classes as events like dragenter and drag exit happens.\n * We use these references to emit a (mostly) consistent event across drag, drop, resize event.\n */\nexport type NgDragEvent = DragEvent & {\n dropzone: { target: HTMLElement},\n target: TftDragElement\n};\n/**\n * Event emitted when resizing, dragging, dropping\n */\nexport interface TftInteractableEvent {\n dragRef: DraggableDirective;\n dragOrigin?: DropzoneDirective;\n dropTarget?: DropzoneDirective;\n positionInDropTarget: Point;\n}\n/**\n * Event emitted on drop\n */\nexport interface TftDropEvent extends TftInteractableEvent {\n interactEvent: NgDropEvent\n}\n/**\n * Event emitted on drag\n */\nexport interface TftDragEvent extends TftInteractableEvent {\n interactEvent: NgDragEvent\n}\n/**\n * Event emitted on resize\n */\nexport interface TftResizeEvent extends TftInteractableEvent {\n interactEvent: ResizeEvent,\n resizeRef: ResizableDirective\n size: {\n width: number;\n height: number;\n }\n}\n\nexport type TftCoords= Delta & Position & Size;\n\nexport interface Delta {\n deltaX: number | null;\n deltaY: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Position {\n x: number | null;\n y: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Size {\n width: number | null;\n height: number | null;\n targetElement: TftResizeElement | null;\n}\n\nexport interface TftGestureEvent {\n gestureRef: GesturableDirective;\n interactEvent: GestureEvent;\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DEFAULT_REGISTRY_ID":"DEFAULT","defaultDelta":{"deltaX":0,"deltaY":0,"targetElement":null},"defaultSize":{"width":null,"height":null,"targetElement":null},"defaultPosition":{"x":0,"y":0,"targetElement":null},"InteractableSystem":{"__symbolic":"interface"},"InteractableRegistry":{"__symbolic":"interface"},"TftDragElement":{"__symbolic":"interface"},"TftResizeElement":{"__symbolic":"interface"},"NgDropEvent":{"__symbolic":"interface"},"NgResizeEvent":{"__symbolic":"interface"},"NgDragEvent":{"__symbolic":"interface"},"TftInteractableEvent":{"__symbolic":"interface"},"TftDropEvent":{"__symbolic":"interface"},"TftDragEvent":{"__symbolic":"interface"},"TftResizeEvent":{"__symbolic":"interface"},"TftCoords":{"__symbolic":"interface"},"Delta":{"__symbolic":"interface"},"Position":{"__symbolic":"interface"},"Size":{"__symbolic":"interface"},"TftGestureEvent":{"__symbolic":"interface"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"CssDimensionUnit":{"__symbolic":"interface"},"InteractRootConfig":{"__symbolic":"interface"},"INTERACT_ROOT_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":11,"character":40},"arguments":["INTERACT_ROOT_CONFIG_PARAMS"]},"DEFAULT_REGISTRY_ID":"DEFAULT","defaultDelta":{"deltaX":0,"deltaY":0,"targetElement":null},"defaultSize":{"width":null,"height":null,"targetElement":null},"defaultPosition":{"x":0,"y":0,"targetElement":null},"InteractableSystem":{"__symbolic":"interface"},"InteractableRegistry":{"__symbolic":"interface"},"TftDragElement":{"__symbolic":"interface"},"TftResizeElement":{"__symbolic":"interface"},"NgDropEvent":{"__symbolic":"interface"},"NgResizeEvent":{"__symbolic":"interface"},"NgDragEvent":{"__symbolic":"interface"},"TftInteractableEvent":{"__symbolic":"interface"},"TftDropEvent":{"__symbolic":"interface"},"TftDragEvent":{"__symbolic":"interface"},"TftResizeEvent":{"__symbolic":"interface"},"TftCoords":{"__symbolic":"interface"},"Delta":{"__symbolic":"interface"},"Position":{"__symbolic":"interface"},"Size":{"__symbolic":"interface"},"TftGestureEvent":{"__symbolic":"interface"}}}]
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-of-n.pipe.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/interact/src/lib/pipes/array-of-n.pipe.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}