@wcardinal/wcardinal-ui 0.200.2 → 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 (225) hide show
  1. package/dist/types/wcardinal/ui/{d-controller-default-command.d.ts → d-controller-command-impl.d.ts} +1 -1
  2. package/dist/types/wcardinal/ui/{d-controller-default-focus.d.ts → d-controller-focus-impl.d.ts} +1 -1
  3. package/dist/types/wcardinal/ui/d-diagram-base.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/d-diagram-canvas-data-impl.d.ts +7 -4
  5. package/dist/types/wcardinal/ui/d-diagram-canvas-data.d.ts +7 -4
  6. package/dist/types/wcardinal/ui/d-diagram-canvas.d.ts +2 -3
  7. package/dist/types/wcardinal/ui/d-diagram-data-extended-impl.d.ts +2 -1
  8. package/dist/types/wcardinal/ui/d-diagram-data-impl.d.ts +7 -4
  9. package/dist/types/wcardinal/ui/d-diagram-data-private-impl.d.ts +2 -1
  10. package/dist/types/wcardinal/ui/d-diagram-data-protected-impl.d.ts +2 -1
  11. package/dist/types/wcardinal/ui/d-diagram-data-remote-impl.d.ts +1 -1
  12. package/dist/types/wcardinal/ui/d-diagram-data-remote.d.ts +1 -1
  13. package/dist/types/wcardinal/ui/d-diagram-data-scoped.d.ts +2 -1
  14. package/dist/types/wcardinal/ui/d-diagram-data.d.ts +5 -2
  15. package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +4 -0
  16. package/dist/types/wcardinal/ui/d-table-body-cell-color.d.ts +1 -1
  17. package/dist/types/wcardinal/ui/d-table-body-cell-options.d.ts +18 -0
  18. package/dist/types/wcardinal/ui/d-table-body-cell-select-dialog.d.ts +1 -1
  19. package/dist/types/wcardinal/ui/d-table-body-cell-select-promise.d.ts +1 -1
  20. package/dist/types/wcardinal/ui/d-table-body-cell-time.d.ts +1 -1
  21. package/dist/types/wcardinal/ui/d-table-body-cells.d.ts +7 -5
  22. package/dist/types/wcardinal/ui/d-table-body-row.d.ts +6 -4
  23. package/dist/types/wcardinal/ui/d-table-body.d.ts +2 -0
  24. package/dist/types/wcardinal/ui/d-table-column-editing.d.ts +16 -0
  25. package/dist/types/wcardinal/ui/d-table-column-formatter.d.ts +1 -0
  26. package/dist/types/wcardinal/ui/d-table-column-getter.d.ts +1 -0
  27. package/dist/types/wcardinal/ui/d-table-column-renderable.d.ts +1 -0
  28. package/dist/types/wcardinal/ui/d-table-column-selecting.d.ts +25 -0
  29. package/dist/types/wcardinal/ui/d-table-column-setter.d.ts +1 -0
  30. package/dist/types/wcardinal/ui/d-table-column-sorting.d.ts +9 -0
  31. package/dist/types/wcardinal/ui/d-table-column-state.d.ts +11 -0
  32. package/dist/types/wcardinal/ui/d-table-column-type.d.ts +18 -0
  33. package/dist/types/wcardinal/ui/d-table-column.d.ts +33 -101
  34. package/dist/types/wcardinal/ui/index.d.ts +12 -2
  35. package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtimes.d.ts +7 -15
  36. package/dist/types/wcardinal/ui/shape/e-shape-data-impl.d.ts +7 -0
  37. package/dist/types/wcardinal/ui/shape/e-shape-data-scoped-impl.d.ts +2 -1
  38. package/dist/types/wcardinal/ui/shape/e-shape-data-scoped.d.ts +2 -1
  39. package/dist/types/wcardinal/ui/shape/e-shape-data-value-formatter.d.ts +1 -0
  40. package/dist/types/wcardinal/ui/shape/e-shape-data-value-impl.d.ts +10 -1
  41. package/dist/types/wcardinal/ui/shape/e-shape-data-value-state.d.ts +32 -0
  42. package/dist/types/wcardinal/ui/shape/e-shape-data-value.d.ts +6 -1
  43. package/dist/types/wcardinal/ui/shape/e-shape-data.d.ts +4 -0
  44. package/dist/types/wcardinal/ui/shape/index.d.ts +2 -0
  45. package/dist/types/wcardinal/ui/shape/variant/build-text.d.ts +2 -1
  46. package/dist/types/wcardinal/ui/shape/variant/builder-text.d.ts +2 -0
  47. package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded-layer.d.ts +1 -1
  48. package/dist/types/wcardinal/ui/shape/variant/e-shape-embedded.d.ts +1 -1
  49. package/dist/types/wcardinal/ui/shape/variant/e-shape-group-viewer.d.ts +2 -4
  50. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.d.ts +2 -0
  51. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header-cell.d.ts +2 -0
  52. package/dist/types/wcardinal/ui/util/index.d.ts +3 -0
  53. package/dist/types/wcardinal/ui/util/is-object.d.ts +1 -0
  54. package/dist/types/wcardinal/ui/util/to-cloned.d.ts +1 -0
  55. package/dist/types/wcardinal/ui/util/to-merged.d.ts +1 -0
  56. package/dist/wcardinal/ui/d-application.js +2 -2
  57. package/dist/wcardinal/ui/d-application.js.map +1 -1
  58. package/dist/wcardinal/ui/d-base.js +2 -2
  59. package/dist/wcardinal/ui/d-base.js.map +1 -1
  60. package/dist/wcardinal/ui/{d-controller-default-command.js → d-controller-command-impl.js} +24 -24
  61. package/dist/wcardinal/ui/d-controller-command-impl.js.map +1 -0
  62. package/dist/wcardinal/ui/{d-controller-default-focus.js → d-controller-focus-impl.js} +18 -18
  63. package/dist/wcardinal/ui/d-controller-focus-impl.js.map +1 -0
  64. package/dist/wcardinal/ui/d-controllers.js +2 -2
  65. package/dist/wcardinal/ui/d-controllers.js.map +1 -1
  66. package/dist/wcardinal/ui/d-diagram-base.js.map +1 -1
  67. package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js +50 -16
  68. package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js.map +1 -1
  69. package/dist/wcardinal/ui/d-diagram-canvas-data.js.map +1 -1
  70. package/dist/wcardinal/ui/d-diagram-canvas.js +13 -16
  71. package/dist/wcardinal/ui/d-diagram-canvas.js.map +1 -1
  72. package/dist/wcardinal/ui/d-diagram-data-extended-impl.js +2 -2
  73. package/dist/wcardinal/ui/d-diagram-data-extended-impl.js.map +1 -1
  74. package/dist/wcardinal/ui/d-diagram-data-impl.js +22 -8
  75. package/dist/wcardinal/ui/d-diagram-data-impl.js.map +1 -1
  76. package/dist/wcardinal/ui/d-diagram-data-private-impl.js +2 -2
  77. package/dist/wcardinal/ui/d-diagram-data-private-impl.js.map +1 -1
  78. package/dist/wcardinal/ui/d-diagram-data-protected-impl.js +2 -2
  79. package/dist/wcardinal/ui/d-diagram-data-protected-impl.js.map +1 -1
  80. package/dist/wcardinal/ui/d-diagram-data-remote-impl.js +1 -1
  81. package/dist/wcardinal/ui/d-diagram-data-remote-impl.js.map +1 -1
  82. package/dist/wcardinal/ui/d-diagram-data-remote.js.map +1 -1
  83. package/dist/wcardinal/ui/d-diagram-data-scoped.js.map +1 -1
  84. package/dist/wcardinal/ui/d-diagram-data.js.map +1 -1
  85. package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
  86. package/dist/wcardinal/ui/d-table-body-cell-action-menu.js +1 -3
  87. package/dist/wcardinal/ui/d-table-body-cell-action-menu.js.map +1 -1
  88. package/dist/wcardinal/ui/d-table-body-cell-check.js +2 -4
  89. package/dist/wcardinal/ui/d-table-body-cell-check.js.map +1 -1
  90. package/dist/wcardinal/ui/d-table-body-cell-color.js +17 -19
  91. package/dist/wcardinal/ui/d-table-body-cell-color.js.map +1 -1
  92. package/dist/wcardinal/ui/d-table-body-cell-date.js +1 -3
  93. package/dist/wcardinal/ui/d-table-body-cell-date.js.map +1 -1
  94. package/dist/wcardinal/ui/d-table-body-cell-datetime.js +2 -4
  95. package/dist/wcardinal/ui/d-table-body-cell-datetime.js.map +1 -1
  96. package/dist/wcardinal/ui/d-table-body-cell-index.js +1 -3
  97. package/dist/wcardinal/ui/d-table-body-cell-index.js.map +1 -1
  98. package/dist/wcardinal/ui/d-table-body-cell-input-integer.js +1 -3
  99. package/dist/wcardinal/ui/d-table-body-cell-input-integer.js.map +1 -1
  100. package/dist/wcardinal/ui/d-table-body-cell-input-real.js +1 -3
  101. package/dist/wcardinal/ui/d-table-body-cell-input-real.js.map +1 -1
  102. package/dist/wcardinal/ui/d-table-body-cell-input-text.js +1 -3
  103. package/dist/wcardinal/ui/d-table-body-cell-input-text.js.map +1 -1
  104. package/dist/wcardinal/ui/d-table-body-cell-input-tree.js +1 -3
  105. package/dist/wcardinal/ui/d-table-body-cell-input-tree.js.map +1 -1
  106. package/dist/wcardinal/ui/d-table-body-cell-options.js +6 -0
  107. package/dist/wcardinal/ui/d-table-body-cell-options.js.map +1 -0
  108. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js +1 -3
  109. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js.map +1 -1
  110. package/dist/wcardinal/ui/d-table-body-cell-select-menu.js +1 -3
  111. package/dist/wcardinal/ui/d-table-body-cell-select-menu.js.map +1 -1
  112. package/dist/wcardinal/ui/d-table-body-cell-select-multiple.js +1 -3
  113. package/dist/wcardinal/ui/d-table-body-cell-select-multiple.js.map +1 -1
  114. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js +1 -3
  115. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js.map +1 -1
  116. package/dist/wcardinal/ui/d-table-body-cell-text.js +1 -3
  117. package/dist/wcardinal/ui/d-table-body-cell-text.js.map +1 -1
  118. package/dist/wcardinal/ui/d-table-body-cell-time.js +1 -3
  119. package/dist/wcardinal/ui/d-table-body-cell-time.js.map +1 -1
  120. package/dist/wcardinal/ui/d-table-body-cell-tree.js +1 -2
  121. package/dist/wcardinal/ui/d-table-body-cell-tree.js.map +1 -1
  122. package/dist/wcardinal/ui/d-table-body-cells.js +13 -5
  123. package/dist/wcardinal/ui/d-table-body-cells.js.map +1 -1
  124. package/dist/wcardinal/ui/d-table-body-row.js +43 -39
  125. package/dist/wcardinal/ui/d-table-body-row.js.map +1 -1
  126. package/dist/wcardinal/ui/d-table-body.js +2 -1
  127. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  128. package/dist/wcardinal/ui/d-table-column-editing.js +6 -0
  129. package/dist/wcardinal/ui/d-table-column-editing.js.map +1 -0
  130. package/dist/wcardinal/ui/d-table-column-formatter.js +6 -0
  131. package/dist/wcardinal/ui/d-table-column-formatter.js.map +1 -0
  132. package/dist/wcardinal/ui/d-table-column-getter.js +6 -0
  133. package/dist/wcardinal/ui/d-table-column-getter.js.map +1 -0
  134. package/dist/wcardinal/ui/d-table-column-renderable.js +6 -0
  135. package/dist/wcardinal/ui/d-table-column-renderable.js.map +1 -0
  136. package/dist/wcardinal/ui/d-table-column-selecting.js +6 -0
  137. package/dist/wcardinal/ui/d-table-column-selecting.js.map +1 -0
  138. package/dist/wcardinal/ui/d-table-column-setter.js +6 -0
  139. package/dist/wcardinal/ui/d-table-column-setter.js.map +1 -0
  140. package/dist/wcardinal/ui/d-table-column-sorting.js +6 -0
  141. package/dist/wcardinal/ui/d-table-column-sorting.js.map +1 -0
  142. package/dist/wcardinal/ui/d-table-column-state.js +6 -0
  143. package/dist/wcardinal/ui/d-table-column-state.js.map +1 -0
  144. package/dist/wcardinal/ui/d-table-column-type.js +22 -0
  145. package/dist/wcardinal/ui/d-table-column-type.js.map +1 -0
  146. package/dist/wcardinal/ui/d-table-column.js +1 -17
  147. package/dist/wcardinal/ui/d-table-column.js.map +1 -1
  148. package/dist/wcardinal/ui/d-table.js +23 -1
  149. package/dist/wcardinal/ui/d-table.js.map +1 -1
  150. package/dist/wcardinal/ui/index.js +12 -2
  151. package/dist/wcardinal/ui/index.js.map +1 -1
  152. package/dist/wcardinal/ui/shape/action/e-shape-action-expressions.js +2 -0
  153. package/dist/wcardinal/ui/shape/action/e-shape-action-expressions.js.map +1 -1
  154. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-both.js +2 -2
  155. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-both.js.map +1 -1
  156. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-local.js +1 -1
  157. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-local.js.map +1 -1
  158. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-remote.js +1 -1
  159. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-misc-write-remote.js.map +1 -1
  160. package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js +30 -29
  161. package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js.map +1 -1
  162. package/dist/wcardinal/ui/shape/action/e-shape-action-value-on-input-actions.js +4 -4
  163. package/dist/wcardinal/ui/shape/action/e-shape-action-value-on-input-actions.js.map +1 -1
  164. package/dist/wcardinal/ui/shape/e-shape-data-impl.js +57 -0
  165. package/dist/wcardinal/ui/shape/e-shape-data-impl.js.map +1 -1
  166. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js +5 -1
  167. package/dist/wcardinal/ui/shape/e-shape-data-scoped-impl.js.map +1 -1
  168. package/dist/wcardinal/ui/shape/e-shape-data-scoped.js.map +1 -1
  169. package/dist/wcardinal/ui/shape/e-shape-data-value-formatter.js +6 -0
  170. package/dist/wcardinal/ui/shape/e-shape-data-value-formatter.js.map +1 -0
  171. package/dist/wcardinal/ui/shape/e-shape-data-value-impl.js +211 -56
  172. package/dist/wcardinal/ui/shape/e-shape-data-value-impl.js.map +1 -1
  173. package/dist/wcardinal/ui/shape/e-shape-data-value-state.js +36 -0
  174. package/dist/wcardinal/ui/shape/e-shape-data-value-state.js.map +1 -0
  175. package/dist/wcardinal/ui/shape/e-shape-data-value.js.map +1 -1
  176. package/dist/wcardinal/ui/shape/e-shape-data.js.map +1 -1
  177. package/dist/wcardinal/ui/shape/e-shape-runtime.js +4 -2
  178. package/dist/wcardinal/ui/shape/e-shape-runtime.js.map +1 -1
  179. package/dist/wcardinal/ui/shape/index.js +2 -0
  180. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  181. package/dist/wcardinal/ui/shape/variant/build-text.js +84 -63
  182. package/dist/wcardinal/ui/shape/variant/build-text.js.map +1 -1
  183. package/dist/wcardinal/ui/shape/variant/builder-text.js +18 -3
  184. package/dist/wcardinal/ui/shape/variant/builder-text.js.map +1 -1
  185. package/dist/wcardinal/ui/shape/variant/deserialize-embedded-layer.js +2 -3
  186. package/dist/wcardinal/ui/shape/variant/deserialize-embedded-layer.js.map +1 -1
  187. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +4 -3
  188. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
  189. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +3 -1
  190. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  191. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js +3 -3
  192. package/dist/wcardinal/ui/shape/variant/e-shape-embedded-layer.js.map +1 -1
  193. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js +3 -3
  194. package/dist/wcardinal/ui/shape/variant/e-shape-embedded.js.map +1 -1
  195. package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js +1 -1
  196. package/dist/wcardinal/ui/shape/variant/e-shape-embeddeds.js.map +1 -1
  197. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js +4 -18
  198. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js.map +1 -1
  199. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js +11 -0
  200. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js.map +1 -1
  201. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js +11 -0
  202. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js.map +1 -1
  203. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js +1 -1
  204. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js.map +1 -1
  205. package/dist/wcardinal/ui/util/index.js +3 -0
  206. package/dist/wcardinal/ui/util/index.js.map +1 -1
  207. package/dist/wcardinal/ui/util/is-object.js +13 -0
  208. package/dist/wcardinal/ui/util/is-object.js.map +1 -0
  209. package/dist/wcardinal/ui/util/to-cloned.js +32 -0
  210. package/dist/wcardinal/ui/util/to-cloned.js.map +1 -0
  211. package/dist/wcardinal/ui/util/to-merged.js +45 -0
  212. package/dist/wcardinal/ui/util/to-merged.js.map +1 -0
  213. package/dist/wcardinal-ui-theme-dark.js +12 -1
  214. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  215. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  216. package/dist/wcardinal-ui-theme-white.js +12 -1
  217. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  218. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  219. package/dist/wcardinal-ui.cjs.js +1451 -1014
  220. package/dist/wcardinal-ui.js +1429 -1014
  221. package/dist/wcardinal-ui.min.js +2 -2
  222. package/dist/wcardinal-ui.min.js.map +1 -1
  223. package/package.json +1 -1
  224. package/dist/wcardinal/ui/d-controller-default-command.js.map +0 -1
  225. package/dist/wcardinal/ui/d-controller-default-focus.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.200.2
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) {
@@ -7833,15 +8121,17 @@
7833
8121
  var data = shape.data;
7834
8122
  var isEffectTimeUp = this.effect <= time;
7835
8123
  if (data.isChanged || this.isStateChanged || isEffectTimeUp) {
8124
+ this.isStateChanged = false;
8125
+ data.isChanged = false;
7836
8126
  if (isEffectTimeUp) {
7837
8127
  this.effect = NaN;
7838
8128
  }
7839
8129
  shape.disallowUploadedUpdate();
7840
8130
  this.onUpdate(shape, time);
7841
8131
  shape.allowUploadedUpdate();
8132
+ var wasStateChanged = this.isStateChanged;
7842
8133
  shape.state.removeAll(EShapeState.CLICKED, EShapeState.DOWN, EShapeState.UP, EShapeState.ACTIVATED, EShapeState.DEACTIVATED);
7843
- this.isStateChanged = false;
7844
- data.isChanged = false;
8134
+ this.isStateChanged = wasStateChanged;
7845
8135
  }
7846
8136
  };
7847
8137
  EShapeRuntime.prototype.onRender = function (shape, time, renderer) {
@@ -7960,6 +8250,7 @@
7960
8250
  "try {" +
7961
8251
  "with (shape) {" +
7962
8252
  "with (state) {" +
8253
+ "with (data.alias) {" +
7963
8254
  "with (environment) {" +
7964
8255
  (nullable ?
7965
8256
  ("var result = (".concat(expression, ");") +
@@ -7968,6 +8259,7 @@
7968
8259
  "}" +
7969
8260
  "}" +
7970
8261
  "}" +
8262
+ "}" +
7971
8263
  "} catch (e) {" +
7972
8264
  "return ".concat(defLiteral, ";") +
7973
8265
  "}";
@@ -13521,9 +13813,9 @@
13521
13813
  if (target === this) {
13522
13814
  return true;
13523
13815
  }
13524
- else if (target != null && !(target instanceof DBase)) {
13816
+ else if (target != null && !(target instanceof DBase && target.interactive)) {
13525
13817
  var parent_5 = target.parent;
13526
- while (parent_5 != null && !(parent_5 instanceof DBase)) {
13818
+ while (parent_5 != null && !(parent_5 instanceof DBase && parent_5.interactive)) {
13527
13819
  parent_5 = parent_5.parent;
13528
13820
  }
13529
13821
  return parent_5 === this;
@@ -16018,569 +16310,6 @@
16018
16310
  return EShapeGroupFillViewer;
16019
16311
  }());
16020
16312
 
16021
- /*
16022
- * Copyright (C) 2019 Toshiba Corporation
16023
- * SPDX-License-Identifier: Apache-2.0
16024
- */
16025
- /* eslint-disable prettier/prettier */
16026
- var NONE = 0x0;
16027
- var ID = 0x1;
16028
- var POSITION = 0x2;
16029
- var WIDTH = 0x4;
16030
- var HEIGHT = 0x8;
16031
- var ROTATION = 0x10;
16032
- var SKEW = 0x20;
16033
- var REPLACING = 0x40;
16034
- var GROUPING = 0x80;
16035
- var UNGROUPING = 0x100;
16036
- var FILL = 0x200;
16037
- var STROKE = 0x400;
16038
- var STROKE_SIDE = 0x800;
16039
- var BORDER_RADIUS = 0x1000;
16040
- var TEXT = 0x2000;
16041
- var TEXTURE = 0x4000;
16042
- var DATA = 0x8000;
16043
- var ACTION = 0x10000;
16044
- var CURSOR = 0x20000;
16045
- var ORDER_IN_LAYER = 0x40000;
16046
- var CHILDREN = 0x80000;
16047
- var DATA_MAPPING = 0x100000;
16048
- var COORDINATE = ID | POSITION | WIDTH | HEIGHT | ROTATION | SKEW;
16049
- var SHAPE = REPLACING | GROUPING | FILL | STROKE;
16050
- var LAYER = ORDER_IN_LAYER;
16051
- var PRIMITIVE = COORDINATE | SHAPE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
16052
- var GROUP = PRIMITIVE | UNGROUPING;
16053
- var EMBEDDED = COORDINATE | REPLACING | GROUPING | TEXT | DATA | ACTION | LAYER | DATA_MAPPING;
16054
- var CONNECTOR = ID | REPLACING | FILL | STROKE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
16055
- var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
16056
- var EShapeCapability = {
16057
- NONE: NONE,
16058
- /**
16059
- * Allows shape IDs to be modified.
16060
- */
16061
- ID: ID,
16062
- /**
16063
- * Allows shape positions to be modified.
16064
- */
16065
- POSITION: POSITION,
16066
- /**
16067
- * Allows shape widths to be modified.
16068
- */
16069
- WIDTH: WIDTH,
16070
- /**
16071
- * Allows shape heights to be modified.
16072
- */
16073
- HEIGHT: HEIGHT,
16074
- /**
16075
- * Allows shape rotations to be modified.
16076
- */
16077
- ROTATION: ROTATION,
16078
- /**
16079
- * Allows shape skews to be modified.
16080
- */
16081
- SKEW: SKEW,
16082
- /** @deprecated */
16083
- ALIGN: NONE,
16084
- /**
16085
- * Allows shapes to be replaced with other shapes.
16086
- */
16087
- REPLACING: REPLACING,
16088
- /**
16089
- * Allows shapes to be grouped.
16090
- */
16091
- GROUPING: GROUPING,
16092
- /**
16093
- * Allows grouped shapes to be ungrouped.
16094
- */
16095
- UNGROUPING: UNGROUPING,
16096
- /**
16097
- * Allows shape fills to be modified.
16098
- */
16099
- FILL: FILL,
16100
- /**
16101
- * Allows shape strokes to be modified.
16102
- */
16103
- STROKE: STROKE,
16104
- /**
16105
- * Allows shape stroke sides to be modified.
16106
- */
16107
- STROKE_SIDE: STROKE_SIDE,
16108
- /**
16109
- * Allows shape border radiuses to be modified.
16110
- */
16111
- BORDER_RADIUS: BORDER_RADIUS,
16112
- /**
16113
- * Allows shape texts to be modified.
16114
- */
16115
- TEXT: TEXT,
16116
- /**
16117
- * Allows shape textures to be modified.
16118
- */
16119
- TEXTURE: TEXTURE,
16120
- /** @deprecated in favor of {@link DATA} */
16121
- TAG: DATA,
16122
- /**
16123
- * Allows shape data to be modified.
16124
- */
16125
- DATA: DATA,
16126
- /**
16127
- * Allows shape data mapping to be modified.
16128
- */
16129
- DATA_MAPPING: DATA_MAPPING,
16130
- /**
16131
- * Allows shape actions to be modified.
16132
- */
16133
- ACTION: ACTION,
16134
- /**
16135
- * Allows shape cursors to be modified.
16136
- */
16137
- CURSOR: CURSOR,
16138
- /**
16139
- * Allows shape orders in layer to be modified.
16140
- */
16141
- ORDER_IN_LAYER: ORDER_IN_LAYER,
16142
- /**
16143
- * Allows shape children to be modified.
16144
- */
16145
- CHILDREN: CHILDREN,
16146
- COORDINATE: COORDINATE,
16147
- SHAPE: SHAPE,
16148
- LAYER: LAYER,
16149
- PRIMITIVE: PRIMITIVE,
16150
- GROUP: GROUP,
16151
- EMBEDDED: EMBEDDED,
16152
- CONNECTOR: CONNECTOR,
16153
- ALL: ALL
16154
- };
16155
-
16156
- /*
16157
- * Copyright (C) 2019 Toshiba Corporation
16158
- * SPDX-License-Identifier: Apache-2.0
16159
- */
16160
- var EShapeCapabilities = /** @class */ (function () {
16161
- function EShapeCapabilities() {
16162
- }
16163
- EShapeCapabilities.get = function (type) {
16164
- var capability = this.mappings[type];
16165
- if (capability != null) {
16166
- return capability;
16167
- }
16168
- return EShapeCapability.PRIMITIVE;
16169
- };
16170
- EShapeCapabilities.contains = function (shape, target) {
16171
- if (shape != null) {
16172
- var capability = this.get(shape.type);
16173
- if (capability & target) {
16174
- return true;
16175
- }
16176
- if (capability & EShapeCapability.CHILDREN) {
16177
- var children = shape.children;
16178
- for (var i = 0, imax = children.length; i < imax; ++i) {
16179
- if (this.contains(children[i], target)) {
16180
- return true;
16181
- }
16182
- }
16183
- }
16184
- }
16185
- return false;
16186
- };
16187
- EShapeCapabilities.set = function (type, capability) {
16188
- this.mappings[type] = capability;
16189
- };
16190
- EShapeCapabilities.mappings = {};
16191
- return EShapeCapabilities;
16192
- }());
16193
-
16194
- /*
16195
- * Copyright (C) 2019 Toshiba Corporation
16196
- * SPDX-License-Identifier: Apache-2.0
16197
- */
16198
- var EShapeEditor = /** @class */ (function () {
16199
- function EShapeEditor() {
16200
- this.localTransform = new pixi_js.Matrix();
16201
- this.internalTransform = new pixi_js.Matrix();
16202
- this.internalTransformParentInverse = new pixi_js.Matrix();
16203
- this.rotation = 0;
16204
- this.size = new pixi_js.Point();
16205
- }
16206
- return EShapeEditor;
16207
- }());
16208
-
16209
- /*
16210
- * Copyright (C) 2019 Toshiba Corporation
16211
- * SPDX-License-Identifier: Apache-2.0
16212
- */
16213
- var toSizeNormalized = function (size) {
16214
- var THRESHOLD = 0.001;
16215
- if (Math.abs(size) < THRESHOLD) {
16216
- return size < 0 ? -THRESHOLD : +THRESHOLD;
16217
- }
16218
- return size;
16219
- };
16220
-
16221
- /*
16222
- * Copyright (C) 2019 Toshiba Corporation
16223
- * SPDX-License-Identifier: Apache-2.0
16224
- */
16225
- var EShapeTransforms = /** @class */ (function () {
16226
- function EShapeTransforms() {
16227
- }
16228
- EShapeTransforms.prepare = function (shape) {
16229
- var editor = shape.editor || new EShapeEditor();
16230
- shape.editor = editor;
16231
- // Transform
16232
- shape.updateTransform();
16233
- var parent = shape.parent;
16234
- if (parent instanceof EShapeBase) {
16235
- parent.transform.internalTransform
16236
- .copyTo(editor.internalTransformParentInverse)
16237
- .invert();
16238
- }
16239
- else {
16240
- editor.internalTransformParentInverse.identity();
16241
- }
16242
- shape.transform.internalTransform.copyTo(editor.internalTransform);
16243
- // Rotation
16244
- editor.rotation = shape.transform.rotation;
16245
- // Size
16246
- editor.size.copyFrom(shape.size);
16247
- //
16248
- shape.disallowOnTransformChange();
16249
- };
16250
- EShapeTransforms.finalize = function (shape) {
16251
- shape.allowOnTransformChange(true);
16252
- };
16253
- EShapeTransforms.apply = function (shape, transform, keepSize) {
16254
- var editor = shape.editor;
16255
- if (editor != null) {
16256
- var newLocalTransform = editor.localTransform;
16257
- editor.internalTransformParentInverse
16258
- .copyTo(newLocalTransform)
16259
- .append(transform)
16260
- .append(editor.internalTransform);
16261
- if (keepSize) {
16262
- this.applyLocal(shape, newLocalTransform);
16263
- }
16264
- else {
16265
- var size = editor.size;
16266
- this.applyLocal(shape, newLocalTransform, size.x, size.y);
16267
- }
16268
- }
16269
- };
16270
- EShapeTransforms.applyLocal = function (shape, localTransform, bx, by) {
16271
- shape.disallowUploadedUpdate();
16272
- // Reconstruct the position, the rotation and the size
16273
- var a = localTransform.a;
16274
- var b = localTransform.b;
16275
- var c = localTransform.c;
16276
- var d = localTransform.d;
16277
- var tx = localTransform.tx;
16278
- var ty = localTransform.ty;
16279
- // Rotation
16280
- var transform = shape.transform;
16281
- var rx = Math.atan2(-c, d); // rotation - skewX
16282
- var ry = Math.atan2(+b, a); // rotation + skewY
16283
- transform.rotation = (rx + ry) * 0.5; // Here, assumes `skewX` === `skewY`
16284
- // Skew
16285
- var skew = (ry - rx) * 0.5;
16286
- transform.skew.set(skew, skew);
16287
- // Position: Assumes the pivot is invariant.
16288
- // tx = position.x - (a * px + c * py)
16289
- // ty = position.y - (b * px + d * py)
16290
- //
16291
- // Thus,
16292
- // position.x = tx + (a * px + c * py)
16293
- // position.y = ty + (b * px + d * py)
16294
- var pivot = transform.pivot;
16295
- var px = pivot.x;
16296
- var py = pivot.y;
16297
- transform.position.set(tx + (a * px + c * py), ty + (b * px + d * py));
16298
- // Scale
16299
- if (bx != null && by != null) {
16300
- var sx = Math.sqrt(a * a + b * b);
16301
- var sy = Math.sqrt(c * c + d * d);
16302
- shape.size.set(toSizeNormalized(bx * sx), toSizeNormalized(by * sy));
16303
- }
16304
- //
16305
- shape.allowUploadedUpdate();
16306
- };
16307
- return EShapeTransforms;
16308
- }());
16309
-
16310
- /*
16311
- * Copyright (C) 2019 Toshiba Corporation
16312
- * SPDX-License-Identifier: Apache-2.0
16313
- */
16314
- var EShapeGroupSizeLayout = /** @class */ (function () {
16315
- function EShapeGroupSizeLayout(shape, bx, by) {
16316
- this.shape = shape;
16317
- // Base group size
16318
- this.base = new pixi_js.Point(bx, by);
16319
- // Base shape size
16320
- var size = shape.size;
16321
- this.shapeBase = new pixi_js.Point(size.x, size.y);
16322
- // Transform
16323
- this.transform = new pixi_js.Matrix();
16324
- shape.updateTransform();
16325
- shape.transform.localTransform.copyTo(this.transform);
16326
- this.capable =
16327
- EShapeCapabilities.contains(shape, EShapeCapability.POSITION) &&
16328
- EShapeCapabilities.contains(shape, EShapeCapability.WIDTH) &&
16329
- EShapeCapabilities.contains(shape, EShapeCapability.HEIGHT) &&
16330
- EShapeCapabilities.contains(shape, EShapeCapability.ROTATION) &&
16331
- EShapeCapabilities.contains(shape, EShapeCapability.SKEW);
16332
- }
16333
- EShapeGroupSizeLayout.prototype.isCompatible = function (shape) {
16334
- return this.shape === shape;
16335
- };
16336
- EShapeGroupSizeLayout.prototype.reset = function (shape, baseX, baseY) {
16337
- this.base.set(baseX, baseY);
16338
- // Base shape size
16339
- var size = shape.size;
16340
- this.shapeBase.copyFrom(size);
16341
- // Transform
16342
- shape.updateTransform();
16343
- shape.transform.localTransform.copyTo(this.transform);
16344
- };
16345
- EShapeGroupSizeLayout.prototype.update = function (shape, baseX, baseY, pivotX, pivotY) {
16346
- if (!this.capable) {
16347
- return;
16348
- }
16349
- var sx = baseX / this.base.x;
16350
- var sy = baseY / this.base.y;
16351
- var childBase = this.shapeBase;
16352
- var transform = EShapeGroupSizeLayout.WORK_TRANSFORM;
16353
- transform
16354
- .identity()
16355
- .append(this.transform)
16356
- .translate(-pivotX, -pivotY)
16357
- .scale(sx, sy)
16358
- .translate(+pivotX, +pivotY);
16359
- shape.disallowOnTransformChange();
16360
- EShapeTransforms.applyLocal(shape, transform, childBase.x, childBase.y);
16361
- shape.allowOnTransformChange(false);
16362
- };
16363
- EShapeGroupSizeLayout.WORK_TRANSFORM = new pixi_js.Matrix();
16364
- return EShapeGroupSizeLayout;
16365
- }());
16366
-
16367
- /*
16368
- * Copyright (C) 2019 Toshiba Corporation
16369
- * SPDX-License-Identifier: Apache-2.0
16370
- */
16371
- var EShapeGroupSizeEditor = /** @class */ (function () {
16372
- function EShapeGroupSizeEditor(parent, x, y, isFittable) {
16373
- this._workRectForCalcRect = new pixi_js.Rectangle();
16374
- this._workRectForFit = new pixi_js.Rectangle();
16375
- this._parent = parent;
16376
- this._layouts = [];
16377
- this._size = new pixi_js.Point(x, y);
16378
- this._isFittable = isFittable;
16379
- }
16380
- EShapeGroupSizeEditor.prototype.init = function () {
16381
- // DO NOTHING
16382
- };
16383
- Object.defineProperty(EShapeGroupSizeEditor.prototype, "x", {
16384
- get: function () {
16385
- return this._size.x;
16386
- },
16387
- set: function (x) {
16388
- var size = this._size;
16389
- if (size.x !== x) {
16390
- var ox = size.x;
16391
- size.x = x;
16392
- this.onChange(ox, size.y);
16393
- }
16394
- },
16395
- enumerable: false,
16396
- configurable: true
16397
- });
16398
- Object.defineProperty(EShapeGroupSizeEditor.prototype, "y", {
16399
- get: function () {
16400
- return this._size.y;
16401
- },
16402
- set: function (y) {
16403
- var size = this._size;
16404
- if (size.y !== y) {
16405
- var oy = size.y;
16406
- size.y = y;
16407
- this.onChange(size.x, oy);
16408
- }
16409
- },
16410
- enumerable: false,
16411
- configurable: true
16412
- });
16413
- EShapeGroupSizeEditor.prototype.set = function (x, y) {
16414
- var isChanged = false;
16415
- var size = this._size;
16416
- var ox = size.x;
16417
- var oy = size.y;
16418
- if (x != null && ox !== x) {
16419
- isChanged = true;
16420
- size.x = x;
16421
- }
16422
- if (y != null && oy !== y) {
16423
- isChanged = true;
16424
- size.y = y;
16425
- }
16426
- if (isChanged) {
16427
- this.onChange(ox, oy);
16428
- }
16429
- return this;
16430
- };
16431
- EShapeGroupSizeEditor.prototype.clone = function () {
16432
- var size = this._size;
16433
- return new EShapeGroupSizeEditor(this._parent, size.x, size.y, this._isFittable);
16434
- };
16435
- EShapeGroupSizeEditor.prototype.copy = function () {
16436
- // DO NOTHING
16437
- };
16438
- EShapeGroupSizeEditor.prototype.copyFrom = function (point) {
16439
- var x = point.x;
16440
- var y = point.y;
16441
- var size = this._size;
16442
- var ox = size.x;
16443
- var oy = size.y;
16444
- if (ox !== x || oy !== y) {
16445
- size.x = x;
16446
- size.y = y;
16447
- this.onChange(ox, oy);
16448
- }
16449
- return this;
16450
- };
16451
- EShapeGroupSizeEditor.prototype.copyTo = function (point) {
16452
- return this._size.copyTo(point);
16453
- };
16454
- EShapeGroupSizeEditor.prototype.equals = function (point) {
16455
- return this._size.equals(point);
16456
- };
16457
- EShapeGroupSizeEditor.prototype.fit = function () {
16458
- if (this._isFittable) {
16459
- this.doFit();
16460
- }
16461
- };
16462
- EShapeGroupSizeEditor.prototype.doFit = function () {
16463
- var parent = this._parent;
16464
- parent.disallowOnTransformChange();
16465
- // Calculate the rect
16466
- var rect = this.calcRect(this._workRectForFit);
16467
- // Set size
16468
- var size = this._size;
16469
- size.set(rect.width, rect.height);
16470
- // Position & Pivot
16471
- // rx := rect.x
16472
- // ry := rect.y
16473
- //
16474
- // | a c tx | | 1 0 +rx | | 1 0 -rx | | a c tx + (a * rx + c * ry) | | 1 0 -rx |
16475
- // | b d ty | | 0 1 +ry | | 0 1 -ry | = | b d ty + (b * rx + d * ry) | | 0 1 -ry |
16476
- // | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 |
16477
- //
16478
- // tx -> tx + (a * rx + c * ry) = poxition.x - (a * pivot.x + c * pivot.y)
16479
- // ty -> ty + (b * rx + d * ry) = poxition.y - (b * pivot.x + d * pivot.y)
16480
- // position.x -> position.x + (a * rx + c * ry) - (a * pivot.x + c * pivot.y)
16481
- // position.y -> position.y + (b * rx + d * ry) - (b * pivot.x + d * pivot.y)
16482
- // pivot.x -> 0
16483
- // pivot.y -> 0
16484
- //
16485
- // a -> a', b -> b', c -> c', tx -> tx', ty -> ty'
16486
- //
16487
- // | a' c' tx' | | 1 0 -rx | | a' c' tx' - (a' * rx + c' * ry) |
16488
- // | b' d' ty' | | 0 1 -ry | = | b' d' ty' - (b' * rx + d' * ry) |
16489
- // | 0 0 1 | | 0 0 1 | | 0 0 1 |
16490
- //
16491
- // tx' -> tx' - (a' * rx + c' * ry) = poxition.x - (a' * pivot.x + c' * pivot.y)
16492
- // ty' -> ty' - (b' * rx + d' * ry) = poxition.y - (b' * pivot.x + d' * pivot.y)
16493
- // pivot.x -> pivot.x + rx
16494
- // pivot.y -> pivot.y + ry
16495
- parent.updateTransform();
16496
- var transform = parent.transform;
16497
- var x = rect.x + rect.width * 0.5;
16498
- var y = rect.y + rect.height * 0.5;
16499
- var position = transform.position;
16500
- var localTransform = transform.localTransform;
16501
- var a = localTransform.a;
16502
- var b = localTransform.b;
16503
- var c = localTransform.c;
16504
- var d = localTransform.d;
16505
- var pivot = transform.pivot;
16506
- 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));
16507
- pivot.set(x, y);
16508
- // Reset the data
16509
- this.reset(parent.children, this._layouts, size);
16510
- //
16511
- parent.allowOnTransformChange(true);
16512
- };
16513
- EShapeGroupSizeEditor.prototype.reset = function (children, layouts, size) {
16514
- for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
16515
- var child = children[i];
16516
- var layout = layouts[i];
16517
- if (layout.isCompatible(child)) {
16518
- layout.reset(child, size.x, size.y);
16519
- }
16520
- else {
16521
- layouts.length = i;
16522
- break;
16523
- }
16524
- }
16525
- if (children.length < layouts.length) {
16526
- layouts.length = children.length;
16527
- }
16528
- };
16529
- EShapeGroupSizeEditor.prototype.calcRect = function (result) {
16530
- var parent = this._parent;
16531
- var children = parent.children;
16532
- if (children.length <= 0) {
16533
- result.x = 0;
16534
- result.y = 0;
16535
- result.width = 0;
16536
- result.height = 0;
16537
- }
16538
- else {
16539
- var workRect = this._workRectForCalcRect;
16540
- children[0].getBoundsLocal(false, result);
16541
- for (var i = 1, imax = children.length; i < imax; ++i) {
16542
- var child = children[i];
16543
- child.getBoundsLocal(false, workRect);
16544
- result.enlarge(workRect);
16545
- }
16546
- }
16547
- return result;
16548
- };
16549
- EShapeGroupSizeEditor.prototype.onChange = function (ox, oy) {
16550
- var parent = this._parent;
16551
- var size = this._size;
16552
- var pivot = parent.transform.pivot;
16553
- this.onChange_(parent.children, this._layouts, size.x, size.y, pivot.x, pivot.y, ox, oy);
16554
- parent.onSizeChange();
16555
- };
16556
- EShapeGroupSizeEditor.prototype.onChange_ = function (children, layouts, sx, sy, px, py, ox, oy) {
16557
- for (var i = 0, imax = Math.min(layouts.length, children.length); i < imax; ++i) {
16558
- var child = children[i];
16559
- var layout = layouts[i];
16560
- if (layout.isCompatible(child)) {
16561
- layout.update(child, sx, sy, px, py);
16562
- }
16563
- else {
16564
- layouts.length = i;
16565
- break;
16566
- }
16567
- }
16568
- for (var i = layouts.length, imax = children.length; i < imax; ++i) {
16569
- var child = children[i];
16570
- var layout = this.newLayout(child, ox, oy);
16571
- layout.update(child, sx, sy, px, py);
16572
- layouts.push(layout);
16573
- }
16574
- if (layouts.length !== children.length) {
16575
- layouts.length = children.length;
16576
- }
16577
- };
16578
- EShapeGroupSizeEditor.prototype.newLayout = function (shape, ox, oy) {
16579
- return shape.layout || new EShapeGroupSizeLayout(shape, ox, oy);
16580
- };
16581
- return EShapeGroupSizeEditor;
16582
- }());
16583
-
16584
16313
  /*
16585
16314
  * Copyright (C) 2019 Toshiba Corporation
16586
16315
  * SPDX-License-Identifier: Apache-2.0
@@ -17207,34 +16936,21 @@
17207
16936
  */
17208
16937
  var EShapeGroupViewer = /** @class */ (function (_super) {
17209
16938
  __extends(EShapeGroupViewer, _super);
17210
- function EShapeGroupViewer(isEditMode, type) {
16939
+ function EShapeGroupViewer(type) {
17211
16940
  var _this = _super.call(this, type) || this;
17212
- _this._isEditMode = isEditMode;
17213
16941
  var data = _this.newData();
17214
16942
  _this.data = data;
17215
16943
  _this.tag = data;
17216
- _this.size = _this.newGroupSize(isEditMode);
16944
+ _this.size = _this.newGroupSize();
17217
16945
  _this.fill = _this.newGroupFill();
17218
16946
  _this.stroke = _this.newGroupStroke();
17219
16947
  _this.text = _this.newGroupText();
17220
16948
  return _this;
17221
16949
  }
17222
- Object.defineProperty(EShapeGroupViewer.prototype, "isEditMode", {
17223
- get: function () {
17224
- return this._isEditMode;
17225
- },
17226
- enumerable: false,
17227
- configurable: true
17228
- });
17229
- EShapeGroupViewer.prototype.newGroupSize = function (isEditMode) {
16950
+ EShapeGroupViewer.prototype.newGroupSize = function () {
17230
16951
  var sizeX = EShapeDefaults.SIZE_X;
17231
16952
  var sizeY = EShapeDefaults.SIZE_Y;
17232
- if (isEditMode) {
17233
- return new EShapeGroupSizeEditor(this, sizeX, sizeY, this.isGroupSizeFittable());
17234
- }
17235
- else {
17236
- return new EShapeGroupSizeViewer(this, sizeX, sizeY, sizeX, sizeY);
17237
- }
16953
+ return new EShapeGroupSizeViewer(this, sizeX, sizeY, sizeX, sizeY);
17238
16954
  };
17239
16955
  EShapeGroupViewer.prototype.isGroupSizeFittable = function () {
17240
16956
  return true;
@@ -17332,9 +17048,9 @@
17332
17048
 
17333
17049
  var EShapeEmbedded = /** @class */ (function (_super) {
17334
17050
  __extends(EShapeEmbedded, _super);
17335
- function EShapeEmbedded(name, isEditMode, type) {
17051
+ function EShapeEmbedded(name, type) {
17336
17052
  if (type === void 0) { type = EShapeType.EMBEDDED; }
17337
- var _this = _super.call(this, isEditMode, type) || this;
17053
+ var _this = _super.call(this, type) || this;
17338
17054
  _this._name = name;
17339
17055
  return _this;
17340
17056
  }
@@ -17365,7 +17081,7 @@
17365
17081
  };
17366
17082
  EShapeEmbedded.prototype.newClone = function () {
17367
17083
  var constructor = this.constructor;
17368
- return new constructor(this._name, this._isEditMode, this.type);
17084
+ return new constructor(this._name, this.type);
17369
17085
  };
17370
17086
  EShapeEmbedded.prototype.serializeChildren = function (manager) {
17371
17087
  return [];
@@ -19958,7 +19674,7 @@
19958
19674
  * SPDX-License-Identifier: Apache-2.0
19959
19675
  */
19960
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";
19961
- 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";
19962
19678
  var DynamicSDFFontGenerator = /** @class */ (function () {
19963
19679
  function DynamicSDFFontGenerator() {
19964
19680
  var _this = this;
@@ -21323,9 +21039,9 @@
21323
21039
  */
21324
21040
  var EShapeEmbeddedLayer = /** @class */ (function (_super) {
21325
21041
  __extends(EShapeEmbeddedLayer, _super);
21326
- function EShapeEmbeddedLayer(name, isEditMode, type) {
21042
+ function EShapeEmbeddedLayer(name, type) {
21327
21043
  if (type === void 0) { type = EShapeType.EMBEDDED_LAYER; }
21328
- var _this = _super.call(this, isEditMode, type) || this;
21044
+ var _this = _super.call(this, type) || this;
21329
21045
  _this._name = name;
21330
21046
  return _this;
21331
21047
  }
@@ -21357,7 +21073,7 @@
21357
21073
  };
21358
21074
  EShapeEmbeddedLayer.prototype.newClone = function () {
21359
21075
  var constructor = this.constructor;
21360
- return new constructor(this._name, this._isEditMode, this.type);
21076
+ return new constructor(this._name, this.type);
21361
21077
  };
21362
21078
  EShapeEmbeddedLayer.prototype.serializeChildren = function (manager) {
21363
21079
  return [];
@@ -21797,9 +21513,7 @@
21797
21513
  var deserializeEmbeddedLayer = function (serialized, manager, width, height, creator) {
21798
21514
  var _a, _b, _c;
21799
21515
  var name = deserializeEmbeddedLayerName(serialized[0], manager);
21800
- var result = creator
21801
- ? creator(name, manager)
21802
- : new EShapeEmbeddedLayer(name, manager.isEditMode);
21516
+ var result = creator ? creator(name, manager) : new EShapeEmbeddedLayer(name);
21803
21517
  var visibility = serialized[1];
21804
21518
  var visible = visibility == null || !!(visibility & 0x2);
21805
21519
  if (!visible) {
@@ -21812,6 +21526,7 @@
21812
21526
  var sizeX = (_a = serialized[4]) !== null && _a !== void 0 ? _a : width;
21813
21527
  var sizeY = (_b = serialized[5]) !== null && _b !== void 0 ? _b : height;
21814
21528
  result.size.set(sizeX, sizeY);
21529
+ result.size.init();
21815
21530
  var fillId = serialized[6];
21816
21531
  if (fillId != null) {
21817
21532
  result.fill.deserialize(fillId, manager);
@@ -22107,42 +21822,42 @@
22107
21822
  }
22108
21823
  }
22109
21824
  };
22110
- EShapeActionRuntimes.write = function (shape, id, value, time, remote) {
21825
+ EShapeActionRuntimes.writeLocal = function (shape, id, value, time, state) {
22111
21826
  var _a;
22112
- if (remote) {
22113
- var container = this.toContainer(shape);
22114
- if (container) {
22115
- return container.data.remote.set(id, value, time);
22116
- }
22117
- }
22118
- else {
22119
- var current = shape;
22120
- while (current != null) {
22121
- if (this.isContainer(current)) {
22122
- if (current.data.private.set(id, value, time)) {
22123
- DApplications.update(current);
22124
- return true;
22125
- }
22126
- else if (current.data.protected.set(id, value, time)) {
22127
- DApplications.update(current);
22128
- return true;
22129
- }
22130
- else {
22131
- if (current.data.set(id, value, time)) {
22132
- DApplications.update(current);
22133
- return true;
22134
- }
22135
- }
22136
- 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;
22137
21838
  }
22138
- else if (this.isEmbedded(current)) {
22139
- 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)) {
22140
21841
  DApplications.update(current);
22141
21842
  return true;
22142
21843
  }
22143
21844
  }
22144
- current = current.parent;
21845
+ return false;
22145
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
+ }
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);
22146
21861
  }
22147
21862
  return false;
22148
21863
  };
@@ -24189,14 +23904,14 @@
24189
23904
  EShapeActionRuntimes.emit(shape, target, value, time);
24190
23905
  break;
24191
23906
  case EShapeActionValueOnInputAction.WRITE_LOCAL:
24192
- EShapeActionRuntimes.write(shape, target, value, time, false);
23907
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24193
23908
  break;
24194
23909
  case EShapeActionValueOnInputAction.WRITE_REMOTE:
24195
- EShapeActionRuntimes.write(shape, target, value, time, true);
23910
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24196
23911
  break;
24197
23912
  case EShapeActionValueOnInputAction.WRITE_BOTH:
24198
- EShapeActionRuntimes.write(shape, target, value, time, false);
24199
- EShapeActionRuntimes.write(shape, target, value, time, true);
23913
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
23914
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24200
23915
  break;
24201
23916
  }
24202
23917
  };
@@ -24397,8 +24112,8 @@
24397
24112
  return _super !== null && _super.apply(this, arguments) || this;
24398
24113
  }
24399
24114
  EShapeActionRuntimeMiscWriteBoth.prototype.write = function (shape, target, value, time) {
24400
- EShapeActionRuntimes.write(shape, target, value, time, false);
24401
- EShapeActionRuntimes.write(shape, target, value, time, true);
24115
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24116
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24402
24117
  };
24403
24118
  return EShapeActionRuntimeMiscWriteBoth;
24404
24119
  }(EShapeActionRuntimeMiscWrite));
@@ -24413,7 +24128,7 @@
24413
24128
  return _super !== null && _super.apply(this, arguments) || this;
24414
24129
  }
24415
24130
  EShapeActionRuntimeMiscWriteLocal.prototype.write = function (shape, target, value, time) {
24416
- EShapeActionRuntimes.write(shape, target, value, time, false);
24131
+ EShapeActionRuntimes.writeLocal(shape, target, value, time);
24417
24132
  };
24418
24133
  return EShapeActionRuntimeMiscWriteLocal;
24419
24134
  }(EShapeActionRuntimeMiscWrite));
@@ -24428,7 +24143,7 @@
24428
24143
  return _super !== null && _super.apply(this, arguments) || this;
24429
24144
  }
24430
24145
  EShapeActionRuntimeMiscWriteRemote.prototype.write = function (shape, target, value, time) {
24431
- EShapeActionRuntimes.write(shape, target, value, time, true);
24146
+ EShapeActionRuntimes.writeRemote(shape, target, value);
24432
24147
  };
24433
24148
  return EShapeActionRuntimeMiscWriteRemote;
24434
24149
  }(EShapeActionRuntimeMiscWrite));
@@ -32251,6 +31966,18 @@
32251
31966
  return EShapeActionValueTransformMove;
32252
31967
  }(EShapeActionValueOpetyped));
32253
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
+
32254
31981
  /*
32255
31982
  * Copyright (C) 2019 Toshiba Corporation
32256
31983
  * SPDX-License-Identifier: Apache-2.0
@@ -32992,6 +32719,179 @@
32992
32719
  EShapeDeserializers[EShapeType.BAR] = deserializeBar;
32993
32720
  };
32994
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
+
32995
32895
  /*
32996
32896
  * Copyright (C) 2019 Toshiba Corporation
32997
32897
  * SPDX-License-Identifier: Apache-2.0
@@ -36784,7 +36684,7 @@
36784
36684
  * SPDX-License-Identifier: Apache-2.0
36785
36685
  */
36786
36686
  var create = function (name, width, height, container, manager, item, shape) {
36787
- shape = shape || new EShapeEmbedded(name, manager.isEditMode);
36687
+ shape = shape || new EShapeEmbedded(name);
36788
36688
  var result = deserializeBase(item, manager, shape);
36789
36689
  var shapeSize = shape.size;
36790
36690
  var sizeX = shapeSize.x;
@@ -36797,17 +36697,18 @@
36797
36697
  return result;
36798
36698
  };
36799
36699
  var createMissing = function (name, manager, item, shape) {
36800
- shape = shape || new EShapeEmbedded(name, manager.isEditMode);
36700
+ shape = shape || new EShapeEmbedded(name);
36801
36701
  var result = deserializeBase(item, manager, shape);
36802
36702
  var size = shape.size;
36803
36703
  var sizeX = size.x;
36804
36704
  var sizeY = size.y;
36805
36705
  var children = shape.children;
36806
- var layer = new EShapeEmbeddedLayer("missing", manager.isEditMode);
36706
+ var layer = new EShapeEmbeddedLayer("missing");
36807
36707
  var px = 0.5 * sizeX;
36808
36708
  var py = 0.5 * sizeX;
36809
36709
  layer.transform.position.set(-px, -py);
36810
36710
  layer.size.set(sizeX, sizeY);
36711
+ layer.size.init();
36811
36712
  layer.parent = shape;
36812
36713
  var rectangle = new EShapeRectangle();
36813
36714
  rectangle.stroke.color = 0xff0000;
@@ -37108,89 +37009,467 @@
37108
37009
  return points.getMarker();
37109
37010
  }
37110
37011
  }
37111
- return undefined;
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
+ }
37112
37160
  };
37113
- Object.defineProperty(EShapeGroupPoints.prototype, "formatter", {
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", {
37114
37275
  get: function () {
37115
- var children = this._parent.children;
37116
- if (0 < children.length) {
37117
- var points = children[children.length - 1].points;
37118
- if (points != null) {
37119
- return points.formatter;
37120
- }
37121
- }
37122
- return null;
37276
+ return this._size.x;
37123
37277
  },
37124
- set: function (formatter) {
37125
- var children = this._parent.children;
37126
- for (var i = 0, imax = children.length; i < imax; ++i) {
37127
- var points = children[i].points;
37128
- if (points != null) {
37129
- points.formatter = formatter;
37130
- }
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);
37131
37284
  }
37132
37285
  },
37133
37286
  enumerable: false,
37134
37287
  configurable: true
37135
37288
  });
37136
- Object.defineProperty(EShapeGroupPoints.prototype, "formatted", {
37289
+ Object.defineProperty(EShapeGroupSizeEditor.prototype, "y", {
37137
37290
  get: function () {
37138
- var children = this._parent.children;
37139
- if (0 < children.length) {
37140
- var points = children[children.length - 1].points;
37141
- if (points != null) {
37142
- return points.formatted;
37143
- }
37291
+ return this._size.y;
37292
+ },
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);
37144
37299
  }
37145
- return this;
37146
37300
  },
37147
37301
  enumerable: false,
37148
37302
  configurable: true
37149
37303
  });
37150
- EShapeGroupPoints.prototype.copy = function (source) {
37151
- var children = this._parent.children;
37152
- for (var i = 0, imax = children.length; i < imax; ++i) {
37153
- var points = children[i].points;
37154
- if (points != null) {
37155
- points.copy(source);
37156
- }
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;
37312
+ }
37313
+ if (y != null && oy !== y) {
37314
+ isChanged = true;
37315
+ size.y = y;
37316
+ }
37317
+ if (isChanged) {
37318
+ this.onChange(ox, oy);
37157
37319
  }
37158
37320
  return this;
37159
37321
  };
37160
- EShapeGroupPoints.prototype.set = function (values, segments, style) {
37161
- var children = this._parent.children;
37162
- for (var i = 0, imax = children.length; i < imax; ++i) {
37163
- var points = children[i].points;
37164
- if (points != null) {
37165
- points.set(values, segments, style);
37166
- }
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);
37167
37339
  }
37168
37340
  return this;
37169
37341
  };
37170
- EShapeGroupPoints.prototype.clone = function (parent) {
37171
- return new EShapeGroupPoints(parent);
37342
+ EShapeGroupSizeEditor.prototype.copyTo = function (point) {
37343
+ return this._size.copyTo(point);
37172
37344
  };
37173
- EShapeGroupPoints.prototype.toPoints = function (transform) {
37174
- var children = this._parent.children;
37175
- for (var i = 0, imax = children.length; i < imax; ++i) {
37176
- var points = children[i].points;
37177
- if (points != null) {
37178
- 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;
37179
37414
  }
37180
37415
  }
37181
- return [];
37416
+ if (children.length < layouts.length) {
37417
+ layouts.length = children.length;
37418
+ }
37182
37419
  };
37183
- EShapeGroupPoints.prototype.serialize = function (manager) {
37184
- var children = this._parent.children;
37185
- for (var i = 0, imax = children.length; i < imax; ++i) {
37186
- var points = children[i].points;
37187
- if (points != null) {
37188
- 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);
37189
37436
  }
37190
37437
  }
37191
- return -1;
37438
+ return result;
37192
37439
  };
37193
- 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;
37194
37473
  }());
37195
37474
 
37196
37475
  /*
@@ -43043,7 +43322,7 @@
43043
43322
  });
43044
43323
  };
43045
43324
  EShapeEmbeddeds.create = function (name, width, height, container, manager) {
43046
- var shape = new EShapeEmbedded(name, manager.isEditMode);
43325
+ var shape = new EShapeEmbedded(name);
43047
43326
  shape.size.set(width, height);
43048
43327
  container.copyTo(shape);
43049
43328
  shape.size.init();
@@ -44743,6 +45022,19 @@
44743
45022
  return DynamicFontAtlases;
44744
45023
  }());
44745
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
+
44746
45038
  /*
44747
45039
  * Copyright (C) 2019 Toshiba Corporation
44748
45040
  * SPDX-License-Identifier: Apache-2.0
@@ -44806,6 +45098,36 @@
44806
45098
  return Math.max(i0, i1);
44807
45099
  };
44808
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
+
44809
45131
  /*
44810
45132
  * Copyright (C) 2019 Toshiba Corporation
44811
45133
  * SPDX-License-Identifier: Apache-2.0
@@ -44831,6 +45153,46 @@
44831
45153
  return "";
44832
45154
  };
44833
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
+
44834
45196
  /*
44835
45197
  * Copyright (C) 2019 Toshiba Corporation
44836
45198
  * SPDX-License-Identifier: Apache-2.0
@@ -46295,9 +46657,9 @@
46295
46657
  var isCommandClean = function (command) {
46296
46658
  return !!(command.getFlag() & DCommandFlag.CLEAN);
46297
46659
  };
46298
- var DControllerDefaultCommand = /** @class */ (function (_super) {
46299
- __extends(DControllerDefaultCommand, _super);
46300
- function DControllerDefaultCommand() {
46660
+ var DControllerCommandImpl = /** @class */ (function (_super) {
46661
+ __extends(DControllerCommandImpl, _super);
46662
+ function DControllerCommandImpl() {
46301
46663
  var _this = _super.call(this) || this;
46302
46664
  _this._position = 0;
46303
46665
  _this._done = [];
@@ -46305,7 +46667,7 @@
46305
46667
  _this._executing = null;
46306
46668
  return _this;
46307
46669
  }
46308
- DControllerDefaultCommand.prototype.last = function () {
46670
+ DControllerCommandImpl.prototype.last = function () {
46309
46671
  var done = this._done;
46310
46672
  var waiting = this._waiting;
46311
46673
  if (waiting.length <= 0) {
@@ -46320,11 +46682,11 @@
46320
46682
  return waiting[waiting.length - 1];
46321
46683
  }
46322
46684
  };
46323
- DControllerDefaultCommand.prototype.push = function (command) {
46685
+ DControllerCommandImpl.prototype.push = function (command) {
46324
46686
  this._waiting.push(command);
46325
46687
  this.next();
46326
46688
  };
46327
- DControllerDefaultCommand.prototype.next = function () {
46689
+ DControllerCommandImpl.prototype.next = function () {
46328
46690
  if (this._executing != null) {
46329
46691
  // Still executing a command.
46330
46692
  // So do nothing.
@@ -46352,7 +46714,7 @@
46352
46714
  this.execute(command);
46353
46715
  }
46354
46716
  };
46355
- DControllerDefaultCommand.prototype.executeUndo = function (command) {
46717
+ DControllerCommandImpl.prototype.executeUndo = function (command) {
46356
46718
  var _this = this;
46357
46719
  var done = this._done;
46358
46720
  if (this._position < done.length) {
@@ -46375,7 +46737,7 @@
46375
46737
  }
46376
46738
  }
46377
46739
  };
46378
- DControllerDefaultCommand.prototype.executeRedo = function (command) {
46740
+ DControllerCommandImpl.prototype.executeRedo = function (command) {
46379
46741
  var _this = this;
46380
46742
  var done = this._done;
46381
46743
  if (0 < this._position) {
@@ -46398,7 +46760,7 @@
46398
46760
  }
46399
46761
  }
46400
46762
  };
46401
- DControllerDefaultCommand.prototype.execute = function (command) {
46763
+ DControllerCommandImpl.prototype.execute = function (command) {
46402
46764
  var _this = this;
46403
46765
  var isClear = isCommandClear(command);
46404
46766
  var isStorable = isCommandStorable(command);
@@ -46426,7 +46788,7 @@
46426
46788
  });
46427
46789
  }
46428
46790
  };
46429
- DControllerDefaultCommand.prototype.cleanup = function () {
46791
+ DControllerCommandImpl.prototype.cleanup = function () {
46430
46792
  var done = this._done;
46431
46793
  var size = done.length - 100;
46432
46794
  if (0 < size) {
@@ -46436,7 +46798,7 @@
46436
46798
  }
46437
46799
  }
46438
46800
  };
46439
- DControllerDefaultCommand.prototype.remove = function (size) {
46801
+ DControllerCommandImpl.prototype.remove = function (size) {
46440
46802
  var done = this._done;
46441
46803
  if (0 < size) {
46442
46804
  var ifrom = Math.max(0, done.length - size);
@@ -46451,7 +46813,7 @@
46451
46813
  }
46452
46814
  return false;
46453
46815
  };
46454
- DControllerDefaultCommand.prototype.onSuccess = function (command) {
46816
+ DControllerCommandImpl.prototype.onSuccess = function (command) {
46455
46817
  this._executing = null;
46456
46818
  if (isCommandStorable(command)) {
46457
46819
  this._done.push(command);
@@ -46462,7 +46824,7 @@
46462
46824
  this.emit("change", this);
46463
46825
  this.next();
46464
46826
  };
46465
- DControllerDefaultCommand.prototype.onSuccessUndo = function (undoed) {
46827
+ DControllerCommandImpl.prototype.onSuccessUndo = function (undoed) {
46466
46828
  this._executing = null;
46467
46829
  if (!isCommandClean(undoed)) {
46468
46830
  this.emit("dirty", this);
@@ -46470,7 +46832,7 @@
46470
46832
  this.emit("change", this);
46471
46833
  this.next();
46472
46834
  };
46473
- DControllerDefaultCommand.prototype.onSuccessRedo = function (redoed) {
46835
+ DControllerCommandImpl.prototype.onSuccessRedo = function (redoed) {
46474
46836
  this._executing = null;
46475
46837
  if (!isCommandClean(redoed)) {
46476
46838
  this.emit("dirty", this);
@@ -46478,7 +46840,7 @@
46478
46840
  this.emit("change", this);
46479
46841
  this.next();
46480
46842
  };
46481
- DControllerDefaultCommand.prototype.onFail = function (command) {
46843
+ DControllerCommandImpl.prototype.onFail = function (command) {
46482
46844
  this._executing = null;
46483
46845
  var waiting = this._waiting;
46484
46846
  command.destroy();
@@ -46488,31 +46850,31 @@
46488
46850
  waiting.length = 0;
46489
46851
  this.emit("change", this);
46490
46852
  };
46491
- DControllerDefaultCommand.prototype.size = function () {
46853
+ DControllerCommandImpl.prototype.size = function () {
46492
46854
  return this._done.length;
46493
46855
  };
46494
- DControllerDefaultCommand.prototype.clear = function () {
46856
+ DControllerCommandImpl.prototype.clear = function () {
46495
46857
  this.push(new DCommandClear());
46496
46858
  };
46497
- DControllerDefaultCommand.prototype.redo = function () {
46859
+ DControllerCommandImpl.prototype.redo = function () {
46498
46860
  if (this.isRedoable()) {
46499
46861
  this._waiting.push(new DCommandRedo());
46500
46862
  this.next();
46501
46863
  }
46502
46864
  };
46503
- DControllerDefaultCommand.prototype.undo = function () {
46865
+ DControllerCommandImpl.prototype.undo = function () {
46504
46866
  if (this.isUndoable()) {
46505
46867
  this._waiting.push(new DCommandUndo());
46506
46868
  this.next();
46507
46869
  }
46508
46870
  };
46509
- DControllerDefaultCommand.prototype.isRedoable = function () {
46871
+ DControllerCommandImpl.prototype.isRedoable = function () {
46510
46872
  return 0 < this._position && this._executing == null;
46511
46873
  };
46512
- DControllerDefaultCommand.prototype.isUndoable = function () {
46874
+ DControllerCommandImpl.prototype.isUndoable = function () {
46513
46875
  return this._position < this._done.length && this._executing == null;
46514
46876
  };
46515
- return DControllerDefaultCommand;
46877
+ return DControllerCommandImpl;
46516
46878
  }(pixi_js.utils.EventEmitter));
46517
46879
 
46518
46880
  /*
@@ -46599,7 +46961,7 @@
46599
46961
  // Command
46600
46962
  DControllers.getCommandController = function () {
46601
46963
  if (this.COMMAND == null) {
46602
- this.COMMAND = new DControllerDefaultCommand();
46964
+ this.COMMAND = new DControllerCommandImpl();
46603
46965
  }
46604
46966
  return this.COMMAND;
46605
46967
  };
@@ -46913,11 +47275,11 @@
46913
47275
  * Copyright (C) 2019 Toshiba Corporation
46914
47276
  * SPDX-License-Identifier: Apache-2.0
46915
47277
  */
46916
- var DControllerDefaultFocus = /** @class */ (function () {
46917
- function DControllerDefaultFocus() {
47278
+ var DControllerFocusImpl = /** @class */ (function () {
47279
+ function DControllerFocusImpl() {
46918
47280
  this._focused = null;
46919
47281
  }
46920
- DControllerDefaultFocus.prototype.focus = function (focusable) {
47282
+ DControllerFocusImpl.prototype.focus = function (focusable) {
46921
47283
  var previous = this._focused;
46922
47284
  if (previous !== focusable) {
46923
47285
  if (previous != null) {
@@ -46931,7 +47293,7 @@
46931
47293
  }
46932
47294
  return null;
46933
47295
  };
46934
- DControllerDefaultFocus.prototype.blur = function (focusable) {
47296
+ DControllerFocusImpl.prototype.blur = function (focusable) {
46935
47297
  if (focusable != null && this._focused === focusable) {
46936
47298
  this._focused = null;
46937
47299
  focusable.state.isFocused = false;
@@ -46939,10 +47301,10 @@
46939
47301
  }
46940
47302
  return null;
46941
47303
  };
46942
- DControllerDefaultFocus.prototype.clear = function () {
47304
+ DControllerFocusImpl.prototype.clear = function () {
46943
47305
  return this.focus(null);
46944
47306
  };
46945
- DControllerDefaultFocus.prototype.set = function (focusable, isFocused) {
47307
+ DControllerFocusImpl.prototype.set = function (focusable, isFocused) {
46946
47308
  if (isFocused) {
46947
47309
  return this.focus(focusable);
46948
47310
  }
@@ -46950,10 +47312,10 @@
46950
47312
  return this.blur(focusable);
46951
47313
  }
46952
47314
  };
46953
- DControllerDefaultFocus.prototype.get = function () {
47315
+ DControllerFocusImpl.prototype.get = function () {
46954
47316
  return this._focused;
46955
47317
  };
46956
- DControllerDefaultFocus.prototype.findParent = function (mightBeFocusable) {
47318
+ DControllerFocusImpl.prototype.findParent = function (mightBeFocusable) {
46957
47319
  var current = mightBeFocusable;
46958
47320
  while (current != null) {
46959
47321
  if (this.isFocusable(current)) {
@@ -46965,7 +47327,7 @@
46965
47327
  }
46966
47328
  return null;
46967
47329
  };
46968
- DControllerDefaultFocus.prototype.find = function (target, includesTarget, includesTargetChildren, direction, root) {
47330
+ DControllerFocusImpl.prototype.find = function (target, includesTarget, includesTargetChildren, direction, root) {
46969
47331
  if (direction) {
46970
47332
  var result = this.findNext(target, includesTarget, includesTargetChildren);
46971
47333
  if (result != null) {
@@ -47079,7 +47441,7 @@
47079
47441
  }
47080
47442
  return null;
47081
47443
  };
47082
- DControllerDefaultFocus.prototype.findNext = function (target, includesTarget, includesTargetChildren) {
47444
+ DControllerFocusImpl.prototype.findNext = function (target, includesTarget, includesTargetChildren) {
47083
47445
  // Target itself
47084
47446
  if (includesTarget) {
47085
47447
  if (this.isFocusable(target)) {
@@ -47110,7 +47472,7 @@
47110
47472
  // Found nothing
47111
47473
  return null;
47112
47474
  };
47113
- DControllerDefaultFocus.prototype.findPrevious = function (target, includesTarget, includesTargetChildren) {
47475
+ DControllerFocusImpl.prototype.findPrevious = function (target, includesTarget, includesTargetChildren) {
47114
47476
  // Target children
47115
47477
  if (includesTargetChildren && this.isFocusableContainer(target) && target.visible) {
47116
47478
  var children = target.children;
@@ -47141,26 +47503,26 @@
47141
47503
  // Found nothing
47142
47504
  return null;
47143
47505
  };
47144
- DControllerDefaultFocus.prototype.isFocusable = function (target) {
47506
+ DControllerFocusImpl.prototype.isFocusable = function (target) {
47145
47507
  return (target != null &&
47146
47508
  "state" in target &&
47147
47509
  target.state.inEnabled &&
47148
47510
  target.state.isFocusable &&
47149
47511
  target.visible);
47150
47512
  };
47151
- DControllerDefaultFocus.prototype.isFocusableContainer = function (target) {
47513
+ DControllerFocusImpl.prototype.isFocusableContainer = function (target) {
47152
47514
  return target != null && "children" in target;
47153
47515
  };
47154
- DControllerDefaultFocus.prototype.isFocusRoot = function (target, root) {
47516
+ DControllerFocusImpl.prototype.isFocusRoot = function (target, root) {
47155
47517
  if (target === root) {
47156
47518
  return true;
47157
47519
  }
47158
47520
  return target != null && "state" in target && target.state.isFocusRoot && target.visible;
47159
47521
  };
47160
- DControllerDefaultFocus.prototype.isFocusReverse = function (target) {
47522
+ DControllerFocusImpl.prototype.isFocusReverse = function (target) {
47161
47523
  return target != null && "state" in target && target.state.isFocusReverse;
47162
47524
  };
47163
- return DControllerDefaultFocus;
47525
+ return DControllerFocusImpl;
47164
47526
  }());
47165
47527
 
47166
47528
  /*
@@ -47242,7 +47604,7 @@
47242
47604
  };
47243
47605
  DApplication.prototype.getFocusController = function () {
47244
47606
  if (this._focus == null) {
47245
- this._focus = new DControllerDefaultFocus();
47607
+ this._focus = new DControllerFocusImpl();
47246
47608
  }
47247
47609
  return this._focus;
47248
47610
  };
@@ -58546,7 +58908,7 @@
58546
58908
  list.push(value);
58547
58909
  }
58548
58910
  };
58549
- DDiagramCanvasDataImpl.prototype.set = function (id, value, time, from, to) {
58911
+ DDiagramCanvasDataImpl.prototype.set = function (id, value, time, state, from, to) {
58550
58912
  var data = this._data;
58551
58913
  if (data == null) {
58552
58914
  return false;
@@ -58568,6 +58930,10 @@
58568
58930
  if (time !== undefined) {
58569
58931
  datumValue.time = time;
58570
58932
  }
58933
+ // State
58934
+ if (state !== undefined) {
58935
+ datumValue.state = state;
58936
+ }
58571
58937
  // Value
58572
58938
  datumValue.value = value;
58573
58939
  }
@@ -58609,7 +58975,7 @@
58609
58975
  }
58610
58976
  return true;
58611
58977
  };
58612
- DDiagramCanvasDataImpl.prototype.setAll = function (id, values, times, from, to) {
58978
+ DDiagramCanvasDataImpl.prototype.setAll = function (id, values, times, states, from, to) {
58613
58979
  var data = this._data;
58614
58980
  if (data == null) {
58615
58981
  return false;
@@ -58631,12 +58997,16 @@
58631
58997
  if (times !== undefined) {
58632
58998
  datumValue.times = times;
58633
58999
  }
59000
+ // State
59001
+ if (states !== undefined) {
59002
+ datumValue.states = states;
59003
+ }
58634
59004
  // Value
58635
59005
  datumValue.values = values;
58636
59006
  }
58637
59007
  return true;
58638
59008
  };
58639
- DDiagramCanvasDataImpl.prototype.setValue = function (id, value, time) {
59009
+ DDiagramCanvasDataImpl.prototype.setValue = function (id, value) {
58640
59010
  var data = this._data;
58641
59011
  if (data == null) {
58642
59012
  return false;
@@ -58650,15 +59020,11 @@
58650
59020
  return false;
58651
59021
  }
58652
59022
  for (var i = 0; i < size; ++i) {
58653
- var datumValue = datum[i];
58654
- if (time !== undefined) {
58655
- datumValue.time = time;
58656
- }
58657
- datumValue.value = value;
59023
+ datum[i].value = value;
58658
59024
  }
58659
59025
  return true;
58660
59026
  };
58661
- DDiagramCanvasDataImpl.prototype.setValues = function (id, values, times) {
59027
+ DDiagramCanvasDataImpl.prototype.setValues = function (id, values) {
58662
59028
  var data = this._data;
58663
59029
  if (data == null) {
58664
59030
  return false;
@@ -58672,11 +59038,7 @@
58672
59038
  return false;
58673
59039
  }
58674
59040
  for (var i = 0; i < size; ++i) {
58675
- var datumValue = datum[i];
58676
- if (times !== undefined) {
58677
- datumValue.times = times;
58678
- }
58679
- datumValue.values = values;
59041
+ datum[i].values = values;
58680
59042
  }
58681
59043
  return true;
58682
59044
  };
@@ -58716,6 +59078,42 @@
58716
59078
  }
58717
59079
  return true;
58718
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
+ };
58719
59117
  DDiagramCanvasDataImpl.prototype.setRange = function (id, from, to) {
58720
59118
  var data = this._data;
58721
59119
  if (data == null) {
@@ -59139,7 +59537,7 @@
59139
59537
  DDiagramCanvas.prototype.initialize = function (shapes, mapper) {
59140
59538
  var time = Date.now();
59141
59539
  var actionables = this._actionables;
59142
- this.initialize_(shapes, null, mapper, new Map(), new Map(), new Map(), this._ticker, this._shape, this._data, actionables);
59540
+ this.initialize_(shapes, null, null, mapper, new Map(), new Map(), new Map(), this._ticker, this._shape, this._data, actionables);
59143
59541
  var layers = this._layer.children;
59144
59542
  for (var i = 0, imax = layers.length; i < imax; ++i) {
59145
59543
  layers[i].initialize(actionables);
@@ -59154,7 +59552,7 @@
59154
59552
  EShapeActionEnvironment.isInitializing = false;
59155
59553
  this._ticker.start();
59156
59554
  };
59157
- DDiagramCanvas.prototype.initialize_ = function (shapes, dataShape, mapper, formatToFormatter, initialToInitialValue, actionValueToRuntime, canvasTicker, canvasShape, canvasData, actionables) {
59555
+ DDiagramCanvas.prototype.initialize_ = function (shapes, dataShape, containerShape, mapper, formatToFormatter, initialToInitialValue, actionValueToRuntime, canvasTicker, canvasShape, canvasData, actionables) {
59158
59556
  var _loop_1 = function (i, imax) {
59159
59557
  var shape = shapes[i];
59160
59558
  // ID
@@ -59163,7 +59561,7 @@
59163
59561
  canvasShape.add(id, shape);
59164
59562
  }
59165
59563
  // Data
59166
- this_1.initData(shape, dataShape, mapper, formatToFormatter, initialToInitialValue, canvasTicker, canvasData);
59564
+ this_1.initData(shape, dataShape, containerShape, mapper, formatToFormatter, initialToInitialValue, canvasTicker, canvasData);
59167
59565
  // Runtime
59168
59566
  var runtime = new (EShapeRuntimes[shape.type] || EShapeRuntime)(shape);
59169
59567
  shape.runtime = runtime;
@@ -59185,7 +59583,13 @@
59185
59583
  // Children
59186
59584
  var children = shape.children;
59187
59585
  if (0 < children.length) {
59188
- this_1.initialize_(children, this_1.toDataShape(dataShape, shape), mapper, formatToFormatter, initialToInitialValue, actionValueToRuntime, canvasTicker, canvasShape, canvasData, actionables);
59586
+ if (shape instanceof EShapeEmbedded) {
59587
+ if (dataShape == null) {
59588
+ dataShape = shape;
59589
+ }
59590
+ containerShape = shape;
59591
+ }
59592
+ this_1.initialize_(children, dataShape, containerShape, mapper, formatToFormatter, initialToInitialValue, actionValueToRuntime, canvasTicker, canvasShape, canvasData, actionables);
59189
59593
  }
59190
59594
  };
59191
59595
  var this_1 = this;
@@ -59193,7 +59597,7 @@
59193
59597
  _loop_1(i);
59194
59598
  }
59195
59599
  };
59196
- DDiagramCanvas.prototype.initData = function (shape, dataShape, mapper, formatToFormatter, initialToInitialValue, canvasTicker, canvasData) {
59600
+ DDiagramCanvas.prototype.initData = function (shape, dataShape, containerShape, mapper, formatToFormatter, initialToInitialValue, canvasTicker, canvasData) {
59197
59601
  var data = shape.data;
59198
59602
  var format = "";
59199
59603
  var initial = "";
@@ -59212,8 +59616,8 @@
59212
59616
  if (value.scope === EShapeDataValueScope.PRIVATE) {
59213
59617
  var id = value.id;
59214
59618
  if (0 < id.length) {
59215
- if (dataShape) {
59216
- dataShape.data.private.add(id, value);
59619
+ if (containerShape) {
59620
+ containerShape.data.private.add(id, value);
59217
59621
  }
59218
59622
  else {
59219
59623
  canvasData.private.add(id, value);
@@ -59365,15 +59769,6 @@
59365
59769
  return "0";
59366
59770
  }
59367
59771
  };
59368
- DDiagramCanvas.prototype.toDataShape = function (dataShape, shape) {
59369
- if (dataShape != null) {
59370
- return dataShape;
59371
- }
59372
- if (shape instanceof EShapeEmbedded) {
59373
- return shape;
59374
- }
59375
- return null;
59376
- };
59377
59772
  DDiagramCanvas.prototype.onDestroy = function () {
59378
59773
  this._ticker.stop();
59379
59774
  _super.prototype.onDestroy.call(this);
@@ -59639,10 +60034,10 @@
59639
60034
  enumerable: false,
59640
60035
  configurable: true
59641
60036
  });
59642
- DDiagramDataPrivateImpl.prototype.set = function (id, value, time, from, to) {
60037
+ DDiagramDataPrivateImpl.prototype.set = function (id, value, time, state, from, to) {
59643
60038
  var canvas = this._diagram.canvas;
59644
60039
  if (canvas != null) {
59645
- return canvas.data.private.set(id, value, time, from, to);
60040
+ return canvas.data.private.set(id, value, time, state, from, to);
59646
60041
  }
59647
60042
  return false;
59648
60043
  };
@@ -59682,10 +60077,10 @@
59682
60077
  enumerable: false,
59683
60078
  configurable: true
59684
60079
  });
59685
- DDiagramDataProtectedImpl.prototype.set = function (id, value, time, from, to) {
60080
+ DDiagramDataProtectedImpl.prototype.set = function (id, value, time, state, from, to) {
59686
60081
  var canvas = this._diagram.canvas;
59687
60082
  if (canvas != null) {
59688
- return canvas.data.protected.set(id, value, time, from, to);
60083
+ return canvas.data.protected.set(id, value, time, state, from, to);
59689
60084
  }
59690
60085
  return false;
59691
60086
  };
@@ -59714,7 +60109,7 @@
59714
60109
  function DDiagramDataRemoteImpl(options) {
59715
60110
  this._controller = options && options.controller;
59716
60111
  }
59717
- DDiagramDataRemoteImpl.prototype.set = function (id, value, time) {
60112
+ DDiagramDataRemoteImpl.prototype.set = function (id, value) {
59718
60113
  var controller = this._controller;
59719
60114
  if (controller) {
59720
60115
  controller.write(id, value);
@@ -59744,10 +60139,10 @@
59744
60139
  enumerable: false,
59745
60140
  configurable: true
59746
60141
  });
59747
- DDiagramDataExtendedImpl.prototype.set = function (id, value, time, from, to) {
60142
+ DDiagramDataExtendedImpl.prototype.set = function (id, value, time, state, from, to) {
59748
60143
  var canvas = this._diagram.canvas;
59749
60144
  if (canvas != null) {
59750
- return canvas.data.extended.set(id, value, time, from, to);
60145
+ return canvas.data.extended.set(id, value, time, state, from, to);
59751
60146
  }
59752
60147
  return false;
59753
60148
  };
@@ -59843,10 +60238,10 @@
59843
60238
  }
59844
60239
  return null;
59845
60240
  };
59846
- DDiagramDataImpl.prototype.set = function (id, value, time, from, to) {
60241
+ DDiagramDataImpl.prototype.set = function (id, value, time, state, from, to) {
59847
60242
  var canvas = this._diagram.canvas;
59848
60243
  if (canvas != null) {
59849
- return canvas.data.set(id, value, time, from, to);
60244
+ return canvas.data.set(id, value, time, state, from, to);
59850
60245
  }
59851
60246
  return false;
59852
60247
  };
@@ -59864,24 +60259,24 @@
59864
60259
  }
59865
60260
  return false;
59866
60261
  };
59867
- DDiagramDataImpl.prototype.setAll = function (id, values, times, from, to) {
60262
+ DDiagramDataImpl.prototype.setAll = function (id, values, times, states, from, to) {
59868
60263
  var canvas = this._diagram.canvas;
59869
60264
  if (canvas != null) {
59870
- return canvas.data.setAll(id, values, times, from, to);
60265
+ return canvas.data.setAll(id, values, times, states, from, to);
59871
60266
  }
59872
60267
  return false;
59873
60268
  };
59874
- DDiagramDataImpl.prototype.setValue = function (id, value, time) {
60269
+ DDiagramDataImpl.prototype.setValue = function (id, value) {
59875
60270
  var canvas = this._diagram.canvas;
59876
60271
  if (canvas != null) {
59877
- return canvas.data.setValue(id, value, time);
60272
+ return canvas.data.setValue(id, value);
59878
60273
  }
59879
60274
  return false;
59880
60275
  };
59881
- DDiagramDataImpl.prototype.setValues = function (id, values, times) {
60276
+ DDiagramDataImpl.prototype.setValues = function (id, values) {
59882
60277
  var canvas = this._diagram.canvas;
59883
60278
  if (canvas != null) {
59884
- return canvas.data.setValues(id, values, times);
60279
+ return canvas.data.setValues(id, values);
59885
60280
  }
59886
60281
  return false;
59887
60282
  };
@@ -59899,6 +60294,20 @@
59899
60294
  }
59900
60295
  return false;
59901
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
+ };
59902
60311
  DDiagramDataImpl.prototype.setRange = function (id, from, to) {
59903
60312
  var canvas = this._diagram.canvas;
59904
60313
  if (canvas != null) {
@@ -63894,13 +64303,21 @@
63894
64303
  var DTableBodyCells = /** @class */ (function () {
63895
64304
  function DTableBodyCells() {
63896
64305
  }
63897
- DTableBodyCells.setReadOnly = function (target, row, columnIndex, column) {
63898
- target.state.isReadOnly = this.toReadOnly(row, columnIndex, column);
63899
- };
63900
- DTableBodyCells.setRenderable = function (target, row, columnIndex, column) {
64306
+ DTableBodyCells.set = function (target, row, columnIndex, column, readOnly) {
64307
+ var _a;
63901
64308
  var renderable = this.toRenderable(row, columnIndex, column);
63902
64309
  target.renderable = renderable;
63903
- 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();
63904
64321
  };
63905
64322
  DTableBodyCells.toReadOnly = function (row, columnIndex, column) {
63906
64323
  var enable = column.editing.enable;
@@ -64033,9 +64450,7 @@
64033
64450
  else {
64034
64451
  this.text = value;
64035
64452
  }
64036
- var column = this._column;
64037
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64038
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64453
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64039
64454
  };
64040
64455
  DTableBodyCellSelectDialog.prototype.unset = function () {
64041
64456
  this._row = undefined;
@@ -64121,9 +64536,7 @@
64121
64536
  this._row = row;
64122
64537
  this._rowIndex = rowIndex;
64123
64538
  this.text = value;
64124
- var column = this._column;
64125
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64126
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64539
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64127
64540
  };
64128
64541
  DTableBodyCellActionMenu.prototype.unset = function () {
64129
64542
  this._row = undefined;
@@ -64237,9 +64650,7 @@
64237
64650
  else {
64238
64651
  this.text = value;
64239
64652
  }
64240
- var column = this._column;
64241
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64242
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64653
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64243
64654
  };
64244
64655
  DTableBodyCellSelectPromise.prototype.unset = function () {
64245
64656
  this._row = undefined;
@@ -64312,9 +64723,7 @@
64312
64723
  this._row = row;
64313
64724
  this._rowIndex = rowIndex;
64314
64725
  this.text = value;
64315
- var column = this._column;
64316
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64317
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64726
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64318
64727
  };
64319
64728
  DTableBodyCellText.prototype.unset = function () {
64320
64729
  this._row = undefined;
@@ -64517,9 +64926,7 @@
64517
64926
  this._row = row;
64518
64927
  this._rowIndex = rowIndex;
64519
64928
  this.state.isActive = !!value;
64520
- var column = this._column;
64521
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64522
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
64929
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64523
64930
  };
64524
64931
  DTableBodyCellCheck.prototype.unset = function () {
64525
64932
  this._row = undefined;
@@ -64586,32 +64993,30 @@
64586
64993
  enumerable: false,
64587
64994
  configurable: true
64588
64995
  });
64589
- DTableBodyCellColor.prototype.set = function (newValue, row, supplimental, rowIndex, columnIndex, forcibly) {
64996
+ DTableBodyCellColor.prototype.set = function (value, row, supplimental, rowIndex, columnIndex, forcibly) {
64590
64997
  this._row = row;
64591
64998
  this._rowIndex = rowIndex;
64592
- var value = this.value;
64593
- if (isNumber(newValue)) {
64594
- value.color = newValue;
64595
- value.alpha = 1;
64596
- }
64597
- else if (isString(newValue)) {
64598
- var parsed = Number(newValue);
64599
- value.color = parsed === parsed ? parsed : 0xffffff;
64600
- value.alpha = 1;
64601
- }
64602
- else if (newValue != null) {
64603
- var color = newValue.color;
64604
- var alpha = newValue.alpha;
64605
- value.color = isNumber(color) ? color : 0xffffff;
64606
- 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;
64607
65014
  }
64608
65015
  else {
64609
- value.color = 0xffffff;
64610
- value.alpha = 1;
65016
+ cell.color = 0xffffff;
65017
+ cell.alpha = 1;
64611
65018
  }
64612
- var column = this._column;
64613
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64614
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65019
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64615
65020
  };
64616
65021
  DTableBodyCellColor.prototype.unset = function () {
64617
65022
  this._row = undefined;
@@ -64703,9 +65108,7 @@
64703
65108
  this.createOrUpdateText();
64704
65109
  }
64705
65110
  }
64706
- var column = this._column;
64707
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64708
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65111
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64709
65112
  };
64710
65113
  DTableBodyCellDate.prototype.unset = function () {
64711
65114
  this._row = undefined;
@@ -64788,7 +65191,7 @@
64788
65191
  }
64789
65192
  else if (isNumber(value)) {
64790
65193
  var textValueComputed = this._textValueComputed;
64791
- if (textValueComputed === undefined) {
65194
+ if (textValueComputed == null) {
64792
65195
  this.text = new Date(value);
64793
65196
  }
64794
65197
  else if (textValueComputed.getTime() !== value) {
@@ -64797,9 +65200,7 @@
64797
65200
  this.createOrUpdateText();
64798
65201
  }
64799
65202
  }
64800
- var column = this._column;
64801
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64802
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65203
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64803
65204
  };
64804
65205
  DTableBodyCellDatetime.prototype.unset = function () {
64805
65206
  this._row = undefined;
@@ -64857,9 +65258,7 @@
64857
65258
  this._row = row;
64858
65259
  this._rowIndex = rowIndex;
64859
65260
  this.text = rowIndex;
64860
- var column = this._column;
64861
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64862
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65261
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64863
65262
  };
64864
65263
  DTableBodyCellIndex.prototype.unset = function () {
64865
65264
  this._row = undefined;
@@ -64927,9 +65326,7 @@
64927
65326
  this._row = row;
64928
65327
  this._rowIndex = rowIndex;
64929
65328
  this.text = Number(value);
64930
- var column = this._column;
64931
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
64932
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65329
+ DTableBodyCells.set(this, row, columnIndex, this._column);
64933
65330
  };
64934
65331
  DTableBodyCellInputInteger.prototype.unset = function () {
64935
65332
  this._row = undefined;
@@ -64997,9 +65394,7 @@
64997
65394
  this._row = row;
64998
65395
  this._rowIndex = rowIndex;
64999
65396
  this.text = Number(value);
65000
- var column = this._column;
65001
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65002
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65397
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65003
65398
  };
65004
65399
  DTableBodyCellInputReal.prototype.unset = function () {
65005
65400
  this._row = undefined;
@@ -65067,9 +65462,7 @@
65067
65462
  this._row = row;
65068
65463
  this._rowIndex = rowIndex;
65069
65464
  this.text = String(value);
65070
- var column = this._column;
65071
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65072
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65465
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65073
65466
  };
65074
65467
  DTableBodyCellInputText.prototype.unset = function () {
65075
65468
  this._row = undefined;
@@ -65325,9 +65718,7 @@
65325
65718
  marker.hide();
65326
65719
  input.padding.adjLeft(0);
65327
65720
  }
65328
- var column = this._column;
65329
- DTableBodyCells.setReadOnly(this._input, row, columnIndex, column);
65330
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65721
+ DTableBodyCells.set(this._input, row, columnIndex, this._column);
65331
65722
  };
65332
65723
  DTableBodyCellInputTree.prototype.unset = function () {
65333
65724
  this._row = undefined;
@@ -65481,9 +65872,7 @@
65481
65872
  this._row = row;
65482
65873
  this._rowIndex = rowIndex;
65483
65874
  this.value = value;
65484
- var column = this._column;
65485
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65486
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65875
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65487
65876
  };
65488
65877
  DTableBodyCellSelectMenu.prototype.unset = function () {
65489
65878
  this._row = undefined;
@@ -65554,9 +65943,7 @@
65554
65943
  this._row = row;
65555
65944
  this._rowIndex = rowIndex;
65556
65945
  this.values = value;
65557
- var column = this._column;
65558
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65559
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
65946
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65560
65947
  };
65561
65948
  DTableBodyCellSelectMultiple.prototype.unset = function () {
65562
65949
  this._row = undefined;
@@ -65648,9 +66035,7 @@
65648
66035
  this.createOrUpdateText();
65649
66036
  }
65650
66037
  }
65651
- var column = this._column;
65652
- DTableBodyCells.setReadOnly(this, row, columnIndex, column);
65653
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
66038
+ DTableBodyCells.set(this, row, columnIndex, this._column);
65654
66039
  };
65655
66040
  DTableBodyCellTime.prototype.unset = function () {
65656
66041
  this._row = undefined;
@@ -65748,8 +66133,7 @@
65748
66133
  this._row = row;
65749
66134
  this._rowIndex = rowIndex;
65750
66135
  this.text = value;
65751
- var column = this._column;
65752
- DTableBodyCells.setRenderable(this, row, columnIndex, column);
66136
+ DTableBodyCells.set(this, row, columnIndex, this._column, false);
65753
66137
  var link = this.link;
65754
66138
  var padding = this._padding;
65755
66139
  if (isNumber(supplimental)) {
@@ -65897,20 +66281,26 @@
65897
66281
  */
65898
66282
  var DTableBodyRow = /** @class */ (function (_super) {
65899
66283
  __extends(DTableBodyRow, _super);
65900
- function DTableBodyRow(onChange, isEven, options) {
66284
+ function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, options) {
65901
66285
  var _this = _super.call(this, options) || this;
65902
66286
  _this._index = -1;
65903
66287
  _this._onCellChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex) {
65904
66288
  _this.emit("change", newValue, oldValue, row, rowIndex, columnIndex, _this);
65905
66289
  onChange(newValue, oldValue, row, rowIndex, columnIndex, _this);
65906
66290
  };
66291
+ _this._columnIndexToCellOptions = columnIndexToCellOptions;
65907
66292
  _this.state.isAlternated = !isEven;
65908
66293
  _this.initCells(options, _this._columns, _this._frozen);
65909
66294
  return _this;
65910
66295
  }
65911
66296
  DTableBodyRow.prototype.newCell = function (columnIndex, column, columns, options) {
65912
66297
  var onChange = this._onCellChangeBound;
65913
- 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
+ }
65914
66304
  if (column.editing.enable !== false) {
65915
66305
  return this.newCellEditable(columnIndex, column, onChange, cellOptions);
65916
66306
  }
@@ -66026,51 +66416,48 @@
66026
66416
  }
66027
66417
  };
66028
66418
  DTableBodyRow.prototype.toCellOptions = function (columnIndex, column, options) {
66029
- var _a, _b;
66030
- var result = column.body || options.cell;
66031
- var columnWeight = column.weight;
66032
- 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
66033
66429
  var columnFormatter = column.formatter;
66034
- var columnAlign = column.align;
66035
- var columnSelecting = column.selecting;
66036
- var columnSelectingMenu = columnSelecting.menu || columnSelecting.multiple;
66037
- if (result != null) {
66038
- result.weight = columnWeight;
66039
- result.width = columnWidth;
66040
- var text = result.text || {};
66041
- result.text = text;
66042
- text.formatter || (text.formatter = columnFormatter);
66043
- var textAlign = text.align || {};
66044
- text.align = textAlign;
66045
- textAlign.horizontal = columnAlign;
66046
- 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);
66047
66433
  }
66048
- else {
66049
- result = {
66050
- weight: columnWeight,
66051
- width: columnWidth,
66052
- text: {
66053
- formatter: columnFormatter,
66054
- align: {
66055
- horizontal: columnAlign
66056
- }
66057
- },
66058
- menu: columnSelectingMenu
66059
- };
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);
66060
66440
  }
66441
+ // Editing
66061
66442
  var columnEditing = column.editing;
66062
66443
  if (columnEditing.enable !== false) {
66063
- var editing = result.editing || {};
66064
- result.editing = editing;
66065
- editing.formatter || (editing.formatter = columnEditing.formatter);
66066
- editing.unformatter || (editing.unformatter = columnEditing.unformatter);
66067
- 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);
66068
66448
  }
66449
+ // Link
66069
66450
  var columnLink = column.link;
66070
- if (columnLink) {
66451
+ if (columnLink !== undefined) {
66071
66452
  result.link = columnLink;
66072
66453
  }
66073
- 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;
66074
66461
  if (selectionType !== DTableDataSelectionType.NONE) {
66075
66462
  result.when = "DOUBLE_CLICKED";
66076
66463
  result.cursor = function (state) {
@@ -67108,6 +67495,7 @@
67108
67495
  _this._onRowChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex) {
67109
67496
  data.emit("change", newValue, oldValue, row, rowIndex, columnIndex, data);
67110
67497
  };
67498
+ _this._columnIndexToCellOptions = new Map();
67111
67499
  _this._data.emit("init", _this._data);
67112
67500
  return _this;
67113
67501
  }
@@ -67299,7 +67687,7 @@
67299
67687
  return row;
67300
67688
  };
67301
67689
  DTableBody.prototype.newRow = function (isEven) {
67302
- return new DTableBodyRow(this._onRowChangeBound, isEven, this._rowOptions);
67690
+ return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
67303
67691
  };
67304
67692
  DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
67305
67693
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
@@ -69062,6 +69450,27 @@
69062
69450
  }
69063
69451
  }
69064
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
+ };
69065
69474
  var toColumnPath = function (options) {
69066
69475
  return options.path != null ? options.path.split(".") : null;
69067
69476
  };
@@ -69103,6 +69512,7 @@
69103
69512
  formatter: options.formatter,
69104
69513
  renderable: toColumnRenderable(options, path),
69105
69514
  align: align,
69515
+ state: toColumnState(options),
69106
69516
  editing: toColumnEditing(options, path),
69107
69517
  sorting: toColumnSorting(getter, index, options),
69108
69518
  header: options.header,
@@ -71223,6 +71633,7 @@
71223
71633
  buildRectangleUv: buildRectangleUv,
71224
71634
  TEXT_VERTEX_COUNT: TEXT_VERTEX_COUNT,
71225
71635
  TEXT_INDEX_COUNT: TEXT_INDEX_COUNT,
71636
+ TEXT_FMIN: TEXT_FMIN,
71226
71637
  toTextBufferCount: toTextBufferCount,
71227
71638
  buildTextClipping: buildTextClipping,
71228
71639
  buildTextIndex: buildTextIndex,
@@ -71447,6 +71858,7 @@
71447
71858
  EShapeDataValueRangeImpl: EShapeDataValueRangeImpl,
71448
71859
  EShapeDataValueRangeType: EShapeDataValueRangeType,
71449
71860
  EShapeDataValueScope: EShapeDataValueScope,
71861
+ EShapeDataValueState: EShapeDataValueState,
71450
71862
  EShapeDataValueType: EShapeDataValueType,
71451
71863
  EShapeDefaults: EShapeDefaults,
71452
71864
  EShapeDeleter: EShapeDeleter,
@@ -71548,14 +71960,17 @@
71548
71960
  isFunction: isFunction,
71549
71961
  isNaN: isNaN,
71550
71962
  isNumber: isNumber,
71963
+ isObject: isObject,
71551
71964
  isString: isString,
71552
71965
  Lazy: Lazy,
71553
71966
  NumberFormatterImpl: NumberFormatterImpl,
71554
71967
  NumberFormatters: NumberFormatters,
71555
71968
  toCeilingIndex: toCeilingIndex,
71969
+ toCloned: toCloned,
71556
71970
  toEnum: toEnum,
71557
71971
  toIndexOf: toIndexOf,
71558
71972
  toLabel: toLabel$1,
71973
+ toMerged: toMerged,
71559
71974
  toPadded: toPadded,
71560
71975
  toString: toString,
71561
71976
  toSvgTexture: toSvgTexture,
@@ -71734,8 +72149,8 @@
71734
72149
  DCommandSave: DCommandSave,
71735
72150
  DCommandUndo: DCommandUndo,
71736
72151
  DContent: DContent,
71737
- DControllerDefaultCommand: DControllerDefaultCommand,
71738
- DControllerDefaultFocus: DControllerDefaultFocus,
72152
+ DControllerCommandImpl: DControllerCommandImpl,
72153
+ DControllerFocusImpl: DControllerFocusImpl,
71739
72154
  DControllerKeyboard: DControllerKeyboard,
71740
72155
  DControllers: DControllers,
71741
72156
  DCornerMask: DCornerMask,