@wcardinal/wcardinal-ui 0.155.0 → 0.158.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 (78) hide show
  1. package/dist/types/wcardinal/ui/d-application-layer-like.d.ts +0 -1
  2. package/dist/types/wcardinal/ui/d-application-layer.d.ts +0 -2
  3. package/dist/types/wcardinal/ui/d-base.d.ts +11 -12
  4. package/dist/types/wcardinal/ui/d-diagram-snapshot.d.ts +0 -2
  5. package/dist/types/wcardinal/ui/d-image-base.d.ts +2 -0
  6. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-bottom.d.ts +4 -0
  7. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-center.d.ts +6 -0
  8. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-container.d.ts +25 -0
  9. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-left.d.ts +4 -0
  10. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-middle.d.ts +6 -0
  11. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-right.d.ts +4 -0
  12. package/dist/types/wcardinal/ui/d-image-piece-layouter-part-top.d.ts +4 -0
  13. package/dist/types/wcardinal/ui/d-image-piece-layouter-part.d.ts +8 -0
  14. package/dist/types/wcardinal/ui/d-image-piece-layouter.d.ts +17 -0
  15. package/dist/types/wcardinal/ui/d-menu-sided.d.ts +1 -1
  16. package/dist/types/wcardinal/ui/d-text-base.d.ts +5 -5
  17. package/dist/types/wcardinal/ui/shape/variant/deserialize-connector-line.d.ts +1 -1
  18. package/dist/types/wcardinal/ui/shape/variant/deserialize-line.d.ts +1 -1
  19. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-input.d.ts +1 -1
  20. package/dist/types/wcardinal/ui/theme/white/d-theme-white-input.d.ts +1 -1
  21. package/dist/wcardinal/ui/d-application-layer-like.js.map +1 -1
  22. package/dist/wcardinal/ui/d-application-layer.js +3 -21
  23. package/dist/wcardinal/ui/d-application-layer.js.map +1 -1
  24. package/dist/wcardinal/ui/d-base.js +126 -100
  25. package/dist/wcardinal/ui/d-base.js.map +1 -1
  26. package/dist/wcardinal/ui/d-diagram-snapshot.js +2 -18
  27. package/dist/wcardinal/ui/d-diagram-snapshot.js.map +1 -1
  28. package/dist/wcardinal/ui/d-html-element.js +0 -3
  29. package/dist/wcardinal/ui/d-html-element.js.map +1 -1
  30. package/dist/wcardinal/ui/d-image-base.js +9 -264
  31. package/dist/wcardinal/ui/d-image-base.js.map +1 -1
  32. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js +31 -0
  33. package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js.map +1 -0
  34. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js +24 -0
  35. package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js.map +1 -0
  36. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +158 -0
  37. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -0
  38. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js +30 -0
  39. package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js.map +1 -0
  40. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js +24 -0
  41. package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js.map +1 -0
  42. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js +31 -0
  43. package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js.map +1 -0
  44. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js +32 -0
  45. package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js.map +1 -0
  46. package/dist/wcardinal/ui/d-image-piece-layouter-part.js +18 -0
  47. package/dist/wcardinal/ui/d-image-piece-layouter-part.js.map +1 -0
  48. package/dist/wcardinal/ui/d-image-piece-layouter.js +65 -0
  49. package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -0
  50. package/dist/wcardinal/ui/d-menu-item-text.js +18 -2
  51. package/dist/wcardinal/ui/d-menu-item-text.js.map +1 -1
  52. package/dist/wcardinal/ui/d-menu-sided.js +2 -2
  53. package/dist/wcardinal/ui/d-menu-sided.js.map +1 -1
  54. package/dist/wcardinal/ui/d-picker-color-gradient.js +6 -6
  55. package/dist/wcardinal/ui/d-picker-color-gradient.js.map +1 -1
  56. package/dist/wcardinal/ui/d-text-base.js +34 -24
  57. package/dist/wcardinal/ui/d-text-base.js.map +1 -1
  58. package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js.map +1 -1
  59. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +30 -0
  60. package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
  61. package/dist/wcardinal/ui/shape/variant/deserialize-line.js.map +1 -1
  62. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js +2 -2
  63. package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js.map +1 -1
  64. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js +2 -2
  65. package/dist/wcardinal/ui/theme/white/d-theme-white-input.js.map +1 -1
  66. package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js +3 -1
  67. package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js.map +1 -1
  68. package/dist/wcardinal-ui-theme-dark.js +3 -3
  69. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  70. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  71. package/dist/wcardinal-ui-theme-white.js +3 -3
  72. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  73. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  74. package/dist/wcardinal-ui.cjs.js +785 -611
  75. package/dist/wcardinal-ui.js +781 -607
  76. package/dist/wcardinal-ui.min.js +2 -2
  77. package/dist/wcardinal-ui.min.js.map +1 -1
  78. package/package.json +1 -1
@@ -3,12 +3,10 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { __extends } from "tslib";
6
- import { DAlignHorizontal } from "./d-align-horizontal";
7
- import { DAlignVertical } from "./d-align-vertical";
8
- import { DAlignWith } from "./d-align-with";
9
6
  import { DImageBaseThemeWrapperSecondary } from "./d-image-base-theme-wrapper-secondary";
10
7
  import { DImageBaseThemeWrapperTertiary } from "./d-image-base-theme-wrapper-tertiary";
11
8
  import { DImagePiece } from "./d-image-piece";
9
+ import { DImagePieceLayouter } from "./d-image-piece-layouter";
12
10
  import { DTextBase } from "./d-text-base";
13
11
  var hasSecondaryImageSource = function (theme) {
14
12
  return !!theme.getSecondaryImageSource;
@@ -68,277 +66,24 @@ var DImageBase = /** @class */ (function (_super) {
68
66
  this.updateTextAndImage();
69
67
  };
70
68
  DImageBase.prototype.updateTextAndImage = function () {
71
- var text = this._text;
69
+ var _a;
72
70
  var images = this._images;
73
- var padding = this._padding;
74
- var toRounded = this.toRounded;
75
- var width = this.width;
76
- var height = this.height;
77
- var pl = padding.getLeft();
78
- var pr = padding.getRight();
79
- var pt = padding.getTop();
80
- var pb = padding.getBottom();
81
- var noText = text == null;
82
- var textLeftFirst = noText;
83
- var textTopFirst = noText;
84
- var textRightLastMargin = 0;
85
- var textBottomLastMargin = 0;
86
- var textLeft = 0;
87
- var textRight = 0;
88
- var textTop = 0;
89
- var textBottom = 0;
90
- var paddingLeft = pl;
91
- var paddingRight = width - pr;
92
- var paddingTop = pt;
93
- var paddingBottom = height - pb;
94
- var borderLeft = 0;
95
- var borderRight = width;
96
- var borderTop = 0;
97
- var borderBottom = height;
71
+ var layouter = ((_a = DImageBase.LAYOUTER) !== null && _a !== void 0 ? _a : (DImageBase.LAYOUTER = new DImagePieceLayouter()));
98
72
  for (var i = 0, imax = images.length; i < imax; ++i) {
99
73
  var image = images[i];
100
74
  image.updateSource();
101
75
  image.updateTint();
102
76
  image.updateBound();
103
- var imageImage = image.image;
104
- if (imageImage) {
105
- var imageBound = image.bound;
106
- var imageBoundWidth = imageBound.width;
107
- var imageBoundHeight = imageBound.height;
108
- var imageMargin = image.margin;
109
- var imageMarginHorizontal = imageMargin.horizontal;
110
- var imageMarginVertical = imageMargin.vertical;
111
- // Text
112
- if (image.align.with === DAlignWith.TEXT) {
113
- switch (image.align.horizontal) {
114
- case DAlignHorizontal.LEFT:
115
- imageImage.x = textLeft;
116
- textLeft += imageBoundWidth;
117
- if (textLeftFirst) {
118
- textLeftFirst = false;
119
- }
120
- else {
121
- textLeft += imageMarginHorizontal;
122
- }
123
- break;
124
- case DAlignHorizontal.CENTER:
125
- // DO NOTHING
126
- break;
127
- case DAlignHorizontal.RIGHT:
128
- textRight -= imageBoundWidth;
129
- imageImage.x = textRight;
130
- textRight -= imageMarginHorizontal;
131
- textRightLastMargin = imageMarginHorizontal;
132
- break;
133
- }
134
- switch (image.align.vertical) {
135
- case DAlignVertical.TOP:
136
- imageImage.y = textTop;
137
- textTop += imageBoundHeight;
138
- if (textTopFirst) {
139
- textTopFirst = false;
140
- }
141
- else {
142
- textTop += imageMarginVertical;
143
- }
144
- break;
145
- case DAlignVertical.MIDDLE:
146
- // DO NOTHING
147
- break;
148
- case DAlignVertical.BOTTOM:
149
- textBottom -= imageBoundHeight;
150
- imageImage.y = textBottom;
151
- textBottom -= imageMarginVertical;
152
- textBottomLastMargin = imageMarginVertical;
153
- break;
154
- }
155
- }
156
- // Padding
157
- if (image.align.with === DAlignWith.PADDING) {
158
- switch (image.align.horizontal) {
159
- case DAlignHorizontal.LEFT:
160
- paddingLeft += imageMarginHorizontal;
161
- imageImage.x = toRounded(paddingLeft);
162
- paddingLeft += imageBoundWidth;
163
- break;
164
- case DAlignHorizontal.CENTER:
165
- // DO NOTHING
166
- break;
167
- case DAlignHorizontal.RIGHT:
168
- paddingRight -= imageBoundWidth + imageMarginHorizontal;
169
- imageImage.x = toRounded(paddingRight);
170
- break;
171
- }
172
- switch (image.align.vertical) {
173
- case DAlignVertical.TOP:
174
- paddingTop += imageMarginVertical;
175
- imageImage.y = toRounded(paddingTop);
176
- paddingTop += imageBoundHeight;
177
- break;
178
- case DAlignVertical.MIDDLE:
179
- // DO NOTHING
180
- break;
181
- case DAlignVertical.BOTTOM:
182
- paddingBottom -= imageBoundHeight + imageMarginVertical;
183
- imageImage.y = toRounded(paddingBottom);
184
- break;
185
- }
186
- }
187
- // Border
188
- if (image.align.with === DAlignWith.BORDER) {
189
- switch (image.align.horizontal) {
190
- case DAlignHorizontal.LEFT:
191
- borderLeft += imageMarginHorizontal;
192
- imageImage.x = toRounded(borderLeft);
193
- borderLeft += imageBoundWidth;
194
- break;
195
- case DAlignHorizontal.CENTER:
196
- // DO NOTHING
197
- break;
198
- case DAlignHorizontal.RIGHT:
199
- borderRight -= imageBoundWidth + imageMarginHorizontal;
200
- imageImage.x = toRounded(borderRight);
201
- break;
202
- }
203
- switch (image.align.vertical) {
204
- case DAlignVertical.TOP:
205
- borderTop += imageMarginVertical;
206
- imageImage.y = toRounded(borderTop);
207
- borderTop += imageBoundHeight;
208
- break;
209
- case DAlignVertical.MIDDLE:
210
- // DO NOTHING
211
- break;
212
- case DAlignVertical.BOTTOM:
213
- borderBottom -= imageBoundHeight + imageMarginVertical;
214
- imageImage.y = toRounded(borderBottom);
215
- break;
216
- }
217
- }
218
- }
219
- }
220
- if (noText) {
221
- textRight += textRightLastMargin;
222
- textBottom += textBottomLastMargin;
77
+ layouter.add(image);
223
78
  }
224
- // Text
225
- var textLeftAdjust = 0;
226
- var textCenterAdjust = 0;
227
- var textRightAdjust = 0;
228
- var textTopAdjust = 0;
229
- var textMiddleAdjust = 0;
230
- var textBottomAdjust = 0;
79
+ var text = this._text;
231
80
  if (text != null) {
232
81
  this.updateTextColor(text);
233
- text.setClippingDelta(textLeft - textRight, textTop - textBottom);
234
- var textAlign = this._textAlign;
235
- var textWidth = text.width;
236
- var textHeight = text.height;
237
- switch (textAlign.horizontal) {
238
- case DAlignHorizontal.LEFT:
239
- textLeftAdjust = pl;
240
- textRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;
241
- break;
242
- case DAlignHorizontal.CENTER:
243
- textLeftAdjust = (width - textLeft + textRight - textWidth) * 0.5;
244
- textRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;
245
- break;
246
- case DAlignHorizontal.RIGHT:
247
- textRightAdjust = width - pr;
248
- textLeftAdjust = textRightAdjust + textRight - textWidth - textLeft;
249
- break;
250
- }
251
- text.x = toRounded(textLeftAdjust + textLeft);
252
- textCenterAdjust = textLeftAdjust + textLeft + textWidth * 0.5;
253
- switch (textAlign.vertical) {
254
- case DAlignVertical.TOP:
255
- textTopAdjust = pt;
256
- textBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;
257
- break;
258
- case DAlignVertical.MIDDLE:
259
- textTopAdjust = (height - textTop + textBottom - textHeight) * 0.5;
260
- textBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;
261
- break;
262
- case DAlignVertical.BOTTOM:
263
- textBottomAdjust = height - pb;
264
- textTopAdjust = textBottomAdjust + textBottom - textHeight - textTop;
265
- break;
266
- }
267
- text.y = toRounded(textTopAdjust + textTop);
268
- textMiddleAdjust = textTopAdjust + textTop + textHeight * 0.5;
269
- }
270
- else {
271
- textLeftAdjust = (width - textLeft + textRight) * 0.5;
272
- textRightAdjust = textLeftAdjust + textLeft - textRight;
273
- textCenterAdjust = textLeftAdjust + textLeft;
274
- textTopAdjust = (height - textTop + textBottom) * 0.5;
275
- textBottomAdjust = textTopAdjust + textTop - textBottom;
276
- textMiddleAdjust = textTopAdjust + textTop;
277
- }
278
- var paddingCenterAdjust = width * 0.5;
279
- var paddingMiddleAdjust = height * 0.5;
280
- var borderCenterAdjust = width * 0.5;
281
- var borderMiddleAdjust = height * 0.5;
282
- for (var i = 0, imax = images.length; i < imax; ++i) {
283
- var image = images[i];
284
- var imageImage = image.image;
285
- if (imageImage) {
286
- var imageBound = image.bound;
287
- var imageBoundWidth = imageBound.width;
288
- var imageBoundHeight = imageBound.height;
289
- // Text
290
- if (image.align.with === DAlignWith.TEXT) {
291
- switch (image.align.horizontal) {
292
- case DAlignHorizontal.LEFT:
293
- imageImage.x = toRounded(imageImage.x + textLeftAdjust);
294
- break;
295
- case DAlignHorizontal.CENTER:
296
- imageImage.x = toRounded(textCenterAdjust - imageBoundWidth * 0.5);
297
- break;
298
- case DAlignHorizontal.RIGHT:
299
- imageImage.x = toRounded(imageImage.x + textRightAdjust);
300
- break;
301
- }
302
- switch (image.align.vertical) {
303
- case DAlignVertical.TOP:
304
- imageImage.y = toRounded(imageImage.y + textTopAdjust);
305
- break;
306
- case DAlignVertical.MIDDLE:
307
- imageImage.y = toRounded(textMiddleAdjust - imageBoundHeight * 0.5);
308
- break;
309
- case DAlignVertical.BOTTOM:
310
- imageImage.y = toRounded(imageImage.y + textBottomAdjust);
311
- break;
312
- }
313
- }
314
- // Padding
315
- if (image.align.with === DAlignWith.PADDING) {
316
- switch (image.align.horizontal) {
317
- case DAlignHorizontal.CENTER:
318
- imageImage.x = toRounded(paddingCenterAdjust - imageBoundWidth * 0.5);
319
- break;
320
- }
321
- switch (image.align.vertical) {
322
- case DAlignVertical.MIDDLE:
323
- imageImage.y = toRounded(paddingMiddleAdjust - imageBoundHeight * 0.5);
324
- break;
325
- }
326
- }
327
- // Border
328
- if (image.align.with === DAlignWith.BORDER) {
329
- switch (image.align.horizontal) {
330
- case DAlignHorizontal.CENTER:
331
- imageImage.x = toRounded(borderCenterAdjust - imageBoundWidth * 0.5);
332
- break;
333
- }
334
- switch (image.align.vertical) {
335
- case DAlignVertical.MIDDLE:
336
- imageImage.y = toRounded(borderMiddleAdjust - imageBoundHeight * 0.5);
337
- break;
338
- }
339
- }
340
- }
82
+ layouter.set(text);
341
83
  }
84
+ var auto = this._auto;
85
+ layouter.execute(this._padding, this._textAlign, auto.width.isOn ? null : this.width, auto.height.isOn ? null : this.height);
86
+ layouter.clear();
342
87
  };
343
88
  DImageBase.prototype.isRefitable = function (target) {
344
89
  if (_super.prototype.isRefitable.call(this, target)) {
@@ -1 +1 @@
1
- {"version":3,"file":"d-image-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-base.ts"],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B,GAAG,gBAAgB,GAAG,GAAG,CAAC,CAAC;4BACtE,MAAM;qBACP;iBACD;aACD;SACD;IACF,CAAC;IAES,gCAAW,GAArB,UAAsB,MAAW;QAChC,IAAI,iBAAM,WAAW,YAAC,MAAM,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC;SACZ;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;gBAClC,OAAO,IAAI,CAAC;aACZ;SACD;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAES,4BAAO,GAAjB;QACC,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,4BAAO,GAAP;QACC,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,iBAAC;AAAD,CAAC,AA7XD,CAIU,SAAS,GAyXlB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject, Texture } from \"pixi.js\";\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DAlignVertical } from \"./d-align-vertical\";\nimport { DAlignWith } from \"./d-align-with\";\nimport { DRefitable } from \"./d-base\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport {\n\tDImageBaseThemeWrapperSecondary,\n\tDThemeImageBaseSecondary\n} from \"./d-image-base-theme-wrapper-secondary\";\nimport {\n\tDImageBaseThemeWrapperTertiary,\n\tDThemeImageBaseTertiary\n} from \"./d-image-base-theme-wrapper-tertiary\";\nimport { DImagePiece, DImagePieceOptions, DThemeImagePiece } from \"./d-image-piece\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DTextBase, DTextBaseEvents, DTextBaseOptions, DThemeTextBase } from \"./d-text-base\";\n\n/**\n * {@link DImageBase} events.\n */\nexport interface DImageBaseEvents<VALUE, EMITTER> extends DTextBaseEvents<VALUE, EMITTER> {}\n\n/**\n * {@link DImageBase} \"on\" options.\n */\nexport interface DImageBaseOnOptions<VALUE, EMITTER>\n\textends Partial<DImageBaseEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DImageBase} options.\n */\nexport interface DImageBaseOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeImageBase<VALUE> = DThemeImageBase<VALUE>,\n\tEMITTER = any\n> extends DTextBaseOptions<VALUE, THEME, EMITTER> {\n\timage?: DImagePieceOptions;\n\ton?: DImageBaseOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DImageBase} theme.\n */\nexport interface DThemeImageBase<VALUE = unknown> extends DThemeTextBase<VALUE>, DThemeImagePiece {\n\tgetSecondaryImageAlignHorizontal(): DAlignHorizontal;\n\tgetSecondaryImageAlignVertical(): DAlignVertical;\n\tgetSecondaryImageAlignWith(): DAlignWith;\n\tgetSecondaryImageMarginHorizontal(): number;\n\tgetSecondaryImageMarginVertial(): number;\n\tgetSecondaryImageTintColor(state: DBaseStateSet): number | null;\n\tgetSecondaryImageTintAlpha(state: DBaseStateSet): number;\n\tgetSecondaryImageSource?(state: DBaseStateSet): Texture | DisplayObject | null;\n\n\tgetTertiaryImageAlignHorizontal(): DAlignHorizontal;\n\tgetTertiaryImageAlignVertical(): DAlignVertical;\n\tgetTertiaryImageAlignWith(): DAlignWith;\n\tgetTertiaryImageMarginHorizontal(): number;\n\tgetTertiaryImageMarginVertial(): number;\n\tgetTertiaryImageTintColor(state: DBaseStateSet): number | null;\n\tgetTertiaryImageTintAlpha(state: DBaseStateSet): number;\n\tgetTertiaryImageSource?(state: DBaseStateSet): Texture | DisplayObject | null;\n}\n\nconst hasSecondaryImageSource = <VALUE>(\n\ttheme: DThemeImageBase<VALUE>\n): theme is DThemeImageBase<VALUE> & DThemeImageBaseSecondary => {\n\treturn !!theme.getSecondaryImageSource;\n};\n\nconst hasTertiaryImageSource = <VALUE>(\n\ttheme: DThemeImageBase<VALUE>\n): theme is DThemeImageBase<VALUE> & DThemeImageBaseTertiary => {\n\treturn !!theme.getTertiaryImageSource;\n};\n\n/**\n * A base class for UI classes with an image support.\n * See {@link DImageBaseEvents} for event details.\n */\nexport class DImageBase<\n\tVALUE = unknown,\n\tTHEME extends DThemeImageBase<VALUE> = DThemeImageBase<VALUE>,\n\tOPTIONS extends DImageBaseOptions<VALUE, THEME> = DImageBaseOptions<VALUE, THEME>\n> extends DTextBase<VALUE, THEME, OPTIONS> {\n\tprotected _images!: DImagePiece[];\n\n\tprotected init(options?: OPTIONS): void {\n\t\tthis._images = this.newImages(this.theme, options);\n\t\tsuper.init(options);\n\t}\n\n\tprotected newImages(theme: THEME, options?: OPTIONS): DImagePiece[] {\n\t\tconst images: DImagePiece[] = [];\n\t\timages.push(this.newImage(theme, this.toImageOptions(theme, options?.image)));\n\t\tif (hasSecondaryImageSource(theme)) {\n\t\t\timages.push(this.newImage(new DImageBaseThemeWrapperSecondary(theme)));\n\t\t}\n\t\tif (hasTertiaryImageSource(theme)) {\n\t\t\timages.push(this.newImage(new DImageBaseThemeWrapperTertiary(theme)));\n\t\t}\n\t\treturn images;\n\t}\n\n\tprotected toImageOptions(\n\t\ttheme: THEME,\n\t\toptions?: DImagePieceOptions\n\t): DImagePieceOptions | undefined {\n\t\treturn options;\n\t}\n\n\tprotected newImage(theme: DThemeImagePiece, options?: DImagePieceOptions): DImagePiece {\n\t\treturn new DImagePiece(this, theme, this._textAlign, options);\n\t}\n\n\tget image(): DStateAwareOrValueMightBe<Texture | DisplayObject | null> {\n\t\treturn this._images[0].source;\n\t}\n\n\tset image(imageSource: DStateAwareOrValueMightBe<Texture | DisplayObject | null>) {\n\t\tthis._images[0].source = imageSource;\n\t}\n\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tsuper.onStateChange(newState, oldState);\n\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\timages[i].onStateChange(newState, oldState);\n\t\t}\n\t}\n\n\tprotected updateText(): void {\n\t\tthis.updateTextValue();\n\t\tthis.updateTextAndImage();\n\t}\n\n\tprotected updateTextAndImage(): void {\n\t\tconst text = this._text;\n\t\tconst images = this._images;\n\t\tconst padding = this._padding;\n\n\t\tconst toRounded = this.toRounded;\n\n\t\tconst width = this.width;\n\t\tconst height = this.height;\n\n\t\tconst pl = padding.getLeft();\n\t\tconst pr = padding.getRight();\n\t\tconst pt = padding.getTop();\n\t\tconst pb = padding.getBottom();\n\n\t\tconst noText = text == null;\n\n\t\tlet textLeftFirst = noText;\n\t\tlet textTopFirst = noText;\n\n\t\tlet textRightLastMargin = 0;\n\t\tlet textBottomLastMargin = 0;\n\n\t\tlet textLeft = 0;\n\t\tlet textRight = 0;\n\t\tlet textTop = 0;\n\t\tlet textBottom = 0;\n\n\t\tlet paddingLeft = pl;\n\t\tlet paddingRight = width - pr;\n\t\tlet paddingTop = pt;\n\t\tlet paddingBottom = height - pb;\n\n\t\tlet borderLeft = 0;\n\t\tlet borderRight = width;\n\t\tlet borderTop = 0;\n\t\tlet borderBottom = height;\n\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\tconst image = images[i];\n\t\t\timage.updateSource();\n\t\t\timage.updateTint();\n\t\t\timage.updateBound();\n\n\t\t\tconst imageImage = image.image;\n\t\t\tif (imageImage) {\n\t\t\t\tconst imageBound = image.bound;\n\t\t\t\tconst imageBoundWidth = imageBound.width;\n\t\t\t\tconst imageBoundHeight = imageBound.height;\n\t\t\t\tconst imageMargin = image.margin;\n\t\t\t\tconst imageMarginHorizontal = imageMargin.horizontal;\n\t\t\t\tconst imageMarginVertical = imageMargin.vertical;\n\n\t\t\t\t// Text\n\t\t\t\tif (image.align.with === DAlignWith.TEXT) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\t\t\timageImage.x = textLeft;\n\t\t\t\t\t\t\ttextLeft += imageBoundWidth;\n\t\t\t\t\t\t\tif (textLeftFirst) {\n\t\t\t\t\t\t\t\ttextLeftFirst = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttextLeft += imageMarginHorizontal;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\t\t\ttextRight -= imageBoundWidth;\n\t\t\t\t\t\t\timageImage.x = textRight;\n\t\t\t\t\t\t\ttextRight -= imageMarginHorizontal;\n\t\t\t\t\t\t\ttextRightLastMargin = imageMarginHorizontal;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\t\t\timageImage.y = textTop;\n\t\t\t\t\t\t\ttextTop += imageBoundHeight;\n\t\t\t\t\t\t\tif (textTopFirst) {\n\t\t\t\t\t\t\t\ttextTopFirst = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttextTop += imageMarginVertical;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\t\t\ttextBottom -= imageBoundHeight;\n\t\t\t\t\t\t\timageImage.y = textBottom;\n\t\t\t\t\t\t\ttextBottom -= imageMarginVertical;\n\t\t\t\t\t\t\ttextBottomLastMargin = imageMarginVertical;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Padding\n\t\t\t\tif (image.align.with === DAlignWith.PADDING) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\t\t\tpaddingLeft += imageMarginHorizontal;\n\t\t\t\t\t\t\timageImage.x = toRounded(paddingLeft);\n\t\t\t\t\t\t\tpaddingLeft += imageBoundWidth;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\t\t\tpaddingRight -= imageBoundWidth + imageMarginHorizontal;\n\t\t\t\t\t\t\timageImage.x = toRounded(paddingRight);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\t\t\tpaddingTop += imageMarginVertical;\n\t\t\t\t\t\t\timageImage.y = toRounded(paddingTop);\n\t\t\t\t\t\t\tpaddingTop += imageBoundHeight;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\t\t\tpaddingBottom -= imageBoundHeight + imageMarginVertical;\n\t\t\t\t\t\t\timageImage.y = toRounded(paddingBottom);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Border\n\t\t\t\tif (image.align.with === DAlignWith.BORDER) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\t\t\tborderLeft += imageMarginHorizontal;\n\t\t\t\t\t\t\timageImage.x = toRounded(borderLeft);\n\t\t\t\t\t\t\tborderLeft += imageBoundWidth;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\t\t\tborderRight -= imageBoundWidth + imageMarginHorizontal;\n\t\t\t\t\t\t\timageImage.x = toRounded(borderRight);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\t\t\tborderTop += imageMarginVertical;\n\t\t\t\t\t\t\timageImage.y = toRounded(borderTop);\n\t\t\t\t\t\t\tborderTop += imageBoundHeight;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\t// DO NOTHING\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\t\t\tborderBottom -= imageBoundHeight + imageMarginVertical;\n\t\t\t\t\t\t\timageImage.y = toRounded(borderBottom);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (noText) {\n\t\t\ttextRight += textRightLastMargin;\n\t\t\ttextBottom += textBottomLastMargin;\n\t\t}\n\n\t\t// Text\n\t\tlet textLeftAdjust = 0;\n\t\tlet textCenterAdjust = 0;\n\t\tlet textRightAdjust = 0;\n\t\tlet textTopAdjust = 0;\n\t\tlet textMiddleAdjust = 0;\n\t\tlet textBottomAdjust = 0;\n\n\t\tif (text != null) {\n\t\t\tthis.updateTextColor(text);\n\t\t\ttext.setClippingDelta(textLeft - textRight, textTop - textBottom);\n\n\t\t\tconst textAlign = this._textAlign;\n\t\t\tconst textWidth = text.width;\n\t\t\tconst textHeight = text.height;\n\t\t\tswitch (textAlign.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\ttextLeftAdjust = pl;\n\t\t\t\t\ttextRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\ttextLeftAdjust = (width - textLeft + textRight - textWidth) * 0.5;\n\t\t\t\t\ttextRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\ttextRightAdjust = width - pr;\n\t\t\t\t\ttextLeftAdjust = textRightAdjust + textRight - textWidth - textLeft;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttext.x = toRounded(textLeftAdjust + textLeft);\n\t\t\ttextCenterAdjust = textLeftAdjust + textLeft + textWidth * 0.5;\n\n\t\t\tswitch (textAlign.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\ttextTopAdjust = pt;\n\t\t\t\t\ttextBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\ttextTopAdjust = (height - textTop + textBottom - textHeight) * 0.5;\n\t\t\t\t\ttextBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\ttextBottomAdjust = height - pb;\n\t\t\t\t\ttextTopAdjust = textBottomAdjust + textBottom - textHeight - textTop;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttext.y = toRounded(textTopAdjust + textTop);\n\t\t\ttextMiddleAdjust = textTopAdjust + textTop + textHeight * 0.5;\n\t\t} else {\n\t\t\ttextLeftAdjust = (width - textLeft + textRight) * 0.5;\n\t\t\ttextRightAdjust = textLeftAdjust + textLeft - textRight;\n\t\t\ttextCenterAdjust = textLeftAdjust + textLeft;\n\n\t\t\ttextTopAdjust = (height - textTop + textBottom) * 0.5;\n\t\t\ttextBottomAdjust = textTopAdjust + textTop - textBottom;\n\t\t\ttextMiddleAdjust = textTopAdjust + textTop;\n\t\t}\n\n\t\tconst paddingCenterAdjust = width * 0.5;\n\t\tconst paddingMiddleAdjust = height * 0.5;\n\n\t\tconst borderCenterAdjust = width * 0.5;\n\t\tconst borderMiddleAdjust = height * 0.5;\n\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\tconst image = images[i];\n\t\t\tconst imageImage = image.image;\n\t\t\tif (imageImage) {\n\t\t\t\tconst imageBound = image.bound;\n\t\t\t\tconst imageBoundWidth = imageBound.width;\n\t\t\t\tconst imageBoundHeight = imageBound.height;\n\n\t\t\t\t// Text\n\t\t\t\tif (image.align.with === DAlignWith.TEXT) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\t\t\timageImage.x = toRounded(imageImage.x + textLeftAdjust);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\timageImage.x = toRounded(textCenterAdjust - imageBoundWidth * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\t\t\timageImage.x = toRounded(imageImage.x + textRightAdjust);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\t\t\timageImage.y = toRounded(imageImage.y + textTopAdjust);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\timageImage.y = toRounded(textMiddleAdjust - imageBoundHeight * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\t\t\timageImage.y = toRounded(imageImage.y + textBottomAdjust);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Padding\n\t\t\t\tif (image.align.with === DAlignWith.PADDING) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\timageImage.x = toRounded(paddingCenterAdjust - imageBoundWidth * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\timageImage.y = toRounded(paddingMiddleAdjust - imageBoundHeight * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Border\n\t\t\t\tif (image.align.with === DAlignWith.BORDER) {\n\t\t\t\t\tswitch (image.align.horizontal) {\n\t\t\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\t\t\timageImage.x = toRounded(borderCenterAdjust - imageBoundWidth * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (image.align.vertical) {\n\t\t\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\t\t\timageImage.y = toRounded(borderMiddleAdjust - imageBoundHeight * 0.5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected isRefitable(target: any): target is DRefitable {\n\t\tif (super.isRefitable(target)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\tif (images[i].isRefitable(target)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DImageBase\";\n\t}\n\n\tdestroy(): void {\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\timages[i].destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-image-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAQH,OAAO,EACN,+BAA+B,EAE/B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,8BAA8B,EAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAwC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,SAAS,EAAqD,MAAM,eAAe,CAAC;AAiD7F,IAAM,uBAAuB,GAAG,UAC/B,KAA6B;IAE7B,OAAO,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;AACxC,CAAC,CAAC;AAEF,IAAM,sBAAsB,GAAG,UAC9B,KAA6B;IAE7B,OAAO,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC;AACvC,CAAC,CAAC;AAEF;;;GAGG;AACH;IAIU,8BAAgC;IAJ1C;;IA6GA,CAAC;IArGU,yBAAI,GAAd,UAAe,OAAiB;QAC/B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnD,iBAAM,IAAI,YAAC,OAAO,CAAC,CAAC;IACrB,CAAC;IAES,8BAAS,GAAnB,UAAoB,KAAY,EAAE,OAAiB;QAClD,IAAM,MAAM,GAAkB,EAAE,CAAC;QAC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MAAM,CACrC,CAAC;QACF,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;IAES,gCAAW,GAArB,UAAsB,MAAW;QAChC,IAAI,iBAAM,WAAW,YAAC,MAAM,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC;SACZ;QAED,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE;gBAClC,OAAO,IAAI,CAAC;aACZ;SACD;QAED,OAAO,KAAK,CAAC;IACd,CAAC;IAES,4BAAO,GAAjB;QACC,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,4BAAO,GAAP;QACC,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,iBAAC;AAAD,CAAC,AA7GD,CAIU,SAAS,GAyGlB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject, Texture } from \"pixi.js\";\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DAlignVertical } from \"./d-align-vertical\";\nimport { DAlignWith } from \"./d-align-with\";\nimport { DRefitable } from \"./d-base\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport {\n\tDImageBaseThemeWrapperSecondary,\n\tDThemeImageBaseSecondary\n} from \"./d-image-base-theme-wrapper-secondary\";\nimport {\n\tDImageBaseThemeWrapperTertiary,\n\tDThemeImageBaseTertiary\n} from \"./d-image-base-theme-wrapper-tertiary\";\nimport { DImagePiece, DImagePieceOptions, DThemeImagePiece } from \"./d-image-piece\";\nimport { DImagePieceLayouter } from \"./d-image-piece-layouter\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DStateAwareOrValueMightBe } from \"./d-state-aware\";\nimport { DTextBase, DTextBaseEvents, DTextBaseOptions, DThemeTextBase } from \"./d-text-base\";\n\n/**\n * {@link DImageBase} events.\n */\nexport interface DImageBaseEvents<VALUE, EMITTER> extends DTextBaseEvents<VALUE, EMITTER> {}\n\n/**\n * {@link DImageBase} \"on\" options.\n */\nexport interface DImageBaseOnOptions<VALUE, EMITTER>\n\textends Partial<DImageBaseEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DImageBase} options.\n */\nexport interface DImageBaseOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeImageBase<VALUE> = DThemeImageBase<VALUE>,\n\tEMITTER = any\n> extends DTextBaseOptions<VALUE, THEME, EMITTER> {\n\timage?: DImagePieceOptions;\n\ton?: DImageBaseOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DImageBase} theme.\n */\nexport interface DThemeImageBase<VALUE = unknown> extends DThemeTextBase<VALUE>, DThemeImagePiece {\n\tgetSecondaryImageAlignHorizontal(): DAlignHorizontal;\n\tgetSecondaryImageAlignVertical(): DAlignVertical;\n\tgetSecondaryImageAlignWith(): DAlignWith;\n\tgetSecondaryImageMarginHorizontal(): number;\n\tgetSecondaryImageMarginVertial(): number;\n\tgetSecondaryImageTintColor(state: DBaseStateSet): number | null;\n\tgetSecondaryImageTintAlpha(state: DBaseStateSet): number;\n\tgetSecondaryImageSource?(state: DBaseStateSet): Texture | DisplayObject | null;\n\n\tgetTertiaryImageAlignHorizontal(): DAlignHorizontal;\n\tgetTertiaryImageAlignVertical(): DAlignVertical;\n\tgetTertiaryImageAlignWith(): DAlignWith;\n\tgetTertiaryImageMarginHorizontal(): number;\n\tgetTertiaryImageMarginVertial(): number;\n\tgetTertiaryImageTintColor(state: DBaseStateSet): number | null;\n\tgetTertiaryImageTintAlpha(state: DBaseStateSet): number;\n\tgetTertiaryImageSource?(state: DBaseStateSet): Texture | DisplayObject | null;\n}\n\nconst hasSecondaryImageSource = <VALUE>(\n\ttheme: DThemeImageBase<VALUE>\n): theme is DThemeImageBase<VALUE> & DThemeImageBaseSecondary => {\n\treturn !!theme.getSecondaryImageSource;\n};\n\nconst hasTertiaryImageSource = <VALUE>(\n\ttheme: DThemeImageBase<VALUE>\n): theme is DThemeImageBase<VALUE> & DThemeImageBaseTertiary => {\n\treturn !!theme.getTertiaryImageSource;\n};\n\n/**\n * A base class for UI classes with an image support.\n * See {@link DImageBaseEvents} for event details.\n */\nexport class DImageBase<\n\tVALUE = unknown,\n\tTHEME extends DThemeImageBase<VALUE> = DThemeImageBase<VALUE>,\n\tOPTIONS extends DImageBaseOptions<VALUE, THEME> = DImageBaseOptions<VALUE, THEME>\n> extends DTextBase<VALUE, THEME, OPTIONS> {\n\tprotected static LAYOUTER?: DImagePieceLayouter;\n\tprotected _images!: DImagePiece[];\n\n\tprotected init(options?: OPTIONS): void {\n\t\tthis._images = this.newImages(this.theme, options);\n\t\tsuper.init(options);\n\t}\n\n\tprotected newImages(theme: THEME, options?: OPTIONS): DImagePiece[] {\n\t\tconst images: DImagePiece[] = [];\n\t\timages.push(this.newImage(theme, this.toImageOptions(theme, options?.image)));\n\t\tif (hasSecondaryImageSource(theme)) {\n\t\t\timages.push(this.newImage(new DImageBaseThemeWrapperSecondary(theme)));\n\t\t}\n\t\tif (hasTertiaryImageSource(theme)) {\n\t\t\timages.push(this.newImage(new DImageBaseThemeWrapperTertiary(theme)));\n\t\t}\n\t\treturn images;\n\t}\n\n\tprotected toImageOptions(\n\t\ttheme: THEME,\n\t\toptions?: DImagePieceOptions\n\t): DImagePieceOptions | undefined {\n\t\treturn options;\n\t}\n\n\tprotected newImage(theme: DThemeImagePiece, options?: DImagePieceOptions): DImagePiece {\n\t\treturn new DImagePiece(this, theme, this._textAlign, options);\n\t}\n\n\tget image(): DStateAwareOrValueMightBe<Texture | DisplayObject | null> {\n\t\treturn this._images[0].source;\n\t}\n\n\tset image(imageSource: DStateAwareOrValueMightBe<Texture | DisplayObject | null>) {\n\t\tthis._images[0].source = imageSource;\n\t}\n\n\tprotected onStateChange(newState: DBaseStateSet, oldState: DBaseStateSet): void {\n\t\tsuper.onStateChange(newState, oldState);\n\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\timages[i].onStateChange(newState, oldState);\n\t\t}\n\t}\n\n\tprotected updateText(): void {\n\t\tthis.updateTextValue();\n\t\tthis.updateTextAndImage();\n\t}\n\n\tprotected updateTextAndImage(): void {\n\t\tconst images = this._images;\n\t\tconst layouter = (DImageBase.LAYOUTER ??= new DImagePieceLayouter());\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\tconst image = images[i];\n\t\t\timage.updateSource();\n\t\t\timage.updateTint();\n\t\t\timage.updateBound();\n\t\t\tlayouter.add(image);\n\t\t}\n\t\tconst text = this._text;\n\t\tif (text != null) {\n\t\t\tthis.updateTextColor(text);\n\t\t\tlayouter.set(text);\n\t\t}\n\t\tconst auto = this._auto;\n\t\tlayouter.execute(\n\t\t\tthis._padding,\n\t\t\tthis._textAlign,\n\t\t\tauto.width.isOn ? null : this.width,\n\t\t\tauto.height.isOn ? null : this.height\n\t\t);\n\t\tlayouter.clear();\n\t}\n\n\tprotected isRefitable(target: any): target is DRefitable {\n\t\tif (super.isRefitable(target)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\tif (images[i].isRefitable(target)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DImageBase\";\n\t}\n\n\tdestroy(): void {\n\t\tconst images = this._images;\n\t\tfor (let i = 0, imax = images.length; i < imax; ++i) {\n\t\t\timages[i].destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { __extends } from "tslib";
2
+ import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
3
+ var DImagePieceLayouterPartBottom = /** @class */ (function (_super) {
4
+ __extends(DImagePieceLayouterPartBottom, _super);
5
+ function DImagePieceLayouterPartBottom() {
6
+ return _super !== null && _super.apply(this, arguments) || this;
7
+ }
8
+ DImagePieceLayouterPartBottom.prototype.execute = function (pbottom, height, marginAfter) {
9
+ var pieces = this.pieces;
10
+ var y = height - pbottom;
11
+ if (marginAfter) {
12
+ var margin = 0;
13
+ for (var i = 0, imax = pieces.length; i < imax; ++i) {
14
+ var piece = pieces[i];
15
+ y -= margin + piece.bound.height;
16
+ piece.image.y = y;
17
+ margin = piece.margin.horizontal;
18
+ }
19
+ }
20
+ else {
21
+ for (var i = 0, imax = pieces.length; i < imax; ++i) {
22
+ var piece = pieces[i];
23
+ y -= piece.margin.horizontal + piece.bound.height;
24
+ piece.image.y = y;
25
+ }
26
+ }
27
+ };
28
+ return DImagePieceLayouterPartBottom;
29
+ }(DImagePieceLayouterPart));
30
+ export { DImagePieceLayouterPartBottom };
31
+ //# sourceMappingURL=d-image-piece-layouter-part-bottom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d-image-piece-layouter-part-bottom.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-bottom.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAmD,iDAAuB;IAA1E;;IAoBA,CAAC;IAnBA,+CAAO,GAAP,UAAQ,OAAe,EAAE,MAAc,EAAE,WAAoB;QAC5D,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC;QACzB,IAAI,WAAW,EAAE;YAChB,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBACjC,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;gBACnB,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;aACjC;SACD;aAAM;YACN,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;gBAClD,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,CAAC;aACnB;SACD;IACF,CAAC;IACF,oCAAC;AAAD,CAAC,AApBD,CAAmD,uBAAuB,GAoBzE","sourcesContent":["import { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartBottom extends DImagePieceLayouterPart {\n\texecute(pbottom: number, height: number, marginAfter: boolean): void {\n\t\tconst pieces = this.pieces;\n\t\tlet y = height - pbottom;\n\t\tif (marginAfter) {\n\t\t\tlet margin = 0;\n\t\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\t\tconst piece = pieces[i];\n\t\t\t\ty -= margin + piece.bound.height;\n\t\t\t\tpiece.image!.y = y;\n\t\t\t\tmargin = piece.margin.horizontal;\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\t\tconst piece = pieces[i];\n\t\t\t\ty -= piece.margin.horizontal + piece.bound.height;\n\t\t\t\tpiece.image!.y = y;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import { __extends } from "tslib";
2
+ import { DImagePieceLayouterPart } from "./d-image-piece-layouter-part";
3
+ var DImagePieceLayouterPartCenter = /** @class */ (function (_super) {
4
+ __extends(DImagePieceLayouterPartCenter, _super);
5
+ function DImagePieceLayouterPartCenter() {
6
+ return _super !== null && _super.apply(this, arguments) || this;
7
+ }
8
+ DImagePieceLayouterPartCenter.prototype.add = function (image, size, margin) {
9
+ var pieces = this.pieces;
10
+ pieces.push(image);
11
+ this.size = Math.max(this.size, size);
12
+ };
13
+ DImagePieceLayouterPartCenter.prototype.execute = function (pleft, pright, width) {
14
+ var c = pleft + (width - pleft - pright) * 0.5;
15
+ var pieces = this.pieces;
16
+ for (var i = 0, imax = pieces.length; i < imax; ++i) {
17
+ var piece = pieces[i];
18
+ piece.image.x = c - piece.bound.width * 0.5;
19
+ }
20
+ };
21
+ return DImagePieceLayouterPartCenter;
22
+ }(DImagePieceLayouterPart));
23
+ export { DImagePieceLayouterPartCenter };
24
+ //# sourceMappingURL=d-image-piece-layouter-part-center.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d-image-piece-layouter-part-center.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-center.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IAAmD,iDAAuB;IAA1E;;IAeA,CAAC;IAdA,2CAAG,GAAH,UAAI,KAAkB,EAAE,IAAY,EAAE,MAAc;QACnD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,+CAAO,GAAP,UAAQ,KAAa,EAAE,MAAc,EAAE,KAAa;QACnD,IAAM,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC;QACjD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,KAAK,CAAC,KAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;SAC7C;IACF,CAAC;IACF,oCAAC;AAAD,CAAC,AAfD,CAAmD,uBAAuB,GAezE","sourcesContent":["import { DImagePiece } from \"./d-image-piece\";\nimport { DImagePieceLayouterPart } from \"./d-image-piece-layouter-part\";\n\nexport class DImagePieceLayouterPartCenter extends DImagePieceLayouterPart {\n\tadd(image: DImagePiece, size: number, margin: number): void {\n\t\tconst pieces = this.pieces;\n\t\tpieces.push(image);\n\t\tthis.size = Math.max(this.size, size);\n\t}\n\n\texecute(pleft: number, pright: number, width: number): void {\n\t\tconst c = pleft + (width - pleft - pright) * 0.5;\n\t\tconst pieces = this.pieces;\n\t\tfor (let i = 0, imax = pieces.length; i < imax; ++i) {\n\t\t\tconst piece = pieces[i];\n\t\t\tpiece.image!.x = c - piece.bound.width * 0.5;\n\t\t}\n\t}\n}\n"]}
@@ -0,0 +1,158 @@
1
+ import { DAlignHorizontal } from "./d-align-horizontal";
2
+ import { DAlignVertical } from "./d-align-vertical";
3
+ import { DImagePieceLayouterPartBottom } from "./d-image-piece-layouter-part-bottom";
4
+ import { DImagePieceLayouterPartCenter } from "./d-image-piece-layouter-part-center";
5
+ import { DImagePieceLayouterPartLeft } from "./d-image-piece-layouter-part-left";
6
+ import { DImagePieceLayouterPartMiddle } from "./d-image-piece-layouter-part-middle";
7
+ import { DImagePieceLayouterPartRight } from "./d-image-piece-layouter-part-right";
8
+ import { DImagePieceLayouterPartTop } from "./d-image-piece-layouter-part-top";
9
+ var DImagePieceLayouterPartContainer = /** @class */ (function () {
10
+ function DImagePieceLayouterPartContainer() {
11
+ this.left = new DImagePieceLayouterPartLeft();
12
+ this.center = new DImagePieceLayouterPartCenter();
13
+ this.right = new DImagePieceLayouterPartRight();
14
+ this.top = new DImagePieceLayouterPartTop();
15
+ this.middle = new DImagePieceLayouterPartMiddle();
16
+ this.bottom = new DImagePieceLayouterPartBottom();
17
+ }
18
+ DImagePieceLayouterPartContainer.prototype.clear = function () {
19
+ this.left.clear();
20
+ this.center.clear();
21
+ this.right.clear();
22
+ this.top.clear();
23
+ this.middle.clear();
24
+ this.bottom.clear();
25
+ this.text = undefined;
26
+ };
27
+ DImagePieceLayouterPartContainer.prototype.add = function (image) {
28
+ var imageImage = image.image;
29
+ if (imageImage != null) {
30
+ var imageBound = image.bound;
31
+ var imageBoundWidth = imageBound.width;
32
+ var imageBoundHeight = imageBound.height;
33
+ var imageMargin = image.margin;
34
+ var imageMarginHorizontal = imageMargin.horizontal;
35
+ var imageMarginVertical = imageMargin.vertical;
36
+ var imageAlign = image.align;
37
+ switch (imageAlign.horizontal) {
38
+ case DAlignHorizontal.LEFT:
39
+ this.left.add(image, imageBoundWidth, imageMarginHorizontal);
40
+ break;
41
+ case DAlignHorizontal.CENTER:
42
+ this.center.add(image, imageBoundWidth, imageMarginHorizontal);
43
+ break;
44
+ case DAlignHorizontal.RIGHT:
45
+ this.right.add(image, imageBoundWidth, imageMarginHorizontal);
46
+ break;
47
+ }
48
+ switch (imageAlign.vertical) {
49
+ case DAlignVertical.TOP:
50
+ this.top.add(image, imageBoundHeight, imageMarginVertical);
51
+ break;
52
+ case DAlignVertical.MIDDLE:
53
+ this.middle.add(image, imageBoundHeight, imageMarginVertical);
54
+ break;
55
+ case DAlignVertical.BOTTOM:
56
+ this.bottom.add(image, imageBoundHeight, imageMarginVertical);
57
+ break;
58
+ }
59
+ }
60
+ };
61
+ DImagePieceLayouterPartContainer.prototype.set = function (text) {
62
+ this.text = text;
63
+ };
64
+ Object.defineProperty(DImagePieceLayouterPartContainer.prototype, "width", {
65
+ get: function () {
66
+ var text = this.text;
67
+ var left = this.left;
68
+ var center = this.center;
69
+ var right = this.right;
70
+ if (text) {
71
+ return Math.max(left.size + text.width + right.size, center.size);
72
+ }
73
+ else {
74
+ return Math.max(left.size, right.size, center.size);
75
+ }
76
+ },
77
+ enumerable: false,
78
+ configurable: true
79
+ });
80
+ Object.defineProperty(DImagePieceLayouterPartContainer.prototype, "height", {
81
+ get: function () {
82
+ var text = this.text;
83
+ var top = this.top;
84
+ var middle = this.middle;
85
+ var bottom = this.bottom;
86
+ if (text) {
87
+ return Math.max(top.size + text.height + bottom.size, middle.size);
88
+ }
89
+ else {
90
+ return Math.max(top.size, bottom.size, middle.size);
91
+ }
92
+ },
93
+ enumerable: false,
94
+ configurable: true
95
+ });
96
+ DImagePieceLayouterPartContainer.prototype.execute = function (pleft, ptop, pright, pbottom, textAlign, width, height) {
97
+ var left = this.left;
98
+ var center = this.center;
99
+ var right = this.right;
100
+ var top = this.top;
101
+ var middle = this.middle;
102
+ var bottom = this.bottom;
103
+ var text = this.text;
104
+ if (text) {
105
+ var textX = 0;
106
+ var textWidth = text.width;
107
+ switch (textAlign.horizontal) {
108
+ case DAlignHorizontal.LEFT:
109
+ textX = pleft + left.size;
110
+ break;
111
+ case DAlignHorizontal.CENTER:
112
+ textX =
113
+ pleft +
114
+ (width - pleft - pright - (left.size + textWidth + right.size)) * 0.5 +
115
+ left.size;
116
+ break;
117
+ case DAlignHorizontal.RIGHT:
118
+ textX = width - pright - right.size - textWidth;
119
+ break;
120
+ }
121
+ var textY = 0;
122
+ var textHeight = text.height;
123
+ switch (textAlign.vertical) {
124
+ case DAlignVertical.TOP:
125
+ textY = ptop + top.size;
126
+ break;
127
+ case DAlignVertical.MIDDLE:
128
+ textY =
129
+ ptop +
130
+ (height - ptop - pbottom - (top.size + textHeight + bottom.size)) * 0.5 +
131
+ top.size;
132
+ break;
133
+ case DAlignVertical.BOTTOM:
134
+ textY = height - pbottom - bottom.size - textHeight;
135
+ break;
136
+ }
137
+ text.position.set(textX, textY);
138
+ text.setClippingDelta(left.size + right.size, top.size + bottom.size);
139
+ left.execute(textX - left.size, true);
140
+ center.execute(0, 0, textX * 2 + textWidth);
141
+ right.execute(0, textX + textWidth + right.size, true);
142
+ top.execute(textY - top.size, true);
143
+ middle.execute(0, 0, textY * 2 + textHeight);
144
+ bottom.execute(0, textY + textHeight + bottom.size, true);
145
+ }
146
+ else {
147
+ left.execute(pleft, false);
148
+ center.execute(pleft, pright, width);
149
+ right.execute(pright, width, false);
150
+ top.execute(ptop, false);
151
+ middle.execute(ptop, pbottom, height);
152
+ bottom.execute(pbottom, height, false);
153
+ }
154
+ };
155
+ return DImagePieceLayouterPartContainer;
156
+ }());
157
+ export { DImagePieceLayouterPartContainer };
158
+ //# sourceMappingURL=d-image-piece-layouter-part-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"d-image-piece-layouter-part-container.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-layouter-part-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;A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AAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;SACvC;IACF,CAAC;IACF,uCAAC;AAAD,CAAC,AApKD,IAoKC","sourcesContent":["import { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DAlignVertical } from \"./d-align-vertical\";\nimport { DDynamicText } from \"./d-dynamic-text\";\nimport { DImagePiece } from \"./d-image-piece\";\nimport { DImagePieceLayouterPartBottom } from \"./d-image-piece-layouter-part-bottom\";\nimport { DImagePieceLayouterPartCenter } from \"./d-image-piece-layouter-part-center\";\nimport { DImagePieceLayouterPartLeft } from \"./d-image-piece-layouter-part-left\";\nimport { DImagePieceLayouterPartMiddle } from \"./d-image-piece-layouter-part-middle\";\nimport { DImagePieceLayouterPartRight } from \"./d-image-piece-layouter-part-right\";\nimport { DImagePieceLayouterPartTop } from \"./d-image-piece-layouter-part-top\";\nimport { DTextBaseAlign } from \"./d-text-base\";\n\nexport class DImagePieceLayouterPartContainer {\n\tleft: DImagePieceLayouterPartLeft;\n\tcenter: DImagePieceLayouterPartCenter;\n\tright: DImagePieceLayouterPartRight;\n\ttop: DImagePieceLayouterPartTop;\n\tmiddle: DImagePieceLayouterPartMiddle;\n\tbottom: DImagePieceLayouterPartBottom;\n\n\ttext?: DDynamicText;\n\n\tconstructor() {\n\t\tthis.left = new DImagePieceLayouterPartLeft();\n\t\tthis.center = new DImagePieceLayouterPartCenter();\n\t\tthis.right = new DImagePieceLayouterPartRight();\n\t\tthis.top = new DImagePieceLayouterPartTop();\n\t\tthis.middle = new DImagePieceLayouterPartMiddle();\n\t\tthis.bottom = new DImagePieceLayouterPartBottom();\n\t}\n\n\tclear(): void {\n\t\tthis.left.clear();\n\t\tthis.center.clear();\n\t\tthis.right.clear();\n\t\tthis.top.clear();\n\t\tthis.middle.clear();\n\t\tthis.bottom.clear();\n\t\tthis.text = undefined;\n\t}\n\n\tadd(image: DImagePiece): void {\n\t\tconst imageImage = image.image;\n\t\tif (imageImage != null) {\n\t\t\tconst imageBound = image.bound;\n\t\t\tconst imageBoundWidth = imageBound.width;\n\t\t\tconst imageBoundHeight = imageBound.height;\n\n\t\t\tconst imageMargin = image.margin;\n\t\t\tconst imageMarginHorizontal = imageMargin.horizontal;\n\t\t\tconst imageMarginVertical = imageMargin.vertical;\n\n\t\t\tconst imageAlign = image.align;\n\t\t\tswitch (imageAlign.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\tthis.left.add(image, imageBoundWidth, imageMarginHorizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\tthis.center.add(image, imageBoundWidth, imageMarginHorizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\tthis.right.add(image, imageBoundWidth, imageMarginHorizontal);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch (imageAlign.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\tthis.top.add(image, imageBoundHeight, imageMarginVertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\tthis.middle.add(image, imageBoundHeight, imageMarginVertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\tthis.bottom.add(image, imageBoundHeight, imageMarginVertical);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(text: DDynamicText): void {\n\t\tthis.text = text;\n\t}\n\n\tget width(): number {\n\t\tconst text = this.text;\n\t\tconst left = this.left;\n\t\tconst center = this.center;\n\t\tconst right = this.right;\n\t\tif (text) {\n\t\t\treturn Math.max(left.size + text.width + right.size, center.size);\n\t\t} else {\n\t\t\treturn Math.max(left.size, right.size, center.size);\n\t\t}\n\t}\n\n\tget height(): number {\n\t\tconst text = this.text;\n\t\tconst top = this.top;\n\t\tconst middle = this.middle;\n\t\tconst bottom = this.bottom;\n\t\tif (text) {\n\t\t\treturn Math.max(top.size + text.height + bottom.size, middle.size);\n\t\t} else {\n\t\t\treturn Math.max(top.size, bottom.size, middle.size);\n\t\t}\n\t}\n\n\texecute(\n\t\tpleft: number,\n\t\tptop: number,\n\t\tpright: number,\n\t\tpbottom: number,\n\t\ttextAlign: DTextBaseAlign,\n\t\twidth: number,\n\t\theight: number\n\t): void {\n\t\tconst left = this.left;\n\t\tconst center = this.center;\n\t\tconst right = this.right;\n\t\tconst top = this.top;\n\t\tconst middle = this.middle;\n\t\tconst bottom = this.bottom;\n\n\t\tconst text = this.text;\n\t\tif (text) {\n\t\t\tlet textX = 0;\n\t\t\tconst textWidth = text.width;\n\t\t\tswitch (textAlign.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\ttextX = pleft + left.size;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\ttextX =\n\t\t\t\t\t\tpleft +\n\t\t\t\t\t\t(width - pleft - pright - (left.size + textWidth + right.size)) * 0.5 +\n\t\t\t\t\t\tleft.size;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\ttextX = width - pright - right.size - textWidth;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet textY = 0;\n\t\t\tconst textHeight = text.height;\n\t\t\tswitch (textAlign.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\ttextY = ptop + top.size;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\ttextY =\n\t\t\t\t\t\tptop +\n\t\t\t\t\t\t(height - ptop - pbottom - (top.size + textHeight + bottom.size)) * 0.5 +\n\t\t\t\t\t\ttop.size;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\ttextY = height - pbottom - bottom.size - textHeight;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttext.position.set(textX, textY);\n\t\t\ttext.setClippingDelta(left.size + right.size, top.size + bottom.size);\n\n\t\t\tleft.execute(textX - left.size, true);\n\t\t\tcenter.execute(0, 0, textX * 2 + textWidth);\n\t\t\tright.execute(0, textX + textWidth + right.size, true);\n\t\t\ttop.execute(textY - top.size, true);\n\t\t\tmiddle.execute(0, 0, textY * 2 + textHeight);\n\t\t\tbottom.execute(0, textY + textHeight + bottom.size, true);\n\t\t} else {\n\t\t\tleft.execute(pleft, false);\n\t\t\tcenter.execute(pleft, pright, width);\n\t\t\tright.execute(pright, width, false);\n\t\t\ttop.execute(ptop, false);\n\t\t\tmiddle.execute(ptop, pbottom, height);\n\t\t\tbottom.execute(pbottom, height, false);\n\t\t}\n\t}\n}\n"]}