@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
@@ -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
 
@@ -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 toLabel$1 = function (target) {
49495
+ var toLabelWith = function (target, def) {
49496
49496
  if (target != null) {
49497
49497
  if (isString(target)) {
49498
49498
  return target;
@@ -49510,7 +49510,15 @@ var toLabel$1 = function (target) {
49510
49510
  return target.id;
49511
49511
  }
49512
49512
  }
49513
- return "";
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, "");
49514
49522
  };
49515
49523
 
49516
49524
  /*
@@ -49578,7 +49586,7 @@ var DThemeWhiteDialogSelect = /** @class */ (function (_super) {
49578
49586
  return toId(category);
49579
49587
  };
49580
49588
  DThemeWhiteDialogSelect.prototype.toCategoryLabel = function (category) {
49581
- return toLabel$1(category);
49589
+ return toLabelWith(category, "All");
49582
49590
  };
49583
49591
  return DThemeWhiteDialogSelect;
49584
49592
  }(DThemeWhiteDialogLayered));
@@ -58881,7 +58889,7 @@ var DThemeDarkDialogSelect = /** @class */ (function (_super) {
58881
58889
  return toId(category);
58882
58890
  };
58883
58891
  DThemeDarkDialogSelect.prototype.toCategoryLabel = function (category) {
58884
- return toLabel$1(category);
58892
+ return toLabelWith(category, "All");
58885
58893
  };
58886
58894
  return DThemeDarkDialogSelect;
58887
58895
  }(DThemeDarkDialogLayered));
@@ -69311,16 +69319,10 @@ var DSelect = /** @class */ (function (_super) {
69311
69319
  _super.prototype.onMenuReplaced.call(this, newMenu, oldMenu);
69312
69320
  // Update the value
69313
69321
  var value = this._value;
69314
- if (value != null) {
69315
- var item = this.findMenuItem(newMenu, value);
69316
- if (item != null) {
69317
- this._value = value;
69318
- this.text = item;
69319
- }
69320
- else {
69321
- this._value = null;
69322
- this.text = null;
69323
- }
69322
+ var item = this.findMenuItem(newMenu, value);
69323
+ if (item != null) {
69324
+ this._value = value;
69325
+ this.text = item;
69324
69326
  }
69325
69327
  else {
69326
69328
  this._value = null;
@@ -74278,6 +74280,9 @@ var DDialogSelect = /** @class */ (function (_super) {
74278
74280
  if (result.width === undefined && result.weight === undefined) {
74279
74281
  result.width = 140;
74280
74282
  }
74283
+ if (result.state === undefined) {
74284
+ result.state = DBaseState.DISABLED;
74285
+ }
74281
74286
  return result;
74282
74287
  };
74283
74288
  DDialogSelect.prototype.onSelectCategoryChange = function (categoryId) {
@@ -74516,9 +74521,7 @@ var DDialogSelect = /** @class */ (function (_super) {
74516
74521
  this.onCategoryFetched(selectCategory, categoriesOrPromise);
74517
74522
  }
74518
74523
  else {
74519
- selectCategory.state.isEnabled = false;
74520
74524
  categoriesOrPromise.then(function (categories) {
74521
- selectCategory.state.isEnabled = true;
74522
74525
  _this.onCategoryFetched(selectCategory, categories);
74523
74526
  });
74524
74527
  }
@@ -74533,12 +74536,20 @@ var DDialogSelect = /** @class */ (function (_super) {
74533
74536
  };
74534
74537
  DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
74535
74538
  var items = [];
74539
+ var toId = this.newToCategoryId();
74540
+ var toLabel = this.newToCategoryLabel();
74541
+ items.push({
74542
+ value: null,
74543
+ text: {
74544
+ value: toLabel(null)
74545
+ }
74546
+ });
74536
74547
  for (var i = 0, imax = categories.length; i < imax; ++i) {
74537
74548
  var category = categories[i];
74538
74549
  items.push({
74539
- value: this.toCategoryId(category),
74550
+ value: toId(category),
74540
74551
  text: {
74541
- value: this.toCategoryLabel(category)
74552
+ value: toLabel(category)
74542
74553
  }
74543
74554
  });
74544
74555
  }
@@ -74546,36 +74557,40 @@ var DDialogSelect = /** @class */ (function (_super) {
74546
74557
  fit: true,
74547
74558
  items: items
74548
74559
  });
74549
- var newValue = 0 < items.length ? items[0].value : null;
74550
- selectCategory.value = newValue;
74551
- selectCategory.show();
74552
- this.search.create([this.input.value, newValue]);
74560
+ selectCategory.state.isEnabled = true;
74561
+ this.search.create([this.input.value, null]);
74553
74562
  };
74554
- DDialogSelect.prototype.toCategoryId = function (target) {
74563
+ DDialogSelect.prototype.newToCategoryId = function () {
74555
74564
  var options = this._options;
74556
74565
  if (options != null) {
74557
74566
  var category = options.category;
74558
74567
  if (category != null) {
74559
74568
  var toId = category.toId;
74560
74569
  if (toId != null) {
74561
- return toId(target);
74570
+ return toId;
74562
74571
  }
74563
74572
  }
74564
74573
  }
74565
- return this.theme.toCategoryId(target);
74574
+ var theme = this.theme;
74575
+ return function (category) {
74576
+ return theme.toCategoryId(category);
74577
+ };
74566
74578
  };
74567
- DDialogSelect.prototype.toCategoryLabel = function (target) {
74579
+ DDialogSelect.prototype.newToCategoryLabel = function () {
74568
74580
  var options = this._options;
74569
74581
  if (options != null) {
74570
74582
  var category = options.category;
74571
74583
  if (category != null) {
74572
74584
  var toLabel = category.toLabel;
74573
74585
  if (toLabel != null) {
74574
- return toLabel(target);
74586
+ return toLabel;
74575
74587
  }
74576
74588
  }
74577
74589
  }
74578
- return this.theme.toCategoryLabel(target);
74590
+ var theme = this.theme;
74591
+ return function (category) {
74592
+ return theme.toCategoryLabel(category);
74593
+ };
74579
74594
  };
74580
74595
  DDialogSelect.prototype.findCategories = function () {
74581
74596
  var options = this._options;
@@ -95900,6 +95915,7 @@ exports.toId = toId;
95900
95915
  exports.toImageElement = toImageElement;
95901
95916
  exports.toIndexOf = toIndexOf;
95902
95917
  exports.toLabel = toLabel$1;
95918
+ exports.toLabelWith = toLabelWith;
95903
95919
  exports.toLength = toLength;
95904
95920
  exports.toLineIndexCount = toLineIndexCount;
95905
95921
  exports.toLineOfAnyPointCount = toLineOfAnyPointCount;
@@ -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
 
@@ -47278,7 +47278,7 @@
47278
47278
  * Copyright (C) 2019 Toshiba Corporation
47279
47279
  * SPDX-License-Identifier: Apache-2.0
47280
47280
  */
47281
- var toLabel$1 = function (target) {
47281
+ var toLabelWith = function (target, def) {
47282
47282
  if (target != null) {
47283
47283
  if (isString(target)) {
47284
47284
  return target;
@@ -47296,7 +47296,15 @@
47296
47296
  return target.id;
47297
47297
  }
47298
47298
  }
47299
- return "";
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, "");
47300
47308
  };
47301
47309
 
47302
47310
  /*
@@ -50665,16 +50673,10 @@
50665
50673
  _super.prototype.onMenuReplaced.call(this, newMenu, oldMenu);
50666
50674
  // Update the value
50667
50675
  var value = this._value;
50668
- if (value != null) {
50669
- var item = this.findMenuItem(newMenu, value);
50670
- if (item != null) {
50671
- this._value = value;
50672
- this.text = item;
50673
- }
50674
- else {
50675
- this._value = null;
50676
- this.text = null;
50677
- }
50676
+ var item = this.findMenuItem(newMenu, value);
50677
+ if (item != null) {
50678
+ this._value = value;
50679
+ this.text = item;
50678
50680
  }
50679
50681
  else {
50680
50682
  this._value = null;
@@ -55702,6 +55704,9 @@
55702
55704
  if (result.width === undefined && result.weight === undefined) {
55703
55705
  result.width = 140;
55704
55706
  }
55707
+ if (result.state === undefined) {
55708
+ result.state = DBaseState.DISABLED;
55709
+ }
55705
55710
  return result;
55706
55711
  };
55707
55712
  DDialogSelect.prototype.onSelectCategoryChange = function (categoryId) {
@@ -55940,9 +55945,7 @@
55940
55945
  this.onCategoryFetched(selectCategory, categoriesOrPromise);
55941
55946
  }
55942
55947
  else {
55943
- selectCategory.state.isEnabled = false;
55944
55948
  categoriesOrPromise.then(function (categories) {
55945
- selectCategory.state.isEnabled = true;
55946
55949
  _this.onCategoryFetched(selectCategory, categories);
55947
55950
  });
55948
55951
  }
@@ -55957,12 +55960,20 @@
55957
55960
  };
55958
55961
  DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
55959
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
+ });
55960
55971
  for (var i = 0, imax = categories.length; i < imax; ++i) {
55961
55972
  var category = categories[i];
55962
55973
  items.push({
55963
- value: this.toCategoryId(category),
55974
+ value: toId(category),
55964
55975
  text: {
55965
- value: this.toCategoryLabel(category)
55976
+ value: toLabel(category)
55966
55977
  }
55967
55978
  });
55968
55979
  }
@@ -55970,36 +55981,40 @@
55970
55981
  fit: true,
55971
55982
  items: items
55972
55983
  });
55973
- var newValue = 0 < items.length ? items[0].value : null;
55974
- selectCategory.value = newValue;
55975
- selectCategory.show();
55976
- this.search.create([this.input.value, newValue]);
55984
+ selectCategory.state.isEnabled = true;
55985
+ this.search.create([this.input.value, null]);
55977
55986
  };
55978
- DDialogSelect.prototype.toCategoryId = function (target) {
55987
+ DDialogSelect.prototype.newToCategoryId = function () {
55979
55988
  var options = this._options;
55980
55989
  if (options != null) {
55981
55990
  var category = options.category;
55982
55991
  if (category != null) {
55983
55992
  var toId = category.toId;
55984
55993
  if (toId != null) {
55985
- return toId(target);
55994
+ return toId;
55986
55995
  }
55987
55996
  }
55988
55997
  }
55989
- return this.theme.toCategoryId(target);
55998
+ var theme = this.theme;
55999
+ return function (category) {
56000
+ return theme.toCategoryId(category);
56001
+ };
55990
56002
  };
55991
- DDialogSelect.prototype.toCategoryLabel = function (target) {
56003
+ DDialogSelect.prototype.newToCategoryLabel = function () {
55992
56004
  var options = this._options;
55993
56005
  if (options != null) {
55994
56006
  var category = options.category;
55995
56007
  if (category != null) {
55996
56008
  var toLabel = category.toLabel;
55997
56009
  if (toLabel != null) {
55998
- return toLabel(target);
56010
+ return toLabel;
55999
56011
  }
56000
56012
  }
56001
56013
  }
56002
- return this.theme.toCategoryLabel(target);
56014
+ var theme = this.theme;
56015
+ return function (category) {
56016
+ return theme.toCategoryLabel(category);
56017
+ };
56003
56018
  };
56004
56019
  DDialogSelect.prototype.findCategories = function () {
56005
56020
  var options = this._options;
@@ -76340,6 +76355,7 @@
76340
76355
  toEnum: toEnum,
76341
76356
  toId: toId,
76342
76357
  toIndexOf: toIndexOf,
76358
+ toLabelWith: toLabelWith,
76343
76359
  toLabel: toLabel$1,
76344
76360
  toMerged: toMerged,
76345
76361
  toPadded: toPadded,