@wcardinal/wcardinal-ui 0.330.0 → 0.332.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/types/wcardinal/ui/d-animation-base.d.ts +3 -1
  2. package/dist/types/wcardinal/ui/d-animation.d.ts +21 -3
  3. package/dist/types/wcardinal/ui/d-view-gesture-impl.d.ts +7 -4
  4. package/dist/types/wcardinal/ui/d-view-impl.d.ts +2 -2
  5. package/dist/types/wcardinal/ui/d-view-parent.d.ts +5 -0
  6. package/dist/types/wcardinal/ui/d-view-transform-impl.d.ts +8 -4
  7. package/dist/types/wcardinal/ui/d-view.d.ts +35 -0
  8. package/dist/types/wcardinal/ui/index.d.ts +1 -1
  9. package/dist/types/wcardinal/ui/shape/e-shape-connector-edge-impl.d.ts +7 -1
  10. package/dist/types/wcardinal/ui/util/util-gesture.d.ts +12 -0
  11. package/dist/wcardinal/ui/d-animation-base.js +10 -0
  12. package/dist/wcardinal/ui/d-animation-base.js.map +1 -1
  13. package/dist/wcardinal/ui/d-animation.js.map +1 -1
  14. package/dist/wcardinal/ui/d-view-gesture-impl.js +30 -9
  15. package/dist/wcardinal/ui/d-view-gesture-impl.js.map +1 -1
  16. package/dist/wcardinal/ui/d-view-impl.js +44 -27
  17. package/dist/wcardinal/ui/d-view-impl.js.map +1 -1
  18. package/dist/wcardinal/ui/{d-view-stopper.js → d-view-parent.js} +1 -1
  19. package/dist/wcardinal/ui/d-view-parent.js.map +1 -0
  20. package/dist/wcardinal/ui/d-view-transform-impl.js +30 -5
  21. package/dist/wcardinal/ui/d-view-transform-impl.js.map +1 -1
  22. package/dist/wcardinal/ui/d-view.js.map +1 -1
  23. package/dist/wcardinal/ui/index.js +1 -1
  24. package/dist/wcardinal/ui/index.js.map +1 -1
  25. package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js +6 -2
  26. package/dist/wcardinal/ui/shape/e-shape-connector-edge-container-impl.js.map +1 -1
  27. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js +88 -26
  28. package/dist/wcardinal/ui/shape/e-shape-connector-edge-impl.js.map +1 -1
  29. package/dist/wcardinal/ui/util/util-gesture.js +22 -0
  30. package/dist/wcardinal/ui/util/util-gesture.js.map +1 -1
  31. package/dist/wcardinal-ui-theme-dark.js +1 -1
  32. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  33. package/dist/wcardinal-ui-theme-white.js +1 -1
  34. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  35. package/dist/wcardinal-ui.cjs.js +229 -69
  36. package/dist/wcardinal-ui.js +229 -69
  37. package/dist/wcardinal-ui.min.js +2 -2
  38. package/dist/wcardinal-ui.min.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/types/wcardinal/ui/d-view-stopper.d.ts +0 -4
  41. package/dist/wcardinal/ui/d-view-stopper.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { utils } from "pixi.js";
2
- import { DAnimation, DAnimationOnEnd, DAnimationOnTime, DAnimationOptions, DAnimationTiming } from "./d-animation";
2
+ import { DAnimation, DAnimationOnEnd, DAnimationOnStop, DAnimationOnTime, DAnimationOptions, DAnimationTiming } from "./d-animation";
3
3
  export declare class DAnimationBase<TARGET = unknown> extends utils.EventEmitter implements DAnimation<TARGET> {
4
4
  protected _id: number | null;
5
5
  protected _startTime: number;
@@ -10,6 +10,7 @@ export declare class DAnimationBase<TARGET = unknown> extends utils.EventEmitter
10
10
  protected _onTimeBaseBound: () => void;
11
11
  protected _onStart: DAnimationOnEnd<TARGET> | undefined;
12
12
  protected _onEnd: DAnimationOnEnd<TARGET> | undefined;
13
+ protected _onStop: DAnimationOnStop<TARGET> | undefined;
13
14
  protected _timing: DAnimationTiming<TARGET>;
14
15
  protected _target: TARGET | null;
15
16
  constructor(options?: DAnimationOptions<TARGET>);
@@ -21,6 +22,7 @@ export declare class DAnimationBase<TARGET = unknown> extends utils.EventEmitter
21
22
  protected onStart(isReverse: boolean): void;
22
23
  protected onTime(time: number, isReverse: boolean, elapsedTime: number): void;
23
24
  protected onEnd(isReverse: boolean): void;
25
+ protected onStop(isReverse: boolean): void;
24
26
  isStarted(): boolean;
25
27
  isReverse(): boolean;
26
28
  protected onTimeBase(): void;
@@ -17,12 +17,19 @@ export declare type DAnimationOnStart<TARGET> = (isReverse: boolean, animation:
17
17
  */
18
18
  export declare type DAnimationOnTime<TARGET> = (time: number, isReverse: boolean, elapsedTime: number, animation: DAnimation<TARGET>) => void;
19
19
  /**
20
- * Triggered when an animation stops.
20
+ * Triggered when an animation ends.
21
21
  *
22
22
  * @param isReverse true if an animation is playing in reverse
23
23
  * @param animation an instance
24
24
  */
25
25
  export declare type DAnimationOnEnd<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;
26
+ /**
27
+ * Triggered when an animation stops.
28
+ *
29
+ * @param isReverse true if an animation is playing in reverse
30
+ * @param animation an instance
31
+ */
32
+ export declare type DAnimationOnStop<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;
26
33
  /**
27
34
  * An easing function.
28
35
  *
@@ -51,12 +58,19 @@ export interface DAnimationEvents<EMITTER> {
51
58
  */
52
59
  time(time: number, isReverse: boolean, elapsedTime: number, emitter: EMITTER): void;
53
60
  /**
54
- * Triggered when an animation stops.
61
+ * Triggered when an animation ends.
55
62
  *
56
63
  * @param isReverse true if an animation is playing in reverse
57
64
  * @param emitter an emitter
58
65
  */
59
66
  end(isReverse: boolean, emitter: EMITTER): void;
67
+ /**
68
+ * Triggered when an animation stops.
69
+ *
70
+ * @param isReverse true if an animation is playing in reverse
71
+ * @param emitter an emitter
72
+ */
73
+ stop(isReverse: boolean, emitter: EMITTER): void;
60
74
  }
61
75
  /**
62
76
  * {@link DAnimation} "on" options.
@@ -80,9 +94,13 @@ export interface DAnimationOptions<TARGET, EMITTER = DAnimation<TARGET>> {
80
94
  */
81
95
  onTime?: DAnimationOnTime<TARGET>;
82
96
  /**
83
- * Triggered when an animation stops.
97
+ * Triggered when an animation ends.
84
98
  */
85
99
  onEnd?: DAnimationOnEnd<TARGET>;
100
+ /**
101
+ * Triggered when an animation stops.
102
+ */
103
+ onStop?: DAnimationOnStop<TARGET>;
86
104
  timing?: DAnimationTiming<TARGET>;
87
105
  /**
88
106
  * An animation duration.
@@ -1,16 +1,19 @@
1
1
  import { interaction } from "pixi.js";
2
2
  import { DBase } from "./d-base";
3
3
  import { DThemeViewGesture, DViewGesture, DViewGestureOptions } from "./d-view-gesture";
4
- import { DViewStopper } from "./d-view-stopper";
4
+ import { DViewParent } from "./d-view-parent";
5
5
  import { DViewTarget, DViewToTarget } from "./d-view-to-target";
6
6
  import { UtilGesture } from "./util/util-gesture";
7
7
  import { DViewConstraint } from "./d-view-constraint";
8
8
  export declare class DViewGestureImpl implements DViewGesture {
9
- protected _parent: DBase;
10
- protected _stopper: DViewStopper;
9
+ protected _owner: DBase;
10
+ protected _parent: DViewParent;
11
11
  protected _constraint: DViewConstraint;
12
12
  protected _gestureUtil?: UtilGesture<DBase>;
13
- constructor(parent: DBase, toTarget: DViewToTarget, stopper: DViewStopper, constraint: DViewConstraint, theme: DThemeViewGesture, options?: DViewGestureOptions);
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
17
  protected onGestureMove(target: DViewTarget | null, dx: number, dy: number, x: number, y: number, ds: number): void;
15
18
  stop(): void;
16
19
  onDown(e: interaction.InteractionEvent): void;
@@ -1,4 +1,4 @@
1
- import { interaction, IPoint, Point, Rectangle } from "pixi.js";
1
+ import { interaction, IPoint, Point, Rectangle, utils } from "pixi.js";
2
2
  import { DBase } from "./d-base";
3
3
  import { UtilGestureModifier } from "./util/util-gesture-modifier";
4
4
  import { DThemeView, DView, DViewChecker, DViewOptions } from "./d-view";
@@ -8,7 +8,7 @@ import { DViewTargetPoint, DViewToTarget } from "./d-view-to-target";
8
8
  import { DViewTransformImpl } from "./d-view-transform-impl";
9
9
  import { UtilWheelEventDeltas } from "./util/util-wheel-event";
10
10
  import { DViewConstraint } from "./d-view-constraint";
11
- export declare class DViewImpl implements DView {
11
+ export declare class DViewImpl extends utils.EventEmitter implements DView {
12
12
  protected static CONSTRAINT: DViewConstraint;
13
13
  protected _parent: DBase;
14
14
  protected _toTarget: DViewToTarget;
@@ -0,0 +1,5 @@
1
+ import { utils } from "pixi.js";
2
+ export interface DViewParent extends utils.EventEmitter {
3
+ stop(): void;
4
+ toNormalizedScale(scale: number): number;
5
+ }
@@ -1,11 +1,11 @@
1
1
  import { DAnimation } from "./d-animation";
2
2
  import { DBase } from "./d-base";
3
3
  import { DViewConstraint } from "./d-view-constraint";
4
- import { DViewStopper } from "./d-view-stopper";
4
+ import { DViewParent } from "./d-view-parent";
5
5
  import { DViewTarget, DViewToTarget } from "./d-view-to-target";
6
6
  import { DViewTransform } from "./d-view-transform";
7
7
  export declare class DViewTransformImpl implements DViewTransform {
8
- protected _parent: DBase;
8
+ protected _owner: DBase;
9
9
  protected _toTarget: DViewToTarget;
10
10
  protected _constraint: DViewConstraint;
11
11
  protected _newX: number;
@@ -17,10 +17,14 @@ export declare class DViewTransformImpl implements DViewTransform {
17
17
  protected _oldScaleX: number;
18
18
  protected _oldScaleY: number;
19
19
  protected _animation: DAnimation;
20
- protected _stopper: DViewStopper;
20
+ protected _parent: DViewParent;
21
21
  protected _duration: number;
22
- constructor(parent: DBase, toTarget: DViewToTarget, stopper: DViewStopper, constraint: DViewConstraint, duration: number);
22
+ protected _isStarted: boolean;
23
+ constructor(owner: DBase, toTarget: DViewToTarget, parent: DViewParent, constraint: DViewConstraint, duration: number);
24
+ protected onStart(): void;
23
25
  protected onTime(time: number): void;
26
+ protected onEnd(): void;
27
+ protected onStop(): void;
24
28
  start(target: DViewTarget, x: number, y: number, scaleX: number, scaleY: number, duration?: number, stop?: boolean): void;
25
29
  stop(): void;
26
30
  }
@@ -4,6 +4,8 @@ import { UtilGestureModifier } from "./util/util-gesture-modifier";
4
4
  import { DThemeViewGesture, DViewGesture, DViewGestureOptions } from "./d-view-gesture";
5
5
  import { DViewTargetPoint } from "./d-view-to-target";
6
6
  import { DViewConstraint } from "./d-view-constraint";
7
+ import { DOnOptions } from "./d-on-options";
8
+ import { DViewTransform } from "./d-view-transform";
7
9
  export declare type DViewChecker = (e: WheelEvent | MouseEvent | TouchEvent, modifier: UtilGestureModifier, target: DBase) => boolean;
8
10
  /**
9
11
  * {@link DView} wheel zoom options.
@@ -77,6 +79,37 @@ export interface DViewTranslationOptions {
77
79
  /** Wheel translation options */
78
80
  wheel?: DViewTranslationWheelOptions;
79
81
  }
82
+ /**
83
+ * {@link DView} events.
84
+ */
85
+ export interface DViewEvents<EMITTER> {
86
+ /**
87
+ * Triggered when a view operation starts.
88
+ *
89
+ * @param operation a view operation
90
+ * @param emitter an emitter
91
+ */
92
+ start(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
93
+ /**
94
+ * Triggered when a view operation ends.
95
+ *
96
+ * @param operation a view operation
97
+ * @param emitter an emitter
98
+ */
99
+ end(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
100
+ /**
101
+ * Triggered when a view operation stops.
102
+ *
103
+ * @param operation a view operation
104
+ * @param emitter an emitter
105
+ */
106
+ stop(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
107
+ }
108
+ /**
109
+ * {@link DView} "on" options.
110
+ */
111
+ export interface DViewOnOptions<EMITTER> extends Partial<DViewEvents<EMITTER>>, DOnOptions {
112
+ }
80
113
  /**
81
114
  * {@link DView} options.
82
115
  */
@@ -91,6 +124,8 @@ export interface DViewOptions {
91
124
  constraint?: DViewConstraint;
92
125
  /** Theme */
93
126
  theme?: DThemeView | string;
127
+ /** On options */
128
+ on?: DViewOnOptions<DView>;
94
129
  }
95
130
  /**
96
131
  * {@link DView} theme.
@@ -599,7 +599,7 @@ export * from "./d-view-constraint";
599
599
  export * from "./d-view-gesture-impl";
600
600
  export * from "./d-view-gesture";
601
601
  export * from "./d-view-impl";
602
- export * from "./d-view-stopper";
602
+ export * from "./d-view-parent";
603
603
  export * from "./d-view-to-target";
604
604
  export * from "./d-view-transform-impl";
605
605
  export * from "./d-view-transform";
@@ -12,6 +12,9 @@ export declare class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {
12
12
  protected _parent: EShapeConnector;
13
13
  protected _onChange: () => void;
14
14
  protected _acceptor: EShapeConnectorEdgeAcceptor;
15
+ protected _acceptorTransformNew: Matrix;
16
+ protected _acceptorTransformOld: Matrix;
17
+ protected _hasAcceptorTransformOld: boolean;
15
18
  protected _localIdRequired: number;
16
19
  protected _localId: number;
17
20
  protected _local: IPoint;
@@ -20,6 +23,7 @@ export declare class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {
20
23
  protected _normal: IPoint;
21
24
  protected _side: EShapeAcceptorEdgeSide;
22
25
  protected _margin: number;
26
+ protected _other: EShapeConnectorEdge | null;
23
27
  protected _lockCount: number;
24
28
  protected _isAcceptorChanged: boolean;
25
29
  protected _isLocalChanged: boolean;
@@ -38,13 +42,15 @@ export declare class EShapeConnectorEdgeImpl implements EShapeConnectorEdge {
38
42
  set side(side: EShapeAcceptorEdgeSide);
39
43
  get margin(): number;
40
44
  set margin(margin: number);
45
+ get other(): EShapeConnectorEdge | null;
46
+ set other(other: EShapeConnectorEdge | null);
41
47
  set(acceptorShape?: EShape | null, acceptorEdge?: string | null, acceptorX?: number | null, acceptorY?: number | null, margin?: number, x?: number, y?: number, nx?: number, ny?: number, side?: EShapeAcceptorEdgeSide): this;
42
48
  copy(source: EShapeConnectorEdge): this;
43
49
  serialize(manager: EShapeResourceManagerSerialization): number;
44
50
  deserialize(resourceId: number, mapping: EShapeUuidMapping, manager: EShapeResourceManagerDeserialization): void;
45
51
  fit(forcibly?: boolean): this;
46
52
  protected doFit(): boolean;
47
- protected toAcceptorTransform(shape: EShape): Matrix;
53
+ protected toAcceptorTransform(shape: EShape, result: Matrix): Matrix;
48
54
  onAcceptorChange(): void;
49
55
  protected onLocalChange(): void;
50
56
  protected onNormalChange(): void;
@@ -11,15 +11,24 @@ export interface UtilGestureTarget extends DApplicationTarget {
11
11
  export declare type UtilGestureOnMove<TARGET> = (target: TARGET, dx: number, dy: number, x: number, y: number, ds: number) => void;
12
12
  export declare type UtilGestureOnStart<TARGET> = (target: TARGET) => void;
13
13
  export declare type UtilGestureOnEnd<TARGET> = (target: TARGET) => void;
14
+ export declare type UtilGestureOnStop<TARGET> = (target: TARGET) => void;
15
+ export declare type UtilGestureOnEasingStart<TARGET> = (target: TARGET) => void;
16
+ export declare type UtilGestureOnEasingEnd<TARGET> = (target: TARGET) => void;
14
17
  export declare type UtilGestureChecker<TARGET> = (e: InteractionEvent, modifier: UtilGestureModifier, target: TARGET) => boolean;
15
18
  export interface UtilGestureCheckerOptions<TARGET> {
16
19
  start?: UtilGestureChecker<TARGET>;
17
20
  move?: UtilGestureChecker<TARGET>;
18
21
  }
22
+ export interface UtilGestureOnEasingOptions<TARGET> {
23
+ start?: UtilGestureOnEasingStart<TARGET>;
24
+ end?: UtilGestureOnEasingEnd<TARGET>;
25
+ }
19
26
  export interface UtilGestureOnOptions<TARGET> {
20
27
  start?: UtilGestureOnStart<TARGET>;
21
28
  move?: UtilGestureOnMove<TARGET>;
22
29
  end?: UtilGestureOnEnd<TARGET>;
30
+ stop?: UtilGestureOnStop<TARGET>;
31
+ easing?: UtilGestureOnEasingOptions<TARGET>;
23
32
  }
24
33
  export interface UtilGestureOptions<TARGET> {
25
34
  /**
@@ -47,6 +56,9 @@ export declare class UtilGesture<TARGET extends UtilGestureTarget> {
47
56
  protected _onStart?: UtilGestureOnStart<TARGET>;
48
57
  protected _onMove?: UtilGestureOnMove<TARGET>;
49
58
  protected _onEnd?: UtilGestureOnEnd<TARGET>;
59
+ protected _onStop?: UtilGestureOnStop<TARGET>;
60
+ protected _onEasingStart?: UtilGestureOnEasingStart<TARGET>;
61
+ protected _onEasingEnd?: UtilGestureOnEasingEnd<TARGET>;
50
62
  protected _modifier: UtilGestureModifier;
51
63
  protected _checkerStart: UtilGestureChecker<TARGET>;
52
64
  protected _checkerMove: UtilGestureChecker<TARGET>;
@@ -23,6 +23,7 @@ var DAnimationBase = /** @class */ (function (_super) {
23
23
  };
24
24
  _this._onStart = options === null || options === void 0 ? void 0 : options.onStart;
25
25
  _this._onEnd = options === null || options === void 0 ? void 0 : options.onEnd;
26
+ _this._onStop = options === null || options === void 0 ? void 0 : options.onStop;
26
27
  _this._timing = (_c = options === null || options === void 0 ? void 0 : options.timing) !== null && _c !== void 0 ? _c : DAnimationTimings.ELASTIC;
27
28
  // Events
28
29
  var on = options === null || options === void 0 ? void 0 : options.on;
@@ -91,6 +92,13 @@ var DAnimationBase = /** @class */ (function (_super) {
91
92
  }
92
93
  this.emit("end", isReverse, this);
93
94
  };
95
+ DAnimationBase.prototype.onStop = function (isReverse) {
96
+ var onStop = this._onStop;
97
+ if (onStop != null) {
98
+ onStop(isReverse, this);
99
+ }
100
+ this.emit("stop", isReverse, this);
101
+ };
94
102
  DAnimationBase.prototype.isStarted = function () {
95
103
  return this._id != null;
96
104
  };
@@ -127,6 +135,8 @@ var DAnimationBase = /** @class */ (function (_super) {
127
135
  if (id != null) {
128
136
  this._id = null;
129
137
  window.clearTimeout(id);
138
+ // OnStop
139
+ this.onStop(this._reverse);
130
140
  }
131
141
  };
132
142
  DAnimationBase.prototype.end = function () {
@@ -1 +1 @@
1
- {"version":3,"file":"d-animation-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-animation-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;IACS,kCAAkB;IAe1B,wBAAY,OAAmC;QAA/C,iBA2BC;;gBA1BA,iBAAO;QAEP,KAAI,CAAC,GAAG,G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C,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;YAExC,QAAQ;YACR,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACpB;IACF,CAAC;IACF,qBAAC;AAAD,CAAC,AAlKD,CACS,KAAK,CAAC,YAAY,GAiK1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport {\n\tDAnimation,\n\tDAnimationOnEnd,\n\tDAnimationOnTime,\n\tDAnimationOptions,\n\tDAnimationTiming\n} from \"./d-animation\";\nimport { DAnimationTimings } from \"./d-animation-timings\";\n\nexport class DAnimationBase<TARGET = unknown>\n\textends utils.EventEmitter\n\timplements DAnimation<TARGET>\n{\n\tprotected _id: number | null;\n\tprotected _startTime: number;\n\tprotected _duration: number;\n\tprotected _durationInverse: number;\n\tprotected _reverse: boolean;\n\tprotected _onTime: DAnimationOnTime<TARGET> | undefined;\n\tprotected _onTimeBaseBound: () => void;\n\tprotected _onStart: DAnimationOnEnd<TARGET> | undefined;\n\tprotected _onEnd: DAnimationOnEnd<TARGET> | undefined;\n\tprotected _timing: DAnimationTiming<TARGET>;\n\tprotected _target: TARGET | null;\n\n\tconstructor(options?: DAnimationOptions<TARGET>) {\n\t\tsuper();\n\n\t\tthis._id = null;\n\t\tthis._target = options?.target ?? null;\n\t\tthis._startTime = 0;\n\t\tthis._duration = options?.duration ?? 200;\n\t\tthis._durationInverse = 1 / Math.max(1, this._duration);\n\t\tthis._reverse = false;\n\t\tthis._onTime = options?.onTime;\n\t\tthis._onTimeBaseBound = () => {\n\t\t\tthis.onTimeBase();\n\t\t};\n\t\tthis._onStart = options?.onStart;\n\t\tthis._onEnd = options?.onEnd;\n\t\tthis._timing = options?.timing ?? DAnimationTimings.ELASTIC;\n\n\t\t// Events\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\tget target(): TARGET | null {\n\t\treturn this._target;\n\t}\n\n\tset target(target: TARGET | null) {\n\t\tthis._target = target;\n\t}\n\n\tget duration(): number {\n\t\treturn this._duration;\n\t}\n\n\tset duration(duration: number) {\n\t\tthis._duration = duration;\n\t\tthis._durationInverse = 1 / Math.max(1, duration);\n\t}\n\n\tstart(reverse: boolean = false): void {\n\t\tthis.stop();\n\t\tthis._startTime = Date.now();\n\t\tthis._reverse = reverse;\n\t\tthis._id = window.setTimeout(this._onTimeBaseBound, 0);\n\n\t\t// onStart\n\t\tthis.onStart(reverse);\n\n\t\t// onTime\n\t\tconst duration = this._duration;\n\t\tconst time = this.toTime(reverse ? duration : 0);\n\t\tthis.onTime(time, reverse, 0);\n\t}\n\n\tprotected onStart(isReverse: boolean): void {\n\t\tconst onStart = this._onStart;\n\t\tif (onStart != null) {\n\t\t\tonStart(isReverse, this);\n\t\t}\n\t\tthis.emit(\"start\", isReverse, this);\n\t}\n\n\tprotected onTime(time: number, isReverse: boolean, elapsedTime: number): void {\n\t\tconst onTime = this._onTime;\n\t\tif (onTime != null) {\n\t\t\tonTime(time, isReverse, elapsedTime, this);\n\t\t}\n\t\tthis.emit(\"time\", time, isReverse, elapsedTime, this);\n\t}\n\n\tprotected onEnd(isReverse: boolean): void {\n\t\tconst onEnd = this._onEnd;\n\t\tif (onEnd != null) {\n\t\t\tonEnd(isReverse, this);\n\t\t}\n\t\tthis.emit(\"end\", isReverse, this);\n\t}\n\n\tisStarted(): boolean {\n\t\treturn this._id != null;\n\t}\n\n\tisReverse(): boolean {\n\t\treturn this._reverse;\n\t}\n\n\tprotected onTimeBase(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst duration = this._duration;\n\t\t\tconst reverse = this._reverse;\n\t\t\tif (elapsedTime < duration) {\n\t\t\t\tthis._id = window.setTimeout(this._onTimeBaseBound, 0);\n\n\t\t\t\t// OnTime\n\t\t\t\tconst time = this.toTime(reverse ? duration - elapsedTime : elapsedTime);\n\t\t\t\tthis.onTime(time, reverse, elapsedTime);\n\t\t\t} else {\n\t\t\t\t// OnTime\n\t\t\t\tconst time = this.toTime(reverse ? 0 : duration);\n\t\t\t\tthis.onTime(time, reverse, elapsedTime);\n\n\t\t\t\t// OnEnd\n\t\t\t\tthis.onEnd(reverse);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toTime(elapsedTime: number): number {\n\t\treturn this._timing(elapsedTime * this._durationInverse, this);\n\t}\n\n\tstop(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\twindow.clearTimeout(id);\n\t\t}\n\t}\n\n\tend(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\twindow.clearTimeout(id);\n\n\t\t\t// OnTime\n\t\t\tconst reverse = this._reverse;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst duration = this._duration;\n\t\t\tconst time = this.toTime(reverse ? 0 : duration);\n\t\t\tthis.onTime(time, reverse, elapsedTime);\n\n\t\t\t// OnEnd\n\t\t\tthis.onEnd(reverse);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-animation-base.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-animation-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAShC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;IACS,kCAAkB;IAgB1B,wBAAY,OAAmC;QAA/C,iBA4BC;;gBA3BA,iBAA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,CAAC;SAC3B;IACF,CAAC;IAED,4BAAG,GAAH;QACC,IAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,EAAE,IAAI,IAAI,EAAE;YACf,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;YAChB,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YAExB,SAAS;YACT,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC9B,IAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC;YACjD,IAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;YAChC,IAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;YAExC,QAAQ;YACR,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SACpB;IACF,CAAC;IACF,qBAAC;AAAD,CAAC,AA/KD,CACS,KAAK,CAAC,YAAY,GA8K1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport {\n\tDAnimation,\n\tDAnimationOnEnd,\n\tDAnimationOnStop,\n\tDAnimationOnTime,\n\tDAnimationOptions,\n\tDAnimationTiming\n} from \"./d-animation\";\nimport { DAnimationTimings } from \"./d-animation-timings\";\n\nexport class DAnimationBase<TARGET = unknown>\n\textends utils.EventEmitter\n\timplements DAnimation<TARGET>\n{\n\tprotected _id: number | null;\n\tprotected _startTime: number;\n\tprotected _duration: number;\n\tprotected _durationInverse: number;\n\tprotected _reverse: boolean;\n\tprotected _onTime: DAnimationOnTime<TARGET> | undefined;\n\tprotected _onTimeBaseBound: () => void;\n\tprotected _onStart: DAnimationOnEnd<TARGET> | undefined;\n\tprotected _onEnd: DAnimationOnEnd<TARGET> | undefined;\n\tprotected _onStop: DAnimationOnStop<TARGET> | undefined;\n\tprotected _timing: DAnimationTiming<TARGET>;\n\tprotected _target: TARGET | null;\n\n\tconstructor(options?: DAnimationOptions<TARGET>) {\n\t\tsuper();\n\n\t\tthis._id = null;\n\t\tthis._target = options?.target ?? null;\n\t\tthis._startTime = 0;\n\t\tthis._duration = options?.duration ?? 200;\n\t\tthis._durationInverse = 1 / Math.max(1, this._duration);\n\t\tthis._reverse = false;\n\t\tthis._onTime = options?.onTime;\n\t\tthis._onTimeBaseBound = () => {\n\t\t\tthis.onTimeBase();\n\t\t};\n\t\tthis._onStart = options?.onStart;\n\t\tthis._onEnd = options?.onEnd;\n\t\tthis._onStop = options?.onStop;\n\t\tthis._timing = options?.timing ?? DAnimationTimings.ELASTIC;\n\n\t\t// Events\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\tget target(): TARGET | null {\n\t\treturn this._target;\n\t}\n\n\tset target(target: TARGET | null) {\n\t\tthis._target = target;\n\t}\n\n\tget duration(): number {\n\t\treturn this._duration;\n\t}\n\n\tset duration(duration: number) {\n\t\tthis._duration = duration;\n\t\tthis._durationInverse = 1 / Math.max(1, duration);\n\t}\n\n\tstart(reverse: boolean = false): void {\n\t\tthis.stop();\n\t\tthis._startTime = Date.now();\n\t\tthis._reverse = reverse;\n\t\tthis._id = window.setTimeout(this._onTimeBaseBound, 0);\n\n\t\t// onStart\n\t\tthis.onStart(reverse);\n\n\t\t// onTime\n\t\tconst duration = this._duration;\n\t\tconst time = this.toTime(reverse ? duration : 0);\n\t\tthis.onTime(time, reverse, 0);\n\t}\n\n\tprotected onStart(isReverse: boolean): void {\n\t\tconst onStart = this._onStart;\n\t\tif (onStart != null) {\n\t\t\tonStart(isReverse, this);\n\t\t}\n\t\tthis.emit(\"start\", isReverse, this);\n\t}\n\n\tprotected onTime(time: number, isReverse: boolean, elapsedTime: number): void {\n\t\tconst onTime = this._onTime;\n\t\tif (onTime != null) {\n\t\t\tonTime(time, isReverse, elapsedTime, this);\n\t\t}\n\t\tthis.emit(\"time\", time, isReverse, elapsedTime, this);\n\t}\n\n\tprotected onEnd(isReverse: boolean): void {\n\t\tconst onEnd = this._onEnd;\n\t\tif (onEnd != null) {\n\t\t\tonEnd(isReverse, this);\n\t\t}\n\t\tthis.emit(\"end\", isReverse, this);\n\t}\n\n\tprotected onStop(isReverse: boolean): void {\n\t\tconst onStop = this._onStop;\n\t\tif (onStop != null) {\n\t\t\tonStop(isReverse, this);\n\t\t}\n\t\tthis.emit(\"stop\", isReverse, this);\n\t}\n\n\tisStarted(): boolean {\n\t\treturn this._id != null;\n\t}\n\n\tisReverse(): boolean {\n\t\treturn this._reverse;\n\t}\n\n\tprotected onTimeBase(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst duration = this._duration;\n\t\t\tconst reverse = this._reverse;\n\t\t\tif (elapsedTime < duration) {\n\t\t\t\tthis._id = window.setTimeout(this._onTimeBaseBound, 0);\n\n\t\t\t\t// OnTime\n\t\t\t\tconst time = this.toTime(reverse ? duration - elapsedTime : elapsedTime);\n\t\t\t\tthis.onTime(time, reverse, elapsedTime);\n\t\t\t} else {\n\t\t\t\t// OnTime\n\t\t\t\tconst time = this.toTime(reverse ? 0 : duration);\n\t\t\t\tthis.onTime(time, reverse, elapsedTime);\n\n\t\t\t\t// OnEnd\n\t\t\t\tthis.onEnd(reverse);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected toTime(elapsedTime: number): number {\n\t\treturn this._timing(elapsedTime * this._durationInverse, this);\n\t}\n\n\tstop(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\twindow.clearTimeout(id);\n\n\t\t\t// OnStop\n\t\t\tthis.onStop(this._reverse);\n\t\t}\n\t}\n\n\tend(): void {\n\t\tconst id = this._id;\n\t\tif (id != null) {\n\t\t\tthis._id = null;\n\t\t\twindow.clearTimeout(id);\n\n\t\t\t// OnTime\n\t\t\tconst reverse = this._reverse;\n\t\t\tconst elapsedTime = Date.now() - this._startTime;\n\t\t\tconst duration = this._duration;\n\t\t\tconst time = this.toTime(reverse ? 0 : duration);\n\t\t\tthis.onTime(time, reverse, elapsedTime);\n\n\t\t\t// OnEnd\n\t\t\tthis.onEnd(reverse);\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"d-animation.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-animation.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * A function called when an animation starts.\n *\n * @param isReverse true if an animation is playing in reverse\n * @param animation an instance\n */\nexport type DAnimationOnStart<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;\n\n/**\n * A function called constantly when an animation is on a run.\n *\n * @param time a timing value in a range [0, 1]\n * @param isReverse true if an animation is playing in reverse\n * @param elapsedTime an elapsed time since an animation has started\n * @param animation an instance\n */\nexport type DAnimationOnTime<TARGET> = (\n\ttime: number,\n\tisReverse: boolean,\n\telapsedTime: number,\n\tanimation: DAnimation<TARGET>\n) => void;\n\n/**\n * Triggered when an animation stops.\n *\n * @param isReverse true if an animation is playing in reverse\n * @param animation an instance\n */\nexport type DAnimationOnEnd<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;\n\n/**\n * An easing function.\n *\n * @param time a normalized elapsed time\n * @param animation an instance\n */\nexport type DAnimationTiming<TARGET> = (time: number, animation: DAnimation<TARGET>) => number;\n\n/**\n * {@link DAnimation} events.\n */\nexport interface DAnimationEvents<EMITTER> {\n\t/**\n\t * Triggered when an animation starts.\n\t *\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param emitter an emitter\n\t */\n\tstart(isReverse: boolean, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered constantly when an animation is on a run.\n\t *\n\t * @param time a timing value in a range [0, 1]\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param elapsedTime an elapsed time since an animation has started\n\t * @param emitter an emitter\n\t */\n\ttime(time: number, isReverse: boolean, elapsedTime: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when an animation stops.\n\t *\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param emitter an emitter\n\t */\n\tend(isReverse: boolean, emitter: EMITTER): void;\n}\n\n/**\n * {@link DAnimation} \"on\" options.\n */\nexport interface DAnimationOnOptions<EMITTER>\n\textends Partial<DAnimationEvents<EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DAnimation} options.\n */\nexport interface DAnimationOptions<TARGET, EMITTER = DAnimation<TARGET>> {\n\t/**\n\t * An animation target.\n\t */\n\ttarget?: TARGET | null;\n\n\t/**\n\t * A function called when an animation starts.\n\t */\n\tonStart?: DAnimationOnStart<TARGET>;\n\n\t/**\n\t * A function called constantly when an animation is on a run.\n\t */\n\tonTime?: DAnimationOnTime<TARGET>;\n\n\t/**\n\t * Triggered when an animation stops.\n\t */\n\tonEnd?: DAnimationOnEnd<TARGET>;\n\n\ttiming?: DAnimationTiming<TARGET>;\n\n\t/**\n\t * An animation duration.\n\t */\n\tduration?: number;\n\n\t/**\n\t * Event handlers.\n\t */\n\ton?: DAnimationOnOptions<EMITTER>;\n}\n\nexport interface DAnimation<TARGET = unknown> extends utils.EventEmitter {\n\t/**\n\t * An animation target.\n\t */\n\ttarget: TARGET | null;\n\n\t/**\n\t * An animation duration.\n\t */\n\tduration: number;\n\n\t/**\n\t * Starts an animation.\n\t *\n\t * @param reverse true to play in reverse.\n\t */\n\tstart(reverse?: boolean): void;\n\n\t/**\n\t * Returns true if an animation is playing.\n\t */\n\tisStarted(): boolean;\n\n\t/**\n\t * Returns true if an animation is in a reverse mode.\n\t */\n\tisReverse(): boolean;\n\n\t/**\n\t * Stops an animation as is.\n\t */\n\tstop(): void;\n\n\t/**\n\t * Moves an animation frame to the end.\n\t */\n\tend(): void;\n\n\ton<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\thandler: DAnimationEvents<this>[E],\n\t\tcontext?: any\n\t): this;\n\ton(event: string, handler: (...args: any[]) => any, context?: any): this;\n\n\tonce<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\thandler: DAnimationEvents<this>[E],\n\t\tcontext?: any\n\t): this;\n\tonce(event: string, handler: (...args: any[]) => any, context?: any): this;\n\n\temit<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\t...args: Parameters<DAnimationEvents<this>[E]>\n\t): boolean;\n\temit(event: string, ...args: any): boolean;\n}\n"]}
1
+ {"version":3,"file":"d-animation.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-animation.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * A function called when an animation starts.\n *\n * @param isReverse true if an animation is playing in reverse\n * @param animation an instance\n */\nexport type DAnimationOnStart<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;\n\n/**\n * A function called constantly when an animation is on a run.\n *\n * @param time a timing value in a range [0, 1]\n * @param isReverse true if an animation is playing in reverse\n * @param elapsedTime an elapsed time since an animation has started\n * @param animation an instance\n */\nexport type DAnimationOnTime<TARGET> = (\n\ttime: number,\n\tisReverse: boolean,\n\telapsedTime: number,\n\tanimation: DAnimation<TARGET>\n) => void;\n\n/**\n * Triggered when an animation ends.\n *\n * @param isReverse true if an animation is playing in reverse\n * @param animation an instance\n */\nexport type DAnimationOnEnd<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;\n\n/**\n * Triggered when an animation stops.\n *\n * @param isReverse true if an animation is playing in reverse\n * @param animation an instance\n */\nexport type DAnimationOnStop<TARGET> = (isReverse: boolean, animation: DAnimation<TARGET>) => void;\n\n/**\n * An easing function.\n *\n * @param time a normalized elapsed time\n * @param animation an instance\n */\nexport type DAnimationTiming<TARGET> = (time: number, animation: DAnimation<TARGET>) => number;\n\n/**\n * {@link DAnimation} events.\n */\nexport interface DAnimationEvents<EMITTER> {\n\t/**\n\t * Triggered when an animation starts.\n\t *\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param emitter an emitter\n\t */\n\tstart(isReverse: boolean, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered constantly when an animation is on a run.\n\t *\n\t * @param time a timing value in a range [0, 1]\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param elapsedTime an elapsed time since an animation has started\n\t * @param emitter an emitter\n\t */\n\ttime(time: number, isReverse: boolean, elapsedTime: number, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when an animation ends.\n\t *\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param emitter an emitter\n\t */\n\tend(isReverse: boolean, emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when an animation stops.\n\t *\n\t * @param isReverse true if an animation is playing in reverse\n\t * @param emitter an emitter\n\t */\n\tstop(isReverse: boolean, emitter: EMITTER): void;\n}\n\n/**\n * {@link DAnimation} \"on\" options.\n */\nexport interface DAnimationOnOptions<EMITTER>\n\textends Partial<DAnimationEvents<EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DAnimation} options.\n */\nexport interface DAnimationOptions<TARGET, EMITTER = DAnimation<TARGET>> {\n\t/**\n\t * An animation target.\n\t */\n\ttarget?: TARGET | null;\n\n\t/**\n\t * A function called when an animation starts.\n\t */\n\tonStart?: DAnimationOnStart<TARGET>;\n\n\t/**\n\t * A function called constantly when an animation is on a run.\n\t */\n\tonTime?: DAnimationOnTime<TARGET>;\n\n\t/**\n\t * Triggered when an animation ends.\n\t */\n\tonEnd?: DAnimationOnEnd<TARGET>;\n\n\t/**\n\t * Triggered when an animation stops.\n\t */\n\tonStop?: DAnimationOnStop<TARGET>;\n\n\ttiming?: DAnimationTiming<TARGET>;\n\n\t/**\n\t * An animation duration.\n\t */\n\tduration?: number;\n\n\t/**\n\t * Event handlers.\n\t */\n\ton?: DAnimationOnOptions<EMITTER>;\n}\n\nexport interface DAnimation<TARGET = unknown> extends utils.EventEmitter {\n\t/**\n\t * An animation target.\n\t */\n\ttarget: TARGET | null;\n\n\t/**\n\t * An animation duration.\n\t */\n\tduration: number;\n\n\t/**\n\t * Starts an animation.\n\t *\n\t * @param reverse true to play in reverse.\n\t */\n\tstart(reverse?: boolean): void;\n\n\t/**\n\t * Returns true if an animation is playing.\n\t */\n\tisStarted(): boolean;\n\n\t/**\n\t * Returns true if an animation is in a reverse mode.\n\t */\n\tisReverse(): boolean;\n\n\t/**\n\t * Stops an animation as is.\n\t */\n\tstop(): void;\n\n\t/**\n\t * Moves an animation frame to the end.\n\t */\n\tend(): void;\n\n\ton<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\thandler: DAnimationEvents<this>[E],\n\t\tcontext?: any\n\t): this;\n\ton(event: string, handler: (...args: any[]) => any, context?: any): this;\n\n\tonce<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\thandler: DAnimationEvents<this>[E],\n\t\tcontext?: any\n\t): this;\n\tonce(event: string, handler: (...args: any[]) => any, context?: any): this;\n\n\temit<E extends keyof DAnimationEvents<this>>(\n\t\tevent: E,\n\t\t...args: Parameters<DAnimationEvents<this>[E]>\n\t): boolean;\n\temit(event: string, ...args: any): boolean;\n}\n"]}
@@ -7,11 +7,11 @@ import { UtilGestureModifier } from "./util/util-gesture-modifier";
7
7
  import { toEnum } from "./util/to-enum";
8
8
  import { UtilGesture } from "./util/util-gesture";
9
9
  var DViewGestureImpl = /** @class */ (function () {
10
- function DViewGestureImpl(parent, toTarget, stopper, constraint, theme, options) {
10
+ function DViewGestureImpl(owner, toTarget, parent, constraint, theme, options) {
11
11
  var _this = this;
12
12
  var _a, _b;
13
+ this._owner = owner;
13
14
  this._parent = parent;
14
- this._stopper = stopper;
15
15
  this._constraint = constraint;
16
16
  var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getGestureMode(), UtilGestureMode);
17
17
  var modifier = toEnum((_b = options === null || options === void 0 ? void 0 : options.modifier) !== null && _b !== void 0 ? _b : theme.getGestureModifier(), UtilGestureModifier);
@@ -25,24 +25,45 @@ var DViewGestureImpl = /** @class */ (function () {
25
25
  },
26
26
  on: {
27
27
  start: function () {
28
- _this._stopper.stop();
28
+ _this.onStart();
29
29
  },
30
30
  move: function (target, dx, dy, x, y, ds) {
31
- _this.onGestureMove(toTarget(parent), dx, dy, x, y, ds);
31
+ _this.onGestureMove(toTarget(owner), dx, dy, x, y, ds);
32
+ },
33
+ easing: {
34
+ end: function () {
35
+ _this.onEnd();
36
+ }
37
+ },
38
+ stop: function () {
39
+ _this.onStop();
32
40
  }
33
41
  }
34
42
  });
35
43
  }
36
44
  }
45
+ DViewGestureImpl.prototype.onStart = function () {
46
+ var parent = this._parent;
47
+ parent.stop();
48
+ parent.emit("start", this, parent);
49
+ };
50
+ DViewGestureImpl.prototype.onEnd = function () {
51
+ var parent = this._parent;
52
+ parent.emit("end", this, parent);
53
+ };
54
+ DViewGestureImpl.prototype.onStop = function () {
55
+ var parent = this._parent;
56
+ parent.emit("stop", this, parent);
57
+ };
37
58
  DViewGestureImpl.prototype.onGestureMove = function (target, dx, dy, x, y, ds) {
38
59
  if (target) {
39
60
  // Scale
40
- var stopper = this._stopper;
61
+ var parent_1 = this._parent;
41
62
  var oldScale = target.scale;
42
63
  var oldScaleX = oldScale.x;
43
64
  var oldScaleY = oldScale.y;
44
- var newScaleX = stopper.toNormalizedScale(oldScaleX * ds);
45
- var newScaleY = stopper.toNormalizedScale(oldScaleY * ds);
65
+ var newScaleX = parent_1.toNormalizedScale(oldScaleX * ds);
66
+ var newScaleY = parent_1.toNormalizedScale(oldScaleY * ds);
46
67
  var scaleRatioX = newScaleX / oldScaleX;
47
68
  var scaleRatioY = newScaleY / oldScaleY;
48
69
  var scaleRatio = ds < 1 ? Math.max(scaleRatioX, scaleRatioY) : Math.min(scaleRatioX, scaleRatioY);
@@ -60,11 +81,11 @@ var DViewGestureImpl = /** @class */ (function () {
60
81
  };
61
82
  DViewGestureImpl.prototype.stop = function () {
62
83
  var _a;
63
- (_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.stop(this._parent);
84
+ (_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.stop(this._owner);
64
85
  };
65
86
  DViewGestureImpl.prototype.onDown = function (e) {
66
87
  var _a;
67
- (_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.onDown(this._parent, e);
88
+ (_a = this._gestureUtil) === null || _a === void 0 ? void 0 : _a.onDown(this._owner, e);
68
89
  };
69
90
  return DViewGestureImpl;
70
91
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"d-view-gesture-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-gesture-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;IAMC,0BACC,MAAa,EACb,QAAuB,EACvB,OAAqB,EACrB,UAA2B,EAC3B,KAAwB,EACxB,OAA6B;QAN9B,iBA0CC;;QAlCA,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC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,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,iCAAM,GAAN,UAAO,CAA+B;;QACrC,MAAA,IAAI,CAAC,YAAY,0CAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IACF,uBAAC;AAAD,CAAC,AA7FD,IA6FC","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 { DViewStopper } from \"./d-view-stopper\";\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 _parent: DBase;\n\tprotected _stopper: DViewStopper;\n\tprotected _constraint: DViewConstraint;\n\tprotected _gestureUtil?: UtilGesture<DBase>;\n\n\tconstructor(\n\t\tparent: DBase,\n\t\ttoTarget: DViewToTarget,\n\t\tstopper: DViewStopper,\n\t\tconstraint: DViewConstraint,\n\t\ttheme: DThemeViewGesture,\n\t\toptions?: DViewGestureOptions\n\t) {\n\t\tthis._parent = parent;\n\t\tthis._stopper = stopper;\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: (): void => {\n\t\t\t\t\t\tthis._stopper.stop();\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(parent), dx, dy, x, y, ds);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\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 stopper = this._stopper;\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 = stopper.toNormalizedScale(oldScaleX * ds);\n\t\t\tlet newScaleY = stopper.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._parent);\n\t}\n\n\tonDown(e: interaction.InteractionEvent): void {\n\t\tthis._gestureUtil?.onDown(this._parent, e);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-view-gesture-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-view-gesture-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;IAMC,0BACC,KAAY,EACZ,QAAuB,EACvB,MAAmB,EACnB,UAA2B,EAC3B,KAAwB,EACxB,OAA6B;QAN9B,iBAkDC;;QA1CA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,IAAM,IAAI,GAAG,MAAM,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,KAAK,CAAC,cAAc,EAAE,EAAE,eAAe,CAAC,CAAC;QAC9E,IAAM,QAAQ,GAAG,MAAM,CACtB,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,KAAK,CAAC,kBAAkB,EAAE,EAC/C,mBAAmB,CACnB,CAAC;QACF,IAAI,IAAI,KAAK,eAAe,CAAC,EAAE,IAAI,IAAI,KAAK,eAAe,CAAC,KAAK,EAAE;YAClE,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAQ;gBAC1C,KAAK,EAAE,IAAI,KAAK,eAAe,CAAC,KAAK;gBACrC,QAAQ,UAAA;gBACR,OAAO,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AAJ;;QACC,MAAA,IAAI,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: (): void => {\n\t\t\t\t\t\tthis.onStart();\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: (): void => {\n\t\t\t\t\t\t\tthis.onEnd();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tstop: (): void => {\n\t\t\t\t\t\tthis.onStop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected onStart(): void {\n\t\tconst parent = this._parent;\n\t\tparent.stop();\n\t\tparent.emit(\"start\", this, parent);\n\t}\n\n\tprotected onEnd(): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"end\", this, parent);\n\t}\n\n\tprotected onStop(): void {\n\t\tconst parent = this._parent;\n\t\tparent.emit(\"stop\", this, 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"]}
@@ -2,7 +2,8 @@
2
2
  * Copyright (C) 2019 Toshiba Corporation
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { Point, Rectangle } from "pixi.js";
5
+ import { __extends } from "tslib";
6
+ import { Point, Rectangle, utils } from "pixi.js";
6
7
  import { UtilGestureModifier } from "./util/util-gesture-modifier";
7
8
  import { UtilGestureModifiers } from "./util/util-gesture-modifiers";
8
9
  import { DViewGestureImpl } from "./d-view-gesture-impl";
@@ -11,45 +12,61 @@ import { DThemes } from "./theme/d-themes";
11
12
  import { isString } from "./util/is-string";
12
13
  import { toEnum } from "./util/to-enum";
13
14
  import { UtilPointerEvent } from "./util/util-pointer-event";
14
- var DViewImpl = /** @class */ (function () {
15
+ var DViewImpl = /** @class */ (function (_super) {
16
+ __extends(DViewImpl, _super);
15
17
  function DViewImpl(parent, toTarget, options) {
18
+ var _this = this;
16
19
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
17
- this._parent = parent;
18
- this._toTarget = toTarget;
19
- this._constraint = (options && options.constraint) || DViewImpl.CONSTRAINT;
20
- this._workRect = new Rectangle();
20
+ _this = _super.call(this) || this;
21
+ _this._parent = parent;
22
+ _this._toTarget = toTarget;
23
+ _this._constraint = (options && options.constraint) || DViewImpl.CONSTRAINT;
24
+ _this._workRect = new Rectangle();
21
25
  // Theme
22
- var theme = this.toTheme(options) || this.getThemeDefault();
26
+ var theme = _this.toTheme(options) || _this.getThemeDefault();
23
27
  // Zoom
24
28
  var zoom = options === null || options === void 0 ? void 0 : options.zoom;
25
- this._zoomPoint = new Point();
26
- this._zoomMin = (_a = zoom === null || zoom === void 0 ? void 0 : zoom.min) !== null && _a !== void 0 ? _a : theme.getZoomMin();
27
- this._zoomMax = (_b = zoom === null || zoom === void 0 ? void 0 : zoom.max) !== null && _b !== void 0 ? _b : theme.getZoomMax();
28
- this._zoomKeepRatio = (_c = zoom === null || zoom === void 0 ? void 0 : zoom.keepRatio) !== null && _c !== void 0 ? _c : theme.getZoomKeepRatio();
29
+ _this._zoomPoint = new Point();
30
+ _this._zoomMin = (_a = zoom === null || zoom === void 0 ? void 0 : zoom.min) !== null && _a !== void 0 ? _a : theme.getZoomMin();
31
+ _this._zoomMax = (_b = zoom === null || zoom === void 0 ? void 0 : zoom.max) !== null && _b !== void 0 ? _b : theme.getZoomMax();
32
+ _this._zoomKeepRatio = (_c = zoom === null || zoom === void 0 ? void 0 : zoom.keepRatio) !== null && _c !== void 0 ? _c : theme.getZoomKeepRatio();
29
33
  // Zoom: Wheel
30
34
  var wheelZoom = zoom === null || zoom === void 0 ? void 0 : zoom.wheel;
31
- this._isWheelZoomEnabled = (_d = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.enable) !== null && _d !== void 0 ? _d : theme.isWheelZoomEnabled();
32
- this._wheelZoomSpeed = (_e = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.speed) !== null && _e !== void 0 ? _e : theme.getWheelZoomSpeed();
33
- this._wheelZoomModifier = toEnum((_f = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.modifier) !== null && _f !== void 0 ? _f : theme.getWheelZoomModifier(), UtilGestureModifier);
34
- this._wheelZoomChecker = (_g = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.checker) !== null && _g !== void 0 ? _g : UtilGestureModifiers.match;
35
+ _this._isWheelZoomEnabled = (_d = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.enable) !== null && _d !== void 0 ? _d : theme.isWheelZoomEnabled();
36
+ _this._wheelZoomSpeed = (_e = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.speed) !== null && _e !== void 0 ? _e : theme.getWheelZoomSpeed();
37
+ _this._wheelZoomModifier = toEnum((_f = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.modifier) !== null && _f !== void 0 ? _f : theme.getWheelZoomModifier(), UtilGestureModifier);
38
+ _this._wheelZoomChecker = (_g = wheelZoom === null || wheelZoom === void 0 ? void 0 : wheelZoom.checker) !== null && _g !== void 0 ? _g : UtilGestureModifiers.match;
35
39
  // Zoom: Dbl click
36
40
  var dblClickZoom = zoom === null || zoom === void 0 ? void 0 : zoom.dblclick;
37
- this._isDblClickZoomEnabled = (_h = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.enable) !== null && _h !== void 0 ? _h : theme.isDblClickZoomEnabled();
38
- this._dblClickZoomSpeed = (_j = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.amount) !== null && _j !== void 0 ? _j : theme.getDblClickZoomSpeed();
39
- this._dblClickZoomModifier = toEnum((_k = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.modifier) !== null && _k !== void 0 ? _k : theme.getDblClickZoomModifier(), UtilGestureModifier);
40
- this._dblClickZoomChecker = (_l = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.checker) !== null && _l !== void 0 ? _l : UtilGestureModifiers.match;
41
- this._dblclickZoomDuration = (_m = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.duration) !== null && _m !== void 0 ? _m : theme.getDblClickZoomDuration();
41
+ _this._isDblClickZoomEnabled = (_h = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.enable) !== null && _h !== void 0 ? _h : theme.isDblClickZoomEnabled();
42
+ _this._dblClickZoomSpeed = (_j = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.amount) !== null && _j !== void 0 ? _j : theme.getDblClickZoomSpeed();
43
+ _this._dblClickZoomModifier = toEnum((_k = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.modifier) !== null && _k !== void 0 ? _k : theme.getDblClickZoomModifier(), UtilGestureModifier);
44
+ _this._dblClickZoomChecker = (_l = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.checker) !== null && _l !== void 0 ? _l : UtilGestureModifiers.match;
45
+ _this._dblclickZoomDuration = (_m = dblClickZoom === null || dblClickZoom === void 0 ? void 0 : dblClickZoom.duration) !== null && _m !== void 0 ? _m : theme.getDblClickZoomDuration();
42
46
  // Translation: Wheel
43
47
  var wheelTranslation = (_o = options === null || options === void 0 ? void 0 : options.translation) === null || _o === void 0 ? void 0 : _o.wheel;
44
- this._isWheelTranslationEnabled =
48
+ _this._isWheelTranslationEnabled =
45
49
  (_p = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.enable) !== null && _p !== void 0 ? _p : theme.isWheelTranslationEnabled();
46
- this._wheelTranslationSpeed = (_q = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.speed) !== null && _q !== void 0 ? _q : theme.getWheelTranslationSpeed();
47
- this._wheelTranslationModifier = toEnum((_r = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.modifier) !== null && _r !== void 0 ? _r : theme.getWheelTranslationModifier(), UtilGestureModifier);
48
- this._wheelTranslationChecker = (_s = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.checker) !== null && _s !== void 0 ? _s : UtilGestureModifiers.match;
50
+ _this._wheelTranslationSpeed = (_q = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.speed) !== null && _q !== void 0 ? _q : theme.getWheelTranslationSpeed();
51
+ _this._wheelTranslationModifier = toEnum((_r = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.modifier) !== null && _r !== void 0 ? _r : theme.getWheelTranslationModifier(), UtilGestureModifier);
52
+ _this._wheelTranslationChecker = (_s = wheelTranslation === null || wheelTranslation === void 0 ? void 0 : wheelTranslation.checker) !== null && _s !== void 0 ? _s : UtilGestureModifiers.match;
49
53
  // Gesture
50
- this._gesture = new DViewGestureImpl(parent, toTarget, this, this._constraint, theme, options === null || options === void 0 ? void 0 : options.gesture);
54
+ _this._gesture = new DViewGestureImpl(parent, toTarget, _this, _this._constraint, theme, options === null || options === void 0 ? void 0 : options.gesture);
51
55
  // Transform
52
- this._transform = new DViewTransformImpl(parent, toTarget, this, this._constraint, this._dblclickZoomDuration);
56
+ _this._transform = new DViewTransformImpl(parent, toTarget, _this, _this._constraint, _this._dblclickZoomDuration);
57
+ // Events
58
+ if (options != null) {
59
+ var on = options.on;
60
+ if (on != null) {
61
+ for (var name_1 in on) {
62
+ var handler = on[name_1];
63
+ if (handler) {
64
+ _this.on(name_1, handler);
65
+ }
66
+ }
67
+ }
68
+ }
69
+ return _this;
53
70
  }
54
71
  Object.defineProperty(DViewImpl.prototype, "gesture", {
55
72
  get: function () {
@@ -276,6 +293,6 @@ var DViewImpl = /** @class */ (function () {
276
293
  target.position.set(x, y);
277
294
  };
278
295
  return DViewImpl;
279
- }());
296
+ }(utils.EventEmitter));
280
297
  export { DViewImpl };
281
298
  //# sourceMappingURL=d-view-impl.js.map