@wcardinal/wcardinal-ui 0.398.0 → 0.400.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 (200) hide show
  1. package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +5 -0
  2. package/dist/types/wcardinal/ui/d-base-state-set.d.ts +4 -0
  3. package/dist/types/wcardinal/ui/d-base-state.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/d-base.d.ts +13 -1
  5. package/dist/types/wcardinal/ui/d-button-color.d.ts +0 -3
  6. package/dist/types/wcardinal/ui/d-image-base-theme-wrapper-other.d.ts +19 -0
  7. package/dist/types/wcardinal/ui/d-image-base-theme-wrapper-secondary.d.ts +3 -1
  8. package/dist/types/wcardinal/ui/d-image-base-theme-wrapper-tertiary.d.ts +3 -1
  9. package/dist/types/wcardinal/ui/d-image-base.d.ts +11 -26
  10. package/dist/types/wcardinal/ui/d-image-piece-align-impl.d.ts +23 -0
  11. package/dist/types/wcardinal/ui/d-image-piece-align.d.ts +14 -0
  12. package/dist/types/wcardinal/ui/d-image-piece-container-impl.d.ts +24 -0
  13. package/dist/types/wcardinal/ui/d-image-piece-container.d.ts +12 -0
  14. package/dist/types/wcardinal/ui/d-image-piece-impl.d.ts +60 -0
  15. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-bottom.d.ts +3 -0
  16. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-center.d.ts +2 -1
  17. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-left.d.ts +3 -0
  18. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-middle.d.ts +2 -1
  19. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-right.d.ts +3 -0
  20. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-top.d.ts +3 -0
  21. package/dist/types/wcardinal/ui/d-image-piece-layouter-part.d.ts +4 -2
  22. package/dist/types/wcardinal/ui/d-image-piece-margin-impl.d.ts +17 -0
  23. package/dist/types/wcardinal/ui/d-image-piece-margin.d.ts +9 -0
  24. package/dist/types/wcardinal/ui/d-image-piece-tint-impl.d.ts +23 -0
  25. package/dist/types/wcardinal/ui/d-image-piece-tint.d.ts +13 -0
  26. package/dist/types/wcardinal/ui/d-image-piece.d.ts +14 -77
  27. package/dist/types/wcardinal/ui/d-indicator-processing.d.ts +69 -0
  28. package/dist/types/wcardinal/ui/index.d.ts +11 -0
  29. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-processing.d.ts +2 -0
  30. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-en-us-indicator-processing.d.ts +5 -0
  31. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-image-base.d.ts +3 -0
  32. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.d.ts +13 -0
  33. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-processing.d.ts +2 -0
  34. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-indicator-processing.d.ts +5 -0
  35. package/dist/types/wcardinal/ui/theme/dark/index-en-us.d.ts +1 -0
  36. package/dist/types/wcardinal/ui/theme/dark/index-ja-jp.d.ts +1 -0
  37. package/dist/types/wcardinal/ui/theme/dark/index-zz-zz.d.ts +1 -0
  38. package/dist/types/wcardinal/ui/theme/dark/load/index-en-us.d.ts +1 -0
  39. package/dist/types/wcardinal/ui/theme/dark/load/index-ja-jp.d.ts +1 -0
  40. package/dist/types/wcardinal/ui/theme/dark/load/load-theme-dark-en-us-indicator-processing.d.ts +1 -0
  41. package/dist/types/wcardinal/ui/theme/dark/load/load-theme-dark-ja-jp-indicator-processing.d.ts +1 -0
  42. package/dist/types/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-processing.d.ts +2 -0
  43. package/dist/types/wcardinal/ui/theme/white/d-theme-white-en-us-indicator-processing.d.ts +5 -0
  44. package/dist/types/wcardinal/ui/theme/white/d-theme-white-image-base.d.ts +3 -0
  45. package/dist/types/wcardinal/ui/theme/white/d-theme-white-indicator-processing.d.ts +13 -0
  46. package/dist/types/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-processing.d.ts +2 -0
  47. package/dist/types/wcardinal/ui/theme/white/d-theme-white-ja-jp-indicator-processing.d.ts +5 -0
  48. package/dist/types/wcardinal/ui/theme/white/index-en-us.d.ts +1 -0
  49. package/dist/types/wcardinal/ui/theme/white/index-ja-jp.d.ts +1 -0
  50. package/dist/types/wcardinal/ui/theme/white/index-zz-zz.d.ts +1 -0
  51. package/dist/types/wcardinal/ui/theme/white/load/index-en-us.d.ts +1 -0
  52. package/dist/types/wcardinal/ui/theme/white/load/index-ja-jp.d.ts +1 -0
  53. package/dist/types/wcardinal/ui/theme/white/load/load-theme-white-en-us-indicator-processing.d.ts +1 -0
  54. package/dist/types/wcardinal/ui/theme/white/load/load-theme-white-ja-jp-indicator-processing.d.ts +1 -0
  55. package/dist/wcardinal/ui/d-base-state-set-impl.js +31 -0
  56. package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
  57. package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
  58. package/dist/wcardinal/ui/d-base-state.js +1 -0
  59. package/dist/wcardinal/ui/d-base-state.js.map +1 -1
  60. package/dist/wcardinal/ui/d-base.js +63 -7
  61. package/dist/wcardinal/ui/d-base.js.map +1 -1
  62. package/dist/wcardinal/ui/d-button-color.js +6 -29
  63. package/dist/wcardinal/ui/d-button-color.js.map +1 -1
  64. package/dist/wcardinal/ui/d-dialog-processing.js +3 -2
  65. package/dist/wcardinal/ui/d-dialog-processing.js.map +1 -1
  66. package/dist/wcardinal/ui/d-image-base-theme-wrapper-other.js +35 -0
  67. package/dist/wcardinal/ui/d-image-base-theme-wrapper-other.js.map +1 -0
  68. package/dist/wcardinal/ui/d-image-base-theme-wrapper-secondary.js +5 -1
  69. package/dist/wcardinal/ui/d-image-base-theme-wrapper-secondary.js.map +1 -1
  70. package/dist/wcardinal/ui/d-image-base-theme-wrapper-tertiary.js +5 -1
  71. package/dist/wcardinal/ui/d-image-base-theme-wrapper-tertiary.js.map +1 -1
  72. package/dist/wcardinal/ui/d-image-base.js +22 -51
  73. package/dist/wcardinal/ui/d-image-base.js.map +1 -1
  74. package/dist/wcardinal/ui/d-image-piece-align-impl.js +89 -0
  75. package/dist/wcardinal/ui/d-image-piece-align-impl.js.map +1 -0
  76. package/dist/wcardinal/ui/d-image-piece-align.js +2 -0
  77. package/dist/wcardinal/ui/d-image-piece-align.js.map +1 -0
  78. package/dist/wcardinal/ui/d-image-piece-container-impl.js +108 -0
  79. package/dist/wcardinal/ui/d-image-piece-container-impl.js.map +1 -0
  80. package/dist/wcardinal/ui/d-image-piece-container.js +2 -0
  81. package/dist/wcardinal/ui/d-image-piece-container.js.map +1 -0
  82. package/dist/wcardinal/ui/d-image-piece-impl.js +235 -0
  83. package/dist/wcardinal/ui/d-image-piece-impl.js.map +1 -0
  84. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js +15 -4
  85. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js.map +1 -1
  86. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js +8 -5
  87. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js.map +1 -1
  88. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +13 -17
  89. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -1
  90. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js +15 -4
  91. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js.map +1 -1
  92. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js +8 -5
  93. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js.map +1 -1
  94. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js +15 -4
  95. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js.map +1 -1
  96. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js +15 -4
  97. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js.map +1 -1
  98. package/dist/wcardinal/ui/d-image-piece-layouter-part.js +2 -6
  99. package/dist/wcardinal/ui/d-image-piece-layouter-part.js.map +1 -1
  100. package/dist/wcardinal/ui/d-image-piece-layouter.js +2 -2
  101. package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -1
  102. package/dist/wcardinal/ui/d-image-piece-margin-impl.js +55 -0
  103. package/dist/wcardinal/ui/d-image-piece-margin-impl.js.map +1 -0
  104. package/dist/wcardinal/ui/d-image-piece-margin.js +2 -0
  105. package/dist/wcardinal/ui/d-image-piece-margin.js.map +1 -0
  106. package/dist/wcardinal/ui/d-image-piece-tint-impl.js +90 -0
  107. package/dist/wcardinal/ui/d-image-piece-tint-impl.js.map +1 -0
  108. package/dist/wcardinal/ui/d-image-piece-tint.js +2 -0
  109. package/dist/wcardinal/ui/d-image-piece-tint.js.map +1 -0
  110. package/dist/wcardinal/ui/d-image-piece.js +1 -287
  111. package/dist/wcardinal/ui/d-image-piece.js.map +1 -1
  112. package/dist/wcardinal/ui/d-indicator-processing.js +216 -0
  113. package/dist/wcardinal/ui/d-indicator-processing.js.map +1 -0
  114. package/dist/wcardinal/ui/d-table-header-cell.js +10 -5
  115. package/dist/wcardinal/ui/d-table-header-cell.js.map +1 -1
  116. package/dist/wcardinal/ui/d-text-base.js +9 -1
  117. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  118. package/dist/wcardinal/ui/index.js +11 -0
  119. package/dist/wcardinal/ui/index.js.map +1 -1
  120. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-processing.js +2 -2
  121. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-processing.js.map +1 -1
  122. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-indicator-processing.js +19 -0
  123. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-indicator-processing.js.map +1 -0
  124. package/dist/wcardinal/ui/theme/dark/d-theme-dark-image-base.js +9 -0
  125. package/dist/wcardinal/ui/theme/dark/d-theme-dark-image-base.js.map +1 -1
  126. package/dist/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.js +74 -0
  127. package/dist/wcardinal/ui/theme/dark/d-theme-dark-indicator-processing.js.map +1 -0
  128. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-processing.js +2 -2
  129. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-processing.js.map +1 -1
  130. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-indicator-processing.js +19 -0
  131. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-indicator-processing.js.map +1 -0
  132. package/dist/wcardinal/ui/theme/dark/index-en-us.js +1 -0
  133. package/dist/wcardinal/ui/theme/dark/index-en-us.js.map +1 -1
  134. package/dist/wcardinal/ui/theme/dark/index-ja-jp.js +1 -0
  135. package/dist/wcardinal/ui/theme/dark/index-ja-jp.js.map +1 -1
  136. package/dist/wcardinal/ui/theme/dark/index-zz-zz.js +1 -0
  137. package/dist/wcardinal/ui/theme/dark/index-zz-zz.js.map +1 -1
  138. package/dist/wcardinal/ui/theme/dark/load/index-en-us.js +1 -0
  139. package/dist/wcardinal/ui/theme/dark/load/index-en-us.js.map +1 -1
  140. package/dist/wcardinal/ui/theme/dark/load/index-ja-jp.js +1 -0
  141. package/dist/wcardinal/ui/theme/dark/load/index-ja-jp.js.map +1 -1
  142. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-en-us-all.js +2 -0
  143. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-en-us-all.js.map +1 -1
  144. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-en-us-indicator-processing.js +10 -0
  145. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-en-us-indicator-processing.js.map +1 -0
  146. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-ja-jp-all.js +2 -0
  147. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-ja-jp-all.js.map +1 -1
  148. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-ja-jp-indicator-processing.js +10 -0
  149. package/dist/wcardinal/ui/theme/dark/load/load-theme-dark-ja-jp-indicator-processing.js.map +1 -0
  150. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-processing.js +2 -2
  151. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-processing.js.map +1 -1
  152. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-indicator-processing.js +19 -0
  153. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-indicator-processing.js.map +1 -0
  154. package/dist/wcardinal/ui/theme/white/d-theme-white-image-base.js +9 -0
  155. package/dist/wcardinal/ui/theme/white/d-theme-white-image-base.js.map +1 -1
  156. package/dist/wcardinal/ui/theme/white/d-theme-white-indicator-processing.js +74 -0
  157. package/dist/wcardinal/ui/theme/white/d-theme-white-indicator-processing.js.map +1 -0
  158. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-processing.js +2 -2
  159. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-processing.js.map +1 -1
  160. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-indicator-processing.js +19 -0
  161. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-indicator-processing.js.map +1 -0
  162. package/dist/wcardinal/ui/theme/white/index-en-us.js +1 -0
  163. package/dist/wcardinal/ui/theme/white/index-en-us.js.map +1 -1
  164. package/dist/wcardinal/ui/theme/white/index-ja-jp.js +1 -0
  165. package/dist/wcardinal/ui/theme/white/index-ja-jp.js.map +1 -1
  166. package/dist/wcardinal/ui/theme/white/index-zz-zz.js +1 -0
  167. package/dist/wcardinal/ui/theme/white/index-zz-zz.js.map +1 -1
  168. package/dist/wcardinal/ui/theme/white/load/index-en-us.js +1 -0
  169. package/dist/wcardinal/ui/theme/white/load/index-en-us.js.map +1 -1
  170. package/dist/wcardinal/ui/theme/white/load/index-ja-jp.js +1 -0
  171. package/dist/wcardinal/ui/theme/white/load/index-ja-jp.js.map +1 -1
  172. package/dist/wcardinal/ui/theme/white/load/load-theme-white-en-us-all.js +2 -0
  173. package/dist/wcardinal/ui/theme/white/load/load-theme-white-en-us-all.js.map +1 -1
  174. package/dist/wcardinal/ui/theme/white/load/load-theme-white-en-us-indicator-processing.js +10 -0
  175. package/dist/wcardinal/ui/theme/white/load/load-theme-white-en-us-indicator-processing.js.map +1 -0
  176. package/dist/wcardinal/ui/theme/white/load/load-theme-white-ja-jp-all.js +2 -0
  177. package/dist/wcardinal/ui/theme/white/load/load-theme-white-ja-jp-all.js.map +1 -1
  178. package/dist/wcardinal/ui/theme/white/load/load-theme-white-ja-jp-indicator-processing.js +10 -0
  179. package/dist/wcardinal/ui/theme/white/load/load-theme-white-ja-jp-indicator-processing.js.map +1 -0
  180. package/dist/wcardinal-ui-theme-dark-en-us.js +112 -3
  181. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  182. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  183. package/dist/wcardinal-ui-theme-dark-ja-jp.js +112 -3
  184. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  185. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  186. package/dist/wcardinal-ui-theme-dark.js +112 -3
  187. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  188. package/dist/wcardinal-ui-theme-white-en-us.js +112 -3
  189. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  190. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  191. package/dist/wcardinal-ui-theme-white-ja-jp.js +112 -3
  192. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  193. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  194. package/dist/wcardinal-ui-theme-white.js +112 -3
  195. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  196. package/dist/wcardinal-ui.cjs.js +1413 -513
  197. package/dist/wcardinal-ui.js +1127 -495
  198. package/dist/wcardinal-ui.min.js +2 -2
  199. package/dist/wcardinal-ui.min.js.map +1 -1
  200. package/package.json +1 -1
@@ -1,288 +1,2 @@
1
- import { Rectangle, Sprite, Texture } from "pixi.js";
2
- import { DAlignHorizontal } from "./d-align-horizontal";
3
- import { DAlignVertical } from "./d-align-vertical";
4
- import { DAlignWith } from "./d-align-with";
5
- import { DApplications } from "./d-applications";
6
- import { isFunction } from "./util/is-function";
7
- import { toEnum } from "./util/to-enum";
8
- var toImageAlign = function (theme, options) {
9
- var _a, _b, _c;
10
- var align = options === null || options === void 0 ? void 0 : options.align;
11
- return {
12
- with: toEnum((_a = align === null || align === void 0 ? void 0 : align.with) !== null && _a !== void 0 ? _a : theme.getImageAlignWith(), DAlignWith),
13
- vertical: toEnum((_b = align === null || align === void 0 ? void 0 : align.vertical) !== null && _b !== void 0 ? _b : theme.getImageAlignVertical(), DAlignVertical),
14
- horizontal: toEnum((_c = align === null || align === void 0 ? void 0 : align.horizontal) !== null && _c !== void 0 ? _c : theme.getImageAlignHorizontal(), DAlignHorizontal)
15
- };
16
- };
17
- var toImageMargin = function (theme, options) {
18
- var _a, _b;
19
- var margin = options === null || options === void 0 ? void 0 : options.margin;
20
- return {
21
- vertical: (_a = margin === null || margin === void 0 ? void 0 : margin.vertical) !== null && _a !== void 0 ? _a : theme.getImageMarginVertial(),
22
- horizontal: (_b = margin === null || margin === void 0 ? void 0 : margin.horizontal) !== null && _b !== void 0 ? _b : theme.getImageMarginHorizontal()
23
- };
24
- };
25
- var DImagePiece = /** @class */ (function () {
26
- function DImagePiece(parent, theme, textAlign, options) {
27
- var _this = this;
28
- this._parent = parent;
29
- this._theme = theme;
30
- this._textAlign = textAlign;
31
- this._image = null;
32
- this._align = toImageAlign(theme, options);
33
- this._margin = toImageMargin(theme, options);
34
- this._tint = options === null || options === void 0 ? void 0 : options.tint;
35
- this._bound = new Rectangle();
36
- this._source = options === null || options === void 0 ? void 0 : options.source;
37
- this._computed = null;
38
- this._onUpdateBound = function () {
39
- _this.onUpdate();
40
- };
41
- }
42
- Object.defineProperty(DImagePiece.prototype, "image", {
43
- get: function () {
44
- return this._image;
45
- },
46
- enumerable: false,
47
- configurable: true
48
- });
49
- Object.defineProperty(DImagePiece.prototype, "align", {
50
- get: function () {
51
- return this._align;
52
- },
53
- enumerable: false,
54
- configurable: true
55
- });
56
- Object.defineProperty(DImagePiece.prototype, "margin", {
57
- get: function () {
58
- return this._margin;
59
- },
60
- enumerable: false,
61
- configurable: true
62
- });
63
- Object.defineProperty(DImagePiece.prototype, "bound", {
64
- get: function () {
65
- return this._bound;
66
- },
67
- enumerable: false,
68
- configurable: true
69
- });
70
- Object.defineProperty(DImagePiece.prototype, "source", {
71
- get: function () {
72
- return this._source;
73
- },
74
- set: function (source) {
75
- if (this._source !== source) {
76
- this._source = source;
77
- this.onUpdate();
78
- }
79
- },
80
- enumerable: false,
81
- configurable: true
82
- });
83
- DImagePiece.prototype.computeSource = function () {
84
- var source = this._source;
85
- if (source !== undefined) {
86
- if (isFunction(source)) {
87
- var result = source(this._parent.state);
88
- if (result !== undefined) {
89
- return result;
90
- }
91
- }
92
- else {
93
- return source;
94
- }
95
- }
96
- return this._theme.getImageSource(this._parent.state);
97
- };
98
- DImagePiece.prototype.onStateChange = function (newState, oldState) {
99
- this.updateTint();
100
- };
101
- DImagePiece.prototype.updateBound = function () {
102
- var bound = this._bound;
103
- var image = this._image;
104
- if (image != null) {
105
- image.updateTransform();
106
- image.getLocalBounds(bound);
107
- var bl = bound.left;
108
- var bt = bound.top;
109
- var br = bound.right;
110
- var bb = bound.bottom;
111
- var localTransform = image.localTransform;
112
- var a = localTransform.a;
113
- var b = localTransform.b;
114
- var c = localTransform.c;
115
- var d = localTransform.d;
116
- var x0 = a * bl + c * bt;
117
- var y0 = b * bl + d * bt;
118
- var x1 = a * br + c * bt;
119
- var y1 = b * br + d * bt;
120
- var x2 = a * br + c * bb;
121
- var y2 = b * br + d * bb;
122
- var x3 = a * bl + c * bb;
123
- var y3 = b * bl + d * bb;
124
- var xmin = Math.min(x0, x1, x2, x3);
125
- var xmax = Math.max(x0, x1, x2, x3);
126
- var ymin = Math.min(y0, y1, y2, y3);
127
- var ymax = Math.max(y0, y1, y2, y3);
128
- bound.x = xmin + localTransform.tx;
129
- bound.y = ymin + localTransform.ty;
130
- bound.width = xmax - xmin;
131
- bound.height = ymax - ymin;
132
- }
133
- else {
134
- bound.x = 0;
135
- bound.y = 0;
136
- bound.width = 0;
137
- bound.height = 0;
138
- }
139
- };
140
- DImagePiece.prototype.isTintAware = function (target) {
141
- return target != null && "tint" in target;
142
- };
143
- DImagePiece.prototype.toTintColor = function (theme, state) {
144
- var tint = this._tint;
145
- if (tint) {
146
- var color = tint.color;
147
- if (color !== undefined) {
148
- if (isFunction(color)) {
149
- var result = color(state);
150
- if (result !== undefined) {
151
- return result;
152
- }
153
- }
154
- else {
155
- return color;
156
- }
157
- }
158
- }
159
- return theme.getImageTintColor(state);
160
- };
161
- DImagePiece.prototype.toTintAlpha = function (theme, state) {
162
- var tint = this._tint;
163
- if (tint) {
164
- var alpha = tint.alpha;
165
- if (alpha !== undefined) {
166
- if (isFunction(alpha)) {
167
- var result = alpha(state);
168
- if (result !== undefined) {
169
- return result;
170
- }
171
- }
172
- else {
173
- return alpha;
174
- }
175
- }
176
- }
177
- return theme.getImageTintAlpha(state);
178
- };
179
- /**
180
- * Updates the tint.
181
- *
182
- * @returns True if the tint is changed.
183
- */
184
- DImagePiece.prototype.updateTint = function () {
185
- var image = this._image;
186
- if (image) {
187
- if (this.isTintAware(image)) {
188
- var theme = this._theme;
189
- var state = this._parent.state;
190
- var color = this.toTintColor(theme, state);
191
- if (color != null) {
192
- var result = false;
193
- if (image.tint !== color) {
194
- image.tint = color;
195
- result = true;
196
- }
197
- var alpha = this.toTintAlpha(theme, state);
198
- if (image.alpha !== alpha) {
199
- image.alpha = alpha;
200
- result = true;
201
- }
202
- return result;
203
- }
204
- }
205
- }
206
- return false;
207
- };
208
- /**
209
- * Updates the computed source.
210
- *
211
- * @returns True if the computed source is changed
212
- */
213
- DImagePiece.prototype.updateSource = function () {
214
- var newComputed = this.computeSource();
215
- var oldComputed = this._computed;
216
- if (newComputed !== oldComputed) {
217
- this._computed = newComputed;
218
- var parent_1 = this._parent;
219
- var oldImage = this._image;
220
- var onUpdateBound = this._onUpdateBound;
221
- if (newComputed instanceof Texture) {
222
- if (oldComputed instanceof Texture) {
223
- oldComputed.off("update", onUpdateBound);
224
- if (oldImage instanceof Sprite) {
225
- oldImage.texture = newComputed;
226
- newComputed.on("update", onUpdateBound);
227
- }
228
- }
229
- else {
230
- if (oldImage != null) {
231
- parent_1.removeChild(oldImage);
232
- }
233
- var newImage = new Sprite(newComputed);
234
- var overflowMask = parent_1.getOverflowMask();
235
- if (overflowMask) {
236
- newImage.mask = overflowMask;
237
- }
238
- newComputed.on("update", onUpdateBound);
239
- parent_1.addChild(newImage);
240
- this._image = newImage;
241
- }
242
- }
243
- else {
244
- if (oldComputed instanceof Texture) {
245
- oldComputed.off("update", onUpdateBound);
246
- if (oldImage != null) {
247
- parent_1.removeChild(oldImage);
248
- oldImage.destroy();
249
- }
250
- }
251
- else if (oldImage != null) {
252
- parent_1.removeChild(oldImage);
253
- }
254
- if (newComputed != null) {
255
- var overflowMask = parent_1.getOverflowMask();
256
- if (overflowMask) {
257
- newComputed.mask = overflowMask;
258
- }
259
- parent_1.addChild(newComputed);
260
- }
261
- this._image = newComputed;
262
- }
263
- return true;
264
- }
265
- return false;
266
- };
267
- DImagePiece.prototype.isRefitable = function (target) {
268
- return target != null && target === this._image;
269
- };
270
- DImagePiece.prototype.destroy = function () {
271
- var image = this._image;
272
- if (image) {
273
- this._image = null;
274
- var computed = this._computed;
275
- if (computed instanceof Texture) {
276
- computed.off("update", this._onUpdateBound, this);
277
- image.destroy();
278
- }
279
- }
280
- };
281
- DImagePiece.prototype.onUpdate = function () {
282
- this._parent.toDirty();
283
- DApplications.update(this._parent);
284
- };
285
- return DImagePiece;
286
- }());
287
- export { DImagePiece };
1
+ export {};
288
2
  //# sourceMappingURL=d-image-piece.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"d-image-piece.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA4DxC,IAAM,YAAY,GAAG,UAAC,KAAuB,EAAE,OAA4B;;IAC1E,IAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;IAC7B,OAAO;QACN,IAAI,EAAE,MAAM,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,mCAAI,KAAK,CAAC,iBAAiB,EAAE,EAAE,UAAU,CAAC;QAClE,QAAQ,EAAE,MAAM,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,KAAK,CAAC,qBAAqB,EAAE,EAAE,cAAc,CAAC;QAClF,UAAU,EAAE,MAAM,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,mCAAI,KAAK,CAAC,uBAAuB,EAAE,EAAE,gBAAgB,CAAC;KAC1F,CAAC;AACH,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,UACrB,KAAuB,EACvB,OAA4B;;IAE5B,IAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAA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Content":["import { DisplayObject, Graphics, Rectangle, Sprite, Texture } from \"pixi.js\";\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DAlignVertical } from \"./d-align-vertical\";\nimport { DAlignWith } from \"./d-align-with\";\nimport { DApplicationTarget } from \"./d-application-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { isFunction } from \"./util/is-function\";\nimport { toEnum } from \"./util/to-enum\";\n\nexport interface DImagePieceTintOptions {\n\tcolor?: DStateAwareOrValueMightBe<number | null>;\n\talpha?: DStateAwareOrValueMightBe<number>;\n}\n\nexport interface DImagePieceAlignOptions {\n\twith?: keyof typeof DAlignWith | DAlignWith;\n\tvertical?: keyof typeof DAlignVertical | DAlignVertical;\n\thorizontal?: keyof typeof DAlignHorizontal | DAlignHorizontal;\n}\n\nexport interface DImagePieceMarginOptions {\n\tvertical?: number;\n\thorizontal?: number;\n}\n\nexport interface DImagePieceOptions {\n\tsource?: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\ttint?: DImagePieceTintOptions;\n\talign?: DImagePieceAlignOptions;\n\tmargin?: DImagePieceMarginOptions;\n}\n\nexport interface DImagePieceAlign {\n\twith: DAlignWith;\n\tvertical: DAlignVertical;\n\thorizontal: DAlignHorizontal;\n}\n\nexport interface DImagePieceMargin {\n\tvertical: number;\n\thorizontal: number;\n}\n\nexport interface DImagePieceTextAlign {\n\tvertical: DAlignVertical;\n\thorizontal: DAlignHorizontal;\n}\n\nexport interface DImagePieceParent extends DApplicationTarget {\n\treadonly state: DBaseStateSet;\n\taddChild(displayObject: DisplayObject): void;\n\tremoveChild(displayObject: DisplayObject): void;\n\ttoDirty(): void;\n\tgetOverflowMask(): Graphics | null;\n}\n\nexport interface DThemeImagePiece {\n\tgetImageAlignHorizontal(): DAlignHorizontal;\n\tgetImageAlignVertical(): DAlignVertical;\n\tgetImageAlignWith(): DAlignWith;\n\tgetImageMarginHorizontal(): number;\n\tgetImageMarginVertial(): number;\n\tgetImageTintColor(state: DBaseStateSet): number | null;\n\tgetImageTintAlpha(state: DBaseStateSet): number;\n\tgetImageSource(state: DBaseStateSet): Texture | DisplayObject | null;\n}\n\nconst toImageAlign = (theme: DThemeImagePiece, options?: DImagePieceOptions): DImagePieceAlign => {\n\tconst align = options?.align;\n\treturn {\n\t\twith: toEnum(align?.with ?? theme.getImageAlignWith(), DAlignWith),\n\t\tvertical: toEnum(align?.vertical ?? theme.getImageAlignVertical(), DAlignVertical),\n\t\thorizontal: toEnum(align?.horizontal ?? theme.getImageAlignHorizontal(), DAlignHorizontal)\n\t};\n};\n\nconst toImageMargin = (\n\ttheme: DThemeImagePiece,\n\toptions?: DImagePieceOptions\n): DImagePieceMargin => {\n\tconst margin = options?.margin;\n\treturn {\n\t\tvertical: margin?.vertical ?? theme.getImageMarginVertial(),\n\t\thorizontal: margin?.horizontal ?? theme.getImageMarginHorizontal()\n\t};\n};\n\nexport class DImagePiece {\n\tprotected _parent: DImagePieceParent;\n\tprotected _theme: DThemeImagePiece;\n\tprotected _textAlign: DImagePieceTextAlign;\n\n\tprotected _image: DisplayObject | null;\n\tprotected _computed: Texture | DisplayObject | null;\n\tprotected _source: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tprotected _align: DImagePieceAlign;\n\tprotected _margin: DImagePieceMargin;\n\tprotected _tint: DImagePieceTintOptions | undefined;\n\tprotected _bound: Rectangle;\n\n\tprotected _onUpdateBound: () => void;\n\n\tconstructor(\n\t\tparent: DImagePieceParent,\n\t\ttheme: DThemeImagePiece,\n\t\ttextAlign: DImagePieceTextAlign,\n\t\toptions?: DImagePieceOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._theme = theme;\n\t\tthis._textAlign = textAlign;\n\n\t\tthis._image = null;\n\t\tthis._align = toImageAlign(theme, options);\n\t\tthis._margin = toImageMargin(theme, options);\n\t\tthis._tint = options?.tint;\n\t\tthis._bound = new Rectangle();\n\t\tthis._source = options?.source;\n\t\tthis._computed = null;\n\n\t\tthis._onUpdateBound = () => {\n\t\t\tthis.onUpdate();\n\t\t};\n\t}\n\n\tget image(): DisplayObject | null {\n\t\treturn this._image;\n\t}\n\n\tget align(): DImagePieceAlign {\n\t\treturn this._align;\n\t}\n\n\tget margin(): DImagePieceMargin {\n\t\treturn this._margin;\n\t}\n\n\tget bound(): Rectangle {\n\t\treturn this._bound;\n\t}\n\n\tget source(): DStateAwareOrValueMightBe<Texture | DisplayObject | null> {\n\t\treturn this._source;\n\t}\n\n\tset source(source: DStateAwareOrValueMightBe<Texture | DisplayObject | null>) {\n\t\tif (this._source !== source) {\n\t\t\tthis._source = source;\n\t\t\tthis.onUpdate();\n\t\t}\n\t}\n\n\tprotected computeSource(): Texture | DisplayObject | null {\n\t\tconst source = this._source;\n\t\tif (source !== undefined) {\n\t\t\tif (isFunction(source)) {\n\t\t\t\tconst result = source(this._parent.state);\n\t\t\t\tif (result !== undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn source;\n\t\t\t}\n\t\t}\n\t\treturn this._theme.getImageSource(this._parent.state);\n\t}\n\n\tonStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tthis.updateTint();\n\t}\n\n\tupdateBound(): void {\n\t\tconst bound = this._bound;\n\t\tconst image = this._image;\n\t\tif (image != null) {\n\t\t\timage.updateTransform();\n\t\t\timage.getLocalBounds(bound);\n\t\t\tconst bl = bound.left;\n\t\t\tconst bt = bound.top;\n\t\t\tconst br = bound.right;\n\t\t\tconst bb = bound.bottom;\n\n\t\t\tconst localTransform = image.localTransform;\n\t\t\tconst a = localTransform.a;\n\t\t\tconst b = localTransform.b;\n\t\t\tconst c = localTransform.c;\n\t\t\tconst d = localTransform.d;\n\n\t\t\tconst x0 = a * bl + c * bt;\n\t\t\tconst y0 = b * bl + d * bt;\n\t\t\tconst x1 = a * br + c * bt;\n\t\t\tconst y1 = b * br + d * bt;\n\t\t\tconst x2 = a * br + c * bb;\n\t\t\tconst y2 = b * br + d * bb;\n\t\t\tconst x3 = a * bl + c * bb;\n\t\t\tconst y3 = b * bl + d * bb;\n\n\t\t\tconst xmin = Math.min(x0, x1, x2, x3);\n\t\t\tconst xmax = Math.max(x0, x1, x2, x3);\n\t\t\tconst ymin = Math.min(y0, y1, y2, y3);\n\t\t\tconst ymax = Math.max(y0, y1, y2, y3);\n\n\t\t\tbound.x = xmin + localTransform.tx;\n\t\t\tbound.y = ymin + localTransform.ty;\n\t\t\tbound.width = xmax - xmin;\n\t\t\tbound.height = ymax - ymin;\n\t\t} else {\n\t\t\tbound.x = 0;\n\t\t\tbound.y = 0;\n\t\t\tbound.width = 0;\n\t\t\tbound.height = 0;\n\t\t}\n\t}\n\n\tprotected isTintAware(\n\t\ttarget: DisplayObject | null\n\t): target is DisplayObject & { tint: number } {\n\t\treturn target != null && \"tint\" in target;\n\t}\n\n\tprotected toTintColor(theme: DThemeImagePiece, state: DBaseStateSet): number | null {\n\t\tconst tint = this._tint;\n\t\tif (tint) {\n\t\t\tconst color = tint.color;\n\t\t\tif (color !== undefined) {\n\t\t\t\tif (isFunction(color)) {\n\t\t\t\t\tconst result = color(state);\n\t\t\t\t\tif (result !== undefined) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theme.getImageTintColor(state);\n\t}\n\n\tprotected toTintAlpha(theme: DThemeImagePiece, state: DBaseStateSet): number {\n\t\tconst tint = this._tint;\n\t\tif (tint) {\n\t\t\tconst alpha = tint.alpha;\n\t\t\tif (alpha !== undefined) {\n\t\t\t\tif (isFunction(alpha)) {\n\t\t\t\t\tconst result = alpha(state);\n\t\t\t\t\tif (result !== undefined) {\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theme.getImageTintAlpha(state);\n\t}\n\n\t/**\n\t * Updates the tint.\n\t *\n\t * @returns True if the tint is changed.\n\t */\n\tupdateTint(): boolean {\n\t\tconst image = this._image;\n\t\tif (image) {\n\t\t\tif (this.isTintAware(image)) {\n\t\t\t\tconst theme = this._theme;\n\t\t\t\tconst state = this._parent.state;\n\t\t\t\tconst color = this.toTintColor(theme, state);\n\t\t\t\tif (color != null) {\n\t\t\t\t\tlet result = false;\n\t\t\t\t\tif (image.tint !== color) {\n\t\t\t\t\t\timage.tint = color;\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst alpha = this.toTintAlpha(theme, state);\n\t\t\t\t\tif (image.alpha !== alpha) {\n\t\t\t\t\t\timage.alpha = alpha;\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Updates the computed source.\n\t *\n\t * @returns True if the computed source is changed\n\t */\n\tupdateSource(): boolean {\n\t\tconst newComputed = this.computeSource();\n\t\tconst oldComputed = this._computed;\n\t\tif (newComputed !== oldComputed) {\n\t\t\tthis._computed = newComputed;\n\n\t\t\tconst parent = this._parent;\n\t\t\tconst oldImage = this._image;\n\t\t\tconst onUpdateBound = this._onUpdateBound;\n\t\t\tif (newComputed instanceof Texture) {\n\t\t\t\tif (oldComputed instanceof Texture) {\n\t\t\t\t\toldComputed.off(\"update\", onUpdateBound);\n\t\t\t\t\tif (oldImage instanceof Sprite) {\n\t\t\t\t\t\toldImage.texture = newComputed;\n\t\t\t\t\t\tnewComputed.on(\"update\", onUpdateBound);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (oldImage != null) {\n\t\t\t\t\t\tparent.removeChild(oldImage);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newImage = new Sprite(newComputed);\n\t\t\t\t\tconst overflowMask = parent.getOverflowMask();\n\t\t\t\t\tif (overflowMask) {\n\t\t\t\t\t\tnewImage.mask = overflowMask;\n\t\t\t\t\t}\n\t\t\t\t\tnewComputed.on(\"update\", onUpdateBound);\n\t\t\t\t\tparent.addChild(newImage);\n\t\t\t\t\tthis._image = newImage;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (oldComputed instanceof Texture) {\n\t\t\t\t\toldComputed.off(\"update\", onUpdateBound);\n\t\t\t\t\tif (oldImage != null) {\n\t\t\t\t\t\tparent.removeChild(oldImage);\n\t\t\t\t\t\toldImage.destroy();\n\t\t\t\t\t}\n\t\t\t\t} else if (oldImage != null) {\n\t\t\t\t\tparent.removeChild(oldImage);\n\t\t\t\t}\n\n\t\t\t\tif (newComputed != null) {\n\t\t\t\t\tconst overflowMask = parent.getOverflowMask();\n\t\t\t\t\tif (overflowMask) {\n\t\t\t\t\t\tnewComputed.mask = overflowMask;\n\t\t\t\t\t}\n\t\t\t\t\tparent.addChild(newComputed);\n\t\t\t\t}\n\t\t\t\tthis._image = newComputed;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tisRefitable(target: any): boolean {\n\t\treturn target != null && target === this._image;\n\t}\n\n\tdestroy(): void {\n\t\tconst image = this._image;\n\t\tif (image) {\n\t\t\tthis._image = null;\n\t\t\tconst computed = this._computed;\n\t\t\tif (computed instanceof Texture) {\n\t\t\t\tcomputed.off(\"update\", this._onUpdateBound, this);\n\t\t\t\timage.destroy();\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onUpdate(): void {\n\t\tthis._parent.toDirty();\n\t\tDApplications.update(this._parent);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-image-piece.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece.ts"],"names":[],"mappings":"","sourcesContent":["import { DisplayObject, Texture } from \"pixi.js\";\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DAlignVertical } from \"./d-align-vertical\";\nimport { DAlignWith } from \"./d-align-with\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DImagePieceTint, DImagePieceTintOptions } from \"./d-image-piece-tint\";\nimport { DImagePieceMargin, DImagePieceMarginOptions } from \"./d-image-piece-margin\";\nimport { DImagePieceAlign, DImagePieceAlignOptions } from \"./d-image-piece-align\";\n\nexport interface DImagePieceOptions {\n\tsource?: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\ttint?: DImagePieceTintOptions;\n\talign?: DImagePieceAlignOptions;\n\tmargin?: DImagePieceMarginOptions;\n\trotation?: DStateAwareOrValueMightBe<number>;\n}\n\nexport interface DThemeImagePiece {\n\tgetImageAlignHorizontal(): DAlignHorizontal;\n\tgetImageAlignVertical(): DAlignVertical;\n\tgetImageAlignWith(): DAlignWith;\n\tgetImageMarginHorizontal(): number;\n\tgetImageMarginVertial(): number;\n\tgetImageTintColor(state: DBaseStateSet): number | null;\n\tgetImageTintAlpha(state: DBaseStateSet): number;\n\tgetImageSource(state: DBaseStateSet): Texture | DisplayObject | null;\n\tgetImageRotation(state: DBaseStateSet): number;\n}\n\nexport interface DImagePiece {\n\treadonly object: DisplayObject | null;\n\treadonly align: DImagePieceAlign;\n\treadonly margin: DImagePieceMargin;\n\treadonly tint: DImagePieceTint;\n\tsource: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\trotation: DStateAwareOrValueMightBe<number>;\n\tdestroy(): void;\n}\n"]}
@@ -0,0 +1,216 @@
1
+ import { DBaseState } from "./d-base-state";
2
+ import { DThemes } from "./theme/d-themes";
3
+ var STATE_INITIAL = 0;
4
+ var STATE_STARTED = 1;
5
+ var STATE_RESOLVED = 2;
6
+ var STATE_REJECTED = 3;
7
+ var DIndicatorProcessing = /** @class */ (function () {
8
+ function DIndicatorProcessing(parent, options) {
9
+ var _a, _b, _c, _d, _e, _f, _g;
10
+ this._parent = parent;
11
+ this._state = STATE_INITIAL;
12
+ this._startTime = 0;
13
+ // Delay
14
+ var theme = this.theme;
15
+ var delay = options === null || options === void 0 ? void 0 : options.delay;
16
+ this._delayDone = (_a = delay === null || delay === void 0 ? void 0 : delay.done) !== null && _a !== void 0 ? _a : theme.getProcessDoneDelay();
17
+ var delayClose = delay === null || delay === void 0 ? void 0 : delay.close;
18
+ this._delayClose = delayClose !== undefined ? delayClose : theme.getProcessCloseDelay();
19
+ // Text
20
+ var text = options === null || options === void 0 ? void 0 : options.text;
21
+ this._isTextEnabled = (_b = text === null || text === void 0 ? void 0 : text.enabled) !== null && _b !== void 0 ? _b : theme.isProcessTextEnabled();
22
+ this._textValue = (_c = text === null || text === void 0 ? void 0 : text.value) !== null && _c !== void 0 ? _c : theme.newProcessTextValue();
23
+ // Image
24
+ var image = options === null || options === void 0 ? void 0 : options.image;
25
+ this._isImageEnabled = (_d = image === null || image === void 0 ? void 0 : image.enabled) !== null && _d !== void 0 ? _d : theme.isProcessImageEnabled();
26
+ this._imageIndex = (_e = image === null || image === void 0 ? void 0 : image.index) !== null && _e !== void 0 ? _e : theme.getProcessImageIndex();
27
+ this._imageSource = (_f = image === null || image === void 0 ? void 0 : image.source) !== null && _f !== void 0 ? _f : theme.newProcessImageSource();
28
+ this._imageRotation = (_g = image === null || image === void 0 ? void 0 : image.rotation) !== null && _g !== void 0 ? _g : theme.newProcessImageRotation();
29
+ // State
30
+ this._wasReadOnly = false;
31
+ }
32
+ DIndicatorProcessing.prototype.start = function () {
33
+ var state = this._state;
34
+ if (state === STATE_INITIAL) {
35
+ this._state = STATE_STARTED;
36
+ this.onBegin();
37
+ }
38
+ else if (state === STATE_RESOLVED || state === STATE_REJECTED) {
39
+ this._state = STATE_STARTED;
40
+ this.onEnd();
41
+ this.onBegin();
42
+ }
43
+ return this;
44
+ };
45
+ DIndicatorProcessing.prototype.onBegin = function () {
46
+ this._startTime = Date.now();
47
+ var timeoutId = this._timeoutId;
48
+ if (timeoutId != null) {
49
+ clearTimeout(timeoutId);
50
+ }
51
+ var closeTimeoutId = this._closeTimeoutId;
52
+ if (closeTimeoutId != null) {
53
+ clearTimeout(closeTimeoutId);
54
+ }
55
+ var parent = this._parent;
56
+ var state = parent.state;
57
+ state.lock();
58
+ state.ticker.remove(DBaseState.PROCESSING).add(DBaseState.PROCESSING, 32);
59
+ state.removeAll(DBaseState.SUCCEEDED, DBaseState.FAILED);
60
+ this._wasReadOnly = state.isReadOnly;
61
+ if (!this._wasReadOnly) {
62
+ state.add(DBaseState.READ_ONLY);
63
+ }
64
+ state.unlock();
65
+ if (this._isTextEnabled) {
66
+ this._textValueBackup = parent.text;
67
+ var textValue = this._textValue;
68
+ if (textValue !== undefined) {
69
+ parent.text = textValue;
70
+ }
71
+ }
72
+ if (this._isImageEnabled) {
73
+ var image = parent.image.get(this._imageIndex);
74
+ if (image != null) {
75
+ this._imageSourceBackup = image.source;
76
+ this._imageRotationBackup = image.rotation;
77
+ var imageSource = this._imageSource;
78
+ if (imageSource !== undefined) {
79
+ image.source = imageSource;
80
+ }
81
+ var imageRotation = this._imageRotation;
82
+ if (imageRotation !== undefined) {
83
+ image.rotation = imageRotation;
84
+ }
85
+ }
86
+ }
87
+ };
88
+ DIndicatorProcessing.prototype.end = function () {
89
+ var state = this._state;
90
+ if (state === STATE_STARTED || state === STATE_RESOLVED || state === STATE_REJECTED) {
91
+ this._state = STATE_INITIAL;
92
+ this.onEnd();
93
+ }
94
+ return this;
95
+ };
96
+ DIndicatorProcessing.prototype.onEnd = function () {
97
+ var timeoutId = this._timeoutId;
98
+ if (timeoutId != null) {
99
+ clearTimeout(timeoutId);
100
+ }
101
+ var closeTimeoutId = this._closeTimeoutId;
102
+ if (closeTimeoutId != null) {
103
+ clearTimeout(closeTimeoutId);
104
+ }
105
+ var parent = this._parent;
106
+ var state = parent.state;
107
+ state.lock();
108
+ state.ticker.remove(DBaseState.PROCESSING);
109
+ state.removeAll(DBaseState.SUCCEEDED, DBaseState.FAILED);
110
+ if (!this._wasReadOnly) {
111
+ state.remove(DBaseState.READ_ONLY);
112
+ }
113
+ state.unlock();
114
+ if (this._isTextEnabled) {
115
+ parent.text = this._textValueBackup;
116
+ }
117
+ if (this._isImageEnabled) {
118
+ var image = parent.image.get(this._imageIndex);
119
+ if (image != null) {
120
+ image.source = this._imageSourceBackup;
121
+ image.rotation = this._imageRotationBackup;
122
+ }
123
+ }
124
+ };
125
+ DIndicatorProcessing.prototype.resolve = function (message) {
126
+ var _this = this;
127
+ if (this._state === STATE_STARTED) {
128
+ this._state = STATE_RESOLVED;
129
+ var elapsedTime = Date.now() - this._startTime;
130
+ var delay = this._delayDone - elapsedTime;
131
+ if (0 < delay) {
132
+ this._timeoutId = window.setTimeout(function () {
133
+ _this._timeoutId = undefined;
134
+ _this.onResolved(message);
135
+ }, delay);
136
+ }
137
+ else {
138
+ this.onResolved(message);
139
+ }
140
+ }
141
+ };
142
+ DIndicatorProcessing.prototype.onResolved = function (message) {
143
+ var parent = this._parent;
144
+ if (this._isTextEnabled && message != null) {
145
+ parent.text = message;
146
+ }
147
+ var state = parent.state;
148
+ state.lock();
149
+ state.ticker.remove(DBaseState.PROCESSING);
150
+ state.add(DBaseState.SUCCEEDED);
151
+ state.remove(DBaseState.FAILED);
152
+ if (!this._wasReadOnly) {
153
+ state.remove(DBaseState.READ_ONLY);
154
+ }
155
+ state.unlock();
156
+ this.onDone(this._delayClose);
157
+ };
158
+ DIndicatorProcessing.prototype.reject = function (message) {
159
+ var _this = this;
160
+ if (this._state === STATE_STARTED) {
161
+ this._state = STATE_REJECTED;
162
+ var elapsedTime = Date.now() - this._startTime;
163
+ var delay = this._delayDone - elapsedTime;
164
+ if (0 < delay) {
165
+ this._timeoutId = window.setTimeout(function () {
166
+ _this._timeoutId = undefined;
167
+ _this.onRejected(message);
168
+ }, delay);
169
+ }
170
+ else {
171
+ this.onRejected(message);
172
+ }
173
+ }
174
+ };
175
+ DIndicatorProcessing.prototype.onRejected = function (message) {
176
+ var parent = this._parent;
177
+ if (this._isTextEnabled && message != null) {
178
+ parent.text = message;
179
+ }
180
+ var state = parent.state;
181
+ state.lock();
182
+ state.ticker.remove(DBaseState.PROCESSING);
183
+ state.add(DBaseState.FAILED);
184
+ state.remove(DBaseState.SUCCEEDED);
185
+ if (!this._wasReadOnly) {
186
+ state.remove(DBaseState.READ_ONLY);
187
+ }
188
+ state.unlock();
189
+ this.onDone(this._delayClose);
190
+ };
191
+ DIndicatorProcessing.prototype.onDone = function (delay) {
192
+ var _this = this;
193
+ if (delay != null) {
194
+ this._closeTimeoutId = window.setTimeout(function () {
195
+ _this._closeTimeoutId = undefined;
196
+ _this.end();
197
+ }, delay);
198
+ }
199
+ else {
200
+ this.end();
201
+ }
202
+ };
203
+ DIndicatorProcessing.prototype.getType = function () {
204
+ return "DIndicatorProcessing";
205
+ };
206
+ Object.defineProperty(DIndicatorProcessing.prototype, "theme", {
207
+ get: function () {
208
+ return DThemes.get(this.getType());
209
+ },
210
+ enumerable: false,
211
+ configurable: true
212
+ });
213
+ return DIndicatorProcessing;
214
+ }());
215
+ export { DIndicatorProcessing };
216
+ //# sourceMappingURL=d-indicator-processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d-indicator-processing.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-indicator-processing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAuC3C,IAAM,aAAa,GAAG,CAAC,CAAC;AACxB,IAAM,aAAa,GAAG,CAAC,CAAC;AACxB,IAAM,cAAc,GAAG,CAAC,CAAC;AACzB,IAAM,cAAc,GAAG,CAAC,CAAC;AAOzB;IAmBC,8BAAY,MAAyB,EAAE,OAA4C;;QAClF,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,QAAQ;QACR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;IAES,qCAAM,GAAhB,UAAiB,KAAoB;QAArC,iBASC;QARA,IAAI,KAAK,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;gBACxC,KAAI,CAAC,eAAe,GAAG,SAAS,CAAC;gBACjC,KAAI,CAAC,GAAG,EAAE,CAAC;YACZ,CAAC,EAAE,KAAK,CAAC,CAAC;SACV;aAAM;YACN,IAAI,CAAC,GAAG,EAAE,CAAC;SACX;IACF,CAAC;IAES,sCAAO,GAAjB;QACC,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IAED,sBAAI,uCAAK;aAAT;YACC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACpC,CAAC;;;OAAA;IACF,2BAAC;AAAD,CAAC,AA3OD,IA2OC","sourcesContent":["import { DisplayObject, Texture } from \"pixi.js\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { DImageBase } from \"./d-image-base\";\n\nexport interface DIndicatorProcessingDelayOptions {\n\tdone?: number;\n\tclose?: number | null;\n}\n\nexport interface DIndicatorProcessingTextOptions<VALUE> {\n\tenabled?: boolean;\n\tvalue?: DStateAwareOrValueMightBe<VALUE>;\n}\n\nexport interface DIndicatorProcessingImageOptions {\n\tenabled?: boolean;\n\tindex?: number;\n\tsource?: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\trotation?: DStateAwareOrValueMightBe<number>;\n}\n\nexport interface DIndicatorProcessingOptions<VALUE> {\n\tdelay?: DIndicatorProcessingDelayOptions;\n\ttext?: DIndicatorProcessingTextOptions<VALUE>;\n\timage?: DIndicatorProcessingImageOptions;\n}\n\nexport interface DThemeIndicatorProcessing<VALUE = unknown> {\n\tgetProcessDoneDelay(): number;\n\tgetProcessCloseDelay(): number | null;\n\n\tisProcessTextEnabled(): boolean;\n\tnewProcessTextValue(): DStateAwareOrValueMightBe<VALUE>;\n\n\tisProcessImageEnabled(): boolean;\n\tgetProcessImageIndex(): number;\n\tnewProcessImageSource(): DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tnewProcessImageRotation(): DStateAwareOrValueMightBe<number>;\n}\n\nconst STATE_INITIAL = 0;\nconst STATE_STARTED = 1;\nconst STATE_RESOLVED = 2;\nconst STATE_REJECTED = 3;\ntype STATE =\n\t| typeof STATE_INITIAL\n\t| typeof STATE_STARTED\n\t| typeof STATE_RESOLVED\n\t| typeof STATE_REJECTED;\n\nexport class DIndicatorProcessing<VALUE> {\n\tprotected _parent: DImageBase<VALUE>;\n\tprotected _state: STATE;\n\tprotected _startTime: number;\n\tprotected _delayDone: number;\n\tprotected _delayClose: number | null;\n\tprotected _timeoutId?: number;\n\tprotected _closeTimeoutId?: number;\n\tprotected _isTextEnabled: boolean;\n\tprotected _textValue: DStateAwareOrValueMightBe<VALUE>;\n\tprotected _textValueBackup?: DStateAwareOrValueMightBe<VALUE>;\n\tprotected _isImageEnabled: boolean;\n\tprotected _imageIndex: number;\n\tprotected _imageSource: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tprotected _imageRotation: DStateAwareOrValueMightBe<number>;\n\tprotected _imageSourceBackup?: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tprotected _imageRotationBackup?: DStateAwareOrValueMightBe<number>;\n\tprotected _wasReadOnly: boolean;\n\n\tconstructor(parent: DImageBase<VALUE>, options?: DIndicatorProcessingOptions<VALUE>) {\n\t\tthis._parent = parent;\n\t\tthis._state = STATE_INITIAL;\n\t\tthis._startTime = 0;\n\n\t\t// Delay\n\t\tconst theme = this.theme;\n\t\tconst delay = options?.delay;\n\t\tthis._delayDone = delay?.done ?? theme.getProcessDoneDelay();\n\t\tconst delayClose = delay?.close;\n\t\tthis._delayClose = delayClose !== undefined ? delayClose : theme.getProcessCloseDelay();\n\n\t\t// Text\n\t\tconst text = options?.text;\n\t\tthis._isTextEnabled = text?.enabled ?? theme.isProcessTextEnabled();\n\t\tthis._textValue = text?.value ?? theme.newProcessTextValue();\n\n\t\t// Image\n\t\tconst image = options?.image;\n\t\tthis._isImageEnabled = image?.enabled ?? theme.isProcessImageEnabled();\n\t\tthis._imageIndex = image?.index ?? theme.getProcessImageIndex();\n\t\tthis._imageSource = image?.source ?? theme.newProcessImageSource();\n\t\tthis._imageRotation = image?.rotation ?? theme.newProcessImageRotation();\n\n\t\t// State\n\t\tthis._wasReadOnly = false;\n\t}\n\n\tstart(): this {\n\t\tconst state = this._state;\n\t\tif (state === STATE_INITIAL) {\n\t\t\tthis._state = STATE_STARTED;\n\t\t\tthis.onBegin();\n\t\t} else if (state === STATE_RESOLVED || state === STATE_REJECTED) {\n\t\t\tthis._state = STATE_STARTED;\n\t\t\tthis.onEnd();\n\t\t\tthis.onBegin();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected onBegin(): void {\n\t\tthis._startTime = Date.now();\n\t\tconst timeoutId = this._timeoutId;\n\t\tif (timeoutId != null) {\n\t\t\tclearTimeout(timeoutId);\n\t\t}\n\t\tconst closeTimeoutId = this._closeTimeoutId;\n\t\tif (closeTimeoutId != null) {\n\t\t\tclearTimeout(closeTimeoutId);\n\t\t}\n\n\t\tconst parent = this._parent;\n\t\tconst state = parent.state;\n\t\tstate.lock();\n\t\tstate.ticker.remove(DBaseState.PROCESSING).add(DBaseState.PROCESSING, 32);\n\t\tstate.removeAll(DBaseState.SUCCEEDED, DBaseState.FAILED);\n\t\tthis._wasReadOnly = state.isReadOnly;\n\t\tif (!this._wasReadOnly) {\n\t\t\tstate.add(DBaseState.READ_ONLY);\n\t\t}\n\t\tstate.unlock();\n\n\t\tif (this._isTextEnabled) {\n\t\t\tthis._textValueBackup = parent.text;\n\t\t\tconst textValue = this._textValue;\n\t\t\tif (textValue !== undefined) {\n\t\t\t\tparent.text = textValue;\n\t\t\t}\n\t\t}\n\n\t\tif (this._isImageEnabled) {\n\t\t\tconst image = parent.image.get(this._imageIndex);\n\t\t\tif (image != null) {\n\t\t\t\tthis._imageSourceBackup = image.source;\n\t\t\t\tthis._imageRotationBackup = image.rotation;\n\t\t\t\tconst imageSource = this._imageSource;\n\t\t\t\tif (imageSource !== undefined) {\n\t\t\t\t\timage.source = imageSource;\n\t\t\t\t}\n\t\t\t\tconst imageRotation = this._imageRotation;\n\t\t\t\tif (imageRotation !== undefined) {\n\t\t\t\t\timage.rotation = imageRotation;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tend(): this {\n\t\tconst state = this._state;\n\t\tif (state === STATE_STARTED || state === STATE_RESOLVED || state === STATE_REJECTED) {\n\t\t\tthis._state = STATE_INITIAL;\n\t\t\tthis.onEnd();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected onEnd(): void {\n\t\tconst timeoutId = this._timeoutId;\n\t\tif (timeoutId != null) {\n\t\t\tclearTimeout(timeoutId);\n\t\t}\n\t\tconst closeTimeoutId = this._closeTimeoutId;\n\t\tif (closeTimeoutId != null) {\n\t\t\tclearTimeout(closeTimeoutId);\n\t\t}\n\n\t\tconst parent = this._parent;\n\t\tconst state = parent.state;\n\t\tstate.lock();\n\t\tstate.ticker.remove(DBaseState.PROCESSING);\n\t\tstate.removeAll(DBaseState.SUCCEEDED, DBaseState.FAILED);\n\t\tif (!this._wasReadOnly) {\n\t\t\tstate.remove(DBaseState.READ_ONLY);\n\t\t}\n\t\tstate.unlock();\n\n\t\tif (this._isTextEnabled) {\n\t\t\tparent.text = this._textValueBackup;\n\t\t}\n\n\t\tif (this._isImageEnabled) {\n\t\t\tconst image = parent.image.get(this._imageIndex);\n\t\t\tif (image != null) {\n\t\t\t\timage.source = this._imageSourceBackup;\n\t\t\t\timage.rotation = this._imageRotationBackup;\n\t\t\t}\n\t\t}\n\t}\n\n\tresolve(message?: DStateAwareOrValueMightBe<VALUE>): void {\n\t\tif (this._state === STATE_STARTED) {\n\t\t\tthis._state = STATE_RESOLVED;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst delay = this._delayDone - elapsedTime;\n\t\t\tif (0 < delay) {\n\t\t\t\tthis._timeoutId = window.setTimeout((): void => {\n\t\t\t\t\tthis._timeoutId = undefined;\n\t\t\t\t\tthis.onResolved(message);\n\t\t\t\t}, delay);\n\t\t\t} else {\n\t\t\t\tthis.onResolved(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onResolved(message?: DStateAwareOrValueMightBe<VALUE>): void {\n\t\tconst parent = this._parent;\n\t\tif (this._isTextEnabled && message != null) {\n\t\t\tparent.text = message;\n\t\t}\n\t\tconst state = parent.state;\n\t\tstate.lock();\n\t\tstate.ticker.remove(DBaseState.PROCESSING);\n\t\tstate.add(DBaseState.SUCCEEDED);\n\t\tstate.remove(DBaseState.FAILED);\n\t\tif (!this._wasReadOnly) {\n\t\t\tstate.remove(DBaseState.READ_ONLY);\n\t\t}\n\t\tstate.unlock();\n\n\t\tthis.onDone(this._delayClose);\n\t}\n\n\treject(message?: DStateAwareOrValueMightBe<VALUE>): void {\n\t\tif (this._state === STATE_STARTED) {\n\t\t\tthis._state = STATE_REJECTED;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst delay = this._delayDone - elapsedTime;\n\t\t\tif (0 < delay) {\n\t\t\t\tthis._timeoutId = window.setTimeout((): void => {\n\t\t\t\t\tthis._timeoutId = undefined;\n\t\t\t\t\tthis.onRejected(message);\n\t\t\t\t}, delay);\n\t\t\t} else {\n\t\t\t\tthis.onRejected(message);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onRejected(message?: DStateAwareOrValueMightBe<VALUE>): void {\n\t\tconst parent = this._parent;\n\t\tif (this._isTextEnabled && message != null) {\n\t\t\tparent.text = message;\n\t\t}\n\t\tconst state = parent.state;\n\t\tstate.lock();\n\t\tstate.ticker.remove(DBaseState.PROCESSING);\n\t\tstate.add(DBaseState.FAILED);\n\t\tstate.remove(DBaseState.SUCCEEDED);\n\t\tif (!this._wasReadOnly) {\n\t\t\tstate.remove(DBaseState.READ_ONLY);\n\t\t}\n\t\tstate.unlock();\n\n\t\tthis.onDone(this._delayClose);\n\t}\n\n\tprotected onDone(delay: number | null): void {\n\t\tif (delay != null) {\n\t\t\tthis._closeTimeoutId = window.setTimeout(() => {\n\t\t\t\tthis._closeTimeoutId = undefined;\n\t\t\t\tthis.end();\n\t\t\t}, delay);\n\t\t} else {\n\t\t\tthis.end();\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DIndicatorProcessing\";\n\t}\n\n\tget theme(): DThemeIndicatorProcessing<VALUE> {\n\t\treturn DThemes.get(this.getType());\n\t}\n}\n"]}
@@ -145,12 +145,17 @@ var DTableHeaderCell = /** @class */ (function (_super) {
145
145
  DTableHeaderCell.prototype.isCheckClicked = function (e) {
146
146
  if (e instanceof InteractionEvent && this._check.isEnabled) {
147
147
  if (this.isSortable) {
148
- var image = this._images[1];
149
- if (image && image.image != null) {
148
+ var image = this.image.get(1);
149
+ if (image) {
150
150
  var position = this.toClickPosition(e);
151
- var bound = image.bound;
152
- var margin = image.margin.horizontal;
153
- return bound.left - margin <= position && position <= bound.right + margin;
151
+ var object = image.object;
152
+ if (object != null) {
153
+ var bound = object.getLocalBounds();
154
+ var margin = image.margin.horizontal;
155
+ var x = object.x;
156
+ return (x + bound.left - margin <= position &&
157
+ position <= x + bound.right + margin);
158
+ }
154
159
  }
155
160
  }
156
161
  else {