@wcardinal/wcardinal-ui 0.320.0 → 0.322.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/shape/e-shape-acceptor-edge-normal.d.ts +4 -0
  2. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge-side.d.ts +9 -0
  3. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge-size.d.ts +4 -0
  4. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-edge.d.ts +12 -0
  5. package/dist/types/wcardinal/ui/shape/e-shape-acceptor-impl.d.ts +5 -1
  6. package/dist/types/wcardinal/ui/shape/e-shape-acceptor.d.ts +1 -16
  7. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-impl.d.ts +5 -1
  8. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge.d.ts +5 -2
  9. package/dist/types/wcardinal/ui/shape/index.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.d.ts +7 -5
  11. package/dist/wcardinal/ui/d-button-group.js +1 -1
  12. package/dist/wcardinal/ui/d-button-group.js.map +1 -1
  13. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-normal.js +6 -0
  14. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-normal.js.map +1 -0
  15. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-side.js +13 -0
  16. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-side.js.map +1 -0
  17. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-size.js +6 -0
  18. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge-size.js.map +1 -0
  19. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge.js +6 -0
  20. package/dist/wcardinal/ui/shape/e-shape-acceptor-edge.js.map +1 -0
  21. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js +4 -2
  22. package/dist/wcardinal/ui/shape/e-shape-acceptor-impl.js.map +1 -1
  23. package/dist/wcardinal/ui/shape/e-shape-acceptor.js.map +1 -1
  24. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +24 -3
  25. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
  26. package/dist/wcardinal/ui/shape/e-shape-connector-edge.js.map +1 -1
  27. package/dist/wcardinal/ui/shape/index.js +4 -0
  28. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  29. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js +68 -76
  30. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow-points-filler.js.map +1 -1
  31. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow.js +6 -4
  32. package/dist/wcardinal/ui/shape/variant/e-shape-connector-elbow.js.map +1 -1
  33. package/dist/wcardinal-ui-theme-dark.js +1 -1
  34. package/dist/wcardinal-ui-theme-dark.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 +119 -91
  38. package/dist/wcardinal-ui.js +119 -91
  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.320.0
2
+ Winter Cardinal UI v0.322.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -17611,6 +17611,19 @@
17611
17611
  return EShapeEmbeddedDatum;
17612
17612
  }());
17613
17613
 
17614
+ /*
17615
+ * Copyright (C) 2019 Toshiba Corporation
17616
+ * SPDX-License-Identifier: Apache-2.0
17617
+ */
17618
+ var EShapeAcceptorEdgeSide = {
17619
+ NONE: 0,
17620
+ TOP: 1,
17621
+ RIGHT: 2,
17622
+ BOTTOM: 4,
17623
+ LEFT: 8,
17624
+ ALL: 15
17625
+ };
17626
+
17614
17627
  /*
17615
17628
  * Copyright (C) 2019 Toshiba Corporation
17616
17629
  * SPDX-License-Identifier: Apache-2.0
@@ -17619,7 +17632,7 @@
17619
17632
  function EShapeAcceptorImpl() {
17620
17633
  this._edges = new Map();
17621
17634
  }
17622
- EShapeAcceptorImpl.prototype.add = function (id, type, x, y, nx, ny, sx, sy) {
17635
+ EShapeAcceptorImpl.prototype.add = function (id, type, x, y, nx, ny, sx, sy, side) {
17623
17636
  this._edges.set(id, {
17624
17637
  type: type,
17625
17638
  x: x,
@@ -17628,7 +17641,8 @@
17628
17641
  size: {
17629
17642
  x: sx !== null && sx !== void 0 ? sx : 0,
17630
17643
  y: sy !== null && sy !== void 0 ? sy : 0
17631
- }
17644
+ },
17645
+ side: side !== null && side !== void 0 ? side : EShapeAcceptorEdgeSide.TOP
17632
17646
  });
17633
17647
  return true;
17634
17648
  };
@@ -17844,6 +17858,7 @@
17844
17858
  }, undefined);
17845
17859
  this._normalIdRequired = 0;
17846
17860
  this._normalId = 0;
17861
+ this._side = EShapeAcceptorEdgeSide.TOP;
17847
17862
  this._margin = 0;
17848
17863
  this._lockCount = 0;
17849
17864
  this._isAcceptorChanged = false;
@@ -17935,6 +17950,19 @@
17935
17950
  enumerable: false,
17936
17951
  configurable: true
17937
17952
  });
17953
+ Object.defineProperty(EShapeConnectorEdgeImpl.prototype, "side", {
17954
+ get: function () {
17955
+ return this._side;
17956
+ },
17957
+ set: function (side) {
17958
+ if (this._side !== side) {
17959
+ this._side = side;
17960
+ this.onOtherChange();
17961
+ }
17962
+ },
17963
+ enumerable: false,
17964
+ configurable: true
17965
+ });
17938
17966
  Object.defineProperty(EShapeConnectorEdgeImpl.prototype, "margin", {
17939
17967
  get: function () {
17940
17968
  return this._margin;
@@ -17948,7 +17976,7 @@
17948
17976
  enumerable: false,
17949
17977
  configurable: true
17950
17978
  });
17951
- EShapeConnectorEdgeImpl.prototype.set = function (acceptorShape, acceptorEdge, acceptorX, acceptorY, margin, x, y, nx, ny) {
17979
+ EShapeConnectorEdgeImpl.prototype.set = function (acceptorShape, acceptorEdge, acceptorX, acceptorY, margin, x, y, nx, ny, side) {
17952
17980
  this.lock();
17953
17981
  this._acceptor.set(acceptorShape, acceptorEdge, acceptorX, acceptorY);
17954
17982
  var local = this._local;
@@ -17971,6 +17999,9 @@
17971
17999
  else if (ny != null) {
17972
18000
  normal.y = ny;
17973
18001
  }
18002
+ if (side != null) {
18003
+ this.side = side;
18004
+ }
17974
18005
  if (margin != null) {
17975
18006
  this.margin = margin;
17976
18007
  }
@@ -17982,6 +18013,7 @@
17982
18013
  this._acceptor.copy(source.acceptor);
17983
18014
  this._local.copyFrom(source.local);
17984
18015
  this._normal.copyFrom(source.normal);
18016
+ this.side = source.side;
17985
18017
  this.margin = source.margin;
17986
18018
  this.unlock();
17987
18019
  return this;
@@ -17994,10 +18026,11 @@
17994
18026
  var edgeId = edge != null ? manager.addResource(edge) : -1;
17995
18027
  var local = this._local;
17996
18028
  var normal = this._normal;
17997
- return manager.addResource("[".concat(shapeUuid, ",").concat(edgeId, ",").concat(local.x, ",").concat(local.y, ",").concat(this._margin, ",").concat(normal.x, ",").concat(normal.y, ",").concat(acceptor.x, ",").concat(acceptor.y, "]"));
18029
+ var side = this._side;
18030
+ return manager.addResource("[".concat(shapeUuid, ",").concat(edgeId, ",").concat(local.x, ",").concat(local.y, ",").concat(this._margin, ",").concat(normal.x, ",").concat(normal.y, ",").concat(acceptor.x, ",").concat(acceptor.y, ",").concat(side, "]"));
17998
18031
  };
17999
18032
  EShapeConnectorEdgeImpl.prototype.deserialize = function (resourceId, mapping, manager) {
18000
- var _a, _b;
18033
+ var _a, _b, _c;
18001
18034
  var resources = manager.resources;
18002
18035
  if (0 <= resourceId && resourceId < resources.length) {
18003
18036
  var parsed = manager.getExtension(resourceId);
@@ -18027,6 +18060,7 @@
18027
18060
  else {
18028
18061
  normal.set(1, 0);
18029
18062
  }
18063
+ this.side = (_c = parsed[9]) !== null && _c !== void 0 ? _c : EShapeAcceptorEdgeSide.TOP;
18030
18064
  this.margin = parsed[4] || 0;
18031
18065
  this.unlock();
18032
18066
  if (shape) {
@@ -30230,7 +30264,7 @@
30230
30264
  set: function (newActive) {
30231
30265
  if ((newActive == null || newActive.isToggle) && this._active !== newActive) {
30232
30266
  var oldActive = this._active;
30233
- this._active = null;
30267
+ this._active = newActive;
30234
30268
  var buttons = this._buttons;
30235
30269
  for (var i = 0, imax = buttons.length; i < imax; ++i) {
30236
30270
  var button = buttons[i];
@@ -37787,103 +37821,94 @@
37787
37821
  enumerable: false,
37788
37822
  configurable: true
37789
37823
  });
37790
- EShapeConnectorElbowPointsFiller.prototype.toAxis = function (dx, dy, nx, ny) {
37824
+ EShapeConnectorElbowPointsFiller.prototype.toSide = function (x, y) {
37825
+ // y = +x => 0 = x - y
37826
+ // y = -x => 0 = x + y
37827
+ if (0 <= x - y) {
37828
+ if (0 <= x + y) {
37829
+ return EShapeAcceptorEdgeSide.RIGHT;
37830
+ }
37831
+ else {
37832
+ return EShapeAcceptorEdgeSide.BOTTOM;
37833
+ }
37834
+ }
37835
+ else {
37836
+ if (0 <= x + y) {
37837
+ return EShapeAcceptorEdgeSide.TOP;
37838
+ }
37839
+ else {
37840
+ return EShapeAcceptorEdgeSide.LEFT;
37841
+ }
37842
+ }
37843
+ };
37844
+ EShapeConnectorElbowPointsFiller.prototype.toAxis = function (dx, dy, nx, ny, side) {
37845
+ // When (nx, ny) === (0, 0), treat as if side === EShapeAcceptorEdgeSide.ALL.
37791
37846
  var anx = Math.abs(nx);
37792
37847
  var any = Math.abs(ny);
37793
37848
  var threshold = this._threshold;
37794
37849
  if (anx < threshold && any < threshold) {
37795
37850
  if (Math.abs(dx) < Math.abs(dy)) {
37796
37851
  if (0 <= dy) {
37797
- return 2;
37852
+ return 2; // Bottom
37798
37853
  }
37799
37854
  else {
37800
- return 0;
37855
+ return 0; // Top
37801
37856
  }
37802
37857
  }
37803
37858
  else {
37804
37859
  if (0 <= dx) {
37805
- return 1;
37806
- }
37807
- else {
37808
- return 3;
37809
- }
37810
- }
37811
- }
37812
- var s = 0.2;
37813
- if (0 <= nx) {
37814
- if (0 <= ny) {
37815
- if (s < anx && s < any) {
37816
- if (dx < dy) {
37817
- return 2;
37818
- }
37819
- else {
37820
- return 1;
37821
- }
37822
- }
37823
- else if (s < anx) {
37824
- return 1;
37825
- }
37826
- else {
37827
- return 2;
37828
- }
37829
- }
37830
- else {
37831
- if (s < anx && s < any) {
37832
- if (dx < -dy) {
37833
- return 0;
37834
- }
37835
- else {
37836
- return 1;
37837
- }
37838
- }
37839
- else if (s < anx) {
37840
- return 1;
37860
+ return 1; // Right
37841
37861
  }
37842
37862
  else {
37843
- return 0;
37863
+ return 3; // Left
37844
37864
  }
37845
37865
  }
37846
37866
  }
37847
- else {
37848
- if (0 <= ny) {
37849
- if (s < anx && s < any) {
37850
- if (-dx < dy) {
37851
- return 2;
37852
- }
37853
- else {
37854
- return 3;
37855
- }
37856
- }
37857
- else if (s < anx) {
37858
- return 3;
37859
- }
37860
- else {
37861
- return 2;
37862
- }
37863
- }
37864
- else {
37865
- if (s < anx && s < any) {
37866
- if (dy < dx) {
37867
- return 0;
37868
- }
37869
- else {
37870
- return 3;
37871
- }
37872
- }
37873
- else if (s < anx) {
37874
- return 3;
37875
- }
37876
- else {
37877
- return 0;
37878
- }
37867
+ var d = null;
37868
+ var result = 0;
37869
+ // 0 := (0, -1)
37870
+ // | ny, nx | 0 |
37871
+ // | nx, -ny | -1 |
37872
+ if (side & this.toSide(-nx, ny)) {
37873
+ if (d == null || d < -dy) {
37874
+ d = -dy;
37875
+ result = 0;
37876
+ }
37877
+ }
37878
+ // 1 := (1, 0)
37879
+ // | ny, nx | 1 |
37880
+ // | nx, -ny | 0 |
37881
+ if (side & this.toSide(ny, nx)) {
37882
+ if (d == null || d < dx) {
37883
+ d = dx;
37884
+ result = 1;
37885
+ }
37886
+ }
37887
+ // 2 := (0, 1)
37888
+ // | ny, nx | 0 |
37889
+ // | nx, -ny | 1 |
37890
+ if (side & this.toSide(nx, -ny)) {
37891
+ if (d == null || d < dy) {
37892
+ d = dy;
37893
+ result = 2;
37894
+ }
37895
+ }
37896
+ // 3 := (-1, 0)
37897
+ // | ny, nx | -1 |
37898
+ // | nx, -ny | 0 |
37899
+ if (side & this.toSide(-ny, -nx)) {
37900
+ if (d == null || d < -dx) {
37901
+ d = -dx;
37902
+ result = 3;
37879
37903
  }
37880
37904
  }
37905
+ return result;
37881
37906
  };
37882
- EShapeConnectorElbowPointsFiller.prototype.toTailAxis = function (x, y, nx, ny) {
37883
- return this.toAxis(x - this.x, y - this.y, nx, ny);
37907
+ EShapeConnectorElbowPointsFiller.prototype.toTailAxis = function (x, y, nx, ny, side) {
37908
+ return this.toAxis(x - this.x, y - this.y, nx, ny, side);
37884
37909
  };
37885
- EShapeConnectorElbowPointsFiller.prototype.tail = function (x, y, nx, ny, sxh, syh, margin) {
37886
- switch (this.toTailAxis(x, y, nx, ny)) {
37910
+ EShapeConnectorElbowPointsFiller.prototype.tail = function (x, y, nx, ny, sxh, syh, margin, side) {
37911
+ switch (this.toTailAxis(x, y, nx, ny, side)) {
37887
37912
  case 0:
37888
37913
  if (this.y - margin <= y) {
37889
37914
  this.y -= Math.max(margin, syh);
@@ -37932,11 +37957,11 @@
37932
37957
  this.x = x;
37933
37958
  }
37934
37959
  };
37935
- EShapeConnectorElbowPointsFiller.prototype.toHeadAxis = function (x, y, nx, ny) {
37936
- return this.toAxis(this.x - x, this.y - y, nx, ny);
37960
+ EShapeConnectorElbowPointsFiller.prototype.toHeadAxis = function (x, y, nx, ny, side) {
37961
+ return this.toAxis(this.x - x, this.y - y, nx, ny, side);
37937
37962
  };
37938
- EShapeConnectorElbowPointsFiller.prototype.head = function (x, y, nx, ny, sxh, syh, margin) {
37939
- switch (this.toHeadAxis(x, y, nx, ny)) {
37963
+ EShapeConnectorElbowPointsFiller.prototype.head = function (x, y, nx, ny, sxh, syh, margin, side) {
37964
+ switch (this.toHeadAxis(x, y, nx, ny, side)) {
37940
37965
  case 0:
37941
37966
  if (y - margin <= this.y) {
37942
37967
  this.y = y - Math.max(margin, syh);
@@ -38033,6 +38058,7 @@
38033
38058
  var tailNormal = tail.normal;
38034
38059
  var tailNormalX = tailNormal.x;
38035
38060
  var tailNormalY = tailNormal.y;
38061
+ var tailSide = tail.side;
38036
38062
  // Head
38037
38063
  var headLocal = head.local;
38038
38064
  var headLocalX = headLocal.x;
@@ -38040,6 +38066,7 @@
38040
38066
  var headNormal = head.normal;
38041
38067
  var headNormalX = headNormal.x;
38042
38068
  var headNormalY = headNormal.y;
38069
+ var headSide = head.side;
38043
38070
  // Body
38044
38071
  var bodyValues = body.values;
38045
38072
  var bodyValuesLength = bodyValues.length;
@@ -38073,7 +38100,7 @@
38073
38100
  var y3 = bodyValues[1];
38074
38101
  var x4 = cx + c * x3 - s * y3;
38075
38102
  var y4 = cy + c * y3 + s * x3;
38076
- filler.tail(x4, y4, tailNormalX, tailNormalY, sxh, syh, tailMargin);
38103
+ filler.tail(x4, y4, tailNormalX, tailNormalY, sxh, syh, tailMargin, tailSide);
38077
38104
  for (var i = 2; i < bodyValuesLength; i += 2) {
38078
38105
  var x = bodyValues[i + 0];
38079
38106
  var y = bodyValues[i + 1];
@@ -38081,11 +38108,11 @@
38081
38108
  var y5 = cy + c * y + s * x;
38082
38109
  filler.middle(x5, y5);
38083
38110
  }
38084
- filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin);
38111
+ filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin, headSide);
38085
38112
  }
38086
38113
  else {
38087
- filler.tail(cx, cy, tailNormalX, tailNormalY, sxh, syh, tailMargin);
38088
- filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin);
38114
+ filler.tail(cx, cy, tailNormalX, tailNormalY, sxh, syh, tailMargin, tailSide);
38115
+ filler.head(x1, y1, headNormalX, headNormalY, sxh, syh, headMargin, headSide);
38089
38116
  }
38090
38117
  filler.margin(tailMargin, headMargin);
38091
38118
  }
@@ -74968,6 +74995,7 @@
74968
74995
  toSizeNormalized: toSizeNormalized,
74969
74996
  toSizeRounded: toSizeRounded,
74970
74997
  toThresholdDefault: toThresholdDefault,
74998
+ EShapeAcceptorEdgeSide: EShapeAcceptorEdgeSide,
74971
74999
  EShapeAcceptorImpl: EShapeAcceptorImpl,
74972
75000
  EShapeAcceptorType: EShapeAcceptorType,
74973
75001
  EShapeAcceptors: EShapeAcceptors,