@wcardinal/wcardinal-ui 0.201.0 → 0.202.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 (208) hide show
  1. package/dist/types/wcardinal/ui/d-diagram-base.d.ts +1 -0
  2. package/dist/types/wcardinal/ui/d-diagram-canvas-data-impl.d.ts +7 -4
  3. package/dist/types/wcardinal/ui/d-diagram-canvas-data.d.ts +7 -4
  4. package/dist/types/wcardinal/ui/d-diagram-data-extended-impl.d.ts +2 -1
  5. package/dist/types/wcardinal/ui/d-diagram-data-impl.d.ts +7 -4
  6. package/dist/types/wcardinal/ui/d-diagram-data-private-impl.d.ts +2 -1
  7. package/dist/types/wcardinal/ui/d-diagram-data-protected-impl.d.ts +2 -1
  8. package/dist/types/wcardinal/ui/d-diagram-data-remote-impl.d.ts +1 -1
  9. package/dist/types/wcardinal/ui/d-diagram-data-remote.d.ts +1 -1
  10. package/dist/types/wcardinal/ui/d-diagram-data-scoped.d.ts +2 -1
  11. package/dist/types/wcardinal/ui/d-diagram-data.d.ts +5 -2
  12. package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +4 -0
  13. package/dist/types/wcardinal/ui/d-table-body-cell-color.d.ts +1 -1
  14. package/dist/types/wcardinal/ui/d-table-body-cell-options.d.ts +18 -0
  15. package/dist/types/wcardinal/ui/d-table-body-cell-select-dialog.d.ts +1 -1
  16. package/dist/types/wcardinal/ui/d-table-body-cell-select-promise.d.ts +1 -1
  17. package/dist/types/wcardinal/ui/d-table-body-cell-time.d.ts +1 -1
  18. package/dist/types/wcardinal/ui/d-table-body-cells.d.ts +7 -5
  19. package/dist/types/wcardinal/ui/d-table-body-row.d.ts +6 -4
  20. package/dist/types/wcardinal/ui/d-table-body.d.ts +2 -0
  21. package/dist/types/wcardinal/ui/d-table-column-editing.d.ts +16 -0
  22. package/dist/types/wcardinal/ui/d-table-column-formatter.d.ts +1 -0
  23. package/dist/types/wcardinal/ui/d-table-column-getter.d.ts +1 -0
  24. package/dist/types/wcardinal/ui/d-table-column-renderable.d.ts +1 -0
  25. package/dist/types/wcardinal/ui/d-table-column-selecting.d.ts +25 -0
  26. package/dist/types/wcardinal/ui/d-table-column-setter.d.ts +1 -0
  27. package/dist/types/wcardinal/ui/d-table-column-sorting.d.ts +9 -0
  28. package/dist/types/wcardinal/ui/d-table-column-state.d.ts +11 -0
  29. package/dist/types/wcardinal/ui/d-table-column-type.d.ts +18 -0
  30. package/dist/types/wcardinal/ui/d-table-column.d.ts +33 -101
  31. package/dist/types/wcardinal/ui/index.d.ts +10 -0
  32. package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtimes.d.ts +7 -15
  33. package/dist/types/wcardinal/ui/shape/e-shape-data-impl.d.ts +7 -0
  34. package/dist/types/wcardinal/ui/shape/e-shape-data-scoped-impl.d.ts +2 -1
  35. package/dist/types/wcardinal/ui/shape/e-shape-data-scoped.d.ts +2 -1
  36. package/dist/types/wcardinal/ui/shape/e-shape-data-value-formatter.d.ts +1 -0
  37. package/dist/types/wcardinal/ui/shape/e-shape-data-value-impl.d.ts +10 -1
  38. package/dist/types/wcardinal/ui/shape/e-shape-data-value-state.d.ts +32 -0
  39. package/dist/types/wcardinal/ui/shape/e-shape-data-value.d.ts +6 -1
  40. package/dist/types/wcardinal/ui/shape/e-shape-data.d.ts +4 -0
  41. package/dist/types/wcardinal/ui/shape/index.d.ts +2 -0
  42. package/dist/types/wcardinal/ui/shape/variant/build-text.d.ts +2 -1
  43. package/dist/types/wcardinal/ui/shape/variant/builder-text.d.ts +2 -0
  44. package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded-layer.d.ts +1 -1
  45. package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded.d.ts +1 -1
  46. package/dist/types/wcardinal/ui/shape/variant/e-shape-group-viewer.d.ts +2 -4
  47. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.d.ts +2 -0
  48. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header-cell.d.ts +2 -0
  49. package/dist/types/wcardinal/ui/util/index.d.ts +3 -0
  50. package/dist/types/wcardinal/ui/util/is-object.d.ts +1 -0
  51. package/dist/types/wcardinal/ui/util/to-cloned.d.ts +1 -0
  52. package/dist/types/wcardinal/ui/util/to-merged.d.ts +1 -0
  53. package/dist/wcardinal/ui/d-controller-focus-impl.js +0 -2
  54. package/dist/wcardinal/ui/d-controller-focus-impl.js.map +1 -1
  55. package/dist/wcardinal/ui/d-diagram-base.js.map +1 -1
  56. package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js +50 -16
  57. package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js.map +1 -1
  58. package/dist/wcardinal/ui/d-diagram-canvas-data.js.map +1 -1
  59. package/dist/wcardinal/ui/d-diagram-data-extended-impl.js +2 -2
  60. package/dist/wcardinal/ui/d-diagram-data-extended-impl.js.map +1 -1
  61. package/dist/wcardinal/ui/d-diagram-data-impl.js +22 -8
  62. package/dist/wcardinal/ui/d-diagram-data-impl.js.map +1 -1
  63. package/dist/wcardinal/ui/d-diagram-data-private-impl.js +2 -2
  64. package/dist/wcardinal/ui/d-diagram-data-private-impl.js.map +1 -1
  65. package/dist/wcardinal/ui/d-diagram-data-protected-impl.js +2 -2
  66. package/dist/wcardinal/ui/d-diagram-data-protected-impl.js.map +1 -1
  67. package/dist/wcardinal/ui/d-diagram-data-remote-impl.js +1 -1
  68. package/dist/wcardinal/ui/d-diagram-data-remote-impl.js.map +1 -1
  69. package/dist/wcardinal/ui/d-diagram-data-remote.js.map +1 -1
  70. package/dist/wcardinal/ui/d-diagram-data-scoped.js.map +1 -1
  71. package/dist/wcardinal/ui/d-diagram-data.js.map +1 -1
  72. package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
  73. package/dist/wcardinal/ui/d-table-body-cell-action-menu.js +1 -3
  74. package/dist/wcardinal/ui/d-table-body-cell-action-menu.js.map +1 -1
  75. package/dist/wcardinal/ui/d-table-body-cell-check.js +2 -4
  76. package/dist/wcardinal/ui/d-table-body-cell-check.js.map +1 -1
  77. package/dist/wcardinal/ui/d-table-body-cell-color.js +17 -19
  78. package/dist/wcardinal/ui/d-table-body-cell-color.js.map +1 -1
  79. package/dist/wcardinal/ui/d-table-body-cell-date.js +1 -3
  80. package/dist/wcardinal/ui/d-table-body-cell-date.js.map +1 -1
  81. package/dist/wcardinal/ui/d-table-body-cell-datetime.js +2 -4
  82. package/dist/wcardinal/ui/d-table-body-cell-datetime.js.map +1 -1
  83. package/dist/wcardinal/ui/d-table-body-cell-index.js +1 -3
  84. package/dist/wcardinal/ui/d-table-body-cell-index.js.map +1 -1
  85. package/dist/wcardinal/ui/d-table-body-cell-input-integer.js +1 -3
  86. package/dist/wcardinal/ui/d-table-body-cell-input-integer.js.map +1 -1
  87. package/dist/wcardinal/ui/d-table-body-cell-input-real.js +1 -3
  88. package/dist/wcardinal/ui/d-table-body-cell-input-real.js.map +1 -1
  89. package/dist/wcardinal/ui/d-table-body-cell-input-text.js +1 -3
  90. package/dist/wcardinal/ui/d-table-body-cell-input-text.js.map +1 -1
  91. package/dist/wcardinal/ui/d-table-body-cell-input-tree.js +1 -3
  92. package/dist/wcardinal/ui/d-table-body-cell-input-tree.js.map +1 -1
  93. package/dist/wcardinal/ui/d-table-body-cell-options.js +6 -0
  94. package/dist/wcardinal/ui/d-table-body-cell-options.js.map +1 -0
  95. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js +1 -3
  96. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js.map +1 -1
  97. package/dist/wcardinal/ui/d-table-body-cell-select-menu.js +1 -3
  98. package/dist/wcardinal/ui/d-table-body-cell-select-menu.js.map +1 -1
  99. package/dist/wcardinal/ui/d-table-body-cell-select-multiple.js +1 -3
  100. package/dist/wcardinal/ui/d-table-body-cell-select-multiple.js.map +1 -1
  101. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js +1 -3
  102. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js.map +1 -1
  103. package/dist/wcardinal/ui/d-table-body-cell-text.js +1 -3
  104. package/dist/wcardinal/ui/d-table-body-cell-text.js.map +1 -1
  105. package/dist/wcardinal/ui/d-table-body-cell-time.js +1 -3
  106. package/dist/wcardinal/ui/d-table-body-cell-time.js.map +1 -1
  107. package/dist/wcardinal/ui/d-table-body-cell-tree.js +1 -2
  108. package/dist/wcardinal/ui/d-table-body-cell-tree.js.map +1 -1
  109. package/dist/wcardinal/ui/d-table-body-cells.js +13 -5
  110. package/dist/wcardinal/ui/d-table-body-cells.js.map +1 -1
  111. package/dist/wcardinal/ui/d-table-body-row.js +43 -39
  112. package/dist/wcardinal/ui/d-table-body-row.js.map +1 -1
  113. package/dist/wcardinal/ui/d-table-body.js +2 -1
  114. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  115. package/dist/wcardinal/ui/d-table-column-editing.js +6 -0
  116. package/dist/wcardinal/ui/d-table-column-editing.js.map +1 -0
  117. package/dist/wcardinal/ui/d-table-column-formatter.js +6 -0
  118. package/dist/wcardinal/ui/d-table-column-formatter.js.map +1 -0
  119. package/dist/wcardinal/ui/d-table-column-getter.js +6 -0
  120. package/dist/wcardinal/ui/d-table-column-getter.js.map +1 -0
  121. package/dist/wcardinal/ui/d-table-column-renderable.js +6 -0
  122. package/dist/wcardinal/ui/d-table-column-renderable.js.map +1 -0
  123. package/dist/wcardinal/ui/d-table-column-selecting.js +6 -0
  124. package/dist/wcardinal/ui/d-table-column-selecting.js.map +1 -0
  125. package/dist/wcardinal/ui/d-table-column-setter.js +6 -0
  126. package/dist/wcardinal/ui/d-table-column-setter.js.map +1 -0
  127. package/dist/wcardinal/ui/d-table-column-sorting.js +6 -0
  128. package/dist/wcardinal/ui/d-table-column-sorting.js.map +1 -0
  129. package/dist/wcardinal/ui/d-table-column-state.js +6 -0
  130. package/dist/wcardinal/ui/d-table-column-state.js.map +1 -0
  131. package/dist/wcardinal/ui/d-table-column-type.js +22 -0
  132. package/dist/wcardinal/ui/d-table-column-type.js.map +1 -0
  133. package/dist/wcardinal/ui/d-table-column.js +1 -17
  134. package/dist/wcardinal/ui/d-table-column.js.map +1 -1
  135. package/dist/wcardinal/ui/d-table.js +23 -1
  136. package/dist/wcardinal/ui/d-table.js.map +1 -1
  137. package/dist/wcardinal/ui/index.js +10 -0
  138. package/dist/wcardinal/ui/index.js.map +1 -1
  139. package/dist/wcardinal/ui/shape/action/e-shape-action-expressions.js +2 -0
  140. package/dist/wcardinal/ui/shape/action/e-shape-action-expressions.js.map +1 -1
  141. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-both.js +2 -2
  142. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-both.js.map +1 -1
  143. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-local.js +1 -1
  144. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-local.js.map +1 -1
  145. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-remote.js +1 -1
  146. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-remote.js.map +1 -1
  147. package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js +30 -29
  148. package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js.map +1 -1
  149. package/dist/wcardinal/ui/shape/action/e-shape-action-value-on-input-actions.js +4 -4
  150. package/dist/wcardinal/ui/shape/action/e-shape-action-value-on-input-actions.js.map +1 -1
  151. package/dist/wcardinal/ui/shape/e-shape-data-impl.js +57 -0
  152. package/dist/wcardinal/ui/shape/e-shape-data-impl.js.map +1 -1
  153. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js +5 -1
  154. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js.map +1 -1
  155. package/dist/wcardinal/ui/shape/e-shape-data-scoped.js.map +1 -1
  156. package/dist/wcardinal/ui/shape/e-shape-data-value-formatter.js +6 -0
  157. package/dist/wcardinal/ui/shape/e-shape-data-value-formatter.js.map +1 -0
  158. package/dist/wcardinal/ui/shape/e-shape-data-value-impl.js +211 -56
  159. package/dist/wcardinal/ui/shape/e-shape-data-value-impl.js.map +1 -1
  160. package/dist/wcardinal/ui/shape/e-shape-data-value-state.js +36 -0
  161. package/dist/wcardinal/ui/shape/e-shape-data-value-state.js.map +1 -0
  162. package/dist/wcardinal/ui/shape/e-shape-data-value.js.map +1 -1
  163. package/dist/wcardinal/ui/shape/e-shape-data.js.map +1 -1
  164. package/dist/wcardinal/ui/shape/index.js +2 -0
  165. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  166. package/dist/wcardinal/ui/shape/variant/build-text.js +84 -63
  167. package/dist/wcardinal/ui/shape/variant/build-text.js.map +1 -1
  168. package/dist/wcardinal/ui/shape/variant/builder-text.js +18 -3
  169. package/dist/wcardinal/ui/shape/variant/builder-text.js.map +1 -1
  170. package/dist/wcardinal/ui/shape/variant/deserialize-embedded-layer.js +2 -3
  171. package/dist/wcardinal/ui/shape/variant/deserialize-embedded-layer.js.map +1 -1
  172. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +4 -3
  173. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
  174. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +3 -1
  175. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  176. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js +3 -3
  177. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js.map +1 -1
  178. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js +3 -3
  179. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js.map +1 -1
  180. package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js +1 -1
  181. package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js.map +1 -1
  182. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js +4 -18
  183. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js.map +1 -1
  184. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js +11 -0
  185. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js.map +1 -1
  186. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js +11 -0
  187. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js.map +1 -1
  188. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js +1 -1
  189. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js.map +1 -1
  190. package/dist/wcardinal/ui/util/index.js +3 -0
  191. package/dist/wcardinal/ui/util/index.js.map +1 -1
  192. package/dist/wcardinal/ui/util/is-object.js +13 -0
  193. package/dist/wcardinal/ui/util/is-object.js.map +1 -0
  194. package/dist/wcardinal/ui/util/to-cloned.js +32 -0
  195. package/dist/wcardinal/ui/util/to-cloned.js.map +1 -0
  196. package/dist/wcardinal/ui/util/to-merged.js +45 -0
  197. package/dist/wcardinal/ui/util/to-merged.js.map +1 -0
  198. package/dist/wcardinal-ui-theme-dark.js +12 -1
  199. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  200. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  201. package/dist/wcardinal-ui-theme-white.js +12 -1
  202. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  203. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  204. package/dist/wcardinal-ui.cjs.js +1390 -954
  205. package/dist/wcardinal-ui.js +1596 -1182
  206. package/dist/wcardinal-ui.min.js +2 -2
  207. package/dist/wcardinal-ui.min.js.map +1 -1
  208. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.201.0
2
+ Winter Cardinal UI v0.202.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -505,12 +505,12 @@
505
505
  iv += 4;
506
506
  }
507
507
  };
508
- var buildTextStep = function (steps, voffset, vcount, textAtlas, textSize, textOutlineWidth, textWeight) {
508
+ var buildTextStep = function (steps, voffset, vcount, textAtlas, textSize, textOutlineWidth, textWeight, scaleX, scaleY) {
509
509
  var is = voffset * 6 - 1;
510
510
  var ismax = (voffset + vcount) * 6 - 1;
511
511
  var scaleInvariant = toScaleInvariant(EShapeStrokeStyle.NONE);
512
512
  if (textAtlas != null) {
513
- var scale = textAtlas.font.size / textSize;
513
+ var scale = textAtlas.font.size / (textSize * (scaleX + scaleY) * 0.5);
514
514
  var position = textWeight === EShapeTextWeight.NORMAL ? 0.0 : 0.05;
515
515
  for (; is < ismax;) {
516
516
  steps[++is] = textOutlineWidth;
@@ -742,19 +742,6 @@
742
742
  break;
743
743
  }
744
744
  };
745
- var toNormalized = function (dx, dy, defx, defy, result) {
746
- var d = dx * dx + dy * dy;
747
- if (TEXT_FMIN < d) {
748
- var l = Math.sqrt(d);
749
- var li = 1 / l;
750
- result.set(dx * li, dy * li);
751
- return l;
752
- }
753
- else {
754
- result.set(defx, defy);
755
- return 0;
756
- }
757
- };
758
745
  var rotateAlignHorizontalRight = function (align) {
759
746
  switch (align) {
760
747
  case EShapeTextAlignHorizontal.LEFT:
@@ -822,36 +809,78 @@
822
809
  //
823
810
  var sx = sizeX * 0.5;
824
811
  var sy = sizeY * 0.5;
825
- var work = TEXT_WORK_POINT;
826
- work.set(originX - sx, originY - sy);
827
- internalTransform.apply(work, work);
828
- var x0 = work.x;
829
- var y0 = work.y;
830
- work.set(originX + sx, originY - sy);
831
- internalTransform.apply(work, work);
832
- var x1 = work.x;
833
- var y1 = work.y;
834
- work.set(originX + sx, originY + sy);
835
- internalTransform.apply(work, work);
836
- var x2 = work.x;
837
- var y2 = work.y;
812
+ var a = internalTransform.a;
813
+ var b = internalTransform.b;
814
+ var c = internalTransform.c;
815
+ var d = internalTransform.d;
816
+ var tx = internalTransform.tx;
817
+ var ty = internalTransform.ty;
818
+ var ltx = originX - sx;
819
+ var lty = originY - sy;
820
+ var rtx = originX + sx;
821
+ var rty = originY - sy;
822
+ var rbx = originX + sx;
823
+ var rby = originY + sy;
824
+ var x0 = a * ltx + c * lty + tx;
825
+ var y0 = b * ltx + d * lty + ty;
826
+ var x1 = a * rtx + c * rty + tx;
827
+ var y1 = b * rtx + d * rty + ty;
828
+ var x2 = a * rbx + c * rby + tx;
829
+ var y2 = b * rbx + d * rby + ty;
838
830
  var x3 = x0 + (x2 - x1);
839
831
  var y3 = y0 + (y2 - y1);
840
832
  // Horizontal normal
841
833
  var hl = toLength(x0, y0, x1, y1);
842
- toNormalized(internalTransform.a, internalTransform.b, 1, 0, work);
843
- var hnx = work.x;
844
- var hny = work.y;
834
+ var hnl = toLength(0, 0, a, b);
835
+ var hnx = 1;
836
+ var hny = 0;
837
+ if (TEXT_FMIN < hnl) {
838
+ var hnli = 1 / hnl;
839
+ hnx = a * hnli;
840
+ hny = b * hnli;
841
+ }
845
842
  // Vertical normal
846
843
  var vl = toLength(x0, y0, x3, y3);
847
- toNormalized(internalTransform.c, internalTransform.d, 0, 1, work);
848
- var vnx = work.x;
849
- var vny = work.y;
844
+ var vnl = toLength(0, 0, c, d);
845
+ var vnx = 0;
846
+ var vny = 1;
847
+ if (TEXT_FMIN < hnl) {
848
+ var vnli = 1 / vnl;
849
+ vnx = c * vnli;
850
+ vny = d * vnli;
851
+ }
852
+ var work = TEXT_WORK_POINT;
853
+ switch (textDirection) {
854
+ case EShapeTextDirection.LEFT_TO_RIGHT:
855
+ // DO NOTHING
856
+ break;
857
+ case EShapeTextDirection.TOP_TO_BOTTOM:
858
+ work.set(vnx, vny);
859
+ vnx = -hnx;
860
+ vny = -hny;
861
+ hnx = work.x;
862
+ hny = work.y;
863
+ work.x = vnl;
864
+ vnl = hnl;
865
+ hnl = work.x;
866
+ break;
867
+ case EShapeTextDirection.BOTTOM_TO_TOP:
868
+ work.set(vnx, vny);
869
+ vnx = hnx;
870
+ vny = hny;
871
+ hnx = -work.x;
872
+ hny = -work.y;
873
+ work.x = vnl;
874
+ vnl = hnl;
875
+ hnl = work.x;
876
+ break;
877
+ }
850
878
  // Calculate the width / height
851
879
  var width = 0;
852
880
  var height = 0;
853
881
  var heightChar = 0;
854
- var lineHeight = Math.max(0, textSize + textSpacingVertical);
882
+ var textSizeY = textSize * vnl;
883
+ var lineHeight = Math.max(0, textSize + textSpacingVertical) * vnl;
855
884
  var lineWidth = 0;
856
885
  var textAtlasCharacters = textAtlas.characters;
857
886
  var iterator = UtilCharacterIterator.from(textValue);
@@ -879,12 +908,14 @@
879
908
  height += lineHeight;
880
909
  }
881
910
  }
882
- var scale = textSize / textAtlas.font.size;
911
+ var scaleZ = textSize / textAtlas.font.size;
912
+ var scaleX = hnl * scaleZ;
913
+ var scaleY = vnl * scaleZ;
883
914
  lineWidth += advancePrevious;
884
- width = Math.max(width, lineWidth) * scale;
915
+ width = Math.max(width, lineWidth) * scaleX;
885
916
  lineWidth = 0;
886
- heightChar *= scale;
887
- height += textSize;
917
+ heightChar *= scaleY;
918
+ height += textSizeY;
888
919
  //
889
920
  var tx0 = 0;
890
921
  var ty0 = 0;
@@ -911,13 +942,6 @@
911
942
  }
912
943
  break;
913
944
  case EShapeTextDirection.TOP_TO_BOTTOM:
914
- // Swap normals
915
- work.set(vnx, vny);
916
- vnx = -hnx;
917
- vny = -hny;
918
- hnx = work.x;
919
- hny = work.y;
920
- // Get text bbox
921
945
  getTextBBox(rotateAlignVerticalRight(textAlignVertical), rotateAlignHorizontalRight(textAlignHorizontal), textOffsetVertical, textOffsetHorizontal, textPaddingVertical, textPaddingHorizontal, width, height, x1, y1, x2, y2, x3, y3, x0, y0, hnx, hny, vnx, vny, work);
922
946
  tx0 = work.x;
923
947
  ty0 = work.y;
@@ -938,13 +962,6 @@
938
962
  }
939
963
  break;
940
964
  case EShapeTextDirection.BOTTOM_TO_TOP:
941
- // Swap normals
942
- work.set(vnx, vny);
943
- vnx = hnx;
944
- vny = hny;
945
- hnx = -work.x;
946
- hny = -work.y;
947
- // Get text bbox
948
965
  getTextBBox(rotateAlignVerticalLeft(textAlignVertical), rotateAlignHorizontalLeft(textAlignHorizontal), textOffsetVertical, textOffsetHorizontal, textPaddingVertical, textPaddingHorizontal, width, height, x3, y3, x0, y0, x1, y1, x2, y2, hnx, hny, vnx, vny, work);
949
966
  tx0 = work.x;
950
967
  ty0 = work.y;
@@ -976,6 +993,8 @@
976
993
  textWorld[5] = vny;
977
994
  textWorld[6] = lineWidthMaximum;
978
995
  textWorld[7] = height;
996
+ textWorld[8] = hnl;
997
+ textWorld[9] = vnl;
979
998
  }
980
999
  else {
981
1000
  textWorld[0] = tx0;
@@ -986,6 +1005,8 @@
986
1005
  textWorld[5] = vny;
987
1006
  textWorld[6] = width;
988
1007
  textWorld[7] = height;
1008
+ textWorld[8] = hnl;
1009
+ textWorld[9] = vnl;
989
1010
  }
990
1011
  // Texture
991
1012
  var uvx0 = textureUvs.x0;
@@ -1001,16 +1022,16 @@
1001
1022
  // Vertices & UVs
1002
1023
  var lhx = lineHeight * vnx;
1003
1024
  var lhy = lineHeight * vny;
1004
- var snx = scale * hnx;
1005
- var sny = scale * hny;
1006
- var offsetY = (heightChar - textSize) * 0.5;
1025
+ var snx = scaleX * hnx;
1026
+ var sny = scaleX * hny;
1027
+ var offsetY = (heightChar - textSizeY) * 0.5;
1007
1028
  var oyx = offsetY * vnx;
1008
1029
  var oyy = offsetY * vny;
1009
1030
  var offsetItalic = textStyle === EShapeTextStyle.NORMAL ? 0 : textSize * 0.25;
1010
1031
  var bx0 = tx0 - oyx + offsetItalic * snx;
1011
1032
  var by0 = ty0 - oyy + offsetItalic * sny;
1012
- var bx3 = tx0 + oyx + textSize * vnx;
1013
- var by3 = ty0 + oyy + textSize * vny;
1033
+ var bx3 = tx0 + oyx + textSizeY * vnx;
1034
+ var by3 = ty0 + oyy + textSizeY * vny;
1014
1035
  var cx0 = bx0;
1015
1036
  var cy0 = by0;
1016
1037
  var cx3 = bx3;
@@ -1037,11 +1058,11 @@
1037
1058
  lineCount += 1;
1038
1059
  if (data) {
1039
1060
  var advance = data.advance;
1040
- if (lineWidthMaximum < (lineWidth + advance) * scale) {
1061
+ if (lineWidthMaximum < (lineWidth + advance) * scaleX) {
1041
1062
  var dots = textAtlasCharacters["..."];
1042
1063
  if (dots) {
1043
1064
  if (1 < lineCount &&
1044
- lineWidthMaximum < (lineWidth + dots.advance) * scale) {
1065
+ lineWidthMaximum < (lineWidth + dots.advance) * scaleX) {
1045
1066
  lineWidth = lineWidthPrevious;
1046
1067
  iv -= 8;
1047
1068
  lineCount -= 1;
@@ -1092,13 +1113,13 @@
1092
1113
  cx3 = bx3;
1093
1114
  cy3 = by3;
1094
1115
  writeCharacterEmpty(vertices, uvs, iv, cx0, cy0, cx3, cy3, uvx0, uvy0, uvx3, uvy3);
1095
- adjustTextAlignment(vertices, hnx, hny, lineCount, iv, width - lineWidth * scale, textDirection, textAlignHorizontal, textAlignVertical);
1116
+ adjustTextAlignment(vertices, hnx, hny, lineCount, iv, width - lineWidth * scaleX, textDirection, textAlignHorizontal, textAlignVertical);
1096
1117
  lineWidth = 0;
1097
1118
  lineCount = 0;
1098
1119
  }
1099
1120
  }
1100
1121
  lineWidth += advancePrevious;
1101
- adjustTextAlignment(vertices, hnx, hny, lineCount, iv, width - lineWidth * scale, textDirection, textAlignHorizontal, textAlignVertical);
1122
+ adjustTextAlignment(vertices, hnx, hny, lineCount, iv, width - lineWidth * scaleX, textDirection, textAlignHorizontal, textAlignVertical);
1102
1123
  for (var ivmax = (voffset + vcount) * 2; iv < ivmax; iv += 2) {
1103
1124
  vertices[iv + 0] = tx0;
1104
1125
  vertices[iv + 1] = ty0;
@@ -4140,7 +4161,9 @@
4140
4161
  var ty = transform.b * x + transform.d * y + transform.ty - textWorld[1];
4141
4162
  var th = textWorld[2] * tx + textWorld[3] * ty;
4142
4163
  var tv = textWorld[4] * tx + textWorld[5] * ty;
4143
- if (0 <= th && th <= textWorld[6] && 0 <= tv && tv <= textWorld[7]) {
4164
+ var w = textWorld[6];
4165
+ var h = textWorld[7];
4166
+ if (0 <= th && th <= w && 0 <= tv && tv <= h) {
4144
4167
  return this;
4145
4168
  }
4146
4169
  }
@@ -4889,6 +4912,42 @@
4889
4912
  PROTECTED: 2
4890
4913
  };
4891
4914
 
4915
+ /*
4916
+ * Copyright (C) 2019 Toshiba Corporation
4917
+ * SPDX-License-Identifier: Apache-2.0
4918
+ */
4919
+ var EShapeDataValueState = {
4920
+ /**
4921
+ * The data status is not known.
4922
+ * This is the default state.
4923
+ */
4924
+ UNKOWN: -1,
4925
+ /**
4926
+ * The request succeeded.
4927
+ */
4928
+ FOUND: 0,
4929
+ /**
4930
+ * The server can not find the requested data.
4931
+ */
4932
+ NOT_FOUND: 1,
4933
+ /**
4934
+ * The settings or something provided by clients are considered incorrect.
4935
+ */
4936
+ BAD_REQUEST: 2,
4937
+ /**
4938
+ * The server has encountered unknown errors.
4939
+ */
4940
+ SERVER_ERROR: 3,
4941
+ /**
4942
+ * The server is not ready to handle the request.
4943
+ */
4944
+ SERVICE_UNAVAILABLE: 4,
4945
+ /**
4946
+ * A client is not allowed to access this data.
4947
+ */
4948
+ FORBIDDEN: 5
4949
+ };
4950
+
4892
4951
  /*
4893
4952
  * Copyright (C) 2019 Toshiba Corporation
4894
4953
  * SPDX-License-Identifier: Apache-2.0
@@ -4899,6 +4958,7 @@
4899
4958
  var EShapeDataValueImpl = /** @class */ (function () {
4900
4959
  function EShapeDataValueImpl() {
4901
4960
  this.id = "";
4961
+ this.as = "";
4902
4962
  this.type = EShapeDataValueType.NUMBER;
4903
4963
  this.scope = EShapeDataValueScope.PUBLIC;
4904
4964
  this.initial = "";
@@ -4906,6 +4966,7 @@
4906
4966
  this.range = new EShapeDataValueRangeImpl();
4907
4967
  this._value = 0;
4908
4968
  this._time = 0;
4969
+ this._state = EShapeDataValueState.UNKOWN;
4909
4970
  this._capacity = 0;
4910
4971
  this._order = EShapeDataValueOrder.ASCENDING;
4911
4972
  }
@@ -4996,10 +5057,11 @@
4996
5057
  return result;
4997
5058
  },
4998
5059
  set: function (newValues) {
4999
- if (0 < newValues.length) {
5060
+ var newValuesLength = newValues.length;
5061
+ if (0 < newValuesLength) {
5000
5062
  var capacity = this._capacity;
5001
5063
  if (capacity <= 0) {
5002
- var newValue = newValues[newValues.length - 1];
5064
+ var newValue = newValues[newValuesLength - 1];
5003
5065
  var formatter = this.formatter;
5004
5066
  if (formatter != null) {
5005
5067
  newValue = formatter(newValue);
@@ -5022,30 +5084,30 @@
5022
5084
  var formatter = this.formatter;
5023
5085
  if (formatter != null) {
5024
5086
  // Update the value
5025
- this._value = formatter(newValues[newValues.length - 1]);
5087
+ this._value = formatter(newValues[newValuesLength - 1]);
5026
5088
  // Update the values
5027
5089
  if (order === EShapeDataValueOrder.ASCENDING) {
5028
- for (var i = 0, imax = newValues.length; i < imax; ++i) {
5090
+ for (var i = 0; i < newValuesLength; ++i) {
5029
5091
  values.push(formatter(newValues[i]));
5030
5092
  }
5031
5093
  }
5032
5094
  else {
5033
- for (var i = 0, imax = newValues.length; i < imax; ++i) {
5095
+ for (var i = 0; i < newValuesLength; ++i) {
5034
5096
  values.unshift(formatter(newValues[i]));
5035
5097
  }
5036
5098
  }
5037
5099
  }
5038
5100
  else {
5039
5101
  // Update the value
5040
- this._value = newValues[newValues.length - 1];
5102
+ this._value = newValues[newValuesLength - 1];
5041
5103
  // Update the values
5042
5104
  if (order === EShapeDataValueOrder.ASCENDING) {
5043
- for (var i = 0, imax = newValues.length; i < imax; ++i) {
5105
+ for (var i = 0; i < newValuesLength; ++i) {
5044
5106
  values.push(newValues[i]);
5045
5107
  }
5046
5108
  }
5047
5109
  else {
5048
- for (var i = 0, imax = newValues.length; i < imax; ++i) {
5110
+ for (var i = 0; i < newValuesLength; ++i) {
5049
5111
  values.unshift(newValues[i]);
5050
5112
  }
5051
5113
  }
@@ -5137,10 +5199,11 @@
5137
5199
  return result;
5138
5200
  },
5139
5201
  set: function (newTimes) {
5140
- if (0 < newTimes.length) {
5202
+ var newTimesLength = newTimes.length;
5203
+ if (0 < newTimesLength) {
5141
5204
  var capacity = this._capacity;
5142
5205
  if (capacity <= 0) {
5143
- var newTime = newTimes[newTimes.length - 1];
5206
+ var newTime = newTimes[newTimesLength - 1];
5144
5207
  if (this._time !== newTime) {
5145
5208
  this._time = newTime;
5146
5209
  var parent_7 = this.parent;
@@ -5157,16 +5220,16 @@
5157
5220
  this._times = times;
5158
5221
  }
5159
5222
  // Update the value
5160
- this._time = newTimes[newTimes.length - 1];
5223
+ this._time = newTimes[newTimesLength - 1];
5161
5224
  //
5162
5225
  var order = this._order;
5163
5226
  if (order === EShapeDataValueOrder.ASCENDING) {
5164
- for (var i = 0, imax = newTimes.length; i < imax; ++i) {
5227
+ for (var i = 0; i < newTimesLength; ++i) {
5165
5228
  times.push(newTimes[i]);
5166
5229
  }
5167
5230
  }
5168
5231
  else {
5169
- for (var i = 0, imax = newTimes.length; i < imax; ++i) {
5232
+ for (var i = 0; i < newTimesLength; ++i) {
5170
5233
  times.unshift(newTimes[i]);
5171
5234
  }
5172
5235
  }
@@ -5193,6 +5256,127 @@
5193
5256
  enumerable: false,
5194
5257
  configurable: true
5195
5258
  });
5259
+ Object.defineProperty(EShapeDataValueImpl.prototype, "state", {
5260
+ get: function () {
5261
+ return this._state;
5262
+ },
5263
+ set: function (newState) {
5264
+ var capacity = this._capacity;
5265
+ if (capacity <= 0) {
5266
+ if (this._state !== newState) {
5267
+ this._state = newState;
5268
+ var parent_9 = this.parent;
5269
+ if (parent_9 != null) {
5270
+ parent_9.isChanged = true;
5271
+ }
5272
+ }
5273
+ }
5274
+ else {
5275
+ // Update the states
5276
+ var states = this._states;
5277
+ if (states == null) {
5278
+ states = [];
5279
+ this._states = states;
5280
+ }
5281
+ // Update the state
5282
+ this._state = newState;
5283
+ // Update the states
5284
+ var order = this._order;
5285
+ if (order === EShapeDataValueOrder.ASCENDING) {
5286
+ states.push(newState);
5287
+ }
5288
+ else {
5289
+ states.unshift(newState);
5290
+ }
5291
+ // Remove the unnecessary states
5292
+ var count = states.length - capacity;
5293
+ if (0 < count) {
5294
+ if (order === EShapeDataValueOrder.ASCENDING) {
5295
+ for (var i = 0; i < count; ++i) {
5296
+ states.shift();
5297
+ }
5298
+ }
5299
+ else {
5300
+ states.length = capacity;
5301
+ }
5302
+ }
5303
+ // Tell the parent it's changed
5304
+ var parent_10 = this.parent;
5305
+ if (parent_10 != null) {
5306
+ parent_10.isChanged = true;
5307
+ }
5308
+ }
5309
+ },
5310
+ enumerable: false,
5311
+ configurable: true
5312
+ });
5313
+ Object.defineProperty(EShapeDataValueImpl.prototype, "states", {
5314
+ get: function () {
5315
+ var result = this._states;
5316
+ if (result == null) {
5317
+ result = [];
5318
+ this._states = result;
5319
+ }
5320
+ return result;
5321
+ },
5322
+ set: function (newStates) {
5323
+ var newStatesLength = newStates.length;
5324
+ if (0 < newStatesLength) {
5325
+ var capacity = this._capacity;
5326
+ if (capacity <= 0) {
5327
+ var newState = newStates[newStatesLength - 1];
5328
+ if (this._state !== newState) {
5329
+ this._state = newState;
5330
+ var parent_11 = this.parent;
5331
+ if (parent_11 != null) {
5332
+ parent_11.isChanged = true;
5333
+ }
5334
+ }
5335
+ }
5336
+ else {
5337
+ // Update the states
5338
+ var states = this._states;
5339
+ if (states == null) {
5340
+ states = [];
5341
+ this._states = states;
5342
+ }
5343
+ // Update the value
5344
+ this._state = newStates[newStatesLength - 1];
5345
+ //
5346
+ var order = this._order;
5347
+ if (order === EShapeDataValueOrder.ASCENDING) {
5348
+ for (var i = 0; i < newStatesLength; ++i) {
5349
+ states.push(newStates[i]);
5350
+ }
5351
+ }
5352
+ else {
5353
+ for (var i = 0; i < newStatesLength; ++i) {
5354
+ states.unshift(newStates[i]);
5355
+ }
5356
+ }
5357
+ //
5358
+ var count = states.length - capacity;
5359
+ if (0 < count) {
5360
+ if (order === EShapeDataValueOrder.ASCENDING) {
5361
+ for (var i = 0; i < count; ++i) {
5362
+ states.shift();
5363
+ }
5364
+ }
5365
+ else {
5366
+ states.length = capacity;
5367
+ }
5368
+ }
5369
+ // Tell the parent it's changed
5370
+ var parent_12 = this.parent;
5371
+ if (parent_12 != null) {
5372
+ parent_12.isChanged = true;
5373
+ }
5374
+ }
5375
+ }
5376
+ },
5377
+ enumerable: false,
5378
+ configurable: true
5379
+ });
5196
5380
  Object.defineProperty(EShapeDataValueImpl.prototype, "capacity", {
5197
5381
  get: function () {
5198
5382
  return this._capacity;
@@ -5237,10 +5421,26 @@
5237
5421
  isChanged = true;
5238
5422
  }
5239
5423
  }
5424
+ // States
5425
+ var states = this._states;
5426
+ if (states != null) {
5427
+ var count = states.length - capacity;
5428
+ if (0 < count) {
5429
+ if (order === EShapeDataValueOrder.ASCENDING) {
5430
+ for (var i = 0; i < count; ++i) {
5431
+ states.shift();
5432
+ }
5433
+ }
5434
+ else {
5435
+ states.length = capacity;
5436
+ }
5437
+ isChanged = true;
5438
+ }
5439
+ }
5240
5440
  if (isChanged) {
5241
- var parent_9 = this.parent;
5242
- if (parent_9 != null) {
5243
- parent_9.isChanged = true;
5441
+ var parent_13 = this.parent;
5442
+ if (parent_13 != null) {
5443
+ parent_13.isChanged = true;
5244
5444
  }
5245
5445
  }
5246
5446
  }
@@ -5276,59 +5476,62 @@
5276
5476
  isChanged = true;
5277
5477
  }
5278
5478
  }
5479
+ // States
5480
+ var states = this._states;
5481
+ if (states != null) {
5482
+ if (0 <= index && index < states.length) {
5483
+ states.splice(index, 1);
5484
+ isChanged = true;
5485
+ }
5486
+ }
5279
5487
  if (isChanged) {
5280
- var parent_10 = this.parent;
5281
- if (parent_10 != null) {
5282
- parent_10.isChanged = true;
5488
+ var parent_14 = this.parent;
5489
+ if (parent_14 != null) {
5490
+ parent_14.isChanged = true;
5283
5491
  }
5284
5492
  }
5285
5493
  };
5286
5494
  EShapeDataValueImpl.prototype.removeAll = function (indices) {
5287
5495
  var isChanged = false;
5288
- var values = this._values;
5289
- var times = this._times;
5290
5496
  var sorted = indices.slice(0).sort(INDEX_COMPARATOR);
5497
+ var sortedLength = sorted.length;
5498
+ // Values
5499
+ var values = this._values;
5291
5500
  if (values != null) {
5292
- if (times != null) {
5293
- for (var i = sorted.length - 1; 0 <= i; --i) {
5294
- var index = sorted[i];
5295
- if (0 <= index) {
5296
- if (index < values.length) {
5297
- values.splice(index, 1);
5298
- isChanged = true;
5299
- }
5300
- if (index < times.length) {
5301
- times.splice(index, 1);
5302
- isChanged = true;
5303
- }
5304
- }
5501
+ for (var i = sortedLength - 1; 0 <= i; --i) {
5502
+ var index = sorted[i];
5503
+ if (0 <= index && index < values.length) {
5504
+ values.splice(index, 1);
5505
+ isChanged = true;
5305
5506
  }
5306
5507
  }
5307
- else {
5308
- for (var i = sorted.length - 1; 0 <= i; --i) {
5309
- var index = sorted[i];
5310
- if (0 <= index && index < values.length) {
5311
- values.splice(index, 1);
5312
- isChanged = true;
5313
- }
5508
+ }
5509
+ // Times
5510
+ var times = this._times;
5511
+ if (times != null) {
5512
+ for (var i = sortedLength - 1; 0 <= i; --i) {
5513
+ var index = sorted[i];
5514
+ if (0 <= index && index < times.length) {
5515
+ times.splice(index, 1);
5516
+ isChanged = true;
5314
5517
  }
5315
5518
  }
5316
5519
  }
5317
- else {
5318
- if (times != null) {
5319
- for (var i = sorted.length - 1; 0 <= i; --i) {
5320
- var index = sorted[i];
5321
- if (0 <= index && index < times.length) {
5322
- times.splice(index, 1);
5323
- isChanged = true;
5324
- }
5520
+ // States
5521
+ var states = this._states;
5522
+ if (states != null) {
5523
+ for (var i = sortedLength - 1; 0 <= i; --i) {
5524
+ var index = sorted[i];
5525
+ if (0 <= index && index < states.length) {
5526
+ states.splice(index, 1);
5527
+ isChanged = true;
5325
5528
  }
5326
5529
  }
5327
5530
  }
5328
5531
  if (isChanged) {
5329
- var parent_11 = this.parent;
5330
- if (parent_11 != null) {
5331
- parent_11.isChanged = true;
5532
+ var parent_15 = this.parent;
5533
+ if (parent_15 != null) {
5534
+ parent_15.isChanged = true;
5332
5535
  }
5333
5536
  }
5334
5537
  };
@@ -5346,11 +5549,17 @@
5346
5549
  times.length = 0;
5347
5550
  isChanged = true;
5348
5551
  }
5552
+ // States
5553
+ var states = this._states;
5554
+ if (states != null) {
5555
+ states.length = 0;
5556
+ isChanged = true;
5557
+ }
5349
5558
  // Change flag
5350
5559
  if (isChanged) {
5351
- var parent_12 = this.parent;
5352
- if (parent_12 != null) {
5353
- parent_12.isChanged = true;
5560
+ var parent_16 = this.parent;
5561
+ if (parent_16 != null) {
5562
+ parent_16.isChanged = true;
5354
5563
  }
5355
5564
  }
5356
5565
  };
@@ -5375,6 +5584,7 @@
5375
5584
  this.range.copy(target.range);
5376
5585
  this._value = target.value;
5377
5586
  this._time = target.time;
5587
+ this._state = target.state;
5378
5588
  this._capacity = target.capacity;
5379
5589
  return this;
5380
5590
  };
@@ -5391,7 +5601,8 @@
5391
5601
  var initial = manager.addResource(this.initial);
5392
5602
  var format = manager.addResource(this.format.trim());
5393
5603
  var range = this.range.serialize(manager);
5394
- return manager.addResource("[".concat(id, ",").concat(initial, ",").concat(format, ",").concat(range, ",").concat(this._capacity, ",").concat(this._order, ",").concat(this.type, ",").concat(this.scope, "]"));
5604
+ var as = manager.addResource(this.as);
5605
+ return manager.addResource("[".concat(id, ",").concat(initial, ",").concat(format, ",").concat(range, ",").concat(this._capacity, ",").concat(this._order, ",").concat(this.type, ",").concat(this.scope, ",").concat(as, "]"));
5395
5606
  };
5396
5607
  EShapeDataValueImpl.prototype.deserialize = function (target, manager) {
5397
5608
  var _a, _b;
@@ -5403,6 +5614,8 @@
5403
5614
  manager.setDataValue(target, parsed);
5404
5615
  }
5405
5616
  this.id = manager.data[parsed[0]] || "";
5617
+ var as = parsed[8];
5618
+ this.as = as != null ? resources[as] || "" : "";
5406
5619
  this.type = (_a = parsed[6]) !== null && _a !== void 0 ? _a : EShapeDataValueType.NUMBER;
5407
5620
  this.scope = (_b = parsed[7]) !== null && _b !== void 0 ? _b : EShapeDataValueScope.PUBLIC;
5408
5621
  this.initial = resources[parsed[1]] || "";
@@ -5588,7 +5801,7 @@
5588
5801
  list.push(value);
5589
5802
  }
5590
5803
  };
5591
- EShapeDataScopedImpl.prototype.set = function (id, value, time, from, to) {
5804
+ EShapeDataScopedImpl.prototype.set = function (id, value, time, state, from, to) {
5592
5805
  var data = this._data;
5593
5806
  if (data == null) {
5594
5807
  return false;
@@ -5610,6 +5823,10 @@
5610
5823
  if (time !== undefined) {
5611
5824
  datumValue.time = time;
5612
5825
  }
5826
+ // State
5827
+ if (state !== undefined) {
5828
+ datumValue.state = state;
5829
+ }
5613
5830
  // Value
5614
5831
  datumValue.value = value;
5615
5832
  }
@@ -5656,6 +5873,7 @@
5656
5873
  * SPDX-License-Identifier: Apache-2.0
5657
5874
  */
5658
5875
  var RANGE_DUMMY;
5876
+ var ALIAS_DUMMY;
5659
5877
  var EShapeDataImpl = /** @class */ (function () {
5660
5878
  function EShapeDataImpl() {
5661
5879
  this._values = [];
@@ -5689,6 +5907,17 @@
5689
5907
  enumerable: false,
5690
5908
  configurable: true
5691
5909
  });
5910
+ Object.defineProperty(EShapeDataImpl.prototype, "as", {
5911
+ get: function () {
5912
+ var values = this._values;
5913
+ if (0 < values.length) {
5914
+ return values[0].as;
5915
+ }
5916
+ return "";
5917
+ },
5918
+ enumerable: false,
5919
+ configurable: true
5920
+ });
5692
5921
  Object.defineProperty(EShapeDataImpl.prototype, "type", {
5693
5922
  get: function () {
5694
5923
  var values = this._values;
@@ -5789,6 +6018,23 @@
5789
6018
  enumerable: false,
5790
6019
  configurable: true
5791
6020
  });
6021
+ Object.defineProperty(EShapeDataImpl.prototype, "state", {
6022
+ get: function () {
6023
+ var values = this._values;
6024
+ if (0 < values.length) {
6025
+ return values[0].state;
6026
+ }
6027
+ return EShapeDataValueState.UNKOWN;
6028
+ },
6029
+ set: function (state) {
6030
+ var values = this._values;
6031
+ if (0 < values.length) {
6032
+ values[0].state = state;
6033
+ }
6034
+ },
6035
+ enumerable: false,
6036
+ configurable: true
6037
+ });
5792
6038
  Object.defineProperty(EShapeDataImpl.prototype, "capacity", {
5793
6039
  get: function () {
5794
6040
  var values = this._values;
@@ -5806,6 +6052,33 @@
5806
6052
  enumerable: false,
5807
6053
  configurable: true
5808
6054
  });
6055
+ Object.defineProperty(EShapeDataImpl.prototype, "alias", {
6056
+ get: function () {
6057
+ var result = this._alias;
6058
+ if (result == null) {
6059
+ result = this.newAlias();
6060
+ this._alias = result;
6061
+ }
6062
+ return result;
6063
+ },
6064
+ enumerable: false,
6065
+ configurable: true
6066
+ });
6067
+ EShapeDataImpl.prototype.newAlias = function () {
6068
+ var values = this._values;
6069
+ var valuesLength = values.length;
6070
+ if (0 < valuesLength) {
6071
+ var result = {};
6072
+ for (var i = 0; i < valuesLength; ++i) {
6073
+ var value = values[i];
6074
+ result[value.as || value.id] = value;
6075
+ }
6076
+ return result;
6077
+ }
6078
+ else {
6079
+ return (ALIAS_DUMMY !== null && ALIAS_DUMMY !== void 0 ? ALIAS_DUMMY : (ALIAS_DUMMY = {}));
6080
+ }
6081
+ };
5809
6082
  Object.defineProperty(EShapeDataImpl.prototype, "mapping", {
5810
6083
  get: function () {
5811
6084
  var result = this._mapping;
@@ -7098,6 +7371,8 @@
7098
7371
  this.sizeX = NaN;
7099
7372
  this.sizeY = NaN;
7100
7373
  this.transformLocalId = NaN;
7374
+ this.scaleX = 1;
7375
+ this.scaleY = 1;
7101
7376
  this.size = NaN;
7102
7377
  this.family = "auto";
7103
7378
  this.value = "";
@@ -7256,12 +7531,25 @@
7256
7531
  var text = shape.text;
7257
7532
  var textOutline = text.outline;
7258
7533
  var textOutlineWidth = textOutline.enable ? textOutline.width : 0;
7534
+ var isOutlineWidthChanged = textOutlineWidth !== this.outlineWidth;
7259
7535
  var textWeight = text.weight;
7260
- if (textWeight !== this.weight || textOutlineWidth !== this.outlineWidth) {
7536
+ var isWeightChanged = textWeight !== this.weight;
7537
+ var scaleX = 1;
7538
+ var scaleY = 1;
7539
+ var textWorld = text.world;
7540
+ if (textWorld != null) {
7541
+ scaleX = textWorld[8];
7542
+ scaleY = textWorld[9];
7543
+ }
7544
+ var isScaleChanged = TEXT_FMIN < Math.abs(this.scaleX - scaleX) ||
7545
+ TEXT_FMIN < Math.abs(this.scaleY - scaleY);
7546
+ if (isWeightChanged || isOutlineWidthChanged || isScaleChanged) {
7261
7547
  this.weight = textWeight;
7262
7548
  this.outlineWidth = textOutlineWidth;
7549
+ this.scaleX = scaleX;
7550
+ this.scaleY = scaleY;
7263
7551
  buffer.updateSteps();
7264
- buildTextStep(buffer.steps, this.vertexOffset, this.vertexCount, text.atlas, text.size, textOutlineWidth, textWeight);
7552
+ buildTextStep(buffer.steps, this.vertexOffset, this.vertexCount, text.atlas, text.size, textOutlineWidth, textWeight, this.scaleX, this.scaleY);
7265
7553
  }
7266
7554
  };
7267
7555
  BuilderText.prototype.buildUnit = function (builder) {
@@ -7962,6 +8250,7 @@
7962
8250
  "try {" +
7963
8251
  "with (shape) {" +
7964
8252
  "with (state) {" +
8253
+ "with (data.alias) {" +
7965
8254
  "with (environment) {" +
7966
8255
  (nullable ?
7967
8256
  ("var result = (".concat(expression, ");") +
@@ -7970,6 +8259,7 @@
7970
8259
  "}" +
7971
8260
  "}" +
7972
8261
  "}" +
8262
+ "}" +
7973
8263
  "} catch (e) {" +
7974
8264
  "return ".concat(defLiteral, ";") +
7975
8265
  "}";
@@ -15880,707 +16170,144 @@
15880
16170
  });
15881
16171
  Object.defineProperty(EShapeGroupTextEditor.prototype, "direction", {
15882
16172
  get: function () {
15883
- var children = this._parent.children;
15884
- if (0 < children.length) {
15885
- return children[children.length - 1].text.direction;
15886
- }
15887
- return 0;
15888
- },
15889
- set: function (direction) {
15890
- var children = this._parent.children;
15891
- for (var i = 0, imax = children.length; i < imax; ++i) {
15892
- children[i].text.direction = direction;
15893
- }
15894
- },
15895
- enumerable: false,
15896
- configurable: true
15897
- });
15898
- Object.defineProperty(EShapeGroupTextEditor.prototype, "clipping", {
15899
- get: function () {
15900
- var children = this._parent.children;
15901
- if (0 < children.length) {
15902
- return children[children.length - 1].text.clipping;
15903
- }
15904
- return false;
15905
- },
15906
- set: function (clipping) {
15907
- var children = this._parent.children;
15908
- for (var i = 0, imax = children.length; i < imax; ++i) {
15909
- children[i].text.clipping = clipping;
15910
- }
15911
- },
15912
- enumerable: false,
15913
- configurable: true
15914
- });
15915
- EShapeGroupTextEditor.prototype.copy = function (target) {
15916
- var children = this._parent.children;
15917
- for (var i = 0, imax = children.length; i < imax; ++i) {
15918
- children[i].text.copy(target);
15919
- }
15920
- return this;
15921
- };
15922
- EShapeGroupTextEditor.prototype.set = function (value, color, alpha, family, size, weight, style, direction) {
15923
- var children = this._parent.children;
15924
- for (var i = 0, imax = children.length; i < imax; ++i) {
15925
- children[i].text.set(value, color, alpha, family, size, weight, style, direction);
15926
- }
15927
- return this;
15928
- };
15929
- EShapeGroupTextEditor.prototype.toObject = function () {
15930
- var children = this._parent.children;
15931
- if (0 < children.length) {
15932
- return children[children.length - 1].text.toObject();
15933
- }
15934
- return {
15935
- value: "",
15936
- color: 0x000000,
15937
- alpha: 1.0,
15938
- family: "auto",
15939
- size: 24,
15940
- weight: EShapeTextWeight.NORMAL,
15941
- align: this.align.toObject(),
15942
- offset: this.offset.toObject(),
15943
- style: EShapeTextStyle.NORMAL,
15944
- outline: this.outline.toObject(),
15945
- spacing: this.spacing.toObject(),
15946
- direction: EShapeTextDirection.LEFT_TO_RIGHT,
15947
- padding: this.padding.toObject(),
15948
- clipping: false
15949
- };
15950
- };
15951
- EShapeGroupTextEditor.prototype.serialize = function (manager) {
15952
- return -1;
15953
- };
15954
- EShapeGroupTextEditor.prototype.deserialize = function (target, manager) {
15955
- // DO NOTHING
15956
- };
15957
- return EShapeGroupTextEditor;
15958
- }());
15959
-
15960
- /*
15961
- * Copyright (C) 2019 Toshiba Corporation
15962
- * SPDX-License-Identifier: Apache-2.0
15963
- */
15964
- var EShapeGroupFillViewer = /** @class */ (function () {
15965
- function EShapeGroupFillViewer() {
15966
- // DO NOTHING
15967
- }
15968
- Object.defineProperty(EShapeGroupFillViewer.prototype, "enable", {
15969
- get: function () {
15970
- return true;
15971
- },
15972
- set: function (enable) {
15973
- // DO NOTHING
15974
- },
15975
- enumerable: false,
15976
- configurable: true
15977
- });
15978
- Object.defineProperty(EShapeGroupFillViewer.prototype, "color", {
15979
- get: function () {
15980
- return 0xffffff;
15981
- },
15982
- set: function (color) {
15983
- // DO NOTHING
15984
- },
15985
- enumerable: false,
15986
- configurable: true
15987
- });
15988
- Object.defineProperty(EShapeGroupFillViewer.prototype, "alpha", {
15989
- get: function () {
15990
- return 1.0;
15991
- },
15992
- set: function (alpha) {
15993
- // DO NOTHING
15994
- },
15995
- enumerable: false,
15996
- configurable: true
15997
- });
15998
- EShapeGroupFillViewer.prototype.copy = function (target) {
15999
- // DO NOTHING
16000
- };
16001
- EShapeGroupFillViewer.prototype.set = function (enable, color, alpha) {
16002
- // DO NOTHING
16003
- };
16004
- EShapeGroupFillViewer.prototype.clone = function () {
16005
- return new EShapeGroupFillViewer();
16006
- };
16007
- EShapeGroupFillViewer.prototype.toObject = function () {
16008
- return {
16009
- enable: true,
16010
- color: 0xffffff,
16011
- alpha: 1.0
16012
- };
16013
- };
16014
- EShapeGroupFillViewer.prototype.serialize = function (manager) {
16015
- return -1;
16016
- };
16017
- EShapeGroupFillViewer.prototype.deserialize = function (target, manager) {
16018
- // DO NOTHING
16019
- };
16020
- return EShapeGroupFillViewer;
16021
- }());
16022
-
16023
- /*
16024
- * Copyright (C) 2019 Toshiba Corporation
16025
- * SPDX-License-Identifier: Apache-2.0
16026
- */
16027
- /* eslint-disable prettier/prettier */
16028
- var NONE = 0x0;
16029
- var ID = 0x1;
16030
- var POSITION = 0x2;
16031
- var WIDTH = 0x4;
16032
- var HEIGHT = 0x8;
16033
- var ROTATION = 0x10;
16034
- var SKEW = 0x20;
16035
- var REPLACING = 0x40;
16036
- var GROUPING = 0x80;
16037
- var UNGROUPING = 0x100;
16038
- var FILL = 0x200;
16039
- var STROKE = 0x400;
16040
- var STROKE_SIDE = 0x800;
16041
- var BORDER_RADIUS = 0x1000;
16042
- var TEXT = 0x2000;
16043
- var TEXTURE = 0x4000;
16044
- var DATA = 0x8000;
16045
- var ACTION = 0x10000;
16046
- var CURSOR = 0x20000;
16047
- var ORDER_IN_LAYER = 0x40000;
16048
- var CHILDREN = 0x80000;
16049
- var DATA_MAPPING = 0x100000;
16050
- var COORDINATE = ID | POSITION | WIDTH | HEIGHT | ROTATION | SKEW;
16051
- var SHAPE = REPLACING | GROUPING | FILL | STROKE;
16052
- var LAYER = ORDER_IN_LAYER;
16053
- var PRIMITIVE = COORDINATE | SHAPE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
16054
- var GROUP = PRIMITIVE | UNGROUPING;
16055
- var EMBEDDED = COORDINATE | REPLACING | GROUPING | TEXT | DATA | ACTION | LAYER | DATA_MAPPING;
16056
- var CONNECTOR = ID | REPLACING | FILL | STROKE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
16057
- var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
16058
- var EShapeCapability = {
16059
- NONE: NONE,
16060
- /**
16061
- * Allows shape IDs to be modified.
16062
- */
16063
- ID: ID,
16064
- /**
16065
- * Allows shape positions to be modified.
16066
- */
16067
- POSITION: POSITION,
16068
- /**
16069
- * Allows shape widths to be modified.
16070
- */
16071
- WIDTH: WIDTH,
16072
- /**
16073
- * Allows shape heights to be modified.
16074
- */
16075
- HEIGHT: HEIGHT,
16076
- /**
16077
- * Allows shape rotations to be modified.
16078
- */
16079
- ROTATION: ROTATION,
16080
- /**
16081
- * Allows shape skews to be modified.
16082
- */
16083
- SKEW: SKEW,
16084
- /** @deprecated */
16085
- ALIGN: NONE,
16086
- /**
16087
- * Allows shapes to be replaced with other shapes.
16088
- */
16089
- REPLACING: REPLACING,
16090
- /**
16091
- * Allows shapes to be grouped.
16092
- */
16093
- GROUPING: GROUPING,
16094
- /**
16095
- * Allows grouped shapes to be ungrouped.
16096
- */
16097
- UNGROUPING: UNGROUPING,
16098
- /**
16099
- * Allows shape fills to be modified.
16100
- */
16101
- FILL: FILL,
16102
- /**
16103
- * Allows shape strokes to be modified.
16104
- */
16105
- STROKE: STROKE,
16106
- /**
16107
- * Allows shape stroke sides to be modified.
16108
- */
16109
- STROKE_SIDE: STROKE_SIDE,
16110
- /**
16111
- * Allows shape border radiuses to be modified.
16112
- */
16113
- BORDER_RADIUS: BORDER_RADIUS,
16114
- /**
16115
- * Allows shape texts to be modified.
16116
- */
16117
- TEXT: TEXT,
16118
- /**
16119
- * Allows shape textures to be modified.
16120
- */
16121
- TEXTURE: TEXTURE,
16122
- /** @deprecated in favor of {@link DATA} */
16123
- TAG: DATA,
16124
- /**
16125
- * Allows shape data to be modified.
16126
- */
16127
- DATA: DATA,
16128
- /**
16129
- * Allows shape data mapping to be modified.
16130
- */
16131
- DATA_MAPPING: DATA_MAPPING,
16132
- /**
16133
- * Allows shape actions to be modified.
16134
- */
16135
- ACTION: ACTION,
16136
- /**
16137
- * Allows shape cursors to be modified.
16138
- */
16139
- CURSOR: CURSOR,
16140
- /**
16141
- * Allows shape orders in layer to be modified.
16142
- */
16143
- ORDER_IN_LAYER: ORDER_IN_LAYER,
16144
- /**
16145
- * Allows shape children to be modified.
16146
- */
16147
- CHILDREN: CHILDREN,
16148
- COORDINATE: COORDINATE,
16149
- SHAPE: SHAPE,
16150
- LAYER: LAYER,
16151
- PRIMITIVE: PRIMITIVE,
16152
- GROUP: GROUP,
16153
- EMBEDDED: EMBEDDED,
16154
- CONNECTOR: CONNECTOR,
16155
- ALL: ALL
16156
- };
16157
-
16158
- /*
16159
- * Copyright (C) 2019 Toshiba Corporation
16160
- * SPDX-License-Identifier: Apache-2.0
16161
- */
16162
- var EShapeCapabilities = /** @class */ (function () {
16163
- function EShapeCapabilities() {
16164
- }
16165
- EShapeCapabilities.get = function (type) {
16166
- var capability = this.mappings[type];
16167
- if (capability != null) {
16168
- return capability;
16169
- }
16170
- return EShapeCapability.PRIMITIVE;
16171
- };
16172
- EShapeCapabilities.contains = function (shape, target) {
16173
- if (shape != null) {
16174
- var capability = this.get(shape.type);
16175
- if (capability & target) {
16176
- return true;
16177
- }
16178
- if (capability & EShapeCapability.CHILDREN) {
16179
- var children = shape.children;
16180
- for (var i = 0, imax = children.length; i < imax; ++i) {
16181
- if (this.contains(children[i], target)) {
16182
- return true;
16183
- }
16184
- }
16185
- }
16186
- }
16187
- return false;
16188
- };
16189
- EShapeCapabilities.set = function (type, capability) {
16190
- this.mappings[type] = capability;
16191
- };
16192
- EShapeCapabilities.mappings = {};
16193
- return EShapeCapabilities;
16194
- }());
16195
-
16196
- /*
16197
- * Copyright (C) 2019 Toshiba Corporation
16198
- * SPDX-License-Identifier: Apache-2.0
16199
- */
16200
- var EShapeEditor = /** @class */ (function () {
16201
- function EShapeEditor() {
16202
- this.localTransform = new pixi_js.Matrix();
16203
- this.internalTransform = new pixi_js.Matrix();
16204
- this.internalTransformParentInverse = new pixi_js.Matrix();
16205
- this.rotation = 0;
16206
- this.size = new pixi_js.Point();
16207
- }
16208
- return EShapeEditor;
16209
- }());
16210
-
16211
- /*
16212
- * Copyright (C) 2019 Toshiba Corporation
16213
- * SPDX-License-Identifier: Apache-2.0
16214
- */
16215
- var toSizeNormalized = function (size) {
16216
- var THRESHOLD = 0.001;
16217
- if (Math.abs(size) < THRESHOLD) {
16218
- return size < 0 ? -THRESHOLD : +THRESHOLD;
16219
- }
16220
- return size;
16221
- };
16222
-
16223
- /*
16224
- * Copyright (C) 2019 Toshiba Corporation
16225
- * SPDX-License-Identifier: Apache-2.0
16226
- */
16227
- var EShapeTransforms = /** @class */ (function () {
16228
- function EShapeTransforms() {
16229
- }
16230
- EShapeTransforms.prepare = function (shape) {
16231
- var editor = shape.editor || new EShapeEditor();
16232
- shape.editor = editor;
16233
- // Transform
16234
- shape.updateTransform();
16235
- var parent = shape.parent;
16236
- if (parent instanceof EShapeBase) {
16237
- parent.transform.internalTransform
16238
- .copyTo(editor.internalTransformParentInverse)
16239
- .invert();
16240
- }
16241
- else {
16242
- editor.internalTransformParentInverse.identity();
16243
- }
16244
- shape.transform.internalTransform.copyTo(editor.internalTransform);
16245
- // Rotation
16246
- editor.rotation = shape.transform.rotation;
16247
- // Size
16248
- editor.size.copyFrom(shape.size);
16249
- //
16250
- shape.disallowOnTransformChange();
16251
- };
16252
- EShapeTransforms.finalize = function (shape) {
16253
- shape.allowOnTransformChange(true);
16254
- };
16255
- EShapeTransforms.apply = function (shape, transform, keepSize) {
16256
- var editor = shape.editor;
16257
- if (editor != null) {
16258
- var newLocalTransform = editor.localTransform;
16259
- editor.internalTransformParentInverse
16260
- .copyTo(newLocalTransform)
16261
- .append(transform)
16262
- .append(editor.internalTransform);
16263
- if (keepSize) {
16264
- this.applyLocal(shape, newLocalTransform);
16265
- }
16266
- else {
16267
- var size = editor.size;
16268
- this.applyLocal(shape, newLocalTransform, size.x, size.y);
16269
- }
16270
- }
16271
- };
16272
- EShapeTransforms.applyLocal = function (shape, localTransform, bx, by) {
16273
- shape.disallowUploadedUpdate();
16274
- // Reconstruct the position, the rotation and the size
16275
- var a = localTransform.a;
16276
- var b = localTransform.b;
16277
- var c = localTransform.c;
16278
- var d = localTransform.d;
16279
- var tx = localTransform.tx;
16280
- var ty = localTransform.ty;
16281
- // Rotation
16282
- var transform = shape.transform;
16283
- var rx = Math.atan2(-c, d); // rotation - skewX
16284
- var ry = Math.atan2(+b, a); // rotation + skewY
16285
- transform.rotation = (rx + ry) * 0.5; // Here, assumes `skewX` === `skewY`
16286
- // Skew
16287
- var skew = (ry - rx) * 0.5;
16288
- transform.skew.set(skew, skew);
16289
- // Position: Assumes the pivot is invariant.
16290
- // tx = position.x - (a * px + c * py)
16291
- // ty = position.y - (b * px + d * py)
16292
- //
16293
- // Thus,
16294
- // position.x = tx + (a * px + c * py)
16295
- // position.y = ty + (b * px + d * py)
16296
- var pivot = transform.pivot;
16297
- var px = pivot.x;
16298
- var py = pivot.y;
16299
- transform.position.set(tx + (a * px + c * py), ty + (b * px + d * py));
16300
- // Scale
16301
- if (bx != null && by != null) {
16302
- var sx = Math.sqrt(a * a + b * b);
16303
- var sy = Math.sqrt(c * c + d * d);
16304
- shape.size.set(toSizeNormalized(bx * sx), toSizeNormalized(by * sy));
16305
- }
16306
- //
16307
- shape.allowUploadedUpdate();
16308
- };
16309
- return EShapeTransforms;
16310
- }());
16311
-
16312
- /*
16313
- * Copyright (C) 2019 Toshiba Corporation
16314
- * SPDX-License-Identifier: Apache-2.0
16315
- */
16316
- var EShapeGroupSizeLayout = /** @class */ (function () {
16317
- function EShapeGroupSizeLayout(shape, bx, by) {
16318
- this.shape = shape;
16319
- // Base group size
16320
- this.base = new pixi_js.Point(bx, by);
16321
- // Base shape size
16322
- var size = shape.size;
16323
- this.shapeBase = new pixi_js.Point(size.x, size.y);
16324
- // Transform
16325
- this.transform = new pixi_js.Matrix();
16326
- shape.updateTransform();
16327
- shape.transform.localTransform.copyTo(this.transform);
16328
- this.capable =
16329
- EShapeCapabilities.contains(shape, EShapeCapability.POSITION) &&
16330
- EShapeCapabilities.contains(shape, EShapeCapability.WIDTH) &&
16331
- EShapeCapabilities.contains(shape, EShapeCapability.HEIGHT) &&
16332
- EShapeCapabilities.contains(shape, EShapeCapability.ROTATION) &&
16333
- EShapeCapabilities.contains(shape, EShapeCapability.SKEW);
16334
- }
16335
- EShapeGroupSizeLayout.prototype.isCompatible = function (shape) {
16336
- return this.shape === shape;
16337
- };
16338
- EShapeGroupSizeLayout.prototype.reset = function (shape, baseX, baseY) {
16339
- this.base.set(baseX, baseY);
16340
- // Base shape size
16341
- var size = shape.size;
16342
- this.shapeBase.copyFrom(size);
16343
- // Transform
16344
- shape.updateTransform();
16345
- shape.transform.localTransform.copyTo(this.transform);
16346
- };
16347
- EShapeGroupSizeLayout.prototype.update = function (shape, baseX, baseY, pivotX, pivotY) {
16348
- if (!this.capable) {
16349
- return;
16350
- }
16351
- var sx = baseX / this.base.x;
16352
- var sy = baseY / this.base.y;
16353
- var childBase = this.shapeBase;
16354
- var transform = EShapeGroupSizeLayout.WORK_TRANSFORM;
16355
- transform
16356
- .identity()
16357
- .append(this.transform)
16358
- .translate(-pivotX, -pivotY)
16359
- .scale(sx, sy)
16360
- .translate(+pivotX, +pivotY);
16361
- shape.disallowOnTransformChange();
16362
- EShapeTransforms.applyLocal(shape, transform, childBase.x, childBase.y);
16363
- shape.allowOnTransformChange(false);
16364
- };
16365
- EShapeGroupSizeLayout.WORK_TRANSFORM = new pixi_js.Matrix();
16366
- return EShapeGroupSizeLayout;
16367
- }());
16368
-
16369
- /*
16370
- * Copyright (C) 2019 Toshiba Corporation
16371
- * SPDX-License-Identifier: Apache-2.0
16372
- */
16373
- var EShapeGroupSizeEditor = /** @class */ (function () {
16374
- function EShapeGroupSizeEditor(parent, x, y, isFittable) {
16375
- this._workRectForCalcRect = new pixi_js.Rectangle();
16376
- this._workRectForFit = new pixi_js.Rectangle();
16377
- this._parent = parent;
16378
- this._layouts = [];
16379
- this._size = new pixi_js.Point(x, y);
16380
- this._isFittable = isFittable;
16381
- }
16382
- EShapeGroupSizeEditor.prototype.init = function () {
16383
- // DO NOTHING
16384
- };
16385
- Object.defineProperty(EShapeGroupSizeEditor.prototype, "x", {
16386
- get: function () {
16387
- return this._size.x;
16173
+ var children = this._parent.children;
16174
+ if (0 < children.length) {
16175
+ return children[children.length - 1].text.direction;
16176
+ }
16177
+ return 0;
16388
16178
  },
16389
- set: function (x) {
16390
- var size = this._size;
16391
- if (size.x !== x) {
16392
- var ox = size.x;
16393
- size.x = x;
16394
- this.onChange(ox, size.y);
16179
+ set: function (direction) {
16180
+ var children = this._parent.children;
16181
+ for (var i = 0, imax = children.length; i < imax; ++i) {
16182
+ children[i].text.direction = direction;
16395
16183
  }
16396
16184
  },
16397
16185
  enumerable: false,
16398
16186
  configurable: true
16399
16187
  });
16400
- Object.defineProperty(EShapeGroupSizeEditor.prototype, "y", {
16188
+ Object.defineProperty(EShapeGroupTextEditor.prototype, "clipping", {
16401
16189
  get: function () {
16402
- return this._size.y;
16190
+ var children = this._parent.children;
16191
+ if (0 < children.length) {
16192
+ return children[children.length - 1].text.clipping;
16193
+ }
16194
+ return false;
16403
16195
  },
16404
- set: function (y) {
16405
- var size = this._size;
16406
- if (size.y !== y) {
16407
- var oy = size.y;
16408
- size.y = y;
16409
- this.onChange(size.x, oy);
16196
+ set: function (clipping) {
16197
+ var children = this._parent.children;
16198
+ for (var i = 0, imax = children.length; i < imax; ++i) {
16199
+ children[i].text.clipping = clipping;
16410
16200
  }
16411
16201
  },
16412
16202
  enumerable: false,
16413
16203
  configurable: true
16414
16204
  });
16415
- EShapeGroupSizeEditor.prototype.set = function (x, y) {
16416
- var isChanged = false;
16417
- var size = this._size;
16418
- var ox = size.x;
16419
- var oy = size.y;
16420
- if (x != null && ox !== x) {
16421
- isChanged = true;
16422
- size.x = x;
16423
- }
16424
- if (y != null && oy !== y) {
16425
- isChanged = true;
16426
- size.y = y;
16427
- }
16428
- if (isChanged) {
16429
- this.onChange(ox, oy);
16205
+ EShapeGroupTextEditor.prototype.copy = function (target) {
16206
+ var children = this._parent.children;
16207
+ for (var i = 0, imax = children.length; i < imax; ++i) {
16208
+ children[i].text.copy(target);
16430
16209
  }
16431
16210
  return this;
16432
16211
  };
16433
- EShapeGroupSizeEditor.prototype.clone = function () {
16434
- var size = this._size;
16435
- return new EShapeGroupSizeEditor(this._parent, size.x, size.y, this._isFittable);
16436
- };
16437
- EShapeGroupSizeEditor.prototype.copy = function () {
16438
- // DO NOTHING
16439
- };
16440
- EShapeGroupSizeEditor.prototype.copyFrom = function (point) {
16441
- var x = point.x;
16442
- var y = point.y;
16443
- var size = this._size;
16444
- var ox = size.x;
16445
- var oy = size.y;
16446
- if (ox !== x || oy !== y) {
16447
- size.x = x;
16448
- size.y = y;
16449
- this.onChange(ox, oy);
16212
+ EShapeGroupTextEditor.prototype.set = function (value, color, alpha, family, size, weight, style, direction) {
16213
+ var children = this._parent.children;
16214
+ for (var i = 0, imax = children.length; i < imax; ++i) {
16215
+ children[i].text.set(value, color, alpha, family, size, weight, style, direction);
16450
16216
  }
16451
16217
  return this;
16452
16218
  };
16453
- EShapeGroupSizeEditor.prototype.copyTo = function (point) {
16454
- return this._size.copyTo(point);
16219
+ EShapeGroupTextEditor.prototype.toObject = function () {
16220
+ var children = this._parent.children;
16221
+ if (0 < children.length) {
16222
+ return children[children.length - 1].text.toObject();
16223
+ }
16224
+ return {
16225
+ value: "",
16226
+ color: 0x000000,
16227
+ alpha: 1.0,
16228
+ family: "auto",
16229
+ size: 24,
16230
+ weight: EShapeTextWeight.NORMAL,
16231
+ align: this.align.toObject(),
16232
+ offset: this.offset.toObject(),
16233
+ style: EShapeTextStyle.NORMAL,
16234
+ outline: this.outline.toObject(),
16235
+ spacing: this.spacing.toObject(),
16236
+ direction: EShapeTextDirection.LEFT_TO_RIGHT,
16237
+ padding: this.padding.toObject(),
16238
+ clipping: false
16239
+ };
16455
16240
  };
16456
- EShapeGroupSizeEditor.prototype.equals = function (point) {
16457
- return this._size.equals(point);
16241
+ EShapeGroupTextEditor.prototype.serialize = function (manager) {
16242
+ return -1;
16458
16243
  };
16459
- EShapeGroupSizeEditor.prototype.fit = function () {
16460
- if (this._isFittable) {
16461
- this.doFit();
16462
- }
16244
+ EShapeGroupTextEditor.prototype.deserialize = function (target, manager) {
16245
+ // DO NOTHING
16463
16246
  };
16464
- EShapeGroupSizeEditor.prototype.doFit = function () {
16465
- var parent = this._parent;
16466
- parent.disallowOnTransformChange();
16467
- // Calculate the rect
16468
- var rect = this.calcRect(this._workRectForFit);
16469
- // Set size
16470
- var size = this._size;
16471
- size.set(rect.width, rect.height);
16472
- // Position & Pivot
16473
- // rx := rect.x
16474
- // ry := rect.y
16475
- //
16476
- // | a c tx | | 1 0 +rx | | 1 0 -rx | | a c tx + (a * rx + c * ry) | | 1 0 -rx |
16477
- // | b d ty | | 0 1 +ry | | 0 1 -ry | = | b d ty + (b * rx + d * ry) | | 0 1 -ry |
16478
- // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |
16479
- //
16480
- // tx -> tx + (a * rx + c * ry) = poxition.x - (a * pivot.x + c * pivot.y)
16481
- // ty -> ty + (b * rx + d * ry) = poxition.y - (b * pivot.x + d * pivot.y)
16482
- // position.x -> position.x + (a * rx + c * ry) - (a * pivot.x + c * pivot.y)
16483
- // position.y -> position.y + (b * rx + d * ry) - (b * pivot.x + d * pivot.y)
16484
- // pivot.x -> 0
16485
- // pivot.y -> 0
16486
- //
16487
- // a -> a', b -> b', c -> c', tx -> tx', ty -> ty'
16488
- //
16489
- // | a' c' tx' | | 1 0 -rx | | a' c' tx' - (a' * rx + c' * ry) |
16490
- // | b' d' ty' | | 0 1 -ry | = | b' d' ty' - (b' * rx + d' * ry) |
16491
- // | 0 0 1 | | 0 0 1 | | 0 0 1 |
16492
- //
16493
- // tx' -> tx' - (a' * rx + c' * ry) = poxition.x - (a' * pivot.x + c' * pivot.y)
16494
- // ty' -> ty' - (b' * rx + d' * ry) = poxition.y - (b' * pivot.x + d' * pivot.y)
16495
- // pivot.x -> pivot.x + rx
16496
- // pivot.y -> pivot.y + ry
16497
- parent.updateTransform();
16498
- var transform = parent.transform;
16499
- var x = rect.x + rect.width * 0.5;
16500
- var y = rect.y + rect.height * 0.5;
16501
- var position = transform.position;
16502
- var localTransform = transform.localTransform;
16503
- var a = localTransform.a;
16504
- var b = localTransform.b;
16505
- var c = localTransform.c;
16506
- var d = localTransform.d;
16507
- var pivot = transform.pivot;
16508
- position.set(position.x + (a * x + c * y) - (a * pivot.x + c * pivot.y), position.y + (b * x + d * y) - (b * pivot.x + d * pivot.y));
16509
- pivot.set(x, y);
16510
- // Reset the data
16511
- this.reset(parent.children, this._layouts, size);
16512
- //
16513
- parent.allowOnTransformChange(true);
16247
+ return EShapeGroupTextEditor;
16248
+ }());
16249
+
16250
+ /*
16251
+ * Copyright (C) 2019 Toshiba Corporation
16252
+ * SPDX-License-Identifier: Apache-2.0
16253
+ */
16254
+ var EShapeGroupFillViewer = /** @class */ (function () {
16255
+ function EShapeGroupFillViewer() {
16256
+ // DO NOTHING
16257
+ }
16258
+ Object.defineProperty(EShapeGroupFillViewer.prototype, "enable", {
16259
+ get: function () {
16260
+ return true;
16261
+ },
16262
+ set: function (enable) {
16263
+ // DO NOTHING
16264
+ },
16265
+ enumerable: false,
16266
+ configurable: true
16267
+ });
16268
+ Object.defineProperty(EShapeGroupFillViewer.prototype, "color", {
16269
+ get: function () {
16270
+ return 0xffffff;
16271
+ },
16272
+ set: function (color) {
16273
+ // DO NOTHING
16274
+ },
16275
+ enumerable: false,
16276
+ configurable: true
16277
+ });
16278
+ Object.defineProperty(EShapeGroupFillViewer.prototype, "alpha", {
16279
+ get: function () {
16280
+ return 1.0;
16281
+ },
16282
+ set: function (alpha) {
16283
+ // DO NOTHING
16284
+ },
16285
+ enumerable: false,
16286
+ configurable: true
16287
+ });
16288
+ EShapeGroupFillViewer.prototype.copy = function (target) {
16289
+ // DO NOTHING
16514
16290
  };
16515
- EShapeGroupSizeEditor.prototype.reset = function (children, layouts, size) {
16516
- for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
16517
- var child = children[i];
16518
- var layout = layouts[i];
16519
- if (layout.isCompatible(child)) {
16520
- layout.reset(child, size.x, size.y);
16521
- }
16522
- else {
16523
- layouts.length = i;
16524
- break;
16525
- }
16526
- }
16527
- if (children.length < layouts.length) {
16528
- layouts.length = children.length;
16529
- }
16291
+ EShapeGroupFillViewer.prototype.set = function (enable, color, alpha) {
16292
+ // DO NOTHING
16530
16293
  };
16531
- EShapeGroupSizeEditor.prototype.calcRect = function (result) {
16532
- var parent = this._parent;
16533
- var children = parent.children;
16534
- if (children.length <= 0) {
16535
- result.x = 0;
16536
- result.y = 0;
16537
- result.width = 0;
16538
- result.height = 0;
16539
- }
16540
- else {
16541
- var workRect = this._workRectForCalcRect;
16542
- children[0].getBoundsLocal(false, result);
16543
- for (var i = 1, imax = children.length; i < imax; ++i) {
16544
- var child = children[i];
16545
- child.getBoundsLocal(false, workRect);
16546
- result.enlarge(workRect);
16547
- }
16548
- }
16549
- return result;
16294
+ EShapeGroupFillViewer.prototype.clone = function () {
16295
+ return new EShapeGroupFillViewer();
16550
16296
  };
16551
- EShapeGroupSizeEditor.prototype.onChange = function (ox, oy) {
16552
- var parent = this._parent;
16553
- var size = this._size;
16554
- var pivot = parent.transform.pivot;
16555
- this.onChange_(parent.children, this._layouts, size.x, size.y, pivot.x, pivot.y, ox, oy);
16556
- parent.onSizeChange();
16297
+ EShapeGroupFillViewer.prototype.toObject = function () {
16298
+ return {
16299
+ enable: true,
16300
+ color: 0xffffff,
16301
+ alpha: 1.0
16302
+ };
16557
16303
  };
16558
- EShapeGroupSizeEditor.prototype.onChange_ = function (children, layouts, sx, sy, px, py, ox, oy) {
16559
- for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
16560
- var child = children[i];
16561
- var layout = layouts[i];
16562
- if (layout.isCompatible(child)) {
16563
- layout.update(child, sx, sy, px, py);
16564
- }
16565
- else {
16566
- layouts.length = i;
16567
- break;
16568
- }
16569
- }
16570
- for (var i = layouts.length, imax = children.length; i < imax; ++i) {
16571
- var child = children[i];
16572
- var layout = this.newLayout(child, ox, oy);
16573
- layout.update(child, sx, sy, px, py);
16574
- layouts.push(layout);
16575
- }
16576
- if (layouts.length !== children.length) {
16577
- layouts.length = children.length;
16578
- }
16304
+ EShapeGroupFillViewer.prototype.serialize = function (manager) {
16305
+ return -1;
16579
16306
  };
16580
- EShapeGroupSizeEditor.prototype.newLayout = function (shape, ox, oy) {
16581
- return shape.layout || new EShapeGroupSizeLayout(shape, ox, oy);
16307
+ EShapeGroupFillViewer.prototype.deserialize = function (target, manager) {
16308
+ // DO NOTHING
16582
16309
  };
16583
- return EShapeGroupSizeEditor;
16310
+ return EShapeGroupFillViewer;
16584
16311
  }());
16585
16312
 
16586
16313
  /*
@@ -17209,34 +16936,21 @@
17209
16936
  */
17210
16937
  var EShapeGroupViewer = /** @class */ (function (_super) {
17211
16938
  __extends(EShapeGroupViewer, _super);
17212
- function EShapeGroupViewer(isEditMode, type) {
16939
+ function EShapeGroupViewer(type) {
17213
16940
  var _this = _super.call(this, type) || this;
17214
- _this._isEditMode = isEditMode;
17215
16941
  var data = _this.newData();
17216
16942
  _this.data = data;
17217
16943
  _this.tag = data;
17218
- _this.size = _this.newGroupSize(isEditMode);
16944
+ _this.size = _this.newGroupSize();
17219
16945
  _this.fill = _this.newGroupFill();
17220
16946
  _this.stroke = _this.newGroupStroke();
17221
16947
  _this.text = _this.newGroupText();
17222
16948
  return _this;
17223
16949
  }
17224
- Object.defineProperty(EShapeGroupViewer.prototype, "isEditMode", {
17225
- get: function () {
17226
- return this._isEditMode;
17227
- },
17228
- enumerable: false,
17229
- configurable: true
17230
- });
17231
- EShapeGroupViewer.prototype.newGroupSize = function (isEditMode) {
16950
+ EShapeGroupViewer.prototype.newGroupSize = function () {
17232
16951
  var sizeX = EShapeDefaults.SIZE_X;
17233
16952
  var sizeY = EShapeDefaults.SIZE_Y;
17234
- if (isEditMode) {
17235
- return new EShapeGroupSizeEditor(this, sizeX, sizeY, this.isGroupSizeFittable());
17236
- }
17237
- else {
17238
- return new EShapeGroupSizeViewer(this, sizeX, sizeY, sizeX, sizeY);
17239
- }
16953
+ return new EShapeGroupSizeViewer(this, sizeX, sizeY, sizeX, sizeY);
17240
16954
  };
17241
16955
  EShapeGroupViewer.prototype.isGroupSizeFittable = function () {
17242
16956
  return true;
@@ -17334,9 +17048,9 @@
17334
17048
 
17335
17049
  var EShapeEmbedded = /** @class */ (function (_super) {
17336
17050
  __extends(EShapeEmbedded, _super);
17337
- function EShapeEmbedded(name, isEditMode, type) {
17051
+ function EShapeEmbedded(name, type) {
17338
17052
  if (type === void 0) { type = EShapeType.EMBEDDED; }
17339
- var _this = _super.call(this, isEditMode, type) || this;
17053
+ var _this = _super.call(this, type) || this;
17340
17054
  _this._name = name;
17341
17055
  return _this;
17342
17056
  }
@@ -17367,7 +17081,7 @@
17367
17081
  };
17368
17082
  EShapeEmbedded.prototype.newClone = function () {
17369
17083
  var constructor = this.constructor;
17370
- return new constructor(this._name, this._isEditMode, this.type);
17084
+ return new constructor(this._name, this.type);
17371
17085
  };
17372
17086
  EShapeEmbedded.prototype.serializeChildren = function (manager) {
17373
17087
  return [];
@@ -19960,7 +19674,7 @@
19960
19674
  * SPDX-License-Identifier: Apache-2.0
19961
19675
  */
19962
19676
  var VERTEX_SHADER$2 = "\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n";
19963
- var FRAGMENT_SHADER$2 = "\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\n\tfloat xl = mix( xd - 1.0, xd, (0.5 - l) / (m - l) );\n\tfloat yt = mix( yd - 1.0, yd, (0.5 - t) / (m - t) );\n\n\tbool bl = ( min(l, m) < 0.5 && 0.5 <= max(l, m) );\n\tbool bt = ( min(t, m) < 0.5 && 0.5 <= max(t, m) );\n\n\tfloat ll = (bl ? length( vec2( xl - x, yd - y ) ) : 100.0);\n\tfloat lt = (bt ? length( vec2( xd - x, yt - y ) ) : 100.0);\n\n\treturn min( ll, lt );\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n";
19677
+ var FRAGMENT_SHADER$2 = "\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n";
19964
19678
  var DynamicSDFFontGenerator = /** @class */ (function () {
19965
19679
  function DynamicSDFFontGenerator() {
19966
19680
  var _this = this;
@@ -21325,9 +21039,9 @@
21325
21039
  */
21326
21040
  var EShapeEmbeddedLayer = /** @class */ (function (_super) {
21327
21041
  __extends(EShapeEmbeddedLayer, _super);
21328
- function EShapeEmbeddedLayer(name, isEditMode, type) {
21042
+ function EShapeEmbeddedLayer(name, type) {
21329
21043
  if (type === void 0) { type = EShapeType.EMBEDDED_LAYER; }
21330
- var _this = _super.call(this, isEditMode, type) || this;
21044
+ var _this = _super.call(this, type) || this;
21331
21045
  _this._name = name;
21332
21046
  return _this;
21333
21047
  }
@@ -21359,7 +21073,7 @@
21359
21073
  };
21360
21074
  EShapeEmbeddedLayer.prototype.newClone = function () {
21361
21075
  var constructor = this.constructor;
21362
- return new constructor(this._name, this._isEditMode, this.type);
21076
+ return new constructor(this._name, this.type);
21363
21077
  };
21364
21078
  EShapeEmbeddedLayer.prototype.serializeChildren = function (manager) {
21365
21079
  return [];
@@ -21799,9 +21513,7 @@
21799
21513
  var deserializeEmbeddedLayer = function (serialized, manager, width, height, creator) {
21800
21514
  var _a, _b, _c;
21801
21515
  var name = deserializeEmbeddedLayerName(serialized[0], manager);
21802
- var result = creator
21803
- ? creator(name, manager)
21804
- : new EShapeEmbeddedLayer(name, manager.isEditMode);
21516
+ var result = creator ? creator(name, manager) : new EShapeEmbeddedLayer(name);
21805
21517
  var visibility = serialized[1];
21806
21518
  var visible = visibility == null || !!(visibility & 0x2);
21807
21519
  if (!visible) {
@@ -21814,6 +21526,7 @@
21814
21526
  var sizeX = (_a = serialized[4]) !== null && _a !== void 0 ? _a : width;
21815
21527
  var sizeY = (_b = serialized[5]) !== null && _b !== void 0 ? _b : height;
21816
21528
  result.size.set(sizeX, sizeY);
21529
+ result.size.init();
21817
21530
  var fillId = serialized[6];
21818
21531
  if (fillId != null) {
21819
21532
  result.fill.deserialize(fillId, manager);
@@ -22109,42 +21822,42 @@
22109
21822
  }
22110
21823
  }
22111
21824
  };
22112
- EShapeActionRuntimes.write = function (shape, id, value, time, remote) {
21825
+ EShapeActionRuntimes.writeLocal = function (shape, id, value, time, state) {
22113
21826
  var _a;
22114
- if (remote) {
22115
- var container = this.toContainer(shape);
22116
- if (container) {
22117
- return container.data.remote.set(id, value, time);
22118
- }
22119
- }
22120
- else {
22121
- var current = shape;
22122
- while (current != null) {
22123
- if (this.isContainer(current)) {
22124
- if (current.data.private.set(id, value, time)) {
22125
- DApplications.update(current);
22126
- return true;
22127
- }
22128
- else if (current.data.protected.set(id, value, time)) {
22129
- DApplications.update(current);
22130
- return true;
22131
- }
22132
- else {
22133
- if (current.data.set(id, value, time)) {
22134
- DApplications.update(current);
22135
- return true;
22136
- }
22137
- }
22138
- return false;
21827
+ if (state === void 0) { state = EShapeDataValueState.FOUND; }
21828
+ var current = shape;
21829
+ while (current != null) {
21830
+ if (this.isContainer(current)) {
21831
+ if (current.data.private.set(id, value, time, state)) {
21832
+ DApplications.update(current);
21833
+ return true;
21834
+ }
21835
+ else if (current.data.protected.set(id, value, time, state)) {
21836
+ DApplications.update(current);
21837
+ return true;
22139
21838
  }
22140
- else if (this.isEmbedded(current)) {
22141
- if ((_a = current.data.getPrivate()) === null || _a === void 0 ? void 0 : _a.set(id, value, time)) {
21839
+ else {
21840
+ if (current.data.set(id, value, time, state)) {
22142
21841
  DApplications.update(current);
22143
21842
  return true;
22144
21843
  }
22145
21844
  }
22146
- current = current.parent;
21845
+ return false;
21846
+ }
21847
+ else if (this.isEmbedded(current)) {
21848
+ if ((_a = current.data.getPrivate()) === null || _a === void 0 ? void 0 : _a.set(id, value, time, state)) {
21849
+ DApplications.update(current);
21850
+ return true;
21851
+ }
22147
21852
  }
21853
+ current = current.parent;
21854
+ }
21855
+ return false;
21856
+ };
21857
+ EShapeActionRuntimes.writeRemote = function (shape, id, value) {
21858
+ var container = this.toContainer(shape);
21859
+ if (container) {
21860
+ return container.data.remote.set(id, value);
22148
21861
  }
22149
21862
  return false;
22150
21863
  };
@@ -24191,14 +23904,14 @@
24191
23904
  EShapeActionRuntimes.emit(shape, target, value, time);
24192
23905
  break;
24193
23906
  case EShapeActionValueOnInputAction.WRITE_LOCAL:
24194
- EShapeActionRuntimes.write(shape, target, value, time, false);
23907
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24195
23908
  break;
24196
23909
  case EShapeActionValueOnInputAction.WRITE_REMOTE:
24197
- EShapeActionRuntimes.write(shape, target, value, time, true);
23910
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24198
23911
  break;
24199
23912
  case EShapeActionValueOnInputAction.WRITE_BOTH:
24200
- EShapeActionRuntimes.write(shape, target, value, time, false);
24201
- EShapeActionRuntimes.write(shape, target, value, time, true);
23913
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
23914
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24202
23915
  break;
24203
23916
  }
24204
23917
  };
@@ -24399,8 +24112,8 @@
24399
24112
  return _super !== null && _super.apply(this, arguments) || this;
24400
24113
  }
24401
24114
  EShapeActionRuntimeMiscWriteBoth.prototype.write = function (shape, target, value, time) {
24402
- EShapeActionRuntimes.write(shape, target, value, time, false);
24403
- EShapeActionRuntimes.write(shape, target, value, time, true);
24115
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24116
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24404
24117
  };
24405
24118
  return EShapeActionRuntimeMiscWriteBoth;
24406
24119
  }(EShapeActionRuntimeMiscWrite));
@@ -24415,7 +24128,7 @@
24415
24128
  return _super !== null && _super.apply(this, arguments) || this;
24416
24129
  }
24417
24130
  EShapeActionRuntimeMiscWriteLocal.prototype.write = function (shape, target, value, time) {
24418
- EShapeActionRuntimes.write(shape, target, value, time, false);
24131
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24419
24132
  };
24420
24133
  return EShapeActionRuntimeMiscWriteLocal;
24421
24134
  }(EShapeActionRuntimeMiscWrite));
@@ -24430,7 +24143,7 @@
24430
24143
  return _super !== null && _super.apply(this, arguments) || this;
24431
24144
  }
24432
24145
  EShapeActionRuntimeMiscWriteRemote.prototype.write = function (shape, target, value, time) {
24433
- EShapeActionRuntimes.write(shape, target, value, time, true);
24146
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24434
24147
  };
24435
24148
  return EShapeActionRuntimeMiscWriteRemote;
24436
24149
  }(EShapeActionRuntimeMiscWrite));
@@ -32253,6 +31966,18 @@
32253
31966
  return EShapeActionValueTransformMove;
32254
31967
  }(EShapeActionValueOpetyped));
32255
31968
 
31969
+ /*
31970
+ * Copyright (C) 2019 Toshiba Corporation
31971
+ * SPDX-License-Identifier: Apache-2.0
31972
+ */
31973
+ var toSizeNormalized = function (size) {
31974
+ var THRESHOLD = 0.001;
31975
+ if (Math.abs(size) < THRESHOLD) {
31976
+ return size < 0 ? -THRESHOLD : +THRESHOLD;
31977
+ }
31978
+ return size;
31979
+ };
31980
+
32256
31981
  /*
32257
31982
  * Copyright (C) 2019 Toshiba Corporation
32258
31983
  * SPDX-License-Identifier: Apache-2.0
@@ -32994,6 +32719,179 @@
32994
32719
  EShapeDeserializers[EShapeType.BAR] = deserializeBar;
32995
32720
  };
32996
32721
 
32722
+ /*
32723
+ * Copyright (C) 2019 Toshiba Corporation
32724
+ * SPDX-License-Identifier: Apache-2.0
32725
+ */
32726
+ /* eslint-disable prettier/prettier */
32727
+ var NONE = 0x0;
32728
+ var ID = 0x1;
32729
+ var POSITION = 0x2;
32730
+ var WIDTH = 0x4;
32731
+ var HEIGHT = 0x8;
32732
+ var ROTATION = 0x10;
32733
+ var SKEW = 0x20;
32734
+ var REPLACING = 0x40;
32735
+ var GROUPING = 0x80;
32736
+ var UNGROUPING = 0x100;
32737
+ var FILL = 0x200;
32738
+ var STROKE = 0x400;
32739
+ var STROKE_SIDE = 0x800;
32740
+ var BORDER_RADIUS = 0x1000;
32741
+ var TEXT = 0x2000;
32742
+ var TEXTURE = 0x4000;
32743
+ var DATA = 0x8000;
32744
+ var ACTION = 0x10000;
32745
+ var CURSOR = 0x20000;
32746
+ var ORDER_IN_LAYER = 0x40000;
32747
+ var CHILDREN = 0x80000;
32748
+ var DATA_MAPPING = 0x100000;
32749
+ var COORDINATE = ID | POSITION | WIDTH | HEIGHT | ROTATION | SKEW;
32750
+ var SHAPE = REPLACING | GROUPING | FILL | STROKE;
32751
+ var LAYER = ORDER_IN_LAYER;
32752
+ var PRIMITIVE = COORDINATE | SHAPE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
32753
+ var GROUP = PRIMITIVE | UNGROUPING;
32754
+ var EMBEDDED = COORDINATE | REPLACING | GROUPING | TEXT | DATA | ACTION | LAYER | DATA_MAPPING;
32755
+ var CONNECTOR = ID | REPLACING | FILL | STROKE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
32756
+ var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
32757
+ var EShapeCapability = {
32758
+ NONE: NONE,
32759
+ /**
32760
+ * Allows shape IDs to be modified.
32761
+ */
32762
+ ID: ID,
32763
+ /**
32764
+ * Allows shape positions to be modified.
32765
+ */
32766
+ POSITION: POSITION,
32767
+ /**
32768
+ * Allows shape widths to be modified.
32769
+ */
32770
+ WIDTH: WIDTH,
32771
+ /**
32772
+ * Allows shape heights to be modified.
32773
+ */
32774
+ HEIGHT: HEIGHT,
32775
+ /**
32776
+ * Allows shape rotations to be modified.
32777
+ */
32778
+ ROTATION: ROTATION,
32779
+ /**
32780
+ * Allows shape skews to be modified.
32781
+ */
32782
+ SKEW: SKEW,
32783
+ /** @deprecated */
32784
+ ALIGN: NONE,
32785
+ /**
32786
+ * Allows shapes to be replaced with other shapes.
32787
+ */
32788
+ REPLACING: REPLACING,
32789
+ /**
32790
+ * Allows shapes to be grouped.
32791
+ */
32792
+ GROUPING: GROUPING,
32793
+ /**
32794
+ * Allows grouped shapes to be ungrouped.
32795
+ */
32796
+ UNGROUPING: UNGROUPING,
32797
+ /**
32798
+ * Allows shape fills to be modified.
32799
+ */
32800
+ FILL: FILL,
32801
+ /**
32802
+ * Allows shape strokes to be modified.
32803
+ */
32804
+ STROKE: STROKE,
32805
+ /**
32806
+ * Allows shape stroke sides to be modified.
32807
+ */
32808
+ STROKE_SIDE: STROKE_SIDE,
32809
+ /**
32810
+ * Allows shape border radiuses to be modified.
32811
+ */
32812
+ BORDER_RADIUS: BORDER_RADIUS,
32813
+ /**
32814
+ * Allows shape texts to be modified.
32815
+ */
32816
+ TEXT: TEXT,
32817
+ /**
32818
+ * Allows shape textures to be modified.
32819
+ */
32820
+ TEXTURE: TEXTURE,
32821
+ /** @deprecated in favor of {@link DATA} */
32822
+ TAG: DATA,
32823
+ /**
32824
+ * Allows shape data to be modified.
32825
+ */
32826
+ DATA: DATA,
32827
+ /**
32828
+ * Allows shape data mapping to be modified.
32829
+ */
32830
+ DATA_MAPPING: DATA_MAPPING,
32831
+ /**
32832
+ * Allows shape actions to be modified.
32833
+ */
32834
+ ACTION: ACTION,
32835
+ /**
32836
+ * Allows shape cursors to be modified.
32837
+ */
32838
+ CURSOR: CURSOR,
32839
+ /**
32840
+ * Allows shape orders in layer to be modified.
32841
+ */
32842
+ ORDER_IN_LAYER: ORDER_IN_LAYER,
32843
+ /**
32844
+ * Allows shape children to be modified.
32845
+ */
32846
+ CHILDREN: CHILDREN,
32847
+ COORDINATE: COORDINATE,
32848
+ SHAPE: SHAPE,
32849
+ LAYER: LAYER,
32850
+ PRIMITIVE: PRIMITIVE,
32851
+ GROUP: GROUP,
32852
+ EMBEDDED: EMBEDDED,
32853
+ CONNECTOR: CONNECTOR,
32854
+ ALL: ALL
32855
+ };
32856
+
32857
+ /*
32858
+ * Copyright (C) 2019 Toshiba Corporation
32859
+ * SPDX-License-Identifier: Apache-2.0
32860
+ */
32861
+ var EShapeCapabilities = /** @class */ (function () {
32862
+ function EShapeCapabilities() {
32863
+ }
32864
+ EShapeCapabilities.get = function (type) {
32865
+ var capability = this.mappings[type];
32866
+ if (capability != null) {
32867
+ return capability;
32868
+ }
32869
+ return EShapeCapability.PRIMITIVE;
32870
+ };
32871
+ EShapeCapabilities.contains = function (shape, target) {
32872
+ if (shape != null) {
32873
+ var capability = this.get(shape.type);
32874
+ if (capability & target) {
32875
+ return true;
32876
+ }
32877
+ if (capability & EShapeCapability.CHILDREN) {
32878
+ var children = shape.children;
32879
+ for (var i = 0, imax = children.length; i < imax; ++i) {
32880
+ if (this.contains(children[i], target)) {
32881
+ return true;
32882
+ }
32883
+ }
32884
+ }
32885
+ }
32886
+ return false;
32887
+ };
32888
+ EShapeCapabilities.set = function (type, capability) {
32889
+ this.mappings[type] = capability;
32890
+ };
32891
+ EShapeCapabilities.mappings = {};
32892
+ return EShapeCapabilities;
32893
+ }());
32894
+
32997
32895
  /*
32998
32896
  * Copyright (C) 2019 Toshiba Corporation
32999
32897
  * SPDX-License-Identifier: Apache-2.0
@@ -36786,7 +36684,7 @@
36786
36684
  * SPDX-License-Identifier: Apache-2.0
36787
36685
  */
36788
36686
  var create = function (name, width, height, container, manager, item, shape) {
36789
- shape = shape || new EShapeEmbedded(name, manager.isEditMode);
36687
+ shape = shape || new EShapeEmbedded(name);
36790
36688
  var result = deserializeBase(item, manager, shape);
36791
36689
  var shapeSize = shape.size;
36792
36690
  var sizeX = shapeSize.x;
@@ -36799,17 +36697,18 @@
36799
36697
  return result;
36800
36698
  };
36801
36699
  var createMissing = function (name, manager, item, shape) {
36802
- shape = shape || new EShapeEmbedded(name, manager.isEditMode);
36700
+ shape = shape || new EShapeEmbedded(name);
36803
36701
  var result = deserializeBase(item, manager, shape);
36804
36702
  var size = shape.size;
36805
36703
  var sizeX = size.x;
36806
36704
  var sizeY = size.y;
36807
36705
  var children = shape.children;
36808
- var layer = new EShapeEmbeddedLayer("missing", manager.isEditMode);
36706
+ var layer = new EShapeEmbeddedLayer("missing");
36809
36707
  var px = 0.5 * sizeX;
36810
36708
  var py = 0.5 * sizeX;
36811
36709
  layer.transform.position.set(-px, -py);
36812
36710
  layer.size.set(sizeX, sizeY);
36711
+ layer.size.init();
36813
36712
  layer.parent = shape;
36814
36713
  var rectangle = new EShapeRectangle();
36815
36714
  rectangle.stroke.color = 0xff0000;
@@ -36991,208 +36890,586 @@
36991
36890
  function EShapeGroupPoints(parent) {
36992
36891
  this._parent = parent;
36993
36892
  }
36994
- Object.defineProperty(EShapeGroupPoints.prototype, "length", {
36995
- get: function () {
36996
- var children = this._parent.children;
36997
- if (0 < children.length) {
36998
- var points = children[children.length - 1].points;
36999
- if (points != null) {
37000
- return points.length;
37001
- }
37002
- }
37003
- return 0;
37004
- },
37005
- enumerable: false,
37006
- configurable: true
37007
- });
37008
- Object.defineProperty(EShapeGroupPoints.prototype, "id", {
37009
- get: function () {
37010
- var children = this._parent.children;
37011
- if (0 < children.length) {
37012
- var points = children[children.length - 1].points;
37013
- if (points != null) {
37014
- return points.id;
37015
- }
37016
- }
37017
- return 0;
37018
- },
37019
- enumerable: false,
37020
- configurable: true
37021
- });
37022
- Object.defineProperty(EShapeGroupPoints.prototype, "values", {
37023
- get: function () {
37024
- var children = this._parent.children;
37025
- if (0 < children.length) {
37026
- var points = children[children.length - 1].points;
37027
- if (points != null) {
37028
- return points.values;
37029
- }
37030
- }
37031
- return [];
37032
- },
37033
- set: function (values) {
37034
- var children = this._parent.children;
37035
- for (var i = 0, imax = children.length; i < imax; ++i) {
37036
- var points = children[i].points;
37037
- if (points != null) {
37038
- points.values = values;
37039
- }
37040
- }
37041
- },
37042
- enumerable: false,
37043
- configurable: true
37044
- });
37045
- Object.defineProperty(EShapeGroupPoints.prototype, "segments", {
36893
+ Object.defineProperty(EShapeGroupPoints.prototype, "length", {
36894
+ get: function () {
36895
+ var children = this._parent.children;
36896
+ if (0 < children.length) {
36897
+ var points = children[children.length - 1].points;
36898
+ if (points != null) {
36899
+ return points.length;
36900
+ }
36901
+ }
36902
+ return 0;
36903
+ },
36904
+ enumerable: false,
36905
+ configurable: true
36906
+ });
36907
+ Object.defineProperty(EShapeGroupPoints.prototype, "id", {
36908
+ get: function () {
36909
+ var children = this._parent.children;
36910
+ if (0 < children.length) {
36911
+ var points = children[children.length - 1].points;
36912
+ if (points != null) {
36913
+ return points.id;
36914
+ }
36915
+ }
36916
+ return 0;
36917
+ },
36918
+ enumerable: false,
36919
+ configurable: true
36920
+ });
36921
+ Object.defineProperty(EShapeGroupPoints.prototype, "values", {
36922
+ get: function () {
36923
+ var children = this._parent.children;
36924
+ if (0 < children.length) {
36925
+ var points = children[children.length - 1].points;
36926
+ if (points != null) {
36927
+ return points.values;
36928
+ }
36929
+ }
36930
+ return [];
36931
+ },
36932
+ set: function (values) {
36933
+ var children = this._parent.children;
36934
+ for (var i = 0, imax = children.length; i < imax; ++i) {
36935
+ var points = children[i].points;
36936
+ if (points != null) {
36937
+ points.values = values;
36938
+ }
36939
+ }
36940
+ },
36941
+ enumerable: false,
36942
+ configurable: true
36943
+ });
36944
+ Object.defineProperty(EShapeGroupPoints.prototype, "segments", {
36945
+ get: function () {
36946
+ var children = this._parent.children;
36947
+ if (0 < children.length) {
36948
+ var points = children[children.length - 1].points;
36949
+ if (points != null) {
36950
+ return points.segments;
36951
+ }
36952
+ }
36953
+ return [];
36954
+ },
36955
+ set: function (segments) {
36956
+ var children = this._parent.children;
36957
+ for (var i = 0, imax = children.length; i < imax; ++i) {
36958
+ var points = children[i].points;
36959
+ if (points != null) {
36960
+ points.segments = segments;
36961
+ }
36962
+ }
36963
+ },
36964
+ enumerable: false,
36965
+ configurable: true
36966
+ });
36967
+ Object.defineProperty(EShapeGroupPoints.prototype, "style", {
36968
+ get: function () {
36969
+ var children = this._parent.children;
36970
+ if (0 < children.length) {
36971
+ var points = children[children.length - 1].points;
36972
+ if (points != null) {
36973
+ return points.style;
36974
+ }
36975
+ }
36976
+ return EShapePointsStyle.NONE;
36977
+ },
36978
+ set: function (style) {
36979
+ var children = this._parent.children;
36980
+ for (var i = 0, imax = children.length; i < imax; ++i) {
36981
+ var points = children[i].points;
36982
+ if (points != null) {
36983
+ points.style = style;
36984
+ }
36985
+ }
36986
+ },
36987
+ enumerable: false,
36988
+ configurable: true
36989
+ });
36990
+ Object.defineProperty(EShapeGroupPoints.prototype, "marker", {
36991
+ get: function () {
36992
+ var children = this._parent.children;
36993
+ for (var i = 0, imax = children.length; i < imax; ++i) {
36994
+ var points = children[i].points;
36995
+ if (points != null) {
36996
+ return points.marker;
36997
+ }
36998
+ }
36999
+ return EShapePointsMarkerContainerImplNoop.getInstance();
37000
+ },
37001
+ enumerable: false,
37002
+ configurable: true
37003
+ });
37004
+ EShapeGroupPoints.prototype.getMarker = function () {
37005
+ var children = this._parent.children;
37006
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37007
+ var points = children[i].points;
37008
+ if (points != null) {
37009
+ return points.getMarker();
37010
+ }
37011
+ }
37012
+ return undefined;
37013
+ };
37014
+ Object.defineProperty(EShapeGroupPoints.prototype, "formatter", {
37015
+ get: function () {
37016
+ var children = this._parent.children;
37017
+ if (0 < children.length) {
37018
+ var points = children[children.length - 1].points;
37019
+ if (points != null) {
37020
+ return points.formatter;
37021
+ }
37022
+ }
37023
+ return null;
37024
+ },
37025
+ set: function (formatter) {
37026
+ var children = this._parent.children;
37027
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37028
+ var points = children[i].points;
37029
+ if (points != null) {
37030
+ points.formatter = formatter;
37031
+ }
37032
+ }
37033
+ },
37034
+ enumerable: false,
37035
+ configurable: true
37036
+ });
37037
+ Object.defineProperty(EShapeGroupPoints.prototype, "formatted", {
37038
+ get: function () {
37039
+ var children = this._parent.children;
37040
+ if (0 < children.length) {
37041
+ var points = children[children.length - 1].points;
37042
+ if (points != null) {
37043
+ return points.formatted;
37044
+ }
37045
+ }
37046
+ return this;
37047
+ },
37048
+ enumerable: false,
37049
+ configurable: true
37050
+ });
37051
+ EShapeGroupPoints.prototype.copy = function (source) {
37052
+ var children = this._parent.children;
37053
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37054
+ var points = children[i].points;
37055
+ if (points != null) {
37056
+ points.copy(source);
37057
+ }
37058
+ }
37059
+ return this;
37060
+ };
37061
+ EShapeGroupPoints.prototype.set = function (values, segments, style) {
37062
+ var children = this._parent.children;
37063
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37064
+ var points = children[i].points;
37065
+ if (points != null) {
37066
+ points.set(values, segments, style);
37067
+ }
37068
+ }
37069
+ return this;
37070
+ };
37071
+ EShapeGroupPoints.prototype.clone = function (parent) {
37072
+ return new EShapeGroupPoints(parent);
37073
+ };
37074
+ EShapeGroupPoints.prototype.toPoints = function (transform) {
37075
+ var children = this._parent.children;
37076
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37077
+ var points = children[i].points;
37078
+ if (points != null) {
37079
+ return points.toPoints(transform);
37080
+ }
37081
+ }
37082
+ return [];
37083
+ };
37084
+ EShapeGroupPoints.prototype.serialize = function (manager) {
37085
+ var children = this._parent.children;
37086
+ for (var i = 0, imax = children.length; i < imax; ++i) {
37087
+ var points = children[i].points;
37088
+ if (points != null) {
37089
+ return points.serialize(manager);
37090
+ }
37091
+ }
37092
+ return -1;
37093
+ };
37094
+ return EShapeGroupPoints;
37095
+ }());
37096
+
37097
+ /*
37098
+ * Copyright (C) 2019 Toshiba Corporation
37099
+ * SPDX-License-Identifier: Apache-2.0
37100
+ */
37101
+ var EShapeEditor = /** @class */ (function () {
37102
+ function EShapeEditor() {
37103
+ this.localTransform = new pixi_js.Matrix();
37104
+ this.internalTransform = new pixi_js.Matrix();
37105
+ this.internalTransformParentInverse = new pixi_js.Matrix();
37106
+ this.rotation = 0;
37107
+ this.size = new pixi_js.Point();
37108
+ }
37109
+ return EShapeEditor;
37110
+ }());
37111
+
37112
+ /*
37113
+ * Copyright (C) 2019 Toshiba Corporation
37114
+ * SPDX-License-Identifier: Apache-2.0
37115
+ */
37116
+ var EShapeTransforms = /** @class */ (function () {
37117
+ function EShapeTransforms() {
37118
+ }
37119
+ EShapeTransforms.prepare = function (shape) {
37120
+ var editor = shape.editor || new EShapeEditor();
37121
+ shape.editor = editor;
37122
+ // Transform
37123
+ shape.updateTransform();
37124
+ var parent = shape.parent;
37125
+ if (parent instanceof EShapeBase) {
37126
+ parent.transform.internalTransform
37127
+ .copyTo(editor.internalTransformParentInverse)
37128
+ .invert();
37129
+ }
37130
+ else {
37131
+ editor.internalTransformParentInverse.identity();
37132
+ }
37133
+ shape.transform.internalTransform.copyTo(editor.internalTransform);
37134
+ // Rotation
37135
+ editor.rotation = shape.transform.rotation;
37136
+ // Size
37137
+ editor.size.copyFrom(shape.size);
37138
+ //
37139
+ shape.disallowOnTransformChange();
37140
+ };
37141
+ EShapeTransforms.finalize = function (shape) {
37142
+ shape.allowOnTransformChange(true);
37143
+ };
37144
+ EShapeTransforms.apply = function (shape, transform, keepSize) {
37145
+ var editor = shape.editor;
37146
+ if (editor != null) {
37147
+ var newLocalTransform = editor.localTransform;
37148
+ editor.internalTransformParentInverse
37149
+ .copyTo(newLocalTransform)
37150
+ .append(transform)
37151
+ .append(editor.internalTransform);
37152
+ if (keepSize) {
37153
+ this.applyLocal(shape, newLocalTransform);
37154
+ }
37155
+ else {
37156
+ var size = editor.size;
37157
+ this.applyLocal(shape, newLocalTransform, size.x, size.y);
37158
+ }
37159
+ }
37160
+ };
37161
+ EShapeTransforms.applyLocal = function (shape, localTransform, bx, by) {
37162
+ shape.disallowUploadedUpdate();
37163
+ // Reconstruct the position, the rotation and the size
37164
+ var a = localTransform.a;
37165
+ var b = localTransform.b;
37166
+ var c = localTransform.c;
37167
+ var d = localTransform.d;
37168
+ var tx = localTransform.tx;
37169
+ var ty = localTransform.ty;
37170
+ // Rotation
37171
+ var transform = shape.transform;
37172
+ var rx = Math.atan2(-c, d); // rotation - skewX
37173
+ var ry = Math.atan2(+b, a); // rotation + skewY
37174
+ transform.rotation = (rx + ry) * 0.5; // Here, assumes `skewX` === `skewY`
37175
+ // Skew
37176
+ var skew = (ry - rx) * 0.5;
37177
+ transform.skew.set(skew, skew);
37178
+ // Position: Assumes the pivot is invariant.
37179
+ // tx = position.x - (a * px + c * py)
37180
+ // ty = position.y - (b * px + d * py)
37181
+ //
37182
+ // Thus,
37183
+ // position.x = tx + (a * px + c * py)
37184
+ // position.y = ty + (b * px + d * py)
37185
+ var pivot = transform.pivot;
37186
+ var px = pivot.x;
37187
+ var py = pivot.y;
37188
+ transform.position.set(tx + (a * px + c * py), ty + (b * px + d * py));
37189
+ // Scale
37190
+ if (bx != null && by != null) {
37191
+ var sx = Math.sqrt(a * a + b * b);
37192
+ var sy = Math.sqrt(c * c + d * d);
37193
+ shape.size.set(toSizeNormalized(bx * sx), toSizeNormalized(by * sy));
37194
+ }
37195
+ //
37196
+ shape.allowUploadedUpdate();
37197
+ };
37198
+ return EShapeTransforms;
37199
+ }());
37200
+
37201
+ /*
37202
+ * Copyright (C) 2019 Toshiba Corporation
37203
+ * SPDX-License-Identifier: Apache-2.0
37204
+ */
37205
+ var EShapeGroupSizeLayout = /** @class */ (function () {
37206
+ function EShapeGroupSizeLayout(shape, bx, by) {
37207
+ this.shape = shape;
37208
+ // Base group size
37209
+ this.base = new pixi_js.Point(bx, by);
37210
+ // Base shape size
37211
+ var size = shape.size;
37212
+ this.shapeBase = new pixi_js.Point(size.x, size.y);
37213
+ // Transform
37214
+ this.transform = new pixi_js.Matrix();
37215
+ shape.updateTransform();
37216
+ shape.transform.localTransform.copyTo(this.transform);
37217
+ this.capable =
37218
+ EShapeCapabilities.contains(shape, EShapeCapability.POSITION) &&
37219
+ EShapeCapabilities.contains(shape, EShapeCapability.WIDTH) &&
37220
+ EShapeCapabilities.contains(shape, EShapeCapability.HEIGHT) &&
37221
+ EShapeCapabilities.contains(shape, EShapeCapability.ROTATION) &&
37222
+ EShapeCapabilities.contains(shape, EShapeCapability.SKEW);
37223
+ }
37224
+ EShapeGroupSizeLayout.prototype.isCompatible = function (shape) {
37225
+ return this.shape === shape;
37226
+ };
37227
+ EShapeGroupSizeLayout.prototype.reset = function (shape, baseX, baseY) {
37228
+ this.base.set(baseX, baseY);
37229
+ // Base shape size
37230
+ var size = shape.size;
37231
+ this.shapeBase.copyFrom(size);
37232
+ // Transform
37233
+ shape.updateTransform();
37234
+ shape.transform.localTransform.copyTo(this.transform);
37235
+ };
37236
+ EShapeGroupSizeLayout.prototype.update = function (shape, baseX, baseY, pivotX, pivotY) {
37237
+ if (!this.capable) {
37238
+ return;
37239
+ }
37240
+ var sx = baseX / this.base.x;
37241
+ var sy = baseY / this.base.y;
37242
+ var childBase = this.shapeBase;
37243
+ var transform = EShapeGroupSizeLayout.WORK_TRANSFORM;
37244
+ transform
37245
+ .identity()
37246
+ .append(this.transform)
37247
+ .translate(-pivotX, -pivotY)
37248
+ .scale(sx, sy)
37249
+ .translate(+pivotX, +pivotY);
37250
+ shape.disallowOnTransformChange();
37251
+ EShapeTransforms.applyLocal(shape, transform, childBase.x, childBase.y);
37252
+ shape.allowOnTransformChange(false);
37253
+ };
37254
+ EShapeGroupSizeLayout.WORK_TRANSFORM = new pixi_js.Matrix();
37255
+ return EShapeGroupSizeLayout;
37256
+ }());
37257
+
37258
+ /*
37259
+ * Copyright (C) 2019 Toshiba Corporation
37260
+ * SPDX-License-Identifier: Apache-2.0
37261
+ */
37262
+ var EShapeGroupSizeEditor = /** @class */ (function () {
37263
+ function EShapeGroupSizeEditor(parent, x, y, isFittable) {
37264
+ this._workRectForCalcRect = new pixi_js.Rectangle();
37265
+ this._workRectForFit = new pixi_js.Rectangle();
37266
+ this._parent = parent;
37267
+ this._layouts = [];
37268
+ this._size = new pixi_js.Point(x, y);
37269
+ this._isFittable = isFittable;
37270
+ }
37271
+ EShapeGroupSizeEditor.prototype.init = function () {
37272
+ // DO NOTHING
37273
+ };
37274
+ Object.defineProperty(EShapeGroupSizeEditor.prototype, "x", {
37046
37275
  get: function () {
37047
- var children = this._parent.children;
37048
- if (0 < children.length) {
37049
- var points = children[children.length - 1].points;
37050
- if (points != null) {
37051
- return points.segments;
37052
- }
37053
- }
37054
- return [];
37276
+ return this._size.x;
37055
37277
  },
37056
- set: function (segments) {
37057
- var children = this._parent.children;
37058
- for (var i = 0, imax = children.length; i < imax; ++i) {
37059
- var points = children[i].points;
37060
- if (points != null) {
37061
- points.segments = segments;
37062
- }
37278
+ set: function (x) {
37279
+ var size = this._size;
37280
+ if (size.x !== x) {
37281
+ var ox = size.x;
37282
+ size.x = x;
37283
+ this.onChange(ox, size.y);
37063
37284
  }
37064
37285
  },
37065
37286
  enumerable: false,
37066
37287
  configurable: true
37067
37288
  });
37068
- Object.defineProperty(EShapeGroupPoints.prototype, "style", {
37289
+ Object.defineProperty(EShapeGroupSizeEditor.prototype, "y", {
37069
37290
  get: function () {
37070
- var children = this._parent.children;
37071
- if (0 < children.length) {
37072
- var points = children[children.length - 1].points;
37073
- if (points != null) {
37074
- return points.style;
37075
- }
37076
- }
37077
- return EShapePointsStyle.NONE;
37078
- },
37079
- set: function (style) {
37080
- var children = this._parent.children;
37081
- for (var i = 0, imax = children.length; i < imax; ++i) {
37082
- var points = children[i].points;
37083
- if (points != null) {
37084
- points.style = style;
37085
- }
37086
- }
37291
+ return this._size.y;
37087
37292
  },
37088
- enumerable: false,
37089
- configurable: true
37090
- });
37091
- Object.defineProperty(EShapeGroupPoints.prototype, "marker", {
37092
- get: function () {
37093
- var children = this._parent.children;
37094
- for (var i = 0, imax = children.length; i < imax; ++i) {
37095
- var points = children[i].points;
37096
- if (points != null) {
37097
- return points.marker;
37098
- }
37293
+ set: function (y) {
37294
+ var size = this._size;
37295
+ if (size.y !== y) {
37296
+ var oy = size.y;
37297
+ size.y = y;
37298
+ this.onChange(size.x, oy);
37099
37299
  }
37100
- return EShapePointsMarkerContainerImplNoop.getInstance();
37101
37300
  },
37102
37301
  enumerable: false,
37103
37302
  configurable: true
37104
37303
  });
37105
- EShapeGroupPoints.prototype.getMarker = function () {
37106
- var children = this._parent.children;
37107
- for (var i = 0, imax = children.length; i < imax; ++i) {
37108
- var points = children[i].points;
37109
- if (points != null) {
37110
- return points.getMarker();
37111
- }
37304
+ EShapeGroupSizeEditor.prototype.set = function (x, y) {
37305
+ var isChanged = false;
37306
+ var size = this._size;
37307
+ var ox = size.x;
37308
+ var oy = size.y;
37309
+ if (x != null && ox !== x) {
37310
+ isChanged = true;
37311
+ size.x = x;
37112
37312
  }
37113
- return undefined;
37114
- };
37115
- Object.defineProperty(EShapeGroupPoints.prototype, "formatter", {
37116
- get: function () {
37117
- var children = this._parent.children;
37118
- if (0 < children.length) {
37119
- var points = children[children.length - 1].points;
37120
- if (points != null) {
37121
- return points.formatter;
37122
- }
37123
- }
37124
- return null;
37125
- },
37126
- set: function (formatter) {
37127
- var children = this._parent.children;
37128
- for (var i = 0, imax = children.length; i < imax; ++i) {
37129
- var points = children[i].points;
37130
- if (points != null) {
37131
- points.formatter = formatter;
37132
- }
37133
- }
37134
- },
37135
- enumerable: false,
37136
- configurable: true
37137
- });
37138
- Object.defineProperty(EShapeGroupPoints.prototype, "formatted", {
37139
- get: function () {
37140
- var children = this._parent.children;
37141
- if (0 < children.length) {
37142
- var points = children[children.length - 1].points;
37143
- if (points != null) {
37144
- return points.formatted;
37145
- }
37146
- }
37147
- return this;
37148
- },
37149
- enumerable: false,
37150
- configurable: true
37151
- });
37152
- EShapeGroupPoints.prototype.copy = function (source) {
37153
- var children = this._parent.children;
37154
- for (var i = 0, imax = children.length; i < imax; ++i) {
37155
- var points = children[i].points;
37156
- if (points != null) {
37157
- points.copy(source);
37158
- }
37313
+ if (y != null && oy !== y) {
37314
+ isChanged = true;
37315
+ size.y = y;
37316
+ }
37317
+ if (isChanged) {
37318
+ this.onChange(ox, oy);
37159
37319
  }
37160
37320
  return this;
37161
37321
  };
37162
- EShapeGroupPoints.prototype.set = function (values, segments, style) {
37163
- var children = this._parent.children;
37164
- for (var i = 0, imax = children.length; i < imax; ++i) {
37165
- var points = children[i].points;
37166
- if (points != null) {
37167
- points.set(values, segments, style);
37168
- }
37322
+ EShapeGroupSizeEditor.prototype.clone = function () {
37323
+ var size = this._size;
37324
+ return new EShapeGroupSizeEditor(this._parent, size.x, size.y, this._isFittable);
37325
+ };
37326
+ EShapeGroupSizeEditor.prototype.copy = function () {
37327
+ // DO NOTHING
37328
+ };
37329
+ EShapeGroupSizeEditor.prototype.copyFrom = function (point) {
37330
+ var x = point.x;
37331
+ var y = point.y;
37332
+ var size = this._size;
37333
+ var ox = size.x;
37334
+ var oy = size.y;
37335
+ if (ox !== x || oy !== y) {
37336
+ size.x = x;
37337
+ size.y = y;
37338
+ this.onChange(ox, oy);
37169
37339
  }
37170
37340
  return this;
37171
37341
  };
37172
- EShapeGroupPoints.prototype.clone = function (parent) {
37173
- return new EShapeGroupPoints(parent);
37342
+ EShapeGroupSizeEditor.prototype.copyTo = function (point) {
37343
+ return this._size.copyTo(point);
37174
37344
  };
37175
- EShapeGroupPoints.prototype.toPoints = function (transform) {
37176
- var children = this._parent.children;
37177
- for (var i = 0, imax = children.length; i < imax; ++i) {
37178
- var points = children[i].points;
37179
- if (points != null) {
37180
- return points.toPoints(transform);
37345
+ EShapeGroupSizeEditor.prototype.equals = function (point) {
37346
+ return this._size.equals(point);
37347
+ };
37348
+ EShapeGroupSizeEditor.prototype.fit = function () {
37349
+ if (this._isFittable) {
37350
+ this.doFit();
37351
+ }
37352
+ };
37353
+ EShapeGroupSizeEditor.prototype.doFit = function () {
37354
+ var parent = this._parent;
37355
+ parent.disallowOnTransformChange();
37356
+ // Calculate the rect
37357
+ var rect = this.calcRect(this._workRectForFit);
37358
+ // Set size
37359
+ var size = this._size;
37360
+ size.set(rect.width, rect.height);
37361
+ // Position & Pivot
37362
+ // rx := rect.x
37363
+ // ry := rect.y
37364
+ //
37365
+ // | a c tx | | 1 0 +rx | | 1 0 -rx | | a c tx + (a * rx + c * ry) | | 1 0 -rx |
37366
+ // | b d ty | | 0 1 +ry | | 0 1 -ry | = | b d ty + (b * rx + d * ry) | | 0 1 -ry |
37367
+ // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |
37368
+ //
37369
+ // tx -> tx + (a * rx + c * ry) = poxition.x - (a * pivot.x + c * pivot.y)
37370
+ // ty -> ty + (b * rx + d * ry) = poxition.y - (b * pivot.x + d * pivot.y)
37371
+ // position.x -> position.x + (a * rx + c * ry) - (a * pivot.x + c * pivot.y)
37372
+ // position.y -> position.y + (b * rx + d * ry) - (b * pivot.x + d * pivot.y)
37373
+ // pivot.x -> 0
37374
+ // pivot.y -> 0
37375
+ //
37376
+ // a -> a', b -> b', c -> c', tx -> tx', ty -> ty'
37377
+ //
37378
+ // | a' c' tx' | | 1 0 -rx | | a' c' tx' - (a' * rx + c' * ry) |
37379
+ // | b' d' ty' | | 0 1 -ry | = | b' d' ty' - (b' * rx + d' * ry) |
37380
+ // | 0 0 1 | | 0 0 1 | | 0 0 1 |
37381
+ //
37382
+ // tx' -> tx' - (a' * rx + c' * ry) = poxition.x - (a' * pivot.x + c' * pivot.y)
37383
+ // ty' -> ty' - (b' * rx + d' * ry) = poxition.y - (b' * pivot.x + d' * pivot.y)
37384
+ // pivot.x -> pivot.x + rx
37385
+ // pivot.y -> pivot.y + ry
37386
+ parent.updateTransform();
37387
+ var transform = parent.transform;
37388
+ var x = rect.x + rect.width * 0.5;
37389
+ var y = rect.y + rect.height * 0.5;
37390
+ var position = transform.position;
37391
+ var localTransform = transform.localTransform;
37392
+ var a = localTransform.a;
37393
+ var b = localTransform.b;
37394
+ var c = localTransform.c;
37395
+ var d = localTransform.d;
37396
+ var pivot = transform.pivot;
37397
+ position.set(position.x + (a * x + c * y) - (a * pivot.x + c * pivot.y), position.y + (b * x + d * y) - (b * pivot.x + d * pivot.y));
37398
+ pivot.set(x, y);
37399
+ // Reset the data
37400
+ this.reset(parent.children, this._layouts, size);
37401
+ //
37402
+ parent.allowOnTransformChange(true);
37403
+ };
37404
+ EShapeGroupSizeEditor.prototype.reset = function (children, layouts, size) {
37405
+ for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
37406
+ var child = children[i];
37407
+ var layout = layouts[i];
37408
+ if (layout.isCompatible(child)) {
37409
+ layout.reset(child, size.x, size.y);
37410
+ }
37411
+ else {
37412
+ layouts.length = i;
37413
+ break;
37181
37414
  }
37182
37415
  }
37183
- return [];
37416
+ if (children.length < layouts.length) {
37417
+ layouts.length = children.length;
37418
+ }
37184
37419
  };
37185
- EShapeGroupPoints.prototype.serialize = function (manager) {
37186
- var children = this._parent.children;
37187
- for (var i = 0, imax = children.length; i < imax; ++i) {
37188
- var points = children[i].points;
37189
- if (points != null) {
37190
- return points.serialize(manager);
37420
+ EShapeGroupSizeEditor.prototype.calcRect = function (result) {
37421
+ var parent = this._parent;
37422
+ var children = parent.children;
37423
+ if (children.length <= 0) {
37424
+ result.x = 0;
37425
+ result.y = 0;
37426
+ result.width = 0;
37427
+ result.height = 0;
37428
+ }
37429
+ else {
37430
+ var workRect = this._workRectForCalcRect;
37431
+ children[0].getBoundsLocal(false, result);
37432
+ for (var i = 1, imax = children.length; i < imax; ++i) {
37433
+ var child = children[i];
37434
+ child.getBoundsLocal(false, workRect);
37435
+ result.enlarge(workRect);
37191
37436
  }
37192
37437
  }
37193
- return -1;
37438
+ return result;
37194
37439
  };
37195
- return EShapeGroupPoints;
37440
+ EShapeGroupSizeEditor.prototype.onChange = function (ox, oy) {
37441
+ var parent = this._parent;
37442
+ var size = this._size;
37443
+ var pivot = parent.transform.pivot;
37444
+ this.onChange_(parent.children, this._layouts, size.x, size.y, pivot.x, pivot.y, ox, oy);
37445
+ parent.onSizeChange();
37446
+ };
37447
+ EShapeGroupSizeEditor.prototype.onChange_ = function (children, layouts, sx, sy, px, py, ox, oy) {
37448
+ for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
37449
+ var child = children[i];
37450
+ var layout = layouts[i];
37451
+ if (layout.isCompatible(child)) {
37452
+ layout.update(child, sx, sy, px, py);
37453
+ }
37454
+ else {
37455
+ layouts.length = i;
37456
+ break;
37457
+ }
37458
+ }
37459
+ for (var i = layouts.length, imax = children.length; i < imax; ++i) {
37460
+ var child = children[i];
37461
+ var layout = this.newLayout(child, ox, oy);
37462
+ layout.update(child, sx, sy, px, py);
37463
+ layouts.push(layout);
37464
+ }
37465
+ if (layouts.length !== children.length) {
37466
+ layouts.length = children.length;
37467
+ }
37468
+ };
37469
+ EShapeGroupSizeEditor.prototype.newLayout = function (shape, ox, oy) {
37470
+ return shape.layout || new EShapeGroupSizeLayout(shape, ox, oy);
37471
+ };
37472
+ return EShapeGroupSizeEditor;
37196
37473
  }());
37197
37474
 
37198
37475
  /*
@@ -43045,7 +43322,7 @@
43045
43322
  });
43046
43323
  };
43047
43324
  EShapeEmbeddeds.create = function (name, width, height, container, manager) {
43048
- var shape = new EShapeEmbedded(name, manager.isEditMode);
43325
+ var shape = new EShapeEmbedded(name);
43049
43326
  shape.size.set(width, height);
43050
43327
  container.copyTo(shape);
43051
43328
  shape.size.init();
@@ -44745,6 +45022,19 @@
44745
45022
  return DynamicFontAtlases;
44746
45023
  }());
44747
45024
 
45025
+ /*
45026
+ * Copyright (C) 2019 Toshiba Corporation
45027
+ * SPDX-License-Identifier: Apache-2.0
45028
+ */
45029
+ var isObject = function (target) {
45030
+ if (typeof target === "object" &&
45031
+ Object.prototype.toString.call(target) === "[object Object]") {
45032
+ var prototype = Object.getPrototypeOf(target);
45033
+ return prototype == null || prototype === Object.prototype;
45034
+ }
45035
+ return false;
45036
+ };
45037
+
44748
45038
  /*
44749
45039
  * Copyright (C) 2019 Toshiba Corporation
44750
45040
  * SPDX-License-Identifier: Apache-2.0
@@ -44808,6 +45098,36 @@
44808
45098
  return Math.max(i0, i1);
44809
45099
  };
44810
45100
 
45101
+ /*
45102
+ * Copyright (C) 2019 Toshiba Corporation
45103
+ * SPDX-License-Identifier: Apache-2.0
45104
+ */
45105
+ var toClonedArray = function (target) {
45106
+ var result = [];
45107
+ for (var i = 0, imax = target.length; i < imax; ++i) {
45108
+ result[i] = target[i];
45109
+ }
45110
+ return result;
45111
+ };
45112
+ var toClonedObject = function (target) {
45113
+ var result = {};
45114
+ for (var key in target) {
45115
+ if (Object.hasOwnProperty.call(target, key)) {
45116
+ result[key] = toCloned(target[key]);
45117
+ }
45118
+ }
45119
+ return result;
45120
+ };
45121
+ var toCloned = function (target) {
45122
+ if (isArray(target)) {
45123
+ return toClonedArray(target);
45124
+ }
45125
+ else if (isObject(target)) {
45126
+ return toClonedObject(target);
45127
+ }
45128
+ return target;
45129
+ };
45130
+
44811
45131
  /*
44812
45132
  * Copyright (C) 2019 Toshiba Corporation
44813
45133
  * SPDX-License-Identifier: Apache-2.0
@@ -44833,6 +45153,46 @@
44833
45153
  return "";
44834
45154
  };
44835
45155
 
45156
+ /*
45157
+ * Copyright (C) 2019 Toshiba Corporation
45158
+ * SPDX-License-Identifier: Apache-2.0
45159
+ */
45160
+ var toMerged = function (one, other) {
45161
+ if (one != null) {
45162
+ var o = toCloned(one);
45163
+ if (other != null) {
45164
+ for (var key in other) {
45165
+ if (Object.prototype.hasOwnProperty.call(other, key)) {
45166
+ var otherValue = other[key];
45167
+ if (isObject(otherValue)) {
45168
+ if (Object.prototype.hasOwnProperty.call(o, key)) {
45169
+ var oneValue = o[key];
45170
+ if (isObject(oneValue)) {
45171
+ toMerged(oneValue, otherValue);
45172
+ }
45173
+ }
45174
+ else {
45175
+ o[key] = toCloned(otherValue);
45176
+ }
45177
+ }
45178
+ else {
45179
+ if (!Object.prototype.hasOwnProperty.call(o, key)) {
45180
+ o[key] = otherValue;
45181
+ }
45182
+ }
45183
+ }
45184
+ }
45185
+ }
45186
+ return o;
45187
+ }
45188
+ else if (other != null) {
45189
+ return toCloned(other);
45190
+ }
45191
+ else {
45192
+ return {};
45193
+ }
45194
+ };
45195
+
44836
45196
  /*
44837
45197
  * Copyright (C) 2019 Toshiba Corporation
44838
45198
  * SPDX-License-Identifier: Apache-2.0
@@ -46923,12 +47283,10 @@
46923
47283
  var previous = this._focused;
46924
47284
  if (previous !== focusable) {
46925
47285
  if (previous != null) {
46926
- console.log("previous", previous.constructor.name);
46927
47286
  previous.state.isFocused = false;
46928
47287
  }
46929
47288
  this._focused = focusable;
46930
47289
  if (this.isFocusable(focusable)) {
46931
- console.log("previous", focusable.constructor.name);
46932
47290
  focusable.state.isFocused = true;
46933
47291
  }
46934
47292
  return previous;
@@ -58550,7 +58908,7 @@
58550
58908
  list.push(value);
58551
58909
  }
58552
58910
  };
58553
- DDiagramCanvasDataImpl.prototype.set = function (id, value, time, from, to) {
58911
+ DDiagramCanvasDataImpl.prototype.set = function (id, value, time, state, from, to) {
58554
58912
  var data = this._data;
58555
58913
  if (data == null) {
58556
58914
  return false;
@@ -58572,6 +58930,10 @@
58572
58930
  if (time !== undefined) {
58573
58931
  datumValue.time = time;
58574
58932
  }
58933
+ // State
58934
+ if (state !== undefined) {
58935
+ datumValue.state = state;
58936
+ }
58575
58937
  // Value
58576
58938
  datumValue.value = value;
58577
58939
  }
@@ -58613,7 +58975,7 @@
58613
58975
  }
58614
58976
  return true;
58615
58977
  };
58616
- DDiagramCanvasDataImpl.prototype.setAll = function (id, values, times, from, to) {
58978
+ DDiagramCanvasDataImpl.prototype.setAll = function (id, values, times, states, from, to) {
58617
58979
  var data = this._data;
58618
58980
  if (data == null) {
58619
58981
  return false;
@@ -58635,12 +58997,16 @@
58635
58997
  if (times !== undefined) {
58636
58998
  datumValue.times = times;
58637
58999
  }
59000
+ // State
59001
+ if (states !== undefined) {
59002
+ datumValue.states = states;
59003
+ }
58638
59004
  // Value
58639
59005
  datumValue.values = values;
58640
59006
  }
58641
59007
  return true;
58642
59008
  };
58643
- DDiagramCanvasDataImpl.prototype.setValue = function (id, value, time) {
59009
+ DDiagramCanvasDataImpl.prototype.setValue = function (id, value) {
58644
59010
  var data = this._data;
58645
59011
  if (data == null) {
58646
59012
  return false;
@@ -58654,15 +59020,11 @@
58654
59020
  return false;
58655
59021
  }
58656
59022
  for (var i = 0; i < size; ++i) {
58657
- var datumValue = datum[i];
58658
- if (time !== undefined) {
58659
- datumValue.time = time;
58660
- }
58661
- datumValue.value = value;
59023
+ datum[i].value = value;
58662
59024
  }
58663
59025
  return true;
58664
59026
  };
58665
- DDiagramCanvasDataImpl.prototype.setValues = function (id, values, times) {
59027
+ DDiagramCanvasDataImpl.prototype.setValues = function (id, values) {
58666
59028
  var data = this._data;
58667
59029
  if (data == null) {
58668
59030
  return false;
@@ -58676,11 +59038,7 @@
58676
59038
  return false;
58677
59039
  }
58678
59040
  for (var i = 0; i < size; ++i) {
58679
- var datumValue = datum[i];
58680
- if (times !== undefined) {
58681
- datumValue.times = times;
58682
- }
58683
- datumValue.values = values;
59041
+ datum[i].values = values;
58684
59042
  }
58685
59043
  return true;
58686
59044
  };
@@ -58720,6 +59078,42 @@
58720
59078
  }
58721
59079
  return true;
58722
59080
  };
59081
+ DDiagramCanvasDataImpl.prototype.setState = function (id, state) {
59082
+ var data = this._data;
59083
+ if (data == null) {
59084
+ return false;
59085
+ }
59086
+ var datum = data.get(id);
59087
+ if (datum == null) {
59088
+ return false;
59089
+ }
59090
+ var size = datum.length;
59091
+ if (size <= 0) {
59092
+ return false;
59093
+ }
59094
+ for (var i = 0; i < size; ++i) {
59095
+ datum[i].state = state;
59096
+ }
59097
+ return true;
59098
+ };
59099
+ DDiagramCanvasDataImpl.prototype.setStates = function (id, states) {
59100
+ var data = this._data;
59101
+ if (data == null) {
59102
+ return false;
59103
+ }
59104
+ var datum = data.get(id);
59105
+ if (datum == null) {
59106
+ return false;
59107
+ }
59108
+ var size = datum.length;
59109
+ if (size <= 0) {
59110
+ return false;
59111
+ }
59112
+ for (var i = 0; i < size; ++i) {
59113
+ datum[i].states = states;
59114
+ }
59115
+ return true;
59116
+ };
58723
59117
  DDiagramCanvasDataImpl.prototype.setRange = function (id, from, to) {
58724
59118
  var data = this._data;
58725
59119
  if (data == null) {
@@ -59640,10 +60034,10 @@
59640
60034
  enumerable: false,
59641
60035
  configurable: true
59642
60036
  });
59643
- DDiagramDataPrivateImpl.prototype.set = function (id, value, time, from, to) {
60037
+ DDiagramDataPrivateImpl.prototype.set = function (id, value, time, state, from, to) {
59644
60038
  var canvas = this._diagram.canvas;
59645
60039
  if (canvas != null) {
59646
- return canvas.data.private.set(id, value, time, from, to);
60040
+ return canvas.data.private.set(id, value, time, state, from, to);
59647
60041
  }
59648
60042
  return false;
59649
60043
  };
@@ -59683,10 +60077,10 @@
59683
60077
  enumerable: false,
59684
60078
  configurable: true
59685
60079
  });
59686
- DDiagramDataProtectedImpl.prototype.set = function (id, value, time, from, to) {
60080
+ DDiagramDataProtectedImpl.prototype.set = function (id, value, time, state, from, to) {
59687
60081
  var canvas = this._diagram.canvas;
59688
60082
  if (canvas != null) {
59689
- return canvas.data.protected.set(id, value, time, from, to);
60083
+ return canvas.data.protected.set(id, value, time, state, from, to);
59690
60084
  }
59691
60085
  return false;
59692
60086
  };
@@ -59715,7 +60109,7 @@
59715
60109
  function DDiagramDataRemoteImpl(options) {
59716
60110
  this._controller = options && options.controller;
59717
60111
  }
59718
- DDiagramDataRemoteImpl.prototype.set = function (id, value, time) {
60112
+ DDiagramDataRemoteImpl.prototype.set = function (id, value) {
59719
60113
  var controller = this._controller;
59720
60114
  if (controller) {
59721
60115
  controller.write(id, value);
@@ -59745,10 +60139,10 @@
59745
60139
  enumerable: false,
59746
60140
  configurable: true
59747
60141
  });
59748
- DDiagramDataExtendedImpl.prototype.set = function (id, value, time, from, to) {
60142
+ DDiagramDataExtendedImpl.prototype.set = function (id, value, time, state, from, to) {
59749
60143
  var canvas = this._diagram.canvas;
59750
60144
  if (canvas != null) {
59751
- return canvas.data.extended.set(id, value, time, from, to);
60145
+ return canvas.data.extended.set(id, value, time, state, from, to);
59752
60146
  }
59753
60147
  return false;
59754
60148
  };
@@ -59844,10 +60238,10 @@
59844
60238
  }
59845
60239
  return null;
59846
60240
  };
59847
- DDiagramDataImpl.prototype.set = function (id, value, time, from, to) {
60241
+ DDiagramDataImpl.prototype.set = function (id, value, time, state, from, to) {
59848
60242
  var canvas = this._diagram.canvas;
59849
60243
  if (canvas != null) {
59850
- return canvas.data.set(id, value, time, from, to);
60244
+ return canvas.data.set(id, value, time, state, from, to);
59851
60245
  }
59852
60246
  return false;
59853
60247
  };
@@ -59865,24 +60259,24 @@
59865
60259
  }
59866
60260
  return false;
59867
60261
  };
59868
- DDiagramDataImpl.prototype.setAll = function (id, values, times, from, to) {
60262
+ DDiagramDataImpl.prototype.setAll = function (id, values, times, states, from, to) {
59869
60263
  var canvas = this._diagram.canvas;
59870
60264
  if (canvas != null) {
59871
- return canvas.data.setAll(id, values, times, from, to);
60265
+ return canvas.data.setAll(id, values, times, states, from, to);
59872
60266
  }
59873
60267
  return false;
59874
60268
  };
59875
- DDiagramDataImpl.prototype.setValue = function (id, value, time) {
60269
+ DDiagramDataImpl.prototype.setValue = function (id, value) {
59876
60270
  var canvas = this._diagram.canvas;
59877
60271
  if (canvas != null) {
59878
- return canvas.data.setValue(id, value, time);
60272
+ return canvas.data.setValue(id, value);
59879
60273
  }
59880
60274
  return false;
59881
60275
  };
59882
- DDiagramDataImpl.prototype.setValues = function (id, values, times) {
60276
+ DDiagramDataImpl.prototype.setValues = function (id, values) {
59883
60277
  var canvas = this._diagram.canvas;
59884
60278
  if (canvas != null) {
59885
- return canvas.data.setValues(id, values, times);
60279
+ return canvas.data.setValues(id, values);
59886
60280
  }
59887
60281
  return false;
59888
60282
  };
@@ -59900,6 +60294,20 @@
59900
60294
  }
59901
60295
  return false;
59902
60296
  };
60297
+ DDiagramDataImpl.prototype.setState = function (id, state) {
60298
+ var canvas = this._diagram.canvas;
60299
+ if (canvas != null) {
60300
+ return canvas.data.setState(id, state);
60301
+ }
60302
+ return false;
60303
+ };
60304
+ DDiagramDataImpl.prototype.setStates = function (id, states) {
60305
+ var canvas = this._diagram.canvas;
60306
+ if (canvas != null) {
60307
+ return canvas.data.setStates(id, states);
60308
+ }
60309
+ return false;
60310
+ };
59903
60311
  DDiagramDataImpl.prototype.setRange = function (id, from, to) {
59904
60312
  var canvas = this._diagram.canvas;
59905
60313
  if (canvas != null) {
@@ -63895,13 +64303,21 @@
63895
64303
  var DTableBodyCells = /** @class */ (function () {
63896
64304
  function DTableBodyCells() {
63897
64305
  }
63898
- DTableBodyCells.setReadOnly = function (target, row, columnIndex, column) {
63899
- target.state.isReadOnly = this.toReadOnly(row, columnIndex, column);
63900
- };
63901
- DTableBodyCells.setRenderable = function (target, row, columnIndex, column) {
64306
+ DTableBodyCells.set = function (target, row, columnIndex, column, readOnly) {
64307
+ var _a;
63902
64308
  var renderable = this.toRenderable(row, columnIndex, column);
63903
64309
  target.renderable = renderable;
63904
- target.state.isDisabled = !renderable;
64310
+ var state = target.state;
64311
+ state.lock();
64312
+ state.isDisabled = !renderable;
64313
+ if (readOnly !== false) {
64314
+ state.isReadOnly = this.toReadOnly(row, columnIndex, column);
64315
+ }
64316
+ var columnStateModifier = (_a = column.state) === null || _a === void 0 ? void 0 : _a.modifier;
64317
+ if (columnStateModifier) {
64318
+ columnStateModifier(row, columnIndex, target.state);
64319
+ }
64320
+ state.unlock();
63905
64321
  };
63906
64322
  DTableBodyCells.toReadOnly = function (row, columnIndex, column) {
63907
64323
  var enable = column.editing.enable;
@@ -64034,9 +64450,7 @@
64034
64450
  else {
64035
64451
  this.text = value;
64036
64452
  }
64037
- var column = this._column;
64038
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64039
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64453
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64040
64454
  };
64041
64455
  DTableBodyCellSelectDialog.prototype.unset = function () {
64042
64456
  this._row = undefined;
@@ -64122,9 +64536,7 @@
64122
64536
  this._row = row;
64123
64537
  this._rowIndex = rowIndex;
64124
64538
  this.text = value;
64125
- var column = this._column;
64126
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64127
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64539
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64128
64540
  };
64129
64541
  DTableBodyCellActionMenu.prototype.unset = function () {
64130
64542
  this._row = undefined;
@@ -64238,9 +64650,7 @@
64238
64650
  else {
64239
64651
  this.text = value;
64240
64652
  }
64241
- var column = this._column;
64242
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64243
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64653
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64244
64654
  };
64245
64655
  DTableBodyCellSelectPromise.prototype.unset = function () {
64246
64656
  this._row = undefined;
@@ -64313,9 +64723,7 @@
64313
64723
  this._row = row;
64314
64724
  this._rowIndex = rowIndex;
64315
64725
  this.text = value;
64316
- var column = this._column;
64317
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64318
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64726
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64319
64727
  };
64320
64728
  DTableBodyCellText.prototype.unset = function () {
64321
64729
  this._row = undefined;
@@ -64518,9 +64926,7 @@
64518
64926
  this._row = row;
64519
64927
  this._rowIndex = rowIndex;
64520
64928
  this.state.isActive = !!value;
64521
- var column = this._column;
64522
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64523
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64929
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64524
64930
  };
64525
64931
  DTableBodyCellCheck.prototype.unset = function () {
64526
64932
  this._row = undefined;
@@ -64587,32 +64993,30 @@
64587
64993
  enumerable: false,
64588
64994
  configurable: true
64589
64995
  });
64590
- DTableBodyCellColor.prototype.set = function (newValue, row, supplimental, rowIndex, columnIndex, forcibly) {
64996
+ DTableBodyCellColor.prototype.set = function (value, row, supplimental, rowIndex, columnIndex, forcibly) {
64591
64997
  this._row = row;
64592
64998
  this._rowIndex = rowIndex;
64593
- var value = this.value;
64594
- if (isNumber(newValue)) {
64595
- value.color = newValue;
64596
- value.alpha = 1;
64597
- }
64598
- else if (isString(newValue)) {
64599
- var parsed = Number(newValue);
64600
- value.color = parsed === parsed ? parsed : 0xffffff;
64601
- value.alpha = 1;
64602
- }
64603
- else if (newValue != null) {
64604
- var color = newValue.color;
64605
- var alpha = newValue.alpha;
64606
- value.color = isNumber(color) ? color : 0xffffff;
64607
- value.alpha = isNumber(alpha) ? alpha : 1;
64999
+ var cell = this.value;
65000
+ if (isNumber(value)) {
65001
+ cell.color = value;
65002
+ cell.alpha = 1;
65003
+ }
65004
+ else if (isString(value)) {
65005
+ var parsed = Number(value);
65006
+ cell.color = parsed === parsed ? parsed : 0xffffff;
65007
+ cell.alpha = 1;
65008
+ }
65009
+ else if (value != null) {
65010
+ var color = value.color;
65011
+ var alpha = value.alpha;
65012
+ cell.color = isNumber(color) ? color : 0xffffff;
65013
+ cell.alpha = isNumber(alpha) ? alpha : 1;
64608
65014
  }
64609
65015
  else {
64610
- value.color = 0xffffff;
64611
- value.alpha = 1;
65016
+ cell.color = 0xffffff;
65017
+ cell.alpha = 1;
64612
65018
  }
64613
- var column = this._column;
64614
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64615
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65019
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64616
65020
  };
64617
65021
  DTableBodyCellColor.prototype.unset = function () {
64618
65022
  this._row = undefined;
@@ -64704,9 +65108,7 @@
64704
65108
  this.createOrUpdateText();
64705
65109
  }
64706
65110
  }
64707
- var column = this._column;
64708
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64709
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65111
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64710
65112
  };
64711
65113
  DTableBodyCellDate.prototype.unset = function () {
64712
65114
  this._row = undefined;
@@ -64789,7 +65191,7 @@
64789
65191
  }
64790
65192
  else if (isNumber(value)) {
64791
65193
  var textValueComputed = this._textValueComputed;
64792
- if (textValueComputed === undefined) {
65194
+ if (textValueComputed == null) {
64793
65195
  this.text = new Date(value);
64794
65196
  }
64795
65197
  else if (textValueComputed.getTime() !== value) {
@@ -64798,9 +65200,7 @@
64798
65200
  this.createOrUpdateText();
64799
65201
  }
64800
65202
  }
64801
- var column = this._column;
64802
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64803
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65203
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64804
65204
  };
64805
65205
  DTableBodyCellDatetime.prototype.unset = function () {
64806
65206
  this._row = undefined;
@@ -64858,9 +65258,7 @@
64858
65258
  this._row = row;
64859
65259
  this._rowIndex = rowIndex;
64860
65260
  this.text = rowIndex;
64861
- var column = this._column;
64862
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64863
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65261
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64864
65262
  };
64865
65263
  DTableBodyCellIndex.prototype.unset = function () {
64866
65264
  this._row = undefined;
@@ -64928,9 +65326,7 @@
64928
65326
  this._row = row;
64929
65327
  this._rowIndex = rowIndex;
64930
65328
  this.text = Number(value);
64931
- var column = this._column;
64932
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64933
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65329
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64934
65330
  };
64935
65331
  DTableBodyCellInputInteger.prototype.unset = function () {
64936
65332
  this._row = undefined;
@@ -64998,9 +65394,7 @@
64998
65394
  this._row = row;
64999
65395
  this._rowIndex = rowIndex;
65000
65396
  this.text = Number(value);
65001
- var column = this._column;
65002
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65003
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65397
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65004
65398
  };
65005
65399
  DTableBodyCellInputReal.prototype.unset = function () {
65006
65400
  this._row = undefined;
@@ -65068,9 +65462,7 @@
65068
65462
  this._row = row;
65069
65463
  this._rowIndex = rowIndex;
65070
65464
  this.text = String(value);
65071
- var column = this._column;
65072
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65073
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65465
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65074
65466
  };
65075
65467
  DTableBodyCellInputText.prototype.unset = function () {
65076
65468
  this._row = undefined;
@@ -65326,9 +65718,7 @@
65326
65718
  marker.hide();
65327
65719
  input.padding.adjLeft(0);
65328
65720
  }
65329
- var column = this._column;
65330
- DTableBodyCells.setReadOnly(this._input, row, columnIndex, column);
65331
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65721
+ DTableBodyCells.set(this._input, row, columnIndex, this._column);
65332
65722
  };
65333
65723
  DTableBodyCellInputTree.prototype.unset = function () {
65334
65724
  this._row = undefined;
@@ -65482,9 +65872,7 @@
65482
65872
  this._row = row;
65483
65873
  this._rowIndex = rowIndex;
65484
65874
  this.value = value;
65485
- var column = this._column;
65486
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65487
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65875
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65488
65876
  };
65489
65877
  DTableBodyCellSelectMenu.prototype.unset = function () {
65490
65878
  this._row = undefined;
@@ -65555,9 +65943,7 @@
65555
65943
  this._row = row;
65556
65944
  this._rowIndex = rowIndex;
65557
65945
  this.values = value;
65558
- var column = this._column;
65559
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65560
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65946
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65561
65947
  };
65562
65948
  DTableBodyCellSelectMultiple.prototype.unset = function () {
65563
65949
  this._row = undefined;
@@ -65649,9 +66035,7 @@
65649
66035
  this.createOrUpdateText();
65650
66036
  }
65651
66037
  }
65652
- var column = this._column;
65653
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65654
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
66038
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65655
66039
  };
65656
66040
  DTableBodyCellTime.prototype.unset = function () {
65657
66041
  this._row = undefined;
@@ -65749,8 +66133,7 @@
65749
66133
  this._row = row;
65750
66134
  this._rowIndex = rowIndex;
65751
66135
  this.text = value;
65752
- var column = this._column;
65753
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
66136
+ DTableBodyCells.set(this, row, columnIndex, this._column, false);
65754
66137
  var link = this.link;
65755
66138
  var padding = this._padding;
65756
66139
  if (isNumber(supplimental)) {
@@ -65898,20 +66281,26 @@
65898
66281
  */
65899
66282
  var DTableBodyRow = /** @class */ (function (_super) {
65900
66283
  __extends(DTableBodyRow, _super);
65901
- function DTableBodyRow(onChange, isEven, options) {
66284
+ function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, options) {
65902
66285
  var _this = _super.call(this, options) || this;
65903
66286
  _this._index = -1;
65904
66287
  _this._onCellChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex) {
65905
66288
  _this.emit("change", newValue, oldValue, row, rowIndex, columnIndex, _this);
65906
66289
  onChange(newValue, oldValue, row, rowIndex, columnIndex, _this);
65907
66290
  };
66291
+ _this._columnIndexToCellOptions = columnIndexToCellOptions;
65908
66292
  _this.state.isAlternated = !isEven;
65909
66293
  _this.initCells(options, _this._columns, _this._frozen);
65910
66294
  return _this;
65911
66295
  }
65912
66296
  DTableBodyRow.prototype.newCell = function (columnIndex, column, columns, options) {
65913
66297
  var onChange = this._onCellChangeBound;
65914
- var cellOptions = this.toCellOptions(columnIndex, column, options);
66298
+ var columnIndexToCellOptions = this._columnIndexToCellOptions;
66299
+ var cellOptions = columnIndexToCellOptions.get(columnIndex);
66300
+ if (cellOptions == null) {
66301
+ cellOptions = this.toCellOptions(columnIndex, column, options);
66302
+ columnIndexToCellOptions.set(columnIndex, cellOptions);
66303
+ }
65915
66304
  if (column.editing.enable !== false) {
65916
66305
  return this.newCellEditable(columnIndex, column, onChange, cellOptions);
65917
66306
  }
@@ -66027,51 +66416,48 @@
66027
66416
  }
66028
66417
  };
66029
66418
  DTableBodyRow.prototype.toCellOptions = function (columnIndex, column, options) {
66030
- var _a, _b;
66031
- var result = column.body || options.cell;
66032
- var columnWeight = column.weight;
66033
- var columnWidth = column.width;
66419
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
66420
+ var _p;
66421
+ var result = toMerged(column.body, options.cell);
66422
+ // Weight
66423
+ result.weight = column.weight;
66424
+ // Width
66425
+ result.width = column.width;
66426
+ // State
66427
+ (_a = result.state) !== null && _a !== void 0 ? _a : (result.state = column.state.initial);
66428
+ // Text formatter
66034
66429
  var columnFormatter = column.formatter;
66035
- var columnAlign = column.align;
66036
- var columnSelecting = column.selecting;
66037
- var columnSelectingMenu = columnSelecting.menu || columnSelecting.multiple;
66038
- if (result != null) {
66039
- result.weight = columnWeight;
66040
- result.width = columnWidth;
66041
- var text = result.text || {};
66042
- result.text = text;
66043
- text.formatter || (text.formatter = columnFormatter);
66044
- var textAlign = text.align || {};
66045
- text.align = textAlign;
66046
- textAlign.horizontal = columnAlign;
66047
- result.menu || (result.menu = columnSelectingMenu);
66430
+ if (columnFormatter != null) {
66431
+ var text = ((_b = result.text) !== null && _b !== void 0 ? _b : (result.text = {}));
66432
+ (_c = text.formatter) !== null && _c !== void 0 ? _c : (text.formatter = columnFormatter);
66048
66433
  }
66049
- else {
66050
- result = {
66051
- weight: columnWeight,
66052
- width: columnWidth,
66053
- text: {
66054
- formatter: columnFormatter,
66055
- align: {
66056
- horizontal: columnAlign
66057
- }
66058
- },
66059
- menu: columnSelectingMenu
66060
- };
66434
+ // Text align horizontal
66435
+ var columnAlign = column.align;
66436
+ if (columnAlign != null) {
66437
+ var text = ((_d = result.text) !== null && _d !== void 0 ? _d : (result.text = {}));
66438
+ var textAlign = ((_e = text.align) !== null && _e !== void 0 ? _e : (text.align = {}));
66439
+ (_f = textAlign.horizontal) !== null && _f !== void 0 ? _f : (textAlign.horizontal = columnAlign);
66061
66440
  }
66441
+ // Editing
66062
66442
  var columnEditing = column.editing;
66063
66443
  if (columnEditing.enable !== false) {
66064
- var editing = result.editing || {};
66065
- result.editing = editing;
66066
- editing.formatter || (editing.formatter = columnEditing.formatter);
66067
- editing.unformatter || (editing.unformatter = columnEditing.unformatter);
66068
- editing.validator || (editing.validator = columnEditing.validator);
66444
+ var editing = ((_g = (_p = result).editing) !== null && _g !== void 0 ? _g : (_p.editing = {}));
66445
+ (_h = editing.formatter) !== null && _h !== void 0 ? _h : (editing.formatter = columnEditing.formatter);
66446
+ (_j = editing.unformatter) !== null && _j !== void 0 ? _j : (editing.unformatter = columnEditing.unformatter);
66447
+ (_k = editing.validator) !== null && _k !== void 0 ? _k : (editing.validator = columnEditing.validator);
66069
66448
  }
66449
+ // Link
66070
66450
  var columnLink = column.link;
66071
- if (columnLink) {
66451
+ if (columnLink !== undefined) {
66072
66452
  result.link = columnLink;
66073
66453
  }
66074
- var selectionType = (_b = (_a = options === null || options === void 0 ? void 0 : options.selection) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : DTableDataSelectionType.NONE;
66454
+ // Selecting
66455
+ var columnSelecting = column.selecting;
66456
+ var columnSelectingMenu = (_l = columnSelecting.menu) !== null && _l !== void 0 ? _l : columnSelecting.multiple;
66457
+ if (columnSelectingMenu !== undefined) {
66458
+ result.menu = columnSelectingMenu;
66459
+ }
66460
+ var selectionType = (_o = (_m = options === null || options === void 0 ? void 0 : options.selection) === null || _m === void 0 ? void 0 : _m.type) !== null && _o !== void 0 ? _o : DTableDataSelectionType.NONE;
66075
66461
  if (selectionType !== DTableDataSelectionType.NONE) {
66076
66462
  result.when = "DOUBLE_CLICKED";
66077
66463
  result.cursor = function (state) {
@@ -67109,6 +67495,7 @@
67109
67495
  _this._onRowChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex) {
67110
67496
  data.emit("change", newValue, oldValue, row, rowIndex, columnIndex, data);
67111
67497
  };
67498
+ _this._columnIndexToCellOptions = new Map();
67112
67499
  _this._data.emit("init", _this._data);
67113
67500
  return _this;
67114
67501
  }
@@ -67300,7 +67687,7 @@
67300
67687
  return row;
67301
67688
  };
67302
67689
  DTableBody.prototype.newRow = function (isEven) {
67303
- return new DTableBodyRow(this._onRowChangeBound, isEven, this._rowOptions);
67690
+ return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
67304
67691
  };
67305
67692
  DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
67306
67693
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
@@ -69063,6 +69450,27 @@
69063
69450
  }
69064
69451
  }
69065
69452
  };
69453
+ var toColumnState = function (options) {
69454
+ var state = options.state;
69455
+ if (state != null) {
69456
+ if (isString(state) || isArray(state)) {
69457
+ return {
69458
+ initial: state,
69459
+ modifier: undefined
69460
+ };
69461
+ }
69462
+ else {
69463
+ return {
69464
+ initial: undefined,
69465
+ modifier: state
69466
+ };
69467
+ }
69468
+ }
69469
+ return {
69470
+ initial: undefined,
69471
+ modifier: undefined
69472
+ };
69473
+ };
69066
69474
  var toColumnPath = function (options) {
69067
69475
  return options.path != null ? options.path.split(".") : null;
69068
69476
  };
@@ -69104,6 +69512,7 @@
69104
69512
  formatter: options.formatter,
69105
69513
  renderable: toColumnRenderable(options, path),
69106
69514
  align: align,
69515
+ state: toColumnState(options),
69107
69516
  editing: toColumnEditing(options, path),
69108
69517
  sorting: toColumnSorting(getter, index, options),
69109
69518
  header: options.header,
@@ -71224,6 +71633,7 @@
71224
71633
  buildRectangleUv: buildRectangleUv,
71225
71634
  TEXT_VERTEX_COUNT: TEXT_VERTEX_COUNT,
71226
71635
  TEXT_INDEX_COUNT: TEXT_INDEX_COUNT,
71636
+ TEXT_FMIN: TEXT_FMIN,
71227
71637
  toTextBufferCount: toTextBufferCount,
71228
71638
  buildTextClipping: buildTextClipping,
71229
71639
  buildTextIndex: buildTextIndex,
@@ -71448,6 +71858,7 @@
71448
71858
  EShapeDataValueRangeImpl: EShapeDataValueRangeImpl,
71449
71859
  EShapeDataValueRangeType: EShapeDataValueRangeType,
71450
71860
  EShapeDataValueScope: EShapeDataValueScope,
71861
+ EShapeDataValueState: EShapeDataValueState,
71451
71862
  EShapeDataValueType: EShapeDataValueType,
71452
71863
  EShapeDefaults: EShapeDefaults,
71453
71864
  EShapeDeleter: EShapeDeleter,
@@ -71549,14 +71960,17 @@
71549
71960
  isFunction: isFunction,
71550
71961
  isNaN: isNaN,
71551
71962
  isNumber: isNumber,
71963
+ isObject: isObject,
71552
71964
  isString: isString,
71553
71965
  Lazy: Lazy,
71554
71966
  NumberFormatterImpl: NumberFormatterImpl,
71555
71967
  NumberFormatters: NumberFormatters,
71556
71968
  toCeilingIndex: toCeilingIndex,
71969
+ toCloned: toCloned,
71557
71970
  toEnum: toEnum,
71558
71971
  toIndexOf: toIndexOf,
71559
71972
  toLabel: toLabel$1,
71973
+ toMerged: toMerged,
71560
71974
  toPadded: toPadded,
71561
71975
  toString: toString,
71562
71976
  toSvgTexture: toSvgTexture,