xctc-utils 1.6.51 → 1.6.53

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.
@@ -35,7 +35,7 @@ export default class CanvasHooks {
35
35
  canvasConfigDataFn(config: any): void;
36
36
  registerCallBackEventFn(config?: any): void;
37
37
  registerAllEventHandleFn(): void;
38
- registerCanvasZoomChangeEventFn(): any;
38
+ registerCanvasZoomChangeEventFn(): void;
39
39
  registerMouseDropEventFn(options: any): void;
40
40
  registerMouseOverEventFn(options: any): void;
41
41
  registerMouseOutEventFn(options: any): void;
@@ -187,7 +187,9 @@ var CanvasHooks = /** @class */ (function () {
187
187
  };
188
188
  // 注册回调事件--页面生成画布实例的时候,调用该函数
189
189
  CanvasHooks.prototype.registerCallBackEventFn = function (config) {
190
- new register_1.RegisterCanvasEventFn(config);
190
+ var _ = this;
191
+ var boundFunction = register_1.RegisterCanvasEventFn.bind(_, config);
192
+ boundFunction();
191
193
  };
192
194
  // 执行注册事件
193
195
  CanvasHooks.prototype.registerAllEventHandleFn = function () {
@@ -232,15 +234,18 @@ var CanvasHooks = /** @class */ (function () {
232
234
  };
233
235
  // 注册画布发生缩放监听事件
234
236
  CanvasHooks.prototype.registerCanvasZoomChangeEventFn = function () {
235
- return new register_1.RegisterCanvasZoomChangeEventFn();
237
+ var _ = this;
238
+ var boundFunction = register_1.RegisterCanvasZoomChangeEventFn.bind(_);
239
+ boundFunction();
236
240
  };
237
241
  // 拖拽事件注册
238
242
  CanvasHooks.prototype.registerMouseDropEventFn = function (options) {
239
- new drop_1.RegisterMouseDropEventFn(options);
243
+ var _ = this;
244
+ var boundFunction = drop_1.RegisterMouseDropEventFn.bind(_, options);
245
+ boundFunction();
240
246
  };
241
247
  // 鼠标进入画布
242
248
  CanvasHooks.prototype.registerMouseOverEventFn = function (options) {
243
- // console.log("registerMouseOutEventFn");
244
249
  var _ = this;
245
250
  _.mouseCanvasInRangeStatus = true;
246
251
  };
@@ -252,35 +257,51 @@ var CanvasHooks = /** @class */ (function () {
252
257
  };
253
258
  // 注册鼠标按下事件
254
259
  CanvasHooks.prototype.registerMouseDownEventFn = function (options) {
255
- new mouse_down_1.RegisterMouseDownEventFn(options);
260
+ var _ = this;
261
+ var boundFunction = mouse_down_1.RegisterMouseDownEventFn.bind(_, options);
262
+ boundFunction();
256
263
  };
257
264
  // 注册鼠标移动事件
258
265
  CanvasHooks.prototype.registerMouseMoveEventFn = function (options) {
259
- new mouse_move_1.RegisterMouseMoveEventFn(options);
266
+ var _ = this;
267
+ var boundFunction = mouse_move_1.RegisterMouseMoveEventFn.bind(_, options);
268
+ boundFunction();
260
269
  };
261
270
  // 注册鼠标抬起事件
262
271
  CanvasHooks.prototype.registerMouseUpEventFn = function (options) {
263
- new mouse_up_1.RegisterMouseUpEventFn(options);
272
+ var _ = this;
273
+ var boundFunction = mouse_up_1.RegisterMouseUpEventFn.bind(_, options);
274
+ boundFunction();
264
275
  };
265
276
  // 注册鼠标滚动事件
266
277
  CanvasHooks.prototype.registerMouseWheelEventFn = function (options) {
267
- new mouse_wheel_1.RegisterMouseWheelEventFn(options);
278
+ var _ = this;
279
+ var boundFunction = mouse_wheel_1.RegisterMouseWheelEventFn.bind(_, options);
280
+ boundFunction();
268
281
  };
269
282
  // 滚动事件操作--画布缩放监听
270
283
  CanvasHooks.prototype.registerZoomHandleFn = function (options) {
271
- new index_1.RegisterZoomHandleFn(options);
284
+ var _ = this;
285
+ var boundFunction = index_1.RegisterZoomHandleFn.bind(_, options);
286
+ boundFunction();
272
287
  };
273
288
  // 页面上发生拖拽时,拖拽完成后的数据存储函数
274
289
  CanvasHooks.prototype.dragCreateElementDataFn = function (data) {
275
- new drop_2.DragCreateElementDataFn(data);
290
+ var _ = this;
291
+ var boundFunction = drop_2.DragCreateElementDataFn.bind(_, data);
292
+ boundFunction();
276
293
  };
277
294
  // 拖拽进入画布元素创建
278
295
  CanvasHooks.prototype.createDragElementFn = function () {
279
- new create_1.CreateDragElementFn();
296
+ var _ = this;
297
+ var boundFunction = create_1.CreateDragElementFn.bind(_);
298
+ boundFunction();
280
299
  };
281
300
  // 默认加载一个列表数据到画布
282
301
  CanvasHooks.prototype.initElement2CanvasFn = function (list) {
283
- new create_1.InitElement2CanvasFn(list);
302
+ var _ = this;
303
+ var boundFunction = create_1.InitElement2CanvasFn.bind(_, list);
304
+ boundFunction();
284
305
  };
285
306
  CanvasHooks.prototype.getCreateElementStatusFn = function (index) {
286
307
  var _ = this;
@@ -295,80 +316,118 @@ var CanvasHooks = /** @class */ (function () {
295
316
  };
296
317
  // 创建SVG到画布
297
318
  CanvasHooks.prototype.createCanvasSvgElementFn = function (item, index) {
298
- new create_1.CreateCanvasSvgElementFn(fabric_1.fabric, item, index);
319
+ var _ = this;
320
+ var boundFunction = create_1.CreateCanvasSvgElementFn.bind(_, fabric_1.fabric, item, index);
321
+ boundFunction();
299
322
  };
300
323
  // 创建图片到画布
301
324
  CanvasHooks.prototype.createCanvasImageElementFn = function (item, index) {
302
- new create_1.CreateCanvasImageElementFn(fabric_1.fabric, item, index);
325
+ var _ = this;
326
+ var boundFunction = create_1.CreateCanvasImageElementFn.bind(_, fabric_1.fabric, item, index);
327
+ boundFunction();
303
328
  };
304
329
  // 获取到所有被框选的对象
305
330
  CanvasHooks.prototype.getSelectionAllElementsFn = function () {
306
- return new query_1.QuerySelectionAllElementsFn();
331
+ var _ = this;
332
+ var data = query_1.QuerySelectionAllElementsFn.bind(_);
333
+ return data();
307
334
  };
308
335
  // 获取到指定选择框内被框选的对象
309
336
  CanvasHooks.prototype.getSelectionElementsFn = function (item) {
310
- return new query_1.QuerySelectionElementsFn(item);
337
+ var _ = this;
338
+ var data = query_1.QuerySelectionElementsFn.bind(_, item);
339
+ return data();
311
340
  };
312
341
  // 创建自定义图像
313
342
  CanvasHooks.prototype.createSelectionRectFn = function () {
314
- new create_1.CreateSelectionRectFn(fabric_1.fabric);
343
+ var _ = this;
344
+ var boundFunction = create_1.CreateSelectionRectFn.bind(_, fabric_1.fabric);
345
+ boundFunction();
315
346
  };
316
347
  // 创建全选框
317
348
  CanvasHooks.prototype.createAllSelectionRectFn = function () {
318
- new create_1.CreateAllSelectionRectFn(fabric_1.fabric);
349
+ var _ = this;
350
+ var boundFunction = create_1.CreateAllSelectionRectFn.bind(_, fabric_1.fabric);
351
+ boundFunction();
319
352
  };
320
353
  // 删除全选对象选择框
321
354
  CanvasHooks.prototype.removeAllSelectionRectFn = function () {
322
- new update_1.RemoveAllSelectionRectFn();
355
+ var _ = this;
356
+ var boundFunction = update_1.RemoveAllSelectionRectFn.bind(_);
357
+ boundFunction();
323
358
  };
324
359
  // 自定义选择框绘制数据更新
325
360
  CanvasHooks.prototype.updateSelectionRectFn = function (options) {
326
- new update_1.UpdateSelectionRectFn(options);
361
+ var _ = this;
362
+ var boundFunction = update_1.UpdateSelectionRectFn.bind(_, options);
363
+ boundFunction();
327
364
  };
328
365
  // 自定义选择框绘制完成
329
366
  CanvasHooks.prototype.createSelectionRectFinishFn = function () {
330
- new update_1.CreateSelectionRectFinishFn();
367
+ var _ = this;
368
+ var boundFunction = update_1.CreateSelectionRectFinishFn.bind(_);
369
+ boundFunction();
331
370
  };
332
371
  CanvasHooks.prototype.init = function () {
333
372
  var _ = this;
334
373
  };
335
374
  // 获取画布容器的宽高
336
375
  CanvasHooks.prototype.elementSizeFn = function (id) {
337
- return new query_1.QueryElementSizeFn(id);
376
+ var _ = this;
377
+ var data = query_1.QueryElementSizeFn.bind(_, id);
378
+ return data();
338
379
  };
339
380
  // 右键菜单管理
340
381
  CanvasHooks.prototype.createRightClickMenuFn = function (options) {
341
- new create_1.CreateRightClickMenuFn(options);
382
+ var _ = this;
383
+ var boundFunction = create_1.CreateRightClickMenuFn.bind(_, options);
384
+ boundFunction();
342
385
  };
343
386
  CanvasHooks.prototype.hiddenRightClickMenuFn = function () {
344
- new update_1.HiddenRightClickMenuFn();
387
+ var _ = this;
388
+ var boundFunction = update_1.HiddenRightClickMenuFn.bind(_);
389
+ boundFunction();
345
390
  };
346
391
  // 在画布上动态创建对象
347
392
  CanvasHooks.prototype.createElementFn = function (domVal, id, index) {
348
- return new create_1.CreateElementFn(domVal, id, index);
393
+ var _ = this;
394
+ var data = create_1.CreateElementFn.bind(_, domVal, id, index);
395
+ return data();
349
396
  };
350
397
  // 执行返回上一步操作
351
398
  CanvasHooks.prototype.previousStepFn = function () {
352
- new changed_1.PreviousStepFn();
399
+ var _ = this;
400
+ var boundFunction = changed_1.PreviousStepFn.bind(_);
401
+ boundFunction();
353
402
  };
354
403
  // 移除画布上指定对象
355
404
  CanvasHooks.prototype.removeElementFn = function (id) {
356
- new update_1.RemoveElementFn(id);
405
+ var _ = this;
406
+ var boundFunction = update_1.RemoveElementFn.bind(_, id);
407
+ boundFunction();
357
408
  };
358
409
  // 清空画布上所有对象
359
410
  CanvasHooks.prototype.removeAllElementFn = function () {
360
- new update_1.RemoveAllElementFn();
411
+ var _ = this;
412
+ var boundFunction = update_1.RemoveAllElementFn.bind(_);
413
+ boundFunction();
361
414
  };
362
415
  // 对于画布出现缩放的情况,加载进入的数据会产生偏移处理
363
416
  // 问题未解决,备注
364
417
  CanvasHooks.prototype.resetElementSizeFn = function () {
365
- new changed_1.ResetElementSizeFn();
418
+ var _ = this;
419
+ var boundFunction = changed_1.ResetElementSizeFn.bind(_);
420
+ boundFunction();
366
421
  };
367
422
  CanvasHooks.prototype.setCanvasBaseConfigFn = function (zoom) {
368
- new index_1.SetCanvasBaseConfigFn(zoom);
423
+ var _ = this;
424
+ var boundFunction = index_1.SetCanvasBaseConfigFn.bind(_, zoom);
425
+ boundFunction();
369
426
  };
370
427
  CanvasHooks.prototype.getCanvasActionDataFn = function () {
371
- return new query_1.QueryCanvasActionDataFn();
428
+ var _ = this;
429
+ var data = query_1.QueryCanvasActionDataFn.bind(_);
430
+ return data();
372
431
  };
373
432
  return CanvasHooks;
374
433
  }());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xctc-utils",
3
- "version": "1.6.51",
3
+ "version": "1.6.53",
4
4
  "description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",