@guiexpert/table 1.1.90 → 1.1.91

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.
Files changed (205) hide show
  1. package/README.md +3 -1
  2. package/css/main.css +50 -4
  3. package/css/table-classes.css +30 -0
  4. package/css/table-color-classes.css +3 -1
  5. package/css/table-color-vars.css +4 -2
  6. package/css/table-tree.css +13 -1
  7. package/index.cjs +80 -89
  8. package/index.d.ts +192 -184
  9. package/index.js +3229 -1580
  10. package/lib/common/debounce.d.ts +1 -0
  11. package/lib/common/decorator/avoid-double-execution.decorator.d.ts +2 -0
  12. package/lib/common/escape-html.d.ts +22 -0
  13. package/lib/common/generator/column-def-generator-service.d.ts +2 -1
  14. package/lib/common/generator/domain/property-type.d.ts +19 -0
  15. package/lib/common/generator/domain/value-info.d.ts +2 -1
  16. package/lib/common/generator/json-service.d.ts +1 -0
  17. package/lib/common/generator/property-type.service.d.ts +3 -2
  18. package/lib/common/generator/scheme-generator-service.d.ts +3 -1
  19. package/lib/common/generator/string-util.d.ts +7 -0
  20. package/lib/common/throttle.d.ts +1 -0
  21. package/lib/table/action/action-id.type.d.ts +5 -1
  22. package/lib/table/action/on-action-triggered.if.d.ts +2 -1
  23. package/lib/table/action/osx-shortcut-actionId-mapping.d.ts +3 -1
  24. package/lib/table/action/shortcut-actionid-mapping.type.d.ts +3 -1
  25. package/lib/table/action/shortcut-util.d.ts +12 -0
  26. package/lib/table/action/shortcut.service.d.ts +5 -3
  27. package/lib/table/action/windows-shortcut-actionId-mapping.d.ts +3 -1
  28. package/lib/table/aria/aria-grid-info.d.ts +76 -0
  29. package/lib/table/aria/aria-ids.d.ts +56 -0
  30. package/lib/table/aria/aria-texts.d.ts +34 -0
  31. package/lib/table/aria/aria-texts.if.d.ts +88 -0
  32. package/lib/table/aria/live-announcer.d.ts +53 -0
  33. package/lib/table/aria/tree-aria-info.d.ts +58 -0
  34. package/lib/table/checkbox/all-rows-checkbox-model.d.ts +31 -0
  35. package/lib/table/checkbox/checkbox-model.d.ts +3 -2
  36. package/lib/table/checkbox/checkbox-model.if.d.ts +2 -1
  37. package/lib/table/checkbox/tree-checkbox-model.d.ts +19 -4
  38. package/lib/table/color/color-rgb.d.ts +2 -1
  39. package/lib/table/color/color-rgb.if.d.ts +2 -0
  40. package/lib/table/color/ge-css-color-util.d.ts +25 -2
  41. package/lib/table/color/three-color-gradient-arg.d.ts +3 -2
  42. package/lib/table/color/three-color-gradient-arg.if.d.ts +3 -1
  43. package/lib/table/color/two-color-gradient-arg.d.ts +3 -2
  44. package/lib/table/color/two-color-gradient-arg.if.d.ts +3 -1
  45. package/lib/table/crud/column-widths.d.ts +2 -1
  46. package/lib/table/crud/column-widths.if.d.ts +1 -0
  47. package/lib/table/crud/crud-action.d.ts +1 -0
  48. package/lib/table/crud/crud-object-edit.d.ts +25 -3
  49. package/lib/table/crud/crud-object-view.d.ts +6 -0
  50. package/lib/table/crud/crud-options.d.ts +35 -4
  51. package/lib/table/crud/crud-options.if.d.ts +3 -2
  52. package/lib/table/crud/crud-table-model-factory.d.ts +64 -8
  53. package/lib/table/crud/url-info.d.ts +2 -1
  54. package/lib/table/crud/url-info.if.d.ts +1 -0
  55. package/lib/table/crud/urls.if.d.ts +2 -1
  56. package/lib/table/css-vars.d.ts +1 -0
  57. package/lib/table/data/chunk/chunk.data-event.d.ts +3 -2
  58. package/lib/table/data/chunk/chunk.data-event.if.d.ts +2 -1
  59. package/lib/table/data/chunk/request-chunk.d.ts +2 -1
  60. package/lib/table/data/chunk/request-chunk.if.d.ts +1 -0
  61. package/lib/table/data/common/aligns.d.ts +18 -0
  62. package/lib/table/data/common/area-map-factory.d.ts +3 -2
  63. package/lib/table/data/common/area-map.d.ts +3 -1
  64. package/lib/table/data/common/area-map.type.d.ts +1 -0
  65. package/lib/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +6 -4
  66. package/lib/table/data/common/args-render-cell-div.d.ts +5 -3
  67. package/lib/table/data/common/boolean-function.d.ts +10 -0
  68. package/lib/table/data/common/cell-range.d.ts +16 -7
  69. package/lib/table/data/common/checkbox-column-def.d.ts +6 -4
  70. package/lib/table/data/common/checked-type.d.ts +2 -0
  71. package/lib/table/data/common/event/ge-cell-indices.d.ts +2 -0
  72. package/lib/table/data/common/event/ge-key-event.d.ts +2 -0
  73. package/lib/table/data/common/event/ge-model-change-event.d.ts +16 -2
  74. package/lib/table/data/common/event/ge-mouse-event.d.ts +52 -4
  75. package/lib/table/data/common/event/ge-scroll-event.d.ts +27 -1
  76. package/lib/table/data/common/event/input/table-cell-update-event.d.ts +14 -10
  77. package/lib/table/data/common/event/input/table-cell-update-event.if.d.ts +3 -1
  78. package/lib/table/data/common/filter-function.d.ts +2 -0
  79. package/lib/table/data/common/get-t.d.ts +2 -0
  80. package/lib/table/data/common/index-and-px.d.ts +2 -0
  81. package/lib/table/data/common/size-unit.type.d.ts +2 -0
  82. package/lib/table/data/common/size.d.ts +13 -2
  83. package/lib/table/data/common/size.if.d.ts +3 -1
  84. package/lib/table/data/common/sizes.d.ts +133 -1
  85. package/lib/table/data/common/sort-item.d.ts +16 -3
  86. package/lib/table/data/common/sort-state.type.d.ts +2 -0
  87. package/lib/table/data/common/tree-arrow.type.d.ts +2 -0
  88. package/lib/table/data/common/tree-row-if.d.ts +22 -1
  89. package/lib/table/data/common/tree-row.d.ts +3 -1
  90. package/lib/table/data/common/value-label.d.ts +2 -1
  91. package/lib/table/data/common/value-label.if.d.ts +1 -0
  92. package/lib/table/data/div-scope.type.d.ts +2 -0
  93. package/lib/table/data/event/mouse-target-data.d.ts +5 -3
  94. package/lib/table/data/geo-data.d.ts +2 -0
  95. package/lib/table/data/options/auto-restore-options.d.ts +32 -1
  96. package/lib/table/data/options/auto-restore-options.if.d.ts +8 -0
  97. package/lib/table/data/options/default-row-heights.d.ts +20 -2
  98. package/lib/table/data/options/default-row-heights.if.d.ts +4 -1
  99. package/lib/table/data/options/header-group-options.d.ts +3 -2
  100. package/lib/table/data/options/header-group-options.if.d.ts +3 -4
  101. package/lib/table/data/options/icon.d.ts +2 -1
  102. package/lib/table/data/options/icon.if.d.ts +2 -0
  103. package/lib/table/data/options/sorted-options.d.ts +3 -2
  104. package/lib/table/data/options/sorted-options.if.d.ts +3 -1
  105. package/lib/table/data/options/table-options.d.ts +37 -13
  106. package/lib/table/data/options/table-options.if.d.ts +117 -44
  107. package/lib/table/data/options/tree-options.d.ts +3 -2
  108. package/lib/table/data/options/tree-options.if.d.ts +3 -1
  109. package/lib/table/data/side-ident.type.d.ts +2 -0
  110. package/lib/table/data/table-model-and-options.d.ts +5 -3
  111. package/lib/table/data/table-model-and-options.if.d.ts +4 -2
  112. package/lib/table/data/tablemodel/area-ident.type.d.ts +4 -0
  113. package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +10 -9
  114. package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +6 -4
  115. package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +13 -12
  116. package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +9 -7
  117. package/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +16 -14
  118. package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +35 -31
  119. package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +153 -11
  120. package/lib/table/data/tablemodel/areamodel/area-model.d.ts +66 -104
  121. package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +56 -50
  122. package/lib/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +5 -5
  123. package/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +14 -3
  124. package/lib/table/data/tablemodel/areamodel/cover-grid-body-model.d.ts +10 -8
  125. package/lib/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +1 -0
  126. package/lib/table/data/tablemodel/areamodel/object-array-holder.if.d.ts +1 -0
  127. package/lib/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +3 -2
  128. package/lib/table/data/tablemodel/cellgroup/cell-group.d.ts +2 -1
  129. package/lib/table/data/tablemodel/cellgroup/cell-group.if.d.ts +28 -0
  130. package/lib/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +4 -3
  131. package/lib/table/data/tablemodel/column/column-def.d.ts +67 -10
  132. package/lib/table/data/tablemodel/column/column-def.if.d.ts +63 -96
  133. package/lib/table/data/tablemodel/column/column-visibility.d.ts +6 -0
  134. package/lib/table/data/tablemodel/cover-grid-table-model.d.ts +11 -10
  135. package/lib/table/data/tablemodel/padding.d.ts +2 -0
  136. package/lib/table/data/tablemodel/table-model.d.ts +75 -14
  137. package/lib/table/data/tablemodel/table-model.if.d.ts +52 -8
  138. package/lib/table/ele-scope.d.ts +36 -5
  139. package/lib/table/event-adapter.d.ts +17 -10
  140. package/lib/table/event-checkbox-changed-handler.d.ts +2 -1
  141. package/lib/table/event-listener.if.d.ts +42 -9
  142. package/lib/table/factory/cover-grid-factory.d.ts +4 -3
  143. package/lib/table/factory/table-factory.d.ts +103 -64
  144. package/lib/table/factory/tree-factory.d.ts +45 -3
  145. package/lib/table/focus/event-focus-changed-listener.if.d.ts +5 -3
  146. package/lib/table/focus/focus-model.d.ts +7 -5
  147. package/lib/table/focus/focus-model.if.d.ts +22 -1
  148. package/lib/table/focus/focus.type.d.ts +2 -0
  149. package/lib/table/input-handler.d.ts +5 -1
  150. package/lib/table/instanceof-workaround.d.ts +16 -0
  151. package/lib/table/license-manager.d.ts +2 -0
  152. package/lib/table/mouse-handler.d.ts +18 -9
  153. package/lib/table/render-scope.d.ts +115 -25
  154. package/lib/table/renderer/action/action-event-listener.if.d.ts +2 -1
  155. package/lib/table/renderer/action/action-event.d.ts +4 -3
  156. package/lib/table/renderer/action/action-event.if.d.ts +2 -1
  157. package/lib/table/renderer/action/actions-cell-renderer.d.ts +8 -7
  158. package/lib/table/renderer/cell-group-ext-cell-renderer.d.ts +8 -7
  159. package/lib/table/renderer/cell-render.if.d.ts +41 -4
  160. package/lib/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +7 -5
  161. package/lib/table/renderer/checkbox-cell-renderer.d.ts +8 -5
  162. package/lib/table/renderer/date-to-int-date-cell-renderer.d.ts +6 -5
  163. package/lib/table/renderer/date-to-iso-cell-renderer.d.ts +6 -5
  164. package/lib/table/renderer/date-to-locale-date-cell-renderer.d.ts +6 -5
  165. package/lib/table/renderer/date-to-tec-cell-renderer.d.ts +6 -5
  166. package/lib/table/renderer/edit/edit-cell-renderer.type.d.ts +2 -1
  167. package/lib/table/renderer/edit/edit-input-pipe-for-number.d.ts +2 -1
  168. package/lib/table/renderer/edit/edit-input-pipe.if.d.ts +2 -0
  169. package/lib/table/renderer/edit/input-cell-renderer.d.ts +6 -5
  170. package/lib/table/renderer/edit/select-cell-renderer.d.ts +7 -6
  171. package/lib/table/renderer/male-female-to-icon-cell-renderer.d.ts +19 -6
  172. package/lib/table/renderer/number-cell-progress-bar-cell-renderer.d.ts +11 -6
  173. package/lib/table/renderer/number-cell-renderer.d.ts +6 -5
  174. package/lib/table/renderer/positive-and-negative-number-renderer.d.ts +6 -5
  175. package/lib/table/renderer/progress-bar-cell-renderer.d.ts +12 -6
  176. package/lib/table/renderer/renderer-cleanup-fn.type.d.ts +1 -0
  177. package/lib/table/renderer/renderer.d.ts +3 -2
  178. package/lib/table/renderer/simple-array-cell-renderer.d.ts +6 -5
  179. package/lib/table/renderer/star-rating-cell-renderer.d.ts +12 -6
  180. package/lib/table/renderer/true-false-cell-renderer.d.ts +17 -5
  181. package/lib/table/resize-handler.d.ts +3 -1
  182. package/lib/table/selection/event-selection-changed-listener.if.d.ts +2 -1
  183. package/lib/table/selection/multi-rows-selection-model.d.ts +7 -4
  184. package/lib/table/selection/selection-model.d.ts +112 -10
  185. package/lib/table/selection/selection-model.if.d.ts +48 -3
  186. package/lib/table/selection/selection-service.d.ts +35 -7
  187. package/lib/table/selection/selection.type.d.ts +3 -0
  188. package/lib/table/service/abstract-store-state.service.d.ts +1 -1
  189. package/lib/table/service/convenience-dom.service.d.ts +36 -13
  190. package/lib/table/service/copy-service.d.ts +18 -4
  191. package/lib/table/service/copy-service.if.d.ts +4 -3
  192. package/lib/table/service/data/collapsed-expanded.data.d.ts +1 -0
  193. package/lib/table/service/data/html-style.type.d.ts +1 -0
  194. package/lib/table/service/dom-service.if.d.ts +30 -0
  195. package/lib/table/service/excel-service.d.ts +24 -1
  196. package/lib/table/service/excel-service.if.d.ts +7 -0
  197. package/lib/table/service/ge-filter.service.d.ts +1 -0
  198. package/lib/table/service/simple-dom-service.d.ts +3 -1
  199. package/lib/table/service/store-state-collapsed-expand.service.d.ts +4 -3
  200. package/lib/table/service/store-state-scroll-pos.service.d.ts +3 -2
  201. package/lib/table/service/store-state-sorting.service.d.ts +4 -3
  202. package/lib/table/service/tree-row.service.d.ts +5 -1
  203. package/lib/table/table-api.d.ts +296 -550
  204. package/lib/table/table-scope.d.ts +213 -86
  205. package/package.json +23 -8
@@ -1,57 +1,61 @@
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 { SortState } from './data/common/sort-state.type';
10
- import { StoreStateCollapsedExpandService } from './service/store-state-collapsed-expand.service';
11
- import { StoreStateSortingService } from './service/store-state-sorting.service';
12
- import { RenderScope } from './render-scope';
13
- import { InputHandler } from './input-handler';
14
- import { SelectionService } from './selection/selection-service';
15
- import { GeKeyEvent } from './data/common/event/ge-key-event';
16
- import { OnActionTriggeredIf } from './action/on-action-triggered.if';
17
- import { ActionId } from './action/action-id.type';
18
- import { ShortcutService } from './action/shortcut.service';
19
- import { LicenseManager } from './license-manager';
20
- import { SelectionModel } from './selection/selection-model';
21
- import { CopyServiceIf } from './service/copy-service.if';
22
- import { MouseTargetData } from './data/event/mouse-target-data';
23
- import { SelectionModelIf } from './selection/selection-model.if';
24
- import { FocusModelIf } from './focus/focus-model.if';
25
- import { EventFocusChangedListenerIf } from './focus/event-focus-changed-listener.if';
26
- import { EventSelectionChangedListenerIf } from './selection/event-selection-changed-listener.if';
27
- import { ResizeHandler } from './resize-handler';
28
- import { ExcelServiceIf } from './service/excel-service.if';
1
+ import { TableModelIf } from './data/tablemodel/table-model.if.js';
2
+ import { AreaIdent } from './data/tablemodel/area-ident.type.js';
3
+ import { GeMouseEvent } from './data/common/event/ge-mouse-event.js';
4
+ import { DomServiceIf } from './service/dom-service.if.js';
5
+ import { TableOptionsIf } from './data/options/table-options.if.js';
6
+ import { MouseHandler } from './mouse-handler.js';
7
+ import { EventListenerIf } from './event-listener.if.js';
8
+ import { TableApi } from './table-api.js';
9
+ import { SortState } from './data/common/sort-state.type.js';
10
+ import { StoreStateCollapsedExpandService } from './service/store-state-collapsed-expand.service.js';
11
+ import { StoreStateSortingService } from './service/store-state-sorting.service.js';
12
+ import { RenderScope } from './render-scope.js';
13
+ import { InputHandler } from './input-handler.js';
14
+ import { SelectionService } from './selection/selection-service.js';
15
+ import { GeKeyEvent } from './data/common/event/ge-key-event.js';
16
+ import { OnActionTriggeredIf } from './action/on-action-triggered.if.js';
17
+ import { ActionId } from './action/action-id.type.js';
18
+ import { ShortcutService } from './action/shortcut.service.js';
19
+ import { TreeRowIf } from './data/common/tree-row-if.js';
20
+ import { LicenseManager } from './license-manager.js';
21
+ import { SelectionModel } from './selection/selection-model.js';
22
+ import { CopyServiceIf } from './service/copy-service.if.js';
23
+ import { MouseTargetData } from './data/event/mouse-target-data.js';
24
+ import { SelectionModelIf } from './selection/selection-model.if.js';
25
+ import { FocusModelIf } from './focus/focus-model.if.js';
26
+ import { EventFocusChangedListenerIf } from './focus/event-focus-changed-listener.if.js';
27
+ import { EventSelectionChangedListenerIf } from './selection/event-selection-changed-listener.if.js';
28
+ import { ResizeHandler } from './resize-handler.js';
29
+ import { ExcelServiceIf } from './service/excel-service.if.js';
30
+ import { ColumnDefIf } from './data/tablemodel/column/column-def.if.js';
31
+ import { LiveAnnouncer } from './aria/live-announcer.js';
29
32
 
30
33
  /**
31
- * The TableScope class extends the RenderScope class and provides functionality for rendering and interacting with a table.
34
+ * Creates and runs one table in a host element – the core that every framework wrapper uses.
32
35
  *
33
- * @property {LicenseManager} licenseManager - An instance of LicenseManager.
34
- * @property {MouseHandler} mouseHandler - An instance of MouseHandler to handle mouse events.
35
- * @property {InputHandler} inputHandler - An instance of InputHandler to handle keyboard inputs.
36
- * @property {ShortcutService} shortcutService - An instance of ShortcutService to register and handle shortcuts.
37
- * @property {StoreStateCollapsedExpandService | undefined} storeStateCollapsedExpandService - A service to manage and restore the collapsed or expanded state of the table's rows.
38
- * @property {StoreStateSortingService | undefined} storeSortingService - A service to manage and restore the sort state of the table's columns.
39
- * @property {SelectionService} selectionService - An instance of SelectionService to manage cell selection in the table.
40
- * @property {GeKeyEvent | undefined} keyEvent - An object representing the last processed keyboard event.
41
- * @property {TableApi} api - An instance of TableApi, providing an API for table interactions.
36
+ * It connects the four building blocks: host element, {@link TableModelIf table model}, {@link TableOptionsIf options}
37
+ * and an {@link EventListenerIf event listener}, renders only the visible cells (virtual scrolling in both
38
+ * directions) and handles mouse, keyboard, selection, sorting and editing. Talk to the table through
39
+ * {@link getApi} – the {@link TableApi}.
42
40
  *
43
- * Additional properties related to the dragging state of the table:
44
- * - mouseStartAction: The action performed at the start of a mouse drag operation.
45
- * - mouseStartWidth: The initial width of an element at the start of a resizing drag operation.
46
- * - mouseStartColumnIndex: The index of the column at the start of a resizing drag operation.
47
- * - dragFrom: The initial cell index of a drag operation.
48
- * - dragTo: The current cell index of a drag operation.
49
- * - lastDragFrom: The previous initial cell index of a drag operation.
50
- * - lastDragTo: The previous current cell index of a drag operation.
51
- * - firstDraggingRendering: A boolean indicating if this is the first render during the current drag operation.
41
+ * The host element needs a height: the table fills it.
52
42
  *
53
- * Methods: Please refer to the documentation of the superclass RenderScope for the inherited methods.
54
- * The TableScope class introduces additional methods not listed here. Please refer to the source code for further details.
43
+ * @example
44
+ * import "@guiexpert/table/css/main.css";
45
+ * import { EventAdapter, SimpleDomService, TableFactory, TableOptions, TableScope } from "@guiexpert/table";
46
+ *
47
+ * const host = document.querySelector<HTMLDivElement>(".table-div")!; // CSS: .table-div { height: 500px }
48
+ * const tableModel = TableFactory.createTableModel({ rows: orders });
49
+ * const tableScope = new TableScope(host, tableModel, new SimpleDomService(), new TableOptions(), new EventAdapter());
50
+ * tableScope.firstInit();
51
+ * const tableApi = tableScope.getApi();
52
+ *
53
+ * // later: remove the table (route change, new model)
54
+ * tableScope.destroy();
55
+ *
56
+ * @see Training: [Your first table in plain TypeScript](https://gui.expert/training/first-table/)
57
+ *
58
+ * @category Table & API
55
59
  */
56
60
  export declare class TableScope extends RenderScope implements OnActionTriggeredIf, EventFocusChangedListenerIf, EventSelectionChangedListenerIf {
57
61
  protected readonly eventListener: EventListenerIf;
@@ -73,6 +77,16 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
73
77
  protected selectionService: SelectionService;
74
78
  protected keyEvent?: GeKeyEvent;
75
79
  private api;
80
+ /**
81
+ * The live region of this table: screen readers speak its messages (sorting, filter, copy …).
82
+ * Use {@link TableApi.announce} for own messages.
83
+ * @since 1.1.91
84
+ */
85
+ readonly liveAnnouncer: LiveAnnouncer;
86
+ /** Delay of the "42 rows" announcement after a filter change (typing in a filter field: one announcement). */
87
+ static filterAnnouncementDelayInMs: number;
88
+ /** firstInit() has finished: announcements are made from now on (not for the initial filter). */
89
+ private initialized;
76
90
  private mouseStartAction;
77
91
  private mouseStartWidth;
78
92
  private mouseStartColumnIndex;
@@ -84,6 +98,13 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
84
98
  /** Last comparator passed to `sort()`; re-applied after filtering. Cleared by a header sort. */
85
99
  private lastSortCompareFn?;
86
100
  constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, domService: DomServiceIf, tableOptions: TableOptionsIf, eventListener: EventListenerIf, copyService?: CopyServiceIf, excelService?: ExcelServiceIf);
101
+ /** Time of the last Tab key press on the page (the host is focused right after it). */
102
+ private lastTabKeyTime;
103
+ /**
104
+ * The host got the keyboard focus (Tab): without a focus cell the first shown cell of the first visible row
105
+ * gets the focus, so screen readers announce a cell (`aria-activedescendant`).
106
+ */
107
+ private onHostKeyboardFocus;
87
108
  /**
88
109
  * Creates a TableScope instance.
89
110
  *
@@ -106,6 +127,51 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
106
127
  * @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
107
128
  */
108
129
  onActionTriggered(actionId: ActionId): boolean;
130
+ /**
131
+ * Speaks a message to screen reader users (polite live region, see {@link LiveAnnouncer}).
132
+ *
133
+ * @param {string} text - plain text, e.g. "Orders loaded"
134
+ * @param {number} [delayInMs] - wait before the text is written (default {@link LiveAnnouncer.defaultDelayInMs})
135
+ * @since 1.1.91
136
+ */
137
+ announce(text: string, delayInMs?: number): void;
138
+ /** "12 cells copied" – the selected cells of the shown columns (without a selection: the focused cell). */
139
+ announceCopied(_text?: string): void;
140
+ /** The number of cells a copy takes: selected cells of shown columns (like CopyService), otherwise 1 (focus). */
141
+ private countCopiedCells;
142
+ /**
143
+ * The header cell with the keyboard focus (arrow up in the first body row moves the focus into the header).
144
+ *
145
+ * @returns {[number, number] | undefined} header row and column index of the cell, `undefined` if the focus is in the body
146
+ * @since 1.1.91
147
+ */
148
+ getHeaderFocus(): [number, number] | undefined;
149
+ /** Moves the body focus to a cell, scrolls it into view and repaints (also leaves the header). */
150
+ private setFocusCell;
151
+ private getFirstShownColumnIndex;
152
+ private getLastShownColumnIndex;
153
+ /** Home, End, Ctrl+Home, Ctrl+End, Page Up/Down and Enter in the body; `undefined` = not such an action. */
154
+ private onBodyNavigation;
155
+ /** Enter on a body cell: toggles its row checkbox, otherwise expands/collapses its tree row. */
156
+ private activateBodyCell;
157
+ /** Arrow up in the first body row: the focus moves to the lowest header row (same column). */
158
+ private moveFocusIntoHeader;
159
+ /** Focuses a header cell – the origin of a span cell that covers (row, column) – and repaints. */
160
+ private setHeaderFocus;
161
+ /**
162
+ * Keys while a header cell has the focus. Returns `undefined` for actions that work as in the body (copy,
163
+ * select all …) – they leave the header focus as it is.
164
+ */
165
+ private onHeaderAction;
166
+ /** Enter on a header cell: a group with a toggle opens/closes, a sortable (lowest) header cell sorts. */
167
+ private activateHeaderCell;
168
+ /**
169
+ * Closes the cell editor without changing the model (Escape in the editor).
170
+ *
171
+ * @param {HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement} [editor] - the editor element: its value is reset
172
+ * first, so the blur caused by closing does not commit the typed text ("change" event)
173
+ */
174
+ cancelEditing(editor?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
109
175
  updateModelValueAfterEdit(areaIdent: AreaIdent, rowIndex: number, columnIndex: number, value: string): void;
110
176
  /**
111
177
  * Retrieves the TableApi object.
@@ -150,6 +216,15 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
150
216
  * @return {GeMouseEvent} - The created GeMouseEvent object.
151
217
  */
152
218
  createGeMouseEvent(mouseEvent: MouseEvent): GeMouseEvent;
219
+ /**
220
+ * The element a mouse event belongs to – usually `evt.target`. The scroll viewport lies above the footer areas (its
221
+ * horizontal scroll bar must stay usable), so a mouse event on a footer cell arrives at the viewport: then the footer
222
+ * element below the mouse pointer is returned (not on the scroll bar itself).
223
+ *
224
+ * @param {MouseEvent} evt - a mouse event on the host element
225
+ * @returns {EventTarget | null} the target element
226
+ */
227
+ getMouseEventTarget(evt: MouseEvent): EventTarget | null;
153
228
  /**
154
229
  * Handles the mouse down event.
155
230
  *
@@ -195,6 +270,18 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
195
270
  * @return {void}
196
271
  */
197
272
  toggleExpandCollapseAll(expand?: boolean): void;
273
+ /** The last "expand / collapse all" state – the header icon toggles it. */
274
+ allExpanded: boolean;
275
+ /**
276
+ * Expands or collapses one row of a tree table, repaints, and remembers the state (`autoRestoreOptions`).
277
+ *
278
+ * @param {TreeRowIf<any>} row - a tree row of the body model
279
+ * @param {boolean} expanded - the new state
280
+ * @returns {boolean} false if the body is no tree or the state was already set
281
+ */
282
+ setTreeRowExpanded(row: TreeRowIf<any>, expanded: boolean): boolean;
283
+ /** Remembers the expanded/collapsed state of a row (autoRestoreOptions.getRowId). */
284
+ private storeTreeRowState;
198
285
  /**
199
286
  * Toggles the checkbox state of a specific row in a table.
200
287
  *
@@ -214,9 +301,24 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
214
301
  */
215
302
  onMouseClicked(evt: GeMouseEvent, previousEvt: GeMouseEvent | undefined): boolean;
216
303
  debounceRepaint(): void;
304
+ /**
305
+ * Cancels a repaint scheduled by {@link debounceRepaint}.
306
+ *
307
+ * @returns true if a repaint was pending
308
+ */
309
+ cancelPendingRepaint(): boolean;
217
310
  publishGeMouseEvent(evt: GeMouseEvent): void;
218
311
  onFocusChanged(sm: FocusModelIf): void;
219
312
  onSelectionChanged(sm: SelectionModelIf): void;
313
+ private selectionEventsHeld;
314
+ private heldSelectionModel?;
315
+ /**
316
+ * Runs `fn` and reports all selection changes made in it as ONE `onSelectionChanged` event (a click used to fire
317
+ * up to three: `clear()`, adding the new range and the selection service itself).
318
+ *
319
+ * @param {() => void} fn - code that changes the selection model
320
+ */
321
+ holdSelectionEvents(fn: () => void): void;
220
322
  /**
221
323
  * Updates the table (repaint) when an external filter is changed.
222
324
  *
@@ -254,13 +356,26 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
254
356
  */
255
357
  scrollToPixel(px: number, py: number): void;
256
358
  /**
257
- * Scrolls to the specified index in the table.
359
+ * Scrolls to a column and a row: the row becomes the first row of the viewport, the column the first column of the
360
+ * scrollable center area (as far as the scroll range allows).
258
361
  *
259
- * @param {number} _indexX - The horizontal index of the table where scrolling is needed.
260
- * @param {number} indexY - The vertical index of the table where scrolling is needed.
362
+ * A fixed west column scrolls back to the start (x = 0, like before columns were supported). A fixed east column,
363
+ * `-1` or any other index outside the column range keeps the current horizontal position.
364
+ *
365
+ * @param {number} indexX - The column index (model index over west + center + east), `-1` = keep the horizontal position.
366
+ * @param {number} indexY - The row index of the body.
261
367
  * @return {void}
262
368
  */
263
- scrollToIndex(_indexX: number, indexY: number): void;
369
+ scrollToIndex(indexX: number, indexY: number): void;
370
+ /**
371
+ * The horizontal scroll position (`scrollLeft` of the scroll viewport) that shows a column as the first column of
372
+ * the scrollable center area, clamped to the scroll range.
373
+ * A fixed west column returns 0 (start); fixed east columns and indices outside the columns return the current position.
374
+ *
375
+ * @param {number} columnIndex - model column index (west + center + east)
376
+ * @returns {number} scrollLeft in scroll bar pixels
377
+ */
378
+ protected getScrollLeftForColumnIndex(columnIndex: number): number;
264
379
  adjustAfterScrolling(): void;
265
380
  /**
266
381
  * Sets the selection model for the table.
@@ -285,13 +400,20 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
285
400
  focusModel(): FocusModelIf | undefined;
286
401
  setDragging(dragging: boolean): void;
287
402
  /**
288
- * Changes the focus cell using the specified deltas.
403
+ * Changes the focus cell using the specified deltas (keyboard navigation).
404
+ * The new focus stays inside the body (first/last row and column) and the focused row is scrolled into view.
405
+ * `onFocusChanged` is fired by the focus model itself (TableScope listens to it).
289
406
  *
290
407
  * @param {number} dx - The delta for the column index.
291
408
  * @param {number} dy - The delta for the row index.
292
- * @return {boolean} - True if the focus cell was changed, false otherwise.
409
+ * @return {boolean} - True if the key was handled (a focus model exists and the table is not editing), false otherwise.
293
410
  */
294
411
  private changeFocusCell;
412
+ /**
413
+ * The column index `dx` steps from `colIdx`, skipping hidden columns (width 0, e.g. `setColumnVisible(…, false)`).
414
+ * Stays inside the columns; if there is no shown column in that direction, the focus stays where it is.
415
+ */
416
+ private getNextShownColumnIndex;
295
417
  /**
296
418
  * Resizes the column based on the mouse event.
297
419
  *
@@ -304,7 +426,6 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
304
426
  * @return {void}
305
427
  */
306
428
  private clearSelectionModel;
307
- private debugOnce;
308
429
  /**
309
430
  * Restores the scroll position of the table if auto restore options are enabled.
310
431
  *
@@ -346,6 +467,27 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
346
467
  */
347
468
  calcAutoColumnWidths(): number[];
348
469
  setColumnWidth(columnIndex: number, width: number): void;
470
+ /**
471
+ * Shows or hides a column and repaints (see {@link TableApi.setColumnVisible}).
472
+ *
473
+ * @param {number | string | ColumnDefIf} column - column index, property or column definition
474
+ * @param {boolean} visible - false hides the column
475
+ * @returns {boolean} false if the column has no column definition (or the table model can't hide columns)
476
+ */
477
+ setColumnVisible(column: number | string | ColumnDefIf, visible: boolean): boolean;
478
+ /**
479
+ * Shows or hides the header and repaints (see {@link TableApi.setHeaderVisible}).
480
+ *
481
+ * @param {boolean} visible - false hides the header
482
+ */
483
+ setHeaderVisible(visible: boolean): void;
484
+ /**
485
+ * Shows or hides the footer and repaints (see {@link TableApi.setFooterVisible}).
486
+ *
487
+ * @param {boolean} visible - false hides the footer
488
+ */
489
+ setFooterVisible(visible: boolean): void;
490
+ private setAreaVisible;
349
491
  autoResizeColumns(recalcWrappers?: boolean): void;
350
492
  recalcWrappers(): void;
351
493
  reSort(): void;
@@ -363,7 +505,7 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
363
505
  * The method performs the following:
364
506
  * 1. Checks if the row is above the current viewport (before first visible row)
365
507
  * 2. Checks if the row is below the current viewport (after last visible row)
366
- * 3. Scrolls to make the row visible if needed
508
+ * 3. Scrolls to make the row visible if needed – vertically only, the horizontal position is kept
367
509
  *
368
510
  * @param {number} rowIndex - The index of the row to make visible
369
511
  * @returns {boolean} Returns true if scrolling was needed and performed, false if the row was already visible
@@ -372,39 +514,24 @@ export declare class TableScope extends RenderScope implements OnActionTriggered
372
514
  * // Ensure row 5 is visible in the viewport
373
515
  * tableScope.ensureRowIsVisible(5);
374
516
  *
375
- * @example
376
- * // Example usage in a component
377
- * class MyTableComponent {
378
- * private tableScope: TableScope;
379
- *
380
- * scrollToSpecificRow(rowIndex: number) {
381
- * // This will scroll the row into view if it's not visible
382
- * const didScroll = this.tableScope.ensureRowIsVisible(rowIndex);
383
- *
384
- * if (didScroll) {
385
- * console.log(`Table scrolled to show row ${rowIndex}`);
386
- * } else {
387
- * console.log(`Row ${rowIndex} was already visible`);
388
- * }
389
- * }
390
- * }
391
- *
392
- * @example
393
- * // Example with row selection
394
- * class TableHandler {
395
- * selectAndShowRow(rowIndex: number) {
396
- * // First ensure the row is visible
397
- * this.tableScope.ensureRowIsVisible(rowIndex);
398
- *
399
- * // Then perform selection
400
- * this.selectionModel.selectRow(rowIndex);
401
- * }
402
- * }
403
- *
404
517
  * @throws {Error} Implicitly may throw if rowIndex is not a number or if required properties are undefined
405
518
  *
406
519
  * @see {@link scrollToIndex} - The underlying method used for scrolling
407
520
  * @see {@link getDisplayedRowCount} - Related method for getting visible row count
408
521
  */
409
522
  ensureRowIsVisible(rowIndex: number): boolean;
523
+ /**
524
+ * Ensures that a column of the scrollable center area is fully visible by scrolling horizontally if necessary –
525
+ * the counterpart of {@link ensureRowIsVisible}. A column left of the viewport becomes the first visible column,
526
+ * a column right of it the last one (a column wider than the viewport: the first). The vertical position is kept.
527
+ *
528
+ * Fixed west/east columns are always visible: nothing to do.
529
+ *
530
+ * @param {number} columnIndex - model column index (west + center + east)
531
+ * @returns {boolean} true if the table was scrolled, false if the column was already visible (or is fixed / hidden / out of range)
532
+ *
533
+ * @example
534
+ * tableScope.ensureColumnIsVisible(12);
535
+ */
536
+ ensureColumnIsVisible(columnIndex: number): boolean;
410
537
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.90",
3
+ "version": "1.1.91",
4
4
  "license": "MIT",
5
5
  "author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
6
6
  "repository": {
@@ -23,7 +23,10 @@
23
23
  },
24
24
  "exports": {
25
25
  ".": {
26
- "import": "./index.js",
26
+ "import": {
27
+ "types": "./index.d.ts",
28
+ "default": "./index.js"
29
+ },
27
30
  "require": "./index.cjs"
28
31
  },
29
32
  "./css/*": "./css/*",
@@ -34,7 +37,7 @@
34
37
  },
35
38
  "devDependencies": {
36
39
  "@types/node": "^20.11.17",
37
- "vite": "6.3.4",
40
+ "vite": "6.4.4",
38
41
  "vite-plugin-dts": "^3.7.2",
39
42
  "vite-plugin-eslint": "^1.8.1",
40
43
  "vite-plugin-static-copy": "^0.17.0",
@@ -46,7 +49,12 @@
46
49
  "typedoc-plugin-rename-defaults": "^0.7.0",
47
50
  "typedoc-plugin-markdown": "3.17.1",
48
51
  "typescript": "5.2.2",
49
- "@babel/core": "~7.28.6"
52
+ "@babel/core": "~7.28.6",
53
+ "vitest": "5.0.4",
54
+ "@vitest/browser-playwright": "5.0.4",
55
+ "@vitest/coverage-v8": "5.0.4",
56
+ "axe-core": "4.10.3",
57
+ "playwright": "1.64.0"
50
58
  },
51
59
  "scripts": {
52
60
  "i": "pnpm i",
@@ -54,10 +62,17 @@
54
62
  "build": "vite build && npm run concat-css:main && npm run concat-css:dist",
55
63
  "concat-css:main": "cat css/table*.css > css/main.css",
56
64
  "concat-css:dist": "cat css/table*.css > dist/css/main.css",
57
- "typedoc:json": "npx typedoc --json ../../apps/table-website/src/assets/json/doctype.json src/index.ts",
58
- "typedoc:docs-html": "npx typedoc --out ../../apps/table-website/src/assets/docs src/index.ts",
59
- "typedoc:docs-html-custom-css": "npx typedoc --customCss ./doc.css --out ../../apps/table-website/src/assets/docs src/index.ts",
60
- "typedoc:docs-md": "npx typedoc --plugin typedoc-plugin-markdown --out ../../apps/table-website/src/assets/docsmd src/index.ts",
65
+ "typedoc:website": "node scripts/typedoc-website.mjs",
66
+ "typedoc:json": "npx typedoc --json ../../apps/table-website/src/assets/json/doctype.json",
67
+ "typedoc:docs-html": "npx typedoc --out ../../apps/table-website/src/assets/docs",
68
+ "typedoc:docs-md": "npx typedoc --plugin typedoc-plugin-markdown --out ../../apps/table-website/src/assets/docsmd",
69
+ "docs:check": "node scripts/check-doc-examples.mjs",
70
+ "test": "vitest run",
71
+ "test:unit": "vitest run --project unit",
72
+ "test:browser": "vitest run --project browser",
73
+ "test:watch": "vitest --project unit",
74
+ "test:coverage": "vitest run --coverage",
75
+ "test:types": "tsc -p tsconfig.spec.json --noEmit",
61
76
  "npm-pub": "pnpm publish --no-git-checks --access public"
62
77
  }
63
78
  }