@wcardinal/wcardinal-ui 0.368.0 → 0.370.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.368.0
2
+ Winter Cardinal UI v0.370.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -25932,12 +25932,16 @@
25932
25932
  BOTTOM_LEFT: 13,
25933
25933
  BOTTOM_CENTER: 14,
25934
25934
  BOTTOM_RIGHT: 15,
25935
- OVER: 16
25935
+ OVER: 16,
25936
+ NONE: 17
25936
25937
  };
25937
25938
  var UtilAttach = /** @class */ (function () {
25938
25939
  function UtilAttach() {
25939
25940
  }
25940
25941
  UtilAttach.attach = function (target, bounds, offsetX, offsetY, clippingWidth, clippingHeight, align) {
25942
+ if (align === UtilAttachAlign.NONE) {
25943
+ return;
25944
+ }
25941
25945
  var width = target.width;
25942
25946
  var height = target.height;
25943
25947
  var x = 0;
@@ -26553,6 +26557,9 @@
26553
26557
  return;
26554
26558
  }
26555
26559
  var align = this._align;
26560
+ if (align === UtilAttachAlign.NONE) {
26561
+ return;
26562
+ }
26556
26563
  var opener = this._opener;
26557
26564
  if (align != null && opener != null) {
26558
26565
  var mode = this._mode;
@@ -48538,6 +48545,8 @@
48538
48545
  width = bbox.width;
48539
48546
  height = bbox.height;
48540
48547
  }
48548
+ this._isWidthFixed = options.width != null;
48549
+ this._isHeightFixed = options.height != null;
48541
48550
  // Background color
48542
48551
  var background = options === null || options === void 0 ? void 0 : options.background;
48543
48552
  var backgroundColor = 0;
@@ -48606,6 +48615,23 @@
48606
48615
  this._pixi.width = width;
48607
48616
  return this;
48608
48617
  };
48618
+ /**
48619
+ * Returns true if the width is fixed.
48620
+ *
48621
+ * @returns true if the width is fixed.
48622
+ */
48623
+ DApplicationLayerOptions.prototype.isWidthFixed = function () {
48624
+ return this._isWidthFixed;
48625
+ };
48626
+ /**
48627
+ * Makes the canvas width fixed.
48628
+ *
48629
+ * @param fixed true to make the canvas width fixed
48630
+ */
48631
+ DApplicationLayerOptions.prototype.setWidthFixed = function (fixed) {
48632
+ this._isWidthFixed = fixed;
48633
+ return this;
48634
+ };
48609
48635
  /**
48610
48636
  * Returns a canvas height.
48611
48637
  */
@@ -48621,6 +48647,23 @@
48621
48647
  this._pixi.height = height;
48622
48648
  return this;
48623
48649
  };
48650
+ /**
48651
+ * Returns true if the height is fixed.
48652
+ *
48653
+ * @returns true if the height is fixed.
48654
+ */
48655
+ DApplicationLayerOptions.prototype.isHeightFixed = function () {
48656
+ return this._isHeightFixed;
48657
+ };
48658
+ /**
48659
+ * Makes the canvas height fixed.
48660
+ *
48661
+ * @param fixed true to make the canvas height fixed
48662
+ */
48663
+ DApplicationLayerOptions.prototype.setHeightFixed = function (fixed) {
48664
+ this._isHeightFixed = fixed;
48665
+ return this;
48666
+ };
48624
48667
  /**
48625
48668
  * Returns padding sizes.
48626
48669
  * The default padding size is 6.
@@ -49142,23 +49185,34 @@
49142
49185
  };
49143
49186
  DApplicationLayer.prototype.initResizeHandling = function () {
49144
49187
  var _this = this;
49145
- var onResizeBound = function () {
49146
- _this.onResize();
49147
- };
49148
- window.addEventListener("resize", onResizeBound);
49149
- window.addEventListener("orientationchange", onResizeBound);
49188
+ var options = this._options;
49189
+ var isWidthFixed = options.isWidthFixed();
49190
+ var isHeightFixed = options.isHeightFixed();
49191
+ if (!isWidthFixed || !isHeightFixed) {
49192
+ var onResizeBound = function () {
49193
+ _this.onResize();
49194
+ };
49195
+ if (window.ResizeObserver != null) {
49196
+ new ResizeObserver(onResizeBound).observe(this._rootElement);
49197
+ }
49198
+ else {
49199
+ window.addEventListener("resize", onResizeBound);
49200
+ window.addEventListener("orientationchange", onResizeBound);
49201
+ }
49202
+ }
49150
49203
  };
49151
49204
  DApplicationLayer.prototype.onResize = function () {
49205
+ var options = this._options;
49152
49206
  var bbox = this._rootElement.getBoundingClientRect();
49153
- var bboxWidth = bbox.width;
49154
- var bboxHeight = bbox.height;
49155
- this.renderer.resize(bboxWidth, bboxHeight);
49207
+ var newWidth = options.isWidthFixed() ? options.getWidth() : bbox.width;
49208
+ var newHeight = options.isHeightFixed() ? options.getHeight() : bbox.height;
49209
+ this.renderer.resize(newWidth, newHeight);
49156
49210
  var padding = this._padding;
49157
49211
  var children = this.stage.children;
49158
49212
  for (var i = 0, imax = children.length; i < imax; ++i) {
49159
49213
  var child = children[i];
49160
49214
  if (child instanceof DBase) {
49161
- child.onParentResize(bboxWidth, bboxHeight, padding);
49215
+ child.onParentResize(newWidth, newHeight, padding);
49162
49216
  }
49163
49217
  }
49164
49218
  this.update();
@@ -71586,10 +71640,10 @@
71586
71640
  enumerable: false,
71587
71641
  configurable: true
71588
71642
  });
71589
- DTableDataList.prototype.update = function () {
71643
+ DTableDataList.prototype.update = function (forcibly) {
71590
71644
  var parent = this._parent;
71591
71645
  if (parent) {
71592
- parent.update();
71646
+ parent.update(forcibly);
71593
71647
  }
71594
71648
  };
71595
71649
  DTableDataList.prototype.lock = function () {
@@ -71598,11 +71652,10 @@
71598
71652
  parent.lock();
71599
71653
  }
71600
71654
  };
71601
- DTableDataList.prototype.unlock = function () {
71655
+ DTableDataList.prototype.unlock = function (callIfNeeded) {
71602
71656
  var parent = this._parent;
71603
71657
  if (parent) {
71604
- parent.unlock(false);
71605
- parent.update();
71658
+ parent.unlock(callIfNeeded);
71606
71659
  }
71607
71660
  };
71608
71661
  DTableDataList.prototype.size = function () {
@@ -71616,7 +71669,8 @@
71616
71669
  this._selection.clear();
71617
71670
  this._sorter.toDirty();
71618
71671
  this._filter.toDirty();
71619
- this.unlock();
71672
+ this.update();
71673
+ this.unlock(true);
71620
71674
  }
71621
71675
  };
71622
71676
  DTableDataList.prototype.clearAndAdd = function (row) {
@@ -71627,7 +71681,8 @@
71627
71681
  this._selection.clear();
71628
71682
  this._sorter.toDirty();
71629
71683
  this._filter.toDirty();
71630
- this.unlock();
71684
+ this.update();
71685
+ this.unlock(true);
71631
71686
  };
71632
71687
  DTableDataList.prototype.clearAndAddAll = function (newRows) {
71633
71688
  var rows = this._rows;
@@ -71639,7 +71694,8 @@
71639
71694
  this._selection.clear();
71640
71695
  this._sorter.toDirty();
71641
71696
  this._filter.toDirty();
71642
- this.unlock();
71697
+ this.update();
71698
+ this.unlock(true);
71643
71699
  };
71644
71700
  DTableDataList.prototype.add = function (row, index) {
71645
71701
  var rows = this._rows;
@@ -71651,7 +71707,8 @@
71651
71707
  this.lock();
71652
71708
  sorter.toDirty();
71653
71709
  filter.toDirty();
71654
- this.unlock();
71710
+ this.update();
71711
+ this.unlock(true);
71655
71712
  }
71656
71713
  else if (0 <= index && index < rows.length) {
71657
71714
  rows.splice(index, 0, row);
@@ -71659,7 +71716,8 @@
71659
71716
  selection.shift(index, 1);
71660
71717
  sorter.toDirty();
71661
71718
  filter.toDirty();
71662
- this.unlock();
71719
+ this.update();
71720
+ this.unlock(true);
71663
71721
  }
71664
71722
  };
71665
71723
  DTableDataList.prototype.addAll = function (newRows, index) {
@@ -71676,7 +71734,8 @@
71676
71734
  this.lock();
71677
71735
  sorter.toDirty();
71678
71736
  filter.toDirty();
71679
- this.unlock();
71737
+ this.update();
71738
+ this.unlock(true);
71680
71739
  }
71681
71740
  else if (0 <= index && index < rowsLength) {
71682
71741
  var newRowsLength = newRows.length;
@@ -71687,7 +71746,8 @@
71687
71746
  selection.shift(index, newRowsLength);
71688
71747
  sorter.toDirty();
71689
71748
  filter.toDirty();
71690
- this.unlock();
71749
+ this.update();
71750
+ this.unlock(true);
71691
71751
  }
71692
71752
  };
71693
71753
  DTableDataList.prototype.get = function (index) {
@@ -71705,7 +71765,8 @@
71705
71765
  this.lock();
71706
71766
  this._sorter.toDirty();
71707
71767
  this._filter.toDirty();
71708
- this.unlock();
71768
+ this.update();
71769
+ this.unlock(true);
71709
71770
  return result;
71710
71771
  }
71711
71772
  return null;
@@ -71718,7 +71779,8 @@
71718
71779
  this._selection.remove(index);
71719
71780
  this._sorter.toDirty();
71720
71781
  this._filter.toDirty();
71721
- this.unlock();
71782
+ this.update();
71783
+ this.unlock(true);
71722
71784
  return result;
71723
71785
  }
71724
71786
  return null;
@@ -73056,6 +73118,18 @@
73056
73118
  parent.update(forcibly);
73057
73119
  }
73058
73120
  };
73121
+ DTableDataTree.prototype.lock = function () {
73122
+ var parent = this._parent;
73123
+ if (parent) {
73124
+ parent.lock();
73125
+ }
73126
+ };
73127
+ DTableDataTree.prototype.unlock = function (callIfNeeded) {
73128
+ var parent = this._parent;
73129
+ if (parent) {
73130
+ parent.unlock(callIfNeeded);
73131
+ }
73132
+ };
73059
73133
  DTableDataTree.prototype.size = function () {
73060
73134
  return this.rows.length;
73061
73135
  };