@wcardinal/wcardinal-ui 0.405.0 → 0.406.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 (182) hide show
  1. package/dist/types/wcardinal/ui/d-base-background-snippet.d.ts +2 -1
  2. package/dist/types/wcardinal/ui/d-base-border-snippet.d.ts +2 -1
  3. package/dist/types/wcardinal/ui/d-base-outline-snippet.d.ts +2 -1
  4. package/dist/types/wcardinal/ui/d-button-color.d.ts +0 -1
  5. package/dist/types/wcardinal/ui/d-dialog.d.ts +1 -1
  6. package/dist/types/wcardinal/ui/d-dynamic-text-style.d.ts +17 -11
  7. package/dist/types/wcardinal/ui/d-dynamic-text.d.ts +3 -2
  8. package/dist/types/wcardinal/ui/d-image-base.d.ts +1 -4
  9. package/dist/types/wcardinal/ui/d-image-piece-align.d.ts +4 -4
  10. package/dist/types/wcardinal/ui/d-image-piece-container-impl.d.ts +14 -1
  11. package/dist/types/wcardinal/ui/d-image-piece-container.d.ts +11 -0
  12. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-container.d.ts +2 -2
  13. package/dist/types/wcardinal/ui/d-image-piece-layouter.d.ts +2 -2
  14. package/dist/types/wcardinal/ui/d-input.d.ts +2 -1
  15. package/dist/types/wcardinal/ui/d-menu-item-text.d.ts +3 -2
  16. package/dist/types/wcardinal/ui/d-scroll-bar.d.ts +2 -1
  17. package/dist/types/wcardinal/ui/d-text-base.d.ts +15 -74
  18. package/dist/types/wcardinal/ui/d-text-piece-align-impl.d.ts +20 -0
  19. package/dist/types/wcardinal/ui/d-text-piece-align.d.ts +7 -0
  20. package/dist/types/wcardinal/ui/d-text-piece-impl.d.ts +63 -0
  21. package/dist/types/wcardinal/ui/d-text-piece-style-impl.d.ts +29 -0
  22. package/dist/types/wcardinal/ui/d-text-piece-style.d.ts +16 -0
  23. package/dist/types/wcardinal/ui/d-text-piece.d.ts +61 -0
  24. package/dist/types/wcardinal/ui/shape/e-shape-image-like.d.ts +6 -0
  25. package/dist/types/wcardinal/ui/shape/e-shape.d.ts +2 -2
  26. package/dist/types/wcardinal/ui/shape/index.d.ts +1 -0
  27. package/dist/types/wcardinal/ui/shape/variant/e-shape-base.d.ts +4 -6
  28. package/dist/types/wcardinal/ui/shape/variant/e-shape-group-viewer.d.ts +6 -2
  29. package/dist/types/wcardinal/ui/shape/variant/e-shape-group.d.ts +6 -2
  30. package/dist/types/wcardinal/ui/shape/variant/e-shape-image-sdf.d.ts +2 -1
  31. package/dist/types/wcardinal/ui/shape/variant/e-shape-image.d.ts +2 -1
  32. package/dist/types/wcardinal/ui/shape/variant/e-shape-primitive.d.ts +7 -3
  33. package/dist/types/wcardinal/ui/shape/variant/to-image-element.d.ts +2 -1
  34. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-input.d.ts +1 -0
  35. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-last.d.ts +5 -4
  36. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-next.d.ts +5 -4
  37. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-previous.d.ts +5 -4
  38. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-top.d.ts +5 -4
  39. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.d.ts +5 -4
  40. package/dist/types/wcardinal/ui/theme/white/d-theme-white-input.d.ts +1 -0
  41. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-last.d.ts +5 -4
  42. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-next.d.ts +5 -4
  43. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-previous.d.ts +5 -4
  44. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-button-top.d.ts +5 -4
  45. package/dist/types/wcardinal/ui/theme/white/d-theme-white-pagination-dots.d.ts +5 -4
  46. package/dist/types/wcardinal/ui/util/dynamic-atlas-item-image.d.ts +2 -2
  47. package/dist/types/wcardinal/ui/util/dynamic-sdf-font-generator.d.ts +1 -1
  48. package/dist/wcardinal/ui/d-base-background-snippet.js.map +1 -1
  49. package/dist/wcardinal/ui/d-base-border-snippet.js.map +1 -1
  50. package/dist/wcardinal/ui/d-base-outline-snippet.js.map +1 -1
  51. package/dist/wcardinal/ui/d-button-color-gradient.js +10 -13
  52. package/dist/wcardinal/ui/d-button-color-gradient.js.map +1 -1
  53. package/dist/wcardinal/ui/d-button-color.js +20 -23
  54. package/dist/wcardinal/ui/d-button-color.js.map +1 -1
  55. package/dist/wcardinal/ui/d-button-date.js +4 -4
  56. package/dist/wcardinal/ui/d-button-date.js.map +1 -1
  57. package/dist/wcardinal/ui/d-button-datetime.js +4 -4
  58. package/dist/wcardinal/ui/d-button-datetime.js.map +1 -1
  59. package/dist/wcardinal/ui/d-button-select.js +2 -2
  60. package/dist/wcardinal/ui/d-button-select.js.map +1 -1
  61. package/dist/wcardinal/ui/d-button-time.js +4 -4
  62. package/dist/wcardinal/ui/d-button-time.js.map +1 -1
  63. package/dist/wcardinal/ui/d-dialog-processing.js +1 -1
  64. package/dist/wcardinal/ui/d-dialog-processing.js.map +1 -1
  65. package/dist/wcardinal/ui/d-dialog.js.map +1 -1
  66. package/dist/wcardinal/ui/d-dynamic-text-style.js +39 -65
  67. package/dist/wcardinal/ui/d-dynamic-text-style.js.map +1 -1
  68. package/dist/wcardinal/ui/d-dynamic-text.js +11 -8
  69. package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
  70. package/dist/wcardinal/ui/d-image-base.js +6 -18
  71. package/dist/wcardinal/ui/d-image-base.js.map +1 -1
  72. package/dist/wcardinal/ui/d-image-piece-align.js.map +1 -1
  73. package/dist/wcardinal/ui/d-image-piece-container-impl.js +49 -1
  74. package/dist/wcardinal/ui/d-image-piece-container-impl.js.map +1 -1
  75. package/dist/wcardinal/ui/d-image-piece-container.js.map +1 -1
  76. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -1
  77. package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -1
  78. package/dist/wcardinal/ui/d-indicator-processing.js +1 -1
  79. package/dist/wcardinal/ui/d-indicator-processing.js.map +1 -1
  80. package/dist/wcardinal/ui/d-input.js +11 -7
  81. package/dist/wcardinal/ui/d-input.js.map +1 -1
  82. package/dist/wcardinal/ui/d-menu-item-text.js +12 -6
  83. package/dist/wcardinal/ui/d-menu-item-text.js.map +1 -1
  84. package/dist/wcardinal/ui/d-scroll-bar.js.map +1 -1
  85. package/dist/wcardinal/ui/d-table-body-cell-date.js +7 -10
  86. package/dist/wcardinal/ui/d-table-body-cell-date.js.map +1 -1
  87. package/dist/wcardinal/ui/d-table-body-cell-datetime.js +7 -10
  88. package/dist/wcardinal/ui/d-table-body-cell-datetime.js.map +1 -1
  89. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js +4 -10
  90. package/dist/wcardinal/ui/d-table-body-cell-select-dialog.js.map +1 -1
  91. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js +4 -10
  92. package/dist/wcardinal/ui/d-table-body-cell-select-promise.js.map +1 -1
  93. package/dist/wcardinal/ui/d-table-body-cell-time.js +7 -10
  94. package/dist/wcardinal/ui/d-table-body-cell-time.js.map +1 -1
  95. package/dist/wcardinal/ui/d-text-base.js +55 -247
  96. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  97. package/dist/wcardinal/ui/d-text-piece-align-impl.js +69 -0
  98. package/dist/wcardinal/ui/d-text-piece-align-impl.js.map +1 -0
  99. package/dist/wcardinal/ui/d-text-piece-align.js +2 -0
  100. package/dist/wcardinal/ui/d-text-piece-align.js.map +1 -0
  101. package/dist/wcardinal/ui/d-text-piece-impl.js +299 -0
  102. package/dist/wcardinal/ui/d-text-piece-impl.js.map +1 -0
  103. package/dist/wcardinal/ui/d-text-piece-style-impl.js +146 -0
  104. package/dist/wcardinal/ui/d-text-piece-style-impl.js.map +1 -0
  105. package/dist/wcardinal/ui/d-text-piece-style.js +2 -0
  106. package/dist/wcardinal/ui/d-text-piece-style.js.map +1 -0
  107. package/dist/wcardinal/ui/d-text-piece.js +2 -0
  108. package/dist/wcardinal/ui/d-text-piece.js.map +1 -0
  109. package/dist/wcardinal/ui/shape/e-shape-container.js +1 -1
  110. package/dist/wcardinal/ui/shape/e-shape-container.js.map +1 -1
  111. package/dist/wcardinal/ui/shape/e-shape-image-like.js +2 -0
  112. package/dist/wcardinal/ui/shape/e-shape-image-like.js.map +1 -0
  113. package/dist/wcardinal/ui/shape/e-shape-renderer.js +7 -13
  114. package/dist/wcardinal/ui/shape/e-shape-renderer.js.map +1 -1
  115. package/dist/wcardinal/ui/shape/e-shape.js.map +1 -1
  116. package/dist/wcardinal/ui/shape/index.js +1 -0
  117. package/dist/wcardinal/ui/shape/index.js.map +1 -1
  118. package/dist/wcardinal/ui/shape/variant/create-image-sdf.js +4 -4
  119. package/dist/wcardinal/ui/shape/variant/create-image-sdf.js.map +1 -1
  120. package/dist/wcardinal/ui/shape/variant/create-image.js +2 -2
  121. package/dist/wcardinal/ui/shape/variant/create-image.js.map +1 -1
  122. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +0 -25
  123. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  124. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js +6 -0
  125. package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js.map +1 -1
  126. package/dist/wcardinal/ui/shape/variant/e-shape-group.js +6 -0
  127. package/dist/wcardinal/ui/shape/variant/e-shape-group.js.map +1 -1
  128. package/dist/wcardinal/ui/shape/variant/e-shape-image-sdf.js.map +1 -1
  129. package/dist/wcardinal/ui/shape/variant/e-shape-image.js.map +1 -1
  130. package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js +15 -2
  131. package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js.map +1 -1
  132. package/dist/wcardinal/ui/shape/variant/to-image-element.js +9 -3
  133. package/dist/wcardinal/ui/shape/variant/to-image-element.js.map +1 -1
  134. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js +6 -0
  135. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js.map +1 -1
  136. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-last.js.map +1 -1
  137. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-next.js.map +1 -1
  138. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-previous.js.map +1 -1
  139. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-button-top.js.map +1 -1
  140. package/dist/wcardinal/ui/theme/dark/d-theme-dark-pagination-dots.js.map +1 -1
  141. package/dist/wcardinal/ui/theme/dark/d-theme-dark-select-multiple.js +9 -9
  142. package/dist/wcardinal/ui/theme/dark/d-theme-dark-select-multiple.js.map +1 -1
  143. package/dist/wcardinal/ui/theme/dark/d-theme-dark-select.js +7 -7
  144. package/dist/wcardinal/ui/theme/dark/d-theme-dark-select.js.map +1 -1
  145. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js +6 -0
  146. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js.map +1 -1
  147. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-last.js.map +1 -1
  148. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-next.js.map +1 -1
  149. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-previous.js.map +1 -1
  150. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-button-top.js.map +1 -1
  151. package/dist/wcardinal/ui/theme/white/d-theme-white-pagination-dots.js.map +1 -1
  152. package/dist/wcardinal/ui/theme/white/d-theme-white-select-multiple.js +9 -9
  153. package/dist/wcardinal/ui/theme/white/d-theme-white-select-multiple.js.map +1 -1
  154. package/dist/wcardinal/ui/theme/white/d-theme-white-select.js +7 -7
  155. package/dist/wcardinal/ui/theme/white/d-theme-white-select.js.map +1 -1
  156. package/dist/wcardinal/ui/util/dynamic-atlas-item-image.js +18 -9
  157. package/dist/wcardinal/ui/util/dynamic-atlas-item-image.js.map +1 -1
  158. package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js +1 -1
  159. package/dist/wcardinal/ui/util/dynamic-sdf-font-atlas.js.map +1 -1
  160. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js +1 -3
  161. package/dist/wcardinal/ui/util/dynamic-sdf-font-generator.js.map +1 -1
  162. package/dist/wcardinal-ui-theme-dark-en-us.js +23 -17
  163. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  164. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  165. package/dist/wcardinal-ui-theme-dark-ja-jp.js +23 -17
  166. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  167. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  168. package/dist/wcardinal-ui-theme-dark.js +23 -17
  169. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  170. package/dist/wcardinal-ui-theme-white-en-us.js +23 -17
  171. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  172. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  173. package/dist/wcardinal-ui-theme-white-ja-jp.js +23 -17
  174. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  175. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  176. package/dist/wcardinal-ui-theme-white.js +23 -17
  177. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  178. package/dist/wcardinal-ui.cjs.js +1110 -787
  179. package/dist/wcardinal-ui.js +1065 -754
  180. package/dist/wcardinal-ui.min.js +2 -2
  181. package/dist/wcardinal-ui.min.js.map +1 -1
  182. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.405.0
2
+ Winter Cardinal UI v0.406.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -4549,21 +4549,6 @@
4549
4549
  return -ax <= x && x <= +ax && -ay <= y && y <= +ay;
4550
4550
  };
4551
4551
 
4552
- /*
4553
- * Copyright (C) 2019 Toshiba Corporation
4554
- * SPDX-License-Identifier: Apache-2.0
4555
- */
4556
- var toGradientSerialized = function (gradient) {
4557
- var points = gradient.points;
4558
- var result = "[".concat(gradient.direction);
4559
- for (var i = 0, imax = points.length, j = 1; i < imax; i += 1, j += 3) {
4560
- var point = points[i];
4561
- result += ",".concat(point.color, ",").concat(point.alpha, ",").concat(point.position);
4562
- }
4563
- result += "]";
4564
- return result;
4565
- };
4566
-
4567
4552
  /*
4568
4553
  * Copyright (C) 2019 Toshiba Corporation
4569
4554
  * SPDX-License-Identifier: Apache-2.0
@@ -4964,16 +4949,6 @@
4964
4949
  }
4965
4950
  }
4966
4951
  };
4967
- Object.defineProperty(EShapeBase.prototype, "image", {
4968
- get: function () {
4969
- return this._image;
4970
- },
4971
- set: function (image) {
4972
- this._image = image;
4973
- },
4974
- enumerable: false,
4975
- configurable: true
4976
- });
4977
4952
  Object.defineProperty(EShapeBase.prototype, "points", {
4978
4953
  get: function () {
4979
4954
  return this._points;
@@ -5122,20 +5097,6 @@
5122
5097
  }
5123
5098
  return childrenSerialized;
5124
5099
  };
5125
- EShapeBase.prototype.serializeImage = function (manager) {
5126
- var image = this._image;
5127
- return image != null ? manager.addResource(image.src) : -1;
5128
- };
5129
- EShapeBase.prototype.serializeGradient = function (manager) {
5130
- var gradient = this.gradient;
5131
- if (gradient != null) {
5132
- if (gradient.serialized == null) {
5133
- gradient.serialized = toGradientSerialized(gradient);
5134
- }
5135
- return manager.addResource(gradient.serialized);
5136
- }
5137
- return -1;
5138
- };
5139
5100
  EShapeBase.prototype.serializeState = function (manager) {
5140
5101
  var state = this.state;
5141
5102
  return (this.interactive ? 1 : 0) | (state.isFocusable ? 0 : 2) | (state.isActive ? 4 : 0);
@@ -8153,6 +8114,21 @@
8153
8114
  return EShapeTextImpl;
8154
8115
  }());
8155
8116
 
8117
+ /*
8118
+ * Copyright (C) 2019 Toshiba Corporation
8119
+ * SPDX-License-Identifier: Apache-2.0
8120
+ */
8121
+ var toGradientSerialized = function (gradient) {
8122
+ var points = gradient.points;
8123
+ var result = "[".concat(gradient.direction);
8124
+ for (var i = 0, imax = points.length, j = 1; i < imax; i += 1, j += 3) {
8125
+ var point = points[i];
8126
+ result += ",".concat(point.color, ",").concat(point.alpha, ",").concat(point.position);
8127
+ }
8128
+ result += "]";
8129
+ return result;
8130
+ };
8131
+
8156
8132
  /*
8157
8133
  * Copyright (C) 2019 Toshiba Corporation
8158
8134
  * SPDX-License-Identifier: Apache-2.0
@@ -8221,11 +8197,9 @@
8221
8197
  if (this._image !== image) {
8222
8198
  if (image != null) {
8223
8199
  this._image = image;
8224
- this.imageSrc = image.src;
8225
8200
  }
8226
8201
  else {
8227
8202
  this._image = undefined;
8228
- this.imageSrc = undefined;
8229
8203
  }
8230
8204
  var parent_1 = this.parent;
8231
8205
  if (parent_1 != null) {
@@ -8236,6 +8210,20 @@
8236
8210
  enumerable: false,
8237
8211
  configurable: true
8238
8212
  });
8213
+ EShapePrimitive.prototype.serializeImage = function (manager) {
8214
+ var image = this._image;
8215
+ return image != null ? manager.addResource(image.url) : -1;
8216
+ };
8217
+ EShapePrimitive.prototype.serializeGradient = function (manager) {
8218
+ var gradient = this.gradient;
8219
+ if (gradient != null) {
8220
+ if (gradient.serialized == null) {
8221
+ gradient.serialized = toGradientSerialized(gradient);
8222
+ }
8223
+ return manager.addResource(gradient.serialized);
8224
+ }
8225
+ return -1;
8226
+ };
8239
8227
  return EShapePrimitive;
8240
8228
  }(EShapeBase));
8241
8229
 
@@ -17947,6 +17935,9 @@
17947
17935
  enumerable: false,
17948
17936
  configurable: true
17949
17937
  });
17938
+ EShapeGroupViewer.prototype.serializeGradient = function (manager) {
17939
+ return -1;
17940
+ };
17950
17941
  Object.defineProperty(EShapeGroupViewer.prototype, "radius", {
17951
17942
  get: function () {
17952
17943
  return 0;
@@ -17967,6 +17958,9 @@
17967
17958
  enumerable: false,
17968
17959
  configurable: true
17969
17960
  });
17961
+ EShapeGroupViewer.prototype.serializeImage = function (manager) {
17962
+ return -1;
17963
+ };
17970
17964
  Object.defineProperty(EShapeGroupViewer.prototype, "points", {
17971
17965
  get: function () {
17972
17966
  return undefined;
@@ -21173,12 +21167,10 @@
21173
21167
  }
21174
21168
  }
21175
21169
  };
21176
- DynamicSDFFontGenerator.prototype.updateTexture = function (source) {
21170
+ DynamicSDFFontGenerator.prototype.updateTexture = function (width, height, source) {
21177
21171
  var gl = this._gl;
21178
21172
  var canvas = this._canvas;
21179
21173
  if (gl != null && gl.isContextLost() !== true && canvas != null) {
21180
- var width = source.width;
21181
- var height = source.height;
21182
21174
  if (canvas.width !== width || canvas.height !== height) {
21183
21175
  canvas.width = width;
21184
21176
  canvas.height = height;
@@ -21541,7 +21533,7 @@
21541
21533
  context.fillText(data.character, data.origin.x, data.origin.y);
21542
21534
  }
21543
21535
  // Convert to SDF font texture
21544
- generator.updateTexture(canvas);
21536
+ generator.updateTexture(width, height, canvas);
21545
21537
  generator.render();
21546
21538
  generator.read(canvas);
21547
21539
  return true;
@@ -21692,9 +21684,9 @@
21692
21684
  */
21693
21685
  var DynamicAtlasItemImage = /** @class */ (function (_super) {
21694
21686
  __extends(DynamicAtlasItemImage, _super);
21695
- function DynamicAtlasItemImage(image, baseTexture) {
21696
- var _this = _super.call(this, image.src, image.width / baseTexture.resolution, image.height / baseTexture.resolution, 0, baseTexture) || this;
21697
- _this.image = image;
21687
+ function DynamicAtlasItemImage(src, width, height, source, baseTexture) {
21688
+ var _this = _super.call(this, src, width / baseTexture.resolution, height / baseTexture.resolution, 0, baseTexture) || this;
21689
+ _this.source = source;
21698
21690
  return _this;
21699
21691
  }
21700
21692
  DynamicAtlasItemImage.prototype.render = function (context) {
@@ -21703,12 +21695,21 @@
21703
21695
  var y = frame.y;
21704
21696
  var w = frame.width;
21705
21697
  var h = frame.height;
21706
- var image = this.image;
21707
- context.drawImage(image, x, y, w, h);
21708
- context.drawImage(image, 0, 0, 1, h, x - 1, y - 1, 1, h + 2);
21709
- context.drawImage(image, 0, 0, w, 1, x, y - 1, w, 1);
21710
- context.drawImage(image, w - 1, 0, 1, h, x + w, y - 1, 1, h + 2);
21711
- context.drawImage(image, 0, h - 1, w, 1, x, y + h, w, 1);
21698
+ var source = this.source;
21699
+ if (source instanceof ImageData) {
21700
+ context.putImageData(source, x, y);
21701
+ context.putImageData(source, x - 1, y, 0, 0, 1, h);
21702
+ context.putImageData(source, x, y - 1, 0, 0, w, 1);
21703
+ context.putImageData(source, x + w, y, w - 1, 0, 1, h);
21704
+ context.putImageData(source, x, y + h, 0, h - 1, w, 1);
21705
+ }
21706
+ else {
21707
+ context.drawImage(source, x, y, w, h);
21708
+ context.drawImage(source, 0, 0, 1, h, x - 1, y - 1, 1, h + 2);
21709
+ context.drawImage(source, 0, 0, w, 1, x, y - 1, w, 1);
21710
+ context.drawImage(source, w - 1, 0, 1, h, x + w, y - 1, 1, h + 2);
21711
+ context.drawImage(source, 0, h - 1, w, 1, x, y + h, w, 1);
21712
+ }
21712
21713
  };
21713
21714
  return DynamicAtlasItemImage;
21714
21715
  }(DynamicAtlasItem));
@@ -22061,24 +22062,18 @@
22061
22062
  };
22062
22063
  EShapeRenderer.prototype.updateAtlas = function (shape, atlas, fontAtlases, defaultTexture, baseTexture) {
22063
22064
  // Texture
22064
- // Do not access the shape.image.src here.
22065
+ // Do not access the shape.image.source here.
22065
22066
  // It slows down the rendering speed significantly.
22066
- var imageSrc = shape.imageSrc;
22067
- if (imageSrc != null) {
22068
- var textureItem = atlas.get(imageSrc);
22067
+ var image = shape.image;
22068
+ if (image != null) {
22069
+ var textureItem = atlas.get(image.url);
22069
22070
  if (textureItem != null) {
22070
22071
  shape.texture = textureItem.texture;
22071
22072
  }
22072
22073
  else {
22073
- var image = shape.image;
22074
- if (image != null) {
22075
- var newTextureItem = new DynamicAtlasItemImage(image, baseTexture);
22076
- shape.texture = newTextureItem.texture;
22077
- atlas.set(newTextureItem.id, newTextureItem);
22078
- }
22079
- else {
22080
- shape.texture = defaultTexture;
22081
- }
22074
+ var newTextureItem = new DynamicAtlasItemImage(image.url, image.width, image.height, image.source, baseTexture);
22075
+ shape.texture = newTextureItem.texture;
22076
+ atlas.set(newTextureItem.id, newTextureItem);
22082
22077
  }
22083
22078
  }
22084
22079
  else {
@@ -22246,7 +22241,7 @@
22246
22241
  _this._pixelScale = 1;
22247
22242
  _this._pixelScaleId = -2; // Since this._shapeScaleId starts from -1.
22248
22243
  _this._shapeScale = 1;
22249
- _this._shapeScaleId = -1; // Since PIXI.Transform._worldID starts from zero.
22244
+ _this._shapeScaleId = -1; // Since Transform._worldID starts from zero.
22250
22245
  _this._work = new pixi_js.Point();
22251
22246
  _this._buffers = [];
22252
22247
  return _this;
@@ -28963,345 +28958,6 @@
28963
28958
  return DDynamicTextGeometry;
28964
28959
  }(pixi_js.MeshGeometry));
28965
28960
 
28966
- /*
28967
- * Copyright (C) 2019 Toshiba Corporation
28968
- * SPDX-License-Identifier: Apache-2.0
28969
- */
28970
- var DDynamicTextStyle = /** @class */ (function () {
28971
- function DDynamicTextStyle(options, onChange) {
28972
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
28973
- this._id = 0;
28974
- this._idApproved = -1;
28975
- var defaultOptions = this.getDefaultOptions();
28976
- if (options) {
28977
- this._align = (_a = options.align) !== null && _a !== void 0 ? _a : defaultOptions.align;
28978
- this._fontFamily = (_b = options.fontFamily) !== null && _b !== void 0 ? _b : defaultOptions.fontFamily;
28979
- this._fontSize = (_c = options.fontSize) !== null && _c !== void 0 ? _c : defaultOptions.fontSize;
28980
- this._fontStyle = (_d = options.fontStyle) !== null && _d !== void 0 ? _d : defaultOptions.fontStyle;
28981
- this._fontVariant = (_e = options.fontVariant) !== null && _e !== void 0 ? _e : defaultOptions.fontVariant;
28982
- this._fontWeight = (_f = options.fontWeight) !== null && _f !== void 0 ? _f : defaultOptions.fontWeight;
28983
- this._fill = (_g = options.fill) !== null && _g !== void 0 ? _g : defaultOptions.fill;
28984
- this._clipping = (_h = options.clipping) !== null && _h !== void 0 ? _h : defaultOptions.clipping;
28985
- this._fitting = (_j = options.fitting) !== null && _j !== void 0 ? _j : defaultOptions.fitting;
28986
- this._wordWrap = toEnum((_k = options.wordWrap) !== null && _k !== void 0 ? _k : defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
28987
- this._lineHeight = (_l = options.lineHeight) !== null && _l !== void 0 ? _l : defaultOptions.lineHeight;
28988
- }
28989
- else {
28990
- this._align = defaultOptions.align;
28991
- this._fontFamily = defaultOptions.fontFamily;
28992
- this._fontSize = defaultOptions.fontSize;
28993
- this._fontStyle = defaultOptions.fontStyle;
28994
- this._fontVariant = defaultOptions.fontVariant;
28995
- this._fontWeight = defaultOptions.fontWeight;
28996
- this._fill = defaultOptions.fill;
28997
- this._clipping = defaultOptions.clipping;
28998
- this._fitting = defaultOptions.fitting;
28999
- this._wordWrap = toEnum(defaultOptions.wordWrap, DDynamicTextStyleWordWrap);
29000
- this._lineHeight = defaultOptions.lineHeight;
29001
- }
29002
- this._fontSizeFitted = this._fontSize;
29003
- this._lineHeightFitted = this._lineHeight;
29004
- this._isFontFitted = false;
29005
- this._fontIdFontSize = this._fontSize;
29006
- this._fontIdId = -1;
29007
- this._fontId = "";
29008
- this._fontIdApproved = "";
29009
- this._fillApproved = 0x000000;
29010
- this._onChange = onChange;
29011
- }
29012
- DDynamicTextStyle.prototype.getDefaultOptions = function () {
29013
- var result = DDynamicTextStyle.DEFAULT_OPTIONS;
29014
- if (result == null) {
29015
- result = this.newDefaultOptions();
29016
- DDynamicTextStyle.DEFAULT_OPTIONS = result;
29017
- }
29018
- return result;
29019
- };
29020
- DDynamicTextStyle.prototype.newDefaultOptions = function () {
29021
- var theme = DThemes.getInstance().get("DBase");
29022
- return {
29023
- align: "left",
29024
- fontFamily: theme.getFontFamilly(),
29025
- fontSize: theme.getFontSize(),
29026
- fontStyle: "normal",
29027
- fontVariant: "normal",
29028
- fontWeight: "normal",
29029
- fill: theme.getColor(new DBaseStateSetImpl()),
29030
- clipping: true,
29031
- fitting: false,
29032
- wordWrap: DDynamicTextStyleWordWrap.NONE,
29033
- lineHeight: theme.getLineHeight()
29034
- };
29035
- };
29036
- Object.defineProperty(DDynamicTextStyle.prototype, "id", {
29037
- get: function () {
29038
- return this._id;
29039
- },
29040
- enumerable: false,
29041
- configurable: true
29042
- });
29043
- Object.defineProperty(DDynamicTextStyle.prototype, "idApproved", {
29044
- get: function () {
29045
- return this._idApproved;
29046
- },
29047
- enumerable: false,
29048
- configurable: true
29049
- });
29050
- Object.defineProperty(DDynamicTextStyle.prototype, "fontId", {
29051
- get: function () {
29052
- this.update();
29053
- return this._fontId;
29054
- },
29055
- enumerable: false,
29056
- configurable: true
29057
- });
29058
- Object.defineProperty(DDynamicTextStyle.prototype, "fontIdFontSize", {
29059
- get: function () {
29060
- this.update();
29061
- return this._fontSizeFitted;
29062
- },
29063
- enumerable: false,
29064
- configurable: true
29065
- });
29066
- Object.defineProperty(DDynamicTextStyle.prototype, "fontIdApproved", {
29067
- get: function () {
29068
- return this._fontIdApproved;
29069
- },
29070
- enumerable: false,
29071
- configurable: true
29072
- });
29073
- Object.defineProperty(DDynamicTextStyle.prototype, "fill", {
29074
- get: function () {
29075
- return this._fill;
29076
- },
29077
- set: function (fill) {
29078
- if (this._fill !== fill) {
29079
- this._fill = fill;
29080
- this.onChange();
29081
- }
29082
- },
29083
- enumerable: false,
29084
- configurable: true
29085
- });
29086
- DDynamicTextStyle.prototype.onChange = function () {
29087
- this._id += 1;
29088
- this._onChange();
29089
- };
29090
- Object.defineProperty(DDynamicTextStyle.prototype, "fillApproved", {
29091
- get: function () {
29092
- return this._fillApproved;
29093
- },
29094
- enumerable: false,
29095
- configurable: true
29096
- });
29097
- DDynamicTextStyle.prototype.approve = function () {
29098
- this.update();
29099
- this._idApproved = this._id;
29100
- this._fontIdApproved = this._fontId;
29101
- this._fillApproved = this._fill;
29102
- };
29103
- Object.defineProperty(DDynamicTextStyle.prototype, "fontFamily", {
29104
- get: function () {
29105
- return this._fontFamily;
29106
- },
29107
- set: function (fontFamily) {
29108
- if (this._fontFamily !== fontFamily) {
29109
- this._fontFamily = fontFamily;
29110
- this.onChange();
29111
- }
29112
- },
29113
- enumerable: false,
29114
- configurable: true
29115
- });
29116
- Object.defineProperty(DDynamicTextStyle.prototype, "fontSize", {
29117
- get: function () {
29118
- return this._fontSize;
29119
- },
29120
- set: function (fontSize) {
29121
- if (this._fontSize !== fontSize) {
29122
- this._fontSize = fontSize;
29123
- this._fontSizeFitted = fontSize;
29124
- this._lineHeightFitted = this._lineHeight;
29125
- this._isFontFitted = false;
29126
- this.onChange();
29127
- }
29128
- },
29129
- enumerable: false,
29130
- configurable: true
29131
- });
29132
- Object.defineProperty(DDynamicTextStyle.prototype, "fontSizeFitted", {
29133
- get: function () {
29134
- return this._fontSizeFitted;
29135
- },
29136
- enumerable: false,
29137
- configurable: true
29138
- });
29139
- Object.defineProperty(DDynamicTextStyle.prototype, "isFontFitted", {
29140
- get: function () {
29141
- return this._isFontFitted;
29142
- },
29143
- enumerable: false,
29144
- configurable: true
29145
- });
29146
- Object.defineProperty(DDynamicTextStyle.prototype, "fontStyle", {
29147
- get: function () {
29148
- return this._fontStyle;
29149
- },
29150
- set: function (fontStyle) {
29151
- if (this._fontStyle !== fontStyle) {
29152
- this._fontStyle = fontStyle;
29153
- this.onChange();
29154
- }
29155
- },
29156
- enumerable: false,
29157
- configurable: true
29158
- });
29159
- Object.defineProperty(DDynamicTextStyle.prototype, "fontVariant", {
29160
- get: function () {
29161
- return this._fontVariant;
29162
- },
29163
- set: function (fontVariant) {
29164
- if (this._fontVariant !== fontVariant) {
29165
- this._fontVariant = fontVariant;
29166
- this.onChange();
29167
- }
29168
- },
29169
- enumerable: false,
29170
- configurable: true
29171
- });
29172
- Object.defineProperty(DDynamicTextStyle.prototype, "fontWeight", {
29173
- get: function () {
29174
- return this._fontWeight;
29175
- },
29176
- set: function (fontWeight) {
29177
- if (this._fontWeight !== fontWeight) {
29178
- this._fontWeight = fontWeight;
29179
- this.onChange();
29180
- }
29181
- },
29182
- enumerable: false,
29183
- configurable: true
29184
- });
29185
- DDynamicTextStyle.prototype.update = function () {
29186
- if (this._fontIdId !== this._id) {
29187
- this._fontIdId = this._id;
29188
- var fontIdFontSize = this._fitting ? this._fontSizeFitted : this._fontSize;
29189
- this._fontIdFontSize = fontIdFontSize;
29190
- this._fontId = this.toFontId(fontIdFontSize);
29191
- }
29192
- };
29193
- DDynamicTextStyle.prototype.toFontId = function (fontSize) {
29194
- return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(fontSize, "px ").concat(this._fontFamily);
29195
- };
29196
- Object.defineProperty(DDynamicTextStyle.prototype, "clipping", {
29197
- get: function () {
29198
- return this._clipping;
29199
- },
29200
- set: function (clipping) {
29201
- if (this._clipping !== clipping) {
29202
- this._clipping = clipping;
29203
- this.onChange();
29204
- }
29205
- },
29206
- enumerable: false,
29207
- configurable: true
29208
- });
29209
- Object.defineProperty(DDynamicTextStyle.prototype, "fitting", {
29210
- get: function () {
29211
- return this._fitting;
29212
- },
29213
- set: function (fitting) {
29214
- if (this._fitting !== fitting) {
29215
- this._fitting = fitting;
29216
- this.onChange();
29217
- }
29218
- },
29219
- enumerable: false,
29220
- configurable: true
29221
- });
29222
- Object.defineProperty(DDynamicTextStyle.prototype, "wordWrap", {
29223
- get: function () {
29224
- return this._wordWrap;
29225
- },
29226
- set: function (wordWrap) {
29227
- if (this._wordWrap !== wordWrap) {
29228
- this._wordWrap = wordWrap;
29229
- this.onChange();
29230
- }
29231
- },
29232
- enumerable: false,
29233
- configurable: true
29234
- });
29235
- Object.defineProperty(DDynamicTextStyle.prototype, "lineHeight", {
29236
- get: function () {
29237
- return this._lineHeight;
29238
- },
29239
- set: function (lineHeight) {
29240
- if (this._lineHeight !== lineHeight) {
29241
- this._lineHeight = lineHeight;
29242
- this._fontSizeFitted = this._fontSize;
29243
- this._lineHeightFitted = lineHeight;
29244
- this._isFontFitted = false;
29245
- this.onChange();
29246
- }
29247
- },
29248
- enumerable: false,
29249
- configurable: true
29250
- });
29251
- Object.defineProperty(DDynamicTextStyle.prototype, "lineHeightFitted", {
29252
- get: function () {
29253
- return this._lineHeightFitted;
29254
- },
29255
- set: function (lineHeightFitted) {
29256
- if (this._lineHeightFitted !== lineHeightFitted) {
29257
- this._lineHeightFitted = lineHeightFitted;
29258
- this.onChange();
29259
- }
29260
- },
29261
- enumerable: false,
29262
- configurable: true
29263
- });
29264
- DDynamicTextStyle.prototype.fit = function (fontSize, lineHeight) {
29265
- var isChanged = false;
29266
- if (fontSize < this._fontSizeFitted) {
29267
- this._fontSizeFitted = fontSize;
29268
- isChanged = true;
29269
- }
29270
- if (this._lineHeightFitted !== lineHeight) {
29271
- this._lineHeightFitted = lineHeight;
29272
- isChanged = true;
29273
- }
29274
- if (this._isFontFitted !== true) {
29275
- this._isFontFitted = true;
29276
- isChanged = true;
29277
- }
29278
- if (isChanged) {
29279
- this.onChange();
29280
- }
29281
- return isChanged;
29282
- };
29283
- DDynamicTextStyle.prototype.unfit = function () {
29284
- var isChanged = false;
29285
- if (this._isFontFitted !== false) {
29286
- this._isFontFitted = false;
29287
- isChanged = true;
29288
- }
29289
- if (this._fontSizeFitted !== this._fontSize) {
29290
- this._fontSizeFitted = this._fontSize;
29291
- isChanged = true;
29292
- }
29293
- if (this._lineHeightFitted !== this._lineHeight) {
29294
- this._lineHeightFitted = this._lineHeight;
29295
- isChanged = true;
29296
- }
29297
- if (isChanged) {
29298
- this.onChange();
29299
- }
29300
- return isChanged;
29301
- };
29302
- return DDynamicTextStyle;
29303
- }());
29304
-
29305
28961
  /*
29306
28962
  * Copyright (C) 2019 Toshiba Corporation
29307
28963
  * SPDX-License-Identifier: Apache-2.0
@@ -29379,13 +29035,11 @@
29379
29035
  */
29380
29036
  var DDynamicText = /** @class */ (function (_super) {
29381
29037
  __extends(DDynamicText, _super);
29382
- function DDynamicText(options) {
29038
+ function DDynamicText(style) {
29383
29039
  var _this = _super.call(this, new DDynamicTextGeometry(), new pixi_js.MeshMaterial(pixi_js.Texture.EMPTY)) || this;
29384
- _this._style = new DDynamicTextStyle(options, function () {
29385
- _this._isDirty = true;
29386
- _this._isGeometryDirty = true;
29387
- _this._atlas = null;
29388
- _this.update_();
29040
+ _this._style = style;
29041
+ style.on("change", function () {
29042
+ _this.onStyleChange();
29389
29043
  });
29390
29044
  _this._text = "";
29391
29045
  _this._textApproved = "";
@@ -29409,15 +29063,21 @@
29409
29063
  };
29410
29064
  return _this;
29411
29065
  }
29066
+ DDynamicText.prototype.onStyleChange = function () {
29067
+ this._isDirty = true;
29068
+ this._isGeometryDirty = true;
29069
+ this._atlas = null;
29070
+ this.update_();
29071
+ };
29412
29072
  DDynamicText.prototype.update_ = function () {
29413
29073
  var layer = DApplications.getLayer(this);
29414
29074
  if (layer) {
29415
- var style = this._style;
29416
29075
  if (this._isDirty) {
29417
29076
  this._isDirty = false;
29418
29077
  var text = this._text;
29419
29078
  var textApproved = this._textApproved;
29420
29079
  this._textApproved = text;
29080
+ var style = this._style;
29421
29081
  var fontId = style.fontId;
29422
29082
  var fontIdApproved = style.fontIdApproved;
29423
29083
  var fontIdFontSize = style.fontIdFontSize;
@@ -29610,203 +29270,737 @@
29610
29270
  * Copyright (C) 2019 Toshiba Corporation
29611
29271
  * SPDX-License-Identifier: Apache-2.0
29612
29272
  */
29613
- var toTextStyle = function (theme, options, state) {
29614
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
29615
- var style = (_a = options === null || options === void 0 ? void 0 : options.text) === null || _a === void 0 ? void 0 : _a.style;
29616
- if (style != null) {
29617
- var fill = (_b = style.fill) !== null && _b !== void 0 ? _b : theme.getColor(state);
29618
- var fontSize = (_c = style.fontSize) !== null && _c !== void 0 ? _c : theme.getFontSize();
29619
- var fontFamily = (_d = style.fontFamily) !== null && _d !== void 0 ? _d : theme.getFontFamilly();
29620
- var fontWeight = (_e = style.fontWeight) !== null && _e !== void 0 ? _e : theme.getFontWeight();
29621
- var fontStyle = (_f = style.fontStyle) !== null && _f !== void 0 ? _f : theme.getFontStyle();
29622
- var fontVariant = (_g = style.fontVariant) !== null && _g !== void 0 ? _g : theme.getFontVariant();
29623
- var clipping = (_h = style.clipping) !== null && _h !== void 0 ? _h : theme.getTextStyleClipping();
29624
- var fitting = (_j = style.fitting) !== null && _j !== void 0 ? _j : theme.getTextStyleFitting();
29625
- var wordWrap = (_k = style.wordWrap) !== null && _k !== void 0 ? _k : theme.getTextStyleWordWrap();
29626
- var lineHeight = (_l = style.lineHeight) !== null && _l !== void 0 ? _l : theme.getLineHeight();
29627
- return {
29628
- fill: fill,
29629
- fontSize: fontSize,
29630
- fontFamily: fontFamily,
29631
- fontWeight: fontWeight,
29632
- fontStyle: fontStyle,
29633
- fontVariant: fontVariant,
29634
- clipping: clipping,
29635
- fitting: fitting,
29636
- wordWrap: wordWrap,
29637
- lineHeight: lineHeight
29638
- };
29273
+ var DDynamicTextStyle = /** @class */ (function (_super) {
29274
+ __extends(DDynamicTextStyle, _super);
29275
+ function DDynamicTextStyle(parent, theme, options) {
29276
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
29277
+ var _this = _super.call(this) || this;
29278
+ _this._id = 0;
29279
+ _this._idApproved = -1;
29280
+ if (options) {
29281
+ _this._fontFamily = (_a = options.fontFamily) !== null && _a !== void 0 ? _a : theme.getFontFamilly();
29282
+ _this._fontSize = (_b = options.fontSize) !== null && _b !== void 0 ? _b : theme.getFontSize();
29283
+ _this._fontStyle = (_c = options.fontStyle) !== null && _c !== void 0 ? _c : theme.getFontStyle();
29284
+ _this._fontVariant = (_d = options.fontVariant) !== null && _d !== void 0 ? _d : theme.getFontVariant();
29285
+ _this._fontWeight = (_e = options.fontWeight) !== null && _e !== void 0 ? _e : theme.getFontWeight();
29286
+ _this._clipping = (_f = options.clipping) !== null && _f !== void 0 ? _f : theme.getTextStyleClipping();
29287
+ _this._fitting = (_g = options.fitting) !== null && _g !== void 0 ? _g : theme.getTextStyleFitting();
29288
+ _this._wordWrap = toEnum((_h = options.wordWrap) !== null && _h !== void 0 ? _h : theme.getTextStyleWordWrap(), DDynamicTextStyleWordWrap);
29289
+ _this._lineHeight = (_j = options.lineHeight) !== null && _j !== void 0 ? _j : theme.getLineHeight();
29290
+ }
29291
+ else {
29292
+ _this._fontFamily = theme.getFontFamilly();
29293
+ _this._fontSize = theme.getFontSize();
29294
+ _this._fontStyle = theme.getFontStyle();
29295
+ _this._fontVariant = theme.getFontVariant();
29296
+ _this._fontWeight = theme.getFontWeight();
29297
+ _this._clipping = theme.getTextStyleClipping();
29298
+ _this._fitting = theme.getTextStyleFitting();
29299
+ _this._wordWrap = theme.getTextStyleWordWrap();
29300
+ _this._lineHeight = theme.getLineHeight();
29301
+ }
29302
+ _this._fill = theme.getColor(parent.state);
29303
+ _this._fontSizeFitted = _this._fontSize;
29304
+ _this._lineHeightFitted = _this._lineHeight;
29305
+ _this._isFontFitted = false;
29306
+ _this._fontIdFontSize = _this._fontSize;
29307
+ _this._fontIdId = -1;
29308
+ _this._fontId = "";
29309
+ _this._fontIdApproved = "";
29310
+ _this._fillApproved = 0x000000;
29311
+ return _this;
29639
29312
  }
29640
- return {
29641
- fill: theme.getColor(state),
29642
- fontSize: theme.getFontSize(),
29643
- fontFamily: theme.getFontFamilly(),
29644
- fontWeight: theme.getFontWeight(),
29645
- fontStyle: theme.getFontStyle(),
29646
- fontVariant: theme.getFontVariant(),
29647
- clipping: theme.getTextStyleClipping(),
29648
- fitting: theme.getTextStyleFitting(),
29649
- wordWrap: theme.getTextStyleWordWrap(),
29650
- lineHeight: theme.getLineHeight()
29313
+ Object.defineProperty(DDynamicTextStyle.prototype, "id", {
29314
+ get: function () {
29315
+ return this._id;
29316
+ },
29317
+ enumerable: false,
29318
+ configurable: true
29319
+ });
29320
+ Object.defineProperty(DDynamicTextStyle.prototype, "idApproved", {
29321
+ get: function () {
29322
+ return this._idApproved;
29323
+ },
29324
+ enumerable: false,
29325
+ configurable: true
29326
+ });
29327
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontId", {
29328
+ get: function () {
29329
+ this.update();
29330
+ return this._fontId;
29331
+ },
29332
+ enumerable: false,
29333
+ configurable: true
29334
+ });
29335
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontIdFontSize", {
29336
+ get: function () {
29337
+ this.update();
29338
+ return this._fontSizeFitted;
29339
+ },
29340
+ enumerable: false,
29341
+ configurable: true
29342
+ });
29343
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontIdApproved", {
29344
+ get: function () {
29345
+ return this._fontIdApproved;
29346
+ },
29347
+ enumerable: false,
29348
+ configurable: true
29349
+ });
29350
+ Object.defineProperty(DDynamicTextStyle.prototype, "fill", {
29351
+ get: function () {
29352
+ return this._fill;
29353
+ },
29354
+ set: function (fill) {
29355
+ if (this._fill !== fill) {
29356
+ this._fill = fill;
29357
+ this.onChange();
29358
+ }
29359
+ },
29360
+ enumerable: false,
29361
+ configurable: true
29362
+ });
29363
+ DDynamicTextStyle.prototype.onChange = function () {
29364
+ this._id += 1;
29365
+ this.emit("change", this);
29651
29366
  };
29652
- };
29653
- var toTextAlign = function (theme, options) {
29654
- var _a, _b, _c;
29655
- var align = (_a = options === null || options === void 0 ? void 0 : options.text) === null || _a === void 0 ? void 0 : _a.align;
29656
- return {
29657
- vertical: toEnum((_b = align === null || align === void 0 ? void 0 : align.vertical) !== null && _b !== void 0 ? _b : theme.getTextAlignVertical(), DAlignVertical),
29658
- horizontal: toEnum((_c = align === null || align === void 0 ? void 0 : align.horizontal) !== null && _c !== void 0 ? _c : theme.getTextAlignHorizontal(), DAlignHorizontal)
29367
+ Object.defineProperty(DDynamicTextStyle.prototype, "fillApproved", {
29368
+ get: function () {
29369
+ return this._fillApproved;
29370
+ },
29371
+ enumerable: false,
29372
+ configurable: true
29373
+ });
29374
+ DDynamicTextStyle.prototype.approve = function () {
29375
+ this.update();
29376
+ this._idApproved = this._id;
29377
+ this._fontIdApproved = this._fontId;
29378
+ this._fillApproved = this._fill;
29659
29379
  };
29660
- };
29661
- /**
29662
- * A base class for UI classes with a text support.
29663
- * See {@link DTextBaseEvents} for event defaults.
29664
- */
29665
- var DTextBase = /** @class */ (function (_super) {
29666
- __extends(DTextBase, _super);
29667
- function DTextBase() {
29668
- return _super !== null && _super.apply(this, arguments) || this;
29669
- }
29670
- DTextBase.prototype.init = function (options) {
29671
- var _a, _b, _c, _d;
29672
- _super.prototype.init.call(this, options);
29673
- var theme = this.theme;
29674
- this._textValue = (_b = (_a = options === null || options === void 0 ? void 0 : options.text) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : theme.newTextValue();
29675
- this._textValueComputed = this.computeTextValue();
29676
- var text = options === null || options === void 0 ? void 0 : options.text;
29677
- this._textColor = text === null || text === void 0 ? void 0 : text.color;
29678
- this._textAlpha = text === null || text === void 0 ? void 0 : text.alpha;
29679
- this._textStyle = toTextStyle(theme, options, this.state);
29680
- this._textAlign = toTextAlign(theme, options);
29681
- this._textFormatter = (_c = text === null || text === void 0 ? void 0 : text.formatter) !== null && _c !== void 0 ? _c : theme.getTextFormatter();
29682
- this._isTextVisible = true;
29683
- this._isOverflowMaskEnabled = (_d = options === null || options === void 0 ? void 0 : options.mask) !== null && _d !== void 0 ? _d : theme.isOverflowMaskEnabled();
29684
- this.onTextChange();
29685
- this.createOrUpdateText();
29380
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontFamily", {
29381
+ get: function () {
29382
+ return this._fontFamily;
29383
+ },
29384
+ set: function (fontFamily) {
29385
+ if (this._fontFamily !== fontFamily) {
29386
+ this._fontFamily = fontFamily;
29387
+ this.onChange();
29388
+ }
29389
+ },
29390
+ enumerable: false,
29391
+ configurable: true
29392
+ });
29393
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontSize", {
29394
+ get: function () {
29395
+ return this._fontSize;
29396
+ },
29397
+ set: function (fontSize) {
29398
+ if (this._fontSize !== fontSize) {
29399
+ this._fontSize = fontSize;
29400
+ this._fontSizeFitted = fontSize;
29401
+ this._lineHeightFitted = this._lineHeight;
29402
+ this._isFontFitted = false;
29403
+ this.onChange();
29404
+ }
29405
+ },
29406
+ enumerable: false,
29407
+ configurable: true
29408
+ });
29409
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontSizeFitted", {
29410
+ get: function () {
29411
+ return this._fontSizeFitted;
29412
+ },
29413
+ enumerable: false,
29414
+ configurable: true
29415
+ });
29416
+ Object.defineProperty(DDynamicTextStyle.prototype, "isFontFitted", {
29417
+ get: function () {
29418
+ return this._isFontFitted;
29419
+ },
29420
+ enumerable: false,
29421
+ configurable: true
29422
+ });
29423
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontStyle", {
29424
+ get: function () {
29425
+ return this._fontStyle;
29426
+ },
29427
+ set: function (fontStyle) {
29428
+ if (this._fontStyle !== fontStyle) {
29429
+ this._fontStyle = fontStyle;
29430
+ this.onChange();
29431
+ }
29432
+ },
29433
+ enumerable: false,
29434
+ configurable: true
29435
+ });
29436
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontVariant", {
29437
+ get: function () {
29438
+ return this._fontVariant;
29439
+ },
29440
+ set: function (fontVariant) {
29441
+ if (this._fontVariant !== fontVariant) {
29442
+ this._fontVariant = fontVariant;
29443
+ this.onChange();
29444
+ }
29445
+ },
29446
+ enumerable: false,
29447
+ configurable: true
29448
+ });
29449
+ Object.defineProperty(DDynamicTextStyle.prototype, "fontWeight", {
29450
+ get: function () {
29451
+ return this._fontWeight;
29452
+ },
29453
+ set: function (fontWeight) {
29454
+ if (this._fontWeight !== fontWeight) {
29455
+ this._fontWeight = fontWeight;
29456
+ this.onChange();
29457
+ }
29458
+ },
29459
+ enumerable: false,
29460
+ configurable: true
29461
+ });
29462
+ DDynamicTextStyle.prototype.update = function () {
29463
+ if (this._fontIdId !== this._id) {
29464
+ this._fontIdId = this._id;
29465
+ var fontIdFontSize = this._fitting ? this._fontSizeFitted : this._fontSize;
29466
+ this._fontIdFontSize = fontIdFontSize;
29467
+ this._fontId = this.toFontId(fontIdFontSize);
29468
+ }
29686
29469
  };
29687
- Object.defineProperty(DTextBase.prototype, "text", {
29470
+ DDynamicTextStyle.prototype.toFontId = function (fontSize) {
29471
+ return "".concat(this._fontStyle, " ").concat(this._fontVariant, " ").concat(this._fontWeight, " ").concat(fontSize, "px ").concat(this._fontFamily);
29472
+ };
29473
+ Object.defineProperty(DDynamicTextStyle.prototype, "clipping", {
29688
29474
  get: function () {
29689
- return this._textValue;
29475
+ return this._clipping;
29690
29476
  },
29691
- set: function (text) {
29692
- if (this._textValue !== text) {
29693
- this._textValue = text;
29694
- this.updateTextValue();
29477
+ set: function (clipping) {
29478
+ if (this._clipping !== clipping) {
29479
+ this._clipping = clipping;
29480
+ this.onChange();
29695
29481
  }
29696
29482
  },
29697
29483
  enumerable: false,
29698
29484
  configurable: true
29699
29485
  });
29700
- DTextBase.prototype.onTextChange = function () {
29701
- // DO NOTHING
29486
+ Object.defineProperty(DDynamicTextStyle.prototype, "fitting", {
29487
+ get: function () {
29488
+ return this._fitting;
29489
+ },
29490
+ set: function (fitting) {
29491
+ if (this._fitting !== fitting) {
29492
+ this._fitting = fitting;
29493
+ this.onChange();
29494
+ }
29495
+ },
29496
+ enumerable: false,
29497
+ configurable: true
29498
+ });
29499
+ Object.defineProperty(DDynamicTextStyle.prototype, "wordWrap", {
29500
+ get: function () {
29501
+ return this._wordWrap;
29502
+ },
29503
+ set: function (wordWrap) {
29504
+ if (this._wordWrap !== wordWrap) {
29505
+ this._wordWrap = wordWrap;
29506
+ this.onChange();
29507
+ }
29508
+ },
29509
+ enumerable: false,
29510
+ configurable: true
29511
+ });
29512
+ Object.defineProperty(DDynamicTextStyle.prototype, "lineHeight", {
29513
+ get: function () {
29514
+ return this._lineHeight;
29515
+ },
29516
+ set: function (lineHeight) {
29517
+ if (this._lineHeight !== lineHeight) {
29518
+ this._lineHeight = lineHeight;
29519
+ this._fontSizeFitted = this._fontSize;
29520
+ this._lineHeightFitted = lineHeight;
29521
+ this._isFontFitted = false;
29522
+ this.onChange();
29523
+ }
29524
+ },
29525
+ enumerable: false,
29526
+ configurable: true
29527
+ });
29528
+ Object.defineProperty(DDynamicTextStyle.prototype, "lineHeightFitted", {
29529
+ get: function () {
29530
+ return this._lineHeightFitted;
29531
+ },
29532
+ set: function (lineHeightFitted) {
29533
+ if (this._lineHeightFitted !== lineHeightFitted) {
29534
+ this._lineHeightFitted = lineHeightFitted;
29535
+ this.onChange();
29536
+ }
29537
+ },
29538
+ enumerable: false,
29539
+ configurable: true
29540
+ });
29541
+ DDynamicTextStyle.prototype.fit = function (fontSize, lineHeight) {
29542
+ var isChanged = false;
29543
+ if (fontSize < this._fontSizeFitted) {
29544
+ this._fontSizeFitted = fontSize;
29545
+ isChanged = true;
29546
+ }
29547
+ if (this._lineHeightFitted !== lineHeight) {
29548
+ this._lineHeightFitted = lineHeight;
29549
+ isChanged = true;
29550
+ }
29551
+ if (this._isFontFitted !== true) {
29552
+ this._isFontFitted = true;
29553
+ isChanged = true;
29554
+ }
29555
+ if (isChanged) {
29556
+ this.onChange();
29557
+ }
29558
+ return isChanged;
29702
29559
  };
29703
- DTextBase.prototype.computeTextValue = function () {
29704
- var textValue = this._textValue;
29705
- if (textValue !== undefined) {
29706
- if (isFunction(textValue)) {
29707
- var result = textValue(this.state);
29708
- if (result !== undefined) {
29709
- return result;
29710
- }
29560
+ DDynamicTextStyle.prototype.unfit = function () {
29561
+ var isChanged = false;
29562
+ if (this._isFontFitted !== false) {
29563
+ this._isFontFitted = false;
29564
+ isChanged = true;
29565
+ }
29566
+ if (this._fontSizeFitted !== this._fontSize) {
29567
+ this._fontSizeFitted = this._fontSize;
29568
+ isChanged = true;
29569
+ }
29570
+ if (this._lineHeightFitted !== this._lineHeight) {
29571
+ this._lineHeightFitted = this._lineHeight;
29572
+ isChanged = true;
29573
+ }
29574
+ if (isChanged) {
29575
+ this.onChange();
29576
+ }
29577
+ return isChanged;
29578
+ };
29579
+ return DDynamicTextStyle;
29580
+ }(pixi_js.utils.EventEmitter));
29581
+
29582
+ var DTextPieceAlignImpl = /** @class */ (function () {
29583
+ function DTextPieceAlignImpl(parent, theme, options) {
29584
+ var _a, _b;
29585
+ this._parent = parent;
29586
+ this._vertical = toEnum((_a = options === null || options === void 0 ? void 0 : options.vertical) !== null && _a !== void 0 ? _a : theme.getTextAlignVertical(), DAlignVertical);
29587
+ this._horizontal = toEnum((_b = options === null || options === void 0 ? void 0 : options.horizontal) !== null && _b !== void 0 ? _b : theme.getTextAlignHorizontal(), DAlignHorizontal);
29588
+ }
29589
+ Object.defineProperty(DTextPieceAlignImpl.prototype, "vertical", {
29590
+ get: function () {
29591
+ return this._vertical;
29592
+ },
29593
+ set: function (vertical) {
29594
+ vertical = toEnum(vertical, DAlignVertical);
29595
+ if (this._vertical !== vertical) {
29596
+ this._vertical = vertical;
29597
+ this.onChange();
29711
29598
  }
29712
- else {
29713
- return textValue;
29599
+ },
29600
+ enumerable: false,
29601
+ configurable: true
29602
+ });
29603
+ Object.defineProperty(DTextPieceAlignImpl.prototype, "horizontal", {
29604
+ get: function () {
29605
+ return this._horizontal;
29606
+ },
29607
+ set: function (horizontal) {
29608
+ horizontal = toEnum(horizontal, DAlignHorizontal);
29609
+ if (this._horizontal !== horizontal) {
29610
+ this._horizontal = horizontal;
29611
+ this.onChange();
29612
+ }
29613
+ },
29614
+ enumerable: false,
29615
+ configurable: true
29616
+ });
29617
+ DTextPieceAlignImpl.prototype.set = function (vertical, horizontal) {
29618
+ var isChanged = false;
29619
+ if (vertical != null) {
29620
+ vertical = toEnum(vertical, DAlignVertical);
29621
+ if (this._vertical !== vertical) {
29622
+ this._vertical = vertical;
29623
+ isChanged = true;
29714
29624
  }
29715
29625
  }
29716
- return this.theme.getTextValue(this.state);
29626
+ if (horizontal != null) {
29627
+ horizontal = toEnum(horizontal, DAlignHorizontal);
29628
+ if (this._horizontal !== horizontal) {
29629
+ this._horizontal = horizontal;
29630
+ isChanged = true;
29631
+ }
29632
+ }
29633
+ if (isChanged) {
29634
+ this.onChange();
29635
+ }
29636
+ return this;
29717
29637
  };
29718
- DTextBase.prototype.createOrUpdateText = function () {
29719
- var textValueComputed = this._textValueComputed;
29720
- if (textValueComputed !== undefined) {
29721
- var formatted = this._textFormatter(textValueComputed, this);
29722
- var text = this._text;
29723
- if (text == null) {
29724
- if (0 < formatted.length) {
29725
- var newText = this.newText();
29726
- newText.visible = this._isTextVisible;
29727
- this._text = newText;
29728
- this.addChild(newText);
29729
- this.updateTextPosition(newText);
29730
- var overflowMask = this.getOverflowMask();
29731
- if (overflowMask) {
29732
- newText.mask = overflowMask;
29733
- }
29734
- newText.text = formatted;
29735
- this.toDirty();
29736
- DApplications.update(this);
29737
- }
29638
+ DTextPieceAlignImpl.prototype.onChange = function () {
29639
+ var parent = this._parent;
29640
+ parent.toDirty();
29641
+ DApplications.update(parent);
29642
+ };
29643
+ return DTextPieceAlignImpl;
29644
+ }());
29645
+
29646
+ /*
29647
+ * Copyright (C) 2019 Toshiba Corporation
29648
+ * SPDX-License-Identifier: Apache-2.0
29649
+ */
29650
+ var DTextPieceStyleImpl = /** @class */ (function () {
29651
+ function DTextPieceStyleImpl(parent, style) {
29652
+ this._parent = parent;
29653
+ this._style = style;
29654
+ }
29655
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fontFamily", {
29656
+ get: function () {
29657
+ return this._style.fontFamily;
29658
+ },
29659
+ set: function (fontFamily) {
29660
+ var style = this._style;
29661
+ if (style.fontFamily !== fontFamily) {
29662
+ style.fontFamily = fontFamily;
29663
+ this.onChange();
29738
29664
  }
29739
- else if (text.text !== formatted) {
29740
- text.text = formatted;
29741
- this.toDirty();
29742
- DApplications.update(this);
29665
+ },
29666
+ enumerable: false,
29667
+ configurable: true
29668
+ });
29669
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fontSize", {
29670
+ get: function () {
29671
+ return this._style.fontSize;
29672
+ },
29673
+ set: function (fontSize) {
29674
+ var style = this._style;
29675
+ if (style.fontSize !== fontSize) {
29676
+ style.fontSize = fontSize;
29677
+ this.onChange();
29678
+ }
29679
+ },
29680
+ enumerable: false,
29681
+ configurable: true
29682
+ });
29683
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fontStyle", {
29684
+ get: function () {
29685
+ return this._style.fontStyle;
29686
+ },
29687
+ set: function (fontStyle) {
29688
+ var style = this._style;
29689
+ if (style.fontStyle !== fontStyle) {
29690
+ style.fontStyle = fontStyle;
29691
+ this.onChange();
29743
29692
  }
29693
+ },
29694
+ enumerable: false,
29695
+ configurable: true
29696
+ });
29697
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fontVariant", {
29698
+ get: function () {
29699
+ return this._style.fontVariant;
29700
+ },
29701
+ set: function (fontVariant) {
29702
+ var style = this._style;
29703
+ if (style.fontVariant !== fontVariant) {
29704
+ style.fontVariant = fontVariant;
29705
+ this.onChange();
29706
+ }
29707
+ },
29708
+ enumerable: false,
29709
+ configurable: true
29710
+ });
29711
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fontWeight", {
29712
+ get: function () {
29713
+ return this._style.fontWeight;
29714
+ },
29715
+ set: function (fontWeight) {
29716
+ var style = this._style;
29717
+ if (style.fontWeight !== fontWeight) {
29718
+ style.fontWeight = fontWeight;
29719
+ this.onChange();
29720
+ }
29721
+ },
29722
+ enumerable: false,
29723
+ configurable: true
29724
+ });
29725
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "clipping", {
29726
+ get: function () {
29727
+ return this._style.clipping;
29728
+ },
29729
+ set: function (clipping) {
29730
+ var style = this._style;
29731
+ if (style.clipping !== clipping) {
29732
+ style.clipping = clipping;
29733
+ this.onChange();
29734
+ }
29735
+ },
29736
+ enumerable: false,
29737
+ configurable: true
29738
+ });
29739
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "fitting", {
29740
+ get: function () {
29741
+ return this._style.fitting;
29742
+ },
29743
+ set: function (fitting) {
29744
+ var style = this._style;
29745
+ if (style.fitting !== fitting) {
29746
+ style.fitting = fitting;
29747
+ this.onChange();
29748
+ }
29749
+ },
29750
+ enumerable: false,
29751
+ configurable: true
29752
+ });
29753
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "wordWrap", {
29754
+ get: function () {
29755
+ return this._style.wordWrap;
29756
+ },
29757
+ set: function (wordWrap) {
29758
+ wordWrap = toEnum(wordWrap, DDynamicTextStyleWordWrap);
29759
+ var style = this._style;
29760
+ if (style.wordWrap !== wordWrap) {
29761
+ style.wordWrap = wordWrap;
29762
+ this.onChange();
29763
+ }
29764
+ },
29765
+ enumerable: false,
29766
+ configurable: true
29767
+ });
29768
+ Object.defineProperty(DTextPieceStyleImpl.prototype, "lineHeight", {
29769
+ get: function () {
29770
+ return this._style.lineHeight;
29771
+ },
29772
+ set: function (lineHeight) {
29773
+ var style = this._style;
29774
+ if (style.lineHeight !== lineHeight) {
29775
+ style.lineHeight = lineHeight;
29776
+ this.onChange();
29777
+ }
29778
+ },
29779
+ enumerable: false,
29780
+ configurable: true
29781
+ });
29782
+ DTextPieceStyleImpl.prototype.onChange = function () {
29783
+ DApplications.update(this._parent);
29784
+ };
29785
+ return DTextPieceStyleImpl;
29786
+ }());
29787
+
29788
+ var DTextPieceImpl = /** @class */ (function (_super) {
29789
+ __extends(DTextPieceImpl, _super);
29790
+ function DTextPieceImpl(parent, theme, options) {
29791
+ var _a, _b;
29792
+ var _this = _super.call(this) || this;
29793
+ _this._parent = parent;
29794
+ _this._theme = theme;
29795
+ _this._value = (_a = options === null || options === void 0 ? void 0 : options.value) !== null && _a !== void 0 ? _a : theme.newTextValue();
29796
+ _this._computed = _this.newComputed();
29797
+ _this._color = options === null || options === void 0 ? void 0 : options.color;
29798
+ _this._alpha = options === null || options === void 0 ? void 0 : options.alpha;
29799
+ var dstyle = new DDynamicTextStyle(parent, theme, options === null || options === void 0 ? void 0 : options.style);
29800
+ _this._dstyle = dstyle;
29801
+ _this._style = new DTextPieceStyleImpl(parent, dstyle);
29802
+ _this._align = new DTextPieceAlignImpl(parent, theme, options === null || options === void 0 ? void 0 : options.align);
29803
+ _this._formatter = (_b = options === null || options === void 0 ? void 0 : options.formatter) !== null && _b !== void 0 ? _b : theme.getTextFormatter();
29804
+ _this._isVisible = true;
29805
+ _this.onComputedChange();
29806
+ if (_this.updateObject()) {
29807
+ parent.toDirty();
29808
+ DApplications.update(parent);
29744
29809
  }
29745
- else {
29746
- var text = this._text;
29747
- if (text != null && text.text !== "") {
29748
- text.text = "";
29749
- this.toDirty();
29750
- DApplications.update(this);
29810
+ return _this;
29811
+ }
29812
+ Object.defineProperty(DTextPieceImpl.prototype, "value", {
29813
+ get: function () {
29814
+ return this._value;
29815
+ },
29816
+ set: function (value) {
29817
+ if (this._value !== value) {
29818
+ this._value = value;
29819
+ this.onValueChange();
29751
29820
  }
29821
+ },
29822
+ enumerable: false,
29823
+ configurable: true
29824
+ });
29825
+ DTextPieceImpl.prototype.getValue = function () {
29826
+ return this._value;
29827
+ };
29828
+ DTextPieceImpl.prototype.setValue = function (value, forcibly) {
29829
+ if (forcibly || this._value !== value) {
29830
+ this._value = value;
29831
+ this.onValueChange(forcibly);
29752
29832
  }
29753
29833
  };
29754
- DTextBase.prototype.newText = function () {
29755
- return new DDynamicText(this._textStyle);
29834
+ DTextPieceImpl.prototype.onValueChange = function (forcibly) {
29835
+ var newComputed = this.newComputed();
29836
+ if (forcibly || this._computed !== newComputed) {
29837
+ this._computed = newComputed;
29838
+ this.onComputedChange();
29839
+ if (this.updateObject()) {
29840
+ var parent_1 = this._parent;
29841
+ parent_1.toDirty();
29842
+ DApplications.update(parent_1);
29843
+ }
29844
+ }
29756
29845
  };
29757
- DTextBase.prototype.getOverflowMask = function () {
29758
- if (this._isOverflowMaskEnabled) {
29759
- if (this._overflowMask == null) {
29760
- this._overflowMask = new DBaseOverflowMaskSimple(this);
29761
- this._reflowable.add(this._overflowMask);
29762
- this.toDirty();
29846
+ DTextPieceImpl.prototype.compute = function (forcibly) {
29847
+ this.onValueChange(forcibly);
29848
+ };
29849
+ Object.defineProperty(DTextPieceImpl.prototype, "computed", {
29850
+ get: function () {
29851
+ return this._computed;
29852
+ },
29853
+ enumerable: false,
29854
+ configurable: true
29855
+ });
29856
+ Object.defineProperty(DTextPieceImpl.prototype, "formatter", {
29857
+ get: function () {
29858
+ return this._formatter;
29859
+ },
29860
+ set: function (formatter) {
29861
+ if (this._formatter !== formatter) {
29862
+ this._formatter = formatter;
29863
+ this.onValueChange(true);
29864
+ }
29865
+ },
29866
+ enumerable: false,
29867
+ configurable: true
29868
+ });
29869
+ Object.defineProperty(DTextPieceImpl.prototype, "color", {
29870
+ get: function () {
29871
+ return this._color;
29872
+ },
29873
+ set: function (color) {
29874
+ if (this._color !== color) {
29875
+ this._color = color;
29876
+ this.onColorChange();
29877
+ }
29878
+ },
29879
+ enumerable: false,
29880
+ configurable: true
29881
+ });
29882
+ Object.defineProperty(DTextPieceImpl.prototype, "alpha", {
29883
+ get: function () {
29884
+ return this._alpha;
29885
+ },
29886
+ set: function (alpha) {
29887
+ if (this._alpha !== alpha) {
29888
+ this._alpha = alpha;
29889
+ this.onColorChange();
29890
+ }
29891
+ },
29892
+ enumerable: false,
29893
+ configurable: true
29894
+ });
29895
+ DTextPieceImpl.prototype.onColorChange = function () {
29896
+ var object = this._object;
29897
+ if (object != null) {
29898
+ var parent_2 = this._parent;
29899
+ var state = parent_2.state;
29900
+ var color = this.newColor(state);
29901
+ var alpha = this.newAlpha(state);
29902
+ var style = object.style;
29903
+ if (style.fill !== color || object.alpha !== alpha) {
29904
+ style.fill = color;
29905
+ object.alpha = alpha;
29906
+ DApplications.update(parent_2);
29763
29907
  }
29764
- return this._overflowMask;
29765
29908
  }
29766
- return null;
29767
29909
  };
29768
- DTextBase.prototype.updateTextPosition = function (text) {
29769
- var align = this._textAlign;
29770
- var padding = this._padding;
29771
- var auto = this._auto;
29772
- var textX = 0;
29773
- var pleft = padding.getLeft();
29774
- var alignHorizontal = align.horizontal;
29775
- if (auto.width.isOn || alignHorizontal === DAlignHorizontal.LEFT) {
29776
- textX = pleft;
29910
+ Object.defineProperty(DTextPieceImpl.prototype, "align", {
29911
+ get: function () {
29912
+ return this._align;
29913
+ },
29914
+ enumerable: false,
29915
+ configurable: true
29916
+ });
29917
+ Object.defineProperty(DTextPieceImpl.prototype, "style", {
29918
+ get: function () {
29919
+ return this._style;
29920
+ },
29921
+ enumerable: false,
29922
+ configurable: true
29923
+ });
29924
+ Object.defineProperty(DTextPieceImpl.prototype, "object", {
29925
+ get: function () {
29926
+ return this._object;
29927
+ },
29928
+ enumerable: false,
29929
+ configurable: true
29930
+ });
29931
+ DTextPieceImpl.prototype.update = function (layouter) {
29932
+ // Compute a value
29933
+ var newComputed = this.newComputed();
29934
+ if (this._computed !== newComputed) {
29935
+ this._computed = newComputed;
29936
+ this.onComputedChange();
29937
+ this.updateObject();
29938
+ }
29939
+ var object = this._object;
29940
+ if (object != null) {
29941
+ // Update the color
29942
+ var state = this._parent.state;
29943
+ object.style.fill = this.newColor(state);
29944
+ object.alpha = this.newAlpha(state);
29945
+ // Layout
29946
+ layouter.set(object);
29777
29947
  }
29778
29948
  else {
29779
- var width = this.width;
29780
- var textWidth = text.width;
29781
- var pright = padding.getRight();
29782
- if (alignHorizontal === DAlignHorizontal.CENTER) {
29783
- textX = pleft + (width - pleft - pright - textWidth) * 0.5;
29949
+ // Layout
29950
+ layouter.set(null);
29951
+ }
29952
+ };
29953
+ DTextPieceImpl.prototype.updateObject = function () {
29954
+ var computed = this._computed;
29955
+ if (computed !== undefined) {
29956
+ var formatted = this._formatter(computed, this);
29957
+ var object = this._object;
29958
+ if (object == null) {
29959
+ if (0 < formatted.length) {
29960
+ var newObject = this.newObject();
29961
+ newObject.visible = this._isVisible;
29962
+ this._object = newObject;
29963
+ var parent_3 = this._parent;
29964
+ parent_3.addChild(newObject);
29965
+ var overflowMask = parent_3.getOverflowMask();
29966
+ if (overflowMask) {
29967
+ newObject.mask = overflowMask;
29968
+ }
29969
+ newObject.text = formatted;
29970
+ return true;
29971
+ }
29784
29972
  }
29785
- else {
29786
- textX = width - textWidth - pright;
29973
+ else if (object.text !== formatted) {
29974
+ object.text = formatted;
29975
+ return true;
29787
29976
  }
29788
29977
  }
29789
- var textY = 0;
29790
- var ptop = padding.getTop();
29791
- var alignVertical = align.vertical;
29792
- if (auto.height.isOn || alignVertical === DAlignVertical.TOP) {
29793
- textY = ptop;
29794
- }
29795
29978
  else {
29796
- var height = this.height;
29797
- var textHeight = text.height;
29798
- var pbottom = padding.getBottom();
29799
- if (alignVertical === DAlignVertical.MIDDLE) {
29800
- textY = ptop + (height - ptop - pbottom - textHeight) * 0.5;
29979
+ var object = this._object;
29980
+ if (object != null && object.text !== "") {
29981
+ object.text = "";
29982
+ return true;
29983
+ }
29984
+ }
29985
+ return false;
29986
+ };
29987
+ DTextPieceImpl.prototype.newComputed = function () {
29988
+ var value = this._value;
29989
+ if (value !== undefined) {
29990
+ if (isFunction(value)) {
29991
+ var result = value(this._parent.state);
29992
+ if (result !== undefined) {
29993
+ return result;
29994
+ }
29801
29995
  }
29802
29996
  else {
29803
- textY = height - textHeight - pbottom;
29997
+ return value;
29804
29998
  }
29805
29999
  }
29806
- text.position.set(textX, textY);
30000
+ return this._theme.getTextValue(this._parent.state);
29807
30001
  };
29808
- DTextBase.prototype.getTextColor = function (theme, state) {
29809
- var color = this._textColor;
30002
+ DTextPieceImpl.prototype.newColor = function (state) {
30003
+ var color = this._color;
29810
30004
  if (color !== undefined) {
29811
30005
  if (isFunction(color)) {
29812
30006
  var result = color(state);
@@ -29818,10 +30012,10 @@
29818
30012
  return color;
29819
30013
  }
29820
30014
  }
29821
- return theme.getColor(state);
30015
+ return this._theme.getColor(state);
29822
30016
  };
29823
- DTextBase.prototype.getTextAlpha = function (theme, state) {
29824
- var alpha = this._textAlpha;
30017
+ DTextPieceImpl.prototype.newAlpha = function (state) {
30018
+ var alpha = this._alpha;
29825
30019
  if (alpha !== undefined) {
29826
30020
  if (isFunction(alpha)) {
29827
30021
  var result = alpha(state);
@@ -29833,57 +30027,144 @@
29833
30027
  return alpha;
29834
30028
  }
29835
30029
  }
29836
- return theme.getAlpha(state);
30030
+ return this._theme.getAlpha(state);
29837
30031
  };
29838
- DTextBase.prototype.updateTextColor = function (text) {
29839
- var theme = this.theme;
29840
- var state = this.state;
29841
- text.style.fill = this.getTextColor(theme, state);
29842
- text.alpha = this.getTextAlpha(theme, state);
30032
+ DTextPieceImpl.prototype.newObject = function () {
30033
+ return new DDynamicText(this._dstyle);
29843
30034
  };
29844
- DTextBase.prototype.updateTextValue = function () {
29845
- var newTextValueComputed = this.computeTextValue();
29846
- if (this._textValueComputed !== newTextValueComputed) {
29847
- this._textValueComputed = newTextValueComputed;
29848
- this.onTextChange();
29849
- this.createOrUpdateText();
29850
- }
30035
+ Object.defineProperty(DTextPieceImpl.prototype, "visible", {
30036
+ get: function () {
30037
+ var object = this._object;
30038
+ if (object != null) {
30039
+ return object.visible;
30040
+ }
30041
+ return this._isVisible;
30042
+ },
30043
+ set: function (visible) {
30044
+ var object = this._object;
30045
+ if (object != null) {
30046
+ object.visible = visible;
30047
+ }
30048
+ this._isVisible = visible;
30049
+ },
30050
+ enumerable: false,
30051
+ configurable: true
30052
+ });
30053
+ DTextPieceImpl.prototype.show = function () {
30054
+ this.visible = true;
30055
+ return this;
29851
30056
  };
29852
- DTextBase.prototype.updateText = function () {
29853
- var text = this._text;
29854
- if (text) {
29855
- this.updateTextValue();
29856
- this.updateTextPosition(text);
29857
- this.updateTextColor(text);
30057
+ DTextPieceImpl.prototype.hide = function () {
30058
+ this.visible = false;
30059
+ return this;
30060
+ };
30061
+ DTextPieceImpl.prototype.isShown = function () {
30062
+ return this.visible;
30063
+ };
30064
+ DTextPieceImpl.prototype.onComputedChange = function () {
30065
+ this.emit("change", this);
30066
+ };
30067
+ DTextPieceImpl.prototype.destroy = function () {
30068
+ var object = this._object;
30069
+ if (object) {
30070
+ this._object = undefined;
30071
+ object.destroy();
29858
30072
  }
30073
+ return this;
29859
30074
  };
29860
- DTextBase.prototype.showText = function () {
29861
- var text = this._text;
29862
- if (text) {
29863
- text.visible = true;
30075
+ return DTextPieceImpl;
30076
+ }(pixi_js.utils.EventEmitter));
30077
+
30078
+ /*
30079
+ * Copyright (C) 2019 Toshiba Corporation
30080
+ * SPDX-License-Identifier: Apache-2.0
30081
+ */
30082
+ /**
30083
+ * A base class for UI classes with a text support.
30084
+ * See {@link DTextBaseEvents} for event defaults.
30085
+ */
30086
+ var DTextBase = /** @class */ (function (_super) {
30087
+ __extends(DTextBase, _super);
30088
+ function DTextBase() {
30089
+ return _super !== null && _super.apply(this, arguments) || this;
30090
+ }
30091
+ DTextBase.prototype.init = function (options) {
30092
+ _super.prototype.init.call(this, options);
30093
+ this.getText();
30094
+ };
30095
+ DTextBase.prototype.getOverflowMask = function () {
30096
+ var result = this._overflowMask;
30097
+ if (result === undefined) {
30098
+ result = this.newOverflowMask();
30099
+ this._overflowMask = result;
29864
30100
  }
29865
- this._isTextVisible = true;
30101
+ return null;
29866
30102
  };
29867
- DTextBase.prototype.hideText = function () {
29868
- var text = this._text;
29869
- if (text) {
29870
- text.visible = false;
30103
+ DTextBase.prototype.newOverflowMask = function () {
30104
+ var _a, _b;
30105
+ if ((_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.mask) !== null && _b !== void 0 ? _b : this.theme.isOverflowMaskEnabled()) {
30106
+ var result = new DBaseOverflowMaskSimple(this);
30107
+ this._reflowable.add(result);
30108
+ this.toDirty();
30109
+ return result;
30110
+ }
30111
+ else {
30112
+ return null;
29871
30113
  }
29872
- this._isTextVisible = false;
30114
+ };
30115
+ Object.defineProperty(DTextBase.prototype, "text", {
30116
+ get: function () {
30117
+ var _a;
30118
+ return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = this.newText()));
30119
+ },
30120
+ set: function (text) {
30121
+ this.text.value = text;
30122
+ },
30123
+ enumerable: false,
30124
+ configurable: true
30125
+ });
30126
+ DTextBase.prototype.getText = function () {
30127
+ var _a;
30128
+ return ((_a = this._text) !== null && _a !== void 0 ? _a : (this._text = this.newText()));
30129
+ };
30130
+ DTextBase.prototype.newText = function () {
30131
+ var _a;
30132
+ return new DTextPieceImpl(this, this.theme, (_a = this._options) === null || _a === void 0 ? void 0 : _a.text);
29873
30133
  };
29874
30134
  DTextBase.prototype.onReflow = function () {
29875
30135
  _super.prototype.onReflow.call(this);
29876
- this.updateText();
30136
+ this.onReflowTextAndImage();
30137
+ };
30138
+ DTextBase.prototype.getLayouter = function () {
30139
+ var _a;
30140
+ return ((_a = DTextBase.LAYOUTER) !== null && _a !== void 0 ? _a : (DTextBase.LAYOUTER = new DImagePieceLayouter()));
30141
+ };
30142
+ DTextBase.prototype.onReflowTextAndImage = function () {
30143
+ var layouter = this.getLayouter();
30144
+ var text = this.getText();
30145
+ text.update(layouter);
30146
+ var auto = this._auto;
30147
+ layouter.execute(this._padding, text.align, auto.width.isOn ? null : this.width, auto.height.isOn ? null : this.height);
30148
+ layouter.clear();
29877
30149
  };
29878
30150
  DTextBase.prototype.isRefitable = function (target) {
29879
- return _super.prototype.isRefitable.call(this, target) || (target != null && target === this._text);
30151
+ if (_super.prototype.isRefitable.call(this, target)) {
30152
+ return true;
30153
+ }
30154
+ if (target != null) {
30155
+ var text = this._text;
30156
+ if (text != null && target === text.object) {
30157
+ return true;
30158
+ }
30159
+ }
30160
+ return false;
29880
30161
  };
29881
30162
  DTextBase.prototype.applyTitle = function () {
29882
- var text = this._text;
29883
- if (this._title.length <= 0 && text && "clipped" in text && text.clipped) {
30163
+ var object = this.text.object;
30164
+ if (this._title.length <= 0 && object != null && object.clipped) {
29884
30165
  var layer = DApplications.getLayer(this);
29885
30166
  if (layer) {
29886
- layer.view.title = text.text;
30167
+ layer.view.title = object.text;
29887
30168
  }
29888
30169
  }
29889
30170
  else {
@@ -29897,7 +30178,6 @@
29897
30178
  // Text
29898
30179
  var text = this._text;
29899
30180
  if (text) {
29900
- this._text = null;
29901
30181
  text.destroy();
29902
30182
  }
29903
30183
  // Overflow mask
@@ -30529,7 +30809,7 @@
30529
30809
  }
30530
30810
  return false;
30531
30811
  };
30532
- DImagePieceContainerImpl.prototype.updateTextAndImage = function (layouter) {
30812
+ DImagePieceContainerImpl.prototype.update = function (layouter) {
30533
30813
  var pieces = this._pieces;
30534
30814
  for (var i = 0, imax = pieces.length; i < imax; ++i) {
30535
30815
  var piece = pieces[i];
@@ -30539,6 +30819,54 @@
30539
30819
  layouter.add(piece);
30540
30820
  }
30541
30821
  };
30822
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "object", {
30823
+ get: function () {
30824
+ return this._pieces[0].object;
30825
+ },
30826
+ enumerable: false,
30827
+ configurable: true
30828
+ });
30829
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "align", {
30830
+ get: function () {
30831
+ return this._pieces[0].align;
30832
+ },
30833
+ enumerable: false,
30834
+ configurable: true
30835
+ });
30836
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "margin", {
30837
+ get: function () {
30838
+ return this._pieces[0].margin;
30839
+ },
30840
+ enumerable: false,
30841
+ configurable: true
30842
+ });
30843
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "tint", {
30844
+ get: function () {
30845
+ return this._pieces[0].tint;
30846
+ },
30847
+ enumerable: false,
30848
+ configurable: true
30849
+ });
30850
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "source", {
30851
+ get: function () {
30852
+ return this._pieces[0].source;
30853
+ },
30854
+ set: function (source) {
30855
+ this._pieces[0].source = source;
30856
+ },
30857
+ enumerable: false,
30858
+ configurable: true
30859
+ });
30860
+ Object.defineProperty(DImagePieceContainerImpl.prototype, "rotation", {
30861
+ get: function () {
30862
+ return this._pieces[0].rotation;
30863
+ },
30864
+ set: function (rotation) {
30865
+ this._pieces[0].rotation = rotation;
30866
+ },
30867
+ enumerable: false,
30868
+ configurable: true
30869
+ });
30542
30870
  DImagePieceContainerImpl.prototype.add = function (options) {
30543
30871
  var result = this.newImage(this._theme, options);
30544
30872
  this._pieces.push(result);
@@ -30613,24 +30941,13 @@
30613
30941
  _super.prototype.onStateChange.call(this, newState, oldState);
30614
30942
  this.getImage().onStateChange(newState, oldState);
30615
30943
  };
30616
- DImageBase.prototype.updateText = function () {
30617
- this.updateTextValue();
30618
- this.updateTextAndImage();
30619
- };
30620
- DImageBase.prototype.updateTextAndImage = function () {
30621
- var _a;
30622
- var layouter = ((_a = DImageBase.LAYOUTER) !== null && _a !== void 0 ? _a : (DImageBase.LAYOUTER = new DImagePieceLayouter()));
30623
- this.getImage().updateTextAndImage(layouter);
30624
- var text = this._text;
30625
- if (text != null) {
30626
- this.updateTextColor(text);
30627
- layouter.set(text);
30628
- }
30629
- else {
30630
- layouter.set(null);
30631
- }
30944
+ DImageBase.prototype.onReflowTextAndImage = function () {
30945
+ var layouter = this.getLayouter();
30946
+ this.getImage().update(layouter);
30947
+ var text = this.getText();
30948
+ text.update(layouter);
30632
30949
  var auto = this._auto;
30633
- layouter.execute(this._padding, this._textAlign, auto.width.isOn ? null : this.width, auto.height.isOn ? null : this.height);
30950
+ layouter.execute(this._padding, text.align, auto.width.isOn ? null : this.width, auto.height.isOn ? null : this.height);
30634
30951
  layouter.clear();
30635
30952
  };
30636
30953
  DImageBase.prototype.isRefitable = function (target) {
@@ -31919,16 +32236,16 @@
31919
32236
  return _this.containsPoint(point);
31920
32237
  },
31921
32238
  onStart: function () {
31922
- _this.hideText();
32239
+ _this.text.hide();
31923
32240
  },
31924
32241
  onCancel: function () {
31925
- _this.showText();
32242
+ _this.text.show();
31926
32243
  },
31927
32244
  onEnd: function () {
31928
32245
  // DO NOTHING
31929
32246
  },
31930
32247
  getValue: function () {
31931
- return _this._textValueComputed;
32248
+ return _this.text.computed;
31932
32249
  },
31933
32250
  onValueInput: function (newValue) {
31934
32251
  _this.onValueInput(newValue);
@@ -31947,7 +32264,7 @@
31947
32264
  };
31948
32265
  Object.defineProperty(DInput.prototype, "value", {
31949
32266
  get: function () {
31950
- return this._textValueComputed;
32267
+ return this.text.computed;
31951
32268
  },
31952
32269
  set: function (value) {
31953
32270
  this.text = value;
@@ -31955,9 +32272,13 @@
31955
32272
  enumerable: false,
31956
32273
  configurable: true
31957
32274
  });
31958
- DInput.prototype.onTextChange = function () {
31959
- _super.prototype.onTextChange.call(this);
31960
- this.validate();
32275
+ DInput.prototype.newText = function () {
32276
+ var _this = this;
32277
+ var result = _super.prototype.newText.call(this);
32278
+ result.on("change", function () {
32279
+ _this.validate();
32280
+ });
32281
+ return result;
31961
32282
  };
31962
32283
  DInput.prototype.onValueChange = function (newValue, oldValue) {
31963
32284
  this.emit("change", newValue, oldValue, this);
@@ -35216,7 +35537,7 @@
35216
35537
  var toImageElement = function (dataUrl) {
35217
35538
  var cachedImageElement = imageElementCache[dataUrl];
35218
35539
  if (cachedImageElement != null) {
35219
- if (cachedImageElement instanceof HTMLImageElement) {
35540
+ if ("url" in cachedImageElement) {
35220
35541
  return Promise.resolve(cachedImageElement);
35221
35542
  }
35222
35543
  else {
@@ -35227,8 +35548,14 @@
35227
35548
  var result = new Promise(function (resolve, reject) {
35228
35549
  var imageElement = document.createElement("img");
35229
35550
  imageElement.onload = function () {
35230
- imageElementCache[dataUrl] = imageElement;
35231
- resolve(imageElement);
35551
+ var resolved = {
35552
+ url: dataUrl,
35553
+ width: imageElement.width,
35554
+ height: imageElement.height,
35555
+ source: imageElement
35556
+ };
35557
+ imageElementCache[dataUrl] = resolved;
35558
+ resolve(resolved);
35232
35559
  };
35233
35560
  imageElement.onabort = imageElement.onerror = function () {
35234
35561
  reject();
@@ -40383,6 +40710,9 @@
40383
40710
  enumerable: false,
40384
40711
  configurable: true
40385
40712
  });
40713
+ EShapeGroup.prototype.serializeGradient = function (manager) {
40714
+ return -1;
40715
+ };
40386
40716
  Object.defineProperty(EShapeGroup.prototype, "radius", {
40387
40717
  get: function () {
40388
40718
  var children = this.children;
@@ -40420,6 +40750,9 @@
40420
40750
  enumerable: false,
40421
40751
  configurable: true
40422
40752
  });
40753
+ EShapeGroup.prototype.serializeImage = function (manager) {
40754
+ return -1;
40755
+ };
40423
40756
  Object.defineProperty(EShapeGroup.prototype, "points", {
40424
40757
  get: function () {
40425
40758
  var children = this.children;
@@ -44581,9 +44914,9 @@
44581
44914
  var shortcuts = this._shortcuts;
44582
44915
  if (shortcuts != null && 0 < shortcuts.length) {
44583
44916
  var shortcut = shortcuts[0];
44584
- var shortcutText = this.newText();
44917
+ var shortcutText = this.newShortcutText();
44585
44918
  this._shortcutText = shortcutText;
44586
- this.snippet.add(this._shortcutText, true);
44919
+ this.snippet.add(shortcutText, true);
44587
44920
  shortcutText.text = UtilKeyboardEvent.toString(shortcut);
44588
44921
  }
44589
44922
  else {
@@ -44591,6 +44924,10 @@
44591
44924
  }
44592
44925
  this._shortcutMargin = this.theme.getShortcutTextMargin();
44593
44926
  };
44927
+ DMenuItemText.prototype.newShortcutText = function () {
44928
+ var _a, _b;
44929
+ return new DDynamicText(new DDynamicTextStyle(this, this.theme, (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.style));
44930
+ };
44594
44931
  DMenuItemText.prototype.updateShortcutText = function () {
44595
44932
  var text = this._shortcutText;
44596
44933
  var margin = this._shortcutMargin;
@@ -44615,8 +44952,7 @@
44615
44952
  text.position.set(textX, textY);
44616
44953
  }
44617
44954
  };
44618
- DMenuItemText.prototype.updateTextColor = function (text) {
44619
- _super.prototype.updateTextColor.call(this, text);
44955
+ DMenuItemText.prototype.updateShortcutColor = function () {
44620
44956
  var shortcutText = this._shortcutText;
44621
44957
  if (shortcutText != null) {
44622
44958
  var theme = this.theme;
@@ -44625,8 +44961,9 @@
44625
44961
  shortcutText.alpha = theme.getShortcutAlpha(state);
44626
44962
  }
44627
44963
  };
44628
- DMenuItemText.prototype.updateText = function () {
44629
- _super.prototype.updateText.call(this);
44964
+ DMenuItemText.prototype.onReflow = function () {
44965
+ _super.prototype.onReflow.call(this);
44966
+ this.updateShortcutColor();
44630
44967
  this.updateShortcutText();
44631
44968
  };
44632
44969
  DMenuItemText.prototype.getType = function () {
@@ -46326,9 +46663,9 @@
46326
46663
  */
46327
46664
  var createImageSdf = function (dataUrl, convertToSdf) {
46328
46665
  if (convertToSdf) {
46329
- return toImageElement(dataUrl).then(function (imageElement) {
46666
+ return toImageElement(dataUrl).then(function (image) {
46330
46667
  var generator = DynamicSDFFontGenerator.getInstance().init();
46331
- generator.updateTexture(imageElement);
46668
+ generator.updateTexture(image.width, image.height, image.source);
46332
46669
  generator.render();
46333
46670
  var canvas = document.createElement("canvas");
46334
46671
  generator.read(canvas);
@@ -46336,8 +46673,8 @@
46336
46673
  });
46337
46674
  }
46338
46675
  else {
46339
- return toImageElement(dataUrl).then(function (imageElement) {
46340
- return new EShapeImageSdf(imageElement);
46676
+ return toImageElement(dataUrl).then(function (image) {
46677
+ return new EShapeImageSdf(image);
46341
46678
  });
46342
46679
  }
46343
46680
  };
@@ -46347,8 +46684,8 @@
46347
46684
  * SPDX-License-Identifier: Apache-2.0
46348
46685
  */
46349
46686
  var createImage = function (dataUrl) {
46350
- return toImageElement(dataUrl).then(function (imageElement) {
46351
- return new EShapeImage(imageElement);
46687
+ return toImageElement(dataUrl).then(function (image) {
46688
+ return new EShapeImage(image);
46352
46689
  });
46353
46690
  };
46354
46691
 
@@ -53086,7 +53423,7 @@
53086
53423
  var view = DPickerColorGradientView.from(1, 10, checkers, texture);
53087
53424
  this._view = view;
53088
53425
  view.setRectangle(0, 0, 0, texture.width, texture.height);
53089
- view.setData(0, this._textValueComputed);
53426
+ view.setData(0, this.text.computed);
53090
53427
  view.update();
53091
53428
  this.image = view;
53092
53429
  }
@@ -53095,13 +53432,13 @@
53095
53432
  DButtonColorGradient.prototype.onActivate = function (e) {
53096
53433
  var _this = this;
53097
53434
  _super.prototype.onActivate.call(this, e);
53098
- var value = this._textValueComputed;
53435
+ var computed = this.text.computed;
53099
53436
  var dialog = this.dialog;
53100
- if (value != null) {
53101
- dialog.value.fromObject(value);
53437
+ if (computed != null) {
53438
+ dialog.value.fromObject(computed);
53102
53439
  }
53103
53440
  dialog.open(this).then(function (newValue) {
53104
- _this.onValueChange(newValue, _this.toClone(value));
53441
+ _this.onValueChange(newValue, _this.toClone(computed));
53105
53442
  });
53106
53443
  };
53107
53444
  DButtonColorGradient.prototype.toClone = function (value) {
@@ -53112,17 +53449,15 @@
53112
53449
  return result;
53113
53450
  };
53114
53451
  DButtonColorGradient.prototype.onValueChange = function (newValue, oldValue) {
53115
- var value = this._textValueComputed;
53116
- if (value != null) {
53117
- value.fromObject(newValue);
53452
+ var computed = this.text.computed;
53453
+ if (computed != null) {
53454
+ computed.fromObject(newValue);
53118
53455
  }
53119
53456
  var view = this._view;
53120
53457
  if (view != null) {
53121
53458
  view.update();
53122
53459
  }
53123
- this.onTextChange();
53124
- this.createOrUpdateText();
53125
- DApplications.update(this);
53460
+ this.text.compute(true);
53126
53461
  this.emit("change", newValue, oldValue, this);
53127
53462
  };
53128
53463
  Object.defineProperty(DButtonColorGradient.prototype, "dialog", {
@@ -53155,7 +53490,7 @@
53155
53490
  };
53156
53491
  Object.defineProperty(DButtonColorGradient.prototype, "value", {
53157
53492
  get: function () {
53158
- return this._textValueComputed;
53493
+ return this.text.computed;
53159
53494
  },
53160
53495
  enumerable: false,
53161
53496
  configurable: true
@@ -53244,14 +53579,14 @@
53244
53579
  var _this = this;
53245
53580
  _super.prototype.onActivate.call(this, e);
53246
53581
  var dialog = this.dialog;
53247
- var value = this._textValueComputed;
53248
- if (value != null) {
53582
+ var computed = this.text.computed;
53583
+ if (computed != null) {
53249
53584
  var dialogCurrent = dialog.current;
53250
- dialogCurrent.color = value.color;
53251
- dialogCurrent.alpha = value.alpha;
53585
+ dialogCurrent.color = computed.color;
53586
+ dialogCurrent.alpha = computed.alpha;
53252
53587
  var dialogNew = dialog.new;
53253
- dialogNew.color = value.color;
53254
- dialogNew.alpha = value.alpha;
53588
+ dialogNew.color = computed.color;
53589
+ dialogNew.alpha = computed.alpha;
53255
53590
  }
53256
53591
  dialog.open(this).then(function () {
53257
53592
  _this.onValueChange(_this.toClone(dialog.new), _this.toClone(dialog.current));
@@ -53264,10 +53599,10 @@
53264
53599
  };
53265
53600
  };
53266
53601
  DButtonColor.prototype.onValueChange = function (newValue, oldValue) {
53267
- var value = this._textValueComputed;
53268
- if (value != null) {
53269
- value.color = newValue.color;
53270
- value.alpha = newValue.alpha;
53602
+ var computed = this.text.computed;
53603
+ if (computed != null) {
53604
+ computed.color = newValue.color;
53605
+ computed.alpha = newValue.alpha;
53271
53606
  }
53272
53607
  this.onColorChange();
53273
53608
  this.emit("change", newValue, oldValue, this);
@@ -53275,16 +53610,12 @@
53275
53610
  DButtonColor.prototype.onColorChange = function () {
53276
53611
  var image = this.image.get(0);
53277
53612
  if (image != null) {
53278
- var value = this._textValueComputed;
53279
- if (value != null) {
53280
- image.tint.color = value.color;
53613
+ var computed = this.text.computed;
53614
+ if (computed != null) {
53615
+ image.tint.color = computed.color;
53281
53616
  }
53282
53617
  }
53283
- this.updateTextForcibly();
53284
- };
53285
- DButtonColor.prototype.updateTextForcibly = function () {
53286
- this.onTextChange();
53287
- this.createOrUpdateText();
53618
+ this.text.compute(true);
53288
53619
  };
53289
53620
  Object.defineProperty(DButtonColor.prototype, "dialog", {
53290
53621
  get: function () {
@@ -53328,13 +53659,14 @@
53328
53659
  });
53329
53660
  DButtonColor.prototype.newValue = function () {
53330
53661
  var _this = this;
53331
- var value = this._textValueComputed;
53332
- return new DPickerColorAndAlpha(value, function (color) {
53333
- value.color = color;
53662
+ var text = this.text;
53663
+ var computed = text.computed;
53664
+ return new DPickerColorAndAlpha(computed, function (color) {
53665
+ computed.color = color;
53334
53666
  _this.onColorChange();
53335
53667
  }, function (alpha) {
53336
- value.alpha = alpha;
53337
- _this.updateTextForcibly();
53668
+ computed.alpha = alpha;
53669
+ text.compute(true);
53338
53670
  });
53339
53671
  };
53340
53672
  DButtonColor.prototype.getType = function () {
@@ -53371,7 +53703,7 @@
53371
53703
  var _this = this;
53372
53704
  var _a, _b;
53373
53705
  _super.prototype.onActivate.call(this, e);
53374
- var value = (_b = (_a = this._textValueComputed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
53706
+ var value = (_b = (_a = this.text.computed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
53375
53707
  var dialog = this.dialog;
53376
53708
  dialog.current = new Date(value);
53377
53709
  dialog.new = new Date(value);
@@ -53415,11 +53747,11 @@
53415
53747
  Object.defineProperty(DButtonDate.prototype, "value", {
53416
53748
  get: function () {
53417
53749
  var _a;
53418
- return (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : new Date();
53750
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : new Date();
53419
53751
  },
53420
53752
  set: function (value) {
53421
- var textValueComputed = this._textValueComputed;
53422
- if (textValueComputed === undefined || textValueComputed.getTime() !== value.getTime()) {
53753
+ var computed = this.text.computed;
53754
+ if (computed === undefined || computed.getTime() !== value.getTime()) {
53423
53755
  this.text = value;
53424
53756
  }
53425
53757
  },
@@ -53515,7 +53847,7 @@
53515
53847
  var _this = this;
53516
53848
  var _a, _b;
53517
53849
  _super.prototype.onActivate.call(this, e);
53518
- var value = (_b = (_a = this._textValueComputed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
53850
+ var value = (_b = (_a = this.text.computed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
53519
53851
  var dialog = this.dialog;
53520
53852
  dialog.current = new Date(value);
53521
53853
  dialog.new = new Date(value);
@@ -53568,11 +53900,11 @@
53568
53900
  Object.defineProperty(DButtonDatetime.prototype, "value", {
53569
53901
  get: function () {
53570
53902
  var _a;
53571
- return (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : new Date();
53903
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : new Date();
53572
53904
  },
53573
53905
  set: function (value) {
53574
- var textValueComputed = this._textValueComputed;
53575
- if (textValueComputed === undefined || textValueComputed.getTime() !== value.getTime()) {
53906
+ var computed = this.text.computed;
53907
+ if (computed === undefined || computed.getTime() !== value.getTime()) {
53576
53908
  this.text = value;
53577
53909
  }
53578
53910
  },
@@ -56657,7 +56989,7 @@
56657
56989
  var _a;
56658
56990
  _super.prototype.onActivate.call(this, e);
56659
56991
  var dialog = this.dialog;
56660
- var oldValue = (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : null;
56992
+ var oldValue = (_a = this.text.computed) !== null && _a !== void 0 ? _a : null;
56661
56993
  this._dialogSetter(dialog, oldValue);
56662
56994
  dialog.open(this).then(function () {
56663
56995
  var newValue = _this._dialogGetter(dialog);
@@ -56690,7 +57022,7 @@
56690
57022
  Object.defineProperty(DButtonSelect.prototype, "value", {
56691
57023
  get: function () {
56692
57024
  var _a;
56693
- return (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : null;
57025
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : null;
56694
57026
  },
56695
57027
  set: function (value) {
56696
57028
  this.text = value;
@@ -56717,7 +57049,7 @@
56717
57049
  var _this = this;
56718
57050
  var _a, _b;
56719
57051
  _super.prototype.onActivate.call(this, e);
56720
- var value = (_b = (_a = this._textValueComputed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
57052
+ var value = (_b = (_a = this.text.computed) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : Date.now();
56721
57053
  var dialog = this.dialog;
56722
57054
  dialog.current = new Date(value);
56723
57055
  dialog.new = new Date(value);
@@ -56769,11 +57101,11 @@
56769
57101
  Object.defineProperty(DButtonTime.prototype, "value", {
56770
57102
  get: function () {
56771
57103
  var _a;
56772
- return (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : new Date();
57104
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : new Date();
56773
57105
  },
56774
57106
  set: function (value) {
56775
- var textValueComputed = this._textValueComputed;
56776
- if (textValueComputed === undefined || textValueComputed.getTime() !== value.getTime()) {
57107
+ var computed = this.text.computed;
57108
+ if (computed === undefined || computed.getTime() !== value.getTime()) {
56777
57109
  this.text = value;
56778
57110
  }
56779
57111
  },
@@ -65933,7 +66265,7 @@
65933
66265
  _this._delayDone = (_a = delay === null || delay === void 0 ? void 0 : delay.done) !== null && _a !== void 0 ? _a : theme.getDoneDelay();
65934
66266
  var delayClose = delay === null || delay === void 0 ? void 0 : delay.close;
65935
66267
  _this._delayClose = delayClose !== undefined ? delayClose : theme.getCloseDelay();
65936
- _this._messageText = _this.message.text;
66268
+ _this._messageText = _this.message.text.value;
65937
66269
  return _this;
65938
66270
  }
65939
66271
  DDialogProcessing.prototype.newMessage = function (options) {
@@ -66291,7 +66623,7 @@
66291
66623
  }
66292
66624
  state.unlock();
66293
66625
  if (this._isTextEnabled) {
66294
- this._textValueBackup = parent.text;
66626
+ this._textValueBackup = parent.text.value;
66295
66627
  var textValue = this._textValue;
66296
66628
  if (textValue !== undefined) {
66297
66629
  parent.text = textValue;
@@ -69433,7 +69765,7 @@
69433
69765
  var selecting = this._column.selecting;
69434
69766
  var dialog = selecting.dialog;
69435
69767
  if (dialog) {
69436
- var oldValue_1 = (_a = this._textValueComputed) !== null && _a !== void 0 ? _a : null;
69768
+ var oldValue_1 = (_a = this.text.computed) !== null && _a !== void 0 ? _a : null;
69437
69769
  selecting.setter(dialog, oldValue_1);
69438
69770
  dialog.open(this).then(function () {
69439
69771
  var newValue = selecting.getter(dialog);
@@ -69490,11 +69822,8 @@
69490
69822
  });
69491
69823
  Object.defineProperty(DTableBodyCellSelectDialog.prototype, "value", {
69492
69824
  get: function () {
69493
- var textValueComputed = this._textValueComputed;
69494
- if (textValueComputed !== undefined) {
69495
- return textValueComputed;
69496
- }
69497
- return null;
69825
+ var _a;
69826
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : null;
69498
69827
  },
69499
69828
  set: function (value) {
69500
69829
  this.text = value;
@@ -69506,10 +69835,7 @@
69506
69835
  this._row = row;
69507
69836
  this._rowIndex = rowIndex;
69508
69837
  if (forcibly) {
69509
- this._textValue = value;
69510
- this._textValueComputed = value;
69511
- this.onTextChange();
69512
- this.createOrUpdateText();
69838
+ this.text.setValue(value, true);
69513
69839
  }
69514
69840
  else {
69515
69841
  this.text = value;
@@ -69638,7 +69964,7 @@
69638
69964
  promise().then(function (newValue) {
69639
69965
  var _a;
69640
69966
  if (_this._isSyncEnabled) {
69641
- var oldValue = (_a = _this._textValueComputed) !== null && _a !== void 0 ? _a : null;
69967
+ var oldValue = (_a = _this.text.computed) !== null && _a !== void 0 ? _a : null;
69642
69968
  if (newValue !== oldValue) {
69643
69969
  _this.text = newValue;
69644
69970
  _this.onValueChange(newValue, oldValue);
@@ -69691,11 +70017,8 @@
69691
70017
  });
69692
70018
  Object.defineProperty(DTableBodyCellSelectPromise.prototype, "value", {
69693
70019
  get: function () {
69694
- var textValueComputed = this._textValueComputed;
69695
- if (textValueComputed !== undefined) {
69696
- return textValueComputed;
69697
- }
69698
- return null;
70020
+ var _a;
70021
+ return (_a = this.text.computed) !== null && _a !== void 0 ? _a : null;
69699
70022
  },
69700
70023
  set: function (value) {
69701
70024
  this.text = value;
@@ -69707,10 +70030,7 @@
69707
70030
  this._row = row;
69708
70031
  this._rowIndex = rowIndex;
69709
70032
  if (forcibly) {
69710
- this._textValue = value;
69711
- this._textValueComputed = value;
69712
- this.onTextChange();
69713
- this.createOrUpdateText();
70033
+ this.text.setValue(value, true);
69714
70034
  }
69715
70035
  else {
69716
70036
  this.text = value;
@@ -70165,24 +70485,21 @@
70165
70485
  this._rowIndex = rowIndex;
70166
70486
  if (value instanceof Date) {
70167
70487
  if (forcibly) {
70168
- this._textValue = value;
70169
- this._textValueComputed = value;
70170
- this.onTextChange();
70171
- this.createOrUpdateText();
70488
+ this.text.setValue(value, true);
70172
70489
  }
70173
70490
  else {
70174
70491
  this.text = value;
70175
70492
  }
70176
70493
  }
70177
70494
  else if (isNumber(value)) {
70178
- var textValueComputed = this._textValueComputed;
70179
- if (textValueComputed === undefined) {
70495
+ var text = this.text;
70496
+ var computed = text.computed;
70497
+ if (computed === undefined) {
70180
70498
  this.text = new Date(value);
70181
70499
  }
70182
- else if (textValueComputed.getTime() !== value) {
70183
- textValueComputed.setTime(value);
70184
- this.onTextChange();
70185
- this.createOrUpdateText();
70500
+ else if (computed.getTime() !== value) {
70501
+ computed.setTime(value);
70502
+ text.compute(true);
70186
70503
  }
70187
70504
  }
70188
70505
  DTableBodyCells.set(this, row, columnIndex, this._column);
@@ -70258,24 +70575,21 @@
70258
70575
  this._rowIndex = rowIndex;
70259
70576
  if (value instanceof Date) {
70260
70577
  if (forcibly) {
70261
- this._textValue = value;
70262
- this._textValueComputed = value;
70263
- this.onTextChange();
70264
- this.createOrUpdateText();
70578
+ this.text.setValue(value, true);
70265
70579
  }
70266
70580
  else {
70267
70581
  this.text = value;
70268
70582
  }
70269
70583
  }
70270
70584
  else if (isNumber(value)) {
70271
- var textValueComputed = this._textValueComputed;
70272
- if (textValueComputed == null) {
70585
+ var text = this.text;
70586
+ var computed = text.computed;
70587
+ if (computed == null) {
70273
70588
  this.text = new Date(value);
70274
70589
  }
70275
- else if (textValueComputed.getTime() !== value) {
70276
- textValueComputed.setTime(value);
70277
- this.onTextChange();
70278
- this.createOrUpdateText();
70590
+ else if (computed.getTime() !== value) {
70591
+ computed.setTime(value);
70592
+ text.compute(true);
70279
70593
  }
70280
70594
  }
70281
70595
  DTableBodyCells.set(this, row, columnIndex, this._column);
@@ -71201,24 +71515,21 @@
71201
71515
  this._rowIndex = rowIndex;
71202
71516
  if (value instanceof Date) {
71203
71517
  if (forcibly) {
71204
- this._textValue = value;
71205
- this._textValueComputed = value;
71206
- this.onTextChange();
71207
- this.createOrUpdateText();
71518
+ this.text.setValue(value, true);
71208
71519
  }
71209
71520
  else {
71210
71521
  this.text = value;
71211
71522
  }
71212
71523
  }
71213
71524
  else if (isNumber(value)) {
71214
- var textValueComputed = this._textValueComputed;
71215
- if (textValueComputed == null) {
71525
+ var text = this.text;
71526
+ var computed = text.computed;
71527
+ if (computed == null) {
71216
71528
  this.text = new Date(value);
71217
71529
  }
71218
- else if (textValueComputed.getTime() !== value) {
71219
- textValueComputed.setTime(value);
71220
- this.onTextChange();
71221
- this.createOrUpdateText();
71530
+ else if (computed.getTime() !== value) {
71531
+ computed.setTime(value);
71532
+ text.compute(true);
71222
71533
  }
71223
71534
  }
71224
71535
  DTableBodyCells.set(this, row, columnIndex, this._column);