@guiexpert/table 1.1.1 → 1.1.2
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 +11 -11
- package/index.js +794 -338
- package/lib/table/action/action-id.type.d.ts +12 -0
- package/lib/table/action/on-action-triggered.if.d.ts +7 -0
- package/lib/table/action/osx-shortcut-actionId-mapping.d.ts +5 -0
- package/lib/table/action/shortcut-actionid-mapping.type.d.ts +4 -0
- package/lib/table/action/shortcut.service.d.ts +3 -0
- package/lib/table/action/windows-shortcut-actionId-mapping.d.ts +3 -0
- package/lib/table/color/color-rgb.if.d.ts +5 -0
- package/lib/table/color/three-color-gradient-arg.if.d.ts +5 -0
- package/lib/table/color/two-color-gradient-arg.if.d.ts +4 -0
- package/lib/table/data/common/aligns.d.ts +23 -0
- package/lib/table/data/common/area-map-factory.d.ts +6 -0
- package/lib/table/data/common/area-map.d.ts +7 -0
- package/lib/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +4 -0
- package/lib/table/data/common/args-render-cell-div.d.ts +17 -0
- package/lib/table/data/common/boolean-function.d.ts +12 -0
- package/lib/table/data/common/cell-range.d.ts +9 -0
- package/lib/table/data/common/checkbox-column-def.d.ts +5 -0
- package/lib/table/data/common/checked-type.d.ts +5 -0
- package/lib/table/data/common/event/ge-cell-indices.d.ts +3 -0
- package/lib/table/data/common/event/ge-key-event.d.ts +5 -0
- package/lib/table/data/common/event/ge-model-change-event.d.ts +3 -0
- package/lib/table/data/common/event/ge-mouse-event.d.ts +3 -0
- package/lib/table/data/common/event/input/table-cell-update-event.d.ts +12 -0
- package/lib/table/data/common/event/input/table-cell-update-event.if.d.ts +41 -0
- package/lib/table/data/common/filter-function.d.ts +8 -0
- package/lib/table/data/common/get-t.d.ts +6 -0
- package/lib/table/data/common/index-and-px.d.ts +3 -0
- package/lib/table/data/common/size.if.d.ts +4 -0
- package/lib/table/data/common/sort-item.d.ts +3 -0
- package/lib/table/data/common/sort-state.type.d.ts +6 -0
- package/lib/table/data/common/tree-arrow.type.d.ts +7 -0
- package/lib/table/data/common/tree-row-if.d.ts +3 -0
- package/lib/table/data/common/tree-row.d.ts +4 -0
- package/lib/table/data/div-scope.type.d.ts +9 -0
- package/lib/table/data/event/mouse-target-data.d.ts +3 -0
- package/lib/table/data/geo-data.d.ts +3 -0
- package/lib/table/data/options/icon.if.d.ts +13 -0
- package/lib/table/data/options/sorted-options.if.d.ts +4 -0
- package/lib/table/data/options/table-options.if.d.ts +186 -0
- package/lib/table/data/side-ident.type.d.ts +3 -0
- package/lib/table/data/table-model-and-options.d.ts +3 -0
- package/lib/table/data/table-model-and-options.if.d.ts +3 -0
- package/lib/table/data/tablemodel/area-ident.type.d.ts +1 -1
- package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +4 -0
- package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +1 -1
- package/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +5 -0
- package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +4 -0
- package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +6 -0
- package/lib/table/data/tablemodel/areamodel/area-model.d.ts +3 -0
- package/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +3 -0
- package/lib/table/data/tablemodel/column/column-def.d.ts +3 -0
- package/lib/table/data/tablemodel/column/column-def.if.d.ts +113 -0
- package/lib/table/data/tablemodel/padding.d.ts +3 -0
- package/lib/table/data/tablemodel/table-model.d.ts +186 -0
- package/lib/table/data/tablemodel/table-model.if.d.ts +165 -0
- package/lib/table/ele-scope.d.ts +4 -0
- package/lib/table/event-adapter.d.ts +7 -0
- package/lib/table/event-listener.if.d.ts +5 -0
- package/lib/table/input-handler.d.ts +14 -0
- package/lib/table/instanceof-workaround.d.ts +19 -0
- package/lib/table/mouse-handler.d.ts +38 -0
- package/lib/table/render-scope.d.ts +1 -1
- package/lib/table/renderer/edit/edit-input-pipe.if.d.ts +8 -0
- package/lib/table/table-api.d.ts +72 -0
- package/lib/table/table-scope.d.ts +148 -0
- package/package.json +1 -1
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An array of action identifiers.
|
|
3
|
+
*
|
|
4
|
+
* @type {ReadonlyArray<string>}
|
|
5
|
+
*/
|
|
1
6
|
export declare const actionIds: readonly ["START_EDITING", "TOGGLE_SELECTION", "SELECT_ALL", "DESELECT_ALL", "NAVIGATE_LEFT", "NAVIGATE_RIGHT", "NAVIGATE_UP", "NAVIGATE_DOWN"];
|
|
7
|
+
/**
|
|
8
|
+
* Represents an action ID.
|
|
9
|
+
*
|
|
10
|
+
* @typedef {string} ActionId
|
|
11
|
+
* @memberof module:myModule
|
|
12
|
+
* @see module:myModule.actionIds
|
|
13
|
+
*/
|
|
2
14
|
export type ActionId = typeof actionIds[number];
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { ActionId } from "./action-id.type";
|
|
2
2
|
export interface OnActionTriggeredIf {
|
|
3
|
+
/**
|
|
4
|
+
* Triggers an action based on the provided action ID.
|
|
5
|
+
*
|
|
6
|
+
* @param {ActionId} actionId - The ID of the action to be triggered.
|
|
7
|
+
*
|
|
8
|
+
* @return {boolean} - Returns true if the action was successfully triggered; otherwise, false.
|
|
9
|
+
*/
|
|
3
10
|
onActionTriggered(actionId: ActionId): boolean;
|
|
4
11
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TableScope } from "../table-scope";
|
|
2
2
|
import { OnActionTriggeredIf } from "./on-action-triggered.if";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a service for managing shortcuts and triggering actions based on keyboard events.
|
|
5
|
+
*/
|
|
3
6
|
export declare class ShortcutService {
|
|
4
7
|
protected tableScope: TableScope;
|
|
5
8
|
private shortcutActionIdMapping;
|
|
@@ -7,16 +7,39 @@ export declare const bodyCenter: {
|
|
|
7
7
|
export declare const bodyRight: {
|
|
8
8
|
body: string[];
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Predefined CSS classes for aligning text to the left within a table for all three areas.
|
|
12
|
+
*
|
|
13
|
+
* @property {Array.<string>} header - The CSS class(es) for aligning text to the left in the table header.
|
|
14
|
+
* @property {Array.<string>} body - The CSS class(es) for aligning text to the left in the table body.
|
|
15
|
+
* @property {Array.<string>} footer - The CSS class(es) for aligning text to the left in the table footer.
|
|
16
|
+
*/
|
|
10
17
|
export declare const allLeft: {
|
|
11
18
|
header: string[];
|
|
12
19
|
body: string[];
|
|
13
20
|
footer: string[];
|
|
14
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* Predefined CSS classes for aligning text to the center of the table cells for all three areas.
|
|
24
|
+
*
|
|
25
|
+
* @typedef {Object} AllCenter
|
|
26
|
+
* @property {Array.<string>} header - The alignment classes for the table header.
|
|
27
|
+
* @property {Array.<string>} body - The alignment classes for the table body.
|
|
28
|
+
* @property {Array.<string>} footer - The alignment classes for the table footer.
|
|
29
|
+
*/
|
|
15
30
|
export declare const allCenter: {
|
|
16
31
|
header: string[];
|
|
17
32
|
body: string[];
|
|
18
33
|
footer: string[];
|
|
19
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Predefined CSS classes for aligning text to the right of the table cells for all three areas.
|
|
37
|
+
*
|
|
38
|
+
* @type {Object}
|
|
39
|
+
* @property {Array} header - An array containing CSS classes for aligning text right in the table header.
|
|
40
|
+
* @property {Array} body - An array containing CSS classes for aligning text right in the table body.
|
|
41
|
+
* @property {Array} footer - An array containing CSS classes for aligning text right in the table footer.
|
|
42
|
+
*/
|
|
20
43
|
export declare const allRight: {
|
|
21
44
|
header: string[];
|
|
22
45
|
body: string[];
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { AreaObjectMap } from "./area-map";
|
|
2
2
|
import { CellRendererIf } from "../../renderer/cell-render.if";
|
|
3
3
|
export declare class AreaMapFactory {
|
|
4
|
+
/**
|
|
5
|
+
* A factory that creates a new AreaObjectMap with the given body renderer.
|
|
6
|
+
*
|
|
7
|
+
* @param {CellRendererIf} bodyRenderer - The renderer for the body of the map.
|
|
8
|
+
* @returns {AreaObjectMap<CellRendererIf>} The newly created AreaObjectMap.
|
|
9
|
+
*/
|
|
4
10
|
static body(bodyRenderer: CellRendererIf): AreaObjectMap<CellRendererIf>;
|
|
5
11
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { AreaObjectMapType } from "./area-map.type";
|
|
2
|
+
/**
|
|
3
|
+
* An object map as container for all three areas.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of objects stored in the map.
|
|
6
|
+
* @class
|
|
7
|
+
* @implements {AreaObjectMapType<T>}
|
|
8
|
+
*/
|
|
2
9
|
export declare class AreaObjectMap<T> implements AreaObjectMapType<T> {
|
|
3
10
|
header?: T | undefined;
|
|
4
11
|
body?: T | undefined;
|
|
@@ -2,6 +2,10 @@ import { AreaIdent } from "../tablemodel/area-ident.type";
|
|
|
2
2
|
import { SideIdent } from "../side-ident.type";
|
|
3
3
|
import { AreaModelIf } from "../tablemodel/areamodel/area-model.if";
|
|
4
4
|
import { GeoData } from "../geo-data";
|
|
5
|
+
/**
|
|
6
|
+
* Represents the parameters required for adjusting columns to the row parent.
|
|
7
|
+
* @interface ArgsAdjustColumnsToRowParentParams
|
|
8
|
+
*/
|
|
5
9
|
export interface ArgsAdjustColumnsToRowParentParams {
|
|
6
10
|
areaIdent: AreaIdent;
|
|
7
11
|
sideIdent: SideIdent;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { AreaModelIf } from "../tablemodel/areamodel/area-model.if";
|
|
2
2
|
import { AreaIdent } from "../tablemodel/area-ident.type";
|
|
3
3
|
import { SideIdent } from "../side-ident.type";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the arguments required to render a cell div.
|
|
6
|
+
*
|
|
7
|
+
* @interface ArgsRenderCellDiv
|
|
8
|
+
* @property {AreaModelIf} areaModel - The area model for the cell.
|
|
9
|
+
* @property {AreaIdent} areaIdent - The identifier of the area.
|
|
10
|
+
* @property {SideIdent} sideIdent - The identifier of the side.
|
|
11
|
+
* @property {number} rowIndex - The index of the row.
|
|
12
|
+
* @property {number} index - The index of the cell.
|
|
13
|
+
* @property {number} left - The left position of the cell.
|
|
14
|
+
* @property {number} width - The width of the cell.
|
|
15
|
+
* @property {number} height - The height of the cell.
|
|
16
|
+
* @property {number} top - The top position of the cell.
|
|
17
|
+
* @property {HTMLDivElement} parent - The parent element of the cell.
|
|
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
|
+
*/
|
|
4
21
|
export interface ArgsRenderCellDiv {
|
|
5
22
|
areaModel: AreaModelIf;
|
|
6
23
|
areaIdent: AreaIdent;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export type BooleanFunction = () => boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Represents a function that always returns true.
|
|
4
|
+
*
|
|
5
|
+
* @function
|
|
6
|
+
* @returns {boolean} - Always returns true
|
|
7
|
+
*/
|
|
2
8
|
export declare const TrueFn: () => boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Represents a function that always returns `false`.
|
|
11
|
+
*
|
|
12
|
+
* @function
|
|
13
|
+
* @returns {boolean} Always returns `false`.
|
|
14
|
+
*/
|
|
3
15
|
export declare const FalseFn: () => boolean;
|
|
@@ -4,6 +4,15 @@ export declare class CellRange {
|
|
|
4
4
|
r2: number;
|
|
5
5
|
c2: number;
|
|
6
6
|
gammaRange: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a constructor for a class.
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {number} r1 - The value for r1.
|
|
11
|
+
* @param {number} c1 - The value for c1.
|
|
12
|
+
* @param {number} r2 - The value for r2.
|
|
13
|
+
* @param {number} c2 - The value for c2.
|
|
14
|
+
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
15
|
+
*/
|
|
7
16
|
constructor(r1: number, c1: number, r2: number, c2: number, gammaRange?: boolean);
|
|
8
17
|
static create(params: {
|
|
9
18
|
rowIndex1: number;
|
|
@@ -2,6 +2,11 @@ import { SizeIf } from "./size.if";
|
|
|
2
2
|
import { ColumnDefIf } from "../tablemodel/column/column-def.if";
|
|
3
3
|
import { CellRendererIf } from "../../renderer/cell-render.if";
|
|
4
4
|
import { AreaObjectMapType } from "./area-map.type";
|
|
5
|
+
/**
|
|
6
|
+
* A pre-defined column definition for a checkbox representation.
|
|
7
|
+
*
|
|
8
|
+
* @implements {ColumnDefIf}
|
|
9
|
+
*/
|
|
5
10
|
export declare class CheckboxColumnDef implements ColumnDefIf {
|
|
6
11
|
type: string;
|
|
7
12
|
property: string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { TableCellUpdateEventIf } from "./table-cell-update-event.if";
|
|
2
2
|
import { AreaIdent } from "../../../tablemodel/area-ident.type";
|
|
3
|
+
/**
|
|
4
|
+
* Represents an event that occurs when a table cell is updated.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
* @implements TableCellUpdateEventIf
|
|
8
|
+
*
|
|
9
|
+
* @param {AreaIdent} area - The identification of the area where the cell belongs.
|
|
10
|
+
* @param {number} rowIndex - The index of the row where the cell is located.
|
|
11
|
+
* @param {number} columnIndex - The index of the column where the cell is located.
|
|
12
|
+
* @param {any} value - The new value for the cell.
|
|
13
|
+
* @param {Object.<string, boolean>} cssClasses - An object containing CSS classes to be applied to the cell.
|
|
14
|
+
*/
|
|
3
15
|
export declare class TableCellUpdateEvent implements TableCellUpdateEventIf {
|
|
4
16
|
area: AreaIdent;
|
|
5
17
|
rowIndex: number;
|
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
import { AreaIdent } from "../../../tablemodel/area-ident.type";
|
|
2
|
+
/**
|
|
3
|
+
* One event defines one table cell update operation.
|
|
4
|
+
* You can send an array of these event via TableApi#updateCells(events: TableCellUpdateEventIf[], repaintAll: boolean = false).
|
|
5
|
+
*/
|
|
2
6
|
export interface TableCellUpdateEventIf {
|
|
7
|
+
/**
|
|
8
|
+
* Represents an area identifier ("header" | "body" | "footer"), which defines the part of the table.
|
|
9
|
+
*
|
|
10
|
+
* @typedef {number} AreaIdent
|
|
11
|
+
*/
|
|
3
12
|
area: AreaIdent;
|
|
13
|
+
/**
|
|
14
|
+
* Represents the index of a row of the table.
|
|
15
|
+
*
|
|
16
|
+
* @typedef {number} rowIndex
|
|
17
|
+
*/
|
|
4
18
|
rowIndex: number;
|
|
19
|
+
/**
|
|
20
|
+
* Represents the index of a column in a data table.
|
|
21
|
+
*
|
|
22
|
+
* @typedef {number} columnIndex
|
|
23
|
+
*/
|
|
5
24
|
columnIndex: number;
|
|
25
|
+
/**
|
|
26
|
+
* The value can be any data type.
|
|
27
|
+
* It can store a string, number, boolean, object, function, or null.
|
|
28
|
+
* It is a flexible variable that can hold any value.
|
|
29
|
+
*
|
|
30
|
+
* This valie will be set to the area model for the cell (rowIndex, columnIndex).
|
|
31
|
+
*
|
|
32
|
+
* @type {*} - Represents any data type
|
|
33
|
+
*/
|
|
6
34
|
value: any;
|
|
35
|
+
/**
|
|
36
|
+
* Represents a collection of CSS classes with their corresponding boolean values.
|
|
37
|
+
* For each key-value pair of the object with a truthy value the corresponding key is used as a class name.
|
|
38
|
+
* For each key-value pair of the object with a falsy value the corresponding key will be removed from the class list of the cell div (dom node).
|
|
39
|
+
* Example:
|
|
40
|
+
* {
|
|
41
|
+
* low: val >= 0 && val <=5,
|
|
42
|
+
* medium: val > 5 && val <= 10,
|
|
43
|
+
* high: val > 10
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @typedef {Object.<string, boolean>} CssClasses
|
|
47
|
+
*/
|
|
7
48
|
cssClasses: {
|
|
8
49
|
[key: string]: boolean;
|
|
9
50
|
};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a filter function that is used to determine if an element should be included in a filtered array.
|
|
3
|
+
* @template T The type of the elements in the array.
|
|
4
|
+
* @param {T} value The current element being evaluated.
|
|
5
|
+
* @param {number} index The index of the current element being evaluated.
|
|
6
|
+
* @param {T[]} array The array that the filter function was called upon.
|
|
7
|
+
* @returns {unknown} The result of the filter function evaluation: `true` if the element should be included, `false` otherwise.
|
|
8
|
+
*/
|
|
1
9
|
export type FilterFunction<T> = (value: T, index: number, array: T[]) => unknown;
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the arrow type for a tree node in a hierarchical structure.
|
|
3
|
+
*
|
|
4
|
+
* The arrow type determines the visual representation of the arrow icon associated with a tree node.
|
|
5
|
+
*
|
|
6
|
+
* @typedef {("none" | "hidden" | "collapsed" | "expanded")} TreeArrowType
|
|
7
|
+
*/
|
|
1
8
|
export type TreeArrowType = "none" | "hidden" | "collapsed" | "expanded";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { TreeRowIf } from "./tree-row-if";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a (table) row in a tree structure. It's a container object for T with additional tree node information.
|
|
4
|
+
* @template T - The type of data stored in the row.
|
|
5
|
+
*/
|
|
2
6
|
export declare class TreeRow<T> implements TreeRowIf<T> {
|
|
3
7
|
data: T;
|
|
4
8
|
expanded: boolean;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a DivScope object.
|
|
3
|
+
*
|
|
4
|
+
* @typedef {{
|
|
5
|
+
* parent: HTMLDivElement,
|
|
6
|
+
* child: HTMLDivElement,
|
|
7
|
+
* cache: { [key: number]: HTMLDivElement }
|
|
8
|
+
* }} DivScope
|
|
9
|
+
*/
|
|
1
10
|
export type DivScope = {
|
|
2
11
|
parent: HTMLDivElement;
|
|
3
12
|
child: HTMLDivElement;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AreaIdent } from "../tablemodel/area-ident.type";
|
|
2
2
|
import { AreaModelIf } from "../tablemodel/areamodel/area-model.if";
|
|
3
3
|
import { TableScope } from "../../table-scope";
|
|
4
|
+
/**
|
|
5
|
+
* Represents data about a mouse target. It's a helper class to extract all information from the target HTMLElement.
|
|
6
|
+
*/
|
|
4
7
|
export declare class MouseTargetData {
|
|
5
8
|
rowIdx: number;
|
|
6
9
|
colIdx: number;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an Icon with content, css style and css classes.
|
|
3
|
+
*
|
|
4
|
+
* Example:
|
|
5
|
+
*
|
|
6
|
+
* new Icon(
|
|
7
|
+
* ">",
|
|
8
|
+
* "transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
9
|
+
* ["gt-table-tree-arrow-expanded"]
|
|
10
|
+
* )
|
|
11
|
+
*
|
|
12
|
+
* @interface
|
|
13
|
+
*/
|
|
1
14
|
export interface IconIf {
|
|
2
15
|
content: string;
|
|
3
16
|
style: string;
|