@wcardinal/wcardinal-ui 0.446.0 → 0.447.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 (31) hide show
  1. package/README.md +24 -28
  2. package/dist/types/wcardinal/ui/d-dialog.d.ts +9 -1
  3. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog.d.ts +1 -0
  4. package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog.d.ts +1 -0
  5. package/dist/wcardinal/ui/d-dialog.js +48 -2
  6. package/dist/wcardinal/ui/d-dialog.js.map +1 -1
  7. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js +3 -0
  8. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js.map +1 -1
  9. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js +3 -0
  10. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js.map +1 -1
  11. package/dist/wcardinal-ui-theme-dark-en-us.js +4 -1
  12. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  13. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  14. package/dist/wcardinal-ui-theme-dark-ja-jp.js +4 -1
  15. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  16. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  17. package/dist/wcardinal-ui-theme-dark.js +4 -1
  18. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  19. package/dist/wcardinal-ui-theme-white-en-us.js +4 -1
  20. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  21. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  22. package/dist/wcardinal-ui-theme-white-ja-jp.js +4 -1
  23. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  24. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  25. package/dist/wcardinal-ui-theme-white.js +4 -1
  26. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  27. package/dist/wcardinal-ui.cjs.js +55 -3
  28. package/dist/wcardinal-ui.js +49 -3
  29. package/dist/wcardinal-ui.min.js +2 -2
  30. package/dist/wcardinal-ui.min.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.446.0
2
+ Winter Cardinal UI v0.447.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -30416,7 +30416,7 @@ var DDialog = /** @class */ (function (_super) {
30416
30416
  }
30417
30417
  DDialog.prototype.init = function (options) {
30418
30418
  var _this = this;
30419
- var _a, _b;
30419
+ var _a, _b, _c;
30420
30420
  _super.prototype.init.call(this, options);
30421
30421
  this._onPrerenderBound = function () {
30422
30422
  _this.onPrerender();
@@ -30426,8 +30426,10 @@ var DDialog = /** @class */ (function (_super) {
30426
30426
  var theme = this.theme;
30427
30427
  var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getMode(), DDialogMode);
30428
30428
  this._mode = mode;
30429
+ // Always On Top
30430
+ this._alwaysOnTop = (_b = options === null || options === void 0 ? void 0 : options.alwaysOnTop) !== null && _b !== void 0 ? _b : theme.isAlwaysOnTop();
30429
30431
  // Sticky
30430
- this._sticky = (_b = options === null || options === void 0 ? void 0 : options.sticky) !== null && _b !== void 0 ? _b : theme.isSticky(mode);
30432
+ this._sticky = (_c = options === null || options === void 0 ? void 0 : options.sticky) !== null && _c !== void 0 ? _c : theme.isSticky(mode);
30431
30433
  // Close On
30432
30434
  var closeOn = this.toCloseOn(mode, theme, options);
30433
30435
  this._closeOn = closeOn;
@@ -30508,6 +30510,16 @@ var DDialog = /** @class */ (function (_super) {
30508
30510
  enumerable: false,
30509
30511
  configurable: true
30510
30512
  });
30513
+ Object.defineProperty(DDialog.prototype, "alwaysOnTop", {
30514
+ get: function () {
30515
+ return this._alwaysOnTop;
30516
+ },
30517
+ set: function (alwaysOnTop) {
30518
+ this._alwaysOnTop = alwaysOnTop;
30519
+ },
30520
+ enumerable: false,
30521
+ configurable: true
30522
+ });
30511
30523
  Object.defineProperty(DDialog.prototype, "gesture", {
30512
30524
  get: function () {
30513
30525
  return this._gesture;
@@ -30614,6 +30626,7 @@ var DDialog = /** @class */ (function (_super) {
30614
30626
  */
30615
30627
  DDialog.prototype.open = function (opener) {
30616
30628
  var _this = this;
30629
+ var _a;
30617
30630
  var result = this._promise;
30618
30631
  if (result == null) {
30619
30632
  result = new Promise(function (resolve, reject) {
@@ -30657,11 +30670,37 @@ var DDialog = /** @class */ (function (_super) {
30657
30670
  gesture.constraint(this, layer, position.x, position.y);
30658
30671
  }
30659
30672
  }
30673
+ // Always On Top
30674
+ if (this._alwaysOnTop) {
30675
+ var parent_2 = this.parent;
30676
+ if (parent_2 != null) {
30677
+ parent_2.on("childAdded", ((_a = this._onParentChildAddedBound) !== null && _a !== void 0 ? _a : (this._onParentChildAddedBound = function () {
30678
+ _this.onParentChildAdded();
30679
+ })));
30680
+ this.onParentChildAdded();
30681
+ }
30682
+ }
30660
30683
  // Done
30661
30684
  this.onOpen();
30662
30685
  }
30663
30686
  return result;
30664
30687
  };
30688
+ DDialog.prototype.onParentChildAdded = function () {
30689
+ var parent = this.parent;
30690
+ if (parent != null) {
30691
+ parent.children.sort(this.compareAlwaysOnTop);
30692
+ }
30693
+ };
30694
+ DDialog.prototype.compareAlwaysOnTop = function (a, b) {
30695
+ var at = a instanceof DDialog && a.alwaysOnTop;
30696
+ var bt = b instanceof DDialog && b.alwaysOnTop;
30697
+ if (at) {
30698
+ return bt ? 0 : +1;
30699
+ }
30700
+ else {
30701
+ return bt ? -1 : 0;
30702
+ }
30703
+ };
30665
30704
  DDialog.prototype.onPrerender = function () {
30666
30705
  var _a;
30667
30706
  var layer = this._layer;
@@ -30757,6 +30796,13 @@ var DDialog = /** @class */ (function (_super) {
30757
30796
  this.visible = false;
30758
30797
  this.onAnimationEnd(true);
30759
30798
  }
30799
+ // Always On Top
30800
+ if (this._alwaysOnTop) {
30801
+ var parent_3 = this.parent;
30802
+ if (parent_3 != null) {
30803
+ parent_3.off("childAdded", this._onParentChildAddedBound);
30804
+ }
30805
+ }
30760
30806
  this.emit("close", this);
30761
30807
  };
30762
30808
  DDialog.prototype.onKeyDown = function (e) {
@@ -53962,6 +54008,9 @@ var DThemeWhiteDialog = /** @class */ (function (_super) {
53962
54008
  DThemeWhiteDialog.prototype.isSticky = function (mode) {
53963
54009
  return false;
53964
54010
  };
54011
+ DThemeWhiteDialog.prototype.isAlwaysOnTop = function () {
54012
+ return false;
54013
+ };
53965
54014
  DThemeWhiteDialog.prototype.isGestureEnabled = function (mode) {
53966
54015
  switch (mode) {
53967
54016
  case DDialogMode.MODAL:
@@ -65048,6 +65097,9 @@ var DThemeDarkDialog = /** @class */ (function (_super) {
65048
65097
  DThemeDarkDialog.prototype.isSticky = function (mode) {
65049
65098
  return false;
65050
65099
  };
65100
+ DThemeDarkDialog.prototype.isAlwaysOnTop = function () {
65101
+ return false;
65102
+ };
65051
65103
  DThemeDarkDialog.prototype.isGestureEnabled = function (mode) {
65052
65104
  switch (mode) {
65053
65105
  case DDialogMode.MODAL:
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.446.0
2
+ Winter Cardinal UI v0.447.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -30413,7 +30413,7 @@
30413
30413
  }
30414
30414
  DDialog.prototype.init = function (options) {
30415
30415
  var _this = this;
30416
- var _a, _b;
30416
+ var _a, _b, _c;
30417
30417
  _super.prototype.init.call(this, options);
30418
30418
  this._onPrerenderBound = function () {
30419
30419
  _this.onPrerender();
@@ -30423,8 +30423,10 @@
30423
30423
  var theme = this.theme;
30424
30424
  var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getMode(), DDialogMode);
30425
30425
  this._mode = mode;
30426
+ // Always On Top
30427
+ this._alwaysOnTop = (_b = options === null || options === void 0 ? void 0 : options.alwaysOnTop) !== null && _b !== void 0 ? _b : theme.isAlwaysOnTop();
30426
30428
  // Sticky
30427
- this._sticky = (_b = options === null || options === void 0 ? void 0 : options.sticky) !== null && _b !== void 0 ? _b : theme.isSticky(mode);
30429
+ this._sticky = (_c = options === null || options === void 0 ? void 0 : options.sticky) !== null && _c !== void 0 ? _c : theme.isSticky(mode);
30428
30430
  // Close On
30429
30431
  var closeOn = this.toCloseOn(mode, theme, options);
30430
30432
  this._closeOn = closeOn;
@@ -30505,6 +30507,16 @@
30505
30507
  enumerable: false,
30506
30508
  configurable: true
30507
30509
  });
30510
+ Object.defineProperty(DDialog.prototype, "alwaysOnTop", {
30511
+ get: function () {
30512
+ return this._alwaysOnTop;
30513
+ },
30514
+ set: function (alwaysOnTop) {
30515
+ this._alwaysOnTop = alwaysOnTop;
30516
+ },
30517
+ enumerable: false,
30518
+ configurable: true
30519
+ });
30508
30520
  Object.defineProperty(DDialog.prototype, "gesture", {
30509
30521
  get: function () {
30510
30522
  return this._gesture;
@@ -30611,6 +30623,7 @@
30611
30623
  */
30612
30624
  DDialog.prototype.open = function (opener) {
30613
30625
  var _this = this;
30626
+ var _a;
30614
30627
  var result = this._promise;
30615
30628
  if (result == null) {
30616
30629
  result = new Promise(function (resolve, reject) {
@@ -30654,11 +30667,37 @@
30654
30667
  gesture.constraint(this, layer, position.x, position.y);
30655
30668
  }
30656
30669
  }
30670
+ // Always On Top
30671
+ if (this._alwaysOnTop) {
30672
+ var parent_2 = this.parent;
30673
+ if (parent_2 != null) {
30674
+ parent_2.on("childAdded", ((_a = this._onParentChildAddedBound) !== null && _a !== void 0 ? _a : (this._onParentChildAddedBound = function () {
30675
+ _this.onParentChildAdded();
30676
+ })));
30677
+ this.onParentChildAdded();
30678
+ }
30679
+ }
30657
30680
  // Done
30658
30681
  this.onOpen();
30659
30682
  }
30660
30683
  return result;
30661
30684
  };
30685
+ DDialog.prototype.onParentChildAdded = function () {
30686
+ var parent = this.parent;
30687
+ if (parent != null) {
30688
+ parent.children.sort(this.compareAlwaysOnTop);
30689
+ }
30690
+ };
30691
+ DDialog.prototype.compareAlwaysOnTop = function (a, b) {
30692
+ var at = a instanceof DDialog && a.alwaysOnTop;
30693
+ var bt = b instanceof DDialog && b.alwaysOnTop;
30694
+ if (at) {
30695
+ return bt ? 0 : +1;
30696
+ }
30697
+ else {
30698
+ return bt ? -1 : 0;
30699
+ }
30700
+ };
30662
30701
  DDialog.prototype.onPrerender = function () {
30663
30702
  var _a;
30664
30703
  var layer = this._layer;
@@ -30754,6 +30793,13 @@
30754
30793
  this.visible = false;
30755
30794
  this.onAnimationEnd(true);
30756
30795
  }
30796
+ // Always On Top
30797
+ if (this._alwaysOnTop) {
30798
+ var parent_3 = this.parent;
30799
+ if (parent_3 != null) {
30800
+ parent_3.off("childAdded", this._onParentChildAddedBound);
30801
+ }
30802
+ }
30757
30803
  this.emit("close", this);
30758
30804
  };
30759
30805
  DDialog.prototype.onKeyDown = function (e) {