@wcardinal/wcardinal-ui 0.430.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 (63) hide show
  1. package/dist/types/wcardinal/ui/d-chart-plot-area-twofold-sub-base.d.ts +2 -1
  2. package/dist/types/wcardinal/ui/d-chart-plot-area.d.ts +2 -1
  3. package/dist/types/wcardinal/ui/d-chart-selection-container-impl.d.ts +1 -1
  4. package/dist/types/wcardinal/ui/d-chart-selection-container.d.ts +1 -1
  5. package/dist/types/wcardinal/ui/d-chart-selection-shape-base.d.ts +2 -2
  6. package/dist/types/wcardinal/ui/d-chart-selection-shape.d.ts +1 -1
  7. package/dist/types/wcardinal/ui/d-chart-selection-simple.d.ts +9 -0
  8. package/dist/types/wcardinal/ui/d-chart-selection-sub-impl.d.ts +6 -1
  9. package/dist/types/wcardinal/ui/d-chart-selection-sub.d.ts +18 -1
  10. package/dist/types/wcardinal/ui/d-chart-selection.d.ts +1 -1
  11. package/dist/types/wcardinal/ui/d-diagram-canvas-editor-snap.d.ts +10 -1
  12. package/dist/types/wcardinal/ui/d-diagram-canvas-editor.d.ts +3 -1
  13. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.d.ts +1 -0
  14. package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.d.ts +1 -0
  15. package/dist/wcardinal/ui/d-chart-plot-area-twofold-sub-base.js +3 -0
  16. package/dist/wcardinal/ui/d-chart-plot-area-twofold-sub-base.js.map +1 -1
  17. package/dist/wcardinal/ui/d-chart-plot-area.js.map +1 -1
  18. package/dist/wcardinal/ui/d-chart-selection-container-impl.js.map +1 -1
  19. package/dist/wcardinal/ui/d-chart-selection-container.js.map +1 -1
  20. package/dist/wcardinal/ui/d-chart-selection-gridline-x.js +2 -1
  21. package/dist/wcardinal/ui/d-chart-selection-gridline-x.js.map +1 -1
  22. package/dist/wcardinal/ui/d-chart-selection-gridline-y.js +2 -1
  23. package/dist/wcardinal/ui/d-chart-selection-gridline-y.js.map +1 -1
  24. package/dist/wcardinal/ui/d-chart-selection-shape-base.js +1 -1
  25. package/dist/wcardinal/ui/d-chart-selection-shape-base.js.map +1 -1
  26. package/dist/wcardinal/ui/d-chart-selection-shape.js.map +1 -1
  27. package/dist/wcardinal/ui/d-chart-selection-simple.js +17 -4
  28. package/dist/wcardinal/ui/d-chart-selection-simple.js.map +1 -1
  29. package/dist/wcardinal/ui/d-chart-selection-sub-impl.js +160 -61
  30. package/dist/wcardinal/ui/d-chart-selection-sub-impl.js.map +1 -1
  31. package/dist/wcardinal/ui/d-chart-selection-sub.js.map +1 -1
  32. package/dist/wcardinal/ui/d-chart-selection.js.map +1 -1
  33. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js +84 -22
  34. package/dist/wcardinal/ui/d-diagram-canvas-editor-snap.js.map +1 -1
  35. package/dist/wcardinal/ui/d-diagram-canvas-editor.js +22 -10
  36. package/dist/wcardinal/ui/d-diagram-canvas-editor.js.map +1 -1
  37. package/dist/wcardinal/ui/snapper/e-snapper-grid.js +1 -1
  38. package/dist/wcardinal/ui/snapper/e-snapper-grid.js.map +1 -1
  39. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js +3 -0
  40. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-canvas-editor.js.map +1 -1
  41. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js +3 -0
  42. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-canvas-editor.js.map +1 -1
  43. package/dist/wcardinal-ui-theme-dark-en-us.js +4 -1
  44. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  45. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  46. package/dist/wcardinal-ui-theme-dark-ja-jp.js +4 -1
  47. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  48. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  49. package/dist/wcardinal-ui-theme-dark.js +4 -1
  50. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  51. package/dist/wcardinal-ui-theme-white-en-us.js +4 -1
  52. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  53. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  54. package/dist/wcardinal-ui-theme-white-ja-jp.js +4 -1
  55. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  56. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  57. package/dist/wcardinal-ui-theme-white.js +4 -1
  58. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  59. package/dist/wcardinal-ui.cjs.js +298 -101
  60. package/dist/wcardinal-ui.js +292 -101
  61. package/dist/wcardinal-ui.min.js +2 -2
  62. package/dist/wcardinal-ui.min.js.map +1 -1
  63. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.430.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
  };
@@ -83222,6 +83228,9 @@ var DChartPlotAreaTwofoldSubBase = /** @class */ (function () {
83222
83228
  DChartPlotAreaTwofoldSubBase.prototype.toBoundsDirty = function () {
83223
83229
  this._isContainerBoundsDirty = true;
83224
83230
  };
83231
+ DChartPlotAreaTwofoldSubBase.prototype.toLocal = function (position, from, result, skipUpdate) {
83232
+ return this._plotArea.toLocal(position, from, result, skipUpdate);
83233
+ };
83225
83234
  DChartPlotAreaTwofoldSubBase.prototype.destroy = function () {
83226
83235
  this._container.destroy();
83227
83236
  this._series.destroy();
@@ -83764,7 +83773,7 @@ var DChartSelectionShapeBase = /** @class */ (function () {
83764
83773
  DChartSelectionShapeBase.prototype.set = function (container, position, mappedPosition, series) {
83765
83774
  this.update(container, position, mappedPosition, series);
83766
83775
  var shape = this._shape;
83767
- if (shape) {
83776
+ if (shape != null) {
83768
83777
  this._style(shape, series);
83769
83778
  }
83770
83779
  };
@@ -83811,7 +83820,8 @@ var DChartSelectionGridlineX = /** @class */ (function (_super) {
83811
83820
  var bounds = container.plotArea.getSelectionBoundsX();
83812
83821
  shape.transform.position.set(mappedX, bounds.y + bounds.height * 0.5);
83813
83822
  shape.size.set(0, bounds.height);
83814
- 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;
83815
83825
  return true;
83816
83826
  }
83817
83827
  return false;
@@ -83838,7 +83848,8 @@ var DChartSelectionGridlineY = /** @class */ (function (_super) {
83838
83848
  var bounds = container.plotArea.getSelectionBoundsY();
83839
83849
  shape.transform.position.set(bounds.x + bounds.width * 0.5, mappedY);
83840
83850
  shape.size.set(bounds.width, 0);
83841
- 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;
83842
83853
  return true;
83843
83854
  }
83844
83855
  return false;
@@ -83901,18 +83912,25 @@ var DChartSelectionPoint = {
83901
83912
  var DChartSelectionSubImpl = /** @class */ (function (_super) {
83902
83913
  __extends(DChartSelectionSubImpl, _super);
83903
83914
  function DChartSelectionSubImpl(options) {
83904
- var _a, _b, _c, _d, _e;
83915
+ var _a, _b, _c;
83905
83916
  var _this = _super.call(this) || this;
83906
83917
  _this._container = null;
83907
83918
  _this._series = null;
83908
83919
  _this._isEnabled = (_a = options.enable) !== null && _a !== void 0 ? _a : true;
83909
- _this._gridline = new DChartSelectionContainerImpl(new DChartSelectionGridlineX((_b = options.gridline) === null || _b === void 0 ? void 0 : _b.x), new DChartSelectionGridlineY((_c = options.gridline) === null || _c === void 0 ? void 0 : _c.y));
83920
+ _this._isVisible = false;
83921
+ var gridline = options.gridline;
83922
+ if (gridline != null) {
83923
+ _this._gridline = new DChartSelectionContainerImpl(new DChartSelectionGridlineX(gridline.x), new DChartSelectionGridlineY(gridline.y));
83924
+ }
83925
+ else {
83926
+ _this._gridline = new DChartSelectionContainerImpl(new DChartSelectionGridlineX(), new DChartSelectionGridlineY());
83927
+ }
83910
83928
  _this._marker = new DChartSelectionMarker(options.marker);
83911
- _this._state = (_d = options.state) !== null && _d !== void 0 ? _d : DBaseState.HOVERED;
83929
+ _this._state = (_b = options.state) !== null && _b !== void 0 ? _b : DBaseState.HOVERED;
83912
83930
  _this._coordinateX = null;
83913
83931
  _this._coordinateY = null;
83914
83932
  _this._position = new pixi_js.Point();
83915
- _this._point = (_e = options.point) !== null && _e !== void 0 ? _e : DChartSelectionPoint.CLOSER;
83933
+ _this._point = (_c = options.point) !== null && _c !== void 0 ? _c : DChartSelectionPoint.CLOSER;
83916
83934
  _this._work = new pixi_js.Point();
83917
83935
  // Events
83918
83936
  var on = options.on;
@@ -83940,6 +83958,13 @@ var DChartSelectionSubImpl = /** @class */ (function (_super) {
83940
83958
  this._coordinateX = null;
83941
83959
  this._coordinateY = null;
83942
83960
  };
83961
+ Object.defineProperty(DChartSelectionSubImpl.prototype, "visible", {
83962
+ get: function () {
83963
+ return this._isVisible;
83964
+ },
83965
+ enumerable: false,
83966
+ configurable: true
83967
+ });
83943
83968
  Object.defineProperty(DChartSelectionSubImpl.prototype, "series", {
83944
83969
  get: function () {
83945
83970
  return this._series;
@@ -83969,49 +83994,116 @@ var DChartSelectionSubImpl = /** @class */ (function (_super) {
83969
83994
  configurable: true
83970
83995
  });
83971
83996
  DChartSelectionSubImpl.prototype.set = function (series, result) {
83997
+ if (isNumber(series)) {
83998
+ this.set1(series, result);
83999
+ }
84000
+ else {
84001
+ this.set2(series, result);
84002
+ }
84003
+ };
84004
+ DChartSelectionSubImpl.prototype.set1 = function (x, y) {
83972
84005
  var container = this._container;
83973
- var coordinateX = (this._coordinateX = series.coordinate.x);
83974
- var coordinateY = (this._coordinateY = series.coordinate.y);
83975
- if (container && coordinateX && coordinateY) {
83976
- var transform = container.plotArea.container.localTransform;
83977
- var position = this._position;
83978
- var work = this._work;
83979
- if (result instanceof DChartSeriesHitResult) {
83980
- var x = result.x;
83981
- var y = result.y;
83982
- switch (this._point) {
83983
- case DChartSelectionPoint.PREVIOUS:
83984
- x = result.p0x;
83985
- y = result.p0y;
83986
- break;
83987
- case DChartSelectionPoint.NEXT:
83988
- x = result.p1x;
83989
- y = result.p1y;
83990
- break;
83991
- case DChartSelectionPoint.CLOSER:
83992
- if (Math.abs(result.p0x - result.x) < Math.abs(result.p1x - result.x)) {
83993
- x = result.p0x;
83994
- y = result.p0y;
83995
- }
83996
- else {
83997
- x = result.p1x;
83998
- y = result.p1y;
83999
- }
84000
- }
84001
- work.set(x, y);
84002
- transform.apply(work, work);
84003
- position.set(coordinateX.unmap(coordinateX.transform.unmap(x)), coordinateY.unmap(coordinateY.transform.unmap(y)));
84004
- }
84005
- else {
84006
- position.copyFrom(result.position);
84007
- work.set(coordinateX.transform.map(coordinateX.map(position.x)), coordinateY.transform.map(coordinateY.map(position.y)));
84008
- transform.apply(work, work);
84006
+ if (container == null) {
84007
+ return;
84008
+ }
84009
+ var work = this._work;
84010
+ work.set(x, y);
84011
+ var plotArea = container.plotArea;
84012
+ plotArea.container.toLocal(work, undefined, work, true);
84013
+ var coordinate = plotArea.coordinate;
84014
+ var coordinateX = coordinate.x.get(0);
84015
+ var coordinateY = coordinate.y.get(0);
84016
+ var newPositionX = work.x;
84017
+ var newPositionY = work.y;
84018
+ if (coordinateX && coordinateY) {
84019
+ newPositionX = coordinateX.unmap(coordinateX.transform.unmap(newPositionX));
84020
+ newPositionY = coordinateY.unmap(coordinateY.transform.unmap(newPositionY));
84021
+ }
84022
+ else {
84023
+ coordinateX = null;
84024
+ coordinateY = null;
84025
+ }
84026
+ var oldSeries = this._series;
84027
+ var position = this._position;
84028
+ if (this._isVisible &&
84029
+ oldSeries == null &&
84030
+ newPositionX === position.x &&
84031
+ newPositionY === position.y) {
84032
+ return;
84033
+ }
84034
+ this._isVisible = true;
84035
+ position.set(newPositionX, newPositionY);
84036
+ this._coordinateX = coordinateX;
84037
+ this._coordinateY = coordinateY;
84038
+ plotArea.container.localTransform.apply(work, work);
84039
+ this._gridline.set(container, position, work, null);
84040
+ this._marker.set(container, position, work, null);
84041
+ if (oldSeries != null) {
84042
+ var state = this._state;
84043
+ if (oldSeries) {
84044
+ oldSeries.state.remove(state);
84009
84045
  }
84010
- this._gridline.set(container, position, work, series);
84011
- this._marker.set(container, position, work, series);
84012
- DApplications.update(container.plotArea);
84046
+ this._series = null;
84047
+ }
84048
+ this.emit("change", this);
84049
+ DApplications.update(plotArea);
84050
+ };
84051
+ DChartSelectionSubImpl.prototype.set2 = function (series, result) {
84052
+ var container = this._container;
84053
+ if (container == null) {
84054
+ return;
84055
+ }
84056
+ var work = this._work;
84057
+ var x = result.x;
84058
+ var y = result.y;
84059
+ switch (this._point) {
84060
+ case DChartSelectionPoint.PREVIOUS:
84061
+ x = result.p0x;
84062
+ y = result.p0y;
84063
+ break;
84064
+ case DChartSelectionPoint.NEXT:
84065
+ x = result.p1x;
84066
+ y = result.p1y;
84067
+ break;
84068
+ case DChartSelectionPoint.CLOSER:
84069
+ if (Math.abs(result.p0x - result.x) < Math.abs(result.p1x - result.x)) {
84070
+ x = result.p0x;
84071
+ y = result.p0y;
84072
+ }
84073
+ else {
84074
+ x = result.p1x;
84075
+ y = result.p1y;
84076
+ }
84077
+ }
84078
+ work.set(x, y);
84079
+ var plotArea = container.plotArea;
84080
+ plotArea.container.localTransform.apply(work, work);
84081
+ var coordinateX = series.coordinate.x;
84082
+ var coordinateY = series.coordinate.y;
84083
+ var newPositionX = x;
84084
+ var newPositionY = y;
84085
+ if (coordinateX && coordinateY) {
84086
+ newPositionX = coordinateX.unmap(coordinateX.transform.unmap(newPositionX));
84087
+ newPositionY = coordinateY.unmap(coordinateY.transform.unmap(newPositionY));
84088
+ }
84089
+ else {
84090
+ coordinateX = null;
84091
+ coordinateY = null;
84013
84092
  }
84014
84093
  var oldSeries = this._series;
84094
+ var position = this._position;
84095
+ if (this._isVisible &&
84096
+ oldSeries === series &&
84097
+ newPositionX === position.x &&
84098
+ newPositionY === position.y) {
84099
+ return;
84100
+ }
84101
+ this._isVisible = true;
84102
+ position.set(newPositionX, newPositionY);
84103
+ this._coordinateX = coordinateX;
84104
+ this._coordinateY = coordinateY;
84105
+ this._gridline.set(container, position, work, series);
84106
+ this._marker.set(container, position, work, series);
84015
84107
  if (oldSeries !== series) {
84016
84108
  var state = this._state;
84017
84109
  if (oldSeries) {
@@ -84021,34 +84113,52 @@ var DChartSelectionSubImpl = /** @class */ (function (_super) {
84021
84113
  series.state.add(state);
84022
84114
  }
84023
84115
  this.emit("change", this);
84116
+ DApplications.update(plotArea);
84024
84117
  };
84025
84118
  DChartSelectionSubImpl.prototype.unset = function () {
84026
- var series = this._series;
84027
- if (series) {
84119
+ var container = this._container;
84120
+ if (container == null) {
84121
+ return;
84122
+ }
84123
+ var oldSeries = this._series;
84124
+ if (!this._isVisible && oldSeries == null) {
84125
+ return;
84126
+ }
84127
+ this._isVisible = false;
84128
+ this._coordinateX = null;
84129
+ this._coordinateY = null;
84130
+ this._gridline.unset();
84131
+ this._marker.unset();
84132
+ if (oldSeries != null) {
84028
84133
  this._series = null;
84029
- this._coordinateX = null;
84030
- this._coordinateY = null;
84031
- series.state.remove(this._state);
84032
- this._gridline.unset();
84033
- this._marker.unset();
84034
- this.emit("change", this);
84134
+ oldSeries.state.remove(this._state);
84035
84135
  }
84136
+ this.emit("change", this);
84137
+ DApplications.update(container.plotArea);
84036
84138
  };
84037
84139
  DChartSelectionSubImpl.prototype.update = function () {
84038
84140
  var container = this._container;
84141
+ if (container == null) {
84142
+ return false;
84143
+ }
84144
+ if (!this._isVisible) {
84145
+ return false;
84146
+ }
84147
+ var position = this._position;
84148
+ var work = this._work;
84039
84149
  var coordinateX = this._coordinateX;
84040
84150
  var coordinateY = this._coordinateY;
84041
- if (container && coordinateX && coordinateY) {
84042
- var position = this._position;
84043
- var work = this._work;
84151
+ if (coordinateX && coordinateY) {
84044
84152
  work.set(coordinateX.transform.map(coordinateX.map(position.x)), coordinateY.transform.map(coordinateY.map(position.y)));
84045
- container.plotArea.container.localTransform.apply(work, work);
84046
- var series = this._series;
84047
- var isGridlineUpdated = this._gridline.update(container, position, work, series);
84048
- var isMarkerUpdated = this._marker.update(container, position, work, series);
84049
- return isGridlineUpdated || isMarkerUpdated;
84050
84153
  }
84051
- return false;
84154
+ else {
84155
+ work.copyFrom(position);
84156
+ }
84157
+ container.plotArea.container.localTransform.apply(work, work);
84158
+ var series = this._series;
84159
+ var isGridlineUpdated = this._gridline.update(container, position, work, series);
84160
+ var isMarkerUpdated = this._marker.update(container, position, work, series);
84161
+ return isGridlineUpdated || isMarkerUpdated;
84052
84162
  };
84053
84163
  return DChartSelectionSubImpl;
84054
84164
  }(pixi_js.utils.EventEmitter));
@@ -84096,14 +84206,16 @@ var DChartSelectionSimple = /** @class */ (function (_super) {
84096
84206
  return {
84097
84207
  enable: (_a = dismiss.enable) !== null && _a !== void 0 ? _a : true,
84098
84208
  tap: this.toDismissTap(dismiss.tap),
84099
- longPress: this.toDismissLongPress(dismiss.longPress)
84209
+ longPress: this.toDismissLongPress(dismiss.longPress),
84210
+ noSeries: this.toDismissNoSeries(dismiss.noSeries)
84100
84211
  };
84101
84212
  }
84102
84213
  }
84103
84214
  return {
84104
84215
  enable: true,
84105
84216
  tap: this.toDismissTap(),
84106
- longPress: this.toDismissLongPress()
84217
+ longPress: this.toDismissLongPress(),
84218
+ noSeries: this.toDismissNoSeries()
84107
84219
  };
84108
84220
  };
84109
84221
  DChartSelectionSimple.prototype.toDismissTap = function (options) {
@@ -84119,6 +84231,12 @@ var DChartSelectionSimple = /** @class */ (function (_super) {
84119
84231
  enable: (_a = options === null || options === void 0 ? void 0 : options.enable) !== null && _a !== void 0 ? _a : true
84120
84232
  };
84121
84233
  };
84234
+ DChartSelectionSimple.prototype.toDismissNoSeries = function (options) {
84235
+ var _a;
84236
+ return {
84237
+ enable: (_a = options === null || options === void 0 ? void 0 : options.enable) !== null && _a !== void 0 ? _a : true
84238
+ };
84239
+ };
84122
84240
  DChartSelectionSimple.prototype.newSelected = function (point, options) {
84123
84241
  return new DChartSelectionSubImpl(this.toSelectedOptions(point, options));
84124
84242
  };
@@ -84184,7 +84302,12 @@ var DChartSelectionSimple = /** @class */ (function (_super) {
84184
84302
  selected.set(series, result);
84185
84303
  }
84186
84304
  else {
84187
- selected.unset();
84305
+ if (dismiss.enable && dismiss.noSeries.enable) {
84306
+ selected.unset();
84307
+ }
84308
+ else {
84309
+ selected.set(global_1.x, global_1.y);
84310
+ }
84188
84311
  }
84189
84312
  }
84190
84313
  };
@@ -84212,7 +84335,7 @@ var DChartSelectionSimple = /** @class */ (function (_super) {
84212
84335
  var result = DChartSelectionSimple.WORK_SELECT;
84213
84336
  var global_2 = e.data.global;
84214
84337
  var series = container.calcHitPoint(global_2.x, global_2.y, result);
84215
- if (series) {
84338
+ if (series != null) {
84216
84339
  hovered.set(series, result);
84217
84340
  }
84218
84341
  else {
@@ -87185,6 +87308,7 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87185
87308
  function DDiagramCanvasEditorSnap(parent, theme, options) {
87186
87309
  var _this = this;
87187
87310
  this._parent = parent;
87311
+ this._isDirty = true;
87188
87312
  // Controller
87189
87313
  var controller = options.controller;
87190
87314
  this._controller = controller;
@@ -87200,49 +87324,83 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87200
87324
  parent.addChildAt(container, parent.children.length - 1);
87201
87325
  // Grid
87202
87326
  this._grid = this.toGrid(theme, options.grid);
87327
+ this._gridScale = this.toGridScale(parent.scale.x);
87203
87328
  // Target
87204
87329
  this._target = this.toTarget(theme, options.target);
87205
87330
  }
87206
87331
  DDiagramCanvasEditorSnap.prototype.toGrid = function (theme, options) {
87207
- 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
+ }
87208
87341
  return {
87209
- major: this.toGridMajor(theme, options === null || options === void 0 ? void 0 : options.major),
87210
- minor: this.toGridMinor(theme, options === null || options === void 0 ? void 0 : options.minor),
87211
- 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()
87212
87346
  };
87213
87347
  };
87214
87348
  DDiagramCanvasEditorSnap.prototype.toGridMajor = function (theme, options) {
87215
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
+ }
87216
87359
  return {
87217
- interval: (_a = options === null || options === void 0 ? void 0 : options.interval) !== null && _a !== void 0 ? _a : theme.getSnapGridMajorInterval(),
87218
- color: (_b = options === null || options === void 0 ? void 0 : options.color) !== null && _b !== void 0 ? _b : theme.getSnapGridMajorColor(),
87219
- alpha: (_c = options === null || options === void 0 ? void 0 : options.alpha) !== null && _c !== void 0 ? _c : theme.getSnapGridMajorAlpha(),
87220
- width: (_d = options === null || options === void 0 ? void 0 : options.width) !== null && _d !== void 0 ? _d : theme.getSnapGridMajorWidth(),
87221
- 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()
87222
87365
  };
87223
87366
  };
87224
87367
  DDiagramCanvasEditorSnap.prototype.toGridMinor = function (theme, options) {
87225
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
+ }
87226
87377
  return {
87227
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapGridMinorColor(),
87228
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapGridMinorAlpha(),
87229
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapGridMinorWidth(),
87230
- 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()
87231
87382
  };
87232
87383
  };
87233
87384
  DDiagramCanvasEditorSnap.prototype.toTarget = function (theme, options) {
87234
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
+ }
87235
87394
  return {
87236
- color: (_a = options === null || options === void 0 ? void 0 : options.color) !== null && _a !== void 0 ? _a : theme.getSnapTargetColor(),
87237
- alpha: (_b = options === null || options === void 0 ? void 0 : options.alpha) !== null && _b !== void 0 ? _b : theme.getSnapTargetAlpha(),
87238
- width: (_c = options === null || options === void 0 ? void 0 : options.width) !== null && _c !== void 0 ? _c : theme.getSnapTargetWidth(),
87239
- 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()
87240
87399
  };
87241
87400
  };
87242
87401
  DDiagramCanvasEditorSnap.prototype.onChange = function () {
87243
- var parent = this._parent;
87244
- parent.toDirty();
87245
- DApplications.update(parent);
87402
+ this._isDirty = true;
87403
+ DApplications.update(this._parent);
87246
87404
  };
87247
87405
  Object.defineProperty(DDiagramCanvasEditorSnap.prototype, "container", {
87248
87406
  get: function () {
@@ -87254,7 +87412,34 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87254
87412
  DDiagramCanvasEditorSnap.prototype.serialize = function () {
87255
87413
  return this._controller.serialize();
87256
87414
  };
87257
- 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 () {
87258
87443
  var parent = this._parent;
87259
87444
  var container = this._container;
87260
87445
  var controller = this._controller;
@@ -87275,7 +87460,7 @@ var DDiagramCanvasEditorSnap = /** @class */ (function () {
87275
87460
  var major = grid.major;
87276
87461
  var minor = grid.minor;
87277
87462
  var interval = major.interval;
87278
- var size = grid.size(controller.grid.size, w, h);
87463
+ var size = grid.size(controller.grid.size * this._gridScale, w, h);
87279
87464
  for (var x = size, ix = 1; x < w; x += size, ix += 1, index += 1) {
87280
87465
  var style = ix % interval === 0 ? major : minor;
87281
87466
  this.update(container, shapes, index, x, hh, TOP, w, h, style);
@@ -87368,12 +87553,8 @@ var DDiagramCanvasEditor = /** @class */ (function (_super) {
87368
87553
  });
87369
87554
  Object.defineProperty(DDiagramCanvasEditor.prototype, "shape", {
87370
87555
  get: function () {
87371
- var result = this._shape;
87372
- if (result == null) {
87373
- result = this.newShape();
87374
- this._shape = result;
87375
- }
87376
- return result;
87556
+ var _a;
87557
+ return ((_a = this._shape) !== null && _a !== void 0 ? _a : (this._shape = this.newShape()));
87377
87558
  },
87378
87559
  enumerable: false,
87379
87560
  configurable: true
@@ -87412,10 +87593,26 @@ var DDiagramCanvasEditor = /** @class */ (function (_super) {
87412
87593
  thumbnail: thumbnail === null || thumbnail === void 0 ? void 0 : thumbnail.serialize()
87413
87594
  };
87414
87595
  };
87415
- DDiagramCanvasEditor.prototype.onReflow = function () {
87416
- var _a;
87417
- _super.prototype.onReflow.call(this);
87418
- (_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);
87419
87616
  };
87420
87617
  DDiagramCanvasEditor.prototype.getType = function () {
87421
87618
  return "DDiagramCanvasEditor";