@wcardinal/wcardinal-ui 0.441.0 → 0.443.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 (67) hide show
  1. package/dist/types/wcardinal/ui/d-picker-color.d.ts +3 -0
  2. package/dist/types/wcardinal/ui/d-table-column-state.d.ts +4 -1
  3. package/dist/types/wcardinal/ui/d-table-state.d.ts +4 -0
  4. package/dist/types/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.d.ts +1 -0
  5. package/dist/types/wcardinal/ui/theme/common/new-svg-rounded-rect.d.ts +1 -0
  6. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-picker-color.d.ts +3 -0
  7. package/dist/types/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.d.ts +1 -0
  8. package/dist/types/wcardinal/ui/theme/white/d-theme-white-picker-color.d.ts +3 -0
  9. package/dist/types/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.d.ts +1 -0
  10. package/dist/wcardinal/ui/d-dynamic-text.js +3 -8
  11. package/dist/wcardinal/ui/d-dynamic-text.js.map +1 -1
  12. package/dist/wcardinal/ui/d-image-piece-impl.js +8 -0
  13. package/dist/wcardinal/ui/d-image-piece-impl.js.map +1 -1
  14. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +1 -1
  15. package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -1
  16. package/dist/wcardinal/ui/d-picker-color.js +5 -4
  17. package/dist/wcardinal/ui/d-picker-color.js.map +1 -1
  18. package/dist/wcardinal/ui/d-table-body.js +3 -2
  19. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  20. package/dist/wcardinal/ui/d-table-column-state.js.map +1 -1
  21. package/dist/wcardinal/ui/d-table-state.js +4 -0
  22. package/dist/wcardinal/ui/d-table-state.js.map +1 -1
  23. package/dist/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.js +20 -0
  24. package/dist/wcardinal/ui/theme/common/new-svg-rounded-checkerboard.js.map +1 -0
  25. package/dist/wcardinal/ui/theme/common/new-svg-rounded-rect.js +15 -0
  26. package/dist/wcardinal/ui/theme/common/new-svg-rounded-rect.js.map +1 -0
  27. package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color-gradient.js +2 -5
  28. package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color-gradient.js.map +1 -1
  29. package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color.js +3 -6
  30. package/dist/wcardinal/ui/theme/dark/d-theme-dark-button-color.js.map +1 -1
  31. package/dist/wcardinal/ui/theme/dark/d-theme-dark-picker-color.js +24 -35
  32. package/dist/wcardinal/ui/theme/dark/d-theme-dark-picker-color.js.map +1 -1
  33. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cells.js +7 -2
  34. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-body-cells.js.map +1 -1
  35. package/dist/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.js +5 -0
  36. package/dist/wcardinal/ui/theme/dark/new-dark-svg-rounded-checkerboard.js.map +1 -0
  37. package/dist/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.js +2 -5
  38. package/dist/wcardinal/ui/theme/white/d-theme-white-button-color-gradient.js.map +1 -1
  39. package/dist/wcardinal/ui/theme/white/d-theme-white-button-color.js +3 -6
  40. package/dist/wcardinal/ui/theme/white/d-theme-white-button-color.js.map +1 -1
  41. package/dist/wcardinal/ui/theme/white/d-theme-white-picker-color.js +24 -35
  42. package/dist/wcardinal/ui/theme/white/d-theme-white-picker-color.js.map +1 -1
  43. package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cells.js +7 -2
  44. package/dist/wcardinal/ui/theme/white/d-theme-white-table-body-cells.js.map +1 -1
  45. package/dist/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.js +5 -0
  46. package/dist/wcardinal/ui/theme/white/new-white-svg-rounded-checkerboard.js.map +1 -0
  47. package/dist/wcardinal-ui-theme-dark-en-us.js +71 -49
  48. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  49. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  50. package/dist/wcardinal-ui-theme-dark-ja-jp.js +71 -49
  51. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  52. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  53. package/dist/wcardinal-ui-theme-dark.js +71 -49
  54. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  55. package/dist/wcardinal-ui-theme-white-en-us.js +71 -49
  56. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  57. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  58. package/dist/wcardinal-ui-theme-white-ja-jp.js +71 -49
  59. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  60. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  61. package/dist/wcardinal-ui-theme-white.js +71 -49
  62. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  63. package/dist/wcardinal-ui.cjs.js +131 -112
  64. package/dist/wcardinal-ui.js +25 -16
  65. package/dist/wcardinal-ui.min.js +2 -2
  66. package/dist/wcardinal-ui.min.js.map +1 -1
  67. package/package.json +1 -1
@@ -41,6 +41,9 @@ export interface DThemePickerColor extends DThemeBase {
41
41
  getRecentTexture(): Texture;
42
42
  getInputMargin(): number;
43
43
  getInputLabelWidth(): number;
44
+ getSampleWidth(): number;
45
+ getSampleHeight(): number;
46
+ getSampleMargin(): number;
44
47
  getSampleCheckerboardOldTexture(): Texture;
45
48
  getSampleCheckerboardNewTexture(): Texture;
46
49
  getSampleOldTexture(): Texture;
@@ -2,7 +2,10 @@ import { DBaseStateSet } from "./d-base-state-set";
2
2
  /**
3
3
  * {@link DTable} column state modifier.
4
4
  * This function is called on every cells of a column when the cell data is changed.
5
- * The state given at the third parameter is a state of a cell.
5
+ *
6
+ * @param row a cell data
7
+ * @param columnIndex a column index of a cell
8
+ * @param state a cell state
6
9
  */
7
10
  export type DTableColumnStateModifier<ROW_VALUE> = (row: ROW_VALUE, columnIndex: number, state: DBaseStateSet) => void;
8
11
  export interface DTableColumnState<ROW_VALUE> {
@@ -18,6 +18,10 @@ export declare const DTableState: {
18
18
  * Cells of a right-most frozen column.
19
19
  */
20
20
  FROZEN_END: string;
21
+ /**
22
+ * Rows with data
23
+ */
24
+ HAS_DATA: string;
21
25
  /**
22
26
  * Header cells of sortable columns.
23
27
  */
@@ -0,0 +1 @@
1
+ export declare const newSvgRoundedCheckerboard: (width: number, height: number, color1: string, color2: string, stroke?: string, strokeWidth?: number, strokeOpacity?: number) => string;
@@ -0,0 +1 @@
1
+ export declare const newSvgRoundedRect: (x: number, y: number, width: number, height: number, fill: string, stroke?: string, strokeWidth?: number, strokeOpacity?: number) => string;
@@ -34,6 +34,9 @@ export declare abstract class DThemeDarkPickerColor extends DThemeDarkBase imple
34
34
  getRecentTexture(): Texture;
35
35
  getInputMargin(): number;
36
36
  getInputLabelWidth(): number;
37
+ getSampleWidth(): number;
38
+ getSampleHeight(): number;
39
+ getSampleMargin(): number;
37
40
  getSampleCheckerboardOldTexture(): Texture;
38
41
  getSampleCheckerboardNewTexture(): Texture;
39
42
  getSampleOldTexture(): Texture;
@@ -0,0 +1 @@
1
+ export declare const newDarkSvgRoundedCheckerboard: (width: number, height: number, stroke?: string, strokeWidth?: number, strokeOpacity?: number) => string;
@@ -34,6 +34,9 @@ export declare abstract class DThemeWhitePickerColor extends DThemeWhiteBase imp
34
34
  getRecentTexture(): Texture;
35
35
  getInputMargin(): number;
36
36
  getInputLabelWidth(): number;
37
+ getSampleWidth(): number;
38
+ getSampleHeight(): number;
39
+ getSampleMargin(): number;
37
40
  getSampleCheckerboardOldTexture(): Texture;
38
41
  getSampleCheckerboardNewTexture(): Texture;
39
42
  getSampleOldTexture(): Texture;
@@ -0,0 +1 @@
1
+ export declare const newWhiteSvgRoundedCheckerboard: (width: number, height: number, stroke?: string, strokeWidth?: number, strokeOpacity?: number) => string;
@@ -205,18 +205,13 @@ var DDynamicText = /** @class */ (function (_super) {
205
205
  if (styleClipping || styleFitting || styleWordWrap) {
206
206
  var parent_1 = this.parent;
207
207
  if (parent_1 instanceof DBase) {
208
- var width = parent_1.width -
209
- parent_1.padding.getLeft() -
210
- parent_1.padding.getRight() -
211
- modifier.delta.width;
208
+ var padding = parent_1.padding;
209
+ var width = parent_1.width - padding.getLeft() - padding.getRight() - modifier.delta.width;
212
210
  if (modifier.width !== width) {
213
211
  modifier.width = width;
214
212
  isChanged = true;
215
213
  }
216
- var height = parent_1.height -
217
- parent_1.padding.getTop() -
218
- parent_1.padding.getBottom() -
219
- modifier.delta.height;
214
+ var height = parent_1.height - padding.getTop() - padding.getBottom() - modifier.delta.height;
220
215
  if (modifier.height !== height) {
221
216
  modifier.height = height;
222
217
  isChanged = true;
@@ -1 +1 @@
1
- {"version":3,"file":"d-dynamic-text.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dynamic-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAY,OAAO,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAiB5C;IAAkC,gCAAI;IAcrC,sBAAY,KAAwB;QAApC,YACC,kBAAM,IAAI,oBAAoB,EAAE,EAAE,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SA0BlE;QAxBA,KAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE;YAClB,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ACnC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAES,uCAAgB,GAA1B;QACC,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;IAES,8BAAO,GAAjB,UAAkB,QAAmB;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,iBAAM,OAAO,YAAC,QAAS,CAAC,CAAC;IAC1B,CAAC;IACF,mBAAC;AAAD,CAAC,AA1PD,CAAkC,IAAI,GA0PrC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Mesh, MeshMaterial, Renderer, Texture } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase } from \"./d-base\";\nimport { DDynamicTextGeometry } from \"./d-dynamic-text-geometry\";\nimport { DDynamicTextStyle } from \"./d-dynamic-text-style\";\nimport { DDynamicTextStyleWordWrap } from \"./d-dynamic-text-style-word-wrap\";\nimport { DynamicFontAtlas } from \"./util/dynamic-font-atlas\";\nimport { UtilFont } from \"./util/util-font\";\n\nexport interface DDynamicTextClippingDelta {\n\twidth: number;\n\theight: number;\n}\n\nexport interface DDynamicTextModifier {\n\tclipping: boolean;\n\tfitting: boolean;\n\twordWrap: DDynamicTextStyleWordWrap;\n\twidth: number;\n\theight: number;\n\tlineHeight: number;\n\tdelta: DDynamicTextClippingDelta;\n}\n\nexport class DDynamicText extends Mesh {\n\tprotected _style: DDynamicTextStyle;\n\tprotected _text: string;\n\tprotected _textApproved: string;\n\tprotected _isDirty: boolean;\n\tprotected _isGeometryDirty: boolean;\n\tprotected _atlas: DynamicFontAtlas | null;\n\tprotected _atlasRevisionUpdated: number;\n\tprotected _width: number;\n\tprotected _height: number;\n\tprotected _modifier: DDynamicTextModifier;\n\n\treadonly geometry!: DDynamicTextGeometry;\n\n\tconstructor(style: DDynamicTextStyle) {\n\t\tsuper(new DDynamicTextGeometry(), new MeshMaterial(Texture.EMPTY));\n\n\t\tthis._style = style;\n\t\tstyle.on(\"change\", () => {\n\t\t\tthis.onStyleChange();\n\t\t});\n\t\tthis._text = \"\";\n\t\tthis._textApproved = \"\";\n\t\tthis._isDirty = true;\n\t\tthis._isGeometryDirty = true;\n\t\tthis._atlas = null;\n\t\tthis._atlasRevisionUpdated = 0;\n\t\tthis._width = 0;\n\t\tthis._height = 0;\n\t\tthis._modifier = {\n\t\t\tclipping: false,\n\t\t\tfitting: false,\n\t\t\twordWrap: DDynamicTextStyleWordWrap.NONE,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tlineHeight: 0,\n\t\t\tdelta: {\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected onStyleChange(): void {\n\t\tthis._isDirty = true;\n\t\tthis._isGeometryDirty = true;\n\t\tthis._atlas = null;\n\t\tthis.update_();\n\t}\n\n\tprotected update_(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tif (this._isDirty) {\n\t\t\t\tthis._isDirty = false;\n\n\t\t\t\tconst text = this._text;\n\t\t\t\tconst textApproved = this._textApproved;\n\t\t\t\tthis._textApproved = text;\n\t\t\t\tconst style = this._style;\n\t\t\t\tconst fontId = style.fontId;\n\t\t\t\tconst fontIdApproved = style.fontIdApproved;\n\t\t\t\tconst fontIdFontSize = style.fontIdFontSize;\n\t\t\t\tconst fill = style.fill;\n\t\t\t\tconst fillApproved = style.fillApproved;\n\t\t\t\tstyle.approve();\n\n\t\t\t\tconst atlases = layer.getDynamicFontAtlases();\n\t\t\t\tif (text !== textApproved || fontId !== fontIdApproved || fill !== fillApproved) {\n\t\t\t\t\tatlases.add(fontId, fontIdFontSize, fill, text);\n\t\t\t\t\tatlases.remove(fontIdApproved, fillApproved, textApproved);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tget text(): string {\n\t\treturn this._text;\n\t}\n\n\tset text(text: string) {\n\t\tif (this._text !== text) {\n\t\t\tthis._text = text;\n\t\t\tif (!this._style.unfit()) {\n\t\t\t\tthis._isDirty = true;\n\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t\tthis.update_();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget width(): number {\n\t\tthis.update();\n\t\treturn Math.abs(this.scale.x) * this.geometry.width;\n\t}\n\n\tset width(width: number) {\n\t\tthis.update();\n\t\tconst geometryWidth = this.geometry.width;\n\t\tif (+1e-4 < geometryWidth) {\n\t\t\tconst newScale = width / geometryWidth;\n\t\t\tthis.scale.x = 0 <= this.scale.x ? +newScale : -newScale;\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget height(): number {\n\t\tthis.update();\n\t\treturn Math.abs(this.scale.y) * this.geometry.height;\n\t}\n\n\tset height(height: number) {\n\t\tthis.update();\n\t\tconst geometryHeight = this.geometry.height;\n\t\tif (+1e-4 < geometryHeight) {\n\t\t\tconst newScale = height / geometryHeight;\n\t\t\tthis.scale.y = 0 <= this.scale.y ? +newScale : -newScale;\n\t\t}\n\t}\n\n\tget clipped(): boolean {\n\t\treturn this.geometry.clipped;\n\t}\n\n\tget style(): DDynamicTextStyle {\n\t\treturn this._style;\n\t}\n\n\tupdate(): void {\n\t\tthis.update_();\n\n\t\tconst style = this._style;\n\t\tlet atlas = this._atlas;\n\t\tif (atlas == null) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tatlas = layer.getDynamicFontAtlases().get(style.fontId, style.fill);\n\t\t\t\tif (atlas != null) {\n\t\t\t\t\tthis._atlasRevisionUpdated = atlas.getRevisionUpdate();\n\t\t\t\t\tthis._atlas = atlas;\n\t\t\t\t\tthis.texture = atlas.texture;\n\t\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst revisionUpdate = atlas.getRevisionUpdate();\n\t\t\tif (revisionUpdate !== this._atlasRevisionUpdated) {\n\t\t\t\tthis._atlasRevisionUpdated = revisionUpdate;\n\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t}\n\t\t}\n\n\t\tconst modifier = this._modifier;\n\t\tif (this.updateClipping(style, modifier)) {\n\t\t\tthis._isGeometryDirty = true;\n\t\t}\n\n\t\tif (this._isGeometryDirty) {\n\t\t\tthis._isGeometryDirty = false;\n\t\t\tconst geometry = this.geometry;\n\t\t\tgeometry.update(this._text, atlas, modifier);\n\n\t\t\tif (modifier.fitting && !style.isFontFitted && geometry.scaled) {\n\t\t\t\tconst oldScale = geometry.scale;\n\t\t\t\tconst oldFontSize = style.fontSize;\n\t\t\t\tconst newFontId = style.toFontId(Math.ceil(oldFontSize * oldScale * 1000) / 1000);\n\t\t\t\tconst newFontSize = UtilFont.toSize(newFontId);\n\t\t\t\tconst newScale = newFontSize / oldFontSize;\n\t\t\t\tconst newLineHeight = style.lineHeight * newScale;\n\t\t\t\tif (style.fit(newFontSize, newLineHeight)) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tDApplications.update(this);\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected updateClipping(style: DDynamicTextStyle, modifier: DDynamicTextModifier): boolean {\n\t\tlet isChanged = false;\n\n\t\tconst styleClipping = style.clipping;\n\t\tif (modifier.clipping !== styleClipping) {\n\t\t\tmodifier.clipping = styleClipping;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleFitting = style.fitting;\n\t\tif (modifier.fitting !== styleFitting) {\n\t\t\tmodifier.fitting = styleFitting;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleWordWrap = style.wordWrap;\n\t\tif (modifier.wordWrap !== styleWordWrap) {\n\t\t\tmodifier.wordWrap = styleWordWrap;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleLineHeight = styleFitting ? style.lineHeightFitted : style.lineHeight;\n\t\tif (modifier.lineHeight !== styleLineHeight) {\n\t\t\tmodifier.lineHeight = styleLineHeight;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tif (styleClipping || styleFitting || styleWordWrap) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent instanceof DBase) {\n\t\t\t\tconst width =\n\t\t\t\t\tparent.width -\n\t\t\t\t\tparent.padding.getLeft() -\n\t\t\t\t\tparent.padding.getRight() -\n\t\t\t\t\tmodifier.delta.width;\n\t\t\t\tif (modifier.width !== width) {\n\t\t\t\t\tmodifier.width = width;\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\n\t\t\t\tconst height =\n\t\t\t\t\tparent.height -\n\t\t\t\t\tparent.padding.getTop() -\n\t\t\t\t\tparent.padding.getBottom() -\n\t\t\t\t\tmodifier.delta.height;\n\t\t\t\tif (modifier.height !== height) {\n\t\t\t\t\tmodifier.height = height;\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn isChanged;\n\t}\n\n\tsetClippingDelta(width: number, height: number): void {\n\t\tconst delta = this._modifier.delta;\n\t\tdelta.width = width;\n\t\tdelta.height = height;\n\t}\n\n\tprotected _calculateBounds(): void {\n\t\tthis.update();\n\t\tconst geometry = this.geometry;\n\t\tthis._bounds.addFrame(this.transform, 0, 0, geometry.width, geometry.height);\n\t}\n\n\tprotected _render(renderer?: Renderer): void {\n\t\tthis.update();\n\t\tsuper._render(renderer!);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-dynamic-text.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dynamic-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,IAAI,EAAE,Y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KAAK,KAAK,EAAE;oBAC7B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;oBACvB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBAED,IAAM,MAAM,GACX,QAAM,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;gBAChF,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,EAAE;oBAC/B,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;oBACzB,SAAS,GAAG,IAAI,CAAC;iBACjB;aACD;SACD;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,uCAAgB,GAAhB,UAAiB,KAAa,EAAE,MAAc;QAC7C,IAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QACnC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAES,uCAAgB,GAA1B;QACC,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,IAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC;IAES,8BAAO,GAAjB,UAAkB,QAAmB;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,iBAAM,OAAO,YAAC,QAAS,CAAC,CAAC;IAC1B,CAAC;IACF,mBAAC;AAAD,CAAC,AArPD,CAAkC,IAAI,GAqPrC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Mesh, MeshMaterial, Renderer, Texture } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase } from \"./d-base\";\nimport { DDynamicTextGeometry } from \"./d-dynamic-text-geometry\";\nimport { DDynamicTextStyle } from \"./d-dynamic-text-style\";\nimport { DDynamicTextStyleWordWrap } from \"./d-dynamic-text-style-word-wrap\";\nimport { DynamicFontAtlas } from \"./util/dynamic-font-atlas\";\nimport { UtilFont } from \"./util/util-font\";\n\nexport interface DDynamicTextClippingDelta {\n\twidth: number;\n\theight: number;\n}\n\nexport interface DDynamicTextModifier {\n\tclipping: boolean;\n\tfitting: boolean;\n\twordWrap: DDynamicTextStyleWordWrap;\n\twidth: number;\n\theight: number;\n\tlineHeight: number;\n\tdelta: DDynamicTextClippingDelta;\n}\n\nexport class DDynamicText extends Mesh {\n\tprotected _style: DDynamicTextStyle;\n\tprotected _text: string;\n\tprotected _textApproved: string;\n\tprotected _isDirty: boolean;\n\tprotected _isGeometryDirty: boolean;\n\tprotected _atlas: DynamicFontAtlas | null;\n\tprotected _atlasRevisionUpdated: number;\n\tprotected _width: number;\n\tprotected _height: number;\n\tprotected _modifier: DDynamicTextModifier;\n\n\treadonly geometry!: DDynamicTextGeometry;\n\n\tconstructor(style: DDynamicTextStyle) {\n\t\tsuper(new DDynamicTextGeometry(), new MeshMaterial(Texture.EMPTY));\n\n\t\tthis._style = style;\n\t\tstyle.on(\"change\", () => {\n\t\t\tthis.onStyleChange();\n\t\t});\n\t\tthis._text = \"\";\n\t\tthis._textApproved = \"\";\n\t\tthis._isDirty = true;\n\t\tthis._isGeometryDirty = true;\n\t\tthis._atlas = null;\n\t\tthis._atlasRevisionUpdated = 0;\n\t\tthis._width = 0;\n\t\tthis._height = 0;\n\t\tthis._modifier = {\n\t\t\tclipping: false,\n\t\t\tfitting: false,\n\t\t\twordWrap: DDynamicTextStyleWordWrap.NONE,\n\t\t\twidth: 0,\n\t\t\theight: 0,\n\t\t\tlineHeight: 0,\n\t\t\tdelta: {\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0\n\t\t\t}\n\t\t};\n\t}\n\n\tprotected onStyleChange(): void {\n\t\tthis._isDirty = true;\n\t\tthis._isGeometryDirty = true;\n\t\tthis._atlas = null;\n\t\tthis.update_();\n\t}\n\n\tprotected update_(): void {\n\t\tconst layer = DApplications.getLayer(this);\n\t\tif (layer) {\n\t\t\tif (this._isDirty) {\n\t\t\t\tthis._isDirty = false;\n\n\t\t\t\tconst text = this._text;\n\t\t\t\tconst textApproved = this._textApproved;\n\t\t\t\tthis._textApproved = text;\n\t\t\t\tconst style = this._style;\n\t\t\t\tconst fontId = style.fontId;\n\t\t\t\tconst fontIdApproved = style.fontIdApproved;\n\t\t\t\tconst fontIdFontSize = style.fontIdFontSize;\n\t\t\t\tconst fill = style.fill;\n\t\t\t\tconst fillApproved = style.fillApproved;\n\t\t\t\tstyle.approve();\n\n\t\t\t\tconst atlases = layer.getDynamicFontAtlases();\n\t\t\t\tif (text !== textApproved || fontId !== fontIdApproved || fill !== fillApproved) {\n\t\t\t\t\tatlases.add(fontId, fontIdFontSize, fill, text);\n\t\t\t\t\tatlases.remove(fontIdApproved, fillApproved, textApproved);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tget text(): string {\n\t\treturn this._text;\n\t}\n\n\tset text(text: string) {\n\t\tif (this._text !== text) {\n\t\t\tthis._text = text;\n\t\t\tif (!this._style.unfit()) {\n\t\t\t\tthis._isDirty = true;\n\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t\tthis.update_();\n\t\t\t}\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget width(): number {\n\t\tthis.update();\n\t\treturn Math.abs(this.scale.x) * this.geometry.width;\n\t}\n\n\tset width(width: number) {\n\t\tthis.update();\n\t\tconst geometryWidth = this.geometry.width;\n\t\tif (+1e-4 < geometryWidth) {\n\t\t\tconst newScale = width / geometryWidth;\n\t\t\tthis.scale.x = 0 <= this.scale.x ? +newScale : -newScale;\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tget height(): number {\n\t\tthis.update();\n\t\treturn Math.abs(this.scale.y) * this.geometry.height;\n\t}\n\n\tset height(height: number) {\n\t\tthis.update();\n\t\tconst geometryHeight = this.geometry.height;\n\t\tif (+1e-4 < geometryHeight) {\n\t\t\tconst newScale = height / geometryHeight;\n\t\t\tthis.scale.y = 0 <= this.scale.y ? +newScale : -newScale;\n\t\t}\n\t}\n\n\tget clipped(): boolean {\n\t\treturn this.geometry.clipped;\n\t}\n\n\tget style(): DDynamicTextStyle {\n\t\treturn this._style;\n\t}\n\n\tupdate(): void {\n\t\tthis.update_();\n\n\t\tconst style = this._style;\n\t\tlet atlas = this._atlas;\n\t\tif (atlas == null) {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tatlas = layer.getDynamicFontAtlases().get(style.fontId, style.fill);\n\t\t\t\tif (atlas != null) {\n\t\t\t\t\tthis._atlasRevisionUpdated = atlas.getRevisionUpdate();\n\t\t\t\t\tthis._atlas = atlas;\n\t\t\t\t\tthis.texture = atlas.texture;\n\t\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst revisionUpdate = atlas.getRevisionUpdate();\n\t\t\tif (revisionUpdate !== this._atlasRevisionUpdated) {\n\t\t\t\tthis._atlasRevisionUpdated = revisionUpdate;\n\t\t\t\tthis._isGeometryDirty = true;\n\t\t\t}\n\t\t}\n\n\t\tconst modifier = this._modifier;\n\t\tif (this.updateClipping(style, modifier)) {\n\t\t\tthis._isGeometryDirty = true;\n\t\t}\n\n\t\tif (this._isGeometryDirty) {\n\t\t\tthis._isGeometryDirty = false;\n\t\t\tconst geometry = this.geometry;\n\t\t\tgeometry.update(this._text, atlas, modifier);\n\n\t\t\tif (modifier.fitting && !style.isFontFitted && geometry.scaled) {\n\t\t\t\tconst oldScale = geometry.scale;\n\t\t\t\tconst oldFontSize = style.fontSize;\n\t\t\t\tconst newFontId = style.toFontId(Math.ceil(oldFontSize * oldScale * 1000) / 1000);\n\t\t\t\tconst newFontSize = UtilFont.toSize(newFontId);\n\t\t\t\tconst newScale = newFontSize / oldFontSize;\n\t\t\t\tconst newLineHeight = style.lineHeight * newScale;\n\t\t\t\tif (style.fit(newFontSize, newLineHeight)) {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tDApplications.update(this);\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected updateClipping(style: DDynamicTextStyle, modifier: DDynamicTextModifier): boolean {\n\t\tlet isChanged = false;\n\n\t\tconst styleClipping = style.clipping;\n\t\tif (modifier.clipping !== styleClipping) {\n\t\t\tmodifier.clipping = styleClipping;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleFitting = style.fitting;\n\t\tif (modifier.fitting !== styleFitting) {\n\t\t\tmodifier.fitting = styleFitting;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleWordWrap = style.wordWrap;\n\t\tif (modifier.wordWrap !== styleWordWrap) {\n\t\t\tmodifier.wordWrap = styleWordWrap;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tconst styleLineHeight = styleFitting ? style.lineHeightFitted : style.lineHeight;\n\t\tif (modifier.lineHeight !== styleLineHeight) {\n\t\t\tmodifier.lineHeight = styleLineHeight;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\tif (styleClipping || styleFitting || styleWordWrap) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent instanceof DBase) {\n\t\t\t\tconst padding = parent.padding;\n\t\t\t\tconst width =\n\t\t\t\t\tparent.width - padding.getLeft() - padding.getRight() - modifier.delta.width;\n\t\t\t\tif (modifier.width !== width) {\n\t\t\t\t\tmodifier.width = width;\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\n\t\t\t\tconst height =\n\t\t\t\t\tparent.height - padding.getTop() - padding.getBottom() - modifier.delta.height;\n\t\t\t\tif (modifier.height !== height) {\n\t\t\t\t\tmodifier.height = height;\n\t\t\t\t\tisChanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn isChanged;\n\t}\n\n\tsetClippingDelta(width: number, height: number): void {\n\t\tconst delta = this._modifier.delta;\n\t\tdelta.width = width;\n\t\tdelta.height = height;\n\t}\n\n\tprotected _calculateBounds(): void {\n\t\tthis.update();\n\t\tconst geometry = this.geometry;\n\t\tthis._bounds.addFrame(this.transform, 0, 0, geometry.width, geometry.height);\n\t}\n\n\tprotected _render(renderer?: Renderer): void {\n\t\tthis.update();\n\t\tsuper._render(renderer!);\n\t}\n}\n"]}
@@ -122,8 +122,16 @@ var DImagePieceImpl = /** @class */ (function () {
122
122
  object.alpha = alpha;
123
123
  result = true;
124
124
  }
125
+ if (!object.visible) {
126
+ object.visible = true;
127
+ result = true;
128
+ }
125
129
  return result;
126
130
  }
131
+ else if (object.visible) {
132
+ object.visible = false;
133
+ return true;
134
+ }
127
135
  }
128
136
  }
129
137
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"d-image-piece-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAWlE;IAcC,yBACC,MAA6B,EAC7B,KAAuB,EACvB,OAA4B;QAH7B,iBAmBC;QAdA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAoB,CAAC,IAAI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AI,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IACF,sBAAC;AAAD,CAAC,AA7OD,IA6OC","sourcesContent":["import { DisplayObject, Graphics, Sprite, Texture } from \"pixi.js\";\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 { DImagePieceTint } from \"./d-image-piece-tint\";\nimport { DImagePieceTintImpl } from \"./d-image-piece-tint-impl\";\nimport { DImagePieceMarginImpl } from \"./d-image-piece-margin-impl\";\nimport { DImagePieceMargin } from \"./d-image-piece-margin\";\nimport { DImagePieceAlign } from \"./d-image-piece-align\";\nimport { DImagePieceAlignImpl } from \"./d-image-piece-align-impl\";\nimport { DImagePiece, DImagePieceOptions, DThemeImagePiece } from \"./d-image-piece\";\n\nexport interface DImagePieceImplParent 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 class DImagePieceImpl implements DImagePiece {\n\tprotected _parent: DImagePieceImplParent;\n\tprotected _theme: DThemeImagePiece;\n\n\tprotected _object: DisplayObject | null;\n\tprotected _computed: Texture | DisplayObject | null;\n\tprotected _source: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tprotected _align: DImagePieceAlignImpl;\n\tprotected _margin: DImagePieceMarginImpl;\n\tprotected _tint: DImagePieceTint;\n\tprotected _rotation: DStateAwareOrValueMightBe<number> | undefined;\n\n\tprotected _onUpdateBound: () => void;\n\n\tconstructor(\n\t\tparent: DImagePieceImplParent,\n\t\ttheme: DThemeImagePiece,\n\t\toptions?: DImagePieceOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._theme = theme;\n\n\t\tthis._object = null;\n\t\tthis._align = new DImagePieceAlignImpl(this, theme, options?.align);\n\t\tthis._margin = new DImagePieceMarginImpl(this, theme, options?.margin);\n\t\tthis._tint = new DImagePieceTintImpl(this, theme, options?.tint);\n\t\tthis._rotation = options?.rotation;\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 object(): DisplayObject | null {\n\t\treturn this._object;\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 tint(): DImagePieceTint {\n\t\treturn this._tint;\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\tif (this.updateSource()) {\n\t\t\t\tthis.onUpdate();\n\t\t\t}\n\t\t}\n\t}\n\n\tget rotation(): DStateAwareOrValueMightBe<number> {\n\t\treturn this._rotation;\n\t}\n\n\tset rotation(rotation: DStateAwareOrValueMightBe<number>) {\n\t\tif (this._rotation !== rotation) {\n\t\t\tthis._rotation = rotation;\n\t\t\tif (this.updateRotation()) {\n\t\t\t\tDApplications.update(this._parent);\n\t\t\t}\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\tthis.updateRotation();\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\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 object = this._object;\n\t\tif (object) {\n\t\t\tif (this.isTintAware(object)) {\n\t\t\t\tconst state = this._parent.state;\n\t\t\t\tconst color = this._tint.getColor(state);\n\t\t\t\tif (color != null) {\n\t\t\t\t\tlet result = false;\n\t\t\t\t\tif (object.tint !== color) {\n\t\t\t\t\t\tobject.tint = color;\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst alpha = this._tint.getAlpha(state);\n\t\t\t\t\tif (object.alpha !== alpha) {\n\t\t\t\t\t\tobject.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\tprotected toRotation(theme: DThemeImagePiece, state: DBaseStateSet): number | null {\n\t\tconst rotation = this._rotation;\n\t\tif (rotation != null) {\n\t\t\tif (isFunction(rotation)) {\n\t\t\t\tconst result = rotation(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 rotation;\n\t\t\t}\n\t\t}\n\t\treturn theme.getImageRotation(state);\n\t}\n\n\tupdateRotation(): boolean {\n\t\tconst object = this._object;\n\t\tif (object) {\n\t\t\tconst theme = this._theme;\n\t\t\tconst state = this._parent.state;\n\t\t\tconst rotation = this.toRotation(theme, state);\n\t\t\tif (rotation != null) {\n\t\t\t\tconst transform = object.transform;\n\t\t\t\tif (transform.rotation !== rotation) {\n\t\t\t\t\ttransform.rotation = rotation;\n\t\t\t\t\treturn true;\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 oldObject = this._object;\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 (oldObject instanceof Sprite) {\n\t\t\t\t\t\toldObject.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 (oldObject != null) {\n\t\t\t\t\t\tparent.removeChild(oldObject);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newObject = new Sprite(newComputed);\n\t\t\t\t\tnewObject.anchor.set(0.5, 0.5);\n\t\t\t\t\tconst overflowMask = parent.getOverflowMask();\n\t\t\t\t\tif (overflowMask) {\n\t\t\t\t\t\tnewObject.mask = overflowMask;\n\t\t\t\t\t}\n\t\t\t\t\tnewComputed.on(\"update\", onUpdateBound);\n\t\t\t\t\tparent.addChild(newObject);\n\t\t\t\t\tthis._object = newObject;\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 (oldObject != null) {\n\t\t\t\t\t\tparent.removeChild(oldObject);\n\t\t\t\t\t\toldObject.destroy();\n\t\t\t\t\t}\n\t\t\t\t} else if (oldObject != null) {\n\t\t\t\t\tparent.removeChild(oldObject);\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._object = 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._object;\n\t}\n\n\tdestroy(): void {\n\t\tthis.source = null;\n\t}\n\n\tonUpdate(): void {\n\t\tthis._parent.toDirty();\n\t\tDApplications.update(this._parent);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-image-piece-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-image-piece-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAWlE;IAcC,yBACC,MAA6B,EAC7B,KAAuB,EACvB,OAA4B;QAH7B,iBAmBC;QAdA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QAEpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,KAAK,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE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ourcesContent":["import { DisplayObject, Graphics, Sprite, Texture } from \"pixi.js\";\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 { DImagePieceTint } from \"./d-image-piece-tint\";\nimport { DImagePieceTintImpl } from \"./d-image-piece-tint-impl\";\nimport { DImagePieceMarginImpl } from \"./d-image-piece-margin-impl\";\nimport { DImagePieceMargin } from \"./d-image-piece-margin\";\nimport { DImagePieceAlign } from \"./d-image-piece-align\";\nimport { DImagePieceAlignImpl } from \"./d-image-piece-align-impl\";\nimport { DImagePiece, DImagePieceOptions, DThemeImagePiece } from \"./d-image-piece\";\n\nexport interface DImagePieceImplParent 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 class DImagePieceImpl implements DImagePiece {\n\tprotected _parent: DImagePieceImplParent;\n\tprotected _theme: DThemeImagePiece;\n\n\tprotected _object: DisplayObject | null;\n\tprotected _computed: Texture | DisplayObject | null;\n\tprotected _source: DStateAwareOrValueMightBe<Texture | DisplayObject | null>;\n\tprotected _align: DImagePieceAlignImpl;\n\tprotected _margin: DImagePieceMarginImpl;\n\tprotected _tint: DImagePieceTint;\n\tprotected _rotation: DStateAwareOrValueMightBe<number> | undefined;\n\n\tprotected _onUpdateBound: () => void;\n\n\tconstructor(\n\t\tparent: DImagePieceImplParent,\n\t\ttheme: DThemeImagePiece,\n\t\toptions?: DImagePieceOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._theme = theme;\n\n\t\tthis._object = null;\n\t\tthis._align = new DImagePieceAlignImpl(this, theme, options?.align);\n\t\tthis._margin = new DImagePieceMarginImpl(this, theme, options?.margin);\n\t\tthis._tint = new DImagePieceTintImpl(this, theme, options?.tint);\n\t\tthis._rotation = options?.rotation;\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 object(): DisplayObject | null {\n\t\treturn this._object;\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 tint(): DImagePieceTint {\n\t\treturn this._tint;\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\tif (this.updateSource()) {\n\t\t\t\tthis.onUpdate();\n\t\t\t}\n\t\t}\n\t}\n\n\tget rotation(): DStateAwareOrValueMightBe<number> {\n\t\treturn this._rotation;\n\t}\n\n\tset rotation(rotation: DStateAwareOrValueMightBe<number>) {\n\t\tif (this._rotation !== rotation) {\n\t\t\tthis._rotation = rotation;\n\t\t\tif (this.updateRotation()) {\n\t\t\t\tDApplications.update(this._parent);\n\t\t\t}\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\tthis.updateRotation();\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\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 object = this._object;\n\t\tif (object) {\n\t\t\tif (this.isTintAware(object)) {\n\t\t\t\tconst state = this._parent.state;\n\t\t\t\tconst color = this._tint.getColor(state);\n\t\t\t\tif (color != null) {\n\t\t\t\t\tlet result = false;\n\t\t\t\t\tif (object.tint !== color) {\n\t\t\t\t\t\tobject.tint = color;\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\tconst alpha = this._tint.getAlpha(state);\n\t\t\t\t\tif (object.alpha !== alpha) {\n\t\t\t\t\t\tobject.alpha = alpha;\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (!object.visible) {\n\t\t\t\t\t\tobject.visible = true;\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} else if (object.visible) {\n\t\t\t\t\tobject.visible = false;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected toRotation(theme: DThemeImagePiece, state: DBaseStateSet): number | null {\n\t\tconst rotation = this._rotation;\n\t\tif (rotation != null) {\n\t\t\tif (isFunction(rotation)) {\n\t\t\t\tconst result = rotation(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 rotation;\n\t\t\t}\n\t\t}\n\t\treturn theme.getImageRotation(state);\n\t}\n\n\tupdateRotation(): boolean {\n\t\tconst object = this._object;\n\t\tif (object) {\n\t\t\tconst theme = this._theme;\n\t\t\tconst state = this._parent.state;\n\t\t\tconst rotation = this.toRotation(theme, state);\n\t\t\tif (rotation != null) {\n\t\t\t\tconst transform = object.transform;\n\t\t\t\tif (transform.rotation !== rotation) {\n\t\t\t\t\ttransform.rotation = rotation;\n\t\t\t\t\treturn true;\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 oldObject = this._object;\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 (oldObject instanceof Sprite) {\n\t\t\t\t\t\toldObject.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 (oldObject != null) {\n\t\t\t\t\t\tparent.removeChild(oldObject);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst newObject = new Sprite(newComputed);\n\t\t\t\t\tnewObject.anchor.set(0.5, 0.5);\n\t\t\t\t\tconst overflowMask = parent.getOverflowMask();\n\t\t\t\t\tif (overflowMask) {\n\t\t\t\t\t\tnewObject.mask = overflowMask;\n\t\t\t\t\t}\n\t\t\t\t\tnewComputed.on(\"update\", onUpdateBound);\n\t\t\t\t\tparent.addChild(newObject);\n\t\t\t\t\tthis._object = newObject;\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 (oldObject != null) {\n\t\t\t\t\t\tparent.removeChild(oldObject);\n\t\t\t\t\t\toldObject.destroy();\n\t\t\t\t\t}\n\t\t\t\t} else if (oldObject != null) {\n\t\t\t\t\tparent.removeChild(oldObject);\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._object = 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._object;\n\t}\n\n\tdestroy(): void {\n\t\tthis.source = null;\n\t}\n\n\tonUpdate(): void {\n\t\tthis._parent.toDirty();\n\t\tDApplications.update(this._parent);\n\t}\n}\n"]}
@@ -128,6 +128,7 @@ var DImagePieceLayouterPartContainer = /** @class */ (function () {
128
128
  var textWidth = 0;
129
129
  var textHeight = 0;
130
130
  if (text != null) {
131
+ text.setClippingDelta(leftSize + rightSize, topSize + bottomSize);
131
132
  textWidth = text.width;
132
133
  textHeight = text.height;
133
134
  }
@@ -162,7 +163,6 @@ var DImagePieceLayouterPartContainer = /** @class */ (function () {
162
163
  }
163
164
  if (text != null) {
164
165
  text.position.set(textX, textY);
165
- text.setClippingDelta(leftSize + rightSize, topSize + bottomSize);
166
166
  }
167
167
  left.execute(textX - leftSize);
168
168
  center.execute(0, 0, textX * 2 + textWidth);
@@ -1 +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;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,0BAA0B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KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;YAChD,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;YAC7B,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;YAC7C,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;SACnD;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YACrC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC7B,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChC;IACF,CAAC;IACF,uCAAC;AAAD,CAAC,AA3LD,IA2LC","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 { DTextPieceAlign } from \"./d-text-piece-align\";\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 | null;\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 object = image.object;\n\t\tif (object != null) {\n\t\t\tconst bound = object.getLocalBounds();\n\t\t\tconst margin = image.margin;\n\t\t\tconst align = image.align;\n\t\t\tswitch (align.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\tthis.left.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\tthis.center.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\tthis.right.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch (align.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\tthis.top.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\tthis.middle.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\tthis.bottom.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(text: DDynamicText | null): void {\n\t\tthis.left.set(text);\n\t\tthis.center.set(text);\n\t\tthis.right.set(text);\n\t\tthis.top.set(text);\n\t\tthis.middle.set(text);\n\t\tthis.bottom.set(text);\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 leftSize = left.size;\n\t\tconst center = this.center;\n\t\tconst centerSize = center.size;\n\t\tconst right = this.right;\n\t\tconst rightSize = right.size;\n\t\tif (text !== undefined) {\n\t\t\tif (text !== null) {\n\t\t\t\treturn Math.max(leftSize + text.width + rightSize, centerSize);\n\t\t\t} else {\n\t\t\t\treturn Math.max(leftSize + rightSize, centerSize);\n\t\t\t}\n\t\t} else {\n\t\t\treturn Math.max(leftSize, rightSize, centerSize);\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 topSize = top.size;\n\t\tconst middle = this.middle;\n\t\tconst middleSize = middle.size;\n\t\tconst bottom = this.bottom;\n\t\tconst bottomSize = bottom.size;\n\t\tif (text !== undefined) {\n\t\t\tif (text !== null) {\n\t\t\t\treturn Math.max(topSize + text.height + bottomSize, middleSize);\n\t\t\t} else {\n\t\t\t\treturn Math.max(topSize + bottomSize, middleSize);\n\t\t\t}\n\t\t} else {\n\t\t\treturn Math.max(topSize, bottomSize, middleSize);\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: DTextPieceAlign,\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 !== undefined) {\n\t\t\tconst leftSize = left.size;\n\t\t\tconst rightSize = right.size;\n\t\t\tconst topSize = top.size;\n\t\t\tconst bottomSize = bottom.size;\n\n\t\t\tlet textX = 0;\n\t\t\tlet textWidth = 0;\n\t\t\tlet textHeight = 0;\n\t\t\tif (text != null) {\n\t\t\t\ttextWidth = text.width;\n\t\t\t\ttextHeight = text.height;\n\t\t\t}\n\t\t\tswitch (textAlign.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\ttextX = pleft + leftSize;\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 - (leftSize + textWidth + rightSize)) * 0.5 +\n\t\t\t\t\t\tleftSize;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\ttextX = width - pright - rightSize - textWidth;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet textY = 0;\n\t\t\tswitch (textAlign.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\ttextY = ptop + topSize;\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 - (topSize + textHeight + bottomSize)) * 0.5 +\n\t\t\t\t\t\ttopSize;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\ttextY = height - pbottom - bottomSize - textHeight;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (text != null) {\n\t\t\t\ttext.position.set(textX, textY);\n\t\t\t\ttext.setClippingDelta(leftSize + rightSize, topSize + bottomSize);\n\t\t\t}\n\t\t\tleft.execute(textX - leftSize);\n\t\t\tcenter.execute(0, 0, textX * 2 + textWidth);\n\t\t\tright.execute(0, textX + textWidth + rightSize);\n\t\t\ttop.execute(textY - topSize);\n\t\t\tmiddle.execute(0, 0, textY * 2 + textHeight);\n\t\t\tbottom.execute(0, textY + textHeight + bottomSize);\n\t\t} else {\n\t\t\tleft.execute(pleft);\n\t\t\tcenter.execute(pleft, pright, width);\n\t\t\tright.execute(pright, width);\n\t\t\ttop.execute(ptop);\n\t\t\tmiddle.execute(ptop, pbottom, height);\n\t\t\tbottom.execute(pbottom, height);\n\t\t}\n\t}\n}\n"]}
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;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAG/E;IAUC;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,2BAA2B,EAAE,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,6BAA6B,EAAE,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,4BAA4B,EAAE,CAAC;QAChD,IAAI,CAAC,GAAG,GAAG,IAAI,0BAA0B,EAAE,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,6BAA6B,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,IAAI,6BAA6B,EAAE,CAAC;IACnD,CAAC;IAED,gDAAK,GAAL;QACC,IAAI,CAAC,IAAI,CAAC,KAA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C,CAAC;YACrC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC7B,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChC;IACF,CAAC;IACF,uCAAC;AAAD,CAAC,AA3LD,IA2LC","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 { DTextPieceAlign } from \"./d-text-piece-align\";\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 | null;\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 object = image.object;\n\t\tif (object != null) {\n\t\t\tconst bound = object.getLocalBounds();\n\t\t\tconst margin = image.margin;\n\t\t\tconst align = image.align;\n\t\t\tswitch (align.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\tthis.left.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.CENTER:\n\t\t\t\t\tthis.center.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\tthis.right.add(image, bound, margin.horizontal);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch (align.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\tthis.top.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.MIDDLE:\n\t\t\t\t\tthis.middle.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\tthis.bottom.add(image, bound, margin.vertical);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(text: DDynamicText | null): void {\n\t\tthis.left.set(text);\n\t\tthis.center.set(text);\n\t\tthis.right.set(text);\n\t\tthis.top.set(text);\n\t\tthis.middle.set(text);\n\t\tthis.bottom.set(text);\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 leftSize = left.size;\n\t\tconst center = this.center;\n\t\tconst centerSize = center.size;\n\t\tconst right = this.right;\n\t\tconst rightSize = right.size;\n\t\tif (text !== undefined) {\n\t\t\tif (text !== null) {\n\t\t\t\treturn Math.max(leftSize + text.width + rightSize, centerSize);\n\t\t\t} else {\n\t\t\t\treturn Math.max(leftSize + rightSize, centerSize);\n\t\t\t}\n\t\t} else {\n\t\t\treturn Math.max(leftSize, rightSize, centerSize);\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 topSize = top.size;\n\t\tconst middle = this.middle;\n\t\tconst middleSize = middle.size;\n\t\tconst bottom = this.bottom;\n\t\tconst bottomSize = bottom.size;\n\t\tif (text !== undefined) {\n\t\t\tif (text !== null) {\n\t\t\t\treturn Math.max(topSize + text.height + bottomSize, middleSize);\n\t\t\t} else {\n\t\t\t\treturn Math.max(topSize + bottomSize, middleSize);\n\t\t\t}\n\t\t} else {\n\t\t\treturn Math.max(topSize, bottomSize, middleSize);\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: DTextPieceAlign,\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 !== undefined) {\n\t\t\tconst leftSize = left.size;\n\t\t\tconst rightSize = right.size;\n\t\t\tconst topSize = top.size;\n\t\t\tconst bottomSize = bottom.size;\n\n\t\t\tlet textX = 0;\n\t\t\tlet textWidth = 0;\n\t\t\tlet textHeight = 0;\n\t\t\tif (text != null) {\n\t\t\t\ttext.setClippingDelta(leftSize + rightSize, topSize + bottomSize);\n\t\t\t\ttextWidth = text.width;\n\t\t\t\ttextHeight = text.height;\n\t\t\t}\n\t\t\tswitch (textAlign.horizontal) {\n\t\t\t\tcase DAlignHorizontal.LEFT:\n\t\t\t\t\ttextX = pleft + leftSize;\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 - (leftSize + textWidth + rightSize)) * 0.5 +\n\t\t\t\t\t\tleftSize;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignHorizontal.RIGHT:\n\t\t\t\t\ttextX = width - pright - rightSize - textWidth;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tlet textY = 0;\n\t\t\tswitch (textAlign.vertical) {\n\t\t\t\tcase DAlignVertical.TOP:\n\t\t\t\t\ttextY = ptop + topSize;\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 - (topSize + textHeight + bottomSize)) * 0.5 +\n\t\t\t\t\t\ttopSize;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DAlignVertical.BOTTOM:\n\t\t\t\t\ttextY = height - pbottom - bottomSize - textHeight;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (text != null) {\n\t\t\t\ttext.position.set(textX, textY);\n\t\t\t}\n\t\t\tleft.execute(textX - leftSize);\n\t\t\tcenter.execute(0, 0, textX * 2 + textWidth);\n\t\t\tright.execute(0, textX + textWidth + rightSize);\n\t\t\ttop.execute(textY - topSize);\n\t\t\tmiddle.execute(0, 0, textY * 2 + textHeight);\n\t\t\tbottom.execute(0, textY + textHeight + bottomSize);\n\t\t} else {\n\t\t\tleft.execute(pleft);\n\t\t\tcenter.execute(pleft, pright, width);\n\t\t\tright.execute(pright, width);\n\t\t\ttop.execute(ptop);\n\t\t\tmiddle.execute(ptop, pbottom, height);\n\t\t\tbottom.execute(pbottom, height);\n\t\t}\n\t}\n}\n"]}
@@ -361,10 +361,11 @@ var DPickerColor = /** @class */ (function (_super) {
361
361
  });
362
362
  this._inputAndLabelAlpha = inputAndLabelAlpha;
363
363
  // Samples
364
- var sampleWidth = (inputWidth - inputLabelWidth - inputMargin) * 0.5;
365
- var sampleHeight = inputHeight + inputMargin + inputHeight;
364
+ var sampleWidth = theme.getSampleWidth();
365
+ var sampleHeight = theme.getSampleHeight();
366
366
  var sampleX = paddingLeft + (mainWidth - inputMargin) * 0.5 + inputMargin;
367
367
  var sampleY = inputY + (inputHeight + inputMargin + inputAndLabelAlpha.height - sampleHeight) * 0.5;
368
+ var sampleMargin = theme.getSampleMargin();
368
369
  var sampleCurrentCheckerboardSprite = new Sprite(theme.getSampleCheckerboardOldTexture());
369
370
  this._sampleCurrentCheckerboardSprite = sampleCurrentCheckerboardSprite;
370
371
  sampleCurrentCheckerboardSprite.x = sampleX;
@@ -391,7 +392,7 @@ var DPickerColor = /** @class */ (function (_super) {
391
392
  this.addChild(sampleCurrentSprite);
392
393
  var sampleNewCheckerboardSprite = new Sprite(theme.getSampleCheckerboardNewTexture());
393
394
  this._sampleNewCheckerboardSprite = sampleNewCheckerboardSprite;
394
- sampleNewCheckerboardSprite.x = sampleX + sampleWidth;
395
+ sampleNewCheckerboardSprite.x = sampleX + sampleWidth + sampleMargin;
395
396
  sampleNewCheckerboardSprite.y = sampleY;
396
397
  sampleNewCheckerboardSprite.width = sampleWidth;
397
398
  sampleNewCheckerboardSprite.height = sampleHeight;
@@ -399,7 +400,7 @@ var DPickerColor = /** @class */ (function (_super) {
399
400
  this.addChild(sampleNewCheckerboardSprite);
400
401
  var sampleNewSprite = new Sprite(theme.getSampleNewTexture());
401
402
  this._sampleNewSprite = sampleNewSprite;
402
- sampleNewSprite.x = sampleX + sampleWidth;
403
+ sampleNewSprite.x = sampleX + sampleWidth + sampleMargin;
403
404
  sampleNewSprite.y = sampleY;
404
405
  sampleNewSprite.tint = this._new.color;
405
406
  sampleNewSprite.alpha = this._new.alpha;