@guiexpert/table 1.1.4 → 1.1.7

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.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * LicenseManager class responsible for managing license keys.
3
+ * As it's a singleton class, it only allows one instance of itself to exist.
4
+ *
5
+ * Usage: LicenseManager.getInstance().setLicenseKey('Your API key');
6
+ */
7
+ export declare class LicenseManager {
8
+ private static instance;
9
+ private alreadySet;
10
+ private constructor();
11
+ static getInstance(): LicenseManager;
12
+ /**
13
+ * Method to set the license key for the application.
14
+ * A 'meta' element is created with content as 'guiexperttable=<license key>'
15
+ * and appended into the head section of the document
16
+ *
17
+ * @param {string} key - The license key to set for the application.
18
+ *
19
+ * @return {void} - This method does not return anything
20
+ */
21
+ setLicenseKey(key: string | undefined): void;
22
+ }
@@ -6,6 +6,12 @@ import { GeMouseEvent } from "./data/common/event/ge-mouse-event";
6
6
  */
7
7
  export declare class MouseHandler {
8
8
  protected tableScope: TableScope;
9
+ /**
10
+ * Represents the delay in milliseconds between two consecutive double clicks.
11
+ *
12
+ * @type {number}
13
+ */
14
+ doubleClickDelay: number;
9
15
  mouseEvent?: MouseEvent;
10
16
  startMouseEvent?: GeMouseEvent;
11
17
  geMouseEvent?: GeMouseEvent;
@@ -22,6 +28,7 @@ export declare class MouseHandler {
22
28
  * @return {void}
23
29
  */
24
30
  private onContextmenu;
31
+ private lastClicked;
25
32
  /**
26
33
  * Handles the click event on the host element.
27
34
  *
@@ -45,7 +45,14 @@ export declare class RenderScope extends EleScope {
45
45
  protected editing: boolean;
46
46
  isEditing(): boolean;
47
47
  resetEditorRenderer(): void;
48
- clearSelection(): void;
48
+ /**
49
+ * Clears the selection in the component.
50
+ *
51
+ * @param {boolean} rerender - Indicates whether to rerender the component after clearing the selection. Default value is false.
52
+ *
53
+ * @return {void}
54
+ */
55
+ clearSelection(rerender?: boolean): void;
49
56
  initRenderEditor(rowIdx: number, colIdx: number): void;
50
57
  repaint(): void;
51
58
  adjustAfterScrolling(): void;
@@ -0,0 +1,4 @@
1
+ import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from '../../../index.ts';
2
+ export declare class PositiveAndNegativeNumberRenderer implements CellRendererIf {
3
+ render(cellDiv: HTMLDivElement, rowIndex: number, columnIndex: number, areaIdent: AreaIdent, _areaModel: AreaModelIf, cellValue: any, domService: DomServiceIf): RendererCleanupFnType | undefined;
4
+ }
@@ -8,6 +8,7 @@ export declare class SelectionModel implements SelectionModelIf {
8
8
  protected negativeRanges: CellRange[];
9
9
  protected allSelected: boolean;
10
10
  constructor(selectionType?: SelectionType, selectionMode?: SelectionMode);
11
+ firstClick(rowIndex: number, columnIndex: number): void;
11
12
  getSelectionCount(rowIndex: number, columnIndex: number): number;
12
13
  isInNegativeRange(rowIndex: number, columnIndex: number): boolean;
13
14
  getRanges(): CellRange[];
@@ -8,4 +8,5 @@ export interface SelectionModelIf {
8
8
  removeSelection(range: CellRange): void;
9
9
  getSelectionCount(rowIndex: number, columnIndex: number): number;
10
10
  selectAll(): void;
11
+ firstClick(rowIndex: number, columnIndex: number): void;
11
12
  }
@@ -7,8 +7,8 @@ import { OnActionTriggeredIf } from "../action/on-action-triggered.if";
7
7
  import { ActionId } from "../action/action-id.type";
8
8
  export declare class SelectionService implements OnActionTriggeredIf {
9
9
  protected readonly tableScope: TableScope;
10
- protected getSelectionModel?: GetT<SelectionModelIf>;
11
- protected getFocusModel?: GetT<FocusModelIf>;
10
+ getSelectionModel?: GetT<SelectionModelIf>;
11
+ getFocusModel?: GetT<FocusModelIf>;
12
12
  protected previousEvt?: GeMouseEvent;
13
13
  constructor(tableScope: TableScope);
14
14
  onMouseClicked(evt: GeMouseEvent, _previousEvt: GeMouseEvent | undefined): boolean;
@@ -1,6 +1,7 @@
1
1
  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
+ import { SelectionModel } from './selection/selection-model';
4
5
  export declare class TableApi {
5
6
  private readonly tableScope;
6
7
  constructor(tableScope: TableScope);
@@ -87,4 +88,20 @@ export declare class TableApi {
87
88
  * to update and redraw the table based on the latest data.
88
89
  */
89
90
  repaint(): void;
91
+ /**
92
+ * Clears the current selection of the table.
93
+ * The table will be rendered automatically.
94
+ *
95
+ * @returns {void}
96
+ */
97
+ clearSelection(): void;
98
+ /**
99
+ * Sets the selection model for the table scope.
100
+ *
101
+ * @param {SelectionModel} sm - The selection model to be set.
102
+ * @param {boolean} [repaint=true] - Indicates whether the table should be repainted after setting the selection model. Default value is true.
103
+ *
104
+ * @return {void}
105
+ */
106
+ setSelectionModel(sm: SelectionModel, repaint?: boolean): void;
90
107
  }
@@ -15,13 +15,19 @@ import { GeKeyEvent } from "./data/common/event/ge-key-event";
15
15
  import { OnActionTriggeredIf } from "./action/on-action-triggered.if";
16
16
  import { ActionId } from "./action/action-id.type";
17
17
  import { ShortcutService } from "./action/shortcut.service";
18
+ import { LicenseManager } from './license-manager';
19
+ import { SelectionModel } from './selection/selection-model';
18
20
  /**
19
- * Class representing a TableScope.
20
- * @extends RenderScope
21
- * @implements OnActionTriggeredIf
21
+ * Creates a TableScope instance.
22
+ * @param {HTMLDivElement} hostElement - The host element.
23
+ * @param {TableModelIf} tableModel - The table model object.
24
+ * @param {TableOptionsIf} [tableOptions=new TableOptions()] - Optional table options object.
25
+ * @param {EventListenerIf} [eventListener=new EventAdapter()] - Optional event listener object.
26
+ * @param {DomServiceIf} [domService=new SimpleDomService()] - Optional DOM service object.
22
27
  */
23
28
  export declare class TableScope extends RenderScope implements OnActionTriggeredIf {
24
29
  protected readonly eventListener: EventListenerIf;
30
+ licenseManager: LicenseManager;
25
31
  mouseHandler: MouseHandler;
26
32
  inputHandler: InputHandler;
27
33
  shortcutService: ShortcutService;
@@ -132,7 +138,9 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
132
138
  * @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
133
139
  * @returns {void}
134
140
  */
135
- onMouseClicked(evt: GeMouseEvent, previousEvt: GeMouseEvent | undefined): void;
141
+ onMouseClicked(evt: GeMouseEvent, previousEvt: GeMouseEvent | undefined): boolean;
142
+ debounceRepaint(): void;
143
+ publishGeMouseEvent(evt: GeMouseEvent): void;
136
144
  /**
137
145
  * Updates the table (repaint) when an external filter is changed.
138
146
  *
@@ -174,8 +182,6 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
174
182
  /**
175
183
  * Restores the scroll position of the table if auto restore options are enabled.
176
184
  *
177
- * @private
178
- * @memberof ClassName
179
185
  *
180
186
  * @returns {void}
181
187
  */
@@ -219,4 +225,13 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
219
225
  * @return {void}
220
226
  */
221
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;
222
237
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.4",
3
+ "version": "1.1.7",
4
4
  "dependencies": {
5
5
  "tslib": "^2.3.0"
6
6
  },
@@ -25,3 +25,4 @@
25
25
  }
26
26
  }
27
27
 
28
+