@tft/interact 12.5.2 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/esm2020/index.mjs +6 -0
  2. package/esm2020/lib/directives/account-for-scale.directive.mjs +26 -0
  3. package/esm2020/lib/directives/apply-scale.directive.mjs +28 -0
  4. package/esm2020/lib/directives/auto-scroll.directive.mjs +56 -0
  5. package/esm2020/lib/directives/drag-preview.directive.mjs +20 -0
  6. package/esm2020/lib/directives/drag-root.directive.mjs +32 -0
  7. package/esm2020/lib/directives/draggable.directive.mjs +320 -0
  8. package/esm2020/lib/directives/dropzone.directive.mjs +114 -0
  9. package/esm2020/lib/directives/gesturable.directive.mjs +82 -0
  10. package/esm2020/lib/directives/index.mjs +10 -0
  11. package/esm2020/lib/directives/resizable.directive.mjs +228 -0
  12. package/esm2020/lib/interact.module.mjs +66 -0
  13. package/esm2020/lib/models/index.mjs +2 -0
  14. package/esm2020/lib/models/interact.mjs +28 -0
  15. package/esm2020/lib/pipes/array-of-n.pipe.mjs +22 -0
  16. package/esm2020/lib/pipes/index.mjs +2 -0
  17. package/esm2020/lib/services/interact.service.mjs +197 -0
  18. package/esm2020/lib/utils/helpers.mjs +35 -0
  19. package/esm2020/lib/utils/index.mjs +2 -0
  20. package/esm2020/tft-interact.mjs +5 -0
  21. package/fesm2015/{tft-interact.js → tft-interact.mjs} +464 -267
  22. package/fesm2015/tft-interact.mjs.map +1 -0
  23. package/fesm2020/tft-interact.mjs +1192 -0
  24. package/fesm2020/tft-interact.mjs.map +1 -0
  25. package/lib/directives/account-for-scale.directive.d.ts +3 -0
  26. package/lib/directives/apply-scale.directive.d.ts +3 -0
  27. package/lib/directives/auto-scroll.directive.d.ts +34 -0
  28. package/lib/directives/drag-preview.directive.d.ts +3 -0
  29. package/lib/directives/drag-root.directive.d.ts +3 -0
  30. package/lib/directives/draggable.directive.d.ts +8 -1
  31. package/lib/directives/dropzone.directive.d.ts +5 -0
  32. package/lib/directives/gesturable.directive.d.ts +3 -0
  33. package/lib/directives/index.d.ts +1 -0
  34. package/lib/directives/resizable.directive.d.ts +10 -2
  35. package/lib/interact.module.d.ts +15 -0
  36. package/lib/pipes/array-of-n.pipe.d.ts +3 -0
  37. package/lib/services/interact.service.d.ts +3 -0
  38. package/package.json +24 -11
  39. package/tft-interact-14.0.0.tgz +0 -0
  40. package/bundles/tft-interact.umd.js +0 -1419
  41. package/bundles/tft-interact.umd.js.map +0 -1
  42. package/esm2015/index.js +0 -6
  43. package/esm2015/index.js.map +0 -1
  44. package/esm2015/index.metadata.json +0 -1
  45. package/esm2015/lib/directives/account-for-scale.directive.js +0 -26
  46. package/esm2015/lib/directives/account-for-scale.directive.js.map +0 -1
  47. package/esm2015/lib/directives/account-for-scale.directive.metadata.json +0 -1
  48. package/esm2015/lib/directives/apply-scale.directive.js +0 -26
  49. package/esm2015/lib/directives/apply-scale.directive.js.map +0 -1
  50. package/esm2015/lib/directives/apply-scale.directive.metadata.json +0 -1
  51. package/esm2015/lib/directives/drag-preview.directive.js +0 -20
  52. package/esm2015/lib/directives/drag-preview.directive.js.map +0 -1
  53. package/esm2015/lib/directives/drag-preview.directive.metadata.json +0 -1
  54. package/esm2015/lib/directives/drag-root.directive.js +0 -27
  55. package/esm2015/lib/directives/drag-root.directive.js.map +0 -1
  56. package/esm2015/lib/directives/drag-root.directive.metadata.json +0 -1
  57. package/esm2015/lib/directives/draggable.directive.js +0 -265
  58. package/esm2015/lib/directives/draggable.directive.js.map +0 -1
  59. package/esm2015/lib/directives/draggable.directive.metadata.json +0 -1
  60. package/esm2015/lib/directives/dropzone.directive.js +0 -103
  61. package/esm2015/lib/directives/dropzone.directive.js.map +0 -1
  62. package/esm2015/lib/directives/dropzone.directive.metadata.json +0 -1
  63. package/esm2015/lib/directives/gesturable.directive.js +0 -77
  64. package/esm2015/lib/directives/gesturable.directive.js.map +0 -1
  65. package/esm2015/lib/directives/gesturable.directive.metadata.json +0 -1
  66. package/esm2015/lib/directives/index.js +0 -9
  67. package/esm2015/lib/directives/index.js.map +0 -1
  68. package/esm2015/lib/directives/index.metadata.json +0 -1
  69. package/esm2015/lib/directives/resizable.directive.js +0 -175
  70. package/esm2015/lib/directives/resizable.directive.js.map +0 -1
  71. package/esm2015/lib/directives/resizable.directive.metadata.json +0 -1
  72. package/esm2015/lib/interact.module.js +0 -42
  73. package/esm2015/lib/interact.module.js.map +0 -1
  74. package/esm2015/lib/interact.module.metadata.json +0 -1
  75. package/esm2015/lib/models/index.js +0 -2
  76. package/esm2015/lib/models/index.js.map +0 -1
  77. package/esm2015/lib/models/index.metadata.json +0 -1
  78. package/esm2015/lib/models/interact.js +0 -28
  79. package/esm2015/lib/models/interact.js.map +0 -1
  80. package/esm2015/lib/models/interact.metadata.json +0 -1
  81. package/esm2015/lib/pipes/array-of-n.pipe.js +0 -18
  82. package/esm2015/lib/pipes/array-of-n.pipe.js.map +0 -1
  83. package/esm2015/lib/pipes/array-of-n.pipe.metadata.json +0 -1
  84. package/esm2015/lib/pipes/index.js +0 -2
  85. package/esm2015/lib/pipes/index.js.map +0 -1
  86. package/esm2015/lib/pipes/index.metadata.json +0 -1
  87. package/esm2015/lib/services/interact.service.js +0 -196
  88. package/esm2015/lib/services/interact.service.js.map +0 -1
  89. package/esm2015/lib/services/interact.service.metadata.json +0 -1
  90. package/esm2015/lib/utils/helpers.js +0 -35
  91. package/esm2015/lib/utils/helpers.js.map +0 -1
  92. package/esm2015/lib/utils/helpers.metadata.json +0 -1
  93. package/esm2015/lib/utils/index.js +0 -2
  94. package/esm2015/lib/utils/index.js.map +0 -1
  95. package/esm2015/lib/utils/index.metadata.json +0 -1
  96. package/esm2015/tft-interact.js +0 -7
  97. package/esm2015/tft-interact.js.map +0 -1
  98. package/esm2015/tft-interact.metadata.json +0 -1
  99. package/fesm2015/tft-interact.js.map +0 -1
  100. package/tft-interact-12.5.2.tgz +0 -0
  101. package/tft-interact.d.ts +0 -6
  102. package/tft-interact.metadata.json +0 -1
@@ -1,1419 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('interactjs'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@tft/interact', ['exports', '@angular/core', '@angular/common', 'interactjs', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.tft = global.tft || {}, global.tft.interact = {}), global.ng.core, global.ng.common, global.interact, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, i0, common, interact, rxjs, operators) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () {
19
- return e[k];
20
- }
21
- });
22
- }
23
- });
24
- }
25
- n['default'] = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
- var interact__default = /*#__PURE__*/_interopDefaultLegacy(interact);
31
-
32
- /*! *****************************************************************************
33
- Copyright (c) Microsoft Corporation.
34
-
35
- Permission to use, copy, modify, and/or distribute this software for any
36
- purpose with or without fee is hereby granted.
37
-
38
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
42
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
- PERFORMANCE OF THIS SOFTWARE.
45
- ***************************************************************************** */
46
- /* global Reflect, Promise */
47
- var extendStatics = function (d, b) {
48
- extendStatics = Object.setPrototypeOf ||
49
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
50
- function (d, b) { for (var p in b)
51
- if (Object.prototype.hasOwnProperty.call(b, p))
52
- d[p] = b[p]; };
53
- return extendStatics(d, b);
54
- };
55
- function __extends(d, b) {
56
- if (typeof b !== "function" && b !== null)
57
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
58
- extendStatics(d, b);
59
- function __() { this.constructor = d; }
60
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
61
- }
62
- var __assign = function () {
63
- __assign = Object.assign || function __assign(t) {
64
- for (var s, i = 1, n = arguments.length; i < n; i++) {
65
- s = arguments[i];
66
- for (var p in s)
67
- if (Object.prototype.hasOwnProperty.call(s, p))
68
- t[p] = s[p];
69
- }
70
- return t;
71
- };
72
- return __assign.apply(this, arguments);
73
- };
74
- function __rest(s, e) {
75
- var t = {};
76
- for (var p in s)
77
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
- t[p] = s[p];
79
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
80
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
81
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
82
- t[p[i]] = s[p[i]];
83
- }
84
- return t;
85
- }
86
- function __decorate(decorators, target, key, desc) {
87
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
88
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
- r = Reflect.decorate(decorators, target, key, desc);
90
- else
91
- for (var i = decorators.length - 1; i >= 0; i--)
92
- if (d = decorators[i])
93
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
94
- return c > 3 && r && Object.defineProperty(target, key, r), r;
95
- }
96
- function __param(paramIndex, decorator) {
97
- return function (target, key) { decorator(target, key, paramIndex); };
98
- }
99
- function __metadata(metadataKey, metadataValue) {
100
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
- return Reflect.metadata(metadataKey, metadataValue);
102
- }
103
- function __awaiter(thisArg, _arguments, P, generator) {
104
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
105
- return new (P || (P = Promise))(function (resolve, reject) {
106
- function fulfilled(value) { try {
107
- step(generator.next(value));
108
- }
109
- catch (e) {
110
- reject(e);
111
- } }
112
- function rejected(value) { try {
113
- step(generator["throw"](value));
114
- }
115
- catch (e) {
116
- reject(e);
117
- } }
118
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
119
- step((generator = generator.apply(thisArg, _arguments || [])).next());
120
- });
121
- }
122
- function __generator(thisArg, body) {
123
- var _ = { label: 0, sent: function () { if (t[0] & 1)
124
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
126
- function verb(n) { return function (v) { return step([n, v]); }; }
127
- function step(op) {
128
- if (f)
129
- throw new TypeError("Generator is already executing.");
130
- while (_)
131
- try {
132
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
133
- return t;
134
- if (y = 0, t)
135
- op = [op[0] & 2, t.value];
136
- switch (op[0]) {
137
- case 0:
138
- case 1:
139
- t = op;
140
- break;
141
- case 4:
142
- _.label++;
143
- return { value: op[1], done: false };
144
- case 5:
145
- _.label++;
146
- y = op[1];
147
- op = [0];
148
- continue;
149
- case 7:
150
- op = _.ops.pop();
151
- _.trys.pop();
152
- continue;
153
- default:
154
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
- _ = 0;
156
- continue;
157
- }
158
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
- _.label = op[1];
160
- break;
161
- }
162
- if (op[0] === 6 && _.label < t[1]) {
163
- _.label = t[1];
164
- t = op;
165
- break;
166
- }
167
- if (t && _.label < t[2]) {
168
- _.label = t[2];
169
- _.ops.push(op);
170
- break;
171
- }
172
- if (t[2])
173
- _.ops.pop();
174
- _.trys.pop();
175
- continue;
176
- }
177
- op = body.call(thisArg, _);
178
- }
179
- catch (e) {
180
- op = [6, e];
181
- y = 0;
182
- }
183
- finally {
184
- f = t = 0;
185
- }
186
- if (op[0] & 5)
187
- throw op[1];
188
- return { value: op[0] ? op[1] : void 0, done: true };
189
- }
190
- }
191
- var __createBinding = Object.create ? (function (o, m, k, k2) {
192
- if (k2 === undefined)
193
- k2 = k;
194
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
195
- }) : (function (o, m, k, k2) {
196
- if (k2 === undefined)
197
- k2 = k;
198
- o[k2] = m[k];
199
- });
200
- function __exportStar(m, o) {
201
- for (var p in m)
202
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
203
- __createBinding(o, m, p);
204
- }
205
- function __values(o) {
206
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
207
- if (m)
208
- return m.call(o);
209
- if (o && typeof o.length === "number")
210
- return {
211
- next: function () {
212
- if (o && i >= o.length)
213
- o = void 0;
214
- return { value: o && o[i++], done: !o };
215
- }
216
- };
217
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
218
- }
219
- function __read(o, n) {
220
- var m = typeof Symbol === "function" && o[Symbol.iterator];
221
- if (!m)
222
- return o;
223
- var i = m.call(o), r, ar = [], e;
224
- try {
225
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
226
- ar.push(r.value);
227
- }
228
- catch (error) {
229
- e = { error: error };
230
- }
231
- finally {
232
- try {
233
- if (r && !r.done && (m = i["return"]))
234
- m.call(i);
235
- }
236
- finally {
237
- if (e)
238
- throw e.error;
239
- }
240
- }
241
- return ar;
242
- }
243
- /** @deprecated */
244
- function __spread() {
245
- for (var ar = [], i = 0; i < arguments.length; i++)
246
- ar = ar.concat(__read(arguments[i]));
247
- return ar;
248
- }
249
- /** @deprecated */
250
- function __spreadArrays() {
251
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
252
- s += arguments[i].length;
253
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
254
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
255
- r[k] = a[j];
256
- return r;
257
- }
258
- function __spreadArray(to, from) {
259
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
260
- to[j] = from[i];
261
- return to;
262
- }
263
- function __await(v) {
264
- return this instanceof __await ? (this.v = v, this) : new __await(v);
265
- }
266
- function __asyncGenerator(thisArg, _arguments, generator) {
267
- if (!Symbol.asyncIterator)
268
- throw new TypeError("Symbol.asyncIterator is not defined.");
269
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
270
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
271
- function verb(n) { if (g[n])
272
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
273
- function resume(n, v) { try {
274
- step(g[n](v));
275
- }
276
- catch (e) {
277
- settle(q[0][3], e);
278
- } }
279
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
280
- function fulfill(value) { resume("next", value); }
281
- function reject(value) { resume("throw", value); }
282
- function settle(f, v) { if (f(v), q.shift(), q.length)
283
- resume(q[0][0], q[0][1]); }
284
- }
285
- function __asyncDelegator(o) {
286
- var i, p;
287
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
288
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
289
- }
290
- function __asyncValues(o) {
291
- if (!Symbol.asyncIterator)
292
- throw new TypeError("Symbol.asyncIterator is not defined.");
293
- var m = o[Symbol.asyncIterator], i;
294
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
295
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
296
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
297
- }
298
- function __makeTemplateObject(cooked, raw) {
299
- if (Object.defineProperty) {
300
- Object.defineProperty(cooked, "raw", { value: raw });
301
- }
302
- else {
303
- cooked.raw = raw;
304
- }
305
- return cooked;
306
- }
307
- ;
308
- var __setModuleDefault = Object.create ? (function (o, v) {
309
- Object.defineProperty(o, "default", { enumerable: true, value: v });
310
- }) : function (o, v) {
311
- o["default"] = v;
312
- };
313
- function __importStar(mod) {
314
- if (mod && mod.__esModule)
315
- return mod;
316
- var result = {};
317
- if (mod != null)
318
- for (var k in mod)
319
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
320
- __createBinding(result, mod, k);
321
- __setModuleDefault(result, mod);
322
- return result;
323
- }
324
- function __importDefault(mod) {
325
- return (mod && mod.__esModule) ? mod : { default: mod };
326
- }
327
- function __classPrivateFieldGet(receiver, state, kind, f) {
328
- if (kind === "a" && !f)
329
- throw new TypeError("Private accessor was defined without a getter");
330
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
331
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
332
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
333
- }
334
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
335
- if (kind === "m")
336
- throw new TypeError("Private method is not writable");
337
- if (kind === "a" && !f)
338
- throw new TypeError("Private accessor was defined without a setter");
339
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
340
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
341
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
342
- }
343
-
344
- var ArrayOfNPipe = /** @class */ (function () {
345
- function ArrayOfNPipe() {
346
- }
347
- /**
348
- *
349
- * @param n the number to make an array of
350
- * @param max the max length of the array (useful for limiting rendering in ngFor loop)
351
- */
352
- ArrayOfNPipe.prototype.transform = function (n, max) {
353
- var length = ((max && max < n) || n === Infinity) ? max : n;
354
- return new Array(length).fill(length).map(function (x, i) { return i; });
355
- };
356
- return ArrayOfNPipe;
357
- }());
358
- ArrayOfNPipe.decorators = [
359
- { type: i0.Pipe, args: [{
360
- name: 'arrayOfN'
361
- },] }
362
- ];
363
-
364
- var INTERACT_ROOT_CONFIG = new i0.InjectionToken('INTERACT_ROOT_CONFIG_PARAMS');
365
- var DEFAULT_REGISTRY_ID = 'DEFAULT';
366
- /**
367
- * Default initial value for Delta BehaviorSubject
368
- */
369
- var defaultDelta = {
370
- deltaX: 0,
371
- deltaY: 0,
372
- targetElement: null
373
- };
374
- /**
375
- * Default initial value for Size BehaviorSubject
376
- */
377
- var defaultSize = {
378
- width: null,
379
- height: null,
380
- targetElement: null
381
- };
382
- /**
383
- * Default initial value for Position BehaviorSubject
384
- */
385
- var defaultPosition = {
386
- x: 0,
387
- y: 0,
388
- targetElement: null
389
- };
390
-
391
- var InteractService = /** @class */ (function () {
392
- function InteractService(rendererFactory, ngZone, rootConfig) {
393
- this.rendererFactory = rendererFactory;
394
- this.ngZone = ngZone;
395
- this.rootConfig = rootConfig;
396
- this._interactableIndex = 0;
397
- this._dropzoneIndex = 0;
398
- // TODO: consider using Map here
399
- this.dragRegistrySystem = {};
400
- this.cssUnit = 'px';
401
- this.renderer = this.rendererFactory.createRenderer(null, null);
402
- this.cssUnit = (rootConfig === null || rootConfig === void 0 ? void 0 : rootConfig.cssDimensionUnit) || 'px';
403
- }
404
- InteractService.prototype.addDeltaToPosition = function (delta, position) {
405
- return {
406
- x: delta.deltaX + position.x,
407
- y: delta.deltaY + position.y,
408
- targetElement: position.targetElement || delta.targetElement
409
- };
410
- };
411
- InteractService.prototype.addRegistryToSystem = function (customRegistryId) {
412
- if (customRegistryId === void 0) { customRegistryId = null; }
413
- var registryId = customRegistryId || this.createDropzoneId(this._dropzoneIndex++);
414
- this.dragRegistrySystem[registryId] = {};
415
- return registryId;
416
- };
417
- InteractService.prototype.addDraggableToRegistry = function (customRegistryId, interactableId) {
418
- if (customRegistryId === void 0) { customRegistryId = null; }
419
- if (interactableId === void 0) { interactableId = null; }
420
- var registryId = customRegistryId || DEFAULT_REGISTRY_ID;
421
- // if we pass an id to createInteractableId then it is used when creating the interactable
422
- // and returned, otherwise a new id is created for the draggable.
423
- var key = this.createInteractableId(interactableId);
424
- if (!Object.prototype.hasOwnProperty.call(this.dragRegistrySystem, registryId)) {
425
- this.dragRegistrySystem[registryId] = {};
426
- }
427
- this.dragRegistrySystem[registryId][key] = this.createInteractableState(defaultPosition, defaultSize, defaultDelta);
428
- return key;
429
- };
430
- InteractService.prototype.destroyInteractable = function (interactableId, registryId) {
431
- if (registryId === void 0) { registryId = DEFAULT_REGISTRY_ID; }
432
- var interactableSystem = this.dragRegistrySystem[registryId][interactableId];
433
- if (interactableSystem) {
434
- // unsubscribe from all the subscriptions if they're subscriptions
435
- for (var propName in interactableSystem) {
436
- var prop = interactableSystem[propName];
437
- if (prop.unsubscribe && typeof prop.unsubscribe === 'function') {
438
- prop.unsubscribe();
439
- }
440
- ;
441
- }
442
- delete this.dragRegistrySystem[registryId][interactableId];
443
- }
444
- };
445
- InteractService.prototype.subscribeToInteractable = function (interactableId, registryId) {
446
- if (registryId === void 0) { registryId = DEFAULT_REGISTRY_ID; }
447
- return this.dragRegistrySystem[registryId][interactableId];
448
- };
449
- InteractService.prototype.createInteractableState = function (initialPosition, initialSize, initialDelta) {
450
- var _this = this;
451
- var deltas$ = new rxjs.BehaviorSubject(initialDelta);
452
- // tracks the size of the element
453
- var size$ = new rxjs.BehaviorSubject(Object.assign(Object.assign({}, initialSize), initialDelta));
454
- // Stream of positions as they change
455
- var position$ = new rxjs.BehaviorSubject(initialPosition);
456
- // All draggable data mapped together
457
- var interactable$ = rxjs.combineLatest([
458
- size$.pipe(
459
- // startWith({...initialSize, ...initialDelta}),
460
- operators.shareReplay(1),
461
- // filter(resizeEvent => !!resizeEvent.targetElement),
462
- operators.tap(function (_a) {
463
- var deltaX = _a.deltaX, deltaY = _a.deltaY, width = _a.width, height = _a.height, targetElement = _a.targetElement;
464
- _this.ngZone.runOutsideAngular(function () {
465
- _this.setElementSize(width, height, targetElement);
466
- });
467
- // only reposition if necessary i.e when resizing left or up
468
- if (deltaX || deltaY) {
469
- deltas$.next({ deltaX: deltaX, deltaY: deltaY, targetElement: targetElement });
470
- }
471
- })),
472
- deltas$.pipe(operators.shareReplay(1), operators.tap(function (delta) {
473
- var position = position$.value;
474
- var newPosition = _this.addDeltaToPosition(delta, position);
475
- position$.next(newPosition);
476
- })),
477
- position$.pipe(operators.shareReplay(1), operators.tap(function (position) {
478
- _this.ngZone.runOutsideAngular(function () {
479
- _this.setElementTransform(position.x, position.y, position);
480
- });
481
- }))
482
- ]).pipe(operators.shareReplay(1), operators.map(function (_a) {
483
- var _b = __read(_a, 3), size = _b[0], deltas = _b[1], position = _b[2];
484
- return {
485
- x: position.x,
486
- y: position.y,
487
- deltaX: deltas.deltaX,
488
- deltaY: deltas.deltaY,
489
- width: size.width,
490
- height: size.height,
491
- targetElement: size.targetElement || position.targetElement || deltas.targetElement
492
- };
493
- }));
494
- // TODO: update system to handle only returning interactable$
495
- return {
496
- deltas$: deltas$,
497
- position$: position$,
498
- size$: size$,
499
- interactable$: interactable$
500
- };
501
- };
502
- InteractService.prototype.createInteractableId = function (customInteractableId) {
503
- if (customInteractableId === void 0) { customInteractableId = null; }
504
- return customInteractableId || "interactable" + this._interactableIndex++;
505
- };
506
- InteractService.prototype.createDropzoneId = function (index) {
507
- return "dropzone" + index;
508
- };
509
- InteractService.prototype.getInteractableState = function (interactableId, registryId) {
510
- if (registryId === void 0) { registryId = DEFAULT_REGISTRY_ID; }
511
- return this.dragRegistrySystem[registryId][interactableId].interactable$;
512
- };
513
- InteractService.prototype.updateDeltas = function (interactId, registryId, _a, targetElement) {
514
- var deltaX = _a.deltaX, deltaY = _a.deltaY;
515
- if (!this.interactableExistOnRegistry(interactId, registryId))
516
- return;
517
- this.dragRegistrySystem[registryId][interactId].deltas$.next({ deltaX: deltaX, deltaY: deltaY, targetElement: targetElement });
518
- };
519
- InteractService.prototype.updatePosition = function (interactId, registryId, _a, targetElement) {
520
- var x = _a.x, y = _a.y;
521
- if (!this.interactableExistOnRegistry(interactId, registryId))
522
- return;
523
- this.dragRegistrySystem[registryId][interactId].position$.next({ x: x, y: y, targetElement: targetElement });
524
- };
525
- InteractService.prototype.updateSize = function (interactId, registryId, _a, targetElement) {
526
- var deltaX = _a.deltaX, deltaY = _a.deltaY, width = _a.width, height = _a.height;
527
- if (!this.interactableExistOnRegistry(interactId, registryId))
528
- return;
529
- this.dragRegistrySystem[registryId][interactId].size$.next({ deltaX: deltaX, deltaY: deltaY, width: width, height: height, targetElement: targetElement });
530
- };
531
- InteractService.prototype.interactableExistOnRegistry = function (interactId, registryId) {
532
- if (registryId === void 0) { registryId = DEFAULT_REGISTRY_ID; }
533
- // eslint-disable-next-line no-prototype-builtins
534
- return this.dragRegistrySystem.hasOwnProperty(registryId) && this.dragRegistrySystem[registryId].hasOwnProperty(interactId);
535
- };
536
- /**
537
- * Uses renderer to set width and height of angular component
538
- * @param width the desired width of component
539
- * @param height the desired height of component
540
- * @param target the element to transform
541
- */
542
- InteractService.prototype.setElementSize = function (width, height, target) {
543
- if (!target)
544
- return;
545
- this.renderer.setStyle(target, 'width', "" + width + this.cssUnit);
546
- this.renderer.setStyle(target, 'height', "" + height + this.cssUnit);
547
- };
548
- /**
549
- * Uses renderer to set position of angular component
550
- * @param x position on x axis
551
- * @param y position on y axis
552
- * @param target the element to transform
553
- */
554
- InteractService.prototype.setElementTransform = function (x, y, position) {
555
- if (!(position === null || position === void 0 ? void 0 : position.targetElement))
556
- return;
557
- this.renderer.setStyle(position.targetElement, 'left', "" + x + this.cssUnit);
558
- this.renderer.setStyle(position.targetElement, 'top', "" + y + this.cssUnit);
559
- };
560
- /**
561
- * Generates a translate string for the x and y arguments passed to
562
- * be passed to css transform
563
- * @param x the position along the x axis
564
- * @param y the position along the y axis
565
- */
566
- InteractService.prototype.createTransformString = function (x, y) {
567
- return "translate3d(" + x + this.cssUnit + ", " + y + this.cssUnit + ", 0)";
568
- };
569
- InteractService.prototype.calculatePositionInElement = function (zoneElement, dragElement, scale) {
570
- // TODO: this calculation may not cover a lot of scenarios, keep an eye out for possible improvements
571
- var zoneRect = zoneElement.getBoundingClientRect();
572
- var dragRect = dragElement.getBoundingClientRect();
573
- var position = scale
574
- ? {
575
- x: (dragRect.left - zoneRect.left) / scale || 1,
576
- y: (dragRect.top - zoneRect.top) / scale || 1
577
- } : {
578
- x: dragRect.left - zoneRect.left,
579
- y: dragRect.top - zoneRect.top
580
- };
581
- // console.log({ y:position.y, drt:dragRect.top, zrt: zoneRect.top})
582
- return position;
583
- };
584
- return InteractService;
585
- }());
586
- InteractService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function InteractService_Factory() { return new InteractService(i0__namespace.ɵɵinject(i0__namespace.RendererFactory2), i0__namespace.ɵɵinject(i0__namespace.NgZone), i0__namespace.ɵɵinject(INTERACT_ROOT_CONFIG, 8)); }, token: InteractService, providedIn: "root" });
587
- InteractService.decorators = [
588
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
589
- ];
590
- InteractService.ctorParameters = function () { return [
591
- { type: i0.RendererFactory2 },
592
- { type: i0.NgZone },
593
- { type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [INTERACT_ROOT_CONFIG,] }] }
594
- ]; };
595
-
596
- /**
597
- * Use to apply scale to the element and tell the drag and resize directives to account for the scale when
598
- * @example <div tftAccountForScale [scale]="2.5"> <div tftDraggable> </div> </div>
599
- * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag
600
- * element accounts for scale
601
- */
602
- var AccountForScaleDirective = /** @class */ (function () {
603
- function AccountForScaleDirective(el) {
604
- this.el = el;
605
- // this setup allows consumers to set x, y scale independently or just set them both with scale
606
- this.scale = 1;
607
- }
608
- return AccountForScaleDirective;
609
- }());
610
- AccountForScaleDirective.decorators = [
611
- { type: i0.Directive, args: [{
612
- selector: '[tftAccountForScale]'
613
- },] }
614
- ];
615
- AccountForScaleDirective.ctorParameters = function () { return [
616
- { type: i0.ElementRef }
617
- ]; };
618
- AccountForScaleDirective.propDecorators = {
619
- scale: [{ type: i0.Input }]
620
- };
621
-
622
- var DropzoneDirective = /** @class */ (function () {
623
- function DropzoneDirective(el, renderer, interactService, account_for_scale_dir) {
624
- this.el = el;
625
- this.renderer = renderer;
626
- this.interactService = interactService;
627
- this.account_for_scale_dir = account_for_scale_dir;
628
- this.dropzoneConfig = {};
629
- // proxies to pass interact events through to consumer of directive
630
- this.dropActivate = new i0.EventEmitter();
631
- this.dragEnter = new i0.EventEmitter();
632
- this.dragLeave = new i0.EventEmitter();
633
- this.dragDrop = new i0.EventEmitter();
634
- }
635
- Object.defineProperty(DropzoneDirective.prototype, "scale", {
636
- get: function () {
637
- var _a;
638
- return (_a = this.account_for_scale_dir) === null || _a === void 0 ? void 0 : _a.scale;
639
- },
640
- enumerable: false,
641
- configurable: true
642
- });
643
- DropzoneDirective.prototype.ngOnInit = function () {
644
- // connects
645
- this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);
646
- this.dropzoneId = this.interactService.addRegistryToSystem(this.dropzoneId);
647
- };
648
- DropzoneDirective.prototype.ngOnChanges = function (changes) {
649
- if (!changes.dropzoneConfig || !this.dropzone)
650
- return;
651
- // this.dropzone.unset();
652
- // this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig)
653
- this.dropzone.dropzone(this.dropzoneConfig);
654
- };
655
- /**
656
- * Connects element to interacts dropzone events and returns a reference to the interactable
657
- * @param nativeElement the element to tie drop events to
658
- * @param dropzoneConfig the interact configuration to use when connecting
659
- */
660
- DropzoneDirective.prototype.connectDropzoneEvents = function (nativeElement, dropzoneConfig) {
661
- var _this = this;
662
- return interact__default['default'](nativeElement).dropzone(dropzoneConfig)
663
- // TODO: investigate when this fires in different scenarios
664
- .on('dropactivate', function (event) {
665
- _this.dropActivate.emit(_this.mapDropzoneEvent(event));
666
- })
667
- .on('dragenter', function (event) {
668
- _this.renderer.setProperty(event.relatedTarget, 'dropTarget', _this);
669
- _this.dragEnter.emit(_this.mapDropzoneEvent(event));
670
- })
671
- .on('dragleave', function (event) {
672
- if (event.relatedTarget.dropTarget === _this) {
673
- _this.renderer.setProperty(event.relatedTarget, 'dropTarget', null);
674
- }
675
- _this.dragLeave.emit(_this.mapDropzoneEvent(event));
676
- })
677
- .on('drop', function (event) {
678
- _this.dragDrop.emit(_this.mapDropzoneEvent(event));
679
- });
680
- };
681
- /**
682
- * Maps the drop event emitted by interact to something a little easier to use
683
- * @param event the drop event emitted by interact, extended with extra fields we added to
684
- */
685
- DropzoneDirective.prototype.mapDropzoneEvent = function (event) {
686
- var _a, _b;
687
- var zoneElement = event.target;
688
- var dragElement = (_b = (_a = event.relatedTarget) === null || _a === void 0 ? void 0 : _a.dragRef) === null || _b === void 0 ? void 0 : _b.previewRef;
689
- var scale = this.scale;
690
- var positionInDropTarget = zoneElement && dragElement
691
- ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)
692
- : null;
693
- return {
694
- interactEvent: event,
695
- dragRef: dragElement.dragRef,
696
- dragOrigin: dragElement.dragOrigin,
697
- dropTarget: event.relatedTarget.dropTarget,
698
- positionInDropTarget: positionInDropTarget
699
- };
700
- };
701
- return DropzoneDirective;
702
- }());
703
- DropzoneDirective.decorators = [
704
- { type: i0.Directive, args: [{
705
- selector: '[tftDropzone]',
706
- host: {
707
- '[id]': 'dropzoneId',
708
- }
709
- },] }
710
- ];
711
- DropzoneDirective.ctorParameters = function () { return [
712
- { type: i0.ElementRef },
713
- { type: i0.Renderer2 },
714
- { type: InteractService },
715
- { type: AccountForScaleDirective, decorators: [{ type: i0.Optional }] }
716
- ]; };
717
- DropzoneDirective.propDecorators = {
718
- dropzoneId: [{ type: i0.Input }],
719
- dropzoneConfig: [{ type: i0.Input }],
720
- dropzoneData: [{ type: i0.Input }],
721
- dropActivate: [{ type: i0.Output }],
722
- dragEnter: [{ type: i0.Output }],
723
- dragLeave: [{ type: i0.Output }],
724
- dragDrop: [{ type: i0.Output }]
725
- };
726
-
727
- var TFT_DRAG_PREVIEW = new i0.InjectionToken('DragPreviewDirective');
728
- var DragPreviewDirective = /** @class */ (function () {
729
- function DragPreviewDirective(templateRef) {
730
- this.templateRef = templateRef;
731
- }
732
- return DragPreviewDirective;
733
- }());
734
- DragPreviewDirective.decorators = [
735
- { type: i0.Directive, args: [{
736
- // eslint-disable-next-line @angular-eslint/directive-selector
737
- selector: 'ng-template[tftDragPreview]',
738
- },] }
739
- ];
740
- DragPreviewDirective.ctorParameters = function () { return [
741
- { type: i0.TemplateRef }
742
- ]; };
743
- DragPreviewDirective.propDecorators = {
744
- dragData: [{ type: i0.Input }]
745
- };
746
-
747
- /** Gets the closest ancestor of an element that matches a selector. */
748
- function getClosestMatchingAncestor(element, selector) {
749
- var currentElement = element.parentElement;
750
- while (currentElement) {
751
- // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.
752
- if (currentElement.matches ? currentElement.matches(selector) :
753
- currentElement.msMatchesSelector(selector)) {
754
- return currentElement;
755
- }
756
- currentElement = currentElement.parentElement;
757
- }
758
- return null;
759
- }
760
- /**
761
- * Create a copy of the HTML Element
762
- */
763
- function cloneElement$1(element) {
764
- var clone = element.cloneNode(true);
765
- clone.removeAttribute('id');
766
- return clone;
767
- }
768
- /**
769
- * Gets the root HTML element of an embedded view.
770
- * If the root is not an HTML element it gets wrapped in one.
771
- */
772
- function getRootNode(viewRef, _document) {
773
- var rootNodes = viewRef.rootNodes;
774
- if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {
775
- return rootNodes[0];
776
- }
777
- var wrapper = _document.createElement('div');
778
- rootNodes.forEach(function (node) { return wrapper.appendChild(node); });
779
- return wrapper;
780
- }
781
-
782
- /**
783
- * Use this directive to select which element to attach the element to while dragging
784
- * @example <div tftDragRoot><div tftDraggable> </div> </div>
785
- * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )
786
- */
787
- var DragRootDirective = /** @class */ (function () {
788
- function DragRootDirective(el,
789
- // This is used when passing a dragRoot as in input to a draggable element that not a child of that dragRoot
790
- // 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
791
- account_for_scale_dir) {
792
- this.el = el;
793
- this.account_for_scale_dir = account_for_scale_dir;
794
- }
795
- return DragRootDirective;
796
- }());
797
- DragRootDirective.decorators = [
798
- { type: i0.Directive, args: [{
799
- selector: '[tftDragRoot]',
800
- exportAs: 'tftDragRoot'
801
- },] }
802
- ];
803
- DragRootDirective.ctorParameters = function () { return [
804
- { type: i0.ElementRef },
805
- { type: AccountForScaleDirective, decorators: [{ type: i0.Optional }, { type: i0.Self }] }
806
- ]; };
807
-
808
- /** @dynamic */
809
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
810
- var DraggableDirective = /** @class */ (function () {
811
- function DraggableDirective(el, interactService, renderer, _viewContainerRef, _document, account_for_scale_dir, dropzone_dir, drag_root_dir) {
812
- this.el = el;
813
- this.interactService = interactService;
814
- this.renderer = renderer;
815
- this._viewContainerRef = _viewContainerRef;
816
- this._document = _document;
817
- this.account_for_scale_dir = account_for_scale_dir;
818
- this.dropzone_dir = dropzone_dir;
819
- this.drag_root_dir = drag_root_dir;
820
- /* zIndex while dragging*/
821
- this.dragZIndex = 10000;
822
- this.enableDragDefault = true;
823
- /**
824
- * @deprecated replaced by 'dragDisabled' property, please migrate before v13
825
- */
826
- this.disabled = false;
827
- this.dragDisabled = false;
828
- this.showPlaceholder = false;
829
- // pipes all interact events to event emitters
830
- this.dragStart = new i0.EventEmitter();
831
- this.dragMove = new i0.EventEmitter();
832
- this.dragInertiaStart = new i0.EventEmitter();
833
- this.dragEnd = new i0.EventEmitter();
834
- }
835
- Object.defineProperty(DraggableDirective.prototype, "scale", {
836
- // check all the different places for scale
837
- get: function () {
838
- var _a, _b, _c, _d;
839
- 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);
840
- },
841
- enumerable: false,
842
- configurable: true
843
- });
844
- DraggableDirective.prototype.ngOnInit = function () {
845
- var _this = this;
846
- var _a, _b, _c, _d, _e;
847
- this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);
848
- 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;
849
- // register with parent dropzone if it exists, otherwise use default
850
- // this gives us a place on the registry to store our drag items that don't have a dropzone
851
- this.registryId = ((_e = this.dropzone_dir) === null || _e === void 0 ? void 0 : _e.dropzoneId) || DEFAULT_REGISTRY_ID;
852
- // add draggable to directory and store its id
853
- this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);
854
- this.alignPositionWithInputs(this.x, this.y);
855
- // cache subscription to interactable state so we can unsubscribe onDestroy
856
- this.interactableState = this.interactService
857
- .getInteractableState(this.interactableId, this.registryId);
858
- // keep our cached position values in line with our drag state
859
- this.interactableSubscription = this.interactableState.subscribe(function (state) {
860
- _this.y = state.y;
861
- _this.x = state.x;
862
- });
863
- this.setDragConfig();
864
- };
865
- // TODO: watch config here as well and update interactable
866
- DraggableDirective.prototype.ngOnChanges = function (changes) {
867
- // we do this here instead of using a setter on the input so that it
868
- // will only run once when there is a change to x and y
869
- if (changes.y || changes.x) {
870
- this.alignPositionWithInputs(this.x, this.y);
871
- }
872
- if (changes.dragConfig || changes.disabled || changes.dragDisabled) {
873
- if (!this.interactable)
874
- return;
875
- this.setDragConfig();
876
- }
877
- /**
878
- * @deprecated remove this in v13
879
- */
880
- if (changes.disabled) {
881
- 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");
882
- }
883
- };
884
- DraggableDirective.prototype.setDragConfig = function () {
885
- var enabled = !(this.disabled || this.dragDisabled);
886
- var dragConfig = Object.assign(Object.assign({}, this.dragConfig), { enabled: enabled });
887
- this.interactable.draggable(dragConfig);
888
- };
889
- DraggableDirective.prototype.ngAfterViewInit = function () {
890
- this.addDragPropertiesToElement(this.el.nativeElement);
891
- if (!this.dropzone_dir) {
892
- this.previewRef = this.el.nativeElement;
893
- }
894
- };
895
- DraggableDirective.prototype.ngOnDestroy = function () {
896
- // clean up state and subscriptions related to destroyed component
897
- this.interactableSubscription.unsubscribe();
898
- this.interactService.destroyInteractable(this.interactableId, this.registryId);
899
- };
900
- DraggableDirective.prototype.dragMoveListener = function (event, element) {
901
- var dx = event.dx, dy = event.dy;
902
- var scale = this.scale;
903
- var deltaX = scale ? dx / scale : dx;
904
- var deltaY = scale ? dy / scale : dy;
905
- this.interactService.updateDeltas(this.interactableId, this.registryId, { deltaX: deltaX, deltaY: deltaY }, element);
906
- };
907
- DraggableDirective.prototype.setDragStyles = function (dragElement) {
908
- this.renderer.setStyle(dragElement, 'touchAction', 'none');
909
- this.renderer.setStyle(dragElement, 'zIndex', this.dragZIndex);
910
- this.renderer.setStyle(dragElement, 'position', 'absolute');
911
- };
912
- DraggableDirective.prototype.addDragPropertiesToElement = function (nativeElement) {
913
- this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);
914
- this.renderer.setProperty(nativeElement, 'dragOrigin', this.dropzone_dir || null);
915
- this.renderer.setProperty(nativeElement, 'dragRef', this);
916
- };
917
- DraggableDirective.prototype.mapDragEvent = function (event) {
918
- var _a;
919
- var target = event.target, dropzone = event.dropzone;
920
- var dropzoneElement = (dropzone === null || dropzone === void 0 ? void 0 : dropzone.target) || ((_a = target.dropTarget) === null || _a === void 0 ? void 0 : _a.el.nativeElement);
921
- var scale = this.scale;
922
- var positionInDropTarget = target && dropzoneElement
923
- ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef, scale)
924
- : null;
925
- return {
926
- interactEvent: event,
927
- dragRef: this,
928
- dragOrigin: target.dragOrigin,
929
- dropTarget: target.dropTarget,
930
- positionInDropTarget: positionInDropTarget
931
- };
932
- };
933
- DraggableDirective.prototype.setPosition = function (x, y) {
934
- this.interactService.updatePosition(this.interactableId, this.registryId, { x: x, y: y }, this.el.nativeElement);
935
- };
936
- DraggableDirective.prototype.alignPositionWithInputs = function (x, y) {
937
- // short circuit if positions aren't numbers or if they haven't changed
938
- if (!this.isValidPosition(x, y))
939
- return;
940
- this.interactService.updatePosition(this.interactableId, this.registryId, { x: x, y: y }, this.el.nativeElement);
941
- };
942
- DraggableDirective.prototype.isValidPosition = function (x, y) {
943
- return this.isNumeric(x) && this.isNumeric(y);
944
- };
945
- // We use use this instead of isNaN here to try and help performance
946
- // We should be able to reliably restrict to numbers or falsey values
947
- DraggableDirective.prototype.isNumeric = function (num) {
948
- return typeof num === 'number' && !isNaN(num);
949
- };
950
- DraggableDirective.prototype.initiateDragEvents = function (dragConfig, nativeElement) {
951
- var _this = this;
952
- return interact__default['default'](nativeElement).draggable(Object.assign(Object.assign({}, dragConfig), { enabled: !(this.disabled || this.dragDisabled) }))
953
- .on('dragstart', function (event) {
954
- var _a, _b, _c;
955
- var interaction = event.interaction;
956
- // check if we should append drag element to body
957
- if (_this.enableDragDefault
958
- && interaction.pointerIsDown
959
- // TODO: probably don't need following condition checks anymore remove by 2022
960
- // && !!this.dropzone_dir
961
- // && !interaction.interacting()
962
- ) {
963
- if (_this._previewTemplate) {
964
- var viewRef = _this._viewContainerRef.createEmbeddedView(_this._previewTemplate.templateRef);
965
- _this.previewRef = getRootNode(viewRef, _this._document);
966
- }
967
- else {
968
- _this.previewRef = cloneElement(_this.el.nativeElement);
969
- }
970
- _this.addDragPropertiesToElement(_this.previewRef);
971
- _this.setDragStyles(_this.previewRef);
972
- _this.dragRootEl.prepend(_this.previewRef);
973
- var 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;
974
- var _f = _this.interactService.calculatePositionInElement(_this.dragRootEl, nativeElement, scale), x = _f.x, y = _f.y;
975
- _this.interactService.updatePosition(_this.interactableId, _this.registryId, { x: x, y: y }, _this.previewRef);
976
- if (!_this.showPlaceholder) {
977
- _this.renderer.setStyle(_this.el.nativeElement, 'display', 'none');
978
- }
979
- }
980
- _this.dragStart.emit(_this.mapDragEvent(event));
981
- })
982
- .on('dragmove', function (event) {
983
- if (_this.enableDragDefault) {
984
- var dragElement = _this.dropzone_dir && _this.previewRef || nativeElement;
985
- _this.dragMoveListener(event, dragElement);
986
- }
987
- var mappedEvent = _this.mapDragEvent(event);
988
- _this.dragMove.emit(mappedEvent);
989
- })
990
- .on('draginertiastart', function (event) {
991
- _this.dragInertiaStart.emit(_this.mapDragEvent(event));
992
- })
993
- .on('dragend', function (event) {
994
- var mappedEvent = _this.mapDragEvent(event);
995
- if (!!_this.dropzone_dir && _this.dropzone_dir === event.target.dropTarget) {
996
- var _f = mappedEvent.positionInDropTarget, x = _f.x, y = _f.y;
997
- _this.setPosition(x, y);
998
- }
999
- _this.renderer.setStyle(_this.el.nativeElement, 'display', '');
1000
- _this.dragEnd.emit(mappedEvent);
1001
- if (_this.el.nativeElement !== _this.previewRef) {
1002
- // we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect
1003
- setTimeout(function () {
1004
- _this.dragRootEl.removeChild(_this.previewRef);
1005
- });
1006
- }
1007
- });
1008
- };
1009
- return DraggableDirective;
1010
- }());
1011
- DraggableDirective.decorators = [
1012
- { type: i0.Directive, args: [{
1013
- selector: '[tftDraggable]',
1014
- // eslint-disable-next-line @angular-eslint/no-host-metadata-property
1015
- host: {
1016
- '[style.touchAction]': 'this.dragDisabled ? "auto" : "none"',
1017
- '[style.position]': '"absolute"',
1018
- '[id]': 'interactableId',
1019
- }
1020
- },] }
1021
- ];
1022
- DraggableDirective.ctorParameters = function () { return [
1023
- { type: i0.ElementRef },
1024
- { type: InteractService },
1025
- { type: i0.Renderer2 },
1026
- { type: i0.ViewContainerRef },
1027
- { type: Document, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },
1028
- { type: AccountForScaleDirective, decorators: [{ type: i0.Optional }] },
1029
- { type: DropzoneDirective, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] },
1030
- { type: DragRootDirective, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1031
- ]; };
1032
- DraggableDirective.propDecorators = {
1033
- x: [{ type: i0.Input }],
1034
- y: [{ type: i0.Input }],
1035
- dragZIndex: [{ type: i0.Input }],
1036
- zIndex: [{ type: i0.Input }],
1037
- interactableId: [{ type: i0.Input }],
1038
- dragData: [{ type: i0.Input }],
1039
- enableDragDefault: [{ type: i0.Input }],
1040
- disabled: [{ type: i0.Input }],
1041
- dragDisabled: [{ type: i0.Input }],
1042
- dragConfig: [{ type: i0.Input }],
1043
- showPlaceholder: [{ type: i0.Input }],
1044
- dragRoot: [{ type: i0.Input }],
1045
- dragStart: [{ type: i0.Output }],
1046
- dragMove: [{ type: i0.Output }],
1047
- dragInertiaStart: [{ type: i0.Output }],
1048
- dragEnd: [{ type: i0.Output }],
1049
- _previewTemplate: [{ type: i0.ContentChild, args: [DragPreviewDirective,] }]
1050
- };
1051
- /**
1052
- * Component utils
1053
- */
1054
- // create a clone of the component passed in and add it to the root component
1055
- function cloneElement(element) {
1056
- var clone = element.cloneNode(true);
1057
- clone.removeAttribute('id');
1058
- return clone;
1059
- }
1060
- function getPreviewInsertionPoint(documentRef) {
1061
- // We can't use the body if the user is in fullscreen mode,
1062
- // because the preview will render under the fullscreen element.
1063
- return documentRef.fullscreenElement ||
1064
- documentRef.webkitFullscreenElement ||
1065
- documentRef.mozFullScreenElement ||
1066
- documentRef.msFullscreenElement ||
1067
- documentRef.body;
1068
- }
1069
-
1070
- /** @dynamic */
1071
- var ResizableDirective = /** @class */ (function () {
1072
- function ResizableDirective(el, _document, interactService, renderer, drag_root_dir, account_for_scale_dir, draggable_dir, dropzone_dir) {
1073
- var _a;
1074
- this.el = el;
1075
- this._document = _document;
1076
- this.interactService = interactService;
1077
- this.renderer = renderer;
1078
- this.drag_root_dir = drag_root_dir;
1079
- this.account_for_scale_dir = account_for_scale_dir;
1080
- this.draggable_dir = draggable_dir;
1081
- this.dropzone_dir = dropzone_dir;
1082
- this.enableResizeDefault = true;
1083
- // TODO: should this be an input with default or should consuming user set display in styles each time
1084
- this.position = 'absolute';
1085
- this.resizeDisabled = false;
1086
- this.resizeStart = new i0.EventEmitter();
1087
- this.resizeMove = new i0.EventEmitter();
1088
- this.resizeInertiaStart = new i0.EventEmitter();
1089
- this.resizeEnd = new i0.EventEmitter();
1090
- this.defaultConfig = {
1091
- edges: { left: true, right: true, bottom: true, top: true }
1092
- };
1093
- 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;
1094
- }
1095
- Object.defineProperty(ResizableDirective.prototype, "scale", {
1096
- get: function () {
1097
- var _a, _b, _c;
1098
- 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);
1099
- },
1100
- enumerable: false,
1101
- configurable: true
1102
- });
1103
- ResizableDirective.prototype.ngOnInit = function () {
1104
- var _a, _b;
1105
- this.addResizePropertiesToElement(this.el.nativeElement);
1106
- // we check for a dropzone, we use its id as the registry id if there is on
1107
- // otherwise, we use DEFAULT_REGISTRY_ID as a registry id. This allows us to keep our interactable
1108
- // drag state organized by dropzones.
1109
- this.registryId = ((_a = this.dropzone_dir) === null || _a === void 0 ? void 0 : _a.dropzoneId) || DEFAULT_REGISTRY_ID;
1110
- this.interactableId = ((_b = this.draggable_dir) === null || _b === void 0 ? void 0 : _b.interactableId) || this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);
1111
- this.interactable = this.initiateResizeEvents(Object.assign(Object.assign({}, this.defaultConfig), this.resizeConfig), this.el.nativeElement);
1112
- this.alignDimensionsWithInputs(this.width, this.height);
1113
- this.interactableSubscription = this.interactService
1114
- .getInteractableState(this.interactableId, this.registryId)
1115
- .subscribe();
1116
- };
1117
- ResizableDirective.prototype.ngOnChanges = function (changes) {
1118
- if ((changes.resizeConfig || changes.resizeDisabled) && this.interactable) {
1119
- this.interactable.resizable(Object.assign(Object.assign({}, this.resizeConfig), { enabled: !this.resizeDisabled }));
1120
- }
1121
- if (changes.width || changes.height) {
1122
- this.alignDimensionsWithInputs(this.width, this.height);
1123
- }
1124
- };
1125
- ResizableDirective.prototype.ngOnDestroy = function () {
1126
- this.interactableSubscription.unsubscribe();
1127
- this.interactService.destroyInteractable(this.interactableId, this.registryId);
1128
- };
1129
- ResizableDirective.prototype.resizeListener = function (event) {
1130
- var scale = this.scale;
1131
- var deltaX;
1132
- var deltaY;
1133
- var height;
1134
- var width;
1135
- if (scale) {
1136
- deltaX = event.deltaRect.left / scale;
1137
- deltaY = event.deltaRect.top / scale;
1138
- height = event.rect.height / scale;
1139
- width = event.rect.width / scale;
1140
- }
1141
- else {
1142
- deltaX = event.deltaRect.left;
1143
- deltaY = event.deltaRect.top;
1144
- width = event.rect.width;
1145
- height = event.rect.height;
1146
- }
1147
- this.interactService.updateSize(this.interactableId, this.registryId, { deltaX: deltaX, deltaY: deltaY, width: width, height: height }, this.el.nativeElement);
1148
- };
1149
- /**
1150
- * hook elements into interacts resize event listeners
1151
- * we spread the configs so that the consuming component only overwrites the
1152
- * pieces that it explicitly indicates
1153
- * @param resizeConfig
1154
- * @param nativeElement
1155
- */
1156
- ResizableDirective.prototype.initiateResizeEvents = function (resizeConfig, nativeElement) {
1157
- var _this = this;
1158
- var _a;
1159
- // TODO: This should try and get interactable from tft_draggable if it exists
1160
- var interactable = ((_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.interactable) || interact__default['default'](nativeElement);
1161
- return interactable.resizable(Object.assign(Object.assign({}, resizeConfig), { enabled: !this.resizeDisabled }))
1162
- .on('resizestart', function (event) { _this.resizeStart.emit(_this.mapResizeEvent(event)); })
1163
- .on('resizemove', function (event) {
1164
- if (_this.enableResizeDefault) {
1165
- _this.resizeListener(event);
1166
- }
1167
- var mappedEvent = _this.mapResizeEvent(event);
1168
- _this.resizeMove.emit(mappedEvent);
1169
- })
1170
- .on('resizeinertiastart', function (event) { return _this.resizeInertiaStart.emit(_this.mapResizeEvent(event)); })
1171
- .on('resizeend', function (event) { return _this.resizeEnd.emit(_this.mapResizeEvent(event)); });
1172
- };
1173
- ResizableDirective.prototype.mapResizeEvent = function (event) {
1174
- var _a, _b;
1175
- var target = event.target;
1176
- var relatedTarget = (_b = (_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.dropzone_dir) === null || _b === void 0 ? void 0 : _b.el.nativeElement;
1177
- var scale = this.scale;
1178
- var positionInDropTarget = target && relatedTarget
1179
- ? this.interactService.calculatePositionInElement(relatedTarget, target, scale)
1180
- : null;
1181
- return {
1182
- interactEvent: event,
1183
- resizeRef: this,
1184
- dragRef: this.draggable_dir,
1185
- dragOrigin: this.dropzone_dir,
1186
- dropTarget: this.el.nativeElement.dropTarget,
1187
- positionInDropTarget: positionInDropTarget,
1188
- size: {
1189
- width: target.clientWidth / scale,
1190
- height: target.clientHeight / scale
1191
- }
1192
- };
1193
- };
1194
- ResizableDirective.prototype.alignDimensionsWithInputs = function (width, height) {
1195
- this.interactService.updateSize(this.interactableId, this.registryId, { deltaX: 0, deltaY: 0, width: width, height: height }, this.el.nativeElement);
1196
- };
1197
- ResizableDirective.prototype.addResizePropertiesToElement = function (nativeElement) {
1198
- this.renderer.setProperty(nativeElement, 'resizeRef', this);
1199
- };
1200
- return ResizableDirective;
1201
- }());
1202
- ResizableDirective.decorators = [
1203
- { type: i0.Directive, args: [{
1204
- selector: '[tftResizable]',
1205
- // eslint-disable-next-line @angular-eslint/no-host-metadata-property
1206
- host: {
1207
- // prevents touch events from colliding with with mouse events
1208
- // on touch screen
1209
- '[style.touchAction]': 'this.resizeDisabled ? "auto" : "none"',
1210
- // default to absolute here to accommodate likely use cases
1211
- // consuming component can easily over ride with position input
1212
- '[style.position]': 'position',
1213
- // follows interactjs suggested practices
1214
- '[style.boxSizing]': '"border-box"',
1215
- }
1216
- },] }
1217
- ];
1218
- ResizableDirective.ctorParameters = function () { return [
1219
- { type: i0.ElementRef },
1220
- { type: Document, decorators: [{ type: i0.Inject, args: [common.DOCUMENT,] }] },
1221
- { type: InteractService },
1222
- { type: i0.Renderer2 },
1223
- { type: DragRootDirective, decorators: [{ type: i0.Optional }] },
1224
- { type: AccountForScaleDirective, decorators: [{ type: i0.Optional }] },
1225
- { type: DraggableDirective, decorators: [{ type: i0.Optional }] },
1226
- { type: DropzoneDirective, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1227
- ]; };
1228
- ResizableDirective.propDecorators = {
1229
- enableResizeDefault: [{ type: i0.Input }],
1230
- position: [{ type: i0.Input }],
1231
- resizeConfig: [{ type: i0.Input }],
1232
- interactableId: [{ type: i0.Input }],
1233
- width: [{ type: i0.Input }],
1234
- height: [{ type: i0.Input }],
1235
- resizeDisabled: [{ type: i0.Input }],
1236
- resizeStart: [{ type: i0.Output }],
1237
- resizeMove: [{ type: i0.Output }],
1238
- resizeInertiaStart: [{ type: i0.Output }],
1239
- resizeEnd: [{ type: i0.Output }]
1240
- };
1241
-
1242
- /** @dynamic */
1243
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1244
- var GesturableDirective = /** @class */ (function () {
1245
- function GesturableDirective(el, draggable_dir) {
1246
- this.el = el;
1247
- this.draggable_dir = draggable_dir;
1248
- this.gestureDisabled = false;
1249
- // pipes all interact events to event emitters
1250
- this.gestureStart = new i0.EventEmitter();
1251
- this.gestureMove = new i0.EventEmitter();
1252
- this.gestureEnd = new i0.EventEmitter();
1253
- }
1254
- GesturableDirective.prototype.ngOnInit = function () {
1255
- var _a;
1256
- this.gesturableId = ((_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.interactableId) || 'id';
1257
- this.interactable = this.initiateGestureEvents(this.gestureConfig, this.el.nativeElement);
1258
- this.setGestureConfig();
1259
- };
1260
- // TODO: watch config here as well and update interactable
1261
- GesturableDirective.prototype.ngOnChanges = function (changes) {
1262
- // we do this here instead of using a setter on the input so that it
1263
- // will only run once when there is a change to x and y
1264
- if (changes.gestureConfig || changes.gestureDisabled) {
1265
- if (!this.interactable)
1266
- return;
1267
- this.setGestureConfig();
1268
- }
1269
- };
1270
- GesturableDirective.prototype.setGestureConfig = function () {
1271
- var enabled = !this.gestureDisabled;
1272
- var gestureConfig = Object.assign(Object.assign({}, this.gestureConfig), { enabled: enabled });
1273
- this.interactable.gesturable(gestureConfig);
1274
- };
1275
- GesturableDirective.prototype.initiateGestureEvents = function (gestureConfig, nativeElement) {
1276
- var _this = this;
1277
- var _a;
1278
- var defaultConfig = {
1279
- enabled: !this.gestureDisabled,
1280
- };
1281
- var interactable = ((_a = this.draggable_dir) === null || _a === void 0 ? void 0 : _a.interactable) || interact__default['default'](nativeElement);
1282
- return interactable.gesturable(Object.assign(Object.assign({}, defaultConfig), gestureConfig))
1283
- .on('gesturestart', function (event) {
1284
- _this.gestureStart.emit({ gestureRef: _this, interactEvent: event });
1285
- })
1286
- .on('gesturemove', function (event) {
1287
- _this.gestureMove.emit({ gestureRef: _this, interactEvent: event });
1288
- })
1289
- .on('gestureend', function (event) {
1290
- _this.gestureEnd.emit({ gestureRef: _this, interactEvent: event });
1291
- });
1292
- };
1293
- return GesturableDirective;
1294
- }());
1295
- GesturableDirective.decorators = [
1296
- { type: i0.Directive, args: [{
1297
- selector: '[tftGesturable]',
1298
- // eslint-disable-next-line @angular-eslint/no-host-metadata-property
1299
- host: {
1300
- // '[style.touchAction]': 'this.gestureDisabled ? "auto" : "none"',
1301
- '[id]': 'gesturableId',
1302
- }
1303
- },] }
1304
- ];
1305
- GesturableDirective.ctorParameters = function () { return [
1306
- { type: i0.ElementRef },
1307
- { type: DraggableDirective, decorators: [{ type: i0.Optional }] }
1308
- ]; };
1309
- GesturableDirective.propDecorators = {
1310
- gesturableId: [{ type: i0.Input }],
1311
- gestureDisabled: [{ type: i0.Input }],
1312
- gestureConfig: [{ type: i0.Input }],
1313
- gestureStart: [{ type: i0.Output }],
1314
- gestureMove: [{ type: i0.Output }],
1315
- gestureEnd: [{ type: i0.Output }]
1316
- };
1317
-
1318
- var ApplyScaleDirective = /** @class */ (function () {
1319
- function ApplyScaleDirective(el) {
1320
- this.el = el;
1321
- this._scale = 1;
1322
- }
1323
- Object.defineProperty(ApplyScaleDirective.prototype, "scale", {
1324
- // this setup allows consumers to set x, y scale independently or just set them both with scale
1325
- set: function (val) {
1326
- this._scale;
1327
- this.fontSize = val + "px";
1328
- },
1329
- enumerable: false,
1330
- configurable: true
1331
- });
1332
- ;
1333
- return ApplyScaleDirective;
1334
- }());
1335
- ApplyScaleDirective.decorators = [
1336
- { type: i0.Directive, args: [{
1337
- selector: '[tftApplyScale]'
1338
- },] }
1339
- ];
1340
- ApplyScaleDirective.ctorParameters = function () { return [
1341
- { type: i0.ElementRef }
1342
- ]; };
1343
- ApplyScaleDirective.propDecorators = {
1344
- scale: [{ type: i0.Input }],
1345
- fontSize: [{ type: i0.HostBinding, args: ['style.fontSize',] }]
1346
- };
1347
-
1348
- var EXPORTS = [
1349
- DraggableDirective,
1350
- ResizableDirective,
1351
- DropzoneDirective,
1352
- GesturableDirective,
1353
- DragRootDirective,
1354
- AccountForScaleDirective,
1355
- ApplyScaleDirective,
1356
- DragPreviewDirective,
1357
- ArrayOfNPipe,
1358
- ];
1359
- var InteractModule = /** @class */ (function () {
1360
- function InteractModule() {
1361
- }
1362
- InteractModule.forRoot = function (config) {
1363
- var defaultConfig = { cssDimensionUnit: 'px' };
1364
- return {
1365
- ngModule: InteractModule,
1366
- providers: [
1367
- { provide: INTERACT_ROOT_CONFIG, useValue: Object.assign(Object.assign({}, defaultConfig), config) },
1368
- InteractService
1369
- ]
1370
- };
1371
- };
1372
- return InteractModule;
1373
- }());
1374
- InteractModule.decorators = [
1375
- { type: i0.NgModule, args: [{
1376
- imports: [common.CommonModule],
1377
- // providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],
1378
- declarations: __spreadArray([], __read(EXPORTS)),
1379
- exports: __spreadArray([], __read(EXPORTS))
1380
- },] }
1381
- ];
1382
-
1383
- /**
1384
- * Generated bundle index. Do not edit.
1385
- */
1386
-
1387
- exports.AccountForScaleDirective = AccountForScaleDirective;
1388
- exports.ApplyScaleDirective = ApplyScaleDirective;
1389
- exports.ArrayOfNPipe = ArrayOfNPipe;
1390
- exports.DEFAULT_REGISTRY_ID = DEFAULT_REGISTRY_ID;
1391
- exports.DragPreviewDirective = DragPreviewDirective;
1392
- exports.DragRootDirective = DragRootDirective;
1393
- exports.DraggableDirective = DraggableDirective;
1394
- exports.DropzoneDirective = DropzoneDirective;
1395
- exports.GesturableDirective = GesturableDirective;
1396
- exports.INTERACT_ROOT_CONFIG = INTERACT_ROOT_CONFIG;
1397
- exports.InteractModule = InteractModule;
1398
- exports.ResizableDirective = ResizableDirective;
1399
- exports.TFT_DRAG_PREVIEW = TFT_DRAG_PREVIEW;
1400
- exports.cloneElement = cloneElement$1;
1401
- exports.defaultDelta = defaultDelta;
1402
- exports.defaultPosition = defaultPosition;
1403
- exports.defaultSize = defaultSize;
1404
- exports.getClosestMatchingAncestor = getClosestMatchingAncestor;
1405
- exports.getRootNode = getRootNode;
1406
- exports.ɵa = DraggableDirective;
1407
- exports.ɵb = ResizableDirective;
1408
- exports.ɵc = DropzoneDirective;
1409
- exports.ɵd = GesturableDirective;
1410
- exports.ɵe = DragRootDirective;
1411
- exports.ɵf = AccountForScaleDirective;
1412
- exports.ɵg = ApplyScaleDirective;
1413
- exports.ɵh = DragPreviewDirective;
1414
- exports.ɵi = ArrayOfNPipe;
1415
-
1416
- Object.defineProperty(exports, '__esModule', { value: true });
1417
-
1418
- })));
1419
- //# sourceMappingURL=tft-interact.umd.js.map