@wcardinal/wcardinal-ui 0.447.0 → 0.449.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.
- package/dist/types/wcardinal/ui/d-diagram-shape.d.ts +0 -1
- package/dist/types/wcardinal/ui/d-diagram.d.ts +5 -1
- package/dist/types/wcardinal/ui/d-dialog.d.ts +4 -3
- package/dist/wcardinal/ui/d-diagram-shape.js +0 -6
- package/dist/wcardinal/ui/d-diagram-shape.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram.js +41 -3
- package/dist/wcardinal/ui/d-diagram.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog.js +33 -25
- package/dist/wcardinal/ui/d-dialog.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +74 -35
- package/dist/wcardinal-ui.js +74 -35
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,6 @@ export declare class DDiagramShape extends utils.EventEmitter {
|
|
|
25
25
|
protected _updateBound: () => void;
|
|
26
26
|
constructor(diagram: DDiagramShapeDiagram);
|
|
27
27
|
update(): void;
|
|
28
|
-
onRender(renderer: Renderer): void;
|
|
29
28
|
get(id: string): EShape | null;
|
|
30
29
|
getAll(id: string): EShape[];
|
|
31
30
|
each(iteratee: (shape: EShape) => boolean | void, reverse?: boolean): EShape | null;
|
|
@@ -26,6 +26,8 @@ export declare class DDiagram<THEME extends DThemeDiagram = DThemeDiagram, OPTIO
|
|
|
26
26
|
tag: DDiagramData;
|
|
27
27
|
data: DDiagramData;
|
|
28
28
|
shape: DDiagramShape;
|
|
29
|
+
protected _rendererBound?: Renderer;
|
|
30
|
+
protected _onPrerenderBound?: (renderer: Renderer) => void;
|
|
29
31
|
constructor(options?: OPTIONS);
|
|
30
32
|
protected initLayer(canvas: DDiagramCanvas, shapes: EShape[], mapper?: DDiagramDataMapper | null): DDiagramCanvas;
|
|
31
33
|
protected toMode(options?: OPTIONS): EShapeResourceManagerDeserializationMode;
|
|
@@ -41,6 +43,8 @@ export declare class DDiagram<THEME extends DThemeDiagram = DThemeDiagram, OPTIO
|
|
|
41
43
|
protected onShapeRightUp(e: InteractionEvent): void;
|
|
42
44
|
protected onShapeRightCancel(e: InteractionEvent): void;
|
|
43
45
|
onDblClick(e: MouseEvent | TouchEvent, manager: InteractionManager): boolean;
|
|
44
|
-
|
|
46
|
+
protected onPrerender(renderer: Renderer): void;
|
|
47
|
+
render(newRenderer: Renderer): void;
|
|
48
|
+
destroy(): void;
|
|
45
49
|
protected getType(): string;
|
|
46
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Point, Rectangle } from "pixi.js";
|
|
2
2
|
import { DAnimation } from "./d-animation";
|
|
3
3
|
import { DApplicationLayerLike } from "./d-application-layer-like";
|
|
4
4
|
import { DBase, DBaseEvents, DBaseOptions, DThemeBase } from "./d-base";
|
|
@@ -125,8 +125,9 @@ export declare class DDialog<VALUE = void, THEME extends DThemeDialog = DThemeDi
|
|
|
125
125
|
* @returns a value of this dialog
|
|
126
126
|
*/
|
|
127
127
|
open(opener?: DDialogOpener): Promise<VALUE>;
|
|
128
|
-
protected
|
|
129
|
-
protected
|
|
128
|
+
protected onChildFocus(focused: DBase): void;
|
|
129
|
+
protected onFocus(): void;
|
|
130
|
+
protected bringToFront(): void;
|
|
130
131
|
protected onPrerender(): void;
|
|
131
132
|
protected onOpen(): void;
|
|
132
133
|
isOpened(): boolean;
|
|
@@ -24,12 +24,6 @@ var DDiagramShape = /** @class */ (function (_super) {
|
|
|
24
24
|
canvas.update();
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
DDiagramShape.prototype.onRender = function (renderer) {
|
|
28
|
-
var canvas = this._diagram.canvas;
|
|
29
|
-
if (canvas) {
|
|
30
|
-
canvas.onRender(renderer);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
27
|
DDiagramShape.prototype.get = function (id) {
|
|
34
28
|
var canvas = this._diagram.canvas;
|
|
35
29
|
if (canvas) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagram-shape.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-shape.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAY,KAAK,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuBjD;;GAEG;AACH;IAAmC,iCAAkB;IAIpD,uBAAY,OAA6B;QAAzC,YACC,iBAAO,SAKP;QAJA,KAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,KAAI,CAAC,YAAY,GAAG;YACnB,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC;;IACH,CAAC;IAED,8BAAM,GAAN;QACC,IAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpC,IAAI,MAAM,EAAE;YACX,MAAM,CAAC,MAAM,EAAE,CAAC;SAChB;IACF,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"d-diagram-shape.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/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get } from \"./d-application-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DDiagramCanvasShape } from \"./d-diagram-canvas-shape\";\nimport { EShape } from \"./shape/e-shape\";\n\nexport interface DDiagramShapeLayer {\n\tchildren: EShape[];\n}\n\nexport interface DDiagramShapeLayerContainer {\n\tchildren: DDiagramShapeLayer[];\n}\n\nexport interface DDiagramShapeCanvas {\n\tlayer: DDiagramShapeLayerContainer;\n\tshape: DDiagramCanvasShape;\n\tupdate(): void;\n\tonRender(renderer: Renderer): void;\n}\n\nexport interface DDiagramShapeDiagram extends DApplicationTarget {\n\tcanvas: DDiagramShapeCanvas | null;\n}\n\n/**\n * A shape helper class for diagrams.\n */\nexport class DDiagramShape extends utils.EventEmitter {\n\tprotected _diagram: DDiagramShapeDiagram;\n\tprotected _updateBound: () => void;\n\n\tconstructor(diagram: DDiagramShapeDiagram) {\n\t\tsuper();\n\t\tthis._diagram = diagram;\n\t\tthis._updateBound = (): void => {\n\t\t\tDApplications.update(diagram);\n\t\t};\n\t}\n\n\tupdate(): void {\n\t\tconst canvas = this._diagram.canvas;\n\t\tif (canvas) {\n\t\t\tcanvas.update();\n\t\t}\n\t}\n\n\tget(id: string): EShape | null {\n\t\tconst canvas = this._diagram.canvas;\n\t\tif (canvas) {\n\t\t\treturn canvas.shape.get(id);\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetAll(id: string): EShape[] {\n\t\tconst canvas = this._diagram.canvas;\n\t\tif (canvas) {\n\t\t\treturn canvas.shape.getAll(id);\n\t\t}\n\t\treturn [];\n\t}\n\n\teach(iteratee: (shape: EShape) => boolean | void, reverse = false): EShape | null {\n\t\tconst canvas = this._diagram.canvas;\n\t\tif (canvas != null) {\n\t\t\tconst layers = canvas.layer.children;\n\t\t\tif (!reverse) {\n\t\t\t\tfor (let i = 0, imax = layers.length; i < imax; ++i) {\n\t\t\t\t\tconst layer = layers[i];\n\t\t\t\t\tconst children = layer.children;\n\t\t\t\t\tfor (let j = 0, jmax = children.length; j < jmax; ++j) {\n\t\t\t\t\t\tconst child = children[j];\n\t\t\t\t\t\tif (iteratee(child) === false) {\n\t\t\t\t\t\t\treturn child;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = layers.length - 1; 0 <= i; --i) {\n\t\t\t\t\tconst layer = layers[i];\n\t\t\t\t\tconst children = layer.children;\n\t\t\t\t\tfor (let j = children.length - 1; 0 <= j; --j) {\n\t\t\t\t\t\tconst child = children[j];\n\t\t\t\t\t\tif (iteratee(child) === false) {\n\t\t\t\t\t\t\treturn child;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { DDiagramShape } from "./d-diagram-shape";
|
|
|
9
9
|
import { DDiagramDataImpl } from "./d-diagram-data-impl";
|
|
10
10
|
import { UtilPointerEvent } from "./util/util-pointer-event";
|
|
11
11
|
import { EShapeResourceManagerDeserializationMode } from "./shape/e-shape-resource-manager-deserialization-mode";
|
|
12
|
+
import { DApplications } from "./d-applications";
|
|
12
13
|
var DDiagram = /** @class */ (function (_super) {
|
|
13
14
|
__extends(DDiagram, _super);
|
|
14
15
|
function DDiagram(options) {
|
|
@@ -157,9 +158,46 @@ var DDiagram = /** @class */ (function (_super) {
|
|
|
157
158
|
return _super.prototype.onDblClick.call(this, e, manager);
|
|
158
159
|
}
|
|
159
160
|
};
|
|
160
|
-
DDiagram.prototype.
|
|
161
|
-
this.
|
|
162
|
-
|
|
161
|
+
DDiagram.prototype.onPrerender = function (renderer) {
|
|
162
|
+
var canvas = this._canvas;
|
|
163
|
+
if (canvas) {
|
|
164
|
+
canvas.onRender(renderer);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
DDiagram.prototype.render = function (newRenderer) {
|
|
168
|
+
var _this = this;
|
|
169
|
+
var _a;
|
|
170
|
+
var oldRenderer = this._rendererBound;
|
|
171
|
+
if (oldRenderer !== newRenderer) {
|
|
172
|
+
var onPrerenderBound = ((_a = this._onPrerenderBound) !== null && _a !== void 0 ? _a : (this._onPrerenderBound = function (r) {
|
|
173
|
+
_this.onPrerender(r);
|
|
174
|
+
}));
|
|
175
|
+
if (oldRenderer != null) {
|
|
176
|
+
oldRenderer.off("prerender", onPrerenderBound);
|
|
177
|
+
}
|
|
178
|
+
this._rendererBound = newRenderer;
|
|
179
|
+
if (newRenderer != null) {
|
|
180
|
+
newRenderer.on("prerender", onPrerenderBound);
|
|
181
|
+
var canvas = this._canvas;
|
|
182
|
+
if (canvas != null) {
|
|
183
|
+
// Request the update to call `canvas.onRender(Renderer)`
|
|
184
|
+
DApplications.update(this);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
_super.prototype.render.call(this, newRenderer);
|
|
189
|
+
};
|
|
190
|
+
DDiagram.prototype.destroy = function () {
|
|
191
|
+
// Renderer
|
|
192
|
+
var renderer = this._rendererBound;
|
|
193
|
+
if (renderer != null) {
|
|
194
|
+
this._rendererBound = undefined;
|
|
195
|
+
var onPrerenderBound = this._onPrerenderBound;
|
|
196
|
+
if (onPrerenderBound != null) {
|
|
197
|
+
renderer.off("prerender", onPrerenderBound);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
_super.prototype.destroy.call(this);
|
|
163
201
|
};
|
|
164
202
|
DDiagram.prototype.getType = function () {
|
|
165
203
|
return "DDiagram";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagram.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,YAAY,EAA0C,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAyB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EA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B,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,MAAM,EAAE;gBACzC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;aAC7B;SACD;IACF,CAAC;IAED,6BAAU,GAAV,UAAW,CAA0B,EAAE,OAA2B;QACjE,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,EAAE;YACX,OAAO,iBAAM,UAAU,YAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;SACxE;aAAM;YACN,OAAO,iBAAM,UAAU,YAAC,CAAC,EAAE,OAAO,CAAC,CAAC;SACpC;IACF,CAAC;IAED,yBAAM,GAAN,UAAO,QAAkB;QACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC9B,iBAAM,MAAM,YAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAES,0BAAO,GAAjB;QACC,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,eAAC;AAAD,CAAC,AArLD,CAGU,YAAY,GAkLrB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InteractionEvent, InteractionManager, Renderer } from \"pixi.js\";\nimport { DDiagramBase, DDiagramBaseOptions, DThemeDiagramBase } from \"./d-diagram-base\";\nimport { DDiagramCanvas, DDiagramCanvasOptions } from \"./d-diagram-canvas\";\nimport { DDiagramSerialized } from \"./d-diagram-serialized\";\nimport { DDiagramShape } from \"./d-diagram-shape\";\nimport { DDiagramData, DDiagramDataOptions } from \"./d-diagram-data\";\nimport { EShape } from \"./shape/e-shape\";\nimport { DDiagramDataImpl } from \"./d-diagram-data-impl\";\nimport { DDiagramDataMapper } from \"./d-diagram-data-mapper\";\nimport { DDiagramController } from \"./d-diagram-controller\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { EShapeResourceManagerDeserializationMode } from \"./shape/e-shape-resource-manager-deserialization-mode\";\n\n/**\n * {@link DDiagram} options.\n */\nexport interface DDiagramOptions<THEME extends DThemeDiagram = DThemeDiagram, EMITTER = any>\n\textends DDiagramBaseOptions<\n\t\tDDiagramCanvas,\n\t\tDDiagramCanvasOptions,\n\t\tDDiagramController,\n\t\tTHEME,\n\t\tEMITTER\n\t> {\n\t/** @deprecated in favor of {@link data} */\n\ttag?: DDiagramDataOptions;\n\tdata?: DDiagramDataOptions;\n}\n\n/**\n * {@link DDiagram} theme.\n */\nexport interface DThemeDiagram extends DThemeDiagramBase {}\n\nexport class DDiagram<\n\tTHEME extends DThemeDiagram = DThemeDiagram,\n\tOPTIONS extends DDiagramOptions<THEME> = DDiagramOptions<THEME>\n> extends DDiagramBase<DDiagramCanvas, DDiagramCanvasOptions, DDiagramController, THEME, OPTIONS> {\n\t/** @deprecated in favor of {@link data} */\n\ttag: DDiagramData;\n\tdata: DDiagramData;\n\tshape: DDiagramShape;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\t// Event handlers\n\t\tthis.on(UtilPointerEvent.move, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeMove(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.up, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeUp(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.upoutside, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeCancel(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.cancel, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeCancel(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.tap, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeClick(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.righttap, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightClick(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightdown, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightDown(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightup, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightUp(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightupoutside, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightCancel(e);\n\t\t});\n\n\t\t// Data\n\t\tconst data = new DDiagramDataImpl(this, options && (options.data || options.tag));\n\t\tthis.data = data;\n\t\tthis.tag = data;\n\n\t\t// Shape\n\t\tthis.shape = new DDiagramShape(this);\n\t}\n\n\tprotected initLayer(\n\t\tcanvas: DDiagramCanvas,\n\t\tshapes: EShape[],\n\t\tmapper?: DDiagramDataMapper | null\n\t): DDiagramCanvas {\n\t\treturn super.initLayer(canvas, shapes, mapper || this.data.mapper);\n\t}\n\n\tprotected toMode(options?: OPTIONS): EShapeResourceManagerDeserializationMode {\n\t\treturn EShapeResourceManagerDeserializationMode.VIEWER;\n\t}\n\n\tprotected newCanvas(serialized: DDiagramSerialized): DDiagramCanvas {\n\t\treturn new DDiagramCanvas(this.toCanvasOptions(serialized));\n\t}\n\n\tprotected toCanvasOptions(serialized: DDiagramSerialized): DDiagramCanvasOptions {\n\t\treturn this.toCanvasBaseOptions(serialized);\n\t}\n\n\tprotected onDown(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tsuper.onDown(e, canvas.onShapeDown(e));\n\t\t\t} else {\n\t\t\t\tsuper.onDown(e);\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.onDown(e);\n\t\t}\n\t}\n\n\tprotected onShapeMove(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeMove(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeUp(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeUp(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeCancel(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeClick(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeClick(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightClick(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightClick(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightDown(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightDown(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightUp(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightUp(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightCancel(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightCancel(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tonDblClick(e: MouseEvent | TouchEvent, manager: InteractionManager): boolean {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\treturn super.onDblClick(e, manager, canvas.onShapeDblClick(e, manager));\n\t\t} else {\n\t\t\treturn super.onDblClick(e, manager);\n\t\t}\n\t}\n\n\trender(renderer: Renderer): void {\n\t\tthis.shape.onRender(renderer);\n\t\tsuper.render(renderer);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDiagram\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-diagram.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,YAAY,EAA0C,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAyB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,wCAAwC,EAAE,MAAM,uDAAuD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAuBjD;IAGU,4BAAuF;IAShG,kBAAY,OAAiB;QAA7B,YACC,kBAAM,OAAO,CAAC,SAsCd;QApCA,iBAAiB;QACjB,KAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,UAAC,CAAmB;YAClD,KAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,KAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,EAAE,UAAC,CAAmB;YAChD,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,KAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAC,CAAmB;YACvD,KAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QACH,KAA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/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InteractionEvent, InteractionManager, Renderer } from \"pixi.js\";\nimport { DDiagramBase, DDiagramBaseOptions, DThemeDiagramBase } from \"./d-diagram-base\";\nimport { DDiagramCanvas, DDiagramCanvasOptions } from \"./d-diagram-canvas\";\nimport { DDiagramSerialized } from \"./d-diagram-serialized\";\nimport { DDiagramShape } from \"./d-diagram-shape\";\nimport { DDiagramData, DDiagramDataOptions } from \"./d-diagram-data\";\nimport { EShape } from \"./shape/e-shape\";\nimport { DDiagramDataImpl } from \"./d-diagram-data-impl\";\nimport { DDiagramDataMapper } from \"./d-diagram-data-mapper\";\nimport { DDiagramController } from \"./d-diagram-controller\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { EShapeResourceManagerDeserializationMode } from \"./shape/e-shape-resource-manager-deserialization-mode\";\nimport { DApplications } from \"./d-applications\";\n\n/**\n * {@link DDiagram} options.\n */\nexport interface DDiagramOptions<THEME extends DThemeDiagram = DThemeDiagram, EMITTER = any>\n\textends DDiagramBaseOptions<\n\t\tDDiagramCanvas,\n\t\tDDiagramCanvasOptions,\n\t\tDDiagramController,\n\t\tTHEME,\n\t\tEMITTER\n\t> {\n\t/** @deprecated in favor of {@link data} */\n\ttag?: DDiagramDataOptions;\n\tdata?: DDiagramDataOptions;\n}\n\n/**\n * {@link DDiagram} theme.\n */\nexport interface DThemeDiagram extends DThemeDiagramBase {}\n\nexport class DDiagram<\n\tTHEME extends DThemeDiagram = DThemeDiagram,\n\tOPTIONS extends DDiagramOptions<THEME> = DDiagramOptions<THEME>\n> extends DDiagramBase<DDiagramCanvas, DDiagramCanvasOptions, DDiagramController, THEME, OPTIONS> {\n\t/** @deprecated in favor of {@link data} */\n\ttag: DDiagramData;\n\tdata: DDiagramData;\n\tshape: DDiagramShape;\n\n\tprotected _rendererBound?: Renderer;\n\tprotected _onPrerenderBound?: (renderer: Renderer) => void;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\t// Event handlers\n\t\tthis.on(UtilPointerEvent.move, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeMove(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.up, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeUp(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.upoutside, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeCancel(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.cancel, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeCancel(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.tap, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeClick(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.righttap, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightClick(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightdown, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightDown(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightup, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightUp(e);\n\t\t});\n\t\tthis.on(UtilPointerEvent.rightupoutside, (e: InteractionEvent): void => {\n\t\t\tthis.onShapeRightCancel(e);\n\t\t});\n\n\t\t// Data\n\t\tconst data = new DDiagramDataImpl(this, options && (options.data || options.tag));\n\t\tthis.data = data;\n\t\tthis.tag = data;\n\n\t\t// Shape\n\t\tthis.shape = new DDiagramShape(this);\n\t}\n\n\tprotected initLayer(\n\t\tcanvas: DDiagramCanvas,\n\t\tshapes: EShape[],\n\t\tmapper?: DDiagramDataMapper | null\n\t): DDiagramCanvas {\n\t\treturn super.initLayer(canvas, shapes, mapper || this.data.mapper);\n\t}\n\n\tprotected toMode(options?: OPTIONS): EShapeResourceManagerDeserializationMode {\n\t\treturn EShapeResourceManagerDeserializationMode.VIEWER;\n\t}\n\n\tprotected newCanvas(serialized: DDiagramSerialized): DDiagramCanvas {\n\t\treturn new DDiagramCanvas(this.toCanvasOptions(serialized));\n\t}\n\n\tprotected toCanvasOptions(serialized: DDiagramSerialized): DDiagramCanvasOptions {\n\t\treturn this.toCanvasBaseOptions(serialized);\n\t}\n\n\tprotected onDown(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tsuper.onDown(e, canvas.onShapeDown(e));\n\t\t\t} else {\n\t\t\t\tsuper.onDown(e);\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.onDown(e);\n\t\t}\n\t}\n\n\tprotected onShapeMove(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeMove(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeUp(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeUp(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeCancel(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeClick(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeClick(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightClick(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightClick(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightDown(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightDown(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightUp(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightUp(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onShapeRightCancel(e: InteractionEvent): void {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\tconst target = e.target;\n\t\t\tif (target === this || target === canvas) {\n\t\t\t\tcanvas.onShapeRightCancel(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tonDblClick(e: MouseEvent | TouchEvent, manager: InteractionManager): boolean {\n\t\tconst canvas = this.canvas;\n\t\tif (canvas) {\n\t\t\treturn super.onDblClick(e, manager, canvas.onShapeDblClick(e, manager));\n\t\t} else {\n\t\t\treturn super.onDblClick(e, manager);\n\t\t}\n\t}\n\n\tprotected onPrerender(renderer: Renderer): void {\n\t\tconst canvas = this._canvas;\n\t\tif (canvas) {\n\t\t\tcanvas.onRender(renderer);\n\t\t}\n\t}\n\n\trender(newRenderer: Renderer): void {\n\t\tconst oldRenderer = this._rendererBound;\n\t\tif (oldRenderer !== newRenderer) {\n\t\t\tconst onPrerenderBound = (this._onPrerenderBound ??= (r: Renderer): void => {\n\t\t\t\tthis.onPrerender(r);\n\t\t\t});\n\n\t\t\tif (oldRenderer != null) {\n\t\t\t\toldRenderer.off(\"prerender\", onPrerenderBound);\n\t\t\t}\n\n\t\t\tthis._rendererBound = newRenderer;\n\t\t\tif (newRenderer != null) {\n\t\t\t\tnewRenderer.on(\"prerender\", onPrerenderBound);\n\t\t\t\tconst canvas = this._canvas;\n\t\t\t\tif (canvas != null) {\n\t\t\t\t\t// Request the update to call `canvas.onRender(Renderer)`\n\t\t\t\t\tDApplications.update(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.render(newRenderer);\n\t}\n\n\toverride destroy(): void {\n\t\t// Renderer\n\t\tconst renderer = this._rendererBound;\n\t\tif (renderer != null) {\n\t\t\tthis._rendererBound = undefined;\n\n\t\t\tconst onPrerenderBound = this._onPrerenderBound;\n\t\t\tif (onPrerenderBound != null) {\n\t\t\t\trenderer.off(\"prerender\", onPrerenderBound);\n\t\t\t}\n\t\t}\n\n\t\tsuper.destroy();\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDiagram\";\n\t}\n}\n"]}
|
|
@@ -248,7 +248,6 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
248
248
|
*/
|
|
249
249
|
DDialog.prototype.open = function (opener) {
|
|
250
250
|
var _this = this;
|
|
251
|
-
var _a;
|
|
252
251
|
var result = this._promise;
|
|
253
252
|
if (result == null) {
|
|
254
253
|
result = new Promise(function (resolve, reject) {
|
|
@@ -292,36 +291,45 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
292
291
|
gesture.constraint(this, layer, position.x, position.y);
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
|
-
//
|
|
296
|
-
|
|
297
|
-
var parent_2 = this.parent;
|
|
298
|
-
if (parent_2 != null) {
|
|
299
|
-
parent_2.on("childAdded", ((_a = this._onParentChildAddedBound) !== null && _a !== void 0 ? _a : (this._onParentChildAddedBound = function () {
|
|
300
|
-
_this.onParentChildAdded();
|
|
301
|
-
})));
|
|
302
|
-
this.onParentChildAdded();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
294
|
+
// Bring To Front
|
|
295
|
+
this.bringToFront();
|
|
305
296
|
// Done
|
|
306
297
|
this.onOpen();
|
|
307
298
|
}
|
|
308
299
|
return result;
|
|
309
300
|
};
|
|
310
|
-
DDialog.prototype.
|
|
301
|
+
DDialog.prototype.onChildFocus = function (focused) {
|
|
302
|
+
_super.prototype.onChildFocus.call(this, focused);
|
|
303
|
+
this.bringToFront();
|
|
304
|
+
};
|
|
305
|
+
DDialog.prototype.onFocus = function () {
|
|
306
|
+
_super.prototype.onFocus.call(this);
|
|
307
|
+
this.bringToFront();
|
|
308
|
+
};
|
|
309
|
+
DDialog.prototype.bringToFront = function () {
|
|
311
310
|
var parent = this.parent;
|
|
312
|
-
if (parent
|
|
313
|
-
|
|
311
|
+
if (parent == null) {
|
|
312
|
+
return;
|
|
314
313
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
var
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
314
|
+
var children = parent.children;
|
|
315
|
+
var childrenLength = children.length;
|
|
316
|
+
var index = childrenLength - 1;
|
|
317
|
+
for (; 0 <= index; --index) {
|
|
318
|
+
if (children[index] === this) {
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
321
|
}
|
|
322
|
-
|
|
323
|
-
return
|
|
322
|
+
if (index < 0) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
for (var i = index + 1; i < childrenLength; ++i) {
|
|
326
|
+
children[i - 1] = children[i];
|
|
324
327
|
}
|
|
328
|
+
children[childrenLength - 1] = this;
|
|
329
|
+
children.sort(function (a, b) {
|
|
330
|
+
return ((a instanceof DDialog ? (a._alwaysOnTop ? 2 : 1) : 0) -
|
|
331
|
+
(b instanceof DDialog ? (b._alwaysOnTop ? 2 : 1) : 0));
|
|
332
|
+
});
|
|
325
333
|
};
|
|
326
334
|
DDialog.prototype.onPrerender = function () {
|
|
327
335
|
var _a;
|
|
@@ -420,9 +428,9 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
420
428
|
}
|
|
421
429
|
// Always On Top
|
|
422
430
|
if (this._alwaysOnTop) {
|
|
423
|
-
var
|
|
424
|
-
if (
|
|
425
|
-
|
|
431
|
+
var parent_2 = this.parent;
|
|
432
|
+
if (parent_2 != null) {
|
|
433
|
+
parent_2.off("childAdded", this._onParentChildAddedBound);
|
|
426
434
|
}
|
|
427
435
|
}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IAAI,CAAC,wBAAwB,CAAC,CAAC;aACxD;SACD;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;IAES,2BAAS,GAAnB,UAAoB,CAAgB;QACnC,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE;YACvC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;gBACrC,IAAI,CAAC,SAAS,EAAE,CAAC;aACjB;SACD;QACD,OAAO,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAES,2BAAS,GAAnB;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAES,qCAAmB,GAA7B,UAA8B,KAAY;QACzC,QAAQ,IAAI,CAAC,KAAK,EAAE;YACnB,KAAK,WAAW,CAAC,KAAK,CAAC;YACvB,KAAK,WAAW,CAAC,IAAI;gBACpB,OAAO,IAAI,CAAC;YACb,KAAK,WAAW,CAAC,QAAQ;gBACxB,OAAO,iBAAM,mBAAmB,YAAC,KAAK,CAAC,CAAC;SACzC;IACF,CAAC;IAES,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AA9cD,CAIU,KAAK,GA0cd","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject, Point, Rectangle } from \"pixi.js\";\nimport { DAnimation } from \"./d-animation\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DControllerFocus, DFocusable } from \"./d-controller-focus\";\nimport { DDialogAlign } from \"./d-dialog-align\";\nimport { DDialogCloseOn } from \"./d-dialog-close-on\";\nimport { DDialogGesture, DDialogGestureOptions } from \"./d-dialog-gesture\";\nimport { DDialogGestureImpl } from \"./d-dialog-gesture-impl\";\nimport { DDialogGestureMode } from \"./d-dialog-gesture-mode\";\nimport { DDialogMode } from \"./d-dialog-mode\";\nimport { DDialogState } from \"./d-dialog-state\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DPadding } from \"./d-padding\";\nimport { isArray } from \"./util/is-array\";\nimport { isString } from \"./util/is-string\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilAttach } from \"./util/util-attach\";\nimport { UtilClickOutside } from \"./util/util-click-outside\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilOverlay } from \"./util/util-overlay\";\nimport { DApplicationTarget } from \"./d-application-like\";\n\n/**\n * {@link DDialog} events.\n */\nexport interface DDialogEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when a dialog is opened.\n\t *\n\t * @param emitter this\n\t */\n\topen(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a dialog is closed.\n\t *\n\t * @param emitter this\n\t */\n\tclose(emitter: EMITTER): void;\n}\n\n/**\n * {@link DDialog} `on` options.\n */\nexport interface DDialogOnOptions<EMITTER> extends Partial<DDialogEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DDialog} options.\n */\nexport interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITTER = any>\n\textends DBaseOptions<THEME> {\n\tcloseOn?: DDialogCloseOn | Array<keyof typeof DDialogCloseOn> | keyof typeof DDialogCloseOn;\n\n\tanimation?: DAnimation<DBase>;\n\n\t/**\n\t * A dialog mode.\n\t */\n\tmode?: DDialogMode | keyof typeof DDialogMode;\n\n\talwaysOnTop?: boolean;\n\n\tsticky?: boolean;\n\n\tgesture?: boolean | DDialogGestureOptions;\n\n\talign?: DDialogAlign | null | keyof typeof DDialogAlign;\n\n\t/**\n\t * Mappings of event names and handlers.\n\t */\n\ton?: DDialogOnOptions<EMITTER>;\n}\n\n/**\n * {@link DDialog} theme.\n */\nexport interface DThemeDialog extends DThemeBase {\n\tgetMode(): DDialogMode;\n\tcloseOn(mode: DDialogMode): DDialogCloseOn;\n\tisSticky(mode: DDialogMode): boolean;\n\tisAlwaysOnTop(): boolean;\n\tisGestureEnabled(mode: DDialogMode): boolean;\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode;\n\tgetOffsetX(mode: DDialogMode): number;\n\tgetOffsetY(mode: DDialogMode): number;\n\tgetAlign(mode: DDialogMode): DDialogAlign | null;\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null;\n}\n\nexport interface DDialogOpener extends DApplicationTarget {\n\tgetBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle;\n}\n\n/**\n * A dialog class.\n *\n * If multiple application instances are there, better to set the constructor\n * option `parent` to an `application.stage` so that the dialog picks a right\n * application. `DDialog` searches applications in a following order:\n *\n * * To begin, `DDialog` tries to find applications which it belongs to.\n * * If `DDialog` can't find applications, then `DDialog` tries to find applications which openers belong to.\n * * If openers are not given, `DDialog` assumes the last created application at the very moment `DDialog` is instantiated is the one it belongs to.\n */\nexport class DDialog<\n\tVALUE = void,\n\tTHEME extends DThemeDialog = DThemeDialog,\n\tOPTIONS extends DDialogOptions<THEME> = DDialogOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_BOUNDS?: Rectangle;\n\n\tprotected _promise?: Promise<VALUE>;\n\tprotected _resolve?: (value: VALUE | PromiseLike<VALUE>) => void;\n\tprotected _reject?: (reason?: any) => void;\n\n\tprotected _animation?: DAnimation<DBase> | null;\n\tprotected _closeOn!: DDialogCloseOn;\n\tprotected _focused?: DFocusable | null;\n\tprotected _overlay!: UtilOverlay;\n\tprotected _mode!: DDialogMode;\n\tprotected _alwaysOnTop!: boolean;\n\tprotected _onParentChildAddedBound?: () => void;\n\tprotected _sticky!: boolean;\n\tprotected _onPrerenderBound!: () => void;\n\tprotected _align!: DDialogAlign | null;\n\tprotected _opener?: DDialogOpener | null;\n\n\tprotected _gesture!: DDialogGesture<this>;\n\tprotected _layer!: DApplicationLayerLike | null;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tthis._onPrerenderBound = (): void => {\n\t\t\tthis.onPrerender();\n\t\t};\n\t\tthis._layer = null;\n\n\t\t// Mode\n\t\tconst theme = this.theme;\n\t\tconst mode = toEnum(options?.mode ?? theme.getMode(), DDialogMode);\n\t\tthis._mode = mode;\n\n\t\t// Always On Top\n\t\tthis._alwaysOnTop = options?.alwaysOnTop ?? theme.isAlwaysOnTop();\n\n\t\t// Sticky\n\t\tthis._sticky = options?.sticky ?? theme.isSticky(mode);\n\n\t\t// Close On\n\t\tconst closeOn = this.toCloseOn(mode, theme, options);\n\t\tthis._closeOn = closeOn;\n\n\t\t// Align\n\t\tthis._align = this.toAlign(mode, theme, options);\n\n\t\t// Overlay\n\t\tthis._overlay = new UtilOverlay();\n\n\t\t// Gesture\n\t\tthis._gesture = new DDialogGestureImpl(this, this.toGestureOptions(mode, theme, options));\n\n\t\t// Visibility\n\t\tthis.visible = false;\n\n\t\t// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MODAL);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\tthis.state.add(DDialogState.MODELESS);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MENU);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Outside-click handling\n\t\tif (closeOn & DDialogCloseOn.CLICK_OUTSIDE) {\n\t\t\tUtilClickOutside.apply(this, (): void => {\n\t\t\t\tthis.onCloseOn();\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected toCloseOn(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogCloseOn {\n\t\tconst closeOn = options?.closeOn;\n\t\tif (closeOn == null) {\n\t\t\treturn theme.closeOn(mode);\n\t\t} else if (isArray(closeOn)) {\n\t\t\tlet result = DDialogCloseOn.NONE;\n\t\t\tfor (let i = 0, imax = closeOn.length; i < imax; ++i) {\n\t\t\t\tresult |= DDialogCloseOn[closeOn[i]];\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if (isString(closeOn)) {\n\t\t\treturn DDialogCloseOn[closeOn];\n\t\t}\n\t\treturn closeOn;\n\t}\n\n\tprotected toAlign(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogAlign | null {\n\t\tconst align = options?.align;\n\t\tif (align === null) {\n\t\t\treturn null;\n\t\t} else if (align === undefined) {\n\t\t\treturn theme.getAlign(mode);\n\t\t} else {\n\t\t\treturn toEnum(align, DDialogAlign);\n\t\t}\n\t}\n\n\tget mode(): DDialogMode {\n\t\treturn this._mode;\n\t}\n\n\tget align(): DDialogAlign | null {\n\t\treturn this._align;\n\t}\n\n\tset algin(align: DDialogAlign | null) {\n\t\tthis._align = align;\n\t}\n\n\tget alwaysOnTop(): boolean {\n\t\treturn this._alwaysOnTop;\n\t}\n\n\tset alwaysOnTop(alwaysOnTop: boolean) {\n\t\tthis._alwaysOnTop = alwaysOnTop;\n\t}\n\n\tget gesture(): DDialogGesture<this> {\n\t\treturn this._gesture;\n\t}\n\n\tget layer(): DApplicationLayerLike | null {\n\t\treturn this._layer;\n\t}\n\n\tprotected toGestureOptions(\n\t\tmode: DDialogMode,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DDialogGestureOptions {\n\t\tconst gesture = options?.gesture;\n\t\tif (gesture === true) {\n\t\t\treturn {\n\t\t\t\tenable: true,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture === false) {\n\t\t\treturn {\n\t\t\t\tenable: false,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture != null) {\n\t\t\tif (gesture.enable === undefined) {\n\t\t\t\tgesture.enable = theme.isGestureEnabled(mode);\n\t\t\t}\n\t\t\tif (gesture.mode === undefined) {\n\t\t\t\tgesture.mode = theme.getGestureMode(mode);\n\t\t\t}\n\t\t\treturn gesture;\n\t\t}\n\t\treturn {\n\t\t\tenable: theme.isGestureEnabled(mode),\n\t\t\tmode: theme.getGestureMode(mode)\n\t\t};\n\t}\n\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tif (this.isOpened()) {\n\t\t\tconst layer = this._layer;\n\t\t\tif (layer != null) {\n\t\t\t\tconst gesture = this._gesture;\n\t\t\t\tif (gesture.isDirty()) {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onParentResize(parentWidth, parentHeight, parentPadding);\n\t}\n\n\tprotected getAnimation(): DAnimation | null {\n\t\tlet result = this._animation;\n\t\tif (result === undefined) {\n\t\t\tresult = this._options?.animation ?? this.theme.newAnimation(this._mode);\n\t\t\tif (result) {\n\t\t\t\tresult.target = this;\n\t\t\t\tresult.on(\"end\", (isReverse: boolean): void => {\n\t\t\t\t\tthis.onAnimationEnd(isReverse);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._animation = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onAnimationEnd(isReverse: boolean): void {\n\t\tif (isReverse) {\n\t\t\tif (this._mode === DDialogMode.MODELESS) {\n\t\t\t\tthis.hide();\n\t\t\t} else {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent) {\n\t\t\t\t\tparent.removeChild(this);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tthis._focused = focusController.get();\n\t\t\t\tfocusController.focus(this.findFirstFocusable(focusController) || this);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected findFirstFocusable(focusController: DControllerFocus): DFocusable | null {\n\t\treturn focusController.find(this, false, true, true);\n\t}\n\n\t/**\n\t * Opens a dialog.\n\t *\n\t * @param opener An opener of a dialog.\n\t * The dialog position is determined based on a position and a size of the opener.\n\t * If the opener is undefined, the dialog is placed at the center of the screen.\n\t *\n\t * @returns a value of this dialog\n\t */\n\topen(opener?: DDialogOpener): Promise<VALUE> {\n\t\tlet result = this._promise;\n\t\tif (result == null) {\n\t\t\tresult = new Promise<VALUE>((resolve, reject): void => {\n\t\t\t\tthis._resolve = resolve;\n\t\t\t\tthis._reject = reject;\n\t\t\t});\n\t\t\tthis._promise = result;\n\n\t\t\tthis._opener = opener;\n\n\t\t\t// Attach to a layer\n\t\t\tlet layer: DApplicationLayerLike | null = null;\n\t\t\tswitch (this._mode) {\n\t\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tcase DDialogMode.MENU:\n\t\t\t\t\tlayer = this._overlay.pick(this, opener);\n\t\t\t\t\tlayer.stage.addChild(this);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\t\tlayer = DApplications.getLayer(this);\n\t\t\t\t\tthis.show();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._layer = layer;\n\n\t\t\t// Position & size\n\t\t\tconst gesture = this._gesture;\n\t\t\tif (gesture.mode === DDialogGestureMode.CLEAN) {\n\t\t\t\tgesture.toClean();\n\t\t\t}\n\t\t\tif (layer != null) {\n\t\t\t\tif (gesture.isClean()) {\n\t\t\t\t\tconst renderer = layer.renderer;\n\t\t\t\t\tconst onPrerenderBound = this._onPrerenderBound;\n\t\t\t\t\tif (this._sticky) {\n\t\t\t\t\t\trenderer.on(\"prerender\", onPrerenderBound);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderer.once(\"prerender\", onPrerenderBound);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Always On Top\n\t\t\tif (this._alwaysOnTop) {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent != null) {\n\t\t\t\t\tparent.on(\n\t\t\t\t\t\t\"childAdded\",\n\t\t\t\t\t\t(this._onParentChildAddedBound ??= (): void => {\n\t\t\t\t\t\t\tthis.onParentChildAdded();\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tthis.onParentChildAdded();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onParentChildAdded(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent != null) {\n\t\t\tparent.children.sort(this.compareAlwaysOnTop);\n\t\t}\n\t}\n\n\tprotected compareAlwaysOnTop(this: unknown, a: DisplayObject, b: DisplayObject): number {\n\t\tconst at = a instanceof DDialog && a.alwaysOnTop;\n\t\tconst bt = b instanceof DDialog && b.alwaysOnTop;\n\t\tif (at) {\n\t\t\treturn bt ? 0 : +1;\n\t\t} else {\n\t\t\treturn bt ? -1 : 0;\n\t\t}\n\t}\n\n\tprotected onPrerender(): void {\n\t\tconst layer = this._layer;\n\t\tif (layer == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst align = this._align;\n\t\tif (align === DDialogAlign.NONE) {\n\t\t\treturn;\n\t\t}\n\t\tconst opener = this._opener;\n\t\tif (align != null && opener != null) {\n\t\t\tconst mode = this._mode;\n\t\t\tconst bounds = opener.getBounds(false, (DDialog.WORK_BOUNDS ??= new Rectangle()));\n\t\t\tconst theme = this.theme;\n\t\t\tUtilAttach.attach(\n\t\t\t\tthis,\n\t\t\t\tbounds,\n\t\t\t\ttheme.getOffsetX(mode),\n\t\t\t\ttheme.getOffsetY(mode),\n\t\t\t\tlayer.width,\n\t\t\t\tlayer.height,\n\t\t\t\talign\n\t\t\t);\n\t\t} else {\n\t\t\tthis.position.set((layer.width - this.width) * 0.5, (layer.height - this.height) * 0.5);\n\t\t}\n\t}\n\n\tprotected onOpen(): void {\n\t\tthis.emit(\"open\", this);\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start();\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = true;\n\t\t\tthis.onAnimationEnd(false);\n\t\t}\n\t}\n\n\tisOpened(): boolean {\n\t\treturn this._promise != null;\n\t}\n\n\tclose(): void {\n\t\tthis.doReject();\n\t}\n\n\tprotected doResolve(value: VALUE | PromiseLike<VALUE>): void {\n\t\tconst resolve = this._resolve;\n\t\tif (resolve) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\tresolve(value);\n\t\t}\n\t}\n\n\tprotected doReject(reason?: any): void {\n\t\tconst reject = this._reject;\n\t\tif (reject) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\treject(reason);\n\t\t}\n\t}\n\n\tprotected onClose(): void {\n\t\t// Focus\n\t\tconst layer = this._layer;\n\t\tconst focused = this._focused;\n\t\tif (focused != null) {\n\t\t\tthis._focused = null;\n\t\t\tif (layer) {\n\t\t\t\tconst focusedLayer = DApplications.getLayer(focused);\n\t\t\t\tif (focusedLayer != null && layer !== focusedLayer) {\n\t\t\t\t\tfocusedLayer.view.focus();\n\t\t\t\t}\n\t\t\t\tlayer.getFocusController().focus(focused);\n\t\t\t} else {\n\t\t\t\tthis.blur(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.blur(true);\n\t\t}\n\n\t\t// Remove the prerender event handler and forget the layer\n\t\tif (layer) {\n\t\t\tlayer.renderer.off(\"prerender\", this._onPrerenderBound);\n\t\t\tthis._layer = null;\n\t\t}\n\n\t\t// Forget the opener\n\t\tthis._opener = null;\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start(true);\n\t\t} else {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\t// Always On Top\n\t\tif (this._alwaysOnTop) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent != null) {\n\t\t\t\tparent.off(\"childAdded\", this._onParentChildAddedBound);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tprotected onKeyDown(e: KeyboardEvent): boolean {\n\t\tif (this._closeOn & DDialogCloseOn.ESC) {\n\t\t\tif (UtilKeyboardEvent.isCancelKey(e)) {\n\t\t\t\tthis.onCloseOn();\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected onCloseOn(): void {\n\t\tthis.close();\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\tswitch (this._mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn super.containsGlobalPoint(point);\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialog\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-dialog.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAyC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,C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,GAAnB,UAAoB,CAAgB;QACnC,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE;YACvC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;gBACrC,IAAI,CAAC,SAAS,EAAE,CAAC;aACjB;SACD;QACD,OAAO,iBAAM,SAAS,YAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAES,2BAAS,GAAnB;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAES,qCAAmB,GAA7B,UAA8B,KAAY;QACzC,QAAQ,IAAI,CAAC,KAAK,EAAE;YACnB,KAAK,WAAW,CAAC,KAAK,CAAC;YACvB,KAAK,WAAW,CAAC,IAAI;gBACpB,OAAO,IAAI,CAAC;YACb,KAAK,WAAW,CAAC,QAAQ;gBACxB,OAAO,iBAAM,mBAAmB,YAAC,KAAK,CAAC,CAAC;SACzC;IACF,CAAC;IAES,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AAxdD,CAIU,KAAK,GAodd","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Point, Rectangle } from \"pixi.js\";\nimport { DAnimation } from \"./d-animation\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DControllerFocus, DFocusable } from \"./d-controller-focus\";\nimport { DDialogAlign } from \"./d-dialog-align\";\nimport { DDialogCloseOn } from \"./d-dialog-close-on\";\nimport { DDialogGesture, DDialogGestureOptions } from \"./d-dialog-gesture\";\nimport { DDialogGestureImpl } from \"./d-dialog-gesture-impl\";\nimport { DDialogGestureMode } from \"./d-dialog-gesture-mode\";\nimport { DDialogMode } from \"./d-dialog-mode\";\nimport { DDialogState } from \"./d-dialog-state\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DPadding } from \"./d-padding\";\nimport { isArray } from \"./util/is-array\";\nimport { isString } from \"./util/is-string\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilAttach } from \"./util/util-attach\";\nimport { UtilClickOutside } from \"./util/util-click-outside\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilOverlay } from \"./util/util-overlay\";\nimport { DApplicationTarget } from \"./d-application-like\";\n\n/**\n * {@link DDialog} events.\n */\nexport interface DDialogEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when a dialog is opened.\n\t *\n\t * @param emitter this\n\t */\n\topen(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a dialog is closed.\n\t *\n\t * @param emitter this\n\t */\n\tclose(emitter: EMITTER): void;\n}\n\n/**\n * {@link DDialog} `on` options.\n */\nexport interface DDialogOnOptions<EMITTER> extends Partial<DDialogEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DDialog} options.\n */\nexport interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITTER = any>\n\textends DBaseOptions<THEME> {\n\tcloseOn?: DDialogCloseOn | Array<keyof typeof DDialogCloseOn> | keyof typeof DDialogCloseOn;\n\n\tanimation?: DAnimation<DBase>;\n\n\t/**\n\t * A dialog mode.\n\t */\n\tmode?: DDialogMode | keyof typeof DDialogMode;\n\n\talwaysOnTop?: boolean;\n\n\tsticky?: boolean;\n\n\tgesture?: boolean | DDialogGestureOptions;\n\n\talign?: DDialogAlign | null | keyof typeof DDialogAlign;\n\n\t/**\n\t * Mappings of event names and handlers.\n\t */\n\ton?: DDialogOnOptions<EMITTER>;\n}\n\n/**\n * {@link DDialog} theme.\n */\nexport interface DThemeDialog extends DThemeBase {\n\tgetMode(): DDialogMode;\n\tcloseOn(mode: DDialogMode): DDialogCloseOn;\n\tisSticky(mode: DDialogMode): boolean;\n\tisAlwaysOnTop(): boolean;\n\tisGestureEnabled(mode: DDialogMode): boolean;\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode;\n\tgetOffsetX(mode: DDialogMode): number;\n\tgetOffsetY(mode: DDialogMode): number;\n\tgetAlign(mode: DDialogMode): DDialogAlign | null;\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null;\n}\n\nexport interface DDialogOpener extends DApplicationTarget {\n\tgetBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle;\n}\n\n/**\n * A dialog class.\n *\n * If multiple application instances are there, better to set the constructor\n * option `parent` to an `application.stage` so that the dialog picks a right\n * application. `DDialog` searches applications in a following order:\n *\n * * To begin, `DDialog` tries to find applications which it belongs to.\n * * If `DDialog` can't find applications, then `DDialog` tries to find applications which openers belong to.\n * * If openers are not given, `DDialog` assumes the last created application at the very moment `DDialog` is instantiated is the one it belongs to.\n */\nexport class DDialog<\n\tVALUE = void,\n\tTHEME extends DThemeDialog = DThemeDialog,\n\tOPTIONS extends DDialogOptions<THEME> = DDialogOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_BOUNDS?: Rectangle;\n\n\tprotected _promise?: Promise<VALUE>;\n\tprotected _resolve?: (value: VALUE | PromiseLike<VALUE>) => void;\n\tprotected _reject?: (reason?: any) => void;\n\n\tprotected _animation?: DAnimation<DBase> | null;\n\tprotected _closeOn!: DDialogCloseOn;\n\tprotected _focused?: DFocusable | null;\n\tprotected _overlay!: UtilOverlay;\n\tprotected _mode!: DDialogMode;\n\tprotected _alwaysOnTop!: boolean;\n\tprotected _onParentChildAddedBound?: () => void;\n\tprotected _sticky!: boolean;\n\tprotected _onPrerenderBound!: () => void;\n\tprotected _align!: DDialogAlign | null;\n\tprotected _opener?: DDialogOpener | null;\n\n\tprotected _gesture!: DDialogGesture<this>;\n\tprotected _layer!: DApplicationLayerLike | null;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tthis._onPrerenderBound = (): void => {\n\t\t\tthis.onPrerender();\n\t\t};\n\t\tthis._layer = null;\n\n\t\t// Mode\n\t\tconst theme = this.theme;\n\t\tconst mode = toEnum(options?.mode ?? theme.getMode(), DDialogMode);\n\t\tthis._mode = mode;\n\n\t\t// Always On Top\n\t\tthis._alwaysOnTop = options?.alwaysOnTop ?? theme.isAlwaysOnTop();\n\n\t\t// Sticky\n\t\tthis._sticky = options?.sticky ?? theme.isSticky(mode);\n\n\t\t// Close On\n\t\tconst closeOn = this.toCloseOn(mode, theme, options);\n\t\tthis._closeOn = closeOn;\n\n\t\t// Align\n\t\tthis._align = this.toAlign(mode, theme, options);\n\n\t\t// Overlay\n\t\tthis._overlay = new UtilOverlay();\n\n\t\t// Gesture\n\t\tthis._gesture = new DDialogGestureImpl(this, this.toGestureOptions(mode, theme, options));\n\n\t\t// Visibility\n\t\tthis.visible = false;\n\n\t\t// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MODAL);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\tthis.state.add(DDialogState.MODELESS);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MENU);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Outside-click handling\n\t\tif (closeOn & DDialogCloseOn.CLICK_OUTSIDE) {\n\t\t\tUtilClickOutside.apply(this, (): void => {\n\t\t\t\tthis.onCloseOn();\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected toCloseOn(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogCloseOn {\n\t\tconst closeOn = options?.closeOn;\n\t\tif (closeOn == null) {\n\t\t\treturn theme.closeOn(mode);\n\t\t} else if (isArray(closeOn)) {\n\t\t\tlet result = DDialogCloseOn.NONE;\n\t\t\tfor (let i = 0, imax = closeOn.length; i < imax; ++i) {\n\t\t\t\tresult |= DDialogCloseOn[closeOn[i]];\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if (isString(closeOn)) {\n\t\t\treturn DDialogCloseOn[closeOn];\n\t\t}\n\t\treturn closeOn;\n\t}\n\n\tprotected toAlign(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogAlign | null {\n\t\tconst align = options?.align;\n\t\tif (align === null) {\n\t\t\treturn null;\n\t\t} else if (align === undefined) {\n\t\t\treturn theme.getAlign(mode);\n\t\t} else {\n\t\t\treturn toEnum(align, DDialogAlign);\n\t\t}\n\t}\n\n\tget mode(): DDialogMode {\n\t\treturn this._mode;\n\t}\n\n\tget align(): DDialogAlign | null {\n\t\treturn this._align;\n\t}\n\n\tset algin(align: DDialogAlign | null) {\n\t\tthis._align = align;\n\t}\n\n\tget alwaysOnTop(): boolean {\n\t\treturn this._alwaysOnTop;\n\t}\n\n\tset alwaysOnTop(alwaysOnTop: boolean) {\n\t\tthis._alwaysOnTop = alwaysOnTop;\n\t}\n\n\tget gesture(): DDialogGesture<this> {\n\t\treturn this._gesture;\n\t}\n\n\tget layer(): DApplicationLayerLike | null {\n\t\treturn this._layer;\n\t}\n\n\tprotected toGestureOptions(\n\t\tmode: DDialogMode,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DDialogGestureOptions {\n\t\tconst gesture = options?.gesture;\n\t\tif (gesture === true) {\n\t\t\treturn {\n\t\t\t\tenable: true,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture === false) {\n\t\t\treturn {\n\t\t\t\tenable: false,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture != null) {\n\t\t\tif (gesture.enable === undefined) {\n\t\t\t\tgesture.enable = theme.isGestureEnabled(mode);\n\t\t\t}\n\t\t\tif (gesture.mode === undefined) {\n\t\t\t\tgesture.mode = theme.getGestureMode(mode);\n\t\t\t}\n\t\t\treturn gesture;\n\t\t}\n\t\treturn {\n\t\t\tenable: theme.isGestureEnabled(mode),\n\t\t\tmode: theme.getGestureMode(mode)\n\t\t};\n\t}\n\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tif (this.isOpened()) {\n\t\t\tconst layer = this._layer;\n\t\t\tif (layer != null) {\n\t\t\t\tconst gesture = this._gesture;\n\t\t\t\tif (gesture.isDirty()) {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onParentResize(parentWidth, parentHeight, parentPadding);\n\t}\n\n\tprotected getAnimation(): DAnimation | null {\n\t\tlet result = this._animation;\n\t\tif (result === undefined) {\n\t\t\tresult = this._options?.animation ?? this.theme.newAnimation(this._mode);\n\t\t\tif (result) {\n\t\t\t\tresult.target = this;\n\t\t\t\tresult.on(\"end\", (isReverse: boolean): void => {\n\t\t\t\t\tthis.onAnimationEnd(isReverse);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._animation = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onAnimationEnd(isReverse: boolean): void {\n\t\tif (isReverse) {\n\t\t\tif (this._mode === DDialogMode.MODELESS) {\n\t\t\t\tthis.hide();\n\t\t\t} else {\n\t\t\t\tconst parent = this.parent;\n\t\t\t\tif (parent) {\n\t\t\t\t\tparent.removeChild(this);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tthis._focused = focusController.get();\n\t\t\t\tfocusController.focus(this.findFirstFocusable(focusController) || this);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected findFirstFocusable(focusController: DControllerFocus): DFocusable | null {\n\t\treturn focusController.find(this, false, true, true);\n\t}\n\n\t/**\n\t * Opens a dialog.\n\t *\n\t * @param opener An opener of a dialog.\n\t * The dialog position is determined based on a position and a size of the opener.\n\t * If the opener is undefined, the dialog is placed at the center of the screen.\n\t *\n\t * @returns a value of this dialog\n\t */\n\topen(opener?: DDialogOpener): Promise<VALUE> {\n\t\tlet result = this._promise;\n\t\tif (result == null) {\n\t\t\tresult = new Promise<VALUE>((resolve, reject): void => {\n\t\t\t\tthis._resolve = resolve;\n\t\t\t\tthis._reject = reject;\n\t\t\t});\n\t\t\tthis._promise = result;\n\n\t\t\tthis._opener = opener;\n\n\t\t\t// Attach to a layer\n\t\t\tlet layer: DApplicationLayerLike | null = null;\n\t\t\tswitch (this._mode) {\n\t\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tcase DDialogMode.MENU:\n\t\t\t\t\tlayer = this._overlay.pick(this, opener);\n\t\t\t\t\tlayer.stage.addChild(this);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\t\tlayer = DApplications.getLayer(this);\n\t\t\t\t\tthis.show();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._layer = layer;\n\n\t\t\t// Position & size\n\t\t\tconst gesture = this._gesture;\n\t\t\tif (gesture.mode === DDialogGestureMode.CLEAN) {\n\t\t\t\tgesture.toClean();\n\t\t\t}\n\t\t\tif (layer != null) {\n\t\t\t\tif (gesture.isClean()) {\n\t\t\t\t\tconst renderer = layer.renderer;\n\t\t\t\t\tconst onPrerenderBound = this._onPrerenderBound;\n\t\t\t\t\tif (this._sticky) {\n\t\t\t\t\t\trenderer.on(\"prerender\", onPrerenderBound);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderer.once(\"prerender\", onPrerenderBound);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Bring To Front\n\t\t\tthis.bringToFront();\n\n\t\t\t// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected override onChildFocus(focused: DBase): void {\n\t\tsuper.onChildFocus(focused);\n\t\tthis.bringToFront();\n\t}\n\n\tprotected override onFocus(): void {\n\t\tsuper.onFocus();\n\t\tthis.bringToFront();\n\t}\n\n\tprotected bringToFront(): void {\n\t\tconst parent = this.parent;\n\t\tif (parent == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = parent.children;\n\t\tconst childrenLength = children.length;\n\t\tlet index = childrenLength - 1;\n\t\tfor (; 0 <= index; --index) {\n\t\t\tif (children[index] === this) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (index < 0) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = index + 1; i < childrenLength; ++i) {\n\t\t\tchildren[i - 1] = children[i];\n\t\t}\n\t\tchildren[childrenLength - 1] = this;\n\t\tchildren.sort((a, b) => {\n\t\t\treturn (\n\t\t\t\t(a instanceof DDialog ? (a._alwaysOnTop ? 2 : 1) : 0) -\n\t\t\t\t(b instanceof DDialog ? (b._alwaysOnTop ? 2 : 1) : 0)\n\t\t\t);\n\t\t});\n\t}\n\n\tprotected onPrerender(): void {\n\t\tconst layer = this._layer;\n\t\tif (layer == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst align = this._align;\n\t\tif (align === DDialogAlign.NONE) {\n\t\t\treturn;\n\t\t}\n\t\tconst opener = this._opener;\n\t\tif (align != null && opener != null) {\n\t\t\tconst mode = this._mode;\n\t\t\tconst bounds = opener.getBounds(false, (DDialog.WORK_BOUNDS ??= new Rectangle()));\n\t\t\tconst theme = this.theme;\n\t\t\tUtilAttach.attach(\n\t\t\t\tthis,\n\t\t\t\tbounds,\n\t\t\t\ttheme.getOffsetX(mode),\n\t\t\t\ttheme.getOffsetY(mode),\n\t\t\t\tlayer.width,\n\t\t\t\tlayer.height,\n\t\t\t\talign\n\t\t\t);\n\t\t} else {\n\t\t\tthis.position.set((layer.width - this.width) * 0.5, (layer.height - this.height) * 0.5);\n\t\t}\n\t}\n\n\tprotected onOpen(): void {\n\t\tthis.emit(\"open\", this);\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start();\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = true;\n\t\t\tthis.onAnimationEnd(false);\n\t\t}\n\t}\n\n\tisOpened(): boolean {\n\t\treturn this._promise != null;\n\t}\n\n\tclose(): void {\n\t\tthis.doReject();\n\t}\n\n\tprotected doResolve(value: VALUE | PromiseLike<VALUE>): void {\n\t\tconst resolve = this._resolve;\n\t\tif (resolve) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\tresolve(value);\n\t\t}\n\t}\n\n\tprotected doReject(reason?: any): void {\n\t\tconst reject = this._reject;\n\t\tif (reject) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\treject(reason);\n\t\t}\n\t}\n\n\tprotected onClose(): void {\n\t\t// Focus\n\t\tconst layer = this._layer;\n\t\tconst focused = this._focused;\n\t\tif (focused != null) {\n\t\t\tthis._focused = null;\n\t\t\tif (layer) {\n\t\t\t\tconst focusedLayer = DApplications.getLayer(focused);\n\t\t\t\tif (focusedLayer != null && layer !== focusedLayer) {\n\t\t\t\t\tfocusedLayer.view.focus();\n\t\t\t\t}\n\t\t\t\tlayer.getFocusController().focus(focused);\n\t\t\t} else {\n\t\t\t\tthis.blur(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.blur(true);\n\t\t}\n\n\t\t// Remove the prerender event handler and forget the layer\n\t\tif (layer) {\n\t\t\tlayer.renderer.off(\"prerender\", this._onPrerenderBound);\n\t\t\tthis._layer = null;\n\t\t}\n\n\t\t// Forget the opener\n\t\tthis._opener = null;\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start(true);\n\t\t} else {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\t// Always On Top\n\t\tif (this._alwaysOnTop) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent != null) {\n\t\t\t\tparent.off(\"childAdded\", this._onParentChildAddedBound);\n\t\t\t}\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tprotected onKeyDown(e: KeyboardEvent): boolean {\n\t\tif (this._closeOn & DDialogCloseOn.ESC) {\n\t\t\tif (UtilKeyboardEvent.isCancelKey(e)) {\n\t\t\t\tthis.onCloseOn();\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected onCloseOn(): void {\n\t\tthis.close();\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\tswitch (this._mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn super.containsGlobalPoint(point);\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialog\";\n\t}\n}\n"]}
|