@wcardinal/wcardinal-ui 0.410.0 → 0.412.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 (97) hide show
  1. package/dist/types/wcardinal/ui/d-base.d.ts +1 -0
  2. package/dist/types/wcardinal/ui/d-dialog-gesture-impl.d.ts +2 -2
  3. package/dist/types/wcardinal/ui/d-table-body-cell.d.ts +2 -2
  4. package/dist/types/wcardinal/ui/d-table-body-row.d.ts +9 -9
  5. package/dist/types/wcardinal/ui/d-table-body.d.ts +5 -7
  6. package/dist/types/wcardinal/ui/d-table-category-cell.d.ts +37 -0
  7. package/dist/types/wcardinal/ui/d-table-category-column-impl.d.ts +24 -0
  8. package/dist/types/wcardinal/ui/d-table-category-column.d.ts +10 -0
  9. package/dist/types/wcardinal/ui/d-table-category-container-impl.d.ts +12 -0
  10. package/dist/types/wcardinal/ui/d-table-category-container.d.ts +4 -0
  11. package/dist/types/wcardinal/ui/d-table-category.d.ts +13 -12
  12. package/dist/types/wcardinal/ui/d-table-column-container-impl.d.ts +25 -0
  13. package/dist/types/wcardinal/ui/d-table-column-container.d.ts +12 -0
  14. package/dist/types/wcardinal/ui/d-table-column-impl.d.ts +44 -0
  15. package/dist/types/wcardinal/ui/d-table-column.d.ts +22 -19
  16. package/dist/types/wcardinal/ui/d-table-header-cell-check.d.ts +1 -1
  17. package/dist/types/wcardinal/ui/d-table-header-cell.d.ts +34 -12
  18. package/dist/types/wcardinal/ui/d-table-header.d.ts +8 -9
  19. package/dist/types/wcardinal/ui/d-table-row.d.ts +8 -9
  20. package/dist/types/wcardinal/ui/d-table-state.d.ts +8 -0
  21. package/dist/types/wcardinal/ui/d-table.d.ts +15 -18
  22. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.d.ts +1 -0
  23. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header.d.ts +1 -0
  24. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header-cell.d.ts +1 -0
  25. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header.d.ts +1 -0
  26. package/dist/types/wcardinal/ui/util/util-gesture-easing.d.ts +1 -0
  27. package/dist/wcardinal/ui/d-base.js +9 -2
  28. package/dist/wcardinal/ui/d-base.js.map +1 -1
  29. package/dist/wcardinal/ui/d-dialog-gesture-impl.js.map +1 -1
  30. package/dist/wcardinal/ui/d-table-body-cell.js.map +1 -1
  31. package/dist/wcardinal/ui/d-table-body-row.js +4 -4
  32. package/dist/wcardinal/ui/d-table-body-row.js.map +1 -1
  33. package/dist/wcardinal/ui/d-table-body.js +6 -15
  34. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  35. package/dist/wcardinal/ui/d-table-category-cell.js +244 -2
  36. package/dist/wcardinal/ui/d-table-category-cell.js.map +1 -1
  37. package/dist/wcardinal/ui/d-table-category-column-impl.js +222 -0
  38. package/dist/wcardinal/ui/d-table-category-column-impl.js.map +1 -0
  39. package/dist/wcardinal/ui/d-table-category-column.js +6 -0
  40. package/dist/wcardinal/ui/d-table-category-column.js.map +1 -0
  41. package/dist/wcardinal/ui/d-table-category-container-impl.js +149 -0
  42. package/dist/wcardinal/ui/d-table-category-container-impl.js.map +1 -0
  43. package/dist/wcardinal/ui/d-table-category-container.js +2 -0
  44. package/dist/wcardinal/ui/d-table-category-container.js.map +1 -0
  45. package/dist/wcardinal/ui/d-table-category.js +49 -7
  46. package/dist/wcardinal/ui/d-table-category.js.map +1 -1
  47. package/dist/wcardinal/ui/d-table-column-container-impl.js +126 -0
  48. package/dist/wcardinal/ui/d-table-column-container-impl.js.map +1 -0
  49. package/dist/wcardinal/ui/d-table-column-container.js +2 -0
  50. package/dist/wcardinal/ui/d-table-column-container.js.map +1 -0
  51. package/dist/wcardinal/ui/d-table-column-impl.js +375 -0
  52. package/dist/wcardinal/ui/d-table-column-impl.js.map +1 -0
  53. package/dist/wcardinal/ui/d-table-column.js.map +1 -1
  54. package/dist/wcardinal/ui/d-table-header-cell-check.js.map +1 -1
  55. package/dist/wcardinal/ui/d-table-header-cell.js +245 -48
  56. package/dist/wcardinal/ui/d-table-header-cell.js.map +1 -1
  57. package/dist/wcardinal/ui/d-table-header.js +8 -22
  58. package/dist/wcardinal/ui/d-table-header.js.map +1 -1
  59. package/dist/wcardinal/ui/d-table-row.js +7 -5
  60. package/dist/wcardinal/ui/d-table-row.js.map +1 -1
  61. package/dist/wcardinal/ui/d-table-state.js +9 -1
  62. package/dist/wcardinal/ui/d-table-state.js.map +1 -1
  63. package/dist/wcardinal/ui/d-table.js +69 -631
  64. package/dist/wcardinal/ui/d-table.js.map +1 -1
  65. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js +7 -1
  66. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js.map +1 -1
  67. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js +7 -0
  68. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js.map +1 -1
  69. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js +7 -1
  70. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js.map +1 -1
  71. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js +7 -0
  72. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js.map +1 -1
  73. package/dist/wcardinal/ui/util/util-gesture-easing.js +16 -5
  74. package/dist/wcardinal/ui/util/util-gesture-easing.js.map +1 -1
  75. package/dist/wcardinal/ui/util/util-gesture.js +2 -1
  76. package/dist/wcardinal/ui/util/util-gesture.js.map +1 -1
  77. package/dist/wcardinal-ui-theme-dark-en-us.js +14 -2
  78. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  79. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  80. package/dist/wcardinal-ui-theme-dark-ja-jp.js +14 -2
  81. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  82. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  83. package/dist/wcardinal-ui-theme-dark.js +14 -2
  84. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  85. package/dist/wcardinal-ui-theme-white-en-us.js +14 -2
  86. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  87. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  88. package/dist/wcardinal-ui-theme-white-ja-jp.js +14 -2
  89. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  90. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  91. package/dist/wcardinal-ui-theme-white.js +14 -2
  92. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  93. package/dist/wcardinal-ui.cjs.js +1178 -377
  94. package/dist/wcardinal-ui.js +1152 -375
  95. package/dist/wcardinal-ui.min.js +2 -2
  96. package/dist/wcardinal-ui.min.js.map +1 -1
  97. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.410.0
2
+ Winter Cardinal UI v0.412.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -14357,6 +14357,13 @@ var DBase = /** @class */ (function (_super) {
14357
14357
  get: function () {
14358
14358
  return this._weight;
14359
14359
  },
14360
+ set: function (weight) {
14361
+ if (this._weight !== weight) {
14362
+ this._weight = weight;
14363
+ this.toHierarchyDirty();
14364
+ DApplications.update(this);
14365
+ }
14366
+ },
14360
14367
  enumerable: false,
14361
14368
  configurable: true
14362
14369
  });
@@ -15174,10 +15181,10 @@ var DBase = /** @class */ (function (_super) {
15174
15181
  this.emit("down", e, this);
15175
15182
  };
15176
15183
  DBase.prototype.onDownThis = function (e) {
15184
+ var _a;
15177
15185
  var oe = e.data.originalEvent;
15178
15186
  if ("touches" in oe) {
15179
- var lastDownPoint = this._lastDownPoint || new pixi_js.Point();
15180
- this._lastDownPoint = lastDownPoint;
15187
+ var lastDownPoint = ((_a = this._lastDownPoint) !== null && _a !== void 0 ? _a : (this._lastDownPoint = new pixi_js.Point()));
15181
15188
  lastDownPoint.copyFrom(e.data.global);
15182
15189
  }
15183
15190
  else {
@@ -15809,6 +15816,7 @@ var UtilGestureEasing = /** @class */ (function () {
15809
15816
  this._dt = 0;
15810
15817
  this._dtw = 0;
15811
15818
  this._t = 0;
15819
+ this._duration = 333 * ((_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1);
15812
15820
  this._animation = new DAnimationBase({
15813
15821
  onTime: function (t) {
15814
15822
  _this.onEase(t);
@@ -15817,7 +15825,7 @@ var UtilGestureEasing = /** @class */ (function () {
15817
15825
  _this.onEaseEnd();
15818
15826
  },
15819
15827
  timing: DAnimationTimings.LINEAR,
15820
- duration: 333 * ((_a = options === null || options === void 0 ? void 0 : options.duration) !== null && _a !== void 0 ? _a : 1)
15828
+ duration: this._duration
15821
15829
  });
15822
15830
  this._onMove = onMove;
15823
15831
  this._onEnd = onEnd;
@@ -15898,6 +15906,11 @@ var UtilGestureEasing = /** @class */ (function () {
15898
15906
  }
15899
15907
  };
15900
15908
  UtilGestureEasing.prototype.onEnd = function (ldt) {
15909
+ var d0 = this._duration;
15910
+ var d = d0 - ldt;
15911
+ if (d <= 0) {
15912
+ return this.onEaseEnd();
15913
+ }
15901
15914
  this.updateHistoriesSorted(ldt);
15902
15915
  var sorted = this._historiesSorted;
15903
15916
  var sortedLength = sorted.length;
@@ -15922,22 +15935,27 @@ var UtilGestureEasing = /** @class */ (function () {
15922
15935
  dx *= w;
15923
15936
  dy *= w;
15924
15937
  ds *= w;
15925
- dt *= w;
15938
+ dt *= w * (d0 / d); // Effectively, this lowers the velocity (dx, dy, ds) by d / d0.
15926
15939
  this._dx = dx;
15927
15940
  this._dy = dy;
15928
15941
  this._ds = ds;
15929
15942
  this._dt = dt;
15930
15943
  // Start animation
15931
15944
  var animation = this._animation;
15932
- var d = animation.duration;
15933
- this._t = -ldt / d;
15945
+ animation.duration = d;
15946
+ this._t = 0;
15934
15947
  this._dtw = d / dt;
15935
15948
  animation.start();
15936
15949
  };
15937
15950
  UtilGestureEasing.prototype.onEase = function (t) {
15938
15951
  var ot = this._t;
15939
15952
  this._t = t;
15940
- // Note: Integral of (1-x) is x (1 - 0.5 x) + c.
15953
+ // Note: Integral_{x=ot...t} (1-x) dx
15954
+ // = [x (1 - 0.5 x)]_{x=ot...t}
15955
+ // = t (1 - 0.5 t) - ot (1 - 0.5 ot)
15956
+ // = t - ot - 0.5 t t + 0.5 ot ot
15957
+ // = (t - ot) - 0.5 (t + ot) (t - ot)
15958
+ // = (1 - 0.5 (t + ot)) * (t - ot)
15941
15959
  var w = (1 - 0.5 * (t + ot)) * (t - ot) * this._dtw;
15942
15960
  this._onMove(this._dx * w, this._dy * w, 1 + (this._ds - 1) * w, t);
15943
15961
  };
@@ -16142,6 +16160,7 @@ var UtilGesture = /** @class */ (function () {
16142
16160
  if (target == null || !target.state.isGesturing) {
16143
16161
  return;
16144
16162
  }
16163
+ var oldTime = data.time;
16145
16164
  if (!data.end(e)) {
16146
16165
  return;
16147
16166
  }
@@ -16173,7 +16192,7 @@ var UtilGesture = /** @class */ (function () {
16173
16192
  }
16174
16193
  var easing = data.easing;
16175
16194
  if (easing) {
16176
- easing.onEnd(e.data.originalEvent.timeStamp - data.time);
16195
+ easing.onEnd(data.time - oldTime);
16177
16196
  }
16178
16197
  else {
16179
16198
  this.deleteData(data);
@@ -54066,7 +54085,15 @@ var DTableState = {
54066
54085
  /**
54067
54086
  * Selectable row
54068
54087
  */
54069
- SELECTABLE: "SELECTABLE"
54088
+ SELECTABLE: "SELECTABLE",
54089
+ /**
54090
+ * Header or category cells hovered on their edges.
54091
+ */
54092
+ HOVERED_ON_EDGE: "HOVERED_ON_EDGE",
54093
+ /**
54094
+ * Header or category of being resized.
54095
+ */
54096
+ RESIZING: "RESIZING"
54070
54097
  };
54071
54098
 
54072
54099
  /*
@@ -58243,6 +58270,12 @@ var DThemeWhiteTableHeader = /** @class */ (function (_super) {
58243
58270
  DThemeWhiteTableHeader.prototype.getHeight = function () {
58244
58271
  return 30;
58245
58272
  };
58273
+ DThemeWhiteTableHeader.prototype.getCursor = function (state) {
58274
+ if (state.is(DTableState.RESIZING)) {
58275
+ return "col-resize";
58276
+ }
58277
+ return _super.prototype.getCursor.call(this, state);
58278
+ };
58246
58279
  return DThemeWhiteTableHeader;
58247
58280
  }(DThemeWhiteTableRow));
58248
58281
 
@@ -58285,7 +58318,7 @@ var DThemeWhiteTableHeaderCell = /** @class */ (function (_super) {
58285
58318
  return _this;
58286
58319
  }
58287
58320
  DThemeWhiteTableHeaderCell.prototype.getBackgroundColor = function (state) {
58288
- if (state.inDisabled) {
58321
+ if (state.inDisabled || state.on(DTableState.RESIZING)) {
58289
58322
  return state.is(DTableState.FROZEN) ? this.BACKGROUND_COLOR_FROZEN : null;
58290
58323
  }
58291
58324
  else if (state.isPressed) {
@@ -58386,11 +58419,17 @@ var DThemeWhiteTableHeaderCell = /** @class */ (function (_super) {
58386
58419
  if (!state.isActionable) {
58387
58420
  return "";
58388
58421
  }
58422
+ if (state.is(DTableState.HOVERED_ON_EDGE) || state.on(DTableState.RESIZING)) {
58423
+ return "col-resize";
58424
+ }
58389
58425
  if (state.is(DTableState.CHECKABLE) || state.is(DTableState.SORTABLE)) {
58390
58426
  return "pointer";
58391
58427
  }
58392
58428
  return "";
58393
58429
  };
58430
+ DThemeWhiteTableHeaderCell.prototype.getEdgeWidth = function () {
58431
+ return 10;
58432
+ };
58394
58433
  return DThemeWhiteTableHeaderCell;
58395
58434
  }(DThemeWhiteImage));
58396
58435
 
@@ -68758,6 +68797,12 @@ var DThemeDarkTableHeader = /** @class */ (function (_super) {
68758
68797
  DThemeDarkTableHeader.prototype.getHeight = function () {
68759
68798
  return 30;
68760
68799
  };
68800
+ DThemeDarkTableHeader.prototype.getCursor = function (state) {
68801
+ if (state.is(DTableState.RESIZING)) {
68802
+ return "col-resize";
68803
+ }
68804
+ return _super.prototype.getCursor.call(this, state);
68805
+ };
68761
68806
  return DThemeDarkTableHeader;
68762
68807
  }(DThemeDarkTableRow));
68763
68808
 
@@ -68800,7 +68845,7 @@ var DThemeDarkTableHeaderCell = /** @class */ (function (_super) {
68800
68845
  return _this;
68801
68846
  }
68802
68847
  DThemeDarkTableHeaderCell.prototype.getBackgroundColor = function (state) {
68803
- if (state.inDisabled) {
68848
+ if (state.inDisabled || state.on(DTableState.RESIZING)) {
68804
68849
  return state.is(DTableState.FROZEN) ? this.BACKGROUND_COLOR_FROZEN : null;
68805
68850
  }
68806
68851
  else if (state.isPressed) {
@@ -68901,11 +68946,17 @@ var DThemeDarkTableHeaderCell = /** @class */ (function (_super) {
68901
68946
  if (!state.isActionable) {
68902
68947
  return "";
68903
68948
  }
68949
+ if (state.is(DTableState.HOVERED_ON_EDGE) || state.on(DTableState.RESIZING)) {
68950
+ return "col-resize";
68951
+ }
68904
68952
  if (state.is(DTableState.CHECKABLE) || state.is(DTableState.SORTABLE)) {
68905
68953
  return "pointer";
68906
68954
  }
68907
68955
  return "";
68908
68956
  };
68957
+ DThemeDarkTableHeaderCell.prototype.getEdgeWidth = function () {
68958
+ return 10;
68959
+ };
68909
68960
  return DThemeDarkTableHeaderCell;
68910
68961
  }(DThemeDarkImage));
68911
68962
 
@@ -93174,15 +93225,17 @@ var DTableDataSelectionType = {
93174
93225
  */
93175
93226
  var DTableRow = /** @class */ (function (_super) {
93176
93227
  __extends(DTableRow, _super);
93177
- function DTableRow(options) {
93178
- var _a, _b;
93228
+ function DTableRow(columns, frozen, options) {
93179
93229
  var _this = _super.call(this, options) || this;
93180
93230
  _this._reverse = true;
93181
- _this._frozen = (_a = options.frozen) !== null && _a !== void 0 ? _a : 0;
93182
- _this._columns = (_b = options.columns) !== null && _b !== void 0 ? _b : [];
93231
+ _this._frozen = frozen;
93232
+ _this._columns = columns;
93183
93233
  return _this;
93184
93234
  }
93185
- DTableRow.prototype.initCells = function (options, columns, frozen) {
93235
+ DTableRow.prototype.initCells = function () {
93236
+ var columns = this._columns;
93237
+ var frozen = this._frozen;
93238
+ var options = this._options;
93186
93239
  var iend = this.toIndexEnd(columns);
93187
93240
  for (var i = columns.length - 1; 0 <= i; --i) {
93188
93241
  var cell = this.newCell(i, columns[i], columns, options);
@@ -93274,8 +93327,8 @@ var DTableRow = /** @class */ (function (_super) {
93274
93327
  */
93275
93328
  var DTableBodyRow = /** @class */ (function (_super) {
93276
93329
  __extends(DTableBodyRow, _super);
93277
- function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, options) {
93278
- var _this = _super.call(this, options) || this;
93330
+ function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, columns, frozen, options) {
93331
+ var _this = _super.call(this, columns, frozen, options) || this;
93279
93332
  _this._index = -1;
93280
93333
  _this._onChange = onChange;
93281
93334
  _this._onCellChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
@@ -93283,7 +93336,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
93283
93336
  };
93284
93337
  _this._columnIndexToCellOptions = columnIndexToCellOptions;
93285
93338
  _this.state.isAlternated = !isEven;
93286
- _this.initCells(options, _this._columns, _this._frozen);
93339
+ _this.initCells();
93287
93340
  return _this;
93288
93341
  }
93289
93342
  DTableBodyRow.prototype.onCellChange = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
@@ -93427,7 +93480,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
93427
93480
  DTableBodyRow.prototype.toCellOptions = function (columnIndex, column, options) {
93428
93481
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
93429
93482
  var _p;
93430
- var result = toMerged(column.body, options.cell);
93483
+ var result = toMerged(column.body, options === null || options === void 0 ? void 0 : options.cell);
93431
93484
  // Weight
93432
93485
  result.weight = column.weight;
93433
93486
  // Width
@@ -94496,18 +94549,11 @@ var DTableDataList = /** @class */ (function (_super) {
94496
94549
  * SPDX-License-Identifier: Apache-2.0
94497
94550
  */
94498
94551
  var toRowOptions = function (theme, options, selectionType) {
94499
- var columns = options.columns || [];
94500
94552
  var result = options.row;
94501
94553
  if (result != null) {
94502
94554
  if (result.height == null) {
94503
94555
  result.height = theme.getRowHeight();
94504
94556
  }
94505
- if (result.columns === undefined) {
94506
- result.columns = columns;
94507
- }
94508
- if (result.frozen == null) {
94509
- result.frozen = options.frozen;
94510
- }
94511
94557
  if (result.selection === undefined) {
94512
94558
  result.selection = {
94513
94559
  type: selectionType
@@ -94519,9 +94565,7 @@ var toRowOptions = function (theme, options, selectionType) {
94519
94565
  }
94520
94566
  else {
94521
94567
  result = {
94522
- columns: columns,
94523
94568
  height: theme.getRowHeight(),
94524
- frozen: options.frozen,
94525
94569
  selection: {
94526
94570
  type: selectionType
94527
94571
  }
@@ -94531,18 +94575,18 @@ var toRowOptions = function (theme, options, selectionType) {
94531
94575
  };
94532
94576
  var DTableBody = /** @class */ (function (_super) {
94533
94577
  __extends(DTableBody, _super);
94534
- function DTableBody(options) {
94535
- var _a;
94578
+ function DTableBody(columns, frozen, offset, options) {
94536
94579
  var _this = _super.call(this, options) || this;
94537
- _this.transform.position.y = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
94580
+ _this.transform.position.y = offset;
94538
94581
  var data = _this.toData(options.data);
94539
94582
  _this._data = data;
94540
94583
  data.bind(_this);
94541
94584
  var theme = _this.theme;
94585
+ _this._columns = columns;
94586
+ _this._frozen = frozen;
94542
94587
  var rowOptions = toRowOptions(theme, options, data.selection.type);
94543
94588
  _this._rowOptions = rowOptions;
94544
94589
  _this._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();
94545
- _this._columns = rowOptions.columns || [];
94546
94590
  _this._rowIndexMappedStart = 0;
94547
94591
  _this._rowIndexMappedEnd = 0;
94548
94592
  _this._updateRowsCount = 0;
@@ -94753,14 +94797,14 @@ var DTableBody = /** @class */ (function (_super) {
94753
94797
  return row;
94754
94798
  };
94755
94799
  DTableBody.prototype.newRow = function (isEven) {
94756
- return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
94800
+ return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._columns, this._frozen, this._rowOptions);
94757
94801
  };
94758
94802
  DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
94759
94803
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
94760
94804
  this.updateFrozenCellPosition(newX);
94761
94805
  };
94762
94806
  DTableBody.prototype.updateFrozenCellPosition = function (x) {
94763
- var frozen = this._rowOptions.frozen;
94807
+ var frozen = this._frozen;
94764
94808
  if (frozen != null && 0 < frozen) {
94765
94809
  var rows = this.children;
94766
94810
  for (var i = 0, imax = rows.length; i < imax; ++i) {
@@ -94975,11 +95019,249 @@ var DTableBody = /** @class */ (function (_super) {
94975
95019
  * Copyright (C) 2019 Toshiba Corporation
94976
95020
  * SPDX-License-Identifier: Apache-2.0
94977
95021
  */
95022
+ var DTableCategoryCellEdge = {
95023
+ NONE: 0,
95024
+ LEFT: 1,
95025
+ RIGHT: 2,
95026
+ BOTH: 3
95027
+ };
94978
95028
  var DTableCategoryCell = /** @class */ (function (_super) {
94979
95029
  __extends(DTableCategoryCell, _super);
94980
- function DTableCategoryCell() {
94981
- return _super !== null && _super.apply(this, arguments) || this;
95030
+ function DTableCategoryCell(category, columnIndex, column, options) {
95031
+ var _this = _super.call(this, options) || this;
95032
+ _this._category = category;
95033
+ _this._columnIndex = columnIndex;
95034
+ _this._column = column;
95035
+ _this._edgeSize = _this.theme.getEdgeWidth();
95036
+ _this._wasResizing = false;
95037
+ return _this;
94982
95038
  }
95039
+ Object.defineProperty(DTableCategoryCell.prototype, "column", {
95040
+ get: function () {
95041
+ return this._column;
95042
+ },
95043
+ enumerable: false,
95044
+ configurable: true
95045
+ });
95046
+ Object.defineProperty(DTableCategoryCell.prototype, "columnIndex", {
95047
+ get: function () {
95048
+ return this._columnIndex;
95049
+ },
95050
+ enumerable: false,
95051
+ configurable: true
95052
+ });
95053
+ Object.defineProperty(DTableCategoryCell.prototype, "category", {
95054
+ get: function () {
95055
+ return this._category;
95056
+ },
95057
+ enumerable: false,
95058
+ configurable: true
95059
+ });
95060
+ DTableCategoryCell.prototype.onDown = function (e) {
95061
+ var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
95062
+ if (edges != null) {
95063
+ this._wasResizing = true;
95064
+ var layer = DApplications.getLayer(this);
95065
+ if (layer != null) {
95066
+ var interactionManager = layer.renderer.plugins.interaction;
95067
+ var columnIndex = this._columnIndex;
95068
+ if (edges === DTableCategoryCellEdge.LEFT) {
95069
+ this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
95070
+ }
95071
+ else {
95072
+ this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
95073
+ }
95074
+ }
95075
+ }
95076
+ else {
95077
+ this._wasResizing = false;
95078
+ _super.prototype.onDown.call(this, e);
95079
+ }
95080
+ };
95081
+ DTableCategoryCell.prototype.findLeftResizableCell = function (columnIndex) {
95082
+ var children = this._category.children;
95083
+ var childrenLength = children.length;
95084
+ for (var i = columnIndex; 0 <= i; --i) {
95085
+ var child = children[childrenLength - i - 1];
95086
+ if (child.column.resizable) {
95087
+ return child;
95088
+ }
95089
+ }
95090
+ return null;
95091
+ };
95092
+ DTableCategoryCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
95093
+ var children = this._category.children;
95094
+ var childrenLength = children.length;
95095
+ for (var i = columnIndex + 1; i < childrenLength; ++i) {
95096
+ var child = children[childrenLength - i - 1];
95097
+ var childColumn = child.column;
95098
+ if (childColumn.resizable) {
95099
+ var childColumnWeight = childColumn.weight;
95100
+ if (childColumnWeight != null) {
95101
+ return child;
95102
+ }
95103
+ }
95104
+ }
95105
+ return null;
95106
+ };
95107
+ DTableCategoryCell.prototype.checkIfEdgeResizable = function (columnIndex) {
95108
+ var target = this.findLeftResizableCell(columnIndex);
95109
+ if (target != null) {
95110
+ if (target.column.weight != null) {
95111
+ return this.findRightResizableCellOfWeight(target.columnIndex) != null;
95112
+ }
95113
+ else {
95114
+ return true;
95115
+ }
95116
+ }
95117
+ return false;
95118
+ };
95119
+ DTableCategoryCell.prototype.getResizableEdges = function () {
95120
+ var result = this._resizableEdges;
95121
+ if (result == null) {
95122
+ var columnIndex = this._columnIndex;
95123
+ if (this.checkIfEdgeResizable(columnIndex - 1)) {
95124
+ if (this.checkIfEdgeResizable(columnIndex)) {
95125
+ result = DTableCategoryCellEdge.BOTH;
95126
+ }
95127
+ else {
95128
+ result = DTableCategoryCellEdge.LEFT;
95129
+ }
95130
+ }
95131
+ else {
95132
+ if (this.checkIfEdgeResizable(columnIndex)) {
95133
+ result = DTableCategoryCellEdge.RIGHT;
95134
+ }
95135
+ else {
95136
+ result = DTableCategoryCellEdge.NONE;
95137
+ }
95138
+ }
95139
+ this._resizableEdges = result;
95140
+ }
95141
+ return result;
95142
+ };
95143
+ DTableCategoryCell.prototype.onOver = function (e) {
95144
+ var _this = this;
95145
+ var _a;
95146
+ _super.prototype.onOver.call(this, e);
95147
+ if (this.getResizableEdges() !== DTableCategoryCellEdge.NONE) {
95148
+ var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
95149
+ _this.onHovered(event);
95150
+ }));
95151
+ this.on(UtilPointerEvent.move, onHoveredBound);
95152
+ // Since the cursor is set by InteractionManager before this method is called,
95153
+ // the cursor need to be overriden.
95154
+ this.onHovered(e);
95155
+ var layer = DApplications.getLayer(this);
95156
+ if (layer != null) {
95157
+ layer.renderer.plugins.interaction.cursor = this.cursor;
95158
+ }
95159
+ }
95160
+ };
95161
+ DTableCategoryCell.prototype.onOut = function (e) {
95162
+ _super.prototype.onOut.call(this, e);
95163
+ var onHoveredBound = this._onHoveredBound;
95164
+ if (onHoveredBound != null) {
95165
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95166
+ this.off(UtilPointerEvent.move, onHoveredBound);
95167
+ }
95168
+ };
95169
+ DTableCategoryCell.prototype.onHovered = function (e) {
95170
+ var width = this.width;
95171
+ var x = this.toClickPosition(e);
95172
+ var edgeSize = this._edgeSize;
95173
+ if (0 <= x && x <= edgeSize) {
95174
+ if (this.getResizableEdges() & DTableCategoryCellEdge.LEFT) {
95175
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.LEFT);
95176
+ }
95177
+ else {
95178
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95179
+ }
95180
+ }
95181
+ else if (width - edgeSize <= x && x <= width) {
95182
+ if (this.getResizableEdges() & DTableCategoryCellEdge.RIGHT) {
95183
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.RIGHT);
95184
+ }
95185
+ else {
95186
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95187
+ }
95188
+ }
95189
+ else {
95190
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95191
+ }
95192
+ };
95193
+ DTableCategoryCell.prototype.toClickPosition = function (e) {
95194
+ var _a;
95195
+ var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
95196
+ return e.data.getLocalPosition(this, checkWork).x;
95197
+ };
95198
+ DTableCategoryCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
95199
+ // Find the resizable cell
95200
+ var left = this.findLeftResizableCell(columnIndex);
95201
+ if (left == null) {
95202
+ // No resizable cell
95203
+ return;
95204
+ }
95205
+ var category = this._category;
95206
+ var leftColumn = left.column;
95207
+ var leftOldWidth = left.width;
95208
+ var leftOldWeight = left.weight;
95209
+ if (leftColumn.weight == null) {
95210
+ category.state.add(DTableState.RESIZING);
95211
+ var leftMinWidth_1 = leftColumn.minWidth;
95212
+ var onMove_1 = function (e) {
95213
+ leftColumn.width = Math.max(leftMinWidth_1, leftOldWidth + e.data.global.x - onDownPoint);
95214
+ };
95215
+ var onUp_1 = function (e) {
95216
+ category.state.remove(DTableState.RESIZING);
95217
+ interactionManager.off(UtilPointerEvent.move, onMove_1);
95218
+ interactionManager.off(UtilPointerEvent.up, onUp_1);
95219
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
95220
+ interactionManager.off(UtilPointerEvent.cancel, onUp_1);
95221
+ };
95222
+ interactionManager.on(UtilPointerEvent.move, onMove_1);
95223
+ interactionManager.on(UtilPointerEvent.up, onUp_1);
95224
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
95225
+ interactionManager.on(UtilPointerEvent.cancel, onUp_1);
95226
+ }
95227
+ else {
95228
+ var right = this.findRightResizableCellOfWeight(left.columnIndex);
95229
+ if (right == null) {
95230
+ // No right resizable cell found
95231
+ return;
95232
+ }
95233
+ var rightColumn_1 = right.column;
95234
+ var rightOldWeight = right.weight;
95235
+ var rightOldWidth = right.width;
95236
+ var totalWidth_1 = leftOldWidth + rightOldWidth;
95237
+ var totalWeight_1 = leftOldWeight + rightOldWeight;
95238
+ var leftMinWeight_1 = leftColumn.minWeight;
95239
+ var rightMinWeight = rightColumn_1.minWeight;
95240
+ var leftMaxWeight_1 = totalWeight_1 - rightMinWeight;
95241
+ if (totalWidth_1 <= 0 || leftMaxWeight_1 <= leftMinWeight_1) {
95242
+ // The left and right resizable cells doesn't non-zero width
95243
+ return;
95244
+ }
95245
+ category.state.add(DTableState.RESIZING);
95246
+ var onMove_2 = function (e) {
95247
+ var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
95248
+ var leftNewWeight = Math.max(leftMinWeight_1, Math.min(leftMaxWeight_1, totalWeight_1 * (leftNewWidth / totalWidth_1)));
95249
+ leftColumn.weight = leftNewWeight;
95250
+ rightColumn_1.weight = totalWeight_1 - leftNewWeight;
95251
+ };
95252
+ var onUp_2 = function (e) {
95253
+ category.state.remove(DTableState.RESIZING);
95254
+ interactionManager.off(UtilPointerEvent.move, onMove_2);
95255
+ interactionManager.off(UtilPointerEvent.up, onUp_2);
95256
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
95257
+ interactionManager.off(UtilPointerEvent.cancel, onUp_2);
95258
+ };
95259
+ interactionManager.on(UtilPointerEvent.move, onMove_2);
95260
+ interactionManager.on(UtilPointerEvent.up, onUp_2);
95261
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
95262
+ interactionManager.on(UtilPointerEvent.cancel, onUp_2);
95263
+ }
95264
+ };
94983
95265
  DTableCategoryCell.prototype.getType = function () {
94984
95266
  return "DTableCategoryCell";
94985
95267
  };
@@ -94992,15 +95274,53 @@ var DTableCategoryCell = /** @class */ (function (_super) {
94992
95274
  */
94993
95275
  var DTableCategory = /** @class */ (function (_super) {
94994
95276
  __extends(DTableCategory, _super);
94995
- function DTableCategory(options) {
94996
- var _a;
94997
- var _this = _super.call(this, options) || this;
94998
- var offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
95277
+ function DTableCategory(columns, frozen, offset, options) {
95278
+ var _this = _super.call(this, columns, frozen, options) || this;
95279
+ _this._columns = columns;
95280
+ _this._frozen = frozen;
94999
95281
  _this._offset = offset;
95000
95282
  _this.transform.position.y = offset;
95001
- _this.initCells(options, _this._columns, _this._frozen);
95283
+ _this.initCells();
95284
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95285
+ var column = columns[i];
95286
+ column.on("resize", _this.newOnColumnResize(i, column));
95287
+ }
95002
95288
  return _this;
95003
95289
  }
95290
+ DTableCategory.prototype.newOnColumnResize = function (index, column) {
95291
+ var _this = this;
95292
+ return function () {
95293
+ _this.onColumnResize(index, column);
95294
+ };
95295
+ };
95296
+ DTableCategory.prototype.onColumnResize = function (index, column) {
95297
+ var columnWeight = column.weight;
95298
+ if (columnWeight != null) {
95299
+ this.onColumnResizeWeight(this, index, columnWeight);
95300
+ }
95301
+ else {
95302
+ var columnWidth = column.width;
95303
+ if (columnWidth != null) {
95304
+ this.onColumnResizeWidth(this, index, columnWidth);
95305
+ }
95306
+ }
95307
+ };
95308
+ DTableCategory.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
95309
+ var cells = row.children;
95310
+ var cellsLength = cells.length;
95311
+ var cellsIndex = cellsLength - index - 1;
95312
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
95313
+ cells[cellsIndex].weight = columnWeight;
95314
+ }
95315
+ };
95316
+ DTableCategory.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
95317
+ var cells = row.children;
95318
+ var cellsLength = cells.length;
95319
+ var cellsIndex = cellsLength - index - 1;
95320
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
95321
+ cells[cellsIndex].width = columnWidth;
95322
+ }
95323
+ };
95004
95324
  DTableCategory.prototype.onParentMove = function (newX, newY, oldX, oldY) {
95005
95325
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
95006
95326
  this.transform.position.y = -newY + this._offset;
@@ -95014,16 +95334,20 @@ var DTableCategory = /** @class */ (function (_super) {
95014
95334
  return 0;
95015
95335
  };
95016
95336
  DTableCategory.prototype.newCell = function (columnIndex, column, columns, options) {
95017
- return new DTableCategoryCell(this.toCellOptions(columnIndex, column, options));
95337
+ return new DTableCategoryCell(this, columnIndex, column, this.toCellOptions(columnIndex, column, options));
95018
95338
  };
95019
95339
  DTableCategory.prototype.toCellOptions = function (columnIndex, column, options) {
95020
- var result = options.cell;
95340
+ var result = options === null || options === void 0 ? void 0 : options.cell;
95021
95341
  if (result) {
95342
+ // Weight
95022
95343
  result.weight = column.weight;
95344
+ // Width
95023
95345
  result.width = column.width;
95346
+ // Label
95024
95347
  var text = result.text || {};
95025
95348
  result.text = text;
95026
95349
  text.value = text.value || column.label;
95350
+ // Done
95027
95351
  return result;
95028
95352
  }
95029
95353
  else {
@@ -96013,24 +96337,37 @@ var DTableHeaderCellCheck = /** @class */ (function () {
96013
96337
  * Copyright (C) 2019 Toshiba Corporation
96014
96338
  * SPDX-License-Identifier: Apache-2.0
96015
96339
  */
96340
+ var DTableHeaderCellEdge = {
96341
+ NONE: 0,
96342
+ LEFT: 1,
96343
+ RIGHT: 2,
96344
+ BOTH: 3
96345
+ };
96016
96346
  var DTableHeaderCell = /** @class */ (function (_super) {
96017
96347
  __extends(DTableHeaderCell, _super);
96018
- function DTableHeaderCell() {
96019
- return _super !== null && _super.apply(this, arguments) || this;
96020
- }
96021
- DTableHeaderCell.prototype.init = function (options) {
96022
- if (options != null) {
96023
- this._header = options.header;
96024
- this._column = options.column;
96025
- this._columnIndex = options.columnIndex;
96026
- this._check = new DTableHeaderCellCheck(this, options.check);
96027
- }
96028
- else {
96029
- this._check = new DTableHeaderCellCheck(this);
96348
+ function DTableHeaderCell(header, columnIndex, column, options) {
96349
+ var _this = _super.call(this, options) || this;
96350
+ _this._header = header;
96351
+ _this._column = column;
96352
+ _this._columnIndex = columnIndex;
96353
+ var check = new DTableHeaderCellCheck(_this, options === null || options === void 0 ? void 0 : options.check);
96354
+ _this._check = check;
96355
+ _this._edgeSize = _this.theme.getEdgeWidth();
96356
+ _this._wasResizing = false;
96357
+ var sortable = column.sorting.enable;
96358
+ var checkable = check.isEnabled;
96359
+ if (checkable || sortable) {
96360
+ _this.on(UtilPointerEvent.tap, function (e) {
96361
+ _this.onClick(e);
96362
+ });
96363
+ var state = _this.state;
96364
+ state.lock();
96365
+ state.set(DTableState.SORTABLE, sortable);
96366
+ state.set(DTableState.CHECKABLE, checkable);
96367
+ state.unlock();
96030
96368
  }
96031
- _super.prototype.init.call(this, options);
96032
- this.initOnClick(options);
96033
- };
96369
+ return _this;
96370
+ }
96034
96371
  Object.defineProperty(DTableHeaderCell.prototype, "column", {
96035
96372
  get: function () {
96036
96373
  return this._column;
@@ -96059,23 +96396,201 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96059
96396
  enumerable: false,
96060
96397
  configurable: true
96061
96398
  });
96062
- DTableHeaderCell.prototype.initOnClick = function (options) {
96399
+ DTableHeaderCell.prototype.onDown = function (e) {
96400
+ var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
96401
+ if (edges != null) {
96402
+ this._wasResizing = true;
96403
+ var layer = DApplications.getLayer(this);
96404
+ if (layer != null) {
96405
+ var interactionManager = layer.renderer.plugins.interaction;
96406
+ var columnIndex = this._columnIndex;
96407
+ if (edges === DTableHeaderCellEdge.LEFT) {
96408
+ this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
96409
+ }
96410
+ else {
96411
+ this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
96412
+ }
96413
+ }
96414
+ }
96415
+ else {
96416
+ this._wasResizing = false;
96417
+ _super.prototype.onDown.call(this, e);
96418
+ }
96419
+ };
96420
+ DTableHeaderCell.prototype.findLeftResizableCell = function (columnIndex) {
96421
+ var children = this._header.children;
96422
+ var childrenLength = children.length;
96423
+ for (var i = columnIndex; 0 <= i; --i) {
96424
+ var child = children[childrenLength - i - 1];
96425
+ if (child.column.resizable) {
96426
+ return child;
96427
+ }
96428
+ }
96429
+ return null;
96430
+ };
96431
+ DTableHeaderCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
96432
+ var children = this._header.children;
96433
+ var childrenLength = children.length;
96434
+ for (var i = columnIndex + 1; i < childrenLength; ++i) {
96435
+ var child = children[childrenLength - i - 1];
96436
+ var childColumn = child.column;
96437
+ if (childColumn.resizable) {
96438
+ var childColumnWeight = childColumn.weight;
96439
+ if (childColumnWeight != null) {
96440
+ return child;
96441
+ }
96442
+ }
96443
+ }
96444
+ return null;
96445
+ };
96446
+ DTableHeaderCell.prototype.checkIfEdgeResizable = function (columnIndex) {
96447
+ var target = this.findLeftResizableCell(columnIndex);
96448
+ if (target != null) {
96449
+ if (target.column.weight != null) {
96450
+ return this.findRightResizableCellOfWeight(target.columnIndex) != null;
96451
+ }
96452
+ else {
96453
+ return true;
96454
+ }
96455
+ }
96456
+ return false;
96457
+ };
96458
+ DTableHeaderCell.prototype.getResizableEdges = function () {
96459
+ var result = this._resizableEdges;
96460
+ if (result == null) {
96461
+ var columnIndex = this._columnIndex;
96462
+ if (this.checkIfEdgeResizable(columnIndex - 1)) {
96463
+ if (this.checkIfEdgeResizable(columnIndex)) {
96464
+ result = DTableHeaderCellEdge.BOTH;
96465
+ }
96466
+ else {
96467
+ result = DTableHeaderCellEdge.LEFT;
96468
+ }
96469
+ }
96470
+ else {
96471
+ if (this.checkIfEdgeResizable(columnIndex)) {
96472
+ result = DTableHeaderCellEdge.RIGHT;
96473
+ }
96474
+ else {
96475
+ result = DTableHeaderCellEdge.NONE;
96476
+ }
96477
+ }
96478
+ this._resizableEdges = result;
96479
+ }
96480
+ return result;
96481
+ };
96482
+ DTableHeaderCell.prototype.onOver = function (e) {
96063
96483
  var _this = this;
96064
- var column = this._column;
96065
- if (column) {
96066
- var sortable = column.sorting.enable;
96067
- var checkable = this._check.isEnabled;
96068
- if (checkable || sortable) {
96069
- this.on(UtilPointerEvent.tap, function (e) {
96070
- _this.onClick(e);
96071
- });
96072
- var state = this.state;
96073
- state.lock();
96074
- state.set(DTableState.SORTABLE, sortable);
96075
- state.set(DTableState.CHECKABLE, checkable);
96076
- state.unlock();
96484
+ var _a;
96485
+ _super.prototype.onOver.call(this, e);
96486
+ if (this.getResizableEdges() !== DTableHeaderCellEdge.NONE) {
96487
+ var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
96488
+ _this.onHovered(event);
96489
+ }));
96490
+ this.on(UtilPointerEvent.move, onHoveredBound);
96491
+ // Since the cursor is set by InteractionManager before this method is called,
96492
+ // the cursor need to be overriden.
96493
+ this.onHovered(e);
96494
+ var layer = DApplications.getLayer(this);
96495
+ if (layer != null) {
96496
+ layer.renderer.plugins.interaction.cursor = this.cursor;
96497
+ }
96498
+ }
96499
+ };
96500
+ DTableHeaderCell.prototype.onOut = function (e) {
96501
+ _super.prototype.onOut.call(this, e);
96502
+ var onHoveredBound = this._onHoveredBound;
96503
+ if (onHoveredBound != null) {
96504
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
96505
+ this.off(UtilPointerEvent.move, onHoveredBound);
96506
+ }
96507
+ };
96508
+ DTableHeaderCell.prototype.onHovered = function (e) {
96509
+ var width = this.width;
96510
+ var x = this.toClickPosition(e);
96511
+ var edgeSize = this._edgeSize;
96512
+ if (0 <= x && x <= edgeSize) {
96513
+ if (this.getResizableEdges() & DTableHeaderCellEdge.LEFT) {
96514
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.LEFT);
96515
+ }
96516
+ else {
96517
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
96518
+ }
96519
+ }
96520
+ else if (width - edgeSize <= x && x <= width) {
96521
+ if (this.getResizableEdges() & DTableHeaderCellEdge.RIGHT) {
96522
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.RIGHT);
96523
+ }
96524
+ else {
96525
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
96077
96526
  }
96078
96527
  }
96528
+ else {
96529
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
96530
+ }
96531
+ };
96532
+ DTableHeaderCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
96533
+ // Find the resizable cell
96534
+ var left = this.findLeftResizableCell(columnIndex);
96535
+ if (left == null) {
96536
+ // No resizable cell
96537
+ return;
96538
+ }
96539
+ var header = this._header;
96540
+ var leftColumn = left.column;
96541
+ var leftOldWidth = left.width;
96542
+ var leftOldWeight = left.weight;
96543
+ if (leftColumn.weight == null) {
96544
+ header.state.add(DTableState.RESIZING);
96545
+ var onMove_1 = function (e) {
96546
+ leftColumn.width = Math.max(1, leftOldWidth + e.data.global.x - onDownPoint);
96547
+ };
96548
+ var onUp_1 = function (e) {
96549
+ header.state.remove(DTableState.RESIZING);
96550
+ interactionManager.off(UtilPointerEvent.move, onMove_1);
96551
+ interactionManager.off(UtilPointerEvent.up, onUp_1);
96552
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
96553
+ interactionManager.off(UtilPointerEvent.cancel, onUp_1);
96554
+ };
96555
+ interactionManager.on(UtilPointerEvent.move, onMove_1);
96556
+ interactionManager.on(UtilPointerEvent.up, onUp_1);
96557
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
96558
+ interactionManager.on(UtilPointerEvent.cancel, onUp_1);
96559
+ }
96560
+ else {
96561
+ var right = this.findRightResizableCellOfWeight(left.columnIndex);
96562
+ if (right == null) {
96563
+ // No right resizable cell found
96564
+ return;
96565
+ }
96566
+ var rightColumn_1 = right.column;
96567
+ var rightOldWeight = right.weight;
96568
+ var rightOldWidth = right.width;
96569
+ var totalWidth_1 = leftOldWidth + rightOldWidth;
96570
+ var totalWeight_1 = leftOldWeight + rightOldWeight;
96571
+ if (totalWidth_1 <= 0) {
96572
+ // The left and right resizable cells doesn't have non-zero width
96573
+ return;
96574
+ }
96575
+ header.state.add(DTableState.RESIZING);
96576
+ var onMove_2 = function (e) {
96577
+ var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
96578
+ var leftNewWeight = totalWeight_1 * (leftNewWidth / totalWidth_1);
96579
+ leftColumn.weight = leftNewWeight;
96580
+ rightColumn_1.weight = totalWeight_1 - leftNewWeight;
96581
+ };
96582
+ var onUp_2 = function (e) {
96583
+ header.state.remove(DTableState.RESIZING);
96584
+ interactionManager.off(UtilPointerEvent.move, onMove_2);
96585
+ interactionManager.off(UtilPointerEvent.up, onUp_2);
96586
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
96587
+ interactionManager.off(UtilPointerEvent.cancel, onUp_2);
96588
+ };
96589
+ interactionManager.on(UtilPointerEvent.move, onMove_2);
96590
+ interactionManager.on(UtilPointerEvent.up, onUp_2);
96591
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
96592
+ interactionManager.on(UtilPointerEvent.cancel, onUp_2);
96593
+ }
96079
96594
  };
96080
96595
  Object.defineProperty(DTableHeaderCell.prototype, "sorter", {
96081
96596
  get: function () {
@@ -96110,11 +96625,7 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96110
96625
  });
96111
96626
  Object.defineProperty(DTableHeaderCell.prototype, "comparator", {
96112
96627
  get: function () {
96113
- var column = this._column;
96114
- if (column) {
96115
- return column.sorting.comparator || null;
96116
- }
96117
- return null;
96628
+ return this._column.sorting.comparator || null;
96118
96629
  },
96119
96630
  enumerable: false,
96120
96631
  configurable: true
@@ -96141,8 +96652,8 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96141
96652
  }
96142
96653
  };
96143
96654
  DTableHeaderCell.prototype.toClickPosition = function (e) {
96144
- var checkWork = this._checkWork || new pixi_js.Point();
96145
- this._checkWork = checkWork;
96655
+ var _a;
96656
+ var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
96146
96657
  return e.data.getLocalPosition(this, checkWork).x;
96147
96658
  };
96148
96659
  DTableHeaderCell.prototype.isCheckClicked = function (e) {
@@ -96167,6 +96678,10 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96167
96678
  }
96168
96679
  return false;
96169
96680
  };
96681
+ DTableHeaderCell.prototype.isEdgeClicked = function (e) {
96682
+ return (e instanceof pixi_js.InteractionEvent &&
96683
+ (this.state.is(DTableState.HOVERED_ON_EDGE) || this._wasResizing));
96684
+ };
96170
96685
  DTableHeaderCell.prototype.onClick = function (e) {
96171
96686
  if (this.state.isActionable) {
96172
96687
  this.activate(e);
@@ -96176,13 +96691,15 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96176
96691
  this.onActivate(e);
96177
96692
  };
96178
96693
  DTableHeaderCell.prototype.onActivate = function (e) {
96179
- if (this.isCheckClicked(e)) {
96180
- this.onToggleStart();
96181
- this.onToggleEnd();
96182
- }
96183
- else {
96184
- this.doSort(e);
96185
- this.emit("active", this);
96694
+ if (!this.isEdgeClicked(e)) {
96695
+ if (this.isCheckClicked(e)) {
96696
+ this.onToggleStart();
96697
+ this.onToggleEnd();
96698
+ }
96699
+ else {
96700
+ this.doSort(e);
96701
+ this.emit("active", this);
96702
+ }
96186
96703
  }
96187
96704
  };
96188
96705
  DTableHeaderCell.prototype.doSort = function (e) {
@@ -96212,11 +96729,14 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96212
96729
  };
96213
96730
  Object.defineProperty(DTableHeaderCell.prototype, "isSortable", {
96214
96731
  get: function () {
96215
- var column = this._column;
96216
- if (column) {
96217
- return column.sorting.enable;
96218
- }
96219
- return false;
96732
+ return this._column.sorting.enable;
96733
+ },
96734
+ enumerable: false,
96735
+ configurable: true
96736
+ });
96737
+ Object.defineProperty(DTableHeaderCell.prototype, "isResizable", {
96738
+ get: function () {
96739
+ return this._column.resizable;
96220
96740
  },
96221
96741
  enumerable: false,
96222
96742
  configurable: true
@@ -96306,14 +96826,12 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96306
96826
  */
96307
96827
  var DTableHeader = /** @class */ (function (_super) {
96308
96828
  __extends(DTableHeader, _super);
96309
- function DTableHeader(options) {
96310
- var _a, _b;
96311
- var _this = _super.call(this, options) || this;
96312
- _this._table = (_a = options.table) !== null && _a !== void 0 ? _a : null;
96313
- var offset = (_b = options.offset) !== null && _b !== void 0 ? _b : 0;
96829
+ function DTableHeader(table, columns, frozen, offset, options) {
96830
+ var _this = _super.call(this, columns, frozen, options) || this;
96831
+ _this._table = table;
96314
96832
  _this._offset = offset;
96315
96833
  _this.transform.position.y = offset;
96316
- _this.initCells(options, _this._columns, _this._frozen);
96834
+ _this.initCells();
96317
96835
  return _this;
96318
96836
  }
96319
96837
  Object.defineProperty(DTableHeader.prototype, "table", {
@@ -96336,10 +96854,10 @@ var DTableHeader = /** @class */ (function (_super) {
96336
96854
  return 0;
96337
96855
  };
96338
96856
  DTableHeader.prototype.newCell = function (columnIndex, column, columns, options) {
96339
- return new DTableHeaderCell(this.toCellOptions(columnIndex, column, options));
96857
+ return new DTableHeaderCell(this, columnIndex, column, this.toCellOptions(column, options));
96340
96858
  };
96341
- DTableHeader.prototype.toCellOptions = function (columnIndex, column, options) {
96342
- var result = column.header || options.cell;
96859
+ DTableHeader.prototype.toCellOptions = function (column, options) {
96860
+ var result = column.header || (options === null || options === void 0 ? void 0 : options.cell);
96343
96861
  if (result != null) {
96344
96862
  if (result.weight === undefined) {
96345
96863
  result.weight = column.weight;
@@ -96355,15 +96873,6 @@ var DTableHeader = /** @class */ (function (_super) {
96355
96873
  else if (result.text.value === undefined) {
96356
96874
  result.text.value = column.label;
96357
96875
  }
96358
- if (result.header === undefined) {
96359
- result.header = this;
96360
- }
96361
- if (result.column === undefined) {
96362
- result.column = column;
96363
- }
96364
- if (result.columnIndex === undefined) {
96365
- result.columnIndex = columnIndex;
96366
- }
96367
96876
  return result;
96368
96877
  }
96369
96878
  else {
@@ -96372,10 +96881,7 @@ var DTableHeader = /** @class */ (function (_super) {
96372
96881
  width: column.width,
96373
96882
  text: {
96374
96883
  value: column.label
96375
- },
96376
- header: this,
96377
- column: column,
96378
- columnIndex: columnIndex
96884
+ }
96379
96885
  };
96380
96886
  }
96381
96887
  };
@@ -96396,10 +96902,6 @@ var DTableScrollBar = /** @class */ (function (_super) {
96396
96902
  return DTableScrollBar;
96397
96903
  }(DPaneScrollBar));
96398
96904
 
96399
- /*
96400
- * Copyright (C) 2019 Toshiba Corporation
96401
- * SPDX-License-Identifier: Apache-2.0
96402
- */
96403
96905
  var defaultGetter = function (row, columnIndex) {
96404
96906
  return row[columnIndex];
96405
96907
  };
@@ -96460,7 +96962,7 @@ var toPathSetter = function (path) {
96460
96962
  };
96461
96963
  }
96462
96964
  };
96463
- var toColumnAlign = function (options, type) {
96965
+ var toAlign = function (options, type) {
96464
96966
  var align = options.align;
96465
96967
  if (align != null) {
96466
96968
  if (isString(align)) {
@@ -96490,7 +96992,7 @@ var toColumnAlign = function (options, type) {
96490
96992
  return DAlignHorizontal.LEFT;
96491
96993
  }
96492
96994
  };
96493
- var toColumnDataChecker = function (path) {
96995
+ var toDataChecker = function (path) {
96494
96996
  if (path != null) {
96495
96997
  var pathLength_1 = path.length;
96496
96998
  if (pathLength_1 <= 1) {
@@ -96518,9 +97020,9 @@ var toColumnDataChecker = function (path) {
96518
97020
  return columnIndex < row.length;
96519
97021
  };
96520
97022
  };
96521
- var toColumnEditingEnable = function (enable, path) {
97023
+ var toEditingEnable = function (enable, path) {
96522
97024
  if (isString(enable)) {
96523
- return toColumnDataChecker(path);
97025
+ return toDataChecker(path);
96524
97026
  }
96525
97027
  else if (enable != null) {
96526
97028
  return enable;
@@ -96529,20 +97031,20 @@ var toColumnEditingEnable = function (enable, path) {
96529
97031
  return false;
96530
97032
  }
96531
97033
  };
96532
- var toColumnEditing = function (options, path) {
97034
+ var toEditing = function (options, path) {
96533
97035
  var _a;
96534
97036
  var editing = options.editing;
96535
97037
  var editable = options.editable;
96536
97038
  if (editing) {
96537
97039
  return {
96538
- enable: toColumnEditingEnable((_a = editing.enable) !== null && _a !== void 0 ? _a : editable, path),
97040
+ enable: toEditingEnable((_a = editing.enable) !== null && _a !== void 0 ? _a : editable, path),
96539
97041
  formatter: editing.formatter,
96540
97042
  unformatter: editing.unformatter,
96541
97043
  validator: editing.validator
96542
97044
  };
96543
97045
  }
96544
97046
  return {
96545
- enable: toColumnEditingEnable(editable, path)
97047
+ enable: toEditingEnable(editable, path)
96546
97048
  };
96547
97049
  };
96548
97050
  var toComparator = function (getter, index) {
@@ -96552,7 +97054,7 @@ var toComparator = function (getter, index) {
96552
97054
  return valueA < valueB ? -1 : valueB < valueA ? +1 : 0;
96553
97055
  };
96554
97056
  };
96555
- var toColumnSorting = function (getter, index, options) {
97057
+ var toSorting = function (getter, index, options) {
96556
97058
  var sorting = options.sorting;
96557
97059
  var sortable = options.sortable;
96558
97060
  if (sorting) {
@@ -96576,7 +97078,7 @@ var toColumnSorting = function (getter, index, options) {
96576
97078
  enable: false
96577
97079
  };
96578
97080
  };
96579
- var toColumnMenu = function (options) {
97081
+ var toMenu = function (options) {
96580
97082
  if (options == null) {
96581
97083
  return undefined;
96582
97084
  }
@@ -96587,7 +97089,7 @@ var toColumnMenu = function (options) {
96587
97089
  return new DMenu(options);
96588
97090
  }
96589
97091
  };
96590
- var toColumnDialog = function (options) {
97092
+ var toDialog = function (options) {
96591
97093
  if (options == null) {
96592
97094
  return undefined;
96593
97095
  }
@@ -96604,14 +97106,14 @@ var defaultSelectingGetter = function (dialog) {
96604
97106
  var defaultSelectingSetter = function () {
96605
97107
  // DO NOTHING
96606
97108
  };
96607
- var toColumnSelecting = function (options) {
97109
+ var toSelecting = function (options) {
96608
97110
  if (options) {
96609
97111
  return {
96610
97112
  getter: options.getter || defaultSelectingGetter,
96611
97113
  setter: options.setter || defaultSelectingSetter,
96612
- menu: toColumnMenu(options.menu),
96613
- multiple: toColumnMenu(options.multiple),
96614
- dialog: toColumnDialog(options.dialog),
97114
+ menu: toMenu(options.menu),
97115
+ multiple: toMenu(options.multiple),
97116
+ dialog: toDialog(options.dialog),
96615
97117
  promise: options.promise
96616
97118
  };
96617
97119
  }
@@ -96620,7 +97122,7 @@ var toColumnSelecting = function (options) {
96620
97122
  setter: defaultSelectingSetter
96621
97123
  };
96622
97124
  };
96623
- var toColumnGetter = function (options, type, parts) {
97125
+ var toGetter = function (options, type, parts) {
96624
97126
  var getter = options.getter;
96625
97127
  if (getter) {
96626
97128
  return getter;
@@ -96638,7 +97140,7 @@ var toColumnGetter = function (options, type, parts) {
96638
97140
  }
96639
97141
  }
96640
97142
  };
96641
- var toColumnSetter = function (options, type, path) {
97143
+ var toSetter = function (options, type, path) {
96642
97144
  var setter = options.setter;
96643
97145
  if (setter) {
96644
97146
  return setter;
@@ -96657,7 +97159,7 @@ var toColumnSetter = function (options, type, path) {
96657
97159
  }
96658
97160
  }
96659
97161
  };
96660
- var toColumnState = function (options) {
97162
+ var toState = function (options) {
96661
97163
  var state = options.state;
96662
97164
  if (state != null) {
96663
97165
  if (isString(state) || isArray(state)) {
@@ -96678,155 +97180,445 @@ var toColumnState = function (options) {
96678
97180
  modifier: undefined
96679
97181
  };
96680
97182
  };
96681
- var toColumnPath = function (options) {
97183
+ var toPath = function (options) {
96682
97184
  return options.path != null ? options.path.split(".") : null;
96683
97185
  };
96684
- var toColumnRenderable = function (options, path) {
97186
+ var toRenderable = function (options, path) {
96685
97187
  var renderable = options.renderable;
96686
97188
  if (isString(renderable)) {
96687
- return toColumnDataChecker(path);
97189
+ return toDataChecker(path);
96688
97190
  }
96689
97191
  else if (renderable != null) {
96690
97192
  return renderable;
96691
97193
  }
96692
97194
  return true;
96693
97195
  };
96694
- var toColumn = function (index, options) {
96695
- var _a, _b;
96696
- var weight = options.weight;
96697
- var width = options.width;
96698
- if (weight != null) {
96699
- if (width != null) {
96700
- width = undefined;
96701
- }
96702
- }
96703
- else if (width == null) {
96704
- weight = 1;
96705
- }
96706
- var type = toEnum((_a = options.type) !== null && _a !== void 0 ? _a : DTableColumnType.TEXT, DTableColumnType);
96707
- var align = toColumnAlign(options, type);
96708
- var label = options.label || "";
96709
- var path = toColumnPath(options);
96710
- var getter = toColumnGetter(options, type, path);
96711
- var setter = toColumnSetter(options, type, path);
96712
- return {
96713
- weight: weight,
96714
- width: width,
96715
- type: type,
96716
- label: label,
96717
- getter: getter,
96718
- setter: setter,
96719
- formatter: options.formatter,
96720
- renderable: toColumnRenderable(options, path),
96721
- align: align,
96722
- state: toColumnState(options),
96723
- editing: toColumnEditing(options, path),
96724
- sorting: toColumnSorting(getter, index, options),
96725
- header: options.header,
96726
- body: options.body,
96727
- selecting: toColumnSelecting(options.selecting),
96728
- category: options.category,
96729
- frozen: options.frozen,
96730
- offset: 0.0,
96731
- link: options.link,
96732
- update: toEnum((_b = options.update) !== null && _b !== void 0 ? _b : DTableColumnUpdate.CELL, DTableColumnUpdate)
96733
- };
96734
- };
96735
- var toColumns = function (options) {
96736
- var result = [];
96737
- for (var i = 0, imax = options.length; i < imax; ++i) {
96738
- result.push(toColumn(i, options[i]));
97196
+ var DTableColumnImpl = /** @class */ (function (_super) {
97197
+ __extends(DTableColumnImpl, _super);
97198
+ function DTableColumnImpl(index, options) {
97199
+ var _a, _b, _c;
97200
+ var _this = _super.call(this) || this;
97201
+ var weight = options.weight;
97202
+ var width = options.width;
97203
+ if (weight != null) {
97204
+ if (width != null) {
97205
+ width = undefined;
97206
+ }
97207
+ }
97208
+ else if (width == null) {
97209
+ weight = 1;
97210
+ }
97211
+ var type = toEnum((_a = options.type) !== null && _a !== void 0 ? _a : DTableColumnType.TEXT, DTableColumnType);
97212
+ var align = toAlign(options, type);
97213
+ var label = options.label || "";
97214
+ var path = toPath(options);
97215
+ var getter = toGetter(options, type, path);
97216
+ var setter = toSetter(options, type, path);
97217
+ _this._weight = weight;
97218
+ _this._width = width;
97219
+ _this.resizable = (_b = options.resizable) !== null && _b !== void 0 ? _b : false;
97220
+ _this.type = type;
97221
+ _this.label = label;
97222
+ _this.getter = getter;
97223
+ _this.setter = setter;
97224
+ _this.formatter = options.formatter;
97225
+ _this.renderable = toRenderable(options, path);
97226
+ _this.align = align;
97227
+ _this.state = toState(options);
97228
+ _this.editing = toEditing(options, path);
97229
+ _this.sorting = toSorting(getter, index, options);
97230
+ _this.header = options.header;
97231
+ _this.body = options.body;
97232
+ _this.selecting = toSelecting(options.selecting);
97233
+ _this.category = options.category;
97234
+ _this.frozen = options.frozen;
97235
+ _this.offset = 0.0;
97236
+ _this.link = options.link;
97237
+ _this.update = toEnum((_c = options.update) !== null && _c !== void 0 ? _c : DTableColumnUpdate.CELL, DTableColumnUpdate);
97238
+ return _this;
96739
97239
  }
96740
- return result;
96741
- };
96742
- var toFrozen = function (columns) {
96743
- for (var i = columns.length - 1; 0 <= i; --i) {
96744
- if (columns[i].frozen === true) {
96745
- return i + 1;
97240
+ Object.defineProperty(DTableColumnImpl.prototype, "weight", {
97241
+ get: function () {
97242
+ return this._weight;
97243
+ },
97244
+ set: function (weight) {
97245
+ if (this._weight != null && this._weight !== weight) {
97246
+ this._weight = weight;
97247
+ this.emit("resize", this);
97248
+ }
97249
+ },
97250
+ enumerable: false,
97251
+ configurable: true
97252
+ });
97253
+ Object.defineProperty(DTableColumnImpl.prototype, "width", {
97254
+ get: function () {
97255
+ return this._width;
97256
+ },
97257
+ set: function (width) {
97258
+ if (this._width != null && this._width !== width) {
97259
+ this._width = width;
97260
+ this.emit("resize", this);
97261
+ }
97262
+ },
97263
+ enumerable: false,
97264
+ configurable: true
97265
+ });
97266
+ return DTableColumnImpl;
97267
+ }(pixi_js.utils.EventEmitter));
97268
+
97269
+ var DTableColumnContainerImpl = /** @class */ (function (_super) {
97270
+ __extends(DTableColumnContainerImpl, _super);
97271
+ function DTableColumnContainerImpl(parent, options) {
97272
+ var _this = _super.call(this) || this;
97273
+ _this.parent = parent;
97274
+ var columns = [];
97275
+ if (options != null) {
97276
+ for (var i = 0, imax = options.length; i < imax; ++i) {
97277
+ var column = new DTableColumnImpl(i, options[i]);
97278
+ columns.push(column);
97279
+ column.on("resize", _this.newOnColumnResize(i, column));
97280
+ }
97281
+ }
97282
+ _this.items = columns;
97283
+ var frozen = 0;
97284
+ for (var i = columns.length - 1; 0 <= i; --i) {
97285
+ if (columns[i].frozen === true) {
97286
+ frozen = i + 1;
97287
+ break;
97288
+ }
96746
97289
  }
97290
+ _this.frozen = frozen;
97291
+ return _this;
96747
97292
  }
96748
- return 0;
96749
- };
96750
- var DTable = /** @class */ (function (_super) {
96751
- __extends(DTable, _super);
96752
- function DTable(options) {
96753
- var _this = _super.call(this, options) || this;
96754
- var content = _this.content;
96755
- content.setWidth(_this.toContentWidth(options));
96756
- var body = _this.body;
96757
- content.addChild(body);
96758
- if (body.data.selection.type !== DTableDataSelectionType.NONE) {
96759
- _this.on(UtilPointerEvent.tap, function (e) {
96760
- body.onRowClick(e);
96761
- });
97293
+ DTableColumnContainerImpl.prototype.newOnColumnResize = function (index, column) {
97294
+ var _this = this;
97295
+ return function () {
97296
+ _this.onColumnResize(index, column);
97297
+ };
97298
+ };
97299
+ DTableColumnContainerImpl.prototype.onColumnResize = function (index, column) {
97300
+ this.onColumnResizeHeader(index, column);
97301
+ this.onColumnResizeBody(index, column);
97302
+ this.emit("resize", index, column, this);
97303
+ };
97304
+ DTableColumnContainerImpl.prototype.onColumnResizeHeader = function (index, column) {
97305
+ var header = this.parent.header;
97306
+ if (header != null) {
97307
+ var columnWeight = column.weight;
97308
+ if (columnWeight != null) {
97309
+ this.onColumnResizeWeight(header, index, columnWeight);
97310
+ }
97311
+ else {
97312
+ var columnWidth = column.width;
97313
+ if (columnWidth != null) {
97314
+ this.onColumnResizeWidth(header, index, columnWidth);
97315
+ }
97316
+ }
96762
97317
  }
96763
- var header = _this.header;
96764
- if (header) {
96765
- content.addChild(header);
97318
+ };
97319
+ DTableColumnContainerImpl.prototype.onColumnResizeBody = function (index, column) {
97320
+ var rows = this.parent.body.children;
97321
+ var columnWeight = column.weight;
97322
+ if (columnWeight != null) {
97323
+ for (var i = 0, imax = rows.length; i < imax; ++i) {
97324
+ this.onColumnResizeWeight(rows[i], index, columnWeight);
97325
+ }
96766
97326
  }
96767
- var categories = _this.categories;
96768
- for (var i = categories.length - 1; 0 <= i; --i) {
96769
- content.addChild(categories[i]);
97327
+ else {
97328
+ var columnWidth = column.width;
97329
+ if (columnWidth != null) {
97330
+ for (var i = 0, imax = rows.length; i < imax; ++i) {
97331
+ this.onColumnResizeWidth(rows[i], index, columnWidth);
97332
+ }
97333
+ }
96770
97334
  }
96771
- body.update();
97335
+ };
97336
+ DTableColumnContainerImpl.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
97337
+ var cells = row.children;
97338
+ var cellsLength = cells.length;
97339
+ var cellsIndex = cellsLength - index - 1;
97340
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
97341
+ cells[cellsIndex].weight = columnWeight;
97342
+ }
97343
+ };
97344
+ DTableColumnContainerImpl.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
97345
+ var cells = row.children;
97346
+ var cellsLength = cells.length;
97347
+ var cellsIndex = cellsLength - index - 1;
97348
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
97349
+ cells[cellsIndex].width = columnWidth;
97350
+ }
97351
+ };
97352
+ Object.defineProperty(DTableColumnContainerImpl.prototype, "width", {
97353
+ get: function () {
97354
+ var result = 0;
97355
+ var items = this.items;
97356
+ var length = items.length;
97357
+ for (var i = 0; i < length; ++i) {
97358
+ var item = items[i];
97359
+ var itemWidth = item.width;
97360
+ if (itemWidth != null) {
97361
+ result += itemWidth;
97362
+ }
97363
+ }
97364
+ return result;
97365
+ },
97366
+ enumerable: false,
97367
+ configurable: true
97368
+ });
97369
+ DTableColumnContainerImpl.prototype.get = function (index) {
97370
+ var columns = this.items;
97371
+ if (0 <= index && index < columns.length) {
97372
+ return columns[index];
97373
+ }
97374
+ return null;
97375
+ };
97376
+ DTableColumnContainerImpl.prototype.each = function (iteratee) {
97377
+ var columns = this.items;
97378
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
97379
+ if (iteratee(columns[i], i) === false) {
97380
+ break;
97381
+ }
97382
+ }
97383
+ return this;
97384
+ };
97385
+ DTableColumnContainerImpl.prototype.size = function () {
97386
+ return this.items.length;
97387
+ };
97388
+ return DTableColumnContainerImpl;
97389
+ }(pixi_js.utils.EventEmitter));
97390
+
97391
+ /*
97392
+ * Copyright (C) 2019 Toshiba Corporation
97393
+ * SPDX-License-Identifier: Apache-2.0
97394
+ */
97395
+ var DTableCategoryColumnImpl = /** @class */ (function (_super) {
97396
+ __extends(DTableCategoryColumnImpl, _super);
97397
+ function DTableCategoryColumnImpl(index, column) {
97398
+ var _this = _super.call(this) || this;
97399
+ // Label
97400
+ var category = column.category;
97401
+ if (category) {
97402
+ if (isString(category)) {
97403
+ if (index === 0) {
97404
+ _this.label = category;
97405
+ }
97406
+ }
97407
+ else {
97408
+ if (index < category.length) {
97409
+ _this.label = category[index];
97410
+ }
97411
+ }
97412
+ }
97413
+ _this._weight = column.weight;
97414
+ _this._width = column.width;
97415
+ _this._isLocked = false;
97416
+ _this.offset = 0.0;
97417
+ _this._columns = [column];
97418
+ _this._nresizable = column.resizable ? 1 : 0;
97419
+ var onResizeBound = function () {
97420
+ _this.onResize();
97421
+ };
97422
+ _this._onResizeBound = onResizeBound;
97423
+ column.on("resize", onResizeBound);
96772
97424
  return _this;
96773
97425
  }
96774
- Object.defineProperty(DTable.prototype, "columns", {
97426
+ DTableCategoryColumnImpl.prototype.onResize = function () {
97427
+ if (this._isLocked) {
97428
+ return;
97429
+ }
97430
+ var columns = this._columns;
97431
+ if (this._weight != null) {
97432
+ var newWeight = 0;
97433
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
97434
+ var weight = columns[i].weight;
97435
+ if (weight != null) {
97436
+ newWeight += weight;
97437
+ }
97438
+ }
97439
+ if (this._weight !== newWeight) {
97440
+ this._weight = newWeight;
97441
+ this.emit("resize", this);
97442
+ }
97443
+ }
97444
+ else {
97445
+ var newWidth = 0;
97446
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
97447
+ var width = columns[i].width;
97448
+ if (width != null) {
97449
+ newWidth += width;
97450
+ }
97451
+ }
97452
+ if (this._width !== newWidth) {
97453
+ this._width = newWidth;
97454
+ this.emit("resize", this);
97455
+ }
97456
+ }
97457
+ };
97458
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "resizable", {
96775
97459
  get: function () {
96776
- var result = this._columns;
96777
- if (result == null) {
96778
- var options = this._options;
96779
- result = options ? toColumns(options.columns) : [];
96780
- this._columns = result;
97460
+ return 0 < this._nresizable;
97461
+ },
97462
+ enumerable: false,
97463
+ configurable: true
97464
+ });
97465
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "weight", {
97466
+ get: function () {
97467
+ return this._weight;
97468
+ },
97469
+ set: function (weight) {
97470
+ var oldWeight = this._weight;
97471
+ var nresizable = this._nresizable;
97472
+ if (0 < nresizable && oldWeight != null && oldWeight !== weight) {
97473
+ var columns = this._columns;
97474
+ var columnsLength = columns.length;
97475
+ var minWeight = this.minWeight;
97476
+ var newWeight = Math.max(minWeight, weight);
97477
+ if (this._weight !== newWeight) {
97478
+ this._isLocked = true;
97479
+ if (minWeight < oldWeight) {
97480
+ var columnWeightRatio = (newWeight - minWeight) / (oldWeight - minWeight);
97481
+ for (var i = 0; i < columnsLength; ++i) {
97482
+ var column = columns[i];
97483
+ var columnWeight = column.weight;
97484
+ if (column.resizable && columnWeight != null) {
97485
+ column.weight = columnWeight * columnWeightRatio;
97486
+ }
97487
+ }
97488
+ }
97489
+ else {
97490
+ var newColumnWeight = (newWeight - minWeight) / this._nresizable;
97491
+ for (var i = 0; i < columnsLength; ++i) {
97492
+ var column = columns[i];
97493
+ var columnWeight = column.weight;
97494
+ if (column.resizable && columnWeight != null) {
97495
+ column.weight = newColumnWeight;
97496
+ }
97497
+ }
97498
+ }
97499
+ this._isLocked = false;
97500
+ this.onResize();
97501
+ }
96781
97502
  }
96782
- return result;
96783
97503
  },
96784
97504
  enumerable: false,
96785
97505
  configurable: true
96786
97506
  });
96787
- Object.defineProperty(DTable.prototype, "frozen", {
97507
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWeight", {
96788
97508
  get: function () {
96789
- var result = this._frozen;
96790
- if (result == null) {
96791
- result = toFrozen(this.columns);
96792
- this._frozen = result;
97509
+ var result = 0;
97510
+ var columns = this._columns;
97511
+ var columnsLength = columns.length;
97512
+ for (var i = 0; i < columnsLength; ++i) {
97513
+ var column = columns[i];
97514
+ var columnWeight = column.weight;
97515
+ if (!column.resizable && columnWeight != null) {
97516
+ result += columnWeight;
97517
+ }
96793
97518
  }
96794
97519
  return result;
96795
97520
  },
96796
97521
  enumerable: false,
96797
97522
  configurable: true
96798
97523
  });
96799
- Object.defineProperty(DTable.prototype, "categories", {
97524
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "width", {
96800
97525
  get: function () {
96801
- var result = this._categories;
96802
- if (result == null) {
96803
- result = this.newCategories(this._options, this.columns, this.frozen);
96804
- this._categories = result;
97526
+ return this._width;
97527
+ },
97528
+ set: function (width) {
97529
+ var oldWidth = this._width;
97530
+ var nresizable = this._nresizable;
97531
+ if (0 < nresizable && oldWidth != null && oldWidth !== width) {
97532
+ var columns = this._columns;
97533
+ var columnsLength = columns.length;
97534
+ var minWidth = this.minWidth;
97535
+ var newWidth = Math.max(minWidth, width);
97536
+ if (oldWidth !== newWidth) {
97537
+ this._isLocked = true;
97538
+ if (minWidth < oldWidth) {
97539
+ var columnWidthRatio = (newWidth - minWidth) / (oldWidth - minWidth);
97540
+ for (var i = 0; i < columnsLength; ++i) {
97541
+ var column = columns[i];
97542
+ var columnWidth = column.width;
97543
+ if (column.resizable && columnWidth != null) {
97544
+ column.width = columnWidth * columnWidthRatio;
97545
+ }
97546
+ }
97547
+ }
97548
+ else {
97549
+ var newColumnWidth = (newWidth - minWidth) / this._nresizable;
97550
+ for (var i = 0; i < columnsLength; ++i) {
97551
+ var column = columns[i];
97552
+ var columnWidth = column.width;
97553
+ if (column.resizable && columnWidth != null) {
97554
+ column.width = newColumnWidth;
97555
+ }
97556
+ }
97557
+ }
97558
+ this._isLocked = false;
97559
+ this.onResize();
97560
+ }
97561
+ }
97562
+ },
97563
+ enumerable: false,
97564
+ configurable: true
97565
+ });
97566
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWidth", {
97567
+ get: function () {
97568
+ var result = 0;
97569
+ var columns = this._columns;
97570
+ var columnsLength = columns.length;
97571
+ for (var i = 0; i < columnsLength; ++i) {
97572
+ var column = columns[i];
97573
+ var columnWidth = column.width;
97574
+ if (!column.resizable && columnWidth != null) {
97575
+ result += columnWidth;
97576
+ }
96805
97577
  }
96806
97578
  return result;
96807
97579
  },
96808
97580
  enumerable: false,
96809
97581
  configurable: true
96810
97582
  });
96811
- DTable.prototype.initContent = function (content) {
96812
- _super.prototype.initContent.call(this, content);
96813
- content.state.isFocusReverse = true;
96814
- };
96815
- DTable.prototype.onContentChange = function () {
96816
- _super.prototype.onContentChange.call(this);
96817
- this.body.update();
96818
- };
96819
- DTable.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
96820
- var scrollbar = this.scrollbar;
96821
- scrollbar.lock();
96822
- var body = this.body;
96823
- body.lock();
96824
- _super.prototype.onResize.call(this, newWidth, newHeight, oldWidth, oldHeight);
96825
- body.update();
96826
- body.unlock(true);
96827
- scrollbar.unlock(true);
97583
+ DTableCategoryColumnImpl.prototype.add = function (column) {
97584
+ this._columns.push(column);
97585
+ if (this._weight != null) {
97586
+ var weight = column.weight;
97587
+ if (weight != null) {
97588
+ this._weight += weight;
97589
+ if (column.resizable) {
97590
+ this._nresizable += 1;
97591
+ }
97592
+ column.on("resize", this._onResizeBound);
97593
+ }
97594
+ }
97595
+ else if (this._width != null) {
97596
+ var width = column.width;
97597
+ if (width != null) {
97598
+ this._width += width;
97599
+ if (column.resizable) {
97600
+ this._nresizable += 1;
97601
+ }
97602
+ column.on("resize", this._onResizeBound);
97603
+ }
97604
+ }
96828
97605
  };
96829
- DTable.prototype.getCategoryCount = function (columns) {
97606
+ return DTableCategoryColumnImpl;
97607
+ }(pixi_js.utils.EventEmitter));
97608
+
97609
+ var DTableCategoryContainerImpl = /** @class */ (function () {
97610
+ function DTableCategoryContainerImpl(columns, frozen, options) {
97611
+ var count = this.toCount(columns);
97612
+ var items = [];
97613
+ var offset = 0;
97614
+ for (var i = count - 1; 0 <= i; --i) {
97615
+ var item = new DTableCategory(this.toColumns(i, columns, frozen), frozen, offset, options);
97616
+ items.push(item);
97617
+ offset += item.height;
97618
+ }
97619
+ this.items = items;
97620
+ }
97621
+ DTableCategoryContainerImpl.prototype.toCount = function (columns) {
96830
97622
  var result = 0;
96831
97623
  for (var i = 0, imax = columns.length; i < imax; ++i) {
96832
97624
  var category = columns[i].category;
@@ -96837,22 +97629,7 @@ var DTable = /** @class */ (function (_super) {
96837
97629
  }
96838
97630
  return result;
96839
97631
  };
96840
- DTable.prototype.toCategoryLabel = function (index, category) {
96841
- if (category) {
96842
- if (isString(category)) {
96843
- if (index === 0) {
96844
- return category;
96845
- }
96846
- }
96847
- else {
96848
- if (index < category.length) {
96849
- return category[index];
96850
- }
96851
- }
96852
- }
96853
- return undefined;
96854
- };
96855
- DTable.prototype.isSameCategory = function (index, a, b) {
97632
+ DTableCategoryContainerImpl.prototype.isCategory = function (index, a, b) {
96856
97633
  if (a != null) {
96857
97634
  if (b != null) {
96858
97635
  if (isString(a)) {
@@ -96941,7 +97718,7 @@ var DTable = /** @class */ (function (_super) {
96941
97718
  }
96942
97719
  }
96943
97720
  };
96944
- DTable.prototype.toCategoryColumns = function (index, columns, frozen) {
97721
+ DTableCategoryContainerImpl.prototype.toColumns = function (index, columns, frozen) {
96945
97722
  var result = [];
96946
97723
  var tcolumn = null;
96947
97724
  var ccolumn = null;
@@ -96950,66 +97727,119 @@ var DTable = /** @class */ (function (_super) {
96950
97727
  if (i !== frozen &&
96951
97728
  ccolumn &&
96952
97729
  tcolumn &&
96953
- this.isSameCategory(index, tcolumn.category, column.category)) {
97730
+ this.isCategory(index, tcolumn.category, column.category)) {
96954
97731
  if (ccolumn.weight != null && column.weight != null) {
96955
- ccolumn.weight += column.weight;
97732
+ ccolumn.add(column);
96956
97733
  }
96957
97734
  else if (ccolumn.width != null && column.width != null) {
96958
- ccolumn.width += column.width;
97735
+ ccolumn.add(column);
96959
97736
  }
96960
97737
  else {
96961
97738
  tcolumn = column;
96962
- ccolumn = {
96963
- label: this.toCategoryLabel(index, column.category),
96964
- weight: column.weight,
96965
- width: column.width,
96966
- offset: 0.0
96967
- };
97739
+ ccolumn = new DTableCategoryColumnImpl(index, column);
96968
97740
  result.push(ccolumn);
96969
97741
  }
96970
97742
  }
96971
97743
  else {
96972
97744
  tcolumn = column;
96973
- ccolumn = {
96974
- label: this.toCategoryLabel(index, column.category),
96975
- weight: column.weight,
96976
- width: column.width,
96977
- offset: 0.0
96978
- };
97745
+ ccolumn = new DTableCategoryColumnImpl(index, column);
96979
97746
  result.push(ccolumn);
96980
97747
  }
96981
97748
  }
96982
97749
  return result;
96983
97750
  };
96984
- DTable.prototype.toCategoryOptions = function (index, options, columns, frozen, offset) {
96985
- if (options) {
96986
- if (options.columns === undefined) {
96987
- options.columns = this.toCategoryColumns(index, columns, frozen);
96988
- }
96989
- if (options.frozen == null) {
96990
- options.frozen = frozen;
96991
- }
96992
- if (options.offset == null) {
96993
- options.offset = offset;
96994
- }
96995
- return options;
97751
+ return DTableCategoryContainerImpl;
97752
+ }());
97753
+
97754
+ /*
97755
+ * Copyright (C) 2019 Toshiba Corporation
97756
+ * SPDX-License-Identifier: Apache-2.0
97757
+ */
97758
+ var DTable = /** @class */ (function (_super) {
97759
+ __extends(DTable, _super);
97760
+ function DTable(options) {
97761
+ var _this = _super.call(this, options) || this;
97762
+ var content = _this.content;
97763
+ var body = _this.body;
97764
+ content.addChild(body);
97765
+ if (body.data.selection.type !== DTableDataSelectionType.NONE) {
97766
+ _this.on(UtilPointerEvent.tap, function (e) {
97767
+ body.onRowClick(e);
97768
+ });
96996
97769
  }
96997
- return {
96998
- columns: this.toCategoryColumns(index, columns, frozen),
96999
- frozen: frozen,
97000
- offset: offset
97001
- };
97002
- };
97003
- DTable.prototype.newCategories = function (options, columns, frozen) {
97004
- var count = this.getCategoryCount(columns);
97005
- var result = [];
97006
- var offset = 0;
97007
- for (var i = count - 1; 0 <= i; --i) {
97008
- var category = new DTableCategory(this.toCategoryOptions(i, options === null || options === void 0 ? void 0 : options.category, columns, frozen, offset));
97009
- result.push(category);
97010
- offset += category.height;
97770
+ var header = _this.header;
97771
+ if (header) {
97772
+ content.addChild(header);
97011
97773
  }
97012
- return result;
97774
+ var categories = _this.categories;
97775
+ for (var i = categories.length - 1; 0 <= i; --i) {
97776
+ content.addChild(categories[i]);
97777
+ }
97778
+ body.update();
97779
+ return _this;
97780
+ }
97781
+ Object.defineProperty(DTable.prototype, "column", {
97782
+ get: function () {
97783
+ var _a;
97784
+ return ((_a = this._column) !== null && _a !== void 0 ? _a : (this._column = this.newColumn()));
97785
+ },
97786
+ enumerable: false,
97787
+ configurable: true
97788
+ });
97789
+ DTable.prototype.newColumn = function () {
97790
+ var _a;
97791
+ return new DTableColumnContainerImpl(this, (_a = this._options) === null || _a === void 0 ? void 0 : _a.columns);
97792
+ };
97793
+ Object.defineProperty(DTable.prototype, "columns", {
97794
+ get: function () {
97795
+ return this.column.items;
97796
+ },
97797
+ enumerable: false,
97798
+ configurable: true
97799
+ });
97800
+ Object.defineProperty(DTable.prototype, "frozen", {
97801
+ get: function () {
97802
+ return this.column.frozen;
97803
+ },
97804
+ enumerable: false,
97805
+ configurable: true
97806
+ });
97807
+ Object.defineProperty(DTable.prototype, "category", {
97808
+ get: function () {
97809
+ return (this._category = this.newCategory());
97810
+ },
97811
+ enumerable: false,
97812
+ configurable: true
97813
+ });
97814
+ DTable.prototype.newCategory = function () {
97815
+ var _a;
97816
+ var column = this.column;
97817
+ return new DTableCategoryContainerImpl(column.items, column.frozen, (_a = this._options) === null || _a === void 0 ? void 0 : _a.category);
97818
+ };
97819
+ Object.defineProperty(DTable.prototype, "categories", {
97820
+ get: function () {
97821
+ return this.category.items;
97822
+ },
97823
+ enumerable: false,
97824
+ configurable: true
97825
+ });
97826
+ DTable.prototype.initContent = function (content) {
97827
+ _super.prototype.initContent.call(this, content);
97828
+ content.state.isFocusReverse = true;
97829
+ };
97830
+ DTable.prototype.onContentChange = function () {
97831
+ _super.prototype.onContentChange.call(this);
97832
+ this.body.update();
97833
+ };
97834
+ DTable.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
97835
+ var scrollbar = this.scrollbar;
97836
+ scrollbar.lock();
97837
+ var body = this.body;
97838
+ body.lock();
97839
+ _super.prototype.onResize.call(this, newWidth, newHeight, oldWidth, oldHeight);
97840
+ body.update();
97841
+ body.unlock(true);
97842
+ scrollbar.unlock(true);
97013
97843
  };
97014
97844
  DTable.prototype.onDblClick = function (e, interactionManager) {
97015
97845
  var result = this.body.onDblClick(e, interactionManager);
@@ -97021,24 +97851,35 @@ var DTable = /** @class */ (function (_super) {
97021
97851
  _this.onScrollBarUpdate(isRegionVisible);
97022
97852
  });
97023
97853
  };
97024
- DTable.prototype.toContentWidth = function (options) {
97025
- var columnWidthTotal = 0;
97026
- var columns = options === null || options === void 0 ? void 0 : options.columns;
97027
- if (columns) {
97028
- for (var i = 0, imax = columns.length; i < imax; ++i) {
97029
- var column = columns[i];
97030
- var columnWidth = column.width;
97031
- if (columnWidth != null) {
97032
- columnWidthTotal += columnWidth;
97033
- }
97034
- }
97854
+ DTable.prototype.newContent = function (options) {
97855
+ var _this = this;
97856
+ var result = _super.prototype.newContent.call(this, options);
97857
+ // X & Width
97858
+ var column = this.column;
97859
+ var columnWidth = column.width;
97860
+ if (0 < columnWidth) {
97861
+ column.on("resize", function () {
97862
+ columnWidth = column.width;
97863
+ var parentWidth = _this.width;
97864
+ var parentHeight = _this.height;
97865
+ var newWidth = Math.max(parentWidth, columnWidth);
97866
+ var newXMin = parentWidth - newWidth;
97867
+ // The X position must be in [newXMin, 0].
97868
+ if (result.x < newXMin) {
97869
+ result.x = newXMin;
97870
+ }
97871
+ // Force the with reevaluated
97872
+ result.onParentResize(parentWidth, parentHeight, _this.padding);
97873
+ });
97874
+ result.setWidth(function (p) {
97875
+ return Math.max(p, columnWidth);
97876
+ });
97035
97877
  }
97036
- if (0 < columnWidthTotal) {
97037
- return function (p) {
97038
- return Math.max(p, columnWidthTotal);
97039
- };
97878
+ else {
97879
+ result.setWidth("100%");
97040
97880
  }
97041
- return "100%";
97881
+ // Done
97882
+ return result;
97042
97883
  };
97043
97884
  DTable.prototype.getHeaderOffset = function () {
97044
97885
  var result = this._headerOffset;
@@ -97060,7 +97901,7 @@ var DTable = /** @class */ (function (_super) {
97060
97901
  get: function () {
97061
97902
  var result = this._header;
97062
97903
  if (result === undefined) {
97063
- result = this.newHeader(this._options, this.columns, this.frozen, this.getHeaderOffset());
97904
+ result = this.newHeader();
97064
97905
  this._header = result;
97065
97906
  }
97066
97907
  return result;
@@ -97079,42 +97920,17 @@ var DTable = /** @class */ (function (_super) {
97079
97920
  }
97080
97921
  return false;
97081
97922
  };
97082
- DTable.prototype.newHeader = function (options, columns, frozen, offset) {
97923
+ DTable.prototype.newHeader = function () {
97924
+ var options = this._options;
97083
97925
  if (this.hasHeader(options)) {
97084
- return new DTableHeader(this.toHeaderOptions(options === null || options === void 0 ? void 0 : options.header, columns, frozen, offset));
97926
+ var column = this.column;
97927
+ return new DTableHeader(this, column.items, column.frozen, this.getHeaderOffset(), options === null || options === void 0 ? void 0 : options.header);
97085
97928
  }
97086
97929
  return null;
97087
97930
  };
97088
- DTable.prototype.toHeaderOptions = function (options, columns, frozen, offset) {
97089
- if (options) {
97090
- if (options.columns === undefined) {
97091
- options.columns = columns;
97092
- }
97093
- if (options.frozen == null) {
97094
- options.frozen = frozen;
97095
- }
97096
- if (options.offset === undefined) {
97097
- options.offset = offset;
97098
- }
97099
- if (options.table === undefined) {
97100
- options.table = this;
97101
- }
97102
- return options;
97103
- }
97104
- return {
97105
- columns: columns,
97106
- frozen: frozen,
97107
- offset: offset,
97108
- table: this
97109
- };
97110
- };
97111
97931
  DTable.prototype.getBodyOffset = function () {
97112
- var result = this._bodyOffset;
97113
- if (result == null) {
97114
- result = this.newBodyOffset();
97115
- this._bodyOffset = result;
97116
- }
97117
- return result;
97932
+ var _a;
97933
+ return ((_a = this._bodyOffset) !== null && _a !== void 0 ? _a : (this._bodyOffset = this.newBodyOffset()));
97118
97934
  };
97119
97935
  DTable.prototype.newBodyOffset = function () {
97120
97936
  var _a, _b;
@@ -97122,30 +97938,19 @@ var DTable = /** @class */ (function (_super) {
97122
97938
  };
97123
97939
  Object.defineProperty(DTable.prototype, "body", {
97124
97940
  get: function () {
97125
- var result = this._body;
97126
- if (result == null) {
97127
- result = this.newBody(this._options, this.columns, this.frozen, this.getBodyOffset());
97128
- this._body = result;
97129
- }
97130
- return result;
97941
+ var _a;
97942
+ return ((_a = this._body) !== null && _a !== void 0 ? _a : (this._body = this.newBody()));
97131
97943
  },
97132
97944
  enumerable: false,
97133
97945
  configurable: true
97134
97946
  });
97135
- DTable.prototype.newBody = function (options, columns, frozen, offset) {
97136
- return new DTableBody(this.toBodyOptions(options === null || options === void 0 ? void 0 : options.body, columns, frozen, offset, options === null || options === void 0 ? void 0 : options.data));
97947
+ DTable.prototype.newBody = function () {
97948
+ var options = this._options;
97949
+ var column = this.column;
97950
+ return new DTableBody(column.items, column.frozen, this.getBodyOffset(), this.toBodyOptions(options === null || options === void 0 ? void 0 : options.body, options === null || options === void 0 ? void 0 : options.data));
97137
97951
  };
97138
- DTable.prototype.toBodyOptions = function (options, columns, frozen, offset, data) {
97952
+ DTable.prototype.toBodyOptions = function (options, data) {
97139
97953
  if (options != null) {
97140
- if (options.columns === undefined) {
97141
- options.columns = columns;
97142
- }
97143
- if (options.frozen == null) {
97144
- options.frozen = frozen;
97145
- }
97146
- if (options.offset === undefined) {
97147
- options.offset = offset;
97148
- }
97149
97954
  if (options.data === undefined && data !== undefined) {
97150
97955
  if (isArray(data)) {
97151
97956
  options.data = {
@@ -97163,9 +97968,6 @@ var DTable = /** @class */ (function (_super) {
97163
97968
  }
97164
97969
  if (isArray(data)) {
97165
97970
  return {
97166
- columns: columns,
97167
- frozen: frozen,
97168
- offset: offset,
97169
97971
  data: {
97170
97972
  rows: data
97171
97973
  },
@@ -97174,9 +97976,6 @@ var DTable = /** @class */ (function (_super) {
97174
97976
  }
97175
97977
  else {
97176
97978
  return {
97177
- columns: columns,
97178
- frozen: frozen,
97179
- offset: offset,
97180
97979
  data: data,
97181
97980
  weight: 1
97182
97981
  };
@@ -99119,6 +99918,7 @@ exports.DTableBodyCells = DTableBodyCells;
99119
99918
  exports.DTableBodyRow = DTableBodyRow;
99120
99919
  exports.DTableCategory = DTableCategory;
99121
99920
  exports.DTableCategoryCell = DTableCategoryCell;
99921
+ exports.DTableCategoryCellEdge = DTableCategoryCellEdge;
99122
99922
  exports.DTableColumnType = DTableColumnType;
99123
99923
  exports.DTableColumnUpdate = DTableColumnUpdate;
99124
99924
  exports.DTableDataList = DTableDataList;
@@ -99136,6 +99936,7 @@ exports.DTableDataTreeSorter = DTableDataTreeSorter;
99136
99936
  exports.DTableHeader = DTableHeader;
99137
99937
  exports.DTableHeaderCell = DTableHeaderCell;
99138
99938
  exports.DTableHeaderCellCheck = DTableHeaderCellCheck;
99939
+ exports.DTableHeaderCellEdge = DTableHeaderCellEdge;
99139
99940
  exports.DTableRow = DTableRow;
99140
99941
  exports.DTableScrollBar = DTableScrollBar;
99141
99942
  exports.DTableState = DTableState;