@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.
- package/dist/types/wcardinal/ui/d-indicator-processing.d.ts +8 -7
- package/dist/types/wcardinal/ui/d-pagination.d.ts +5 -5
- 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/index.d.ts +7 -0
- 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-indicator-processing.js +20 -15
- package/dist/wcardinal/ui/d-indicator-processing.js.map +1 -1
- package/dist/wcardinal/ui/d-pagination.js +5 -5
- package/dist/wcardinal/ui/d-pagination.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/index.js +7 -0
- package/dist/wcardinal/ui/index.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 +1545 -753
- package/dist/wcardinal-ui.js +1882 -1114
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,18 +14,11 @@ import { DApplications } from "./d-applications";
|
|
|
14
14
|
import { isNumber } from "./util/is-number";
|
|
15
15
|
import { DTableColumnUpdate } from "./d-table-column-update";
|
|
16
16
|
var toRowOptions = function (theme, options, selectionType) {
|
|
17
|
-
var columns = options.columns || [];
|
|
18
17
|
var result = options.row;
|
|
19
18
|
if (result != null) {
|
|
20
19
|
if (result.height == null) {
|
|
21
20
|
result.height = theme.getRowHeight();
|
|
22
21
|
}
|
|
23
|
-
if (result.columns === undefined) {
|
|
24
|
-
result.columns = columns;
|
|
25
|
-
}
|
|
26
|
-
if (result.frozen == null) {
|
|
27
|
-
result.frozen = options.frozen;
|
|
28
|
-
}
|
|
29
22
|
if (result.selection === undefined) {
|
|
30
23
|
result.selection = {
|
|
31
24
|
type: selectionType
|
|
@@ -37,9 +30,7 @@ var toRowOptions = function (theme, options, selectionType) {
|
|
|
37
30
|
}
|
|
38
31
|
else {
|
|
39
32
|
result = {
|
|
40
|
-
columns: columns,
|
|
41
33
|
height: theme.getRowHeight(),
|
|
42
|
-
frozen: options.frozen,
|
|
43
34
|
selection: {
|
|
44
35
|
type: selectionType
|
|
45
36
|
}
|
|
@@ -49,18 +40,18 @@ var toRowOptions = function (theme, options, selectionType) {
|
|
|
49
40
|
};
|
|
50
41
|
var DTableBody = /** @class */ (function (_super) {
|
|
51
42
|
__extends(DTableBody, _super);
|
|
52
|
-
function DTableBody(options) {
|
|
53
|
-
var _a;
|
|
43
|
+
function DTableBody(columns, frozen, offset, options) {
|
|
54
44
|
var _this = _super.call(this, options) || this;
|
|
55
|
-
_this.transform.position.y =
|
|
45
|
+
_this.transform.position.y = offset;
|
|
56
46
|
var data = _this.toData(options.data);
|
|
57
47
|
_this._data = data;
|
|
58
48
|
data.bind(_this);
|
|
59
49
|
var theme = _this.theme;
|
|
50
|
+
_this._columns = columns;
|
|
51
|
+
_this._frozen = frozen;
|
|
60
52
|
var rowOptions = toRowOptions(theme, options, data.selection.type);
|
|
61
53
|
_this._rowOptions = rowOptions;
|
|
62
54
|
_this._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();
|
|
63
|
-
_this._columns = rowOptions.columns || [];
|
|
64
55
|
_this._rowIndexMappedStart = 0;
|
|
65
56
|
_this._rowIndexMappedEnd = 0;
|
|
66
57
|
_this._updateRowsCount = 0;
|
|
@@ -271,14 +262,14 @@ var DTableBody = /** @class */ (function (_super) {
|
|
|
271
262
|
return row;
|
|
272
263
|
};
|
|
273
264
|
DTableBody.prototype.newRow = function (isEven) {
|
|
274
|
-
return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._rowOptions);
|
|
265
|
+
return new DTableBodyRow(this._onRowChangeBound, isEven, this._columnIndexToCellOptions, this._columns, this._frozen, this._rowOptions);
|
|
275
266
|
};
|
|
276
267
|
DTableBody.prototype.onParentMove = function (newX, newY, oldX, oldY) {
|
|
277
268
|
_super.prototype.onParentMove.call(this, newX, newY, oldX, oldY);
|
|
278
269
|
this.updateFrozenCellPosition(newX);
|
|
279
270
|
};
|
|
280
271
|
DTableBody.prototype.updateFrozenCellPosition = function (x) {
|
|
281
|
-
var frozen = this.
|
|
272
|
+
var frozen = this._frozen;
|
|
282
273
|
if (frozen != null && 0 < frozen) {
|
|
283
274
|
var rows = this.children;
|
|
284
275
|
for (var i = 0, imax = rows.length; i < imax; ++i) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-table-body.js","sourceRoot":"","sources":["../../../src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;6BACD;yBACD;6BAAM;4BACN,IAAI,aAAa,EAAE;gCAClB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;oCACnC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;iCAClC;6BACD;iCAAM;gCACN,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;oCACnC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iCACnB;6BACD;yBACD;wBACD,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;qBAC7B;iBACD;aACD;SACD;IACF,CAAC;IAED,+BAAU,GAAV,UAAW,CAA0B,EAAE,kBAAsC;QAC5E,OAAO,iBAAM,UAAU,YAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAChD,CAAC;IAES,4BAAO,GAAjB;QACC,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,sBAAI,4BAAI;aAAR;YACC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;;;OAAA;IAzfgB,wBAAa,GAAG,IAAI,KAAK,EAAE,CAAC;IA0f9C,iBAAC;CAAA,AAhgBD,CAKU,KAAK,GA2fd;SAhgBY,UAAU","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InteractionEvent, InteractionManager, Point, Rectangle } from \"pixi.js\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DTableBodyRow, DTableBodyRowOnChange, DTableBodyRowOptions } from \"./d-table-body-row\";\nimport { DTableColumn } from \"./d-table-column\";\nimport { DTableData, DTableDataOptions, DTableDataSupplimental } from \"./d-table-data\";\nimport { DTableDataList, DTableDataListOptions } from \"./d-table-data-list\";\nimport { DTableDataSelection, DTableDataSelectionType } from \"./d-table-data-selection\";\nimport { DTableBodyCell } from \"./d-table-body-cell\";\nimport { DTableState } from \"./d-table-state\";\nimport { DTableBodyCellOptions } from \"./d-table-body-cell-options\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DApplications } from \"./d-applications\";\nimport { isNumber } from \"./util/is-number\";\nimport { DTableColumnUpdate } from \"./d-table-column-update\";\n\n/**\n * {@link DTableBody} events.\n */\nexport interface DTableBodyEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when rows are updated.\n\t * The first and second parameters are an mapped index range of visible data.\n\t * Please note that these parameters are real numbers.\n\t * For instance, An index range of [0.5, 2.5] means:\n\t *\n\t * * The row at index 0 is partially visible.\n\t * * The row at index 1 is fully visible.\n\t * * The row at index 2 is partially visible.\n\t *\n\t * @param from a lowest mapped index of visible data\n\t * @param to a highest mapped index of vislble data\n\t * @param emitter an emitter\n\t */\n\tupdate(from: number, to: number, emitter: EMITTER): void;\n}\n\n/**\n * {@link DTableBody} \"on\" options.\n */\nexport interface DTableBodyOnOptions<EMITTER>\n\textends Partial<DTableBodyEvents<EMITTER>>,\n\t\tDOnOptions {}\n\nexport interface DTableBodyOptions<\n\tROW,\n\tDATA extends DTableData<ROW> = DTableDataList<ROW>,\n\tTHEME extends DThemeTableBody = DThemeTableBody,\n\tEMITTER = any\n> extends DBaseOptions<THEME, EMITTER> {\n\tcolumns?: Array<DTableColumn<ROW, unknown>>;\n\trow?: DTableBodyRowOptions<ROW>;\n\tdata?: DTableDataListOptions<ROW> | DATA;\n\toffset?: number;\n\tfrozen?: number;\n\ton?: DTableBodyOnOptions<EMITTER>;\n}\n\nexport interface DThemeTableBody extends DThemeBase {\n\tgetRowHeight(): number;\n}\n\nconst toRowOptions = <ROW, DATA extends DTableData<ROW>>(\n\ttheme: DThemeTableBody,\n\toptions: DTableBodyOptions<ROW, DATA>,\n\tselectionType: DTableDataSelectionType\n): DTableBodyRowOptions<ROW> => {\n\tconst columns = options.columns || [];\n\tlet result = options.row;\n\tif (result != null) {\n\t\tif (result.height == null) {\n\t\t\tresult.height = theme.getRowHeight();\n\t\t}\n\t\tif (result.columns === undefined) {\n\t\t\tresult.columns = columns;\n\t\t}\n\t\tif (result.frozen == null) {\n\t\t\tresult.frozen = options.frozen;\n\t\t}\n\t\tif (result.selection === undefined) {\n\t\t\tresult.selection = {\n\t\t\t\ttype: selectionType\n\t\t\t};\n\t\t} else if (result.selection.type === undefined) {\n\t\t\tresult.selection.type = selectionType;\n\t\t}\n\t} else {\n\t\tresult = {\n\t\t\tcolumns,\n\t\t\theight: theme.getRowHeight(),\n\t\t\tfrozen: options.frozen,\n\t\t\tselection: {\n\t\t\t\ttype: selectionType\n\t\t\t}\n\t\t};\n\t}\n\treturn result as DTableBodyRowOptions<ROW>;\n};\n\nexport class DTableBody<\n\tROW,\n\tDATA extends DTableData<ROW> = DTableDataList<ROW>,\n\tTHEME extends DThemeTableBody = DThemeTableBody,\n\tOPTIONS extends DTableBodyOptions<ROW, DATA, THEME> = DTableBodyOptions<ROW, DATA, THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_ON_CLICK = new Point();\n\n\tprotected _columns: Array<DTableColumn<ROW, unknown>>;\n\tprotected _rowHeight: number;\n\tprotected _rowIndexMappedStart: number;\n\tprotected _rowIndexMappedEnd: number;\n\tprotected _rowOptions: DTableBodyRowOptions<ROW>;\n\tprotected _updateRowsCount: number;\n\tprotected _isUpdateRowsCalled: boolean;\n\tprotected _isUpdateRowsCalledForcibly: boolean;\n\tprotected _workRows: Array<DTableBodyRow<ROW>>;\n\tprotected _onRowChangeBound: DTableBodyRowOnChange<ROW, unknown>;\n\tprotected _columnIndexToCellOptions: Map<number, DTableBodyCellOptions<ROW>>;\n\tprotected _data: DATA;\n\n\tconstructor(options: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis.transform.position.y = options.offset ?? 0;\n\t\tconst data = this.toData(options.data);\n\t\tthis._data = data;\n\t\tdata.bind(this);\n\t\tconst theme = this.theme;\n\t\tconst rowOptions = toRowOptions(theme, options, data.selection.type);\n\t\tthis._rowOptions = rowOptions;\n\t\tthis._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();\n\t\tthis._columns = rowOptions.columns || [];\n\t\tthis._rowIndexMappedStart = 0;\n\t\tthis._rowIndexMappedEnd = 0;\n\t\tthis._updateRowsCount = 0;\n\t\tthis._isUpdateRowsCalled = false;\n\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\tthis._workRows = [];\n\t\tthis._onRowChangeBound = (newValue, oldValue, row, rowIndex, columnIndex, column): void => {\n\t\t\tthis.onRowChange(newValue, oldValue, row, rowIndex, columnIndex, column);\n\t\t};\n\t\tthis._columnIndexToCellOptions = new Map<number, DTableBodyCellOptions<ROW>>();\n\t\tthis._data.emit(\"init\", this._data);\n\t}\n\n\tprotected onRowChange(\n\t\tnewValue: unknown,\n\t\toldValue: unknown,\n\t\trow: ROW,\n\t\trowIndex: number,\n\t\tcolumnIndex: number,\n\t\tcolumn: DTableColumn<ROW, unknown>\n\t): void {\n\t\tconst data = this._data;\n\t\tdata.emit(\"change\", newValue, oldValue, row, rowIndex, columnIndex, data);\n\t\tif (column.update === DTableColumnUpdate.ALL) {\n\t\t\tthis.update(true);\n\t\t}\n\t}\n\n\tprotected toData(options?: DATA | DTableDataListOptions<ROW>): DATA {\n\t\tif (this.isData(options)) {\n\t\t\treturn options;\n\t\t}\n\t\treturn new DTableDataList<ROW>(options) as any;\n\t}\n\n\tprotected isData(\n\t\ttarget?: ROW[] | DTableDataOptions<ROW> | DTableData<ROW>\n\t): target is DTableData<ROW> {\n\t\treturn target != null && \"mapped\" in target;\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tsuper.onResize(newWidth, newHeight, oldWidth, oldHeight);\n\t\tthis.update();\n\t}\n\n\tget selection(): DTableDataSelection<ROW> {\n\t\treturn this._data.selection;\n\t}\n\n\tlock(): void {\n\t\tthis._updateRowsCount += 1;\n\t\tif (this._updateRowsCount === 1) {\n\t\t\tthis._isUpdateRowsCalled = false;\n\t\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\t}\n\t}\n\n\tunlock(callIfNeeded: boolean): void {\n\t\tthis._updateRowsCount -= 1;\n\t\tif (this._updateRowsCount === 0) {\n\t\t\tif (callIfNeeded && this._isUpdateRowsCalled) {\n\t\t\t\tthis.update(this._isUpdateRowsCalledForcibly);\n\t\t\t}\n\t\t\tthis._isUpdateRowsCalled = false;\n\t\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\t}\n\t}\n\n\t/**\n\t * Updates rows. If the `forcibly` is true, some dirty checkings for\n\t * avoiding unnecessary state changes are skipped.\n\t *\n\t * @param forcibly true to update forcibly\n\t */\n\tupdate(forcibly?: boolean): void {\n\t\tif (0 < this._updateRowsCount) {\n\t\t\tthis._isUpdateRowsCalled = true;\n\t\t\tif (forcibly) {\n\t\t\t\tthis._isUpdateRowsCalledForcibly = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = this.parent;\n\t\tif (content == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst contentParent = content.parent;\n\t\tif (contentParent == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\tconst height = contentParent.height;\n\t\tconst rowHeight = this._rowHeight;\n\n\t\tconst data = this._data;\n\t\tconst dataMappedSize = data.mapped.size();\n\n\t\tconst oldRowIndexMappedStart = this._rowIndexMappedStart;\n\t\tlet oldRowIndexMappedEnd = this._rowIndexMappedEnd;\n\t\tlet oldRowCount = oldRowIndexMappedEnd - oldRowIndexMappedStart;\n\n\t\tconst y = this.transform.position.y;\n\t\tconst newHeight = y + dataMappedSize * rowHeight;\n\t\tconst newContentHeight = Math.max(height, newHeight);\n\t\tconst newContentY = Math.max(height - newContentHeight, content.position.y);\n\n\t\tconst newRowIndexMappedLowerBound = -newContentY / rowHeight;\n\t\tconst newRowIndexMappedUpperBound = (height - (newContentY + y)) / rowHeight;\n\t\tlet newRowIndexMappedStart = Math.floor(newRowIndexMappedLowerBound);\n\t\tnewRowIndexMappedStart -= newRowIndexMappedStart % 2 === 0 ? 2 : 1;\n\t\tlet newRowIndexMappedEnd = Math.floor(newRowIndexMappedUpperBound);\n\t\tnewRowIndexMappedEnd += (newRowIndexMappedEnd - newRowIndexMappedStart) % 2 === 1 ? 3 : 2;\n\t\tlet newRowCount = newRowIndexMappedEnd - newRowIndexMappedStart;\n\t\tif (newRowCount < oldRowCount) {\n\t\t\tnewRowCount = oldRowCount;\n\t\t\tnewRowIndexMappedEnd = newRowIndexMappedStart + newRowCount;\n\t\t}\n\n\t\tif (oldRowCount < newRowCount) {\n\t\t\tfor (let i = oldRowCount; i < newRowCount; ++i) {\n\t\t\t\tconst oldRowIndexMapped = oldRowIndexMappedStart + i;\n\t\t\t\tconst newRow = this.newRow(oldRowIndexMapped % 2 === 0);\n\t\t\t\tthis.addChild(newRow);\n\t\t\t}\n\t\t\toldRowCount = newRowCount;\n\t\t\toldRowIndexMappedEnd = oldRowIndexMappedStart + oldRowCount;\n\t\t} else if (newRowCount < oldRowCount) {\n\t\t\tfor (let i = oldRowCount - 1; newRowCount <= i; --i) {\n\t\t\t\tthis.removeChild(rows[i]);\n\t\t\t}\n\t\t\toldRowCount = newRowCount;\n\t\t\toldRowIndexMappedEnd = oldRowIndexMappedStart + oldRowCount;\n\t\t}\n\n\t\tthis._rowIndexMappedStart = newRowIndexMappedStart;\n\t\tthis._rowIndexMappedEnd = newRowIndexMappedEnd;\n\n\t\tconst rowIndexMappedStartDelta = newRowIndexMappedStart - oldRowIndexMappedStart;\n\t\tconst rowIndexMappedStartDeltaAbs = Math.abs(rowIndexMappedStartDelta);\n\t\tconst rowsLength = rows.length;\n\t\tif (0 < rowIndexMappedStartDeltaAbs && rowIndexMappedStartDeltaAbs < rowsLength) {\n\t\t\tconst work = this._workRows;\n\t\t\tif (0 < rowIndexMappedStartDelta) {\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\twork.push(this.resetRow(rows[i]));\n\t\t\t\t}\n\t\t\t\tfor (let i = rowIndexMappedStartDeltaAbs; i < rowsLength; ++i) {\n\t\t\t\t\trows[i - rowIndexMappedStartDeltaAbs] = rows[i];\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\trows[rowsLength - rowIndexMappedStartDeltaAbs + i] = work[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\twork.push(this.resetRow(rows[rowsLength - rowIndexMappedStartDeltaAbs + i]));\n\t\t\t\t}\n\t\t\t\tfor (let i = rowsLength - rowIndexMappedStartDeltaAbs - 1; 0 <= i; --i) {\n\t\t\t\t\trows[i + rowIndexMappedStartDeltaAbs] = rows[i];\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\trows[i] = work[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\twork.length = 0;\n\t\t}\n\n\t\tconst selection = data.selection;\n\t\tconst isRowSelectable = selection.type !== DTableDataSelectionType.NONE;\n\t\tdata.mapped.each(\n\t\t\t(\n\t\t\t\tdatum: ROW,\n\t\t\t\tsupplimental: DTableDataSupplimental | null,\n\t\t\t\tindex: number,\n\t\t\t\tunmappedIndex: number\n\t\t\t): void | boolean => {\n\t\t\t\tconst row = rows[index - newRowIndexMappedStart];\n\n\t\t\t\t// Position\n\t\t\t\trow.position.y = index * rowHeight;\n\n\t\t\t\t// State\n\t\t\t\tconst rowState = row.state;\n\t\t\t\trowState.lock();\n\t\t\t\trowState.set(DTableState.SELECTABLE, isRowSelectable);\n\t\t\t\trowState.set(DBaseState.ACTIVE, selection.contains(unmappedIndex));\n\t\t\t\trowState.remove(DBaseState.DISABLED);\n\t\t\t\trowState.unlock();\n\n\t\t\t\t// Data\n\t\t\t\trow.set(datum, supplimental, unmappedIndex, forcibly);\n\t\t\t},\n\t\t\tnewRowIndexMappedStart,\n\t\t\tnewRowIndexMappedStart + rowsLength\n\t\t);\n\n\t\tfor (let i = 0; newRowIndexMappedStart + i < 0 && i < rowsLength; ++i) {\n\t\t\tconst row = rows[i];\n\n\t\t\t// Position\n\t\t\trow.position.y = (newRowIndexMappedStart + i) * rowHeight;\n\n\t\t\t// State\n\t\t\tconst rowState = row.state;\n\t\t\trowState.lock();\n\t\t\trowState.add(DBaseState.DISABLED);\n\t\t\trowState.removeAll(DTableState.SELECTABLE, DBaseState.ACTIVE);\n\t\t\trowState.unlock();\n\n\t\t\t// Data\n\t\t\trow.unset();\n\t\t}\n\n\t\tfor (let i = rowsLength - 1; dataMappedSize <= newRowIndexMappedStart + i && 0 <= i; --i) {\n\t\t\tconst row = rows[i];\n\n\t\t\t// Position\n\t\t\trow.position.y = (newRowIndexMappedStart + i) * rowHeight;\n\n\t\t\t// State\n\t\t\tconst rowState = row.state;\n\t\t\trowState.lock();\n\t\t\trowState.add(DBaseState.DISABLED);\n\t\t\trowState.removeAll(DTableState.SELECTABLE, DBaseState.ACTIVE);\n\t\t\trowState.unlock();\n\n\t\t\t// Data\n\t\t\trow.unset();\n\t\t}\n\n\t\tthis.lock();\n\t\tcontent.position.y = newContentY;\n\t\tcontent.height = newContentHeight;\n\t\tthis.height = newHeight;\n\t\tthis.unlock(false);\n\t\tthis.emit(\"update\", newRowIndexMappedLowerBound, newRowIndexMappedUpperBound, this);\n\t}\n\n\tprotected resetRow(row: DTableBodyRow<ROW>): DTableBodyRow<ROW> {\n\t\trow.blur(true);\n\t\tconst cells = row.children;\n\t\tfor (let i = 0, imax = cells.length; i < imax; ++i) {\n\t\t\tconst cell = cells[i];\n\t\t\tif (cell instanceof DBase) {\n\t\t\t\tcell.state.isPressed = false;\n\t\t\t}\n\t\t}\n\t\treturn row;\n\t}\n\n\tprotected newRow(isEven: boolean): DTableBodyRow<ROW> {\n\t\treturn new DTableBodyRow<ROW>(\n\t\t\tthis._onRowChangeBound,\n\t\t\tisEven,\n\t\t\tthis._columnIndexToCellOptions,\n\t\t\tthis._rowOptions\n\t\t);\n\t}\n\n\tprotected onParentMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tsuper.onParentMove(newX, newY, oldX, oldY);\n\t\tthis.updateFrozenCellPosition(newX);\n\t}\n\n\tprotected updateFrozenCellPosition(x: number): void {\n\t\tconst frozen = this._rowOptions.frozen;\n\t\tif (frozen != null && 0 < frozen) {\n\t\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\t\tfor (let i = 0, imax = rows.length; i < imax; ++i) {\n\t\t\t\trows[i].updateFrozenCellPosition(x);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetClippingRect(target: unknown, result: Rectangle): void {\n\t\tsuper.getClippingRect(target, result);\n\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tconst dy = -parent.transform.position.y;\n\t\t\tresult.y += dy;\n\t\t\tresult.height -= dy;\n\t\t}\n\t}\n\n\t/**\n\t * Scroll to the given row or row index.\n\t *\n\t * @param target a row or an row index to which the body scrolls to.\n\t * @returns true if succeeded\n\t */\n\tscrollTo(target: ROW | number): boolean {\n\t\tconst parent = this.parent;\n\t\tif (parent == null) {\n\t\t\treturn false;\n\t\t}\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent == null) {\n\t\t\treturn false;\n\t\t}\n\t\tlet rowIndexMapped = -1;\n\t\tif (isNumber(target)) {\n\t\t\tif (0 <= target && target < this.data.mapped.size()) {\n\t\t\t\trowIndexMapped = target;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.data.mapped.each((row: ROW, _: unknown, index: number): boolean => {\n\t\t\t\tif (row === target) {\n\t\t\t\t\trowIndexMapped = index;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t\tif (rowIndexMapped < 0) {\n\t\t\treturn false;\n\t\t}\n\t\tparent.position.y = Math.max(\n\t\t\tMath.min(0, parentParent.height - parent.height),\n\t\t\t-rowIndexMapped * this._rowHeight\n\t\t);\n\t\tDApplications.update(this);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns a mapped row index at the given local Y position or -1.\n\t *\n\t * @param localY a local Y position\n\t * @returns a mapped row index at the given local Y position or -1.\n\t */\n\ttoRowIndexMapped(localY: number): number {\n\t\tif (0 <= this.parent.position.y + localY) {\n\t\t\tconst result = Math.floor(localY / this._rowHeight);\n\t\t\tif (0 <= result && result < this._data.mapped.size()) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Returns a row at the given mapped row index or null if not exits.\n\t *\n\t * @param rowIndexMapped a mapped row index\n\t * @returns a row at the given mapped row index or null if not exists.\n\t */\n\ttoRow(rowIndexMapped: number): DTableBodyRow<ROW> | null {\n\t\tconst index = rowIndexMapped - this._rowIndexMappedStart;\n\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\tif (0 <= index && index < rows.length) {\n\t\t\treturn rows[index];\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns a cell at the given local X position or null if not exits.\n\t * This method assumes the given local X position is on the given row.\n\t *\n\t * @param row a row\n\t * @param localX a local X position\n\t * @returns a cell at the given local X position or null if not exits\n\t */\n\ttoCell(row: DTableBodyRow<ROW>, localX: number): DTableBodyCell<ROW, unknown> | null {\n\t\tconst cells = row.children as Array<DTableBodyCell<ROW, unknown>>;\n\t\tconst cellsLength = cells.length;\n\t\tconst columns = this._columns;\n\t\tconst columnsLength = columns.length;\n\t\tfor (let i = 0, imax = Math.min(cellsLength, columnsLength); i < imax; ++i) {\n\t\t\tconst cell = cells[cellsLength - i - 1];\n\t\t\tconst x = localX - cell.position.x;\n\t\t\tif (0 <= x && x <= cell.width) {\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tonRowClick(e: InteractionEvent): void {\n\t\tif (this.state.isActionable) {\n\t\t\tconst local = DTableBody.WORK_ON_CLICK;\n\t\t\tlocal.copyFrom(e.data.global);\n\t\t\tthis.toLocal(local, undefined, local, false);\n\t\t\tconst rowIndexMapped = this.toRowIndexMapped(local.y);\n\t\t\tif (0 <= rowIndexMapped) {\n\t\t\t\t// Delegate to the cell at first\n\t\t\t\tconst row = this.toRow(rowIndexMapped);\n\t\t\t\tif (row) {\n\t\t\t\t\tconst cell = this.toCell(row, local.x);\n\t\t\t\t\tif (cell && cell.onRowSelect && cell.onRowSelect(e, local)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Fallback to the default\n\t\t\t\tthis.onRowSelect(e, rowIndexMapped);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onRowSelect(e: InteractionEvent, rowIndexMapped: number): void {\n\t\tconst data = this._data;\n\t\tconst selection = data.selection;\n\t\tconst isSingle = selection.type === DTableDataSelectionType.SINGLE;\n\t\tconst isNotSingle = !isSingle;\n\t\tconst rowIndex = data.mapped.unmap(rowIndexMapped);\n\t\tconst originalEvent = e.data.originalEvent;\n\t\tconst ctrlKey = originalEvent.ctrlKey;\n\t\tconst shiftKey = originalEvent.shiftKey;\n\t\tif (isSingle || selection.isEmpty() || !(isNotSingle && (ctrlKey || shiftKey))) {\n\t\t\tselection.clearAndAdd(rowIndex);\n\t\t} else if (ctrlKey) {\n\t\t\tselection.toggle(rowIndex);\n\t\t} else if (shiftKey) {\n\t\t\tconst lastRowIndex = selection.last;\n\t\t\tif (lastRowIndex != null) {\n\t\t\t\tconst sorter = data.sorter;\n\t\t\t\tconst filter = data.filter;\n\t\t\t\tconst rowIndexSorted = sorter.map(rowIndex);\n\t\t\t\tconst lastRowIndexSorted = sorter.map(lastRowIndex);\n\t\t\t\tif (rowIndexSorted != null && lastRowIndexSorted != null) {\n\t\t\t\t\tlet istart = lastRowIndexSorted + 1;\n\t\t\t\t\tlet iend = rowIndexSorted + 1;\n\t\t\t\t\tif (rowIndexSorted < lastRowIndexSorted) {\n\t\t\t\t\t\tistart = rowIndexSorted;\n\t\t\t\t\t\tiend = lastRowIndexSorted;\n\t\t\t\t\t}\n\t\t\t\t\tif (istart < iend) {\n\t\t\t\t\t\tconst rowIndices: number[] = [];\n\t\t\t\t\t\tconst indicesFiltered = filter.indices;\n\t\t\t\t\t\tconst indicesSorted = sorter.indices;\n\t\t\t\t\t\tif (indicesFiltered) {\n\t\t\t\t\t\t\tif (indicesSorted) {\n\t\t\t\t\t\t\t\tfor (let i = 0, imax = indicesFiltered.length; i < imax; ++i) {\n\t\t\t\t\t\t\t\t\tconst indexFiltered = indicesFiltered[i];\n\t\t\t\t\t\t\t\t\tif (istart <= indexFiltered && indexFiltered < iend) {\n\t\t\t\t\t\t\t\t\t\trowIndices.push(indicesSorted[indexFiltered]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0, imax = indicesFiltered.length; i < imax; ++i) {\n\t\t\t\t\t\t\t\t\tconst indexFiltered = indicesFiltered[i];\n\t\t\t\t\t\t\t\t\tif (istart <= indexFiltered && indexFiltered < iend) {\n\t\t\t\t\t\t\t\t\t\trowIndices.push(indexFiltered);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (indicesSorted) {\n\t\t\t\t\t\t\t\tfor (let i = istart; i < iend; ++i) {\n\t\t\t\t\t\t\t\t\trowIndices.push(indicesSorted[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = istart; i < iend; ++i) {\n\t\t\t\t\t\t\t\t\trowIndices.push(i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselection.addAll(rowIndices);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonDblClick(e: MouseEvent | TouchEvent, interactionManager: InteractionManager): boolean {\n\t\treturn super.onDblClick(e, interactionManager);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DTableBody\";\n\t}\n\n\tget data(): DATA {\n\t\treturn this._data;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-table-body.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-body.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAwC,KAAK,EAAa,MAAM,SAAS,CAAC;AACjF,OAAO,EAAE,KAAK,EAAyC,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAA+C,MAAM,oBAAoB,CAAC;AAGhG,OAAO,EAAE,cAAc,EAAyB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAuB,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AA6C7D,IAAM,YAAY,GAAG,UACpB,KAAsB,EACtB,OAAqC,EACrC,aAAsC;IAEtC,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IACzB,IAAI,MAAM,IAAI,IAAI,EAAE;QACnB,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;YAC1B,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,YAAY,EAAE,CAAC;SACrC;QACD,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE;YACnC,MAAM,CAAC,SAAS,GAAG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AAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;qCAC/B;iCACD;6BACD;yBACD;6BAAM;4BACN,IAAI,aAAa,EAAE;gCAClB,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;oCACnC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;iCAClC;6BACD;iCAAM;gCACN,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,EAAE;oCACnC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iCACnB;6BACD;yBACD;wBACD,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;qBAC7B;iBACD;aACD;SACD;IACF,CAAC;IAED,+BAAU,GAAV,UAAW,CAA0B,EAAE,kBAAsC;QAC5E,OAAO,iBAAM,UAAU,YAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAChD,CAAC;IAES,4BAAO,GAAjB;QACC,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,sBAAI,4BAAI;aAAR;YACC,OAAO,IAAI,CAAC,KAAK,CAAC;QACnB,CAAC;;;OAAA;IA7fgB,wBAAa,GAAG,IAAI,KAAK,EAAE,CAAC;IA8f9C,iBAAC;CAAA,AApgBD,CAKU,KAAK,GA+fd;SApgBY,UAAU","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InteractionEvent, InteractionManager, Point, Rectangle } from \"pixi.js\";\nimport { DBase, DBaseEvents, DBaseOptions, DThemeBase } from \"./d-base\";\nimport { DBaseState } from \"./d-base-state\";\nimport { DTableBodyRow, DTableBodyRowOnChange, DTableBodyRowOptions } from \"./d-table-body-row\";\nimport { DTableColumn } from \"./d-table-column\";\nimport { DTableData, DTableDataOptions, DTableDataSupplimental } from \"./d-table-data\";\nimport { DTableDataList, DTableDataListOptions } from \"./d-table-data-list\";\nimport { DTableDataSelection, DTableDataSelectionType } from \"./d-table-data-selection\";\nimport { DTableBodyCell } from \"./d-table-body-cell\";\nimport { DTableState } from \"./d-table-state\";\nimport { DTableBodyCellOptions } from \"./d-table-body-cell-options\";\nimport { DOnOptions } from \"./d-on-options\";\nimport { DApplications } from \"./d-applications\";\nimport { isNumber } from \"./util/is-number\";\nimport { DTableColumnUpdate } from \"./d-table-column-update\";\n\n/**\n * {@link DTableBody} events.\n */\nexport interface DTableBodyEvents<EMITTER> extends DBaseEvents<EMITTER> {\n\t/**\n\t * Triggered when rows are updated.\n\t * The first and second parameters are an mapped index range of visible data.\n\t * Please note that these parameters are real numbers.\n\t * For instance, An index range of [0.5, 2.5] means:\n\t *\n\t * * The row at index 0 is partially visible.\n\t * * The row at index 1 is fully visible.\n\t * * The row at index 2 is partially visible.\n\t *\n\t * @param from a lowest mapped index of visible data\n\t * @param to a highest mapped index of vislble data\n\t * @param emitter an emitter\n\t */\n\tupdate(from: number, to: number, emitter: EMITTER): void;\n}\n\n/**\n * {@link DTableBody} \"on\" options.\n */\nexport interface DTableBodyOnOptions<EMITTER>\n\textends Partial<DTableBodyEvents<EMITTER>>,\n\t\tDOnOptions {}\n\nexport interface DTableBodyOptions<\n\tROW,\n\tDATA extends DTableData<ROW> = DTableDataList<ROW>,\n\tTHEME extends DThemeTableBody = DThemeTableBody,\n\tEMITTER = any\n> extends DBaseOptions<THEME, EMITTER> {\n\trow?: DTableBodyRowOptions<ROW>;\n\tdata?: DTableDataListOptions<ROW> | DATA;\n\ton?: DTableBodyOnOptions<EMITTER>;\n}\n\nexport interface DThemeTableBody extends DThemeBase {\n\tgetRowHeight(): number;\n}\n\nconst toRowOptions = <ROW, DATA extends DTableData<ROW>>(\n\ttheme: DThemeTableBody,\n\toptions: DTableBodyOptions<ROW, DATA>,\n\tselectionType: DTableDataSelectionType\n): DTableBodyRowOptions<ROW> => {\n\tlet result = options.row;\n\tif (result != null) {\n\t\tif (result.height == null) {\n\t\t\tresult.height = theme.getRowHeight();\n\t\t}\n\t\tif (result.selection === undefined) {\n\t\t\tresult.selection = {\n\t\t\t\ttype: selectionType\n\t\t\t};\n\t\t} else if (result.selection.type === undefined) {\n\t\t\tresult.selection.type = selectionType;\n\t\t}\n\t} else {\n\t\tresult = {\n\t\t\theight: theme.getRowHeight(),\n\t\t\tselection: {\n\t\t\t\ttype: selectionType\n\t\t\t}\n\t\t};\n\t}\n\treturn result as DTableBodyRowOptions<ROW>;\n};\n\nexport class DTableBody<\n\tROW,\n\tDATA extends DTableData<ROW> = DTableDataList<ROW>,\n\tTHEME extends DThemeTableBody = DThemeTableBody,\n\tOPTIONS extends DTableBodyOptions<ROW, DATA, THEME> = DTableBodyOptions<ROW, DATA, THEME>\n> extends DBase<THEME, OPTIONS> {\n\tprotected static WORK_ON_CLICK = new Point();\n\n\tprotected _columns: DTableColumn<ROW>[];\n\tprotected _frozen: number;\n\tprotected _rowHeight: number;\n\tprotected _rowIndexMappedStart: number;\n\tprotected _rowIndexMappedEnd: number;\n\tprotected _rowOptions: DTableBodyRowOptions<ROW>;\n\tprotected _updateRowsCount: number;\n\tprotected _isUpdateRowsCalled: boolean;\n\tprotected _isUpdateRowsCalledForcibly: boolean;\n\tprotected _workRows: Array<DTableBodyRow<ROW>>;\n\tprotected _onRowChangeBound: DTableBodyRowOnChange<ROW>;\n\tprotected _columnIndexToCellOptions: Map<number, DTableBodyCellOptions<ROW>>;\n\tprotected _data: DATA;\n\n\tconstructor(columns: DTableColumn<ROW>[], frozen: number, offset: number, options: OPTIONS) {\n\t\tsuper(options);\n\n\t\tthis.transform.position.y = offset;\n\t\tconst data = this.toData(options.data);\n\t\tthis._data = data;\n\t\tdata.bind(this);\n\t\tconst theme = this.theme;\n\t\tthis._columns = columns;\n\t\tthis._frozen = frozen;\n\t\tconst rowOptions = toRowOptions(theme, options, data.selection.type);\n\t\tthis._rowOptions = rowOptions;\n\t\tthis._rowHeight = rowOptions.height != null ? rowOptions.height : theme.getRowHeight();\n\t\tthis._rowIndexMappedStart = 0;\n\t\tthis._rowIndexMappedEnd = 0;\n\t\tthis._updateRowsCount = 0;\n\t\tthis._isUpdateRowsCalled = false;\n\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\tthis._workRows = [];\n\t\tthis._onRowChangeBound = (newValue, oldValue, row, rowIndex, columnIndex, column): void => {\n\t\t\tthis.onRowChange(newValue, oldValue, row, rowIndex, columnIndex, column);\n\t\t};\n\t\tthis._columnIndexToCellOptions = new Map<number, DTableBodyCellOptions<ROW>>();\n\t\tthis._data.emit(\"init\", this._data);\n\t}\n\n\tprotected onRowChange(\n\t\tnewValue: unknown,\n\t\toldValue: unknown,\n\t\trow: ROW,\n\t\trowIndex: number,\n\t\tcolumnIndex: number,\n\t\tcolumn: DTableColumn<ROW>\n\t): void {\n\t\tconst data = this._data;\n\t\tdata.emit(\"change\", newValue, oldValue, row, rowIndex, columnIndex, data);\n\t\tif (column.update === DTableColumnUpdate.ALL) {\n\t\t\tthis.update(true);\n\t\t}\n\t}\n\n\tprotected toData(options?: DATA | DTableDataListOptions<ROW>): DATA {\n\t\tif (this.isData(options)) {\n\t\t\treturn options;\n\t\t}\n\t\treturn new DTableDataList<ROW>(options) as any;\n\t}\n\n\tprotected isData(\n\t\ttarget?: ROW[] | DTableDataOptions<ROW> | DTableData<ROW>\n\t): target is DTableData<ROW> {\n\t\treturn target != null && \"mapped\" in target;\n\t}\n\n\tonResize(newWidth: number, newHeight: number, oldWidth: number, oldHeight: number): void {\n\t\tsuper.onResize(newWidth, newHeight, oldWidth, oldHeight);\n\t\tthis.update();\n\t}\n\n\tget selection(): DTableDataSelection<ROW> {\n\t\treturn this._data.selection;\n\t}\n\n\tlock(): void {\n\t\tthis._updateRowsCount += 1;\n\t\tif (this._updateRowsCount === 1) {\n\t\t\tthis._isUpdateRowsCalled = false;\n\t\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\t}\n\t}\n\n\tunlock(callIfNeeded: boolean): void {\n\t\tthis._updateRowsCount -= 1;\n\t\tif (this._updateRowsCount === 0) {\n\t\t\tif (callIfNeeded && this._isUpdateRowsCalled) {\n\t\t\t\tthis.update(this._isUpdateRowsCalledForcibly);\n\t\t\t}\n\t\t\tthis._isUpdateRowsCalled = false;\n\t\t\tthis._isUpdateRowsCalledForcibly = false;\n\t\t}\n\t}\n\n\t/**\n\t * Updates rows. If the `forcibly` is true, some dirty checkings for\n\t * avoiding unnecessary state changes are skipped.\n\t *\n\t * @param forcibly true to update forcibly\n\t */\n\tupdate(forcibly?: boolean): void {\n\t\tif (0 < this._updateRowsCount) {\n\t\t\tthis._isUpdateRowsCalled = true;\n\t\t\tif (forcibly) {\n\t\t\t\tthis._isUpdateRowsCalledForcibly = true;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = this.parent;\n\t\tif (content == null) {\n\t\t\treturn;\n\t\t}\n\t\tconst contentParent = content.parent;\n\t\tif (contentParent == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\tconst height = contentParent.height;\n\t\tconst rowHeight = this._rowHeight;\n\n\t\tconst data = this._data;\n\t\tconst dataMappedSize = data.mapped.size();\n\n\t\tconst oldRowIndexMappedStart = this._rowIndexMappedStart;\n\t\tlet oldRowIndexMappedEnd = this._rowIndexMappedEnd;\n\t\tlet oldRowCount = oldRowIndexMappedEnd - oldRowIndexMappedStart;\n\n\t\tconst y = this.transform.position.y;\n\t\tconst newHeight = y + dataMappedSize * rowHeight;\n\t\tconst newContentHeight = Math.max(height, newHeight);\n\t\tconst newContentY = Math.max(height - newContentHeight, content.position.y);\n\n\t\tconst newRowIndexMappedLowerBound = -newContentY / rowHeight;\n\t\tconst newRowIndexMappedUpperBound = (height - (newContentY + y)) / rowHeight;\n\t\tlet newRowIndexMappedStart = Math.floor(newRowIndexMappedLowerBound);\n\t\tnewRowIndexMappedStart -= newRowIndexMappedStart % 2 === 0 ? 2 : 1;\n\t\tlet newRowIndexMappedEnd = Math.floor(newRowIndexMappedUpperBound);\n\t\tnewRowIndexMappedEnd += (newRowIndexMappedEnd - newRowIndexMappedStart) % 2 === 1 ? 3 : 2;\n\t\tlet newRowCount = newRowIndexMappedEnd - newRowIndexMappedStart;\n\t\tif (newRowCount < oldRowCount) {\n\t\t\tnewRowCount = oldRowCount;\n\t\t\tnewRowIndexMappedEnd = newRowIndexMappedStart + newRowCount;\n\t\t}\n\n\t\tif (oldRowCount < newRowCount) {\n\t\t\tfor (let i = oldRowCount; i < newRowCount; ++i) {\n\t\t\t\tconst oldRowIndexMapped = oldRowIndexMappedStart + i;\n\t\t\t\tconst newRow = this.newRow(oldRowIndexMapped % 2 === 0);\n\t\t\t\tthis.addChild(newRow);\n\t\t\t}\n\t\t\toldRowCount = newRowCount;\n\t\t\toldRowIndexMappedEnd = oldRowIndexMappedStart + oldRowCount;\n\t\t} else if (newRowCount < oldRowCount) {\n\t\t\tfor (let i = oldRowCount - 1; newRowCount <= i; --i) {\n\t\t\t\tthis.removeChild(rows[i]);\n\t\t\t}\n\t\t\toldRowCount = newRowCount;\n\t\t\toldRowIndexMappedEnd = oldRowIndexMappedStart + oldRowCount;\n\t\t}\n\n\t\tthis._rowIndexMappedStart = newRowIndexMappedStart;\n\t\tthis._rowIndexMappedEnd = newRowIndexMappedEnd;\n\n\t\tconst rowIndexMappedStartDelta = newRowIndexMappedStart - oldRowIndexMappedStart;\n\t\tconst rowIndexMappedStartDeltaAbs = Math.abs(rowIndexMappedStartDelta);\n\t\tconst rowsLength = rows.length;\n\t\tif (0 < rowIndexMappedStartDeltaAbs && rowIndexMappedStartDeltaAbs < rowsLength) {\n\t\t\tconst work = this._workRows;\n\t\t\tif (0 < rowIndexMappedStartDelta) {\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\twork.push(this.resetRow(rows[i]));\n\t\t\t\t}\n\t\t\t\tfor (let i = rowIndexMappedStartDeltaAbs; i < rowsLength; ++i) {\n\t\t\t\t\trows[i - rowIndexMappedStartDeltaAbs] = rows[i];\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\trows[rowsLength - rowIndexMappedStartDeltaAbs + i] = work[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\twork.push(this.resetRow(rows[rowsLength - rowIndexMappedStartDeltaAbs + i]));\n\t\t\t\t}\n\t\t\t\tfor (let i = rowsLength - rowIndexMappedStartDeltaAbs - 1; 0 <= i; --i) {\n\t\t\t\t\trows[i + rowIndexMappedStartDeltaAbs] = rows[i];\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < rowIndexMappedStartDeltaAbs; ++i) {\n\t\t\t\t\trows[i] = work[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\twork.length = 0;\n\t\t}\n\n\t\tconst selection = data.selection;\n\t\tconst isRowSelectable = selection.type !== DTableDataSelectionType.NONE;\n\t\tdata.mapped.each(\n\t\t\t(\n\t\t\t\tdatum: ROW,\n\t\t\t\tsupplimental: DTableDataSupplimental | null,\n\t\t\t\tindex: number,\n\t\t\t\tunmappedIndex: number\n\t\t\t): void | boolean => {\n\t\t\t\tconst row = rows[index - newRowIndexMappedStart];\n\n\t\t\t\t// Position\n\t\t\t\trow.position.y = index * rowHeight;\n\n\t\t\t\t// State\n\t\t\t\tconst rowState = row.state;\n\t\t\t\trowState.lock();\n\t\t\t\trowState.set(DTableState.SELECTABLE, isRowSelectable);\n\t\t\t\trowState.set(DBaseState.ACTIVE, selection.contains(unmappedIndex));\n\t\t\t\trowState.remove(DBaseState.DISABLED);\n\t\t\t\trowState.unlock();\n\n\t\t\t\t// Data\n\t\t\t\trow.set(datum, supplimental, unmappedIndex, forcibly);\n\t\t\t},\n\t\t\tnewRowIndexMappedStart,\n\t\t\tnewRowIndexMappedStart + rowsLength\n\t\t);\n\n\t\tfor (let i = 0; newRowIndexMappedStart + i < 0 && i < rowsLength; ++i) {\n\t\t\tconst row = rows[i];\n\n\t\t\t// Position\n\t\t\trow.position.y = (newRowIndexMappedStart + i) * rowHeight;\n\n\t\t\t// State\n\t\t\tconst rowState = row.state;\n\t\t\trowState.lock();\n\t\t\trowState.add(DBaseState.DISABLED);\n\t\t\trowState.removeAll(DTableState.SELECTABLE, DBaseState.ACTIVE);\n\t\t\trowState.unlock();\n\n\t\t\t// Data\n\t\t\trow.unset();\n\t\t}\n\n\t\tfor (let i = rowsLength - 1; dataMappedSize <= newRowIndexMappedStart + i && 0 <= i; --i) {\n\t\t\tconst row = rows[i];\n\n\t\t\t// Position\n\t\t\trow.position.y = (newRowIndexMappedStart + i) * rowHeight;\n\n\t\t\t// State\n\t\t\tconst rowState = row.state;\n\t\t\trowState.lock();\n\t\t\trowState.add(DBaseState.DISABLED);\n\t\t\trowState.removeAll(DTableState.SELECTABLE, DBaseState.ACTIVE);\n\t\t\trowState.unlock();\n\n\t\t\t// Data\n\t\t\trow.unset();\n\t\t}\n\n\t\tthis.lock();\n\t\tcontent.position.y = newContentY;\n\t\tcontent.height = newContentHeight;\n\t\tthis.height = newHeight;\n\t\tthis.unlock(false);\n\t\tthis.emit(\"update\", newRowIndexMappedLowerBound, newRowIndexMappedUpperBound, this);\n\t}\n\n\tprotected resetRow(row: DTableBodyRow<ROW>): DTableBodyRow<ROW> {\n\t\trow.blur(true);\n\t\tconst cells = row.children;\n\t\tfor (let i = 0, imax = cells.length; i < imax; ++i) {\n\t\t\tconst cell = cells[i];\n\t\t\tif (cell instanceof DBase) {\n\t\t\t\tcell.state.isPressed = false;\n\t\t\t}\n\t\t}\n\t\treturn row;\n\t}\n\n\tprotected newRow(isEven: boolean): DTableBodyRow<ROW> {\n\t\treturn new DTableBodyRow<ROW>(\n\t\t\tthis._onRowChangeBound,\n\t\t\tisEven,\n\t\t\tthis._columnIndexToCellOptions,\n\t\t\tthis._columns,\n\t\t\tthis._frozen,\n\t\t\tthis._rowOptions\n\t\t);\n\t}\n\n\tprotected onParentMove(newX: number, newY: number, oldX: number, oldY: number): void {\n\t\tsuper.onParentMove(newX, newY, oldX, oldY);\n\t\tthis.updateFrozenCellPosition(newX);\n\t}\n\n\tprotected updateFrozenCellPosition(x: number): void {\n\t\tconst frozen = this._frozen;\n\t\tif (frozen != null && 0 < frozen) {\n\t\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\t\tfor (let i = 0, imax = rows.length; i < imax; ++i) {\n\t\t\t\trows[i].updateFrozenCellPosition(x);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetClippingRect(target: unknown, result: Rectangle): void {\n\t\tsuper.getClippingRect(target, result);\n\n\t\tconst parent = this.parent;\n\t\tif (parent) {\n\t\t\tconst dy = -parent.transform.position.y;\n\t\t\tresult.y += dy;\n\t\t\tresult.height -= dy;\n\t\t}\n\t}\n\n\t/**\n\t * Scroll to the given row or row index.\n\t *\n\t * @param target a row or an row index to which the body scrolls to.\n\t * @returns true if succeeded\n\t */\n\tscrollTo(target: ROW | number): boolean {\n\t\tconst parent = this.parent;\n\t\tif (parent == null) {\n\t\t\treturn false;\n\t\t}\n\t\tconst parentParent = parent.parent;\n\t\tif (parentParent == null) {\n\t\t\treturn false;\n\t\t}\n\t\tlet rowIndexMapped = -1;\n\t\tif (isNumber(target)) {\n\t\t\tif (0 <= target && target < this.data.mapped.size()) {\n\t\t\t\trowIndexMapped = target;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.data.mapped.each((row: ROW, _: unknown, index: number): boolean => {\n\t\t\t\tif (row === target) {\n\t\t\t\t\trowIndexMapped = index;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\t\t}\n\t\tif (rowIndexMapped < 0) {\n\t\t\treturn false;\n\t\t}\n\t\tparent.position.y = Math.max(\n\t\t\tMath.min(0, parentParent.height - parent.height),\n\t\t\t-rowIndexMapped * this._rowHeight\n\t\t);\n\t\tDApplications.update(this);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns a mapped row index at the given local Y position or -1.\n\t *\n\t * @param localY a local Y position\n\t * @returns a mapped row index at the given local Y position or -1.\n\t */\n\ttoRowIndexMapped(localY: number): number {\n\t\tif (0 <= this.parent.position.y + localY) {\n\t\t\tconst result = Math.floor(localY / this._rowHeight);\n\t\t\tif (0 <= result && result < this._data.mapped.size()) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\n\t/**\n\t * Returns a row at the given mapped row index or null if not exits.\n\t *\n\t * @param rowIndexMapped a mapped row index\n\t * @returns a row at the given mapped row index or null if not exists.\n\t */\n\ttoRow(rowIndexMapped: number): DTableBodyRow<ROW> | null {\n\t\tconst index = rowIndexMapped - this._rowIndexMappedStart;\n\t\tconst rows = this.children as Array<DTableBodyRow<ROW>>;\n\t\tif (0 <= index && index < rows.length) {\n\t\t\treturn rows[index];\n\t\t}\n\t\treturn null;\n\t}\n\n\t/**\n\t * Returns a cell at the given local X position or null if not exits.\n\t * This method assumes the given local X position is on the given row.\n\t *\n\t * @param row a row\n\t * @param localX a local X position\n\t * @returns a cell at the given local X position or null if not exits\n\t */\n\ttoCell(row: DTableBodyRow<ROW>, localX: number): DTableBodyCell<ROW, unknown> | null {\n\t\tconst cells = row.children as Array<DTableBodyCell<ROW, unknown>>;\n\t\tconst cellsLength = cells.length;\n\t\tconst columns = this._columns;\n\t\tconst columnsLength = columns.length;\n\t\tfor (let i = 0, imax = Math.min(cellsLength, columnsLength); i < imax; ++i) {\n\t\t\tconst cell = cells[cellsLength - i - 1];\n\t\t\tconst x = localX - cell.position.x;\n\t\t\tif (0 <= x && x <= cell.width) {\n\t\t\t\treturn cell;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tonRowClick(e: InteractionEvent): void {\n\t\tif (this.state.isActionable) {\n\t\t\tconst local = DTableBody.WORK_ON_CLICK;\n\t\t\tlocal.copyFrom(e.data.global);\n\t\t\tthis.toLocal(local, undefined, local, false);\n\t\t\tconst rowIndexMapped = this.toRowIndexMapped(local.y);\n\t\t\tif (0 <= rowIndexMapped) {\n\t\t\t\t// Delegate to the cell at first\n\t\t\t\tconst row = this.toRow(rowIndexMapped);\n\t\t\t\tif (row) {\n\t\t\t\t\tconst cell = this.toCell(row, local.x);\n\t\t\t\t\tif (cell && cell.onRowSelect && cell.onRowSelect(e, local)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Fallback to the default\n\t\t\t\tthis.onRowSelect(e, rowIndexMapped);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected onRowSelect(e: InteractionEvent, rowIndexMapped: number): void {\n\t\tconst data = this._data;\n\t\tconst selection = data.selection;\n\t\tconst isSingle = selection.type === DTableDataSelectionType.SINGLE;\n\t\tconst isNotSingle = !isSingle;\n\t\tconst rowIndex = data.mapped.unmap(rowIndexMapped);\n\t\tconst originalEvent = e.data.originalEvent;\n\t\tconst ctrlKey = originalEvent.ctrlKey;\n\t\tconst shiftKey = originalEvent.shiftKey;\n\t\tif (isSingle || selection.isEmpty() || !(isNotSingle && (ctrlKey || shiftKey))) {\n\t\t\tselection.clearAndAdd(rowIndex);\n\t\t} else if (ctrlKey) {\n\t\t\tselection.toggle(rowIndex);\n\t\t} else if (shiftKey) {\n\t\t\tconst lastRowIndex = selection.last;\n\t\t\tif (lastRowIndex != null) {\n\t\t\t\tconst sorter = data.sorter;\n\t\t\t\tconst filter = data.filter;\n\t\t\t\tconst rowIndexSorted = sorter.map(rowIndex);\n\t\t\t\tconst lastRowIndexSorted = sorter.map(lastRowIndex);\n\t\t\t\tif (rowIndexSorted != null && lastRowIndexSorted != null) {\n\t\t\t\t\tlet istart = lastRowIndexSorted + 1;\n\t\t\t\t\tlet iend = rowIndexSorted + 1;\n\t\t\t\t\tif (rowIndexSorted < lastRowIndexSorted) {\n\t\t\t\t\t\tistart = rowIndexSorted;\n\t\t\t\t\t\tiend = lastRowIndexSorted;\n\t\t\t\t\t}\n\t\t\t\t\tif (istart < iend) {\n\t\t\t\t\t\tconst rowIndices: number[] = [];\n\t\t\t\t\t\tconst indicesFiltered = filter.indices;\n\t\t\t\t\t\tconst indicesSorted = sorter.indices;\n\t\t\t\t\t\tif (indicesFiltered) {\n\t\t\t\t\t\t\tif (indicesSorted) {\n\t\t\t\t\t\t\t\tfor (let i = 0, imax = indicesFiltered.length; i < imax; ++i) {\n\t\t\t\t\t\t\t\t\tconst indexFiltered = indicesFiltered[i];\n\t\t\t\t\t\t\t\t\tif (istart <= indexFiltered && indexFiltered < iend) {\n\t\t\t\t\t\t\t\t\t\trowIndices.push(indicesSorted[indexFiltered]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0, imax = indicesFiltered.length; i < imax; ++i) {\n\t\t\t\t\t\t\t\t\tconst indexFiltered = indicesFiltered[i];\n\t\t\t\t\t\t\t\t\tif (istart <= indexFiltered && indexFiltered < iend) {\n\t\t\t\t\t\t\t\t\t\trowIndices.push(indexFiltered);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (indicesSorted) {\n\t\t\t\t\t\t\t\tfor (let i = istart; i < iend; ++i) {\n\t\t\t\t\t\t\t\t\trowIndices.push(indicesSorted[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = istart; i < iend; ++i) {\n\t\t\t\t\t\t\t\t\trowIndices.push(i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tselection.addAll(rowIndices);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonDblClick(e: MouseEvent | TouchEvent, interactionManager: InteractionManager): boolean {\n\t\treturn super.onDblClick(e, interactionManager);\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DTableBody\";\n\t}\n\n\tget data(): DATA {\n\t\treturn this._data;\n\t}\n}\n"]}
|
|
@@ -3,12 +3,254 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { __extends } from "tslib";
|
|
6
|
+
import { Point } from "pixi.js";
|
|
6
7
|
import { DImage } from "./d-image";
|
|
8
|
+
import { DTableState } from "./d-table-state";
|
|
9
|
+
import { DApplications } from "./d-applications";
|
|
10
|
+
import { UtilPointerEvent } from "./util/util-pointer-event";
|
|
11
|
+
export var DTableCategoryCellEdge = {
|
|
12
|
+
NONE: 0,
|
|
13
|
+
LEFT: 1,
|
|
14
|
+
RIGHT: 2,
|
|
15
|
+
BOTH: 3
|
|
16
|
+
};
|
|
7
17
|
var DTableCategoryCell = /** @class */ (function (_super) {
|
|
8
18
|
__extends(DTableCategoryCell, _super);
|
|
9
|
-
function DTableCategoryCell() {
|
|
10
|
-
|
|
19
|
+
function DTableCategoryCell(category, columnIndex, column, options) {
|
|
20
|
+
var _this = _super.call(this, options) || this;
|
|
21
|
+
_this._category = category;
|
|
22
|
+
_this._columnIndex = columnIndex;
|
|
23
|
+
_this._column = column;
|
|
24
|
+
_this._edgeSize = _this.theme.getEdgeWidth();
|
|
25
|
+
_this._wasResizing = false;
|
|
26
|
+
return _this;
|
|
11
27
|
}
|
|
28
|
+
Object.defineProperty(DTableCategoryCell.prototype, "column", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this._column;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(DTableCategoryCell.prototype, "columnIndex", {
|
|
36
|
+
get: function () {
|
|
37
|
+
return this._columnIndex;
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(DTableCategoryCell.prototype, "category", {
|
|
43
|
+
get: function () {
|
|
44
|
+
return this._category;
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
DTableCategoryCell.prototype.onDown = function (e) {
|
|
50
|
+
var edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);
|
|
51
|
+
if (edges != null) {
|
|
52
|
+
this._wasResizing = true;
|
|
53
|
+
var layer = DApplications.getLayer(this);
|
|
54
|
+
if (layer != null) {
|
|
55
|
+
var interactionManager = layer.renderer.plugins.interaction;
|
|
56
|
+
var columnIndex = this._columnIndex;
|
|
57
|
+
if (edges === DTableCategoryCellEdge.LEFT) {
|
|
58
|
+
this.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.onDownEdge(e.data.global.x, columnIndex, interactionManager);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this._wasResizing = false;
|
|
67
|
+
_super.prototype.onDown.call(this, e);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
DTableCategoryCell.prototype.findLeftResizableCell = function (columnIndex) {
|
|
71
|
+
var children = this._category.children;
|
|
72
|
+
var childrenLength = children.length;
|
|
73
|
+
for (var i = columnIndex; 0 <= i; --i) {
|
|
74
|
+
var child = children[childrenLength - i - 1];
|
|
75
|
+
if (child.column.resizable) {
|
|
76
|
+
return child;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
};
|
|
81
|
+
DTableCategoryCell.prototype.findRightResizableCellOfWeight = function (columnIndex) {
|
|
82
|
+
var children = this._category.children;
|
|
83
|
+
var childrenLength = children.length;
|
|
84
|
+
for (var i = columnIndex + 1; i < childrenLength; ++i) {
|
|
85
|
+
var child = children[childrenLength - i - 1];
|
|
86
|
+
var childColumn = child.column;
|
|
87
|
+
if (childColumn.resizable) {
|
|
88
|
+
var childColumnWeight = childColumn.weight;
|
|
89
|
+
if (childColumnWeight != null) {
|
|
90
|
+
return child;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
DTableCategoryCell.prototype.checkIfEdgeResizable = function (columnIndex) {
|
|
97
|
+
var target = this.findLeftResizableCell(columnIndex);
|
|
98
|
+
if (target != null) {
|
|
99
|
+
if (target.column.weight != null) {
|
|
100
|
+
return this.findRightResizableCellOfWeight(target.columnIndex) != null;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
107
|
+
};
|
|
108
|
+
DTableCategoryCell.prototype.getResizableEdges = function () {
|
|
109
|
+
var result = this._resizableEdges;
|
|
110
|
+
if (result == null) {
|
|
111
|
+
var columnIndex = this._columnIndex;
|
|
112
|
+
if (this.checkIfEdgeResizable(columnIndex - 1)) {
|
|
113
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
114
|
+
result = DTableCategoryCellEdge.BOTH;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
result = DTableCategoryCellEdge.LEFT;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
if (this.checkIfEdgeResizable(columnIndex)) {
|
|
122
|
+
result = DTableCategoryCellEdge.RIGHT;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
result = DTableCategoryCellEdge.NONE;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
this._resizableEdges = result;
|
|
129
|
+
}
|
|
130
|
+
return result;
|
|
131
|
+
};
|
|
132
|
+
DTableCategoryCell.prototype.onOver = function (e) {
|
|
133
|
+
var _this = this;
|
|
134
|
+
var _a;
|
|
135
|
+
_super.prototype.onOver.call(this, e);
|
|
136
|
+
if (this.getResizableEdges() !== DTableCategoryCellEdge.NONE) {
|
|
137
|
+
var onHoveredBound = ((_a = this._onHoveredBound) !== null && _a !== void 0 ? _a : (this._onHoveredBound = function (event) {
|
|
138
|
+
_this.onHovered(event);
|
|
139
|
+
}));
|
|
140
|
+
this.on(UtilPointerEvent.move, onHoveredBound);
|
|
141
|
+
// Since the cursor is set by InteractionManager before this method is called,
|
|
142
|
+
// the cursor need to be overriden.
|
|
143
|
+
this.onHovered(e);
|
|
144
|
+
var layer = DApplications.getLayer(this);
|
|
145
|
+
if (layer != null) {
|
|
146
|
+
layer.renderer.plugins.interaction.cursor = this.cursor;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
DTableCategoryCell.prototype.onOut = function (e) {
|
|
151
|
+
_super.prototype.onOut.call(this, e);
|
|
152
|
+
var onHoveredBound = this._onHoveredBound;
|
|
153
|
+
if (onHoveredBound != null) {
|
|
154
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
155
|
+
this.off(UtilPointerEvent.move, onHoveredBound);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
DTableCategoryCell.prototype.onHovered = function (e) {
|
|
159
|
+
var width = this.width;
|
|
160
|
+
var x = this.toClickPosition(e);
|
|
161
|
+
var edgeSize = this._edgeSize;
|
|
162
|
+
if (0 <= x && x <= edgeSize) {
|
|
163
|
+
if (this.getResizableEdges() & DTableCategoryCellEdge.LEFT) {
|
|
164
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.LEFT);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (width - edgeSize <= x && x <= width) {
|
|
171
|
+
if (this.getResizableEdges() & DTableCategoryCellEdge.RIGHT) {
|
|
172
|
+
this.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.RIGHT);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
this.state.remove(DTableState.HOVERED_ON_EDGE);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
DTableCategoryCell.prototype.toClickPosition = function (e) {
|
|
183
|
+
var _a;
|
|
184
|
+
var checkWork = ((_a = this._checkWork) !== null && _a !== void 0 ? _a : (this._checkWork = new Point()));
|
|
185
|
+
return e.data.getLocalPosition(this, checkWork).x;
|
|
186
|
+
};
|
|
187
|
+
DTableCategoryCell.prototype.onDownEdge = function (onDownPoint, columnIndex, interactionManager) {
|
|
188
|
+
// Find the resizable cell
|
|
189
|
+
var left = this.findLeftResizableCell(columnIndex);
|
|
190
|
+
if (left == null) {
|
|
191
|
+
// No resizable cell
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
var category = this._category;
|
|
195
|
+
var leftColumn = left.column;
|
|
196
|
+
var leftOldWidth = left.width;
|
|
197
|
+
var leftOldWeight = left.weight;
|
|
198
|
+
if (leftColumn.weight == null) {
|
|
199
|
+
category.state.add(DTableState.RESIZING);
|
|
200
|
+
var leftMinWidth_1 = leftColumn.minWidth;
|
|
201
|
+
var onMove_1 = function (e) {
|
|
202
|
+
leftColumn.width = Math.max(leftMinWidth_1, leftOldWidth + e.data.global.x - onDownPoint);
|
|
203
|
+
};
|
|
204
|
+
var onUp_1 = function (e) {
|
|
205
|
+
category.state.remove(DTableState.RESIZING);
|
|
206
|
+
interactionManager.off(UtilPointerEvent.move, onMove_1);
|
|
207
|
+
interactionManager.off(UtilPointerEvent.up, onUp_1);
|
|
208
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_1);
|
|
209
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_1);
|
|
210
|
+
};
|
|
211
|
+
interactionManager.on(UtilPointerEvent.move, onMove_1);
|
|
212
|
+
interactionManager.on(UtilPointerEvent.up, onUp_1);
|
|
213
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_1);
|
|
214
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_1);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
var right = this.findRightResizableCellOfWeight(left.columnIndex);
|
|
218
|
+
if (right == null) {
|
|
219
|
+
// No right resizable cell found
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
var rightColumn_1 = right.column;
|
|
223
|
+
var rightOldWeight = right.weight;
|
|
224
|
+
var rightOldWidth = right.width;
|
|
225
|
+
var totalWidth_1 = leftOldWidth + rightOldWidth;
|
|
226
|
+
var totalWeight_1 = leftOldWeight + rightOldWeight;
|
|
227
|
+
var leftMinWeight_1 = leftColumn.minWeight;
|
|
228
|
+
var rightMinWeight = rightColumn_1.minWeight;
|
|
229
|
+
var leftMaxWeight_1 = totalWeight_1 - rightMinWeight;
|
|
230
|
+
if (totalWidth_1 <= 0 || leftMaxWeight_1 <= leftMinWeight_1) {
|
|
231
|
+
// The left and right resizable cells doesn't non-zero width
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
category.state.add(DTableState.RESIZING);
|
|
235
|
+
var onMove_2 = function (e) {
|
|
236
|
+
var leftNewWidth = Math.max(0, Math.min(totalWidth_1, leftOldWidth + e.data.global.x - onDownPoint));
|
|
237
|
+
var leftNewWeight = Math.max(leftMinWeight_1, Math.min(leftMaxWeight_1, totalWeight_1 * (leftNewWidth / totalWidth_1)));
|
|
238
|
+
leftColumn.weight = leftNewWeight;
|
|
239
|
+
rightColumn_1.weight = totalWeight_1 - leftNewWeight;
|
|
240
|
+
};
|
|
241
|
+
var onUp_2 = function (e) {
|
|
242
|
+
category.state.remove(DTableState.RESIZING);
|
|
243
|
+
interactionManager.off(UtilPointerEvent.move, onMove_2);
|
|
244
|
+
interactionManager.off(UtilPointerEvent.up, onUp_2);
|
|
245
|
+
interactionManager.off(UtilPointerEvent.upoutside, onUp_2);
|
|
246
|
+
interactionManager.off(UtilPointerEvent.cancel, onUp_2);
|
|
247
|
+
};
|
|
248
|
+
interactionManager.on(UtilPointerEvent.move, onMove_2);
|
|
249
|
+
interactionManager.on(UtilPointerEvent.up, onUp_2);
|
|
250
|
+
interactionManager.on(UtilPointerEvent.upoutside, onUp_2);
|
|
251
|
+
interactionManager.on(UtilPointerEvent.cancel, onUp_2);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
12
254
|
DTableCategoryCell.prototype.getType = function () {
|
|
13
255
|
return "DTableCategoryCell";
|
|
14
256
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d-table-category-cell.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-category-cell.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAAE,MAAM,EAA8B,MAAM,WAAW,CAAC;AAQ/D;IAGU,sCAAqC;IAH/C;;IAOA,CAAC;IAHU,oCAAO,GAAjB;QACC,OAAO,oBAAoB,CAAC;IAC7B,CAAC;IACF,yBAAC;AAAD,CAAC,AAPD,CAGU,MAAM,GAIf","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DImage, DImageOptions, DThemeImage } from \"./d-image\";\n\nexport interface DTableCategoryCellOptions<\n\tTHEME extends DThemeTableCategoryCell = DThemeTableCategoryCell\n> extends DImageOptions<string | null, THEME> {}\n\nexport interface DThemeTableCategoryCell extends DThemeImage<string | null> {}\n\nexport class DTableCategoryCell<\n\tTHEME extends DThemeTableCategoryCell = DThemeTableCategoryCell,\n\tOPTIONS extends DTableCategoryCellOptions<THEME> = DTableCategoryCellOptions<THEME>\n> extends DImage<string | null, THEME, OPTIONS> {\n\tprotected getType(): string {\n\t\treturn \"DTableCategoryCell\";\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"d-table-category-cell.js","sourceRoot":"","sources":["../../../src/main/typescript/wcardinal/ui/d-table-category-cell.ts"],"names":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corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InteractionEvent, InteractionManager, Point } from \"pixi.js\";\nimport { DImage, DImageOptions, DThemeImage } from \"./d-image\";\nimport { DTableCategoryColumn } from \"./d-table-category-column\";\nimport { DTableState } from \"./d-table-state\";\nimport { DApplications } from \"./d-applications\";\nimport { DBaseStateSet } from \"./d-base-state-set\";\nimport { UtilPointerEvent } from \"./util/util-pointer-event\";\n\nexport interface DTableCategoryCellCategory {\n\treadonly children: DTableCategoryCell[];\n\treadonly state: DBaseStateSet;\n}\n\nexport interface DTableCategoryCellOptions<\n\tTHEME extends DThemeTableCategoryCell = DThemeTableCategoryCell\n> extends DImageOptions<string | null, THEME> {}\n\nexport interface DThemeTableCategoryCell extends DThemeImage<string | null> {\n\tgetEdgeWidth(): number;\n}\n\nexport const DTableCategoryCellEdge = {\n\tNONE: 0,\n\tLEFT: 1,\n\tRIGHT: 2,\n\tBOTH: 3\n} as const;\n\nexport type DTableCategoryCellEdge =\n\t(typeof DTableCategoryCellEdge)[keyof typeof DTableCategoryCellEdge];\n\nexport class DTableCategoryCell<\n\tTHEME extends DThemeTableCategoryCell = DThemeTableCategoryCell,\n\tOPTIONS extends DTableCategoryCellOptions<THEME> = DTableCategoryCellOptions<THEME>\n> extends DImage<string | null, THEME, OPTIONS> {\n\tprotected _category: DTableCategoryCellCategory;\n\tprotected _column: DTableCategoryColumn;\n\tprotected _columnIndex: number;\n\n\tprotected _checkWork?: Point;\n\tprotected _onHoveredBound?: (e: InteractionEvent) => void;\n\tprotected _resizableEdges?: DTableCategoryCellEdge;\n\tprotected _edgeSize: number;\n\tprotected _wasResizing: boolean;\n\n\tconstructor(\n\t\tcategory: DTableCategoryCellCategory,\n\t\tcolumnIndex: number,\n\t\tcolumn: DTableCategoryColumn,\n\t\toptions?: OPTIONS\n\t) {\n\t\tsuper(options);\n\n\t\tthis._category = category;\n\t\tthis._columnIndex = columnIndex;\n\t\tthis._column = column;\n\t\tthis._edgeSize = this.theme.getEdgeWidth();\n\t\tthis._wasResizing = false;\n\t}\n\n\tget column(): DTableCategoryColumn {\n\t\treturn this._column;\n\t}\n\n\tget columnIndex(): number {\n\t\treturn this._columnIndex;\n\t}\n\n\tget category(): DTableCategoryCellCategory {\n\t\treturn this._category;\n\t}\n\n\tprotected override onDown(e: InteractionEvent): void {\n\t\tconst edges = this.state.valueOf(DTableState.HOVERED_ON_EDGE);\n\t\tif (edges != null) {\n\t\t\tthis._wasResizing = true;\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer != null) {\n\t\t\t\tconst interactionManager = layer.renderer.plugins.interaction;\n\t\t\t\tconst columnIndex = this._columnIndex;\n\t\t\t\tif (edges === DTableCategoryCellEdge.LEFT) {\n\t\t\t\t\tthis.onDownEdge(e.data.global.x, columnIndex - 1, interactionManager);\n\t\t\t\t} else {\n\t\t\t\t\tthis.onDownEdge(e.data.global.x, columnIndex, interactionManager);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis._wasResizing = false;\n\t\t\tsuper.onDown(e);\n\t\t}\n\t}\n\n\tprotected findLeftResizableCell(columnIndex: number): DTableCategoryCell | null {\n\t\tconst children = this._category.children;\n\t\tconst childrenLength = children.length;\n\t\tfor (let i = columnIndex; 0 <= i; --i) {\n\t\t\tconst child = children[childrenLength - i - 1];\n\t\t\tif (child.column.resizable) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected findRightResizableCellOfWeight(columnIndex: number): DTableCategoryCell | null {\n\t\tconst children = this._category.children;\n\t\tconst childrenLength = children.length;\n\t\tfor (let i = columnIndex + 1; i < childrenLength; ++i) {\n\t\t\tconst child = children[childrenLength - i - 1];\n\t\t\tconst childColumn = child.column;\n\t\t\tif (childColumn.resizable) {\n\t\t\t\tconst childColumnWeight = childColumn.weight;\n\t\t\t\tif (childColumnWeight != null) {\n\t\t\t\t\treturn child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprotected checkIfEdgeResizable(columnIndex: number): boolean {\n\t\tconst target = this.findLeftResizableCell(columnIndex);\n\t\tif (target != null) {\n\t\t\tif (target.column.weight != null) {\n\t\t\t\treturn this.findRightResizableCellOfWeight(target.columnIndex) != null;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tprotected getResizableEdges(): DTableCategoryCellEdge {\n\t\tlet result = this._resizableEdges;\n\t\tif (result == null) {\n\t\t\tconst columnIndex = this._columnIndex;\n\t\t\tif (this.checkIfEdgeResizable(columnIndex - 1)) {\n\t\t\t\tif (this.checkIfEdgeResizable(columnIndex)) {\n\t\t\t\t\tresult = DTableCategoryCellEdge.BOTH;\n\t\t\t\t} else {\n\t\t\t\t\tresult = DTableCategoryCellEdge.LEFT;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.checkIfEdgeResizable(columnIndex)) {\n\t\t\t\t\tresult = DTableCategoryCellEdge.RIGHT;\n\t\t\t\t} else {\n\t\t\t\t\tresult = DTableCategoryCellEdge.NONE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._resizableEdges = result;\n\t\t}\n\t\treturn result;\n\t}\n\n\tprotected override onOver(e: InteractionEvent): void {\n\t\tsuper.onOver(e);\n\n\t\tif (this.getResizableEdges() !== DTableCategoryCellEdge.NONE) {\n\t\t\tconst onHoveredBound = (this._onHoveredBound ??= (event: InteractionEvent): void => {\n\t\t\t\tthis.onHovered(event);\n\t\t\t});\n\t\t\tthis.on(UtilPointerEvent.move, onHoveredBound);\n\n\t\t\t// Since the cursor is set by InteractionManager before this method is called,\n\t\t\t// the cursor need to be overriden.\n\t\t\tthis.onHovered(e);\n\t\t\tconst layer = DApplications.getLayer(this);\n\t\t\tif (layer != null) {\n\t\t\t\tlayer.renderer.plugins.interaction.cursor = this.cursor;\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected override onOut(e: InteractionEvent): void {\n\t\tsuper.onOut(e);\n\n\t\tconst onHoveredBound = this._onHoveredBound;\n\t\tif (onHoveredBound != null) {\n\t\t\tthis.state.remove(DTableState.HOVERED_ON_EDGE);\n\t\t\tthis.off(UtilPointerEvent.move, onHoveredBound);\n\t\t}\n\t}\n\n\tprotected onHovered(e: InteractionEvent): void {\n\t\tconst width = this.width;\n\t\tconst x = this.toClickPosition(e);\n\t\tconst edgeSize = this._edgeSize;\n\t\tif (0 <= x && x <= edgeSize) {\n\t\t\tif (this.getResizableEdges() & DTableCategoryCellEdge.LEFT) {\n\t\t\t\tthis.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.LEFT);\n\t\t\t} else {\n\t\t\t\tthis.state.remove(DTableState.HOVERED_ON_EDGE);\n\t\t\t}\n\t\t} else if (width - edgeSize <= x && x <= width) {\n\t\t\tif (this.getResizableEdges() & DTableCategoryCellEdge.RIGHT) {\n\t\t\t\tthis.state.add(DTableState.HOVERED_ON_EDGE, DTableCategoryCellEdge.RIGHT);\n\t\t\t} else {\n\t\t\t\tthis.state.remove(DTableState.HOVERED_ON_EDGE);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.state.remove(DTableState.HOVERED_ON_EDGE);\n\t\t}\n\t}\n\n\tprotected toClickPosition(e: InteractionEvent): number {\n\t\tconst checkWork = (this._checkWork ??= new Point());\n\t\treturn e.data.getLocalPosition(this, checkWork).x;\n\t}\n\n\tprotected onDownEdge(\n\t\tonDownPoint: number,\n\t\tcolumnIndex: number,\n\t\tinteractionManager: InteractionManager\n\t): void {\n\t\t// Find the resizable cell\n\t\tconst left = this.findLeftResizableCell(columnIndex);\n\t\tif (left == null) {\n\t\t\t// No resizable cell\n\t\t\treturn;\n\t\t}\n\n\t\tconst category = this._category;\n\t\tconst leftColumn = left.column;\n\t\tconst leftOldWidth = left.width;\n\t\tconst leftOldWeight = left.weight;\n\t\tif (leftColumn.weight == null) {\n\t\t\tcategory.state.add(DTableState.RESIZING);\n\t\t\tconst leftMinWidth = leftColumn.minWidth;\n\t\t\tconst onMove = (e: InteractionEvent): void => {\n\t\t\t\tleftColumn.width = Math.max(\n\t\t\t\t\tleftMinWidth,\n\t\t\t\t\tleftOldWidth + e.data.global.x - onDownPoint\n\t\t\t\t);\n\t\t\t};\n\t\t\tconst onUp = (e: InteractionEvent) => {\n\t\t\t\tcategory.state.remove(DTableState.RESIZING);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.move, onMove);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.up, onUp);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.upoutside, onUp);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.cancel, onUp);\n\t\t\t};\n\t\t\tinteractionManager.on(UtilPointerEvent.move, onMove);\n\t\t\tinteractionManager.on(UtilPointerEvent.up, onUp);\n\t\t\tinteractionManager.on(UtilPointerEvent.upoutside, onUp);\n\t\t\tinteractionManager.on(UtilPointerEvent.cancel, onUp);\n\t\t} else {\n\t\t\tconst right = this.findRightResizableCellOfWeight(left.columnIndex);\n\t\t\tif (right == null) {\n\t\t\t\t// No right resizable cell found\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst rightColumn = right.column;\n\t\t\tconst rightOldWeight = right.weight;\n\t\t\tconst rightOldWidth = right.width;\n\t\t\tconst totalWidth = leftOldWidth + rightOldWidth;\n\t\t\tconst totalWeight = leftOldWeight + rightOldWeight;\n\t\t\tconst leftMinWeight = leftColumn.minWeight;\n\t\t\tconst rightMinWeight = rightColumn.minWeight;\n\t\t\tconst leftMaxWeight = totalWeight - rightMinWeight;\n\t\t\tif (totalWidth <= 0 || leftMaxWeight <= leftMinWeight) {\n\t\t\t\t// The left and right resizable cells doesn't non-zero width\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcategory.state.add(DTableState.RESIZING);\n\t\t\tconst onMove = (e: InteractionEvent): void => {\n\t\t\t\tconst leftNewWidth = Math.max(\n\t\t\t\t\t0,\n\t\t\t\t\tMath.min(totalWidth, leftOldWidth + e.data.global.x - onDownPoint)\n\t\t\t\t);\n\t\t\t\tconst leftNewWeight = Math.max(\n\t\t\t\t\tleftMinWeight,\n\t\t\t\t\tMath.min(leftMaxWeight, totalWeight * (leftNewWidth / totalWidth))\n\t\t\t\t);\n\t\t\t\tleftColumn.weight = leftNewWeight;\n\t\t\t\trightColumn.weight = totalWeight - leftNewWeight;\n\t\t\t};\n\t\t\tconst onUp = (e: InteractionEvent) => {\n\t\t\t\tcategory.state.remove(DTableState.RESIZING);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.move, onMove);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.up, onUp);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.upoutside, onUp);\n\t\t\t\tinteractionManager.off(UtilPointerEvent.cancel, onUp);\n\t\t\t};\n\t\t\tinteractionManager.on(UtilPointerEvent.move, onMove);\n\t\t\tinteractionManager.on(UtilPointerEvent.up, onUp);\n\t\t\tinteractionManager.on(UtilPointerEvent.upoutside, onUp);\n\t\t\tinteractionManager.on(UtilPointerEvent.cancel, onUp);\n\t\t}\n\t}\n\n\tprotected getType(): string {\n\t\treturn \"DTableCategoryCell\";\n\t}\n}\n"]}
|