@wcardinal/wcardinal-ui 0.333.0 → 0.335.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/wcardinal/ui/d-button-select.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable-impl.d.ts +7 -7
- package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-dialog-select.d.ts +42 -14
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.d.ts +2 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog-select.d.ts +2 -0
- package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
- package/dist/types/wcardinal/ui/util/to-id.d.ts +1 -0
- package/dist/wcardinal/ui/d-button-select.js +2 -37
- package/dist/wcardinal/ui/d-button-select.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-dismissable.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-impl.js +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select.js +162 -15
- package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +9 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +9 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +1 -0
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/to-id.js +27 -0
- package/dist/wcardinal/ui/util/to-id.js.map +1 -0
- package/dist/wcardinal-ui-theme-dark.js +10 -2
- 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 +10 -2
- 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 +203 -56
- package/dist/wcardinal-ui.js +189 -54
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ export interface DButtonSelectOnOptions<VALUE, EMITTER> extends Partial<DButtonS
|
|
|
40
40
|
/**
|
|
41
41
|
* {@link DButtonSelect} options.
|
|
42
42
|
*/
|
|
43
|
-
export interface DButtonSelectOptions<VALUE = unknown, DIALOG_VALUE = unknown, DIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>, THEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>, EMITTER = any> extends DButtonOptions<VALUE | null, THEME, EMITTER> {
|
|
43
|
+
export interface DButtonSelectOptions<VALUE = unknown, DIALOG_VALUE = unknown, DIALOG_CATEGORY = unknown, DIALOG_CATEGORY_ID = unknown, DIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>, THEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>, EMITTER = any> extends DButtonOptions<VALUE | null, THEME, EMITTER> {
|
|
44
44
|
/**
|
|
45
45
|
* A function to retrieve a selected value from a dialog.
|
|
46
46
|
*/
|
|
@@ -53,7 +53,7 @@ export interface DButtonSelectOptions<VALUE = unknown, DIALOG_VALUE = unknown, D
|
|
|
53
53
|
/**
|
|
54
54
|
* A dialog to select values.
|
|
55
55
|
*/
|
|
56
|
-
dialog?: DDialogSelectOptions<DIALOG_VALUE> | DIALOG;
|
|
56
|
+
dialog?: DDialogSelectOptions<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID> | DIALOG;
|
|
57
57
|
on?: DButtonSelectOnOptions<VALUE, EMITTER>;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
@@ -61,7 +61,7 @@ export interface DButtonSelectOptions<VALUE = unknown, DIALOG_VALUE = unknown, D
|
|
|
61
61
|
*/
|
|
62
62
|
export interface DThemeButtonSelect<VALUE = unknown> extends DThemeButton<VALUE | null> {
|
|
63
63
|
}
|
|
64
|
-
export declare class DButtonSelect<VALUE = unknown, DIALOG_VALUE = unknown, DIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>, THEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>, OPTIONS extends DButtonSelectOptions<VALUE, DIALOG_VALUE, DIALOG, THEME> = DButtonSelectOptions<VALUE, DIALOG_VALUE, DIALOG, THEME>> extends DButton<VALUE | null, THEME, OPTIONS> {
|
|
64
|
+
export declare class DButtonSelect<VALUE = unknown, DIALOG_VALUE = unknown, DIALOG_CATEGORY = unknown, DIALOG_CATEGORY_ID = unknown, DIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>, THEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>, OPTIONS extends DButtonSelectOptions<VALUE, DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID, DIALOG, THEME> = DButtonSelectOptions<VALUE, DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID, DIALOG, THEME>> extends DButton<VALUE | null, THEME, OPTIONS> {
|
|
65
65
|
protected _dialog?: DIALOG;
|
|
66
66
|
protected _dialogGetter: DButtonSelectGetter<VALUE, DIALOG>;
|
|
67
67
|
protected _dialogSetter: DButtonSelectSetter<VALUE, DIALOG>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { utils } from "pixi.js";
|
|
2
2
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
3
3
|
import { DDialogSelectSearchDismissable, DDialogSelectSearhDismissableFilter, DDialogSelectSearhDismissableOptions } from "./d-dialog-select-search-dismissable";
|
|
4
|
-
export declare class DDialogSelectSearhDismissableImpl<VALUE> extends utils.EventEmitter implements DDialogSelectSearchDismissable<VALUE> {
|
|
5
|
-
protected _target: DDialogSelectSearch<VALUE>;
|
|
6
|
-
protected _args?: [string];
|
|
4
|
+
export declare class DDialogSelectSearhDismissableImpl<VALUE, CATEGORY, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearchDismissable<VALUE, CATEGORY, CATEGORY_ID> {
|
|
5
|
+
protected _target: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;
|
|
6
|
+
protected _args?: [string, CATEGORY_ID | null];
|
|
7
7
|
protected _value?: VALUE;
|
|
8
|
-
protected _filter?: DDialogSelectSearhDismissableFilter<VALUE>;
|
|
9
|
-
constructor(target: DDialogSelectSearch<VALUE>, options: DDialogSelectSearhDismissableOptions<VALUE>);
|
|
10
|
-
protected toDismissValue(args?: [string]): VALUE | undefined;
|
|
8
|
+
protected _filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID>;
|
|
9
|
+
constructor(target: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>, options: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>);
|
|
10
|
+
protected toDismissValue(args?: [string, CATEGORY_ID | null]): VALUE | undefined;
|
|
11
11
|
protected toDismissable(values: VALUE[]): VALUE[];
|
|
12
|
-
create(args: [string]): void;
|
|
12
|
+
create(args: [string, CATEGORY_ID | null]): void;
|
|
13
13
|
isDone(): boolean;
|
|
14
14
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
2
|
-
export declare type DDialogSelectSearhDismissableFilter<VALUE> = (value: VALUE, word?: string) => boolean;
|
|
3
|
-
export interface DDialogSelectSearhDismissableOptions<VALUE> {
|
|
2
|
+
export declare type DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID> = (value: VALUE, word?: string, categoryId?: CATEGORY_ID | null) => boolean;
|
|
3
|
+
export interface DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID> {
|
|
4
4
|
value: VALUE;
|
|
5
|
-
filter?: DDialogSelectSearhDismissableFilter<VALUE>;
|
|
5
|
+
filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* {@link DDialogSelect} dismissable search object.
|
|
9
9
|
*/
|
|
10
|
-
export interface DDialogSelectSearchDismissable<VALUE> extends DDialogSelectSearch<VALUE> {
|
|
10
|
+
export interface DDialogSelectSearchDismissable<VALUE, CATEGORY, CATEGORY_ID> extends DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { utils } from "pixi.js";
|
|
2
2
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
3
|
-
export declare class DDialogSelectSearhImpl<VALUE> extends utils.EventEmitter implements DDialogSelectSearch<VALUE> {
|
|
4
|
-
protected _search: (word: string) => Promise<VALUE[]>;
|
|
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[]>;
|
|
5
5
|
protected _id: number;
|
|
6
6
|
protected _idCompleted: number;
|
|
7
|
-
constructor(search?: (word: string) => Promise<VALUE[]>);
|
|
8
|
-
create(args: [string]): void;
|
|
7
|
+
constructor(search?: (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>);
|
|
8
|
+
create(args: [string, CATEGORY_ID]): void;
|
|
9
9
|
isDone(): boolean;
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* {@link DDialogSelect} search object.
|
|
3
3
|
*/
|
|
4
|
-
export interface DDialogSelectSearch<VALUE> {
|
|
5
|
-
create(args: [string]): void;
|
|
4
|
+
export interface DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
|
|
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;
|
|
@@ -3,25 +3,28 @@ import { DBase } from "./d-base";
|
|
|
3
3
|
import { DDialogLayered, DDialogLayeredEvents, DDialogLayeredOptions, DThemeDialogLayered } from "./d-dialog-layered";
|
|
4
4
|
import { DDialogSelectList, DDialogSelectListOptions } from "./d-dialog-select-list";
|
|
5
5
|
import { DInputSearch, DInputSearchOptions } from "./d-input-search";
|
|
6
|
-
import { DLayoutHorizontal
|
|
6
|
+
import { DLayoutHorizontal } from "./d-layout-horizontal";
|
|
7
|
+
import { DLayoutSpace } from "./d-layout-space";
|
|
7
8
|
import { DListOptions } from "./d-list";
|
|
8
9
|
import { DListDataSelection } from "./d-list-data-selection";
|
|
9
10
|
import { DNote, DNoteOptions } from "./d-note";
|
|
10
11
|
import { DOnOptions } from "./d-on-options";
|
|
11
12
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
12
13
|
import { DDialogSelectSearhDismissableOptions } from "./d-dialog-select-search-dismissable";
|
|
14
|
+
import { DSelect, DSelectOptions } from "./d-select";
|
|
13
15
|
export interface DDialogSelectInputOpitons extends DInputSearchOptions {
|
|
14
16
|
margin?: number;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* {@link DDialogSelect} search function.
|
|
18
20
|
*/
|
|
19
|
-
export declare type DDialogSelectSearchFunction<VALUE> = (word: string) => Promise<VALUE[]>;
|
|
21
|
+
export declare type DDialogSelectSearchFunction<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> = (word: string, categoryId: CATEGORY_ID) => Promise<VALUE[]>;
|
|
20
22
|
/**
|
|
21
23
|
* {@link DDialogSelect} controller.
|
|
22
24
|
*/
|
|
23
|
-
export interface DDialogSelectController<VALUE> {
|
|
24
|
-
search: DDialogSelectSearch<VALUE> | DDialogSelectSearchFunction<VALUE>;
|
|
25
|
+
export interface DDialogSelectController<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> {
|
|
26
|
+
search: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> | DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;
|
|
27
|
+
getCategories?: () => Promise<CATEGORY[]>;
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
30
|
* {@link DDialogSelect} note options.
|
|
@@ -39,6 +42,13 @@ export declare type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, calle
|
|
|
39
42
|
export interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {
|
|
40
43
|
select(value: VALUE, self: EMITTER): void;
|
|
41
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* {@link DDialogSelect} category options.
|
|
47
|
+
*/
|
|
48
|
+
export interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID> extends DSelectOptions<CATEGORY_ID> {
|
|
49
|
+
toId?: (category: CATEGORY) => CATEGORY_ID;
|
|
50
|
+
toLabel?: (category: CATEGORY) => string;
|
|
51
|
+
}
|
|
42
52
|
/**
|
|
43
53
|
* {@link DDialogSelect} "on" options.
|
|
44
54
|
*/
|
|
@@ -47,9 +57,10 @@ export interface DDialogSelectOnOptions<VALUE, EMITTER> extends Partial<DDialogS
|
|
|
47
57
|
/**
|
|
48
58
|
* {@link DDialogSelect} options.
|
|
49
59
|
*/
|
|
50
|
-
export interface DDialogSelectOptions<VALUE, THEME extends DThemeDialogSelect<VALUE> = DThemeDialogSelect<VALUE>, EMITTER = any> extends DDialogLayeredOptions<VALUE, THEME> {
|
|
51
|
-
controller?: DDialogSelectController<VALUE>;
|
|
52
|
-
|
|
60
|
+
export interface DDialogSelectOptions<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown, THEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID>, EMITTER = any> extends DDialogLayeredOptions<VALUE, THEME> {
|
|
61
|
+
controller?: DDialogSelectController<VALUE, CATEGORY, CATEGORY_ID>;
|
|
62
|
+
category?: DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>;
|
|
63
|
+
dismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>;
|
|
53
64
|
input?: DDialogSelectInputOpitons;
|
|
54
65
|
list?: DListOptions<VALUE>;
|
|
55
66
|
note?: DDialogSelectNoteOptions;
|
|
@@ -58,27 +69,40 @@ export interface DDialogSelectOptions<VALUE, THEME extends DThemeDialogSelect<VA
|
|
|
58
69
|
/**
|
|
59
70
|
* {@link DDialogSelect} theme.
|
|
60
71
|
*/
|
|
61
|
-
export interface DThemeDialogSelect<VALUE = unknown> extends DThemeDialogLayered {
|
|
72
|
+
export interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown> extends DThemeDialogLayered {
|
|
62
73
|
getInputMargin(): number;
|
|
74
|
+
toCategoryId(category: CATEGORY): CATEGORY_ID;
|
|
75
|
+
toCategoryLabel(category: CATEGORY): string;
|
|
63
76
|
}
|
|
64
|
-
export declare class DDialogSelect<VALUE = unknown, THEME extends DThemeDialogSelect<VALUE> = DThemeDialogSelect<VALUE>, OPTIONS extends DDialogSelectOptions<VALUE, THEME> = DDialogSelectOptions<VALUE, THEME>> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {
|
|
77
|
+
export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown, THEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID>, OPTIONS extends DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {
|
|
65
78
|
protected _value: VALUE | null;
|
|
79
|
+
protected _spaceLeft?: DLayoutSpace;
|
|
80
|
+
protected _spaceRight?: DLayoutSpace;
|
|
81
|
+
protected _selectCategory?: DSelect<CATEGORY_ID> | null;
|
|
82
|
+
protected _isCategoryFetched?: boolean;
|
|
66
83
|
protected _input?: DInputSearch;
|
|
67
84
|
protected _inputLayout?: DLayoutHorizontal;
|
|
68
85
|
protected _list?: DDialogSelectList<VALUE>;
|
|
69
|
-
protected _search?: DDialogSelectSearch<VALUE>;
|
|
86
|
+
protected _search?: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;
|
|
70
87
|
protected _noteError?: DNote | null;
|
|
71
88
|
protected _noteNoItemsFound?: DNote | null;
|
|
72
89
|
protected _noteSearching?: DNote | null;
|
|
73
90
|
constructor(options?: OPTIONS);
|
|
74
91
|
protected newContentChildren(theme: THEME, options?: OPTIONS): Array<DisplayObject | null>;
|
|
75
92
|
protected get inputLayout(): DLayoutHorizontal;
|
|
76
|
-
protected newInputLayout(
|
|
77
|
-
protected
|
|
93
|
+
protected newInputLayout(): DLayoutHorizontal;
|
|
94
|
+
protected get spaceLeft(): DLayoutSpace;
|
|
95
|
+
protected get spaceRight(): DLayoutSpace;
|
|
96
|
+
protected newSpace(): DLayoutSpace;
|
|
97
|
+
protected get selectCategory(): DSelect<CATEGORY_ID> | null;
|
|
98
|
+
protected newSelectCategory(): DSelect<CATEGORY_ID> | null;
|
|
99
|
+
protected toSelectCategoryOptions(theme: THEME, options?: OPTIONS): DSelectOptions<CATEGORY_ID>;
|
|
100
|
+
protected onSelectCategoryChange(categoryId: CATEGORY_ID): void;
|
|
78
101
|
get input(): DInputSearch;
|
|
79
102
|
protected newInput(): DInputSearch;
|
|
80
103
|
protected toInputOptions(theme: THEME, options?: OPTIONS): DInputSearchOptions;
|
|
81
104
|
protected toInputMargin(theme: THEME, options?: OPTIONS): number;
|
|
105
|
+
protected onInputInput(value: string): void;
|
|
82
106
|
get list(): DDialogSelectList<VALUE>;
|
|
83
107
|
protected newList(): DDialogSelectList<VALUE>;
|
|
84
108
|
protected onListSelectionChange(selection: DListDataSelection<VALUE>): void;
|
|
@@ -90,13 +114,17 @@ export declare class DDialogSelect<VALUE = unknown, THEME extends DThemeDialogSe
|
|
|
90
114
|
protected get noteSearching(): DNote | null;
|
|
91
115
|
protected newNoteSearching(): DNote | null;
|
|
92
116
|
protected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions;
|
|
93
|
-
protected get search(): DDialogSelectSearch<VALUE>;
|
|
94
|
-
protected newSearch(): DDialogSelectSearch<VALUE>;
|
|
117
|
+
protected get search(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;
|
|
118
|
+
protected newSearch(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;
|
|
95
119
|
get value(): VALUE | null;
|
|
96
120
|
protected onSearched(results: VALUE[]): void;
|
|
97
121
|
protected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null>;
|
|
98
122
|
protected getType(): string;
|
|
99
123
|
protected onOpen(): void;
|
|
124
|
+
protected onCategoryFetched(selectCategory: DSelect<CATEGORY_ID>, categories: CATEGORY[]): void;
|
|
125
|
+
protected toCategoryId(target: CATEGORY): CATEGORY_ID;
|
|
126
|
+
protected toCategoryLabel(target: CATEGORY): string;
|
|
127
|
+
protected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null;
|
|
100
128
|
protected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void;
|
|
101
129
|
destroy(): void;
|
|
102
130
|
}
|
|
@@ -6,4 +6,6 @@ export declare class DThemeDarkDialogSelect<VALUE> extends DThemeDarkDialogLayer
|
|
|
6
6
|
getWidth(): DCoordinateSize;
|
|
7
7
|
getFooter(): DDialogLayeredFooterOptions | undefined | null;
|
|
8
8
|
getInputMargin(): number;
|
|
9
|
+
toCategoryId(category: unknown): unknown;
|
|
10
|
+
toCategoryLabel(category: unknown): string;
|
|
9
11
|
}
|
|
@@ -6,4 +6,6 @@ export declare class DThemeWhiteDialogSelect<VALUE> extends DThemeWhiteDialogLay
|
|
|
6
6
|
getWidth(): DCoordinateSize;
|
|
7
7
|
getFooter(): DDialogLayeredFooterOptions | undefined | null;
|
|
8
8
|
getInputMargin(): number;
|
|
9
|
+
toCategoryId(category: unknown): unknown;
|
|
10
|
+
toCategoryLabel(category: unknown): string;
|
|
9
11
|
}
|
|
@@ -31,6 +31,7 @@ export * from "./number-formatters";
|
|
|
31
31
|
export * from "./to-ceiling-index";
|
|
32
32
|
export * from "./to-cloned";
|
|
33
33
|
export * from "./to-enum";
|
|
34
|
+
export * from "./to-id";
|
|
34
35
|
export * from "./to-index-of";
|
|
35
36
|
export * from "./to-label";
|
|
36
37
|
export * from "./to-merged";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toId: (target: any) => unknown;
|
|
@@ -12,47 +12,12 @@ var defaultGetter = function (dialog) {
|
|
|
12
12
|
var defaultSetter = function () {
|
|
13
13
|
// DO NOTHING
|
|
14
14
|
};
|
|
15
|
-
var toOptions = function (options) {
|
|
16
|
-
var _a, _b, _c;
|
|
17
|
-
if (options) {
|
|
18
|
-
// Try to copy text.formatter to dialog.item.text.formatter at first
|
|
19
|
-
var formatter = (_a = options.text) === null || _a === void 0 ? void 0 : _a.formatter;
|
|
20
|
-
if (formatter !== undefined) {
|
|
21
|
-
var dialog = options.dialog;
|
|
22
|
-
if (!(dialog && "open" in dialog)) {
|
|
23
|
-
dialog = dialog || {};
|
|
24
|
-
var item = (dialog.item = dialog.item || {});
|
|
25
|
-
var text = (item.text = item.text || {});
|
|
26
|
-
if (text.formatter === undefined) {
|
|
27
|
-
// Assumes formatter is ( value: DIALOG_VALUE | null, caller: any ) => string.
|
|
28
|
-
text.formatter = formatter;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
// Try to copy dialog.item.text.formatter to text.formatter
|
|
34
|
-
var dialog = options.dialog;
|
|
35
|
-
if (!(dialog && "open" in dialog)) {
|
|
36
|
-
var dialogFormatter = (_c = (_b = dialog === null || dialog === void 0 ? void 0 : dialog.item) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c.formatter;
|
|
37
|
-
if (dialogFormatter !== undefined) {
|
|
38
|
-
var text = options.text || {};
|
|
39
|
-
options.text = text;
|
|
40
|
-
if (text.formatter === undefined) {
|
|
41
|
-
// Assumes dialogFormatter is ( value: VALUE | null, caller: any ) => string.
|
|
42
|
-
text.formatter = dialogFormatter;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return options;
|
|
49
|
-
};
|
|
50
15
|
var DButtonSelect = /** @class */ (function (_super) {
|
|
51
16
|
__extends(DButtonSelect, _super);
|
|
52
17
|
function DButtonSelect(options) {
|
|
53
18
|
var _this = this;
|
|
54
19
|
var _a, _b;
|
|
55
|
-
_this = _super.call(this,
|
|
20
|
+
_this = _super.call(this, options) || this;
|
|
56
21
|
_this._dialogGetter = (_a = options === null || options === void 0 ? void 0 : options.getter) !== null && _a !== void 0 ? _a : defaultGetter;
|
|
57
22
|
_this._dialogSetter = (_b = options === null || options === void 0 ? void 0 : options.setter) !== null && _b !== void 0 ? _b : defaultSetter;
|
|
58
23
|
return _this;
|
|
@@ -82,7 +47,7 @@ var DButtonSelect = /** @class */ (function (_super) {
|
|
|
82
47
|
dialog = options;
|
|
83
48
|
}
|
|
84
49
|
else {
|
|
85
|
-
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE>.
|
|
50
|
+
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID>.
|
|
86
51
|
dialog = new DDialogSelect(options);
|
|
87
52
|
}
|
|
88
53
|
this._dialog = dialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-button-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,OAAO,EAA+C,MAAM,YAAY,CAAC;AAElF,OAAO,EAAE,aAAa,EAAwB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"d-button-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-button-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAGH,OAAO,EAAE,OAAO,EAA+C,MAAM,YAAY,CAAC;AAElF,OAAO,EAAE,aAAa,EAAwB,MAAM,mBAAmB,CAAC;AA+ExE,IAAM,aAAa,GAAG,UAAC,MAAgC;IACtD,qCAAqC;IACrC,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG;IACrB,aAAa;AACd,CAAC,CAAC;AAEF;IAsBU,iCAAqC;IAK9C,uBAAY,OAAiB;QAA7B,iBAIC;;gBAHA,kBAAM,OAAO,CAAC;QACd,KAAI,CAAC,aAAa,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,aAAa,CAAC;QACtD,KAAI,CAAC,aAAa,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,aAAa,CAAC;;IACvD,CAAC;IAES,kCAAU,GAApB,UACC,CAA0E;QAD3E,iBAcC;;QAXA,iBAAM,UAAU,YAAC,CAAC,CAAC,CAAC;QACpB,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,kBAAkB,mCAAI,IAAI,CAAC;QACjD,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;YACtB,IAAM,QAAQ,GAAG,KAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,QAAQ,KAAK,QAAQ,EAAE;gBAC1B,KAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;gBACrB,KAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAI,CAAC,CAAC;aAC9C;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAI,iCAAM;aAAV;;YACC,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;YAC1B,IAAI,MAAM,IAAI,IAAI,EAAE;gBACnB,IAAM,OAAO,GAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,MAAM,CAAC;gBACtC,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,EAAE;oBACjC,MAAM,GAAG,OAAO,CAAC;iBACjB;qBAAM;oBACN,uFAAuF;oBACvF,MAAM,GAAG,IAAI,aAAa,CACzB,OAAO,CACU,CAAC;iBACnB;gBACD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;aACtB;YACD,OAAO,MAAM,CAAC;QACf,CAAC;;;OAAA;IAED,sBAAI,gCAAK;aAAT;;YACC,OAAO,MAAA,IAAI,CAAC,kBAAkB,mCAAI,IAAI,CAAC;QACxC,CAAC;aAED,UAAU,KAAmB;YAC5B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QACnB,CAAC;;;OAJA;IAMS,+BAAO,GAAjB;QACC,OAAO,eAAe,CAAC;IACxB,CAAC;IACF,oBAAC;AAAD,CAAC,AA7ED,CAsBU,OAAO,GAuDhB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { interaction } from \"pixi.js\";\nimport { DButton, DButtonEvents, DButtonOptions, DThemeButton } from \"./d-button\";\nimport { DDialogOpener } from \"./d-dialog\";\nimport { DDialogSelect, DDialogSelectOptions } from \"./d-dialog-select\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * A dialog to select values.\n */\nexport interface DButtonSelectDialog<VALUE> {\n\treadonly value: VALUE | null;\n\topen(opener?: DDialogOpener): Promise<unknown>;\n}\n\n/**\n * A function to retrieve a selected value from a dialog.\n */\nexport type DButtonSelectGetter<VALUE, DIALOG> = (dialog: DIALOG) => VALUE | null;\n\n/**\n * A function to set a selecte value to a dialog.\n * Called before opening a dialog.\n */\nexport type DButtonSelectSetter<VALUE, DIALOG> = (dialog: DIALOG, value: VALUE | null) => void;\n\n/**\n * {@link DButtonSelect} events.\n */\nexport interface DButtonSelectEvents<VALUE, EMITTER> extends DButtonEvents<VALUE, EMITTER> {\n\t/**\n\t * Triggered when a selection is changed.\n\t *\n\t * @param newValue a newly selected value\n\t * @param oldValue a previously selected value\n\t * @param emitter an emitter\n\t */\n\tchange(newValue: VALUE | null, oldValue: VALUE | null, emitter: EMITTER): void;\n}\n\n/**\n * {@link DButtonSelect} \"on\" options.\n */\nexport interface DButtonSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DButtonSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DButtonSelect} options.\n */\nexport interface DButtonSelectOptions<\n\tVALUE = unknown,\n\tDIALOG_VALUE = unknown,\n\tDIALOG_CATEGORY = unknown,\n\tDIALOG_CATEGORY_ID = unknown,\n\tDIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>,\n\tTHEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>,\n\tEMITTER = any\n> extends DButtonOptions<VALUE | null, THEME, EMITTER> {\n\t/**\n\t * A function to retrieve a selected value from a dialog.\n\t */\n\tgetter?: DButtonSelectGetter<VALUE, DIALOG>;\n\n\t/**\n\t * A function to set a selected value to a dialog.\n\t * Called before opening a dialog.\n\t */\n\tsetter?: DButtonSelectSetter<VALUE, DIALOG>;\n\n\t/**\n\t * A dialog to select values.\n\t */\n\tdialog?: DDialogSelectOptions<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID> | DIALOG;\n\n\ton?: DButtonSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DButtonSelect} theme.\n */\nexport interface DThemeButtonSelect<VALUE = unknown> extends DThemeButton<VALUE | null> {}\n\nconst defaultGetter = (dialog: DButtonSelectDialog<any>): any => {\n\t// Assumes the dialog.value is VALUE.\n\treturn dialog.value;\n};\n\nconst defaultSetter = (): void => {\n\t// DO NOTHING\n};\n\nexport class DButtonSelect<\n\tVALUE = unknown,\n\tDIALOG_VALUE = unknown,\n\tDIALOG_CATEGORY = unknown,\n\tDIALOG_CATEGORY_ID = unknown,\n\tDIALOG extends DButtonSelectDialog<DIALOG_VALUE> = DButtonSelectDialog<DIALOG_VALUE>,\n\tTHEME extends DThemeButtonSelect<VALUE> = DThemeButtonSelect<VALUE>,\n\tOPTIONS extends DButtonSelectOptions<\n\t\tVALUE,\n\t\tDIALOG_VALUE,\n\t\tDIALOG_CATEGORY,\n\t\tDIALOG_CATEGORY_ID,\n\t\tDIALOG,\n\t\tTHEME\n\t> = DButtonSelectOptions<\n\t\tVALUE,\n\t\tDIALOG_VALUE,\n\t\tDIALOG_CATEGORY,\n\t\tDIALOG_CATEGORY_ID,\n\t\tDIALOG,\n\t\tTHEME\n\t>\n> extends DButton<VALUE | null, THEME, OPTIONS> {\n\tprotected _dialog?: DIALOG;\n\tprotected _dialogGetter: DButtonSelectGetter<VALUE, DIALOG>;\n\tprotected _dialogSetter: DButtonSelectSetter<VALUE, DIALOG>;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\t\tthis._dialogGetter = options?.getter ?? defaultGetter;\n\t\tthis._dialogSetter = options?.setter ?? defaultSetter;\n\t}\n\n\tprotected onActivate(\n\t\te?: interaction.InteractionEvent | KeyboardEvent | MouseEvent | TouchEvent\n\t): void {\n\t\tsuper.onActivate(e);\n\t\tconst dialog = this.dialog;\n\t\tconst oldValue = this._textValueComputed ?? null;\n\t\tthis._dialogSetter(dialog, oldValue);\n\t\tdialog.open(this).then((): void => {\n\t\t\tconst newValue = this._dialogGetter(dialog);\n\t\t\tif (newValue !== oldValue) {\n\t\t\t\tthis.text = newValue;\n\t\t\t\tthis.emit(\"change\", newValue, oldValue, this);\n\t\t\t}\n\t\t});\n\t}\n\n\tget dialog(): DIALOG {\n\t\tlet dialog = this._dialog;\n\t\tif (dialog == null) {\n\t\t\tconst options = this._options?.dialog;\n\t\t\tif (options && \"open\" in options) {\n\t\t\t\tdialog = options;\n\t\t\t} else {\n\t\t\t\t// Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID>.\n\t\t\t\tdialog = new DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID>(\n\t\t\t\t\toptions\n\t\t\t\t) as any as DIALOG;\n\t\t\t}\n\t\t\tthis._dialog = dialog;\n\t\t}\n\t\treturn dialog;\n\t}\n\n\tget value(): VALUE | null {\n\t\treturn this._textValueComputed ?? null;\n\t}\n\n\tset value(value: VALUE | null) {\n\t\tthis.text = value;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DButtonSelect\";\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-dialog-select-search-dismissable-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-dismissable-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQhC;IACS,qDAAkB;IAS1B,2CACC,
|
|
1
|
+
{"version":3,"file":"d-dialog-select-search-dismissable-impl.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-dismissable-impl.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAQhC;IACS,qDAAkB;IAS1B,2CACC,MAAyD,EACzD,OAA2E;QAF5E,YAIC,iBAAO,SAeP;QAbA,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAE9B,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE;YACnB,KAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAI,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,CAAC,EAAE,MAAM;YAC9B,KAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAI,EAAE,KAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE;YACjB,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAI,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;;IACJ,CAAC;IAES,0DAAc,GAAxB,UAAyB,IAAmC;QAC3D,IAAI,IAAI,IAAI,IAAI,EAAE;YACjB,OAAO;SACP;QACD,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,KAAK,KAAK,SAAS,EAAE;YACxB,OAAO;SACP;QACD,IAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;YAC9C,OAAO;SACP;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IAES,yDAAa,GAAvB,UAAwB,MAAe;QACtC,IAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,KAAK,KAAK,SAAS,EAAE;YACxB,OAAO,MAAM,CAAC;SACd;QACD,IAAM,MAAM,GAAY,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;YACpD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SACvB;QACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,kDAAM,GAAN,UAAO,IAAkC;QACxC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,kDAAM,GAAN;QACC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;IACF,wCAAC;AAAD,CAAC,AAnED,CACS,KAAK,CAAC,YAAY,GAkE1B","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\";\nimport {\n\tDDialogSelectSearchDismissable,\n\tDDialogSelectSearhDismissableFilter,\n\tDDialogSelectSearhDismissableOptions\n} from \"./d-dialog-select-search-dismissable\";\n\nexport class DDialogSelectSearhDismissableImpl<VALUE, CATEGORY, CATEGORY_ID>\n\textends utils.EventEmitter\n\timplements DDialogSelectSearchDismissable<VALUE, CATEGORY, CATEGORY_ID>\n{\n\tprotected _target: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;\n\n\tprotected _args?: [string, CATEGORY_ID | null];\n\tprotected _value?: VALUE;\n\tprotected _filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID>;\n\n\tconstructor(\n\t\ttarget: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>,\n\t\toptions: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>\n\t) {\n\t\tsuper();\n\n\t\tthis._target = target;\n\t\tthis._value = options.value;\n\t\tthis._filter = options.filter;\n\n\t\ttarget.on(\"change\", (): void => {\n\t\t\tthis.emit(\"change\", this);\n\t\t});\n\t\ttarget.on(\"success\", (e, values): void => {\n\t\t\tthis.emit(\"success\", this, this.toDismissable(values));\n\t\t});\n\t\ttarget.on(\"fail\", (): void => {\n\t\t\tthis.emit(\"fail\", this);\n\t\t});\n\t}\n\n\tprotected toDismissValue(args?: [string, CATEGORY_ID | null]): VALUE | undefined {\n\t\tif (args == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst value = this._value;\n\t\tif (value === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst filter = this._filter;\n\t\tif (filter != null && !filter(value, args[0])) {\n\t\t\treturn;\n\t\t}\n\t\treturn value;\n\t}\n\n\tprotected toDismissable(values: VALUE[]): VALUE[] {\n\t\tconst value = this.toDismissValue(this._args);\n\t\tif (value === undefined) {\n\t\t\treturn values;\n\t\t}\n\t\tconst result: VALUE[] = [];\n\t\tfor (let i = 0, imax = values.length; i < imax; ++i) {\n\t\t\tresult.push(values[i]);\n\t\t}\n\t\tresult.push(value);\n\t\treturn result;\n\t}\n\n\tcreate(args: [string, CATEGORY_ID | null]): void {\n\t\tthis._args = args;\n\t\tthis._target.create(args);\n\t}\n\n\tisDone(): boolean {\n\t\treturn this._target.isDone();\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-dialog-select-search-dismissable.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-dismissable.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\n\nexport type DDialogSelectSearhDismissableFilter<VALUE> = (
|
|
1
|
+
{"version":3,"file":"d-dialog-select-search-dismissable.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-dismissable.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\n\nexport type DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID> = (\n\tvalue: VALUE,\n\tword?: string,\n\tcategoryId?: CATEGORY_ID | null\n) => boolean;\n\nexport interface DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID> {\n\tvalue: VALUE;\n\tfilter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID>;\n}\n\n/**\n * {@link DDialogSelect} dismissable search object.\n */\nexport interface DDialogSelectSearchDismissable<VALUE, CATEGORY, CATEGORY_ID>\n\textends DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {}\n"]}
|
|
@@ -16,7 +16,7 @@ var DDialogSelectSearhImpl = /** @class */ (function (_super) {
|
|
|
16
16
|
DDialogSelectSearhImpl.prototype.create = function (args) {
|
|
17
17
|
var _this = this;
|
|
18
18
|
var id = ++this._id;
|
|
19
|
-
this._search(args[0]).then(function (searchResult) {
|
|
19
|
+
this._search(args[0], args[1]).then(function (searchResult) {
|
|
20
20
|
if (_this._id === id) {
|
|
21
21
|
_this._idCompleted = id;
|
|
22
22
|
_this.emit("success", _this, searchResult);
|
|
@@ -1 +1 @@
|
|
|
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,EAAE,MAAM,SAAS,CAAC;AAGhC;IACS,0CAAkB;IAO1B,gCAAY,
|
|
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,EAAE,MAAM,SAAS,CAAC;AAGhC;IACS,0CAAkB;IAO1B,gCAAY,MAAoE;QAAhF,YACC,iBAAO,SAKP;QAHA,KAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,UAAC,CAAS,IAAK,OAAA,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAnB,CAAmB,CAAC,CAAC;QAC9D,KAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;;IACvB,CAAC;IAED,uCAAM,GAAN,UAAO,IAA2B;QAAlC,iBAmBC;QAlBA,IAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAClC,UAAC,YAAqB;YACrB,IAAI,KAAI,CAAC,GAAG,KAAK,EAAE,EAAE;gBACpB,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;gBACvB,KAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAI,EAAE,YAAY,CAAC,CAAC;gBACzC,KAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAI,CAAC,CAAC;aAC1B;QACF,CAAC,EACD;YACC,IAAI,KAAI,CAAC,GAAG,KAAK,EAAE,EAAE;gBACpB,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;gBACvB,KAAI,CAAC,IAAI,CAAC,MAAM,EAAE,KAAI,CAAC,CAAC;gBACxB,KAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAI,CAAC,CAAC;aAC1B;QACF,CAAC,CACD,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,uCAAM,GAAN;QACC,OAAO,IAAI,CAAC,GAAG,KAAK,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 +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> {\n\tcreate(args: [string]): 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"]}
|