@wcardinal/wcardinal-ui 0.362.0 → 0.363.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 +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-function.d.ts +4 -4
- package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-dialog-select.d.ts +34 -24
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.d.ts +2 -2
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog-select.d.ts +2 -2
- package/dist/types/wcardinal/ui/util/index.d.ts +0 -1
- package/dist/wcardinal/ui/d-button-select.js +1 -1
- 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-function.js.map +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 +60 -102
- package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +4 -6
- 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 +4 -6
- package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/util/index.js +0 -1
- package/dist/wcardinal/ui/util/index.js.map +1 -1
- package/dist/wcardinal/ui/util/to-label.js +20 -2
- package/dist/wcardinal/ui/util/to-label.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +5 -9
- 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 +5 -9
- 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 +97 -146
- package/dist/wcardinal-ui.js +64 -113
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/wcardinal/ui/util/to-label-with.d.ts +0 -1
- package/dist/wcardinal/ui/util/to-label-with.js +0 -27
- package/dist/wcardinal/ui/util/to-label-with.js.map +0 -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,
|
|
43
|
+
export interface DButtonSelectOptions<VALUE = unknown, DIALOG_VALUE = 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,
|
|
56
|
+
dialog?: DDialogSelectOptions<DIALOG_VALUE, 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,
|
|
64
|
+
export declare class DButtonSelect<VALUE = unknown, DIALOG_VALUE = 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_ID, DIALOG, THEME> = DButtonSelectOptions<VALUE, DIALOG_VALUE, 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,12 +1,12 @@
|
|
|
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,
|
|
5
|
-
protected _target: DDialogSelectSearch<VALUE,
|
|
4
|
+
export declare class DDialogSelectSearhDismissableImpl<VALUE, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearchDismissable<VALUE, CATEGORY_ID> {
|
|
5
|
+
protected _target: DDialogSelectSearch<VALUE, CATEGORY_ID>;
|
|
6
6
|
protected _args?: [string] | [string, CATEGORY_ID | null];
|
|
7
7
|
protected _value?: VALUE;
|
|
8
|
-
protected _filter?: DDialogSelectSearhDismissableFilter<VALUE,
|
|
9
|
-
constructor(target: DDialogSelectSearch<VALUE,
|
|
8
|
+
protected _filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY_ID>;
|
|
9
|
+
constructor(target: DDialogSelectSearch<VALUE, CATEGORY_ID>, options: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY_ID>);
|
|
10
10
|
protected toDismissValue(args?: [string] | [string, CATEGORY_ID | null]): VALUE | undefined;
|
|
11
11
|
protected toDismissable(values: VALUE[]): VALUE[];
|
|
12
12
|
create(args: [string] | [string, CATEGORY_ID | null]): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
2
|
-
export declare type DDialogSelectSearhDismissableFilter<VALUE,
|
|
3
|
-
export interface DDialogSelectSearhDismissableOptions<VALUE,
|
|
2
|
+
export declare type DDialogSelectSearhDismissableFilter<VALUE, CATEGORY_ID> = (value: VALUE, word?: string, categoryId?: CATEGORY_ID | null) => boolean;
|
|
3
|
+
export interface DDialogSelectSearhDismissableOptions<VALUE, CATEGORY_ID> {
|
|
4
4
|
value: VALUE;
|
|
5
|
-
filter?: DDialogSelectSearhDismissableFilter<VALUE,
|
|
5
|
+
filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY_ID>;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* {@link DDialogSelect} dismissable search object.
|
|
9
9
|
*/
|
|
10
|
-
export interface DDialogSelectSearchDismissable<VALUE,
|
|
10
|
+
export interface DDialogSelectSearchDismissable<VALUE, CATEGORY_ID> extends DDialogSelectSearch<VALUE, CATEGORY_ID> {
|
|
11
11
|
}
|
|
@@ -5,12 +5,12 @@ export declare type DDialogSelectSearchFunctionUncategorized<VALUE> = (word: str
|
|
|
5
5
|
/**
|
|
6
6
|
* {@link DDialogSelect} categorized search function.
|
|
7
7
|
*/
|
|
8
|
-
export declare type DDialogSelectSearchFunctionCategorized<VALUE,
|
|
8
|
+
export declare type DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY_ID> = (word: string, categoryId: CATEGORY_ID | null) => Promise<VALUE[]>;
|
|
9
9
|
/**
|
|
10
10
|
* {@link DDialogSelect} search function.
|
|
11
11
|
*/
|
|
12
|
-
export declare type DDialogSelectSearchFunction<VALUE,
|
|
12
|
+
export declare type DDialogSelectSearchFunction<VALUE, CATEGORY_ID> = DDialogSelectSearchFunctionUncategorized<VALUE> | DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY_ID>;
|
|
13
13
|
export declare const DDialogSelectSearchFunctions: {
|
|
14
|
-
isCategorized<VALUE,
|
|
15
|
-
toCategorized<VALUE_1,
|
|
14
|
+
isCategorized<VALUE, CATEGORY_ID>(search: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>): search is DDialogSelectSearchFunctionUncategorized<VALUE>;
|
|
15
|
+
toCategorized<VALUE_1, CATEGORY_ID_1>(search?: DDialogSelectSearchFunction<VALUE_1, CATEGORY_ID_1> | undefined): DDialogSelectSearchFunctionCategorized<VALUE_1, CATEGORY_ID_1>;
|
|
16
16
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { utils } from "pixi.js";
|
|
2
2
|
import { DDialogSelectSearchFunction } from "./d-dialog-select-search-function";
|
|
3
3
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
4
|
-
export declare class DDialogSelectSearhImpl<VALUE,
|
|
5
|
-
protected _search: DDialogSelectSearchFunction<VALUE,
|
|
4
|
+
export declare class DDialogSelectSearhImpl<VALUE, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearch<VALUE, CATEGORY_ID> {
|
|
5
|
+
protected _search: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>;
|
|
6
6
|
protected _id: number;
|
|
7
7
|
protected _idCompleted: number;
|
|
8
|
-
constructor(search?: DDialogSelectSearchFunction<VALUE,
|
|
8
|
+
constructor(search?: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>);
|
|
9
9
|
create(args: [string] | [string, CATEGORY_ID | null]): void;
|
|
10
10
|
isDone(): boolean;
|
|
11
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* {@link DDialogSelect} search object.
|
|
3
3
|
*/
|
|
4
|
-
export interface DDialogSelectSearch<VALUE,
|
|
4
|
+
export interface DDialogSelectSearch<VALUE, CATEGORY_ID> {
|
|
5
5
|
create(args: [string] | [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;
|
|
@@ -19,9 +19,8 @@ export interface DDialogSelectInputOpitons extends DInputSearchOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* {@link DDialogSelect} controller.
|
|
21
21
|
*/
|
|
22
|
-
export interface DDialogSelectController<VALUE,
|
|
23
|
-
search: DDialogSelectSearch<VALUE,
|
|
24
|
-
getCategories?: () => CATEGORY[] | Promise<CATEGORY[]>;
|
|
22
|
+
export interface DDialogSelectController<VALUE, CATEGORY_ID> {
|
|
23
|
+
search: DDialogSelectSearch<VALUE, CATEGORY_ID> | DDialogSelectSearchFunction<VALUE, CATEGORY_ID>;
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
26
|
* {@link DDialogSelect} note options.
|
|
@@ -39,12 +38,23 @@ export declare type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, calle
|
|
|
39
38
|
export interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {
|
|
40
39
|
select(value: VALUE, self: EMITTER): void;
|
|
41
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* {@link DDialogSelect} category dismiss options.
|
|
43
|
+
*/
|
|
44
|
+
export interface DDialogSelectCategoryDismissOptions {
|
|
45
|
+
enable?: boolean;
|
|
46
|
+
label?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface DDialogSelectCategory<CATEGORY_ID> {
|
|
49
|
+
id: CATEGORY_ID;
|
|
50
|
+
label: string;
|
|
51
|
+
}
|
|
42
52
|
/**
|
|
43
53
|
* {@link DDialogSelect} category options.
|
|
44
54
|
*/
|
|
45
|
-
export interface DDialogSelectCategoryOptions<VALUE,
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
export interface DDialogSelectCategoryOptions<VALUE, CATEGORY_ID> extends DSelectOptions<CATEGORY_ID | null> {
|
|
56
|
+
dismiss?: DDialogSelectCategoryDismissOptions;
|
|
57
|
+
items?: DDialogSelectCategory<CATEGORY_ID>[];
|
|
48
58
|
}
|
|
49
59
|
/**
|
|
50
60
|
* {@link DDialogSelect} "on" options.
|
|
@@ -54,10 +64,10 @@ export interface DDialogSelectOnOptions<VALUE, EMITTER> extends Partial<DDialogS
|
|
|
54
64
|
/**
|
|
55
65
|
* {@link DDialogSelect} options.
|
|
56
66
|
*/
|
|
57
|
-
export interface DDialogSelectOptions<VALUE,
|
|
58
|
-
controller?: DDialogSelectController<VALUE,
|
|
59
|
-
category?: DDialogSelectCategoryOptions<VALUE,
|
|
60
|
-
dismiss?: DDialogSelectSearhDismissableOptions<VALUE,
|
|
67
|
+
export interface DDialogSelectOptions<VALUE, CATEGORY_ID = unknown, THEME extends DThemeDialogSelect<VALUE, CATEGORY_ID> = DThemeDialogSelect<VALUE, CATEGORY_ID>, EMITTER = any> extends DDialogLayeredOptions<VALUE, THEME> {
|
|
68
|
+
controller?: DDialogSelectController<VALUE, CATEGORY_ID>;
|
|
69
|
+
category?: DDialogSelectCategoryOptions<VALUE, CATEGORY_ID>;
|
|
70
|
+
dismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY_ID>;
|
|
61
71
|
input?: DDialogSelectInputOpitons;
|
|
62
72
|
list?: DListOptions<VALUE>;
|
|
63
73
|
note?: DDialogSelectNoteOptions;
|
|
@@ -66,21 +76,22 @@ export interface DDialogSelectOptions<VALUE, CATEGORY = unknown, CATEGORY_ID = u
|
|
|
66
76
|
/**
|
|
67
77
|
* {@link DDialogSelect} theme.
|
|
68
78
|
*/
|
|
69
|
-
export interface DThemeDialogSelect<VALUE = unknown,
|
|
79
|
+
export interface DThemeDialogSelect<VALUE = unknown, CATEGORY_ID = unknown> extends DThemeDialogLayered {
|
|
70
80
|
getInputMargin(): number;
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
isCategoryDismissable(): boolean;
|
|
82
|
+
getCategoryDismissLabel(): string;
|
|
73
83
|
}
|
|
74
|
-
export declare class DDialogSelect<VALUE = unknown,
|
|
84
|
+
export declare class DDialogSelect<VALUE = unknown, CATEGORY_ID = unknown, THEME extends DThemeDialogSelect<VALUE, CATEGORY_ID> = DThemeDialogSelect<VALUE, CATEGORY_ID>, OPTIONS extends DDialogSelectOptions<VALUE, CATEGORY_ID, THEME> = DDialogSelectOptions<VALUE, CATEGORY_ID, THEME>> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {
|
|
75
85
|
protected _value: VALUE | null;
|
|
76
86
|
protected _spaceLeft?: DLayoutSpace;
|
|
77
87
|
protected _spaceRight?: DLayoutSpace;
|
|
78
|
-
protected _selectCategory?: DSelect<CATEGORY_ID | null
|
|
88
|
+
protected _selectCategory?: DSelect<CATEGORY_ID | null>;
|
|
79
89
|
protected _isCategoryFetched?: boolean;
|
|
90
|
+
protected _categories: DDialogSelectCategory<CATEGORY_ID>[];
|
|
80
91
|
protected _input?: DInputSearch;
|
|
81
92
|
protected _inputLayout?: DLayoutHorizontal;
|
|
82
93
|
protected _list?: DDialogSelectList<VALUE>;
|
|
83
|
-
protected _search?: DDialogSelectSearch<VALUE,
|
|
94
|
+
protected _search?: DDialogSelectSearch<VALUE, CATEGORY_ID>;
|
|
84
95
|
protected _noteError?: DNote | null;
|
|
85
96
|
protected _noteNoItemsFound?: DNote | null;
|
|
86
97
|
protected _noteSearching?: DNote | null;
|
|
@@ -91,8 +102,8 @@ export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY
|
|
|
91
102
|
protected get spaceLeft(): DLayoutSpace;
|
|
92
103
|
protected get spaceRight(): DLayoutSpace;
|
|
93
104
|
protected newSpace(): DLayoutSpace;
|
|
94
|
-
protected get selectCategory(): DSelect<CATEGORY_ID | null
|
|
95
|
-
protected newSelectCategory(): DSelect<CATEGORY_ID | null
|
|
105
|
+
protected get selectCategory(): DSelect<CATEGORY_ID | null>;
|
|
106
|
+
protected newSelectCategory(): DSelect<CATEGORY_ID | null>;
|
|
96
107
|
protected toSelectCategoryOptions(theme: THEME, options?: OPTIONS): DSelectOptions<CATEGORY_ID | null>;
|
|
97
108
|
protected onSelectCategoryChange(categoryId: CATEGORY_ID): void;
|
|
98
109
|
get input(): DInputSearch;
|
|
@@ -111,17 +122,16 @@ export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY
|
|
|
111
122
|
protected get noteSearching(): DNote | null;
|
|
112
123
|
protected newNoteSearching(): DNote | null;
|
|
113
124
|
protected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions;
|
|
114
|
-
protected get search(): DDialogSelectSearch<VALUE,
|
|
115
|
-
protected newSearch(): DDialogSelectSearch<VALUE,
|
|
125
|
+
protected get search(): DDialogSelectSearch<VALUE, CATEGORY_ID>;
|
|
126
|
+
protected newSearch(): DDialogSelectSearch<VALUE, CATEGORY_ID>;
|
|
116
127
|
get value(): VALUE | null;
|
|
117
128
|
protected onSearched(results: VALUE[]): void;
|
|
118
129
|
protected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null>;
|
|
119
130
|
protected getType(): string;
|
|
120
131
|
protected onOpen(): void;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
protected
|
|
124
|
-
protected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null;
|
|
132
|
+
get categories(): DDialogSelectCategory<CATEGORY_ID>[];
|
|
133
|
+
set categories(categories: DDialogSelectCategory<CATEGORY_ID>[]);
|
|
134
|
+
protected onCategoriesChange(categories: DDialogSelectCategory<CATEGORY_ID>[]): void;
|
|
125
135
|
protected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void;
|
|
126
136
|
destroy(): void;
|
|
127
137
|
}
|
|
@@ -6,6 +6,6 @@ export declare class DThemeDarkDialogSelect<VALUE> extends DThemeDarkDialogLayer
|
|
|
6
6
|
getWidth(): DCoordinateSize;
|
|
7
7
|
getFooter(): DDialogLayeredFooterOptions | undefined | null;
|
|
8
8
|
getInputMargin(): number;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
isCategoryDismissable(): boolean;
|
|
10
|
+
getCategoryDismissLabel(): string;
|
|
11
11
|
}
|
|
@@ -6,6 +6,6 @@ export declare class DThemeWhiteDialogSelect<VALUE> extends DThemeWhiteDialogLay
|
|
|
6
6
|
getWidth(): DCoordinateSize;
|
|
7
7
|
getFooter(): DDialogLayeredFooterOptions | undefined | null;
|
|
8
8
|
getInputMargin(): number;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
isCategoryDismissable(): boolean;
|
|
10
|
+
getCategoryDismissLabel(): string;
|
|
11
11
|
}
|
|
@@ -47,7 +47,7 @@ var DButtonSelect = /** @class */ (function (_super) {
|
|
|
47
47
|
dialog = options;
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE,
|
|
50
|
+
// Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY_ID>.
|
|
51
51
|
dialog = new DDialogSelect(options);
|
|
52
52
|
}
|
|
53
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,O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AAC;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,sEAAsE;oBACtE,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,AApED,CAaU,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_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_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_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_ID,\n\t\tDIALOG,\n\t\tTHEME\n\t> = DButtonSelectOptions<VALUE, DIALOG_VALUE, DIALOG_CATEGORY_ID, DIALOG, THEME>\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_ID>.\n\t\t\t\tdialog = new DDialogSelect<DIALOG_VALUE, 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,MAA+C,EAC/C,OAAiE;QAFlE,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,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GAAN,UAAO,IAA6C;QACnD,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_ID>\n\textends utils.EventEmitter\n\timplements DDialogSelectSearchDismissable<VALUE, CATEGORY_ID>\n{\n\tprotected _target: DDialogSelectSearch<VALUE, CATEGORY_ID>;\n\n\tprotected _args?: [string] | [string, CATEGORY_ID | null];\n\tprotected _value?: VALUE;\n\tprotected _filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY_ID>;\n\n\tconstructor(\n\t\ttarget: DDialogSelectSearch<VALUE, CATEGORY_ID>,\n\t\toptions: DDialogSelectSearhDismissableOptions<VALUE, 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] | [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] | [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_ID> = (\n\tvalue: VALUE,\n\tword?: string,\n\tcategoryId?: CATEGORY_ID | null\n) => boolean;\n\nexport interface DDialogSelectSearhDismissableOptions<VALUE, CATEGORY_ID> {\n\tvalue: VALUE;\n\tfilter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY_ID>;\n}\n\n/**\n * {@link DDialogSelect} dismissable search object.\n */\nexport interface DDialogSelectSearchDismissable<VALUE, CATEGORY_ID>\n\textends DDialogSelectSearch<VALUE, CATEGORY_ID> {}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-dialog-select-search-function.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-function.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,MAAM,CAAC,IAAM,4BAA4B,GAAG;IAC3C,aAAa,EAAb,UACC,
|
|
1
|
+
{"version":3,"file":"d-dialog-select-search-function.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select-search-function.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,MAAM,CAAC,IAAM,4BAA4B,GAAG;IAC3C,aAAa,EAAb,UACC,MAAuD;QAEvD,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,aAAa,EAAb,UACC,MAAwD;QAExD,IAAI,MAAM,IAAI,IAAI,EAAE;YACnB,OAAO,UAAC,IAAY,EAAE,UAA8B,IAAK,OAAA,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAnB,CAAmB,CAAC;SAC7E;aAAM,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;YACtC,OAAO,UAAC,IAAY,EAAE,UAA8B;gBACnD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC;SACF;aAAM;YACN,OAAO,MAAM,CAAC;SACd;IACF,CAAC;CACD,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * {@link DDialogSelect} uncategorized search function.\n */\nexport type DDialogSelectSearchFunctionUncategorized<VALUE> = (word: string) => Promise<VALUE[]>;\n\n/**\n * {@link DDialogSelect} categorized search function.\n */\nexport type DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY_ID> = (\n\tword: string,\n\tcategoryId: CATEGORY_ID | null\n) => Promise<VALUE[]>;\n\n/**\n * {@link DDialogSelect} search function.\n */\nexport type DDialogSelectSearchFunction<VALUE, CATEGORY_ID> =\n\t| DDialogSelectSearchFunctionUncategorized<VALUE>\n\t| DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY_ID>;\n\nexport const DDialogSelectSearchFunctions = {\n\tisCategorized<VALUE, CATEGORY_ID>(\n\t\tsearch: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>\n\t): search is DDialogSelectSearchFunctionUncategorized<VALUE> {\n\t\treturn search.length <= 1;\n\t},\n\n\ttoCategorized<VALUE, CATEGORY_ID>(\n\t\tsearch?: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>\n\t): DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY_ID> {\n\t\tif (search == null) {\n\t\t\treturn (word: string, categoryId: CATEGORY_ID | null) => Promise.resolve([]);\n\t\t} else if (this.isCategorized(search)) {\n\t\t\treturn (word: string, categoryId: CATEGORY_ID | null) => {\n\t\t\t\treturn search(word);\n\t\t\t};\n\t\t} else {\n\t\t\treturn search;\n\t\t}\n\t}\n};\n"]}
|
|
@@ -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;AAChC,OAAO,EAEN,4BAA4B,EAC5B,MAAM,mCAAmC,CAAC;AAG3C;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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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 {\n\tDDialogSelectSearchFunction,\n\tDDialogSelectSearchFunctions\n} from \"./d-dialog-select-search-function\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\n\nexport class DDialogSelectSearhImpl<VALUE, CATEGORY_ID>\n\textends utils.EventEmitter\n\timplements DDialogSelectSearch<VALUE, CATEGORY_ID>\n{\n\tprotected _search: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>;\n\tprotected _id: number;\n\tprotected _idCompleted: number;\n\n\tconstructor(search?: DDialogSelectSearchFunction<VALUE, CATEGORY_ID>) {\n\t\tsuper();\n\n\t\tthis._search = DDialogSelectSearchFunctions.toCategorized(search);\n\t\tthis._id = 0;\n\t\tthis._idCompleted = 0;\n\t}\n\n\tcreate(args: [string] | [string, CATEGORY_ID | null]): void {\n\t\tconst id = ++this._id;\n\t\tthis._search(args[0], args[1] ?? null).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,
|
|
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_ID> {\n\tcreate(args: [string] | [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"]}
|
|
@@ -16,13 +16,20 @@ import { UtilTransition } from "./util/util-transition";
|
|
|
16
16
|
import { DDialogSelectSearhDismissableImpl } from "./d-dialog-select-search-dismissable-impl";
|
|
17
17
|
import { DSelect } from "./d-select";
|
|
18
18
|
import { DMenu } from "./d-menu";
|
|
19
|
-
import { isArray } from "./util/is-array";
|
|
20
|
-
import { DBaseState } from "./d-base-state";
|
|
21
19
|
var DDialogSelect = /** @class */ (function (_super) {
|
|
22
20
|
__extends(DDialogSelect, _super);
|
|
23
21
|
function DDialogSelect(options) {
|
|
24
|
-
var _this =
|
|
22
|
+
var _this = this;
|
|
23
|
+
var _a, _b;
|
|
24
|
+
_this = _super.call(this, options) || this;
|
|
25
|
+
// Value
|
|
25
26
|
_this._value = null;
|
|
27
|
+
// Categories
|
|
28
|
+
var categories = (_b = (_a = options === null || options === void 0 ? void 0 : options.category) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [];
|
|
29
|
+
_this._categories = categories;
|
|
30
|
+
if (0 < categories.length) {
|
|
31
|
+
_this.onCategoriesChange(categories);
|
|
32
|
+
}
|
|
26
33
|
// Controller binding
|
|
27
34
|
var transition = new UtilTransition();
|
|
28
35
|
var search = _this.search;
|
|
@@ -105,7 +112,7 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
105
112
|
Object.defineProperty(DDialogSelect.prototype, "selectCategory", {
|
|
106
113
|
get: function () {
|
|
107
114
|
var result = this._selectCategory;
|
|
108
|
-
if (result
|
|
115
|
+
if (result == null) {
|
|
109
116
|
result = this.newSelectCategory();
|
|
110
117
|
this._selectCategory = result;
|
|
111
118
|
}
|
|
@@ -116,26 +123,19 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
116
123
|
});
|
|
117
124
|
DDialogSelect.prototype.newSelectCategory = function () {
|
|
118
125
|
var _this = this;
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
result.on("change", function (value) {
|
|
125
|
-
_this.onSelectCategoryChange(value);
|
|
126
|
-
});
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
126
|
+
var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
|
|
127
|
+
result.on("change", function (value) {
|
|
128
|
+
_this.onSelectCategoryChange(value);
|
|
129
|
+
});
|
|
130
|
+
return result;
|
|
131
131
|
};
|
|
132
132
|
DDialogSelect.prototype.toSelectCategoryOptions = function (theme, options) {
|
|
133
133
|
var result = (options === null || options === void 0 ? void 0 : options.category) || {};
|
|
134
134
|
if (result.width === undefined && result.weight === undefined) {
|
|
135
135
|
result.width = 140;
|
|
136
136
|
}
|
|
137
|
-
if (result.
|
|
138
|
-
result.
|
|
137
|
+
if (result.visible === undefined) {
|
|
138
|
+
result.visible = false;
|
|
139
139
|
}
|
|
140
140
|
return result;
|
|
141
141
|
};
|
|
@@ -360,101 +360,59 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
360
360
|
return "DDialogSelect";
|
|
361
361
|
};
|
|
362
362
|
DDialogSelect.prototype.onOpen = function () {
|
|
363
|
-
var _this = this;
|
|
364
363
|
_super.prototype.onOpen.call(this);
|
|
365
364
|
this.list.selection.clear();
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (this._isCategoryFetched !== true) {
|
|
369
|
-
this._isCategoryFetched = true;
|
|
370
|
-
var categoriesOrPromise = this.findCategories();
|
|
371
|
-
if (categoriesOrPromise == null) {
|
|
372
|
-
this.search.create([this.input.value, null]);
|
|
373
|
-
}
|
|
374
|
-
else if (isArray(categoriesOrPromise)) {
|
|
375
|
-
this.onCategoryFetched(selectCategory, categoriesOrPromise);
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
378
|
-
categoriesOrPromise.then(function (categories) {
|
|
379
|
-
_this.onCategoryFetched(selectCategory, categories);
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
this.search.create([this.input.value, selectCategory.value]);
|
|
385
|
-
}
|
|
365
|
+
if (0 < this._categories.length) {
|
|
366
|
+
this.search.create([this.input.value, this.selectCategory.value]);
|
|
386
367
|
}
|
|
387
368
|
else {
|
|
388
369
|
this.search.create([this.input.value]);
|
|
389
370
|
}
|
|
390
371
|
};
|
|
391
|
-
DDialogSelect.prototype
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
};
|
|
417
|
-
DDialogSelect.prototype.newToCategoryId = function () {
|
|
418
|
-
var options = this._options;
|
|
419
|
-
if (options != null) {
|
|
420
|
-
var category = options.category;
|
|
421
|
-
if (category != null) {
|
|
422
|
-
var toId = category.toId;
|
|
423
|
-
if (toId != null) {
|
|
424
|
-
return toId;
|
|
425
|
-
}
|
|
372
|
+
Object.defineProperty(DDialogSelect.prototype, "categories", {
|
|
373
|
+
get: function () {
|
|
374
|
+
return this._categories;
|
|
375
|
+
},
|
|
376
|
+
set: function (categories) {
|
|
377
|
+
this._categories = categories;
|
|
378
|
+
this.onCategoriesChange(categories);
|
|
379
|
+
},
|
|
380
|
+
enumerable: false,
|
|
381
|
+
configurable: true
|
|
382
|
+
});
|
|
383
|
+
DDialogSelect.prototype.onCategoriesChange = function (categories) {
|
|
384
|
+
var _a, _b, _c, _d, _e;
|
|
385
|
+
var selectCategory = this.selectCategory;
|
|
386
|
+
if (0 < categories.length) {
|
|
387
|
+
var items = [];
|
|
388
|
+
var theme = this.theme;
|
|
389
|
+
var options = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.dismiss) !== null && _c !== void 0 ? _c : {};
|
|
390
|
+
if ((_d = options.enable) !== null && _d !== void 0 ? _d : theme.isCategoryDismissable()) {
|
|
391
|
+
items.push({
|
|
392
|
+
value: null,
|
|
393
|
+
text: {
|
|
394
|
+
value: (_e = options.label) !== null && _e !== void 0 ? _e : theme.getCategoryDismissLabel()
|
|
395
|
+
}
|
|
396
|
+
});
|
|
426
397
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
if (options != null) {
|
|
436
|
-
var category = options.category;
|
|
437
|
-
if (category != null) {
|
|
438
|
-
var toLabel = category.toLabel;
|
|
439
|
-
if (toLabel != null) {
|
|
440
|
-
return toLabel;
|
|
441
|
-
}
|
|
398
|
+
for (var i = 0, imax = categories.length; i < imax; ++i) {
|
|
399
|
+
var category = categories[i];
|
|
400
|
+
items.push({
|
|
401
|
+
value: category.id,
|
|
402
|
+
text: {
|
|
403
|
+
value: category.label
|
|
404
|
+
}
|
|
405
|
+
});
|
|
442
406
|
}
|
|
407
|
+
selectCategory.menu = new DMenu({
|
|
408
|
+
fit: true,
|
|
409
|
+
items: items
|
|
410
|
+
});
|
|
411
|
+
selectCategory.show();
|
|
443
412
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
return theme.toCategoryLabel(category);
|
|
447
|
-
};
|
|
448
|
-
};
|
|
449
|
-
DDialogSelect.prototype.findCategories = function () {
|
|
450
|
-
var options = this._options;
|
|
451
|
-
if (options != null) {
|
|
452
|
-
var controller = options.controller;
|
|
453
|
-
if (controller != null && controller.getCategories != null) {
|
|
454
|
-
return controller.getCategories();
|
|
455
|
-
}
|
|
413
|
+
else {
|
|
414
|
+
selectCategory.hide();
|
|
456
415
|
}
|
|
457
|
-
return null;
|
|
458
416
|
};
|
|
459
417
|
DDialogSelect.prototype.onOk = function (value) {
|
|
460
418
|
this.emit("select", value, this);
|