@guiexpert/table 1.1.7 → 1.1.8
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 +32 -31
- package/index.d.ts +2 -0
- package/index.js +464 -352
- 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/tablemodel/areamodel/abstract-area-model.d.ts +1 -0
- package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +1 -0
- 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/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/copy-service.d.ts +11 -0
- package/lib/table/service/copy-service.if.d.ts +7 -0
- package/lib/table/table-api.d.ts +16 -0
- package/lib/table/table-scope.d.ts +12 -2
- 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
|
}
|
|
@@ -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;
|
|
@@ -38,6 +38,7 @@ export declare class AreaModelCellGroups implements AreaModelIf {
|
|
|
38
38
|
getRowspanAt(rowIndex: number, columnIndex: number): number;
|
|
39
39
|
getTooltipAt(_rowIndex: number, _columnIndex: number): any;
|
|
40
40
|
getValueAt(rowIndex: number, columnIndex: number): any;
|
|
41
|
+
getTextValueAt(rowIndex: number, columnIndex: number): string;
|
|
41
42
|
getYPosByRowIndex(_rowIndex: number): number;
|
|
42
43
|
init(): void;
|
|
43
44
|
getRowHeight(_rowIndex: number): number;
|
|
@@ -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.
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
createContent(tableModel: TableModelIf, selectionModel: SelectionModelIf, focusModel: FocusModelIf): Promise<string>;
|
|
9
|
+
copyContent(content: string): Promise<void>;
|
|
10
|
+
private mergeRanges;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
createContent(tableModel: TableModelIf, selectionModel: SelectionModelIf | undefined, focusModel: FocusModelIf | undefined): Promise<string>;
|
|
6
|
+
copyContent(content: string): Promise<void>;
|
|
7
|
+
}
|
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,18 @@ 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;
|
|
107
123
|
}
|
|
@@ -17,6 +17,7 @@ import { ActionId } from "./action/action-id.type";
|
|
|
17
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';
|
|
20
21
|
/**
|
|
21
22
|
* Creates a TableScope instance.
|
|
22
23
|
* @param {HTMLDivElement} hostElement - The host element.
|
|
@@ -27,6 +28,7 @@ import { SelectionModel } from './selection/selection-model';
|
|
|
27
28
|
*/
|
|
28
29
|
export declare class TableScope extends RenderScope implements OnActionTriggeredIf {
|
|
29
30
|
protected readonly eventListener: EventListenerIf;
|
|
31
|
+
protected readonly copyService: CopyServiceIf;
|
|
30
32
|
licenseManager: LicenseManager;
|
|
31
33
|
mouseHandler: MouseHandler;
|
|
32
34
|
inputHandler: InputHandler;
|
|
@@ -52,8 +54,16 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
|
|
|
52
54
|
*
|
|
53
55
|
* @return {TableScope} - The newly created TableScope instance.
|
|
54
56
|
*/
|
|
55
|
-
static create(hostElement: HTMLDivElement, tableModel: TableModelIf, tableOptions?: TableOptionsIf, eventListener?: EventListenerIf, domService?: DomServiceIf): TableScope;
|
|
56
|
-
constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, domService: DomServiceIf, tableOptions: TableOptionsIf, eventListener: EventListenerIf);
|
|
57
|
+
static create(hostElement: HTMLDivElement, tableModel: TableModelIf, tableOptions?: TableOptionsIf, eventListener?: EventListenerIf, domService?: DomServiceIf, copyService?: CopyServiceIf): TableScope;
|
|
58
|
+
constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, domService: DomServiceIf, tableOptions: TableOptionsIf, eventListener: EventListenerIf, copyService?: CopyServiceIf);
|
|
59
|
+
/**
|
|
60
|
+
* Triggers an action based on the provided actionId.
|
|
61
|
+
*
|
|
62
|
+
* This function can be invoked manually via the table API or by keyboard shortcuts.
|
|
63
|
+
*
|
|
64
|
+
* @param {ActionId} actionId - The identifier of the action to be triggered.
|
|
65
|
+
* @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
|
|
66
|
+
*/
|
|
57
67
|
onActionTriggered(actionId: ActionId): boolean;
|
|
58
68
|
updateModelValueAfterEdit(areaIdent: AreaIdent, rowIndex: number, columnIndex: number, value: string): void;
|
|
59
69
|
/**
|