@wcardinal/wcardinal-ui 0.167.0 → 0.170.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-button-select.d.ts +4 -3
- package/dist/types/wcardinal/ui/d-command-flag.d.ts +5 -1
- package/dist/types/wcardinal/ui/d-controller-default-command.d.ts +7 -0
- package/dist/types/wcardinal/ui/d-diagram-base.d.ts +2 -1
- package/dist/types/wcardinal/ui/d-diagram-canvas-base.d.ts +3 -1
- package/dist/types/wcardinal/ui/d-diagram-canvas-data-impl.d.ts +20 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-data-private-impl.d.ts +7 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-data-private.d.ts +5 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-data.d.ts +16 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-shape-impl.d.ts +9 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-shape.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-ticker-impl.d.ts +10 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas-ticker.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-diagram-canvas.d.ts +30 -10
- package/dist/types/wcardinal/ui/d-diagram-data-impl.d.ts +29 -0
- package/dist/types/wcardinal/ui/d-diagram-data-mapper.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-diagram-data-private-impl.d.ts +7 -0
- package/dist/types/wcardinal/ui/d-diagram-data-private.d.ts +3 -0
- package/dist/types/wcardinal/ui/d-diagram-data-remote-impl.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-diagram-data-remote.d.ts +1 -3
- package/dist/types/wcardinal/ui/d-diagram-data.d.ts +12 -21
- package/dist/types/wcardinal/ui/d-diagram-layer-container.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-diagram-layer.d.ts +2 -4
- package/dist/types/wcardinal/ui/d-diagram-serialized.d.ts +45 -27
- package/dist/types/wcardinal/ui/d-diagram-shape.d.ts +4 -3
- package/dist/types/wcardinal/ui/d-diagram-snapshot.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-diagram-ticker.d.ts +13 -0
- package/dist/types/wcardinal/ui/d-diagram.d.ts +3 -4
- package/dist/types/wcardinal/ui/index.d.ts +14 -2
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtimes.d.ts +2 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-impl.d.ts +50 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-mapper-impl.d.ts +17 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-mapper.d.ts +7 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-mapping-impl.d.ts +21 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-mapping.d.ts +20 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-private-impl.d.ts +7 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-private.d.ts +5 -0
- package/dist/types/wcardinal/ui/shape/{variant/e-shape-data-value-impl.d.ts → e-shape-data-value-impl.d.ts} +9 -4
- package/dist/types/wcardinal/ui/shape/e-shape-data-value-order.d.ts +5 -0
- package/dist/types/wcardinal/ui/shape/{variant/e-shape-data-value-range-impl.d.ts → e-shape-data-value-range-impl.d.ts} +3 -3
- package/dist/types/wcardinal/ui/shape/e-shape-data-value-scope.d.ts +12 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-value-type.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/e-shape-data-value.d.ts +5 -5
- package/dist/types/wcardinal/ui/shape/e-shape-data.d.ts +10 -0
- package/dist/types/wcardinal/ui/shape/e-shape-resource-manager-deserialization.d.ts +12 -4
- package/dist/types/wcardinal/ui/shape/index.d.ts +12 -0
- package/dist/types/wcardinal/ui/shape/variant/e-shape-button-runtime-action-toggle.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/e-shape-button-runtime-action.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/index.d.ts +0 -3
- package/dist/wcardinal/ui/d-button-select.js +1 -1
- package/dist/wcardinal/ui/d-button-select.js.map +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js +1 -1
- package/dist/wcardinal/ui/d-chart-axis-base.js.map +1 -1
- package/dist/wcardinal/ui/d-command-flag.js +6 -2
- package/dist/wcardinal/ui/d-command-flag.js.map +1 -1
- package/dist/wcardinal/ui/d-controller-default-command.js +117 -80
- package/dist/wcardinal/ui/d-controller-default-command.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-base.js +8 -10
- package/dist/wcardinal/ui/d-diagram-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-base.js +6 -3
- package/dist/wcardinal/ui/d-diagram-canvas-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js +217 -0
- package/dist/wcardinal/ui/d-diagram-canvas-data-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-data-private-impl.js +49 -0
- package/dist/wcardinal/ui/d-diagram-canvas-data-private-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-data-private.js +6 -0
- package/dist/wcardinal/ui/d-diagram-canvas-data-private.js.map +1 -0
- package/dist/wcardinal/ui/{d-diagram-canvas-data-map.js → d-diagram-canvas-data.js} +1 -1
- package/dist/wcardinal/ui/d-diagram-canvas-data.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-shape-impl.js +32 -0
- package/dist/wcardinal/ui/d-diagram-canvas-shape-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-shape.js +6 -0
- package/dist/wcardinal/ui/d-diagram-canvas-shape.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-ticker-impl.js +38 -0
- package/dist/wcardinal/ui/d-diagram-canvas-ticker-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas-ticker.js +6 -0
- package/dist/wcardinal/ui/d-diagram-canvas-ticker.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-canvas.js +275 -10
- package/dist/wcardinal/ui/d-diagram-canvas.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-data-impl.js +121 -0
- package/dist/wcardinal/ui/d-diagram-data-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-data-mapper.js +6 -0
- package/dist/wcardinal/ui/d-diagram-data-mapper.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-data-private-impl.js +19 -0
- package/dist/wcardinal/ui/d-diagram-data-private-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-data-private.js +6 -0
- package/dist/wcardinal/ui/d-diagram-data-private.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-data-remote-impl.js +20 -0
- package/dist/wcardinal/ui/d-diagram-data-remote-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram-data-remote.js +1 -15
- package/dist/wcardinal/ui/d-diagram-data-remote.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-data.js +1 -201
- package/dist/wcardinal/ui/d-diagram-data.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-layer-container.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-layer.js +5 -50
- package/dist/wcardinal/ui/d-diagram-layer.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-serialized.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-shape.js +14 -47
- package/dist/wcardinal/ui/d-diagram-shape.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-snapshot.js +1 -1
- package/dist/wcardinal/ui/d-diagram-snapshot.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-ticker.js +47 -0
- package/dist/wcardinal/ui/d-diagram-ticker.js.map +1 -0
- package/dist/wcardinal/ui/d-diagram.js +4 -115
- package/dist/wcardinal/ui/d-diagram.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog.js +2 -1
- package/dist/wcardinal/ui/d-dialog.js.map +1 -1
- package/dist/wcardinal/ui/index.js +14 -2
- package/dist/wcardinal/ui/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js +27 -7
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtimes.js.map +1 -1
- package/dist/wcardinal/ui/shape/{variant/e-shape-data-impl.js → e-shape-data-impl.js} +105 -20
- package/dist/wcardinal/ui/shape/e-shape-data-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapper-impl.js +122 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapper-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapper.js +6 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapper.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapping-impl.js +135 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapping-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapping.js +6 -0
- package/dist/wcardinal/ui/shape/e-shape-data-mapping.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-private-impl.js +45 -0
- package/dist/wcardinal/ui/shape/e-shape-data-private-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-private.js +2 -0
- package/dist/wcardinal/ui/shape/e-shape-data-private.js.map +1 -0
- package/dist/wcardinal/ui/shape/{variant/e-shape-data-value-impl.js → e-shape-data-value-impl.js} +17 -6
- package/dist/wcardinal/ui/shape/e-shape-data-value-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-order.js +9 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-order.js.map +1 -0
- package/dist/wcardinal/ui/shape/{variant/e-shape-data-value-range-impl.js → e-shape-data-value-range-impl.js} +1 -1
- package/dist/wcardinal/ui/shape/e-shape-data-value-range-impl.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-scope.js +16 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-scope.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-type.js +14 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value-type.js.map +1 -0
- package/dist/wcardinal/ui/shape/e-shape-data-value.js +1 -4
- package/dist/wcardinal/ui/shape/e-shape-data-value.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-data.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-resource-manager-deserialization.js +28 -0
- package/dist/wcardinal/ui/shape/e-shape-resource-manager-deserialization.js.map +1 -1
- package/dist/wcardinal/ui/shape/index.js +12 -0
- package/dist/wcardinal/ui/shape/index.js.map +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-rectangle-pivoted.js +1 -1
- package/dist/wcardinal/ui/shape/load/load-shape-rectangle-pivoted.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +36 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button-runtime-action-toggle.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button-runtime-action-toggle.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button-runtime-action.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-button-runtime-action.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group-viewer.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-group.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js +1 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-primitive.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/index.js +0 -3
- package/dist/wcardinal/ui/shape/variant/index.js.map +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.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +6596 -5666
- package/dist/wcardinal-ui.js +19893 -18963
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/d-diagram-canvas-data-map.d.ts +0 -2
- package/dist/types/wcardinal/ui/d-diagram-canvas-id-map.d.ts +0 -2
- package/dist/types/wcardinal/ui/shape/variant/e-shape-data-impl.d.ts +0 -34
- package/dist/wcardinal/ui/d-diagram-canvas-data-map.js.map +0 -1
- package/dist/wcardinal/ui/d-diagram-canvas-id-map.js +0 -2
- package/dist/wcardinal/ui/d-diagram-canvas-id-map.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-data-impl.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-data-value-impl.js.map +0 -1
- package/dist/wcardinal/ui/shape/variant/e-shape-data-value-range-impl.js.map +0 -1
|
@@ -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;
|
|
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,OA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,MAAM,CAAC,CAAC,CAAC,CAAC;oBACxB,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;oBAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;wBACtD,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;wBAC1B,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE;4BAC9B,OAAO,KAAK,CAAC;yBACb;qBACD;iBACD;aACD;iBAAM;gBACN,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;oBAC5C,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;oBACxB,IAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;oBAChC,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;wBAC9C,IAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;wBAC1B,IAAI,QAAQ,CAAC,KAAK,CAAC,KAAK,KAAK,EAAE;4BAC9B,OAAO,KAAK,CAAC;yBACb;qBACD;iBACD;aACD;SACD;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACF,oBAAC;AAAD,CAAC,AAxED,CAAmC,KAAK,CAAC,YAAY,GAwEpD","sourcesContent":["/*\n * Copyright (C) 2021 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Renderer, utils } from \"pixi.js\";\nimport { DApplicationTarget } 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\tonRender(renderer: Renderer): void {\n\t\tconst canvas = this._diagram.canvas;\n\t\tif (canvas) {\n\t\t\tcanvas.onRender(renderer);\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(callback: (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 (callback(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 (callback(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"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { __extends } from "tslib";
|
|
6
6
|
import { utils } from "pixi.js";
|
|
7
7
|
import { DApplications } from "./d-applications";
|
|
8
|
-
import { isNumber } from "./util";
|
|
8
|
+
import { isNumber } from "./util/is-number";
|
|
9
9
|
import { isString } from "./util/is-string";
|
|
10
10
|
import { UtilExtract } from "./util/util-extract";
|
|
11
11
|
var DDiagramSnapshot = /** @class */ (function (_super) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-diagram-snapshot.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-snapshot.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAoElD;IAEU,oCAAkB;IAG3B,0BAAY,MAAsC,EAAE,OAAyC;QAA7F,YACC,iBAAO,SAWP;QAVA,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACt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G,IAAI,CAAC;aAC1B;YAED,oCAAoC;YACpC,IAAI,SAAS,IAAI,IAAI,EAAE;gBACtB,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;aAC5B;YAED,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YACpE,OAAO,MAAM,CAAC;SACd;IACF,CAAC;IACF,uBAAC;AAAD,CAAC,AA5ND,CAEU,KAAK,CAAC,YAAY,GA0N3B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase } from \"./d-base\";\nimport { DBaseSnippetContainer } from \"./d-base-snippet-container\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DView } from \"./d-view\";\nimport { EShapeContainer } from \"./shape\";\nimport { isNumber } from \"./util\";\nimport { isString } from \"./util/is-string\";\nimport { UtilExtract } from \"./util/util-extract\";\n\nexport interface DDiagramSnapshotParent<CANVAS> {\n\tcanvas: CANVAS | null;\n\tview: DView;\n}\n\nexport interface DDiagramSnapshotEvents<CANVAS, EMITTER> {\n\t/**\n\t * Triggered before taking a snapshot.\n\t *\n\t * @param canvas a canvas\n\t * @param emitter an emitter\n\t */\n\ttaking(canvas: CANVAS, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a snapshot is taken successfully or when failed to take.\n\t *\n\t * @param canvas a canvas\n\t * @param reason Null if succeeded. Otherwise, a string representing a reason why failed.\n\t * @param emitter an emitter\n\t */\n\ttook(canvas: CANVAS, reason: string | null, emitter: EMITTER): void;\n}\n\nexport interface DDiagramSnapshotCanvasSnap {\n\tcontainer: EShapeContainer;\n}\n\nexport interface DDiagramSnapshotCanvas extends DBase {\n\tsnap?: DDiagramSnapshotCanvasSnap | null;\n}\n\nexport interface DDiagramSnapshotOnOptions<CANVAS, EMITTER>\n\textends Partial<DDiagramSnapshotEvents<CANVAS, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * Options to eliminate the snap grid, the snap targets and the canvas background from a snapshot.\n */\nexport interface DDiagramSnapshotCleanupOptions {\n\tsnap?: boolean;\n\tbackground?: boolean;\n\treflow?: boolean;\n}\n\nexport interface DDiagramSnapshotCreateAsUrlOptions {\n\tsize?: number | null;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n}\n\nexport interface DDiagramSnapshotCreateAsFileOptions {\n\tsize?: number | null;\n\tfilename: string;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n}\n\nexport interface DDiagramSnapshotCreateOptions<CANVAS, DATA> {\n\tsize?: number | null;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n\textractor: (canvas: CANVAS) => DATA;\n}\n\nexport interface DDiagramSnapshotOptions<CANVAS, EMITTER = any> {\n\ton?: DDiagramSnapshotOnOptions<CANVAS, EMITTER>;\n}\n\nexport class DDiagramSnapshot<\n\tCANVAS extends DDiagramSnapshotCanvas = DDiagramSnapshotCanvas\n> extends utils.EventEmitter {\n\tprotected _parent: DDiagramSnapshotParent<CANVAS>;\n\n\tconstructor(parent: DDiagramSnapshotParent<CANVAS>, options?: DDiagramSnapshotOptions<CANVAS>) {\n\t\tsuper();\n\t\tthis._parent = parent;\n\t\tconst on = options?.on;\n\t\tif (on) {\n\t\t\tfor (const name in on) {\n\t\t\t\tconst handler = on[name];\n\t\t\t\tif (handler) {\n\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a snapshot.\n\t *\n\t * @param size a maximum image size\n\t * @returns an URL of a created image or undefined\n\t */\n\tcreateAsUrl(size?: number | null): string | undefined;\n\n\t/**\n\t * Creates a snapshot.\n\t *\n\t * @param options options\n\t * @returns an URL of a created image or undefined\n\t */\n\tcreateAsUrl(options: DDiagramSnapshotCreateAsUrlOptions): string | undefined;\n\n\tcreateAsUrl(\n\t\tsizeOrOptions?: number | null | DDiagramSnapshotCreateAsUrlOptions\n\t): string | undefined {\n\t\tif (sizeOrOptions == null || isNumber(sizeOrOptions)) {\n\t\t\treturn this.create({\n\t\t\t\tsize: sizeOrOptions,\n\t\t\t\textractor: (canvas: CANVAS): string => {\n\t\t\t\t\treturn UtilExtract.base64({ target: canvas });\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\treturn this.create({\n\t\t\t\tsize: sizeOrOptions.size,\n\t\t\t\tcleanup: sizeOrOptions.cleanup,\n\t\t\t\textractor: (canvas: CANVAS): string => {\n\t\t\t\t\treturn UtilExtract.base64({ target: canvas });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param filename a filename\n\t */\n\tcreateAsFile(filename: string): void;\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param size a maximum image size\n\t * @param filename a filename\n\t */\n\tcreateAsFile(size: number | null, filename: string): void;\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param options options\n\t */\n\tcreateAsFile(options: DDiagramSnapshotCreateAsFileOptions): void;\n\n\tcreateAsFile(\n\t\tsizeOrFilenameOrOptions: number | string | null | DDiagramSnapshotCreateAsFileOptions,\n\t\tfilename?: string\n\t): void {\n\t\tif (isString(sizeOrFilenameOrOptions)) {\n\t\t\tthis.create({\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({ target: canvas, filename: sizeOrFilenameOrOptions });\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (sizeOrFilenameOrOptions === null || isNumber(sizeOrFilenameOrOptions)) {\n\t\t\tthis.create({\n\t\t\t\tsize: sizeOrFilenameOrOptions,\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({ target: canvas, filename: filename! });\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.create({\n\t\t\t\tsize: sizeOrFilenameOrOptions.size,\n\t\t\t\tcleanup: sizeOrFilenameOrOptions.cleanup,\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({\n\t\t\t\t\t\ttarget: canvas,\n\t\t\t\t\t\tfilename: sizeOrFilenameOrOptions.filename\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected toScale(size: number | null | undefined, canvas: CANVAS): number {\n\t\tif (size == null) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn size / DApplications.getResolution(canvas) / Math.max(canvas.width, canvas.height);\n\t}\n\n\tprotected toCleanupSnap(options?: DDiagramSnapshotCreateOptions<CANVAS, unknown>): boolean {\n\t\tif (options == null) {\n\t\t\treturn true;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn cleanup !== false && cleanup.snap !== false;\n\t}\n\n\tprotected toCleanupBackground(\n\t\toptions?: DDiagramSnapshotCreateOptions<CANVAS, unknown>\n\t): boolean {\n\t\tif (options == null) {\n\t\t\treturn false;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn cleanup === true || cleanup.background === true;\n\t}\n\n\tprotected toCleanupReflow(options?: DDiagramSnapshotCreateOptions<CANVAS, unknown>): boolean {\n\t\tif (options == null) {\n\t\t\treturn true;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn cleanup !== false && cleanup.reflow !== false;\n\t}\n\n\tcreate<DATA>(options: DDiagramSnapshotCreateOptions<CANVAS, DATA>): DATA | undefined {\n\t\tconst parent = this._parent;\n\t\tconst canvas = parent.canvas;\n\t\tif (canvas) {\n\t\t\tconst view = parent.view;\n\t\t\tconst viewPosition = view.position;\n\t\t\tconst viewScale = view.scale;\n\n\t\t\tconst oldPositionX = viewPosition.x;\n\t\t\tconst oldPositionY = viewPosition.y;\n\t\t\tconst oldScaleX = viewScale.x;\n\t\t\tconst oldScaleY = viewScale.y;\n\n\t\t\tconst newScale: number = this.toScale(options.size, canvas);\n\t\t\tview.transform(0, 0, newScale, newScale, 0);\n\n\t\t\t// Turns off the snap grid and targets\n\t\t\tlet container: EShapeContainer | undefined;\n\t\t\tif (this.toCleanupSnap(options) && \"snap\" in canvas) {\n\t\t\t\tconst snap = canvas.snap;\n\t\t\t\tif (snap != null) {\n\t\t\t\t\tcontainer = snap.container;\n\t\t\t\t\tif (container.renderable) {\n\t\t\t\t\t\tcontainer.renderable = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainer = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turns off the canvas snippets\n\t\t\tlet snippet: DBaseSnippetContainer | undefined;\n\t\t\tif (this.toCleanupBackground(options)) {\n\t\t\t\tsnippet = canvas.snippet;\n\t\t\t\tif (snippet.renderable) {\n\t\t\t\t\tsnippet.renderable = false;\n\t\t\t\t} else {\n\t\t\t\t\tsnippet = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Refit & reflow\n\t\t\tconst reflow = this.toCleanupReflow(options);\n\t\t\tif (reflow) {\n\t\t\t\tconst layer = DApplications.getLayer(canvas);\n\t\t\t\tif (layer) {\n\t\t\t\t\tlayer.reflow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extracts\n\t\t\tthis.emit(\"taking\", canvas, this);\n\t\t\tconst result = options.extractor(canvas);\n\t\t\tthis.emit(\"took\", canvas, null, this);\n\n\t\t\t// Turn on the canvas snippets\n\t\t\tif (snippet) {\n\t\t\t\tsnippet.renderable = true;\n\t\t\t}\n\n\t\t\t// Turn on the snap grid and targets\n\t\t\tif (container != null) {\n\t\t\t\tcontainer.renderable = true;\n\t\t\t}\n\n\t\t\tview.transform(oldPositionX, oldPositionY, oldScaleX, oldScaleY, 0);\n\t\t\treturn result;\n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jB,IAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,EAAE;gBACX,IAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBAC7C,IAAI,KAAK,EAAE;oBACV,KAAK,CAAC,MAAM,EAAE,CAAC;iBACf;aACD;YAED,WAAW;YACX,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YAClC,IAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YACzC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YAEtC,8BAA8B;YAC9B,IAAI,OAAO,EAAE;gBACZ,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;aAC1B;YAED,oCAAoC;YACpC,IAAI,SAAS,IAAI,IAAI,EAAE;gBACtB,SAAS,CAAC,UAAU,GAAG,IAAI,CAAC;aAC5B;YAED,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YACpE,OAAO,MAAM,CAAC;SACd;IACF,CAAC;IACF,uBAAC;AAAD,CAAC,AA5ND,CAEU,KAAK,CAAC,YAAY,GA0N3B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase } from \"./d-base\";\nimport { DBaseSnippetContainer } from \"./d-base-snippet-container\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DView } from \"./d-view\";\nimport { EShapeContainer } from \"./shape/e-shape-container\";\nimport { isNumber } from \"./util/is-number\";\nimport { isString } from \"./util/is-string\";\nimport { UtilExtract } from \"./util/util-extract\";\n\nexport interface DDiagramSnapshotParent<CANVAS> {\n\tcanvas: CANVAS | null;\n\tview: DView;\n}\n\nexport interface DDiagramSnapshotEvents<CANVAS, EMITTER> {\n\t/**\n\t * Triggered before taking a snapshot.\n\t *\n\t * @param canvas a canvas\n\t * @param emitter an emitter\n\t */\n\ttaking(canvas: CANVAS, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a snapshot is taken successfully or when failed to take.\n\t *\n\t * @param canvas a canvas\n\t * @param reason Null if succeeded. Otherwise, a string representing a reason why failed.\n\t * @param emitter an emitter\n\t */\n\ttook(canvas: CANVAS, reason: string | null, emitter: EMITTER): void;\n}\n\nexport interface DDiagramSnapshotCanvasSnap {\n\tcontainer: EShapeContainer;\n}\n\nexport interface DDiagramSnapshotCanvas extends DBase {\n\tsnap?: DDiagramSnapshotCanvasSnap | null;\n}\n\nexport interface DDiagramSnapshotOnOptions<CANVAS, EMITTER>\n\textends Partial<DDiagramSnapshotEvents<CANVAS, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * Options to eliminate the snap grid, the snap targets and the canvas background from a snapshot.\n */\nexport interface DDiagramSnapshotCleanupOptions {\n\tsnap?: boolean;\n\tbackground?: boolean;\n\treflow?: boolean;\n}\n\nexport interface DDiagramSnapshotCreateAsUrlOptions {\n\tsize?: number | null;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n}\n\nexport interface DDiagramSnapshotCreateAsFileOptions {\n\tsize?: number | null;\n\tfilename: string;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n}\n\nexport interface DDiagramSnapshotCreateOptions<CANVAS, DATA> {\n\tsize?: number | null;\n\tcleanup?: boolean | DDiagramSnapshotCleanupOptions;\n\textractor: (canvas: CANVAS) => DATA;\n}\n\nexport interface DDiagramSnapshotOptions<CANVAS, EMITTER = any> {\n\ton?: DDiagramSnapshotOnOptions<CANVAS, EMITTER>;\n}\n\nexport class DDiagramSnapshot<\n\tCANVAS extends DDiagramSnapshotCanvas = DDiagramSnapshotCanvas\n> extends utils.EventEmitter {\n\tprotected _parent: DDiagramSnapshotParent<CANVAS>;\n\n\tconstructor(parent: DDiagramSnapshotParent<CANVAS>, options?: DDiagramSnapshotOptions<CANVAS>) {\n\t\tsuper();\n\t\tthis._parent = parent;\n\t\tconst on = options?.on;\n\t\tif (on) {\n\t\t\tfor (const name in on) {\n\t\t\t\tconst handler = on[name];\n\t\t\t\tif (handler) {\n\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates a snapshot.\n\t *\n\t * @param size a maximum image size\n\t * @returns an URL of a created image or undefined\n\t */\n\tcreateAsUrl(size?: number | null): string | undefined;\n\n\t/**\n\t * Creates a snapshot.\n\t *\n\t * @param options options\n\t * @returns an URL of a created image or undefined\n\t */\n\tcreateAsUrl(options: DDiagramSnapshotCreateAsUrlOptions): string | undefined;\n\n\tcreateAsUrl(\n\t\tsizeOrOptions?: number | null | DDiagramSnapshotCreateAsUrlOptions\n\t): string | undefined {\n\t\tif (sizeOrOptions == null || isNumber(sizeOrOptions)) {\n\t\t\treturn this.create({\n\t\t\t\tsize: sizeOrOptions,\n\t\t\t\textractor: (canvas: CANVAS): string => {\n\t\t\t\t\treturn UtilExtract.base64({ target: canvas });\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\treturn this.create({\n\t\t\t\tsize: sizeOrOptions.size,\n\t\t\t\tcleanup: sizeOrOptions.cleanup,\n\t\t\t\textractor: (canvas: CANVAS): string => {\n\t\t\t\t\treturn UtilExtract.base64({ target: canvas });\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param filename a filename\n\t */\n\tcreateAsFile(filename: string): void;\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param size a maximum image size\n\t * @param filename a filename\n\t */\n\tcreateAsFile(size: number | null, filename: string): void;\n\n\t/**\n\t * Creates and downloads a snapshot.\n\t *\n\t * @param options options\n\t */\n\tcreateAsFile(options: DDiagramSnapshotCreateAsFileOptions): void;\n\n\tcreateAsFile(\n\t\tsizeOrFilenameOrOptions: number | string | null | DDiagramSnapshotCreateAsFileOptions,\n\t\tfilename?: string\n\t): void {\n\t\tif (isString(sizeOrFilenameOrOptions)) {\n\t\t\tthis.create({\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({ target: canvas, filename: sizeOrFilenameOrOptions });\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (sizeOrFilenameOrOptions === null || isNumber(sizeOrFilenameOrOptions)) {\n\t\t\tthis.create({\n\t\t\t\tsize: sizeOrFilenameOrOptions,\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({ target: canvas, filename: filename! });\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tthis.create({\n\t\t\t\tsize: sizeOrFilenameOrOptions.size,\n\t\t\t\tcleanup: sizeOrFilenameOrOptions.cleanup,\n\t\t\t\textractor: (canvas): void => {\n\t\t\t\t\tUtilExtract.file({\n\t\t\t\t\t\ttarget: canvas,\n\t\t\t\t\t\tfilename: sizeOrFilenameOrOptions.filename\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected toScale(size: number | null | undefined, canvas: CANVAS): number {\n\t\tif (size == null) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn size / DApplications.getResolution(canvas) / Math.max(canvas.width, canvas.height);\n\t}\n\n\tprotected toCleanupSnap(options?: DDiagramSnapshotCreateOptions<CANVAS, unknown>): boolean {\n\t\tif (options == null) {\n\t\t\treturn true;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn cleanup !== false && cleanup.snap !== false;\n\t}\n\n\tprotected toCleanupBackground(\n\t\toptions?: DDiagramSnapshotCreateOptions<CANVAS, unknown>\n\t): boolean {\n\t\tif (options == null) {\n\t\t\treturn false;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === false) {\n\t\t\treturn false;\n\t\t}\n\t\treturn cleanup === true || cleanup.background === true;\n\t}\n\n\tprotected toCleanupReflow(options?: DDiagramSnapshotCreateOptions<CANVAS, unknown>): boolean {\n\t\tif (options == null) {\n\t\t\treturn true;\n\t\t}\n\t\tconst cleanup = options.cleanup;\n\t\tif (cleanup == null || cleanup === true) {\n\t\t\treturn true;\n\t\t}\n\t\treturn cleanup !== false && cleanup.reflow !== false;\n\t}\n\n\tcreate<DATA>(options: DDiagramSnapshotCreateOptions<CANVAS, DATA>): DATA | undefined {\n\t\tconst parent = this._parent;\n\t\tconst canvas = parent.canvas;\n\t\tif (canvas) {\n\t\t\tconst view = parent.view;\n\t\t\tconst viewPosition = view.position;\n\t\t\tconst viewScale = view.scale;\n\n\t\t\tconst oldPositionX = viewPosition.x;\n\t\t\tconst oldPositionY = viewPosition.y;\n\t\t\tconst oldScaleX = viewScale.x;\n\t\t\tconst oldScaleY = viewScale.y;\n\n\t\t\tconst newScale: number = this.toScale(options.size, canvas);\n\t\t\tview.transform(0, 0, newScale, newScale, 0);\n\n\t\t\t// Turns off the snap grid and targets\n\t\t\tlet container: EShapeContainer | undefined;\n\t\t\tif (this.toCleanupSnap(options) && \"snap\" in canvas) {\n\t\t\t\tconst snap = canvas.snap;\n\t\t\t\tif (snap != null) {\n\t\t\t\t\tcontainer = snap.container;\n\t\t\t\t\tif (container.renderable) {\n\t\t\t\t\t\tcontainer.renderable = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainer = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turns off the canvas snippets\n\t\t\tlet snippet: DBaseSnippetContainer | undefined;\n\t\t\tif (this.toCleanupBackground(options)) {\n\t\t\t\tsnippet = canvas.snippet;\n\t\t\t\tif (snippet.renderable) {\n\t\t\t\t\tsnippet.renderable = false;\n\t\t\t\t} else {\n\t\t\t\t\tsnippet = undefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Refit & reflow\n\t\t\tconst reflow = this.toCleanupReflow(options);\n\t\t\tif (reflow) {\n\t\t\t\tconst layer = DApplications.getLayer(canvas);\n\t\t\t\tif (layer) {\n\t\t\t\t\tlayer.reflow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extracts\n\t\t\tthis.emit(\"taking\", canvas, this);\n\t\t\tconst result = options.extractor(canvas);\n\t\t\tthis.emit(\"took\", canvas, null, this);\n\n\t\t\t// Turn on the canvas snippets\n\t\t\tif (snippet) {\n\t\t\t\tsnippet.renderable = true;\n\t\t\t}\n\n\t\t\t// Turn on the snap grid and targets\n\t\t\tif (container != null) {\n\t\t\t\tcontainer.renderable = true;\n\t\t\t}\n\n\t\t\tview.transform(oldPositionX, oldPositionY, oldScaleX, oldScaleY, 0);\n\t\t\treturn result;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
var DDiagramTicker = /** @class */ (function () {
|
|
6
|
+
function DDiagramTicker(interval) {
|
|
7
|
+
var _this = this;
|
|
8
|
+
this._values = [];
|
|
9
|
+
this._interval = interval;
|
|
10
|
+
this._onTimeBound = function () {
|
|
11
|
+
_this.onTime();
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
DDiagramTicker.prototype.add = function (value) {
|
|
15
|
+
this._values.push(value);
|
|
16
|
+
};
|
|
17
|
+
DDiagramTicker.prototype.start = function () {
|
|
18
|
+
if (this._timeoutId == null) {
|
|
19
|
+
this.onTime();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
DDiagramTicker.prototype.getInterval = function () {
|
|
23
|
+
var now = Date.now();
|
|
24
|
+
var interval = this._interval;
|
|
25
|
+
return Math.max(0, interval - (now % interval));
|
|
26
|
+
};
|
|
27
|
+
DDiagramTicker.prototype.onTime = function () {
|
|
28
|
+
var values = this._values;
|
|
29
|
+
if (0 < values.length) {
|
|
30
|
+
var t = Date.now() / this._interval;
|
|
31
|
+
for (var i = 0, imax = values.length; i < imax; ++i) {
|
|
32
|
+
values[i].value = t;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
this._timeoutId = window.setTimeout(this._onTimeBound, this.getInterval());
|
|
36
|
+
};
|
|
37
|
+
DDiagramTicker.prototype.stop = function () {
|
|
38
|
+
var timeoutId = this._timeoutId;
|
|
39
|
+
if (timeoutId != null) {
|
|
40
|
+
clearTimeout(timeoutId);
|
|
41
|
+
this._timeoutId = undefined;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return DDiagramTicker;
|
|
45
|
+
}());
|
|
46
|
+
export { DDiagramTicker };
|
|
47
|
+
//# sourceMappingURL=d-diagram-ticker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"d-diagram-ticker.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-diagram-ticker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;IAMC,wBAAY,QAAgB;QAA5B,iBAMC;QALA,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG;YACnB,KAAI,CAAC,MAAM,EAAE,CAAC;QACf,CAAC,CAAC;IACH,CAAC;IAED,4BAAG,GAAH,UAAI,KAAsB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,8BAAK,GAAL;QACC,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;SACd;IACF,CAAC;IAES,oCAAW,GAArB;QACC,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC;IACjD,CAAC;IAES,+BAAM,GAAhB;QACC,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACtB,IAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;gBACpD,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;aACpB;SACD;QACD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,6BAAI,GAAJ;QACC,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;SAC5B;IACF,CAAC;IACF,qBAAC;AAAD,CAAC,AAhDD,IAgDC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShapeDataValue } from \"./shape/e-shape-data-value\";\n\nexport class DDiagramTicker {\n\tprotected _interval: number;\n\tprotected _timeoutId?: number;\n\tprotected _onTimeBound: () => void;\n\tprotected _values: EShapeDataValue[];\n\n\tconstructor(interval: number) {\n\t\tthis._values = [];\n\t\tthis._interval = interval;\n\t\tthis._onTimeBound = () => {\n\t\t\tthis.onTime();\n\t\t};\n\t}\n\n\tadd(value: EShapeDataValue): void {\n\t\tthis._values.push(value);\n\t}\n\n\tstart(): void {\n\t\tif (this._timeoutId == null) {\n\t\t\tthis.onTime();\n\t\t}\n\t}\n\n\tprotected getInterval(): number {\n\t\tconst now = Date.now();\n\t\tconst interval = this._interval;\n\t\treturn Math.max(0, interval - (now % interval));\n\t}\n\n\tprotected onTime(): void {\n\t\tconst values = this._values;\n\t\tif (0 < values.length) {\n\t\t\tconst t = Date.now() / this._interval;\n\t\t\tfor (let i = 0, imax = values.length; i < imax; ++i) {\n\t\t\t\tvalues[i].value = t;\n\t\t\t}\n\t\t}\n\t\tthis._timeoutId = window.setTimeout(this._onTimeBound, this.getInterval());\n\t}\n\n\tstop(): void {\n\t\tconst timeoutId = this._timeoutId;\n\t\tif (timeoutId != null) {\n\t\t\tclearTimeout(timeoutId);\n\t\t\tthis._timeoutId = undefined;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -6,12 +6,8 @@ import { __extends } from "tslib";
|
|
|
6
6
|
import { DDiagramBase } from "./d-diagram-base";
|
|
7
7
|
import { DDiagramCanvas } from "./d-diagram-canvas";
|
|
8
8
|
import { DDiagramShape } from "./d-diagram-shape";
|
|
9
|
-
import { DDiagramData } from "./d-diagram-data";
|
|
10
|
-
import { EShapeActionRuntimeOpen } from "./shape/action/e-shape-action-runtime-open";
|
|
11
|
-
import { EShapeRuntime } from "./shape/e-shape-runtime";
|
|
12
|
-
import { EShapeRuntimes } from "./shape/e-shape-runtimes";
|
|
13
|
-
import { EShapeType } from "./shape/e-shape-type";
|
|
14
9
|
import { UtilPointerEvent } from "./util/util-pointer-event";
|
|
10
|
+
import { DDiagramDataImpl } from "./d-diagram-data-impl";
|
|
15
11
|
var DDiagram = /** @class */ (function (_super) {
|
|
16
12
|
__extends(DDiagram, _super);
|
|
17
13
|
function DDiagram(options) {
|
|
@@ -47,121 +43,14 @@ var DDiagram = /** @class */ (function (_super) {
|
|
|
47
43
|
}
|
|
48
44
|
});
|
|
49
45
|
//
|
|
50
|
-
var data = new
|
|
46
|
+
var data = new DDiagramDataImpl(_this, options && (options.data || options.tag));
|
|
51
47
|
_this.data = data;
|
|
52
48
|
_this.tag = data;
|
|
53
49
|
_this.shape = new DDiagramShape(_this);
|
|
54
50
|
return _this;
|
|
55
51
|
}
|
|
56
|
-
DDiagram.prototype.
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
DDiagram.prototype.initializeShapes = function (shapes, dataShape, dataMapper) {
|
|
60
|
-
var formatterMap = {};
|
|
61
|
-
var initialMap = {};
|
|
62
|
-
var actionMap = new Map();
|
|
63
|
-
for (var i = 0, imax = shapes.length; i < imax; ++i) {
|
|
64
|
-
var shape = shapes[i];
|
|
65
|
-
var runtimeConstructor = EShapeRuntimes[shape.type] || EShapeRuntime;
|
|
66
|
-
var runtime = (shape.runtime = new runtimeConstructor(shape));
|
|
67
|
-
// Data
|
|
68
|
-
var shapeData = shape.data;
|
|
69
|
-
for (var j = 0, jmax = shapeData.size(); j < jmax; ++j) {
|
|
70
|
-
var shapeDatum = shapeData.get(j);
|
|
71
|
-
if (shapeDatum) {
|
|
72
|
-
// Mapping
|
|
73
|
-
if (dataMapper) {
|
|
74
|
-
dataMapper(shapeDatum, dataShape || shape);
|
|
75
|
-
}
|
|
76
|
-
// Format
|
|
77
|
-
var datumFormat = shapeDatum.format;
|
|
78
|
-
var datumInitial = shapeDatum.initial;
|
|
79
|
-
if (datumFormat in formatterMap) {
|
|
80
|
-
shapeDatum.formatter = formatterMap[datumFormat];
|
|
81
|
-
}
|
|
82
|
-
else if (0 < datumFormat.length) {
|
|
83
|
-
try {
|
|
84
|
-
var formatter = Function("value",
|
|
85
|
-
/* eslint-disable prettier/prettier */
|
|
86
|
-
"try {" +
|
|
87
|
-
"return (".concat(datumFormat, ");") +
|
|
88
|
-
"} catch( e1 ) {" +
|
|
89
|
-
"try {" +
|
|
90
|
-
"return (".concat(0 < datumInitial.length ? datumInitial : 0, ");") +
|
|
91
|
-
"} catch( e2 ) {" +
|
|
92
|
-
"return 0;" +
|
|
93
|
-
"}" +
|
|
94
|
-
"}"
|
|
95
|
-
/* eslint-enable prettier/prettier */
|
|
96
|
-
);
|
|
97
|
-
formatterMap[datumFormat] = formatter;
|
|
98
|
-
shapeDatum.formatter = formatter;
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
//
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
// Initial
|
|
105
|
-
if (datumInitial in initialMap) {
|
|
106
|
-
shapeDatum.value = initialMap[datumInitial];
|
|
107
|
-
}
|
|
108
|
-
else if (0 < datumInitial.length) {
|
|
109
|
-
try {
|
|
110
|
-
shapeDatum.value = initialMap[datumInitial] = Function(
|
|
111
|
-
/* eslint-disable prettier/prettier */
|
|
112
|
-
"try {" +
|
|
113
|
-
"return (".concat(datumInitial, ");") +
|
|
114
|
-
"} catch( e ) {" +
|
|
115
|
-
"return 0;" +
|
|
116
|
-
"}"
|
|
117
|
-
/* eslint-enable prettier/prettier */
|
|
118
|
-
)();
|
|
119
|
-
}
|
|
120
|
-
catch (e) {
|
|
121
|
-
//
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
// Initialize runtime actions
|
|
127
|
-
var values = shape.action.values;
|
|
128
|
-
var actions = runtime.actions;
|
|
129
|
-
for (var j = 0, jmax = values.length; j < jmax; ++j) {
|
|
130
|
-
var value = values[j];
|
|
131
|
-
var action = actionMap.get(value);
|
|
132
|
-
if (action == null) {
|
|
133
|
-
action = value.toRuntime();
|
|
134
|
-
if (action != null) {
|
|
135
|
-
if (action instanceof EShapeActionRuntimeOpen) {
|
|
136
|
-
if (shape.cursor.length <= 0) {
|
|
137
|
-
shape.cursor = "pointer";
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
actionMap.set(value, action);
|
|
141
|
-
actions.push(action);
|
|
142
|
-
runtime.reset |= action.reset;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
actions.push(action);
|
|
147
|
-
runtime.reset |= action.reset;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
// Children
|
|
151
|
-
var children = shape.children;
|
|
152
|
-
if (0 < children.length) {
|
|
153
|
-
this.initializeShapes(children, this.toDataShape(dataShape, shape), dataMapper);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
DDiagram.prototype.toDataShape = function (dataShape, shape) {
|
|
158
|
-
if (dataShape != null) {
|
|
159
|
-
return dataShape;
|
|
160
|
-
}
|
|
161
|
-
if (shape.type === EShapeType.EMBEDDED) {
|
|
162
|
-
return shape;
|
|
163
|
-
}
|
|
164
|
-
return null;
|
|
52
|
+
DDiagram.prototype.initLayer = function (canvas, shapes, mapper) {
|
|
53
|
+
_super.prototype.initLayer.call(this, canvas, shapes, mapper || this.data.mapper);
|
|
165
54
|
};
|
|
166
55
|
DDiagram.prototype.isEditMode = function () {
|
|
167
56
|
return false;
|
|
@@ -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,EACN,YAAY,EAKZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAyB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAA2C,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAiC7D;IAGU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C;IAES,8BAAW,GAArB,UAAsB,SAAwB,EAAE,KAAa;QAC5D,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,OAAO,SAAS,CAAC;SACjB;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,EAAE;YACvC,OAAO,KAAK,CAAC;SACb;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAES,6BAAU,GAApB;QACC,OAAO,KAAK,CAAC;IACd,CAAC;IAES,4BAAS,GAAnB,UAAoB,UAA8B;QACjD,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,CAAC;IAES,kCAAe,GAAzB,UAA0B,UAA8B;QACvD,OAAO,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAES,yBAAM,GAAhB,UAAiB,CAA+B;;QAC/C,iBAAM,MAAM,YAAC,CAAC,EAAE,MAAA,IAAI,CAAC,MAAM,0CAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,6BAAU,GAAV,UACC,CAA0B,EAC1B,kBAAkD;;QAElD,OAAO,iBAAM,UAAU,YACtB,CAAC,EACD,kBAAkB,EAClB,MAAA,IAAI,CAAC,MAAM,0CAAE,eAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,CACnD,CAAC;IACH,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,AApND,CAGU,YAAY,GAiNrB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Renderer } from \"pixi.js\";\nimport {\n\tDDiagramBase,\n\tDDiagramBaseController,\n\tDDiagramBaseOptions,\n\tDDiagramBasePieceController,\n\tDThemeDiagramBase\n} 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, DDiagramDataMapper, DDiagramDataOptions } from \"./d-diagram-data\";\nimport { EShapeActionRuntime } from \"./shape/action/e-shape-action-runtime\";\nimport { EShapeActionRuntimeOpen } from \"./shape/action/e-shape-action-runtime-open\";\nimport { EShapeActionValue } from \"./shape/action/e-shape-action-value\";\nimport { EShape } from \"./shape/e-shape\";\nimport { EShapeRuntime } from \"./shape/e-shape-runtime\";\nimport { EShapeRuntimes } from \"./shape/e-shape-runtimes\";\nimport { EShapeType } from \"./shape/e-shape-type\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\n\n/**\n * {@link DDiagram} piece controller.\n */\nexport interface DDiagramPieceController extends DDiagramBasePieceController {}\n\n/**\n * {@link DDiagram} controller.\n */\nexport interface DDiagramController extends DDiagramBaseController {}\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\tthis.on(UtilPointerEvent.move, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeMove(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.up, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeUp(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.upoutside, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.cancel, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t});\n\n\t\tUtilPointerEvent.onClick(this, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeClick(e);\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\tconst data = new DDiagramData(this, options && (options.data || options.tag));\n\t\tthis.data = data;\n\t\tthis.tag = data;\n\t\tthis.shape = new DDiagramShape(this);\n\t}\n\n\tprotected initialize(shapes: EShape[]): void {\n\t\tthis.initializeShapes(shapes, null, this.data.mapper);\n\t}\n\n\tprotected initializeShapes(\n\t\tshapes: EShape[],\n\t\tdataShape: EShape | null,\n\t\tdataMapper: DDiagramDataMapper | null\n\t): void {\n\t\tconst formatterMap: Record<string, (value: unknown) => unknown> = {};\n\t\tconst initialMap: Record<string, unknown | undefined> = {};\n\t\tconst actionMap: Map<EShapeActionValue, EShapeActionRuntime> = new Map<\n\t\t\tEShapeActionValue,\n\t\t\tEShapeActionRuntime\n\t\t>();\n\n\t\tfor (let i = 0, imax = shapes.length; i < imax; ++i) {\n\t\t\tconst shape = shapes[i];\n\t\t\tconst runtimeConstructor = EShapeRuntimes[shape.type] || EShapeRuntime;\n\t\t\tconst runtime = (shape.runtime = new runtimeConstructor(shape));\n\n\t\t\t// Data\n\t\t\tconst shapeData = shape.data;\n\t\t\tfor (let j = 0, jmax = shapeData.size(); j < jmax; ++j) {\n\t\t\t\tconst shapeDatum = shapeData.get(j);\n\t\t\t\tif (shapeDatum) {\n\t\t\t\t\t// Mapping\n\t\t\t\t\tif (dataMapper) {\n\t\t\t\t\t\tdataMapper(shapeDatum, dataShape || shape);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Format\n\t\t\t\t\tconst datumFormat = shapeDatum.format;\n\t\t\t\t\tconst datumInitial = shapeDatum.initial;\n\t\t\t\t\tif (datumFormat in formatterMap) {\n\t\t\t\t\t\tshapeDatum.formatter = formatterMap[datumFormat];\n\t\t\t\t\t} else if (0 < datumFormat.length) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst formatter = Function(\n\t\t\t\t\t\t\t\t\"value\",\n\t\t\t\t\t\t\t\t/* eslint-disable prettier/prettier */\n\t\t\t\t\t\t\t\t`try {` +\n\t\t\t\t\t\t\t\t\t`return (${datumFormat});` +\n\t\t\t\t\t\t\t\t`} catch( e1 ) {` +\n\t\t\t\t\t\t\t\t\t`try {` +\n\t\t\t\t\t\t\t\t\t\t`return (${0 < datumInitial.length ? datumInitial : 0});` +\n\t\t\t\t\t\t\t\t\t`} catch( e2 ) {` +\n\t\t\t\t\t\t\t\t\t\t`return 0;` +\n\t\t\t\t\t\t\t\t\t`}` +\n\t\t\t\t\t\t\t\t`}`\n\t\t\t\t\t\t\t\t/* eslint-enable prettier/prettier */\n\t\t\t\t\t\t\t) as any;\n\t\t\t\t\t\t\tformatterMap[datumFormat] = formatter;\n\t\t\t\t\t\t\tshapeDatum.formatter = formatter;\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Initial\n\t\t\t\t\tif (datumInitial in initialMap) {\n\t\t\t\t\t\tshapeDatum.value = initialMap[datumInitial];\n\t\t\t\t\t} else if (0 < datumInitial.length) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tshapeDatum.value = initialMap[datumInitial] = Function(\n\t\t\t\t\t\t\t\t/* eslint-disable prettier/prettier */\n\t\t\t\t\t\t\t\t`try {` +\n\t\t\t\t\t\t\t\t\t`return (${datumInitial});` +\n\t\t\t\t\t\t\t\t`} catch( e ) {` +\n\t\t\t\t\t\t\t\t\t`return 0;` +\n\t\t\t\t\t\t\t\t`}`\n\t\t\t\t\t\t\t\t/* eslint-enable prettier/prettier */\n\t\t\t\t\t\t\t)();\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Initialize runtime actions\n\t\t\tconst values = shape.action.values;\n\t\t\tconst actions = runtime.actions;\n\t\t\tfor (let j = 0, jmax = values.length; j < jmax; ++j) {\n\t\t\t\tconst value = values[j];\n\t\t\t\tlet action: EShapeActionRuntime | undefined | null = actionMap.get(value);\n\t\t\t\tif (action == null) {\n\t\t\t\t\taction = value.toRuntime();\n\t\t\t\t\tif (action != null) {\n\t\t\t\t\t\tif (action instanceof EShapeActionRuntimeOpen) {\n\t\t\t\t\t\t\tif (shape.cursor.length <= 0) {\n\t\t\t\t\t\t\t\tshape.cursor = \"pointer\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tactionMap.set(value, action);\n\t\t\t\t\t\tactions.push(action);\n\t\t\t\t\t\truntime.reset |= action.reset;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tactions.push(action);\n\t\t\t\t\truntime.reset |= action.reset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Children\n\t\t\tconst children = shape.children;\n\t\t\tif (0 < children.length) {\n\t\t\t\tthis.initializeShapes(children, this.toDataShape(dataShape, shape), dataMapper);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toDataShape(dataShape: EShape | null, shape: EShape): EShape | null {\n\t\tif (dataShape != null) {\n\t\t\treturn dataShape;\n\t\t}\n\t\tif (shape.type === EShapeType.EMBEDDED) {\n\t\t\treturn shape;\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected isEditMode(): boolean {\n\t\treturn false;\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: interaction.InteractionEvent): void {\n\t\tsuper.onDown(e, this.canvas?.onShapeDown(e));\n\t}\n\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean {\n\t\treturn super.onDblClick(\n\t\t\te,\n\t\t\tinteractionManager,\n\t\t\tthis.canvas?.onShapeDblClick(e, interactionManager)\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,EACN,YAAY,EAKZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAyB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,gBAAg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AAC;QAC9B,iBAAM,MAAM,YAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAES,0BAAO,GAAjB;QACC,OAAO,UAAU,CAAC;IACnB,CAAC;IACF,eAAC;AAAD,CAAC,AAjGD,CAGU,YAAY,GA8FrB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, Renderer } from \"pixi.js\";\nimport {\n\tDDiagramBase,\n\tDDiagramBaseController,\n\tDDiagramBaseOptions,\n\tDDiagramBasePieceController,\n\tDThemeDiagramBase\n} 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 { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { EShape } from \"./shape/e-shape\";\nimport { DDiagramDataImpl } from \"./d-diagram-data-impl\";\nimport { DDiagramDataMapper } from \"./d-diagram-data-mapper\";\n\n/**\n * {@link DDiagram} piece controller.\n */\nexport interface DDiagramPieceController extends DDiagramBasePieceController {}\n\n/**\n * {@link DDiagram} controller.\n */\nexport interface DDiagramController extends DDiagramBaseController {}\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\tthis.on(UtilPointerEvent.move, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeMove(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.up, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeUp(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.upoutside, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t});\n\n\t\tthis.on(UtilPointerEvent.cancel, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeCancel(e);\n\t\t\t}\n\t\t});\n\n\t\tUtilPointerEvent.onClick(this, (e: interaction.InteractionEvent): void => {\n\t\t\tconst canvas = this.canvas;\n\t\t\tif (canvas) {\n\t\t\t\tcanvas.onShapeClick(e);\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\tconst data = new DDiagramDataImpl(this, options && (options.data || options.tag));\n\t\tthis.data = data;\n\t\tthis.tag = data;\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): void {\n\t\tsuper.initLayer(canvas, shapes, mapper || this.data.mapper);\n\t}\n\n\tprotected isEditMode(): boolean {\n\t\treturn false;\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: interaction.InteractionEvent): void {\n\t\tsuper.onDown(e, this.canvas?.onShapeDown(e));\n\t}\n\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean {\n\t\treturn super.onDblClick(\n\t\t\te,\n\t\t\tinteractionManager,\n\t\t\tthis.canvas?.onShapeDblClick(e, interactionManager)\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"]}
|
|
@@ -13,7 +13,8 @@ import { DDialogGestureImpl } from "./d-dialog-gesture-impl";
|
|
|
13
13
|
import { DDialogGestureMode } from "./d-dialog-gesture-mode";
|
|
14
14
|
import { DDialogMode } from "./d-dialog-mode";
|
|
15
15
|
import { DDialogState } from "./d-dialog-state";
|
|
16
|
-
import { isArray
|
|
16
|
+
import { isArray } from "./util/is-array";
|
|
17
|
+
import { isString } from "./util/is-string";
|
|
17
18
|
import { toEnum } from "./util/to-enum";
|
|
18
19
|
import { UtilAttach } from "./util/util-attach";
|
|
19
20
|
import { UtilClickOutside } from "./util/util-click-outside";
|
|
@@ -1 +1 @@
|
|
|
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,EAA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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 { 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, isString } from \"./util\";\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\";\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\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\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 {\n\tgetBounds(skipUpdate: boolean, result: 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. By default, the dialog assumes the last created application is\n * the one it belongs to at the time when it is created.\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 _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// 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// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.visible = false;\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.visible = false;\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 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\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\tparent.removeChild(this);\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\tconst firstFocusable = focusController.find(this, false, true, true);\n\t\t\t\tfocusController.focus(firstFocusable || this);\n\t\t\t}\n\t\t}\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);\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\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// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\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\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 if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tonKeyDown(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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poration\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 { 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\";\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\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\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 {\n\tgetBounds(skipUpdate: boolean, result: 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. By default, the dialog assumes the last created application is\n * the one it belongs to at the time when it is created.\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 _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// 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// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.visible = false;\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.visible = false;\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 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\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\tparent.removeChild(this);\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\tconst firstFocusable = focusController.find(this, false, true, true);\n\t\t\t\tfocusController.focus(firstFocusable || this);\n\t\t\t}\n\t\t}\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);\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\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// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\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\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 if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tonKeyDown(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"]}
|
|
@@ -191,16 +191,27 @@ export * from "./d-corner-mask";
|
|
|
191
191
|
export * from "./d-corner";
|
|
192
192
|
export * from "./d-diagram-base";
|
|
193
193
|
export * from "./d-diagram-canvas-base";
|
|
194
|
-
export * from "./d-diagram-canvas-data-
|
|
194
|
+
export * from "./d-diagram-canvas-data-impl";
|
|
195
|
+
export * from "./d-diagram-canvas-data-private-impl";
|
|
196
|
+
export * from "./d-diagram-canvas-data-private";
|
|
197
|
+
export * from "./d-diagram-canvas-data";
|
|
195
198
|
export * from "./d-diagram-canvas-editor-background";
|
|
196
199
|
export * from "./d-diagram-canvas-editor-snap";
|
|
197
200
|
export * from "./d-diagram-canvas-editor";
|
|
198
|
-
export * from "./d-diagram-canvas-id-map";
|
|
199
201
|
export * from "./d-diagram-canvas-mapping-impl";
|
|
200
202
|
export * from "./d-diagram-canvas-mapping-point-impl";
|
|
201
203
|
export * from "./d-diagram-canvas-mapping";
|
|
204
|
+
export * from "./d-diagram-canvas-shape-impl";
|
|
205
|
+
export * from "./d-diagram-canvas-shape";
|
|
206
|
+
export * from "./d-diagram-canvas-ticker-impl";
|
|
207
|
+
export * from "./d-diagram-canvas-ticker";
|
|
202
208
|
export * from "./d-diagram-canvas-tile";
|
|
203
209
|
export * from "./d-diagram-canvas";
|
|
210
|
+
export * from "./d-diagram-data-impl";
|
|
211
|
+
export * from "./d-diagram-data-mapper";
|
|
212
|
+
export * from "./d-diagram-data-private-impl";
|
|
213
|
+
export * from "./d-diagram-data-private";
|
|
214
|
+
export * from "./d-diagram-data-remote-impl";
|
|
204
215
|
export * from "./d-diagram-data-remote";
|
|
205
216
|
export * from "./d-diagram-data";
|
|
206
217
|
export * from "./d-diagram-editor-thumbnail";
|
|
@@ -212,6 +223,7 @@ export * from "./d-diagram-layers";
|
|
|
212
223
|
export * from "./d-diagram-serialized";
|
|
213
224
|
export * from "./d-diagram-shape";
|
|
214
225
|
export * from "./d-diagram-snapshot";
|
|
226
|
+
export * from "./d-diagram-ticker";
|
|
215
227
|
export * from "./d-diagram";
|
|
216
228
|
export * from "./d-diagrams";
|
|
217
229
|
export * from "./d-dialog-align";
|