@wcardinal/wcardinal-ui 0.385.0 → 0.387.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 (32) hide show
  1. package/dist/types/wcardinal/ui/d-button-select.d.ts +1 -1
  2. package/dist/types/wcardinal/ui/d-diagrams.d.ts +1 -0
  3. package/dist/types/wcardinal/ui/d-dialog.d.ts +7 -3
  4. package/dist/types/wcardinal/ui/d-menu-opener.d.ts +2 -1
  5. package/dist/types/wcardinal/ui/util/util-overlay.d.ts +1 -1
  6. package/dist/wcardinal/ui/d-button-select.js.map +1 -1
  7. package/dist/wcardinal/ui/d-diagrams.js +25 -0
  8. package/dist/wcardinal/ui/d-diagrams.js.map +1 -1
  9. package/dist/wcardinal/ui/d-dialog.js +6 -3
  10. package/dist/wcardinal/ui/d-dialog.js.map +1 -1
  11. package/dist/wcardinal/ui/d-menu-opener.js.map +1 -1
  12. package/dist/wcardinal/ui/d-menu.js +1 -1
  13. package/dist/wcardinal/ui/d-menu.js.map +1 -1
  14. package/dist/wcardinal/ui/util/util-overlay.js +6 -3
  15. package/dist/wcardinal/ui/util/util-overlay.js.map +1 -1
  16. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  17. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  18. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  19. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-dark.js +1 -1
  21. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  22. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  23. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  24. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  25. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  26. package/dist/wcardinal-ui-theme-white.js +1 -1
  27. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  28. package/dist/wcardinal-ui.cjs.js +36 -8
  29. package/dist/wcardinal-ui.js +36 -8
  30. package/dist/wcardinal-ui.min.js +2 -2
  31. package/dist/wcardinal-ui.min.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.385.0
2
+ Winter Cardinal UI v0.387.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -22711,6 +22711,28 @@ var EShapeEmbeddedLayerContainer = /** @class */ (function () {
22711
22711
  var DDiagrams = /** @class */ (function () {
22712
22712
  function DDiagrams() {
22713
22713
  }
22714
+ DDiagrams.parse = function (target) {
22715
+ if (target != null && isString(target)) {
22716
+ try {
22717
+ var parsed = JSON.parse(target);
22718
+ if (parsed != null && isNumber(parsed.version) && isString(parsed.name)) {
22719
+ if (isNumber(parsed.width) &&
22720
+ isNumber(parsed.height) &&
22721
+ isArray(parsed.items) &&
22722
+ isArray(parsed.resources)) {
22723
+ return parsed;
22724
+ }
22725
+ else if (isString(parsed.data)) {
22726
+ return this.toSerialized(parsed);
22727
+ }
22728
+ }
22729
+ }
22730
+ catch (e) {
22731
+ // DO NOTHING
22732
+ }
22733
+ }
22734
+ return null;
22735
+ };
22714
22736
  DDiagrams.toSimple = function (serialized) {
22715
22737
  return {
22716
22738
  version: serialized.version,
@@ -26282,11 +26304,14 @@ var UtilOverlay = /** @class */ (function () {
26282
26304
  enumerable: false,
26283
26305
  configurable: true
26284
26306
  });
26285
- UtilOverlay.prototype.pick = function (target) {
26307
+ UtilOverlay.prototype.pick = function (owner, opener) {
26286
26308
  var layer = this._layer;
26287
26309
  if (layer == null) {
26288
- layer = DApplications.getLayerOverlay(target);
26289
- if (!layer) {
26310
+ layer = DApplications.getLayerOverlay(owner);
26311
+ if (layer == null && opener != null) {
26312
+ layer = DApplications.getLayerOverlay(opener);
26313
+ }
26314
+ if (layer == null) {
26290
26315
  var application = this._application;
26291
26316
  if (application) {
26292
26317
  layer = application.getLayerOverlay();
@@ -26311,8 +26336,11 @@ var UtilOverlay = /** @class */ (function () {
26311
26336
  *
26312
26337
  * If multiple application instances are there, better to set the constructor
26313
26338
  * option `parent` to an `application.stage` so that the dialog picks a right
26314
- * application. By default, the dialog assumes the last created application is
26315
- * the one it belongs to at the time when it is created.
26339
+ * application. `DDialog` searches applications in a following order:
26340
+ *
26341
+ * * To begin, `DDialog` tries to find applications which it belongs to.
26342
+ * * If `DDialog` can't find applications, then `DDialog` tries to find applications which openers belong to.
26343
+ * * If openers are not given, `DDialog` assumes the last created application at the very moment `DDialog` is instantiated is the one it belongs to.
26316
26344
  */
26317
26345
  var DDialog = /** @class */ (function (_super) {
26318
26346
  __extends(DDialog, _super);
@@ -26532,7 +26560,7 @@ var DDialog = /** @class */ (function (_super) {
26532
26560
  switch (this._mode) {
26533
26561
  case DDialogMode.MODAL:
26534
26562
  case DDialogMode.MENU:
26535
- layer = this._overlay.pick(this);
26563
+ layer = this._overlay.pick(this, opener);
26536
26564
  layer.stage.addChild(this);
26537
26565
  break;
26538
26566
  case DDialogMode.MODELESS:
@@ -70958,7 +70986,7 @@ var DMenu = /** @class */ (function (_super) {
70958
70986
  DMenu.prototype.open = function (owner, closeable, context) {
70959
70987
  var _a;
70960
70988
  if (this.isHidden()) {
70961
- var layer = this._overlay.pick(this);
70989
+ var layer = this._overlay.pick(this, owner);
70962
70990
  this._owner = owner;
70963
70991
  // States
70964
70992
  var children = this.children;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.385.0
2
+ Winter Cardinal UI v0.387.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -22708,6 +22708,28 @@
22708
22708
  var DDiagrams = /** @class */ (function () {
22709
22709
  function DDiagrams() {
22710
22710
  }
22711
+ DDiagrams.parse = function (target) {
22712
+ if (target != null && isString(target)) {
22713
+ try {
22714
+ var parsed = JSON.parse(target);
22715
+ if (parsed != null && isNumber(parsed.version) && isString(parsed.name)) {
22716
+ if (isNumber(parsed.width) &&
22717
+ isNumber(parsed.height) &&
22718
+ isArray(parsed.items) &&
22719
+ isArray(parsed.resources)) {
22720
+ return parsed;
22721
+ }
22722
+ else if (isString(parsed.data)) {
22723
+ return this.toSerialized(parsed);
22724
+ }
22725
+ }
22726
+ }
22727
+ catch (e) {
22728
+ // DO NOTHING
22729
+ }
22730
+ }
22731
+ return null;
22732
+ };
22711
22733
  DDiagrams.toSimple = function (serialized) {
22712
22734
  return {
22713
22735
  version: serialized.version,
@@ -26279,11 +26301,14 @@
26279
26301
  enumerable: false,
26280
26302
  configurable: true
26281
26303
  });
26282
- UtilOverlay.prototype.pick = function (target) {
26304
+ UtilOverlay.prototype.pick = function (owner, opener) {
26283
26305
  var layer = this._layer;
26284
26306
  if (layer == null) {
26285
- layer = DApplications.getLayerOverlay(target);
26286
- if (!layer) {
26307
+ layer = DApplications.getLayerOverlay(owner);
26308
+ if (layer == null && opener != null) {
26309
+ layer = DApplications.getLayerOverlay(opener);
26310
+ }
26311
+ if (layer == null) {
26287
26312
  var application = this._application;
26288
26313
  if (application) {
26289
26314
  layer = application.getLayerOverlay();
@@ -26308,8 +26333,11 @@
26308
26333
  *
26309
26334
  * If multiple application instances are there, better to set the constructor
26310
26335
  * option `parent` to an `application.stage` so that the dialog picks a right
26311
- * application. By default, the dialog assumes the last created application is
26312
- * the one it belongs to at the time when it is created.
26336
+ * application. `DDialog` searches applications in a following order:
26337
+ *
26338
+ * * To begin, `DDialog` tries to find applications which it belongs to.
26339
+ * * If `DDialog` can't find applications, then `DDialog` tries to find applications which openers belong to.
26340
+ * * If openers are not given, `DDialog` assumes the last created application at the very moment `DDialog` is instantiated is the one it belongs to.
26313
26341
  */
26314
26342
  var DDialog = /** @class */ (function (_super) {
26315
26343
  __extends(DDialog, _super);
@@ -26529,7 +26557,7 @@
26529
26557
  switch (this._mode) {
26530
26558
  case DDialogMode.MODAL:
26531
26559
  case DDialogMode.MENU:
26532
- layer = this._overlay.pick(this);
26560
+ layer = this._overlay.pick(this, opener);
26533
26561
  layer.stage.addChild(this);
26534
26562
  break;
26535
26563
  case DDialogMode.MODELESS:
@@ -50158,7 +50186,7 @@
50158
50186
  DMenu.prototype.open = function (owner, closeable, context) {
50159
50187
  var _a;
50160
50188
  if (this.isHidden()) {
50161
- var layer = this._overlay.pick(this);
50189
+ var layer = this._overlay.pick(this, owner);
50162
50190
  this._owner = owner;
50163
50191
  // States
50164
50192
  var children = this.children;