@wcardinal/wcardinal-ui 0.335.0 → 0.336.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-view-gesture-impl.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-view.d.ts +51 -10
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-open-opener.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtime-open.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/action/e-shape-actions.d.ts +1 -1
- package/dist/wcardinal/ui/d-view-gesture-impl.js +12 -12
- package/dist/wcardinal/ui/d-view-gesture-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view-impl.js +2 -0
- package/dist/wcardinal/ui/d-view-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view-transform-impl.js +3 -3
- package/dist/wcardinal/ui/d-view-transform-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-view.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-open-opener.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open.js +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open.js.map +1 -1
- package/dist/wcardinal/ui/shape/action/e-shape-actions.js +2 -1
- package/dist/wcardinal/ui/shape/action/e-shape-actions.js.map +1 -1
- package/dist/wcardinal/ui/util/util-gesture.js +3 -2
- package/dist/wcardinal/ui/util/util-gesture.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 +23 -20
- package/dist/wcardinal-ui.js +23 -20
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,9 +11,9 @@ export declare class DViewGestureImpl implements DViewGesture {
|
|
|
11
11
|
protected _constraint: DViewConstraint;
|
|
12
12
|
protected _gestureUtil?: UtilGesture<DBase>;
|
|
13
13
|
constructor(owner: DBase, toTarget: DViewToTarget, parent: DViewParent, constraint: DViewConstraint, theme: DThemeViewGesture, options?: DViewGestureOptions);
|
|
14
|
-
protected onStart(): void;
|
|
15
|
-
protected onEnd(): void;
|
|
16
|
-
protected onStop(): void;
|
|
14
|
+
protected onStart(target: DBase): void;
|
|
15
|
+
protected onEnd(target: DBase): void;
|
|
16
|
+
protected onStop(target: DBase): void;
|
|
17
17
|
protected onGestureMove(target: DViewTarget | null, dx: number, dy: number, x: number, y: number, ds: number): void;
|
|
18
18
|
stop(): void;
|
|
19
19
|
onDown(e: interaction.InteractionEvent): void;
|
|
@@ -5,7 +5,6 @@ import { DThemeViewGesture, DViewGesture, DViewGestureOptions } from "./d-view-g
|
|
|
5
5
|
import { DViewTargetPoint } from "./d-view-to-target";
|
|
6
6
|
import { DViewConstraint } from "./d-view-constraint";
|
|
7
7
|
import { DOnOptions } from "./d-on-options";
|
|
8
|
-
import { DViewTransform } from "./d-view-transform";
|
|
9
8
|
export declare type DViewChecker = (e: WheelEvent | MouseEvent | TouchEvent, modifier: UtilGestureModifier, target: DBase) => boolean;
|
|
10
9
|
/**
|
|
11
10
|
* {@link DView} wheel zoom options.
|
|
@@ -84,26 +83,68 @@ export interface DViewTranslationOptions {
|
|
|
84
83
|
*/
|
|
85
84
|
export interface DViewEvents<EMITTER> {
|
|
86
85
|
/**
|
|
87
|
-
* Triggered when a
|
|
86
|
+
* Triggered when a gesture starts.
|
|
88
87
|
*
|
|
89
|
-
* @param
|
|
88
|
+
* @param target an operation target
|
|
90
89
|
* @param emitter an emitter
|
|
91
90
|
*/
|
|
92
|
-
|
|
91
|
+
gesturestart(target: DBase, emitter: EMITTER): void;
|
|
93
92
|
/**
|
|
94
|
-
* Triggered when a
|
|
93
|
+
* Triggered when a gesture ends.
|
|
95
94
|
*
|
|
96
|
-
* @param
|
|
95
|
+
* @param target an operation target
|
|
97
96
|
* @param emitter an emitter
|
|
98
97
|
*/
|
|
99
|
-
|
|
98
|
+
gestureend(target: DBase, emitter: EMITTER): void;
|
|
100
99
|
/**
|
|
101
|
-
* Triggered when a
|
|
100
|
+
* Triggered when a gesture stops.
|
|
102
101
|
*
|
|
103
|
-
* @param
|
|
102
|
+
* @param target an operation target
|
|
104
103
|
* @param emitter an emitter
|
|
105
104
|
*/
|
|
106
|
-
|
|
105
|
+
gesturestop(target: DBase, emitter: EMITTER): void;
|
|
106
|
+
/**
|
|
107
|
+
* Triggered when a transform starts.
|
|
108
|
+
*
|
|
109
|
+
* @param target an operation target
|
|
110
|
+
* @param emitter an emitter
|
|
111
|
+
*/
|
|
112
|
+
transformstart(target: DBase, emitter: EMITTER): void;
|
|
113
|
+
/**
|
|
114
|
+
* Triggered when a transform ends.
|
|
115
|
+
*
|
|
116
|
+
* @param target an operation target
|
|
117
|
+
* @param emitter an emitter
|
|
118
|
+
*/
|
|
119
|
+
transformend(target: DBase, emitter: EMITTER): void;
|
|
120
|
+
/**
|
|
121
|
+
* Triggered when a transform stops.
|
|
122
|
+
*
|
|
123
|
+
* @param target an operation target
|
|
124
|
+
* @param emitter an emitter
|
|
125
|
+
*/
|
|
126
|
+
transformstop(target: DBase, emitter: EMITTER): void;
|
|
127
|
+
/**
|
|
128
|
+
* Triggered when a wheel translation starts.
|
|
129
|
+
*
|
|
130
|
+
* @param target an operation target
|
|
131
|
+
* @param emitter an emitter
|
|
132
|
+
*/
|
|
133
|
+
wheeltranslationstart(target: DBase, emitter: EMITTER): void;
|
|
134
|
+
/**
|
|
135
|
+
* Triggered when a wheel translation ends.
|
|
136
|
+
*
|
|
137
|
+
* @param target an operation target
|
|
138
|
+
* @param emitter an emitter
|
|
139
|
+
*/
|
|
140
|
+
wheeltranslationend(target: DBase, emitter: EMITTER): void;
|
|
141
|
+
/**
|
|
142
|
+
* Triggered when a wheel translation stops.
|
|
143
|
+
*
|
|
144
|
+
* @param target an operation target
|
|
145
|
+
* @param emitter an emitter
|
|
146
|
+
*/
|
|
147
|
+
wheeltranslationstop(target: DBase, emitter: EMITTER): void;
|
|
107
148
|
}
|
|
108
149
|
/**
|
|
109
150
|
* {@link DView} "on" options.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EShape } from "../e-shape";
|
|
2
|
-
export declare type EShapeActionOpenOpener = (target:
|
|
2
|
+
export declare type EShapeActionOpenOpener = (target: unknown, inNewWindow: boolean, shape: EShape) => void;
|
|
@@ -7,7 +7,7 @@ import { EShapeActionValueOpen } from "./e-shape-action-value-open";
|
|
|
7
7
|
import { EShapeActionValueOpenExtension } from "./e-shape-action-value-open-extension";
|
|
8
8
|
export declare class EShapeActionRuntimeOpen extends EShapeActionRuntimeConditional {
|
|
9
9
|
protected subtype: number;
|
|
10
|
-
protected readonly target: EShapeActionExpression<
|
|
10
|
+
protected readonly target: EShapeActionExpression<unknown>;
|
|
11
11
|
protected inNewWindow: boolean;
|
|
12
12
|
constructor(value: EShapeActionValueOpen | EShapeActionValueOpenExtension, subtype: DDiagramBaseControllerOpenType);
|
|
13
13
|
execute(shape: EShape, runtime: EShapeRuntime, time: number): void;
|
|
@@ -16,7 +16,7 @@ export declare class EShapeActions {
|
|
|
16
16
|
static isContainer(target: unknown): target is EShapeActionsContainer;
|
|
17
17
|
static isEmbedded(target: unknown): target is EShapeEmbedded;
|
|
18
18
|
static toContainer(shape?: EShape | null): EShapeActionsContainer | null;
|
|
19
|
-
static open(shape: EShape, type: DDiagramBaseControllerOpenType, target:
|
|
19
|
+
static open(shape: EShape, type: DDiagramBaseControllerOpenType, target: unknown, inNewWindow: boolean): void;
|
|
20
20
|
static writeLocal(shape: EShape, id: string, value: unknown, time: number, state?: EShapeDataValueState): boolean;
|
|
21
21
|
static writeRemote(shape: EShape, id: string, value: unknown): boolean;
|
|
22
22
|
static emit(shape: EShape, name: string): void;
|
|
@@ -24,36 +24,36 @@ var DViewGestureImpl = /** @class */ (function () {
|
|
|
24
24
|
duration: options === null || options === void 0 ? void 0 : options.duration
|
|
25
25
|
},
|
|
26
26
|
on: {
|
|
27
|
-
start: function () {
|
|
28
|
-
_this.onStart();
|
|
27
|
+
start: function (target) {
|
|
28
|
+
_this.onStart(target);
|
|
29
29
|
},
|
|
30
30
|
move: function (target, dx, dy, x, y, ds) {
|
|
31
31
|
_this.onGestureMove(toTarget(owner), dx, dy, x, y, ds);
|
|
32
32
|
},
|
|
33
33
|
easing: {
|
|
34
|
-
end: function () {
|
|
35
|
-
_this.onEnd();
|
|
34
|
+
end: function (target) {
|
|
35
|
+
_this.onEnd(target);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
stop: function () {
|
|
39
|
-
_this.onStop();
|
|
38
|
+
stop: function (target) {
|
|
39
|
+
_this.onStop(target);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
DViewGestureImpl.prototype.onStart = function () {
|
|
45
|
+
DViewGestureImpl.prototype.onStart = function (target) {
|
|
46
46
|
var parent = this._parent;
|
|
47
47
|
parent.stop();
|
|
48
|
-
parent.emit("
|
|
48
|
+
parent.emit("gesturestart", target, parent);
|
|
49
49
|
};
|
|
50
|
-
DViewGestureImpl.prototype.onEnd = function () {
|
|
50
|
+
DViewGestureImpl.prototype.onEnd = function (target) {
|
|
51
51
|
var parent = this._parent;
|
|
52
|
-
parent.emit("
|
|
52
|
+
parent.emit("gestureend", target, parent);
|
|
53
53
|
};
|
|
54
|
-
DViewGestureImpl.prototype.onStop = function () {
|
|
54
|
+
DViewGestureImpl.prototype.onStop = function (target) {
|
|
55
55
|
var parent = this._parent;
|
|
56
|
-
parent.emit("
|
|
56
|
+
parent.emit("gesturestop", target, parent);
|
|
57
57
|
};
|
|
58
58
|
DViewGestureImpl.prototype.onGestureMove = function (target, dx, dy, x, y, ds) {
|
|
59
59
|
if (target) {
|
|
@@ -1 +1 @@
|
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,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,iCAAM,GAAN,UAAO,CAA+B;;QACrC,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IACF,uBAAC;AAAD,CAAC,AArHD,IAqHC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { UtilGestureMode } from \"./util/util-gesture-mode\";\nimport { UtilGestureModifier } from \"./util/util-gesture-modifier\";\nimport { DThemeViewGesture, DViewGesture, DViewGestureOptions } from \"./d-view-gesture\";\nimport { DViewParent } from \"./d-view-parent\";\nimport { DViewTarget, DViewToTarget } from \"./d-view-to-target\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilGesture } from \"./util/util-gesture\";\nimport { DViewConstraint } from \"./d-view-constraint\";\n\nexport class DViewGestureImpl implements DViewGesture {\n\tprotected _owner: DBase;\n\tprotected _parent: DViewParent;\n\tprotected _constraint: DViewConstraint;\n\tprotected _gestureUtil?: UtilGesture<DBase>;\n\n\tconstructor(\n\t\towner: DBase,\n\t\ttoTarget: DViewToTarget,\n\t\tparent: DViewParent,\n\t\tconstraint: DViewConstraint,\n\t\ttheme: DThemeViewGesture,\n\t\toptions?: DViewGestureOptions\n\t) {\n\t\tthis._owner = owner;\n\t\tthis._parent = parent;\n\t\tthis._constraint = constraint;\n\n\t\tconst mode = toEnum(options?.mode ?? theme.getGestureMode(), UtilGestureMode);\n\t\tconst modifier = toEnum(\n\t\t\toptions?.modifier ?? theme.getGestureModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tif (mode === UtilGestureMode.ON || mode === UtilGestureMode.TOUCH) {\n\t\t\tthis._gestureUtil = new UtilGesture<DBase>({\n\t\t\t\ttouch: mode === UtilGestureMode.TOUCH,\n\t\t\t\tmodifier,\n\t\t\t\tchecker: options && options.checker,\n\t\t\t\teasing: {\n\t\t\t\t\tduration: options?.duration\n\t\t\t\t},\n\t\t\t\ton: {\n\t\t\t\t\tstart: (target): void => {\n\t\t\t\t\t\tthis.onStart(target);\n\t\t\t\t\t},\n\t\t\t\t\tmove: (\n\t\t\t\t\t\ttarget: DBase,\n\t\t\t\t\t\tdx: number,\n\t\t\t\t\t\tdy: number,\n\t\t\t\t\t\tx: number,\n\t\t\t\t\t\ty: number,\n\t\t\t\t\t\tds: number\n\t\t\t\t\t): void => {\n\t\t\t\t\t\tthis.onGestureMove(toTarget(owner), dx, dy, x, y, ds);\n\t\t\t\t\t},\n\t\t\t\t\teasing: {\n\t\t\t\t\t\tend: (target): void => {\n\t\t\t\t\t\t\tthis.onEnd(target);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tstop: (target): void => {\n\t\t\t\t\t\tthis.onStop(target);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected onStart(target: DBase): void {\n\t\tconst parent = this._parent;\n\t\tparent.stop();\n\t\tparent.emit(\"gesturestart\", target, parent);\n\t}\n\n\tprotected onEnd(target: DBase): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"gestureend\", target, parent);\n\t}\n\n\tprotected onStop(target: DBase): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"gesturestop\", target, parent);\n\t}\n\n\tprotected onGestureMove(\n\t\ttarget: DViewTarget | null,\n\t\tdx: number,\n\t\tdy: number,\n\t\tx: number,\n\t\ty: number,\n\t\tds: number\n\t): void {\n\t\tif (target) {\n\t\t\t// Scale\n\t\t\tconst parent = this._parent;\n\t\t\tconst oldScale = target.scale;\n\t\t\tconst oldScaleX = oldScale.x;\n\t\t\tconst oldScaleY = oldScale.y;\n\t\t\tlet newScaleX = parent.toNormalizedScale(oldScaleX * ds);\n\t\t\tlet newScaleY = parent.toNormalizedScale(oldScaleY * ds);\n\n\t\t\tconst scaleRatioX = newScaleX / oldScaleX;\n\t\t\tconst scaleRatioY = newScaleY / oldScaleY;\n\t\t\tconst scaleRatio =\n\t\t\t\tds < 1 ? Math.max(scaleRatioX, scaleRatioY) : Math.min(scaleRatioX, scaleRatioY);\n\t\t\tnewScaleX = scaleRatio * oldScaleX;\n\t\t\tnewScaleY = scaleRatio * oldScaleY;\n\n\t\t\t// Position\n\t\t\tconst cx = x - dx;\n\t\t\tconst cy = y - dy;\n\t\t\tconst position = target.position;\n\t\t\tconst newX = (position.x - cx) * scaleRatio + x;\n\t\t\tconst newY = (position.y - cy) * scaleRatio + y;\n\n\t\t\t// Update\n\t\t\tthis._constraint(target, newX, newY, newScaleX, newScaleY);\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tthis._gestureUtil?.stop(this._owner);\n\t}\n\n\tonDown(e: interaction.InteractionEvent): void {\n\t\tthis._gestureUtil?.onDown(this._owner, e);\n\t}\n}\n"]}
|
|
@@ -241,12 +241,14 @@ var DViewImpl = /** @class */ (function (_super) {
|
|
|
241
241
|
var target = this._toTarget(this._parent);
|
|
242
242
|
if (target) {
|
|
243
243
|
this.stop();
|
|
244
|
+
this.emit("wheeltranslationstart", this._parent, this);
|
|
244
245
|
var speed = deltas.lowest * this._wheelTranslationSpeed;
|
|
245
246
|
var targetPosition = target.position;
|
|
246
247
|
var newX = targetPosition.x - deltas.deltaX * speed;
|
|
247
248
|
var newY = targetPosition.y + deltas.deltaY * speed;
|
|
248
249
|
var targetScale = target.scale;
|
|
249
250
|
this._constraint(target, newX, newY, targetScale.x, targetScale.y);
|
|
251
|
+
this.emit("wheeltranslationend", this._parent, this);
|
|
250
252
|
return true;
|
|
251
253
|
}
|
|
252
254
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-view-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;A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AC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3B,CAAC,CAAC;IAiZH,gBAAC;CAAA,AArZD,CAA+B,KAAK,CAAC,YAAY,GAqZhD;SArZY,SAAS","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, IPoint, Point, Rectangle, utils } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { UtilGestureModifier } from \"./util/util-gesture-modifier\";\nimport { UtilGestureModifiers } from \"./util/util-gesture-modifiers\";\nimport { DThemeView, DView, DViewChecker, DViewOptions } from \"./d-view\";\nimport { DViewGesture } from \"./d-view-gesture\";\nimport { DViewGestureImpl } from \"./d-view-gesture-impl\";\nimport { DViewTargetPoint, DViewToTarget } from \"./d-view-to-target\";\nimport { DViewTransformImpl } from \"./d-view-transform-impl\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isString } from \"./util/is-string\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEventDeltas } from \"./util/util-wheel-event\";\nimport { DViewConstraint } from \"./d-view-constraint\";\n\nexport class DViewImpl extends utils.EventEmitter implements DView {\n\tprotected static CONSTRAINT: DViewConstraint = (target, x, y, scaleX, scaleY): void => {\n\t\ttarget.scale.set(scaleX, scaleY);\n\t\ttarget.position.set(x, y);\n\t};\n\n\tprotected _parent: DBase;\n\tprotected _toTarget: DViewToTarget;\n\tprotected _constraint: DViewConstraint;\n\n\tprotected _zoomPoint: Point;\n\tprotected _zoomMin: number;\n\tprotected _zoomMax: number;\n\tprotected _zoomKeepRatio: boolean;\n\n\tprotected _isWheelZoomEnabled: boolean;\n\tprotected _wheelZoomSpeed: number;\n\tprotected _wheelZoomModifier: UtilGestureModifier;\n\tprotected _wheelZoomChecker: DViewChecker;\n\n\tprotected _isDblClickZoomEnabled: boolean;\n\tprotected _dblClickZoomSpeed: number;\n\tprotected _dblClickZoomModifier: UtilGestureModifier;\n\tprotected _dblClickZoomChecker: DViewChecker;\n\tprotected _dblclickZoomDuration: number;\n\n\tprotected _isWheelTranslationEnabled: boolean;\n\tprotected _wheelTranslationSpeed: number;\n\tprotected _wheelTranslationModifier: UtilGestureModifier;\n\tprotected _wheelTranslationChecker: DViewChecker;\n\n\tprotected _transform: DViewTransformImpl;\n\tprotected _gesture: DViewGestureImpl;\n\n\tprotected _workRect: Rectangle;\n\n\tconstructor(parent: DBase, toTarget: DViewToTarget, options: DViewOptions | undefined) {\n\t\tsuper();\n\t\tthis._parent = parent;\n\t\tthis._toTarget = toTarget;\n\t\tthis._constraint = (options && options.constraint) || DViewImpl.CONSTRAINT;\n\n\t\tthis._workRect = new Rectangle();\n\n\t\t// Theme\n\t\tconst theme = this.toTheme(options) || this.getThemeDefault();\n\n\t\t// Zoom\n\t\tconst zoom = options?.zoom;\n\t\tthis._zoomPoint = new Point();\n\t\tthis._zoomMin = zoom?.min ?? theme.getZoomMin();\n\t\tthis._zoomMax = zoom?.max ?? theme.getZoomMax();\n\t\tthis._zoomKeepRatio = zoom?.keepRatio ?? theme.getZoomKeepRatio();\n\n\t\t// Zoom: Wheel\n\t\tconst wheelZoom = zoom?.wheel;\n\t\tthis._isWheelZoomEnabled = wheelZoom?.enable ?? theme.isWheelZoomEnabled();\n\t\tthis._wheelZoomSpeed = wheelZoom?.speed ?? theme.getWheelZoomSpeed();\n\t\tthis._wheelZoomModifier = toEnum(\n\t\t\twheelZoom?.modifier ?? theme.getWheelZoomModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._wheelZoomChecker = wheelZoom?.checker ?? UtilGestureModifiers.match;\n\n\t\t// Zoom: Dbl click\n\t\tconst dblClickZoom = zoom?.dblclick;\n\t\tthis._isDblClickZoomEnabled = dblClickZoom?.enable ?? theme.isDblClickZoomEnabled();\n\t\tthis._dblClickZoomSpeed = dblClickZoom?.amount ?? theme.getDblClickZoomSpeed();\n\t\tthis._dblClickZoomModifier = toEnum(\n\t\t\tdblClickZoom?.modifier ?? theme.getDblClickZoomModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._dblClickZoomChecker = dblClickZoom?.checker ?? UtilGestureModifiers.match;\n\t\tthis._dblclickZoomDuration = dblClickZoom?.duration ?? theme.getDblClickZoomDuration();\n\n\t\t// Translation: Wheel\n\t\tconst wheelTranslation = options?.translation?.wheel;\n\t\tthis._isWheelTranslationEnabled =\n\t\t\twheelTranslation?.enable ?? theme.isWheelTranslationEnabled();\n\t\tthis._wheelTranslationSpeed = wheelTranslation?.speed ?? theme.getWheelTranslationSpeed();\n\t\tthis._wheelTranslationModifier = toEnum(\n\t\t\twheelTranslation?.modifier ?? theme.getWheelTranslationModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._wheelTranslationChecker = wheelTranslation?.checker ?? UtilGestureModifiers.match;\n\n\t\t// Gesture\n\t\tthis._gesture = new DViewGestureImpl(\n\t\t\tparent,\n\t\t\ttoTarget,\n\t\t\tthis,\n\t\t\tthis._constraint,\n\t\t\ttheme,\n\t\t\toptions?.gesture\n\t\t);\n\n\t\t// Transform\n\t\tthis._transform = new DViewTransformImpl(\n\t\t\tparent,\n\t\t\ttoTarget,\n\t\t\tthis,\n\t\t\tthis._constraint,\n\t\t\tthis._dblclickZoomDuration\n\t\t);\n\n\t\t// Events\n\t\tif (options != null) {\n\t\t\tconst on = options.on;\n\t\t\tif (on != null) {\n\t\t\t\tfor (const name in on) {\n\t\t\t\t\tconst handler = on[name];\n\t\t\t\t\tif (handler) {\n\t\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tget gesture(): DViewGesture {\n\t\treturn this._gesture;\n\t}\n\n\tstop(): void {\n\t\tthis._gesture.stop();\n\t\tthis._transform.stop();\n\t}\n\n\treset(duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tconst target = this._toTarget(parent);\n\t\tif (target) {\n\t\t\tconst targetRect = target.getLocalBounds(this._workRect);\n\t\t\tconst newTargetX = (parent.width - targetRect.width) * 0.5 - targetRect.x;\n\t\t\tconst newTargetY = (parent.height - targetRect.height) * 0.5 - targetRect.y;\n\t\t\tthis._transform.start(target, newTargetX, newTargetY, 1, 1, duration, stop);\n\t\t}\n\t}\n\n\tfit(duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tconst target = this._toTarget(parent) as any;\n\t\tif (target) {\n\t\t\tconst padding = parent.padding;\n\t\t\tconst width = parent.width;\n\t\t\tconst height = parent.height;\n\t\t\tconst targetRect = target.getLocalBounds(this._workRect);\n\t\t\tconst targetX = targetRect.x;\n\t\t\tconst targetY = targetRect.y;\n\t\t\tconst targetWidth = targetRect.width;\n\t\t\tconst targetHeight = targetRect.height;\n\t\t\tlet newTargetScaleX = (width - padding.getLeft() - padding.getRight()) / targetWidth;\n\t\t\tlet newTargetScaleY = (height - padding.getTop() - padding.getBottom()) / targetHeight;\n\t\t\tif (this._zoomKeepRatio) {\n\t\t\t\tconst newTargetScale = this.toNormalizedScale(\n\t\t\t\t\tMath.min(newTargetScaleX, newTargetScaleY)\n\t\t\t\t);\n\t\t\t\tnewTargetScaleX = newTargetScale;\n\t\t\t\tnewTargetScaleY = newTargetScale;\n\t\t\t} else {\n\t\t\t\tnewTargetScaleX = this.toNormalizedScale(newTargetScaleX);\n\t\t\t\tnewTargetScaleY = this.toNormalizedScale(newTargetScaleY);\n\t\t\t}\n\t\t\tconst newTargetWidth = targetWidth * newTargetScaleX;\n\t\t\tconst newTargetHeight = targetHeight * newTargetScaleY;\n\t\t\tconst newTargetX = (width - newTargetWidth) * 0.5 - targetX * newTargetScaleX;\n\t\t\tconst newTargetY = (height - newTargetHeight) * 0.5 - targetY * newTargetScaleY;\n\t\t\tthis._transform.start(\n\t\t\t\ttarget,\n\t\t\t\tnewTargetX,\n\t\t\t\tnewTargetY,\n\t\t\t\tnewTargetScaleX,\n\t\t\t\tnewTargetScaleY,\n\t\t\t\tduration,\n\t\t\t\tstop\n\t\t\t);\n\t\t}\n\t}\n\n\tzoomIn(duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst factor = this._dblClickZoomSpeed;\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis.zoom(targetScale.x * factor, targetScale.y * factor, duration, stop);\n\t\t}\n\t}\n\n\tzoomOut(duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst factor = 1 / this._dblClickZoomSpeed;\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis.zoom(targetScale.x * factor, targetScale.y * factor, duration, stop);\n\t\t}\n\t}\n\n\tzoomAt(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\t// Scale\n\t\t\tconst oldScaleX = target.scale.x;\n\t\t\tconst oldScaleY = target.scale.y;\n\t\t\tconst newScaleX = this.toNormalizedScale(scaleX);\n\t\t\tconst newScaleY = this.toNormalizedScale(scaleY);\n\t\t\tconst scaleRatioX = newScaleX / oldScaleX;\n\t\t\tconst scaleRatioY = newScaleY / oldScaleY;\n\n\t\t\t// Position\n\t\t\tconst newX = (target.position.x - x) * scaleRatioX + x;\n\t\t\tconst newY = (target.position.y - y) * scaleRatioY + y;\n\n\t\t\t// Start\n\t\t\tthis._transform.start(target, newX, newY, newScaleX, newScaleY, duration, stop);\n\t\t}\n\t}\n\n\tzoomAtGlobal(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst local = this._zoomPoint;\n\t\tlocal.set(x, y);\n\t\tthis.toLocal(local, local);\n\t\tthis.zoomAt(local.x, local.y, scaleX, scaleY, duration, stop);\n\t}\n\n\tzoom(scaleX: number, scaleY: number, duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tthis.zoomAt(parent.width * 0.5, parent.height * 0.5, scaleX, scaleY, duration, stop);\n\t}\n\n\tget scale(): DViewTargetPoint {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\treturn target.scale;\n\t\t}\n\t\treturn new Point(1, 1);\n\t}\n\n\tset scale(scale: DViewTargetPoint) {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst newScaleX = this.toNormalizedScale(scale.x);\n\t\t\tconst newScaleY = this.toNormalizedScale(scale.y);\n\t\t\tconst targetPosition = target.position;\n\t\t\tthis._constraint(target, targetPosition.x, targetPosition.y, newScaleX, newScaleY);\n\t\t}\n\t}\n\n\tmoveTo(x: number, y: number, duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis._transform.start(target, x, y, targetScale.x, targetScale.y, duration, stop);\n\t\t}\n\t}\n\n\tget position(): DViewTargetPoint {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\treturn target.position;\n\t\t}\n\t\treturn new Point(0, 0);\n\t}\n\n\tset position(position: DViewTargetPoint) {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis._constraint(target, position.x, position.y, targetScale.x, targetScale.y);\n\t\t}\n\t}\n\n\ttransform(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tthis._transform.start(target, x, y, scaleX, scaleY, duration, stop);\n\t\t}\n\t}\n\n\ttoLocal(global: IPoint, local: IPoint, skipUpdate?: boolean): IPoint {\n\t\treturn this._parent.toLocal(global, undefined, local, skipUpdate);\n\t}\n\n\ttoGlobal(local: IPoint, global: IPoint, skipUpdate?: boolean): IPoint {\n\t\treturn this._parent.toGlobal(local, global, skipUpdate);\n\t}\n\n\ttoNormalizedScale(scale: number): number {\n\t\treturn Math.min(this._zoomMax, Math.max(this._zoomMin, scale));\n\t}\n\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean {\n\t\tif (\n\t\t\tthis._isWheelZoomEnabled &&\n\t\t\tthis._wheelZoomChecker(e, this._wheelZoomModifier, this._parent)\n\t\t) {\n\t\t\tif (deltas.deltaY !== 0) {\n\t\t\t\tconst target = this._toTarget(this._parent);\n\t\t\t\tif (target) {\n\t\t\t\t\tconst speed = deltas.lowest * this._wheelZoomSpeed;\n\t\t\t\t\tconst factor = 1 + deltas.deltaY * speed;\n\t\t\t\t\tconst targetScale = target.scale;\n\t\t\t\t\tthis.zoomAtGlobal(\n\t\t\t\t\t\tglobal.x,\n\t\t\t\t\t\tglobal.y,\n\t\t\t\t\t\ttargetScale.x * factor,\n\t\t\t\t\t\ttargetScale.y * factor,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tthis._isWheelTranslationEnabled &&\n\t\t\tthis._wheelTranslationChecker(e, this._wheelTranslationModifier, this._parent)\n\t\t) {\n\t\t\tconst target = this._toTarget(this._parent);\n\t\t\tif (target) {\n\t\t\t\tthis.stop();\n\t\t\t\tconst speed = deltas.lowest * this._wheelTranslationSpeed;\n\t\t\t\tconst targetPosition = target.position;\n\t\t\t\tconst newX = targetPosition.x - deltas.deltaX * speed;\n\t\t\t\tconst newY = targetPosition.y + deltas.deltaY * speed;\n\t\t\t\tconst targetScale = target.scale;\n\t\t\t\tthis._constraint(target, newX, newY, targetScale.x, targetScale.y);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tonDown(e: interaction.InteractionEvent): void {\n\t\tthis._gesture.onDown(e);\n\t}\n\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean {\n\t\tif (\n\t\t\tthis._isDblClickZoomEnabled &&\n\t\t\tthis._dblClickZoomChecker(e, this._dblClickZoomModifier, this._parent)\n\t\t) {\n\t\t\tconst target = this._toTarget(this._parent);\n\t\t\tif (target) {\n\t\t\t\tconst global = this._zoomPoint;\n\t\t\t\tUtilPointerEvent.toGlobal(e, interactionManager, global);\n\t\t\t\tconst factor = this._dblClickZoomSpeed;\n\t\t\t\tconst targetScale = target.scale;\n\t\t\t\tthis.zoomAtGlobal(\n\t\t\t\t\tglobal.x,\n\t\t\t\t\tglobal.y,\n\t\t\t\t\ttargetScale.x * factor,\n\t\t\t\t\ttargetScale.y * factor,\n\t\t\t\t\tthis._dblclickZoomDuration\n\t\t\t\t);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected toTheme(options?: DViewOptions): DThemeView | null {\n\t\tif (options && options.theme) {\n\t\t\tconst theme = options.theme;\n\t\t\tif (isString(theme)) {\n\t\t\t\treturn DThemes.getInstance().get(theme);\n\t\t\t} else {\n\t\t\t\treturn theme;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected getThemeDefault(): DThemeView {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DView\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-view-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAuB,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,EAAE,gBAA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AAC;IAC3B,CAAC,CAAC;IAmZH,gBAAC;CAAA,AAvZD,CAA+B,KAAK,CAAC,YAAY,GAuZhD;SAvZY,SAAS","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction, IPoint, Point, Rectangle, utils } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { UtilGestureModifier } from \"./util/util-gesture-modifier\";\nimport { UtilGestureModifiers } from \"./util/util-gesture-modifiers\";\nimport { DThemeView, DView, DViewChecker, DViewOptions } from \"./d-view\";\nimport { DViewGesture } from \"./d-view-gesture\";\nimport { DViewGestureImpl } from \"./d-view-gesture-impl\";\nimport { DViewTargetPoint, DViewToTarget } from \"./d-view-to-target\";\nimport { DViewTransformImpl } from \"./d-view-transform-impl\";\nimport { DThemes } from \"./theme/d-themes\";\nimport { isString } from \"./util/is-string\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\nimport { UtilWheelEventDeltas } from \"./util/util-wheel-event\";\nimport { DViewConstraint } from \"./d-view-constraint\";\n\nexport class DViewImpl extends utils.EventEmitter implements DView {\n\tprotected static CONSTRAINT: DViewConstraint = (target, x, y, scaleX, scaleY): void => {\n\t\ttarget.scale.set(scaleX, scaleY);\n\t\ttarget.position.set(x, y);\n\t};\n\n\tprotected _parent: DBase;\n\tprotected _toTarget: DViewToTarget;\n\tprotected _constraint: DViewConstraint;\n\n\tprotected _zoomPoint: Point;\n\tprotected _zoomMin: number;\n\tprotected _zoomMax: number;\n\tprotected _zoomKeepRatio: boolean;\n\n\tprotected _isWheelZoomEnabled: boolean;\n\tprotected _wheelZoomSpeed: number;\n\tprotected _wheelZoomModifier: UtilGestureModifier;\n\tprotected _wheelZoomChecker: DViewChecker;\n\n\tprotected _isDblClickZoomEnabled: boolean;\n\tprotected _dblClickZoomSpeed: number;\n\tprotected _dblClickZoomModifier: UtilGestureModifier;\n\tprotected _dblClickZoomChecker: DViewChecker;\n\tprotected _dblclickZoomDuration: number;\n\n\tprotected _isWheelTranslationEnabled: boolean;\n\tprotected _wheelTranslationSpeed: number;\n\tprotected _wheelTranslationModifier: UtilGestureModifier;\n\tprotected _wheelTranslationChecker: DViewChecker;\n\n\tprotected _transform: DViewTransformImpl;\n\tprotected _gesture: DViewGestureImpl;\n\n\tprotected _workRect: Rectangle;\n\n\tconstructor(parent: DBase, toTarget: DViewToTarget, options: DViewOptions | undefined) {\n\t\tsuper();\n\t\tthis._parent = parent;\n\t\tthis._toTarget = toTarget;\n\t\tthis._constraint = (options && options.constraint) || DViewImpl.CONSTRAINT;\n\n\t\tthis._workRect = new Rectangle();\n\n\t\t// Theme\n\t\tconst theme = this.toTheme(options) || this.getThemeDefault();\n\n\t\t// Zoom\n\t\tconst zoom = options?.zoom;\n\t\tthis._zoomPoint = new Point();\n\t\tthis._zoomMin = zoom?.min ?? theme.getZoomMin();\n\t\tthis._zoomMax = zoom?.max ?? theme.getZoomMax();\n\t\tthis._zoomKeepRatio = zoom?.keepRatio ?? theme.getZoomKeepRatio();\n\n\t\t// Zoom: Wheel\n\t\tconst wheelZoom = zoom?.wheel;\n\t\tthis._isWheelZoomEnabled = wheelZoom?.enable ?? theme.isWheelZoomEnabled();\n\t\tthis._wheelZoomSpeed = wheelZoom?.speed ?? theme.getWheelZoomSpeed();\n\t\tthis._wheelZoomModifier = toEnum(\n\t\t\twheelZoom?.modifier ?? theme.getWheelZoomModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._wheelZoomChecker = wheelZoom?.checker ?? UtilGestureModifiers.match;\n\n\t\t// Zoom: Dbl click\n\t\tconst dblClickZoom = zoom?.dblclick;\n\t\tthis._isDblClickZoomEnabled = dblClickZoom?.enable ?? theme.isDblClickZoomEnabled();\n\t\tthis._dblClickZoomSpeed = dblClickZoom?.amount ?? theme.getDblClickZoomSpeed();\n\t\tthis._dblClickZoomModifier = toEnum(\n\t\t\tdblClickZoom?.modifier ?? theme.getDblClickZoomModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._dblClickZoomChecker = dblClickZoom?.checker ?? UtilGestureModifiers.match;\n\t\tthis._dblclickZoomDuration = dblClickZoom?.duration ?? theme.getDblClickZoomDuration();\n\n\t\t// Translation: Wheel\n\t\tconst wheelTranslation = options?.translation?.wheel;\n\t\tthis._isWheelTranslationEnabled =\n\t\t\twheelTranslation?.enable ?? theme.isWheelTranslationEnabled();\n\t\tthis._wheelTranslationSpeed = wheelTranslation?.speed ?? theme.getWheelTranslationSpeed();\n\t\tthis._wheelTranslationModifier = toEnum(\n\t\t\twheelTranslation?.modifier ?? theme.getWheelTranslationModifier(),\n\t\t\tUtilGestureModifier\n\t\t);\n\t\tthis._wheelTranslationChecker = wheelTranslation?.checker ?? UtilGestureModifiers.match;\n\n\t\t// Gesture\n\t\tthis._gesture = new DViewGestureImpl(\n\t\t\tparent,\n\t\t\ttoTarget,\n\t\t\tthis,\n\t\t\tthis._constraint,\n\t\t\ttheme,\n\t\t\toptions?.gesture\n\t\t);\n\n\t\t// Transform\n\t\tthis._transform = new DViewTransformImpl(\n\t\t\tparent,\n\t\t\ttoTarget,\n\t\t\tthis,\n\t\t\tthis._constraint,\n\t\t\tthis._dblclickZoomDuration\n\t\t);\n\n\t\t// Events\n\t\tif (options != null) {\n\t\t\tconst on = options.on;\n\t\t\tif (on != null) {\n\t\t\t\tfor (const name in on) {\n\t\t\t\t\tconst handler = on[name];\n\t\t\t\t\tif (handler) {\n\t\t\t\t\t\tthis.on(name, handler);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tget gesture(): DViewGesture {\n\t\treturn this._gesture;\n\t}\n\n\tstop(): void {\n\t\tthis._gesture.stop();\n\t\tthis._transform.stop();\n\t}\n\n\treset(duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tconst target = this._toTarget(parent);\n\t\tif (target) {\n\t\t\tconst targetRect = target.getLocalBounds(this._workRect);\n\t\t\tconst newTargetX = (parent.width - targetRect.width) * 0.5 - targetRect.x;\n\t\t\tconst newTargetY = (parent.height - targetRect.height) * 0.5 - targetRect.y;\n\t\t\tthis._transform.start(target, newTargetX, newTargetY, 1, 1, duration, stop);\n\t\t}\n\t}\n\n\tfit(duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tconst target = this._toTarget(parent) as any;\n\t\tif (target) {\n\t\t\tconst padding = parent.padding;\n\t\t\tconst width = parent.width;\n\t\t\tconst height = parent.height;\n\t\t\tconst targetRect = target.getLocalBounds(this._workRect);\n\t\t\tconst targetX = targetRect.x;\n\t\t\tconst targetY = targetRect.y;\n\t\t\tconst targetWidth = targetRect.width;\n\t\t\tconst targetHeight = targetRect.height;\n\t\t\tlet newTargetScaleX = (width - padding.getLeft() - padding.getRight()) / targetWidth;\n\t\t\tlet newTargetScaleY = (height - padding.getTop() - padding.getBottom()) / targetHeight;\n\t\t\tif (this._zoomKeepRatio) {\n\t\t\t\tconst newTargetScale = this.toNormalizedScale(\n\t\t\t\t\tMath.min(newTargetScaleX, newTargetScaleY)\n\t\t\t\t);\n\t\t\t\tnewTargetScaleX = newTargetScale;\n\t\t\t\tnewTargetScaleY = newTargetScale;\n\t\t\t} else {\n\t\t\t\tnewTargetScaleX = this.toNormalizedScale(newTargetScaleX);\n\t\t\t\tnewTargetScaleY = this.toNormalizedScale(newTargetScaleY);\n\t\t\t}\n\t\t\tconst newTargetWidth = targetWidth * newTargetScaleX;\n\t\t\tconst newTargetHeight = targetHeight * newTargetScaleY;\n\t\t\tconst newTargetX = (width - newTargetWidth) * 0.5 - targetX * newTargetScaleX;\n\t\t\tconst newTargetY = (height - newTargetHeight) * 0.5 - targetY * newTargetScaleY;\n\t\t\tthis._transform.start(\n\t\t\t\ttarget,\n\t\t\t\tnewTargetX,\n\t\t\t\tnewTargetY,\n\t\t\t\tnewTargetScaleX,\n\t\t\t\tnewTargetScaleY,\n\t\t\t\tduration,\n\t\t\t\tstop\n\t\t\t);\n\t\t}\n\t}\n\n\tzoomIn(duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst factor = this._dblClickZoomSpeed;\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis.zoom(targetScale.x * factor, targetScale.y * factor, duration, stop);\n\t\t}\n\t}\n\n\tzoomOut(duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst factor = 1 / this._dblClickZoomSpeed;\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis.zoom(targetScale.x * factor, targetScale.y * factor, duration, stop);\n\t\t}\n\t}\n\n\tzoomAt(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\t// Scale\n\t\t\tconst oldScaleX = target.scale.x;\n\t\t\tconst oldScaleY = target.scale.y;\n\t\t\tconst newScaleX = this.toNormalizedScale(scaleX);\n\t\t\tconst newScaleY = this.toNormalizedScale(scaleY);\n\t\t\tconst scaleRatioX = newScaleX / oldScaleX;\n\t\t\tconst scaleRatioY = newScaleY / oldScaleY;\n\n\t\t\t// Position\n\t\t\tconst newX = (target.position.x - x) * scaleRatioX + x;\n\t\t\tconst newY = (target.position.y - y) * scaleRatioY + y;\n\n\t\t\t// Start\n\t\t\tthis._transform.start(target, newX, newY, newScaleX, newScaleY, duration, stop);\n\t\t}\n\t}\n\n\tzoomAtGlobal(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst local = this._zoomPoint;\n\t\tlocal.set(x, y);\n\t\tthis.toLocal(local, local);\n\t\tthis.zoomAt(local.x, local.y, scaleX, scaleY, duration, stop);\n\t}\n\n\tzoom(scaleX: number, scaleY: number, duration?: number, stop?: boolean): void {\n\t\tconst parent = this._parent;\n\t\tthis.zoomAt(parent.width * 0.5, parent.height * 0.5, scaleX, scaleY, duration, stop);\n\t}\n\n\tget scale(): DViewTargetPoint {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\treturn target.scale;\n\t\t}\n\t\treturn new Point(1, 1);\n\t}\n\n\tset scale(scale: DViewTargetPoint) {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst newScaleX = this.toNormalizedScale(scale.x);\n\t\t\tconst newScaleY = this.toNormalizedScale(scale.y);\n\t\t\tconst targetPosition = target.position;\n\t\t\tthis._constraint(target, targetPosition.x, targetPosition.y, newScaleX, newScaleY);\n\t\t}\n\t}\n\n\tmoveTo(x: number, y: number, duration?: number, stop?: boolean): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis._transform.start(target, x, y, targetScale.x, targetScale.y, duration, stop);\n\t\t}\n\t}\n\n\tget position(): DViewTargetPoint {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\treturn target.position;\n\t\t}\n\t\treturn new Point(0, 0);\n\t}\n\n\tset position(position: DViewTargetPoint) {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tconst targetScale = target.scale;\n\t\t\tthis._constraint(target, position.x, position.y, targetScale.x, targetScale.y);\n\t\t}\n\t}\n\n\ttransform(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst target = this._toTarget(this._parent);\n\t\tif (target) {\n\t\t\tthis._transform.start(target, x, y, scaleX, scaleY, duration, stop);\n\t\t}\n\t}\n\n\ttoLocal(global: IPoint, local: IPoint, skipUpdate?: boolean): IPoint {\n\t\treturn this._parent.toLocal(global, undefined, local, skipUpdate);\n\t}\n\n\ttoGlobal(local: IPoint, global: IPoint, skipUpdate?: boolean): IPoint {\n\t\treturn this._parent.toGlobal(local, global, skipUpdate);\n\t}\n\n\ttoNormalizedScale(scale: number): number {\n\t\treturn Math.min(this._zoomMax, Math.max(this._zoomMin, scale));\n\t}\n\n\tonWheel(e: WheelEvent, deltas: UtilWheelEventDeltas, global: Point): boolean {\n\t\tif (\n\t\t\tthis._isWheelZoomEnabled &&\n\t\t\tthis._wheelZoomChecker(e, this._wheelZoomModifier, this._parent)\n\t\t) {\n\t\t\tif (deltas.deltaY !== 0) {\n\t\t\t\tconst target = this._toTarget(this._parent);\n\t\t\t\tif (target) {\n\t\t\t\t\tconst speed = deltas.lowest * this._wheelZoomSpeed;\n\t\t\t\t\tconst factor = 1 + deltas.deltaY * speed;\n\t\t\t\t\tconst targetScale = target.scale;\n\t\t\t\t\tthis.zoomAtGlobal(\n\t\t\t\t\t\tglobal.x,\n\t\t\t\t\t\tglobal.y,\n\t\t\t\t\t\ttargetScale.x * factor,\n\t\t\t\t\t\ttargetScale.y * factor,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tthis._isWheelTranslationEnabled &&\n\t\t\tthis._wheelTranslationChecker(e, this._wheelTranslationModifier, this._parent)\n\t\t) {\n\t\t\tconst target = this._toTarget(this._parent);\n\t\t\tif (target) {\n\t\t\t\tthis.stop();\n\t\t\t\tthis.emit(\"wheeltranslationstart\", this._parent, this);\n\t\t\t\tconst speed = deltas.lowest * this._wheelTranslationSpeed;\n\t\t\t\tconst targetPosition = target.position;\n\t\t\t\tconst newX = targetPosition.x - deltas.deltaX * speed;\n\t\t\t\tconst newY = targetPosition.y + deltas.deltaY * speed;\n\t\t\t\tconst targetScale = target.scale;\n\t\t\t\tthis._constraint(target, newX, newY, targetScale.x, targetScale.y);\n\t\t\t\tthis.emit(\"wheeltranslationend\", this._parent, this);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tonDown(e: interaction.InteractionEvent): void {\n\t\tthis._gesture.onDown(e);\n\t}\n\n\tonDblClick(\n\t\te: MouseEvent | TouchEvent,\n\t\tinteractionManager: interaction.InteractionManager\n\t): boolean {\n\t\tif (\n\t\t\tthis._isDblClickZoomEnabled &&\n\t\t\tthis._dblClickZoomChecker(e, this._dblClickZoomModifier, this._parent)\n\t\t) {\n\t\t\tconst target = this._toTarget(this._parent);\n\t\t\tif (target) {\n\t\t\t\tconst global = this._zoomPoint;\n\t\t\t\tUtilPointerEvent.toGlobal(e, interactionManager, global);\n\t\t\t\tconst factor = this._dblClickZoomSpeed;\n\t\t\t\tconst targetScale = target.scale;\n\t\t\t\tthis.zoomAtGlobal(\n\t\t\t\t\tglobal.x,\n\t\t\t\t\tglobal.y,\n\t\t\t\t\ttargetScale.x * factor,\n\t\t\t\t\ttargetScale.y * factor,\n\t\t\t\t\tthis._dblclickZoomDuration\n\t\t\t\t);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprotected toTheme(options?: DViewOptions): DThemeView | null {\n\t\tif (options && options.theme) {\n\t\t\tconst theme = options.theme;\n\t\t\tif (isString(theme)) {\n\t\t\t\treturn DThemes.getInstance().get(theme);\n\t\t\t} else {\n\t\t\t\treturn theme;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected getThemeDefault(): DThemeView {\n\t\treturn DThemes.getInstance().get(this.getType());\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DView\";\n\t}\n}\n"]}
|
|
@@ -38,7 +38,7 @@ var DViewTransformImpl = /** @class */ (function () {
|
|
|
38
38
|
}
|
|
39
39
|
DViewTransformImpl.prototype.onStart = function () {
|
|
40
40
|
var parent = this._parent;
|
|
41
|
-
parent.emit("
|
|
41
|
+
parent.emit("transformstart", this._owner, parent);
|
|
42
42
|
};
|
|
43
43
|
DViewTransformImpl.prototype.onTime = function (time) {
|
|
44
44
|
var w0 = 1 - time;
|
|
@@ -54,11 +54,11 @@ var DViewTransformImpl = /** @class */ (function () {
|
|
|
54
54
|
};
|
|
55
55
|
DViewTransformImpl.prototype.onEnd = function () {
|
|
56
56
|
var parent = this._parent;
|
|
57
|
-
parent.emit("
|
|
57
|
+
parent.emit("transformend", this._owner, parent);
|
|
58
58
|
};
|
|
59
59
|
DViewTransformImpl.prototype.onStop = function () {
|
|
60
60
|
var parent = this._parent;
|
|
61
|
-
parent.emit("
|
|
61
|
+
parent.emit("transformstop", this._owner, parent);
|
|
62
62
|
};
|
|
63
63
|
DViewTransformImpl.prototype.start = function (target, x, y, scaleX, scaleY, duration, stop) {
|
|
64
64
|
var parent = this._parent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-view-transform-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-transform-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD;IAiBC,4BACC,KAAY,EACZ,QAAuB,EACvB,MAAmB,EACnB,UAA2B,EAC3B,QAAgB;QALjB,iBAoCC;QA7BA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,cAAc,CAAC;YACpC,OAAO,EAAE;gBACR,KAAI,CAAC,OAAO,EAAE,CAAC;YAChB,CAAC;YACD,MAAM,EAAE,UAAC,IAAY;gBACpB,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;YACD,KAAK,EAAE;gBACN,KAAI,CAAC,KAAK,EAAE,CAAC;YACd,CAAC;YACD,MAAM,EAAE;gBACP,KAAI,CAAC,MAAM,EAAE,CAAC;YACf,CAAC;YACD,QAAQ,UAAA;SACR,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,oCAAO,GAAjB;QACC,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"d-view-transform-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-transform-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOpD;IAiBC,4BACC,KAAY,EACZ,QAAuB,EACvB,MAAmB,EACnB,UAA2B,EAC3B,QAAgB;QALjB,iBAoCC;QA7BA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG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,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC;YAE1B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;YACzB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;YAEzB,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACpC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;SACxB;IACF,CAAC;IAED,iCAAI,GAAJ;QACC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IACF,yBAAC;AAAD,CAAC,AA9HD,IA8HC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DAnimation } from \"./d-animation\";\nimport { DAnimationBase } from \"./d-animation-base\";\nimport { DBase } from \"./d-base\";\nimport { DViewConstraint } from \"./d-view-constraint\";\nimport { DViewParent } from \"./d-view-parent\";\nimport { DViewTarget, DViewToTarget } from \"./d-view-to-target\";\nimport { DViewTransform } from \"./d-view-transform\";\n\nexport class DViewTransformImpl implements DViewTransform {\n\tprotected _owner: DBase;\n\tprotected _toTarget: DViewToTarget;\n\tprotected _constraint: DViewConstraint;\n\tprotected _newX: number;\n\tprotected _newY: number;\n\tprotected _newScaleX: number;\n\tprotected _newScaleY: number;\n\tprotected _oldX: number;\n\tprotected _oldY: number;\n\tprotected _oldScaleX: number;\n\tprotected _oldScaleY: number;\n\tprotected _animation: DAnimation;\n\tprotected _parent: DViewParent;\n\tprotected _duration: number;\n\tprotected _isStarted: boolean;\n\n\tconstructor(\n\t\towner: DBase,\n\t\ttoTarget: DViewToTarget,\n\t\tparent: DViewParent,\n\t\tconstraint: DViewConstraint,\n\t\tduration: number\n\t) {\n\t\tthis._owner = owner;\n\t\tthis._toTarget = toTarget;\n\t\tthis._constraint = constraint;\n\t\tthis._newScaleX = 1;\n\t\tthis._newScaleY = 1;\n\t\tthis._newX = 0;\n\t\tthis._newY = 0;\n\t\tthis._oldScaleX = 1;\n\t\tthis._oldScaleY = 1;\n\t\tthis._oldX = 0;\n\t\tthis._oldY = 0;\n\t\tthis._isStarted = false;\n\t\tthis._animation = new DAnimationBase({\n\t\t\tonStart: () => {\n\t\t\t\tthis.onStart();\n\t\t\t},\n\t\t\tonTime: (time: number): void => {\n\t\t\t\tthis.onTime(time);\n\t\t\t},\n\t\t\tonEnd: () => {\n\t\t\t\tthis.onEnd();\n\t\t\t},\n\t\t\tonStop: () => {\n\t\t\t\tthis.onStop();\n\t\t\t},\n\t\t\tduration\n\t\t});\n\t\tthis._parent = parent;\n\t\tthis._duration = duration;\n\t}\n\n\tprotected onStart(): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"transformstart\", this._owner, parent);\n\t}\n\n\tprotected onTime(time: number): void {\n\t\tconst w0 = 1 - time;\n\t\tconst w1 = time;\n\n\t\tconst scaleX = this._oldScaleX * w0 + this._newScaleX * w1;\n\t\tconst scaleY = this._oldScaleY * w0 + this._newScaleY * w1;\n\t\tconst x = this._oldX * w0 + this._newX * w1;\n\t\tconst y = this._oldY * w0 + this._newY * w1;\n\n\t\tconst target = this._toTarget(this._owner);\n\t\tif (target != null) {\n\t\t\tthis._constraint(target, x, y, scaleX, scaleY);\n\t\t}\n\t}\n\n\tprotected onEnd(): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"transformend\", this._owner, parent);\n\t}\n\n\tprotected onStop(): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"transformstop\", this._owner, parent);\n\t}\n\n\tstart(\n\t\ttarget: DViewTarget,\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void {\n\t\tconst parent = this._parent;\n\t\tif (stop !== false) {\n\t\t\tparent.stop();\n\t\t}\n\t\tif (duration == null) {\n\t\t\tduration = this._duration;\n\t\t}\n\t\tif (duration <= 0) {\n\t\t\tthis.onStart();\n\t\t\tthis._constraint(target, x, y, scaleX, scaleY);\n\t\t\tthis.onEnd();\n\t\t} else {\n\t\t\tconst position = target.position;\n\t\t\tconst scale = target.scale;\n\t\t\tthis._oldX = position.x;\n\t\t\tthis._oldY = position.y;\n\t\t\tthis._oldScaleX = scale.x;\n\t\t\tthis._oldScaleY = scale.y;\n\n\t\t\tthis._newX = x;\n\t\t\tthis._newY = y;\n\t\t\tthis._newScaleX = scaleX;\n\t\t\tthis._newScaleY = scaleY;\n\n\t\t\tthis._animation.duration = duration;\n\t\t\tthis._animation.start();\n\t\t}\n\t}\n\n\tstop(): void {\n\t\tthis._animation.stop();\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-view.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { UtilGestureModifier } from \"./util/util-gesture-modifier\";\nimport { DThemeViewGesture, DViewGesture, DViewGestureOptions } from \"./d-view-gesture\";\nimport { DViewTargetPoint } from \"./d-view-to-target\";\nimport { DViewConstraint } from \"./d-view-constraint\";\nimport { DOnOptions } from \"./d-on-options\";\
|
|
1
|
+
{"version":3,"file":"d-view.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { IPoint } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport { UtilGestureModifier } from \"./util/util-gesture-modifier\";\nimport { DThemeViewGesture, DViewGesture, DViewGestureOptions } from \"./d-view-gesture\";\nimport { DViewTargetPoint } from \"./d-view-to-target\";\nimport { DViewConstraint } from \"./d-view-constraint\";\nimport { DOnOptions } from \"./d-on-options\";\n\nexport type DViewChecker = (\n\te: WheelEvent | MouseEvent | TouchEvent,\n\tmodifier: UtilGestureModifier,\n\ttarget: DBase\n) => boolean;\n\n/**\n * {@link DView} wheel zoom options.\n */\nexport interface DViewZoomWheelOptions {\n\t/** True to enable wheel zoom */\n\tenable?: boolean;\n\n\t/** Zoom speed */\n\tspeed?: number;\n\n\t/** Mouse modifiers */\n\tmodifier?: keyof typeof UtilGestureModifier | UtilGestureModifier;\n\n\t/**\n\t * Wheel zoom checker.\n\t * If a checker returns false, wheel zooms will be canceled.\n\t */\n\tchecker?: DViewChecker;\n}\n\n/**\n * {@link DView} double-click zoom options.\n */\nexport interface DViewZoomDblClickOptions {\n\t/** True to enable double click zoom */\n\tenable?: boolean;\n\n\t/** Zoom amount */\n\tamount?: number;\n\n\t/** Mouse modifiers */\n\tmodifier?: keyof typeof UtilGestureModifier | UtilGestureModifier;\n\n\t/**\n\t * Double click zoom checker.\n\t * If a checker returns false, double click zooms will be canceled.\n\t */\n\tchecker?: DViewChecker;\n\n\t/** Zoom duration */\n\tduration?: number;\n}\n\n/**\n * {@link DView} zoom options.\n */\nexport interface DViewZoomOptions {\n\t/** Minimum scale */\n\tmin?: number;\n\n\t/** Maximum scale */\n\tmax?: number;\n\n\t/** True to keep size ratio */\n\tkeepRatio?: boolean;\n\n\t/** Wheel zoom options */\n\twheel?: DViewZoomWheelOptions;\n\n\t/** Double click zoom options */\n\tdblclick?: DViewZoomDblClickOptions;\n}\n\n/**\n * {@link DView} wheel translation options.\n */\nexport interface DViewTranslationWheelOptions {\n\t/** True to enable wheel translation */\n\tenable?: boolean;\n\n\t/** Translation speed */\n\tspeed?: number;\n\n\t/** Mouse modifiers */\n\tmodifier?: keyof typeof UtilGestureModifier | UtilGestureModifier;\n\n\t/**\n\t * Wheel translation checker.\n\t * If a checker returns false, wheel translations will be canceled.\n\t */\n\tchecker?: DViewChecker;\n}\n\n/**\n * {@link DView} translation options.\n */\nexport interface DViewTranslationOptions {\n\t/** Wheel translation options */\n\twheel?: DViewTranslationWheelOptions;\n}\n\n/**\n * {@link DView} events.\n */\nexport interface DViewEvents<EMITTER> {\n\t/**\n\t * Triggered when a gesture starts.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\tgesturestart(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a gesture ends.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\tgestureend(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a gesture stops.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\tgesturestop(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a transform starts.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\ttransformstart(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a transform ends.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\ttransformend(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a transform stops.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\ttransformstop(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a wheel translation starts.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\twheeltranslationstart(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a wheel translation ends.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\twheeltranslationend(target: DBase, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a wheel translation stops.\n\t *\n\t * @param target an operation target\n\t * @param emitter an emitter\n\t */\n\twheeltranslationstop(target: DBase, emitter: EMITTER): void;\n}\n\n/**\n * {@link DView} \"on\" options.\n */\nexport interface DViewOnOptions<EMITTER> extends Partial<DViewEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DView} options.\n */\nexport interface DViewOptions {\n\t/** Gesture options */\n\tgesture?: DViewGestureOptions;\n\n\t/** Zoom options */\n\tzoom?: DViewZoomOptions;\n\n\t/** Translation options */\n\ttranslation?: DViewTranslationOptions;\n\n\t/** Constraint options */\n\tconstraint?: DViewConstraint;\n\n\t/** Theme */\n\ttheme?: DThemeView | string;\n\n\t/** On options */\n\ton?: DViewOnOptions<DView>;\n}\n\n/**\n * {@link DView} theme.\n */\nexport interface DThemeView extends DThemeViewGesture {\n\tisWheelZoomEnabled(): boolean;\n\tisDblClickZoomEnabled(): boolean;\n\tisWheelTranslationEnabled(): boolean;\n\tgetWheelZoomSpeed(): number;\n\tgetWheelZoomModifier(): UtilGestureModifier;\n\tgetDblClickZoomSpeed(): number;\n\tgetDblClickZoomModifier(): UtilGestureModifier;\n\tgetDblClickZoomDuration(): number;\n\tgetWheelTranslationSpeed(): number;\n\tgetWheelTranslationModifier(): UtilGestureModifier;\n\tgetZoomMin(): number;\n\tgetZoomMax(): number;\n\tgetZoomKeepRatio(): boolean;\n}\n\nexport interface DView {\n\treadonly gesture: DViewGesture;\n\tscale: DViewTargetPoint;\n\tposition: DViewTargetPoint;\n\n\t/**\n\t * Stops an animation if exits.\n\t */\n\tstop(): void;\n\n\t/**\n\t * Resets a position and a scale.\n\t *\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\treset(duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Fits into a screen.\n\t *\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tfit(duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Zooms in at the current position.\n\t *\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tzoomIn(duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Zooms out at the current position.\n\t *\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tzoomOut(duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Zooms into the given position.\n\t *\n\t * @param x a local X coordinate position\n\t * @param y a local Y coordinate position\n\t * @param scaleX a X coordinate scale\n\t * @param scaleY a Y coordinate scale\n\t * @param duration an duration\n\t * @param stop false to keep a previous animation\n\t */\n\tzoomAt(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void;\n\n\t/**\n\t * Zooms into the specified global position.\n\t *\n\t * @param x a global X coordinate position\n\t * @param y a global Y coordinate position\n\t * @param scaleX a X coordinate scale\n\t * @param scaleY a Y coordinate scale\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tzoomAtGlobal(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void;\n\n\t/**\n\t * Zooms in / out at the current position.\n\t *\n\t * @param scaleX a X coordinate scale\n\t * @param scaleY a Y coordinate scale\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tzoom(scaleX: number, scaleY: number, duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Moves to the given position.\n\t *\n\t * @param x a local X coordinate position\n\t * @param y a local Y coordinate position\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\tmoveTo(x: number, y: number, duration?: number, stop?: boolean): void;\n\n\t/**\n\t * Sets to the specified position and scale.\n\t *\n\t * @param x a local X coordinate position\n\t * @param y a local Y coordinate position\n\t * @param scaleX a X coordinate scale\n\t * @param scaleY a Y coordinate scale\n\t * @param duration an animation duration\n\t * @param stop false to keep a previous animation\n\t */\n\ttransform(\n\t\tx: number,\n\t\ty: number,\n\t\tscaleX: number,\n\t\tscaleY: number,\n\t\tduration?: number,\n\t\tstop?: boolean\n\t): void;\n\n\ttoLocal(global: IPoint, local: IPoint, skipUpdate?: boolean): IPoint;\n\ttoGlobal(local: IPoint, global: IPoint, skipUpdate?: boolean): IPoint;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-action-open-opener.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-open-opener.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"../e-shape\";\n\nexport type EShapeActionOpenOpener = (target:
|
|
1
|
+
{"version":3,"file":"e-shape-action-open-opener.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-open-opener.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EShape } from \"../e-shape\";\n\nexport type EShapeActionOpenOpener = (target: unknown, inNewWindow: boolean, shape: EShape) => void;\n"]}
|
|
@@ -13,7 +13,7 @@ var EShapeActionRuntimeOpen = /** @class */ (function (_super) {
|
|
|
13
13
|
function EShapeActionRuntimeOpen(value, subtype) {
|
|
14
14
|
var _this = _super.call(this, value, EShapeRuntimeReset.NONE) || this;
|
|
15
15
|
_this.subtype = subtype;
|
|
16
|
-
_this.target = EShapeActionExpressions.
|
|
16
|
+
_this.target = EShapeActionExpressions.ofUnknown(value.target);
|
|
17
17
|
_this.inNewWindow = value.inNewWindow;
|
|
18
18
|
return _this;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-action-runtime-open.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-open.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;IAA6C,2CAA8B;IAK1E,iCACC,KAA6D,EAC7D,OAAuC;QAFxC,YAIC,kBAAM,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAIrC;QAHA,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,MAAM,GAAG,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"e-shape-action-runtime-open.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-action-runtime-open.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD;IAA6C,2CAA8B;IAK1E,iCACC,KAA6D,EAC7D,OAAuC;QAFxC,YAIC,kBAAM,KAAK,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAIrC;QAHA,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,MAAM,GAAG,uBAAuB,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9D,KAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;;IACtC,CAAC;IAED,yCAAO,GAAP,UAAQ,KAAa,EAAE,OAAsB,EAAE,IAAY;QAC1D,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,uBAAuB,CAAC,EAAE;YACzD,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAC;YACjE,IAAI,MAAM,IAAI,IAAI,EAAE;gBACnB,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;aAClE;SACD;IACF,CAAC;IACF,8BAAC;AAAD,CAAC,AAvBD,CAA6C,8BAA8B,GAuB1E","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDiagramBaseControllerOpenType } from \"../../d-diagram-base-controller\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeRuntime } from \"../e-shape-runtime\";\nimport { EShapeRuntimeReset } from \"../e-shape-runtime-reset\";\nimport { EShapeActionEnvironment } from \"./e-shape-action-environment\";\nimport { EShapeActionExpression } from \"./e-shape-action-expression\";\nimport { EShapeActionExpressions } from \"./e-shape-action-expressions\";\nimport { EShapeActionRuntimeConditional } from \"./e-shape-action-runtime-conditional\";\nimport { EShapeActions } from \"./e-shape-actions\";\nimport { EShapeActionValueOpen } from \"./e-shape-action-value-open\";\nimport { EShapeActionValueOpenExtension } from \"./e-shape-action-value-open-extension\";\n\nexport class EShapeActionRuntimeOpen extends EShapeActionRuntimeConditional {\n\tprotected subtype: number;\n\tprotected readonly target: EShapeActionExpression<unknown>;\n\tprotected inNewWindow: boolean;\n\n\tconstructor(\n\t\tvalue: EShapeActionValueOpen | EShapeActionValueOpenExtension,\n\t\tsubtype: DDiagramBaseControllerOpenType\n\t) {\n\t\tsuper(value, EShapeRuntimeReset.NONE);\n\t\tthis.subtype = subtype;\n\t\tthis.target = EShapeActionExpressions.ofUnknown(value.target);\n\t\tthis.inNewWindow = value.inNewWindow;\n\t}\n\n\texecute(shape: EShape, runtime: EShapeRuntime, time: number): void {\n\t\tif (this.condition(shape, time, EShapeActionEnvironment)) {\n\t\t\tconst target = this.target(shape, time, EShapeActionEnvironment);\n\t\t\tif (target != null) {\n\t\t\t\tEShapeActions.open(shape, this.subtype, target, this.inNewWindow);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { DDiagrams } from "../../d-diagrams";
|
|
|
9
9
|
import { EShapeDataValueState } from "../e-shape-data-value-state";
|
|
10
10
|
import { EShapeEmbedded } from "../variant/e-shape-embedded";
|
|
11
11
|
import { EShapeActionOpenOpeners } from "./e-shape-action-open-openers";
|
|
12
|
+
import { isString } from "../../util/is-string";
|
|
12
13
|
var EShapeActions = /** @class */ (function () {
|
|
13
14
|
function EShapeActions() {
|
|
14
15
|
}
|
|
@@ -33,7 +34,7 @@ var EShapeActions = /** @class */ (function () {
|
|
|
33
34
|
if (opener != null) {
|
|
34
35
|
opener(target, inNewWindow, shape);
|
|
35
36
|
}
|
|
36
|
-
else {
|
|
37
|
+
else if (isString(target)) {
|
|
37
38
|
switch (type) {
|
|
38
39
|
case DDiagramBaseControllerOpenType.DIAGRAM:
|
|
39
40
|
var container_1 = this.toContainer(shape);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-actions.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAEN,8BAA8B,EAC9B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"e-shape-actions.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/action/e-shape-actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAEN,8BAA8B,EAC9B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAUhD;IAAA;IA+GA,CAAC;IA9GO,yBAAW,GAAlB,UAAmB,MAAe;QACjC,OAAO,MAAM,YAAY,gBAAgB,CAAC;IAC3C,CAAC;IAEM,wBAAU,GAAjB,UAAkB,MAAe;QAChC,OAAO,MAAM,YAAY,cAAc,CAAC;IACzC,CAAC;IAEM,yBAAW,GAAlB,UAAmB,KAAqB;QACvC,IAAI,OAAO,GAAuC,KAAK,CAAC;QACxD,OAAO,OAAO,IAAI,IAAI,EAAE;YACvB,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;gBAC9B,OAAO,OAAO,CAAC;aACf;YACD,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,kBAAI,GAAX,UACC,KAAa,EACb,IAAoC,EACpC,MAAe,EACf,WAAoB;QAEpB,IAAM,MAAM,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,MAAM,IAAI,IAAI,EAAE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AI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACxB,IAAI,SAAS,EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aAClC;SACD;aAAM;YACN,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YACrC,IAAI,SAAS,EAAE;gBACd,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;aAC/C;SACD;IACF,CAAC;IACF,oBAAC;AAAD,CAAC,AA/GD,IA+GC","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 { DCanvasContainer } from \"../../d-canvas-container\";\nimport {\n\tDDiagramBaseController,\n\tDDiagramBaseControllerOpenType\n} from \"../../d-diagram-base-controller\";\nimport { DDiagramData } from \"../../d-diagram-data\";\nimport { DDiagramSerialized } from \"../../d-diagram-serialized\";\nimport { DDiagrams } from \"../../d-diagrams\";\nimport { EShape } from \"../e-shape\";\nimport { EShapeDataValueState } from \"../e-shape-data-value-state\";\nimport { EShapeEmbedded } from \"../variant/e-shape-embedded\";\nimport { EShapeActionOpenOpeners } from \"./e-shape-action-open-openers\";\nimport { isString } from \"../../util/is-string\";\n\nexport interface EShapeActionsContainer extends DCanvasContainer {\n\treadonly shape: utils.EventEmitter;\n\treadonly data: DDiagramData;\n\treadonly controller: DDiagramBaseController | null;\n\n\tset(serialized: DDiagramSerialized | null): void;\n}\n\nexport class EShapeActions {\n\tstatic isContainer(target: unknown): target is EShapeActionsContainer {\n\t\treturn target instanceof DCanvasContainer;\n\t}\n\n\tstatic isEmbedded(target: unknown): target is EShapeEmbedded {\n\t\treturn target instanceof EShapeEmbedded;\n\t}\n\n\tstatic toContainer(shape?: EShape | null): EShapeActionsContainer | null {\n\t\tlet current: { parent: any } | null | undefined = shape;\n\t\twhile (current != null) {\n\t\t\tif (this.isContainer(current)) {\n\t\t\t\treturn current;\n\t\t\t}\n\t\t\tcurrent = current.parent;\n\t\t}\n\t\treturn null;\n\t}\n\n\tstatic open(\n\t\tshape: EShape,\n\t\ttype: DDiagramBaseControllerOpenType,\n\t\ttarget: unknown,\n\t\tinNewWindow: boolean\n\t): void {\n\t\tconst opener = EShapeActionOpenOpeners[type];\n\t\tif (opener != null) {\n\t\t\topener(target, inNewWindow, shape);\n\t\t} else if (isString(target)) {\n\t\t\tswitch (type) {\n\t\t\t\tcase DDiagramBaseControllerOpenType.DIAGRAM:\n\t\t\t\t\tconst container = this.toContainer(shape);\n\t\t\t\t\tif (container) {\n\t\t\t\t\t\tconst controller = container.controller;\n\t\t\t\t\t\tif (controller) {\n\t\t\t\t\t\t\tcontroller.getByName(target).then((found): void => {\n\t\t\t\t\t\t\t\tcontainer.set(DDiagrams.toSerialized(found));\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\tbreak;\n\t\t\t\tcase DDiagramBaseControllerOpenType.PAGE:\n\t\t\t\t\tif (inNewWindow) {\n\t\t\t\t\t\twindow.open(target);\n\t\t\t\t\t} else {\n\t\t\t\t\t\twindow.location.href = target;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic writeLocal(\n\t\tshape: EShape,\n\t\tid: string,\n\t\tvalue: unknown,\n\t\ttime: number,\n\t\tstate: EShapeDataValueState = EShapeDataValueState.FOUND\n\t): boolean {\n\t\tlet current: { parent: any } | null | undefined = shape;\n\t\twhile (current != null) {\n\t\t\tif (this.isContainer(current)) {\n\t\t\t\tif (current.data.private.set(id, value, time, state)) {\n\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\treturn true;\n\t\t\t\t} else if (current.data.protected.set(id, value, time, state)) {\n\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tif (current.data.set(id, value, time, state)) {\n\t\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} else if (this.isEmbedded(current)) {\n\t\t\t\tif (current.data.getPrivate()?.set(id, value, time, state)) {\n\t\t\t\t\tDApplications.update(current);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrent = current.parent;\n\t\t}\n\t\treturn false;\n\t}\n\n\tstatic writeRemote(shape: EShape, id: string, value: unknown): boolean {\n\t\tconst container = this.toContainer(shape);\n\t\tif (container) {\n\t\t\treturn container.data.remote.set(id, value);\n\t\t}\n\t\treturn false;\n\t}\n\n\tstatic emit(shape: EShape, name: string): void;\n\tstatic emit(shape: EShape, name: string, value: unknown, time: number): void;\n\tstatic emit(shape: EShape, name: string, value?: unknown, time?: number): void {\n\t\tconst container = EShapeActions.toContainer(shape);\n\t\tif (time === undefined) {\n\t\t\tshape.emit(name, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, shape);\n\t\t\t}\n\t\t} else {\n\t\t\tshape.emit(name, value, time, shape);\n\t\t\tif (container) {\n\t\t\t\tcontainer.shape.emit(name, value, time, shape);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
|
|
@@ -255,10 +255,11 @@ var UtilGesture = /** @class */ (function () {
|
|
|
255
255
|
onMove(data.target, dx, dy, x, y, ds);
|
|
256
256
|
};
|
|
257
257
|
UtilGesture.prototype.onEasingEnd = function (data) {
|
|
258
|
+
var target = data.target;
|
|
258
259
|
this.deleteData(data);
|
|
259
260
|
var onEasingEnd = this._onEasingEnd;
|
|
260
|
-
if (onEasingEnd) {
|
|
261
|
-
onEasingEnd(
|
|
261
|
+
if (onEasingEnd && target != null) {
|
|
262
|
+
onEasingEnd(target);
|
|
262
263
|
}
|
|
263
264
|
};
|
|
264
265
|
UtilGesture.prototype.stop = function (target) {
|