@wcardinal/wcardinal-ui 0.166.0 → 0.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/wcardinal/ui/d-dialog.d.ts +18 -5
- package/dist/types/wcardinal/ui/d-table-column.d.ts +2 -2
- package/dist/wcardinal/ui/d-dialog.js +71 -23
- package/dist/wcardinal/ui/d-dialog.js.map +1 -1
- package/dist/wcardinal/ui/d-table-column.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js +1 -7
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js +1 -7
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +2 -8
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +2 -8
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +3008 -2973
- package/dist/wcardinal-ui.js +18992 -18945
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@ export interface DDialogOnOptions<EMITTER> extends Partial<DDialogEvents<EMITTER
|
|
|
37
37
|
* {@link DDialog} options.
|
|
38
38
|
*/
|
|
39
39
|
export interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITTER = any> extends DBaseOptions<THEME> {
|
|
40
|
-
closeOn?: DDialogCloseOn;
|
|
40
|
+
closeOn?: DDialogCloseOn | Array<keyof typeof DDialogCloseOn> | keyof typeof DDialogCloseOn;
|
|
41
41
|
animation?: DAnimation<DBase>;
|
|
42
42
|
/**
|
|
43
43
|
* A dialog mode.
|
|
@@ -45,7 +45,7 @@ export interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITT
|
|
|
45
45
|
mode?: DDialogMode | keyof typeof DDialogMode;
|
|
46
46
|
sticky?: boolean;
|
|
47
47
|
gesture?: boolean | DDialogGestureOptions;
|
|
48
|
-
align?: DDialogAlign | null;
|
|
48
|
+
align?: DDialogAlign | null | keyof typeof DDialogAlign;
|
|
49
49
|
/**
|
|
50
50
|
* Mappings of event names and handlers.
|
|
51
51
|
*/
|
|
@@ -65,7 +65,7 @@ export interface DThemeDialog extends DThemeBase {
|
|
|
65
65
|
getAlign(mode: DDialogMode): DDialogAlign | null;
|
|
66
66
|
newAnimation(mode: DDialogMode): DAnimation<DBase> | null;
|
|
67
67
|
}
|
|
68
|
-
export interface
|
|
68
|
+
export interface DDialogOpener {
|
|
69
69
|
getBounds(skipUpdate: boolean, result: Rectangle): Rectangle;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
@@ -89,18 +89,31 @@ export declare class DDialog<VALUE = void, THEME extends DThemeDialog = DThemeDi
|
|
|
89
89
|
protected _sticky: boolean;
|
|
90
90
|
protected _onPrerenderBound: () => void;
|
|
91
91
|
protected _align: DDialogAlign | null;
|
|
92
|
-
protected
|
|
92
|
+
protected _opener?: DDialogOpener | null;
|
|
93
93
|
protected _gesture: DDialogGesture<this>;
|
|
94
94
|
protected _layer: DApplicationLayerLike | null;
|
|
95
95
|
protected init(options?: OPTIONS): void;
|
|
96
|
+
protected toCloseOn(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogCloseOn;
|
|
97
|
+
protected toAlign(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogAlign | null;
|
|
96
98
|
get mode(): DDialogMode;
|
|
99
|
+
get align(): DDialogAlign | null;
|
|
100
|
+
set algin(align: DDialogAlign | null);
|
|
97
101
|
get gesture(): DDialogGesture<this>;
|
|
98
102
|
get layer(): DApplicationLayerLike | null;
|
|
99
103
|
protected toGestureOptions(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogGestureOptions;
|
|
100
104
|
onParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void;
|
|
101
105
|
protected getAnimation(): DAnimation | null;
|
|
102
106
|
protected onAnimationEnd(isReverse: boolean): void;
|
|
103
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Opens a dialog.
|
|
109
|
+
*
|
|
110
|
+
* @param opener An opener of a dialog.
|
|
111
|
+
* The dialog position is determined based on a position and a size of the opener.
|
|
112
|
+
* If the opener is undefined, the dialog is placed at the center of the screen.
|
|
113
|
+
*
|
|
114
|
+
* @returns a value of this dialog
|
|
115
|
+
*/
|
|
116
|
+
open(opener?: DDialogOpener): Promise<VALUE>;
|
|
104
117
|
protected onPrerender(): void;
|
|
105
118
|
protected onOpen(): void;
|
|
106
119
|
isOpened(): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DAlignHorizontal } from "./d-align-horizontal";
|
|
2
|
-
import {
|
|
2
|
+
import { DDialogOpener } from "./d-dialog";
|
|
3
3
|
import { DDialogSelectOptions } from "./d-dialog-select";
|
|
4
4
|
import { DMenu, DMenuOptions } from "./d-menu";
|
|
5
5
|
import { DTableBodyCellButtonOptions } from "./d-table-body-cell-button";
|
|
@@ -72,7 +72,7 @@ export interface DTableColumnSorting<ROW_VALUE> {
|
|
|
72
72
|
}
|
|
73
73
|
export interface DTableColumnSelectingDialog<DIALOG_VALUE> {
|
|
74
74
|
readonly value: DIALOG_VALUE;
|
|
75
|
-
open(owner?:
|
|
75
|
+
open(owner?: DDialogOpener): Promise<DIALOG_VALUE>;
|
|
76
76
|
}
|
|
77
77
|
export interface DTableColumnSelectingOptions<CELL_VALUE, DIALOG_VALUE, DIALOG extends DTableColumnSelectingDialog<DIALOG_VALUE>> {
|
|
78
78
|
getter?: DTableSelectingGetter<CELL_VALUE, DIALOG>;
|
|
@@ -13,6 +13,7 @@ import { DDialogGestureImpl } from "./d-dialog-gesture-impl";
|
|
|
13
13
|
import { DDialogGestureMode } from "./d-dialog-gesture-mode";
|
|
14
14
|
import { DDialogMode } from "./d-dialog-mode";
|
|
15
15
|
import { DDialogState } from "./d-dialog-state";
|
|
16
|
+
import { isArray, isString } from "./util";
|
|
16
17
|
import { toEnum } from "./util/to-enum";
|
|
17
18
|
import { UtilAttach } from "./util/util-attach";
|
|
18
19
|
import { UtilClickOutside } from "./util/util-click-outside";
|
|
@@ -33,7 +34,7 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
33
34
|
}
|
|
34
35
|
DDialog.prototype.init = function (options) {
|
|
35
36
|
var _this = this;
|
|
36
|
-
var _a, _b
|
|
37
|
+
var _a, _b;
|
|
37
38
|
_super.prototype.init.call(this, options);
|
|
38
39
|
this._onPrerenderBound = function () {
|
|
39
40
|
_this.onPrerender();
|
|
@@ -46,13 +47,12 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
46
47
|
// Sticky
|
|
47
48
|
this._sticky = (_b = options === null || options === void 0 ? void 0 : options.sticky) !== null && _b !== void 0 ? _b : theme.isSticky(mode);
|
|
48
49
|
// Close On
|
|
49
|
-
var closeOn = (
|
|
50
|
+
var closeOn = this.toCloseOn(mode, theme, options);
|
|
50
51
|
this._closeOn = closeOn;
|
|
51
52
|
// Align
|
|
52
|
-
this._align =
|
|
53
|
+
this._align = this.toAlign(mode, theme, options);
|
|
53
54
|
// Overlay
|
|
54
|
-
|
|
55
|
-
this._overlay = overlay;
|
|
55
|
+
this._overlay = new UtilOverlay();
|
|
56
56
|
// Gesture
|
|
57
57
|
this._gesture = new DDialogGestureImpl(this, this.toGestureOptions(mode, theme, options));
|
|
58
58
|
// State
|
|
@@ -76,6 +76,35 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
+
DDialog.prototype.toCloseOn = function (mode, theme, options) {
|
|
80
|
+
var closeOn = options === null || options === void 0 ? void 0 : options.closeOn;
|
|
81
|
+
if (closeOn == null) {
|
|
82
|
+
return theme.closeOn(mode);
|
|
83
|
+
}
|
|
84
|
+
else if (isArray(closeOn)) {
|
|
85
|
+
var result = DDialogCloseOn.NONE;
|
|
86
|
+
for (var i = 0, imax = closeOn.length; i < imax; ++i) {
|
|
87
|
+
result |= DDialogCloseOn[closeOn[i]];
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
else if (isString(closeOn)) {
|
|
92
|
+
return DDialogCloseOn[closeOn];
|
|
93
|
+
}
|
|
94
|
+
return closeOn;
|
|
95
|
+
};
|
|
96
|
+
DDialog.prototype.toAlign = function (mode, theme, options) {
|
|
97
|
+
var align = options === null || options === void 0 ? void 0 : options.align;
|
|
98
|
+
if (align === null) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
else if (align === undefined) {
|
|
102
|
+
return theme.getAlign(mode);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return toEnum(align, DDialogAlign);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
79
108
|
Object.defineProperty(DDialog.prototype, "mode", {
|
|
80
109
|
get: function () {
|
|
81
110
|
return this._mode;
|
|
@@ -83,6 +112,20 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
83
112
|
enumerable: false,
|
|
84
113
|
configurable: true
|
|
85
114
|
});
|
|
115
|
+
Object.defineProperty(DDialog.prototype, "align", {
|
|
116
|
+
get: function () {
|
|
117
|
+
return this._align;
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(DDialog.prototype, "algin", {
|
|
123
|
+
set: function (align) {
|
|
124
|
+
this._align = align;
|
|
125
|
+
},
|
|
126
|
+
enumerable: false,
|
|
127
|
+
configurable: true
|
|
128
|
+
});
|
|
86
129
|
Object.defineProperty(DDialog.prototype, "gesture", {
|
|
87
130
|
get: function () {
|
|
88
131
|
return this._gesture;
|
|
@@ -171,7 +214,16 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
171
214
|
}
|
|
172
215
|
}
|
|
173
216
|
};
|
|
174
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Opens a dialog.
|
|
219
|
+
*
|
|
220
|
+
* @param opener An opener of a dialog.
|
|
221
|
+
* The dialog position is determined based on a position and a size of the opener.
|
|
222
|
+
* If the opener is undefined, the dialog is placed at the center of the screen.
|
|
223
|
+
*
|
|
224
|
+
* @returns a value of this dialog
|
|
225
|
+
*/
|
|
226
|
+
DDialog.prototype.open = function (opener) {
|
|
175
227
|
var _this = this;
|
|
176
228
|
var result = this._promise;
|
|
177
229
|
if (result == null) {
|
|
@@ -180,7 +232,7 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
180
232
|
_this._reject = reject;
|
|
181
233
|
});
|
|
182
234
|
this._promise = result;
|
|
183
|
-
this.
|
|
235
|
+
this._opener = opener;
|
|
184
236
|
// Attach to a layer
|
|
185
237
|
var layer = null;
|
|
186
238
|
switch (this._mode) {
|
|
@@ -199,9 +251,8 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
199
251
|
if (gesture.mode === DDialogGestureMode.CLEAN) {
|
|
200
252
|
gesture.toClean();
|
|
201
253
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (layer != null) {
|
|
254
|
+
if (layer != null) {
|
|
255
|
+
if (gesture.isClean()) {
|
|
205
256
|
var renderer = layer.renderer;
|
|
206
257
|
var onPrerenderBound = this._onPrerenderBound;
|
|
207
258
|
if (this._sticky) {
|
|
@@ -211,10 +262,10 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
211
262
|
renderer.once("prerender", onPrerenderBound);
|
|
212
263
|
}
|
|
213
264
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
265
|
+
else {
|
|
266
|
+
var position = this.position;
|
|
267
|
+
gesture.constraint(this, layer, position.x, position.y);
|
|
268
|
+
}
|
|
218
269
|
}
|
|
219
270
|
// Done
|
|
220
271
|
this.onOpen();
|
|
@@ -223,18 +274,15 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
223
274
|
};
|
|
224
275
|
DDialog.prototype.onPrerender = function () {
|
|
225
276
|
var _a;
|
|
226
|
-
var align = this._align;
|
|
227
|
-
if (align == null) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
277
|
var layer = this._layer;
|
|
231
278
|
if (layer == null) {
|
|
232
279
|
return;
|
|
233
280
|
}
|
|
234
|
-
var
|
|
235
|
-
|
|
281
|
+
var align = this._align;
|
|
282
|
+
var opener = this._opener;
|
|
283
|
+
if (align != null && opener != null) {
|
|
236
284
|
var mode = this._mode;
|
|
237
|
-
var bounds =
|
|
285
|
+
var bounds = opener.getBounds(false, ((_a = DDialog.WORK_BOUNDS) !== null && _a !== void 0 ? _a : (DDialog.WORK_BOUNDS = new Rectangle())));
|
|
238
286
|
var theme = this.theme;
|
|
239
287
|
UtilAttach.attach(this, bounds, theme.getOffsetX(mode), theme.getOffsetY(mode), layer.width, layer.height, align);
|
|
240
288
|
}
|
|
@@ -305,8 +353,8 @@ var DDialog = /** @class */ (function (_super) {
|
|
|
305
353
|
layer.renderer.off("prerender", this._onPrerenderBound);
|
|
306
354
|
this._layer = null;
|
|
307
355
|
}
|
|
308
|
-
// Forget the
|
|
309
|
-
this.
|
|
356
|
+
// Forget the opener
|
|
357
|
+
this._opener = null;
|
|
310
358
|
// Animation
|
|
311
359
|
var animation = this.getAnimation();
|
|
312
360
|
if (animation) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-dialog.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAyC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE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zC;IACF,CAAC;IAES,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AAzWD,CAIU,KAAK,GAqWd","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Point, Rectangle } from \"pixi.js\";\nimport { DAnimation } from \"./d-animation\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DFocusable } from \"./d-controller-focus\";\nimport { DDialogAlign } from \"./d-dialog-align\";\nimport { DDialogCloseOn } from \"./d-dialog-close-on\";\nimport { DDialogGesture, DDialogGestureOptions } from \"./d-dialog-gesture\";\nimport { DDialogGestureImpl } from \"./d-dialog-gesture-impl\";\nimport { DDialogGestureMode } from \"./d-dialog-gesture-mode\";\nimport { DDialogMode } from \"./d-dialog-mode\";\nimport { DDialogState } from \"./d-dialog-state\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DPadding } from \"./d-padding\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilAttach } from \"./util/util-attach\";\nimport { UtilClickOutside } from \"./util/util-click-outside\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilOverlay } from \"./util/util-overlay\";\n\n/**\n * {@link DDialog} events.\n */\nexport interface DDialogEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when a dialog is opened.\n\t *\n\t * @param emitter this\n\t */\n\topen(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a dialog is closed.\n\t *\n\t * @param emitter this\n\t */\n\tclose(emitter: EMITTER): void;\n}\n\n/**\n * {@link DDialog} `on` options.\n */\nexport interface DDialogOnOptions<EMITTER> extends Partial<DDialogEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DDialog} options.\n */\nexport interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITTER = any>\n\textends DBaseOptions<THEME> {\n\tcloseOn?: DDialogCloseOn;\n\tanimation?: DAnimation<DBase>;\n\n\t/**\n\t * A dialog mode.\n\t */\n\tmode?: DDialogMode | keyof typeof DDialogMode;\n\n\tsticky?: boolean;\n\n\tgesture?: boolean | DDialogGestureOptions;\n\n\talign?: DDialogAlign | null;\n\n\t/**\n\t * Mappings of event names and handlers.\n\t */\n\ton?: DDialogOnOptions<EMITTER>;\n}\n\n/**\n * {@link DDialog} theme.\n */\nexport interface DThemeDialog extends DThemeBase {\n\tgetMode(): DDialogMode;\n\tcloseOn(mode: DDialogMode): DDialogCloseOn;\n\tisSticky(mode: DDialogMode): boolean;\n\tisGestureEnabled(mode: DDialogMode): boolean;\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode;\n\tgetOffsetX(mode: DDialogMode): number;\n\tgetOffsetY(mode: DDialogMode): number;\n\tgetAlign(mode: DDialogMode): DDialogAlign | null;\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null;\n}\n\nexport interface DDialogOwner {\n\tgetBounds(skipUpdate: boolean, result: Rectangle): Rectangle;\n}\n\n/**\n * A dialog class.\n *\n * If multiple application instances are there, better to set the constructor\n * option `parent` to an `application.stage` so that the dialog picks a right\n * application. By default, the dialog assumes the last created application is\n * the one it belongs to at the time when it is created.\n */\nexport class DDialog<\n\tVALUE = void,\n\tTHEME extends DThemeDialog = DThemeDialog,\n\tOPTIONS extends DDialogOptions<THEME> = DDialogOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_BOUNDS?: Rectangle;\n\n\tprotected _promise?: Promise<VALUE>;\n\tprotected _resolve?: (value: VALUE | PromiseLike<VALUE>) => void;\n\tprotected _reject?: (reason?: any) => void;\n\n\tprotected _animation?: DAnimation<DBase> | null;\n\tprotected _closeOn!: DDialogCloseOn;\n\tprotected _focused?: DFocusable | null;\n\tprotected _overlay!: UtilOverlay;\n\tprotected _mode!: DDialogMode;\n\tprotected _sticky!: boolean;\n\tprotected _onPrerenderBound!: () => void;\n\tprotected _align!: DDialogAlign | null;\n\tprotected _owner?: DDialogOwner | null;\n\n\tprotected _gesture!: DDialogGesture<this>;\n\tprotected _layer!: DApplicationLayerLike | null;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tthis._onPrerenderBound = (): void => {\n\t\t\tthis.onPrerender();\n\t\t};\n\t\tthis._layer = null;\n\n\t\t// Mode\n\t\tconst theme = this.theme;\n\t\tconst mode = toEnum(options?.mode ?? theme.getMode(), DDialogMode);\n\t\tthis._mode = mode;\n\n\t\t// Sticky\n\t\tthis._sticky = options?.sticky ?? theme.isSticky(mode);\n\n\t\t// Close On\n\t\tconst closeOn = options?.closeOn ?? theme.closeOn(mode);\n\t\tthis._closeOn = closeOn;\n\n\t\t// Align\n\t\tthis._align = toEnum(options?.align ?? theme.getAlign(mode), DDialogAlign);\n\n\t\t// Overlay\n\t\tconst overlay = new UtilOverlay();\n\t\tthis._overlay = overlay;\n\n\t\t// Gesture\n\t\tthis._gesture = new DDialogGestureImpl(this, this.toGestureOptions(mode, theme, options));\n\n\t\t// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.visible = false;\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MODAL);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\tthis.state.add(DDialogState.MODELESS);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\tthis.visible = false;\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MENU);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Outside-click handling\n\t\tif (closeOn & DDialogCloseOn.CLICK_OUTSIDE) {\n\t\t\tUtilClickOutside.apply(this, (): void => {\n\t\t\t\tthis.onCloseOn();\n\t\t\t});\n\t\t}\n\t}\n\n\tget mode(): DDialogMode {\n\t\treturn this._mode;\n\t}\n\n\tget gesture(): DDialogGesture<this> {\n\t\treturn this._gesture;\n\t}\n\n\tget layer(): DApplicationLayerLike | null {\n\t\treturn this._layer;\n\t}\n\n\tprotected toGestureOptions(\n\t\tmode: DDialogMode,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DDialogGestureOptions {\n\t\tconst gesture = options?.gesture;\n\t\tif (gesture === true) {\n\t\t\treturn {\n\t\t\t\tenable: true,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture === false) {\n\t\t\treturn {\n\t\t\t\tenable: false,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture != null) {\n\t\t\tif (gesture.enable === undefined) {\n\t\t\t\tgesture.enable = theme.isGestureEnabled(mode);\n\t\t\t}\n\t\t\tif (gesture.mode === undefined) {\n\t\t\t\tgesture.mode = theme.getGestureMode(mode);\n\t\t\t}\n\t\t\treturn gesture;\n\t\t}\n\t\treturn {\n\t\t\tenable: theme.isGestureEnabled(mode),\n\t\t\tmode: theme.getGestureMode(mode)\n\t\t};\n\t}\n\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tif (this.isOpened()) {\n\t\t\tconst layer = this._layer;\n\t\t\tif (layer != null) {\n\t\t\t\tconst gesture = this._gesture;\n\t\t\t\tif (gesture.isDirty()) {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onParentResize(parentWidth, parentHeight, parentPadding);\n\t}\n\n\tprotected getAnimation(): DAnimation | null {\n\t\tlet result = this._animation;\n\t\tif (result === undefined) {\n\t\t\tresult = this._options?.animation ?? this.theme.newAnimation(this._mode);\n\t\t\tif (result) {\n\t\t\t\tresult.target = this;\n\t\t\t\tresult.on(\"end\", (isReverse: boolean): void => {\n\t\t\t\t\tthis.onAnimationEnd(isReverse);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._animation = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onAnimationEnd(isReverse: boolean): void {\n\t\tif (isReverse) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\tparent.removeChild(this);\n\t\t\t}\n\t\t} else {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tthis._focused = focusController.get();\n\t\t\t\tconst firstFocusable = focusController.find(this, false, true, true);\n\t\t\t\tfocusController.focus(firstFocusable || this);\n\t\t\t}\n\t\t}\n\t}\n\n\topen(owner?: DDialogOwner): Promise<VALUE> {\n\t\tlet result = this._promise;\n\t\tif (result == null) {\n\t\t\tresult = new Promise<VALUE>((resolve, reject): void => {\n\t\t\t\tthis._resolve = resolve;\n\t\t\t\tthis._reject = reject;\n\t\t\t});\n\t\t\tthis._promise = result;\n\n\t\t\tthis._owner = owner;\n\n\t\t\t// Attach to a layer\n\t\t\tlet layer: DApplicationLayerLike | null = null;\n\t\t\tswitch (this._mode) {\n\t\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tcase DDialogMode.MENU:\n\t\t\t\t\tlayer = this._overlay.pick(this);\n\t\t\t\t\tlayer.stage.addChild(this);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\t\tlayer = DApplications.getLayer(this);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._layer = layer;\n\n\t\t\t// Position & size\n\t\t\tconst gesture = this._gesture;\n\t\t\tif (gesture.mode === DDialogGestureMode.CLEAN) {\n\t\t\t\tgesture.toClean();\n\t\t\t}\n\t\t\tconst align = this._align;\n\t\t\tif (align != null && gesture.isClean()) {\n\t\t\t\tif (layer != null) {\n\t\t\t\t\tconst renderer = layer.renderer;\n\t\t\t\t\tconst onPrerenderBound = this._onPrerenderBound;\n\t\t\t\t\tif (this._sticky) {\n\t\t\t\t\t\trenderer.on(\"prerender\", onPrerenderBound);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderer.once(\"prerender\", onPrerenderBound);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (layer != null) {\n\t\t\t\tconst position = this.position;\n\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t}\n\n\t\t\t// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onPrerender(): void {\n\t\tconst align = this._align;\n\t\tif (align == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst layer = this._layer;\n\t\tif (layer == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst owner = this._owner;\n\t\tif (owner) {\n\t\t\tconst mode = this._mode;\n\t\t\tconst bounds = owner.getBounds(false, (DDialog.WORK_BOUNDS ??= new Rectangle()));\n\t\t\tconst theme = this.theme;\n\t\t\tUtilAttach.attach(\n\t\t\t\tthis,\n\t\t\t\tbounds,\n\t\t\t\ttheme.getOffsetX(mode),\n\t\t\t\ttheme.getOffsetY(mode),\n\t\t\t\tlayer.width,\n\t\t\t\tlayer.height,\n\t\t\t\talign\n\t\t\t);\n\t\t} else {\n\t\t\tthis.position.set((layer.width - this.width) * 0.5, (layer.height - this.height) * 0.5);\n\t\t}\n\t}\n\n\tprotected onOpen(): void {\n\t\tthis.emit(\"open\", this);\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start();\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = true;\n\t\t\tthis.onAnimationEnd(false);\n\t\t}\n\t}\n\n\tisOpened(): boolean {\n\t\treturn this._promise != null;\n\t}\n\n\tclose(): void {\n\t\tthis.doReject();\n\t}\n\n\tprotected doResolve(value: VALUE | PromiseLike<VALUE>): void {\n\t\tconst resolve = this._resolve;\n\t\tif (resolve) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\tresolve(value);\n\t\t}\n\t}\n\n\tprotected doReject(reason?: any): void {\n\t\tconst reject = this._reject;\n\t\tif (reject) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\treject(reason);\n\t\t}\n\t}\n\n\tprotected onClose(): void {\n\t\t// Focus\n\t\tconst layer = this._layer;\n\t\tconst focused = this._focused;\n\t\tif (focused != null) {\n\t\t\tthis._focused = null;\n\t\t\tif (layer) {\n\t\t\t\tconst focusedLayer = DApplications.getLayer(focused);\n\t\t\t\tif (focusedLayer != null && layer !== focusedLayer) {\n\t\t\t\t\tfocusedLayer.view.focus();\n\t\t\t\t}\n\t\t\t\tlayer.getFocusController().focus(focused);\n\t\t\t} else {\n\t\t\t\tthis.blur(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.blur(true);\n\t\t}\n\n\t\t// Remove the prerender event handler and forget the layer\n\t\tif (layer) {\n\t\t\tlayer.renderer.off(\"prerender\", this._onPrerenderBound);\n\t\t\tthis._layer = null;\n\t\t}\n\n\t\t// Forget the owner\n\t\tthis._owner = null;\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start(true);\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tif (this._closeOn & DDialogCloseOn.ESC) {\n\t\t\tif (UtilKeyboardEvent.isCancelKey(e)) {\n\t\t\t\tthis.onCloseOn();\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected onCloseOn(): void {\n\t\tthis.close();\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\tswitch (this._mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn super.containsGlobalPoint(point);\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialog\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-dialog.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAS,SAAS,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAyC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAuElD;;;;;;;GAOG;AACH;IAIU,2BAAqB;IAJ/B;;IA8YA,CAAC;IAtXU,sBAAI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,YAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAES,2BAAS,GAAnB;QACC,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;IAES,qCAAmB,GAA7B,UAA8B,KAAY;QACzC,QAAQ,IAAI,CAAC,KAAK,EAAE;YACnB,KAAK,WAAW,CAAC,KAAK,CAAC;YACvB,KAAK,WAAW,CAAC,IAAI;gBACpB,OAAO,IAAI,CAAC;YACb,KAAK,WAAW,CAAC,QAAQ;gBACxB,OAAO,iBAAM,mBAAmB,YAAC,KAAK,CAAC,CAAC;SACzC;IACF,CAAC;IAES,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AA9YD,CAIU,KAAK,GA0Yd","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Point, Rectangle } from \"pixi.js\";\nimport { DAnimation } from \"./d-animation\";\nimport { DApplicationLayerLike } from \"./d-application-layer-like\";\nimport { DApplications } from \"./d-applications\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DFocusable } from \"./d-controller-focus\";\nimport { DDialogAlign } from \"./d-dialog-align\";\nimport { DDialogCloseOn } from \"./d-dialog-close-on\";\nimport { DDialogGesture, DDialogGestureOptions } from \"./d-dialog-gesture\";\nimport { DDialogGestureImpl } from \"./d-dialog-gesture-impl\";\nimport { DDialogGestureMode } from \"./d-dialog-gesture-mode\";\nimport { DDialogMode } from \"./d-dialog-mode\";\nimport { DDialogState } from \"./d-dialog-state\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DPadding } from \"./d-padding\";\nimport { isArray, isString } from \"./util\";\nimport { toEnum } from \"./util/to-enum\";\nimport { UtilAttach } from \"./util/util-attach\";\nimport { UtilClickOutside } from \"./util/util-click-outside\";\nimport { UtilKeyboardEvent } from \"./util/util-keyboard-event\";\nimport { UtilOverlay } from \"./util/util-overlay\";\n\n/**\n * {@link DDialog} events.\n */\nexport interface DDialogEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when a dialog is opened.\n\t *\n\t * @param emitter this\n\t */\n\topen(emitter: EMITTER): void;\n\n\t/**\n\t * Triggered when a dialog is closed.\n\t *\n\t * @param emitter this\n\t */\n\tclose(emitter: EMITTER): void;\n}\n\n/**\n * {@link DDialog} `on` options.\n */\nexport interface DDialogOnOptions<EMITTER> extends Partial<DDialogEvents<EMITTER>>, DOnOptions {}\n\n/**\n * {@link DDialog} options.\n */\nexport interface DDialogOptions<THEME extends DThemeDialog = DThemeDialog, EMITTER = any>\n\textends DBaseOptions<THEME> {\n\tcloseOn?: DDialogCloseOn | Array<keyof typeof DDialogCloseOn> | keyof typeof DDialogCloseOn;\n\n\tanimation?: DAnimation<DBase>;\n\n\t/**\n\t * A dialog mode.\n\t */\n\tmode?: DDialogMode | keyof typeof DDialogMode;\n\n\tsticky?: boolean;\n\n\tgesture?: boolean | DDialogGestureOptions;\n\n\talign?: DDialogAlign | null | keyof typeof DDialogAlign;\n\n\t/**\n\t * Mappings of event names and handlers.\n\t */\n\ton?: DDialogOnOptions<EMITTER>;\n}\n\n/**\n * {@link DDialog} theme.\n */\nexport interface DThemeDialog extends DThemeBase {\n\tgetMode(): DDialogMode;\n\tcloseOn(mode: DDialogMode): DDialogCloseOn;\n\tisSticky(mode: DDialogMode): boolean;\n\tisGestureEnabled(mode: DDialogMode): boolean;\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode;\n\tgetOffsetX(mode: DDialogMode): number;\n\tgetOffsetY(mode: DDialogMode): number;\n\tgetAlign(mode: DDialogMode): DDialogAlign | null;\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null;\n}\n\nexport interface DDialogOpener {\n\tgetBounds(skipUpdate: boolean, result: Rectangle): Rectangle;\n}\n\n/**\n * A dialog class.\n *\n * If multiple application instances are there, better to set the constructor\n * option `parent` to an `application.stage` so that the dialog picks a right\n * application. By default, the dialog assumes the last created application is\n * the one it belongs to at the time when it is created.\n */\nexport class DDialog<\n\tVALUE = void,\n\tTHEME extends DThemeDialog = DThemeDialog,\n\tOPTIONS extends DDialogOptions<THEME> = DDialogOptions<THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_BOUNDS?: Rectangle;\n\n\tprotected _promise?: Promise<VALUE>;\n\tprotected _resolve?: (value: VALUE | PromiseLike<VALUE>) => void;\n\tprotected _reject?: (reason?: any) => void;\n\n\tprotected _animation?: DAnimation<DBase> | null;\n\tprotected _closeOn!: DDialogCloseOn;\n\tprotected _focused?: DFocusable | null;\n\tprotected _overlay!: UtilOverlay;\n\tprotected _mode!: DDialogMode;\n\tprotected _sticky!: boolean;\n\tprotected _onPrerenderBound!: () => void;\n\tprotected _align!: DDialogAlign | null;\n\tprotected _opener?: DDialogOpener | null;\n\n\tprotected _gesture!: DDialogGesture<this>;\n\tprotected _layer!: DApplicationLayerLike | null;\n\n\tprotected init(options?: OPTIONS): void {\n\t\tsuper.init(options);\n\n\t\tthis._onPrerenderBound = (): void => {\n\t\t\tthis.onPrerender();\n\t\t};\n\t\tthis._layer = null;\n\n\t\t// Mode\n\t\tconst theme = this.theme;\n\t\tconst mode = toEnum(options?.mode ?? theme.getMode(), DDialogMode);\n\t\tthis._mode = mode;\n\n\t\t// Sticky\n\t\tthis._sticky = options?.sticky ?? theme.isSticky(mode);\n\n\t\t// Close On\n\t\tconst closeOn = this.toCloseOn(mode, theme, options);\n\t\tthis._closeOn = closeOn;\n\n\t\t// Align\n\t\tthis._align = this.toAlign(mode, theme, options);\n\n\t\t// Overlay\n\t\tthis._overlay = new UtilOverlay();\n\n\t\t// Gesture\n\t\tthis._gesture = new DDialogGestureImpl(this, this.toGestureOptions(mode, theme, options));\n\n\t\t// State\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tthis.visible = false;\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MODAL);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\tthis.state.add(DDialogState.MODELESS);\n\t\t\t\tbreak;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\tthis.visible = false;\n\t\t\t\tthis.state.addAll(DBaseState.FOCUS_ROOT, DDialogState.MENU);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Outside-click handling\n\t\tif (closeOn & DDialogCloseOn.CLICK_OUTSIDE) {\n\t\t\tUtilClickOutside.apply(this, (): void => {\n\t\t\t\tthis.onCloseOn();\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected toCloseOn(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogCloseOn {\n\t\tconst closeOn = options?.closeOn;\n\t\tif (closeOn == null) {\n\t\t\treturn theme.closeOn(mode);\n\t\t} else if (isArray(closeOn)) {\n\t\t\tlet result = DDialogCloseOn.NONE;\n\t\t\tfor (let i = 0, imax = closeOn.length; i < imax; ++i) {\n\t\t\t\tresult |= DDialogCloseOn[closeOn[i]];\n\t\t\t}\n\t\t\treturn result;\n\t\t} else if (isString(closeOn)) {\n\t\t\treturn DDialogCloseOn[closeOn];\n\t\t}\n\t\treturn closeOn;\n\t}\n\n\tprotected toAlign(mode: DDialogMode, theme: THEME, options?: OPTIONS): DDialogAlign | null {\n\t\tconst align = options?.align;\n\t\tif (align === null) {\n\t\t\treturn null;\n\t\t} else if (align === undefined) {\n\t\t\treturn theme.getAlign(mode);\n\t\t} else {\n\t\t\treturn toEnum(align, DDialogAlign);\n\t\t}\n\t}\n\n\tget mode(): DDialogMode {\n\t\treturn this._mode;\n\t}\n\n\tget align(): DDialogAlign | null {\n\t\treturn this._align;\n\t}\n\n\tset algin(align: DDialogAlign | null) {\n\t\tthis._align = align;\n\t}\n\n\tget gesture(): DDialogGesture<this> {\n\t\treturn this._gesture;\n\t}\n\n\tget layer(): DApplicationLayerLike | null {\n\t\treturn this._layer;\n\t}\n\n\tprotected toGestureOptions(\n\t\tmode: DDialogMode,\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DDialogGestureOptions {\n\t\tconst gesture = options?.gesture;\n\t\tif (gesture === true) {\n\t\t\treturn {\n\t\t\t\tenable: true,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture === false) {\n\t\t\treturn {\n\t\t\t\tenable: false,\n\t\t\t\tmode: theme.getGestureMode(mode)\n\t\t\t};\n\t\t} else if (gesture != null) {\n\t\t\tif (gesture.enable === undefined) {\n\t\t\t\tgesture.enable = theme.isGestureEnabled(mode);\n\t\t\t}\n\t\t\tif (gesture.mode === undefined) {\n\t\t\t\tgesture.mode = theme.getGestureMode(mode);\n\t\t\t}\n\t\t\treturn gesture;\n\t\t}\n\t\treturn {\n\t\t\tenable: theme.isGestureEnabled(mode),\n\t\t\tmode: theme.getGestureMode(mode)\n\t\t};\n\t}\n\n\tonParentResize(parentWidth: number, parentHeight: number, parentPadding: DPadding): void {\n\t\tif (this.isOpened()) {\n\t\t\tconst layer = this._layer;\n\t\t\tif (layer != null) {\n\t\t\t\tconst gesture = this._gesture;\n\t\t\t\tif (gesture.isDirty()) {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper.onParentResize(parentWidth, parentHeight, parentPadding);\n\t}\n\n\tprotected getAnimation(): DAnimation | null {\n\t\tlet result = this._animation;\n\t\tif (result === undefined) {\n\t\t\tresult = this._options?.animation ?? this.theme.newAnimation(this._mode);\n\t\t\tif (result) {\n\t\t\t\tresult.target = this;\n\t\t\t\tresult.on(\"end\", (isReverse: boolean): void => {\n\t\t\t\t\tthis.onAnimationEnd(isReverse);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._animation = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onAnimationEnd(isReverse: boolean): void {\n\t\tif (isReverse) {\n\t\t\tconst parent = this.parent;\n\t\t\tif (parent) {\n\t\t\t\tparent.removeChild(this);\n\t\t\t}\n\t\t} else {\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer) {\n\t\t\t\tconst focusController = layer.getFocusController();\n\t\t\t\tthis._focused = focusController.get();\n\t\t\t\tconst firstFocusable = focusController.find(this, false, true, true);\n\t\t\t\tfocusController.focus(firstFocusable || this);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Opens a dialog.\n\t *\n\t * @param opener An opener of a dialog.\n\t * The dialog position is determined based on a position and a size of the opener.\n\t * If the opener is undefined, the dialog is placed at the center of the screen.\n\t *\n\t * @returns a value of this dialog\n\t */\n\topen(opener?: DDialogOpener): Promise<VALUE> {\n\t\tlet result = this._promise;\n\t\tif (result == null) {\n\t\t\tresult = new Promise<VALUE>((resolve, reject): void => {\n\t\t\t\tthis._resolve = resolve;\n\t\t\t\tthis._reject = reject;\n\t\t\t});\n\t\t\tthis._promise = result;\n\n\t\t\tthis._opener = opener;\n\n\t\t\t// Attach to a layer\n\t\t\tlet layer: DApplicationLayerLike | null = null;\n\t\t\tswitch (this._mode) {\n\t\t\t\tcase DDialogMode.MODAL:\n\t\t\t\tcase DDialogMode.MENU:\n\t\t\t\t\tlayer = this._overlay.pick(this);\n\t\t\t\t\tlayer.stage.addChild(this);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\t\tlayer = DApplications.getLayer(this);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis._layer = layer;\n\n\t\t\t// Position & size\n\t\t\tconst gesture = this._gesture;\n\t\t\tif (gesture.mode === DDialogGestureMode.CLEAN) {\n\t\t\t\tgesture.toClean();\n\t\t\t}\n\t\t\tif (layer != null) {\n\t\t\t\tif (gesture.isClean()) {\n\t\t\t\t\tconst renderer = layer.renderer;\n\t\t\t\t\tconst onPrerenderBound = this._onPrerenderBound;\n\t\t\t\t\tif (this._sticky) {\n\t\t\t\t\t\trenderer.on(\"prerender\", onPrerenderBound);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderer.once(\"prerender\", onPrerenderBound);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst position = this.position;\n\t\t\t\t\tgesture.constraint(this, layer, position.x, position.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Done\n\t\t\tthis.onOpen();\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onPrerender(): void {\n\t\tconst layer = this._layer;\n\t\tif (layer == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst align = this._align;\n\t\tconst opener = this._opener;\n\t\tif (align != null && opener != null) {\n\t\t\tconst mode = this._mode;\n\t\t\tconst bounds = opener.getBounds(false, (DDialog.WORK_BOUNDS ??= new Rectangle()));\n\t\t\tconst theme = this.theme;\n\t\t\tUtilAttach.attach(\n\t\t\t\tthis,\n\t\t\t\tbounds,\n\t\t\t\ttheme.getOffsetX(mode),\n\t\t\t\ttheme.getOffsetY(mode),\n\t\t\t\tlayer.width,\n\t\t\t\tlayer.height,\n\t\t\t\talign\n\t\t\t);\n\t\t} else {\n\t\t\tthis.position.set((layer.width - this.width) * 0.5, (layer.height - this.height) * 0.5);\n\t\t}\n\t}\n\n\tprotected onOpen(): void {\n\t\tthis.emit(\"open\", this);\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start();\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = true;\n\t\t\tthis.onAnimationEnd(false);\n\t\t}\n\t}\n\n\tisOpened(): boolean {\n\t\treturn this._promise != null;\n\t}\n\n\tclose(): void {\n\t\tthis.doReject();\n\t}\n\n\tprotected doResolve(value: VALUE | PromiseLike<VALUE>): void {\n\t\tconst resolve = this._resolve;\n\t\tif (resolve) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\tresolve(value);\n\t\t}\n\t}\n\n\tprotected doReject(reason?: any): void {\n\t\tconst reject = this._reject;\n\t\tif (reject) {\n\t\t\tthis._promise = undefined;\n\t\t\tthis._resolve = undefined;\n\t\t\tthis._reject = undefined;\n\n\t\t\tthis.onClose();\n\n\t\t\treject(reason);\n\t\t}\n\t}\n\n\tprotected onClose(): void {\n\t\t// Focus\n\t\tconst layer = this._layer;\n\t\tconst focused = this._focused;\n\t\tif (focused != null) {\n\t\t\tthis._focused = null;\n\t\t\tif (layer) {\n\t\t\t\tconst focusedLayer = DApplications.getLayer(focused);\n\t\t\t\tif (focusedLayer != null && layer !== focusedLayer) {\n\t\t\t\t\tfocusedLayer.view.focus();\n\t\t\t\t}\n\t\t\t\tlayer.getFocusController().focus(focused);\n\t\t\t} else {\n\t\t\t\tthis.blur(true);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.blur(true);\n\t\t}\n\n\t\t// Remove the prerender event handler and forget the layer\n\t\tif (layer) {\n\t\t\tlayer.renderer.off(\"prerender\", this._onPrerenderBound);\n\t\t\tthis._layer = null;\n\t\t}\n\n\t\t// Forget the opener\n\t\tthis._opener = null;\n\n\t\t// Animation\n\t\tconst animation = this.getAnimation();\n\t\tif (animation) {\n\t\t\tanimation.start(true);\n\t\t} else if (this._mode === DDialogMode.MENU) {\n\t\t\tthis.visible = false;\n\t\t\tthis.onAnimationEnd(true);\n\t\t}\n\n\t\tthis.emit(\"close\", this);\n\t}\n\n\tonKeyDown(e: KeyboardEvent): boolean {\n\t\tif (this._closeOn & DDialogCloseOn.ESC) {\n\t\t\tif (UtilKeyboardEvent.isCancelKey(e)) {\n\t\t\t\tthis.onCloseOn();\n\t\t\t}\n\t\t}\n\t\treturn super.onKeyDown(e);\n\t}\n\n\tprotected onCloseOn(): void {\n\t\tthis.close();\n\t}\n\n\tprotected containsGlobalPoint(point: Point): boolean {\n\t\tswitch (this._mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn super.containsGlobalPoint(point);\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialog\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-table-column.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-column.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC/B,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;CACC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport {
|
|
1
|
+
{"version":3,"file":"d-table-column.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-column.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH,MAAM,CAAC,IAAM,gBAAgB,GAAG;IAC/B,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,CAAC;IACf,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;CACC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DAlignHorizontal } from \"./d-align-horizontal\";\nimport { DDialogOpener } from \"./d-dialog\";\nimport { DDialogSelectOptions } from \"./d-dialog-select\";\nimport { DMenu, DMenuOptions } from \"./d-menu\";\nimport { DTableBodyCellButtonOptions } from \"./d-table-body-cell-button\";\nimport { DTableBodyCellCheckOptions } from \"./d-table-body-cell-check\";\nimport { DTableBodyCellColorOptions } from \"./d-table-body-cell-color\";\nimport { DTableBodyCellDateOptions } from \"./d-table-body-cell-date\";\nimport { DTableBodyCellDatetimeOptions } from \"./d-table-body-cell-datetime\";\nimport { DTableBodyCellIndexOptions } from \"./d-table-body-cell-index\";\nimport { DTableBodyCellInputIntegerOptions } from \"./d-table-body-cell-input-integer\";\nimport { DTableBodyCellInputRealOptions } from \"./d-table-body-cell-input-real\";\nimport { DTableBodyCellInputTextOptions } from \"./d-table-body-cell-input-text\";\nimport { DTableBodyCellLinkLinkOptions, DTableBodyCellLinkOptions } from \"./d-table-body-cell-link\";\nimport { DTableBodyCellSelectDialogOptions } from \"./d-table-body-cell-select-dialog\";\nimport { DTableBodyCellSelectMenuOptions } from \"./d-table-body-cell-select-menu\";\nimport { DTableBodyCellSelectMultipleOptions } from \"./d-table-body-cell-select-multiple\";\nimport { DTableBodyCellSelectPromiseOptions } from \"./d-table-body-cell-select-promise\";\nimport { DTableBodyCellTextOptions } from \"./d-table-body-cell-text\";\nimport { DTableBodyCellTimeOptions } from \"./d-table-body-cell-time\";\nimport { DTableBodyCellTreeOptions } from \"./d-table-body-cell-tree\";\nimport { DTableDataComparator } from \"./d-table-data-sorter\";\nimport { DTableHeaderCellOptions } from \"./d-table-header-cell\";\n\nexport const DTableColumnType = {\n\tINDEX: 0,\n\tTEXT: 1,\n\tINTEGER: 2,\n\tREAL: 3,\n\tCHECK: 4,\n\tCHECK_SINGLE: 5,\n\tCOLOR: 6,\n\tBUTTON: 7,\n\tSELECT: 8,\n\tDATE: 9,\n\tDATETIME: 10,\n\tTIME: 11,\n\tACTION: 12,\n\tLINK: 13,\n\tTREE: 14\n} as const;\n\nexport type DTableColumnType = typeof DTableColumnType[keyof typeof DTableColumnType];\n\nexport type DTableGetter<ROW_VALUE, CELL_VALUE> = (\n\trow: ROW_VALUE,\n\tcolumnIndex: number\n) => CELL_VALUE;\nexport type DTableSetter<ROW_VALUE, CELL_VALUE> = (\n\trow: ROW_VALUE,\n\tcolumnIndex: number,\n\tcell: CELL_VALUE\n) => void;\nexport type DTableFormatter<CELL_VALUE> = (cell: CELL_VALUE) => string;\nexport type DTableEditingFormatter<CELL_VALUE> = (cell: CELL_VALUE) => string;\nexport type DTableEditingUnformatter<CELL_VALUE> = (formatted: string) => CELL_VALUE;\nexport type DTableEditingValidator<CELL_VALUE> = (cell: CELL_VALUE) => string | null;\nexport type DTableSelectingGetter<CELL_VALUE, DIALOG> = (dialog: DIALOG) => CELL_VALUE;\nexport type DTableSelectingSetter<CELL_VALUE, DIALOG> = (dialog: DIALOG, cell: CELL_VALUE) => void;\nexport type DTableEditable<ROW_VALUE> = (row: ROW_VALUE, columnIndex: number) => boolean;\nexport type DTableRenderable<ROW_VALUE> = (row: ROW_VALUE, columnIndex: number) => boolean;\n\nexport type DTableBodyCellOptionsUnion<ROW_VALUE> =\n\t| DTableBodyCellTextOptions<ROW_VALUE>\n\t| DTableBodyCellInputTextOptions<ROW_VALUE>\n\t| DTableBodyCellInputIntegerOptions<ROW_VALUE>\n\t| DTableBodyCellInputRealOptions<ROW_VALUE>\n\t| DTableBodyCellIndexOptions<ROW_VALUE>\n\t| DTableBodyCellColorOptions<ROW_VALUE>\n\t| DTableBodyCellCheckOptions<ROW_VALUE>\n\t| DTableBodyCellSelectDialogOptions<ROW_VALUE>\n\t| DTableBodyCellSelectPromiseOptions<ROW_VALUE>\n\t| DTableBodyCellSelectMenuOptions<ROW_VALUE>\n\t| DTableBodyCellDateOptions<ROW_VALUE>\n\t| DTableBodyCellDatetimeOptions<ROW_VALUE>\n\t| DTableBodyCellTimeOptions<ROW_VALUE>\n\t| DTableBodyCellButtonOptions<ROW_VALUE>\n\t| DTableBodyCellLinkOptions<ROW_VALUE>\n\t| DTableBodyCellSelectMultipleOptions<ROW_VALUE>\n\t| DTableBodyCellTreeOptions<ROW_VALUE>;\n\nexport interface DTableColumnEditingOptions<ROW_VALUE, CELL_VALUE> {\n\tenable?: boolean | DTableEditable<ROW_VALUE> | \"auto\" | \"AUTO\";\n\tformatter?: DTableEditingFormatter<CELL_VALUE>;\n\tunformatter?: DTableEditingUnformatter<CELL_VALUE>;\n\tvalidator?: DTableEditingValidator<CELL_VALUE>;\n}\n\nexport interface DTableColumnEditing<ROW_VALUE, CELL_VALUE> {\n\tenable: boolean | DTableEditable<ROW_VALUE>;\n\tformatter?: DTableEditingFormatter<CELL_VALUE>;\n\tunformatter?: DTableEditingUnformatter<CELL_VALUE>;\n\tvalidator?: DTableEditingValidator<CELL_VALUE>;\n}\n\nexport interface DTableColumnSortingOptions<ROW_VALUE> {\n\tenable?: boolean;\n\tcomparator?: DTableDataComparator<ROW_VALUE>;\n}\n\nexport interface DTableColumnSorting<ROW_VALUE> {\n\tenable: boolean;\n\tcomparator?: DTableDataComparator<ROW_VALUE>;\n}\n\nexport interface DTableColumnSelectingDialog<DIALOG_VALUE> {\n\treadonly value: DIALOG_VALUE;\n\topen(owner?: DDialogOpener): Promise<DIALOG_VALUE>;\n}\n\nexport interface DTableColumnSelectingOptions<\n\tCELL_VALUE,\n\tDIALOG_VALUE,\n\tDIALOG extends DTableColumnSelectingDialog<DIALOG_VALUE>\n> {\n\tgetter?: DTableSelectingGetter<CELL_VALUE, DIALOG>;\n\tsetter?: DTableSelectingSetter<CELL_VALUE, DIALOG>;\n\n\tmenu?: DMenuOptions<CELL_VALUE> | DMenu<CELL_VALUE>;\n\tmultiple?: DMenuOptions<CELL_VALUE> | DMenu<CELL_VALUE>;\n\tdialog?: DDialogSelectOptions<DIALOG_VALUE> | DIALOG;\n\tpromise?: () => Promise<CELL_VALUE>;\n}\n\nexport interface DTableColumnSelecting<\n\tCELL_VALUE,\n\tDIALOG_VALUE,\n\tDIALOG extends DTableColumnSelectingDialog<DIALOG_VALUE>\n> {\n\tgetter: DTableSelectingGetter<CELL_VALUE, DIALOG>;\n\tsetter: DTableSelectingSetter<CELL_VALUE, DIALOG>;\n\n\tmenu?: DMenu<CELL_VALUE>;\n\tmultiple?: DMenu<CELL_VALUE>;\n\tdialog?: DIALOG;\n\tpromise?: () => Promise<CELL_VALUE>;\n}\n\nexport interface DTableColumnOptions<\n\tROW_VALUE,\n\tCELL_VALUE = any,\n\tDIALOG_VALUE = any,\n\tDIALOG extends DTableColumnSelectingDialog<DIALOG_VALUE> = any\n> {\n\tweight?: number;\n\twidth?: number;\n\n\ttype?: keyof typeof DTableColumnType | DTableColumnType;\n\tlabel?: string;\n\tgetter?: DTableGetter<ROW_VALUE, CELL_VALUE>;\n\tsetter?: DTableSetter<ROW_VALUE, CELL_VALUE>;\n\tpath?: string;\n\tdefault?: CELL_VALUE;\n\tformatter?: DTableFormatter<CELL_VALUE>;\n\talign?: keyof typeof DAlignHorizontal | DAlignHorizontal;\n\n\t/**\n\t * If the renderable is\n\t *\n\t * * true, cells get rendered.\n\t * * false, cells do not get rendered.\n\t * * a function, cells get rendered only when that function returns true.\n\t * * \"AUTO\", cells get rendered only when the cell data exit.\n\t */\n\trenderable?: boolean | DTableRenderable<ROW_VALUE> | \"auto\" | \"AUTO\";\n\n\t/**\n\t * If the editable is\n\t *\n\t * * true, cells get editable.\n\t * * false, cells do not get editable.\n\t * * a function, cells are editable only when that function returns true.\n\t * * \"AUTO\", cells are editable only when the cell data exist.\n\t */\n\teditable?: boolean | DTableEditable<ROW_VALUE> | \"auto\" | \"AUTO\";\n\tediting?: DTableColumnEditingOptions<ROW_VALUE, CELL_VALUE>;\n\n\tsortable?: boolean;\n\tsorting?: DTableColumnSortingOptions<ROW_VALUE>;\n\n\theader?: DTableHeaderCellOptions<ROW_VALUE>;\n\tbody?: DTableBodyCellOptionsUnion<ROW_VALUE>;\n\n\tselecting?: DTableColumnSelectingOptions<CELL_VALUE, DIALOG_VALUE, DIALOG>;\n\n\tcategory?: string | string[];\n\tfrozen?: boolean;\n\n\tlink?: DTableBodyCellLinkLinkOptions<ROW_VALUE, CELL_VALUE>;\n}\n\nexport interface DTableColumn<\n\tROW_VALUE,\n\tCELL_VALUE,\n\tDIALOG_VALUE = CELL_VALUE,\n\tDIALOG extends DTableColumnSelectingDialog<DIALOG_VALUE> = DTableColumnSelectingDialog<DIALOG_VALUE>\n> {\n\tweight: number | undefined;\n\twidth: number | undefined;\n\n\ttype: DTableColumnType;\n\tlabel: string;\n\tgetter: DTableGetter<ROW_VALUE, CELL_VALUE>;\n\tsetter: DTableSetter<ROW_VALUE, CELL_VALUE>;\n\tformatter?: DTableFormatter<CELL_VALUE>;\n\talign: DAlignHorizontal;\n\trenderable: boolean | DTableRenderable<ROW_VALUE>;\n\n\tediting: DTableColumnEditing<ROW_VALUE, CELL_VALUE>;\n\tsorting: DTableColumnSorting<ROW_VALUE>;\n\n\theader?: DTableHeaderCellOptions<ROW_VALUE>;\n\tbody?: DTableBodyCellOptionsUnion<ROW_VALUE>;\n\n\tselecting: DTableColumnSelecting<CELL_VALUE, DIALOG_VALUE, DIALOG>;\n\n\tcategory?: string | string[];\n\tfrozen?: boolean;\n\toffset: number;\n\n\tlink?: DTableBodyCellLinkLinkOptions<ROW_VALUE, CELL_VALUE>;\n}\n"]}
|
|
@@ -52,13 +52,7 @@ var DThemeDarkDialog = /** @class */ (function (_super) {
|
|
|
52
52
|
return 5;
|
|
53
53
|
};
|
|
54
54
|
DThemeDarkDialog.prototype.getAlign = function (mode) {
|
|
55
|
-
|
|
56
|
-
case DDialogMode.MODAL:
|
|
57
|
-
return DDialogAlign.OVER;
|
|
58
|
-
case DDialogMode.MODELESS:
|
|
59
|
-
case DDialogMode.MENU:
|
|
60
|
-
return DDialogAlign.BOTTOM;
|
|
61
|
-
}
|
|
55
|
+
return DDialogAlign.BOTTOM;
|
|
62
56
|
};
|
|
63
57
|
DThemeDarkDialog.prototype.newAnimation = function (mode) {
|
|
64
58
|
switch (mode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-dark-dialog.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;IAAsC,oCAAc;IAApD;;
|
|
1
|
+
{"version":3,"file":"d-theme-dark-dialog.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,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AC,IAAI,CAAC;IAC9B,CAAC;IACF,uBAAC;AAAD,CAAC,AApHD,CAAsC,cAAc,GAoHnD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DAnimation } from \"../../d-animation\";\nimport { DAnimationFadeIn } from \"../../d-animation-fade-in\";\nimport { DBase } from \"../../d-base\";\nimport { DBaseInteractive } from \"../../d-base-interactive\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DCoordinatePosition, DCoordinateSize } from \"../../d-coordinate\";\nimport { DThemeDialog } from \"../../d-dialog\";\nimport { DDialogAlign } from \"../../d-dialog-align\";\nimport { DDialogCloseOn } from \"../../d-dialog-close-on\";\nimport { DDialogGestureMode } from \"../../d-dialog-gesture-mode\";\nimport { DDialogMode } from \"../../d-dialog-mode\";\nimport { DDialogState } from \"../../d-dialog-state\";\nimport { DShadow } from \"../../d-shadow\";\nimport { DThemeDarkBase } from \"./d-theme-dark-base\";\nimport { DThemeDarkConstants } from \"./d-theme-dark-constants\";\n\nexport class DThemeDarkDialog extends DThemeDarkBase implements DThemeDialog {\n\tgetMode(): DDialogMode {\n\t\treturn DDialogMode.MODAL;\n\t}\n\n\tcloseOn(mode: DDialogMode): DDialogCloseOn {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn DDialogCloseOn.ESC | DDialogCloseOn.CLICK_OUTSIDE;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn DDialogCloseOn.NONE;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tisSticky(mode: DDialogMode): boolean {\n\t\treturn false;\n\t}\n\n\tisGestureEnabled(mode: DDialogMode): boolean {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode {\n\t\treturn DDialogGestureMode.DIRTY;\n\t}\n\n\tgetOffsetX(mode: DDialogMode): number {\n\t\treturn 5;\n\t}\n\n\tgetOffsetY(mode: DDialogMode): number {\n\t\treturn 5;\n\t}\n\n\tgetAlign(mode: DDialogMode): DDialogAlign {\n\t\treturn DDialogAlign.BOTTOM;\n\t}\n\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\treturn new DAnimationFadeIn();\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn null;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn null;\n\t\t}\n\t}\n\n\tgetBackgroundColor(state: DBaseStateSet): number {\n\t\tif (state.is(DDialogState.MENU)) {\n\t\t\treturn DThemeDarkConstants.BACKGROUND_COLOR_ON_BOARD;\n\t\t} else {\n\t\t\treturn DThemeDarkConstants.BACKGROUND_COLOR;\n\t\t}\n\t}\n\n\tgetBorderColor(state: DBaseStateSet): number | null {\n\t\tif (state.is(DDialogState.MENU)) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn 0x393939;\n\t\t}\n\t}\n\n\tgetOutlineColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetPaddingLeft(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingTop(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingRight(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingBottom(): number {\n\t\treturn 16;\n\t}\n\n\tgetX(): DCoordinatePosition {\n\t\treturn 0;\n\t}\n\n\tgetY(): DCoordinatePosition {\n\t\treturn 0;\n\t}\n\n\tgetWidth(): DCoordinateSize {\n\t\treturn 400;\n\t}\n\n\tgetHeight(): DCoordinateSize {\n\t\treturn \"auto\";\n\t}\n\n\tgetShadow(): DShadow | null {\n\t\treturn this.newShadow();\n\t}\n\n\tgetInteractive(): DBaseInteractive {\n\t\treturn DBaseInteractive.BOTH;\n\t}\n}\n"]}
|
|
@@ -52,13 +52,7 @@ var DThemeWhiteDialog = /** @class */ (function (_super) {
|
|
|
52
52
|
return 5;
|
|
53
53
|
};
|
|
54
54
|
DThemeWhiteDialog.prototype.getAlign = function (mode) {
|
|
55
|
-
|
|
56
|
-
case DDialogMode.MODAL:
|
|
57
|
-
return DDialogAlign.OVER;
|
|
58
|
-
case DDialogMode.MODELESS:
|
|
59
|
-
case DDialogMode.MENU:
|
|
60
|
-
return DDialogAlign.BOTTOM;
|
|
61
|
-
}
|
|
55
|
+
return DDialogAlign.BOTTOM;
|
|
62
56
|
};
|
|
63
57
|
DThemeWhiteDialog.prototype.newAnimation = function (mode) {
|
|
64
58
|
switch (mode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-theme-white-dialog.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;IAAuC,qCAAe;IAAtD;;
|
|
1
|
+
{"version":3,"file":"d-theme-white-dialog.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white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,CAAC;IAED,gCAAI,GAAJ;QACC,OAAO,CAAC,CAAC;IACV,CAAC;IAED,oCAAQ,GAAR;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,qCAAS,GAAT;QACC,OAAO,MAAM,CAAC;IACf,CAAC;IAED,qCAAS,GAAT;QACC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IACzB,CAAC;IAED,0CAAc,GAAd;QACC,OAAO,gBAAgB,CAAC,IAAI,CAAC;IAC9B,CAAC;IACF,wBAAC;AAAD,CAAC,AApHD,CAAuC,eAAe,GAoHrD","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DAnimation } from \"../../d-animation\";\nimport { DAnimationFadeIn } from \"../../d-animation-fade-in\";\nimport { DBase } from \"../../d-base\";\nimport { DBaseInteractive } from \"../../d-base-interactive\";\nimport { DBaseStateSet } from \"../../d-base-state-set\";\nimport { DCoordinatePosition, DCoordinateSize } from \"../../d-coordinate\";\nimport { DThemeDialog } from \"../../d-dialog\";\nimport { DDialogAlign } from \"../../d-dialog-align\";\nimport { DDialogCloseOn } from \"../../d-dialog-close-on\";\nimport { DDialogGestureMode } from \"../../d-dialog-gesture-mode\";\nimport { DDialogMode } from \"../../d-dialog-mode\";\nimport { DDialogState } from \"../../d-dialog-state\";\nimport { DShadow } from \"../../d-shadow\";\nimport { DThemeWhiteBase } from \"./d-theme-white-base\";\nimport { DThemeWhiteConstants } from \"./d-theme-white-constants\";\n\nexport class DThemeWhiteDialog extends DThemeWhiteBase implements DThemeDialog {\n\tgetMode(): DDialogMode {\n\t\treturn DDialogMode.MODAL;\n\t}\n\n\tcloseOn(mode: DDialogMode): DDialogCloseOn {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn DDialogCloseOn.ESC | DDialogCloseOn.CLICK_OUTSIDE;\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn DDialogCloseOn.NONE;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tisSticky(mode: DDialogMode): boolean {\n\t\treturn false;\n\t}\n\n\tisGestureEnabled(mode: DDialogMode): boolean {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn true;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tgetGestureMode(mode: DDialogMode): DDialogGestureMode {\n\t\treturn DDialogGestureMode.DIRTY;\n\t}\n\n\tgetOffsetX(mode: DDialogMode): number {\n\t\treturn 5;\n\t}\n\n\tgetOffsetY(mode: DDialogMode): number {\n\t\treturn 5;\n\t}\n\n\tgetAlign(mode: DDialogMode): DDialogAlign {\n\t\treturn DDialogAlign.BOTTOM;\n\t}\n\n\tnewAnimation(mode: DDialogMode): DAnimation<DBase> | null {\n\t\tswitch (mode) {\n\t\t\tcase DDialogMode.MODAL:\n\t\t\t\treturn new DAnimationFadeIn();\n\t\t\tcase DDialogMode.MODELESS:\n\t\t\t\treturn null;\n\t\t\tcase DDialogMode.MENU:\n\t\t\t\treturn null;\n\t\t}\n\t}\n\n\tgetBackgroundColor(state: DBaseStateSet): number {\n\t\tif (state.is(DDialogState.MENU)) {\n\t\t\treturn DThemeWhiteConstants.BACKGROUND_COLOR_ON_BOARD;\n\t\t} else {\n\t\t\treturn DThemeWhiteConstants.BACKGROUND_COLOR;\n\t\t}\n\t}\n\n\tgetBorderColor(state: DBaseStateSet): number | null {\n\t\tif (state.is(DDialogState.MENU)) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\treturn 0xfafafa;\n\t\t}\n\t}\n\n\tgetOutlineColor(state: DBaseStateSet): number | null {\n\t\treturn null;\n\t}\n\n\tgetPaddingLeft(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingTop(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingRight(): number {\n\t\treturn 16;\n\t}\n\n\tgetPaddingBottom(): number {\n\t\treturn 16;\n\t}\n\n\tgetX(): DCoordinatePosition {\n\t\treturn 0;\n\t}\n\n\tgetY(): DCoordinatePosition {\n\t\treturn 0;\n\t}\n\n\tgetWidth(): DCoordinateSize {\n\t\treturn 400;\n\t}\n\n\tgetHeight(): DCoordinateSize {\n\t\treturn \"auto\";\n\t}\n\n\tgetShadow(): DShadow | null {\n\t\treturn this.newShadow();\n\t}\n\n\tgetInteractive(): DBaseInteractive {\n\t\treturn DBaseInteractive.BOTH;\n\t}\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.167.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -868,13 +868,7 @@
|
|
|
868
868
|
return 5;
|
|
869
869
|
};
|
|
870
870
|
DThemeDarkDialog.prototype.getAlign = function (mode) {
|
|
871
|
-
|
|
872
|
-
case DDialogMode.MODAL:
|
|
873
|
-
return DDialogAlign.OVER;
|
|
874
|
-
case DDialogMode.MODELESS:
|
|
875
|
-
case DDialogMode.MENU:
|
|
876
|
-
return DDialogAlign.BOTTOM;
|
|
877
|
-
}
|
|
871
|
+
return DDialogAlign.BOTTOM;
|
|
878
872
|
};
|
|
879
873
|
DThemeDarkDialog.prototype.newAnimation = function (mode) {
|
|
880
874
|
switch (mode) {
|