@wcardinal/wcardinal-ui 0.386.0 → 0.388.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 (63) hide show
  1. package/dist/types/wcardinal/ui/d-button-select.d.ts +1 -1
  2. package/dist/types/wcardinal/ui/d-dialog-select.d.ts +14 -6
  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/index.d.ts +0 -2
  6. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.d.ts +2 -0
  7. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-select.d.ts +1 -0
  8. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-select.d.ts +1 -0
  9. package/dist/types/wcardinal/ui/theme/white/d-theme-white-dialog-select.d.ts +2 -0
  10. package/dist/types/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-select.d.ts +1 -0
  11. package/dist/types/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-select.d.ts +1 -0
  12. package/dist/types/wcardinal/ui/util/util-overlay.d.ts +1 -1
  13. package/dist/wcardinal/ui/d-button-select.js.map +1 -1
  14. package/dist/wcardinal/ui/d-dialog-select.js +77 -97
  15. package/dist/wcardinal/ui/d-dialog-select.js.map +1 -1
  16. package/dist/wcardinal/ui/d-dialog.js +6 -3
  17. package/dist/wcardinal/ui/d-dialog.js.map +1 -1
  18. package/dist/wcardinal/ui/d-menu-opener.js.map +1 -1
  19. package/dist/wcardinal/ui/d-menu.js +1 -1
  20. package/dist/wcardinal/ui/d-menu.js.map +1 -1
  21. package/dist/wcardinal/ui/index.js +0 -2
  22. package/dist/wcardinal/ui/index.js.map +1 -1
  23. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js +3 -0
  24. package/dist/wcardinal/ui/theme/dark/d-theme-dark-dialog-select.js.map +1 -1
  25. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-select.js +3 -0
  26. package/dist/wcardinal/ui/theme/dark/d-theme-dark-en-us-dialog-select.js.map +1 -1
  27. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-select.js +3 -0
  28. package/dist/wcardinal/ui/theme/dark/d-theme-dark-ja-jp-dialog-select.js.map +1 -1
  29. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js +3 -0
  30. package/dist/wcardinal/ui/theme/white/d-theme-white-dialog-select.js.map +1 -1
  31. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-select.js +3 -0
  32. package/dist/wcardinal/ui/theme/white/d-theme-white-en-us-dialog-select.js.map +1 -1
  33. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-select.js +3 -0
  34. package/dist/wcardinal/ui/theme/white/d-theme-white-ja-jp-dialog-select.js.map +1 -1
  35. package/dist/wcardinal/ui/util/util-overlay.js +6 -3
  36. package/dist/wcardinal/ui/util/util-overlay.js.map +1 -1
  37. package/dist/wcardinal-ui-theme-dark-en-us.js +7 -1
  38. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  39. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  40. package/dist/wcardinal-ui-theme-dark-ja-jp.js +7 -1
  41. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  42. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  43. package/dist/wcardinal-ui-theme-dark.js +7 -1
  44. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  45. package/dist/wcardinal-ui-theme-white-en-us.js +7 -1
  46. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  47. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  48. package/dist/wcardinal-ui-theme-white-ja-jp.js +7 -1
  49. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  50. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  51. package/dist/wcardinal-ui-theme-white.js +7 -1
  52. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  53. package/dist/wcardinal-ui.cjs.js +108 -163
  54. package/dist/wcardinal-ui.js +90 -163
  55. package/dist/wcardinal-ui.min.js +2 -2
  56. package/dist/wcardinal-ui.min.js.map +1 -1
  57. package/package.json +1 -1
  58. package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable-impl.d.ts +0 -14
  59. package/dist/types/wcardinal/ui/d-dialog-select-search-dismissable.d.ts +0 -11
  60. package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js +0 -61
  61. package/dist/wcardinal/ui/d-dialog-select-search-dismissable-impl.js.map +0 -1
  62. package/dist/wcardinal/ui/d-dialog-select-search-dismissable.js +0 -6
  63. package/dist/wcardinal/ui/d-dialog-select-search-dismissable.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.386.0
2
+ Winter Cardinal UI v0.388.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -26301,11 +26301,14 @@
26301
26301
  enumerable: false,
26302
26302
  configurable: true
26303
26303
  });
26304
- UtilOverlay.prototype.pick = function (target) {
26304
+ UtilOverlay.prototype.pick = function (owner, opener) {
26305
26305
  var layer = this._layer;
26306
26306
  if (layer == null) {
26307
- layer = DApplications.getLayerOverlay(target);
26308
- if (!layer) {
26307
+ layer = DApplications.getLayerOverlay(owner);
26308
+ if (layer == null && opener != null) {
26309
+ layer = DApplications.getLayerOverlay(opener);
26310
+ }
26311
+ if (layer == null) {
26309
26312
  var application = this._application;
26310
26313
  if (application) {
26311
26314
  layer = application.getLayerOverlay();
@@ -26330,8 +26333,11 @@
26330
26333
  *
26331
26334
  * If multiple application instances are there, better to set the constructor
26332
26335
  * option `parent` to an `application.stage` so that the dialog picks a right
26333
- * application. By default, the dialog assumes the last created application is
26334
- * 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.
26335
26341
  */
26336
26342
  var DDialog = /** @class */ (function (_super) {
26337
26343
  __extends(DDialog, _super);
@@ -26551,7 +26557,7 @@
26551
26557
  switch (this._mode) {
26552
26558
  case DDialogMode.MODAL:
26553
26559
  case DDialogMode.MENU:
26554
- layer = this._overlay.pick(this);
26560
+ layer = this._overlay.pick(this, opener);
26555
26561
  layer.stage.addChild(this);
26556
26562
  break;
26557
26563
  case DDialogMode.MODELESS:
@@ -50180,7 +50186,7 @@
50180
50186
  DMenu.prototype.open = function (owner, closeable, context) {
50181
50187
  var _a;
50182
50188
  if (this.isHidden()) {
50183
- var layer = this._overlay.pick(this);
50189
+ var layer = this._overlay.pick(this, owner);
50184
50190
  this._owner = owner;
50185
50191
  // States
50186
50192
  var children = this.children;
@@ -55287,64 +55293,6 @@
55287
55293
  return DNoteSmallSearching;
55288
55294
  }(DNoteSmall));
55289
55295
 
55290
- /*
55291
- * Copyright (C) 2019 Toshiba Corporation
55292
- * SPDX-License-Identifier: Apache-2.0
55293
- */
55294
- var DDialogSelectSearhDismissableImpl = /** @class */ (function (_super) {
55295
- __extends(DDialogSelectSearhDismissableImpl, _super);
55296
- function DDialogSelectSearhDismissableImpl(target, options) {
55297
- var _this = _super.call(this) || this;
55298
- _this._target = target;
55299
- _this._value = options.value;
55300
- _this._filter = options.filter;
55301
- target.on("change", function () {
55302
- _this.emit("change", _this);
55303
- });
55304
- target.on("success", function (e, values) {
55305
- _this.emit("success", _this, _this.toDismissable(values));
55306
- });
55307
- target.on("fail", function () {
55308
- _this.emit("fail", _this);
55309
- });
55310
- return _this;
55311
- }
55312
- DDialogSelectSearhDismissableImpl.prototype.toDismissValue = function (args) {
55313
- if (args == null) {
55314
- return;
55315
- }
55316
- var value = this._value;
55317
- if (value === undefined) {
55318
- return;
55319
- }
55320
- var filter = this._filter;
55321
- if (filter != null && !filter(value, args[0])) {
55322
- return;
55323
- }
55324
- return value;
55325
- };
55326
- DDialogSelectSearhDismissableImpl.prototype.toDismissable = function (values) {
55327
- var value = this.toDismissValue(this._args);
55328
- if (value === undefined) {
55329
- return values;
55330
- }
55331
- var result = [];
55332
- for (var i = 0, imax = values.length; i < imax; ++i) {
55333
- result.push(values[i]);
55334
- }
55335
- result.push(value);
55336
- return result;
55337
- };
55338
- DDialogSelectSearhDismissableImpl.prototype.create = function (args) {
55339
- this._args = args;
55340
- this._target.create(args);
55341
- };
55342
- DDialogSelectSearhDismissableImpl.prototype.isDone = function () {
55343
- return this._target.isDone();
55344
- };
55345
- return DDialogSelectSearhDismissableImpl;
55346
- }(pixi_js.utils.EventEmitter));
55347
-
55348
55296
  /*
55349
55297
  * Copyright (C) 2019 Toshiba Corporation
55350
55298
  * SPDX-License-Identifier: Apache-2.0
@@ -55390,17 +55338,13 @@
55390
55338
  }
55391
55339
  DDialogSelect.prototype.newContentChildren = function (theme, options) {
55392
55340
  var result = _super.prototype.newContentChildren.call(this, theme, options);
55393
- result.push(this.inputLayout, this.list);
55341
+ result.push(this.inputLayout, this.list, this.buttonDismiss);
55394
55342
  return result;
55395
55343
  };
55396
55344
  Object.defineProperty(DDialogSelect.prototype, "inputLayout", {
55397
55345
  get: function () {
55398
- var result = this._inputLayout;
55399
- if (result == null) {
55400
- result = this.newInputLayout();
55401
- this._inputLayout = result;
55402
- }
55403
- return result;
55346
+ var _a;
55347
+ return ((_a = this._inputLayout) !== null && _a !== void 0 ? _a : (this._inputLayout = this.newInputLayout()));
55404
55348
  },
55405
55349
  enumerable: false,
55406
55350
  configurable: true
@@ -55409,33 +55353,9 @@
55409
55353
  return new DLayoutHorizontal({
55410
55354
  width: "padding",
55411
55355
  height: "auto",
55412
- children: [this.spaceLeft, this.selectCategory, this.input, this.spaceRight]
55356
+ children: [this.selectCategory, this.input]
55413
55357
  });
55414
55358
  };
55415
- Object.defineProperty(DDialogSelect.prototype, "spaceLeft", {
55416
- get: function () {
55417
- var result = this._spaceLeft;
55418
- if (result == null) {
55419
- result = this.newSpace();
55420
- this._spaceLeft = result;
55421
- }
55422
- return result;
55423
- },
55424
- enumerable: false,
55425
- configurable: true
55426
- });
55427
- Object.defineProperty(DDialogSelect.prototype, "spaceRight", {
55428
- get: function () {
55429
- var result = this._spaceRight;
55430
- if (result == null) {
55431
- result = this.newSpace();
55432
- this._spaceRight = result;
55433
- }
55434
- return result;
55435
- },
55436
- enumerable: false,
55437
- configurable: true
55438
- });
55439
55359
  DDialogSelect.prototype.newSpace = function () {
55440
55360
  return new DLayoutSpace({
55441
55361
  width: this.toInputMargin(this.theme, this._options)
@@ -55443,12 +55363,8 @@
55443
55363
  };
55444
55364
  Object.defineProperty(DDialogSelect.prototype, "selectCategory", {
55445
55365
  get: function () {
55446
- var result = this._selectCategory;
55447
- if (result == null) {
55448
- result = this.newSelectCategory();
55449
- this._selectCategory = result;
55450
- }
55451
- return result;
55366
+ var _a;
55367
+ return ((_a = this._selectCategory) !== null && _a !== void 0 ? _a : (this._selectCategory = this.newSelectCategory()));
55452
55368
  },
55453
55369
  enumerable: false,
55454
55370
  configurable: true
@@ -55476,12 +55392,8 @@
55476
55392
  };
55477
55393
  Object.defineProperty(DDialogSelect.prototype, "input", {
55478
55394
  get: function () {
55479
- var result = this._input;
55480
- if (result == null) {
55481
- result = this.newInput();
55482
- this._input = result;
55483
- }
55484
- return result;
55395
+ var _a;
55396
+ return ((_a = this._input) !== null && _a !== void 0 ? _a : (this._input = this.newInput()));
55485
55397
  },
55486
55398
  enumerable: false,
55487
55399
  configurable: true
@@ -55515,12 +55427,8 @@
55515
55427
  };
55516
55428
  Object.defineProperty(DDialogSelect.prototype, "list", {
55517
55429
  get: function () {
55518
- var result = this._list;
55519
- if (result == null) {
55520
- result = this.newList();
55521
- this._list = result;
55522
- }
55523
- return result;
55430
+ var _a;
55431
+ return ((_a = this._list) !== null && _a !== void 0 ? _a : (this._list = this.newList()));
55524
55432
  },
55525
55433
  enumerable: false,
55526
55434
  configurable: true
@@ -55538,15 +55446,6 @@
55538
55446
  if (selected == null) {
55539
55447
  return;
55540
55448
  }
55541
- var options = this._options;
55542
- if (options) {
55543
- var dismiss = options.dismiss;
55544
- if (dismiss) {
55545
- if (selected === dismiss.value) {
55546
- selected = null;
55547
- }
55548
- }
55549
- }
55550
55449
  this._value = selected;
55551
55450
  this.onOk(selected);
55552
55451
  };
@@ -55559,12 +55458,8 @@
55559
55458
  };
55560
55459
  Object.defineProperty(DDialogSelect.prototype, "noteError", {
55561
55460
  get: function () {
55562
- var result = this._noteError;
55563
- if (result == null) {
55564
- result = this.newNoteError();
55565
- this._noteError = result;
55566
- }
55567
- return result;
55461
+ var _a;
55462
+ return ((_a = this._noteError) !== null && _a !== void 0 ? _a : (this._noteError = this.newNoteError()));
55568
55463
  },
55569
55464
  enumerable: false,
55570
55465
  configurable: true
@@ -55579,12 +55474,8 @@
55579
55474
  };
55580
55475
  Object.defineProperty(DDialogSelect.prototype, "noteNoItemsFound", {
55581
55476
  get: function () {
55582
- var result = this._noteNoItemsFound;
55583
- if (result == null) {
55584
- result = this.newNoteNoItemsFound();
55585
- this._noteNoItemsFound = result;
55586
- }
55587
- return result;
55477
+ var _a;
55478
+ return ((_a = this._noteNoItemsFound) !== null && _a !== void 0 ? _a : (this._noteNoItemsFound = this.newNoteNoItemsFound()));
55588
55479
  },
55589
55480
  enumerable: false,
55590
55481
  configurable: true
@@ -55599,12 +55490,8 @@
55599
55490
  };
55600
55491
  Object.defineProperty(DDialogSelect.prototype, "noteSearching", {
55601
55492
  get: function () {
55602
- var result = this._noteSearching;
55603
- if (result == null) {
55604
- result = this.newNoteSearching();
55605
- this._noteSearching = result;
55606
- }
55607
- return result;
55493
+ var _a;
55494
+ return ((_a = this._noteSearching) !== null && _a !== void 0 ? _a : (this._noteSearching = this.newNoteSearching()));
55608
55495
  },
55609
55496
  enumerable: false,
55610
55497
  configurable: true
@@ -55637,12 +55524,8 @@
55637
55524
  };
55638
55525
  Object.defineProperty(DDialogSelect.prototype, "search", {
55639
55526
  get: function () {
55640
- var result = this._search;
55641
- if (result == null) {
55642
- result = this.newSearch();
55643
- this._search = result;
55644
- }
55645
- return result;
55527
+ var _a;
55528
+ return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = this.newSearch()));
55646
55529
  },
55647
55530
  enumerable: false,
55648
55531
  configurable: true
@@ -55652,28 +55535,73 @@
55652
55535
  if (options) {
55653
55536
  var controller = options.controller;
55654
55537
  if (controller) {
55655
- var dismiss = options.dismiss;
55656
55538
  var search = controller.search;
55657
55539
  if ("create" in search) {
55658
- if (dismiss != null) {
55659
- return new DDialogSelectSearhDismissableImpl(search, dismiss);
55660
- }
55661
- else {
55662
- return search;
55663
- }
55540
+ return search;
55664
55541
  }
55665
55542
  else {
55666
- if (dismiss != null) {
55667
- return new DDialogSelectSearhDismissableImpl(new DDialogSelectSearhImpl(search), dismiss);
55668
- }
55669
- else {
55670
- return new DDialogSelectSearhImpl(search);
55671
- }
55543
+ return new DDialogSelectSearhImpl(search);
55672
55544
  }
55673
55545
  }
55674
55546
  }
55675
55547
  return new DDialogSelectSearhImpl();
55676
55548
  };
55549
+ Object.defineProperty(DDialogSelect.prototype, "buttonDismiss", {
55550
+ get: function () {
55551
+ var result = this._buttonDismiss;
55552
+ if (result === undefined) {
55553
+ result = this.newButtonDismiss();
55554
+ this._buttonDismiss = result;
55555
+ }
55556
+ return result;
55557
+ },
55558
+ enumerable: false,
55559
+ configurable: true
55560
+ });
55561
+ DDialogSelect.prototype.newButtonDismiss = function () {
55562
+ var _this = this;
55563
+ var options = this.toButtonDismissOptions(this._options);
55564
+ if (options.enabled === true) {
55565
+ var result = new DButton(options);
55566
+ result.on("active", function () {
55567
+ _this._value = null;
55568
+ _this.onOk(null);
55569
+ });
55570
+ return result;
55571
+ }
55572
+ return null;
55573
+ };
55574
+ DDialogSelect.prototype.toButtonDismissOptions = function (options) {
55575
+ var theme = this.theme;
55576
+ if (options != null) {
55577
+ var dismiss = options.dismiss;
55578
+ if (dismiss != null) {
55579
+ if (dismiss.enabled === undefined) {
55580
+ dismiss.enabled = theme.isDismissable();
55581
+ }
55582
+ if (dismiss.weight === undefined && dismiss.width === undefined) {
55583
+ dismiss.width = "padding";
55584
+ }
55585
+ var text = dismiss.text;
55586
+ if (text === undefined) {
55587
+ dismiss.text = {
55588
+ value: theme.getDismissLabel()
55589
+ };
55590
+ }
55591
+ else if (text.value === undefined) {
55592
+ text.value = theme.getDismissLabel();
55593
+ }
55594
+ return dismiss;
55595
+ }
55596
+ }
55597
+ return {
55598
+ width: "padding",
55599
+ enabled: theme.isDismissable(),
55600
+ text: {
55601
+ value: theme.getDismissLabel()
55602
+ }
55603
+ };
55604
+ };
55677
55605
  Object.defineProperty(DDialogSelect.prototype, "value", {
55678
55606
  get: function () {
55679
55607
  return this._value;
@@ -76577,7 +76505,6 @@
76577
76505
  DDialogSelectListItemUpdater: DDialogSelectListItemUpdater,
76578
76506
  DDialogSelectListItem: DDialogSelectListItem,
76579
76507
  DDialogSelectList: DDialogSelectList,
76580
- DDialogSelectSearhDismissableImpl: DDialogSelectSearhDismissableImpl,
76581
76508
  DDialogSelectSearhImpl: DDialogSelectSearhImpl,
76582
76509
  DDialogSelect: DDialogSelect,
76583
76510
  DDialogState: DDialogState,