@wcardinal/wcardinal-ui 0.362.0 → 0.363.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/types/wcardinal/ui/d-button-select.d.ts +3 -3
  2. package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable-impl.d.ts +4 -4
  3. package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable.d.ts +4 -4
  4. package/dist/types/wcardinal/ui/d-dialog-select-search-function.d.ts +4 -4
  5. package/dist/types/wcardinal/ui/d-dialog-select-search-impl.d.ts +3 -3
  6. package/dist/types/wcardinal/ui/d-dialog-select-search.d.ts +1 -1
  7. package/dist/types/wcardinal/ui/d-dialog-select.d.ts +34 -24
  8. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.d.ts +2 -2
  9. package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog-select.d.ts +2 -2
  10. package/dist/types/wcardinal/ui/util/index.d.ts +0 -1
  11. package/dist/wcardinal/ui/d-button-select.js +1 -1
  12. package/dist/wcardinal/ui/d-button-select.js.map +1 -1
  13. package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js.map +1 -1
  14. package/dist/wcardinal/ui/d-dialog-select-search-dismissable.js.map +1 -1
  15. package/dist/wcardinal/ui/d-dialog-select-search-function.js.map +1 -1
  16. package/dist/wcardinal/ui/d-dialog-select-search-impl.js.map +1 -1
  17. package/dist/wcardinal/ui/d-dialog-select-search.js.map +1 -1
  18. package/dist/wcardinal/ui/d-dialog-select.js +60 -102
  19. package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
  20. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +4 -6
  21. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
  22. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +4 -6
  23. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
  24. package/dist/wcardinal/ui/util/index.js +0 -1
  25. package/dist/wcardinal/ui/util/index.js.map +1 -1
  26. package/dist/wcardinal/ui/util/to-label.js +20 -2
  27. package/dist/wcardinal/ui/util/to-label.js.map +1 -1
  28. package/dist/wcardinal-ui-theme-dark.js +5 -9
  29. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  30. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  31. package/dist/wcardinal-ui-theme-white.js +5 -9
  32. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  33. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  34. package/dist/wcardinal-ui.cjs.js +97 -146
  35. package/dist/wcardinal-ui.js +64 -113
  36. package/dist/wcardinal-ui.min.js +2 -2
  37. package/dist/wcardinal-ui.min.js.map +1 -1
  38. package/package.json +1 -1
  39. package/dist/types/wcardinal/ui/util/to-label-with.d.ts +0 -1
  40. package/dist/wcardinal/ui/util/to-label-with.js +0 -27
  41. package/dist/wcardinal/ui/util/to-label-with.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.362.0
2
+ Winter Cardinal UI v0.363.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -49492,7 +49492,7 @@ var loadThemeWhiteButtonSecondary = function () {
49492
49492
  * Copyright (C) 2019 Toshiba Corporation
49493
49493
  * SPDX-License-Identifier: Apache-2.0
49494
49494
  */
49495
- var toLabelWith = function (target, def) {
49495
+ var toLabel$1 = function (target) {
49496
49496
  if (target != null) {
49497
49497
  if (isString(target)) {
49498
49498
  return target;
@@ -49510,15 +49510,7 @@ var toLabelWith = function (target, def) {
49510
49510
  return target.id;
49511
49511
  }
49512
49512
  }
49513
- return def;
49514
- };
49515
-
49516
- /*
49517
- * Copyright (C) 2019 Toshiba Corporation
49518
- * SPDX-License-Identifier: Apache-2.0
49519
- */
49520
- var toLabel$1 = function (target) {
49521
- return toLabelWith(target, "");
49513
+ return "";
49522
49514
  };
49523
49515
 
49524
49516
  /*
@@ -49539,31 +49531,6 @@ var DThemeWhiteButtonSelect = /** @class */ (function (_super) {
49539
49531
  return DThemeWhiteButtonSelect;
49540
49532
  }(DThemeWhiteButton));
49541
49533
 
49542
- /*
49543
- * Copyright (C) 2019 Toshiba Corporation
49544
- * SPDX-License-Identifier: Apache-2.0
49545
- */
49546
- var toId = function (target) {
49547
- if (target != null) {
49548
- if (isString(target)) {
49549
- return target;
49550
- }
49551
- else if (isNumber(target)) {
49552
- return target;
49553
- }
49554
- else if ("id" in target) {
49555
- return target.id;
49556
- }
49557
- else if ("name" in target) {
49558
- return target.name;
49559
- }
49560
- else if ("label" in target) {
49561
- return target.label;
49562
- }
49563
- }
49564
- return 0;
49565
- };
49566
-
49567
49534
  /*
49568
49535
  * Copyright (C) 2019 Toshiba Corporation
49569
49536
  * SPDX-License-Identifier: Apache-2.0
@@ -49582,11 +49549,11 @@ var DThemeWhiteDialogSelect = /** @class */ (function (_super) {
49582
49549
  DThemeWhiteDialogSelect.prototype.getInputMargin = function () {
49583
49550
  return 19;
49584
49551
  };
49585
- DThemeWhiteDialogSelect.prototype.toCategoryId = function (category) {
49586
- return toId(category);
49552
+ DThemeWhiteDialogSelect.prototype.isCategoryDismissable = function () {
49553
+ return true;
49587
49554
  };
49588
- DThemeWhiteDialogSelect.prototype.toCategoryLabel = function (category) {
49589
- return toLabelWith(category, "All");
49555
+ DThemeWhiteDialogSelect.prototype.getCategoryDismissLabel = function () {
49556
+ return "All";
49590
49557
  };
49591
49558
  return DThemeWhiteDialogSelect;
49592
49559
  }(DThemeWhiteDialogLayered));
@@ -58888,11 +58855,11 @@ var DThemeDarkDialogSelect = /** @class */ (function (_super) {
58888
58855
  DThemeDarkDialogSelect.prototype.getInputMargin = function () {
58889
58856
  return 19;
58890
58857
  };
58891
- DThemeDarkDialogSelect.prototype.toCategoryId = function (category) {
58892
- return toId(category);
58858
+ DThemeDarkDialogSelect.prototype.isCategoryDismissable = function () {
58859
+ return true;
58893
58860
  };
58894
- DThemeDarkDialogSelect.prototype.toCategoryLabel = function (category) {
58895
- return toLabelWith(category, "All");
58861
+ DThemeDarkDialogSelect.prototype.getCategoryDismissLabel = function () {
58862
+ return "All";
58896
58863
  };
58897
58864
  return DThemeDarkDialogSelect;
58898
58865
  }(DThemeDarkDialogLayered));
@@ -66504,6 +66471,31 @@ var toCloned = function (target) {
66504
66471
  return target;
66505
66472
  };
66506
66473
 
66474
+ /*
66475
+ * Copyright (C) 2019 Toshiba Corporation
66476
+ * SPDX-License-Identifier: Apache-2.0
66477
+ */
66478
+ var toId = function (target) {
66479
+ if (target != null) {
66480
+ if (isString(target)) {
66481
+ return target;
66482
+ }
66483
+ else if (isNumber(target)) {
66484
+ return target;
66485
+ }
66486
+ else if ("id" in target) {
66487
+ return target.id;
66488
+ }
66489
+ else if ("name" in target) {
66490
+ return target.name;
66491
+ }
66492
+ else if ("label" in target) {
66493
+ return target.label;
66494
+ }
66495
+ }
66496
+ return 0;
66497
+ };
66498
+
66507
66499
  /*
66508
66500
  * Copyright (C) 2019 Toshiba Corporation
66509
66501
  * SPDX-License-Identifier: Apache-2.0
@@ -74173,8 +74165,17 @@ var DDialogSelectSearhDismissableImpl = /** @class */ (function (_super) {
74173
74165
  var DDialogSelect = /** @class */ (function (_super) {
74174
74166
  __extends(DDialogSelect, _super);
74175
74167
  function DDialogSelect(options) {
74176
- var _this = _super.call(this, options) || this;
74168
+ var _this = this;
74169
+ var _a, _b;
74170
+ _this = _super.call(this, options) || this;
74171
+ // Value
74177
74172
  _this._value = null;
74173
+ // Categories
74174
+ var categories = (_b = (_a = options === null || options === void 0 ? void 0 : options.category) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [];
74175
+ _this._categories = categories;
74176
+ if (0 < categories.length) {
74177
+ _this.onCategoriesChange(categories);
74178
+ }
74178
74179
  // Controller binding
74179
74180
  var transition = new UtilTransition();
74180
74181
  var search = _this.search;
@@ -74257,7 +74258,7 @@ var DDialogSelect = /** @class */ (function (_super) {
74257
74258
  Object.defineProperty(DDialogSelect.prototype, "selectCategory", {
74258
74259
  get: function () {
74259
74260
  var result = this._selectCategory;
74260
- if (result === undefined) {
74261
+ if (result == null) {
74261
74262
  result = this.newSelectCategory();
74262
74263
  this._selectCategory = result;
74263
74264
  }
@@ -74268,26 +74269,19 @@ var DDialogSelect = /** @class */ (function (_super) {
74268
74269
  });
74269
74270
  DDialogSelect.prototype.newSelectCategory = function () {
74270
74271
  var _this = this;
74271
- var options = this._options;
74272
- if (options != null) {
74273
- var controller = options.controller;
74274
- if (controller != null && controller.getCategories != null) {
74275
- var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
74276
- result.on("change", function (value) {
74277
- _this.onSelectCategoryChange(value);
74278
- });
74279
- return result;
74280
- }
74281
- }
74282
- return null;
74272
+ var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
74273
+ result.on("change", function (value) {
74274
+ _this.onSelectCategoryChange(value);
74275
+ });
74276
+ return result;
74283
74277
  };
74284
74278
  DDialogSelect.prototype.toSelectCategoryOptions = function (theme, options) {
74285
74279
  var result = (options === null || options === void 0 ? void 0 : options.category) || {};
74286
74280
  if (result.width === undefined && result.weight === undefined) {
74287
74281
  result.width = 140;
74288
74282
  }
74289
- if (result.state === undefined) {
74290
- result.state = DBaseState.DISABLED;
74283
+ if (result.visible === undefined) {
74284
+ result.visible = false;
74291
74285
  }
74292
74286
  return result;
74293
74287
  };
@@ -74512,101 +74506,59 @@ var DDialogSelect = /** @class */ (function (_super) {
74512
74506
  return "DDialogSelect";
74513
74507
  };
74514
74508
  DDialogSelect.prototype.onOpen = function () {
74515
- var _this = this;
74516
74509
  _super.prototype.onOpen.call(this);
74517
74510
  this.list.selection.clear();
74518
- var selectCategory = this.selectCategory;
74519
- if (selectCategory != null) {
74520
- if (this._isCategoryFetched !== true) {
74521
- this._isCategoryFetched = true;
74522
- var categoriesOrPromise = this.findCategories();
74523
- if (categoriesOrPromise == null) {
74524
- this.search.create([this.input.value, null]);
74525
- }
74526
- else if (isArray(categoriesOrPromise)) {
74527
- this.onCategoryFetched(selectCategory, categoriesOrPromise);
74528
- }
74529
- else {
74530
- categoriesOrPromise.then(function (categories) {
74531
- _this.onCategoryFetched(selectCategory, categories);
74532
- });
74533
- }
74534
- }
74535
- else {
74536
- this.search.create([this.input.value, selectCategory.value]);
74537
- }
74511
+ if (0 < this._categories.length) {
74512
+ this.search.create([this.input.value, this.selectCategory.value]);
74538
74513
  }
74539
74514
  else {
74540
74515
  this.search.create([this.input.value]);
74541
74516
  }
74542
74517
  };
74543
- DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
74544
- var items = [];
74545
- var toId = this.newToCategoryId();
74546
- var toLabel = this.newToCategoryLabel();
74547
- items.push({
74548
- value: null,
74549
- text: {
74550
- value: toLabel(null)
74551
- }
74552
- });
74553
- for (var i = 0, imax = categories.length; i < imax; ++i) {
74554
- var category = categories[i];
74555
- items.push({
74556
- value: toId(category),
74557
- text: {
74558
- value: toLabel(category)
74559
- }
74560
- });
74561
- }
74562
- selectCategory.menu = new DMenu({
74563
- fit: true,
74564
- items: items
74565
- });
74566
- selectCategory.state.isEnabled = true;
74567
- this.search.create([this.input.value, null]);
74568
- };
74569
- DDialogSelect.prototype.newToCategoryId = function () {
74570
- var options = this._options;
74571
- if (options != null) {
74572
- var category = options.category;
74573
- if (category != null) {
74574
- var toId = category.toId;
74575
- if (toId != null) {
74576
- return toId;
74577
- }
74518
+ Object.defineProperty(DDialogSelect.prototype, "categories", {
74519
+ get: function () {
74520
+ return this._categories;
74521
+ },
74522
+ set: function (categories) {
74523
+ this._categories = categories;
74524
+ this.onCategoriesChange(categories);
74525
+ },
74526
+ enumerable: false,
74527
+ configurable: true
74528
+ });
74529
+ DDialogSelect.prototype.onCategoriesChange = function (categories) {
74530
+ var _a, _b, _c, _d, _e;
74531
+ var selectCategory = this.selectCategory;
74532
+ if (0 < categories.length) {
74533
+ var items = [];
74534
+ var theme = this.theme;
74535
+ var options = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.dismiss) !== null && _c !== void 0 ? _c : {};
74536
+ if ((_d = options.enable) !== null && _d !== void 0 ? _d : theme.isCategoryDismissable()) {
74537
+ items.push({
74538
+ value: null,
74539
+ text: {
74540
+ value: (_e = options.label) !== null && _e !== void 0 ? _e : theme.getCategoryDismissLabel()
74541
+ }
74542
+ });
74578
74543
  }
74579
- }
74580
- var theme = this.theme;
74581
- return function (category) {
74582
- return theme.toCategoryId(category);
74583
- };
74584
- };
74585
- DDialogSelect.prototype.newToCategoryLabel = function () {
74586
- var options = this._options;
74587
- if (options != null) {
74588
- var category = options.category;
74589
- if (category != null) {
74590
- var toLabel = category.toLabel;
74591
- if (toLabel != null) {
74592
- return toLabel;
74593
- }
74544
+ for (var i = 0, imax = categories.length; i < imax; ++i) {
74545
+ var category = categories[i];
74546
+ items.push({
74547
+ value: category.id,
74548
+ text: {
74549
+ value: category.label
74550
+ }
74551
+ });
74594
74552
  }
74553
+ selectCategory.menu = new DMenu({
74554
+ fit: true,
74555
+ items: items
74556
+ });
74557
+ selectCategory.show();
74595
74558
  }
74596
- var theme = this.theme;
74597
- return function (category) {
74598
- return theme.toCategoryLabel(category);
74599
- };
74600
- };
74601
- DDialogSelect.prototype.findCategories = function () {
74602
- var options = this._options;
74603
- if (options != null) {
74604
- var controller = options.controller;
74605
- if (controller != null && controller.getCategories != null) {
74606
- return controller.getCategories();
74607
- }
74559
+ else {
74560
+ selectCategory.hide();
74608
74561
  }
74609
- return null;
74610
74562
  };
74611
74563
  DDialogSelect.prototype.onOk = function (value) {
74612
74564
  this.emit("select", value, this);
@@ -74684,7 +74636,7 @@ var DButtonSelect = /** @class */ (function (_super) {
74684
74636
  dialog = options;
74685
74637
  }
74686
74638
  else {
74687
- // Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID>.
74639
+ // Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY_ID>.
74688
74640
  dialog = new DDialogSelect(options);
74689
74641
  }
74690
74642
  this._dialog = dialog;
@@ -95927,7 +95879,6 @@ exports.toId = toId;
95927
95879
  exports.toImageElement = toImageElement;
95928
95880
  exports.toIndexOf = toIndexOf;
95929
95881
  exports.toLabel = toLabel$1;
95930
- exports.toLabelWith = toLabelWith;
95931
95882
  exports.toLength = toLength;
95932
95883
  exports.toLineIndexCount = toLineIndexCount;
95933
95884
  exports.toLineOfAnyPointCount = toLineOfAnyPointCount;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.362.0
2
+ Winter Cardinal UI v0.363.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -47278,7 +47278,7 @@
47278
47278
  * Copyright (C) 2019 Toshiba Corporation
47279
47279
  * SPDX-License-Identifier: Apache-2.0
47280
47280
  */
47281
- var toLabelWith = function (target, def) {
47281
+ var toLabel$1 = function (target) {
47282
47282
  if (target != null) {
47283
47283
  if (isString(target)) {
47284
47284
  return target;
@@ -47296,15 +47296,7 @@
47296
47296
  return target.id;
47297
47297
  }
47298
47298
  }
47299
- return def;
47300
- };
47301
-
47302
- /*
47303
- * Copyright (C) 2019 Toshiba Corporation
47304
- * SPDX-License-Identifier: Apache-2.0
47305
- */
47306
- var toLabel$1 = function (target) {
47307
- return toLabelWith(target, "");
47299
+ return "";
47308
47300
  };
47309
47301
 
47310
47302
  /*
@@ -55591,8 +55583,17 @@
55591
55583
  var DDialogSelect = /** @class */ (function (_super) {
55592
55584
  __extends(DDialogSelect, _super);
55593
55585
  function DDialogSelect(options) {
55594
- var _this = _super.call(this, options) || this;
55586
+ var _this = this;
55587
+ var _a, _b;
55588
+ _this = _super.call(this, options) || this;
55589
+ // Value
55595
55590
  _this._value = null;
55591
+ // Categories
55592
+ var categories = (_b = (_a = options === null || options === void 0 ? void 0 : options.category) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : [];
55593
+ _this._categories = categories;
55594
+ if (0 < categories.length) {
55595
+ _this.onCategoriesChange(categories);
55596
+ }
55596
55597
  // Controller binding
55597
55598
  var transition = new UtilTransition();
55598
55599
  var search = _this.search;
@@ -55675,7 +55676,7 @@
55675
55676
  Object.defineProperty(DDialogSelect.prototype, "selectCategory", {
55676
55677
  get: function () {
55677
55678
  var result = this._selectCategory;
55678
- if (result === undefined) {
55679
+ if (result == null) {
55679
55680
  result = this.newSelectCategory();
55680
55681
  this._selectCategory = result;
55681
55682
  }
@@ -55686,26 +55687,19 @@
55686
55687
  });
55687
55688
  DDialogSelect.prototype.newSelectCategory = function () {
55688
55689
  var _this = this;
55689
- var options = this._options;
55690
- if (options != null) {
55691
- var controller = options.controller;
55692
- if (controller != null && controller.getCategories != null) {
55693
- var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
55694
- result.on("change", function (value) {
55695
- _this.onSelectCategoryChange(value);
55696
- });
55697
- return result;
55698
- }
55699
- }
55700
- return null;
55690
+ var result = new DSelect(this.toSelectCategoryOptions(this.theme, this._options));
55691
+ result.on("change", function (value) {
55692
+ _this.onSelectCategoryChange(value);
55693
+ });
55694
+ return result;
55701
55695
  };
55702
55696
  DDialogSelect.prototype.toSelectCategoryOptions = function (theme, options) {
55703
55697
  var result = (options === null || options === void 0 ? void 0 : options.category) || {};
55704
55698
  if (result.width === undefined && result.weight === undefined) {
55705
55699
  result.width = 140;
55706
55700
  }
55707
- if (result.state === undefined) {
55708
- result.state = DBaseState.DISABLED;
55701
+ if (result.visible === undefined) {
55702
+ result.visible = false;
55709
55703
  }
55710
55704
  return result;
55711
55705
  };
@@ -55930,101 +55924,59 @@
55930
55924
  return "DDialogSelect";
55931
55925
  };
55932
55926
  DDialogSelect.prototype.onOpen = function () {
55933
- var _this = this;
55934
55927
  _super.prototype.onOpen.call(this);
55935
55928
  this.list.selection.clear();
55936
- var selectCategory = this.selectCategory;
55937
- if (selectCategory != null) {
55938
- if (this._isCategoryFetched !== true) {
55939
- this._isCategoryFetched = true;
55940
- var categoriesOrPromise = this.findCategories();
55941
- if (categoriesOrPromise == null) {
55942
- this.search.create([this.input.value, null]);
55943
- }
55944
- else if (isArray(categoriesOrPromise)) {
55945
- this.onCategoryFetched(selectCategory, categoriesOrPromise);
55946
- }
55947
- else {
55948
- categoriesOrPromise.then(function (categories) {
55949
- _this.onCategoryFetched(selectCategory, categories);
55950
- });
55951
- }
55952
- }
55953
- else {
55954
- this.search.create([this.input.value, selectCategory.value]);
55955
- }
55929
+ if (0 < this._categories.length) {
55930
+ this.search.create([this.input.value, this.selectCategory.value]);
55956
55931
  }
55957
55932
  else {
55958
55933
  this.search.create([this.input.value]);
55959
55934
  }
55960
55935
  };
55961
- DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
55962
- var items = [];
55963
- var toId = this.newToCategoryId();
55964
- var toLabel = this.newToCategoryLabel();
55965
- items.push({
55966
- value: null,
55967
- text: {
55968
- value: toLabel(null)
55969
- }
55970
- });
55971
- for (var i = 0, imax = categories.length; i < imax; ++i) {
55972
- var category = categories[i];
55973
- items.push({
55974
- value: toId(category),
55975
- text: {
55976
- value: toLabel(category)
55977
- }
55978
- });
55979
- }
55980
- selectCategory.menu = new DMenu({
55981
- fit: true,
55982
- items: items
55983
- });
55984
- selectCategory.state.isEnabled = true;
55985
- this.search.create([this.input.value, null]);
55986
- };
55987
- DDialogSelect.prototype.newToCategoryId = function () {
55988
- var options = this._options;
55989
- if (options != null) {
55990
- var category = options.category;
55991
- if (category != null) {
55992
- var toId = category.toId;
55993
- if (toId != null) {
55994
- return toId;
55995
- }
55936
+ Object.defineProperty(DDialogSelect.prototype, "categories", {
55937
+ get: function () {
55938
+ return this._categories;
55939
+ },
55940
+ set: function (categories) {
55941
+ this._categories = categories;
55942
+ this.onCategoriesChange(categories);
55943
+ },
55944
+ enumerable: false,
55945
+ configurable: true
55946
+ });
55947
+ DDialogSelect.prototype.onCategoriesChange = function (categories) {
55948
+ var _a, _b, _c, _d, _e;
55949
+ var selectCategory = this.selectCategory;
55950
+ if (0 < categories.length) {
55951
+ var items = [];
55952
+ var theme = this.theme;
55953
+ var options = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.category) === null || _b === void 0 ? void 0 : _b.dismiss) !== null && _c !== void 0 ? _c : {};
55954
+ if ((_d = options.enable) !== null && _d !== void 0 ? _d : theme.isCategoryDismissable()) {
55955
+ items.push({
55956
+ value: null,
55957
+ text: {
55958
+ value: (_e = options.label) !== null && _e !== void 0 ? _e : theme.getCategoryDismissLabel()
55959
+ }
55960
+ });
55996
55961
  }
55997
- }
55998
- var theme = this.theme;
55999
- return function (category) {
56000
- return theme.toCategoryId(category);
56001
- };
56002
- };
56003
- DDialogSelect.prototype.newToCategoryLabel = function () {
56004
- var options = this._options;
56005
- if (options != null) {
56006
- var category = options.category;
56007
- if (category != null) {
56008
- var toLabel = category.toLabel;
56009
- if (toLabel != null) {
56010
- return toLabel;
56011
- }
55962
+ for (var i = 0, imax = categories.length; i < imax; ++i) {
55963
+ var category = categories[i];
55964
+ items.push({
55965
+ value: category.id,
55966
+ text: {
55967
+ value: category.label
55968
+ }
55969
+ });
56012
55970
  }
55971
+ selectCategory.menu = new DMenu({
55972
+ fit: true,
55973
+ items: items
55974
+ });
55975
+ selectCategory.show();
56013
55976
  }
56014
- var theme = this.theme;
56015
- return function (category) {
56016
- return theme.toCategoryLabel(category);
56017
- };
56018
- };
56019
- DDialogSelect.prototype.findCategories = function () {
56020
- var options = this._options;
56021
- if (options != null) {
56022
- var controller = options.controller;
56023
- if (controller != null && controller.getCategories != null) {
56024
- return controller.getCategories();
56025
- }
55977
+ else {
55978
+ selectCategory.hide();
56026
55979
  }
56027
- return null;
56028
55980
  };
56029
55981
  DDialogSelect.prototype.onOk = function (value) {
56030
55982
  this.emit("select", value, this);
@@ -56102,7 +56054,7 @@
56102
56054
  dialog = options;
56103
56055
  }
56104
56056
  else {
56105
- // Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY, DIALOG_CATEGORY_ID>.
56057
+ // Assumes DIALOG === DDialogSelect<DIALOG_VALUE, DIALOG_CATEGORY_ID>.
56106
56058
  dialog = new DDialogSelect(options);
56107
56059
  }
56108
56060
  this._dialog = dialog;
@@ -76361,7 +76313,6 @@
76361
76313
  toEnum: toEnum,
76362
76314
  toId: toId,
76363
76315
  toIndexOf: toIndexOf,
76364
- toLabelWith: toLabelWith,
76365
76316
  toLabel: toLabel$1,
76366
76317
  toMerged: toMerged,
76367
76318
  toPadded: toPadded,