@wcardinal/wcardinal-ui 0.411.0 → 0.413.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 (98) hide show
  1. package/dist/types/wcardinal/ui/d-indicator-processing.d.ts +8 -7
  2. package/dist/types/wcardinal/ui/d-pagination.d.ts +5 -5
  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/index.d.ts +7 -0
  23. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.d.ts +1 -0
  24. package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header.d.ts +1 -0
  25. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header-cell.d.ts +1 -0
  26. package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header.d.ts +1 -0
  27. package/dist/wcardinal/ui/d-base.js +2 -2
  28. package/dist/wcardinal/ui/d-base.js.map +1 -1
  29. package/dist/wcardinal/ui/d-indicator-processing.js +20 -15
  30. package/dist/wcardinal/ui/d-indicator-processing.js.map +1 -1
  31. package/dist/wcardinal/ui/d-pagination.js +5 -5
  32. package/dist/wcardinal/ui/d-pagination.js.map +1 -1
  33. package/dist/wcardinal/ui/d-table-body-cell.js.map +1 -1
  34. package/dist/wcardinal/ui/d-table-body-row.js +4 -4
  35. package/dist/wcardinal/ui/d-table-body-row.js.map +1 -1
  36. package/dist/wcardinal/ui/d-table-body.js +6 -15
  37. package/dist/wcardinal/ui/d-table-body.js.map +1 -1
  38. package/dist/wcardinal/ui/d-table-category-cell.js +244 -2
  39. package/dist/wcardinal/ui/d-table-category-cell.js.map +1 -1
  40. package/dist/wcardinal/ui/d-table-category-column-impl.js +222 -0
  41. package/dist/wcardinal/ui/d-table-category-column-impl.js.map +1 -0
  42. package/dist/wcardinal/ui/d-table-category-column.js +6 -0
  43. package/dist/wcardinal/ui/d-table-category-column.js.map +1 -0
  44. package/dist/wcardinal/ui/d-table-category-container-impl.js +149 -0
  45. package/dist/wcardinal/ui/d-table-category-container-impl.js.map +1 -0
  46. package/dist/wcardinal/ui/d-table-category-container.js +2 -0
  47. package/dist/wcardinal/ui/d-table-category-container.js.map +1 -0
  48. package/dist/wcardinal/ui/d-table-category.js +49 -7
  49. package/dist/wcardinal/ui/d-table-category.js.map +1 -1
  50. package/dist/wcardinal/ui/d-table-column-container-impl.js +126 -0
  51. package/dist/wcardinal/ui/d-table-column-container-impl.js.map +1 -0
  52. package/dist/wcardinal/ui/d-table-column-container.js +2 -0
  53. package/dist/wcardinal/ui/d-table-column-container.js.map +1 -0
  54. package/dist/wcardinal/ui/d-table-column-impl.js +375 -0
  55. package/dist/wcardinal/ui/d-table-column-impl.js.map +1 -0
  56. package/dist/wcardinal/ui/d-table-column.js.map +1 -1
  57. package/dist/wcardinal/ui/d-table-header-cell-check.js.map +1 -1
  58. package/dist/wcardinal/ui/d-table-header-cell.js +245 -48
  59. package/dist/wcardinal/ui/d-table-header-cell.js.map +1 -1
  60. package/dist/wcardinal/ui/d-table-header.js +8 -22
  61. package/dist/wcardinal/ui/d-table-header.js.map +1 -1
  62. package/dist/wcardinal/ui/d-table-row.js +7 -5
  63. package/dist/wcardinal/ui/d-table-row.js.map +1 -1
  64. package/dist/wcardinal/ui/d-table-state.js +9 -1
  65. package/dist/wcardinal/ui/d-table-state.js.map +1 -1
  66. package/dist/wcardinal/ui/d-table.js +69 -631
  67. package/dist/wcardinal/ui/d-table.js.map +1 -1
  68. package/dist/wcardinal/ui/index.js +7 -0
  69. package/dist/wcardinal/ui/index.js.map +1 -1
  70. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js +7 -1
  71. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js.map +1 -1
  72. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js +7 -0
  73. package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js.map +1 -1
  74. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js +7 -1
  75. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js.map +1 -1
  76. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js +7 -0
  77. package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js.map +1 -1
  78. package/dist/wcardinal-ui-theme-dark-en-us.js +14 -2
  79. package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
  80. package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
  81. package/dist/wcardinal-ui-theme-dark-ja-jp.js +14 -2
  82. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
  83. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
  84. package/dist/wcardinal-ui-theme-dark.js +14 -2
  85. package/dist/wcardinal-ui-theme-dark.min.js +2 -2
  86. package/dist/wcardinal-ui-theme-white-en-us.js +14 -2
  87. package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
  88. package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
  89. package/dist/wcardinal-ui-theme-white-ja-jp.js +14 -2
  90. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
  91. package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
  92. package/dist/wcardinal-ui-theme-white.js +14 -2
  93. package/dist/wcardinal-ui-theme-white.min.js +2 -2
  94. package/dist/wcardinal-ui.cjs.js +1545 -753
  95. package/dist/wcardinal-ui.js +1882 -1114
  96. package/dist/wcardinal-ui.min.js +2 -2
  97. package/dist/wcardinal-ui.min.js.map +1 -1
  98. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.411.0
2
+ Winter Cardinal UI v0.413.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -15181,10 +15181,10 @@ var DBase = /** @class */ (function (_super) {
15181
15181
  this.emit("down", e, this);
15182
15182
  };
15183
15183
  DBase.prototype.onDownThis = function (e) {
15184
+ var _a;
15184
15185
  var oe = e.data.originalEvent;
15185
15186
  if ("touches" in oe) {
15186
- var lastDownPoint = this._lastDownPoint || new pixi_js.Point();
15187
- this._lastDownPoint = lastDownPoint;
15187
+ var lastDownPoint = ((_a = this._lastDownPoint) !== null && _a !== void 0 ? _a : (this._lastDownPoint = new pixi_js.Point()));
15188
15188
  lastDownPoint.copyFrom(e.data.global);
15189
15189
  }
15190
15190
  else {
@@ -54085,7 +54085,15 @@ var DTableState = {
54085
54085
  /**
54086
54086
  * Selectable row
54087
54087
  */
54088
- 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"
54089
54097
  };
54090
54098
 
54091
54099
  /*
@@ -58262,6 +58270,12 @@ var DThemeWhiteTableHeader = /** @class */ (function (_super) {
58262
58270
  DThemeWhiteTableHeader.prototype.getHeight = function () {
58263
58271
  return 30;
58264
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
+ };
58265
58279
  return DThemeWhiteTableHeader;
58266
58280
  }(DThemeWhiteTableRow));
58267
58281
 
@@ -58304,7 +58318,7 @@ var DThemeWhiteTableHeaderCell = /** @class */ (function (_super) {
58304
58318
  return _this;
58305
58319
  }
58306
58320
  DThemeWhiteTableHeaderCell.prototype.getBackgroundColor = function (state) {
58307
- if (state.inDisabled) {
58321
+ if (state.inDisabled || state.on(DTableState.RESIZING)) {
58308
58322
  return state.is(DTableState.FROZEN) ? this.BACKGROUND_COLOR_FROZEN : null;
58309
58323
  }
58310
58324
  else if (state.isPressed) {
@@ -58405,11 +58419,17 @@ var DThemeWhiteTableHeaderCell = /** @class */ (function (_super) {
58405
58419
  if (!state.isActionable) {
58406
58420
  return "";
58407
58421
  }
58422
+ if (state.is(DTableState.HOVERED_ON_EDGE) || state.on(DTableState.RESIZING)) {
58423
+ return "col-resize";
58424
+ }
58408
58425
  if (state.is(DTableState.CHECKABLE) || state.is(DTableState.SORTABLE)) {
58409
58426
  return "pointer";
58410
58427
  }
58411
58428
  return "";
58412
58429
  };
58430
+ DThemeWhiteTableHeaderCell.prototype.getEdgeWidth = function () {
58431
+ return 10;
58432
+ };
58413
58433
  return DThemeWhiteTableHeaderCell;
58414
58434
  }(DThemeWhiteImage));
58415
58435
 
@@ -68777,6 +68797,12 @@ var DThemeDarkTableHeader = /** @class */ (function (_super) {
68777
68797
  DThemeDarkTableHeader.prototype.getHeight = function () {
68778
68798
  return 30;
68779
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
+ };
68780
68806
  return DThemeDarkTableHeader;
68781
68807
  }(DThemeDarkTableRow));
68782
68808
 
@@ -68819,7 +68845,7 @@ var DThemeDarkTableHeaderCell = /** @class */ (function (_super) {
68819
68845
  return _this;
68820
68846
  }
68821
68847
  DThemeDarkTableHeaderCell.prototype.getBackgroundColor = function (state) {
68822
- if (state.inDisabled) {
68848
+ if (state.inDisabled || state.on(DTableState.RESIZING)) {
68823
68849
  return state.is(DTableState.FROZEN) ? this.BACKGROUND_COLOR_FROZEN : null;
68824
68850
  }
68825
68851
  else if (state.isPressed) {
@@ -68920,11 +68946,17 @@ var DThemeDarkTableHeaderCell = /** @class */ (function (_super) {
68920
68946
  if (!state.isActionable) {
68921
68947
  return "";
68922
68948
  }
68949
+ if (state.is(DTableState.HOVERED_ON_EDGE) || state.on(DTableState.RESIZING)) {
68950
+ return "col-resize";
68951
+ }
68923
68952
  if (state.is(DTableState.CHECKABLE) || state.is(DTableState.SORTABLE)) {
68924
68953
  return "pointer";
68925
68954
  }
68926
68955
  return "";
68927
68956
  };
68957
+ DThemeDarkTableHeaderCell.prototype.getEdgeWidth = function () {
68958
+ return 10;
68959
+ };
68928
68960
  return DThemeDarkTableHeaderCell;
68929
68961
  }(DThemeDarkImage));
68930
68962
 
@@ -88113,15 +88145,17 @@ var DExpandable = /** @class */ (function (_super) {
88113
88145
  return DExpandable;
88114
88146
  }(DLayoutVertical));
88115
88147
 
88116
- var STATE_INITIAL = 0;
88117
- var STATE_STARTED = 1;
88118
- var STATE_RESOLVED = 2;
88119
- var STATE_REJECTED = 3;
88148
+ var DIndicatorProcessingState = {
88149
+ INITIAL: 0,
88150
+ STARTED: 1,
88151
+ RESOLVED: 2,
88152
+ REJECTED: 3
88153
+ };
88120
88154
  var DIndicatorProcessing = /** @class */ (function () {
88121
88155
  function DIndicatorProcessing(parent, options) {
88122
88156
  var _a, _b, _c, _d, _e, _f, _g;
88123
88157
  this._parent = parent;
88124
- this._state = STATE_INITIAL;
88158
+ this._state = DIndicatorProcessingState.INITIAL;
88125
88159
  this._startTime = 0;
88126
88160
  // Delay
88127
88161
  var theme = this.theme;
@@ -88144,12 +88178,13 @@ var DIndicatorProcessing = /** @class */ (function () {
88144
88178
  }
88145
88179
  DIndicatorProcessing.prototype.start = function () {
88146
88180
  var state = this._state;
88147
- if (state === STATE_INITIAL) {
88148
- this._state = STATE_STARTED;
88181
+ if (state === DIndicatorProcessingState.INITIAL) {
88182
+ this._state = DIndicatorProcessingState.STARTED;
88149
88183
  this.onBegin();
88150
88184
  }
88151
- else if (state === STATE_RESOLVED || state === STATE_REJECTED) {
88152
- this._state = STATE_STARTED;
88185
+ else if (state === DIndicatorProcessingState.RESOLVED ||
88186
+ state === DIndicatorProcessingState.REJECTED) {
88187
+ this._state = DIndicatorProcessingState.STARTED;
88153
88188
  this.onEnd();
88154
88189
  this.onBegin();
88155
88190
  }
@@ -88200,8 +88235,10 @@ var DIndicatorProcessing = /** @class */ (function () {
88200
88235
  };
88201
88236
  DIndicatorProcessing.prototype.end = function () {
88202
88237
  var state = this._state;
88203
- if (state === STATE_STARTED || state === STATE_RESOLVED || state === STATE_REJECTED) {
88204
- this._state = STATE_INITIAL;
88238
+ if (state === DIndicatorProcessingState.STARTED ||
88239
+ state === DIndicatorProcessingState.RESOLVED ||
88240
+ state === DIndicatorProcessingState.REJECTED) {
88241
+ this._state = DIndicatorProcessingState.INITIAL;
88205
88242
  this.onEnd();
88206
88243
  }
88207
88244
  return this;
@@ -88237,8 +88274,8 @@ var DIndicatorProcessing = /** @class */ (function () {
88237
88274
  };
88238
88275
  DIndicatorProcessing.prototype.resolve = function (message) {
88239
88276
  var _this = this;
88240
- if (this._state === STATE_STARTED) {
88241
- this._state = STATE_RESOLVED;
88277
+ if (this._state === DIndicatorProcessingState.STARTED) {
88278
+ this._state = DIndicatorProcessingState.RESOLVED;
88242
88279
  var elapsedTime = Date.now() - this._startTime;
88243
88280
  var delay = this._delayDone - elapsedTime;
88244
88281
  if (0 < delay) {
@@ -88270,8 +88307,8 @@ var DIndicatorProcessing = /** @class */ (function () {
88270
88307
  };
88271
88308
  DIndicatorProcessing.prototype.reject = function (message) {
88272
88309
  var _this = this;
88273
- if (this._state === STATE_STARTED) {
88274
- this._state = STATE_REJECTED;
88310
+ if (this._state === DIndicatorProcessingState.STARTED) {
88311
+ this._state = DIndicatorProcessingState.REJECTED;
88275
88312
  var elapsedTime = Date.now() - this._startTime;
88276
88313
  var delay = this._delayDone - elapsedTime;
88277
88314
  if (0 < delay) {
@@ -89889,7 +89926,7 @@ var DPagination = /** @class */ (function (_super) {
89889
89926
  };
89890
89927
  /**
89891
89928
  * Goes to the last page.
89892
- * Unlike {@link #value}, this method emits the change event if silently is not true.
89929
+ * Unlike {@link value}, this method emits the change event if silently is not true.
89893
89930
  *
89894
89931
  * @param silently true to suppress the change event
89895
89932
  * @returns true if succeeded.
@@ -89899,7 +89936,7 @@ var DPagination = /** @class */ (function (_super) {
89899
89936
  };
89900
89937
  /**
89901
89938
  * Goes to the given page.
89902
- * Unlike {@link #value}, this method emits the change event if silently is not true.
89939
+ * Unlike {@link value}, this method emits the change event if silently is not true.
89903
89940
  *
89904
89941
  * @param index a page index
89905
89942
  * @param silently true to suppress the change event
@@ -89948,7 +89985,7 @@ var DPagination = /** @class */ (function (_super) {
89948
89985
  };
89949
89986
  /**
89950
89987
  * Goes to the next page.
89951
- * Unlike {@link #value}, this method emits the change event if silently is not true.
89988
+ * Unlike {@link value}, this method emits the change event if silently is not true.
89952
89989
  *
89953
89990
  * @param silently true to suppress the change event
89954
89991
  * @returns true if succeeded.
@@ -89986,7 +90023,7 @@ var DPagination = /** @class */ (function (_super) {
89986
90023
  };
89987
90024
  /**
89988
90025
  * Goes to the previous page.
89989
- * Unlike {@link #value}, this method emits the change event if silently is not true.
90026
+ * Unlike {@link value}, this method emits the change event if silently is not true.
89990
90027
  *
89991
90028
  * @param silently true to suppress the change event
89992
90029
  * @returns true if succeeded.
@@ -90024,7 +90061,7 @@ var DPagination = /** @class */ (function (_super) {
90024
90061
  };
90025
90062
  /**
90026
90063
  * Goes to the top page.
90027
- * Unlike {@link #value}, this method emits the change event if silently is not true.
90064
+ * Unlike {@link value}, this method emits the change event if silently is not true.
90028
90065
  *
90029
90066
  * @param silently true to suppress the change event
90030
90067
  * @returns true if succeeded.
@@ -93193,15 +93230,17 @@ var DTableDataSelectionType = {
93193
93230
  */
93194
93231
  var DTableRow = /** @class */ (function (_super) {
93195
93232
  __extends(DTableRow, _super);
93196
- function DTableRow(options) {
93197
- var _a, _b;
93233
+ function DTableRow(columns, frozen, options) {
93198
93234
  var _this = _super.call(this, options) || this;
93199
93235
  _this._reverse = true;
93200
- _this._frozen = (_a = options.frozen) !== null && _a !== void 0 ? _a : 0;
93201
- _this._columns = (_b = options.columns) !== null && _b !== void 0 ? _b : [];
93236
+ _this._frozen = frozen;
93237
+ _this._columns = columns;
93202
93238
  return _this;
93203
93239
  }
93204
- DTableRow.prototype.initCells = function (options, columns, frozen) {
93240
+ DTableRow.prototype.initCells = function () {
93241
+ var columns = this._columns;
93242
+ var frozen = this._frozen;
93243
+ var options = this._options;
93205
93244
  var iend = this.toIndexEnd(columns);
93206
93245
  for (var i = columns.length - 1; 0 <= i; --i) {
93207
93246
  var cell = this.newCell(i, columns[i], columns, options);
@@ -93293,8 +93332,8 @@ var DTableRow = /** @class */ (function (_super) {
93293
93332
  */
93294
93333
  var DTableBodyRow = /** @class */ (function (_super) {
93295
93334
  __extends(DTableBodyRow, _super);
93296
- function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, options) {
93297
- var _this = _super.call(this, options) || this;
93335
+ function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, columns, frozen, options) {
93336
+ var _this = _super.call(this, columns, frozen, options) || this;
93298
93337
  _this._index = -1;
93299
93338
  _this._onChange = onChange;
93300
93339
  _this._onCellChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
@@ -93302,7 +93341,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
93302
93341
  };
93303
93342
  _this._columnIndexToCellOptions = columnIndexToCellOptions;
93304
93343
  _this.state.isAlternated = !isEven;
93305
- _this.initCells(options, _this._columns, _this._frozen);
93344
+ _this.initCells();
93306
93345
  return _this;
93307
93346
  }
93308
93347
  DTableBodyRow.prototype.onCellChange = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
@@ -93446,7 +93485,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
93446
93485
  DTableBodyRow.prototype.toCellOptions = function (columnIndex, column, options) {
93447
93486
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
93448
93487
  var _p;
93449
- var result = toMerged(column.body, options.cell);
93488
+ var result = toMerged(column.body, options === null || options === void 0 ? void 0 : options.cell);
93450
93489
  // Weight
93451
93490
  result.weight = column.weight;
93452
93491
  // Width
@@ -94515,18 +94554,11 @@ var DTableDataList = /** @class */ (function (_super) {
94515
94554
  * SPDX-License-Identifier: Apache-2.0
94516
94555
  */
94517
94556
  var toRowOptions = function (theme, options, selectionType) {
94518
- var columns = options.columns || [];
94519
94557
  var result = options.row;
94520
94558
  if (result != null) {
94521
94559
  if (result.height == null) {
94522
94560
  result.height = theme.getRowHeight();
94523
94561
  }
94524
- if (result.columns === undefined) {
94525
- result.columns = columns;
94526
- }
94527
- if (result.frozen == null) {
94528
- result.frozen = options.frozen;
94529
- }
94530
94562
  if (result.selection === undefined) {
94531
94563
  result.selection = {
94532
94564
  type: selectionType
@@ -94538,9 +94570,7 @@ var toRowOptions = function (theme, options, selectionType) {
94538
94570
  }
94539
94571
  else {
94540
94572
  result = {
94541
- columns: columns,
94542
94573
  height: theme.getRowHeight(),
94543
- frozen: options.frozen,
94544
94574
  selection: {
94545
94575
  type: selectionType
94546
94576
  }
@@ -94550,18 +94580,18 @@ var toRowOptions = function (theme, options, selectionType) {
94550
94580
  };
94551
94581
  var DTableBody = /** @class */ (function (_super) {
94552
94582
  __extends(DTableBody, _super);
94553
- function DTableBody(options) {
94554
- var _a;
94583
+ function DTableBody(columns, frozen, offset, options) {
94555
94584
  var _this = _super.call(this, options) || this;
94556
- _this.transform.position.y = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
94585
+ _this.transform.position.y = offset;
94557
94586
  var data = _this.toData(options.data);
94558
94587
  _this._data = data;
94559
94588
  data.bind(_this);
94560
94589
  var theme = _this.theme;
94590
+ _this._columns = columns;
94591
+ _this._frozen = frozen;
94561
94592
  var rowOptions = toRowOptions(theme, options, data.selection.type);
94562
94593
  _this._rowOptions = rowOptions;
94563
94594
  _this._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();
94564
- _this._columns = rowOptions.columns || [];
94565
94595
  _this._rowIndexMappedStart = 0;
94566
94596
  _this._rowIndexMappedEnd = 0;
94567
94597
  _this._updateRowsCount = 0;
@@ -94772,14 +94802,14 @@ var DTableBody = /** @class */ (function (_super) {
94772
94802
  return row;
94773
94803
  };
94774
94804
  DTableBody.prototype.newRow = function (isEven) {
94775
- return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
94805
+ return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._columns, this._frozen, this._rowOptions);
94776
94806
  };
94777
94807
  DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
94778
94808
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
94779
94809
  this.updateFrozenCellPosition(newX);
94780
94810
  };
94781
94811
  DTableBody.prototype.updateFrozenCellPosition = function (x) {
94782
- var frozen = this._rowOptions.frozen;
94812
+ var frozen = this._frozen;
94783
94813
  if (frozen != null && 0 < frozen) {
94784
94814
  var rows = this.children;
94785
94815
  for (var i = 0, imax = rows.length; i < imax; ++i) {
@@ -94994,32 +95024,526 @@ var DTableBody = /** @class */ (function (_super) {
94994
95024
  * Copyright (C) 2019 Toshiba Corporation
94995
95025
  * SPDX-License-Identifier: Apache-2.0
94996
95026
  */
95027
+ var DTableCategoryCellEdge = {
95028
+ NONE: 0,
95029
+ LEFT: 1,
95030
+ RIGHT: 2,
95031
+ BOTH: 3
95032
+ };
94997
95033
  var DTableCategoryCell = /** @class */ (function (_super) {
94998
95034
  __extends(DTableCategoryCell, _super);
94999
- function DTableCategoryCell() {
95000
- return _super !== null && _super.apply(this, arguments) || this;
95035
+ function DTableCategoryCell(category, columnIndex, column, options) {
95036
+ var _this = _super.call(this, options) || this;
95037
+ _this._category = category;
95038
+ _this._columnIndex = columnIndex;
95039
+ _this._column = column;
95040
+ _this._edgeSize = _this.theme.getEdgeWidth();
95041
+ _this._wasResizing = false;
95042
+ return _this;
95001
95043
  }
95044
+ Object.defineProperty(DTableCategoryCell.prototype, "column", {
95045
+ get: function () {
95046
+ return this._column;
95047
+ },
95048
+ enumerable: false,
95049
+ configurable: true
95050
+ });
95051
+ Object.defineProperty(DTableCategoryCell.prototype, "columnIndex", {
95052
+ get: function () {
95053
+ return this._columnIndex;
95054
+ },
95055
+ enumerable: false,
95056
+ configurable: true
95057
+ });
95058
+ Object.defineProperty(DTableCategoryCell.prototype, "category", {
95059
+ get: function () {
95060
+ return this._category;
95061
+ },
95062
+ enumerable: false,
95063
+ configurable: true
95064
+ });
95065
+ DTableCategoryCell.prototype.onDown = function (e) {
95066
+ var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
95067
+ if (edges != null) {
95068
+ this._wasResizing = true;
95069
+ var layer = DApplications.getLayer(this);
95070
+ if (layer != null) {
95071
+ var interactionManager = layer.renderer.plugins.interaction;
95072
+ var columnIndex = this._columnIndex;
95073
+ if (edges === DTableCategoryCellEdge.LEFT) {
95074
+ this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
95075
+ }
95076
+ else {
95077
+ this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
95078
+ }
95079
+ }
95080
+ }
95081
+ else {
95082
+ this._wasResizing = false;
95083
+ _super.prototype.onDown.call(this, e);
95084
+ }
95085
+ };
95086
+ DTableCategoryCell.prototype.findLeftResizableCell = function (columnIndex) {
95087
+ var children = this._category.children;
95088
+ var childrenLength = children.length;
95089
+ for (var i = columnIndex; 0 <= i; --i) {
95090
+ var child = children[childrenLength - i - 1];
95091
+ if (child.column.resizable) {
95092
+ return child;
95093
+ }
95094
+ }
95095
+ return null;
95096
+ };
95097
+ DTableCategoryCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
95098
+ var children = this._category.children;
95099
+ var childrenLength = children.length;
95100
+ for (var i = columnIndex + 1; i < childrenLength; ++i) {
95101
+ var child = children[childrenLength - i - 1];
95102
+ var childColumn = child.column;
95103
+ if (childColumn.resizable) {
95104
+ var childColumnWeight = childColumn.weight;
95105
+ if (childColumnWeight != null) {
95106
+ return child;
95107
+ }
95108
+ }
95109
+ }
95110
+ return null;
95111
+ };
95112
+ DTableCategoryCell.prototype.checkIfEdgeResizable = function (columnIndex) {
95113
+ var target = this.findLeftResizableCell(columnIndex);
95114
+ if (target != null) {
95115
+ if (target.column.weight != null) {
95116
+ return this.findRightResizableCellOfWeight(target.columnIndex) != null;
95117
+ }
95118
+ else {
95119
+ return true;
95120
+ }
95121
+ }
95122
+ return false;
95123
+ };
95124
+ DTableCategoryCell.prototype.getResizableEdges = function () {
95125
+ var result = this._resizableEdges;
95126
+ if (result == null) {
95127
+ var columnIndex = this._columnIndex;
95128
+ if (this.checkIfEdgeResizable(columnIndex - 1)) {
95129
+ if (this.checkIfEdgeResizable(columnIndex)) {
95130
+ result = DTableCategoryCellEdge.BOTH;
95131
+ }
95132
+ else {
95133
+ result = DTableCategoryCellEdge.LEFT;
95134
+ }
95135
+ }
95136
+ else {
95137
+ if (this.checkIfEdgeResizable(columnIndex)) {
95138
+ result = DTableCategoryCellEdge.RIGHT;
95139
+ }
95140
+ else {
95141
+ result = DTableCategoryCellEdge.NONE;
95142
+ }
95143
+ }
95144
+ this._resizableEdges = result;
95145
+ }
95146
+ return result;
95147
+ };
95148
+ DTableCategoryCell.prototype.onOver = function (e) {
95149
+ var _this = this;
95150
+ var _a;
95151
+ _super.prototype.onOver.call(this, e);
95152
+ if (this.getResizableEdges() !== DTableCategoryCellEdge.NONE) {
95153
+ var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
95154
+ _this.onHovered(event);
95155
+ }));
95156
+ this.on(UtilPointerEvent.move, onHoveredBound);
95157
+ // Since the cursor is set by InteractionManager before this method is called,
95158
+ // the cursor need to be overriden.
95159
+ this.onHovered(e);
95160
+ var layer = DApplications.getLayer(this);
95161
+ if (layer != null) {
95162
+ layer.renderer.plugins.interaction.cursor = this.cursor;
95163
+ }
95164
+ }
95165
+ };
95166
+ DTableCategoryCell.prototype.onOut = function (e) {
95167
+ _super.prototype.onOut.call(this, e);
95168
+ var onHoveredBound = this._onHoveredBound;
95169
+ if (onHoveredBound != null) {
95170
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95171
+ this.off(UtilPointerEvent.move, onHoveredBound);
95172
+ }
95173
+ };
95174
+ DTableCategoryCell.prototype.onHovered = function (e) {
95175
+ var width = this.width;
95176
+ var x = this.toClickPosition(e);
95177
+ var edgeSize = this._edgeSize;
95178
+ if (0 <= x && x <= edgeSize) {
95179
+ if (this.getResizableEdges() & DTableCategoryCellEdge.LEFT) {
95180
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.LEFT);
95181
+ }
95182
+ else {
95183
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95184
+ }
95185
+ }
95186
+ else if (width - edgeSize <= x && x <= width) {
95187
+ if (this.getResizableEdges() & DTableCategoryCellEdge.RIGHT) {
95188
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.RIGHT);
95189
+ }
95190
+ else {
95191
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95192
+ }
95193
+ }
95194
+ else {
95195
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
95196
+ }
95197
+ };
95198
+ DTableCategoryCell.prototype.toClickPosition = function (e) {
95199
+ var _a;
95200
+ var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
95201
+ return e.data.getLocalPosition(this, checkWork).x;
95202
+ };
95203
+ DTableCategoryCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
95204
+ // Find the resizable cell
95205
+ var left = this.findLeftResizableCell(columnIndex);
95206
+ if (left == null) {
95207
+ // No resizable cell
95208
+ return;
95209
+ }
95210
+ var category = this._category;
95211
+ var leftColumn = left.column;
95212
+ var leftOldWidth = left.width;
95213
+ var leftOldWeight = left.weight;
95214
+ if (leftColumn.weight == null) {
95215
+ category.state.add(DTableState.RESIZING);
95216
+ var leftMinWidth_1 = leftColumn.minWidth;
95217
+ var onMove_1 = function (e) {
95218
+ leftColumn.width = Math.max(leftMinWidth_1, leftOldWidth + e.data.global.x - onDownPoint);
95219
+ };
95220
+ var onUp_1 = function (e) {
95221
+ category.state.remove(DTableState.RESIZING);
95222
+ interactionManager.off(UtilPointerEvent.move, onMove_1);
95223
+ interactionManager.off(UtilPointerEvent.up, onUp_1);
95224
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
95225
+ interactionManager.off(UtilPointerEvent.cancel, onUp_1);
95226
+ };
95227
+ interactionManager.on(UtilPointerEvent.move, onMove_1);
95228
+ interactionManager.on(UtilPointerEvent.up, onUp_1);
95229
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
95230
+ interactionManager.on(UtilPointerEvent.cancel, onUp_1);
95231
+ }
95232
+ else {
95233
+ var right = this.findRightResizableCellOfWeight(left.columnIndex);
95234
+ if (right == null) {
95235
+ // No right resizable cell found
95236
+ return;
95237
+ }
95238
+ var rightColumn_1 = right.column;
95239
+ var rightOldWeight = right.weight;
95240
+ var rightOldWidth = right.width;
95241
+ var totalWidth_1 = leftOldWidth + rightOldWidth;
95242
+ var totalWeight_1 = leftOldWeight + rightOldWeight;
95243
+ var leftMinWeight_1 = leftColumn.minWeight;
95244
+ var rightMinWeight = rightColumn_1.minWeight;
95245
+ var leftMaxWeight_1 = totalWeight_1 - rightMinWeight;
95246
+ if (totalWidth_1 <= 0 || leftMaxWeight_1 <= leftMinWeight_1) {
95247
+ // The left and right resizable cells doesn't non-zero width
95248
+ return;
95249
+ }
95250
+ category.state.add(DTableState.RESIZING);
95251
+ var onMove_2 = function (e) {
95252
+ var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
95253
+ var leftNewWeight = Math.max(leftMinWeight_1, Math.min(leftMaxWeight_1, totalWeight_1 * (leftNewWidth / totalWidth_1)));
95254
+ leftColumn.weight = leftNewWeight;
95255
+ rightColumn_1.weight = totalWeight_1 - leftNewWeight;
95256
+ };
95257
+ var onUp_2 = function (e) {
95258
+ category.state.remove(DTableState.RESIZING);
95259
+ interactionManager.off(UtilPointerEvent.move, onMove_2);
95260
+ interactionManager.off(UtilPointerEvent.up, onUp_2);
95261
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
95262
+ interactionManager.off(UtilPointerEvent.cancel, onUp_2);
95263
+ };
95264
+ interactionManager.on(UtilPointerEvent.move, onMove_2);
95265
+ interactionManager.on(UtilPointerEvent.up, onUp_2);
95266
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
95267
+ interactionManager.on(UtilPointerEvent.cancel, onUp_2);
95268
+ }
95269
+ };
95002
95270
  DTableCategoryCell.prototype.getType = function () {
95003
95271
  return "DTableCategoryCell";
95004
95272
  };
95005
95273
  return DTableCategoryCell;
95006
95274
  }(DImage));
95007
95275
 
95276
+ /*
95277
+ * Copyright (C) 2019 Toshiba Corporation
95278
+ * SPDX-License-Identifier: Apache-2.0
95279
+ */
95280
+ var DTableCategoryColumnImpl = /** @class */ (function (_super) {
95281
+ __extends(DTableCategoryColumnImpl, _super);
95282
+ function DTableCategoryColumnImpl(index, column) {
95283
+ var _this = _super.call(this) || this;
95284
+ // Label
95285
+ var category = column.category;
95286
+ if (category) {
95287
+ if (isString(category)) {
95288
+ if (index === 0) {
95289
+ _this.label = category;
95290
+ }
95291
+ }
95292
+ else {
95293
+ if (index < category.length) {
95294
+ _this.label = category[index];
95295
+ }
95296
+ }
95297
+ }
95298
+ _this._weight = column.weight;
95299
+ _this._width = column.width;
95300
+ _this._isLocked = false;
95301
+ _this.offset = 0.0;
95302
+ _this._columns = [column];
95303
+ _this._nresizable = column.resizable ? 1 : 0;
95304
+ var onResizeBound = function () {
95305
+ _this.onResize();
95306
+ };
95307
+ _this._onResizeBound = onResizeBound;
95308
+ column.on("resize", onResizeBound);
95309
+ return _this;
95310
+ }
95311
+ DTableCategoryColumnImpl.prototype.onResize = function () {
95312
+ if (this._isLocked) {
95313
+ return;
95314
+ }
95315
+ var columns = this._columns;
95316
+ if (this._weight != null) {
95317
+ var newWeight = 0;
95318
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95319
+ var weight = columns[i].weight;
95320
+ if (weight != null) {
95321
+ newWeight += weight;
95322
+ }
95323
+ }
95324
+ if (this._weight !== newWeight) {
95325
+ this._weight = newWeight;
95326
+ this.emit("resize", this);
95327
+ }
95328
+ }
95329
+ else {
95330
+ var newWidth = 0;
95331
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95332
+ var width = columns[i].width;
95333
+ if (width != null) {
95334
+ newWidth += width;
95335
+ }
95336
+ }
95337
+ if (this._width !== newWidth) {
95338
+ this._width = newWidth;
95339
+ this.emit("resize", this);
95340
+ }
95341
+ }
95342
+ };
95343
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "resizable", {
95344
+ get: function () {
95345
+ return 0 < this._nresizable;
95346
+ },
95347
+ enumerable: false,
95348
+ configurable: true
95349
+ });
95350
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "weight", {
95351
+ get: function () {
95352
+ return this._weight;
95353
+ },
95354
+ set: function (weight) {
95355
+ var oldWeight = this._weight;
95356
+ var nresizable = this._nresizable;
95357
+ if (0 < nresizable && oldWeight != null && oldWeight !== weight) {
95358
+ var columns = this._columns;
95359
+ var columnsLength = columns.length;
95360
+ var minWeight = this.minWeight;
95361
+ var newWeight = Math.max(minWeight, weight);
95362
+ if (this._weight !== newWeight) {
95363
+ this._isLocked = true;
95364
+ if (minWeight < oldWeight) {
95365
+ var columnWeightRatio = (newWeight - minWeight) / (oldWeight - minWeight);
95366
+ for (var i = 0; i < columnsLength; ++i) {
95367
+ var column = columns[i];
95368
+ var columnWeight = column.weight;
95369
+ if (column.resizable && columnWeight != null) {
95370
+ column.weight = columnWeight * columnWeightRatio;
95371
+ }
95372
+ }
95373
+ }
95374
+ else {
95375
+ var newColumnWeight = (newWeight - minWeight) / this._nresizable;
95376
+ for (var i = 0; i < columnsLength; ++i) {
95377
+ var column = columns[i];
95378
+ var columnWeight = column.weight;
95379
+ if (column.resizable && columnWeight != null) {
95380
+ column.weight = newColumnWeight;
95381
+ }
95382
+ }
95383
+ }
95384
+ this._isLocked = false;
95385
+ this.onResize();
95386
+ }
95387
+ }
95388
+ },
95389
+ enumerable: false,
95390
+ configurable: true
95391
+ });
95392
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWeight", {
95393
+ get: function () {
95394
+ var result = 0;
95395
+ var columns = this._columns;
95396
+ var columnsLength = columns.length;
95397
+ for (var i = 0; i < columnsLength; ++i) {
95398
+ var column = columns[i];
95399
+ var columnWeight = column.weight;
95400
+ if (!column.resizable && columnWeight != null) {
95401
+ result += columnWeight;
95402
+ }
95403
+ }
95404
+ return result;
95405
+ },
95406
+ enumerable: false,
95407
+ configurable: true
95408
+ });
95409
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "width", {
95410
+ get: function () {
95411
+ return this._width;
95412
+ },
95413
+ set: function (width) {
95414
+ var oldWidth = this._width;
95415
+ var nresizable = this._nresizable;
95416
+ if (0 < nresizable && oldWidth != null && oldWidth !== width) {
95417
+ var columns = this._columns;
95418
+ var columnsLength = columns.length;
95419
+ var minWidth = this.minWidth;
95420
+ var newWidth = Math.max(minWidth, width);
95421
+ if (oldWidth !== newWidth) {
95422
+ this._isLocked = true;
95423
+ if (minWidth < oldWidth) {
95424
+ var columnWidthRatio = (newWidth - minWidth) / (oldWidth - minWidth);
95425
+ for (var i = 0; i < columnsLength; ++i) {
95426
+ var column = columns[i];
95427
+ var columnWidth = column.width;
95428
+ if (column.resizable && columnWidth != null) {
95429
+ column.width = columnWidth * columnWidthRatio;
95430
+ }
95431
+ }
95432
+ }
95433
+ else {
95434
+ var newColumnWidth = (newWidth - minWidth) / this._nresizable;
95435
+ for (var i = 0; i < columnsLength; ++i) {
95436
+ var column = columns[i];
95437
+ var columnWidth = column.width;
95438
+ if (column.resizable && columnWidth != null) {
95439
+ column.width = newColumnWidth;
95440
+ }
95441
+ }
95442
+ }
95443
+ this._isLocked = false;
95444
+ this.onResize();
95445
+ }
95446
+ }
95447
+ },
95448
+ enumerable: false,
95449
+ configurable: true
95450
+ });
95451
+ Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWidth", {
95452
+ get: function () {
95453
+ var result = 0;
95454
+ var columns = this._columns;
95455
+ var columnsLength = columns.length;
95456
+ for (var i = 0; i < columnsLength; ++i) {
95457
+ var column = columns[i];
95458
+ var columnWidth = column.width;
95459
+ if (!column.resizable && columnWidth != null) {
95460
+ result += columnWidth;
95461
+ }
95462
+ }
95463
+ return result;
95464
+ },
95465
+ enumerable: false,
95466
+ configurable: true
95467
+ });
95468
+ DTableCategoryColumnImpl.prototype.add = function (column) {
95469
+ this._columns.push(column);
95470
+ if (this._weight != null) {
95471
+ var weight = column.weight;
95472
+ if (weight != null) {
95473
+ this._weight += weight;
95474
+ if (column.resizable) {
95475
+ this._nresizable += 1;
95476
+ }
95477
+ column.on("resize", this._onResizeBound);
95478
+ }
95479
+ }
95480
+ else if (this._width != null) {
95481
+ var width = column.width;
95482
+ if (width != null) {
95483
+ this._width += width;
95484
+ if (column.resizable) {
95485
+ this._nresizable += 1;
95486
+ }
95487
+ column.on("resize", this._onResizeBound);
95488
+ }
95489
+ }
95490
+ };
95491
+ return DTableCategoryColumnImpl;
95492
+ }(pixi_js.utils.EventEmitter));
95493
+
95008
95494
  /*
95009
95495
  * Copyright (C) 2019 Toshiba Corporation
95010
95496
  * SPDX-License-Identifier: Apache-2.0
95011
95497
  */
95012
95498
  var DTableCategory = /** @class */ (function (_super) {
95013
95499
  __extends(DTableCategory, _super);
95014
- function DTableCategory(options) {
95015
- var _a;
95016
- var _this = _super.call(this, options) || this;
95017
- var offset = (_a = options.offset) !== null && _a !== void 0 ? _a : 0;
95500
+ function DTableCategory(columns, frozen, offset, options) {
95501
+ var _this = _super.call(this, columns, frozen, options) || this;
95502
+ _this._columns = columns;
95503
+ _this._frozen = frozen;
95018
95504
  _this._offset = offset;
95019
95505
  _this.transform.position.y = offset;
95020
- _this.initCells(options, _this._columns, _this._frozen);
95506
+ _this.initCells();
95507
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95508
+ var column = columns[i];
95509
+ column.on("resize", _this.newOnColumnResize(i, column));
95510
+ }
95021
95511
  return _this;
95022
95512
  }
95513
+ DTableCategory.prototype.newOnColumnResize = function (index, column) {
95514
+ var _this = this;
95515
+ return function () {
95516
+ _this.onColumnResize(index, column);
95517
+ };
95518
+ };
95519
+ DTableCategory.prototype.onColumnResize = function (index, column) {
95520
+ var columnWeight = column.weight;
95521
+ if (columnWeight != null) {
95522
+ this.onColumnResizeWeight(this, index, columnWeight);
95523
+ }
95524
+ else {
95525
+ var columnWidth = column.width;
95526
+ if (columnWidth != null) {
95527
+ this.onColumnResizeWidth(this, index, columnWidth);
95528
+ }
95529
+ }
95530
+ };
95531
+ DTableCategory.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
95532
+ var cells = row.children;
95533
+ var cellsLength = cells.length;
95534
+ var cellsIndex = cellsLength - index - 1;
95535
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
95536
+ cells[cellsIndex].weight = columnWeight;
95537
+ }
95538
+ };
95539
+ DTableCategory.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
95540
+ var cells = row.children;
95541
+ var cellsLength = cells.length;
95542
+ var cellsIndex = cellsLength - index - 1;
95543
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
95544
+ cells[cellsIndex].width = columnWidth;
95545
+ }
95546
+ };
95023
95547
  DTableCategory.prototype.onParentMove = function (newX, newY, oldX, oldY) {
95024
95548
  _super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
95025
95549
  this.transform.position.y = -newY + this._offset;
@@ -95033,16 +95557,20 @@ var DTableCategory = /** @class */ (function (_super) {
95033
95557
  return 0;
95034
95558
  };
95035
95559
  DTableCategory.prototype.newCell = function (columnIndex, column, columns, options) {
95036
- return new DTableCategoryCell(this.toCellOptions(columnIndex, column, options));
95560
+ return new DTableCategoryCell(this, columnIndex, column, this.toCellOptions(columnIndex, column, options));
95037
95561
  };
95038
95562
  DTableCategory.prototype.toCellOptions = function (columnIndex, column, options) {
95039
- var result = options.cell;
95563
+ var result = options === null || options === void 0 ? void 0 : options.cell;
95040
95564
  if (result) {
95565
+ // Weight
95041
95566
  result.weight = column.weight;
95567
+ // Width
95042
95568
  result.width = column.width;
95569
+ // Label
95043
95570
  var text = result.text || {};
95044
95571
  result.text = text;
95045
95572
  text.value = text.value || column.label;
95573
+ // Done
95046
95574
  return result;
95047
95575
  }
95048
95576
  else {
@@ -95061,6 +95589,637 @@ var DTableCategory = /** @class */ (function (_super) {
95061
95589
  return DTableCategory;
95062
95590
  }(DTableRow));
95063
95591
 
95592
+ var DTableCategoryContainerImpl = /** @class */ (function () {
95593
+ function DTableCategoryContainerImpl(columns, frozen, options) {
95594
+ var count = this.toCount(columns);
95595
+ var items = [];
95596
+ var offset = 0;
95597
+ for (var i = count - 1; 0 <= i; --i) {
95598
+ var item = new DTableCategory(this.toColumns(i, columns, frozen), frozen, offset, options);
95599
+ items.push(item);
95600
+ offset += item.height;
95601
+ }
95602
+ this.items = items;
95603
+ }
95604
+ DTableCategoryContainerImpl.prototype.toCount = function (columns) {
95605
+ var result = 0;
95606
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95607
+ var category = columns[i].category;
95608
+ if (category != null) {
95609
+ var count = isString(category) ? 1 : category.length;
95610
+ result = Math.max(result, count);
95611
+ }
95612
+ }
95613
+ return result;
95614
+ };
95615
+ DTableCategoryContainerImpl.prototype.isCategory = function (index, a, b) {
95616
+ if (a != null) {
95617
+ if (b != null) {
95618
+ if (isString(a)) {
95619
+ if (isString(b)) {
95620
+ if (0 < index) {
95621
+ return true;
95622
+ }
95623
+ else {
95624
+ return a === b;
95625
+ }
95626
+ }
95627
+ else {
95628
+ if (0 < index) {
95629
+ return b.length <= index;
95630
+ }
95631
+ else {
95632
+ return b.length === 1 && a === b[0];
95633
+ }
95634
+ }
95635
+ }
95636
+ else {
95637
+ if (isString(b)) {
95638
+ if (0 < index) {
95639
+ return a.length <= index;
95640
+ }
95641
+ else {
95642
+ return a.length === 1 && a[0] === b;
95643
+ }
95644
+ }
95645
+ else {
95646
+ if (a.length <= index && b.length <= index) {
95647
+ return true;
95648
+ }
95649
+ else if (b.length === a.length) {
95650
+ for (var i = index, imax = a.length; i < imax; ++i) {
95651
+ if (a[i] !== b[i]) {
95652
+ return false;
95653
+ }
95654
+ }
95655
+ return true;
95656
+ }
95657
+ return false;
95658
+ }
95659
+ }
95660
+ }
95661
+ else {
95662
+ if (isString(a)) {
95663
+ if (0 < index) {
95664
+ return true;
95665
+ }
95666
+ else {
95667
+ return false;
95668
+ }
95669
+ }
95670
+ else {
95671
+ if (a.length <= index) {
95672
+ return true;
95673
+ }
95674
+ else {
95675
+ return false;
95676
+ }
95677
+ }
95678
+ }
95679
+ }
95680
+ else {
95681
+ if (b != null) {
95682
+ if (isString(b)) {
95683
+ if (0 < index) {
95684
+ return true;
95685
+ }
95686
+ else {
95687
+ return false;
95688
+ }
95689
+ }
95690
+ else {
95691
+ if (b.length <= index) {
95692
+ return true;
95693
+ }
95694
+ else {
95695
+ return false;
95696
+ }
95697
+ }
95698
+ }
95699
+ else {
95700
+ return true;
95701
+ }
95702
+ }
95703
+ };
95704
+ DTableCategoryContainerImpl.prototype.toColumns = function (index, columns, frozen) {
95705
+ var result = [];
95706
+ var tcolumn = null;
95707
+ var ccolumn = null;
95708
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
95709
+ var column = columns[i];
95710
+ if (i !== frozen &&
95711
+ ccolumn &&
95712
+ tcolumn &&
95713
+ this.isCategory(index, tcolumn.category, column.category)) {
95714
+ if (ccolumn.weight != null && column.weight != null) {
95715
+ ccolumn.add(column);
95716
+ }
95717
+ else if (ccolumn.width != null && column.width != null) {
95718
+ ccolumn.add(column);
95719
+ }
95720
+ else {
95721
+ tcolumn = column;
95722
+ ccolumn = new DTableCategoryColumnImpl(index, column);
95723
+ result.push(ccolumn);
95724
+ }
95725
+ }
95726
+ else {
95727
+ tcolumn = column;
95728
+ ccolumn = new DTableCategoryColumnImpl(index, column);
95729
+ result.push(ccolumn);
95730
+ }
95731
+ }
95732
+ return result;
95733
+ };
95734
+ return DTableCategoryContainerImpl;
95735
+ }());
95736
+
95737
+ var defaultGetter = function (row, columnIndex) {
95738
+ return row[columnIndex];
95739
+ };
95740
+ var defaultSetter = function (row, columnIndex, cell) {
95741
+ row[columnIndex] = cell;
95742
+ };
95743
+ var defaultGetterEmpty = function () { return ""; };
95744
+ var defaultSetterEmpty = function () {
95745
+ // DO NOTHING
95746
+ };
95747
+ var toPathGetter = function (path, def) {
95748
+ if (path.length <= 1) {
95749
+ var key_1 = path[0];
95750
+ if (def === undefined) {
95751
+ return function (row) {
95752
+ return row[key_1];
95753
+ };
95754
+ }
95755
+ else {
95756
+ return function (row) {
95757
+ return Object.prototype.hasOwnProperty.call(row, key_1) ? row[key_1] : def;
95758
+ };
95759
+ }
95760
+ }
95761
+ else {
95762
+ if (def === undefined) {
95763
+ return function (row) {
95764
+ for (var i = 0, imax = path.length - 1; i < imax; ++i) {
95765
+ row = row[path[i]];
95766
+ }
95767
+ return row[path[path.length - 1]];
95768
+ };
95769
+ }
95770
+ else {
95771
+ return function (row) {
95772
+ for (var i = 0, imax = path.length - 1; i < imax; ++i) {
95773
+ row = row[path[i]];
95774
+ }
95775
+ var key = path[path.length - 1];
95776
+ return Object.prototype.hasOwnProperty.call(row, key) ? row[key] : def;
95777
+ };
95778
+ }
95779
+ }
95780
+ };
95781
+ var toPathSetter = function (path) {
95782
+ if (path.length <= 1) {
95783
+ var key_2 = path[0];
95784
+ return function (row, columnIndex, cell) {
95785
+ row[key_2] = cell;
95786
+ };
95787
+ }
95788
+ else {
95789
+ return function (row, columnIndex, cell) {
95790
+ for (var i = 0, imax = path.length - 1; i < imax; ++i) {
95791
+ row = row[path[i]] || {};
95792
+ }
95793
+ row[path[path.length - 1]] = cell;
95794
+ };
95795
+ }
95796
+ };
95797
+ var toAlign = function (options, type) {
95798
+ var align = options.align;
95799
+ if (align != null) {
95800
+ if (isString(align)) {
95801
+ return DAlignHorizontal[align];
95802
+ }
95803
+ else {
95804
+ return align;
95805
+ }
95806
+ }
95807
+ switch (type) {
95808
+ case DTableColumnType.TEXT:
95809
+ case DTableColumnType.TEXT_AREA:
95810
+ return DAlignHorizontal.LEFT;
95811
+ case DTableColumnType.REAL:
95812
+ case DTableColumnType.INTEGER:
95813
+ return DAlignHorizontal.RIGHT;
95814
+ case DTableColumnType.BUTTON:
95815
+ case DTableColumnType.INDEX:
95816
+ case DTableColumnType.SELECT:
95817
+ case DTableColumnType.ACTION:
95818
+ case DTableColumnType.LINK:
95819
+ case DTableColumnType.CHECK:
95820
+ case DTableColumnType.CHECK_SINGLE:
95821
+ case DTableColumnType.COLOR:
95822
+ return DAlignHorizontal.CENTER;
95823
+ default:
95824
+ return DAlignHorizontal.LEFT;
95825
+ }
95826
+ };
95827
+ var toDataChecker = function (path) {
95828
+ if (path != null) {
95829
+ var pathLength_1 = path.length;
95830
+ if (pathLength_1 <= 1) {
95831
+ var key_3 = path[0];
95832
+ return function (row) {
95833
+ return Object.prototype.hasOwnProperty.call(row, key_3);
95834
+ };
95835
+ }
95836
+ else {
95837
+ return function (row) {
95838
+ for (var i = 0; i < pathLength_1; ++i) {
95839
+ var part = path[i];
95840
+ if (part in row) {
95841
+ row = row[part];
95842
+ }
95843
+ else {
95844
+ return false;
95845
+ }
95846
+ }
95847
+ return true;
95848
+ };
95849
+ }
95850
+ }
95851
+ return function (row, columnIndex) {
95852
+ return columnIndex < row.length;
95853
+ };
95854
+ };
95855
+ var toEditingEnable = function (enable, path) {
95856
+ if (isString(enable)) {
95857
+ return toDataChecker(path);
95858
+ }
95859
+ else if (enable != null) {
95860
+ return enable;
95861
+ }
95862
+ else {
95863
+ return false;
95864
+ }
95865
+ };
95866
+ var toEditing = function (options, path) {
95867
+ var _a;
95868
+ var editing = options.editing;
95869
+ var editable = options.editable;
95870
+ if (editing) {
95871
+ return {
95872
+ enable: toEditingEnable((_a = editing.enable) !== null && _a !== void 0 ? _a : editable, path),
95873
+ formatter: editing.formatter,
95874
+ unformatter: editing.unformatter,
95875
+ validator: editing.validator
95876
+ };
95877
+ }
95878
+ return {
95879
+ enable: toEditingEnable(editable, path)
95880
+ };
95881
+ };
95882
+ var toComparator = function (getter, index) {
95883
+ return function (rowA, rowB) {
95884
+ var valueA = getter(rowA, index);
95885
+ var valueB = getter(rowB, index);
95886
+ return valueA < valueB ? -1 : valueB < valueA ? +1 : 0;
95887
+ };
95888
+ };
95889
+ var toSorting = function (getter, index, options) {
95890
+ var sorting = options.sorting;
95891
+ var sortable = options.sortable;
95892
+ if (sorting) {
95893
+ if (sorting.enable || sortable) {
95894
+ return {
95895
+ enable: true,
95896
+ comparator: sorting.comparator || toComparator(getter, index)
95897
+ };
95898
+ }
95899
+ return {
95900
+ enable: false
95901
+ };
95902
+ }
95903
+ if (sortable) {
95904
+ return {
95905
+ enable: true,
95906
+ comparator: toComparator(getter, index)
95907
+ };
95908
+ }
95909
+ return {
95910
+ enable: false
95911
+ };
95912
+ };
95913
+ var toMenu = function (options) {
95914
+ if (options == null) {
95915
+ return undefined;
95916
+ }
95917
+ else if (options instanceof DMenu) {
95918
+ return options;
95919
+ }
95920
+ else {
95921
+ return new DMenu(options);
95922
+ }
95923
+ };
95924
+ var toDialog = function (options) {
95925
+ if (options == null) {
95926
+ return undefined;
95927
+ }
95928
+ else if ("open" in options) {
95929
+ return options;
95930
+ }
95931
+ else {
95932
+ return new DDialogSelect(options);
95933
+ }
95934
+ };
95935
+ var defaultSelectingGetter = function (dialog) {
95936
+ return dialog.value;
95937
+ };
95938
+ var defaultSelectingSetter = function () {
95939
+ // DO NOTHING
95940
+ };
95941
+ var toSelecting = function (options) {
95942
+ if (options) {
95943
+ return {
95944
+ getter: options.getter || defaultSelectingGetter,
95945
+ setter: options.setter || defaultSelectingSetter,
95946
+ menu: toMenu(options.menu),
95947
+ multiple: toMenu(options.multiple),
95948
+ dialog: toDialog(options.dialog),
95949
+ promise: options.promise
95950
+ };
95951
+ }
95952
+ return {
95953
+ getter: defaultSelectingGetter,
95954
+ setter: defaultSelectingSetter
95955
+ };
95956
+ };
95957
+ var toGetter = function (options, type, parts) {
95958
+ var getter = options.getter;
95959
+ if (getter) {
95960
+ return getter;
95961
+ }
95962
+ switch (type) {
95963
+ case DTableColumnType.ACTION:
95964
+ case DTableColumnType.LINK:
95965
+ return defaultGetterEmpty;
95966
+ default:
95967
+ if (parts == null) {
95968
+ return defaultGetter;
95969
+ }
95970
+ else {
95971
+ return toPathGetter(parts, options.default);
95972
+ }
95973
+ }
95974
+ };
95975
+ var toSetter = function (options, type, path) {
95976
+ var setter = options.setter;
95977
+ if (setter) {
95978
+ return setter;
95979
+ }
95980
+ switch (type) {
95981
+ case DTableColumnType.BUTTON:
95982
+ case DTableColumnType.ACTION:
95983
+ case DTableColumnType.LINK:
95984
+ return defaultSetterEmpty;
95985
+ default:
95986
+ if (path == null) {
95987
+ return defaultSetter;
95988
+ }
95989
+ else {
95990
+ return toPathSetter(path);
95991
+ }
95992
+ }
95993
+ };
95994
+ var toState = function (options) {
95995
+ var state = options.state;
95996
+ if (state != null) {
95997
+ if (isString(state) || isArray(state)) {
95998
+ return {
95999
+ initial: state,
96000
+ modifier: undefined
96001
+ };
96002
+ }
96003
+ else {
96004
+ return {
96005
+ initial: undefined,
96006
+ modifier: state
96007
+ };
96008
+ }
96009
+ }
96010
+ return {
96011
+ initial: undefined,
96012
+ modifier: undefined
96013
+ };
96014
+ };
96015
+ var toPath = function (options) {
96016
+ return options.path != null ? options.path.split(".") : null;
96017
+ };
96018
+ var toRenderable = function (options, path) {
96019
+ var renderable = options.renderable;
96020
+ if (isString(renderable)) {
96021
+ return toDataChecker(path);
96022
+ }
96023
+ else if (renderable != null) {
96024
+ return renderable;
96025
+ }
96026
+ return true;
96027
+ };
96028
+ var DTableColumnImpl = /** @class */ (function (_super) {
96029
+ __extends(DTableColumnImpl, _super);
96030
+ function DTableColumnImpl(index, options) {
96031
+ var _a, _b, _c;
96032
+ var _this = _super.call(this) || this;
96033
+ var weight = options.weight;
96034
+ var width = options.width;
96035
+ if (weight != null) {
96036
+ if (width != null) {
96037
+ width = undefined;
96038
+ }
96039
+ }
96040
+ else if (width == null) {
96041
+ weight = 1;
96042
+ }
96043
+ var type = toEnum((_a = options.type) !== null && _a !== void 0 ? _a : DTableColumnType.TEXT, DTableColumnType);
96044
+ var align = toAlign(options, type);
96045
+ var label = options.label || "";
96046
+ var path = toPath(options);
96047
+ var getter = toGetter(options, type, path);
96048
+ var setter = toSetter(options, type, path);
96049
+ _this._weight = weight;
96050
+ _this._width = width;
96051
+ _this.resizable = (_b = options.resizable) !== null && _b !== void 0 ? _b : false;
96052
+ _this.type = type;
96053
+ _this.label = label;
96054
+ _this.getter = getter;
96055
+ _this.setter = setter;
96056
+ _this.formatter = options.formatter;
96057
+ _this.renderable = toRenderable(options, path);
96058
+ _this.align = align;
96059
+ _this.state = toState(options);
96060
+ _this.editing = toEditing(options, path);
96061
+ _this.sorting = toSorting(getter, index, options);
96062
+ _this.header = options.header;
96063
+ _this.body = options.body;
96064
+ _this.selecting = toSelecting(options.selecting);
96065
+ _this.category = options.category;
96066
+ _this.frozen = options.frozen;
96067
+ _this.offset = 0.0;
96068
+ _this.link = options.link;
96069
+ _this.update = toEnum((_c = options.update) !== null && _c !== void 0 ? _c : DTableColumnUpdate.CELL, DTableColumnUpdate);
96070
+ return _this;
96071
+ }
96072
+ Object.defineProperty(DTableColumnImpl.prototype, "weight", {
96073
+ get: function () {
96074
+ return this._weight;
96075
+ },
96076
+ set: function (weight) {
96077
+ if (this._weight != null && this._weight !== weight) {
96078
+ this._weight = weight;
96079
+ this.emit("resize", this);
96080
+ }
96081
+ },
96082
+ enumerable: false,
96083
+ configurable: true
96084
+ });
96085
+ Object.defineProperty(DTableColumnImpl.prototype, "width", {
96086
+ get: function () {
96087
+ return this._width;
96088
+ },
96089
+ set: function (width) {
96090
+ if (this._width != null && this._width !== width) {
96091
+ this._width = width;
96092
+ this.emit("resize", this);
96093
+ }
96094
+ },
96095
+ enumerable: false,
96096
+ configurable: true
96097
+ });
96098
+ return DTableColumnImpl;
96099
+ }(pixi_js.utils.EventEmitter));
96100
+
96101
+ var DTableColumnContainerImpl = /** @class */ (function (_super) {
96102
+ __extends(DTableColumnContainerImpl, _super);
96103
+ function DTableColumnContainerImpl(parent, options) {
96104
+ var _this = _super.call(this) || this;
96105
+ _this.parent = parent;
96106
+ var columns = [];
96107
+ if (options != null) {
96108
+ for (var i = 0, imax = options.length; i < imax; ++i) {
96109
+ var column = new DTableColumnImpl(i, options[i]);
96110
+ columns.push(column);
96111
+ column.on("resize", _this.newOnColumnResize(i, column));
96112
+ }
96113
+ }
96114
+ _this.items = columns;
96115
+ var frozen = 0;
96116
+ for (var i = columns.length - 1; 0 <= i; --i) {
96117
+ if (columns[i].frozen === true) {
96118
+ frozen = i + 1;
96119
+ break;
96120
+ }
96121
+ }
96122
+ _this.frozen = frozen;
96123
+ return _this;
96124
+ }
96125
+ DTableColumnContainerImpl.prototype.newOnColumnResize = function (index, column) {
96126
+ var _this = this;
96127
+ return function () {
96128
+ _this.onColumnResize(index, column);
96129
+ };
96130
+ };
96131
+ DTableColumnContainerImpl.prototype.onColumnResize = function (index, column) {
96132
+ this.onColumnResizeHeader(index, column);
96133
+ this.onColumnResizeBody(index, column);
96134
+ this.emit("resize", index, column, this);
96135
+ };
96136
+ DTableColumnContainerImpl.prototype.onColumnResizeHeader = function (index, column) {
96137
+ var header = this.parent.header;
96138
+ if (header != null) {
96139
+ var columnWeight = column.weight;
96140
+ if (columnWeight != null) {
96141
+ this.onColumnResizeWeight(header, index, columnWeight);
96142
+ }
96143
+ else {
96144
+ var columnWidth = column.width;
96145
+ if (columnWidth != null) {
96146
+ this.onColumnResizeWidth(header, index, columnWidth);
96147
+ }
96148
+ }
96149
+ }
96150
+ };
96151
+ DTableColumnContainerImpl.prototype.onColumnResizeBody = function (index, column) {
96152
+ var rows = this.parent.body.children;
96153
+ var columnWeight = column.weight;
96154
+ if (columnWeight != null) {
96155
+ for (var i = 0, imax = rows.length; i < imax; ++i) {
96156
+ this.onColumnResizeWeight(rows[i], index, columnWeight);
96157
+ }
96158
+ }
96159
+ else {
96160
+ var columnWidth = column.width;
96161
+ if (columnWidth != null) {
96162
+ for (var i = 0, imax = rows.length; i < imax; ++i) {
96163
+ this.onColumnResizeWidth(rows[i], index, columnWidth);
96164
+ }
96165
+ }
96166
+ }
96167
+ };
96168
+ DTableColumnContainerImpl.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
96169
+ var cells = row.children;
96170
+ var cellsLength = cells.length;
96171
+ var cellsIndex = cellsLength - index - 1;
96172
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
96173
+ cells[cellsIndex].weight = columnWeight;
96174
+ }
96175
+ };
96176
+ DTableColumnContainerImpl.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
96177
+ var cells = row.children;
96178
+ var cellsLength = cells.length;
96179
+ var cellsIndex = cellsLength - index - 1;
96180
+ if (0 <= cellsIndex && cellsIndex < cellsLength) {
96181
+ cells[cellsIndex].width = columnWidth;
96182
+ }
96183
+ };
96184
+ Object.defineProperty(DTableColumnContainerImpl.prototype, "width", {
96185
+ get: function () {
96186
+ var result = 0;
96187
+ var items = this.items;
96188
+ var length = items.length;
96189
+ for (var i = 0; i < length; ++i) {
96190
+ var item = items[i];
96191
+ var itemWidth = item.width;
96192
+ if (itemWidth != null) {
96193
+ result += itemWidth;
96194
+ }
96195
+ }
96196
+ return result;
96197
+ },
96198
+ enumerable: false,
96199
+ configurable: true
96200
+ });
96201
+ DTableColumnContainerImpl.prototype.get = function (index) {
96202
+ var columns = this.items;
96203
+ if (0 <= index && index < columns.length) {
96204
+ return columns[index];
96205
+ }
96206
+ return null;
96207
+ };
96208
+ DTableColumnContainerImpl.prototype.each = function (iteratee) {
96209
+ var columns = this.items;
96210
+ for (var i = 0, imax = columns.length; i < imax; ++i) {
96211
+ if (iteratee(columns[i], i) === false) {
96212
+ break;
96213
+ }
96214
+ }
96215
+ return this;
96216
+ };
96217
+ DTableColumnContainerImpl.prototype.size = function () {
96218
+ return this.items.length;
96219
+ };
96220
+ return DTableColumnContainerImpl;
96221
+ }(pixi_js.utils.EventEmitter));
96222
+
95064
96223
  /*
95065
96224
  * Copyright (C) 2019 Toshiba Corporation
95066
96225
  * SPDX-License-Identifier: Apache-2.0
@@ -96032,24 +97191,37 @@ var DTableHeaderCellCheck = /** @class */ (function () {
96032
97191
  * Copyright (C) 2019 Toshiba Corporation
96033
97192
  * SPDX-License-Identifier: Apache-2.0
96034
97193
  */
97194
+ var DTableHeaderCellEdge = {
97195
+ NONE: 0,
97196
+ LEFT: 1,
97197
+ RIGHT: 2,
97198
+ BOTH: 3
97199
+ };
96035
97200
  var DTableHeaderCell = /** @class */ (function (_super) {
96036
97201
  __extends(DTableHeaderCell, _super);
96037
- function DTableHeaderCell() {
96038
- return _super !== null && _super.apply(this, arguments) || this;
96039
- }
96040
- DTableHeaderCell.prototype.init = function (options) {
96041
- if (options != null) {
96042
- this._header = options.header;
96043
- this._column = options.column;
96044
- this._columnIndex = options.columnIndex;
96045
- this._check = new DTableHeaderCellCheck(this, options.check);
96046
- }
96047
- else {
96048
- this._check = new DTableHeaderCellCheck(this);
97202
+ function DTableHeaderCell(header, columnIndex, column, options) {
97203
+ var _this = _super.call(this, options) || this;
97204
+ _this._header = header;
97205
+ _this._column = column;
97206
+ _this._columnIndex = columnIndex;
97207
+ var check = new DTableHeaderCellCheck(_this, options === null || options === void 0 ? void 0 : options.check);
97208
+ _this._check = check;
97209
+ _this._edgeSize = _this.theme.getEdgeWidth();
97210
+ _this._wasResizing = false;
97211
+ var sortable = column.sorting.enable;
97212
+ var checkable = check.isEnabled;
97213
+ if (checkable || sortable) {
97214
+ _this.on(UtilPointerEvent.tap, function (e) {
97215
+ _this.onClick(e);
97216
+ });
97217
+ var state = _this.state;
97218
+ state.lock();
97219
+ state.set(DTableState.SORTABLE, sortable);
97220
+ state.set(DTableState.CHECKABLE, checkable);
97221
+ state.unlock();
96049
97222
  }
96050
- _super.prototype.init.call(this, options);
96051
- this.initOnClick(options);
96052
- };
97223
+ return _this;
97224
+ }
96053
97225
  Object.defineProperty(DTableHeaderCell.prototype, "column", {
96054
97226
  get: function () {
96055
97227
  return this._column;
@@ -96078,23 +97250,201 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96078
97250
  enumerable: false,
96079
97251
  configurable: true
96080
97252
  });
96081
- DTableHeaderCell.prototype.initOnClick = function (options) {
97253
+ DTableHeaderCell.prototype.onDown = function (e) {
97254
+ var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
97255
+ if (edges != null) {
97256
+ this._wasResizing = true;
97257
+ var layer = DApplications.getLayer(this);
97258
+ if (layer != null) {
97259
+ var interactionManager = layer.renderer.plugins.interaction;
97260
+ var columnIndex = this._columnIndex;
97261
+ if (edges === DTableHeaderCellEdge.LEFT) {
97262
+ this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
97263
+ }
97264
+ else {
97265
+ this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
97266
+ }
97267
+ }
97268
+ }
97269
+ else {
97270
+ this._wasResizing = false;
97271
+ _super.prototype.onDown.call(this, e);
97272
+ }
97273
+ };
97274
+ DTableHeaderCell.prototype.findLeftResizableCell = function (columnIndex) {
97275
+ var children = this._header.children;
97276
+ var childrenLength = children.length;
97277
+ for (var i = columnIndex; 0 <= i; --i) {
97278
+ var child = children[childrenLength - i - 1];
97279
+ if (child.column.resizable) {
97280
+ return child;
97281
+ }
97282
+ }
97283
+ return null;
97284
+ };
97285
+ DTableHeaderCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
97286
+ var children = this._header.children;
97287
+ var childrenLength = children.length;
97288
+ for (var i = columnIndex + 1; i < childrenLength; ++i) {
97289
+ var child = children[childrenLength - i - 1];
97290
+ var childColumn = child.column;
97291
+ if (childColumn.resizable) {
97292
+ var childColumnWeight = childColumn.weight;
97293
+ if (childColumnWeight != null) {
97294
+ return child;
97295
+ }
97296
+ }
97297
+ }
97298
+ return null;
97299
+ };
97300
+ DTableHeaderCell.prototype.checkIfEdgeResizable = function (columnIndex) {
97301
+ var target = this.findLeftResizableCell(columnIndex);
97302
+ if (target != null) {
97303
+ if (target.column.weight != null) {
97304
+ return this.findRightResizableCellOfWeight(target.columnIndex) != null;
97305
+ }
97306
+ else {
97307
+ return true;
97308
+ }
97309
+ }
97310
+ return false;
97311
+ };
97312
+ DTableHeaderCell.prototype.getResizableEdges = function () {
97313
+ var result = this._resizableEdges;
97314
+ if (result == null) {
97315
+ var columnIndex = this._columnIndex;
97316
+ if (this.checkIfEdgeResizable(columnIndex - 1)) {
97317
+ if (this.checkIfEdgeResizable(columnIndex)) {
97318
+ result = DTableHeaderCellEdge.BOTH;
97319
+ }
97320
+ else {
97321
+ result = DTableHeaderCellEdge.LEFT;
97322
+ }
97323
+ }
97324
+ else {
97325
+ if (this.checkIfEdgeResizable(columnIndex)) {
97326
+ result = DTableHeaderCellEdge.RIGHT;
97327
+ }
97328
+ else {
97329
+ result = DTableHeaderCellEdge.NONE;
97330
+ }
97331
+ }
97332
+ this._resizableEdges = result;
97333
+ }
97334
+ return result;
97335
+ };
97336
+ DTableHeaderCell.prototype.onOver = function (e) {
96082
97337
  var _this = this;
96083
- var column = this._column;
96084
- if (column) {
96085
- var sortable = column.sorting.enable;
96086
- var checkable = this._check.isEnabled;
96087
- if (checkable || sortable) {
96088
- this.on(UtilPointerEvent.tap, function (e) {
96089
- _this.onClick(e);
96090
- });
96091
- var state = this.state;
96092
- state.lock();
96093
- state.set(DTableState.SORTABLE, sortable);
96094
- state.set(DTableState.CHECKABLE, checkable);
96095
- state.unlock();
97338
+ var _a;
97339
+ _super.prototype.onOver.call(this, e);
97340
+ if (this.getResizableEdges() !== DTableHeaderCellEdge.NONE) {
97341
+ var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
97342
+ _this.onHovered(event);
97343
+ }));
97344
+ this.on(UtilPointerEvent.move, onHoveredBound);
97345
+ // Since the cursor is set by InteractionManager before this method is called,
97346
+ // the cursor need to be overriden.
97347
+ this.onHovered(e);
97348
+ var layer = DApplications.getLayer(this);
97349
+ if (layer != null) {
97350
+ layer.renderer.plugins.interaction.cursor = this.cursor;
97351
+ }
97352
+ }
97353
+ };
97354
+ DTableHeaderCell.prototype.onOut = function (e) {
97355
+ _super.prototype.onOut.call(this, e);
97356
+ var onHoveredBound = this._onHoveredBound;
97357
+ if (onHoveredBound != null) {
97358
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
97359
+ this.off(UtilPointerEvent.move, onHoveredBound);
97360
+ }
97361
+ };
97362
+ DTableHeaderCell.prototype.onHovered = function (e) {
97363
+ var width = this.width;
97364
+ var x = this.toClickPosition(e);
97365
+ var edgeSize = this._edgeSize;
97366
+ if (0 <= x && x <= edgeSize) {
97367
+ if (this.getResizableEdges() & DTableHeaderCellEdge.LEFT) {
97368
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.LEFT);
97369
+ }
97370
+ else {
97371
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
97372
+ }
97373
+ }
97374
+ else if (width - edgeSize <= x && x <= width) {
97375
+ if (this.getResizableEdges() & DTableHeaderCellEdge.RIGHT) {
97376
+ this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.RIGHT);
97377
+ }
97378
+ else {
97379
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
96096
97380
  }
96097
97381
  }
97382
+ else {
97383
+ this.state.remove(DTableState.HOVERED_ON_EDGE);
97384
+ }
97385
+ };
97386
+ DTableHeaderCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
97387
+ // Find the resizable cell
97388
+ var left = this.findLeftResizableCell(columnIndex);
97389
+ if (left == null) {
97390
+ // No resizable cell
97391
+ return;
97392
+ }
97393
+ var header = this._header;
97394
+ var leftColumn = left.column;
97395
+ var leftOldWidth = left.width;
97396
+ var leftOldWeight = left.weight;
97397
+ if (leftColumn.weight == null) {
97398
+ header.state.add(DTableState.RESIZING);
97399
+ var onMove_1 = function (e) {
97400
+ leftColumn.width = Math.max(1, leftOldWidth + e.data.global.x - onDownPoint);
97401
+ };
97402
+ var onUp_1 = function (e) {
97403
+ header.state.remove(DTableState.RESIZING);
97404
+ interactionManager.off(UtilPointerEvent.move, onMove_1);
97405
+ interactionManager.off(UtilPointerEvent.up, onUp_1);
97406
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
97407
+ interactionManager.off(UtilPointerEvent.cancel, onUp_1);
97408
+ };
97409
+ interactionManager.on(UtilPointerEvent.move, onMove_1);
97410
+ interactionManager.on(UtilPointerEvent.up, onUp_1);
97411
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
97412
+ interactionManager.on(UtilPointerEvent.cancel, onUp_1);
97413
+ }
97414
+ else {
97415
+ var right = this.findRightResizableCellOfWeight(left.columnIndex);
97416
+ if (right == null) {
97417
+ // No right resizable cell found
97418
+ return;
97419
+ }
97420
+ var rightColumn_1 = right.column;
97421
+ var rightOldWeight = right.weight;
97422
+ var rightOldWidth = right.width;
97423
+ var totalWidth_1 = leftOldWidth + rightOldWidth;
97424
+ var totalWeight_1 = leftOldWeight + rightOldWeight;
97425
+ if (totalWidth_1 <= 0) {
97426
+ // The left and right resizable cells doesn't have non-zero width
97427
+ return;
97428
+ }
97429
+ header.state.add(DTableState.RESIZING);
97430
+ var onMove_2 = function (e) {
97431
+ var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
97432
+ var leftNewWeight = totalWeight_1 * (leftNewWidth / totalWidth_1);
97433
+ leftColumn.weight = leftNewWeight;
97434
+ rightColumn_1.weight = totalWeight_1 - leftNewWeight;
97435
+ };
97436
+ var onUp_2 = function (e) {
97437
+ header.state.remove(DTableState.RESIZING);
97438
+ interactionManager.off(UtilPointerEvent.move, onMove_2);
97439
+ interactionManager.off(UtilPointerEvent.up, onUp_2);
97440
+ interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
97441
+ interactionManager.off(UtilPointerEvent.cancel, onUp_2);
97442
+ };
97443
+ interactionManager.on(UtilPointerEvent.move, onMove_2);
97444
+ interactionManager.on(UtilPointerEvent.up, onUp_2);
97445
+ interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
97446
+ interactionManager.on(UtilPointerEvent.cancel, onUp_2);
97447
+ }
96098
97448
  };
96099
97449
  Object.defineProperty(DTableHeaderCell.prototype, "sorter", {
96100
97450
  get: function () {
@@ -96129,11 +97479,7 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96129
97479
  });
96130
97480
  Object.defineProperty(DTableHeaderCell.prototype, "comparator", {
96131
97481
  get: function () {
96132
- var column = this._column;
96133
- if (column) {
96134
- return column.sorting.comparator || null;
96135
- }
96136
- return null;
97482
+ return this._column.sorting.comparator || null;
96137
97483
  },
96138
97484
  enumerable: false,
96139
97485
  configurable: true
@@ -96160,8 +97506,8 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96160
97506
  }
96161
97507
  };
96162
97508
  DTableHeaderCell.prototype.toClickPosition = function (e) {
96163
- var checkWork = this._checkWork || new pixi_js.Point();
96164
- this._checkWork = checkWork;
97509
+ var _a;
97510
+ var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
96165
97511
  return e.data.getLocalPosition(this, checkWork).x;
96166
97512
  };
96167
97513
  DTableHeaderCell.prototype.isCheckClicked = function (e) {
@@ -96186,6 +97532,10 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96186
97532
  }
96187
97533
  return false;
96188
97534
  };
97535
+ DTableHeaderCell.prototype.isEdgeClicked = function (e) {
97536
+ return (e instanceof pixi_js.InteractionEvent &&
97537
+ (this.state.is(DTableState.HOVERED_ON_EDGE) || this._wasResizing));
97538
+ };
96189
97539
  DTableHeaderCell.prototype.onClick = function (e) {
96190
97540
  if (this.state.isActionable) {
96191
97541
  this.activate(e);
@@ -96195,13 +97545,15 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96195
97545
  this.onActivate(e);
96196
97546
  };
96197
97547
  DTableHeaderCell.prototype.onActivate = function (e) {
96198
- if (this.isCheckClicked(e)) {
96199
- this.onToggleStart();
96200
- this.onToggleEnd();
96201
- }
96202
- else {
96203
- this.doSort(e);
96204
- this.emit("active", this);
97548
+ if (!this.isEdgeClicked(e)) {
97549
+ if (this.isCheckClicked(e)) {
97550
+ this.onToggleStart();
97551
+ this.onToggleEnd();
97552
+ }
97553
+ else {
97554
+ this.doSort(e);
97555
+ this.emit("active", this);
97556
+ }
96205
97557
  }
96206
97558
  };
96207
97559
  DTableHeaderCell.prototype.doSort = function (e) {
@@ -96231,11 +97583,14 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96231
97583
  };
96232
97584
  Object.defineProperty(DTableHeaderCell.prototype, "isSortable", {
96233
97585
  get: function () {
96234
- var column = this._column;
96235
- if (column) {
96236
- return column.sorting.enable;
96237
- }
96238
- return false;
97586
+ return this._column.sorting.enable;
97587
+ },
97588
+ enumerable: false,
97589
+ configurable: true
97590
+ });
97591
+ Object.defineProperty(DTableHeaderCell.prototype, "isResizable", {
97592
+ get: function () {
97593
+ return this._column.resizable;
96239
97594
  },
96240
97595
  enumerable: false,
96241
97596
  configurable: true
@@ -96325,14 +97680,12 @@ var DTableHeaderCell = /** @class */ (function (_super) {
96325
97680
  */
96326
97681
  var DTableHeader = /** @class */ (function (_super) {
96327
97682
  __extends(DTableHeader, _super);
96328
- function DTableHeader(options) {
96329
- var _a, _b;
96330
- var _this = _super.call(this, options) || this;
96331
- _this._table = (_a = options.table) !== null && _a !== void 0 ? _a : null;
96332
- var offset = (_b = options.offset) !== null && _b !== void 0 ? _b : 0;
97683
+ function DTableHeader(table, columns, frozen, offset, options) {
97684
+ var _this = _super.call(this, columns, frozen, options) || this;
97685
+ _this._table = table;
96333
97686
  _this._offset = offset;
96334
97687
  _this.transform.position.y = offset;
96335
- _this.initCells(options, _this._columns, _this._frozen);
97688
+ _this.initCells();
96336
97689
  return _this;
96337
97690
  }
96338
97691
  Object.defineProperty(DTableHeader.prototype, "table", {
@@ -96355,10 +97708,10 @@ var DTableHeader = /** @class */ (function (_super) {
96355
97708
  return 0;
96356
97709
  };
96357
97710
  DTableHeader.prototype.newCell = function (columnIndex, column, columns, options) {
96358
- return new DTableHeaderCell(this.toCellOptions(columnIndex, column, options));
97711
+ return new DTableHeaderCell(this, columnIndex, column, this.toCellOptions(column, options));
96359
97712
  };
96360
- DTableHeader.prototype.toCellOptions = function (columnIndex, column, options) {
96361
- var result = column.header || options.cell;
97713
+ DTableHeader.prototype.toCellOptions = function (column, options) {
97714
+ var result = column.header || (options === null || options === void 0 ? void 0 : options.cell);
96362
97715
  if (result != null) {
96363
97716
  if (result.weight === undefined) {
96364
97717
  result.weight = column.weight;
@@ -96374,15 +97727,6 @@ var DTableHeader = /** @class */ (function (_super) {
96374
97727
  else if (result.text.value === undefined) {
96375
97728
  result.text.value = column.label;
96376
97729
  }
96377
- if (result.header === undefined) {
96378
- result.header = this;
96379
- }
96380
- if (result.column === undefined) {
96381
- result.column = column;
96382
- }
96383
- if (result.columnIndex === undefined) {
96384
- result.columnIndex = columnIndex;
96385
- }
96386
97730
  return result;
96387
97731
  }
96388
97732
  else {
@@ -96391,10 +97735,7 @@ var DTableHeader = /** @class */ (function (_super) {
96391
97735
  width: column.width,
96392
97736
  text: {
96393
97737
  value: column.label
96394
- },
96395
- header: this,
96396
- column: column,
96397
- columnIndex: columnIndex
97738
+ }
96398
97739
  };
96399
97740
  }
96400
97741
  };
@@ -96419,359 +97760,11 @@ var DTableScrollBar = /** @class */ (function (_super) {
96419
97760
  * Copyright (C) 2019 Toshiba Corporation
96420
97761
  * SPDX-License-Identifier: Apache-2.0
96421
97762
  */
96422
- var defaultGetter = function (row, columnIndex) {
96423
- return row[columnIndex];
96424
- };
96425
- var defaultSetter = function (row, columnIndex, cell) {
96426
- row[columnIndex] = cell;
96427
- };
96428
- var defaultGetterEmpty = function () { return ""; };
96429
- var defaultSetterEmpty = function () {
96430
- // DO NOTHING
96431
- };
96432
- var toPathGetter = function (path, def) {
96433
- if (path.length <= 1) {
96434
- var key_1 = path[0];
96435
- if (def === undefined) {
96436
- return function (row) {
96437
- return row[key_1];
96438
- };
96439
- }
96440
- else {
96441
- return function (row) {
96442
- return Object.prototype.hasOwnProperty.call(row, key_1) ? row[key_1] : def;
96443
- };
96444
- }
96445
- }
96446
- else {
96447
- if (def === undefined) {
96448
- return function (row) {
96449
- for (var i = 0, imax = path.length - 1; i < imax; ++i) {
96450
- row = row[path[i]];
96451
- }
96452
- return row[path[path.length - 1]];
96453
- };
96454
- }
96455
- else {
96456
- return function (row) {
96457
- for (var i = 0, imax = path.length - 1; i < imax; ++i) {
96458
- row = row[path[i]];
96459
- }
96460
- var key = path[path.length - 1];
96461
- return Object.prototype.hasOwnProperty.call(row, key) ? row[key] : def;
96462
- };
96463
- }
96464
- }
96465
- };
96466
- var toPathSetter = function (path) {
96467
- if (path.length <= 1) {
96468
- var key_2 = path[0];
96469
- return function (row, columnIndex, cell) {
96470
- row[key_2] = cell;
96471
- };
96472
- }
96473
- else {
96474
- return function (row, columnIndex, cell) {
96475
- for (var i = 0, imax = path.length - 1; i < imax; ++i) {
96476
- row = row[path[i]] || {};
96477
- }
96478
- row[path[path.length - 1]] = cell;
96479
- };
96480
- }
96481
- };
96482
- var toColumnAlign = function (options, type) {
96483
- var align = options.align;
96484
- if (align != null) {
96485
- if (isString(align)) {
96486
- return DAlignHorizontal[align];
96487
- }
96488
- else {
96489
- return align;
96490
- }
96491
- }
96492
- switch (type) {
96493
- case DTableColumnType.TEXT:
96494
- case DTableColumnType.TEXT_AREA:
96495
- return DAlignHorizontal.LEFT;
96496
- case DTableColumnType.REAL:
96497
- case DTableColumnType.INTEGER:
96498
- return DAlignHorizontal.RIGHT;
96499
- case DTableColumnType.BUTTON:
96500
- case DTableColumnType.INDEX:
96501
- case DTableColumnType.SELECT:
96502
- case DTableColumnType.ACTION:
96503
- case DTableColumnType.LINK:
96504
- case DTableColumnType.CHECK:
96505
- case DTableColumnType.CHECK_SINGLE:
96506
- case DTableColumnType.COLOR:
96507
- return DAlignHorizontal.CENTER;
96508
- default:
96509
- return DAlignHorizontal.LEFT;
96510
- }
96511
- };
96512
- var toColumnDataChecker = function (path) {
96513
- if (path != null) {
96514
- var pathLength_1 = path.length;
96515
- if (pathLength_1 <= 1) {
96516
- var key_3 = path[0];
96517
- return function (row) {
96518
- return Object.prototype.hasOwnProperty.call(row, key_3);
96519
- };
96520
- }
96521
- else {
96522
- return function (row) {
96523
- for (var i = 0; i < pathLength_1; ++i) {
96524
- var part = path[i];
96525
- if (part in row) {
96526
- row = row[part];
96527
- }
96528
- else {
96529
- return false;
96530
- }
96531
- }
96532
- return true;
96533
- };
96534
- }
96535
- }
96536
- return function (row, columnIndex) {
96537
- return columnIndex < row.length;
96538
- };
96539
- };
96540
- var toColumnEditingEnable = function (enable, path) {
96541
- if (isString(enable)) {
96542
- return toColumnDataChecker(path);
96543
- }
96544
- else if (enable != null) {
96545
- return enable;
96546
- }
96547
- else {
96548
- return false;
96549
- }
96550
- };
96551
- var toColumnEditing = function (options, path) {
96552
- var _a;
96553
- var editing = options.editing;
96554
- var editable = options.editable;
96555
- if (editing) {
96556
- return {
96557
- enable: toColumnEditingEnable((_a = editing.enable) !== null && _a !== void 0 ? _a : editable, path),
96558
- formatter: editing.formatter,
96559
- unformatter: editing.unformatter,
96560
- validator: editing.validator
96561
- };
96562
- }
96563
- return {
96564
- enable: toColumnEditingEnable(editable, path)
96565
- };
96566
- };
96567
- var toComparator = function (getter, index) {
96568
- return function (rowA, rowB) {
96569
- var valueA = getter(rowA, index);
96570
- var valueB = getter(rowB, index);
96571
- return valueA < valueB ? -1 : valueB < valueA ? +1 : 0;
96572
- };
96573
- };
96574
- var toColumnSorting = function (getter, index, options) {
96575
- var sorting = options.sorting;
96576
- var sortable = options.sortable;
96577
- if (sorting) {
96578
- if (sorting.enable || sortable) {
96579
- return {
96580
- enable: true,
96581
- comparator: sorting.comparator || toComparator(getter, index)
96582
- };
96583
- }
96584
- return {
96585
- enable: false
96586
- };
96587
- }
96588
- if (sortable) {
96589
- return {
96590
- enable: true,
96591
- comparator: toComparator(getter, index)
96592
- };
96593
- }
96594
- return {
96595
- enable: false
96596
- };
96597
- };
96598
- var toColumnMenu = function (options) {
96599
- if (options == null) {
96600
- return undefined;
96601
- }
96602
- else if (options instanceof DMenu) {
96603
- return options;
96604
- }
96605
- else {
96606
- return new DMenu(options);
96607
- }
96608
- };
96609
- var toColumnDialog = function (options) {
96610
- if (options == null) {
96611
- return undefined;
96612
- }
96613
- else if ("open" in options) {
96614
- return options;
96615
- }
96616
- else {
96617
- return new DDialogSelect(options);
96618
- }
96619
- };
96620
- var defaultSelectingGetter = function (dialog) {
96621
- return dialog.value;
96622
- };
96623
- var defaultSelectingSetter = function () {
96624
- // DO NOTHING
96625
- };
96626
- var toColumnSelecting = function (options) {
96627
- if (options) {
96628
- return {
96629
- getter: options.getter || defaultSelectingGetter,
96630
- setter: options.setter || defaultSelectingSetter,
96631
- menu: toColumnMenu(options.menu),
96632
- multiple: toColumnMenu(options.multiple),
96633
- dialog: toColumnDialog(options.dialog),
96634
- promise: options.promise
96635
- };
96636
- }
96637
- return {
96638
- getter: defaultSelectingGetter,
96639
- setter: defaultSelectingSetter
96640
- };
96641
- };
96642
- var toColumnGetter = function (options, type, parts) {
96643
- var getter = options.getter;
96644
- if (getter) {
96645
- return getter;
96646
- }
96647
- switch (type) {
96648
- case DTableColumnType.ACTION:
96649
- case DTableColumnType.LINK:
96650
- return defaultGetterEmpty;
96651
- default:
96652
- if (parts == null) {
96653
- return defaultGetter;
96654
- }
96655
- else {
96656
- return toPathGetter(parts, options.default);
96657
- }
96658
- }
96659
- };
96660
- var toColumnSetter = function (options, type, path) {
96661
- var setter = options.setter;
96662
- if (setter) {
96663
- return setter;
96664
- }
96665
- switch (type) {
96666
- case DTableColumnType.BUTTON:
96667
- case DTableColumnType.ACTION:
96668
- case DTableColumnType.LINK:
96669
- return defaultSetterEmpty;
96670
- default:
96671
- if (path == null) {
96672
- return defaultSetter;
96673
- }
96674
- else {
96675
- return toPathSetter(path);
96676
- }
96677
- }
96678
- };
96679
- var toColumnState = function (options) {
96680
- var state = options.state;
96681
- if (state != null) {
96682
- if (isString(state) || isArray(state)) {
96683
- return {
96684
- initial: state,
96685
- modifier: undefined
96686
- };
96687
- }
96688
- else {
96689
- return {
96690
- initial: undefined,
96691
- modifier: state
96692
- };
96693
- }
96694
- }
96695
- return {
96696
- initial: undefined,
96697
- modifier: undefined
96698
- };
96699
- };
96700
- var toColumnPath = function (options) {
96701
- return options.path != null ? options.path.split(".") : null;
96702
- };
96703
- var toColumnRenderable = function (options, path) {
96704
- var renderable = options.renderable;
96705
- if (isString(renderable)) {
96706
- return toColumnDataChecker(path);
96707
- }
96708
- else if (renderable != null) {
96709
- return renderable;
96710
- }
96711
- return true;
96712
- };
96713
- var toColumn = function (index, options) {
96714
- var _a, _b;
96715
- var weight = options.weight;
96716
- var width = options.width;
96717
- if (weight != null) {
96718
- if (width != null) {
96719
- width = undefined;
96720
- }
96721
- }
96722
- else if (width == null) {
96723
- weight = 1;
96724
- }
96725
- var type = toEnum((_a = options.type) !== null && _a !== void 0 ? _a : DTableColumnType.TEXT, DTableColumnType);
96726
- var align = toColumnAlign(options, type);
96727
- var label = options.label || "";
96728
- var path = toColumnPath(options);
96729
- var getter = toColumnGetter(options, type, path);
96730
- var setter = toColumnSetter(options, type, path);
96731
- return {
96732
- weight: weight,
96733
- width: width,
96734
- type: type,
96735
- label: label,
96736
- getter: getter,
96737
- setter: setter,
96738
- formatter: options.formatter,
96739
- renderable: toColumnRenderable(options, path),
96740
- align: align,
96741
- state: toColumnState(options),
96742
- editing: toColumnEditing(options, path),
96743
- sorting: toColumnSorting(getter, index, options),
96744
- header: options.header,
96745
- body: options.body,
96746
- selecting: toColumnSelecting(options.selecting),
96747
- category: options.category,
96748
- frozen: options.frozen,
96749
- offset: 0.0,
96750
- link: options.link,
96751
- update: toEnum((_b = options.update) !== null && _b !== void 0 ? _b : DTableColumnUpdate.CELL, DTableColumnUpdate)
96752
- };
96753
- };
96754
- var toColumns = function (options) {
96755
- var result = [];
96756
- for (var i = 0, imax = options.length; i < imax; ++i) {
96757
- result.push(toColumn(i, options[i]));
96758
- }
96759
- return result;
96760
- };
96761
- var toFrozen = function (columns) {
96762
- for (var i = columns.length - 1; 0 <= i; --i) {
96763
- if (columns[i].frozen === true) {
96764
- return i + 1;
96765
- }
96766
- }
96767
- return 0;
96768
- };
96769
97763
  var DTable = /** @class */ (function (_super) {
96770
97764
  __extends(DTable, _super);
96771
97765
  function DTable(options) {
96772
97766
  var _this = _super.call(this, options) || this;
96773
97767
  var content = _this.content;
96774
- content.setWidth(_this.toContentWidth(options));
96775
97768
  var body = _this.body;
96776
97769
  content.addChild(body);
96777
97770
  if (body.data.selection.type !== DTableDataSelectionType.NONE) {
@@ -96790,39 +97783,47 @@ var DTable = /** @class */ (function (_super) {
96790
97783
  body.update();
96791
97784
  return _this;
96792
97785
  }
97786
+ Object.defineProperty(DTable.prototype, "column", {
97787
+ get: function () {
97788
+ var _a;
97789
+ return ((_a = this._column) !== null && _a !== void 0 ? _a : (this._column = this.newColumn()));
97790
+ },
97791
+ enumerable: false,
97792
+ configurable: true
97793
+ });
97794
+ DTable.prototype.newColumn = function () {
97795
+ var _a;
97796
+ return new DTableColumnContainerImpl(this, (_a = this._options) === null || _a === void 0 ? void 0 : _a.columns);
97797
+ };
96793
97798
  Object.defineProperty(DTable.prototype, "columns", {
96794
97799
  get: function () {
96795
- var result = this._columns;
96796
- if (result == null) {
96797
- var options = this._options;
96798
- result = options ? toColumns(options.columns) : [];
96799
- this._columns = result;
96800
- }
96801
- return result;
97800
+ return this.column.items;
96802
97801
  },
96803
97802
  enumerable: false,
96804
97803
  configurable: true
96805
97804
  });
96806
97805
  Object.defineProperty(DTable.prototype, "frozen", {
96807
97806
  get: function () {
96808
- var result = this._frozen;
96809
- if (result == null) {
96810
- result = toFrozen(this.columns);
96811
- this._frozen = result;
96812
- }
96813
- return result;
97807
+ return this.column.frozen;
97808
+ },
97809
+ enumerable: false,
97810
+ configurable: true
97811
+ });
97812
+ Object.defineProperty(DTable.prototype, "category", {
97813
+ get: function () {
97814
+ return (this._category = this.newCategory());
96814
97815
  },
96815
97816
  enumerable: false,
96816
97817
  configurable: true
96817
97818
  });
97819
+ DTable.prototype.newCategory = function () {
97820
+ var _a;
97821
+ var column = this.column;
97822
+ return new DTableCategoryContainerImpl(column.items, column.frozen, (_a = this._options) === null || _a === void 0 ? void 0 : _a.category);
97823
+ };
96818
97824
  Object.defineProperty(DTable.prototype, "categories", {
96819
97825
  get: function () {
96820
- var result = this._categories;
96821
- if (result == null) {
96822
- result = this.newCategories(this._options, this.columns, this.frozen);
96823
- this._categories = result;
96824
- }
96825
- return result;
97826
+ return this.category.items;
96826
97827
  },
96827
97828
  enumerable: false,
96828
97829
  configurable: true
@@ -96845,191 +97846,6 @@ var DTable = /** @class */ (function (_super) {
96845
97846
  body.unlock(true);
96846
97847
  scrollbar.unlock(true);
96847
97848
  };
96848
- DTable.prototype.getCategoryCount = function (columns) {
96849
- var result = 0;
96850
- for (var i = 0, imax = columns.length; i < imax; ++i) {
96851
- var category = columns[i].category;
96852
- if (category != null) {
96853
- var count = isString(category) ? 1 : category.length;
96854
- result = Math.max(result, count);
96855
- }
96856
- }
96857
- return result;
96858
- };
96859
- DTable.prototype.toCategoryLabel = function (index, category) {
96860
- if (category) {
96861
- if (isString(category)) {
96862
- if (index === 0) {
96863
- return category;
96864
- }
96865
- }
96866
- else {
96867
- if (index < category.length) {
96868
- return category[index];
96869
- }
96870
- }
96871
- }
96872
- return undefined;
96873
- };
96874
- DTable.prototype.isSameCategory = function (index, a, b) {
96875
- if (a != null) {
96876
- if (b != null) {
96877
- if (isString(a)) {
96878
- if (isString(b)) {
96879
- if (0 < index) {
96880
- return true;
96881
- }
96882
- else {
96883
- return a === b;
96884
- }
96885
- }
96886
- else {
96887
- if (0 < index) {
96888
- return b.length <= index;
96889
- }
96890
- else {
96891
- return b.length === 1 && a === b[0];
96892
- }
96893
- }
96894
- }
96895
- else {
96896
- if (isString(b)) {
96897
- if (0 < index) {
96898
- return a.length <= index;
96899
- }
96900
- else {
96901
- return a.length === 1 && a[0] === b;
96902
- }
96903
- }
96904
- else {
96905
- if (a.length <= index && b.length <= index) {
96906
- return true;
96907
- }
96908
- else if (b.length === a.length) {
96909
- for (var i = index, imax = a.length; i < imax; ++i) {
96910
- if (a[i] !== b[i]) {
96911
- return false;
96912
- }
96913
- }
96914
- return true;
96915
- }
96916
- return false;
96917
- }
96918
- }
96919
- }
96920
- else {
96921
- if (isString(a)) {
96922
- if (0 < index) {
96923
- return true;
96924
- }
96925
- else {
96926
- return false;
96927
- }
96928
- }
96929
- else {
96930
- if (a.length <= index) {
96931
- return true;
96932
- }
96933
- else {
96934
- return false;
96935
- }
96936
- }
96937
- }
96938
- }
96939
- else {
96940
- if (b != null) {
96941
- if (isString(b)) {
96942
- if (0 < index) {
96943
- return true;
96944
- }
96945
- else {
96946
- return false;
96947
- }
96948
- }
96949
- else {
96950
- if (b.length <= index) {
96951
- return true;
96952
- }
96953
- else {
96954
- return false;
96955
- }
96956
- }
96957
- }
96958
- else {
96959
- return true;
96960
- }
96961
- }
96962
- };
96963
- DTable.prototype.toCategoryColumns = function (index, columns, frozen) {
96964
- var result = [];
96965
- var tcolumn = null;
96966
- var ccolumn = null;
96967
- for (var i = 0, imax = columns.length; i < imax; ++i) {
96968
- var column = columns[i];
96969
- if (i !== frozen &&
96970
- ccolumn &&
96971
- tcolumn &&
96972
- this.isSameCategory(index, tcolumn.category, column.category)) {
96973
- if (ccolumn.weight != null && column.weight != null) {
96974
- ccolumn.weight += column.weight;
96975
- }
96976
- else if (ccolumn.width != null && column.width != null) {
96977
- ccolumn.width += column.width;
96978
- }
96979
- else {
96980
- tcolumn = column;
96981
- ccolumn = {
96982
- label: this.toCategoryLabel(index, column.category),
96983
- weight: column.weight,
96984
- width: column.width,
96985
- offset: 0.0
96986
- };
96987
- result.push(ccolumn);
96988
- }
96989
- }
96990
- else {
96991
- tcolumn = column;
96992
- ccolumn = {
96993
- label: this.toCategoryLabel(index, column.category),
96994
- weight: column.weight,
96995
- width: column.width,
96996
- offset: 0.0
96997
- };
96998
- result.push(ccolumn);
96999
- }
97000
- }
97001
- return result;
97002
- };
97003
- DTable.prototype.toCategoryOptions = function (index, options, columns, frozen, offset) {
97004
- if (options) {
97005
- if (options.columns === undefined) {
97006
- options.columns = this.toCategoryColumns(index, columns, frozen);
97007
- }
97008
- if (options.frozen == null) {
97009
- options.frozen = frozen;
97010
- }
97011
- if (options.offset == null) {
97012
- options.offset = offset;
97013
- }
97014
- return options;
97015
- }
97016
- return {
97017
- columns: this.toCategoryColumns(index, columns, frozen),
97018
- frozen: frozen,
97019
- offset: offset
97020
- };
97021
- };
97022
- DTable.prototype.newCategories = function (options, columns, frozen) {
97023
- var count = this.getCategoryCount(columns);
97024
- var result = [];
97025
- var offset = 0;
97026
- for (var i = count - 1; 0 <= i; --i) {
97027
- var category = new DTableCategory(this.toCategoryOptions(i, options === null || options === void 0 ? void 0 : options.category, columns, frozen, offset));
97028
- result.push(category);
97029
- offset += category.height;
97030
- }
97031
- return result;
97032
- };
97033
97849
  DTable.prototype.onDblClick = function (e, interactionManager) {
97034
97850
  var result = this.body.onDblClick(e, interactionManager);
97035
97851
  return _super.prototype.onDblClick.call(this, e, interactionManager) || result;
@@ -97040,24 +97856,35 @@ var DTable = /** @class */ (function (_super) {
97040
97856
  _this.onScrollBarUpdate(isRegionVisible);
97041
97857
  });
97042
97858
  };
97043
- DTable.prototype.toContentWidth = function (options) {
97044
- var columnWidthTotal = 0;
97045
- var columns = options === null || options === void 0 ? void 0 : options.columns;
97046
- if (columns) {
97047
- for (var i = 0, imax = columns.length; i < imax; ++i) {
97048
- var column = columns[i];
97049
- var columnWidth = column.width;
97050
- if (columnWidth != null) {
97051
- columnWidthTotal += columnWidth;
97052
- }
97053
- }
97859
+ DTable.prototype.newContent = function (options) {
97860
+ var _this = this;
97861
+ var result = _super.prototype.newContent.call(this, options);
97862
+ // X & Width
97863
+ var column = this.column;
97864
+ var columnWidth = column.width;
97865
+ if (0 < columnWidth) {
97866
+ column.on("resize", function () {
97867
+ columnWidth = column.width;
97868
+ var parentWidth = _this.width;
97869
+ var parentHeight = _this.height;
97870
+ var newWidth = Math.max(parentWidth, columnWidth);
97871
+ var newXMin = parentWidth - newWidth;
97872
+ // The X position must be in [newXMin, 0].
97873
+ if (result.x < newXMin) {
97874
+ result.x = newXMin;
97875
+ }
97876
+ // Force the with reevaluated
97877
+ result.onParentResize(parentWidth, parentHeight, _this.padding);
97878
+ });
97879
+ result.setWidth(function (p) {
97880
+ return Math.max(p, columnWidth);
97881
+ });
97054
97882
  }
97055
- if (0 < columnWidthTotal) {
97056
- return function (p) {
97057
- return Math.max(p, columnWidthTotal);
97058
- };
97883
+ else {
97884
+ result.setWidth("100%");
97059
97885
  }
97060
- return "100%";
97886
+ // Done
97887
+ return result;
97061
97888
  };
97062
97889
  DTable.prototype.getHeaderOffset = function () {
97063
97890
  var result = this._headerOffset;
@@ -97079,7 +97906,7 @@ var DTable = /** @class */ (function (_super) {
97079
97906
  get: function () {
97080
97907
  var result = this._header;
97081
97908
  if (result === undefined) {
97082
- result = this.newHeader(this._options, this.columns, this.frozen, this.getHeaderOffset());
97909
+ result = this.newHeader();
97083
97910
  this._header = result;
97084
97911
  }
97085
97912
  return result;
@@ -97098,42 +97925,17 @@ var DTable = /** @class */ (function (_super) {
97098
97925
  }
97099
97926
  return false;
97100
97927
  };
97101
- DTable.prototype.newHeader = function (options, columns, frozen, offset) {
97928
+ DTable.prototype.newHeader = function () {
97929
+ var options = this._options;
97102
97930
  if (this.hasHeader(options)) {
97103
- return new DTableHeader(this.toHeaderOptions(options === null || options === void 0 ? void 0 : options.header, columns, frozen, offset));
97931
+ var column = this.column;
97932
+ return new DTableHeader(this, column.items, column.frozen, this.getHeaderOffset(), options === null || options === void 0 ? void 0 : options.header);
97104
97933
  }
97105
97934
  return null;
97106
97935
  };
97107
- DTable.prototype.toHeaderOptions = function (options, columns, frozen, offset) {
97108
- if (options) {
97109
- if (options.columns === undefined) {
97110
- options.columns = columns;
97111
- }
97112
- if (options.frozen == null) {
97113
- options.frozen = frozen;
97114
- }
97115
- if (options.offset === undefined) {
97116
- options.offset = offset;
97117
- }
97118
- if (options.table === undefined) {
97119
- options.table = this;
97120
- }
97121
- return options;
97122
- }
97123
- return {
97124
- columns: columns,
97125
- frozen: frozen,
97126
- offset: offset,
97127
- table: this
97128
- };
97129
- };
97130
97936
  DTable.prototype.getBodyOffset = function () {
97131
- var result = this._bodyOffset;
97132
- if (result == null) {
97133
- result = this.newBodyOffset();
97134
- this._bodyOffset = result;
97135
- }
97136
- return result;
97937
+ var _a;
97938
+ return ((_a = this._bodyOffset) !== null && _a !== void 0 ? _a : (this._bodyOffset = this.newBodyOffset()));
97137
97939
  };
97138
97940
  DTable.prototype.newBodyOffset = function () {
97139
97941
  var _a, _b;
@@ -97141,30 +97943,19 @@ var DTable = /** @class */ (function (_super) {
97141
97943
  };
97142
97944
  Object.defineProperty(DTable.prototype, "body", {
97143
97945
  get: function () {
97144
- var result = this._body;
97145
- if (result == null) {
97146
- result = this.newBody(this._options, this.columns, this.frozen, this.getBodyOffset());
97147
- this._body = result;
97148
- }
97149
- return result;
97946
+ var _a;
97947
+ return ((_a = this._body) !== null && _a !== void 0 ? _a : (this._body = this.newBody()));
97150
97948
  },
97151
97949
  enumerable: false,
97152
97950
  configurable: true
97153
97951
  });
97154
- DTable.prototype.newBody = function (options, columns, frozen, offset) {
97155
- 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));
97952
+ DTable.prototype.newBody = function () {
97953
+ var options = this._options;
97954
+ var column = this.column;
97955
+ 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));
97156
97956
  };
97157
- DTable.prototype.toBodyOptions = function (options, columns, frozen, offset, data) {
97957
+ DTable.prototype.toBodyOptions = function (options, data) {
97158
97958
  if (options != null) {
97159
- if (options.columns === undefined) {
97160
- options.columns = columns;
97161
- }
97162
- if (options.frozen == null) {
97163
- options.frozen = frozen;
97164
- }
97165
- if (options.offset === undefined) {
97166
- options.offset = offset;
97167
- }
97168
97959
  if (options.data === undefined && data !== undefined) {
97169
97960
  if (isArray(data)) {
97170
97961
  options.data = {
@@ -97182,9 +97973,6 @@ var DTable = /** @class */ (function (_super) {
97182
97973
  }
97183
97974
  if (isArray(data)) {
97184
97975
  return {
97185
- columns: columns,
97186
- frozen: frozen,
97187
- offset: offset,
97188
97976
  data: {
97189
97977
  rows: data
97190
97978
  },
@@ -97193,9 +97981,6 @@ var DTable = /** @class */ (function (_super) {
97193
97981
  }
97194
97982
  else {
97195
97983
  return {
97196
- columns: columns,
97197
- frozen: frozen,
97198
- offset: offset,
97199
97984
  data: data,
97200
97985
  weight: 1
97201
97986
  };
@@ -98940,6 +99725,7 @@ exports.DImagePieceLayouterPartTop = DImagePieceLayouterPartTop;
98940
99725
  exports.DImagePieceMarginImpl = DImagePieceMarginImpl;
98941
99726
  exports.DImagePieceTintImpl = DImagePieceTintImpl;
98942
99727
  exports.DIndicatorProcessing = DIndicatorProcessing;
99728
+ exports.DIndicatorProcessingState = DIndicatorProcessingState;
98943
99729
  exports.DInput = DInput;
98944
99730
  exports.DInputAndLabel = DInputAndLabel;
98945
99731
  exports.DInputBoolean = DInputBoolean;
@@ -99138,6 +99924,11 @@ exports.DTableBodyCells = DTableBodyCells;
99138
99924
  exports.DTableBodyRow = DTableBodyRow;
99139
99925
  exports.DTableCategory = DTableCategory;
99140
99926
  exports.DTableCategoryCell = DTableCategoryCell;
99927
+ exports.DTableCategoryCellEdge = DTableCategoryCellEdge;
99928
+ exports.DTableCategoryColumnImpl = DTableCategoryColumnImpl;
99929
+ exports.DTableCategoryContainerImpl = DTableCategoryContainerImpl;
99930
+ exports.DTableColumnContainerImpl = DTableColumnContainerImpl;
99931
+ exports.DTableColumnImpl = DTableColumnImpl;
99141
99932
  exports.DTableColumnType = DTableColumnType;
99142
99933
  exports.DTableColumnUpdate = DTableColumnUpdate;
99143
99934
  exports.DTableDataList = DTableDataList;
@@ -99155,6 +99946,7 @@ exports.DTableDataTreeSorter = DTableDataTreeSorter;
99155
99946
  exports.DTableHeader = DTableHeader;
99156
99947
  exports.DTableHeaderCell = DTableHeaderCell;
99157
99948
  exports.DTableHeaderCellCheck = DTableHeaderCellCheck;
99949
+ exports.DTableHeaderCellEdge = DTableHeaderCellEdge;
99158
99950
  exports.DTableRow = DTableRow;
99159
99951
  exports.DTableScrollBar = DTableScrollBar;
99160
99952
  exports.DTableState = DTableState;