@wcardinal/wcardinal-ui 0.337.0 → 0.339.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-select-search-dismissable-impl.d.ts +3 -3
- package/dist/types/wcardinal/ui/d-dialog-select-search-function.d.ts +16 -0
- package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +4 -3
- package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-dialog-select.d.ts +1 -4
- package/dist/types/wcardinal/ui/shape/e-shape-capability.d.ts +12 -0
- package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js.map +1 -1
- package/dist/wcardinal/ui/d-dialog-select-search-function.js +23 -0
- package/dist/wcardinal/ui/d-dialog-select-search-function.js.map +1 -0
- package/dist/wcardinal/ui/d-dialog-select-search-impl.js +4 -2
- 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 +8 -3
- package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
- package/dist/wcardinal/ui/shape/e-shape-capability.js +17 -2
- package/dist/wcardinal/ui/shape/e-shape-capability.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +52 -8
- package/dist/wcardinal-ui.js +52 -8
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,12 @@ import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
|
3
3
|
import { DDialogSelectSearchDismissable, DDialogSelectSearhDismissableFilter, DDialogSelectSearhDismissableOptions } from "./d-dialog-select-search-dismissable";
|
|
4
4
|
export declare class DDialogSelectSearhDismissableImpl<VALUE, CATEGORY, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearchDismissable<VALUE, CATEGORY, CATEGORY_ID> {
|
|
5
5
|
protected _target: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;
|
|
6
|
-
protected _args?: [string, CATEGORY_ID | null];
|
|
6
|
+
protected _args?: [string] | [string, CATEGORY_ID | null];
|
|
7
7
|
protected _value?: VALUE;
|
|
8
8
|
protected _filter?: DDialogSelectSearhDismissableFilter<VALUE, CATEGORY, CATEGORY_ID>;
|
|
9
9
|
constructor(target: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>, options: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>);
|
|
10
|
-
protected toDismissValue(args?: [string, CATEGORY_ID | null]): VALUE | undefined;
|
|
10
|
+
protected toDismissValue(args?: [string] | [string, CATEGORY_ID | null]): VALUE | undefined;
|
|
11
11
|
protected toDismissable(values: VALUE[]): VALUE[];
|
|
12
|
-
create(args: [string, CATEGORY_ID | null]): void;
|
|
12
|
+
create(args: [string] | [string, CATEGORY_ID | null]): void;
|
|
13
13
|
isDone(): boolean;
|
|
14
14
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link DDialogSelect} uncategorized search function.
|
|
3
|
+
*/
|
|
4
|
+
export declare type DDialogSelectSearchFunctionUncategorized<VALUE> = (word: string) => Promise<VALUE[]>;
|
|
5
|
+
/**
|
|
6
|
+
* {@link DDialogSelect} categorized search function.
|
|
7
|
+
*/
|
|
8
|
+
export declare type DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY, CATEGORY_ID> = (word: string, categoryId: CATEGORY_ID | null) => Promise<VALUE[]>;
|
|
9
|
+
/**
|
|
10
|
+
* {@link DDialogSelect} search function.
|
|
11
|
+
*/
|
|
12
|
+
export declare type DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID> = DDialogSelectSearchFunctionUncategorized<VALUE> | DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY, CATEGORY_ID>;
|
|
13
|
+
export declare const DDialogSelectSearchFunctions: {
|
|
14
|
+
isCategorized<VALUE, CATEGORY, CATEGORY_ID>(search: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>): search is DDialogSelectSearchFunctionUncategorized<VALUE>;
|
|
15
|
+
toCategorized<VALUE_1, CATEGORY_1, CATEGORY_ID_1>(search?: DDialogSelectSearchFunction<VALUE_1, CATEGORY_1, CATEGORY_ID_1> | undefined): DDialogSelectSearchFunctionCategorized<VALUE_1, CATEGORY_1, CATEGORY_ID_1>;
|
|
16
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { utils } from "pixi.js";
|
|
2
|
+
import { DDialogSelectSearchFunction } from "./d-dialog-select-search-function";
|
|
2
3
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
3
4
|
export declare class DDialogSelectSearhImpl<VALUE, CATEGORY, CATEGORY_ID> extends utils.EventEmitter implements DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
|
|
4
|
-
protected _search:
|
|
5
|
+
protected _search: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;
|
|
5
6
|
protected _id: number;
|
|
6
7
|
protected _idCompleted: number;
|
|
7
|
-
constructor(search?:
|
|
8
|
-
create(args: [string,
|
|
8
|
+
constructor(search?: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>);
|
|
9
|
+
create(args: [string] | [string, CATEGORY_ID | null]): void;
|
|
9
10
|
isDone(): boolean;
|
|
10
11
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* {@link DDialogSelect} search object.
|
|
3
3
|
*/
|
|
4
4
|
export interface DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {
|
|
5
|
-
create(args: [string,
|
|
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;
|
|
8
8
|
on(event: "change", handler: () => void): void;
|
|
@@ -12,13 +12,10 @@ import { DOnOptions } from "./d-on-options";
|
|
|
12
12
|
import { DDialogSelectSearch } from "./d-dialog-select-search";
|
|
13
13
|
import { DDialogSelectSearhDismissableOptions } from "./d-dialog-select-search-dismissable";
|
|
14
14
|
import { DSelect, DSelectOptions } from "./d-select";
|
|
15
|
+
import { DDialogSelectSearchFunction } from "./d-dialog-select-search-function";
|
|
15
16
|
export interface DDialogSelectInputOpitons extends DInputSearchOptions {
|
|
16
17
|
margin?: number;
|
|
17
18
|
}
|
|
18
|
-
/**
|
|
19
|
-
* {@link DDialogSelect} search function.
|
|
20
|
-
*/
|
|
21
|
-
export declare type DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID> = (word: string, categoryId?: CATEGORY_ID | null) => Promise<VALUE[]>;
|
|
22
19
|
/**
|
|
23
20
|
* {@link DDialogSelect} controller.
|
|
24
21
|
*/
|
|
@@ -88,6 +88,18 @@ export declare const EShapeCapability: {
|
|
|
88
88
|
* Allows shape children to be modified.
|
|
89
89
|
*/
|
|
90
90
|
readonly CHILDREN: 524288;
|
|
91
|
+
/**
|
|
92
|
+
* Allows shape line to be modified.
|
|
93
|
+
*/
|
|
94
|
+
readonly LINE: 2097152;
|
|
95
|
+
/**
|
|
96
|
+
* Allows shape line tail to be modified.
|
|
97
|
+
*/
|
|
98
|
+
readonly LINE_TAIL: 4194304;
|
|
99
|
+
/**
|
|
100
|
+
* Allows shape line head to be modified.
|
|
101
|
+
*/
|
|
102
|
+
readonly LINE_HEAD: 8388608;
|
|
91
103
|
readonly COORDINATE: number;
|
|
92
104
|
readonly SHAPE: number;
|
|
93
105
|
readonly LAYER: 262144;
|
|
@@ -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,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,
|
|
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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E;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,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, 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] | [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] | [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"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
export var DDialogSelectSearchFunctions = {
|
|
6
|
+
isCategorized: function (search) {
|
|
7
|
+
return search.length <= 1;
|
|
8
|
+
},
|
|
9
|
+
toCategorized: function (search) {
|
|
10
|
+
if (search == null) {
|
|
11
|
+
return function (word, categoryId) { return Promise.resolve([]); };
|
|
12
|
+
}
|
|
13
|
+
else if (this.isCategorized(search)) {
|
|
14
|
+
return function (word, categoryId) {
|
|
15
|
+
return search(word);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return search;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=d-dialog-select-search-function.js.map
|
|
@@ -0,0 +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,MAAiE;QAEjE,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,aAAa,EAAb,UACC,MAAkE;QAElE,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, 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, CATEGORY_ID> =\n\t| DDialogSelectSearchFunctionUncategorized<VALUE>\n\t| DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY, CATEGORY_ID>;\n\nexport const DDialogSelectSearchFunctions = {\n\tisCategorized<VALUE, CATEGORY, CATEGORY_ID>(\n\t\tsearch: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>\n\t): search is DDialogSelectSearchFunctionUncategorized<VALUE> {\n\t\treturn search.length <= 1;\n\t},\n\n\ttoCategorized<VALUE, CATEGORY, CATEGORY_ID>(\n\t\tsearch?: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>\n\t): DDialogSelectSearchFunctionCategorized<VALUE, CATEGORY, 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"]}
|
|
@@ -4,19 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { __extends } from "tslib";
|
|
6
6
|
import { utils } from "pixi.js";
|
|
7
|
+
import { DDialogSelectSearchFunctions } from "./d-dialog-select-search-function";
|
|
7
8
|
var DDialogSelectSearhImpl = /** @class */ (function (_super) {
|
|
8
9
|
__extends(DDialogSelectSearhImpl, _super);
|
|
9
10
|
function DDialogSelectSearhImpl(search) {
|
|
10
11
|
var _this = _super.call(this) || this;
|
|
11
|
-
_this._search =
|
|
12
|
+
_this._search = DDialogSelectSearchFunctions.toCategorized(search);
|
|
12
13
|
_this._id = 0;
|
|
13
14
|
_this._idCompleted = 0;
|
|
14
15
|
return _this;
|
|
15
16
|
}
|
|
16
17
|
DDialogSelectSearhImpl.prototype.create = function (args) {
|
|
17
18
|
var _this = this;
|
|
19
|
+
var _a;
|
|
18
20
|
var id = ++this._id;
|
|
19
|
-
this._search(args[0], args[1]).then(function (searchResult) {
|
|
21
|
+
this._search(args[0], (_a = args[1]) !== null && _a !== void 0 ? _a : null).then(function (searchResult) {
|
|
20
22
|
if (_this._id === id) {
|
|
21
23
|
_this._idCompleted = id;
|
|
22
24
|
_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;
|
|
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,MAAkE;QAA9E,YACC,iBAAO,SAKP;QAHA,KAAI,CAAC,OAAO,GAAG,4BAA4B,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAClE,KAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,KAAI,CAAC,YAAY,GAAG,CAAC,CAAC;;IACvB,CAAC;IAED,uCAAM,GAAN,UAAO,IAA6C;QAApD,iBAmBC;;QAlBA,IAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAA,IAAI,CAAC,CAAC,CAAC,mCAAI,IAAI,CAAC,CAAC,IAAI,CAC1C,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 {\n\tDDialogSelectSearchFunction,\n\tDDialogSelectSearchFunctions\n} from \"./d-dialog-select-search-function\";\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: DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;\n\tprotected _id: number;\n\tprotected _idCompleted: number;\n\n\tconstructor(search?: DDialogSelectSearchFunction<VALUE, CATEGORY, 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, CATEGORY, CATEGORY_ID> {\n\tcreate(args: [string,
|
|
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] | [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"]}
|
|
@@ -170,8 +170,13 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
170
170
|
return (_b = (_a = options === null || options === void 0 ? void 0 : options.input) === null || _a === void 0 ? void 0 : _a.margin) !== null && _b !== void 0 ? _b : theme.getInputMargin();
|
|
171
171
|
};
|
|
172
172
|
DDialogSelect.prototype.onInputInput = function (value) {
|
|
173
|
-
var
|
|
174
|
-
|
|
173
|
+
var selectCategory = this.selectCategory;
|
|
174
|
+
if (selectCategory != null) {
|
|
175
|
+
this.search.create([value, selectCategory.value]);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this.search.create([value]);
|
|
179
|
+
}
|
|
175
180
|
};
|
|
176
181
|
Object.defineProperty(DDialogSelect.prototype, "list", {
|
|
177
182
|
get: function () {
|
|
@@ -378,7 +383,7 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
378
383
|
}
|
|
379
384
|
}
|
|
380
385
|
else {
|
|
381
|
-
this.search.create([this.input.value
|
|
386
|
+
this.search.create([this.input.value]);
|
|
382
387
|
}
|
|
383
388
|
};
|
|
384
389
|
DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-dialog-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EACN,cAAc,EAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAuB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE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AAC,iBAAiB,CAAC;QAChD,IAAI,gBAAgB,EAAE;YACrB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAAE,CAAC;SAC5B;QACD,IAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,aAAa,EAAE;YAClB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,EAAE,CAAC;SACzB;QACD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;SACf;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,oBAAC;AAAD,CAAC,AAhdD,CAeU,cAAc,GAicvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport {\n\tDDialogLayered,\n\tDDialogLayeredEvents,\n\tDDialogLayeredOptions,\n\tDThemeDialogLayered\n} from \"./d-dialog-layered\";\nimport { DDialogSelectList, DDialogSelectListOptions } from \"./d-dialog-select-list\";\nimport { DDialogSelectSearhImpl } from \"./d-dialog-select-search-impl\";\nimport { DInputSearch, DInputSearchOptions } from \"./d-input-search\";\nimport { DLayoutHorizontal } from \"./d-layout-horizontal\";\nimport { DLayoutSpace } from \"./d-layout-space\";\nimport { DListOptions } from \"./d-list\";\nimport { DListDataSelection } from \"./d-list-data-selection\";\nimport { DNote, DNoteOptions } from \"./d-note\";\nimport { DNoteSmallError } from \"./d-note-small-error\";\nimport { DNoteSmallNoItemsFound } from \"./d-note-small-no-items-found\";\nimport { DNoteSmallSearching } from \"./d-note-small-searching\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { UtilTransition } from \"./util/util-transition\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\nimport { DDialogSelectSearhDismissableOptions } from \"./d-dialog-select-search-dismissable\";\nimport { DDialogSelectSearhDismissableImpl } from \"./d-dialog-select-search-dismissable-impl\";\nimport { DSelect, DSelectOptions } from \"./d-select\";\nimport { DMenu } from \"./d-menu\";\nimport { isArray } from \"./util/is-array\";\n\nexport interface DDialogSelectInputOpitons extends DInputSearchOptions {\n\tmargin?: number;\n}\n\n/**\n * {@link DDialogSelect} search function.\n */\nexport type DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID> = (\n\tword: string,\n\tcategoryId?: CATEGORY_ID | null\n) => Promise<VALUE[]>;\n\n/**\n * {@link DDialogSelect} controller.\n */\nexport interface DDialogSelectController<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> {\n\tsearch:\n\t\t| DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n\t\t| DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;\n\tgetCategories?: () => Promise<CATEGORY[]>;\n}\n\n/**\n * {@link DDialogSelect} note options.\n */\nexport interface DDialogSelectNoteOptions {\n\terror?: DNoteOptions | null;\n\tnoItemsFound?: DNoteOptions | null;\n\tsearching?: DNoteOptions | null;\n}\n\nexport type DDialogSelectItemToLabel<VALUE> = (result: VALUE, caller: any) => string;\n\nexport type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, caller: any) => boolean;\n\n/**\n * {@link DDialogSelect} events.\n */\nexport interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {\n\tselect(value: VALUE, self: EMITTER): void;\n}\n\n/**\n * {@link DDialogSelect} category options.\n */\nexport interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>\n\textends DSelectOptions<CATEGORY_ID> {\n\ttoId?: (category: CATEGORY) => CATEGORY_ID;\n\ttoLabel?: (category: CATEGORY) => string;\n}\n\n/**\n * {@link DDialogSelect} \"on\" options.\n */\nexport interface DDialogSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DDialogSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DDialogSelect} options.\n */\nexport interface DDialogSelectOptions<\n\tVALUE,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tEMITTER = any\n> extends DDialogLayeredOptions<VALUE, THEME> {\n\tcontroller?: DDialogSelectController<VALUE, CATEGORY, CATEGORY_ID>;\n\tcategory?: DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tdismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tinput?: DDialogSelectInputOpitons;\n\tlist?: DListOptions<VALUE>;\n\tnote?: DDialogSelectNoteOptions;\n\ton?: DDialogSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DDialogSelect} theme.\n */\nexport interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown>\n\textends DThemeDialogLayered {\n\tgetInputMargin(): number;\n\ttoCategoryId(category: CATEGORY): CATEGORY_ID;\n\ttoCategoryLabel(category: CATEGORY): string;\n}\n\nexport class DDialogSelect<\n\tVALUE = unknown,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tOPTIONS extends DDialogSelectOptions<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID,\n\t\tTHEME\n\t> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>\n> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\tprotected _spaceLeft?: DLayoutSpace;\n\tprotected _spaceRight?: DLayoutSpace;\n\tprotected _selectCategory?: DSelect<CATEGORY_ID> | null;\n\tprotected _isCategoryFetched?: boolean;\n\tprotected _input?: DInputSearch;\n\tprotected _inputLayout?: DLayoutHorizontal;\n\tprotected _list?: DDialogSelectList<VALUE>;\n\tprotected _search?: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;\n\tprotected _noteError?: DNote | null;\n\tprotected _noteNoItemsFound?: DNote | null;\n\tprotected _noteSearching?: DNote | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis._value = null;\n\n\t\t// Controller binding\n\t\tconst transition = new UtilTransition();\n\t\tconst search = this.search;\n\t\tsearch.on(\"success\", (e: unknown, results: VALUE[]): void => {\n\t\t\tif (0 < results.length) {\n\t\t\t\ttransition.hide();\n\t\t\t} else {\n\t\t\t\ttransition.show(this.noteNoItemsFound);\n\t\t\t}\n\t\t\tthis.onSearched(results);\n\t\t});\n\t\tsearch.on(\"fail\", (): void => {\n\t\t\ttransition.show(this.noteError);\n\t\t\tthis.onSearched([]);\n\t\t});\n\t\tsearch.on(\"change\", (): void => {\n\t\t\tif (!search.isDone()) {\n\t\t\t\tconst noteSearching = this.noteSearching;\n\t\t\t\tif (noteSearching) {\n\t\t\t\t\ttransition.show(noteSearching);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected newContentChildren(theme: THEME, options?: OPTIONS): Array<DisplayObject | null> {\n\t\tconst result = super.newContentChildren(theme, options);\n\t\tresult.push(this.inputLayout, this.list);\n\t\treturn result;\n\t}\n\n\tprotected get inputLayout(): DLayoutHorizontal {\n\t\tlet result = this._inputLayout;\n\t\tif (result == null) {\n\t\t\tresult = this.newInputLayout();\n\t\t\tthis._inputLayout = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInputLayout(): DLayoutHorizontal {\n\t\treturn new DLayoutHorizontal({\n\t\t\twidth: \"padding\",\n\t\t\theight: \"auto\",\n\t\t\tchildren: [this.spaceLeft, this.selectCategory, this.input, this.spaceRight]\n\t\t});\n\t}\n\n\tprotected get spaceLeft(): DLayoutSpace {\n\t\tlet result = this._spaceLeft;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceLeft = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get spaceRight(): DLayoutSpace {\n\t\tlet result = this._spaceRight;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceRight = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSpace(): DLayoutSpace {\n\t\treturn new DLayoutSpace({\n\t\t\twidth: this.toInputMargin(this.theme, this._options)\n\t\t});\n\t}\n\n\tprotected get selectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tlet result = this._selectCategory;\n\t\tif (result === undefined) {\n\t\t\tresult = this.newSelectCategory();\n\t\t\tthis._selectCategory = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSelectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\tconst result = new DSelect<CATEGORY_ID>(\n\t\t\t\t\tthis.toSelectCategoryOptions(this.theme, this._options)\n\t\t\t\t);\n\t\t\t\tresult.on(\"change\", (value: CATEGORY_ID) => {\n\t\t\t\t\tthis.onSelectCategoryChange(value);\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toSelectCategoryOptions(\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DSelectOptions<CATEGORY_ID> {\n\t\tconst result = options?.category || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.width = 140;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onSelectCategoryChange(categoryId: CATEGORY_ID): void {\n\t\tthis.search.create([this.input.value, categoryId]);\n\t}\n\n\tget input(): DInputSearch {\n\t\tlet result = this._input;\n\t\tif (result == null) {\n\t\t\tresult = this.newInput();\n\t\t\tthis._input = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInput(): DInputSearch {\n\t\tconst result = new DInputSearch(this.toInputOptions(this.theme, this._options));\n\t\tresult.on(\"input\", (value: string): void => {\n\t\t\tthis.onInputInput(value);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected toInputOptions(theme: THEME, options?: OPTIONS): DInputSearchOptions {\n\t\tconst result = options?.input || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.weight = 1;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toInputMargin(theme: THEME, options?: OPTIONS): number {\n\t\treturn options?.input?.margin ?? theme.getInputMargin();\n\t}\n\n\tprotected onInputInput(value: string): void {\n\t\tthis.search.create([value, this.selectCategory?.value ?? null]);\n\t}\n\n\tget list(): DDialogSelectList<VALUE> {\n\t\tlet result = this._list;\n\t\tif (result == null) {\n\t\t\tresult = this.newList();\n\t\t\tthis._list = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newList(): DDialogSelectList<VALUE> {\n\t\tconst result = new DDialogSelectList<VALUE>(this.toListOptions(this.theme, this._options));\n\t\tresult.selection.on(\"change\", (selection: DListDataSelection<VALUE>): void => {\n\t\t\tthis.onListSelectionChange(selection);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected onListSelectionChange(selection: DListDataSelection<VALUE>): void {\n\t\tlet selected = selection.first;\n\t\tif (selected == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst dismiss = options.dismiss;\n\t\t\tif (dismiss) {\n\t\t\t\tif (selected === dismiss.value) {\n\t\t\t\t\tselected = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._value = selected;\n\t\tthis.onOk(selected);\n\t}\n\n\tprotected toListOptions(theme: THEME, options?: OPTIONS): DDialogSelectListOptions<VALUE> {\n\t\tconst result = options?.list || {};\n\t\tif (result.width === undefined) {\n\t\t\tresult.width = \"padding\";\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get noteError(): DNote | null {\n\t\tlet result = this._noteError;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteError();\n\t\t\tthis._noteError = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteError(): DNote | null {\n\t\tconst error = this._options?.note?.error;\n\t\tif (error !== null) {\n\t\t\treturn new DNoteSmallError(this.toNoteOptions(this.list, error));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteNoItemsFound(): DNote | null {\n\t\tlet result = this._noteNoItemsFound;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteNoItemsFound();\n\t\t\tthis._noteNoItemsFound = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteNoItemsFound(): DNote | null {\n\t\tconst noItemsFound = this._options?.note?.noItemsFound;\n\t\tif (noItemsFound !== null) {\n\t\t\treturn new DNoteSmallNoItemsFound(this.toNoteOptions(this.list, noItemsFound));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteSearching(): DNote | null {\n\t\tlet result = this._noteSearching;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteSearching();\n\t\t\tthis._noteSearching = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteSearching(): DNote | null {\n\t\tconst searching = this._options?.note?.searching;\n\t\t// Because the `searching` note is disabled by default,\n\t\t// if options.searching is missing, i.e., if its value is undefined,\n\t\t// this method returns null. This is why `!=` is used here instead of `!==`.\n\t\tif (searching != null) {\n\t\t\treturn new DNoteSmallSearching(this.toNoteOptions(this.list, searching));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions {\n\t\tif (options != null) {\n\t\t\tif (options.parent == null) {\n\t\t\t\toptions.parent = parent;\n\t\t\t}\n\t\t\tif (options.visible == null) {\n\t\t\t\toptions.visible = false;\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\t\treturn {\n\t\t\tparent,\n\t\t\tvisible: false\n\t\t};\n\t}\n\n\tprotected get search(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tlet result = this._search;\n\t\tif (result == null) {\n\t\t\tresult = this.newSearch();\n\t\t\tthis._search = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSearch(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller) {\n\t\t\t\tconst dismiss = options.dismiss;\n\t\t\t\tconst search = controller.search;\n\t\t\t\tif (\"create\" in search) {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(search, dismiss);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn search;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(\n\t\t\t\t\t\t\tnew DDialogSelectSearhImpl(search),\n\t\t\t\t\t\t\tdismiss\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new DDialogSelectSearhImpl(search);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new DDialogSelectSearhImpl();\n\t}\n\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\tprotected onSearched(results: VALUE[]): void {\n\t\tthis.list.data.items = results;\n\t}\n\n\tprotected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null> {\n\t\treturn this._value;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialogSelect\";\n\t}\n\n\tprotected onOpen(): void {\n\t\tsuper.onOpen();\n\t\tthis.list.selection.clear();\n\t\tconst selectCategory = this.selectCategory;\n\t\tif (selectCategory != null) {\n\t\t\tif (this._isCategoryFetched !== true) {\n\t\t\t\tthis._isCategoryFetched = true;\n\t\t\t\tconst categoriesOrPromise = this.findCategories();\n\t\t\t\tif (categoriesOrPromise == null) {\n\t\t\t\t\tthis.search.create([this.input.value, null]);\n\t\t\t\t} else if (isArray(categoriesOrPromise)) {\n\t\t\t\t\tthis.onCategoryFetched(selectCategory, categoriesOrPromise);\n\t\t\t\t} else {\n\t\t\t\t\tselectCategory.state.isEnabled = false;\n\t\t\t\t\tcategoriesOrPromise.then((categories) => {\n\t\t\t\t\t\tselectCategory.state.isEnabled = true;\n\t\t\t\t\t\tthis.onCategoryFetched(selectCategory, categories);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.search.create([this.input.value, selectCategory.value]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.search.create([this.input.value, null]);\n\t\t}\n\t}\n\n\tprotected onCategoryFetched(\n\t\tselectCategory: DSelect<CATEGORY_ID>,\n\t\tcategories: CATEGORY[]\n\t): void {\n\t\tconst items = [];\n\t\tfor (let i = 0, imax = categories.length; i < imax; ++i) {\n\t\t\tconst category = categories[i];\n\t\t\titems.push({\n\t\t\t\tvalue: this.toCategoryId(category),\n\t\t\t\ttext: {\n\t\t\t\t\tvalue: this.toCategoryLabel(category)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tselectCategory.menu = new DMenu<CATEGORY_ID>({\n\t\t\tfit: true,\n\t\t\titems\n\t\t});\n\t\tconst newValue = 0 < items.length ? items[0].value : null;\n\t\tselectCategory.value = newValue;\n\t\tselectCategory.show();\n\t\tthis.search.create([this.input.value, newValue]);\n\t}\n\n\tprotected toCategoryId(target: CATEGORY): CATEGORY_ID {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toId = category.toId;\n\t\t\t\tif (toId != null) {\n\t\t\t\t\treturn toId(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryId(target);\n\t}\n\n\tprotected toCategoryLabel(target: CATEGORY): string {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toLabel = category.toLabel;\n\t\t\t\tif (toLabel != null) {\n\t\t\t\t\treturn toLabel(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryLabel(target);\n\t}\n\n\tprotected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\treturn controller.getCategories();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void {\n\t\tthis.emit(\"select\", value, this);\n\t\tsuper.onOk(value);\n\t}\n\n\tdestroy(): void {\n\t\tconst input = this._input;\n\t\tif (input) {\n\t\t\tinput.destroy();\n\t\t}\n\t\tconst noteError = this._noteError;\n\t\tif (noteError) {\n\t\t\tnoteError.destroy();\n\t\t}\n\t\tconst noteNoItemsFound = this._noteNoItemsFound;\n\t\tif (noteNoItemsFound) {\n\t\t\tnoteNoItemsFound?.destroy();\n\t\t}\n\t\tconst noteSearching = this._noteSearching;\n\t\tif (noteSearching) {\n\t\t\tnoteSearching?.destroy();\n\t\t}\n\t\tconst list = this._list;\n\t\tif (list) {\n\t\t\tlist.destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-dialog-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAIH,OAAO,EACN,cAAc,EAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA4B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,YAAY,E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AAI,GAAd,UAAe,KAA+C;QAC7D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACjC,iBAAM,IAAI,YAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED,+BAAO,GAAP;QACC,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,KAAK,EAAE;YACV,KAAK,CAAC,OAAO,EAAE,CAAC;SAChB;QACD,IAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,SAAS,EAAE;YACd,SAAS,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,IAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAChD,IAAI,gBAAgB,EAAE;YACrB,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,OAAO,EAAE,CAAC;SAC5B;QACD,IAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,aAAa,EAAE;YAClB,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,EAAE,CAAC;SACzB;QACD,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;SACf;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,oBAAC;AAAD,CAAC,AArdD,CAeU,cAAc,GAscvB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DisplayObject } from \"pixi.js\";\nimport { DBase } from \"./d-base\";\nimport {\n\tDDialogLayered,\n\tDDialogLayeredEvents,\n\tDDialogLayeredOptions,\n\tDThemeDialogLayered\n} from \"./d-dialog-layered\";\nimport { DDialogSelectList, DDialogSelectListOptions } from \"./d-dialog-select-list\";\nimport { DDialogSelectSearhImpl } from \"./d-dialog-select-search-impl\";\nimport { DInputSearch, DInputSearchOptions } from \"./d-input-search\";\nimport { DLayoutHorizontal } from \"./d-layout-horizontal\";\nimport { DLayoutSpace } from \"./d-layout-space\";\nimport { DListOptions } from \"./d-list\";\nimport { DListDataSelection } from \"./d-list-data-selection\";\nimport { DNote, DNoteOptions } from \"./d-note\";\nimport { DNoteSmallError } from \"./d-note-small-error\";\nimport { DNoteSmallNoItemsFound } from \"./d-note-small-no-items-found\";\nimport { DNoteSmallSearching } from \"./d-note-small-searching\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { UtilTransition } from \"./util/util-transition\";\nimport { DDialogSelectSearch } from \"./d-dialog-select-search\";\nimport { DDialogSelectSearhDismissableOptions } from \"./d-dialog-select-search-dismissable\";\nimport { DDialogSelectSearhDismissableImpl } from \"./d-dialog-select-search-dismissable-impl\";\nimport { DSelect, DSelectOptions } from \"./d-select\";\nimport { DMenu } from \"./d-menu\";\nimport { isArray } from \"./util/is-array\";\nimport { DDialogSelectSearchFunction } from \"./d-dialog-select-search-function\";\n\nexport interface DDialogSelectInputOpitons extends DInputSearchOptions {\n\tmargin?: number;\n}\n\n/**\n * {@link DDialogSelect} controller.\n */\nexport interface DDialogSelectController<VALUE, CATEGORY = unknown, CATEGORY_ID = unknown> {\n\tsearch:\n\t\t| DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>\n\t\t| DDialogSelectSearchFunction<VALUE, CATEGORY, CATEGORY_ID>;\n\tgetCategories?: () => Promise<CATEGORY[]>;\n}\n\n/**\n * {@link DDialogSelect} note options.\n */\nexport interface DDialogSelectNoteOptions {\n\terror?: DNoteOptions | null;\n\tnoItemsFound?: DNoteOptions | null;\n\tsearching?: DNoteOptions | null;\n}\n\nexport type DDialogSelectItemToLabel<VALUE> = (result: VALUE, caller: any) => string;\n\nexport type DDialogSelectItemIsEqual<VALUE> = (a: VALUE, b: VALUE, caller: any) => boolean;\n\n/**\n * {@link DDialogSelect} events.\n */\nexport interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvents<VALUE, EMITTER> {\n\tselect(value: VALUE, self: EMITTER): void;\n}\n\n/**\n * {@link DDialogSelect} category options.\n */\nexport interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>\n\textends DSelectOptions<CATEGORY_ID> {\n\ttoId?: (category: CATEGORY) => CATEGORY_ID;\n\ttoLabel?: (category: CATEGORY) => string;\n}\n\n/**\n * {@link DDialogSelect} \"on\" options.\n */\nexport interface DDialogSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DDialogSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DDialogSelect} options.\n */\nexport interface DDialogSelectOptions<\n\tVALUE,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tEMITTER = any\n> extends DDialogLayeredOptions<VALUE, THEME> {\n\tcontroller?: DDialogSelectController<VALUE, CATEGORY, CATEGORY_ID>;\n\tcategory?: DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tdismiss?: DDialogSelectSearhDismissableOptions<VALUE, CATEGORY, CATEGORY_ID>;\n\tinput?: DDialogSelectInputOpitons;\n\tlist?: DListOptions<VALUE>;\n\tnote?: DDialogSelectNoteOptions;\n\ton?: DDialogSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DDialogSelect} theme.\n */\nexport interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown>\n\textends DThemeDialogLayered {\n\tgetInputMargin(): number;\n\ttoCategoryId(category: CATEGORY): CATEGORY_ID;\n\ttoCategoryLabel(category: CATEGORY): string;\n}\n\nexport class DDialogSelect<\n\tVALUE = unknown,\n\tCATEGORY = unknown,\n\tCATEGORY_ID = unknown,\n\tTHEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID\n\t>,\n\tOPTIONS extends DDialogSelectOptions<\n\t\tVALUE,\n\t\tCATEGORY,\n\t\tCATEGORY_ID,\n\t\tTHEME\n\t> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>\n> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\tprotected _spaceLeft?: DLayoutSpace;\n\tprotected _spaceRight?: DLayoutSpace;\n\tprotected _selectCategory?: DSelect<CATEGORY_ID> | null;\n\tprotected _isCategoryFetched?: boolean;\n\tprotected _input?: DInputSearch;\n\tprotected _inputLayout?: DLayoutHorizontal;\n\tprotected _list?: DDialogSelectList<VALUE>;\n\tprotected _search?: DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID>;\n\tprotected _noteError?: DNote | null;\n\tprotected _noteNoItemsFound?: DNote | null;\n\tprotected _noteSearching?: DNote | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis._value = null;\n\n\t\t// Controller binding\n\t\tconst transition = new UtilTransition();\n\t\tconst search = this.search;\n\t\tsearch.on(\"success\", (e: unknown, results: VALUE[]): void => {\n\t\t\tif (0 < results.length) {\n\t\t\t\ttransition.hide();\n\t\t\t} else {\n\t\t\t\ttransition.show(this.noteNoItemsFound);\n\t\t\t}\n\t\t\tthis.onSearched(results);\n\t\t});\n\t\tsearch.on(\"fail\", (): void => {\n\t\t\ttransition.show(this.noteError);\n\t\t\tthis.onSearched([]);\n\t\t});\n\t\tsearch.on(\"change\", (): void => {\n\t\t\tif (!search.isDone()) {\n\t\t\t\tconst noteSearching = this.noteSearching;\n\t\t\t\tif (noteSearching) {\n\t\t\t\t\ttransition.show(noteSearching);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tprotected newContentChildren(theme: THEME, options?: OPTIONS): Array<DisplayObject | null> {\n\t\tconst result = super.newContentChildren(theme, options);\n\t\tresult.push(this.inputLayout, this.list);\n\t\treturn result;\n\t}\n\n\tprotected get inputLayout(): DLayoutHorizontal {\n\t\tlet result = this._inputLayout;\n\t\tif (result == null) {\n\t\t\tresult = this.newInputLayout();\n\t\t\tthis._inputLayout = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInputLayout(): DLayoutHorizontal {\n\t\treturn new DLayoutHorizontal({\n\t\t\twidth: \"padding\",\n\t\t\theight: \"auto\",\n\t\t\tchildren: [this.spaceLeft, this.selectCategory, this.input, this.spaceRight]\n\t\t});\n\t}\n\n\tprotected get spaceLeft(): DLayoutSpace {\n\t\tlet result = this._spaceLeft;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceLeft = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get spaceRight(): DLayoutSpace {\n\t\tlet result = this._spaceRight;\n\t\tif (result == null) {\n\t\t\tresult = this.newSpace();\n\t\t\tthis._spaceRight = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSpace(): DLayoutSpace {\n\t\treturn new DLayoutSpace({\n\t\t\twidth: this.toInputMargin(this.theme, this._options)\n\t\t});\n\t}\n\n\tprotected get selectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tlet result = this._selectCategory;\n\t\tif (result === undefined) {\n\t\t\tresult = this.newSelectCategory();\n\t\t\tthis._selectCategory = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSelectCategory(): DSelect<CATEGORY_ID> | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\tconst result = new DSelect<CATEGORY_ID>(\n\t\t\t\t\tthis.toSelectCategoryOptions(this.theme, this._options)\n\t\t\t\t);\n\t\t\t\tresult.on(\"change\", (value: CATEGORY_ID) => {\n\t\t\t\t\tthis.onSelectCategoryChange(value);\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toSelectCategoryOptions(\n\t\ttheme: THEME,\n\t\toptions?: OPTIONS\n\t): DSelectOptions<CATEGORY_ID> {\n\t\tconst result = options?.category || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.width = 140;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected onSelectCategoryChange(categoryId: CATEGORY_ID): void {\n\t\tthis.search.create([this.input.value, categoryId]);\n\t}\n\n\tget input(): DInputSearch {\n\t\tlet result = this._input;\n\t\tif (result == null) {\n\t\t\tresult = this.newInput();\n\t\t\tthis._input = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newInput(): DInputSearch {\n\t\tconst result = new DInputSearch(this.toInputOptions(this.theme, this._options));\n\t\tresult.on(\"input\", (value: string): void => {\n\t\t\tthis.onInputInput(value);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected toInputOptions(theme: THEME, options?: OPTIONS): DInputSearchOptions {\n\t\tconst result = options?.input || {};\n\t\tif (result.width === undefined && result.weight === undefined) {\n\t\t\tresult.weight = 1;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected toInputMargin(theme: THEME, options?: OPTIONS): number {\n\t\treturn options?.input?.margin ?? theme.getInputMargin();\n\t}\n\n\tprotected onInputInput(value: string): void {\n\t\tconst selectCategory = this.selectCategory;\n\t\tif (selectCategory != null) {\n\t\t\tthis.search.create([value, selectCategory.value]);\n\t\t} else {\n\t\t\tthis.search.create([value]);\n\t\t}\n\t}\n\n\tget list(): DDialogSelectList<VALUE> {\n\t\tlet result = this._list;\n\t\tif (result == null) {\n\t\t\tresult = this.newList();\n\t\t\tthis._list = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newList(): DDialogSelectList<VALUE> {\n\t\tconst result = new DDialogSelectList<VALUE>(this.toListOptions(this.theme, this._options));\n\t\tresult.selection.on(\"change\", (selection: DListDataSelection<VALUE>): void => {\n\t\t\tthis.onListSelectionChange(selection);\n\t\t});\n\t\treturn result;\n\t}\n\n\tprotected onListSelectionChange(selection: DListDataSelection<VALUE>): void {\n\t\tlet selected = selection.first;\n\t\tif (selected == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst dismiss = options.dismiss;\n\t\t\tif (dismiss) {\n\t\t\t\tif (selected === dismiss.value) {\n\t\t\t\t\tselected = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._value = selected;\n\t\tthis.onOk(selected);\n\t}\n\n\tprotected toListOptions(theme: THEME, options?: OPTIONS): DDialogSelectListOptions<VALUE> {\n\t\tconst result = options?.list || {};\n\t\tif (result.width === undefined) {\n\t\t\tresult.width = \"padding\";\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected get noteError(): DNote | null {\n\t\tlet result = this._noteError;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteError();\n\t\t\tthis._noteError = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteError(): DNote | null {\n\t\tconst error = this._options?.note?.error;\n\t\tif (error !== null) {\n\t\t\treturn new DNoteSmallError(this.toNoteOptions(this.list, error));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteNoItemsFound(): DNote | null {\n\t\tlet result = this._noteNoItemsFound;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteNoItemsFound();\n\t\t\tthis._noteNoItemsFound = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteNoItemsFound(): DNote | null {\n\t\tconst noItemsFound = this._options?.note?.noItemsFound;\n\t\tif (noItemsFound !== null) {\n\t\t\treturn new DNoteSmallNoItemsFound(this.toNoteOptions(this.list, noItemsFound));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected get noteSearching(): DNote | null {\n\t\tlet result = this._noteSearching;\n\t\tif (result == null) {\n\t\t\tresult = this.newNoteSearching();\n\t\t\tthis._noteSearching = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newNoteSearching(): DNote | null {\n\t\tconst searching = this._options?.note?.searching;\n\t\t// Because the `searching` note is disabled by default,\n\t\t// if options.searching is missing, i.e., if its value is undefined,\n\t\t// this method returns null. This is why `!=` is used here instead of `!==`.\n\t\tif (searching != null) {\n\t\t\treturn new DNoteSmallSearching(this.toNoteOptions(this.list, searching));\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected toNoteOptions(parent: DBase, options?: DNoteOptions): DNoteOptions {\n\t\tif (options != null) {\n\t\t\tif (options.parent == null) {\n\t\t\t\toptions.parent = parent;\n\t\t\t}\n\t\t\tif (options.visible == null) {\n\t\t\t\toptions.visible = false;\n\t\t\t}\n\t\t\treturn options;\n\t\t}\n\t\treturn {\n\t\t\tparent,\n\t\t\tvisible: false\n\t\t};\n\t}\n\n\tprotected get search(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tlet result = this._search;\n\t\tif (result == null) {\n\t\t\tresult = this.newSearch();\n\t\t\tthis._search = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected newSearch(): DDialogSelectSearch<VALUE, CATEGORY, CATEGORY_ID> {\n\t\tconst options = this._options;\n\t\tif (options) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller) {\n\t\t\t\tconst dismiss = options.dismiss;\n\t\t\t\tconst search = controller.search;\n\t\t\t\tif (\"create\" in search) {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(search, dismiss);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn search;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (dismiss != null) {\n\t\t\t\t\t\treturn new DDialogSelectSearhDismissableImpl(\n\t\t\t\t\t\t\tnew DDialogSelectSearhImpl(search),\n\t\t\t\t\t\t\tdismiss\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new DDialogSelectSearhImpl(search);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn new DDialogSelectSearhImpl();\n\t}\n\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\tprotected onSearched(results: VALUE[]): void {\n\t\tthis.list.data.items = results;\n\t}\n\n\tprotected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null> {\n\t\treturn this._value;\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DDialogSelect\";\n\t}\n\n\tprotected onOpen(): void {\n\t\tsuper.onOpen();\n\t\tthis.list.selection.clear();\n\t\tconst selectCategory = this.selectCategory;\n\t\tif (selectCategory != null) {\n\t\t\tif (this._isCategoryFetched !== true) {\n\t\t\t\tthis._isCategoryFetched = true;\n\t\t\t\tconst categoriesOrPromise = this.findCategories();\n\t\t\t\tif (categoriesOrPromise == null) {\n\t\t\t\t\tthis.search.create([this.input.value, null]);\n\t\t\t\t} else if (isArray(categoriesOrPromise)) {\n\t\t\t\t\tthis.onCategoryFetched(selectCategory, categoriesOrPromise);\n\t\t\t\t} else {\n\t\t\t\t\tselectCategory.state.isEnabled = false;\n\t\t\t\t\tcategoriesOrPromise.then((categories) => {\n\t\t\t\t\t\tselectCategory.state.isEnabled = true;\n\t\t\t\t\t\tthis.onCategoryFetched(selectCategory, categories);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.search.create([this.input.value, selectCategory.value]);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.search.create([this.input.value]);\n\t\t}\n\t}\n\n\tprotected onCategoryFetched(\n\t\tselectCategory: DSelect<CATEGORY_ID>,\n\t\tcategories: CATEGORY[]\n\t): void {\n\t\tconst items = [];\n\t\tfor (let i = 0, imax = categories.length; i < imax; ++i) {\n\t\t\tconst category = categories[i];\n\t\t\titems.push({\n\t\t\t\tvalue: this.toCategoryId(category),\n\t\t\t\ttext: {\n\t\t\t\t\tvalue: this.toCategoryLabel(category)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tselectCategory.menu = new DMenu<CATEGORY_ID>({\n\t\t\tfit: true,\n\t\t\titems\n\t\t});\n\t\tconst newValue = 0 < items.length ? items[0].value : null;\n\t\tselectCategory.value = newValue;\n\t\tselectCategory.show();\n\t\tthis.search.create([this.input.value, newValue]);\n\t}\n\n\tprotected toCategoryId(target: CATEGORY): CATEGORY_ID {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toId = category.toId;\n\t\t\t\tif (toId != null) {\n\t\t\t\t\treturn toId(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryId(target);\n\t}\n\n\tprotected toCategoryLabel(target: CATEGORY): string {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst category = options.category;\n\t\t\tif (category != null) {\n\t\t\t\tconst toLabel = category.toLabel;\n\t\t\t\tif (toLabel != null) {\n\t\t\t\t\treturn toLabel(target);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.theme.toCategoryLabel(target);\n\t}\n\n\tprotected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null {\n\t\tconst options = this._options;\n\t\tif (options != null) {\n\t\t\tconst controller = options.controller;\n\t\t\tif (controller != null && controller.getCategories != null) {\n\t\t\t\treturn controller.getCategories();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void {\n\t\tthis.emit(\"select\", value, this);\n\t\tsuper.onOk(value);\n\t}\n\n\tdestroy(): void {\n\t\tconst input = this._input;\n\t\tif (input) {\n\t\t\tinput.destroy();\n\t\t}\n\t\tconst noteError = this._noteError;\n\t\tif (noteError) {\n\t\t\tnoteError.destroy();\n\t\t}\n\t\tconst noteNoItemsFound = this._noteNoItemsFound;\n\t\tif (noteNoItemsFound) {\n\t\t\tnoteNoItemsFound?.destroy();\n\t\t}\n\t\tconst noteSearching = this._noteSearching;\n\t\tif (noteSearching) {\n\t\t\tnoteSearching?.destroy();\n\t\t}\n\t\tconst list = this._list;\n\t\tif (list) {\n\t\t\tlist.destroy();\n\t\t}\n\t\tsuper.destroy();\n\t}\n}\n"]}
|
|
@@ -25,13 +25,16 @@ var CURSOR = 0x20000;
|
|
|
25
25
|
var ORDER_IN_LAYER = 0x40000;
|
|
26
26
|
var CHILDREN = 0x80000;
|
|
27
27
|
var DATA_MAPPING = 0x100000;
|
|
28
|
+
var LINE = 0x200000;
|
|
29
|
+
var LINE_TAIL = 0x400000;
|
|
30
|
+
var LINE_HEAD = 0x800000;
|
|
28
31
|
var COORDINATE = POSITION | WIDTH | HEIGHT | ROTATION | SKEW;
|
|
29
|
-
var SHAPE = REPLACING | GROUPING | FILL | STROKE;
|
|
32
|
+
var SHAPE = REPLACING | GROUPING | FILL | STROKE | LINE | LINE_TAIL | LINE_HEAD;
|
|
30
33
|
var LAYER = ORDER_IN_LAYER;
|
|
31
34
|
var PRIMITIVE = ID | COORDINATE | SHAPE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
|
|
32
35
|
var GROUP = PRIMITIVE | UNGROUPING;
|
|
33
36
|
var EMBEDDED = ID | COORDINATE | REPLACING | GROUPING | TEXT | DATA | ACTION | LAYER | DATA_MAPPING;
|
|
34
|
-
var CONNECTOR = ID | REPLACING | FILL | STROKE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
|
|
37
|
+
var CONNECTOR = ID | REPLACING | FILL | STROKE | LINE | LINE_TAIL | LINE_HEAD | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;
|
|
35
38
|
var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
|
|
36
39
|
export var EShapeCapability = {
|
|
37
40
|
NONE: NONE,
|
|
@@ -123,6 +126,18 @@ export var EShapeCapability = {
|
|
|
123
126
|
* Allows shape children to be modified.
|
|
124
127
|
*/
|
|
125
128
|
CHILDREN: CHILDREN,
|
|
129
|
+
/**
|
|
130
|
+
* Allows shape line to be modified.
|
|
131
|
+
*/
|
|
132
|
+
LINE: LINE,
|
|
133
|
+
/**
|
|
134
|
+
* Allows shape line tail to be modified.
|
|
135
|
+
*/
|
|
136
|
+
LINE_TAIL: LINE_TAIL,
|
|
137
|
+
/**
|
|
138
|
+
* Allows shape line head to be modified.
|
|
139
|
+
*/
|
|
140
|
+
LINE_HEAD: LINE_HEAD,
|
|
126
141
|
COORDINATE: COORDINATE,
|
|
127
142
|
SHAPE: SHAPE,
|
|
128
143
|
LAYER: LAYER,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-capability.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/shape/e-shape-capability.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sCAAsC;AAEtC,IAAM,IAAI,GAAK,GAAG,CAAC;AAEnB,IAAM,EAAE,GAAK,GAAG,CAAC;AACjB,IAAM,QAAQ,GAAI,GAAG,CAAC;AACtB,IAAM,KAAK,GAAK,GAAG,CAAC;AACpB,IAAM,MAAM,GAAI,GAAG,CAAC;AACpB,IAAM,QAAQ,GAAI,IAAI,CAAC;AACvB,IAAM,IAAI,GAAK,IAAI,CAAC;AAEpB,IAAM,SAAS,GAAI,IAAI,CAAC;AACxB,IAAM,QAAQ,GAAI,IAAI,CAAC;AACvB,IAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,IAAM,IAAI,GAAK,KAAK,CAAC;AACrB,IAAM,MAAM,GAAI,KAAK,CAAC;AACtB,IAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,IAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,IAAM,IAAI,GAAK,MAAM,CAAC;AACtB,IAAM,OAAO,GAAI,MAAM,CAAC;AACxB,IAAM,IAAI,GAAK,MAAM,CAAC;AACtB,IAAM,MAAM,GAAI,OAAO,CAAC;AACxB,IAAM,MAAM,GAAI,OAAO,CAAC;AACxB,IAAM,cAAc,GA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WAAA;IAET;;OAEG;IACH,QAAQ,UAAA;IAER;;OAEG;IACH,UAAU,YAAA;IAEV;;OAEG;IACH,IAAI,MAAA;IAEJ;;OAEG;IACH,MAAM,QAAA;IAEN;;OAEG;IACH,WAAW,aAAA;IAEX;;OAEG;IACH,aAAa,eAAA;IAEb;;OAEG;IACH,IAAI,MAAA;IAEJ;;OAEG;IACH,OAAO,SAAA;IAEP,2CAA2C;IAC3C,GAAG,EAAE,IAAI;IAET;;OAEG;IACH,IAAI,MAAA;IAEJ;;OAEG;IACH,YAAY,cAAA;IAEZ;;OAEG;IACH,MAAM,QAAA;IAEN;;OAEG;IACH,MAAM,QAAA;IAEN;;OAEG;IACH,cAAc,gBAAA;IAEd;;OAEG;IACH,QAAQ,UAAA;IAER;;OAEG;IACH,IAAI,MAAA;IAEJ;;OAEG;IACH,SAAS,WAAA;IAET;;OAEG;IACH,SAAS,WAAA;IAET,UAAU,YAAA;IACV,KAAK,OAAA;IACL,KAAK,OAAA;IACL,SAAS,WAAA;IACT,KAAK,OAAA;IACL,QAAQ,UAAA;IACR,SAAS,WAAA;IACT,GAAG,KAAA;CACM,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/* eslint-disable prettier/prettier */\n\nconst NONE\t\t\t= 0x0;\n\nconst ID\t\t\t= 0x1;\nconst POSITION\t\t= 0x2;\nconst WIDTH\t\t\t= 0x4;\nconst HEIGHT\t\t= 0x8;\nconst ROTATION\t\t= 0x10;\nconst SKEW\t\t\t= 0x20;\n\nconst REPLACING\t\t= 0x40;\nconst GROUPING\t\t= 0x80;\nconst UNGROUPING\t= 0x100;\n\nconst FILL\t\t\t= 0x200;\nconst STROKE\t\t= 0x400;\nconst STROKE_SIDE\t= 0x800;\nconst BORDER_RADIUS\t= 0x1000;\n\nconst TEXT\t\t\t= 0x2000;\nconst TEXTURE\t\t= 0x4000;\nconst DATA\t\t\t= 0x8000;\nconst ACTION\t\t= 0x10000;\nconst CURSOR\t\t= 0x20000;\nconst ORDER_IN_LAYER= 0x40000;\n\nconst CHILDREN\t\t= 0x80000;\n\nconst DATA_MAPPING\t= 0x100000;\n\nconst LINE\t\t\t= 0x200000;\nconst LINE_TAIL\t\t= 0x400000;\nconst LINE_HEAD\t\t= 0x800000;\n\nconst COORDINATE\t= POSITION | WIDTH | HEIGHT | ROTATION | SKEW;\nconst SHAPE\t\t\t= REPLACING | GROUPING | FILL | STROKE | LINE | LINE_TAIL | LINE_HEAD;\nconst LAYER\t\t\t= ORDER_IN_LAYER;\nconst PRIMITIVE\t\t= ID | COORDINATE | SHAPE | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;\nconst GROUP\t\t\t= PRIMITIVE | UNGROUPING;\nconst EMBEDDED\t\t= ID | COORDINATE | REPLACING | GROUPING | TEXT | DATA | ACTION | LAYER | DATA_MAPPING;\nconst CONNECTOR\t\t= ID | REPLACING | FILL | STROKE | LINE | LINE_TAIL | LINE_HEAD | TEXT | TEXTURE | DATA | ACTION | CURSOR | LAYER | CHILDREN;\nconst ALL\t\t\t= PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;\n\nexport const EShapeCapability = {\n\tNONE,\n\n\t/**\n\t * Allows shape IDs to be modified.\n\t */\n\tID,\n\n\t/**\n\t * Allows shape positions to be modified.\n\t */\n\tPOSITION,\n\n\t/**\n\t * Allows shape widths to be modified.\n\t */\n\tWIDTH,\n\n\t/**\n\t * Allows shape heights to be modified.\n\t */\n\tHEIGHT,\n\n\t/**\n\t * Allows shape rotations to be modified.\n\t */\n\tROTATION,\n\n\t/**\n\t * Allows shape skews to be modified.\n\t */\n\tSKEW,\n\n\t/** @deprecated */\n\tALIGN: NONE,\n\n\t/**\n\t * Allows shapes to be replaced with other shapes.\n\t */\n\tREPLACING,\n\n\t/**\n\t * Allows shapes to be grouped.\n\t */\n\tGROUPING,\n\n\t/**\n\t * Allows grouped shapes to be ungrouped.\n\t */\n\tUNGROUPING,\n\n\t/**\n\t * Allows shape fills to be modified.\n\t */\n\tFILL,\n\n\t/**\n\t * Allows shape strokes to be modified.\n\t */\n\tSTROKE,\n\n\t/**\n\t * Allows shape stroke sides to be modified.\n\t */\n\tSTROKE_SIDE,\n\n\t/**\n\t * Allows shape border radiuses to be modified.\n\t */\n\tBORDER_RADIUS,\n\n\t/**\n\t * Allows shape texts to be modified.\n\t */\n\tTEXT,\n\n\t/**\n\t * Allows shape textures to be modified.\n\t */\n\tTEXTURE,\n\n\t/** @deprecated in favor of {@link DATA} */\n\tTAG: DATA,\n\n\t/**\n\t * Allows shape data to be modified.\n\t */\n\tDATA,\n\n\t/**\n\t * Allows shape data mapping to be modified.\n\t */\n\tDATA_MAPPING,\n\n\t/**\n\t * Allows shape actions to be modified.\n\t */\n\tACTION,\n\n\t/**\n\t * Allows shape cursors to be modified.\n\t */\n\tCURSOR,\n\n\t/**\n\t * Allows shape orders in layer to be modified.\n\t */\n\tORDER_IN_LAYER,\n\n\t/**\n\t * Allows shape children to be modified.\n\t */\n\tCHILDREN,\n\n\t/**\n\t * Allows shape line to be modified.\n\t */\n\tLINE,\n\n\t/**\n\t * Allows shape line tail to be modified.\n\t */\n\tLINE_TAIL,\n\n\t/**\n\t * Allows shape line head to be modified.\n\t */\n\tLINE_HEAD,\n\n\tCOORDINATE,\n\tSHAPE,\n\tLAYER,\n\tPRIMITIVE,\n\tGROUP,\n\tEMBEDDED,\n\tCONNECTOR,\n\tALL\n} as const;\n\nexport type EShapeCapability = typeof EShapeCapability[keyof typeof EShapeCapability];\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.339.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -4464,13 +4464,16 @@ var CURSOR$1 = 0x20000;
|
|
|
4464
4464
|
var ORDER_IN_LAYER = 0x40000;
|
|
4465
4465
|
var CHILDREN$1 = 0x80000;
|
|
4466
4466
|
var DATA_MAPPING = 0x100000;
|
|
4467
|
+
var LINE = 0x200000;
|
|
4468
|
+
var LINE_TAIL = 0x400000;
|
|
4469
|
+
var LINE_HEAD = 0x800000;
|
|
4467
4470
|
var COORDINATE = POSITION | WIDTH$1 | HEIGHT$1 | ROTATION$1 | SKEW;
|
|
4468
|
-
var SHAPE = REPLACING | GROUPING | FILL$1 | STROKE$1;
|
|
4471
|
+
var SHAPE = REPLACING | GROUPING | FILL$1 | STROKE$1 | LINE | LINE_TAIL | LINE_HEAD;
|
|
4469
4472
|
var LAYER = ORDER_IN_LAYER;
|
|
4470
4473
|
var PRIMITIVE = ID | COORDINATE | SHAPE | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
|
|
4471
4474
|
var GROUP = PRIMITIVE | UNGROUPING;
|
|
4472
4475
|
var EMBEDDED = ID | COORDINATE | REPLACING | GROUPING | TEXT$2 | DATA | ACTION | LAYER | DATA_MAPPING;
|
|
4473
|
-
var CONNECTOR = ID | REPLACING | FILL$1 | STROKE$1 | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
|
|
4476
|
+
var CONNECTOR = ID | REPLACING | FILL$1 | STROKE$1 | LINE | LINE_TAIL | LINE_HEAD | TEXT$2 | TEXTURE | DATA | ACTION | CURSOR$1 | LAYER | CHILDREN$1;
|
|
4474
4477
|
var ALL = PRIMITIVE | STROKE_SIDE | BORDER_RADIUS | DATA_MAPPING | UNGROUPING;
|
|
4475
4478
|
var EShapeCapability = {
|
|
4476
4479
|
NONE: NONE,
|
|
@@ -4562,6 +4565,18 @@ var EShapeCapability = {
|
|
|
4562
4565
|
* Allows shape children to be modified.
|
|
4563
4566
|
*/
|
|
4564
4567
|
CHILDREN: CHILDREN$1,
|
|
4568
|
+
/**
|
|
4569
|
+
* Allows shape line to be modified.
|
|
4570
|
+
*/
|
|
4571
|
+
LINE: LINE,
|
|
4572
|
+
/**
|
|
4573
|
+
* Allows shape line tail to be modified.
|
|
4574
|
+
*/
|
|
4575
|
+
LINE_TAIL: LINE_TAIL,
|
|
4576
|
+
/**
|
|
4577
|
+
* Allows shape line head to be modified.
|
|
4578
|
+
*/
|
|
4579
|
+
LINE_HEAD: LINE_HEAD,
|
|
4565
4580
|
COORDINATE: COORDINATE,
|
|
4566
4581
|
SHAPE: SHAPE,
|
|
4567
4582
|
LAYER: LAYER,
|
|
@@ -73647,6 +73662,29 @@ var DDialogSelectList = /** @class */ (function (_super) {
|
|
|
73647
73662
|
return DDialogSelectList;
|
|
73648
73663
|
}(DList));
|
|
73649
73664
|
|
|
73665
|
+
/*
|
|
73666
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
73667
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
73668
|
+
*/
|
|
73669
|
+
var DDialogSelectSearchFunctions = {
|
|
73670
|
+
isCategorized: function (search) {
|
|
73671
|
+
return search.length <= 1;
|
|
73672
|
+
},
|
|
73673
|
+
toCategorized: function (search) {
|
|
73674
|
+
if (search == null) {
|
|
73675
|
+
return function (word, categoryId) { return Promise.resolve([]); };
|
|
73676
|
+
}
|
|
73677
|
+
else if (this.isCategorized(search)) {
|
|
73678
|
+
return function (word, categoryId) {
|
|
73679
|
+
return search(word);
|
|
73680
|
+
};
|
|
73681
|
+
}
|
|
73682
|
+
else {
|
|
73683
|
+
return search;
|
|
73684
|
+
}
|
|
73685
|
+
}
|
|
73686
|
+
};
|
|
73687
|
+
|
|
73650
73688
|
/*
|
|
73651
73689
|
* Copyright (C) 2019 Toshiba Corporation
|
|
73652
73690
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -73655,15 +73693,16 @@ var DDialogSelectSearhImpl = /** @class */ (function (_super) {
|
|
|
73655
73693
|
__extends(DDialogSelectSearhImpl, _super);
|
|
73656
73694
|
function DDialogSelectSearhImpl(search) {
|
|
73657
73695
|
var _this = _super.call(this) || this;
|
|
73658
|
-
_this._search =
|
|
73696
|
+
_this._search = DDialogSelectSearchFunctions.toCategorized(search);
|
|
73659
73697
|
_this._id = 0;
|
|
73660
73698
|
_this._idCompleted = 0;
|
|
73661
73699
|
return _this;
|
|
73662
73700
|
}
|
|
73663
73701
|
DDialogSelectSearhImpl.prototype.create = function (args) {
|
|
73664
73702
|
var _this = this;
|
|
73703
|
+
var _a;
|
|
73665
73704
|
var id = ++this._id;
|
|
73666
|
-
this._search(args[0], args[1]).then(function (searchResult) {
|
|
73705
|
+
this._search(args[0], (_a = args[1]) !== null && _a !== void 0 ? _a : null).then(function (searchResult) {
|
|
73667
73706
|
if (_this._id === id) {
|
|
73668
73707
|
_this._idCompleted = id;
|
|
73669
73708
|
_this.emit("success", _this, searchResult);
|
|
@@ -73989,8 +74028,13 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
73989
74028
|
return (_b = (_a = options === null || options === void 0 ? void 0 : options.input) === null || _a === void 0 ? void 0 : _a.margin) !== null && _b !== void 0 ? _b : theme.getInputMargin();
|
|
73990
74029
|
};
|
|
73991
74030
|
DDialogSelect.prototype.onInputInput = function (value) {
|
|
73992
|
-
var
|
|
73993
|
-
|
|
74031
|
+
var selectCategory = this.selectCategory;
|
|
74032
|
+
if (selectCategory != null) {
|
|
74033
|
+
this.search.create([value, selectCategory.value]);
|
|
74034
|
+
}
|
|
74035
|
+
else {
|
|
74036
|
+
this.search.create([value]);
|
|
74037
|
+
}
|
|
73994
74038
|
};
|
|
73995
74039
|
Object.defineProperty(DDialogSelect.prototype, "list", {
|
|
73996
74040
|
get: function () {
|
|
@@ -74197,7 +74241,7 @@ var DDialogSelect = /** @class */ (function (_super) {
|
|
|
74197
74241
|
}
|
|
74198
74242
|
}
|
|
74199
74243
|
else {
|
|
74200
|
-
this.search.create([this.input.value
|
|
74244
|
+
this.search.create([this.input.value]);
|
|
74201
74245
|
}
|
|
74202
74246
|
};
|
|
74203
74247
|
DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
|