@wcardinal/wcardinal-ui 0.359.0 → 0.361.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/types/wcardinal/ui/d-dialog-select.d.ts +10 -10
  2. package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
  3. package/dist/types/wcardinal/ui/util/to-label-with.d.ts +1 -0
  4. package/dist/wcardinal/ui/d-dialog-select.js +28 -14
  5. package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
  6. package/dist/wcardinal/ui/d-select.js +4 -10
  7. package/dist/wcardinal/ui/d-select.js.map +1 -1
  8. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +2 -2
  9. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
  10. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +2 -2
  11. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
  12. package/dist/wcardinal/ui/util/index.js +1 -0
  13. package/dist/wcardinal/ui/util/index.js.map +1 -1
  14. package/dist/wcardinal/ui/util/to-label-with.js +27 -0
  15. package/dist/wcardinal/ui/util/to-label-with.js.map +1 -0
  16. package/dist/wcardinal/ui/util/to-label.js +2 -20
  17. package/dist/wcardinal/ui/util/to-label.js.map +1 -1
  18. package/dist/wcardinal-ui-theme-dark.js +4 -2
  19. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  20. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  21. package/dist/wcardinal-ui-theme-white.js +4 -2
  22. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  23. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  24. package/dist/wcardinal-ui.cjs.js +45 -29
  25. package/dist/wcardinal-ui.js +43 -27
  26. package/dist/wcardinal-ui.min.js +2 -2
  27. package/dist/wcardinal-ui.min.js.map +1 -1
  28. package/package.json +1 -1
@@ -42,9 +42,9 @@ export interface DDialogSelectEvents<VALUE, EMITTER> extends DDialogLayeredEvent
42
42
  /**
43
43
  * {@link DDialogSelect} category options.
44
44
  */
45
- export interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID> extends DSelectOptions<CATEGORY_ID> {
45
+ export interface DDialogSelectCategoryOptions<VALUE, CATEGORY, CATEGORY_ID> extends DSelectOptions<CATEGORY_ID | null> {
46
46
  toId?: (category: CATEGORY) => CATEGORY_ID;
47
- toLabel?: (category: CATEGORY) => string;
47
+ toLabel?: (category: CATEGORY | null) => string;
48
48
  }
49
49
  /**
50
50
  * {@link DDialogSelect} "on" options.
@@ -69,13 +69,13 @@ export interface DDialogSelectOptions<VALUE, CATEGORY = unknown, CATEGORY_ID = u
69
69
  export interface DThemeDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown> extends DThemeDialogLayered {
70
70
  getInputMargin(): number;
71
71
  toCategoryId(category: CATEGORY): CATEGORY_ID;
72
- toCategoryLabel(category: CATEGORY): string;
72
+ toCategoryLabel(category: CATEGORY | null): string;
73
73
  }
74
74
  export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY_ID = unknown, THEME extends DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID> = DThemeDialogSelect<VALUE, CATEGORY, CATEGORY_ID>, OPTIONS extends DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME> = DDialogSelectOptions<VALUE, CATEGORY, CATEGORY_ID, THEME>> extends DDialogLayered<VALUE | null, THEME, OPTIONS> {
75
75
  protected _value: VALUE | null;
76
76
  protected _spaceLeft?: DLayoutSpace;
77
77
  protected _spaceRight?: DLayoutSpace;
78
- protected _selectCategory?: DSelect<CATEGORY_ID> | null;
78
+ protected _selectCategory?: DSelect<CATEGORY_ID | null> | null;
79
79
  protected _isCategoryFetched?: boolean;
80
80
  protected _input?: DInputSearch;
81
81
  protected _inputLayout?: DLayoutHorizontal;
@@ -91,9 +91,9 @@ export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY
91
91
  protected get spaceLeft(): DLayoutSpace;
92
92
  protected get spaceRight(): DLayoutSpace;
93
93
  protected newSpace(): DLayoutSpace;
94
- protected get selectCategory(): DSelect<CATEGORY_ID> | null;
95
- protected newSelectCategory(): DSelect<CATEGORY_ID> | null;
96
- protected toSelectCategoryOptions(theme: THEME, options?: OPTIONS): DSelectOptions<CATEGORY_ID>;
94
+ protected get selectCategory(): DSelect<CATEGORY_ID | null> | null;
95
+ protected newSelectCategory(): DSelect<CATEGORY_ID | null> | null;
96
+ protected toSelectCategoryOptions(theme: THEME, options?: OPTIONS): DSelectOptions<CATEGORY_ID | null>;
97
97
  protected onSelectCategoryChange(categoryId: CATEGORY_ID): void;
98
98
  get input(): DInputSearch;
99
99
  protected newInput(): DInputSearch;
@@ -118,9 +118,9 @@ export declare class DDialogSelect<VALUE = unknown, CATEGORY = unknown, CATEGORY
118
118
  protected getResolvedValue(): VALUE | null | PromiseLike<VALUE | null>;
119
119
  protected getType(): string;
120
120
  protected onOpen(): void;
121
- protected onCategoryFetched(selectCategory: DSelect<CATEGORY_ID>, categories: CATEGORY[]): void;
122
- protected toCategoryId(target: CATEGORY): CATEGORY_ID;
123
- protected toCategoryLabel(target: CATEGORY): string;
121
+ protected onCategoryFetched(selectCategory: DSelect<CATEGORY_ID | null>, categories: CATEGORY[]): void;
122
+ protected newToCategoryId(): (category: CATEGORY) => CATEGORY_ID;
123
+ protected newToCategoryLabel(): (category: CATEGORY | null) => string;
124
124
  protected findCategories(): Promise<CATEGORY[]> | CATEGORY[] | null;
125
125
  protected onOk(value: VALUE | null | PromiseLike<VALUE | null>): void;
126
126
  destroy(): void;
@@ -33,6 +33,7 @@ export * from "./to-cloned";
33
33
  export * from "./to-enum";
34
34
  export * from "./to-id";
35
35
  export * from "./to-index-of";
36
+ export * from "./to-label-with";
36
37
  export * from "./to-label";
37
38
  export * from "./to-merged";
38
39
  export * from "./to-padded";
@@ -0,0 +1 @@
1
+ export declare const toLabelWith: (target: any, def: string) => string;
@@ -17,6 +17,7 @@ import { DDialogSelectSearhDismissableImpl } from "./d-dialog-select-search-dism
17
17
  import { DSelect } from "./d-select";
18
18
  import { DMenu } from "./d-menu";
19
19
  import { isArray } from "./util/is-array";
20
+ import { DBaseState } from "./d-base-state";
20
21
  var DDialogSelect = /** @class */ (function (_super) {
21
22
  __extends(DDialogSelect, _super);
22
23
  function DDialogSelect(options) {
@@ -133,6 +134,9 @@ var DDialogSelect = /** @class */ (function (_super) {
133
134
  if (result.width === undefined && result.weight === undefined) {
134
135
  result.width = 140;
135
136
  }
137
+ if (result.state === undefined) {
138
+ result.state = DBaseState.DISABLED;
139
+ }
136
140
  return result;
137
141
  };
138
142
  DDialogSelect.prototype.onSelectCategoryChange = function (categoryId) {
@@ -371,9 +375,7 @@ var DDialogSelect = /** @class */ (function (_super) {
371
375
  this.onCategoryFetched(selectCategory, categoriesOrPromise);
372
376
  }
373
377
  else {
374
- selectCategory.state.isEnabled = false;
375
378
  categoriesOrPromise.then(function (categories) {
376
- selectCategory.state.isEnabled = true;
377
379
  _this.onCategoryFetched(selectCategory, categories);
378
380
  });
379
381
  }
@@ -388,12 +390,20 @@ var DDialogSelect = /** @class */ (function (_super) {
388
390
  };
389
391
  DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
390
392
  var items = [];
393
+ var toId = this.newToCategoryId();
394
+ var toLabel = this.newToCategoryLabel();
395
+ items.push({
396
+ value: null,
397
+ text: {
398
+ value: toLabel(null)
399
+ }
400
+ });
391
401
  for (var i = 0, imax = categories.length; i < imax; ++i) {
392
402
  var category = categories[i];
393
403
  items.push({
394
- value: this.toCategoryId(category),
404
+ value: toId(category),
395
405
  text: {
396
- value: this.toCategoryLabel(category)
406
+ value: toLabel(category)
397
407
  }
398
408
  });
399
409
  }
@@ -401,36 +411,40 @@ var DDialogSelect = /** @class */ (function (_super) {
401
411
  fit: true,
402
412
  items: items
403
413
  });
404
- var newValue = 0 < items.length ? items[0].value : null;
405
- selectCategory.value = newValue;
406
- selectCategory.show();
407
- this.search.create([this.input.value, newValue]);
414
+ selectCategory.state.isEnabled = true;
415
+ this.search.create([this.input.value, null]);
408
416
  };
409
- DDialogSelect.prototype.toCategoryId = function (target) {
417
+ DDialogSelect.prototype.newToCategoryId = function () {
410
418
  var options = this._options;
411
419
  if (options != null) {
412
420
  var category = options.category;
413
421
  if (category != null) {
414
422
  var toId = category.toId;
415
423
  if (toId != null) {
416
- return toId(target);
424
+ return toId;
417
425
  }
418
426
  }
419
427
  }
420
- return this.theme.toCategoryId(target);
428
+ var theme = this.theme;
429
+ return function (category) {
430
+ return theme.toCategoryId(category);
431
+ };
421
432
  };
422
- DDialogSelect.prototype.toCategoryLabel = function (target) {
433
+ DDialogSelect.prototype.newToCategoryLabel = function () {
423
434
  var options = this._options;
424
435
  if (options != null) {
425
436
  var category = options.category;
426
437
  if (category != null) {
427
438
  var toLabel = category.toLabel;
428
439
  if (toLabel != null) {
429
- return toLabel(target);
440
+ return toLabel;
430
441
  }
431
442
  }
432
443
  }
433
- return this.theme.toCategoryLabel(target);
444
+ var theme = this.theme;
445
+ return function (category) {
446
+ return theme.toCategoryLabel(category);
447
+ };
434
448
  };
435
449
  DDialogSelect.prototype.findCategories = function () {
436
450
  var options = this._options;
@@ -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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I,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?: () => CATEGORY[] | 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}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CAAC;QACxB,IAAI,IAAI,EAAE;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;SACf;QACD,iBAAM,OAAO,WAAE,CAAC;IACjB,CAAC;IACF,oBAAC;AAAD,CAAC,AAleD,CAeU,cAAc,GAmdvB","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\";\nimport { DBaseState } from \"./d-base-state\";\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?: () => CATEGORY[] | 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 | null> {\n\ttoId?: (category: CATEGORY) => CATEGORY_ID;\n\ttoLabel?: (category: CATEGORY | null) => 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 | null): 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> | 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> | 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> | 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 | null>(\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 | null> {\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\tif (result.state === undefined) {\n\t\t\tresult.state = DBaseState.DISABLED;\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\tcategoriesOrPromise.then((categories) => {\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 | null>,\n\t\tcategories: CATEGORY[]\n\t): void {\n\t\tconst items = [];\n\t\tconst toId = this.newToCategoryId();\n\t\tconst toLabel = this.newToCategoryLabel();\n\t\titems.push({\n\t\t\tvalue: null,\n\t\t\ttext: {\n\t\t\t\tvalue: toLabel(null)\n\t\t\t}\n\t\t});\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: toId(category),\n\t\t\t\ttext: {\n\t\t\t\t\tvalue: toLabel(category)\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tselectCategory.menu = new DMenu<CATEGORY_ID | null>({\n\t\t\tfit: true,\n\t\t\titems\n\t\t});\n\t\tselectCategory.state.isEnabled = true;\n\t\tthis.search.create([this.input.value, null]);\n\t}\n\n\tprotected newToCategoryId(): (category: 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;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst theme = this.theme;\n\t\treturn (category: CATEGORY): CATEGORY_ID => {\n\t\t\treturn theme.toCategoryId(category);\n\t\t};\n\t}\n\n\tprotected newToCategoryLabel(): (category: CATEGORY | null) => 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;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst theme = this.theme;\n\t\treturn (category: CATEGORY | null): string => {\n\t\t\treturn theme.toCategoryLabel(category);\n\t\t};\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"]}
@@ -34,16 +34,10 @@ var DSelect = /** @class */ (function (_super) {
34
34
  _super.prototype.onMenuReplaced.call(this, newMenu, oldMenu);
35
35
  // Update the value
36
36
  var value = this._value;
37
- if (value != null) {
38
- var item = this.findMenuItem(newMenu, value);
39
- if (item != null) {
40
- this._value = value;
41
- this.text = item;
42
- }
43
- else {
44
- this._value = null;
45
- this.text = null;
46
- }
37
+ var item = this.findMenuItem(newMenu, value);
38
+ if (item != null) {
39
+ this._value = value;
40
+ this.text = item;
47
41
  }
48
42
  else {
49
43
  this._value = null;
@@ -1 +1 @@
1
- {"version":3,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ACpB,CAAC;QAED;;WAEG;aACH,UAAU,KAAmB;YAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,EAAE;gBAC1B,IAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACjD,IAAI,IAAI,IAAI,IAAI,EAAE;oBACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;oBACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;iBACjB;qBAAM;oBACN,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;oBACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;iBACjB;aACD;QACF,CAAC;;;OAhBA;IAkBS,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AApGD,CAIU,aAAa,GAgGtB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tDDropdownBase,\n\tDDropdownBaseEvents,\n\tDDropdownBaseOptions,\n\tDThemeDropdownBase\n} from \"./d-dropdown-base\";\nimport { DMenu } from \"./d-menu\";\nimport { DMenuItem } from \"./d-menu-item\";\nimport { DMenuItemMenu } from \"./d-menu-item-menu\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * {@link DSelect} events.\n */\nexport interface DSelectEvents<VALUE, EMITTER>\n\textends DDropdownBaseEvents<VALUE, DMenuItem<VALUE> | null, 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 item a newly-selected item\n\t * @param emitter an emitter\n\t */\n\tchange(\n\t\tnewValue: VALUE | null,\n\t\toldValue: VALUE | null,\n\t\titem: DMenuItem<VALUE> | null,\n\t\temitter: EMITTER\n\t): void;\n}\n\n/**\n * {@link DSelect} \"on\" options.\n */\nexport interface DSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DSelect} options.\n */\nexport interface DSelectOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeSelect<VALUE> = DThemeSelect<VALUE>,\n\tEMITTER = any\n> extends DDropdownBaseOptions<VALUE, DMenuItem<VALUE> | null, THEME, EMITTER> {\n\t/**\n\t * A default value.\n\t */\n\tvalue?: VALUE | null;\n\n\ton?: DSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DSelect} theme.\n */\nexport interface DThemeSelect<VALUE = unknown>\n\textends DThemeDropdownBase<DMenuItem<VALUE> | null> {}\n\n/**\n * A selector class.\n */\nexport class DSelect<\n\tVALUE = unknown,\n\tTHEME extends DThemeSelect<VALUE> = DThemeSelect<VALUE>,\n\tOPTIONS extends DSelectOptions<VALUE, THEME> = DSelectOptions<VALUE, THEME>\n> extends DDropdownBase<VALUE, DMenuItem<VALUE> | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\t// Default value\n\t\tthis._value = null;\n\t\tconst value = options?.value;\n\t\tif (value != null) {\n\t\t\tthis.value = value;\n\t\t}\n\t}\n\n\tprotected onMenuSelect(newValue: VALUE, item: DMenuItem<VALUE>, menu: DMenu<VALUE>): void {\n\t\tsuper.onMenuSelect(newValue, item, menu);\n\t\tconst oldValue = this._value;\n\t\tif (oldValue !== newValue) {\n\t\t\tthis._value = newValue;\n\t\t\tthis.text = item;\n\t\t\tthis.onValueChange(newValue, oldValue, item);\n\t\t}\n\t}\n\n\tprotected onMenuReplaced(newMenu: DMenu<VALUE>, oldMenu?: DMenu<VALUE>): void {\n\t\tsuper.onMenuReplaced(newMenu, oldMenu);\n\n\t\t// Update the value\n\t\tconst value = this._value;\n\t\tif (value != null) {\n\t\t\tconst item = this.findMenuItem(newMenu, value);\n\t\t\tif (item != null) {\n\t\t\t\tthis._value = value;\n\t\t\t\tthis.text = item;\n\t\t\t} else {\n\t\t\t\tthis._value = null;\n\t\t\t\tthis.text = null;\n\t\t\t}\n\t\t} else {\n\t\t\tthis._value = null;\n\t\t\tthis.text = null;\n\t\t}\n\t}\n\n\tprotected onValueChange(\n\t\tnewValue: VALUE | null,\n\t\toldValue: VALUE | null,\n\t\titem: DMenuItem<VALUE> | null\n\t): void {\n\t\tthis.emit(\"change\", newValue, oldValue, item, this);\n\t}\n\n\tprotected findMenuItem(menu: DMenu<VALUE>, value: VALUE | null): DMenuItem<VALUE> | null {\n\t\tconst children = menu.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DMenuItemMenu) {\n\t\t\t\tconst result = this.findMenuItem(child.menu, value);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else if (child instanceof DMenuItem) {\n\t\t\t\tif (child.value === value) {\n\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns a selected value or null.\n\t */\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets to the specified value.\n\t */\n\tset value(value: VALUE | null) {\n\t\tif (this._value !== value) {\n\t\t\tconst item = this.findMenuItem(this.menu, value);\n\t\t\tif (item != null) {\n\t\t\t\tthis._value = value;\n\t\t\t\tthis.text = item;\n\t\t\t} else {\n\t\t\t\tthis._value = null;\n\t\t\t\tthis.text = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DSelect\";\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-select.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EACN,aAAa,EAIb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC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AAC,MAAM,GAAG,IAAI,CAAC;oBACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;iBACjB;aACD;QACF,CAAC;;;OAhBA;IAkBS,yBAAO,GAAjB;QACC,OAAO,SAAS,CAAC;IAClB,CAAC;IACF,cAAC;AAAD,CAAC,AA/FD,CAIU,aAAa,GA2FtB","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n\tDDropdownBase,\n\tDDropdownBaseEvents,\n\tDDropdownBaseOptions,\n\tDThemeDropdownBase\n} from \"./d-dropdown-base\";\nimport { DMenu } from \"./d-menu\";\nimport { DMenuItem } from \"./d-menu-item\";\nimport { DMenuItemMenu } from \"./d-menu-item-menu\";\nimport { DOnOptions } from \"./d-on-options\";\n\n/**\n * {@link DSelect} events.\n */\nexport interface DSelectEvents<VALUE, EMITTER>\n\textends DDropdownBaseEvents<VALUE, DMenuItem<VALUE> | null, 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 item a newly-selected item\n\t * @param emitter an emitter\n\t */\n\tchange(\n\t\tnewValue: VALUE | null,\n\t\toldValue: VALUE | null,\n\t\titem: DMenuItem<VALUE> | null,\n\t\temitter: EMITTER\n\t): void;\n}\n\n/**\n * {@link DSelect} \"on\" options.\n */\nexport interface DSelectOnOptions<VALUE, EMITTER>\n\textends Partial<DSelectEvents<VALUE, EMITTER>>,\n\t\tDOnOptions {}\n\n/**\n * {@link DSelect} options.\n */\nexport interface DSelectOptions<\n\tVALUE = unknown,\n\tTHEME extends DThemeSelect<VALUE> = DThemeSelect<VALUE>,\n\tEMITTER = any\n> extends DDropdownBaseOptions<VALUE, DMenuItem<VALUE> | null, THEME, EMITTER> {\n\t/**\n\t * A default value.\n\t */\n\tvalue?: VALUE | null;\n\n\ton?: DSelectOnOptions<VALUE, EMITTER>;\n}\n\n/**\n * {@link DSelect} theme.\n */\nexport interface DThemeSelect<VALUE = unknown>\n\textends DThemeDropdownBase<DMenuItem<VALUE> | null> {}\n\n/**\n * A selector class.\n */\nexport class DSelect<\n\tVALUE = unknown,\n\tTHEME extends DThemeSelect<VALUE> = DThemeSelect<VALUE>,\n\tOPTIONS extends DSelectOptions<VALUE, THEME> = DSelectOptions<VALUE, THEME>\n> extends DDropdownBase<VALUE, DMenuItem<VALUE> | null, THEME, OPTIONS> {\n\tprotected _value: VALUE | null;\n\n\tconstructor(options?: OPTIONS) {\n\t\tsuper(options);\n\n\t\t// Default value\n\t\tthis._value = null;\n\t\tconst value = options?.value;\n\t\tif (value != null) {\n\t\t\tthis.value = value;\n\t\t}\n\t}\n\n\tprotected onMenuSelect(newValue: VALUE, item: DMenuItem<VALUE>, menu: DMenu<VALUE>): void {\n\t\tsuper.onMenuSelect(newValue, item, menu);\n\t\tconst oldValue = this._value;\n\t\tif (oldValue !== newValue) {\n\t\t\tthis._value = newValue;\n\t\t\tthis.text = item;\n\t\t\tthis.onValueChange(newValue, oldValue, item);\n\t\t}\n\t}\n\n\tprotected onMenuReplaced(newMenu: DMenu<VALUE>, oldMenu?: DMenu<VALUE>): void {\n\t\tsuper.onMenuReplaced(newMenu, oldMenu);\n\n\t\t// Update the value\n\t\tconst value = this._value;\n\t\tconst item = this.findMenuItem(newMenu, value);\n\t\tif (item != null) {\n\t\t\tthis._value = value;\n\t\t\tthis.text = item;\n\t\t} else {\n\t\t\tthis._value = null;\n\t\t\tthis.text = null;\n\t\t}\n\t}\n\n\tprotected onValueChange(\n\t\tnewValue: VALUE | null,\n\t\toldValue: VALUE | null,\n\t\titem: DMenuItem<VALUE> | null\n\t): void {\n\t\tthis.emit(\"change\", newValue, oldValue, item, this);\n\t}\n\n\tprotected findMenuItem(menu: DMenu<VALUE>, value: VALUE | null): DMenuItem<VALUE> | null {\n\t\tconst children = menu.children;\n\t\tfor (let i = 0, imax = children.length; i < imax; ++i) {\n\t\t\tconst child = children[i];\n\t\t\tif (child instanceof DMenuItemMenu) {\n\t\t\t\tconst result = this.findMenuItem(child.menu, value);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t} else if (child instanceof DMenuItem) {\n\t\t\t\tif (child.value === value) {\n\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns a selected value or null.\n\t */\n\tget value(): VALUE | null {\n\t\treturn this._value;\n\t}\n\n\t/**\n\t * Sets to the specified value.\n\t */\n\tset value(value: VALUE | null) {\n\t\tif (this._value !== value) {\n\t\t\tconst item = this.findMenuItem(this.menu, value);\n\t\t\tif (item != null) {\n\t\t\t\tthis._value = value;\n\t\t\t\tthis.text = item;\n\t\t\t} else {\n\t\t\t\tthis._value = null;\n\t\t\t\tthis.text = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DSelect\";\n\t}\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { __extends } from "tslib";
6
6
  import { toId } from "../../util/to-id";
7
- import { toLabel } from "../../util/to-label";
7
+ import { toLabelWith } from "../../util/to-label-with";
8
8
  import { DThemeDarkDialogLayered } from "./d-theme-dark-dialog-layered";
9
9
  var DThemeDarkDialogSelect = /** @class */ (function (_super) {
10
10
  __extends(DThemeDarkDialogSelect, _super);
@@ -24,7 +24,7 @@ var DThemeDarkDialogSelect = /** @class */ (function (_super) {
24
24
  return toId(category);
25
25
  };
26
26
  DThemeDarkDialogSelect.prototype.toCategoryLabel = function (category) {
27
- return toLabel(category);
27
+ return toLabelWith(category, "All");
28
28
  };
29
29
  return DThemeDarkDialogSelect;
30
30
  }(DThemeDarkDialogLayered));
@@ -1 +1 @@
1
- {"version":3,"file":"d-theme-dark-dialog-select.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IACS,0CAAuB;IADhC;;IAuBA,CAAC;IAnBA,yCAAQ,GAAR;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,0CAAS,GAAT;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,+CAAc,GAAd;QACC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,6CAAY,GAAZ,UAAa,QAAiB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,gDAAe,GAAf,UAAgB,QAAiB;QAChC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IACF,6BAAC;AAAD,CAAC,AAvBD,CACS,uBAAuB,GAsB/B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DCoordinateSize } from \"../../d-coordinate\";\nimport { DDialogLayeredFooterOptions } from \"../../d-dialog-layered-footer\";\nimport { DThemeDialogSelect } from \"../../d-dialog-select\";\nimport { toId } from \"../../util/to-id\";\nimport { toLabel } from \"../../util/to-label\";\nimport { DThemeDarkDialogLayered } from \"./d-theme-dark-dialog-layered\";\n\nexport class DThemeDarkDialogSelect<VALUE>\n\textends DThemeDarkDialogLayered\n\timplements DThemeDialogSelect<VALUE>\n{\n\tgetWidth(): DCoordinateSize {\n\t\treturn 480;\n\t}\n\n\tgetFooter(): DDialogLayeredFooterOptions | undefined | null {\n\t\treturn null;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn 19;\n\t}\n\n\ttoCategoryId(category: unknown): unknown {\n\t\treturn toId(category);\n\t}\n\n\ttoCategoryLabel(category: unknown): string {\n\t\treturn toLabel(category);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-theme-dark-dialog-select.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE;IACS,0CAAuB;IADhC;;IAuBA,CAAC;IAnBA,yCAAQ,GAAR;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,0CAAS,GAAT;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,+CAAc,GAAd;QACC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,6CAAY,GAAZ,UAAa,QAAiB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,gDAAe,GAAf,UAAgB,QAAiB;QAChC,OAAO,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IACF,6BAAC;AAAD,CAAC,AAvBD,CACS,uBAAuB,GAsB/B","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DCoordinateSize } from \"../../d-coordinate\";\nimport { DDialogLayeredFooterOptions } from \"../../d-dialog-layered-footer\";\nimport { DThemeDialogSelect } from \"../../d-dialog-select\";\nimport { toId } from \"../../util/to-id\";\nimport { toLabelWith } from \"../../util/to-label-with\";\nimport { DThemeDarkDialogLayered } from \"./d-theme-dark-dialog-layered\";\n\nexport class DThemeDarkDialogSelect<VALUE>\n\textends DThemeDarkDialogLayered\n\timplements DThemeDialogSelect<VALUE>\n{\n\tgetWidth(): DCoordinateSize {\n\t\treturn 480;\n\t}\n\n\tgetFooter(): DDialogLayeredFooterOptions | undefined | null {\n\t\treturn null;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn 19;\n\t}\n\n\ttoCategoryId(category: unknown): unknown {\n\t\treturn toId(category);\n\t}\n\n\ttoCategoryLabel(category: unknown): string {\n\t\treturn toLabelWith(category, \"All\");\n\t}\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { __extends } from "tslib";
6
6
  import { toId } from "../../util/to-id";
7
- import { toLabel } from "../../util/to-label";
7
+ import { toLabelWith } from "../../util/to-label-with";
8
8
  import { DThemeWhiteDialogLayered } from "./d-theme-white-dialog-layered";
9
9
  var DThemeWhiteDialogSelect = /** @class */ (function (_super) {
10
10
  __extends(DThemeWhiteDialogSelect, _super);
@@ -24,7 +24,7 @@ var DThemeWhiteDialogSelect = /** @class */ (function (_super) {
24
24
  return toId(category);
25
25
  };
26
26
  DThemeWhiteDialogSelect.prototype.toCategoryLabel = function (category) {
27
- return toLabel(category);
27
+ return toLabelWith(category, "All");
28
28
  };
29
29
  return DThemeWhiteDialogSelect;
30
30
  }(DThemeWhiteDialogLayered));
@@ -1 +1 @@
1
- {"version":3,"file":"d-theme-white-dialog-select.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;IACS,2CAAwB;IADjC;;IAuBA,CAAC;IAnBA,0CAAQ,GAAR;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,2CAAS,GAAT;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,gDAAc,GAAd;QACC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,8CAAY,GAAZ,UAAa,QAAiB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,iDAAe,GAAf,UAAgB,QAAiB;QAChC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IACF,8BAAC;AAAD,CAAC,AAvBD,CACS,wBAAwB,GAsBhC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DCoordinateSize } from \"../../d-coordinate\";\nimport { DDialogLayeredFooterOptions } from \"../../d-dialog-layered-footer\";\nimport { DThemeDialogSelect } from \"../../d-dialog-select\";\nimport { toId } from \"../../util/to-id\";\nimport { toLabel } from \"../../util/to-label\";\nimport { DThemeWhiteDialogLayered } from \"./d-theme-white-dialog-layered\";\n\nexport class DThemeWhiteDialogSelect<VALUE>\n\textends DThemeWhiteDialogLayered\n\timplements DThemeDialogSelect<VALUE>\n{\n\tgetWidth(): DCoordinateSize {\n\t\treturn 480;\n\t}\n\n\tgetFooter(): DDialogLayeredFooterOptions | undefined | null {\n\t\treturn null;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn 19;\n\t}\n\n\ttoCategoryId(category: unknown): unknown {\n\t\treturn toId(category);\n\t}\n\n\ttoCategoryLabel(category: unknown): string {\n\t\treturn toLabel(category);\n\t}\n}\n"]}
1
+ {"version":3,"file":"d-theme-white-dialog-select.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-dialog-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAKH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;IACS,2CAAwB;IADjC;;IAuBA,CAAC;IAnBA,0CAAQ,GAAR;QACC,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,2CAAS,GAAT;QACC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,gDAAc,GAAd;QACC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,8CAAY,GAAZ,UAAa,QAAiB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,iDAAe,GAAf,UAAgB,QAAiB;QAChC,OAAO,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IACF,8BAAC;AAAD,CAAC,AAvBD,CACS,wBAAwB,GAsBhC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DCoordinateSize } from \"../../d-coordinate\";\nimport { DDialogLayeredFooterOptions } from \"../../d-dialog-layered-footer\";\nimport { DThemeDialogSelect } from \"../../d-dialog-select\";\nimport { toId } from \"../../util/to-id\";\nimport { toLabelWith } from \"../../util/to-label-with\";\nimport { DThemeWhiteDialogLayered } from \"./d-theme-white-dialog-layered\";\n\nexport class DThemeWhiteDialogSelect<VALUE>\n\textends DThemeWhiteDialogLayered\n\timplements DThemeDialogSelect<VALUE>\n{\n\tgetWidth(): DCoordinateSize {\n\t\treturn 480;\n\t}\n\n\tgetFooter(): DDialogLayeredFooterOptions | undefined | null {\n\t\treturn null;\n\t}\n\n\tgetInputMargin(): number {\n\t\treturn 19;\n\t}\n\n\ttoCategoryId(category: unknown): unknown {\n\t\treturn toId(category);\n\t}\n\n\ttoCategoryLabel(category: unknown): string {\n\t\treturn toLabelWith(category, \"All\");\n\t}\n}\n"]}
@@ -37,6 +37,7 @@ export * from "./to-cloned";
37
37
  export * from "./to-enum";
38
38
  export * from "./to-id";
39
39
  export * from "./to-index-of";
40
+ export * from "./to-label-with";
40
41
  export * from "./to-label";
41
42
  export * from "./to-merged";
42
43
  export * from "./to-padded";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAA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C;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AA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AC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./format-node\";\nexport * from \"./deep-partial\";\nexport * from \"./dynamic-atlas-item-empty\";\nexport * from \"./dynamic-atlas-item-font-atlas\";\nexport * from \"./dynamic-atlas-item-image\";\nexport * from \"./dynamic-atlas-item-text\";\nexport * from \"./dynamic-atlas-item-white\";\nexport * from \"./dynamic-atlas-item\";\nexport * from \"./dynamic-atlas\";\nexport * from \"./dynamic-font-atlas-chaaracter-origin\";\nexport * from \"./dynamic-font-atlas-character-type\";\nexport * from \"./dynamic-font-atlas-character\";\nexport * from \"./dynamic-font-atlas-characters\";\nexport * from \"./dynamic-font-atlas-font\";\nexport * from \"./dynamic-font-atlas\";\nexport * from \"./dynamic-font-atlases\";\nexport * from \"./dynamic-sdf-font-atlas\";\nexport * from \"./dynamic-sdf-font-atlases\";\nexport * from \"./dynamic-sdf-font-generator\";\nexport * from \"./is-array\";\nexport * from \"./is-function\";\nexport * from \"./is-nan\";\nexport * from \"./is-number\";\nexport * from \"./is-object\";\nexport * from \"./is-string\";\nexport * from \"./lazy\";\nexport * from \"./number-formatter-function\";\nexport * from \"./number-formatter-impl\";\nexport * from \"./number-formatter\";\nexport * from \"./number-formatters\";\nexport * from \"./to-ceiling-index\";\nexport * from \"./to-cloned\";\nexport * from \"./to-enum\";\nexport * from \"./to-id\";\nexport * from \"./to-index-of\";\nexport * from \"./to-label-with\";\nexport * from \"./to-label\";\nexport * from \"./to-merged\";\nexport * from \"./to-padded\";\nexport * from \"./to-string\";\nexport * from \"./to-svg-texture\";\nexport * from \"./to-svg-url\";\nexport * from \"./util-alpha\";\nexport * from \"./util-svg-atlas-builder\";\nexport * from \"./util-attach\";\nexport * from \"./util-character-iterator\";\nexport * from \"./util-click-outside\";\nexport * from \"./util-clipboard\";\nexport * from \"./util-gesture-data\";\nexport * from \"./util-gesture-easing-history\";\nexport * from \"./util-gesture-easing\";\nexport * from \"./util-gesture-mode\";\nexport * from \"./util-gesture-modifier\";\nexport * from \"./util-gesture-modifiers\";\nexport * from \"./util-gesture\";\nexport * from \"./util-extract\";\nexport * from \"./util-extractor-pixels\";\nexport * from \"./util-extractor\";\nexport * from \"./util-file-downloader\";\nexport * from \"./util-file-opener\";\nexport * from \"./util-font\";\nexport * from \"./util-hsv\";\nexport * from \"./util-html-element-clipper-ex-impl\";\nexport * from \"./util-html-element-clipper-ex-rects-impl\";\nexport * from \"./util-html-element-clipper-ex-rects\";\nexport * from \"./util-html-element-clipper-ex\";\nexport * from \"./util-html-element-when\";\nexport * from \"./util-html-element\";\nexport * from \"./util-input-input\";\nexport * from \"./util-input-number\";\nexport * from \"./util-input-text-area\";\nexport * from \"./util-input-text\";\nexport * from \"./util-input\";\nexport * from \"./util-keyboard-event\";\nexport * from \"./util-name\";\nexport * from \"./util-overlay\";\nexport * from \"./util-pointer-event\";\nexport * from \"./util-rgb\";\nexport * from \"./util-rgba\";\nexport * from \"./util-state-blinker\";\nexport * from \"./util-transition\";\nexport * from \"./util-wheel-event\";\n"]}
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (C) 2019 Toshiba Corporation
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { isNumber } from "./is-number";
6
+ import { isString } from "./is-string";
7
+ export var toLabelWith = function (target, def) {
8
+ if (target != null) {
9
+ if (isString(target)) {
10
+ return target;
11
+ }
12
+ else if (isNumber(target)) {
13
+ return String(target);
14
+ }
15
+ else if ("name" in target) {
16
+ return target.name;
17
+ }
18
+ else if ("label" in target) {
19
+ return target.label;
20
+ }
21
+ else if ("id" in target) {
22
+ return target.id;
23
+ }
24
+ }
25
+ return def;
26
+ };
27
+ //# sourceMappingURL=to-label-with.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"to-label-with.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/to-label-with.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,MAAW,EAAE,GAAW;IACnD,IAAI,MAAM,IAAI,IAAI,EAAE;QACnB,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;YACrB,OAAO,MAAM,CAAC;SACd;aAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;SACtB;aAAM,IAAI,MAAM,IAAI,MAAM,EAAE;YAC5B,OAAO,MAAM,CAAC,IAAI,CAAC;SACnB;aAAM,IAAI,OAAO,IAAI,MAAM,EAAE;YAC7B,OAAO,MAAM,CAAC,KAAK,CAAC;SACpB;aAAM,IAAI,IAAI,IAAI,MAAM,EAAE;YAC1B,OAAO,MAAM,CAAC,EAAE,CAAC;SACjB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isNumber } from \"./is-number\";\nimport { isString } from \"./is-string\";\n\nexport const toLabelWith = (target: any, def: string): string => {\n\tif (target != null) {\n\t\tif (isString(target)) {\n\t\t\treturn target;\n\t\t} else if (isNumber(target)) {\n\t\t\treturn String(target);\n\t\t} else if (\"name\" in target) {\n\t\t\treturn target.name;\n\t\t} else if (\"label\" in target) {\n\t\t\treturn target.label;\n\t\t} else if (\"id\" in target) {\n\t\t\treturn target.id;\n\t\t}\n\t}\n\treturn def;\n};\n"]}
@@ -2,26 +2,8 @@
2
2
  * Copyright (C) 2019 Toshiba Corporation
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { isNumber } from "./is-number";
6
- import { isString } from "./is-string";
5
+ import { toLabelWith } from "./to-label-with";
7
6
  export var toLabel = function (target) {
8
- if (target != null) {
9
- if (isString(target)) {
10
- return target;
11
- }
12
- else if (isNumber(target)) {
13
- return String(target);
14
- }
15
- else if ("name" in target) {
16
- return target.name;
17
- }
18
- else if ("label" in target) {
19
- return target.label;
20
- }
21
- else if ("id" in target) {
22
- return target.id;
23
- }
24
- }
25
- return "";
7
+ return toLabelWith(target, "");
26
8
  };
27
9
  //# sourceMappingURL=to-label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"to-label.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/to-label.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,MAAW;IAClC,IAAI,MAAM,IAAI,IAAI,EAAE;QACnB,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;YACrB,OAAO,MAAM,CAAC;SACd;aAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE;YAC5B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;SACtB;aAAM,IAAI,MAAM,IAAI,MAAM,EAAE;YAC5B,OAAO,MAAM,CAAC,IAAI,CAAC;SACnB;aAAM,IAAI,OAAO,IAAI,MAAM,EAAE;YAC7B,OAAO,MAAM,CAAC,KAAK,CAAC;SACpB;aAAM,IAAI,IAAI,IAAI,MAAM,EAAE;YAC1B,OAAO,MAAM,CAAC,EAAE,CAAC;SACjB;KACD;IACD,OAAO,EAAE,CAAC;AACX,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isNumber } from \"./is-number\";\nimport { isString } from \"./is-string\";\n\nexport const toLabel = (target: any): string => {\n\tif (target != null) {\n\t\tif (isString(target)) {\n\t\t\treturn target;\n\t\t} else if (isNumber(target)) {\n\t\t\treturn String(target);\n\t\t} else if (\"name\" in target) {\n\t\t\treturn target.name;\n\t\t} else if (\"label\" in target) {\n\t\t\treturn target.label;\n\t\t} else if (\"id\" in target) {\n\t\t\treturn target.id;\n\t\t}\n\t}\n\treturn \"\";\n};\n"]}
1
+ {"version":3,"file":"to-label.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/to-label.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,MAAW;IAClC,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { toLabelWith } from \"./to-label-with\";\n\nexport const toLabel = (target: any): string => {\n\treturn toLabelWith(target, \"\");\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.359.0
2
+ Winter Cardinal UI v0.361.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -2192,6 +2192,8 @@
2192
2192
 
2193
2193
  const toId = wcardinal.ui.toId;
2194
2194
 
2195
+ const toLabelWith = wcardinal.ui.toLabelWith;
2196
+
2195
2197
  /*
2196
2198
  * Copyright (C) 2019 Toshiba Corporation
2197
2199
  * SPDX-License-Identifier: Apache-2.0
@@ -2214,7 +2216,7 @@
2214
2216
  return toId(category);
2215
2217
  };
2216
2218
  DThemeDarkDialogSelect.prototype.toCategoryLabel = function (category) {
2217
- return toLabel(category);
2219
+ return toLabelWith(category, "All");
2218
2220
  };
2219
2221
  return DThemeDarkDialogSelect;
2220
2222
  }(DThemeDarkDialogLayered));