@wcardinal/wcardinal-ui 0.431.0 → 0.432.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 (39) hide show
  1. package/dist/types/wcardinal/ui/d-diagram-canvas-editor-snap.d.ts +10 -1
  2. package/dist/types/wcardinal/ui/d-diagram-canvas-editor.d.ts +3 -1
  3. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.d.ts +1 -0
  5. package/dist/wcardinal/ui/d-chart-selection-gridline-x.js +2 -1
  6. package/dist/wcardinal/ui/d-chart-selection-gridline-x.js.map +1 -1
  7. package/dist/wcardinal/ui/d-chart-selection-gridline-y.js +2 -1
  8. package/dist/wcardinal/ui/d-chart-selection-gridline-y.js.map +1 -1
  9. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js +84 -22
  10. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js.map +1 -1
  11. package/dist/wcardinal/ui/d-diagram-canvas-editor.js +22 -10
  12. package/dist/wcardinal/ui/d-diagram-canvas-editor.js.map +1 -1
  13. package/dist/wcardinal/ui/snapper/e-snapper-grid.js +1 -1
  14. package/dist/wcardinal/ui/snapper/e-snapper-grid.js.map +1 -1
  15. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js +3 -0
  16. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js.map +1 -1
  17. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js +3 -0
  18. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js.map +1 -1
  19. package/dist/wcardinal-ui-theme-dark-en-us.js +4 -1
  20. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  21. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  22. package/dist/wcardinal-ui-theme-dark-ja-jp.js +4 -1
  23. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  24. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  25. package/dist/wcardinal-ui-theme-dark.js +4 -1
  26. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  27. package/dist/wcardinal-ui-theme-white-en-us.js +4 -1
  28. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  29. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  30. package/dist/wcardinal-ui-theme-white-ja-jp.js +4 -1
  31. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  32. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  33. package/dist/wcardinal-ui-theme-white.js +4 -1
  34. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  35. package/dist/wcardinal-ui.cjs.js +118 -36
  36. package/dist/wcardinal-ui.js +112 -36
  37. package/dist/wcardinal-ui.min.js +2 -2
  38. package/dist/wcardinal-ui.min.js.map +1 -1
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.431.0
2
+ Winter Cardinal UI v0.432.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -47852,7 +47852,7 @@ var ESnapperGrid = /** @class */ (function (_super) {
47852
47852
  this.size = serialized[2];
47853
47853
  }
47854
47854
  else {
47855
- this.visible = false;
47855
+ this.visible = this._isVisibleDefault;
47856
47856
  this.size = serialized[1];
47857
47857
  }
47858
47858
  };
@@ -56375,6 +56375,9 @@ var DThemeWhiteDiagramCanvasEditor = /** @class */ (function (_super) {
56375
56375
  DThemeWhiteDiagramCanvasEditor.prototype.getSnapGridSize = function () {
56376
56376
  return toGridSize$1;
56377
56377
  };
56378
+ DThemeWhiteDiagramCanvasEditor.prototype.isSnapGridAdaptive = function () {
56379
+ return true;
56380
+ };
56378
56381
  DThemeWhiteDiagramCanvasEditor.prototype.getSnapTargetColor = function () {
56379
56382
  return DThemeWhiteConstants.HIGHLIGHT_COLOR;
56380
56383
  };
@@ -66908,6 +66911,9 @@ var DThemeDarkDiagramCanvasEditor = /** @class */ (function (_super) {
66908
66911
  DThemeDarkDiagramCanvasEditor.prototype.getSnapGridSize = function () {
66909
66912
  return toGridSize;
66910
66913
  };
66914
+ DThemeDarkDiagramCanvasEditor.prototype.isSnapGridAdaptive = function () {
66915
+ return true;
66916
+ };
66911
66917
  DThemeDarkDiagramCanvasEditor.prototype.getSnapTargetColor = function () {
66912
66918
  return DThemeDarkConstants.HIGHLIGHT_COLOR;
66913
66919
  };
@@ -83814,7 +83820,8 @@ var DChartSelectionGridlineX = /** @class */ (function (_super) {
83814
83820
  var bounds = container.plotArea.getSelectionBoundsX();
83815
83821
  shape.transform.position.set(mappedX, bounds.y + bounds.height * 0.5);
83816
83822
  shape.size.set(0, bounds.height);
83817
- shape.visible = bounds.x <= mappedX && mappedX <= bounds.x + bounds.width;
83823
+ var hw = shape.stroke.width * 0.5;
83824
+ shape.visible = bounds.x <= mappedX + hw && mappedX - hw <= bounds.x + bounds.width;
83818
83825
  return true;
83819
83826
  }
83820
83827
  return false;
@@ -83841,7 +83848,8 @@ var DChartSelectionGridlineY = /** @class */ (function (_super) {
83841
83848
  var bounds = container.plotArea.getSelectionBoundsY();
83842
83849
  shape.transform.position.set(bounds.x + bounds.width * 0.5, mappedY);
83843
83850
  shape.size.set(bounds.width, 0);
83844
- shape.visible = bounds.y <= mappedY && mappedY <= bounds.y + bounds.height;
83851
+ var hw = shape.stroke.width * 0.5;
83852
+ shape.visible = bounds.y <= mappedY + hw && mappedY - hw <= bounds.y + bounds.height;
83845
83853
  return true;
83846
83854
  }
83847
83855
  return false;
@@ -87300,6 +87308,7 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87300
87308
  function DDiagramCanvasEditorSnap(parent, theme, options) {
87301
87309
  var _this = this;
87302
87310
  this._parent = parent;
87311
+ this._isDirty = true;
87303
87312
  // Controller
87304
87313
  var controller = options.controller;
87305
87314
  this._controller = controller;
@@ -87315,49 +87324,83 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87315
87324
  parent.addChildAt(container, parent.children.length - 1);
87316
87325
  // Grid
87317
87326
  this._grid = this.toGrid(theme, options.grid);
87327
+ this._gridScale = this.toGridScale(parent.scale.x);
87318
87328
  // Target
87319
87329
  this._target = this.toTarget(theme, options.target);
87320
87330
  }
87321
87331
  DDiagramCanvasEditorSnap.prototype.toGrid = function (theme, options) {
87322
- var _a;
87332
+ var _a, _b;
87333
+ if (options != null) {
87334
+ return {
87335
+ major: this.toGridMajor(theme, options.major),
87336
+ minor: this.toGridMinor(theme, options.minor),
87337
+ size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize(),
87338
+ adaptive: (_b = options.adaptive) !== null && _b !== void 0 ? _b : theme.isSnapGridAdaptive()
87339
+ };
87340
+ }
87323
87341
  return {
87324
- major: this.toGridMajor(theme, options === null || options === void 0 ? void 0 : options.major),
87325
- minor: this.toGridMinor(theme, options === null || options === void 0 ? void 0 : options.minor),
87326
- size: (_a = options === null || options === void 0 ? void 0 : options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
87342
+ major: this.toGridMajor(theme),
87343
+ minor: this.toGridMinor(theme),
87344
+ size: theme.getSnapGridSize(),
87345
+ adaptive: theme.isSnapGridAdaptive()
87327
87346
  };
87328
87347
  };
87329
87348
  DDiagramCanvasEditorSnap.prototype.toGridMajor = function (theme, options) {
87330
87349
  var _a, _b, _c, _d, _e;
87350
+ if (options != null) {
87351
+ return {
87352
+ interval: (_a = options.interval) !== null && _a !== void 0 ? _a : theme.getSnapGridMajorInterval(),
87353
+ color: (_b = options.color) !== null && _b !== void 0 ? _b : theme.getSnapGridMajorColor(),
87354
+ alpha: (_c = options.alpha) !== null && _c !== void 0 ? _c : theme.getSnapGridMajorAlpha(),
87355
+ width: (_d = options.width) !== null && _d !== void 0 ? _d : theme.getSnapGridMajorWidth(),
87356
+ style: (_e = options.style) !== null && _e !== void 0 ? _e : theme.getSnapGridMajorStyle()
87357
+ };
87358
+ }
87331
87359
  return {
87332
- interval: (_a = options === null || options === void 0 ? void 0 : options.interval) !== null && _a !== void 0 ? _a : theme.getSnapGridMajorInterval(),
87333
- color: (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : theme.getSnapGridMajorColor(),
87334
- alpha: (_c = options === null || options === void 0 ? void 0 : options.alpha) !== null && _c !== void 0 ? _c : theme.getSnapGridMajorAlpha(),
87335
- width: (_d = options === null || options === void 0 ? void 0 : options.width) !== null && _d !== void 0 ? _d : theme.getSnapGridMajorWidth(),
87336
- style: (_e = options === null || options === void 0 ? void 0 : options.style) !== null && _e !== void 0 ? _e : theme.getSnapGridMajorStyle()
87360
+ interval: theme.getSnapGridMajorInterval(),
87361
+ color: theme.getSnapGridMajorColor(),
87362
+ alpha: theme.getSnapGridMajorAlpha(),
87363
+ width: theme.getSnapGridMajorWidth(),
87364
+ style: theme.getSnapGridMajorStyle()
87337
87365
  };
87338
87366
  };
87339
87367
  DDiagramCanvasEditorSnap.prototype.toGridMinor = function (theme, options) {
87340
87368
  var _a, _b, _c, _d;
87369
+ if (options != null) {
87370
+ return {
87371
+ color: (_a = options.color) !== null && _a !== void 0 ? _a : theme.getSnapGridMinorColor(),
87372
+ alpha: (_b = options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapGridMinorAlpha(),
87373
+ width: (_c = options.width) !== null && _c !== void 0 ? _c : theme.getSnapGridMinorWidth(),
87374
+ style: (_d = options.style) !== null && _d !== void 0 ? _d : theme.getSnapGridMinorStyle()
87375
+ };
87376
+ }
87341
87377
  return {
87342
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapGridMinorColor(),
87343
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapGridMinorAlpha(),
87344
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapGridMinorWidth(),
87345
- style: (_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : theme.getSnapGridMinorStyle()
87378
+ color: theme.getSnapGridMinorColor(),
87379
+ alpha: theme.getSnapGridMinorAlpha(),
87380
+ width: theme.getSnapGridMinorWidth(),
87381
+ style: theme.getSnapGridMinorStyle()
87346
87382
  };
87347
87383
  };
87348
87384
  DDiagramCanvasEditorSnap.prototype.toTarget = function (theme, options) {
87349
87385
  var _a, _b, _c, _d;
87386
+ if (options != null) {
87387
+ return {
87388
+ color: (_a = options.color) !== null && _a !== void 0 ? _a : theme.getSnapTargetColor(),
87389
+ alpha: (_b = options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapTargetAlpha(),
87390
+ width: (_c = options.width) !== null && _c !== void 0 ? _c : theme.getSnapTargetWidth(),
87391
+ style: (_d = options.style) !== null && _d !== void 0 ? _d : theme.getSnapTargetStyle()
87392
+ };
87393
+ }
87350
87394
  return {
87351
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapTargetColor(),
87352
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapTargetAlpha(),
87353
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapTargetWidth(),
87354
- style: (_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : theme.getSnapTargetStyle()
87395
+ color: theme.getSnapTargetColor(),
87396
+ alpha: theme.getSnapTargetAlpha(),
87397
+ width: theme.getSnapTargetWidth(),
87398
+ style: theme.getSnapTargetStyle()
87355
87399
  };
87356
87400
  };
87357
87401
  DDiagramCanvasEditorSnap.prototype.onChange = function () {
87358
- var parent = this._parent;
87359
- parent.toDirty();
87360
- DApplications.update(parent);
87402
+ this._isDirty = true;
87403
+ DApplications.update(this._parent);
87361
87404
  };
87362
87405
  Object.defineProperty(DDiagramCanvasEditorSnap.prototype, "container", {
87363
87406
  get: function () {
@@ -87369,7 +87412,34 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87369
87412
  DDiagramCanvasEditorSnap.prototype.serialize = function () {
87370
87413
  return this._controller.serialize();
87371
87414
  };
87372
- DDiagramCanvasEditorSnap.prototype.onReflow = function () {
87415
+ DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
87416
+ this._isDirty = true;
87417
+ };
87418
+ DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
87419
+ var gridScale = this.toGridScale(newX);
87420
+ if (this._gridScale !== gridScale) {
87421
+ this._gridScale = gridScale;
87422
+ this._isDirty = true;
87423
+ }
87424
+ };
87425
+ DDiagramCanvasEditorSnap.prototype.toGridScale = function (sx) {
87426
+ if (!this._grid.adaptive || sx <= 0 || 1 <= sx) {
87427
+ return 1;
87428
+ }
87429
+ var target = 1 / sx;
87430
+ var result = 1;
87431
+ while (result < target && result < Number.MAX_SAFE_INTEGER) {
87432
+ result <<= 1;
87433
+ }
87434
+ return result;
87435
+ };
87436
+ DDiagramCanvasEditorSnap.prototype.onRender = function () {
87437
+ if (this._isDirty) {
87438
+ this._isDirty = false;
87439
+ this.updateAll();
87440
+ }
87441
+ };
87442
+ DDiagramCanvasEditorSnap.prototype.updateAll = function () {
87373
87443
  var parent = this._parent;
87374
87444
  var container = this._container;
87375
87445
  var controller = this._controller;
@@ -87390,7 +87460,7 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87390
87460
  var major = grid.major;
87391
87461
  var minor = grid.minor;
87392
87462
  var interval = major.interval;
87393
- var size = grid.size(controller.grid.size, w, h);
87463
+ var size = grid.size(controller.grid.size * this._gridScale, w, h);
87394
87464
  for (var x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {
87395
87465
  var style = ix % interval === 0 ? major : minor;
87396
87466
  this.update(container, shapes, index, x, hh, TOP, w, h, style);
@@ -87483,12 +87553,8 @@ var DDiagramCanvasEditor = /** @class */ (function (_super) {
87483
87553
  });
87484
87554
  Object.defineProperty(DDiagramCanvasEditor.prototype, "shape", {
87485
87555
  get: function () {
87486
- var result = this._shape;
87487
- if (result == null) {
87488
- result = this.newShape();
87489
- this._shape = result;
87490
- }
87491
- return result;
87556
+ var _a;
87557
+ return ((_a = this._shape) !== null && _a !== void 0 ? _a : (this._shape = this.newShape()));
87492
87558
  },
87493
87559
  enumerable: false,
87494
87560
  configurable: true
@@ -87527,10 +87593,26 @@ var DDiagramCanvasEditor = /** @class */ (function (_super) {
87527
87593
  thumbnail: thumbnail === null || thumbnail === void 0 ? void 0 : thumbnail.serialize()
87528
87594
  };
87529
87595
  };
87530
- DDiagramCanvasEditor.prototype.onReflow = function () {
87531
- var _a;
87532
- _super.prototype.onReflow.call(this);
87533
- (_a = this._snap) === null || _a === void 0 ? void 0 : _a.onReflow();
87596
+ DDiagramCanvasEditor.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
87597
+ var snap = this._snap;
87598
+ if (snap != null) {
87599
+ snap.onResize(newWidth, newHeight, oldWidth, oldHeight);
87600
+ }
87601
+ _super.prototype.onResize.call(this, newWidth, newHeight, oldWidth, oldHeight);
87602
+ };
87603
+ DDiagramCanvasEditor.prototype.onScale = function (newX, newY, oldX, oldY) {
87604
+ var snap = this._snap;
87605
+ if (snap != null) {
87606
+ snap.onScale(newX, newY, oldX, oldY);
87607
+ }
87608
+ _super.prototype.onScale.call(this, newX, newY, oldX, oldY);
87609
+ };
87610
+ DDiagramCanvasEditor.prototype.render = function (renderer) {
87611
+ var snap = this._snap;
87612
+ if (snap != null) {
87613
+ snap.onRender();
87614
+ }
87615
+ _super.prototype.render.call(this, renderer);
87534
87616
  };
87535
87617
  DDiagramCanvasEditor.prototype.getType = function () {
87536
87618
  return "DDiagramCanvasEditor";
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.431.0
2
+ Winter Cardinal UI v0.432.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -47849,7 +47849,7 @@
47849
47849
  this.size = serialized[2];
47850
47850
  }
47851
47851
  else {
47852
- this.visible = false;
47852
+ this.visible = this._isVisibleDefault;
47853
47853
  this.size = serialized[1];
47854
47854
  }
47855
47855
  };
@@ -62653,7 +62653,8 @@
62653
62653
  var bounds = container.plotArea.getSelectionBoundsX();
62654
62654
  shape.transform.position.set(mappedX, bounds.y + bounds.height * 0.5);
62655
62655
  shape.size.set(0, bounds.height);
62656
- shape.visible = bounds.x <= mappedX && mappedX <= bounds.x + bounds.width;
62656
+ var hw = shape.stroke.width * 0.5;
62657
+ shape.visible = bounds.x <= mappedX + hw && mappedX - hw <= bounds.x + bounds.width;
62657
62658
  return true;
62658
62659
  }
62659
62660
  return false;
@@ -62680,7 +62681,8 @@
62680
62681
  var bounds = container.plotArea.getSelectionBoundsY();
62681
62682
  shape.transform.position.set(bounds.x + bounds.width * 0.5, mappedY);
62682
62683
  shape.size.set(bounds.width, 0);
62683
- shape.visible = bounds.y <= mappedY && mappedY <= bounds.y + bounds.height;
62684
+ var hw = shape.stroke.width * 0.5;
62685
+ shape.visible = bounds.y <= mappedY + hw && mappedY - hw <= bounds.y + bounds.height;
62684
62686
  return true;
62685
62687
  }
62686
62688
  return false;
@@ -66139,6 +66141,7 @@
66139
66141
  function DDiagramCanvasEditorSnap(parent, theme, options) {
66140
66142
  var _this = this;
66141
66143
  this._parent = parent;
66144
+ this._isDirty = true;
66142
66145
  // Controller
66143
66146
  var controller = options.controller;
66144
66147
  this._controller = controller;
@@ -66154,49 +66157,83 @@
66154
66157
  parent.addChildAt(container, parent.children.length - 1);
66155
66158
  // Grid
66156
66159
  this._grid = this.toGrid(theme, options.grid);
66160
+ this._gridScale = this.toGridScale(parent.scale.x);
66157
66161
  // Target
66158
66162
  this._target = this.toTarget(theme, options.target);
66159
66163
  }
66160
66164
  DDiagramCanvasEditorSnap.prototype.toGrid = function (theme, options) {
66161
- var _a;
66165
+ var _a, _b;
66166
+ if (options != null) {
66167
+ return {
66168
+ major: this.toGridMajor(theme, options.major),
66169
+ minor: this.toGridMinor(theme, options.minor),
66170
+ size: (_a = options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize(),
66171
+ adaptive: (_b = options.adaptive) !== null && _b !== void 0 ? _b : theme.isSnapGridAdaptive()
66172
+ };
66173
+ }
66162
66174
  return {
66163
- major: this.toGridMajor(theme, options === null || options === void 0 ? void 0 : options.major),
66164
- minor: this.toGridMinor(theme, options === null || options === void 0 ? void 0 : options.minor),
66165
- size: (_a = options === null || options === void 0 ? void 0 : options.size) !== null && _a !== void 0 ? _a : theme.getSnapGridSize()
66175
+ major: this.toGridMajor(theme),
66176
+ minor: this.toGridMinor(theme),
66177
+ size: theme.getSnapGridSize(),
66178
+ adaptive: theme.isSnapGridAdaptive()
66166
66179
  };
66167
66180
  };
66168
66181
  DDiagramCanvasEditorSnap.prototype.toGridMajor = function (theme, options) {
66169
66182
  var _a, _b, _c, _d, _e;
66183
+ if (options != null) {
66184
+ return {
66185
+ interval: (_a = options.interval) !== null && _a !== void 0 ? _a : theme.getSnapGridMajorInterval(),
66186
+ color: (_b = options.color) !== null && _b !== void 0 ? _b : theme.getSnapGridMajorColor(),
66187
+ alpha: (_c = options.alpha) !== null && _c !== void 0 ? _c : theme.getSnapGridMajorAlpha(),
66188
+ width: (_d = options.width) !== null && _d !== void 0 ? _d : theme.getSnapGridMajorWidth(),
66189
+ style: (_e = options.style) !== null && _e !== void 0 ? _e : theme.getSnapGridMajorStyle()
66190
+ };
66191
+ }
66170
66192
  return {
66171
- interval: (_a = options === null || options === void 0 ? void 0 : options.interval) !== null && _a !== void 0 ? _a : theme.getSnapGridMajorInterval(),
66172
- color: (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : theme.getSnapGridMajorColor(),
66173
- alpha: (_c = options === null || options === void 0 ? void 0 : options.alpha) !== null && _c !== void 0 ? _c : theme.getSnapGridMajorAlpha(),
66174
- width: (_d = options === null || options === void 0 ? void 0 : options.width) !== null && _d !== void 0 ? _d : theme.getSnapGridMajorWidth(),
66175
- style: (_e = options === null || options === void 0 ? void 0 : options.style) !== null && _e !== void 0 ? _e : theme.getSnapGridMajorStyle()
66193
+ interval: theme.getSnapGridMajorInterval(),
66194
+ color: theme.getSnapGridMajorColor(),
66195
+ alpha: theme.getSnapGridMajorAlpha(),
66196
+ width: theme.getSnapGridMajorWidth(),
66197
+ style: theme.getSnapGridMajorStyle()
66176
66198
  };
66177
66199
  };
66178
66200
  DDiagramCanvasEditorSnap.prototype.toGridMinor = function (theme, options) {
66179
66201
  var _a, _b, _c, _d;
66202
+ if (options != null) {
66203
+ return {
66204
+ color: (_a = options.color) !== null && _a !== void 0 ? _a : theme.getSnapGridMinorColor(),
66205
+ alpha: (_b = options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapGridMinorAlpha(),
66206
+ width: (_c = options.width) !== null && _c !== void 0 ? _c : theme.getSnapGridMinorWidth(),
66207
+ style: (_d = options.style) !== null && _d !== void 0 ? _d : theme.getSnapGridMinorStyle()
66208
+ };
66209
+ }
66180
66210
  return {
66181
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapGridMinorColor(),
66182
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapGridMinorAlpha(),
66183
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapGridMinorWidth(),
66184
- style: (_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : theme.getSnapGridMinorStyle()
66211
+ color: theme.getSnapGridMinorColor(),
66212
+ alpha: theme.getSnapGridMinorAlpha(),
66213
+ width: theme.getSnapGridMinorWidth(),
66214
+ style: theme.getSnapGridMinorStyle()
66185
66215
  };
66186
66216
  };
66187
66217
  DDiagramCanvasEditorSnap.prototype.toTarget = function (theme, options) {
66188
66218
  var _a, _b, _c, _d;
66219
+ if (options != null) {
66220
+ return {
66221
+ color: (_a = options.color) !== null && _a !== void 0 ? _a : theme.getSnapTargetColor(),
66222
+ alpha: (_b = options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapTargetAlpha(),
66223
+ width: (_c = options.width) !== null && _c !== void 0 ? _c : theme.getSnapTargetWidth(),
66224
+ style: (_d = options.style) !== null && _d !== void 0 ? _d : theme.getSnapTargetStyle()
66225
+ };
66226
+ }
66189
66227
  return {
66190
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapTargetColor(),
66191
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapTargetAlpha(),
66192
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapTargetWidth(),
66193
- style: (_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : theme.getSnapTargetStyle()
66228
+ color: theme.getSnapTargetColor(),
66229
+ alpha: theme.getSnapTargetAlpha(),
66230
+ width: theme.getSnapTargetWidth(),
66231
+ style: theme.getSnapTargetStyle()
66194
66232
  };
66195
66233
  };
66196
66234
  DDiagramCanvasEditorSnap.prototype.onChange = function () {
66197
- var parent = this._parent;
66198
- parent.toDirty();
66199
- DApplications.update(parent);
66235
+ this._isDirty = true;
66236
+ DApplications.update(this._parent);
66200
66237
  };
66201
66238
  Object.defineProperty(DDiagramCanvasEditorSnap.prototype, "container", {
66202
66239
  get: function () {
@@ -66208,7 +66245,34 @@
66208
66245
  DDiagramCanvasEditorSnap.prototype.serialize = function () {
66209
66246
  return this._controller.serialize();
66210
66247
  };
66211
- DDiagramCanvasEditorSnap.prototype.onReflow = function () {
66248
+ DDiagramCanvasEditorSnap.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
66249
+ this._isDirty = true;
66250
+ };
66251
+ DDiagramCanvasEditorSnap.prototype.onScale = function (newX, newY, oldX, oldY) {
66252
+ var gridScale = this.toGridScale(newX);
66253
+ if (this._gridScale !== gridScale) {
66254
+ this._gridScale = gridScale;
66255
+ this._isDirty = true;
66256
+ }
66257
+ };
66258
+ DDiagramCanvasEditorSnap.prototype.toGridScale = function (sx) {
66259
+ if (!this._grid.adaptive || sx <= 0 || 1 <= sx) {
66260
+ return 1;
66261
+ }
66262
+ var target = 1 / sx;
66263
+ var result = 1;
66264
+ while (result < target && result < Number.MAX_SAFE_INTEGER) {
66265
+ result <<= 1;
66266
+ }
66267
+ return result;
66268
+ };
66269
+ DDiagramCanvasEditorSnap.prototype.onRender = function () {
66270
+ if (this._isDirty) {
66271
+ this._isDirty = false;
66272
+ this.updateAll();
66273
+ }
66274
+ };
66275
+ DDiagramCanvasEditorSnap.prototype.updateAll = function () {
66212
66276
  var parent = this._parent;
66213
66277
  var container = this._container;
66214
66278
  var controller = this._controller;
@@ -66229,7 +66293,7 @@
66229
66293
  var major = grid.major;
66230
66294
  var minor = grid.minor;
66231
66295
  var interval = major.interval;
66232
- var size = grid.size(controller.grid.size, w, h);
66296
+ var size = grid.size(controller.grid.size * this._gridScale, w, h);
66233
66297
  for (var x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {
66234
66298
  var style = ix % interval === 0 ? major : minor;
66235
66299
  this.update(container, shapes, index, x, hh, TOP, w, h, style);
@@ -66322,12 +66386,8 @@
66322
66386
  });
66323
66387
  Object.defineProperty(DDiagramCanvasEditor.prototype, "shape", {
66324
66388
  get: function () {
66325
- var result = this._shape;
66326
- if (result == null) {
66327
- result = this.newShape();
66328
- this._shape = result;
66329
- }
66330
- return result;
66389
+ var _a;
66390
+ return ((_a = this._shape) !== null && _a !== void 0 ? _a : (this._shape = this.newShape()));
66331
66391
  },
66332
66392
  enumerable: false,
66333
66393
  configurable: true
@@ -66366,10 +66426,26 @@
66366
66426
  thumbnail: thumbnail === null || thumbnail === void 0 ? void 0 : thumbnail.serialize()
66367
66427
  };
66368
66428
  };
66369
- DDiagramCanvasEditor.prototype.onReflow = function () {
66370
- var _a;
66371
- _super.prototype.onReflow.call(this);
66372
- (_a = this._snap) === null || _a === void 0 ? void 0 : _a.onReflow();
66429
+ DDiagramCanvasEditor.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
66430
+ var snap = this._snap;
66431
+ if (snap != null) {
66432
+ snap.onResize(newWidth, newHeight, oldWidth, oldHeight);
66433
+ }
66434
+ _super.prototype.onResize.call(this, newWidth, newHeight, oldWidth, oldHeight);
66435
+ };
66436
+ DDiagramCanvasEditor.prototype.onScale = function (newX, newY, oldX, oldY) {
66437
+ var snap = this._snap;
66438
+ if (snap != null) {
66439
+ snap.onScale(newX, newY, oldX, oldY);
66440
+ }
66441
+ _super.prototype.onScale.call(this, newX, newY, oldX, oldY);
66442
+ };
66443
+ DDiagramCanvasEditor.prototype.render = function (renderer) {
66444
+ var snap = this._snap;
66445
+ if (snap != null) {
66446
+ snap.onRender();
66447
+ }
66448
+ _super.prototype.render.call(this, renderer);
66373
66449
  };
66374
66450
  DDiagramCanvasEditor.prototype.getType = function () {
66375
66451
  return "DDiagramCanvasEditor";