@wcardinal/wcardinal-ui 0.335.0 → 0.337.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 (35) hide show
  1. package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +3 -3
  2. package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +1 -1
  3. package/dist/types/wcardinal/ui/d-dialog-select.d.ts +1 -1
  4. package/dist/types/wcardinal/ui/d-view-gesture-impl.d.ts +3 -3
  5. package/dist/types/wcardinal/ui/d-view.d.ts +51 -10
  6. package/dist/types/wcardinal/ui/shape/action/e-shape-action-open-opener.d.ts +1 -1
  7. package/dist/types/wcardinal/ui/shape/action/e-shape-action-runtime-open.d.ts +1 -1
  8. package/dist/types/wcardinal/ui/shape/action/e-shape-actions.d.ts +1 -1
  9. package/dist/wcardinal/ui/d-dialog-select-search-impl.js +1 -1
  10. package/dist/wcardinal/ui/d-dialog-select-search-impl.js.map +1 -1
  11. package/dist/wcardinal/ui/d-dialog-select-search.js.map +1 -1
  12. package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
  13. package/dist/wcardinal/ui/d-view-gesture-impl.js +12 -12
  14. package/dist/wcardinal/ui/d-view-gesture-impl.js.map +1 -1
  15. package/dist/wcardinal/ui/d-view-impl.js +2 -0
  16. package/dist/wcardinal/ui/d-view-impl.js.map +1 -1
  17. package/dist/wcardinal/ui/d-view-transform-impl.js +3 -3
  18. package/dist/wcardinal/ui/d-view-transform-impl.js.map +1 -1
  19. package/dist/wcardinal/ui/d-view.js.map +1 -1
  20. package/dist/wcardinal/ui/shape/action/e-shape-action-open-opener.js.map +1 -1
  21. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open.js +1 -1
  22. package/dist/wcardinal/ui/shape/action/e-shape-action-runtime-open.js.map +1 -1
  23. package/dist/wcardinal/ui/shape/action/e-shape-actions.js +2 -1
  24. package/dist/wcardinal/ui/shape/action/e-shape-actions.js.map +1 -1
  25. package/dist/wcardinal/ui/util/util-gesture.js +3 -2
  26. package/dist/wcardinal/ui/util/util-gesture.js.map +1 -1
  27. package/dist/wcardinal-ui-theme-dark.js +1 -1
  28. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  29. package/dist/wcardinal-ui-theme-white.js +1 -1
  30. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  31. package/dist/wcardinal-ui.cjs.js +24 -21
  32. package/dist/wcardinal-ui.js +24 -21
  33. package/dist/wcardinal-ui.min.js +2 -2
  34. package/dist/wcardinal-ui.min.js.map +1 -1
  35. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { utils } from "pixi.js";
2
2
  import { DDialogSelectSearch } from "./d-dialog-select-search";
3
3
  export declare class DDialogSelectSearhImpl<VALUE, CATEGORY, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
4
- protected _search: (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>;
4
+ protected _search: (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>;
5
5
  protected _id: number;
6
6
  protected _idCompleted: number;
7
- constructor(search?: (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>);
8
- create(args: [string, CATEGORY_ID]): void;
7
+ constructor(search?: (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>);
8
+ create(args: [string, (CATEGORY_ID | null)?]): void;
9
9
  isDone(): boolean;
10
10
  }
@@ -2,7 +2,7 @@
2
2
  * {@link DDialogSelect} search object.
3
3
  */
4
4
  export interface DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
5
- create(args: [string, CATEGORY_ID | null]): void;
5
+ create(args: [string, (CATEGORY_ID | null)?]): void;
6
6
  on(event: "success", handler: (e: unknown, searchResults: VALUE[]) => void): void;
7
7
  on(event: "fail", handler: () => void): void;
8
8
  on(event: "change", handler: () => void): void;
@@ -18,7 +18,7 @@ export interface DDialogSelectInputOpitons extends DInputSearchOptions {
18
18
  /**
19
19
  * {@link DDialogSelect} search function.
20
20
  */
21
- export declare type DDialogSelectSearchFunction<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> = (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>;
21
+ export declare type DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID> = (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>;
22
22
  /**
23
23
  * {@link DDialogSelect} controller.
24
24
  */
@@ -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 view operation starts.
86
+ * Triggered when a gesture starts.
88
87
  *
89
- * @param operation a view operation
88
+ * @param target an operation target
90
89
  * @param emitter an emitter
91
90
  */
92
- start(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
91
+ gesturestart(target: DBase, emitter: EMITTER): void;
93
92
  /**
94
- * Triggered when a view operation ends.
93
+ * Triggered when a gesture ends.
95
94
  *
96
- * @param operation a view operation
95
+ * @param target an operation target
97
96
  * @param emitter an emitter
98
97
  */
99
- end(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
98
+ gestureend(target: DBase, emitter: EMITTER): void;
100
99
  /**
101
- * Triggered when a view operation stops.
100
+ * Triggered when a gesture stops.
102
101
  *
103
- * @param operation a view operation
102
+ * @param target an operation target
104
103
  * @param emitter an emitter
105
104
  */
106
- stop(operation: DViewTransform | DViewGesture, emitter: EMITTER): void;
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: string, inNewWindow: boolean, shape: EShape) => void;
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<string | null>;
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: string, inNewWindow: boolean): void;
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;
@@ -8,7 +8,7 @@ var DDialogSelectSearhImpl = /** @class */ (function (_super) {
8
8
  __extends(DDialogSelectSearhImpl, _super);
9
9
  function DDialogSelectSearhImpl(search) {
10
10
  var _this = _super.call(this) || this;
11
- _this._search = search || (function (_) { return Promise.resolve([]); });
11
+ _this._search = search || (function () { return Promise.resolve([]); });
12
12
  _this._id = 0;
13
13
  _this._idCompleted = 0;
14
14
  return _this;
@@ -1 +1 @@
1
- {"version":3,"file":"d-dialog-select-search-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-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,IAAI,CAAC,YAAY,CAAC;IACvC,CAAC;IACF,6BAAC;AAAD,CAAC,AAxCD,CACS,KAAK,CAAC,YAAY,GAuC1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\n\nexport class DDialogSelectSearhImpl<VALUE, CATEGORY, CATEGORY_ID>\n\textends utils.EventEmitter\n\timplements DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n{\n\tprotected _search: (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>;\n\tprotected _id: number;\n\tprotected _idCompleted: number;\n\n\tconstructor(search?: (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>) {\n\t\tsuper();\n\n\t\tthis._search = search || ((_: string) => Promise.resolve([]));\n\t\tthis._id = 0;\n\t\tthis._idCompleted = 0;\n\t}\n\n\tcreate(args: [string, CATEGORY_ID]): void {\n\t\tconst id = ++this._id;\n\t\tthis._search(args[0], args[1]).then(\n\t\t\t(searchResult: VALUE[]) => {\n\t\t\t\tif (this._id === id) {\n\t\t\t\t\tthis._idCompleted = id;\n\t\t\t\t\tthis.emit(\"success\", this, searchResult);\n\t\t\t\t\tthis.emit(\"change\", this);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (this._id === id) {\n\t\t\t\t\tthis._idCompleted = id;\n\t\t\t\t\tthis.emit(\"fail\", this);\n\t\t\t\t\tthis.emit(\"change\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisDone(): boolean {\n\t\treturn this._id === this._idCompleted;\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-dialog-select-search-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EA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AC,YAAY,GAuC1B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { utils } from \"pixi.js\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\n\nexport class DDialogSelectSearhImpl<VALUE, CATEGORY, CATEGORY_ID>\n\textends utils.EventEmitter\n\timplements DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n{\n\tprotected _search: (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>;\n\tprotected _id: number;\n\tprotected _idCompleted: number;\n\n\tconstructor(search?: (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>) {\n\t\tsuper();\n\n\t\tthis._search = search || (() => Promise.resolve([]));\n\t\tthis._id = 0;\n\t\tthis._idCompleted = 0;\n\t}\n\n\tcreate(args: [string, (CATEGORY_ID | null)?]): void {\n\t\tconst id = ++this._id;\n\t\tthis._search(args[0], args[1]).then(\n\t\t\t(searchResult: VALUE[]) => {\n\t\t\t\tif (this._id === id) {\n\t\t\t\t\tthis._idCompleted = id;\n\t\t\t\t\tthis.emit(\"success\", this, searchResult);\n\t\t\t\t\tthis.emit(\"change\", this);\n\t\t\t\t}\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tif (this._id === id) {\n\t\t\t\t\tthis._idCompleted = id;\n\t\t\t\t\tthis.emit(\"fail\", this);\n\t\t\t\t\tthis.emit(\"change\", this);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\tthis.emit(\"change\", this);\n\t}\n\n\tisDone(): boolean {\n\t\treturn this._id === this._idCompleted;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"d-dialog-select-search.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * {@link DDialogSelect} search object.\n */\nexport interface DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\tcreate(args: [string, CATEGORY_ID | null]): void;\n\ton(event: \"success\", handler: (e: unknown, searchResults: VALUE[]) => void): void;\n\ton(event: \"fail\", handler: () => void): void;\n\ton(event: \"change\", handler: () => void): void;\n\tisDone(): boolean;\n}\n"]}
1
+ {"version":3,"file":"d-dialog-select-search.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * {@link DDialogSelect} search object.\n */\nexport interface DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\tcreate(args: [string, (CATEGORY_ID | null)?]): void;\n\ton(event: \"success\", handler: (e: unknown, searchResults: VALUE[]) => void): void;\n\ton(event: \"fail\", handler: () => void): void;\n\ton(event: \"change\", handler: () => void): void;\n\tisDone(): boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"d-dialog-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EACN,cAAc,EAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAuB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BA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,IAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAChD,IAAI,gBAAgB,EAAE;YACrB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAAE,CAAC;SAC5B;QACD,IAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,aAAa,EAAE;YAClB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,EAAE,CAAC;SACzB;QACD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;SACf;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,oBAAC;AAAD,CAAC,AAhdD,CAeU,cAAc,GAicvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport {\n\tDDialogLayered,\n\tDDialogLayeredEvents,\n\tDDialogLayeredOptions,\n\tDThemeDialogLayered\n} from \"./d-dialog-layered\";\nimport { DDialogSelectList, DDialogSelectListOptions } from \"./d-dialog-select-list\";\nimport { DDialogSelectSearhImpl } from \"./d-dialog-select-search-impl\";\nimport { DInputSearch, DInputSearchOptions } from \"./d-input-search\";\nimport { DLayoutHorizontal } from \"./d-layout-horizontal\";\nimport { DLayoutSpace } from \"./d-layout-space\";\nimport { DListOptions } from \"./d-list\";\nimport { DListDataSelection } from \"./d-list-data-selection\";\nimport { DNote, DNoteOptions } from \"./d-note\";\nimport { DNoteSmallError } from \"./d-note-small-error\";\nimport { DNoteSmallNoItemsFound } from \"./d-note-small-no-items-found\";\nimport { DNoteSmallSearching } from \"./d-note-small-searching\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { UtilTransition } from \"./util/util-transition\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\nimport { DDialogSelectSearhDismissableOptions } from \"./d-dialog-select-search-dismissable\";\nimport { DDialogSelectSearhDismissableImpl } from \"./d-dialog-select-search-dismissable-impl\";\nimport { DSelect, DSelectOptions } from \"./d-select\";\nimport { DMenu } from \"./d-menu\";\nimport { isArray } from \"./util/is-array\";\n\nexport interface DDialogSelectInputOpitons extends DInputSearchOptions {\n\tmargin?: number;\n}\n\n/**\n * {@link DDialogSelect} search function.\n */\nexport type DDialogSelectSearchFunction<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> = (\n\tword: string,\n\tcategoryId: CATEGORY_ID\n) => Promise<VALUE[]>;\n\n/**\n * {@link DDialogSelect} controller.\n */\nexport interface DDialogSelectController<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> {\n\tsearch:\n\t\t| DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n\t\t| DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;\n\tgetCategories?: () => Promise<CATEGORY[]>;\n}\n\n/**\n * {@link DDialogSelect} note options.\n */\nexport interface DDialogSelectNoteOptions {\n\terror?: DNoteOptions | null;\n\tnoItemsFound?: DNoteOptions | null;\n\tsearching?: DNoteOptions | null;\n}\n\nexport type DDialogSelectItemToLabel<VALUE> = (result: VALUE, caller: any) => string;\n\nexport type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, caller: any) => boolean;\n\n/**\n * {@link DDialogSelect} events.\n */\nexport interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {\n\tselect(value: VALUE, self: EMITTER): void;\n}\n\n/**\n * {@link DDialogSelect} category options.\n */\nexport interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>\n\textends DSelectOptions<CATEGORY_ID> {\n\ttoId?: (category: CATEGORY) => CATEGORY_ID;\n\ttoLabel?: (category: CATEGORY) => string;\n}\n\n/**\n * {@link DDialogSelect} \"on\" options.\n */\nexport interface DDialogSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DDialogSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DDialogSelect} options.\n */\nexport interface DDialogSelectOptions<\n\tVALUE,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tEMITTER = any\n> extends DDialogLayeredOptions<VALUE, THEME> {\n\tcontroller?: DDialogSelectController<VALUE, CATEGORY, CATEGORY_ID>;\n\tcategory?: DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tdismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tinput?: DDialogSelectInputOpitons;\n\tlist?: DListOptions<VALUE>;\n\tnote?: DDialogSelectNoteOptions;\n\ton?: DDialogSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DDialogSelect} theme.\n */\nexport interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown>\n\textends DThemeDialogLayered {\n\tgetInputMargin(): number;\n\ttoCategoryId(category: CATEGORY): CATEGORY_ID;\n\ttoCategoryLabel(category: CATEGORY): string;\n}\n\nexport class DDialogSelect<\n\tVALUE = unknown,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tOPTIONS extends DDialogSelectOptions<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID,\n\t\tTHEME\n\t> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>\n> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\tprotected _spaceLeft?: DLayoutSpace;\n\tprotected _spaceRight?: DLayoutSpace;\n\tprotected _selectCategory?: DSelect<CATEGORY_ID> | null;\n\tprotected _isCategoryFetched?: boolean;\n\tprotected _input?: DInputSearch;\n\tprotected _inputLayout?: DLayoutHorizontal;\n\tprotected _list?: DDialogSelectList<VALUE>;\n\tprotected _search?: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;\n\tprotected _noteError?: DNote | null;\n\tprotected _noteNoItemsFound?: DNote | null;\n\tprotected _noteSearching?: DNote | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis._value = null;\n\n\t\t// Controller binding\n\t\tconst transition = new UtilTransition();\n\t\tconst search = this.search;\n\t\tsearch.on(\"success\", (e: unknown, results: VALUE[]): void => {\n\t\t\tif (0 < results.length) {\n\t\t\t\ttransition.hide();\n\t\t\t} else {\n\t\t\t\ttransition.show(this.noteNoItemsFound);\n\t\t\t}\n\t\t\tthis.onSearched(results);\n\t\t});\n\t\tsearch.on(\"fail\", (): void => {\n\t\t\ttransition.show(this.noteError);\n\t\t\tthis.onSearched([]);\n\t\t});\n\t\tsearch.on(\"change\", (): void => {\n\t\t\tif (!search.isDone()) {\n\t\t\t\tconst noteSearching = this.noteSearching;\n\t\t\t\tif (noteSearching) {\n\t\t\t\t\ttransition.show(noteSearching);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected newContentChildren(theme: THEME, options?: OPTIONS): Array<DisplayObject | null> {\n\t\tconst result = super.newContentChildren(theme, options);\n\t\tresult.push(this.inputLayout, this.list);\n\t\treturn result;\n\t}\n\n\tprotected get inputLayout(): DLayoutHorizontal {\n\t\tlet result = this._inputLayout;\n\t\tif (result == null) {\n\t\t\tresult = this.newInputLayout();\n\t\t\tthis._inputLayout = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInputLayout(): DLayoutHorizontal {\n\t\treturn new DLayoutHorizontal({\n\t\t\twidth: \"padding\",\n\t\t\theight: \"auto\",\n\t\t\tchildren: [this.spaceLeft, this.selectCategory, this.input, this.spaceRight]\n\t\t});\n\t}\n\n\tprotected get spaceLeft(): DLayoutSpace {\n\t\tlet result = this._spaceLeft;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceLeft = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get spaceRight(): DLayoutSpace {\n\t\tlet result = this._spaceRight;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceRight = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSpace(): DLayoutSpace {\n\t\treturn new DLayoutSpace({\n\t\t\twidth: this.toInputMargin(this.theme, this._options)\n\t\t});\n\t}\n\n\tprotected get selectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tlet result = this._selectCategory;\n\t\tif (result === undefined) {\n\t\t\tresult = this.newSelectCategory();\n\t\t\tthis._selectCategory = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSelectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\tconst result = new DSelect<CATEGORY_ID>(\n\t\t\t\t\tthis.toSelectCategoryOptions(this.theme, this._options)\n\t\t\t\t);\n\t\t\t\tresult.on(\"change\", (value: CATEGORY_ID) => {\n\t\t\t\t\tthis.onSelectCategoryChange(value);\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toSelectCategoryOptions(\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DSelectOptions<CATEGORY_ID> {\n\t\tconst result = options?.category || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.width = 140;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onSelectCategoryChange(categoryId: CATEGORY_ID): void {\n\t\tthis.search.create([this.input.value, categoryId]);\n\t}\n\n\tget input(): DInputSearch {\n\t\tlet result = this._input;\n\t\tif (result == null) {\n\t\t\tresult = this.newInput();\n\t\t\tthis._input = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInput(): DInputSearch {\n\t\tconst result = new DInputSearch(this.toInputOptions(this.theme, this._options));\n\t\tresult.on(\"input\", (value: string): void => {\n\t\t\tthis.onInputInput(value);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected toInputOptions(theme: THEME, options?: OPTIONS): DInputSearchOptions {\n\t\tconst result = options?.input || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.weight = 1;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toInputMargin(theme: THEME, options?: OPTIONS): number {\n\t\treturn options?.input?.margin ?? theme.getInputMargin();\n\t}\n\n\tprotected onInputInput(value: string): void {\n\t\tthis.search.create([value, this.selectCategory?.value ?? null]);\n\t}\n\n\tget list(): DDialogSelectList<VALUE> {\n\t\tlet result = this._list;\n\t\tif (result == null) {\n\t\t\tresult = this.newList();\n\t\t\tthis._list = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newList(): DDialogSelectList<VALUE> {\n\t\tconst result = new DDialogSelectList<VALUE>(this.toListOptions(this.theme, this._options));\n\t\tresult.selection.on(\"change\", (selection: DListDataSelection<VALUE>): void => {\n\t\t\tthis.onListSelectionChange(selection);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected onListSelectionChange(selection: DListDataSelection<VALUE>): void {\n\t\tlet selected = selection.first;\n\t\tif (selected == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst dismiss = options.dismiss;\n\t\t\tif (dismiss) {\n\t\t\t\tif (selected === dismiss.value) {\n\t\t\t\t\tselected = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._value = selected;\n\t\tthis.onOk(selected);\n\t}\n\n\tprotected toListOptions(theme: THEME, options?: OPTIONS): DDialogSelectListOptions<VALUE> {\n\t\tconst result = options?.list || {};\n\t\tif (result.width === undefined) {\n\t\t\tresult.width = \"padding\";\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get noteError(): DNote | null {\n\t\tlet result = this._noteError;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteError();\n\t\t\tthis._noteError = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteError(): DNote | null {\n\t\tconst error = this._options?.note?.error;\n\t\tif (error !== null) {\n\t\t\treturn new DNoteSmallError(this.toNoteOptions(this.list, error));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteNoItemsFound(): DNote | null {\n\t\tlet result = this._noteNoItemsFound;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteNoItemsFound();\n\t\t\tthis._noteNoItemsFound = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteNoItemsFound(): DNote | null {\n\t\tconst noItemsFound = this._options?.note?.noItemsFound;\n\t\tif (noItemsFound !== null) {\n\t\t\treturn new DNoteSmallNoItemsFound(this.toNoteOptions(this.list, noItemsFound));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteSearching(): DNote | null {\n\t\tlet result = this._noteSearching;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteSearching();\n\t\t\tthis._noteSearching = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteSearching(): DNote | null {\n\t\tconst searching = this._options?.note?.searching;\n\t\t// Because the `searching` note is disabled by default,\n\t\t// if options.searching is missing, i.e., if its value is undefined,\n\t\t// this method returns null. This is why `!=` is used here instead of `!==`.\n\t\tif (searching != null) {\n\t\t\treturn new DNoteSmallSearching(this.toNoteOptions(this.list, searching));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions {\n\t\tif (options != null) {\n\t\t\tif (options.parent == null) {\n\t\t\t\toptions.parent = parent;\n\t\t\t}\n\t\t\tif (options.visible == null) {\n\t\t\t\toptions.visible = false;\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\t\treturn {\n\t\t\tparent,\n\t\t\tvisible: false\n\t\t};\n\t}\n\n\tprotected get search(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tlet result = this._search;\n\t\tif (result == null) {\n\t\t\tresult = this.newSearch();\n\t\t\tthis._search = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSearch(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller) {\n\t\t\t\tconst dismiss = options.dismiss;\n\t\t\t\tconst search = controller.search;\n\t\t\t\tif (\"create\" in search) {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(search, dismiss);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn search;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(\n\t\t\t\t\t\t\tnew DDialogSelectSearhImpl(search),\n\t\t\t\t\t\t\tdismiss\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new DDialogSelectSearhImpl(search);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new DDialogSelectSearhImpl();\n\t}\n\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\tprotected onSearched(results: VALUE[]): void {\n\t\tthis.list.data.items = results;\n\t}\n\n\tprotected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null> {\n\t\treturn this._value;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialogSelect\";\n\t}\n\n\tprotected onOpen(): void {\n\t\tsuper.onOpen();\n\t\tthis.list.selection.clear();\n\t\tconst selectCategory = this.selectCategory;\n\t\tif (selectCategory != null) {\n\t\t\tif (this._isCategoryFetched !== true) {\n\t\t\t\tthis._isCategoryFetched = true;\n\t\t\t\tconst categoriesOrPromise = this.findCategories();\n\t\t\t\tif (categoriesOrPromise == null) {\n\t\t\t\t\tthis.search.create([this.input.value, null]);\n\t\t\t\t} else if (isArray(categoriesOrPromise)) {\n\t\t\t\t\tthis.onCategoryFetched(selectCategory, categoriesOrPromise);\n\t\t\t\t} else {\n\t\t\t\t\tselectCategory.state.isEnabled = false;\n\t\t\t\t\tcategoriesOrPromise.then((categories) => {\n\t\t\t\t\t\tselectCategory.state.isEnabled = true;\n\t\t\t\t\t\tthis.onCategoryFetched(selectCategory, categories);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.search.create([this.input.value, selectCategory.value]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.search.create([this.input.value, null]);\n\t\t}\n\t}\n\n\tprotected onCategoryFetched(\n\t\tselectCategory: DSelect<CATEGORY_ID>,\n\t\tcategories: CATEGORY[]\n\t): void {\n\t\tconst items = [];\n\t\tfor (let i = 0, imax = categories.length; i < imax; ++i) {\n\t\t\tconst category = categories[i];\n\t\t\titems.push({\n\t\t\t\tvalue: this.toCategoryId(category),\n\t\t\t\ttext: {\n\t\t\t\t\tvalue: this.toCategoryLabel(category)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tselectCategory.menu = new DMenu<CATEGORY_ID>({\n\t\t\tfit: true,\n\t\t\titems\n\t\t});\n\t\tconst newValue = 0 < items.length ? items[0].value : null;\n\t\tselectCategory.value = newValue;\n\t\tselectCategory.show();\n\t\tthis.search.create([this.input.value, newValue]);\n\t}\n\n\tprotected toCategoryId(target: CATEGORY): CATEGORY_ID {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toId = category.toId;\n\t\t\t\tif (toId != null) {\n\t\t\t\t\treturn toId(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryId(target);\n\t}\n\n\tprotected toCategoryLabel(target: CATEGORY): string {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toLabel = category.toLabel;\n\t\t\t\tif (toLabel != null) {\n\t\t\t\t\treturn toLabel(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryLabel(target);\n\t}\n\n\tprotected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\treturn controller.getCategories();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void {\n\t\tthis.emit(\"select\", value, this);\n\t\tsuper.onOk(value);\n\t}\n\n\tdestroy(): void {\n\t\tconst input = this._input;\n\t\tif (input) {\n\t\t\tinput.destroy();\n\t\t}\n\t\tconst noteError = this._noteError;\n\t\tif (noteError) {\n\t\t\tnoteError.destroy();\n\t\t}\n\t\tconst noteNoItemsFound = this._noteNoItemsFound;\n\t\tif (noteNoItemsFound) {\n\t\t\tnoteNoItemsFound?.destroy();\n\t\t}\n\t\tconst noteSearching = this._noteSearching;\n\t\tif (noteSearching) {\n\t\t\tnoteSearching?.destroy();\n\t\t}\n\t\tconst list = this._list;\n\t\tif (list) {\n\t\t\tlist.destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-dialog-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EACN,cAAc,EAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAA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AC;QACjC,iBAAM,IAAI,YAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED,+BAAO,GAAP;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,OAAO,EAAE,CAAC;SAChB;QACD,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,SAAS,EAAE;YACd,SAAS,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,IAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAChD,IAAI,gBAAgB,EAAE;YACrB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAAE,CAAC;SAC5B;QACD,IAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,aAAa,EAAE;YAClB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,EAAE,CAAC;SACzB;QACD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;SACf;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,oBAAC;AAAD,CAAC,AAhdD,CAeU,cAAc,GAicvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport {\n\tDDialogLayered,\n\tDDialogLayeredEvents,\n\tDDialogLayeredOptions,\n\tDThemeDialogLayered\n} from \"./d-dialog-layered\";\nimport { DDialogSelectList, DDialogSelectListOptions } from \"./d-dialog-select-list\";\nimport { DDialogSelectSearhImpl } from \"./d-dialog-select-search-impl\";\nimport { DInputSearch, DInputSearchOptions } from \"./d-input-search\";\nimport { DLayoutHorizontal } from \"./d-layout-horizontal\";\nimport { DLayoutSpace } from \"./d-layout-space\";\nimport { DListOptions } from \"./d-list\";\nimport { DListDataSelection } from \"./d-list-data-selection\";\nimport { DNote, DNoteOptions } from \"./d-note\";\nimport { DNoteSmallError } from \"./d-note-small-error\";\nimport { DNoteSmallNoItemsFound } from \"./d-note-small-no-items-found\";\nimport { DNoteSmallSearching } from \"./d-note-small-searching\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { UtilTransition } from \"./util/util-transition\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\nimport { DDialogSelectSearhDismissableOptions } from \"./d-dialog-select-search-dismissable\";\nimport { DDialogSelectSearhDismissableImpl } from \"./d-dialog-select-search-dismissable-impl\";\nimport { DSelect, DSelectOptions } from \"./d-select\";\nimport { DMenu } from \"./d-menu\";\nimport { isArray } from \"./util/is-array\";\n\nexport interface DDialogSelectInputOpitons extends DInputSearchOptions {\n\tmargin?: number;\n}\n\n/**\n * {@link DDialogSelect} search function.\n */\nexport type DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID> = (\n\tword: string,\n\tcategoryId?: CATEGORY_ID | null\n) => Promise<VALUE[]>;\n\n/**\n * {@link DDialogSelect} controller.\n */\nexport interface DDialogSelectController<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> {\n\tsearch:\n\t\t| DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n\t\t| DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;\n\tgetCategories?: () => Promise<CATEGORY[]>;\n}\n\n/**\n * {@link DDialogSelect} note options.\n */\nexport interface DDialogSelectNoteOptions {\n\terror?: DNoteOptions | null;\n\tnoItemsFound?: DNoteOptions | null;\n\tsearching?: DNoteOptions | null;\n}\n\nexport type DDialogSelectItemToLabel<VALUE> = (result: VALUE, caller: any) => string;\n\nexport type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, caller: any) => boolean;\n\n/**\n * {@link DDialogSelect} events.\n */\nexport interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {\n\tselect(value: VALUE, self: EMITTER): void;\n}\n\n/**\n * {@link DDialogSelect} category options.\n */\nexport interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>\n\textends DSelectOptions<CATEGORY_ID> {\n\ttoId?: (category: CATEGORY) => CATEGORY_ID;\n\ttoLabel?: (category: CATEGORY) => string;\n}\n\n/**\n * {@link DDialogSelect} \"on\" options.\n */\nexport interface DDialogSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DDialogSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DDialogSelect} options.\n */\nexport interface DDialogSelectOptions<\n\tVALUE,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tEMITTER = any\n> extends DDialogLayeredOptions<VALUE, THEME> {\n\tcontroller?: DDialogSelectController<VALUE, CATEGORY, CATEGORY_ID>;\n\tcategory?: DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tdismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tinput?: DDialogSelectInputOpitons;\n\tlist?: DListOptions<VALUE>;\n\tnote?: DDialogSelectNoteOptions;\n\ton?: DDialogSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DDialogSelect} theme.\n */\nexport interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown>\n\textends DThemeDialogLayered {\n\tgetInputMargin(): number;\n\ttoCategoryId(category: CATEGORY): CATEGORY_ID;\n\ttoCategoryLabel(category: CATEGORY): string;\n}\n\nexport class DDialogSelect<\n\tVALUE = unknown,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tOPTIONS extends DDialogSelectOptions<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID,\n\t\tTHEME\n\t> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>\n> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\tprotected _spaceLeft?: DLayoutSpace;\n\tprotected _spaceRight?: DLayoutSpace;\n\tprotected _selectCategory?: DSelect<CATEGORY_ID> | null;\n\tprotected _isCategoryFetched?: boolean;\n\tprotected _input?: DInputSearch;\n\tprotected _inputLayout?: DLayoutHorizontal;\n\tprotected _list?: DDialogSelectList<VALUE>;\n\tprotected _search?: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;\n\tprotected _noteError?: DNote | null;\n\tprotected _noteNoItemsFound?: DNote | null;\n\tprotected _noteSearching?: DNote | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis._value = null;\n\n\t\t// Controller binding\n\t\tconst transition = new UtilTransition();\n\t\tconst search = this.search;\n\t\tsearch.on(\"success\", (e: unknown, results: VALUE[]): void => {\n\t\t\tif (0 < results.length) {\n\t\t\t\ttransition.hide();\n\t\t\t} else {\n\t\t\t\ttransition.show(this.noteNoItemsFound);\n\t\t\t}\n\t\t\tthis.onSearched(results);\n\t\t});\n\t\tsearch.on(\"fail\", (): void => {\n\t\t\ttransition.show(this.noteError);\n\t\t\tthis.onSearched([]);\n\t\t});\n\t\tsearch.on(\"change\", (): void => {\n\t\t\tif (!search.isDone()) {\n\t\t\t\tconst noteSearching = this.noteSearching;\n\t\t\t\tif (noteSearching) {\n\t\t\t\t\ttransition.show(noteSearching);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected newContentChildren(theme: THEME, options?: OPTIONS): Array<DisplayObject | null> {\n\t\tconst result = super.newContentChildren(theme, options);\n\t\tresult.push(this.inputLayout, this.list);\n\t\treturn result;\n\t}\n\n\tprotected get inputLayout(): DLayoutHorizontal {\n\t\tlet result = this._inputLayout;\n\t\tif (result == null) {\n\t\t\tresult = this.newInputLayout();\n\t\t\tthis._inputLayout = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInputLayout(): DLayoutHorizontal {\n\t\treturn new DLayoutHorizontal({\n\t\t\twidth: \"padding\",\n\t\t\theight: \"auto\",\n\t\t\tchildren: [this.spaceLeft, this.selectCategory, this.input, this.spaceRight]\n\t\t});\n\t}\n\n\tprotected get spaceLeft(): DLayoutSpace {\n\t\tlet result = this._spaceLeft;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceLeft = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get spaceRight(): DLayoutSpace {\n\t\tlet result = this._spaceRight;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceRight = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSpace(): DLayoutSpace {\n\t\treturn new DLayoutSpace({\n\t\t\twidth: this.toInputMargin(this.theme, this._options)\n\t\t});\n\t}\n\n\tprotected get selectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tlet result = this._selectCategory;\n\t\tif (result === undefined) {\n\t\t\tresult = this.newSelectCategory();\n\t\t\tthis._selectCategory = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSelectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\tconst result = new DSelect<CATEGORY_ID>(\n\t\t\t\t\tthis.toSelectCategoryOptions(this.theme, this._options)\n\t\t\t\t);\n\t\t\t\tresult.on(\"change\", (value: CATEGORY_ID) => {\n\t\t\t\t\tthis.onSelectCategoryChange(value);\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toSelectCategoryOptions(\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DSelectOptions<CATEGORY_ID> {\n\t\tconst result = options?.category || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.width = 140;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onSelectCategoryChange(categoryId: CATEGORY_ID): void {\n\t\tthis.search.create([this.input.value, categoryId]);\n\t}\n\n\tget input(): DInputSearch {\n\t\tlet result = this._input;\n\t\tif (result == null) {\n\t\t\tresult = this.newInput();\n\t\t\tthis._input = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInput(): DInputSearch {\n\t\tconst result = new DInputSearch(this.toInputOptions(this.theme, this._options));\n\t\tresult.on(\"input\", (value: string): void => {\n\t\t\tthis.onInputInput(value);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected toInputOptions(theme: THEME, options?: OPTIONS): DInputSearchOptions {\n\t\tconst result = options?.input || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.weight = 1;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toInputMargin(theme: THEME, options?: OPTIONS): number {\n\t\treturn options?.input?.margin ?? theme.getInputMargin();\n\t}\n\n\tprotected onInputInput(value: string): void {\n\t\tthis.search.create([value, this.selectCategory?.value ?? null]);\n\t}\n\n\tget list(): DDialogSelectList<VALUE> {\n\t\tlet result = this._list;\n\t\tif (result == null) {\n\t\t\tresult = this.newList();\n\t\t\tthis._list = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newList(): DDialogSelectList<VALUE> {\n\t\tconst result = new DDialogSelectList<VALUE>(this.toListOptions(this.theme, this._options));\n\t\tresult.selection.on(\"change\", (selection: DListDataSelection<VALUE>): void => {\n\t\t\tthis.onListSelectionChange(selection);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected onListSelectionChange(selection: DListDataSelection<VALUE>): void {\n\t\tlet selected = selection.first;\n\t\tif (selected == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst dismiss = options.dismiss;\n\t\t\tif (dismiss) {\n\t\t\t\tif (selected === dismiss.value) {\n\t\t\t\t\tselected = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._value = selected;\n\t\tthis.onOk(selected);\n\t}\n\n\tprotected toListOptions(theme: THEME, options?: OPTIONS): DDialogSelectListOptions<VALUE> {\n\t\tconst result = options?.list || {};\n\t\tif (result.width === undefined) {\n\t\t\tresult.width = \"padding\";\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get noteError(): DNote | null {\n\t\tlet result = this._noteError;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteError();\n\t\t\tthis._noteError = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteError(): DNote | null {\n\t\tconst error = this._options?.note?.error;\n\t\tif (error !== null) {\n\t\t\treturn new DNoteSmallError(this.toNoteOptions(this.list, error));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteNoItemsFound(): DNote | null {\n\t\tlet result = this._noteNoItemsFound;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteNoItemsFound();\n\t\t\tthis._noteNoItemsFound = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteNoItemsFound(): DNote | null {\n\t\tconst noItemsFound = this._options?.note?.noItemsFound;\n\t\tif (noItemsFound !== null) {\n\t\t\treturn new DNoteSmallNoItemsFound(this.toNoteOptions(this.list, noItemsFound));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteSearching(): DNote | null {\n\t\tlet result = this._noteSearching;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteSearching();\n\t\t\tthis._noteSearching = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteSearching(): DNote | null {\n\t\tconst searching = this._options?.note?.searching;\n\t\t// Because the `searching` note is disabled by default,\n\t\t// if options.searching is missing, i.e., if its value is undefined,\n\t\t// this method returns null. This is why `!=` is used here instead of `!==`.\n\t\tif (searching != null) {\n\t\t\treturn new DNoteSmallSearching(this.toNoteOptions(this.list, searching));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions {\n\t\tif (options != null) {\n\t\t\tif (options.parent == null) {\n\t\t\t\toptions.parent = parent;\n\t\t\t}\n\t\t\tif (options.visible == null) {\n\t\t\t\toptions.visible = false;\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\t\treturn {\n\t\t\tparent,\n\t\t\tvisible: false\n\t\t};\n\t}\n\n\tprotected get search(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tlet result = this._search;\n\t\tif (result == null) {\n\t\t\tresult = this.newSearch();\n\t\t\tthis._search = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSearch(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller) {\n\t\t\t\tconst dismiss = options.dismiss;\n\t\t\t\tconst search = controller.search;\n\t\t\t\tif (\"create\" in search) {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(search, dismiss);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn search;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(\n\t\t\t\t\t\t\tnew DDialogSelectSearhImpl(search),\n\t\t\t\t\t\t\tdismiss\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new DDialogSelectSearhImpl(search);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new DDialogSelectSearhImpl();\n\t}\n\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\tprotected onSearched(results: VALUE[]): void {\n\t\tthis.list.data.items = results;\n\t}\n\n\tprotected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null> {\n\t\treturn this._value;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialogSelect\";\n\t}\n\n\tprotected onOpen(): void {\n\t\tsuper.onOpen();\n\t\tthis.list.selection.clear();\n\t\tconst selectCategory = this.selectCategory;\n\t\tif (selectCategory != null) {\n\t\t\tif (this._isCategoryFetched !== true) {\n\t\t\t\tthis._isCategoryFetched = true;\n\t\t\t\tconst categoriesOrPromise = this.findCategories();\n\t\t\t\tif (categoriesOrPromise == null) {\n\t\t\t\t\tthis.search.create([this.input.value, null]);\n\t\t\t\t} else if (isArray(categoriesOrPromise)) {\n\t\t\t\t\tthis.onCategoryFetched(selectCategory, categoriesOrPromise);\n\t\t\t\t} else {\n\t\t\t\t\tselectCategory.state.isEnabled = false;\n\t\t\t\t\tcategoriesOrPromise.then((categories) => {\n\t\t\t\t\t\tselectCategory.state.isEnabled = true;\n\t\t\t\t\t\tthis.onCategoryFetched(selectCategory, categories);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.search.create([this.input.value, selectCategory.value]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.search.create([this.input.value, null]);\n\t\t}\n\t}\n\n\tprotected onCategoryFetched(\n\t\tselectCategory: DSelect<CATEGORY_ID>,\n\t\tcategories: CATEGORY[]\n\t): void {\n\t\tconst items = [];\n\t\tfor (let i = 0, imax = categories.length; i < imax; ++i) {\n\t\t\tconst category = categories[i];\n\t\t\titems.push({\n\t\t\t\tvalue: this.toCategoryId(category),\n\t\t\t\ttext: {\n\t\t\t\t\tvalue: this.toCategoryLabel(category)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tselectCategory.menu = new DMenu<CATEGORY_ID>({\n\t\t\tfit: true,\n\t\t\titems\n\t\t});\n\t\tconst newValue = 0 < items.length ? items[0].value : null;\n\t\tselectCategory.value = newValue;\n\t\tselectCategory.show();\n\t\tthis.search.create([this.input.value, newValue]);\n\t}\n\n\tprotected toCategoryId(target: CATEGORY): CATEGORY_ID {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toId = category.toId;\n\t\t\t\tif (toId != null) {\n\t\t\t\t\treturn toId(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryId(target);\n\t}\n\n\tprotected toCategoryLabel(target: CATEGORY): string {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toLabel = category.toLabel;\n\t\t\t\tif (toLabel != null) {\n\t\t\t\t\treturn toLabel(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryLabel(target);\n\t}\n\n\tprotected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\treturn controller.getCategories();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void {\n\t\tthis.emit(\"select\", value, this);\n\t\tsuper.onOk(value);\n\t}\n\n\tdestroy(): void {\n\t\tconst input = this._input;\n\t\tif (input) {\n\t\t\tinput.destroy();\n\t\t}\n\t\tconst noteError = this._noteError;\n\t\tif (noteError) {\n\t\t\tnoteError.destroy();\n\t\t}\n\t\tconst noteNoItemsFound = this._noteNoItemsFound;\n\t\tif (noteNoItemsFound) {\n\t\t\tnoteNoItemsFound?.destroy();\n\t\t}\n\t\tconst noteSearching = this._noteSearching;\n\t\tif (noteSearching) {\n\t\t\tnoteSearching?.destroy();\n\t\t}\n\t\tconst list = this._list;\n\t\tif (list) {\n\t\t\tlist.destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
@@ -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("start", this, parent);
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("end", this, parent);
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("stop", this, parent);
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 @@
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,M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,CAAC;YAC1C,IAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;YAC1C,IAAM,UAAU,GACf,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAClF,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;YACnC,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;YAEnC,WAAW;YACX,IAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAClB,IAAM,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAClB,IAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YACjC,IAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;YAChD,IAAM,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC,CAAC;YAEhD,SAAS;YACT,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;SAC3D;IACF,CAAC;IAED,+BAAI,GAAJ;;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"]}
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,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AC;YAEhD,SAAS;YACT,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;SAC3D;IACF,CAAC;IAED,+BAAI,GAAJ;;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: (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/typesc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AAM,CAAC,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,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,E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AAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;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("start", this, parent);
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("end", this, parent);
57
+ parent.emit("transformend", this._owner, parent);
58
58
  };
59
59
  DViewTransformImpl.prototype.onStop = function () {
60
60
  var parent = this._parent;
61
- parent.emit("stop", this, parent);
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;