@wcardinal/wcardinal-ui 0.359.0 → 0.362.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 (39) hide show
  1. package/dist/types/wcardinal/ui/d-diagram-editor.d.ts +13 -1
  2. package/dist/types/wcardinal/ui/d-dialog-select.d.ts +10 -10
  3. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/theme/white/d-theme-white-diagram-editor.d.ts +1 -0
  5. package/dist/types/wcardinal/ui/util/index.d.ts +1 -0
  6. package/dist/types/wcardinal/ui/util/to-label-with.d.ts +1 -0
  7. package/dist/wcardinal/ui/d-diagram-canvas-editor.js +1 -0
  8. package/dist/wcardinal/ui/d-diagram-canvas-editor.js.map +1 -1
  9. package/dist/wcardinal/ui/d-diagram-editor.js +10 -5
  10. package/dist/wcardinal/ui/d-diagram-editor.js.map +1 -1
  11. package/dist/wcardinal/ui/d-dialog-select.js +28 -14
  12. package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
  13. package/dist/wcardinal/ui/d-select.js +4 -10
  14. package/dist/wcardinal/ui/d-select.js.map +1 -1
  15. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.js +3 -0
  16. package/dist/wcardinal/ui/theme/dark/d-theme-dark-diagram-editor.js.map +1 -1
  17. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +2 -2
  18. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
  19. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-editor.js +3 -0
  20. package/dist/wcardinal/ui/theme/white/d-theme-white-diagram-editor.js.map +1 -1
  21. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +2 -2
  22. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
  23. package/dist/wcardinal/ui/util/index.js +1 -0
  24. package/dist/wcardinal/ui/util/index.js.map +1 -1
  25. package/dist/wcardinal/ui/util/to-label-with.js +27 -0
  26. package/dist/wcardinal/ui/util/to-label-with.js.map +1 -0
  27. package/dist/wcardinal/ui/util/to-label.js +2 -20
  28. package/dist/wcardinal/ui/util/to-label.js.map +1 -1
  29. package/dist/wcardinal-ui-theme-dark.js +7 -2
  30. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  31. package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
  32. package/dist/wcardinal-ui-theme-white.js +7 -2
  33. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  34. package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
  35. package/dist/wcardinal-ui.cjs.js +62 -34
  36. package/dist/wcardinal-ui.js +54 -32
  37. package/dist/wcardinal-ui.min.js +2 -2
  38. package/dist/wcardinal-ui.min.js.map +1 -1
  39. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.359.0
2
+ Winter Cardinal UI v0.362.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));
@@ -51126,6 +51134,9 @@ var DThemeWhiteDiagramEditor = /** @class */ (function (_super) {
51126
51134
  DThemeWhiteDiagramEditor.prototype.isSnapTargetEnabled = function () {
51127
51135
  return true;
51128
51136
  };
51137
+ DThemeWhiteDiagramEditor.prototype.getBaseLayerLabel = function () {
51138
+ return "Base Layer";
51139
+ };
51129
51140
  return DThemeWhiteDiagramEditor;
51130
51141
  }(DThemeWhiteDiagramBase));
51131
51142
 
@@ -58881,7 +58892,7 @@ var DThemeDarkDialogSelect = /** @class */ (function (_super) {
58881
58892
  return toId(category);
58882
58893
  };
58883
58894
  DThemeDarkDialogSelect.prototype.toCategoryLabel = function (category) {
58884
- return toLabel$1(category);
58895
+ return toLabelWith(category, "All");
58885
58896
  };
58886
58897
  return DThemeDarkDialogSelect;
58887
58898
  }(DThemeDarkDialogLayered));
@@ -60410,6 +60421,9 @@ var DThemeDarkDiagramEditor = /** @class */ (function (_super) {
60410
60421
  DThemeDarkDiagramEditor.prototype.isSnapTargetEnabled = function () {
60411
60422
  return true;
60412
60423
  };
60424
+ DThemeDarkDiagramEditor.prototype.getBaseLayerLabel = function () {
60425
+ return "Base Layer";
60426
+ };
60413
60427
  return DThemeDarkDiagramEditor;
60414
60428
  }(DThemeDarkDiagramBase));
60415
60429
 
@@ -69311,16 +69325,10 @@ var DSelect = /** @class */ (function (_super) {
69311
69325
  _super.prototype.onMenuReplaced.call(this, newMenu, oldMenu);
69312
69326
  // Update the value
69313
69327
  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
- }
69328
+ var item = this.findMenuItem(newMenu, value);
69329
+ if (item != null) {
69330
+ this._value = value;
69331
+ this.text = item;
69324
69332
  }
69325
69333
  else {
69326
69334
  this._value = null;
@@ -74278,6 +74286,9 @@ var DDialogSelect = /** @class */ (function (_super) {
74278
74286
  if (result.width === undefined && result.weight === undefined) {
74279
74287
  result.width = 140;
74280
74288
  }
74289
+ if (result.state === undefined) {
74290
+ result.state = DBaseState.DISABLED;
74291
+ }
74281
74292
  return result;
74282
74293
  };
74283
74294
  DDialogSelect.prototype.onSelectCategoryChange = function (categoryId) {
@@ -74516,9 +74527,7 @@ var DDialogSelect = /** @class */ (function (_super) {
74516
74527
  this.onCategoryFetched(selectCategory, categoriesOrPromise);
74517
74528
  }
74518
74529
  else {
74519
- selectCategory.state.isEnabled = false;
74520
74530
  categoriesOrPromise.then(function (categories) {
74521
- selectCategory.state.isEnabled = true;
74522
74531
  _this.onCategoryFetched(selectCategory, categories);
74523
74532
  });
74524
74533
  }
@@ -74533,12 +74542,20 @@ var DDialogSelect = /** @class */ (function (_super) {
74533
74542
  };
74534
74543
  DDialogSelect.prototype.onCategoryFetched = function (selectCategory, categories) {
74535
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
+ });
74536
74553
  for (var i = 0, imax = categories.length; i < imax; ++i) {
74537
74554
  var category = categories[i];
74538
74555
  items.push({
74539
- value: this.toCategoryId(category),
74556
+ value: toId(category),
74540
74557
  text: {
74541
- value: this.toCategoryLabel(category)
74558
+ value: toLabel(category)
74542
74559
  }
74543
74560
  });
74544
74561
  }
@@ -74546,36 +74563,40 @@ var DDialogSelect = /** @class */ (function (_super) {
74546
74563
  fit: true,
74547
74564
  items: items
74548
74565
  });
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]);
74566
+ selectCategory.state.isEnabled = true;
74567
+ this.search.create([this.input.value, null]);
74553
74568
  };
74554
- DDialogSelect.prototype.toCategoryId = function (target) {
74569
+ DDialogSelect.prototype.newToCategoryId = function () {
74555
74570
  var options = this._options;
74556
74571
  if (options != null) {
74557
74572
  var category = options.category;
74558
74573
  if (category != null) {
74559
74574
  var toId = category.toId;
74560
74575
  if (toId != null) {
74561
- return toId(target);
74576
+ return toId;
74562
74577
  }
74563
74578
  }
74564
74579
  }
74565
- return this.theme.toCategoryId(target);
74580
+ var theme = this.theme;
74581
+ return function (category) {
74582
+ return theme.toCategoryId(category);
74583
+ };
74566
74584
  };
74567
- DDialogSelect.prototype.toCategoryLabel = function (target) {
74585
+ DDialogSelect.prototype.newToCategoryLabel = function () {
74568
74586
  var options = this._options;
74569
74587
  if (options != null) {
74570
74588
  var category = options.category;
74571
74589
  if (category != null) {
74572
74590
  var toLabel = category.toLabel;
74573
74591
  if (toLabel != null) {
74574
- return toLabel(target);
74592
+ return toLabel;
74575
74593
  }
74576
74594
  }
74577
74595
  }
74578
- return this.theme.toCategoryLabel(target);
74596
+ var theme = this.theme;
74597
+ return function (category) {
74598
+ return theme.toCategoryLabel(category);
74599
+ };
74579
74600
  };
74580
74601
  DDialogSelect.prototype.findCategories = function () {
74581
74602
  var options = this._options;
@@ -81928,6 +81949,7 @@ var DDiagramCanvasEditor = /** @class */ (function (_super) {
81928
81949
  label: this.label,
81929
81950
  width: this.width,
81930
81951
  height: this.height,
81952
+ category: this.category,
81931
81953
  summary: this.summary,
81932
81954
  description: this.description,
81933
81955
  background: {
@@ -83351,16 +83373,21 @@ var DDiagramEditor = /** @class */ (function (_super) {
83351
83373
  this.emit("deleted", null, this);
83352
83374
  return Promise.resolve(null);
83353
83375
  };
83354
- DDiagramEditor.prototype.create = function (name, width, height) {
83376
+ DDiagramEditor.prototype.create = function (options) {
83355
83377
  return this.set({
83356
83378
  version: DDiagramSerializedVersion,
83357
83379
  id: undefined,
83358
- name: name,
83359
- width: width,
83360
- height: height,
83380
+ name: options.name,
83381
+ label: options.label,
83382
+ width: options.width,
83383
+ height: options.height,
83384
+ category: options.category,
83385
+ summary: options.summary,
83386
+ description: options.description,
83387
+ background: options.background,
83361
83388
  resources: [],
83362
83389
  data: [],
83363
- layers: [["Default layer"]],
83390
+ layers: [[this.theme.getBaseLayerLabel()]],
83364
83391
  items: [],
83365
83392
  snap: undefined
83366
83393
  });
@@ -95900,6 +95927,7 @@ exports.toId = toId;
95900
95927
  exports.toImageElement = toImageElement;
95901
95928
  exports.toIndexOf = toIndexOf;
95902
95929
  exports.toLabel = toLabel$1;
95930
+ exports.toLabelWith = toLabelWith;
95903
95931
  exports.toLength = toLength;
95904
95932
  exports.toLineIndexCount = toLineIndexCount;
95905
95933
  exports.toLineOfAnyPointCount = toLineOfAnyPointCount;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.359.0
2
+ Winter Cardinal UI v0.362.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;
@@ -63372,6 +63387,7 @@
63372
63387
  label: this.label,
63373
63388
  width: this.width,
63374
63389
  height: this.height,
63390
+ category: this.category,
63375
63391
  summary: this.summary,
63376
63392
  description: this.description,
63377
63393
  background: {
@@ -64795,16 +64811,21 @@
64795
64811
  this.emit("deleted", null, this);
64796
64812
  return Promise.resolve(null);
64797
64813
  };
64798
- DDiagramEditor.prototype.create = function (name, width, height) {
64814
+ DDiagramEditor.prototype.create = function (options) {
64799
64815
  return this.set({
64800
64816
  version: DDiagramSerializedVersion,
64801
64817
  id: undefined,
64802
- name: name,
64803
- width: width,
64804
- height: height,
64818
+ name: options.name,
64819
+ label: options.label,
64820
+ width: options.width,
64821
+ height: options.height,
64822
+ category: options.category,
64823
+ summary: options.summary,
64824
+ description: options.description,
64825
+ background: options.background,
64805
64826
  resources: [],
64806
64827
  data: [],
64807
- layers: [["Default layer"]],
64828
+ layers: [[this.theme.getBaseLayerLabel()]],
64808
64829
  items: [],
64809
64830
  snap: undefined
64810
64831
  });
@@ -76340,6 +76361,7 @@
76340
76361
  toEnum: toEnum,
76341
76362
  toId: toId,
76342
76363
  toIndexOf: toIndexOf,
76364
+ toLabelWith: toLabelWith,
76343
76365
  toLabel: toLabel$1,
76344
76366
  toMerged: toMerged,
76345
76367
  toPadded: toPadded,