@wcardinal/wcardinal-ui 0.445.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 (38) hide show
  1. package/README.md +24 -28
  2. package/dist/types/wcardinal/ui/d-base-state-set-impl.d.ts +3 -1
  3. package/dist/types/wcardinal/ui/d-base-state-set.d.ts +3 -1
  4. package/dist/types/wcardinal/ui/d-dialog.d.ts +9 -1
  5. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog.d.ts +1 -0
  6. package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog.d.ts +1 -0
  7. package/dist/wcardinal/ui/d-base-state-set-impl.js +9 -1
  8. package/dist/wcardinal/ui/d-base-state-set-impl.js.map +1 -1
  9. package/dist/wcardinal/ui/d-base-state-set.js.map +1 -1
  10. package/dist/wcardinal/ui/d-dialog.js +48 -2
  11. package/dist/wcardinal/ui/d-dialog.js.map +1 -1
  12. package/dist/wcardinal/ui/d-table.js +2 -1
  13. package/dist/wcardinal/ui/d-table.js.map +1 -1
  14. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js +3 -0
  15. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog.js.map +1 -1
  16. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js +3 -0
  17. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog.js.map +1 -1
  18. package/dist/wcardinal-ui-theme-dark-en-us.js +4 -1
  19. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  20. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  21. package/dist/wcardinal-ui-theme-dark-ja-jp.js +4 -1
  22. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  23. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  24. package/dist/wcardinal-ui-theme-dark.js +4 -1
  25. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  26. package/dist/wcardinal-ui-theme-white-en-us.js +4 -1
  27. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  28. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  29. package/dist/wcardinal-ui-theme-white-ja-jp.js +4 -1
  30. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  31. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  32. package/dist/wcardinal-ui-theme-white.js +4 -1
  33. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  34. package/dist/wcardinal-ui.cjs.js +66 -5
  35. package/dist/wcardinal-ui.js +60 -5
  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
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.445.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
 
@@ -3269,11 +3269,19 @@ var DBaseStateSetImpl = /** @class */ (function () {
3269
3269
  DBaseStateSetImpl.prototype.valueOf = function (state, def) {
3270
3270
  var result = this._local.get(state);
3271
3271
  if (result !== undefined) {
3272
+ if (result == null && def !== undefined) {
3273
+ return def;
3274
+ }
3272
3275
  return result;
3273
3276
  }
3274
3277
  var parent = this._parent;
3275
3278
  if (parent != null) {
3276
- return parent.valueOf(state, def);
3279
+ if (def !== undefined) {
3280
+ return parent.valueOf(state, def);
3281
+ }
3282
+ else {
3283
+ return parent.valueOf(state);
3284
+ }
3277
3285
  }
3278
3286
  return def;
3279
3287
  };
@@ -30408,7 +30416,7 @@ var DDialog = /** @class */ (function (_super) {
30408
30416
  }
30409
30417
  DDialog.prototype.init = function (options) {
30410
30418
  var _this = this;
30411
- var _a, _b;
30419
+ var _a, _b, _c;
30412
30420
  _super.prototype.init.call(this, options);
30413
30421
  this._onPrerenderBound = function () {
30414
30422
  _this.onPrerender();
@@ -30418,8 +30426,10 @@ var DDialog = /** @class */ (function (_super) {
30418
30426
  var theme = this.theme;
30419
30427
  var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getMode(), DDialogMode);
30420
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();
30421
30431
  // Sticky
30422
- 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);
30423
30433
  // Close On
30424
30434
  var closeOn = this.toCloseOn(mode, theme, options);
30425
30435
  this._closeOn = closeOn;
@@ -30500,6 +30510,16 @@ var DDialog = /** @class */ (function (_super) {
30500
30510
  enumerable: false,
30501
30511
  configurable: true
30502
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
+ });
30503
30523
  Object.defineProperty(DDialog.prototype, "gesture", {
30504
30524
  get: function () {
30505
30525
  return this._gesture;
@@ -30606,6 +30626,7 @@ var DDialog = /** @class */ (function (_super) {
30606
30626
  */
30607
30627
  DDialog.prototype.open = function (opener) {
30608
30628
  var _this = this;
30629
+ var _a;
30609
30630
  var result = this._promise;
30610
30631
  if (result == null) {
30611
30632
  result = new Promise(function (resolve, reject) {
@@ -30649,11 +30670,37 @@ var DDialog = /** @class */ (function (_super) {
30649
30670
  gesture.constraint(this, layer, position.x, position.y);
30650
30671
  }
30651
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
+ }
30652
30683
  // Done
30653
30684
  this.onOpen();
30654
30685
  }
30655
30686
  return result;
30656
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
+ };
30657
30704
  DDialog.prototype.onPrerender = function () {
30658
30705
  var _a;
30659
30706
  var layer = this._layer;
@@ -30749,6 +30796,13 @@ var DDialog = /** @class */ (function (_super) {
30749
30796
  this.visible = false;
30750
30797
  this.onAnimationEnd(true);
30751
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
+ }
30752
30806
  this.emit("close", this);
30753
30807
  };
30754
30808
  DDialog.prototype.onKeyDown = function (e) {
@@ -53954,6 +54008,9 @@ var DThemeWhiteDialog = /** @class */ (function (_super) {
53954
54008
  DThemeWhiteDialog.prototype.isSticky = function (mode) {
53955
54009
  return false;
53956
54010
  };
54011
+ DThemeWhiteDialog.prototype.isAlwaysOnTop = function () {
54012
+ return false;
54013
+ };
53957
54014
  DThemeWhiteDialog.prototype.isGestureEnabled = function (mode) {
53958
54015
  switch (mode) {
53959
54016
  case DDialogMode.MODAL:
@@ -65040,6 +65097,9 @@ var DThemeDarkDialog = /** @class */ (function (_super) {
65040
65097
  DThemeDarkDialog.prototype.isSticky = function (mode) {
65041
65098
  return false;
65042
65099
  };
65100
+ DThemeDarkDialog.prototype.isAlwaysOnTop = function () {
65101
+ return false;
65102
+ };
65043
65103
  DThemeDarkDialog.prototype.isGestureEnabled = function (mode) {
65044
65104
  switch (mode) {
65045
65105
  case DDialogMode.MODAL:
@@ -100078,7 +100138,8 @@ var DTable = /** @class */ (function (_super) {
100078
100138
  });
100079
100139
  Object.defineProperty(DTable.prototype, "category", {
100080
100140
  get: function () {
100081
- return (this._category = this.newCategory());
100141
+ var _a;
100142
+ return ((_a = this._category) !== null && _a !== void 0 ? _a : (this._category = this.newCategory()));
100082
100143
  },
100083
100144
  enumerable: false,
100084
100145
  configurable: true
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.445.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
 
@@ -3266,11 +3266,19 @@
3266
3266
  DBaseStateSetImpl.prototype.valueOf = function (state, def) {
3267
3267
  var result = this._local.get(state);
3268
3268
  if (result !== undefined) {
3269
+ if (result == null && def !== undefined) {
3270
+ return def;
3271
+ }
3269
3272
  return result;
3270
3273
  }
3271
3274
  var parent = this._parent;
3272
3275
  if (parent != null) {
3273
- return parent.valueOf(state, def);
3276
+ if (def !== undefined) {
3277
+ return parent.valueOf(state, def);
3278
+ }
3279
+ else {
3280
+ return parent.valueOf(state);
3281
+ }
3274
3282
  }
3275
3283
  return def;
3276
3284
  };
@@ -30405,7 +30413,7 @@
30405
30413
  }
30406
30414
  DDialog.prototype.init = function (options) {
30407
30415
  var _this = this;
30408
- var _a, _b;
30416
+ var _a, _b, _c;
30409
30417
  _super.prototype.init.call(this, options);
30410
30418
  this._onPrerenderBound = function () {
30411
30419
  _this.onPrerender();
@@ -30415,8 +30423,10 @@
30415
30423
  var theme = this.theme;
30416
30424
  var mode = toEnum((_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : theme.getMode(), DDialogMode);
30417
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();
30418
30428
  // Sticky
30419
- 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);
30420
30430
  // Close On
30421
30431
  var closeOn = this.toCloseOn(mode, theme, options);
30422
30432
  this._closeOn = closeOn;
@@ -30497,6 +30507,16 @@
30497
30507
  enumerable: false,
30498
30508
  configurable: true
30499
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
+ });
30500
30520
  Object.defineProperty(DDialog.prototype, "gesture", {
30501
30521
  get: function () {
30502
30522
  return this._gesture;
@@ -30603,6 +30623,7 @@
30603
30623
  */
30604
30624
  DDialog.prototype.open = function (opener) {
30605
30625
  var _this = this;
30626
+ var _a;
30606
30627
  var result = this._promise;
30607
30628
  if (result == null) {
30608
30629
  result = new Promise(function (resolve, reject) {
@@ -30646,11 +30667,37 @@
30646
30667
  gesture.constraint(this, layer, position.x, position.y);
30647
30668
  }
30648
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
+ }
30649
30680
  // Done
30650
30681
  this.onOpen();
30651
30682
  }
30652
30683
  return result;
30653
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
+ };
30654
30701
  DDialog.prototype.onPrerender = function () {
30655
30702
  var _a;
30656
30703
  var layer = this._layer;
@@ -30746,6 +30793,13 @@
30746
30793
  this.visible = false;
30747
30794
  this.onAnimationEnd(true);
30748
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
+ }
30749
30803
  this.emit("close", this);
30750
30804
  };
30751
30805
  DDialog.prototype.onKeyDown = function (e) {
@@ -78908,7 +78962,8 @@
78908
78962
  });
78909
78963
  Object.defineProperty(DTable.prototype, "category", {
78910
78964
  get: function () {
78911
- return (this._category = this.newCategory());
78965
+ var _a;
78966
+ return ((_a = this._category) !== null && _a !== void 0 ? _a : (this._category = this.newCategory()));
78912
78967
  },
78913
78968
  enumerable: false,
78914
78969
  configurable: true