@wcardinal/wcardinal-ui 0.430.0 → 0.431.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 (41) 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/wcardinal/ui/d-chart-plot-area-twofold-sub-base.js +3 -0
  12. package/dist/wcardinal/ui/d-chart-plot-area-twofold-sub-base.js.map +1 -1
  13. package/dist/wcardinal/ui/d-chart-plot-area.js.map +1 -1
  14. package/dist/wcardinal/ui/d-chart-selection-container-impl.js.map +1 -1
  15. package/dist/wcardinal/ui/d-chart-selection-container.js.map +1 -1
  16. package/dist/wcardinal/ui/d-chart-selection-shape-base.js +1 -1
  17. package/dist/wcardinal/ui/d-chart-selection-shape-base.js.map +1 -1
  18. package/dist/wcardinal/ui/d-chart-selection-shape.js.map +1 -1
  19. package/dist/wcardinal/ui/d-chart-selection-simple.js +17 -4
  20. package/dist/wcardinal/ui/d-chart-selection-simple.js.map +1 -1
  21. package/dist/wcardinal/ui/d-chart-selection-sub-impl.js +160 -61
  22. package/dist/wcardinal/ui/d-chart-selection-sub-impl.js.map +1 -1
  23. package/dist/wcardinal/ui/d-chart-selection-sub.js.map +1 -1
  24. package/dist/wcardinal/ui/d-chart-selection.js.map +1 -1
  25. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  26. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  27. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  28. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  29. package/dist/wcardinal-ui-theme-dark.js +1 -1
  30. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  31. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  32. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  33. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  34. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  35. package/dist/wcardinal-ui-theme-white.js +1 -1
  36. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  37. package/dist/wcardinal-ui.cjs.js +181 -66
  38. package/dist/wcardinal-ui.js +181 -66
  39. package/dist/wcardinal-ui.min.js +2 -2
  40. package/dist/wcardinal-ui.min.js.map +1 -1
  41. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.430.0
2
+ Winter Cardinal UI v0.431.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -62061,6 +62061,9 @@
62061
62061
  DChartPlotAreaTwofoldSubBase.prototype.toBoundsDirty = function () {
62062
62062
  this._isContainerBoundsDirty = true;
62063
62063
  };
62064
+ DChartPlotAreaTwofoldSubBase.prototype.toLocal = function (position, from, result, skipUpdate) {
62065
+ return this._plotArea.toLocal(position, from, result, skipUpdate);
62066
+ };
62064
62067
  DChartPlotAreaTwofoldSubBase.prototype.destroy = function () {
62065
62068
  this._container.destroy();
62066
62069
  this._series.destroy();
@@ -62603,7 +62606,7 @@
62603
62606
  DChartSelectionShapeBase.prototype.set = function (container, position, mappedPosition, series) {
62604
62607
  this.update(container, position, mappedPosition, series);
62605
62608
  var shape = this._shape;
62606
- if (shape) {
62609
+ if (shape != null) {
62607
62610
  this._style(shape, series);
62608
62611
  }
62609
62612
  };
@@ -62740,18 +62743,25 @@
62740
62743
  var DChartSelectionSubImpl = /** @class */ (function (_super) {
62741
62744
  __extends(DChartSelectionSubImpl, _super);
62742
62745
  function DChartSelectionSubImpl(options) {
62743
- var _a, _b, _c, _d, _e;
62746
+ var _a, _b, _c;
62744
62747
  var _this = _super.call(this) || this;
62745
62748
  _this._container = null;
62746
62749
  _this._series = null;
62747
62750
  _this._isEnabled = (_a = options.enable) !== null && _a !== void 0 ? _a : true;
62748
- _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));
62751
+ _this._isVisible = false;
62752
+ var gridline = options.gridline;
62753
+ if (gridline != null) {
62754
+ _this._gridline = new DChartSelectionContainerImpl(new DChartSelectionGridlineX(gridline.x), new DChartSelectionGridlineY(gridline.y));
62755
+ }
62756
+ else {
62757
+ _this._gridline = new DChartSelectionContainerImpl(new DChartSelectionGridlineX(), new DChartSelectionGridlineY());
62758
+ }
62749
62759
  _this._marker = new DChartSelectionMarker(options.marker);
62750
- _this._state = (_d = options.state) !== null && _d !== void 0 ? _d : DBaseState.HOVERED;
62760
+ _this._state = (_b = options.state) !== null && _b !== void 0 ? _b : DBaseState.HOVERED;
62751
62761
  _this._coordinateX = null;
62752
62762
  _this._coordinateY = null;
62753
62763
  _this._position = new pixi_js.Point();
62754
- _this._point = (_e = options.point) !== null && _e !== void 0 ? _e : DChartSelectionPoint.CLOSER;
62764
+ _this._point = (_c = options.point) !== null && _c !== void 0 ? _c : DChartSelectionPoint.CLOSER;
62755
62765
  _this._work = new pixi_js.Point();
62756
62766
  // Events
62757
62767
  var on = options.on;
@@ -62779,6 +62789,13 @@
62779
62789
  this._coordinateX = null;
62780
62790
  this._coordinateY = null;
62781
62791
  };
62792
+ Object.defineProperty(DChartSelectionSubImpl.prototype, "visible", {
62793
+ get: function () {
62794
+ return this._isVisible;
62795
+ },
62796
+ enumerable: false,
62797
+ configurable: true
62798
+ });
62782
62799
  Object.defineProperty(DChartSelectionSubImpl.prototype, "series", {
62783
62800
  get: function () {
62784
62801
  return this._series;
@@ -62808,49 +62825,116 @@
62808
62825
  configurable: true
62809
62826
  });
62810
62827
  DChartSelectionSubImpl.prototype.set = function (series, result) {
62828
+ if (isNumber(series)) {
62829
+ this.set1(series, result);
62830
+ }
62831
+ else {
62832
+ this.set2(series, result);
62833
+ }
62834
+ };
62835
+ DChartSelectionSubImpl.prototype.set1 = function (x, y) {
62811
62836
  var container = this._container;
62812
- var coordinateX = (this._coordinateX = series.coordinate.x);
62813
- var coordinateY = (this._coordinateY = series.coordinate.y);
62814
- if (container && coordinateX && coordinateY) {
62815
- var transform = container.plotArea.container.localTransform;
62816
- var position = this._position;
62817
- var work = this._work;
62818
- if (result instanceof DChartSeriesHitResult) {
62819
- var x = result.x;
62820
- var y = result.y;
62821
- switch (this._point) {
62822
- case DChartSelectionPoint.PREVIOUS:
62823
- x = result.p0x;
62824
- y = result.p0y;
62825
- break;
62826
- case DChartSelectionPoint.NEXT:
62827
- x = result.p1x;
62828
- y = result.p1y;
62829
- break;
62830
- case DChartSelectionPoint.CLOSER:
62831
- if (Math.abs(result.p0x - result.x) < Math.abs(result.p1x - result.x)) {
62832
- x = result.p0x;
62833
- y = result.p0y;
62834
- }
62835
- else {
62836
- x = result.p1x;
62837
- y = result.p1y;
62838
- }
62839
- }
62840
- work.set(x, y);
62841
- transform.apply(work, work);
62842
- position.set(coordinateX.unmap(coordinateX.transform.unmap(x)), coordinateY.unmap(coordinateY.transform.unmap(y)));
62843
- }
62844
- else {
62845
- position.copyFrom(result.position);
62846
- work.set(coordinateX.transform.map(coordinateX.map(position.x)), coordinateY.transform.map(coordinateY.map(position.y)));
62847
- transform.apply(work, work);
62837
+ if (container == null) {
62838
+ return;
62839
+ }
62840
+ var work = this._work;
62841
+ work.set(x, y);
62842
+ var plotArea = container.plotArea;
62843
+ plotArea.container.toLocal(work, undefined, work, true);
62844
+ var coordinate = plotArea.coordinate;
62845
+ var coordinateX = coordinate.x.get(0);
62846
+ var coordinateY = coordinate.y.get(0);
62847
+ var newPositionX = work.x;
62848
+ var newPositionY = work.y;
62849
+ if (coordinateX && coordinateY) {
62850
+ newPositionX = coordinateX.unmap(coordinateX.transform.unmap(newPositionX));
62851
+ newPositionY = coordinateY.unmap(coordinateY.transform.unmap(newPositionY));
62852
+ }
62853
+ else {
62854
+ coordinateX = null;
62855
+ coordinateY = null;
62856
+ }
62857
+ var oldSeries = this._series;
62858
+ var position = this._position;
62859
+ if (this._isVisible &&
62860
+ oldSeries == null &&
62861
+ newPositionX === position.x &&
62862
+ newPositionY === position.y) {
62863
+ return;
62864
+ }
62865
+ this._isVisible = true;
62866
+ position.set(newPositionX, newPositionY);
62867
+ this._coordinateX = coordinateX;
62868
+ this._coordinateY = coordinateY;
62869
+ plotArea.container.localTransform.apply(work, work);
62870
+ this._gridline.set(container, position, work, null);
62871
+ this._marker.set(container, position, work, null);
62872
+ if (oldSeries != null) {
62873
+ var state = this._state;
62874
+ if (oldSeries) {
62875
+ oldSeries.state.remove(state);
62848
62876
  }
62849
- this._gridline.set(container, position, work, series);
62850
- this._marker.set(container, position, work, series);
62851
- DApplications.update(container.plotArea);
62877
+ this._series = null;
62878
+ }
62879
+ this.emit("change", this);
62880
+ DApplications.update(plotArea);
62881
+ };
62882
+ DChartSelectionSubImpl.prototype.set2 = function (series, result) {
62883
+ var container = this._container;
62884
+ if (container == null) {
62885
+ return;
62886
+ }
62887
+ var work = this._work;
62888
+ var x = result.x;
62889
+ var y = result.y;
62890
+ switch (this._point) {
62891
+ case DChartSelectionPoint.PREVIOUS:
62892
+ x = result.p0x;
62893
+ y = result.p0y;
62894
+ break;
62895
+ case DChartSelectionPoint.NEXT:
62896
+ x = result.p1x;
62897
+ y = result.p1y;
62898
+ break;
62899
+ case DChartSelectionPoint.CLOSER:
62900
+ if (Math.abs(result.p0x - result.x) < Math.abs(result.p1x - result.x)) {
62901
+ x = result.p0x;
62902
+ y = result.p0y;
62903
+ }
62904
+ else {
62905
+ x = result.p1x;
62906
+ y = result.p1y;
62907
+ }
62908
+ }
62909
+ work.set(x, y);
62910
+ var plotArea = container.plotArea;
62911
+ plotArea.container.localTransform.apply(work, work);
62912
+ var coordinateX = series.coordinate.x;
62913
+ var coordinateY = series.coordinate.y;
62914
+ var newPositionX = x;
62915
+ var newPositionY = y;
62916
+ if (coordinateX && coordinateY) {
62917
+ newPositionX = coordinateX.unmap(coordinateX.transform.unmap(newPositionX));
62918
+ newPositionY = coordinateY.unmap(coordinateY.transform.unmap(newPositionY));
62919
+ }
62920
+ else {
62921
+ coordinateX = null;
62922
+ coordinateY = null;
62852
62923
  }
62853
62924
  var oldSeries = this._series;
62925
+ var position = this._position;
62926
+ if (this._isVisible &&
62927
+ oldSeries === series &&
62928
+ newPositionX === position.x &&
62929
+ newPositionY === position.y) {
62930
+ return;
62931
+ }
62932
+ this._isVisible = true;
62933
+ position.set(newPositionX, newPositionY);
62934
+ this._coordinateX = coordinateX;
62935
+ this._coordinateY = coordinateY;
62936
+ this._gridline.set(container, position, work, series);
62937
+ this._marker.set(container, position, work, series);
62854
62938
  if (oldSeries !== series) {
62855
62939
  var state = this._state;
62856
62940
  if (oldSeries) {
@@ -62860,34 +62944,52 @@
62860
62944
  series.state.add(state);
62861
62945
  }
62862
62946
  this.emit("change", this);
62947
+ DApplications.update(plotArea);
62863
62948
  };
62864
62949
  DChartSelectionSubImpl.prototype.unset = function () {
62865
- var series = this._series;
62866
- if (series) {
62950
+ var container = this._container;
62951
+ if (container == null) {
62952
+ return;
62953
+ }
62954
+ var oldSeries = this._series;
62955
+ if (!this._isVisible && oldSeries == null) {
62956
+ return;
62957
+ }
62958
+ this._isVisible = false;
62959
+ this._coordinateX = null;
62960
+ this._coordinateY = null;
62961
+ this._gridline.unset();
62962
+ this._marker.unset();
62963
+ if (oldSeries != null) {
62867
62964
  this._series = null;
62868
- this._coordinateX = null;
62869
- this._coordinateY = null;
62870
- series.state.remove(this._state);
62871
- this._gridline.unset();
62872
- this._marker.unset();
62873
- this.emit("change", this);
62965
+ oldSeries.state.remove(this._state);
62874
62966
  }
62967
+ this.emit("change", this);
62968
+ DApplications.update(container.plotArea);
62875
62969
  };
62876
62970
  DChartSelectionSubImpl.prototype.update = function () {
62877
62971
  var container = this._container;
62972
+ if (container == null) {
62973
+ return false;
62974
+ }
62975
+ if (!this._isVisible) {
62976
+ return false;
62977
+ }
62978
+ var position = this._position;
62979
+ var work = this._work;
62878
62980
  var coordinateX = this._coordinateX;
62879
62981
  var coordinateY = this._coordinateY;
62880
- if (container && coordinateX && coordinateY) {
62881
- var position = this._position;
62882
- var work = this._work;
62982
+ if (coordinateX && coordinateY) {
62883
62983
  work.set(coordinateX.transform.map(coordinateX.map(position.x)), coordinateY.transform.map(coordinateY.map(position.y)));
62884
- container.plotArea.container.localTransform.apply(work, work);
62885
- var series = this._series;
62886
- var isGridlineUpdated = this._gridline.update(container, position, work, series);
62887
- var isMarkerUpdated = this._marker.update(container, position, work, series);
62888
- return isGridlineUpdated || isMarkerUpdated;
62889
62984
  }
62890
- return false;
62985
+ else {
62986
+ work.copyFrom(position);
62987
+ }
62988
+ container.plotArea.container.localTransform.apply(work, work);
62989
+ var series = this._series;
62990
+ var isGridlineUpdated = this._gridline.update(container, position, work, series);
62991
+ var isMarkerUpdated = this._marker.update(container, position, work, series);
62992
+ return isGridlineUpdated || isMarkerUpdated;
62891
62993
  };
62892
62994
  return DChartSelectionSubImpl;
62893
62995
  }(pixi_js.utils.EventEmitter));
@@ -62935,14 +63037,16 @@
62935
63037
  return {
62936
63038
  enable: (_a = dismiss.enable) !== null && _a !== void 0 ? _a : true,
62937
63039
  tap: this.toDismissTap(dismiss.tap),
62938
- longPress: this.toDismissLongPress(dismiss.longPress)
63040
+ longPress: this.toDismissLongPress(dismiss.longPress),
63041
+ noSeries: this.toDismissNoSeries(dismiss.noSeries)
62939
63042
  };
62940
63043
  }
62941
63044
  }
62942
63045
  return {
62943
63046
  enable: true,
62944
63047
  tap: this.toDismissTap(),
62945
- longPress: this.toDismissLongPress()
63048
+ longPress: this.toDismissLongPress(),
63049
+ noSeries: this.toDismissNoSeries()
62946
63050
  };
62947
63051
  };
62948
63052
  DChartSelectionSimple.prototype.toDismissTap = function (options) {
@@ -62958,6 +63062,12 @@
62958
63062
  enable: (_a = options === null || options === void 0 ? void 0 : options.enable) !== null && _a !== void 0 ? _a : true
62959
63063
  };
62960
63064
  };
63065
+ DChartSelectionSimple.prototype.toDismissNoSeries = function (options) {
63066
+ var _a;
63067
+ return {
63068
+ enable: (_a = options === null || options === void 0 ? void 0 : options.enable) !== null && _a !== void 0 ? _a : true
63069
+ };
63070
+ };
62961
63071
  DChartSelectionSimple.prototype.newSelected = function (point, options) {
62962
63072
  return new DChartSelectionSubImpl(this.toSelectedOptions(point, options));
62963
63073
  };
@@ -63023,7 +63133,12 @@
63023
63133
  selected.set(series, result);
63024
63134
  }
63025
63135
  else {
63026
- selected.unset();
63136
+ if (dismiss.enable && dismiss.noSeries.enable) {
63137
+ selected.unset();
63138
+ }
63139
+ else {
63140
+ selected.set(global_1.x, global_1.y);
63141
+ }
63027
63142
  }
63028
63143
  }
63029
63144
  };
@@ -63051,7 +63166,7 @@
63051
63166
  var result = DChartSelectionSimple.WORK_SELECT;
63052
63167
  var global_2 = e.data.global;
63053
63168
  var series = container.calcHitPoint(global_2.x, global_2.y, result);
63054
- if (series) {
63169
+ if (series != null) {
63055
63170
  hovered.set(series, result);
63056
63171
  }
63057
63172
  else {