@wcardinal/wcardinal-ui 0.369.0 → 0.370.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.
@@ -35,6 +35,8 @@ export declare class DApplicationLayerOptions {
35
35
  private _pixi;
36
36
  private _padding;
37
37
  private _overlay;
38
+ private _isWidthFixed;
39
+ private _isHeightFixed;
38
40
  constructor(options: DApplicationLayerOptionsOptions);
39
41
  /**
40
42
  * Returns a root element.
@@ -60,6 +62,18 @@ export declare class DApplicationLayerOptions {
60
62
  * @param width new canvas width
61
63
  */
62
64
  setWidth(width: number): this;
65
+ /**
66
+ * Returns true if the width is fixed.
67
+ *
68
+ * @returns true if the width is fixed.
69
+ */
70
+ isWidthFixed(): boolean;
71
+ /**
72
+ * Makes the canvas width fixed.
73
+ *
74
+ * @param fixed true to make the canvas width fixed
75
+ */
76
+ setWidthFixed(fixed: boolean): this;
63
77
  /**
64
78
  * Returns a canvas height.
65
79
  */
@@ -70,6 +84,18 @@ export declare class DApplicationLayerOptions {
70
84
  * @param height new canvas height
71
85
  */
72
86
  setHeight(height: number): this;
87
+ /**
88
+ * Returns true if the height is fixed.
89
+ *
90
+ * @returns true if the height is fixed.
91
+ */
92
+ isHeightFixed(): boolean;
93
+ /**
94
+ * Makes the canvas height fixed.
95
+ *
96
+ * @param fixed true to make the canvas height fixed
97
+ */
98
+ setHeightFixed(fixed: boolean): this;
73
99
  /**
74
100
  * Returns padding sizes.
75
101
  * The default padding size is 6.
@@ -44,6 +44,8 @@ var DApplicationLayerOptions = /** @class */ (function () {
44
44
  width = bbox.width;
45
45
  height = bbox.height;
46
46
  }
47
+ this._isWidthFixed = options.width != null;
48
+ this._isHeightFixed = options.height != null;
47
49
  // Background color
48
50
  var background = options === null || options === void 0 ? void 0 : options.background;
49
51
  var backgroundColor = 0;
@@ -112,6 +114,23 @@ var DApplicationLayerOptions = /** @class */ (function () {
112
114
  this._pixi.width = width;
113
115
  return this;
114
116
  };
117
+ /**
118
+ * Returns true if the width is fixed.
119
+ *
120
+ * @returns true if the width is fixed.
121
+ */
122
+ DApplicationLayerOptions.prototype.isWidthFixed = function () {
123
+ return this._isWidthFixed;
124
+ };
125
+ /**
126
+ * Makes the canvas width fixed.
127
+ *
128
+ * @param fixed true to make the canvas width fixed
129
+ */
130
+ DApplicationLayerOptions.prototype.setWidthFixed = function (fixed) {
131
+ this._isWidthFixed = fixed;
132
+ return this;
133
+ };
115
134
  /**
116
135
  * Returns a canvas height.
117
136
  */
@@ -127,6 +146,23 @@ var DApplicationLayerOptions = /** @class */ (function () {
127
146
  this._pixi.height = height;
128
147
  return this;
129
148
  };
149
+ /**
150
+ * Returns true if the height is fixed.
151
+ *
152
+ * @returns true if the height is fixed.
153
+ */
154
+ DApplicationLayerOptions.prototype.isHeightFixed = function () {
155
+ return this._isHeightFixed;
156
+ };
157
+ /**
158
+ * Makes the canvas height fixed.
159
+ *
160
+ * @param fixed true to make the canvas height fixed
161
+ */
162
+ DApplicationLayerOptions.prototype.setHeightFixed = function (fixed) {
163
+ this._isHeightFixed = fixed;
164
+ return this;
165
+ };
130
166
  /**
131
167
  * Returns padding sizes.
132
168
  * The default padding size is 6.
@@ -1 +1 @@
1
- {"version":3,"file":"d-application-layer-options.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-application-layer-options.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAmC9D;;GAEG;AACH;IAMC,kCAAY,OAAwC;;QACnD,OAAO;QACP,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAElB,sBAAsB;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,UAAU;QACV,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OA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: Apache-2.0\n */\n\nimport { DApplicationPadding } from \"./d-application-padding\";\nimport { DPadding, DPaddingLike } from \"./d-padding\";\n\n/**\n * PixiJS options\n */\nexport interface PixiApplicationOptions {\n\twidth: number;\n\theight: number;\n\tautoStart: boolean;\n\tbackgroundColor: number;\n\ttransparent: boolean;\n\tresolution: number;\n\tantialias: boolean;\n}\n\nexport interface DApplicationLayerBackgroundOptions {\n\tcolor?: number | null;\n}\n\nexport interface DApplicationLayerOptionsOptions {\n\troot: HTMLElement;\n\tpadding?: number | DPaddingLike;\n\twidth?: number;\n\theight?: number;\n\tbackground?: DApplicationLayerBackgroundOptions;\n\tresolution: number;\n\tantialias?: boolean;\n\n\t/**\n\t * Sets to true if a layer is a overlay layer.\n\t */\n\toverlay: boolean;\n}\n\n/**\n * DApplicationLayer options\n */\nexport class DApplicationLayerOptions {\n\tprivate _root: HTMLElement;\n\tprivate _pixi: PixiApplicationOptions;\n\tprivate _padding: DPadding;\n\tprivate _overlay: boolean;\n\n\tconstructor(options: DApplicationLayerOptionsOptions) {\n\t\t// Root\n\t\tconst root = options.root;\n\t\tthis._root = root;\n\n\t\t// Overlay mode or not\n\t\tthis._overlay = options.overlay;\n\n\t\t// Padding\n\t\tthis._padding = new DApplicationPadding(options?.padding);\n\n\t\t// Width & height\n\t\tlet width = 100;\n\t\tlet height = 100;\n\t\tif (options) {\n\t\t\tif (options.width != null) {\n\t\t\t\twidth = options.width;\n\t\t\t\tif (options.height != null) {\n\t\t\t\t\theight = options.height;\n\t\t\t\t} else {\n\t\t\t\t\theight = root.getBoundingClientRect().height;\n\t\t\t\t}\n\t\t\t} else if (options.height != null) {\n\t\t\t\twidth = root.getBoundingClientRect().width;\n\t\t\t\theight = options.height;\n\t\t\t} else {\n\t\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\t\twidth = bbox.width;\n\t\t\t\theight = bbox.height;\n\t\t\t}\n\t\t} else {\n\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\twidth = bbox.width;\n\t\t\theight = bbox.height;\n\t\t}\n\n\t\t// Background color\n\t\tconst background = options?.background;\n\t\tlet backgroundColor = 0;\n\t\tlet transparent = true;\n\t\tif (background != null) {\n\t\t\tconst color = background.color;\n\t\t\tif (color != null) {\n\t\t\t\tbackgroundColor = color;\n\t\t\t\ttransparent = false;\n\t\t\t}\n\t\t}\n\n\t\t// Resolution\n\t\tconst resolution = options.resolution;\n\n\t\t// Antialias\n\t\tconst antialias = options?.antialias ?? false;\n\n\t\t// Pixi\n\t\tthis._pixi = {\n\t\t\twidth,\n\t\t\theight,\n\t\t\tautoStart: false,\n\t\t\tbackgroundColor,\n\t\t\ttransparent,\n\t\t\tresolution,\n\t\t\tantialias\n\t\t};\n\t}\n\n\t/**\n\t * Returns a root element.\n\t * `HTMLCanvasElement` and other DOM elements are created in this element.\n\t * The default root element is `document.body`.\n\t */\n\tgetRootElement(): HTMLElement {\n\t\treturn this._root;\n\t}\n\n\t/**\n\t * Sets a root element and updates the canvas width and height\n\t * if `updateWidthAndHeight` is not false.\n\t *\n\t * @param root new root element\n\t * @param updateWidthAndHeight false to preserve the canvas width / height\n\t */\n\tsetRootElement(root: HTMLElement, updateWidthAndHeight?: boolean): this {\n\t\tif (this._root !== root) {\n\t\t\tthis._root = root;\n\t\t\tif (updateWidthAndHeight !== false) {\n\t\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\t\tconst pixi = this._pixi;\n\t\t\t\tpixi.width = bbox.width;\n\t\t\t\tpixi.height = bbox.height;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a canvas width.\n\t */\n\tgetWidth(): number {\n\t\treturn this._pixi.width;\n\t}\n\n\t/**\n\t * Sets a canvas width.\n\t *\n\t * @param width new canvas width\n\t */\n\tsetWidth(width: number): this {\n\t\tthis._pixi.width = width;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a canvas height.\n\t */\n\tgetHeight(): number {\n\t\treturn this._pixi.height;\n\t}\n\n\t/**\n\t * Sets a canvas height.\n\t *\n\t * @param height new canvas height\n\t */\n\tsetHeight(height: number): this {\n\t\tthis._pixi.height = height;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns padding sizes.\n\t * The default padding size is 6.\n\t */\n\tgetPadding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\t/**\n\t * Sets padding sizes.\n\t *\n\t * @param left new left padding\n\t * @param top new top padding\n\t * @param right new right padding\n\t * @param bottom new bottom padding\n\t */\n\tsetPadding(left: number, top: number, right: number, bottom: number): this {\n\t\tconst padding = this._padding;\n\t\tpadding.left = left;\n\t\tpadding.top = top;\n\t\tpadding.right = right;\n\t\tpadding.bottom = bottom;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a background color.\n\t */\n\tgetBackgroundColor(): number {\n\t\treturn this._pixi.backgroundColor;\n\t}\n\n\t/**\n\t * Sets a background color.\n\t *\n\t * @param color new background color\n\t */\n\tsetBackgroundColor(color: number): this {\n\t\tthis._pixi.backgroundColor = color;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns an antialias setting.\n\t * The default antialias setting is false.\n\t */\n\tgetAntialias(): boolean {\n\t\treturn this._pixi.antialias;\n\t}\n\n\t/**\n\t * Sets an antialias setting.\n\t *\n\t * @param antialias new antialias setting\n\t */\n\tsetAntialias(antialias: boolean): this {\n\t\tthis._pixi.antialias = antialias;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns true if a layer is supposed to be an overlay layer.\n\t */\n\tisOverlay(): boolean {\n\t\treturn this._overlay;\n\t}\n\n\tgetPixiApplicationOptions(): PixiApplicationOptions {\n\t\treturn this._pixi;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-application-layer-options.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-application-layer-options.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAmC9D;;GAEG;AACH;IAQC,kCAAY,OAAwC;;QAC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AClB,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QACtB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,qDAAkB,GAAlB;QACC,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,qDAAkB,GAAlB,UAAmB,KAAa;QAC/B,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACH,+CAAY,GAAZ;QACC,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,+CAAY,GAAZ,UAAa,SAAkB;QAC9B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,4CAAS,GAAT;QACC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAED,4DAAyB,GAAzB;QACC,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IACF,+BAAC;AAAD,CAAC,AAvPD,IAuPC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DApplicationPadding } from \"./d-application-padding\";\nimport { DPadding, DPaddingLike } from \"./d-padding\";\n\n/**\n * PixiJS options\n */\nexport interface PixiApplicationOptions {\n\twidth: number;\n\theight: number;\n\tautoStart: boolean;\n\tbackgroundColor: number;\n\ttransparent: boolean;\n\tresolution: number;\n\tantialias: boolean;\n}\n\nexport interface DApplicationLayerBackgroundOptions {\n\tcolor?: number | null;\n}\n\nexport interface DApplicationLayerOptionsOptions {\n\troot: HTMLElement;\n\tpadding?: number | DPaddingLike;\n\twidth?: number;\n\theight?: number;\n\tbackground?: DApplicationLayerBackgroundOptions;\n\tresolution: number;\n\tantialias?: boolean;\n\n\t/**\n\t * Sets to true if a layer is a overlay layer.\n\t */\n\toverlay: boolean;\n}\n\n/**\n * DApplicationLayer options\n */\nexport class DApplicationLayerOptions {\n\tprivate _root: HTMLElement;\n\tprivate _pixi: PixiApplicationOptions;\n\tprivate _padding: DPadding;\n\tprivate _overlay: boolean;\n\tprivate _isWidthFixed: boolean;\n\tprivate _isHeightFixed: boolean;\n\n\tconstructor(options: DApplicationLayerOptionsOptions) {\n\t\t// Root\n\t\tconst root = options.root;\n\t\tthis._root = root;\n\n\t\t// Overlay mode or not\n\t\tthis._overlay = options.overlay;\n\n\t\t// Padding\n\t\tthis._padding = new DApplicationPadding(options?.padding);\n\n\t\t// Width & height\n\t\tlet width = 100;\n\t\tlet height = 100;\n\t\tif (options) {\n\t\t\tif (options.width != null) {\n\t\t\t\twidth = options.width;\n\t\t\t\tif (options.height != null) {\n\t\t\t\t\theight = options.height;\n\t\t\t\t} else {\n\t\t\t\t\theight = root.getBoundingClientRect().height;\n\t\t\t\t}\n\t\t\t} else if (options.height != null) {\n\t\t\t\twidth = root.getBoundingClientRect().width;\n\t\t\t\theight = options.height;\n\t\t\t} else {\n\t\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\t\twidth = bbox.width;\n\t\t\t\theight = bbox.height;\n\t\t\t}\n\t\t} else {\n\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\twidth = bbox.width;\n\t\t\theight = bbox.height;\n\t\t}\n\t\tthis._isWidthFixed = options.width != null;\n\t\tthis._isHeightFixed = options.height != null;\n\n\t\t// Background color\n\t\tconst background = options?.background;\n\t\tlet backgroundColor = 0;\n\t\tlet transparent = true;\n\t\tif (background != null) {\n\t\t\tconst color = background.color;\n\t\t\tif (color != null) {\n\t\t\t\tbackgroundColor = color;\n\t\t\t\ttransparent = false;\n\t\t\t}\n\t\t}\n\n\t\t// Resolution\n\t\tconst resolution = options.resolution;\n\n\t\t// Antialias\n\t\tconst antialias = options?.antialias ?? false;\n\n\t\t// Pixi\n\t\tthis._pixi = {\n\t\t\twidth,\n\t\t\theight,\n\t\t\tautoStart: false,\n\t\t\tbackgroundColor,\n\t\t\ttransparent,\n\t\t\tresolution,\n\t\t\tantialias\n\t\t};\n\t}\n\n\t/**\n\t * Returns a root element.\n\t * `HTMLCanvasElement` and other DOM elements are created in this element.\n\t * The default root element is `document.body`.\n\t */\n\tgetRootElement(): HTMLElement {\n\t\treturn this._root;\n\t}\n\n\t/**\n\t * Sets a root element and updates the canvas width and height\n\t * if `updateWidthAndHeight` is not false.\n\t *\n\t * @param root new root element\n\t * @param updateWidthAndHeight false to preserve the canvas width / height\n\t */\n\tsetRootElement(root: HTMLElement, updateWidthAndHeight?: boolean): this {\n\t\tif (this._root !== root) {\n\t\t\tthis._root = root;\n\t\t\tif (updateWidthAndHeight !== false) {\n\t\t\t\tconst bbox = root.getBoundingClientRect();\n\t\t\t\tconst pixi = this._pixi;\n\t\t\t\tpixi.width = bbox.width;\n\t\t\t\tpixi.height = bbox.height;\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a canvas width.\n\t */\n\tgetWidth(): number {\n\t\treturn this._pixi.width;\n\t}\n\n\t/**\n\t * Sets a canvas width.\n\t *\n\t * @param width new canvas width\n\t */\n\tsetWidth(width: number): this {\n\t\tthis._pixi.width = width;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns true if the width is fixed.\n\t *\n\t * @returns true if the width is fixed.\n\t */\n\tisWidthFixed(): boolean {\n\t\treturn this._isWidthFixed;\n\t}\n\n\t/**\n\t * Makes the canvas width fixed.\n\t *\n\t * @param fixed true to make the canvas width fixed\n\t */\n\tsetWidthFixed(fixed: boolean): this {\n\t\tthis._isWidthFixed = fixed;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a canvas height.\n\t */\n\tgetHeight(): number {\n\t\treturn this._pixi.height;\n\t}\n\n\t/**\n\t * Sets a canvas height.\n\t *\n\t * @param height new canvas height\n\t */\n\tsetHeight(height: number): this {\n\t\tthis._pixi.height = height;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns true if the height is fixed.\n\t *\n\t * @returns true if the height is fixed.\n\t */\n\tisHeightFixed(): boolean {\n\t\treturn this._isHeightFixed;\n\t}\n\n\t/**\n\t * Makes the canvas height fixed.\n\t *\n\t * @param fixed true to make the canvas height fixed\n\t */\n\tsetHeightFixed(fixed: boolean): this {\n\t\tthis._isHeightFixed = fixed;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns padding sizes.\n\t * The default padding size is 6.\n\t */\n\tgetPadding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\t/**\n\t * Sets padding sizes.\n\t *\n\t * @param left new left padding\n\t * @param top new top padding\n\t * @param right new right padding\n\t * @param bottom new bottom padding\n\t */\n\tsetPadding(left: number, top: number, right: number, bottom: number): this {\n\t\tconst padding = this._padding;\n\t\tpadding.left = left;\n\t\tpadding.top = top;\n\t\tpadding.right = right;\n\t\tpadding.bottom = bottom;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns a background color.\n\t */\n\tgetBackgroundColor(): number {\n\t\treturn this._pixi.backgroundColor;\n\t}\n\n\t/**\n\t * Sets a background color.\n\t *\n\t * @param color new background color\n\t */\n\tsetBackgroundColor(color: number): this {\n\t\tthis._pixi.backgroundColor = color;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns an antialias setting.\n\t * The default antialias setting is false.\n\t */\n\tgetAntialias(): boolean {\n\t\treturn this._pixi.antialias;\n\t}\n\n\t/**\n\t * Sets an antialias setting.\n\t *\n\t * @param antialias new antialias setting\n\t */\n\tsetAntialias(antialias: boolean): this {\n\t\tthis._pixi.antialias = antialias;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns true if a layer is supposed to be an overlay layer.\n\t */\n\tisOverlay(): boolean {\n\t\treturn this._overlay;\n\t}\n\n\tgetPixiApplicationOptions(): PixiApplicationOptions {\n\t\treturn this._pixi;\n\t}\n}\n"]}
@@ -126,23 +126,34 @@ var DApplicationLayer = /** @class */ (function (_super) {
126
126
  };
127
127
  DApplicationLayer.prototype.initResizeHandling = function () {
128
128
  var _this = this;
129
- var onResizeBound = function () {
130
- _this.onResize();
131
- };
132
- window.addEventListener("resize", onResizeBound);
133
- window.addEventListener("orientationchange", onResizeBound);
129
+ var options = this._options;
130
+ var isWidthFixed = options.isWidthFixed();
131
+ var isHeightFixed = options.isHeightFixed();
132
+ if (!isWidthFixed || !isHeightFixed) {
133
+ var onResizeBound = function () {
134
+ _this.onResize();
135
+ };
136
+ if (window.ResizeObserver != null) {
137
+ new ResizeObserver(onResizeBound).observe(this._rootElement);
138
+ }
139
+ else {
140
+ window.addEventListener("resize", onResizeBound);
141
+ window.addEventListener("orientationchange", onResizeBound);
142
+ }
143
+ }
134
144
  };
135
145
  DApplicationLayer.prototype.onResize = function () {
146
+ var options = this._options;
136
147
  var bbox = this._rootElement.getBoundingClientRect();
137
- var bboxWidth = bbox.width;
138
- var bboxHeight = bbox.height;
139
- this.renderer.resize(bboxWidth, bboxHeight);
148
+ var newWidth = options.isWidthFixed() ? options.getWidth() : bbox.width;
149
+ var newHeight = options.isHeightFixed() ? options.getHeight() : bbox.height;
150
+ this.renderer.resize(newWidth, newHeight);
140
151
  var padding = this._padding;
141
152
  var children = this.stage.children;
142
153
  for (var i = 0, imax = children.length; i < imax; ++i) {
143
154
  var child = children[i];
144
155
  if (child instanceof DBase) {
145
- child.onParentResize(bboxWidth, bboxHeight, padding);
156
+ child.onParentResize(newWidth, newHeight, padding);
146
157
  }
147
158
  }
148
159
  this.update();
@@ -1 +1 @@
1
- {"version":3,"file":"d-application-layer.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-application-layer.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,WAAW,EAAe,KAAK,EAAE,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,i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ation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Application, interaction, Point } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplicationLayerOptions } from \"./d-application-layer-options\";\nimport { DApplicationLike } from \"./d-application-like\";\nimport { DBase } from \"./d-base\";\nimport { DControllerFocus, DFocusable, DFocusableContainer } from \"./d-controller-focus\";\nimport { DControllers } from \"./d-controllers\";\nimport { DPadding } from \"./d-padding\";\nimport { DynamicFontAtlases } from \"./util/dynamic-font-atlases\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEvent, UtilWheelEventDeltas } from \"./util/util-wheel-event\";\n\ninterface DblClickable {\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean;\n}\n\nconst isDblClickable = (target: any): target is DblClickable => {\n\treturn target != null && target.onDblClick != null;\n};\n\ninterface Wheelable {\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean;\n}\n\nconst isWheelable = (target: any): target is Wheelable => {\n\treturn target != null && target.onWheel != null;\n};\n\nexport class DApplicationLayer extends Application implements DApplicationLayerLike {\n\tprotected _options: DApplicationLayerOptions;\n\tprotected _renderId: number | null = null;\n\tprotected _renderBound: () => void;\n\tprotected _isLocked: boolean;\n\tprotected _isOverlay: boolean;\n\tprotected _reflowLimit: number;\n\tprotected _rootElement: HTMLElement;\n\tprotected _elementContainer: HTMLElement;\n\tprotected _padding: DPadding;\n\tprotected _dynamicFontAtlases: DynamicFontAtlases | null = null;\n\tprotected _isVisible: boolean;\n\n\treadonly application: DApplicationLike;\n\n\tconstructor(application: DApplicationLike, options: DApplicationLayerOptions) {\n\t\tsuper(options.getPixiApplicationOptions());\n\n\t\tthis._options = options;\n\t\tthis._isLocked = false;\n\t\tthis._isVisible = true;\n\t\tthis._isOverlay = options.isOverlay();\n\t\tthis._padding = options.getPadding();\n\t\tthis._rootElement = options.getRootElement();\n\t\tthis._reflowLimit = 5;\n\t\tthis._elementContainer = this.newElementContainer();\n\n\t\tthis.application = application;\n\n\t\tthis._renderBound = (): void => {\n\t\t\tif (this._renderId != null) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t};\n\n\t\tthis.initStage();\n\t\tthis.initView();\n\t\tthis.initRootElement();\n\t\tthis.initFocusHandling();\n\t\tthis.initResizeHandling();\n\t\tthis.initWheelHandling();\n\t\tthis.initDoubleClickHandling();\n\t}\n\n\tprotected newElementContainer(): HTMLElement {\n\t\tconst result = document.createElement(\"div\");\n\t\tresult.setAttribute(\n\t\t\t\"style\",\n\t\t\t\"position: absolute; top: 0; left: 0; width: 0; height: 0;\" +\n\t\t\t\t\"margin: 0; padding: 0; outline: none;\"\n\t\t);\n\t\treturn result;\n\t}\n\n\tprotected initStage(): void {\n\t\tconst stage = this.stage;\n\t\t(stage as any).layer = this;\n\t\t(stage as any).application = this.application;\n\t\tstage.interactive = true;\n\t}\n\n\tprotected initView(): void {\n\t\tconst view = this.view;\n\t\tconst style = view.style;\n\t\tstyle.position = \"absolute\";\n\t\tstyle.top = \"0\";\n\t\tstyle.left = \"0\";\n\t\tstyle.width = \"100%\";\n\t\tstyle.height = \"100%\";\n\t\tstyle.display = \"block\";\n\t\tstyle.outline = \"none\";\n\t\t(style as any).webkitTapHighlightColor = \"rgba(255,255,255,0)\";\n\t\tstyle.webkitUserSelect = \"none\";\n\t\tstyle.setProperty(\"-khtml-user-select\", \"none\");\n\t\tstyle.setProperty(\"-moz-user-select\", \"none\");\n\t\tstyle.setProperty(\"-ms-user-select\", \"none\");\n\t\tstyle.userSelect = \"none\";\n\t}\n\n\tprotected initRootElement(): void {\n\t\tconst view = this.view;\n\t\tconst isOverlay = this._isOverlay;\n\t\tconst rootElement = this._rootElement;\n\t\tconst elementContainer = this._elementContainer;\n\n\t\t// Insert elements\n\t\tconst insertionPosition = isOverlay ? 2 : 0;\n\t\tconst children = rootElement.children;\n\t\tif (insertionPosition < children.length) {\n\t\t\tconst child = children[insertionPosition];\n\t\t\trootElement.insertBefore(view, child);\n\t\t\trootElement.insertBefore(elementContainer, child);\n\t\t} else {\n\t\t\trootElement.appendChild(view);\n\t\t\trootElement.appendChild(elementContainer);\n\t\t}\n\n\t\tif (isOverlay) {\n\t\t\tconst stage = this.stage;\n\t\t\tconst oldOnChildrenChange = (stage as any).onChildrenChange;\n\t\t\t(stage as any).onChildrenChange = (): void => {\n\t\t\t\tthis.onStageDirty();\n\t\t\t\toldOnChildrenChange.call(stage);\n\t\t\t};\n\t\t}\n\n\t\t// Init styles\n\t\tconst rootElementStyle = rootElement.style;\n\t\tif (rootElement !== document.body) {\n\t\t\tconst rootElementStylePosition = window.getComputedStyle(rootElement).position;\n\t\t\tif (rootElementStylePosition === \"static\") {\n\t\t\t\trootElementStyle.position = \"relative\";\n\t\t\t}\n\t\t}\n\t\trootElementStyle.margin = \"0\";\n\t\trootElementStyle.padding = \"0\";\n\t\trootElementStyle.overflow = \"hidden\";\n\t}\n\n\tprotected initFocusHandling(): void {\n\t\tconst view = this.view;\n\t\tconst stage = this.stage;\n\t\tconst focusController = this.getFocusController();\n\n\t\tview.setAttribute(\"tabindex\", \"0\");\n\n\t\tDControllers.getKeyboardController().init(view, stage, focusController);\n\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tinteractionManager.on(UtilPointerEvent.down, (e: interaction.InteractionEvent): void => {\n\t\t\tif (e.target == null || e.target === stage) {\n\t\t\t\tfocusController.clear();\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected initResizeHandling(): void {\n\t\tconst onResizeBound = (): void => {\n\t\t\tthis.onResize();\n\t\t};\n\t\twindow.addEventListener(\"resize\", onResizeBound);\n\t\twindow.addEventListener(\"orientationchange\", onResizeBound);\n\t}\n\n\tprotected onResize(): void {\n\t\tconst bbox = this._rootElement.getBoundingClientRect();\n\t\tconst bboxWidth = bbox.width;\n\t\tconst bboxHeight = bbox.height;\n\t\tthis.renderer.resize(bboxWidth, bboxHeight);\n\n\t\tconst padding = this._padding;\n\t\tconst children = this.stage.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentResize(bboxWidth, bboxHeight, padding);\n\t\t\t}\n\t\t}\n\n\t\tthis.update();\n\t}\n\n\tprotected initWheelHandling(): void {\n\t\tconst global = new Point();\n\t\tconst util = UtilWheelEvent.getInstance();\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tutil.on(this.view, (e: WheelEvent | Event): void => {\n\t\t\tconst wheelEvent = e as WheelEvent;\n\t\t\tUtilPointerEvent.toGlobal(wheelEvent, interactionManager, global);\n\t\t\tlet current = interactionManager.hitTest(global);\n\t\t\tconst deltas = util.normalize(e);\n\t\t\tif (deltas != null) {\n\t\t\t\twhile (current != null) {\n\t\t\t\t\tif (isWheelable(current)) {\n\t\t\t\t\t\tif (current.onWheel(wheelEvent, deltas, global)) {\n\t\t\t\t\t\t\twheelEvent.preventDefault();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected initDoubleClickHandling(): void {\n\t\tconst focusController = this.getFocusController();\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tUtilPointerEvent.onDblClick(this.view, (e: MouseEvent | TouchEvent): void => {\n\t\t\tconst focused = focusController.get();\n\t\t\tif (focused != null) {\n\t\t\t\tlet current: DFocusable | DFocusableContainer | null = focused;\n\t\t\t\twhile (current != null) {\n\t\t\t\t\tif (isDblClickable(current)) {\n\t\t\t\t\t\tif (current.onDblClick(e, interactionManager)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tlock(): void {\n\t\tthis._isLocked = true;\n\t}\n\n\tunlock(): void {\n\t\tthis._isLocked = false;\n\t}\n\n\tupdate(): void {\n\t\tif (!this._isLocked && this._renderId == null) {\n\t\t\tthis._renderId = requestAnimationFrame(this._renderBound);\n\t\t}\n\t}\n\n\tprotected onStageDirty(): void {\n\t\t// Update the visibility if this is a overlay layer.\n\t\tif (this._isOverlay) {\n\t\t\tif (0 < this.stage.children.length) {\n\t\t\t\t// There are more than one children,\n\t\t\t\t// therefore must be visible.\n\t\t\t\tif (!this._isVisible) {\n\t\t\t\t\tthis._isVisible = true;\n\t\t\t\t\tthis.view.style.display = \"block\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// There is no child,\n\t\t\t\t// therefore must not be visible.\n\t\t\t\tif (this._isVisible) {\n\t\t\t\t\tthis._isVisible = false;\n\t\t\t\t\tthis.view.style.display = \"none\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trender(): void {\n\t\tthis.reflow();\n\n\t\t// Please note why the following line is here.\n\t\t//\n\t\t// Before this line, the update method does not enque a rendering task\n\t\t// because `this._renderId` is not null. As a result, this prevents\n\t\t// an unintentional rendering loop caused by the refit or the reflow.\n\t\t//\n\t\t// After this line, the update method enques a rendering task.\n\t\t// Namely, in the DisplayObject#render(Renderer) method, allowed to enque\n\t\t// a rendering task. For instance, please refer to the DDiagramShape#update().\n\t\tthis._renderId = null;\n\n\t\t// Render\n\t\tsuper.render();\n\t}\n\n\tget width(): number {\n\t\treturn this.screen.width;\n\t}\n\n\tget height(): number {\n\t\treturn this.screen.height;\n\t}\n\n\tget padding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\treflow(): void {\n\t\tconst children = this.stage.children;\n\t\tfor (let ilimit = 0, limit = this._reflowLimit; ilimit < limit; ++ilimit) {\n\t\t\tlet isDirty = false;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child instanceof DBase) {\n\t\t\t\t\tchild.reflow();\n\t\t\t\t\tisDirty =\n\t\t\t\t\t\tisDirty || child.isDirty() || child.hasDirty() || child.isHierarchyDirty();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If DBases are changed during the `reflow` process, need to reflow again.\n\t\t\tif (!isDirty) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tgetFocusController(): DControllerFocus {\n\t\treturn this.application.getFocusController();\n\t}\n\n\tgetRootElement(): HTMLElement {\n\t\treturn this._rootElement;\n\t}\n\n\tgetElementContainer(): HTMLElement {\n\t\treturn this._elementContainer;\n\t}\n\n\tgetDynamicFontAtlases(): DynamicFontAtlases {\n\t\tif (this._dynamicFontAtlases == null) {\n\t\t\tthis._dynamicFontAtlases = new DynamicFontAtlases(this);\n\t\t}\n\t\treturn this._dynamicFontAtlases;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-application-layer.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-application-layer.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,WAAW,EAAe,KAAK,EAAE,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAS/E,IAAM,cAAc,GAAG,UAAC,MAAW;IAClC,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC;AACpD,CAAC,CAAC;AAMF,IAAM,WAAW,GAAG,UAAC,MAAW;IAC/B,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC;AACjD,CAAC,CAAC;AAEF;IAAuC,qCAAW;IAejD,2BAAY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AO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;IACF,wBAAC;AAAD,CAAC,AA7TD,CAAuC,WAAW,GA6TjD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Application, interaction, Point } from \"pixi.js\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplicationLayerOptions } from \"./d-application-layer-options\";\nimport { DApplicationLike } from \"./d-application-like\";\nimport { DBase } from \"./d-base\";\nimport { DControllerFocus, DFocusable, DFocusableContainer } from \"./d-controller-focus\";\nimport { DControllers } from \"./d-controllers\";\nimport { DPadding } from \"./d-padding\";\nimport { DynamicFontAtlases } from \"./util/dynamic-font-atlases\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEvent, UtilWheelEventDeltas } from \"./util/util-wheel-event\";\n\ninterface DblClickable {\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean;\n}\n\nconst isDblClickable = (target: any): target is DblClickable => {\n\treturn target != null && target.onDblClick != null;\n};\n\ninterface Wheelable {\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean;\n}\n\nconst isWheelable = (target: any): target is Wheelable => {\n\treturn target != null && target.onWheel != null;\n};\n\nexport class DApplicationLayer extends Application implements DApplicationLayerLike {\n\tprotected _options: DApplicationLayerOptions;\n\tprotected _renderId: number | null = null;\n\tprotected _renderBound: () => void;\n\tprotected _isLocked: boolean;\n\tprotected _isOverlay: boolean;\n\tprotected _reflowLimit: number;\n\tprotected _rootElement: HTMLElement;\n\tprotected _elementContainer: HTMLElement;\n\tprotected _padding: DPadding;\n\tprotected _dynamicFontAtlases: DynamicFontAtlases | null = null;\n\tprotected _isVisible: boolean;\n\n\treadonly application: DApplicationLike;\n\n\tconstructor(application: DApplicationLike, options: DApplicationLayerOptions) {\n\t\tsuper(options.getPixiApplicationOptions());\n\n\t\tthis._options = options;\n\t\tthis._isLocked = false;\n\t\tthis._isVisible = true;\n\t\tthis._isOverlay = options.isOverlay();\n\t\tthis._padding = options.getPadding();\n\t\tthis._rootElement = options.getRootElement();\n\t\tthis._reflowLimit = 5;\n\t\tthis._elementContainer = this.newElementContainer();\n\n\t\tthis.application = application;\n\n\t\tthis._renderBound = (): void => {\n\t\t\tif (this._renderId != null) {\n\t\t\t\tthis.render();\n\t\t\t}\n\t\t};\n\n\t\tthis.initStage();\n\t\tthis.initView();\n\t\tthis.initRootElement();\n\t\tthis.initFocusHandling();\n\t\tthis.initResizeHandling();\n\t\tthis.initWheelHandling();\n\t\tthis.initDoubleClickHandling();\n\t}\n\n\tprotected newElementContainer(): HTMLElement {\n\t\tconst result = document.createElement(\"div\");\n\t\tresult.setAttribute(\n\t\t\t\"style\",\n\t\t\t\"position: absolute; top: 0; left: 0; width: 0; height: 0;\" +\n\t\t\t\t\"margin: 0; padding: 0; outline: none;\"\n\t\t);\n\t\treturn result;\n\t}\n\n\tprotected initStage(): void {\n\t\tconst stage = this.stage;\n\t\t(stage as any).layer = this;\n\t\t(stage as any).application = this.application;\n\t\tstage.interactive = true;\n\t}\n\n\tprotected initView(): void {\n\t\tconst view = this.view;\n\t\tconst style = view.style;\n\t\tstyle.position = \"absolute\";\n\t\tstyle.top = \"0\";\n\t\tstyle.left = \"0\";\n\t\tstyle.width = \"100%\";\n\t\tstyle.height = \"100%\";\n\t\tstyle.display = \"block\";\n\t\tstyle.outline = \"none\";\n\t\t(style as any).webkitTapHighlightColor = \"rgba(255,255,255,0)\";\n\t\tstyle.webkitUserSelect = \"none\";\n\t\tstyle.setProperty(\"-khtml-user-select\", \"none\");\n\t\tstyle.setProperty(\"-moz-user-select\", \"none\");\n\t\tstyle.setProperty(\"-ms-user-select\", \"none\");\n\t\tstyle.userSelect = \"none\";\n\t}\n\n\tprotected initRootElement(): void {\n\t\tconst view = this.view;\n\t\tconst isOverlay = this._isOverlay;\n\t\tconst rootElement = this._rootElement;\n\t\tconst elementContainer = this._elementContainer;\n\n\t\t// Insert elements\n\t\tconst insertionPosition = isOverlay ? 2 : 0;\n\t\tconst children = rootElement.children;\n\t\tif (insertionPosition < children.length) {\n\t\t\tconst child = children[insertionPosition];\n\t\t\trootElement.insertBefore(view, child);\n\t\t\trootElement.insertBefore(elementContainer, child);\n\t\t} else {\n\t\t\trootElement.appendChild(view);\n\t\t\trootElement.appendChild(elementContainer);\n\t\t}\n\n\t\tif (isOverlay) {\n\t\t\tconst stage = this.stage;\n\t\t\tconst oldOnChildrenChange = (stage as any).onChildrenChange;\n\t\t\t(stage as any).onChildrenChange = (): void => {\n\t\t\t\tthis.onStageDirty();\n\t\t\t\toldOnChildrenChange.call(stage);\n\t\t\t};\n\t\t}\n\n\t\t// Init styles\n\t\tconst rootElementStyle = rootElement.style;\n\t\tif (rootElement !== document.body) {\n\t\t\tconst rootElementStylePosition = window.getComputedStyle(rootElement).position;\n\t\t\tif (rootElementStylePosition === \"static\") {\n\t\t\t\trootElementStyle.position = \"relative\";\n\t\t\t}\n\t\t}\n\t\trootElementStyle.margin = \"0\";\n\t\trootElementStyle.padding = \"0\";\n\t\trootElementStyle.overflow = \"hidden\";\n\t}\n\n\tprotected initFocusHandling(): void {\n\t\tconst view = this.view;\n\t\tconst stage = this.stage;\n\t\tconst focusController = this.getFocusController();\n\n\t\tview.setAttribute(\"tabindex\", \"0\");\n\n\t\tDControllers.getKeyboardController().init(view, stage, focusController);\n\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tinteractionManager.on(UtilPointerEvent.down, (e: interaction.InteractionEvent): void => {\n\t\t\tif (e.target == null || e.target === stage) {\n\t\t\t\tfocusController.clear();\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected initResizeHandling(): void {\n\t\tconst options = this._options;\n\t\tconst isWidthFixed = options.isWidthFixed();\n\t\tconst isHeightFixed = options.isHeightFixed();\n\t\tif (!isWidthFixed || !isHeightFixed) {\n\t\t\tconst onResizeBound = (): void => {\n\t\t\t\tthis.onResize();\n\t\t\t};\n\t\t\tif (window.ResizeObserver != null) {\n\t\t\t\tnew ResizeObserver(onResizeBound).observe(this._rootElement);\n\t\t\t} else {\n\t\t\t\twindow.addEventListener(\"resize\", onResizeBound);\n\t\t\t\twindow.addEventListener(\"orientationchange\", onResizeBound);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onResize(): void {\n\t\tconst options = this._options;\n\t\tconst bbox = this._rootElement.getBoundingClientRect();\n\t\tconst newWidth = options.isWidthFixed() ? options.getWidth() : bbox.width;\n\t\tconst newHeight = options.isHeightFixed() ? options.getHeight() : bbox.height;\n\t\tthis.renderer.resize(newWidth, newHeight);\n\n\t\tconst padding = this._padding;\n\t\tconst children = this.stage.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DBase) {\n\t\t\t\tchild.onParentResize(newWidth, newHeight, padding);\n\t\t\t}\n\t\t}\n\n\t\tthis.update();\n\t}\n\n\tprotected initWheelHandling(): void {\n\t\tconst global = new Point();\n\t\tconst util = UtilWheelEvent.getInstance();\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tutil.on(this.view, (e: WheelEvent | Event): void => {\n\t\t\tconst wheelEvent = e as WheelEvent;\n\t\t\tUtilPointerEvent.toGlobal(wheelEvent, interactionManager, global);\n\t\t\tlet current = interactionManager.hitTest(global);\n\t\t\tconst deltas = util.normalize(e);\n\t\t\tif (deltas != null) {\n\t\t\t\twhile (current != null) {\n\t\t\t\t\tif (isWheelable(current)) {\n\t\t\t\t\t\tif (current.onWheel(wheelEvent, deltas, global)) {\n\t\t\t\t\t\t\twheelEvent.preventDefault();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected initDoubleClickHandling(): void {\n\t\tconst focusController = this.getFocusController();\n\t\tconst interactionManager = this.renderer.plugins.interaction;\n\t\tUtilPointerEvent.onDblClick(this.view, (e: MouseEvent | TouchEvent): void => {\n\t\t\tconst focused = focusController.get();\n\t\t\tif (focused != null) {\n\t\t\t\tlet current: DFocusable | DFocusableContainer | null = focused;\n\t\t\t\twhile (current != null) {\n\t\t\t\t\tif (isDblClickable(current)) {\n\t\t\t\t\t\tif (current.onDblClick(e, interactionManager)) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = current.parent;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tlock(): void {\n\t\tthis._isLocked = true;\n\t}\n\n\tunlock(): void {\n\t\tthis._isLocked = false;\n\t}\n\n\tupdate(): void {\n\t\tif (!this._isLocked && this._renderId == null) {\n\t\t\tthis._renderId = requestAnimationFrame(this._renderBound);\n\t\t}\n\t}\n\n\tprotected onStageDirty(): void {\n\t\t// Update the visibility if this is a overlay layer.\n\t\tif (this._isOverlay) {\n\t\t\tif (0 < this.stage.children.length) {\n\t\t\t\t// There are more than one children,\n\t\t\t\t// therefore must be visible.\n\t\t\t\tif (!this._isVisible) {\n\t\t\t\t\tthis._isVisible = true;\n\t\t\t\t\tthis.view.style.display = \"block\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// There is no child,\n\t\t\t\t// therefore must not be visible.\n\t\t\t\tif (this._isVisible) {\n\t\t\t\t\tthis._isVisible = false;\n\t\t\t\t\tthis.view.style.display = \"none\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trender(): void {\n\t\tthis.reflow();\n\n\t\t// Please note why the following line is here.\n\t\t//\n\t\t// Before this line, the update method does not enque a rendering task\n\t\t// because `this._renderId` is not null. As a result, this prevents\n\t\t// an unintentional rendering loop caused by the refit or the reflow.\n\t\t//\n\t\t// After this line, the update method enques a rendering task.\n\t\t// Namely, in the DisplayObject#render(Renderer) method, allowed to enque\n\t\t// a rendering task. For instance, please refer to the DDiagramShape#update().\n\t\tthis._renderId = null;\n\n\t\t// Render\n\t\tsuper.render();\n\t}\n\n\tget width(): number {\n\t\treturn this.screen.width;\n\t}\n\n\tget height(): number {\n\t\treturn this.screen.height;\n\t}\n\n\tget padding(): DPadding {\n\t\treturn this._padding;\n\t}\n\n\treflow(): void {\n\t\tconst children = this.stage.children;\n\t\tfor (let ilimit = 0, limit = this._reflowLimit; ilimit < limit; ++ilimit) {\n\t\t\tlet isDirty = false;\n\t\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\t\tconst child = children[i];\n\t\t\t\tif (child instanceof DBase) {\n\t\t\t\t\tchild.reflow();\n\t\t\t\t\tisDirty =\n\t\t\t\t\t\tisDirty || child.isDirty() || child.hasDirty() || child.isHierarchyDirty();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If DBases are changed during the `reflow` process, need to reflow again.\n\t\t\tif (!isDirty) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tgetFocusController(): DControllerFocus {\n\t\treturn this.application.getFocusController();\n\t}\n\n\tgetRootElement(): HTMLElement {\n\t\treturn this._rootElement;\n\t}\n\n\tgetElementContainer(): HTMLElement {\n\t\treturn this._elementContainer;\n\t}\n\n\tgetDynamicFontAtlases(): DynamicFontAtlases {\n\t\tif (this._dynamicFontAtlases == null) {\n\t\t\tthis._dynamicFontAtlases = new DynamicFontAtlases(this);\n\t\t}\n\t\treturn this._dynamicFontAtlases;\n\t}\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -67624,6 +67624,8 @@ var DApplicationLayerOptions = /** @class */ (function () {
67624
67624
  width = bbox.width;
67625
67625
  height = bbox.height;
67626
67626
  }
67627
+ this._isWidthFixed = options.width != null;
67628
+ this._isHeightFixed = options.height != null;
67627
67629
  // Background color
67628
67630
  var background = options === null || options === void 0 ? void 0 : options.background;
67629
67631
  var backgroundColor = 0;
@@ -67692,6 +67694,23 @@ var DApplicationLayerOptions = /** @class */ (function () {
67692
67694
  this._pixi.width = width;
67693
67695
  return this;
67694
67696
  };
67697
+ /**
67698
+ * Returns true if the width is fixed.
67699
+ *
67700
+ * @returns true if the width is fixed.
67701
+ */
67702
+ DApplicationLayerOptions.prototype.isWidthFixed = function () {
67703
+ return this._isWidthFixed;
67704
+ };
67705
+ /**
67706
+ * Makes the canvas width fixed.
67707
+ *
67708
+ * @param fixed true to make the canvas width fixed
67709
+ */
67710
+ DApplicationLayerOptions.prototype.setWidthFixed = function (fixed) {
67711
+ this._isWidthFixed = fixed;
67712
+ return this;
67713
+ };
67695
67714
  /**
67696
67715
  * Returns a canvas height.
67697
67716
  */
@@ -67707,6 +67726,23 @@ var DApplicationLayerOptions = /** @class */ (function () {
67707
67726
  this._pixi.height = height;
67708
67727
  return this;
67709
67728
  };
67729
+ /**
67730
+ * Returns true if the height is fixed.
67731
+ *
67732
+ * @returns true if the height is fixed.
67733
+ */
67734
+ DApplicationLayerOptions.prototype.isHeightFixed = function () {
67735
+ return this._isHeightFixed;
67736
+ };
67737
+ /**
67738
+ * Makes the canvas height fixed.
67739
+ *
67740
+ * @param fixed true to make the canvas height fixed
67741
+ */
67742
+ DApplicationLayerOptions.prototype.setHeightFixed = function (fixed) {
67743
+ this._isHeightFixed = fixed;
67744
+ return this;
67745
+ };
67710
67746
  /**
67711
67747
  * Returns padding sizes.
67712
67748
  * The default padding size is 6.
@@ -68228,23 +68264,34 @@ var DApplicationLayer = /** @class */ (function (_super) {
68228
68264
  };
68229
68265
  DApplicationLayer.prototype.initResizeHandling = function () {
68230
68266
  var _this = this;
68231
- var onResizeBound = function () {
68232
- _this.onResize();
68233
- };
68234
- window.addEventListener("resize", onResizeBound);
68235
- window.addEventListener("orientationchange", onResizeBound);
68267
+ var options = this._options;
68268
+ var isWidthFixed = options.isWidthFixed();
68269
+ var isHeightFixed = options.isHeightFixed();
68270
+ if (!isWidthFixed || !isHeightFixed) {
68271
+ var onResizeBound = function () {
68272
+ _this.onResize();
68273
+ };
68274
+ if (window.ResizeObserver != null) {
68275
+ new ResizeObserver(onResizeBound).observe(this._rootElement);
68276
+ }
68277
+ else {
68278
+ window.addEventListener("resize", onResizeBound);
68279
+ window.addEventListener("orientationchange", onResizeBound);
68280
+ }
68281
+ }
68236
68282
  };
68237
68283
  DApplicationLayer.prototype.onResize = function () {
68284
+ var options = this._options;
68238
68285
  var bbox = this._rootElement.getBoundingClientRect();
68239
- var bboxWidth = bbox.width;
68240
- var bboxHeight = bbox.height;
68241
- this.renderer.resize(bboxWidth, bboxHeight);
68286
+ var newWidth = options.isWidthFixed() ? options.getWidth() : bbox.width;
68287
+ var newHeight = options.isHeightFixed() ? options.getHeight() : bbox.height;
68288
+ this.renderer.resize(newWidth, newHeight);
68242
68289
  var padding = this._padding;
68243
68290
  var children = this.stage.children;
68244
68291
  for (var i = 0, imax = children.length; i < imax; ++i) {
68245
68292
  var child = children[i];
68246
68293
  if (child instanceof DBase) {
68247
- child.onParentResize(bboxWidth, bboxHeight, padding);
68294
+ child.onParentResize(newWidth, newHeight, padding);
68248
68295
  }
68249
68296
  }
68250
68297
  this.update();
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.369.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -48545,6 +48545,8 @@
48545
48545
  width = bbox.width;
48546
48546
  height = bbox.height;
48547
48547
  }
48548
+ this._isWidthFixed = options.width != null;
48549
+ this._isHeightFixed = options.height != null;
48548
48550
  // Background color
48549
48551
  var background = options === null || options === void 0 ? void 0 : options.background;
48550
48552
  var backgroundColor = 0;
@@ -48613,6 +48615,23 @@
48613
48615
  this._pixi.width = width;
48614
48616
  return this;
48615
48617
  };
48618
+ /**
48619
+ * Returns true if the width is fixed.
48620
+ *
48621
+ * @returns true if the width is fixed.
48622
+ */
48623
+ DApplicationLayerOptions.prototype.isWidthFixed = function () {
48624
+ return this._isWidthFixed;
48625
+ };
48626
+ /**
48627
+ * Makes the canvas width fixed.
48628
+ *
48629
+ * @param fixed true to make the canvas width fixed
48630
+ */
48631
+ DApplicationLayerOptions.prototype.setWidthFixed = function (fixed) {
48632
+ this._isWidthFixed = fixed;
48633
+ return this;
48634
+ };
48616
48635
  /**
48617
48636
  * Returns a canvas height.
48618
48637
  */
@@ -48628,6 +48647,23 @@
48628
48647
  this._pixi.height = height;
48629
48648
  return this;
48630
48649
  };
48650
+ /**
48651
+ * Returns true if the height is fixed.
48652
+ *
48653
+ * @returns true if the height is fixed.
48654
+ */
48655
+ DApplicationLayerOptions.prototype.isHeightFixed = function () {
48656
+ return this._isHeightFixed;
48657
+ };
48658
+ /**
48659
+ * Makes the canvas height fixed.
48660
+ *
48661
+ * @param fixed true to make the canvas height fixed
48662
+ */
48663
+ DApplicationLayerOptions.prototype.setHeightFixed = function (fixed) {
48664
+ this._isHeightFixed = fixed;
48665
+ return this;
48666
+ };
48631
48667
  /**
48632
48668
  * Returns padding sizes.
48633
48669
  * The default padding size is 6.
@@ -49149,23 +49185,34 @@
49149
49185
  };
49150
49186
  DApplicationLayer.prototype.initResizeHandling = function () {
49151
49187
  var _this = this;
49152
- var onResizeBound = function () {
49153
- _this.onResize();
49154
- };
49155
- window.addEventListener("resize", onResizeBound);
49156
- window.addEventListener("orientationchange", onResizeBound);
49188
+ var options = this._options;
49189
+ var isWidthFixed = options.isWidthFixed();
49190
+ var isHeightFixed = options.isHeightFixed();
49191
+ if (!isWidthFixed || !isHeightFixed) {
49192
+ var onResizeBound = function () {
49193
+ _this.onResize();
49194
+ };
49195
+ if (window.ResizeObserver != null) {
49196
+ new ResizeObserver(onResizeBound).observe(this._rootElement);
49197
+ }
49198
+ else {
49199
+ window.addEventListener("resize", onResizeBound);
49200
+ window.addEventListener("orientationchange", onResizeBound);
49201
+ }
49202
+ }
49157
49203
  };
49158
49204
  DApplicationLayer.prototype.onResize = function () {
49205
+ var options = this._options;
49159
49206
  var bbox = this._rootElement.getBoundingClientRect();
49160
- var bboxWidth = bbox.width;
49161
- var bboxHeight = bbox.height;
49162
- this.renderer.resize(bboxWidth, bboxHeight);
49207
+ var newWidth = options.isWidthFixed() ? options.getWidth() : bbox.width;
49208
+ var newHeight = options.isHeightFixed() ? options.getHeight() : bbox.height;
49209
+ this.renderer.resize(newWidth, newHeight);
49163
49210
  var padding = this._padding;
49164
49211
  var children = this.stage.children;
49165
49212
  for (var i = 0, imax = children.length; i < imax; ++i) {
49166
49213
  var child = children[i];
49167
49214
  if (child instanceof DBase) {
49168
- child.onParentResize(bboxWidth, bboxHeight, padding);
49215
+ child.onParentResize(newWidth, newHeight, padding);
49169
49216
  }
49170
49217
  }
49171
49218
  this.update();