@guiexpert/table 1.1.7 → 1.1.9
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/index.cjs +26 -19
- package/index.d.ts +2 -0
- package/index.js +933 -691
- package/lib/table/action/action-id.type.d.ts +1 -1
- package/lib/table/action/osx-shortcut-actionId-mapping.d.ts +2 -0
- package/lib/table/action/shortcut.service.d.ts +19 -1
- package/lib/table/action/windows-shortcut-actionId-mapping.d.ts +2 -0
- package/lib/table/data/common/args-render-cell-div.d.ts +0 -2
- package/lib/table/data/options/header-group-options.d.ts +7 -0
- package/lib/table/data/options/header-group-options.if.d.ts +5 -0
- package/lib/table/data/options/table-options.d.ts +2 -0
- package/lib/table/data/options/table-options.if.d.ts +3 -8
- package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +1 -0
- package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +19 -14
- package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +1 -0
- package/lib/table/data/tablemodel/areamodel/area-model.d.ts +1 -0
- package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +5 -0
- package/lib/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +1 -1
- package/lib/table/render-scope.d.ts +1 -1
- package/lib/table/renderer/cell-group-ext-cell-renderer.d.ts +14 -7
- package/lib/table/selection/selection-model.d.ts +4 -3
- package/lib/table/selection/selection-model.if.d.ts +1 -0
- package/lib/table/selection/selection.type.d.ts +2 -1
- package/lib/table/service/convenience-dom.service.d.ts +15 -1
- package/lib/table/service/copy-service.d.ts +41 -0
- package/lib/table/service/copy-service.if.d.ts +32 -0
- package/lib/table/table-api.d.ts +22 -0
- package/lib/table/table-scope.d.ts +70 -45
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @type {ReadonlyArray<string>}
|
|
5
5
|
*/
|
|
6
|
-
export declare const actionIds: readonly ["START_EDITING", "TOGGLE_SELECTION", "SELECT_ALL", "DESELECT_ALL", "NAVIGATE_LEFT", "NAVIGATE_RIGHT", "NAVIGATE_UP", "NAVIGATE_DOWN"];
|
|
6
|
+
export declare const actionIds: readonly ["COPY_2_CLIPBOARD", "START_EDITING", "TOGGLE_SELECTION", "SELECT_ALL", "DESELECT_ALL", "NAVIGATE_LEFT", "NAVIGATE_RIGHT", "NAVIGATE_UP", "NAVIGATE_DOWN"];
|
|
7
7
|
/**
|
|
8
8
|
* Represents an action ID.
|
|
9
9
|
*
|
|
@@ -2,6 +2,8 @@ import { ActionId } from "./action-id.type";
|
|
|
2
2
|
/**
|
|
3
3
|
* Class representing the mapping of OS X shortcut actions to action IDs.
|
|
4
4
|
*
|
|
5
|
+
* Use 'meta' for the MacOS 'cmd' key.
|
|
6
|
+
*
|
|
5
7
|
* @class OsxShortcutActionIdMapping
|
|
6
8
|
*/
|
|
7
9
|
export declare class OsxShortcutActionIdMapping {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TableScope } from "../table-scope";
|
|
2
|
+
import { ShortcutActionIdMapping } from "./shortcut-actionid-mapping.type";
|
|
2
3
|
import { OnActionTriggeredIf } from "./on-action-triggered.if";
|
|
3
4
|
/**
|
|
4
5
|
* Represents a service for managing shortcuts and triggering actions based on keyboard events.
|
|
@@ -8,14 +9,31 @@ export declare class ShortcutService {
|
|
|
8
9
|
private shortcutActionIdMapping;
|
|
9
10
|
private listener;
|
|
10
11
|
constructor(tableScope: TableScope);
|
|
12
|
+
/**
|
|
13
|
+
* Adds a listener to the list of listeners.
|
|
14
|
+
*
|
|
15
|
+
* @param {OnActionTriggeredIf} listener - The listener to be added.
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
11
18
|
addListener(listener: OnActionTriggeredIf): void;
|
|
19
|
+
/**
|
|
20
|
+
* Initializes the ShortcutService by assigning shortcut action id mappings based on the current operating system.
|
|
21
|
+
* Also adds key down event listener to the table host element.
|
|
22
|
+
*/
|
|
12
23
|
init(): void;
|
|
24
|
+
private assignPredefinedSystemShortcutMappings;
|
|
13
25
|
private isMacintosh;
|
|
14
26
|
private isDebug;
|
|
15
27
|
private isLocalhost;
|
|
16
28
|
private onKeyDown;
|
|
17
29
|
private emit;
|
|
18
|
-
private
|
|
30
|
+
private findEntity;
|
|
19
31
|
private areTokensEquals;
|
|
20
32
|
private getTokenByEvent;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves the shortcut action mapping object.
|
|
35
|
+
*
|
|
36
|
+
* @returns {ShortcutActionIdMapping} - The shortcut action mapping object.
|
|
37
|
+
*/
|
|
38
|
+
getShortcutActionMapping(): ShortcutActionIdMapping;
|
|
21
39
|
}
|
|
@@ -16,7 +16,6 @@ import { SideIdent } from "../side-ident.type";
|
|
|
16
16
|
* @property {number} top - The top position of the cell.
|
|
17
17
|
* @property {HTMLDivElement} parent - The parent element of the cell.
|
|
18
18
|
* @property {boolean} lastRowOfModel - Indicates if the cell is in the last row of the model.
|
|
19
|
-
* @property {boolean} gammaRange - Indicates if the gamma range is enabled.
|
|
20
19
|
*/
|
|
21
20
|
export interface ArgsRenderCellDiv {
|
|
22
21
|
areaModel: AreaModelIf;
|
|
@@ -30,5 +29,4 @@ export interface ArgsRenderCellDiv {
|
|
|
30
29
|
top: number;
|
|
31
30
|
parent: HTMLDivElement;
|
|
32
31
|
lastRowOfModel: boolean;
|
|
33
|
-
gammaRange: boolean;
|
|
34
32
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IconIf } from "./icon.if";
|
|
2
|
+
import { HeaderGroupOptionsIf } from './header-group-options.if';
|
|
3
|
+
export declare class HeaderGroupOptions implements HeaderGroupOptionsIf {
|
|
4
|
+
iconExpanded: IconIf;
|
|
5
|
+
iconCollapsed: IconIf;
|
|
6
|
+
constructor(iconExpanded?: IconIf, iconCollapsed?: IconIf);
|
|
7
|
+
}
|
|
@@ -9,6 +9,7 @@ import { SelectionModelIf } from "../../selection/selection-model.if";
|
|
|
9
9
|
import { GetT } from "../common/get-t";
|
|
10
10
|
import { FocusModelIf } from "../../focus/focus-model.if";
|
|
11
11
|
import { ShortcutActionIdMapping } from "../../action/shortcut-actionid-mapping.type";
|
|
12
|
+
import { HeaderGroupOptions } from './header-group-options';
|
|
12
13
|
export declare class TableOptions implements TableOptionsIf {
|
|
13
14
|
overflowX: "auto" | "scroll";
|
|
14
15
|
overflowY: "auto" | "scroll";
|
|
@@ -30,6 +31,7 @@ export declare class TableOptions implements TableOptionsIf {
|
|
|
30
31
|
headerToggleExpandCollapseIcons: boolean;
|
|
31
32
|
headerVerticalSeparator: boolean;
|
|
32
33
|
treeOptions: TreeOptions;
|
|
34
|
+
headerGroupOptions: HeaderGroupOptions;
|
|
33
35
|
showCheckboxWihoutExtraColumn: boolean;
|
|
34
36
|
externalFilterFunction: FilterFunction<any> | undefined;
|
|
35
37
|
sortedOptions: SortedOptions;
|
|
@@ -9,6 +9,7 @@ import { SelectionModelIf } from "../../selection/selection-model.if";
|
|
|
9
9
|
import { GetT } from "../common/get-t";
|
|
10
10
|
import { FocusModelIf } from "../../focus/focus-model.if";
|
|
11
11
|
import { ShortcutActionIdMapping } from "../../action/shortcut-actionid-mapping.type";
|
|
12
|
+
import { HeaderGroupOptionsIf } from './header-group-options.if';
|
|
12
13
|
/**
|
|
13
14
|
* Represents the options for configuring a table.
|
|
14
15
|
*
|
|
@@ -34,6 +35,7 @@ import { ShortcutActionIdMapping } from "../../action/shortcut-actionid-mapping.
|
|
|
34
35
|
* | defaultRowHeights | Represents the default row heights for a given table. |
|
|
35
36
|
* | headerToggleExpandCollapseIcons | Indicates whether to show toggle icons in the header. |
|
|
36
37
|
* | treeOptions | Represents the options for configuring a tree. |
|
|
38
|
+
* | headerGroupOptions | Represents the options for expnded/collapsed icons of the header groups. |
|
|
37
39
|
* | showCheckboxWihoutExtraColumn | Indicates whether to show checkbox without an extra column. |
|
|
38
40
|
* | externalFilterFunction | Represents the external filter function used to filter table rows. |
|
|
39
41
|
* | sortedOptions | Represents a sorted options object. |
|
|
@@ -158,15 +160,8 @@ export interface TableOptionsIf {
|
|
|
158
160
|
*/
|
|
159
161
|
defaultRowHeights: DefaultRowHeightsIf;
|
|
160
162
|
headerToggleExpandCollapseIcons: boolean;
|
|
161
|
-
/**
|
|
162
|
-
* Represents the options for configuring a tree.
|
|
163
|
-
*
|
|
164
|
-
* @typedef {Object} TreeOptions
|
|
165
|
-
* @property {number} [maxDepth] - Maximum depth of the tree.
|
|
166
|
-
* @property {boolean} [allowDuplicates] - Indicates if duplicate items are allowed in the tree.
|
|
167
|
-
* @property {string[]} [colors] - An array of color options for styling the tree.
|
|
168
|
-
*/
|
|
169
163
|
treeOptions: TreeOptionsIf;
|
|
164
|
+
headerGroupOptions: HeaderGroupOptionsIf;
|
|
170
165
|
/**
|
|
171
166
|
* Indicates whether to show checkbox without an extra column.
|
|
172
167
|
* If true and the row is checkable, a checkbox is rendered in the first column.
|
|
@@ -17,6 +17,7 @@ export declare abstract class AbstractAreaModel<T> implements AreaModelIf, HasDe
|
|
|
17
17
|
constructor(areaIdent: AreaIdent, columnDefs?: ColumnDefIf[], defaultRowHeight?: number);
|
|
18
18
|
abstract getRowCount(): number;
|
|
19
19
|
abstract getValueAt(rowIndex: number, columnIndex: number): any;
|
|
20
|
+
getTextValueAt(rowIndex: number, columnIndex: number): string;
|
|
20
21
|
getTooltipAt(_rowIndex: number, _columnIndex: number): any;
|
|
21
22
|
abstract getRowHeight(rowIndex: number): number;
|
|
22
23
|
getCellRenderer(_rowIndex: number, columnIndex: number): CellRendererIf | undefined;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { AreaIdent } from
|
|
2
|
-
import { ColumnDefIf } from
|
|
3
|
-
import { AreaModelIf } from
|
|
4
|
-
import { CellGroupIf } from
|
|
5
|
-
import { CheckboxModelIf } from
|
|
6
|
-
import { SortItem } from
|
|
7
|
-
import { FilterFunction } from
|
|
8
|
-
import { CellRendererIf } from
|
|
9
|
-
import { CheckedType } from
|
|
10
|
-
import { CellGroupExt } from
|
|
1
|
+
import { AreaIdent } from '../area-ident.type';
|
|
2
|
+
import { ColumnDefIf } from '../column/column-def.if';
|
|
3
|
+
import { AreaModelIf } from './area-model.if';
|
|
4
|
+
import { CellGroupIf } from '../cellgroup/cell-group.if';
|
|
5
|
+
import { CheckboxModelIf } from '../../../checkbox/checkbox-model.if';
|
|
6
|
+
import { SortItem } from '../../common/sort-item';
|
|
7
|
+
import { FilterFunction } from '../../common/filter-function';
|
|
8
|
+
import { CellRendererIf } from '../../../renderer/cell-render.if';
|
|
9
|
+
import { CheckedType } from '../../common/checked-type';
|
|
10
|
+
import { CellGroupExt } from '../cellgroup/cell-group-ext';
|
|
11
|
+
import { MouseTargetData } from '../../event/mouse-target-data';
|
|
12
|
+
import { HeaderGroupOptionsIf } from '../../options/header-group-options.if';
|
|
11
13
|
export declare class AreaModelCellGroups implements AreaModelIf {
|
|
12
14
|
readonly areaIdent: AreaIdent;
|
|
13
15
|
readonly groups: CellGroupIf[];
|
|
14
|
-
|
|
16
|
+
columnDefs: ColumnDefIf[];
|
|
15
17
|
readonly defaultRowHeight: number;
|
|
18
|
+
private headerGroupOptions;
|
|
16
19
|
gammaCells: boolean;
|
|
17
20
|
rowSelectionModel: CheckboxModelIf<any> | undefined;
|
|
18
|
-
|
|
21
|
+
arr: (CellGroupExt | null | undefined)[][];
|
|
19
22
|
private groupExts;
|
|
20
23
|
private cellGroupExtCellRenderer;
|
|
21
|
-
constructor(areaIdent: AreaIdent, groups: CellGroupIf[], columnDefs: ColumnDefIf[], defaultRowHeight: number);
|
|
24
|
+
constructor(areaIdent: AreaIdent, groups: CellGroupIf[], columnDefs: ColumnDefIf[], defaultRowHeight: number, headerGroupOptions?: HeaderGroupOptionsIf);
|
|
25
|
+
init(): void;
|
|
22
26
|
getAllLeafs(): CellGroupExt[];
|
|
23
27
|
getMaxRowCount(): number;
|
|
24
28
|
buildArray(): (CellGroupExt | null | undefined)[][];
|
|
@@ -38,8 +42,8 @@ export declare class AreaModelCellGroups implements AreaModelIf {
|
|
|
38
42
|
getRowspanAt(rowIndex: number, columnIndex: number): number;
|
|
39
43
|
getTooltipAt(_rowIndex: number, _columnIndex: number): any;
|
|
40
44
|
getValueAt(rowIndex: number, columnIndex: number): any;
|
|
45
|
+
getTextValueAt(rowIndex: number, columnIndex: number): string;
|
|
41
46
|
getYPosByRowIndex(_rowIndex: number): number;
|
|
42
|
-
init(): void;
|
|
43
47
|
getRowHeight(_rowIndex: number): number;
|
|
44
48
|
isEditable(_rowIndex: number, _columnIndex: number): boolean;
|
|
45
49
|
isFilterable(): boolean;
|
|
@@ -48,4 +52,5 @@ export declare class AreaModelCellGroups implements AreaModelIf {
|
|
|
48
52
|
isSelectable(_rowIndex: number, _columnIndex: number): boolean;
|
|
49
53
|
setRowChecked(_rowIndex: number, _checked: boolean): void;
|
|
50
54
|
setValue(_rowIndex: number, _columnIndex: number, _value: any): boolean;
|
|
55
|
+
toggleHeaderGroup(mouseTargetData: MouseTargetData): ColumnDefIf[];
|
|
51
56
|
}
|
|
@@ -14,6 +14,7 @@ export declare class AreaModelHidden implements AreaModelIf {
|
|
|
14
14
|
constructor(areaIdent?: AreaIdent);
|
|
15
15
|
getRowCount(): number;
|
|
16
16
|
getValueAt(_rowIndex: number, _columnIndex: number): any;
|
|
17
|
+
getTextValueAt(_rowIndex: number, _columnIndex: number): string;
|
|
17
18
|
getCellRenderer(_rowIndex: number, _columnIndex: number): CellRendererIf | undefined;
|
|
18
19
|
getRowHeight(_rowIndex: number): number;
|
|
19
20
|
getColspanAt(_rowIndex: number, _columnIndex: number): number;
|
|
@@ -28,6 +28,7 @@ export declare class AreaModel implements AreaModelIf {
|
|
|
28
28
|
getRowspanAt(_rowIndex: number, _columnIndex: number): number;
|
|
29
29
|
getTooltipAt(_rowIndex: number, _columnIndex: number): any;
|
|
30
30
|
getValueAt(_rowIndex: number, _columnIndex: number): any;
|
|
31
|
+
getTextValueAt(_rowIndex: number, _columnIndex: number): string;
|
|
31
32
|
getYPosByRowIndex(_rowIndex: number): number;
|
|
32
33
|
init(): void;
|
|
33
34
|
isEditable(_rowIndex: number, _columnIndex: number): boolean;
|
|
@@ -39,6 +39,11 @@ export interface AreaModelIf {
|
|
|
39
39
|
* Returns the value of the cell at position rowIndex/columnIndex.
|
|
40
40
|
*/
|
|
41
41
|
getValueAt(rowIndex: number, columnIndex: number): any;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a string value of the cell at position rowIndex/columnIndex.
|
|
44
|
+
* This function will be called by 'export' or 'copy to clipboard'.
|
|
45
|
+
*/
|
|
46
|
+
getTextValueAt(rowIndex: number, columnIndex: number): string;
|
|
42
47
|
/**
|
|
43
48
|
* Returns the value of a colspan of the cell at position rowIndex/columnIndex.
|
|
44
49
|
* A value below 2 is ignored.
|
|
@@ -17,5 +17,5 @@ export declare class CellGroupExt extends CellGroup {
|
|
|
17
17
|
getColumnCount(cg?: CellGroupExt, ret?: number): number;
|
|
18
18
|
getRowSpan(cg: CellGroupExt | undefined, maxRowCount: number): number;
|
|
19
19
|
getParentCount(cg?: CellGroupExt, ret?: number): number;
|
|
20
|
-
log(maxRowCount
|
|
20
|
+
log(maxRowCount?: number): string;
|
|
21
21
|
}
|
|
@@ -78,7 +78,7 @@ export declare class RenderScope extends EleScope {
|
|
|
78
78
|
protected findRowOfImportantRowspanCell(areaModel: AreaModelIf, rowIndex: number, colIndex: number): number;
|
|
79
79
|
protected adjustColumnsToRowParent({ areaIdent, sideIdent, areaModel, geo, parent, rowIndex, columnIndexStart, columnIndexEnd, verticalFixed, lastRowOfModel }: ArgsAdjustColumnsToRowParentParams): void;
|
|
80
80
|
protected getTreeArrowColumnIndex(): 0 | 1;
|
|
81
|
-
protected addAndRenderCellDiv({ areaModel, areaIdent, sideIdent, rowIndex, index, left, width, height, top, parent, lastRowOfModel
|
|
81
|
+
protected addAndRenderCellDiv({ areaModel, areaIdent, sideIdent, rowIndex, index, left, width, height, top, parent, lastRowOfModel }: ArgsRenderCellDiv): [HTMLDivElement, RendererCleanupFnType | undefined];
|
|
82
82
|
protected applyCssClasses(ele: HTMLDivElement, cssClasses?: {
|
|
83
83
|
[key: string]: boolean;
|
|
84
84
|
}): void;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { AreaModelIf } from
|
|
2
|
-
import { CellRendererIf } from
|
|
3
|
-
import { DomServiceIf } from
|
|
4
|
-
import { AreaIdent } from
|
|
5
|
-
import { RendererCleanupFnType } from
|
|
6
|
-
import { CellGroupExt } from
|
|
1
|
+
import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if';
|
|
2
|
+
import { CellRendererIf } from './cell-render.if';
|
|
3
|
+
import { DomServiceIf } from '../service/dom-service.if';
|
|
4
|
+
import { AreaIdent } from '../data/tablemodel/area-ident.type';
|
|
5
|
+
import { RendererCleanupFnType } from './renderer-cleanup-fn.type';
|
|
6
|
+
import { CellGroupExt } from '../data/tablemodel/cellgroup/cell-group-ext';
|
|
7
|
+
import { HeaderGroupOptionsIf } from '../data/options/header-group-options.if';
|
|
7
8
|
export declare class CellGroupExtCellRenderer implements CellRendererIf {
|
|
8
|
-
|
|
9
|
+
private headerGroupOptions;
|
|
10
|
+
private static toggleHeaderGroup;
|
|
11
|
+
constructor(headerGroupOptions?: HeaderGroupOptionsIf);
|
|
12
|
+
render(cellDiv: HTMLDivElement, rowIndex: number, columnIndex: number, areaIdent: AreaIdent, _areaModel: AreaModelIf, cellValue: CellGroupExt | undefined | null, domService: DomServiceIf): RendererCleanupFnType | undefined;
|
|
13
|
+
private addText;
|
|
14
|
+
private addArrowDiv;
|
|
15
|
+
applyStyleString(domService: DomServiceIf, div: HTMLDivElement, style: string): void;
|
|
9
16
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { CellRange } from "../data/common/cell-range";
|
|
2
|
-
import {
|
|
2
|
+
import { ExtendedSelectionType, SelectionMode } from './selection.type';
|
|
3
3
|
import { SelectionModelIf } from "./selection-model.if";
|
|
4
4
|
export declare class SelectionModel implements SelectionModelIf {
|
|
5
|
-
selectionType:
|
|
5
|
+
selectionType: ExtendedSelectionType;
|
|
6
6
|
selectionMode: SelectionMode;
|
|
7
7
|
protected ranges: CellRange[];
|
|
8
8
|
protected negativeRanges: CellRange[];
|
|
9
9
|
protected allSelected: boolean;
|
|
10
|
-
constructor(selectionType?:
|
|
10
|
+
constructor(selectionType?: ExtendedSelectionType, selectionMode?: SelectionMode);
|
|
11
11
|
firstClick(rowIndex: number, columnIndex: number): void;
|
|
12
12
|
getSelectionCount(rowIndex: number, columnIndex: number): number;
|
|
13
13
|
isInNegativeRange(rowIndex: number, columnIndex: number): boolean;
|
|
@@ -18,5 +18,6 @@ export declare class SelectionModel implements SelectionModelIf {
|
|
|
18
18
|
addSelection(range: CellRange): void;
|
|
19
19
|
removeSelection(range: CellRange): void;
|
|
20
20
|
togglePoint(row: number, col: number): void;
|
|
21
|
+
isSelected(row: number, col: number): boolean;
|
|
21
22
|
private addRange;
|
|
22
23
|
}
|
|
@@ -10,6 +10,19 @@ import { SideIdent } from "../data/side-ident.type";
|
|
|
10
10
|
import { SortState } from "../data/common/sort-state.type";
|
|
11
11
|
import { SortedOptionsIf } from "../data/options/sorted-options.if";
|
|
12
12
|
import { HtmlStyle } from "./data/html-style.type";
|
|
13
|
+
interface AddColumnDivPara {
|
|
14
|
+
parent: HTMLDivElement;
|
|
15
|
+
geo: GeoData;
|
|
16
|
+
rowIndex: number;
|
|
17
|
+
columnIndex: number;
|
|
18
|
+
areaIdent: AreaIdent;
|
|
19
|
+
sideIdent: SideIdent;
|
|
20
|
+
text?: string;
|
|
21
|
+
treeArrow?: TreeArrowType;
|
|
22
|
+
tableOptions?: TableOptionsIf;
|
|
23
|
+
checkedType?: CheckedType | undefined;
|
|
24
|
+
sortState?: SortState;
|
|
25
|
+
}
|
|
13
26
|
export declare class ConvenienceDomService {
|
|
14
27
|
readonly domService: DomServiceIf;
|
|
15
28
|
constructor(domService: DomServiceIf);
|
|
@@ -32,7 +45,7 @@ export declare class ConvenienceDomService {
|
|
|
32
45
|
createAreaDivWithClass(clazz: string, parent: HTMLDivElement, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
|
|
33
46
|
createDivWithClass(clazz: string, parent: HTMLDivElement): HTMLDivElement;
|
|
34
47
|
addRowDiv(divScope: DivScope, geo: GeoData, rowIndex: number | undefined, areaIdent: AreaIdent, sideIdent: SideIdent, text?: string): HTMLDivElement;
|
|
35
|
-
addColumnDiv(
|
|
48
|
+
addColumnDiv(para: AddColumnDivPara): HTMLDivElement;
|
|
36
49
|
addCheckboxToDiv(parent: HTMLDivElement, checkedType: CheckedType, areaIdent: AreaIdent, rowIndex: number): HTMLDivElement;
|
|
37
50
|
addLabelDiv(parent: HTMLDivElement, text?: string, firstTreeColumn?: boolean, rowIndex?: number, columnIndex?: number, areaIdent?: AreaIdent): HTMLDivElement;
|
|
38
51
|
addSortedIcon(parent: HTMLDivElement, sorted?: SortState, sortedOptions?: SortedOptionsIf, columnIndex?: number): HTMLDivElement;
|
|
@@ -45,3 +58,4 @@ export declare class ConvenienceDomService {
|
|
|
45
58
|
applyStyleString(div: HTMLDivElement, style: string): void;
|
|
46
59
|
private getDivOrCreateDiv;
|
|
47
60
|
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if';
|
|
2
|
+
import { SelectionModelIf } from '../selection/selection-model.if';
|
|
3
|
+
import { FocusModelIf } from '../focus/focus-model.if';
|
|
4
|
+
import { CopyServiceIf } from './copy-service.if';
|
|
5
|
+
export declare class CopyService implements CopyServiceIf {
|
|
6
|
+
static columnSeparatorChar: string;
|
|
7
|
+
static rowSeparatorChar: string;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
10
|
+
*
|
|
11
|
+
* @param {TableModelIf} tableModel - The table model for data retrieval.
|
|
12
|
+
* @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
|
|
13
|
+
* @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
|
|
14
|
+
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
15
|
+
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
16
|
+
*/
|
|
17
|
+
createContent(tableModel: TableModelIf, selectionModel: SelectionModelIf, focusModel: FocusModelIf): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Copy the provided content to the clipboard.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} content - The content to be copied.
|
|
22
|
+
* @return {Promise<void>} A promise that resolves when the content has been successfully copied to the clipboard.
|
|
23
|
+
*/
|
|
24
|
+
copyContent(content: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Asynchronously copies the content of a table to the clipboard.
|
|
27
|
+
*
|
|
28
|
+
* @param {TableModelIf} tableModel - The table model to copy from.
|
|
29
|
+
* @param {SelectionModelIf} selectionModel - The selection model of the table.
|
|
30
|
+
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
31
|
+
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
32
|
+
*/
|
|
33
|
+
copyToClipboard(tableModel: TableModelIf, selectionModel: SelectionModelIf, focusModel: FocusModelIf): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Merges an array of CellRanges into a single merged CellRange.
|
|
36
|
+
*
|
|
37
|
+
* @param {CellRange[]} ranges - The array of CellRanges to be merged.
|
|
38
|
+
* @return {CellRange | undefined} - The merged CellRange, or undefined if the ranges array is empty.
|
|
39
|
+
*/
|
|
40
|
+
private mergeRanges;
|
|
41
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TableModelIf } from '../data/tablemodel/table-model.if';
|
|
2
|
+
import { SelectionModelIf } from '../selection/selection-model.if';
|
|
3
|
+
import { FocusModelIf } from '../focus/focus-model.if';
|
|
4
|
+
export interface CopyServiceIf {
|
|
5
|
+
/**
|
|
6
|
+
* Copies the selected data from the table to the clipboard.
|
|
7
|
+
*
|
|
8
|
+
* @param {TableModelIf} tableModel - The table model containing the data.
|
|
9
|
+
* @param {SelectionModelIf | undefined} selectionModel - The selection model containing the selected rows/columns.
|
|
10
|
+
* @param {FocusModelIf | undefined} focusModel - The focus model containing the focused cell.
|
|
11
|
+
*
|
|
12
|
+
* @return {Promise<string>} - A promise that resolves with the copied data as a string.
|
|
13
|
+
*/
|
|
14
|
+
copyToClipboard(tableModel: TableModelIf, selectionModel: SelectionModelIf | undefined, focusModel: FocusModelIf | undefined): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates content based on the provided table model, selection model, and focus model.
|
|
17
|
+
*
|
|
18
|
+
* @param {TableModelIf} tableModel - The table model representing the data.
|
|
19
|
+
* @param {SelectionModelIf | undefined} selectionModel - The selection model for the table.
|
|
20
|
+
* @param {FocusModelIf | undefined} focusModel - The focus model for the table.
|
|
21
|
+
*
|
|
22
|
+
* @return {Promise<string>} - A promise that resolves to the generated content as a string.
|
|
23
|
+
*/
|
|
24
|
+
createContent(tableModel: TableModelIf, selectionModel: SelectionModelIf | undefined, focusModel: FocusModelIf | undefined): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Copies the content to a specified location.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} content - The content to be copied.
|
|
29
|
+
* @return {Promise<void>} - A Promise that resolves when the content is successfully copied.
|
|
30
|
+
*/
|
|
31
|
+
copyContent(content: string): Promise<void>;
|
|
32
|
+
}
|
package/lib/table/table-api.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { TableScope } from "./table-scope";
|
|
|
2
2
|
import { ColumnDefIf } from "./data/tablemodel/column/column-def.if";
|
|
3
3
|
import { TableCellUpdateEventIf } from "./data/common/event/input/table-cell-update-event.if";
|
|
4
4
|
import { SelectionModel } from './selection/selection-model';
|
|
5
|
+
import { ActionId } from './action/action-id.type';
|
|
6
|
+
import { ShortcutActionIdMapping } from './action/shortcut-actionid-mapping.type';
|
|
5
7
|
export declare class TableApi {
|
|
6
8
|
private readonly tableScope;
|
|
7
9
|
constructor(tableScope: TableScope);
|
|
@@ -104,4 +106,24 @@ export declare class TableApi {
|
|
|
104
106
|
* @return {void}
|
|
105
107
|
*/
|
|
106
108
|
setSelectionModel(sm: SelectionModel, repaint?: boolean): void;
|
|
109
|
+
/**
|
|
110
|
+
* Triggers the action with the given action ID.
|
|
111
|
+
* This function can be invoked programmatically.
|
|
112
|
+
*
|
|
113
|
+
* @param {ActionId} actionId - The ID of the action to trigger.
|
|
114
|
+
* @return {void}
|
|
115
|
+
*/
|
|
116
|
+
triggerAction(actionId: ActionId): void;
|
|
117
|
+
/**
|
|
118
|
+
* Retrieves the mapping of shortcuts to corresponding action in the current table scope.
|
|
119
|
+
*
|
|
120
|
+
* @return {ShortcutActionIdMapping} The mapping of shortcuts to corresponding action.
|
|
121
|
+
*/
|
|
122
|
+
getShortcutActionMapping(): ShortcutActionIdMapping;
|
|
123
|
+
/**
|
|
124
|
+
* Copies the selected data from the table to the clipboard.
|
|
125
|
+
*
|
|
126
|
+
* @return {Promise<string>} - A promise that resolves with the copied data as a string.
|
|
127
|
+
*/
|
|
128
|
+
copyToClipboard(): Promise<string>;
|
|
107
129
|
}
|
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
import { TableModelIf } from
|
|
2
|
-
import { AreaIdent } from
|
|
3
|
-
import { GeMouseEvent } from
|
|
4
|
-
import { DomServiceIf } from
|
|
5
|
-
import { TableOptionsIf } from
|
|
6
|
-
import { MouseHandler } from
|
|
7
|
-
import { EventListenerIf } from
|
|
8
|
-
import { TableApi } from
|
|
9
|
-
import { StoreStateCollapsedExpandService } from
|
|
10
|
-
import { StoreStateSortingService } from
|
|
11
|
-
import { RenderScope } from
|
|
12
|
-
import { InputHandler } from
|
|
13
|
-
import { SelectionService } from
|
|
14
|
-
import { GeKeyEvent } from
|
|
15
|
-
import { OnActionTriggeredIf } from
|
|
16
|
-
import { ActionId } from
|
|
17
|
-
import { ShortcutService } from
|
|
1
|
+
import { TableModelIf } from './data/tablemodel/table-model.if';
|
|
2
|
+
import { AreaIdent } from './data/tablemodel/area-ident.type';
|
|
3
|
+
import { GeMouseEvent } from './data/common/event/ge-mouse-event';
|
|
4
|
+
import { DomServiceIf } from './service/dom-service.if';
|
|
5
|
+
import { TableOptionsIf } from './data/options/table-options.if';
|
|
6
|
+
import { MouseHandler } from './mouse-handler';
|
|
7
|
+
import { EventListenerIf } from './event-listener.if';
|
|
8
|
+
import { TableApi } from './table-api';
|
|
9
|
+
import { StoreStateCollapsedExpandService } from './service/store-state-collapsed-expand.service';
|
|
10
|
+
import { StoreStateSortingService } from './service/store-state-sorting.service';
|
|
11
|
+
import { RenderScope } from './render-scope';
|
|
12
|
+
import { InputHandler } from './input-handler';
|
|
13
|
+
import { SelectionService } from './selection/selection-service';
|
|
14
|
+
import { GeKeyEvent } from './data/common/event/ge-key-event';
|
|
15
|
+
import { OnActionTriggeredIf } from './action/on-action-triggered.if';
|
|
16
|
+
import { ActionId } from './action/action-id.type';
|
|
17
|
+
import { ShortcutService } from './action/shortcut.service';
|
|
18
18
|
import { LicenseManager } from './license-manager';
|
|
19
19
|
import { SelectionModel } from './selection/selection-model';
|
|
20
|
+
import { CopyServiceIf } from './service/copy-service.if';
|
|
21
|
+
import { MouseTargetData } from './data/event/mouse-target-data';
|
|
22
|
+
import { SelectionModelIf } from './selection/selection-model.if';
|
|
23
|
+
import { FocusModelIf } from './focus/focus-model.if';
|
|
20
24
|
/**
|
|
21
25
|
* Creates a TableScope instance.
|
|
22
26
|
* @param {HTMLDivElement} hostElement - The host element.
|
|
@@ -27,6 +31,7 @@ import { SelectionModel } from './selection/selection-model';
|
|
|
27
31
|
*/
|
|
28
32
|
export declare class TableScope extends RenderScope implements OnActionTriggeredIf {
|
|
29
33
|
protected readonly eventListener: EventListenerIf;
|
|
34
|
+
readonly copyService: CopyServiceIf;
|
|
30
35
|
licenseManager: LicenseManager;
|
|
31
36
|
mouseHandler: MouseHandler;
|
|
32
37
|
inputHandler: InputHandler;
|
|
@@ -41,6 +46,7 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
41
46
|
private mouseStartColumnIndex;
|
|
42
47
|
private dragFrom;
|
|
43
48
|
private dragTo;
|
|
49
|
+
constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, domService: DomServiceIf, tableOptions: TableOptionsIf, eventListener: EventListenerIf, copyService?: CopyServiceIf);
|
|
44
50
|
/**
|
|
45
51
|
* Creates a TableScope instance.
|
|
46
52
|
*
|
|
@@ -52,8 +58,15 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
52
58
|
*
|
|
53
59
|
* @return {TableScope} - The newly created TableScope instance.
|
|
54
60
|
*/
|
|
55
|
-
static create(hostElement: HTMLDivElement, tableModel: TableModelIf, tableOptions?: TableOptionsIf, eventListener?: EventListenerIf, domService?: DomServiceIf): TableScope;
|
|
56
|
-
|
|
61
|
+
static create(hostElement: HTMLDivElement, tableModel: TableModelIf, tableOptions?: TableOptionsIf, eventListener?: EventListenerIf, domService?: DomServiceIf, copyService?: CopyServiceIf): TableScope;
|
|
62
|
+
/**
|
|
63
|
+
* Triggers an action based on the provided actionId.
|
|
64
|
+
*
|
|
65
|
+
* This function can be invoked manually via the table API or by keyboard shortcuts.
|
|
66
|
+
*
|
|
67
|
+
* @param {ActionId} actionId - The identifier of the action to be triggered.
|
|
68
|
+
* @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
|
|
69
|
+
*/
|
|
57
70
|
onActionTriggered(actionId: ActionId): boolean;
|
|
58
71
|
updateModelValueAfterEdit(areaIdent: AreaIdent, rowIndex: number, columnIndex: number, value: string): void;
|
|
59
72
|
/**
|
|
@@ -158,6 +171,44 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
158
171
|
* @return {void}
|
|
159
172
|
*/
|
|
160
173
|
onHeaderDblClicked(event: MouseEvent, _rowIdx: number, colIdx: number): void;
|
|
174
|
+
/**
|
|
175
|
+
* Scrolls the viewport to the specified pixel coordinates.
|
|
176
|
+
*
|
|
177
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
178
|
+
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
179
|
+
*
|
|
180
|
+
* @return {void}
|
|
181
|
+
*/
|
|
182
|
+
scrollToPixel(px: number, py: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* Scrolls to the specified index in the table.
|
|
185
|
+
*
|
|
186
|
+
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
187
|
+
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
188
|
+
* @return {void}
|
|
189
|
+
*/
|
|
190
|
+
scrollToIndex(_indexX: number, indexY: number): void;
|
|
191
|
+
/**
|
|
192
|
+
* Sets the selection model for the table.
|
|
193
|
+
*
|
|
194
|
+
* @param {SelectionModel} sm - The selection model to be set.
|
|
195
|
+
* @param {boolean} rerender - Optional parameter indicating whether to rerender the table after setting the selection model. Default value is false.
|
|
196
|
+
*
|
|
197
|
+
* @return {void} - This method does not return any value.
|
|
198
|
+
*/
|
|
199
|
+
setSelectionModel(sm: SelectionModel, rerender?: boolean): void;
|
|
200
|
+
toggleHeaderGroup(mouseTargetData: MouseTargetData): void;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieves the selection model.
|
|
203
|
+
* @returns {SelectionModelIf | undefined} The selection model if available, otherwise undefined.
|
|
204
|
+
*/
|
|
205
|
+
selectionModel(): SelectionModelIf | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Retrieves the focus model.
|
|
208
|
+
*
|
|
209
|
+
* @returns {FocusModelIf | undefined} The focus model if it exists, or undefined otherwise.
|
|
210
|
+
*/
|
|
211
|
+
focusModel(): FocusModelIf | undefined;
|
|
161
212
|
/**
|
|
162
213
|
* Changes the focus cell using the specified deltas.
|
|
163
214
|
*
|
|
@@ -208,30 +259,4 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
208
259
|
* @private
|
|
209
260
|
*/
|
|
210
261
|
private autoRestoreCollapsedExpandedState;
|
|
211
|
-
/**
|
|
212
|
-
* Scrolls the viewport to the specified pixel coordinates.
|
|
213
|
-
*
|
|
214
|
-
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
215
|
-
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
216
|
-
*
|
|
217
|
-
* @return {void}
|
|
218
|
-
*/
|
|
219
|
-
scrollToPixel(px: number, py: number): void;
|
|
220
|
-
/**
|
|
221
|
-
* Scrolls to the specified index in the table.
|
|
222
|
-
*
|
|
223
|
-
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
224
|
-
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
225
|
-
* @return {void}
|
|
226
|
-
*/
|
|
227
|
-
scrollToIndex(_indexX: number, indexY: number): void;
|
|
228
|
-
/**
|
|
229
|
-
* Sets the selection model for the table.
|
|
230
|
-
*
|
|
231
|
-
* @param {SelectionModel} sm - The selection model to be set.
|
|
232
|
-
* @param {boolean} rerender - Optional parameter indicating whether to rerender the table after setting the selection model. Default value is false.
|
|
233
|
-
*
|
|
234
|
-
* @return {void} - This method does not return any value.
|
|
235
|
-
*/
|
|
236
|
-
setSelectionModel(sm: SelectionModel, rerender?: boolean): void;
|
|
237
262
|
}
|