@wcardinal/wcardinal-ui 0.411.0 → 0.412.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/wcardinal/ui/d-table-body-cell.d.ts +2 -2
- package/dist/types/wcardinal/ui/d-table-body-row.d.ts +9 -9
- package/dist/types/wcardinal/ui/d-table-body.d.ts +5 -7
- package/dist/types/wcardinal/ui/d-table-category-cell.d.ts +37 -0
- package/dist/types/wcardinal/ui/d-table-category-column-impl.d.ts +24 -0
- package/dist/types/wcardinal/ui/d-table-category-column.d.ts +10 -0
- package/dist/types/wcardinal/ui/d-table-category-container-impl.d.ts +12 -0
- package/dist/types/wcardinal/ui/d-table-category-container.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-table-category.d.ts +13 -12
- package/dist/types/wcardinal/ui/d-table-column-container-impl.d.ts +25 -0
- package/dist/types/wcardinal/ui/d-table-column-container.d.ts +12 -0
- package/dist/types/wcardinal/ui/d-table-column-impl.d.ts +44 -0
- package/dist/types/wcardinal/ui/d-table-column.d.ts +22 -19
- package/dist/types/wcardinal/ui/d-table-header-cell-check.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-table-header-cell.d.ts +34 -12
- package/dist/types/wcardinal/ui/d-table-header.d.ts +8 -9
- package/dist/types/wcardinal/ui/d-table-row.d.ts +8 -9
- package/dist/types/wcardinal/ui/d-table-state.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-table.d.ts +15 -18
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-table-header.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header-cell.d.ts +1 -0
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-table-header.d.ts +1 -0
- package/dist/wcardinal/ui/d-base.js +2 -2
- package/dist/wcardinal/ui/d-base.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body-cell.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body-row.js +4 -4
- package/dist/wcardinal/ui/d-table-body-row.js.map +1 -1
- package/dist/wcardinal/ui/d-table-body.js +6 -15
- package/dist/wcardinal/ui/d-table-body.js.map +1 -1
- package/dist/wcardinal/ui/d-table-category-cell.js +244 -2
- package/dist/wcardinal/ui/d-table-category-cell.js.map +1 -1
- package/dist/wcardinal/ui/d-table-category-column-impl.js +222 -0
- package/dist/wcardinal/ui/d-table-category-column-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-table-category-column.js +6 -0
- package/dist/wcardinal/ui/d-table-category-column.js.map +1 -0
- package/dist/wcardinal/ui/d-table-category-container-impl.js +149 -0
- package/dist/wcardinal/ui/d-table-category-container-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-table-category-container.js +2 -0
- package/dist/wcardinal/ui/d-table-category-container.js.map +1 -0
- package/dist/wcardinal/ui/d-table-category.js +49 -7
- package/dist/wcardinal/ui/d-table-category.js.map +1 -1
- package/dist/wcardinal/ui/d-table-column-container-impl.js +126 -0
- package/dist/wcardinal/ui/d-table-column-container-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-table-column-container.js +2 -0
- package/dist/wcardinal/ui/d-table-column-container.js.map +1 -0
- package/dist/wcardinal/ui/d-table-column-impl.js +375 -0
- package/dist/wcardinal/ui/d-table-column-impl.js.map +1 -0
- package/dist/wcardinal/ui/d-table-column.js.map +1 -1
- package/dist/wcardinal/ui/d-table-header-cell-check.js.map +1 -1
- package/dist/wcardinal/ui/d-table-header-cell.js +245 -48
- package/dist/wcardinal/ui/d-table-header-cell.js.map +1 -1
- package/dist/wcardinal/ui/d-table-header.js +8 -22
- package/dist/wcardinal/ui/d-table-header.js.map +1 -1
- package/dist/wcardinal/ui/d-table-row.js +7 -5
- package/dist/wcardinal/ui/d-table-row.js.map +1 -1
- package/dist/wcardinal/ui/d-table-state.js +9 -1
- package/dist/wcardinal/ui/d-table-state.js.map +1 -1
- package/dist/wcardinal/ui/d-table.js +69 -631
- package/dist/wcardinal/ui/d-table.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js +7 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header-cell.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js +7 -0
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-table-header.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js +7 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-header-cell.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js +7 -0
- package/dist/wcardinal/ui/theme/white/d-theme-white-table-header.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +14 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +14 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +14 -2
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.js +14 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-en-us.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +14 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +2 -2
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +14 -2
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui.cjs.js +1153 -371
- package/dist/wcardinal-ui.js +1127 -369
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.412.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
|
|
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
|
|
|
@@ -93193,15 +93225,17 @@ var DTableDataSelectionType = {
|
|
|
93193
93225
|
*/
|
|
93194
93226
|
var DTableRow = /** @class */ (function (_super) {
|
|
93195
93227
|
__extends(DTableRow, _super);
|
|
93196
|
-
function DTableRow(options) {
|
|
93197
|
-
var _a, _b;
|
|
93228
|
+
function DTableRow(columns, frozen, options) {
|
|
93198
93229
|
var _this = _super.call(this, options) || this;
|
|
93199
93230
|
_this._reverse = true;
|
|
93200
|
-
_this._frozen =
|
|
93201
|
-
_this._columns =
|
|
93231
|
+
_this._frozen = frozen;
|
|
93232
|
+
_this._columns = columns;
|
|
93202
93233
|
return _this;
|
|
93203
93234
|
}
|
|
93204
|
-
DTableRow.prototype.initCells = function (
|
|
93235
|
+
DTableRow.prototype.initCells = function () {
|
|
93236
|
+
var columns = this._columns;
|
|
93237
|
+
var frozen = this._frozen;
|
|
93238
|
+
var options = this._options;
|
|
93205
93239
|
var iend = this.toIndexEnd(columns);
|
|
93206
93240
|
for (var i = columns.length - 1; 0 <= i; --i) {
|
|
93207
93241
|
var cell = this.newCell(i, columns[i], columns, options);
|
|
@@ -93293,8 +93327,8 @@ var DTableRow = /** @class */ (function (_super) {
|
|
|
93293
93327
|
*/
|
|
93294
93328
|
var DTableBodyRow = /** @class */ (function (_super) {
|
|
93295
93329
|
__extends(DTableBodyRow, _super);
|
|
93296
|
-
function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, options) {
|
|
93297
|
-
var _this = _super.call(this, options) || this;
|
|
93330
|
+
function DTableBodyRow(onChange, isEven, columnIndexToCellOptions, columns, frozen, options) {
|
|
93331
|
+
var _this = _super.call(this, columns, frozen, options) || this;
|
|
93298
93332
|
_this._index = -1;
|
|
93299
93333
|
_this._onChange = onChange;
|
|
93300
93334
|
_this._onCellChangeBound = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
|
|
@@ -93302,7 +93336,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
|
|
|
93302
93336
|
};
|
|
93303
93337
|
_this._columnIndexToCellOptions = columnIndexToCellOptions;
|
|
93304
93338
|
_this.state.isAlternated = !isEven;
|
|
93305
|
-
_this.initCells(
|
|
93339
|
+
_this.initCells();
|
|
93306
93340
|
return _this;
|
|
93307
93341
|
}
|
|
93308
93342
|
DTableBodyRow.prototype.onCellChange = function (newValue, oldValue, row, rowIndex, columnIndex, column) {
|
|
@@ -93446,7 +93480,7 @@ var DTableBodyRow = /** @class */ (function (_super) {
|
|
|
93446
93480
|
DTableBodyRow.prototype.toCellOptions = function (columnIndex, column, options) {
|
|
93447
93481
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
93448
93482
|
var _p;
|
|
93449
|
-
var result = toMerged(column.body, options.cell);
|
|
93483
|
+
var result = toMerged(column.body, options === null || options === void 0 ? void 0 : options.cell);
|
|
93450
93484
|
// Weight
|
|
93451
93485
|
result.weight = column.weight;
|
|
93452
93486
|
// Width
|
|
@@ -94515,18 +94549,11 @@ var DTableDataList = /** @class */ (function (_super) {
|
|
|
94515
94549
|
* SPDX-License-Identifier: Apache-2.0
|
|
94516
94550
|
*/
|
|
94517
94551
|
var toRowOptions = function (theme, options, selectionType) {
|
|
94518
|
-
var columns = options.columns || [];
|
|
94519
94552
|
var result = options.row;
|
|
94520
94553
|
if (result != null) {
|
|
94521
94554
|
if (result.height == null) {
|
|
94522
94555
|
result.height = theme.getRowHeight();
|
|
94523
94556
|
}
|
|
94524
|
-
if (result.columns === undefined) {
|
|
94525
|
-
result.columns = columns;
|
|
94526
|
-
}
|
|
94527
|
-
if (result.frozen == null) {
|
|
94528
|
-
result.frozen = options.frozen;
|
|
94529
|
-
}
|
|
94530
94557
|
if (result.selection === undefined) {
|
|
94531
94558
|
result.selection = {
|
|
94532
94559
|
type: selectionType
|
|
@@ -94538,9 +94565,7 @@ var toRowOptions = function (theme, options, selectionType) {
|
|
|
94538
94565
|
}
|
|
94539
94566
|
else {
|
|
94540
94567
|
result = {
|
|
94541
|
-
columns: columns,
|
|
94542
94568
|
height: theme.getRowHeight(),
|
|
94543
|
-
frozen: options.frozen,
|
|
94544
94569
|
selection: {
|
|
94545
94570
|
type: selectionType
|
|
94546
94571
|
}
|
|
@@ -94550,18 +94575,18 @@ var toRowOptions = function (theme, options, selectionType) {
|
|
|
94550
94575
|
};
|
|
94551
94576
|
var DTableBody = /** @class */ (function (_super) {
|
|
94552
94577
|
__extends(DTableBody, _super);
|
|
94553
|
-
function DTableBody(options) {
|
|
94554
|
-
var _a;
|
|
94578
|
+
function DTableBody(columns, frozen, offset, options) {
|
|
94555
94579
|
var _this = _super.call(this, options) || this;
|
|
94556
|
-
_this.transform.position.y =
|
|
94580
|
+
_this.transform.position.y = offset;
|
|
94557
94581
|
var data = _this.toData(options.data);
|
|
94558
94582
|
_this._data = data;
|
|
94559
94583
|
data.bind(_this);
|
|
94560
94584
|
var theme = _this.theme;
|
|
94585
|
+
_this._columns = columns;
|
|
94586
|
+
_this._frozen = frozen;
|
|
94561
94587
|
var rowOptions = toRowOptions(theme, options, data.selection.type);
|
|
94562
94588
|
_this._rowOptions = rowOptions;
|
|
94563
94589
|
_this._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();
|
|
94564
|
-
_this._columns = rowOptions.columns || [];
|
|
94565
94590
|
_this._rowIndexMappedStart = 0;
|
|
94566
94591
|
_this._rowIndexMappedEnd = 0;
|
|
94567
94592
|
_this._updateRowsCount = 0;
|
|
@@ -94772,14 +94797,14 @@ var DTableBody = /** @class */ (function (_super) {
|
|
|
94772
94797
|
return row;
|
|
94773
94798
|
};
|
|
94774
94799
|
DTableBody.prototype.newRow = function (isEven) {
|
|
94775
|
-
return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
|
|
94800
|
+
return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._columns, this._frozen, this._rowOptions);
|
|
94776
94801
|
};
|
|
94777
94802
|
DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
|
|
94778
94803
|
_super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
|
|
94779
94804
|
this.updateFrozenCellPosition(newX);
|
|
94780
94805
|
};
|
|
94781
94806
|
DTableBody.prototype.updateFrozenCellPosition = function (x) {
|
|
94782
|
-
var frozen = this.
|
|
94807
|
+
var frozen = this._frozen;
|
|
94783
94808
|
if (frozen != null && 0 < frozen) {
|
|
94784
94809
|
var rows = this.children;
|
|
94785
94810
|
for (var i = 0, imax = rows.length; i < imax; ++i) {
|
|
@@ -94994,11 +95019,249 @@ var DTableBody = /** @class */ (function (_super) {
|
|
|
94994
95019
|
* Copyright (C) 2019 Toshiba Corporation
|
|
94995
95020
|
* SPDX-License-Identifier: Apache-2.0
|
|
94996
95021
|
*/
|
|
95022
|
+
var DTableCategoryCellEdge = {
|
|
95023
|
+
NONE: 0,
|
|
95024
|
+
LEFT: 1,
|
|
95025
|
+
RIGHT: 2,
|
|
95026
|
+
BOTH: 3
|
|
95027
|
+
};
|
|
94997
95028
|
var DTableCategoryCell = /** @class */ (function (_super) {
|
|
94998
95029
|
__extends(DTableCategoryCell, _super);
|
|
94999
|
-
function DTableCategoryCell() {
|
|
95000
|
-
|
|
95030
|
+
function DTableCategoryCell(category, columnIndex, column, options) {
|
|
95031
|
+
var _this = _super.call(this, options) || this;
|
|
95032
|
+
_this._category = category;
|
|
95033
|
+
_this._columnIndex = columnIndex;
|
|
95034
|
+
_this._column = column;
|
|
95035
|
+
_this._edgeSize = _this.theme.getEdgeWidth();
|
|
95036
|
+
_this._wasResizing = false;
|
|
95037
|
+
return _this;
|
|
95001
95038
|
}
|
|
95039
|
+
Object.defineProperty(DTableCategoryCell.prototype, "column", {
|
|
95040
|
+
get: function () {
|
|
95041
|
+
return this._column;
|
|
95042
|
+
},
|
|
95043
|
+
enumerable: false,
|
|
95044
|
+
configurable: true
|
|
95045
|
+
});
|
|
95046
|
+
Object.defineProperty(DTableCategoryCell.prototype, "columnIndex", {
|
|
95047
|
+
get: function () {
|
|
95048
|
+
return this._columnIndex;
|
|
95049
|
+
},
|
|
95050
|
+
enumerable: false,
|
|
95051
|
+
configurable: true
|
|
95052
|
+
});
|
|
95053
|
+
Object.defineProperty(DTableCategoryCell.prototype, "category", {
|
|
95054
|
+
get: function () {
|
|
95055
|
+
return this._category;
|
|
95056
|
+
},
|
|
95057
|
+
enumerable: false,
|
|
95058
|
+
configurable: true
|
|
95059
|
+
});
|
|
95060
|
+
DTableCategoryCell.prototype.onDown = function (e) {
|
|
95061
|
+
var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
|
|
95062
|
+
if (edges != null) {
|
|
95063
|
+
this._wasResizing = true;
|
|
95064
|
+
var layer = DApplications.getLayer(this);
|
|
95065
|
+
if (layer != null) {
|
|
95066
|
+
var interactionManager = layer.renderer.plugins.interaction;
|
|
95067
|
+
var columnIndex = this._columnIndex;
|
|
95068
|
+
if (edges === DTableCategoryCellEdge.LEFT) {
|
|
95069
|
+
this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
|
|
95070
|
+
}
|
|
95071
|
+
else {
|
|
95072
|
+
this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
|
|
95073
|
+
}
|
|
95074
|
+
}
|
|
95075
|
+
}
|
|
95076
|
+
else {
|
|
95077
|
+
this._wasResizing = false;
|
|
95078
|
+
_super.prototype.onDown.call(this, e);
|
|
95079
|
+
}
|
|
95080
|
+
};
|
|
95081
|
+
DTableCategoryCell.prototype.findLeftResizableCell = function (columnIndex) {
|
|
95082
|
+
var children = this._category.children;
|
|
95083
|
+
var childrenLength = children.length;
|
|
95084
|
+
for (var i = columnIndex; 0 <= i; --i) {
|
|
95085
|
+
var child = children[childrenLength - i - 1];
|
|
95086
|
+
if (child.column.resizable) {
|
|
95087
|
+
return child;
|
|
95088
|
+
}
|
|
95089
|
+
}
|
|
95090
|
+
return null;
|
|
95091
|
+
};
|
|
95092
|
+
DTableCategoryCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
|
|
95093
|
+
var children = this._category.children;
|
|
95094
|
+
var childrenLength = children.length;
|
|
95095
|
+
for (var i = columnIndex + 1; i < childrenLength; ++i) {
|
|
95096
|
+
var child = children[childrenLength - i - 1];
|
|
95097
|
+
var childColumn = child.column;
|
|
95098
|
+
if (childColumn.resizable) {
|
|
95099
|
+
var childColumnWeight = childColumn.weight;
|
|
95100
|
+
if (childColumnWeight != null) {
|
|
95101
|
+
return child;
|
|
95102
|
+
}
|
|
95103
|
+
}
|
|
95104
|
+
}
|
|
95105
|
+
return null;
|
|
95106
|
+
};
|
|
95107
|
+
DTableCategoryCell.prototype.checkIfEdgeResizable = function (columnIndex) {
|
|
95108
|
+
var target = this.findLeftResizableCell(columnIndex);
|
|
95109
|
+
if (target != null) {
|
|
95110
|
+
if (target.column.weight != null) {
|
|
95111
|
+
return this.findRightResizableCellOfWeight(target.columnIndex) != null;
|
|
95112
|
+
}
|
|
95113
|
+
else {
|
|
95114
|
+
return true;
|
|
95115
|
+
}
|
|
95116
|
+
}
|
|
95117
|
+
return false;
|
|
95118
|
+
};
|
|
95119
|
+
DTableCategoryCell.prototype.getResizableEdges = function () {
|
|
95120
|
+
var result = this._resizableEdges;
|
|
95121
|
+
if (result == null) {
|
|
95122
|
+
var columnIndex = this._columnIndex;
|
|
95123
|
+
if (this.checkIfEdgeResizable(columnIndex - 1)) {
|
|
95124
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
95125
|
+
result = DTableCategoryCellEdge.BOTH;
|
|
95126
|
+
}
|
|
95127
|
+
else {
|
|
95128
|
+
result = DTableCategoryCellEdge.LEFT;
|
|
95129
|
+
}
|
|
95130
|
+
}
|
|
95131
|
+
else {
|
|
95132
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
95133
|
+
result = DTableCategoryCellEdge.RIGHT;
|
|
95134
|
+
}
|
|
95135
|
+
else {
|
|
95136
|
+
result = DTableCategoryCellEdge.NONE;
|
|
95137
|
+
}
|
|
95138
|
+
}
|
|
95139
|
+
this._resizableEdges = result;
|
|
95140
|
+
}
|
|
95141
|
+
return result;
|
|
95142
|
+
};
|
|
95143
|
+
DTableCategoryCell.prototype.onOver = function (e) {
|
|
95144
|
+
var _this = this;
|
|
95145
|
+
var _a;
|
|
95146
|
+
_super.prototype.onOver.call(this, e);
|
|
95147
|
+
if (this.getResizableEdges() !== DTableCategoryCellEdge.NONE) {
|
|
95148
|
+
var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
|
|
95149
|
+
_this.onHovered(event);
|
|
95150
|
+
}));
|
|
95151
|
+
this.on(UtilPointerEvent.move, onHoveredBound);
|
|
95152
|
+
// Since the cursor is set by InteractionManager before this method is called,
|
|
95153
|
+
// the cursor need to be overriden.
|
|
95154
|
+
this.onHovered(e);
|
|
95155
|
+
var layer = DApplications.getLayer(this);
|
|
95156
|
+
if (layer != null) {
|
|
95157
|
+
layer.renderer.plugins.interaction.cursor = this.cursor;
|
|
95158
|
+
}
|
|
95159
|
+
}
|
|
95160
|
+
};
|
|
95161
|
+
DTableCategoryCell.prototype.onOut = function (e) {
|
|
95162
|
+
_super.prototype.onOut.call(this, e);
|
|
95163
|
+
var onHoveredBound = this._onHoveredBound;
|
|
95164
|
+
if (onHoveredBound != null) {
|
|
95165
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
95166
|
+
this.off(UtilPointerEvent.move, onHoveredBound);
|
|
95167
|
+
}
|
|
95168
|
+
};
|
|
95169
|
+
DTableCategoryCell.prototype.onHovered = function (e) {
|
|
95170
|
+
var width = this.width;
|
|
95171
|
+
var x = this.toClickPosition(e);
|
|
95172
|
+
var edgeSize = this._edgeSize;
|
|
95173
|
+
if (0 <= x && x <= edgeSize) {
|
|
95174
|
+
if (this.getResizableEdges() & DTableCategoryCellEdge.LEFT) {
|
|
95175
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.LEFT);
|
|
95176
|
+
}
|
|
95177
|
+
else {
|
|
95178
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
95179
|
+
}
|
|
95180
|
+
}
|
|
95181
|
+
else if (width - edgeSize <= x && x <= width) {
|
|
95182
|
+
if (this.getResizableEdges() & DTableCategoryCellEdge.RIGHT) {
|
|
95183
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.RIGHT);
|
|
95184
|
+
}
|
|
95185
|
+
else {
|
|
95186
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
95187
|
+
}
|
|
95188
|
+
}
|
|
95189
|
+
else {
|
|
95190
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
95191
|
+
}
|
|
95192
|
+
};
|
|
95193
|
+
DTableCategoryCell.prototype.toClickPosition = function (e) {
|
|
95194
|
+
var _a;
|
|
95195
|
+
var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
|
|
95196
|
+
return e.data.getLocalPosition(this, checkWork).x;
|
|
95197
|
+
};
|
|
95198
|
+
DTableCategoryCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
|
|
95199
|
+
// Find the resizable cell
|
|
95200
|
+
var left = this.findLeftResizableCell(columnIndex);
|
|
95201
|
+
if (left == null) {
|
|
95202
|
+
// No resizable cell
|
|
95203
|
+
return;
|
|
95204
|
+
}
|
|
95205
|
+
var category = this._category;
|
|
95206
|
+
var leftColumn = left.column;
|
|
95207
|
+
var leftOldWidth = left.width;
|
|
95208
|
+
var leftOldWeight = left.weight;
|
|
95209
|
+
if (leftColumn.weight == null) {
|
|
95210
|
+
category.state.add(DTableState.RESIZING);
|
|
95211
|
+
var leftMinWidth_1 = leftColumn.minWidth;
|
|
95212
|
+
var onMove_1 = function (e) {
|
|
95213
|
+
leftColumn.width = Math.max(leftMinWidth_1, leftOldWidth + e.data.global.x - onDownPoint);
|
|
95214
|
+
};
|
|
95215
|
+
var onUp_1 = function (e) {
|
|
95216
|
+
category.state.remove(DTableState.RESIZING);
|
|
95217
|
+
interactionManager.off(UtilPointerEvent.move, onMove_1);
|
|
95218
|
+
interactionManager.off(UtilPointerEvent.up, onUp_1);
|
|
95219
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
|
|
95220
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_1);
|
|
95221
|
+
};
|
|
95222
|
+
interactionManager.on(UtilPointerEvent.move, onMove_1);
|
|
95223
|
+
interactionManager.on(UtilPointerEvent.up, onUp_1);
|
|
95224
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
|
|
95225
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_1);
|
|
95226
|
+
}
|
|
95227
|
+
else {
|
|
95228
|
+
var right = this.findRightResizableCellOfWeight(left.columnIndex);
|
|
95229
|
+
if (right == null) {
|
|
95230
|
+
// No right resizable cell found
|
|
95231
|
+
return;
|
|
95232
|
+
}
|
|
95233
|
+
var rightColumn_1 = right.column;
|
|
95234
|
+
var rightOldWeight = right.weight;
|
|
95235
|
+
var rightOldWidth = right.width;
|
|
95236
|
+
var totalWidth_1 = leftOldWidth + rightOldWidth;
|
|
95237
|
+
var totalWeight_1 = leftOldWeight + rightOldWeight;
|
|
95238
|
+
var leftMinWeight_1 = leftColumn.minWeight;
|
|
95239
|
+
var rightMinWeight = rightColumn_1.minWeight;
|
|
95240
|
+
var leftMaxWeight_1 = totalWeight_1 - rightMinWeight;
|
|
95241
|
+
if (totalWidth_1 <= 0 || leftMaxWeight_1 <= leftMinWeight_1) {
|
|
95242
|
+
// The left and right resizable cells doesn't non-zero width
|
|
95243
|
+
return;
|
|
95244
|
+
}
|
|
95245
|
+
category.state.add(DTableState.RESIZING);
|
|
95246
|
+
var onMove_2 = function (e) {
|
|
95247
|
+
var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
|
|
95248
|
+
var leftNewWeight = Math.max(leftMinWeight_1, Math.min(leftMaxWeight_1, totalWeight_1 * (leftNewWidth / totalWidth_1)));
|
|
95249
|
+
leftColumn.weight = leftNewWeight;
|
|
95250
|
+
rightColumn_1.weight = totalWeight_1 - leftNewWeight;
|
|
95251
|
+
};
|
|
95252
|
+
var onUp_2 = function (e) {
|
|
95253
|
+
category.state.remove(DTableState.RESIZING);
|
|
95254
|
+
interactionManager.off(UtilPointerEvent.move, onMove_2);
|
|
95255
|
+
interactionManager.off(UtilPointerEvent.up, onUp_2);
|
|
95256
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
|
|
95257
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_2);
|
|
95258
|
+
};
|
|
95259
|
+
interactionManager.on(UtilPointerEvent.move, onMove_2);
|
|
95260
|
+
interactionManager.on(UtilPointerEvent.up, onUp_2);
|
|
95261
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
|
|
95262
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_2);
|
|
95263
|
+
}
|
|
95264
|
+
};
|
|
95002
95265
|
DTableCategoryCell.prototype.getType = function () {
|
|
95003
95266
|
return "DTableCategoryCell";
|
|
95004
95267
|
};
|
|
@@ -95011,15 +95274,53 @@ var DTableCategoryCell = /** @class */ (function (_super) {
|
|
|
95011
95274
|
*/
|
|
95012
95275
|
var DTableCategory = /** @class */ (function (_super) {
|
|
95013
95276
|
__extends(DTableCategory, _super);
|
|
95014
|
-
function DTableCategory(options) {
|
|
95015
|
-
var
|
|
95016
|
-
|
|
95017
|
-
|
|
95277
|
+
function DTableCategory(columns, frozen, offset, options) {
|
|
95278
|
+
var _this = _super.call(this, columns, frozen, options) || this;
|
|
95279
|
+
_this._columns = columns;
|
|
95280
|
+
_this._frozen = frozen;
|
|
95018
95281
|
_this._offset = offset;
|
|
95019
95282
|
_this.transform.position.y = offset;
|
|
95020
|
-
_this.initCells(
|
|
95283
|
+
_this.initCells();
|
|
95284
|
+
for (var i = 0, imax = columns.length; i < imax; ++i) {
|
|
95285
|
+
var column = columns[i];
|
|
95286
|
+
column.on("resize", _this.newOnColumnResize(i, column));
|
|
95287
|
+
}
|
|
95021
95288
|
return _this;
|
|
95022
95289
|
}
|
|
95290
|
+
DTableCategory.prototype.newOnColumnResize = function (index, column) {
|
|
95291
|
+
var _this = this;
|
|
95292
|
+
return function () {
|
|
95293
|
+
_this.onColumnResize(index, column);
|
|
95294
|
+
};
|
|
95295
|
+
};
|
|
95296
|
+
DTableCategory.prototype.onColumnResize = function (index, column) {
|
|
95297
|
+
var columnWeight = column.weight;
|
|
95298
|
+
if (columnWeight != null) {
|
|
95299
|
+
this.onColumnResizeWeight(this, index, columnWeight);
|
|
95300
|
+
}
|
|
95301
|
+
else {
|
|
95302
|
+
var columnWidth = column.width;
|
|
95303
|
+
if (columnWidth != null) {
|
|
95304
|
+
this.onColumnResizeWidth(this, index, columnWidth);
|
|
95305
|
+
}
|
|
95306
|
+
}
|
|
95307
|
+
};
|
|
95308
|
+
DTableCategory.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
|
|
95309
|
+
var cells = row.children;
|
|
95310
|
+
var cellsLength = cells.length;
|
|
95311
|
+
var cellsIndex = cellsLength - index - 1;
|
|
95312
|
+
if (0 <= cellsIndex && cellsIndex < cellsLength) {
|
|
95313
|
+
cells[cellsIndex].weight = columnWeight;
|
|
95314
|
+
}
|
|
95315
|
+
};
|
|
95316
|
+
DTableCategory.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
|
|
95317
|
+
var cells = row.children;
|
|
95318
|
+
var cellsLength = cells.length;
|
|
95319
|
+
var cellsIndex = cellsLength - index - 1;
|
|
95320
|
+
if (0 <= cellsIndex && cellsIndex < cellsLength) {
|
|
95321
|
+
cells[cellsIndex].width = columnWidth;
|
|
95322
|
+
}
|
|
95323
|
+
};
|
|
95023
95324
|
DTableCategory.prototype.onParentMove = function (newX, newY, oldX, oldY) {
|
|
95024
95325
|
_super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
|
|
95025
95326
|
this.transform.position.y = -newY + this._offset;
|
|
@@ -95033,16 +95334,20 @@ var DTableCategory = /** @class */ (function (_super) {
|
|
|
95033
95334
|
return 0;
|
|
95034
95335
|
};
|
|
95035
95336
|
DTableCategory.prototype.newCell = function (columnIndex, column, columns, options) {
|
|
95036
|
-
return new DTableCategoryCell(this.toCellOptions(columnIndex, column, options));
|
|
95337
|
+
return new DTableCategoryCell(this, columnIndex, column, this.toCellOptions(columnIndex, column, options));
|
|
95037
95338
|
};
|
|
95038
95339
|
DTableCategory.prototype.toCellOptions = function (columnIndex, column, options) {
|
|
95039
|
-
var result = options.cell;
|
|
95340
|
+
var result = options === null || options === void 0 ? void 0 : options.cell;
|
|
95040
95341
|
if (result) {
|
|
95342
|
+
// Weight
|
|
95041
95343
|
result.weight = column.weight;
|
|
95344
|
+
// Width
|
|
95042
95345
|
result.width = column.width;
|
|
95346
|
+
// Label
|
|
95043
95347
|
var text = result.text || {};
|
|
95044
95348
|
result.text = text;
|
|
95045
95349
|
text.value = text.value || column.label;
|
|
95350
|
+
// Done
|
|
95046
95351
|
return result;
|
|
95047
95352
|
}
|
|
95048
95353
|
else {
|
|
@@ -96032,24 +96337,37 @@ var DTableHeaderCellCheck = /** @class */ (function () {
|
|
|
96032
96337
|
* Copyright (C) 2019 Toshiba Corporation
|
|
96033
96338
|
* SPDX-License-Identifier: Apache-2.0
|
|
96034
96339
|
*/
|
|
96340
|
+
var DTableHeaderCellEdge = {
|
|
96341
|
+
NONE: 0,
|
|
96342
|
+
LEFT: 1,
|
|
96343
|
+
RIGHT: 2,
|
|
96344
|
+
BOTH: 3
|
|
96345
|
+
};
|
|
96035
96346
|
var DTableHeaderCell = /** @class */ (function (_super) {
|
|
96036
96347
|
__extends(DTableHeaderCell, _super);
|
|
96037
|
-
function DTableHeaderCell() {
|
|
96038
|
-
|
|
96039
|
-
|
|
96040
|
-
|
|
96041
|
-
|
|
96042
|
-
|
|
96043
|
-
|
|
96044
|
-
|
|
96045
|
-
|
|
96046
|
-
|
|
96047
|
-
|
|
96048
|
-
|
|
96348
|
+
function DTableHeaderCell(header, columnIndex, column, options) {
|
|
96349
|
+
var _this = _super.call(this, options) || this;
|
|
96350
|
+
_this._header = header;
|
|
96351
|
+
_this._column = column;
|
|
96352
|
+
_this._columnIndex = columnIndex;
|
|
96353
|
+
var check = new DTableHeaderCellCheck(_this, options === null || options === void 0 ? void 0 : options.check);
|
|
96354
|
+
_this._check = check;
|
|
96355
|
+
_this._edgeSize = _this.theme.getEdgeWidth();
|
|
96356
|
+
_this._wasResizing = false;
|
|
96357
|
+
var sortable = column.sorting.enable;
|
|
96358
|
+
var checkable = check.isEnabled;
|
|
96359
|
+
if (checkable || sortable) {
|
|
96360
|
+
_this.on(UtilPointerEvent.tap, function (e) {
|
|
96361
|
+
_this.onClick(e);
|
|
96362
|
+
});
|
|
96363
|
+
var state = _this.state;
|
|
96364
|
+
state.lock();
|
|
96365
|
+
state.set(DTableState.SORTABLE, sortable);
|
|
96366
|
+
state.set(DTableState.CHECKABLE, checkable);
|
|
96367
|
+
state.unlock();
|
|
96049
96368
|
}
|
|
96050
|
-
|
|
96051
|
-
|
|
96052
|
-
};
|
|
96369
|
+
return _this;
|
|
96370
|
+
}
|
|
96053
96371
|
Object.defineProperty(DTableHeaderCell.prototype, "column", {
|
|
96054
96372
|
get: function () {
|
|
96055
96373
|
return this._column;
|
|
@@ -96078,23 +96396,201 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96078
96396
|
enumerable: false,
|
|
96079
96397
|
configurable: true
|
|
96080
96398
|
});
|
|
96081
|
-
DTableHeaderCell.prototype.
|
|
96399
|
+
DTableHeaderCell.prototype.onDown = function (e) {
|
|
96400
|
+
var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
|
|
96401
|
+
if (edges != null) {
|
|
96402
|
+
this._wasResizing = true;
|
|
96403
|
+
var layer = DApplications.getLayer(this);
|
|
96404
|
+
if (layer != null) {
|
|
96405
|
+
var interactionManager = layer.renderer.plugins.interaction;
|
|
96406
|
+
var columnIndex = this._columnIndex;
|
|
96407
|
+
if (edges === DTableHeaderCellEdge.LEFT) {
|
|
96408
|
+
this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
|
|
96409
|
+
}
|
|
96410
|
+
else {
|
|
96411
|
+
this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
|
|
96412
|
+
}
|
|
96413
|
+
}
|
|
96414
|
+
}
|
|
96415
|
+
else {
|
|
96416
|
+
this._wasResizing = false;
|
|
96417
|
+
_super.prototype.onDown.call(this, e);
|
|
96418
|
+
}
|
|
96419
|
+
};
|
|
96420
|
+
DTableHeaderCell.prototype.findLeftResizableCell = function (columnIndex) {
|
|
96421
|
+
var children = this._header.children;
|
|
96422
|
+
var childrenLength = children.length;
|
|
96423
|
+
for (var i = columnIndex; 0 <= i; --i) {
|
|
96424
|
+
var child = children[childrenLength - i - 1];
|
|
96425
|
+
if (child.column.resizable) {
|
|
96426
|
+
return child;
|
|
96427
|
+
}
|
|
96428
|
+
}
|
|
96429
|
+
return null;
|
|
96430
|
+
};
|
|
96431
|
+
DTableHeaderCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
|
|
96432
|
+
var children = this._header.children;
|
|
96433
|
+
var childrenLength = children.length;
|
|
96434
|
+
for (var i = columnIndex + 1; i < childrenLength; ++i) {
|
|
96435
|
+
var child = children[childrenLength - i - 1];
|
|
96436
|
+
var childColumn = child.column;
|
|
96437
|
+
if (childColumn.resizable) {
|
|
96438
|
+
var childColumnWeight = childColumn.weight;
|
|
96439
|
+
if (childColumnWeight != null) {
|
|
96440
|
+
return child;
|
|
96441
|
+
}
|
|
96442
|
+
}
|
|
96443
|
+
}
|
|
96444
|
+
return null;
|
|
96445
|
+
};
|
|
96446
|
+
DTableHeaderCell.prototype.checkIfEdgeResizable = function (columnIndex) {
|
|
96447
|
+
var target = this.findLeftResizableCell(columnIndex);
|
|
96448
|
+
if (target != null) {
|
|
96449
|
+
if (target.column.weight != null) {
|
|
96450
|
+
return this.findRightResizableCellOfWeight(target.columnIndex) != null;
|
|
96451
|
+
}
|
|
96452
|
+
else {
|
|
96453
|
+
return true;
|
|
96454
|
+
}
|
|
96455
|
+
}
|
|
96456
|
+
return false;
|
|
96457
|
+
};
|
|
96458
|
+
DTableHeaderCell.prototype.getResizableEdges = function () {
|
|
96459
|
+
var result = this._resizableEdges;
|
|
96460
|
+
if (result == null) {
|
|
96461
|
+
var columnIndex = this._columnIndex;
|
|
96462
|
+
if (this.checkIfEdgeResizable(columnIndex - 1)) {
|
|
96463
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
96464
|
+
result = DTableHeaderCellEdge.BOTH;
|
|
96465
|
+
}
|
|
96466
|
+
else {
|
|
96467
|
+
result = DTableHeaderCellEdge.LEFT;
|
|
96468
|
+
}
|
|
96469
|
+
}
|
|
96470
|
+
else {
|
|
96471
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
96472
|
+
result = DTableHeaderCellEdge.RIGHT;
|
|
96473
|
+
}
|
|
96474
|
+
else {
|
|
96475
|
+
result = DTableHeaderCellEdge.NONE;
|
|
96476
|
+
}
|
|
96477
|
+
}
|
|
96478
|
+
this._resizableEdges = result;
|
|
96479
|
+
}
|
|
96480
|
+
return result;
|
|
96481
|
+
};
|
|
96482
|
+
DTableHeaderCell.prototype.onOver = function (e) {
|
|
96082
96483
|
var _this = this;
|
|
96083
|
-
var
|
|
96084
|
-
|
|
96085
|
-
|
|
96086
|
-
var
|
|
96087
|
-
|
|
96088
|
-
|
|
96089
|
-
|
|
96090
|
-
|
|
96091
|
-
|
|
96092
|
-
|
|
96093
|
-
|
|
96094
|
-
|
|
96095
|
-
|
|
96484
|
+
var _a;
|
|
96485
|
+
_super.prototype.onOver.call(this, e);
|
|
96486
|
+
if (this.getResizableEdges() !== DTableHeaderCellEdge.NONE) {
|
|
96487
|
+
var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
|
|
96488
|
+
_this.onHovered(event);
|
|
96489
|
+
}));
|
|
96490
|
+
this.on(UtilPointerEvent.move, onHoveredBound);
|
|
96491
|
+
// Since the cursor is set by InteractionManager before this method is called,
|
|
96492
|
+
// the cursor need to be overriden.
|
|
96493
|
+
this.onHovered(e);
|
|
96494
|
+
var layer = DApplications.getLayer(this);
|
|
96495
|
+
if (layer != null) {
|
|
96496
|
+
layer.renderer.plugins.interaction.cursor = this.cursor;
|
|
96497
|
+
}
|
|
96498
|
+
}
|
|
96499
|
+
};
|
|
96500
|
+
DTableHeaderCell.prototype.onOut = function (e) {
|
|
96501
|
+
_super.prototype.onOut.call(this, e);
|
|
96502
|
+
var onHoveredBound = this._onHoveredBound;
|
|
96503
|
+
if (onHoveredBound != null) {
|
|
96504
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
96505
|
+
this.off(UtilPointerEvent.move, onHoveredBound);
|
|
96506
|
+
}
|
|
96507
|
+
};
|
|
96508
|
+
DTableHeaderCell.prototype.onHovered = function (e) {
|
|
96509
|
+
var width = this.width;
|
|
96510
|
+
var x = this.toClickPosition(e);
|
|
96511
|
+
var edgeSize = this._edgeSize;
|
|
96512
|
+
if (0 <= x && x <= edgeSize) {
|
|
96513
|
+
if (this.getResizableEdges() & DTableHeaderCellEdge.LEFT) {
|
|
96514
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.LEFT);
|
|
96515
|
+
}
|
|
96516
|
+
else {
|
|
96517
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
96518
|
+
}
|
|
96519
|
+
}
|
|
96520
|
+
else if (width - edgeSize <= x && x <= width) {
|
|
96521
|
+
if (this.getResizableEdges() & DTableHeaderCellEdge.RIGHT) {
|
|
96522
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableHeaderCellEdge.RIGHT);
|
|
96523
|
+
}
|
|
96524
|
+
else {
|
|
96525
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
96096
96526
|
}
|
|
96097
96527
|
}
|
|
96528
|
+
else {
|
|
96529
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
96530
|
+
}
|
|
96531
|
+
};
|
|
96532
|
+
DTableHeaderCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
|
|
96533
|
+
// Find the resizable cell
|
|
96534
|
+
var left = this.findLeftResizableCell(columnIndex);
|
|
96535
|
+
if (left == null) {
|
|
96536
|
+
// No resizable cell
|
|
96537
|
+
return;
|
|
96538
|
+
}
|
|
96539
|
+
var header = this._header;
|
|
96540
|
+
var leftColumn = left.column;
|
|
96541
|
+
var leftOldWidth = left.width;
|
|
96542
|
+
var leftOldWeight = left.weight;
|
|
96543
|
+
if (leftColumn.weight == null) {
|
|
96544
|
+
header.state.add(DTableState.RESIZING);
|
|
96545
|
+
var onMove_1 = function (e) {
|
|
96546
|
+
leftColumn.width = Math.max(1, leftOldWidth + e.data.global.x - onDownPoint);
|
|
96547
|
+
};
|
|
96548
|
+
var onUp_1 = function (e) {
|
|
96549
|
+
header.state.remove(DTableState.RESIZING);
|
|
96550
|
+
interactionManager.off(UtilPointerEvent.move, onMove_1);
|
|
96551
|
+
interactionManager.off(UtilPointerEvent.up, onUp_1);
|
|
96552
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
|
|
96553
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_1);
|
|
96554
|
+
};
|
|
96555
|
+
interactionManager.on(UtilPointerEvent.move, onMove_1);
|
|
96556
|
+
interactionManager.on(UtilPointerEvent.up, onUp_1);
|
|
96557
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
|
|
96558
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_1);
|
|
96559
|
+
}
|
|
96560
|
+
else {
|
|
96561
|
+
var right = this.findRightResizableCellOfWeight(left.columnIndex);
|
|
96562
|
+
if (right == null) {
|
|
96563
|
+
// No right resizable cell found
|
|
96564
|
+
return;
|
|
96565
|
+
}
|
|
96566
|
+
var rightColumn_1 = right.column;
|
|
96567
|
+
var rightOldWeight = right.weight;
|
|
96568
|
+
var rightOldWidth = right.width;
|
|
96569
|
+
var totalWidth_1 = leftOldWidth + rightOldWidth;
|
|
96570
|
+
var totalWeight_1 = leftOldWeight + rightOldWeight;
|
|
96571
|
+
if (totalWidth_1 <= 0) {
|
|
96572
|
+
// The left and right resizable cells doesn't have non-zero width
|
|
96573
|
+
return;
|
|
96574
|
+
}
|
|
96575
|
+
header.state.add(DTableState.RESIZING);
|
|
96576
|
+
var onMove_2 = function (e) {
|
|
96577
|
+
var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
|
|
96578
|
+
var leftNewWeight = totalWeight_1 * (leftNewWidth / totalWidth_1);
|
|
96579
|
+
leftColumn.weight = leftNewWeight;
|
|
96580
|
+
rightColumn_1.weight = totalWeight_1 - leftNewWeight;
|
|
96581
|
+
};
|
|
96582
|
+
var onUp_2 = function (e) {
|
|
96583
|
+
header.state.remove(DTableState.RESIZING);
|
|
96584
|
+
interactionManager.off(UtilPointerEvent.move, onMove_2);
|
|
96585
|
+
interactionManager.off(UtilPointerEvent.up, onUp_2);
|
|
96586
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
|
|
96587
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_2);
|
|
96588
|
+
};
|
|
96589
|
+
interactionManager.on(UtilPointerEvent.move, onMove_2);
|
|
96590
|
+
interactionManager.on(UtilPointerEvent.up, onUp_2);
|
|
96591
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
|
|
96592
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_2);
|
|
96593
|
+
}
|
|
96098
96594
|
};
|
|
96099
96595
|
Object.defineProperty(DTableHeaderCell.prototype, "sorter", {
|
|
96100
96596
|
get: function () {
|
|
@@ -96129,11 +96625,7 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96129
96625
|
});
|
|
96130
96626
|
Object.defineProperty(DTableHeaderCell.prototype, "comparator", {
|
|
96131
96627
|
get: function () {
|
|
96132
|
-
|
|
96133
|
-
if (column) {
|
|
96134
|
-
return column.sorting.comparator || null;
|
|
96135
|
-
}
|
|
96136
|
-
return null;
|
|
96628
|
+
return this._column.sorting.comparator || null;
|
|
96137
96629
|
},
|
|
96138
96630
|
enumerable: false,
|
|
96139
96631
|
configurable: true
|
|
@@ -96160,8 +96652,8 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96160
96652
|
}
|
|
96161
96653
|
};
|
|
96162
96654
|
DTableHeaderCell.prototype.toClickPosition = function (e) {
|
|
96163
|
-
var
|
|
96164
|
-
this._checkWork =
|
|
96655
|
+
var _a;
|
|
96656
|
+
var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new pixi_js.Point()));
|
|
96165
96657
|
return e.data.getLocalPosition(this, checkWork).x;
|
|
96166
96658
|
};
|
|
96167
96659
|
DTableHeaderCell.prototype.isCheckClicked = function (e) {
|
|
@@ -96186,6 +96678,10 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96186
96678
|
}
|
|
96187
96679
|
return false;
|
|
96188
96680
|
};
|
|
96681
|
+
DTableHeaderCell.prototype.isEdgeClicked = function (e) {
|
|
96682
|
+
return (e instanceof pixi_js.InteractionEvent &&
|
|
96683
|
+
(this.state.is(DTableState.HOVERED_ON_EDGE) || this._wasResizing));
|
|
96684
|
+
};
|
|
96189
96685
|
DTableHeaderCell.prototype.onClick = function (e) {
|
|
96190
96686
|
if (this.state.isActionable) {
|
|
96191
96687
|
this.activate(e);
|
|
@@ -96195,13 +96691,15 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96195
96691
|
this.onActivate(e);
|
|
96196
96692
|
};
|
|
96197
96693
|
DTableHeaderCell.prototype.onActivate = function (e) {
|
|
96198
|
-
if (this.
|
|
96199
|
-
this.
|
|
96200
|
-
|
|
96201
|
-
|
|
96202
|
-
|
|
96203
|
-
|
|
96204
|
-
|
|
96694
|
+
if (!this.isEdgeClicked(e)) {
|
|
96695
|
+
if (this.isCheckClicked(e)) {
|
|
96696
|
+
this.onToggleStart();
|
|
96697
|
+
this.onToggleEnd();
|
|
96698
|
+
}
|
|
96699
|
+
else {
|
|
96700
|
+
this.doSort(e);
|
|
96701
|
+
this.emit("active", this);
|
|
96702
|
+
}
|
|
96205
96703
|
}
|
|
96206
96704
|
};
|
|
96207
96705
|
DTableHeaderCell.prototype.doSort = function (e) {
|
|
@@ -96231,11 +96729,14 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96231
96729
|
};
|
|
96232
96730
|
Object.defineProperty(DTableHeaderCell.prototype, "isSortable", {
|
|
96233
96731
|
get: function () {
|
|
96234
|
-
|
|
96235
|
-
|
|
96236
|
-
|
|
96237
|
-
|
|
96238
|
-
|
|
96732
|
+
return this._column.sorting.enable;
|
|
96733
|
+
},
|
|
96734
|
+
enumerable: false,
|
|
96735
|
+
configurable: true
|
|
96736
|
+
});
|
|
96737
|
+
Object.defineProperty(DTableHeaderCell.prototype, "isResizable", {
|
|
96738
|
+
get: function () {
|
|
96739
|
+
return this._column.resizable;
|
|
96239
96740
|
},
|
|
96240
96741
|
enumerable: false,
|
|
96241
96742
|
configurable: true
|
|
@@ -96325,14 +96826,12 @@ var DTableHeaderCell = /** @class */ (function (_super) {
|
|
|
96325
96826
|
*/
|
|
96326
96827
|
var DTableHeader = /** @class */ (function (_super) {
|
|
96327
96828
|
__extends(DTableHeader, _super);
|
|
96328
|
-
function DTableHeader(options) {
|
|
96329
|
-
var
|
|
96330
|
-
|
|
96331
|
-
_this._table = (_a = options.table) !== null && _a !== void 0 ? _a : null;
|
|
96332
|
-
var offset = (_b = options.offset) !== null && _b !== void 0 ? _b : 0;
|
|
96829
|
+
function DTableHeader(table, columns, frozen, offset, options) {
|
|
96830
|
+
var _this = _super.call(this, columns, frozen, options) || this;
|
|
96831
|
+
_this._table = table;
|
|
96333
96832
|
_this._offset = offset;
|
|
96334
96833
|
_this.transform.position.y = offset;
|
|
96335
|
-
_this.initCells(
|
|
96834
|
+
_this.initCells();
|
|
96336
96835
|
return _this;
|
|
96337
96836
|
}
|
|
96338
96837
|
Object.defineProperty(DTableHeader.prototype, "table", {
|
|
@@ -96355,10 +96854,10 @@ var DTableHeader = /** @class */ (function (_super) {
|
|
|
96355
96854
|
return 0;
|
|
96356
96855
|
};
|
|
96357
96856
|
DTableHeader.prototype.newCell = function (columnIndex, column, columns, options) {
|
|
96358
|
-
return new DTableHeaderCell(this
|
|
96857
|
+
return new DTableHeaderCell(this, columnIndex, column, this.toCellOptions(column, options));
|
|
96359
96858
|
};
|
|
96360
|
-
DTableHeader.prototype.toCellOptions = function (
|
|
96361
|
-
var result = column.header || options.cell;
|
|
96859
|
+
DTableHeader.prototype.toCellOptions = function (column, options) {
|
|
96860
|
+
var result = column.header || (options === null || options === void 0 ? void 0 : options.cell);
|
|
96362
96861
|
if (result != null) {
|
|
96363
96862
|
if (result.weight === undefined) {
|
|
96364
96863
|
result.weight = column.weight;
|
|
@@ -96374,15 +96873,6 @@ var DTableHeader = /** @class */ (function (_super) {
|
|
|
96374
96873
|
else if (result.text.value === undefined) {
|
|
96375
96874
|
result.text.value = column.label;
|
|
96376
96875
|
}
|
|
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
96876
|
return result;
|
|
96387
96877
|
}
|
|
96388
96878
|
else {
|
|
@@ -96391,10 +96881,7 @@ var DTableHeader = /** @class */ (function (_super) {
|
|
|
96391
96881
|
width: column.width,
|
|
96392
96882
|
text: {
|
|
96393
96883
|
value: column.label
|
|
96394
|
-
}
|
|
96395
|
-
header: this,
|
|
96396
|
-
column: column,
|
|
96397
|
-
columnIndex: columnIndex
|
|
96884
|
+
}
|
|
96398
96885
|
};
|
|
96399
96886
|
}
|
|
96400
96887
|
};
|
|
@@ -96415,10 +96902,6 @@ var DTableScrollBar = /** @class */ (function (_super) {
|
|
|
96415
96902
|
return DTableScrollBar;
|
|
96416
96903
|
}(DPaneScrollBar));
|
|
96417
96904
|
|
|
96418
|
-
/*
|
|
96419
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
96420
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
96421
|
-
*/
|
|
96422
96905
|
var defaultGetter = function (row, columnIndex) {
|
|
96423
96906
|
return row[columnIndex];
|
|
96424
96907
|
};
|
|
@@ -96479,7 +96962,7 @@ var toPathSetter = function (path) {
|
|
|
96479
96962
|
};
|
|
96480
96963
|
}
|
|
96481
96964
|
};
|
|
96482
|
-
var
|
|
96965
|
+
var toAlign = function (options, type) {
|
|
96483
96966
|
var align = options.align;
|
|
96484
96967
|
if (align != null) {
|
|
96485
96968
|
if (isString(align)) {
|
|
@@ -96509,7 +96992,7 @@ var toColumnAlign = function (options, type) {
|
|
|
96509
96992
|
return DAlignHorizontal.LEFT;
|
|
96510
96993
|
}
|
|
96511
96994
|
};
|
|
96512
|
-
var
|
|
96995
|
+
var toDataChecker = function (path) {
|
|
96513
96996
|
if (path != null) {
|
|
96514
96997
|
var pathLength_1 = path.length;
|
|
96515
96998
|
if (pathLength_1 <= 1) {
|
|
@@ -96537,9 +97020,9 @@ var toColumnDataChecker = function (path) {
|
|
|
96537
97020
|
return columnIndex < row.length;
|
|
96538
97021
|
};
|
|
96539
97022
|
};
|
|
96540
|
-
var
|
|
97023
|
+
var toEditingEnable = function (enable, path) {
|
|
96541
97024
|
if (isString(enable)) {
|
|
96542
|
-
return
|
|
97025
|
+
return toDataChecker(path);
|
|
96543
97026
|
}
|
|
96544
97027
|
else if (enable != null) {
|
|
96545
97028
|
return enable;
|
|
@@ -96548,20 +97031,20 @@ var toColumnEditingEnable = function (enable, path) {
|
|
|
96548
97031
|
return false;
|
|
96549
97032
|
}
|
|
96550
97033
|
};
|
|
96551
|
-
var
|
|
97034
|
+
var toEditing = function (options, path) {
|
|
96552
97035
|
var _a;
|
|
96553
97036
|
var editing = options.editing;
|
|
96554
97037
|
var editable = options.editable;
|
|
96555
97038
|
if (editing) {
|
|
96556
97039
|
return {
|
|
96557
|
-
enable:
|
|
97040
|
+
enable: toEditingEnable((_a = editing.enable) !== null && _a !== void 0 ? _a : editable, path),
|
|
96558
97041
|
formatter: editing.formatter,
|
|
96559
97042
|
unformatter: editing.unformatter,
|
|
96560
97043
|
validator: editing.validator
|
|
96561
97044
|
};
|
|
96562
97045
|
}
|
|
96563
97046
|
return {
|
|
96564
|
-
enable:
|
|
97047
|
+
enable: toEditingEnable(editable, path)
|
|
96565
97048
|
};
|
|
96566
97049
|
};
|
|
96567
97050
|
var toComparator = function (getter, index) {
|
|
@@ -96571,7 +97054,7 @@ var toComparator = function (getter, index) {
|
|
|
96571
97054
|
return valueA < valueB ? -1 : valueB < valueA ? +1 : 0;
|
|
96572
97055
|
};
|
|
96573
97056
|
};
|
|
96574
|
-
var
|
|
97057
|
+
var toSorting = function (getter, index, options) {
|
|
96575
97058
|
var sorting = options.sorting;
|
|
96576
97059
|
var sortable = options.sortable;
|
|
96577
97060
|
if (sorting) {
|
|
@@ -96595,7 +97078,7 @@ var toColumnSorting = function (getter, index, options) {
|
|
|
96595
97078
|
enable: false
|
|
96596
97079
|
};
|
|
96597
97080
|
};
|
|
96598
|
-
var
|
|
97081
|
+
var toMenu = function (options) {
|
|
96599
97082
|
if (options == null) {
|
|
96600
97083
|
return undefined;
|
|
96601
97084
|
}
|
|
@@ -96606,7 +97089,7 @@ var toColumnMenu = function (options) {
|
|
|
96606
97089
|
return new DMenu(options);
|
|
96607
97090
|
}
|
|
96608
97091
|
};
|
|
96609
|
-
var
|
|
97092
|
+
var toDialog = function (options) {
|
|
96610
97093
|
if (options == null) {
|
|
96611
97094
|
return undefined;
|
|
96612
97095
|
}
|
|
@@ -96623,14 +97106,14 @@ var defaultSelectingGetter = function (dialog) {
|
|
|
96623
97106
|
var defaultSelectingSetter = function () {
|
|
96624
97107
|
// DO NOTHING
|
|
96625
97108
|
};
|
|
96626
|
-
var
|
|
97109
|
+
var toSelecting = function (options) {
|
|
96627
97110
|
if (options) {
|
|
96628
97111
|
return {
|
|
96629
97112
|
getter: options.getter || defaultSelectingGetter,
|
|
96630
97113
|
setter: options.setter || defaultSelectingSetter,
|
|
96631
|
-
menu:
|
|
96632
|
-
multiple:
|
|
96633
|
-
dialog:
|
|
97114
|
+
menu: toMenu(options.menu),
|
|
97115
|
+
multiple: toMenu(options.multiple),
|
|
97116
|
+
dialog: toDialog(options.dialog),
|
|
96634
97117
|
promise: options.promise
|
|
96635
97118
|
};
|
|
96636
97119
|
}
|
|
@@ -96639,7 +97122,7 @@ var toColumnSelecting = function (options) {
|
|
|
96639
97122
|
setter: defaultSelectingSetter
|
|
96640
97123
|
};
|
|
96641
97124
|
};
|
|
96642
|
-
var
|
|
97125
|
+
var toGetter = function (options, type, parts) {
|
|
96643
97126
|
var getter = options.getter;
|
|
96644
97127
|
if (getter) {
|
|
96645
97128
|
return getter;
|
|
@@ -96657,7 +97140,7 @@ var toColumnGetter = function (options, type, parts) {
|
|
|
96657
97140
|
}
|
|
96658
97141
|
}
|
|
96659
97142
|
};
|
|
96660
|
-
var
|
|
97143
|
+
var toSetter = function (options, type, path) {
|
|
96661
97144
|
var setter = options.setter;
|
|
96662
97145
|
if (setter) {
|
|
96663
97146
|
return setter;
|
|
@@ -96676,7 +97159,7 @@ var toColumnSetter = function (options, type, path) {
|
|
|
96676
97159
|
}
|
|
96677
97160
|
}
|
|
96678
97161
|
};
|
|
96679
|
-
var
|
|
97162
|
+
var toState = function (options) {
|
|
96680
97163
|
var state = options.state;
|
|
96681
97164
|
if (state != null) {
|
|
96682
97165
|
if (isString(state) || isArray(state)) {
|
|
@@ -96697,155 +97180,445 @@ var toColumnState = function (options) {
|
|
|
96697
97180
|
modifier: undefined
|
|
96698
97181
|
};
|
|
96699
97182
|
};
|
|
96700
|
-
var
|
|
97183
|
+
var toPath = function (options) {
|
|
96701
97184
|
return options.path != null ? options.path.split(".") : null;
|
|
96702
97185
|
};
|
|
96703
|
-
var
|
|
97186
|
+
var toRenderable = function (options, path) {
|
|
96704
97187
|
var renderable = options.renderable;
|
|
96705
97188
|
if (isString(renderable)) {
|
|
96706
|
-
return
|
|
97189
|
+
return toDataChecker(path);
|
|
96707
97190
|
}
|
|
96708
97191
|
else if (renderable != null) {
|
|
96709
97192
|
return renderable;
|
|
96710
97193
|
}
|
|
96711
97194
|
return true;
|
|
96712
97195
|
};
|
|
96713
|
-
var
|
|
96714
|
-
|
|
96715
|
-
|
|
96716
|
-
|
|
96717
|
-
|
|
96718
|
-
|
|
96719
|
-
|
|
96720
|
-
|
|
96721
|
-
|
|
96722
|
-
|
|
96723
|
-
|
|
96724
|
-
|
|
96725
|
-
|
|
96726
|
-
|
|
96727
|
-
|
|
96728
|
-
|
|
96729
|
-
|
|
96730
|
-
|
|
96731
|
-
|
|
96732
|
-
|
|
96733
|
-
|
|
96734
|
-
|
|
96735
|
-
|
|
96736
|
-
|
|
96737
|
-
|
|
96738
|
-
|
|
96739
|
-
|
|
96740
|
-
|
|
96741
|
-
|
|
96742
|
-
|
|
96743
|
-
|
|
96744
|
-
|
|
96745
|
-
|
|
96746
|
-
|
|
96747
|
-
|
|
96748
|
-
|
|
96749
|
-
|
|
96750
|
-
|
|
96751
|
-
|
|
96752
|
-
|
|
96753
|
-
|
|
96754
|
-
|
|
96755
|
-
|
|
96756
|
-
for (var i = 0, imax = options.length; i < imax; ++i) {
|
|
96757
|
-
result.push(toColumn(i, options[i]));
|
|
97196
|
+
var DTableColumnImpl = /** @class */ (function (_super) {
|
|
97197
|
+
__extends(DTableColumnImpl, _super);
|
|
97198
|
+
function DTableColumnImpl(index, options) {
|
|
97199
|
+
var _a, _b, _c;
|
|
97200
|
+
var _this = _super.call(this) || this;
|
|
97201
|
+
var weight = options.weight;
|
|
97202
|
+
var width = options.width;
|
|
97203
|
+
if (weight != null) {
|
|
97204
|
+
if (width != null) {
|
|
97205
|
+
width = undefined;
|
|
97206
|
+
}
|
|
97207
|
+
}
|
|
97208
|
+
else if (width == null) {
|
|
97209
|
+
weight = 1;
|
|
97210
|
+
}
|
|
97211
|
+
var type = toEnum((_a = options.type) !== null && _a !== void 0 ? _a : DTableColumnType.TEXT, DTableColumnType);
|
|
97212
|
+
var align = toAlign(options, type);
|
|
97213
|
+
var label = options.label || "";
|
|
97214
|
+
var path = toPath(options);
|
|
97215
|
+
var getter = toGetter(options, type, path);
|
|
97216
|
+
var setter = toSetter(options, type, path);
|
|
97217
|
+
_this._weight = weight;
|
|
97218
|
+
_this._width = width;
|
|
97219
|
+
_this.resizable = (_b = options.resizable) !== null && _b !== void 0 ? _b : false;
|
|
97220
|
+
_this.type = type;
|
|
97221
|
+
_this.label = label;
|
|
97222
|
+
_this.getter = getter;
|
|
97223
|
+
_this.setter = setter;
|
|
97224
|
+
_this.formatter = options.formatter;
|
|
97225
|
+
_this.renderable = toRenderable(options, path);
|
|
97226
|
+
_this.align = align;
|
|
97227
|
+
_this.state = toState(options);
|
|
97228
|
+
_this.editing = toEditing(options, path);
|
|
97229
|
+
_this.sorting = toSorting(getter, index, options);
|
|
97230
|
+
_this.header = options.header;
|
|
97231
|
+
_this.body = options.body;
|
|
97232
|
+
_this.selecting = toSelecting(options.selecting);
|
|
97233
|
+
_this.category = options.category;
|
|
97234
|
+
_this.frozen = options.frozen;
|
|
97235
|
+
_this.offset = 0.0;
|
|
97236
|
+
_this.link = options.link;
|
|
97237
|
+
_this.update = toEnum((_c = options.update) !== null && _c !== void 0 ? _c : DTableColumnUpdate.CELL, DTableColumnUpdate);
|
|
97238
|
+
return _this;
|
|
96758
97239
|
}
|
|
96759
|
-
|
|
96760
|
-
|
|
96761
|
-
|
|
96762
|
-
|
|
96763
|
-
|
|
96764
|
-
|
|
97240
|
+
Object.defineProperty(DTableColumnImpl.prototype, "weight", {
|
|
97241
|
+
get: function () {
|
|
97242
|
+
return this._weight;
|
|
97243
|
+
},
|
|
97244
|
+
set: function (weight) {
|
|
97245
|
+
if (this._weight != null && this._weight !== weight) {
|
|
97246
|
+
this._weight = weight;
|
|
97247
|
+
this.emit("resize", this);
|
|
97248
|
+
}
|
|
97249
|
+
},
|
|
97250
|
+
enumerable: false,
|
|
97251
|
+
configurable: true
|
|
97252
|
+
});
|
|
97253
|
+
Object.defineProperty(DTableColumnImpl.prototype, "width", {
|
|
97254
|
+
get: function () {
|
|
97255
|
+
return this._width;
|
|
97256
|
+
},
|
|
97257
|
+
set: function (width) {
|
|
97258
|
+
if (this._width != null && this._width !== width) {
|
|
97259
|
+
this._width = width;
|
|
97260
|
+
this.emit("resize", this);
|
|
97261
|
+
}
|
|
97262
|
+
},
|
|
97263
|
+
enumerable: false,
|
|
97264
|
+
configurable: true
|
|
97265
|
+
});
|
|
97266
|
+
return DTableColumnImpl;
|
|
97267
|
+
}(pixi_js.utils.EventEmitter));
|
|
97268
|
+
|
|
97269
|
+
var DTableColumnContainerImpl = /** @class */ (function (_super) {
|
|
97270
|
+
__extends(DTableColumnContainerImpl, _super);
|
|
97271
|
+
function DTableColumnContainerImpl(parent, options) {
|
|
97272
|
+
var _this = _super.call(this) || this;
|
|
97273
|
+
_this.parent = parent;
|
|
97274
|
+
var columns = [];
|
|
97275
|
+
if (options != null) {
|
|
97276
|
+
for (var i = 0, imax = options.length; i < imax; ++i) {
|
|
97277
|
+
var column = new DTableColumnImpl(i, options[i]);
|
|
97278
|
+
columns.push(column);
|
|
97279
|
+
column.on("resize", _this.newOnColumnResize(i, column));
|
|
97280
|
+
}
|
|
97281
|
+
}
|
|
97282
|
+
_this.items = columns;
|
|
97283
|
+
var frozen = 0;
|
|
97284
|
+
for (var i = columns.length - 1; 0 <= i; --i) {
|
|
97285
|
+
if (columns[i].frozen === true) {
|
|
97286
|
+
frozen = i + 1;
|
|
97287
|
+
break;
|
|
97288
|
+
}
|
|
96765
97289
|
}
|
|
97290
|
+
_this.frozen = frozen;
|
|
97291
|
+
return _this;
|
|
96766
97292
|
}
|
|
96767
|
-
|
|
96768
|
-
|
|
96769
|
-
|
|
96770
|
-
|
|
96771
|
-
|
|
96772
|
-
|
|
96773
|
-
|
|
96774
|
-
|
|
96775
|
-
|
|
96776
|
-
|
|
96777
|
-
|
|
96778
|
-
|
|
96779
|
-
|
|
96780
|
-
|
|
97293
|
+
DTableColumnContainerImpl.prototype.newOnColumnResize = function (index, column) {
|
|
97294
|
+
var _this = this;
|
|
97295
|
+
return function () {
|
|
97296
|
+
_this.onColumnResize(index, column);
|
|
97297
|
+
};
|
|
97298
|
+
};
|
|
97299
|
+
DTableColumnContainerImpl.prototype.onColumnResize = function (index, column) {
|
|
97300
|
+
this.onColumnResizeHeader(index, column);
|
|
97301
|
+
this.onColumnResizeBody(index, column);
|
|
97302
|
+
this.emit("resize", index, column, this);
|
|
97303
|
+
};
|
|
97304
|
+
DTableColumnContainerImpl.prototype.onColumnResizeHeader = function (index, column) {
|
|
97305
|
+
var header = this.parent.header;
|
|
97306
|
+
if (header != null) {
|
|
97307
|
+
var columnWeight = column.weight;
|
|
97308
|
+
if (columnWeight != null) {
|
|
97309
|
+
this.onColumnResizeWeight(header, index, columnWeight);
|
|
97310
|
+
}
|
|
97311
|
+
else {
|
|
97312
|
+
var columnWidth = column.width;
|
|
97313
|
+
if (columnWidth != null) {
|
|
97314
|
+
this.onColumnResizeWidth(header, index, columnWidth);
|
|
97315
|
+
}
|
|
97316
|
+
}
|
|
96781
97317
|
}
|
|
96782
|
-
|
|
96783
|
-
|
|
96784
|
-
|
|
97318
|
+
};
|
|
97319
|
+
DTableColumnContainerImpl.prototype.onColumnResizeBody = function (index, column) {
|
|
97320
|
+
var rows = this.parent.body.children;
|
|
97321
|
+
var columnWeight = column.weight;
|
|
97322
|
+
if (columnWeight != null) {
|
|
97323
|
+
for (var i = 0, imax = rows.length; i < imax; ++i) {
|
|
97324
|
+
this.onColumnResizeWeight(rows[i], index, columnWeight);
|
|
97325
|
+
}
|
|
96785
97326
|
}
|
|
96786
|
-
|
|
96787
|
-
|
|
96788
|
-
|
|
97327
|
+
else {
|
|
97328
|
+
var columnWidth = column.width;
|
|
97329
|
+
if (columnWidth != null) {
|
|
97330
|
+
for (var i = 0, imax = rows.length; i < imax; ++i) {
|
|
97331
|
+
this.onColumnResizeWidth(rows[i], index, columnWidth);
|
|
97332
|
+
}
|
|
97333
|
+
}
|
|
96789
97334
|
}
|
|
96790
|
-
|
|
97335
|
+
};
|
|
97336
|
+
DTableColumnContainerImpl.prototype.onColumnResizeWeight = function (row, index, columnWeight) {
|
|
97337
|
+
var cells = row.children;
|
|
97338
|
+
var cellsLength = cells.length;
|
|
97339
|
+
var cellsIndex = cellsLength - index - 1;
|
|
97340
|
+
if (0 <= cellsIndex && cellsIndex < cellsLength) {
|
|
97341
|
+
cells[cellsIndex].weight = columnWeight;
|
|
97342
|
+
}
|
|
97343
|
+
};
|
|
97344
|
+
DTableColumnContainerImpl.prototype.onColumnResizeWidth = function (row, index, columnWidth) {
|
|
97345
|
+
var cells = row.children;
|
|
97346
|
+
var cellsLength = cells.length;
|
|
97347
|
+
var cellsIndex = cellsLength - index - 1;
|
|
97348
|
+
if (0 <= cellsIndex && cellsIndex < cellsLength) {
|
|
97349
|
+
cells[cellsIndex].width = columnWidth;
|
|
97350
|
+
}
|
|
97351
|
+
};
|
|
97352
|
+
Object.defineProperty(DTableColumnContainerImpl.prototype, "width", {
|
|
97353
|
+
get: function () {
|
|
97354
|
+
var result = 0;
|
|
97355
|
+
var items = this.items;
|
|
97356
|
+
var length = items.length;
|
|
97357
|
+
for (var i = 0; i < length; ++i) {
|
|
97358
|
+
var item = items[i];
|
|
97359
|
+
var itemWidth = item.width;
|
|
97360
|
+
if (itemWidth != null) {
|
|
97361
|
+
result += itemWidth;
|
|
97362
|
+
}
|
|
97363
|
+
}
|
|
97364
|
+
return result;
|
|
97365
|
+
},
|
|
97366
|
+
enumerable: false,
|
|
97367
|
+
configurable: true
|
|
97368
|
+
});
|
|
97369
|
+
DTableColumnContainerImpl.prototype.get = function (index) {
|
|
97370
|
+
var columns = this.items;
|
|
97371
|
+
if (0 <= index && index < columns.length) {
|
|
97372
|
+
return columns[index];
|
|
97373
|
+
}
|
|
97374
|
+
return null;
|
|
97375
|
+
};
|
|
97376
|
+
DTableColumnContainerImpl.prototype.each = function (iteratee) {
|
|
97377
|
+
var columns = this.items;
|
|
97378
|
+
for (var i = 0, imax = columns.length; i < imax; ++i) {
|
|
97379
|
+
if (iteratee(columns[i], i) === false) {
|
|
97380
|
+
break;
|
|
97381
|
+
}
|
|
97382
|
+
}
|
|
97383
|
+
return this;
|
|
97384
|
+
};
|
|
97385
|
+
DTableColumnContainerImpl.prototype.size = function () {
|
|
97386
|
+
return this.items.length;
|
|
97387
|
+
};
|
|
97388
|
+
return DTableColumnContainerImpl;
|
|
97389
|
+
}(pixi_js.utils.EventEmitter));
|
|
97390
|
+
|
|
97391
|
+
/*
|
|
97392
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
97393
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
97394
|
+
*/
|
|
97395
|
+
var DTableCategoryColumnImpl = /** @class */ (function (_super) {
|
|
97396
|
+
__extends(DTableCategoryColumnImpl, _super);
|
|
97397
|
+
function DTableCategoryColumnImpl(index, column) {
|
|
97398
|
+
var _this = _super.call(this) || this;
|
|
97399
|
+
// Label
|
|
97400
|
+
var category = column.category;
|
|
97401
|
+
if (category) {
|
|
97402
|
+
if (isString(category)) {
|
|
97403
|
+
if (index === 0) {
|
|
97404
|
+
_this.label = category;
|
|
97405
|
+
}
|
|
97406
|
+
}
|
|
97407
|
+
else {
|
|
97408
|
+
if (index < category.length) {
|
|
97409
|
+
_this.label = category[index];
|
|
97410
|
+
}
|
|
97411
|
+
}
|
|
97412
|
+
}
|
|
97413
|
+
_this._weight = column.weight;
|
|
97414
|
+
_this._width = column.width;
|
|
97415
|
+
_this._isLocked = false;
|
|
97416
|
+
_this.offset = 0.0;
|
|
97417
|
+
_this._columns = [column];
|
|
97418
|
+
_this._nresizable = column.resizable ? 1 : 0;
|
|
97419
|
+
var onResizeBound = function () {
|
|
97420
|
+
_this.onResize();
|
|
97421
|
+
};
|
|
97422
|
+
_this._onResizeBound = onResizeBound;
|
|
97423
|
+
column.on("resize", onResizeBound);
|
|
96791
97424
|
return _this;
|
|
96792
97425
|
}
|
|
96793
|
-
|
|
97426
|
+
DTableCategoryColumnImpl.prototype.onResize = function () {
|
|
97427
|
+
if (this._isLocked) {
|
|
97428
|
+
return;
|
|
97429
|
+
}
|
|
97430
|
+
var columns = this._columns;
|
|
97431
|
+
if (this._weight != null) {
|
|
97432
|
+
var newWeight = 0;
|
|
97433
|
+
for (var i = 0, imax = columns.length; i < imax; ++i) {
|
|
97434
|
+
var weight = columns[i].weight;
|
|
97435
|
+
if (weight != null) {
|
|
97436
|
+
newWeight += weight;
|
|
97437
|
+
}
|
|
97438
|
+
}
|
|
97439
|
+
if (this._weight !== newWeight) {
|
|
97440
|
+
this._weight = newWeight;
|
|
97441
|
+
this.emit("resize", this);
|
|
97442
|
+
}
|
|
97443
|
+
}
|
|
97444
|
+
else {
|
|
97445
|
+
var newWidth = 0;
|
|
97446
|
+
for (var i = 0, imax = columns.length; i < imax; ++i) {
|
|
97447
|
+
var width = columns[i].width;
|
|
97448
|
+
if (width != null) {
|
|
97449
|
+
newWidth += width;
|
|
97450
|
+
}
|
|
97451
|
+
}
|
|
97452
|
+
if (this._width !== newWidth) {
|
|
97453
|
+
this._width = newWidth;
|
|
97454
|
+
this.emit("resize", this);
|
|
97455
|
+
}
|
|
97456
|
+
}
|
|
97457
|
+
};
|
|
97458
|
+
Object.defineProperty(DTableCategoryColumnImpl.prototype, "resizable", {
|
|
96794
97459
|
get: function () {
|
|
96795
|
-
|
|
96796
|
-
|
|
96797
|
-
|
|
96798
|
-
|
|
96799
|
-
|
|
97460
|
+
return 0 < this._nresizable;
|
|
97461
|
+
},
|
|
97462
|
+
enumerable: false,
|
|
97463
|
+
configurable: true
|
|
97464
|
+
});
|
|
97465
|
+
Object.defineProperty(DTableCategoryColumnImpl.prototype, "weight", {
|
|
97466
|
+
get: function () {
|
|
97467
|
+
return this._weight;
|
|
97468
|
+
},
|
|
97469
|
+
set: function (weight) {
|
|
97470
|
+
var oldWeight = this._weight;
|
|
97471
|
+
var nresizable = this._nresizable;
|
|
97472
|
+
if (0 < nresizable && oldWeight != null && oldWeight !== weight) {
|
|
97473
|
+
var columns = this._columns;
|
|
97474
|
+
var columnsLength = columns.length;
|
|
97475
|
+
var minWeight = this.minWeight;
|
|
97476
|
+
var newWeight = Math.max(minWeight, weight);
|
|
97477
|
+
if (this._weight !== newWeight) {
|
|
97478
|
+
this._isLocked = true;
|
|
97479
|
+
if (minWeight < oldWeight) {
|
|
97480
|
+
var columnWeightRatio = (newWeight - minWeight) / (oldWeight - minWeight);
|
|
97481
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97482
|
+
var column = columns[i];
|
|
97483
|
+
var columnWeight = column.weight;
|
|
97484
|
+
if (column.resizable && columnWeight != null) {
|
|
97485
|
+
column.weight = columnWeight * columnWeightRatio;
|
|
97486
|
+
}
|
|
97487
|
+
}
|
|
97488
|
+
}
|
|
97489
|
+
else {
|
|
97490
|
+
var newColumnWeight = (newWeight - minWeight) / this._nresizable;
|
|
97491
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97492
|
+
var column = columns[i];
|
|
97493
|
+
var columnWeight = column.weight;
|
|
97494
|
+
if (column.resizable && columnWeight != null) {
|
|
97495
|
+
column.weight = newColumnWeight;
|
|
97496
|
+
}
|
|
97497
|
+
}
|
|
97498
|
+
}
|
|
97499
|
+
this._isLocked = false;
|
|
97500
|
+
this.onResize();
|
|
97501
|
+
}
|
|
96800
97502
|
}
|
|
96801
|
-
return result;
|
|
96802
97503
|
},
|
|
96803
97504
|
enumerable: false,
|
|
96804
97505
|
configurable: true
|
|
96805
97506
|
});
|
|
96806
|
-
Object.defineProperty(
|
|
97507
|
+
Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWeight", {
|
|
96807
97508
|
get: function () {
|
|
96808
|
-
var result =
|
|
96809
|
-
|
|
96810
|
-
|
|
96811
|
-
|
|
97509
|
+
var result = 0;
|
|
97510
|
+
var columns = this._columns;
|
|
97511
|
+
var columnsLength = columns.length;
|
|
97512
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97513
|
+
var column = columns[i];
|
|
97514
|
+
var columnWeight = column.weight;
|
|
97515
|
+
if (!column.resizable && columnWeight != null) {
|
|
97516
|
+
result += columnWeight;
|
|
97517
|
+
}
|
|
96812
97518
|
}
|
|
96813
97519
|
return result;
|
|
96814
97520
|
},
|
|
96815
97521
|
enumerable: false,
|
|
96816
97522
|
configurable: true
|
|
96817
97523
|
});
|
|
96818
|
-
Object.defineProperty(
|
|
97524
|
+
Object.defineProperty(DTableCategoryColumnImpl.prototype, "width", {
|
|
96819
97525
|
get: function () {
|
|
96820
|
-
|
|
96821
|
-
|
|
96822
|
-
|
|
96823
|
-
|
|
97526
|
+
return this._width;
|
|
97527
|
+
},
|
|
97528
|
+
set: function (width) {
|
|
97529
|
+
var oldWidth = this._width;
|
|
97530
|
+
var nresizable = this._nresizable;
|
|
97531
|
+
if (0 < nresizable && oldWidth != null && oldWidth !== width) {
|
|
97532
|
+
var columns = this._columns;
|
|
97533
|
+
var columnsLength = columns.length;
|
|
97534
|
+
var minWidth = this.minWidth;
|
|
97535
|
+
var newWidth = Math.max(minWidth, width);
|
|
97536
|
+
if (oldWidth !== newWidth) {
|
|
97537
|
+
this._isLocked = true;
|
|
97538
|
+
if (minWidth < oldWidth) {
|
|
97539
|
+
var columnWidthRatio = (newWidth - minWidth) / (oldWidth - minWidth);
|
|
97540
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97541
|
+
var column = columns[i];
|
|
97542
|
+
var columnWidth = column.width;
|
|
97543
|
+
if (column.resizable && columnWidth != null) {
|
|
97544
|
+
column.width = columnWidth * columnWidthRatio;
|
|
97545
|
+
}
|
|
97546
|
+
}
|
|
97547
|
+
}
|
|
97548
|
+
else {
|
|
97549
|
+
var newColumnWidth = (newWidth - minWidth) / this._nresizable;
|
|
97550
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97551
|
+
var column = columns[i];
|
|
97552
|
+
var columnWidth = column.width;
|
|
97553
|
+
if (column.resizable && columnWidth != null) {
|
|
97554
|
+
column.width = newColumnWidth;
|
|
97555
|
+
}
|
|
97556
|
+
}
|
|
97557
|
+
}
|
|
97558
|
+
this._isLocked = false;
|
|
97559
|
+
this.onResize();
|
|
97560
|
+
}
|
|
97561
|
+
}
|
|
97562
|
+
},
|
|
97563
|
+
enumerable: false,
|
|
97564
|
+
configurable: true
|
|
97565
|
+
});
|
|
97566
|
+
Object.defineProperty(DTableCategoryColumnImpl.prototype, "minWidth", {
|
|
97567
|
+
get: function () {
|
|
97568
|
+
var result = 0;
|
|
97569
|
+
var columns = this._columns;
|
|
97570
|
+
var columnsLength = columns.length;
|
|
97571
|
+
for (var i = 0; i < columnsLength; ++i) {
|
|
97572
|
+
var column = columns[i];
|
|
97573
|
+
var columnWidth = column.width;
|
|
97574
|
+
if (!column.resizable && columnWidth != null) {
|
|
97575
|
+
result += columnWidth;
|
|
97576
|
+
}
|
|
96824
97577
|
}
|
|
96825
97578
|
return result;
|
|
96826
97579
|
},
|
|
96827
97580
|
enumerable: false,
|
|
96828
97581
|
configurable: true
|
|
96829
97582
|
});
|
|
96830
|
-
|
|
96831
|
-
|
|
96832
|
-
|
|
96833
|
-
|
|
96834
|
-
|
|
96835
|
-
|
|
96836
|
-
|
|
96837
|
-
|
|
96838
|
-
|
|
96839
|
-
|
|
96840
|
-
|
|
96841
|
-
|
|
96842
|
-
|
|
96843
|
-
|
|
96844
|
-
|
|
96845
|
-
|
|
96846
|
-
|
|
97583
|
+
DTableCategoryColumnImpl.prototype.add = function (column) {
|
|
97584
|
+
this._columns.push(column);
|
|
97585
|
+
if (this._weight != null) {
|
|
97586
|
+
var weight = column.weight;
|
|
97587
|
+
if (weight != null) {
|
|
97588
|
+
this._weight += weight;
|
|
97589
|
+
if (column.resizable) {
|
|
97590
|
+
this._nresizable += 1;
|
|
97591
|
+
}
|
|
97592
|
+
column.on("resize", this._onResizeBound);
|
|
97593
|
+
}
|
|
97594
|
+
}
|
|
97595
|
+
else if (this._width != null) {
|
|
97596
|
+
var width = column.width;
|
|
97597
|
+
if (width != null) {
|
|
97598
|
+
this._width += width;
|
|
97599
|
+
if (column.resizable) {
|
|
97600
|
+
this._nresizable += 1;
|
|
97601
|
+
}
|
|
97602
|
+
column.on("resize", this._onResizeBound);
|
|
97603
|
+
}
|
|
97604
|
+
}
|
|
96847
97605
|
};
|
|
96848
|
-
|
|
97606
|
+
return DTableCategoryColumnImpl;
|
|
97607
|
+
}(pixi_js.utils.EventEmitter));
|
|
97608
|
+
|
|
97609
|
+
var DTableCategoryContainerImpl = /** @class */ (function () {
|
|
97610
|
+
function DTableCategoryContainerImpl(columns, frozen, options) {
|
|
97611
|
+
var count = this.toCount(columns);
|
|
97612
|
+
var items = [];
|
|
97613
|
+
var offset = 0;
|
|
97614
|
+
for (var i = count - 1; 0 <= i; --i) {
|
|
97615
|
+
var item = new DTableCategory(this.toColumns(i, columns, frozen), frozen, offset, options);
|
|
97616
|
+
items.push(item);
|
|
97617
|
+
offset += item.height;
|
|
97618
|
+
}
|
|
97619
|
+
this.items = items;
|
|
97620
|
+
}
|
|
97621
|
+
DTableCategoryContainerImpl.prototype.toCount = function (columns) {
|
|
96849
97622
|
var result = 0;
|
|
96850
97623
|
for (var i = 0, imax = columns.length; i < imax; ++i) {
|
|
96851
97624
|
var category = columns[i].category;
|
|
@@ -96856,22 +97629,7 @@ var DTable = /** @class */ (function (_super) {
|
|
|
96856
97629
|
}
|
|
96857
97630
|
return result;
|
|
96858
97631
|
};
|
|
96859
|
-
|
|
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) {
|
|
97632
|
+
DTableCategoryContainerImpl.prototype.isCategory = function (index, a, b) {
|
|
96875
97633
|
if (a != null) {
|
|
96876
97634
|
if (b != null) {
|
|
96877
97635
|
if (isString(a)) {
|
|
@@ -96960,7 +97718,7 @@ var DTable = /** @class */ (function (_super) {
|
|
|
96960
97718
|
}
|
|
96961
97719
|
}
|
|
96962
97720
|
};
|
|
96963
|
-
|
|
97721
|
+
DTableCategoryContainerImpl.prototype.toColumns = function (index, columns, frozen) {
|
|
96964
97722
|
var result = [];
|
|
96965
97723
|
var tcolumn = null;
|
|
96966
97724
|
var ccolumn = null;
|
|
@@ -96969,66 +97727,119 @@ var DTable = /** @class */ (function (_super) {
|
|
|
96969
97727
|
if (i !== frozen &&
|
|
96970
97728
|
ccolumn &&
|
|
96971
97729
|
tcolumn &&
|
|
96972
|
-
this.
|
|
97730
|
+
this.isCategory(index, tcolumn.category, column.category)) {
|
|
96973
97731
|
if (ccolumn.weight != null && column.weight != null) {
|
|
96974
|
-
ccolumn.
|
|
97732
|
+
ccolumn.add(column);
|
|
96975
97733
|
}
|
|
96976
97734
|
else if (ccolumn.width != null && column.width != null) {
|
|
96977
|
-
ccolumn.
|
|
97735
|
+
ccolumn.add(column);
|
|
96978
97736
|
}
|
|
96979
97737
|
else {
|
|
96980
97738
|
tcolumn = column;
|
|
96981
|
-
ccolumn =
|
|
96982
|
-
label: this.toCategoryLabel(index, column.category),
|
|
96983
|
-
weight: column.weight,
|
|
96984
|
-
width: column.width,
|
|
96985
|
-
offset: 0.0
|
|
96986
|
-
};
|
|
97739
|
+
ccolumn = new DTableCategoryColumnImpl(index, column);
|
|
96987
97740
|
result.push(ccolumn);
|
|
96988
97741
|
}
|
|
96989
97742
|
}
|
|
96990
97743
|
else {
|
|
96991
97744
|
tcolumn = column;
|
|
96992
|
-
ccolumn =
|
|
96993
|
-
label: this.toCategoryLabel(index, column.category),
|
|
96994
|
-
weight: column.weight,
|
|
96995
|
-
width: column.width,
|
|
96996
|
-
offset: 0.0
|
|
96997
|
-
};
|
|
97745
|
+
ccolumn = new DTableCategoryColumnImpl(index, column);
|
|
96998
97746
|
result.push(ccolumn);
|
|
96999
97747
|
}
|
|
97000
97748
|
}
|
|
97001
97749
|
return result;
|
|
97002
97750
|
};
|
|
97003
|
-
|
|
97004
|
-
|
|
97005
|
-
|
|
97006
|
-
|
|
97007
|
-
|
|
97008
|
-
|
|
97009
|
-
|
|
97010
|
-
|
|
97011
|
-
|
|
97012
|
-
|
|
97013
|
-
|
|
97014
|
-
|
|
97751
|
+
return DTableCategoryContainerImpl;
|
|
97752
|
+
}());
|
|
97753
|
+
|
|
97754
|
+
/*
|
|
97755
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
97756
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
97757
|
+
*/
|
|
97758
|
+
var DTable = /** @class */ (function (_super) {
|
|
97759
|
+
__extends(DTable, _super);
|
|
97760
|
+
function DTable(options) {
|
|
97761
|
+
var _this = _super.call(this, options) || this;
|
|
97762
|
+
var content = _this.content;
|
|
97763
|
+
var body = _this.body;
|
|
97764
|
+
content.addChild(body);
|
|
97765
|
+
if (body.data.selection.type !== DTableDataSelectionType.NONE) {
|
|
97766
|
+
_this.on(UtilPointerEvent.tap, function (e) {
|
|
97767
|
+
body.onRowClick(e);
|
|
97768
|
+
});
|
|
97015
97769
|
}
|
|
97016
|
-
|
|
97017
|
-
|
|
97018
|
-
|
|
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;
|
|
97770
|
+
var header = _this.header;
|
|
97771
|
+
if (header) {
|
|
97772
|
+
content.addChild(header);
|
|
97030
97773
|
}
|
|
97031
|
-
|
|
97774
|
+
var categories = _this.categories;
|
|
97775
|
+
for (var i = categories.length - 1; 0 <= i; --i) {
|
|
97776
|
+
content.addChild(categories[i]);
|
|
97777
|
+
}
|
|
97778
|
+
body.update();
|
|
97779
|
+
return _this;
|
|
97780
|
+
}
|
|
97781
|
+
Object.defineProperty(DTable.prototype, "column", {
|
|
97782
|
+
get: function () {
|
|
97783
|
+
var _a;
|
|
97784
|
+
return ((_a = this._column) !== null && _a !== void 0 ? _a : (this._column = this.newColumn()));
|
|
97785
|
+
},
|
|
97786
|
+
enumerable: false,
|
|
97787
|
+
configurable: true
|
|
97788
|
+
});
|
|
97789
|
+
DTable.prototype.newColumn = function () {
|
|
97790
|
+
var _a;
|
|
97791
|
+
return new DTableColumnContainerImpl(this, (_a = this._options) === null || _a === void 0 ? void 0 : _a.columns);
|
|
97792
|
+
};
|
|
97793
|
+
Object.defineProperty(DTable.prototype, "columns", {
|
|
97794
|
+
get: function () {
|
|
97795
|
+
return this.column.items;
|
|
97796
|
+
},
|
|
97797
|
+
enumerable: false,
|
|
97798
|
+
configurable: true
|
|
97799
|
+
});
|
|
97800
|
+
Object.defineProperty(DTable.prototype, "frozen", {
|
|
97801
|
+
get: function () {
|
|
97802
|
+
return this.column.frozen;
|
|
97803
|
+
},
|
|
97804
|
+
enumerable: false,
|
|
97805
|
+
configurable: true
|
|
97806
|
+
});
|
|
97807
|
+
Object.defineProperty(DTable.prototype, "category", {
|
|
97808
|
+
get: function () {
|
|
97809
|
+
return (this._category = this.newCategory());
|
|
97810
|
+
},
|
|
97811
|
+
enumerable: false,
|
|
97812
|
+
configurable: true
|
|
97813
|
+
});
|
|
97814
|
+
DTable.prototype.newCategory = function () {
|
|
97815
|
+
var _a;
|
|
97816
|
+
var column = this.column;
|
|
97817
|
+
return new DTableCategoryContainerImpl(column.items, column.frozen, (_a = this._options) === null || _a === void 0 ? void 0 : _a.category);
|
|
97818
|
+
};
|
|
97819
|
+
Object.defineProperty(DTable.prototype, "categories", {
|
|
97820
|
+
get: function () {
|
|
97821
|
+
return this.category.items;
|
|
97822
|
+
},
|
|
97823
|
+
enumerable: false,
|
|
97824
|
+
configurable: true
|
|
97825
|
+
});
|
|
97826
|
+
DTable.prototype.initContent = function (content) {
|
|
97827
|
+
_super.prototype.initContent.call(this, content);
|
|
97828
|
+
content.state.isFocusReverse = true;
|
|
97829
|
+
};
|
|
97830
|
+
DTable.prototype.onContentChange = function () {
|
|
97831
|
+
_super.prototype.onContentChange.call(this);
|
|
97832
|
+
this.body.update();
|
|
97833
|
+
};
|
|
97834
|
+
DTable.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
|
|
97835
|
+
var scrollbar = this.scrollbar;
|
|
97836
|
+
scrollbar.lock();
|
|
97837
|
+
var body = this.body;
|
|
97838
|
+
body.lock();
|
|
97839
|
+
_super.prototype.onResize.call(this, newWidth, newHeight, oldWidth, oldHeight);
|
|
97840
|
+
body.update();
|
|
97841
|
+
body.unlock(true);
|
|
97842
|
+
scrollbar.unlock(true);
|
|
97032
97843
|
};
|
|
97033
97844
|
DTable.prototype.onDblClick = function (e, interactionManager) {
|
|
97034
97845
|
var result = this.body.onDblClick(e, interactionManager);
|
|
@@ -97040,24 +97851,35 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97040
97851
|
_this.onScrollBarUpdate(isRegionVisible);
|
|
97041
97852
|
});
|
|
97042
97853
|
};
|
|
97043
|
-
DTable.prototype.
|
|
97044
|
-
var
|
|
97045
|
-
var
|
|
97046
|
-
|
|
97047
|
-
|
|
97048
|
-
|
|
97049
|
-
|
|
97050
|
-
|
|
97051
|
-
|
|
97052
|
-
|
|
97053
|
-
|
|
97854
|
+
DTable.prototype.newContent = function (options) {
|
|
97855
|
+
var _this = this;
|
|
97856
|
+
var result = _super.prototype.newContent.call(this, options);
|
|
97857
|
+
// X & Width
|
|
97858
|
+
var column = this.column;
|
|
97859
|
+
var columnWidth = column.width;
|
|
97860
|
+
if (0 < columnWidth) {
|
|
97861
|
+
column.on("resize", function () {
|
|
97862
|
+
columnWidth = column.width;
|
|
97863
|
+
var parentWidth = _this.width;
|
|
97864
|
+
var parentHeight = _this.height;
|
|
97865
|
+
var newWidth = Math.max(parentWidth, columnWidth);
|
|
97866
|
+
var newXMin = parentWidth - newWidth;
|
|
97867
|
+
// The X position must be in [newXMin, 0].
|
|
97868
|
+
if (result.x < newXMin) {
|
|
97869
|
+
result.x = newXMin;
|
|
97870
|
+
}
|
|
97871
|
+
// Force the with reevaluated
|
|
97872
|
+
result.onParentResize(parentWidth, parentHeight, _this.padding);
|
|
97873
|
+
});
|
|
97874
|
+
result.setWidth(function (p) {
|
|
97875
|
+
return Math.max(p, columnWidth);
|
|
97876
|
+
});
|
|
97054
97877
|
}
|
|
97055
|
-
|
|
97056
|
-
|
|
97057
|
-
return Math.max(p, columnWidthTotal);
|
|
97058
|
-
};
|
|
97878
|
+
else {
|
|
97879
|
+
result.setWidth("100%");
|
|
97059
97880
|
}
|
|
97060
|
-
|
|
97881
|
+
// Done
|
|
97882
|
+
return result;
|
|
97061
97883
|
};
|
|
97062
97884
|
DTable.prototype.getHeaderOffset = function () {
|
|
97063
97885
|
var result = this._headerOffset;
|
|
@@ -97079,7 +97901,7 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97079
97901
|
get: function () {
|
|
97080
97902
|
var result = this._header;
|
|
97081
97903
|
if (result === undefined) {
|
|
97082
|
-
result = this.newHeader(
|
|
97904
|
+
result = this.newHeader();
|
|
97083
97905
|
this._header = result;
|
|
97084
97906
|
}
|
|
97085
97907
|
return result;
|
|
@@ -97098,42 +97920,17 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97098
97920
|
}
|
|
97099
97921
|
return false;
|
|
97100
97922
|
};
|
|
97101
|
-
DTable.prototype.newHeader = function (
|
|
97923
|
+
DTable.prototype.newHeader = function () {
|
|
97924
|
+
var options = this._options;
|
|
97102
97925
|
if (this.hasHeader(options)) {
|
|
97103
|
-
|
|
97926
|
+
var column = this.column;
|
|
97927
|
+
return new DTableHeader(this, column.items, column.frozen, this.getHeaderOffset(), options === null || options === void 0 ? void 0 : options.header);
|
|
97104
97928
|
}
|
|
97105
97929
|
return null;
|
|
97106
97930
|
};
|
|
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
97931
|
DTable.prototype.getBodyOffset = function () {
|
|
97131
|
-
var
|
|
97132
|
-
|
|
97133
|
-
result = this.newBodyOffset();
|
|
97134
|
-
this._bodyOffset = result;
|
|
97135
|
-
}
|
|
97136
|
-
return result;
|
|
97932
|
+
var _a;
|
|
97933
|
+
return ((_a = this._bodyOffset) !== null && _a !== void 0 ? _a : (this._bodyOffset = this.newBodyOffset()));
|
|
97137
97934
|
};
|
|
97138
97935
|
DTable.prototype.newBodyOffset = function () {
|
|
97139
97936
|
var _a, _b;
|
|
@@ -97141,30 +97938,19 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97141
97938
|
};
|
|
97142
97939
|
Object.defineProperty(DTable.prototype, "body", {
|
|
97143
97940
|
get: function () {
|
|
97144
|
-
var
|
|
97145
|
-
|
|
97146
|
-
result = this.newBody(this._options, this.columns, this.frozen, this.getBodyOffset());
|
|
97147
|
-
this._body = result;
|
|
97148
|
-
}
|
|
97149
|
-
return result;
|
|
97941
|
+
var _a;
|
|
97942
|
+
return ((_a = this._body) !== null && _a !== void 0 ? _a : (this._body = this.newBody()));
|
|
97150
97943
|
},
|
|
97151
97944
|
enumerable: false,
|
|
97152
97945
|
configurable: true
|
|
97153
97946
|
});
|
|
97154
|
-
DTable.prototype.newBody = function (
|
|
97155
|
-
|
|
97947
|
+
DTable.prototype.newBody = function () {
|
|
97948
|
+
var options = this._options;
|
|
97949
|
+
var column = this.column;
|
|
97950
|
+
return new DTableBody(column.items, column.frozen, this.getBodyOffset(), this.toBodyOptions(options === null || options === void 0 ? void 0 : options.body, options === null || options === void 0 ? void 0 : options.data));
|
|
97156
97951
|
};
|
|
97157
|
-
DTable.prototype.toBodyOptions = function (options,
|
|
97952
|
+
DTable.prototype.toBodyOptions = function (options, data) {
|
|
97158
97953
|
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
97954
|
if (options.data === undefined && data !== undefined) {
|
|
97169
97955
|
if (isArray(data)) {
|
|
97170
97956
|
options.data = {
|
|
@@ -97182,9 +97968,6 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97182
97968
|
}
|
|
97183
97969
|
if (isArray(data)) {
|
|
97184
97970
|
return {
|
|
97185
|
-
columns: columns,
|
|
97186
|
-
frozen: frozen,
|
|
97187
|
-
offset: offset,
|
|
97188
97971
|
data: {
|
|
97189
97972
|
rows: data
|
|
97190
97973
|
},
|
|
@@ -97193,9 +97976,6 @@ var DTable = /** @class */ (function (_super) {
|
|
|
97193
97976
|
}
|
|
97194
97977
|
else {
|
|
97195
97978
|
return {
|
|
97196
|
-
columns: columns,
|
|
97197
|
-
frozen: frozen,
|
|
97198
|
-
offset: offset,
|
|
97199
97979
|
data: data,
|
|
97200
97980
|
weight: 1
|
|
97201
97981
|
};
|
|
@@ -99138,6 +99918,7 @@ exports.DTableBodyCells = DTableBodyCells;
|
|
|
99138
99918
|
exports.DTableBodyRow = DTableBodyRow;
|
|
99139
99919
|
exports.DTableCategory = DTableCategory;
|
|
99140
99920
|
exports.DTableCategoryCell = DTableCategoryCell;
|
|
99921
|
+
exports.DTableCategoryCellEdge = DTableCategoryCellEdge;
|
|
99141
99922
|
exports.DTableColumnType = DTableColumnType;
|
|
99142
99923
|
exports.DTableColumnUpdate = DTableColumnUpdate;
|
|
99143
99924
|
exports.DTableDataList = DTableDataList;
|
|
@@ -99155,6 +99936,7 @@ exports.DTableDataTreeSorter = DTableDataTreeSorter;
|
|
|
99155
99936
|
exports.DTableHeader = DTableHeader;
|
|
99156
99937
|
exports.DTableHeaderCell = DTableHeaderCell;
|
|
99157
99938
|
exports.DTableHeaderCellCheck = DTableHeaderCellCheck;
|
|
99939
|
+
exports.DTableHeaderCellEdge = DTableHeaderCellEdge;
|
|
99158
99940
|
exports.DTableRow = DTableRow;
|
|
99159
99941
|
exports.DTableScrollBar = DTableScrollBar;
|
|
99160
99942
|
exports.DTableState = DTableState;
|