@guiexpert/table 1.1.89 → 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 +88 -97
  8. package/index.d.ts +192 -184
  9. package/index.js +3616 -1879
  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 +44 -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 +81 -4
  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 +43 -3
  196. package/lib/table/service/excel-service.if.d.ts +8 -1
  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 +309 -550
  204. package/lib/table/table-scope.d.ts +223 -85
  205. package/package.json +23 -8
@@ -1,9 +1,10 @@
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';
1
+ import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if.js';
2
+ import { CellRendererIf } from './cell-render.if.js';
3
+ import { DomServiceIf } from '../service/dom-service.if.js';
4
+ import { AreaIdent } from '../data/tablemodel/area-ident.type.js';
5
+ import { RendererCleanupFnType } from './renderer-cleanup-fn.type.js';
6
6
 
7
+ /** @category Renderers & editing */
7
8
  export declare class SimpleArrayCellRenderer implements CellRendererIf {
8
9
  render(cellDiv: HTMLDivElement, _rowIndex: number, _columnIndex: number, _areaIdent: AreaIdent, _areaModel: AreaModelIf, cellValue: any[], domService: DomServiceIf): RendererCleanupFnType | undefined;
9
10
  }
@@ -1,14 +1,20 @@
1
- import { CellRendererIf } from './cell-render.if';
2
- import { DomServiceIf } from '../service/dom-service.if';
3
- import { AreaIdent } from '../data/tablemodel/area-ident.type';
4
- import { RendererCleanupFnType } from './renderer-cleanup-fn.type';
5
- import { AreaModelObjectArray } from '../data/tablemodel/areamodel/area-model-object-array';
1
+ import { CellRendererIf } from './cell-render.if.js';
2
+ import { DomServiceIf } from '../service/dom-service.if.js';
3
+ import { AreaIdent } from '../data/tablemodel/area-ident.type.js';
4
+ import { RendererCleanupFnType } from './renderer-cleanup-fn.type.js';
5
+ import { AreaModelObjectArray } from '../data/tablemodel/areamodel/area-model-object-array.js';
6
6
 
7
7
  /**
8
8
  * Works with AreaModelObjectArray only
9
+ *
10
+ * @category Renderers & editing
9
11
  */
10
12
  export declare class StarRatingCellRenderer<T> implements CellRendererIf {
11
13
  property: string;
12
- constructor(property: string);
14
+ /** Text for screen readers (the stars are an image). Default: `"4 stars"`. @since 1.1.91 */
15
+ ariaLabel: (stars: number) => string;
16
+ constructor(property: string,
17
+ /** Text for screen readers (the stars are an image). Default: `"4 stars"`. @since 1.1.91 */
18
+ ariaLabel?: (stars: number) => string);
13
19
  render(cellDiv: HTMLDivElement, rowIndex: number, columnIndex: number, areaIdent: AreaIdent, areaModel: AreaModelObjectArray<T>, _cellValue: any, domService: DomServiceIf): RendererCleanupFnType | undefined;
14
20
  }
@@ -1,9 +1,21 @@
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';
1
+ import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if.js';
2
+ import { CellRendererIf } from './cell-render.if.js';
3
+ import { DomServiceIf } from '../service/dom-service.if.js';
4
+ import { AreaIdent } from '../data/tablemodel/area-ident.type.js';
5
+ import { RendererCleanupFnType } from './renderer-cleanup-fn.type.js';
6
6
 
7
+ /** @category Renderers & editing */
7
8
  export declare class TrueFalseCellRenderer implements CellRendererIf {
9
+ ariaLabels: {
10
+ true: string;
11
+ false: string;
12
+ };
13
+ /**
14
+ * @param ariaLabels - texts for screen readers (the icons ✅ / ❌ are images). Default: "Yes" / "No". @since 1.1.91
15
+ */
16
+ constructor(ariaLabels?: {
17
+ true: string;
18
+ false: string;
19
+ });
8
20
  render(cellDiv: HTMLDivElement, _rowIndex: number, _columnIndex: number, _areaIdent: AreaIdent, _areaModel: AreaModelIf, cellValue: any, _domService: DomServiceIf): RendererCleanupFnType | undefined;
9
21
  }
@@ -1,9 +1,11 @@
1
- import { TableScope } from './table-scope';
1
+ import { TableScope } from './table-scope.js';
2
2
 
3
3
  /**
4
4
  * Class representing a ResizeHandler.
5
5
  * @class
6
6
  * @classdesc Handles resizing of elements and calls a callback function on resize. These calls will be debounced with 500 ms.
7
+ *
8
+ * @category Internals
7
9
  */
8
10
  export declare class ResizeHandler {
9
11
  protected tableScope: TableScope;
@@ -1,5 +1,6 @@
1
- import { SelectionModelIf } from './selection-model.if';
1
+ import { SelectionModelIf } from './selection-model.if.js';
2
2
 
3
+ /** @category Events */
3
4
  export interface EventSelectionChangedListenerIf {
4
5
  onSelectionChanged(model: SelectionModelIf): void;
5
6
  }
@@ -1,18 +1,21 @@
1
- import { SelectionModel } from './selection-model';
2
- import { ObjectArrayHolderIf } from '../data/tablemodel/areamodel/object-array-holder.if';
1
+ import { SelectionModel } from './selection-model.js';
2
+ import { ObjectArrayHolderIf } from '../data/tablemodel/areamodel/object-array-holder.if.js';
3
3
 
4
4
  /**
5
5
  * Class representing a multi-row selection model.
6
6
  * @extends SelectionModel
7
+ *
8
+ * @category Selection & focus
7
9
  */
8
10
  export declare class MultiRowsSelectionModel<T> extends SelectionModel {
9
11
  model: ObjectArrayHolderIf<T>;
10
12
  constructor(model: ObjectArrayHolderIf<T>);
11
13
  /**
12
14
  * Retrieves the selected rows from an array of all table rows.
15
+ * The selection holds row indices of the displayed rows – pass the displayed (filtered, sorted) rows.
13
16
  *
14
17
  * @param {T[]} allrows - The array of all rows from the table model.
15
- * @returns {T[]} - The selected rows from the given array.
18
+ * @returns {T[]} - The selected rows from the given array (the array itself if everything is selected).
16
19
  */
17
20
  getSelectedRowItems(allrows: T[]): T[];
18
21
  /**
@@ -42,7 +45,7 @@ export declare class MultiRowsSelectionModel<T> extends SelectionModel {
42
45
  */
43
46
  toggleFilteredRowsSelection(): void;
44
47
  /**
45
- * Toggles the selection state of a row.
48
+ * Toggles the selection state of a row. A row that was toggled off can be toggled on again.
46
49
  *
47
50
  * @param {number} rowIndex - The index of the row to toggle.
48
51
  *
@@ -1,8 +1,18 @@
1
- import { CellRange } from '../data/common/cell-range';
2
- import { ExtendedSelectionType, SelectionMode } from './selection.type';
3
- import { SelectionModelIf } from './selection-model.if';
4
- import { EventSelectionChangedListenerIf } from './event-selection-changed-listener.if';
1
+ import { CellRange } from '../data/common/cell-range.js';
2
+ import { ExtendedSelectionType, SelectionMode } from './selection.type.js';
3
+ import { SelectionModelIf } from './selection-model.if.js';
4
+ import { EventSelectionChangedListenerIf } from './event-selection-changed-listener.if.js';
5
5
 
6
+ /**
7
+ * Saved state of a {@link SelectionModel} – see {@link SelectionModel.createSnapshot}.
8
+ *
9
+ * @category Selection & focus
10
+ */
11
+ export interface SelectionSnapshot {
12
+ ranges: CellRange[];
13
+ negativeRanges: CellRange[];
14
+ allSelected: boolean;
15
+ }
6
16
  /**
7
17
  * `SelectionModel` is a class that manages the various modes and types of selections within a grid.
8
18
  * It supports basic modes like single cell, row, column, and range selections, as well as advanced mode like negative ranges.
@@ -30,14 +40,16 @@ import { EventSelectionChangedListenerIf } from './event-selection-changed-liste
30
40
  * @method clear(): void - Clears all selections in all ranges and resets allSelected and negativeRanges arrays.
31
41
  * @method hasSelection(): boolean - Checks whether there is any selection. Returns true if yes, false if no.
32
42
  * @method hasNoSelection(): boolean - Checks whether there is no selection. Returns true if yes, false if no.
33
- * @method getMergedRowIndices(): number[] - Gets the array of merged row indices.
34
- * @method selectAll(): void - Selects all selectable entities.
43
+ * @method getMergedRowIndices(rowCount?: number): number[] - Gets the sorted indices of all rows with at least one selected cell.
44
+ * @method selectAll(): void - Selects all selectable entities (also cells that were deselected before). No-op for type "none".
35
45
  * @method isAllSelected() - Checks if all selectable entities are selected.
36
- * @method addSelection(range: CellRange): void - Adds a certain range to the selection.
46
+ * @method addSelection(range: CellRange): void - Adds a certain range to the selection (selects removed cells again).
37
47
  * @method removeSelection(range: CellRange): void - Removes a certain range from the selection.
38
48
  * @method togglePoint(row: number, col: number): void - Toggles the selection state of a point at the specified row and column in a grid.
39
49
  * @method isSelected(row: number, col: number): boolean - Checks if a specific cell in a grid is selected.
40
50
  * @method addRange(range: CellRange): void - Adds a range of cells to the selection.
51
+ *
52
+ * @category Selection & focus
41
53
  */
42
54
  export declare class SelectionModel implements SelectionModelIf {
43
55
  selectionType: ExtendedSelectionType;
@@ -52,7 +64,26 @@ export declare class SelectionModel implements SelectionModelIf {
52
64
  addEventSelectionChangedListener(listener: EventSelectionChangedListenerIf): void;
53
65
  removeEventSelectionChangedListener(listener: EventSelectionChangedListenerIf): void;
54
66
  fireChangeEvent(): void;
67
+ /**
68
+ * A plain click: selects the clicked row (`"row"`), column (`"column"`) or cell (`"cell"`, `"range"`).
69
+ *
70
+ * @param {number} rowIndex - row index of the clicked cell
71
+ * @param {number} columnIndex - column index of the clicked cell
72
+ */
55
73
  firstClick(rowIndex: number, columnIndex: number): void;
74
+ /**
75
+ * A copy of the current selection state, e.g. to restore it while a drag rectangle changes
76
+ * (see {@link restoreSnapshot}). The ranges themselves are shared – they are never changed after being added.
77
+ *
78
+ * @returns {SelectionSnapshot} the state
79
+ */
80
+ createSnapshot(): SelectionSnapshot;
81
+ /**
82
+ * Restores a state created by {@link createSnapshot} (fires a change event).
83
+ *
84
+ * @param {SelectionSnapshot} snapshot - the state to restore
85
+ */
86
+ restoreSnapshot(snapshot: SelectionSnapshot): void;
56
87
  getSelectionCount(rowIndex: number, columnIndex: number): number;
57
88
  isInNegativeRange(rowIndex: number, columnIndex: number): boolean;
58
89
  getRanges(): CellRange[];
@@ -60,16 +91,87 @@ export declare class SelectionModel implements SelectionModelIf {
60
91
  hasSelection(): boolean;
61
92
  hasNoSelection(): boolean;
62
93
  /**
63
- * Retrieves the merged row indices from the given range selection.
94
+ * The indices of all rows that contain at least one selected cell, sorted ascending and without duplicates.
95
+ * A row whose selected cells were all removed again ({@link removeSelection}) is left out.
64
96
  *
65
- * @returns {number[]} Array of merged row indices
97
+ * Ranges that cover all rows (selection type `"column"`, {@link CellRange.singleColumn}: `r2 = Number.MAX_SAFE_INTEGER`)
98
+ * and {@link selectAll} can only be resolved with `rowCount`. Without it they are skipped (before, such a range
99
+ * made this method loop forever) – pass the number of (displayed) body rows to get them, too.
100
+ *
101
+ * @param {number} [rowCount] - number of body rows; rows `>= rowCount` are left out, and "all rows"
102
+ * (column ranges, {@link selectAll}) becomes `0 … rowCount - 1`
103
+ * @returns {number[]} row indices, sorted ascending
104
+ *
105
+ * @example
106
+ * const rowCount = tableModel.getBodyModel().getRowCount();
107
+ * const rowIndices = selectionModel.getMergedRowIndices(rowCount); // e.g. [1, 2, 5]
108
+ * console.log(`${rowIndices.length} rows with selected cells`);
109
+ */
110
+ getMergedRowIndices(rowCount?: number): number[];
111
+ /**
112
+ * Selects all cells. Cells that were deselected before ({@link removeSelection}) are selected again;
113
+ * removing cells afterwards cuts holes into "all selected".
66
114
  */
67
- getMergedRowIndices(): number[];
68
115
  selectAll(): void;
69
116
  isAllSelected(): boolean;
117
+ /**
118
+ * Adds a rectangle to the selection (adjusted to the selection type: whole rows for `"row"`, whole columns for
119
+ * `"column"`, the first cell for `"cell"`). Cells of the rectangle that were deselected before
120
+ * ({@link removeSelection}) are selected again – the last operation wins.
121
+ *
122
+ * @param {CellRange} range - the cells to select (adjusted in place to the selection type)
123
+ */
70
124
  addSelection(range: CellRange): void;
125
+ /**
126
+ * Deselects a rectangle (stored as a "negative" range, so it also cuts holes into {@link selectAll}).
127
+ * For selection type `"row"` all rows `r1 … r2` are removed, for `"column"` all columns `c1 … c2`.
128
+ * A following {@link addSelection} / {@link togglePoint} of these cells selects them again.
129
+ *
130
+ * @param {CellRange} range - the cells to deselect
131
+ */
71
132
  removeSelection(range: CellRange): void;
133
+ /**
134
+ * Toggles the selection state of a cell (for selection type `"row"`/`"column"`: of its row/column).
135
+ * A cell that was deselected inside a selected range (or after {@link selectAll}) gets selected again
136
+ * without adding a second, overlapping range.
137
+ *
138
+ * @param {number} row - row index
139
+ * @param {number} col - column index
140
+ */
72
141
  togglePoint(row: number, col: number): void;
73
142
  isSelected(row: number, col: number): boolean;
74
143
  protected addRange(range: CellRange): void;
144
+ /**
145
+ * Adjusts a range (in place) to the selection type: whole rows for `"row"`, whole columns for `"column"`,
146
+ * the first cell for `"cell"`; `"range"` and `"none"` keep it as it is.
147
+ *
148
+ * @param {CellRange} range - the range to adjust
149
+ * @returns {CellRange} the same range object
150
+ */
151
+ protected adjustRangeToSelectionType(range: CellRange): CellRange;
152
+ /**
153
+ * Selects a deselected cell again ("toggle on") by lifting the negative ranges at this cell (for selection type
154
+ * `"row"`/`"column"`: at its whole row/column) – only possible while the cell is still inside a selected range
155
+ * or everything is selected. Fires no event.
156
+ *
157
+ * @param {number} row - row index
158
+ * @param {number} col - column index
159
+ * @returns {boolean} true if the cell is selected again, false if it has to be added as a new range
160
+ */
161
+ protected reselectPoint(row: number, col: number): boolean;
162
+ /**
163
+ * Removes the cells of `range` from all negative ranges ("last operation wins": cells added after they were
164
+ * removed are selected again). A negative range that overlaps `range` is split into up to four rectangles
165
+ * (above, below, left and right of the overlap); unbounded ranges (`Number.MAX_SAFE_INTEGER`) work as well.
166
+ *
167
+ * @param {CellRange} range - the cells that are selected again
168
+ */
169
+ protected liftNegativeRanges(range: CellRange): void;
170
+ /** True if every cell of `range` is inside one of the negative ranges (rectangle difference, works unbounded). */
171
+ private isCoveredByNegativeRanges;
172
+ /** `a` minus `b`: up to four rectangles (above, below, left and right of the overlap). */
173
+ private static difference;
174
+ private static intersects;
175
+ /** Are the columns c1 … c2 of this row completely covered by the given (negative) ranges? */
176
+ private static coversColumns;
75
177
  }
@@ -1,9 +1,30 @@
1
- import { CellRange } from '../data/common/cell-range';
2
- import { EventSelectionChangedListenerIf } from './event-selection-changed-listener.if';
1
+ import { CellRange } from '../data/common/cell-range.js';
2
+ import { EventSelectionChangedListenerIf } from './event-selection-changed-listener.if.js';
3
3
 
4
+ /**
5
+ * What is selected in a table – a list of rectangles ({@link CellRange}). The implementation is {@link SelectionModel};
6
+ * every table gets its own, or you pass one via {@link TableOptionsIf.getSelectionModel}.
7
+ * Changes are reported to {@link EventListenerIf.onSelectionChanged}.
8
+ *
9
+ * @example
10
+ * override onSelectionChanged(model: SelectionModelIf): void {
11
+ * // rows with at least one selected cell – also for "row"/"column" selections (their ranges are unbounded:
12
+ * // r2/c2 = Number.MAX_SAFE_INTEGER, so (r2 - r1 + 1) * (c2 - c1 + 1) is no cell count)
13
+ * const rowCount = tableModel.getBodyModel().getRowCount();
14
+ * const rows = model.getMergedRowIndices(rowCount);
15
+ * console.log(model.hasSelection() ? `${rows.length} rows with selected cells` : "nothing selected");
16
+ * }
17
+ *
18
+ * @see Training: [Select cells, rows and ranges – and copy them](https://gui.expert/training/selection-and-copy/)
19
+ *
20
+ * @category Selection & focus
21
+ */
4
22
  export interface SelectionModelIf {
23
+ /** The registered listeners (the table registers itself). */
5
24
  getEventSelectionChangedListeners(): EventSelectionChangedListenerIf[];
25
+ /** Get notified on every change of the selection. */
6
26
  addEventSelectionChangedListener(listener: EventSelectionChangedListenerIf): void;
27
+ /** Stop notifications. */
7
28
  removeEventSelectionChangedListener(listener: EventSelectionChangedListenerIf): void;
8
29
  /**
9
30
  * Toggles the selection state of a point at the specified row and column in a grid.
@@ -27,14 +48,38 @@ export interface SelectionModelIf {
27
48
  * @return {CellRange[]} Array of CellRange objects representing the ranges.
28
49
  */
29
50
  getRanges(): CellRange[];
30
- getMergedRowIndices(): number[];
51
+ /**
52
+ * The indices of all rows that contain at least one selected cell, sorted ascending.
53
+ *
54
+ * Ranges that cover all rows (selection type `"column"`) and {@link selectAll} need `rowCount` to be listed;
55
+ * without it they are skipped. Implementations written before `rowCount` existed may ignore it.
56
+ *
57
+ * @param rowCount - number of body rows (optional): limits the result to `0 … rowCount - 1`
58
+ *
59
+ * @example
60
+ * const sm = tableApi.getSelectionModel();
61
+ * const rowIndices = sm?.getMergedRowIndices(tableModel.getBodyModel().getRowCount()) ?? [];
62
+ */
63
+ getMergedRowIndices(rowCount?: number): number[];
64
+ /** Removes the whole selection. */
31
65
  clear(): void;
66
+ /** Is anything selected? */
32
67
  hasSelection(): boolean;
68
+ /** Is nothing selected? */
33
69
  hasNoSelection(): boolean;
70
+ /**
71
+ * Adds a rectangle to the selection, e.g. `new CellRange(0, 0, 9, 3)` (rows 0–9, columns 0–3).
72
+ * Cells removed before ({@link removeSelection}) are selected again – the last operation wins.
73
+ */
34
74
  addSelection(range: CellRange): void;
75
+ /** Removes a rectangle from the selection (also from "all selected"); a later {@link addSelection} selects it again. */
35
76
  removeSelection(range: CellRange): void;
77
+ /** In how many selected ranges is this cell (0 = not selected)? */
36
78
  getSelectionCount(rowIndex: number, columnIndex: number): number;
79
+ /** Selects all cells (⌘/Ctrl+A) – also those removed from the selection before. */
37
80
  selectAll(): void;
81
+ /** Was everything selected with {@link selectAll}? */
38
82
  isAllSelected(): boolean;
83
+ /** Called by the table on a click: starts a selection at this cell, depending on selection type and mode. */
39
84
  firstClick(rowIndex: number, columnIndex: number): void;
40
85
  }
@@ -1,11 +1,14 @@
1
- import { GeMouseEvent } from '../data/common/event/ge-mouse-event';
2
- import { TableScope } from '../table-scope';
3
- import { GetT } from '../data/common/get-t';
4
- import { SelectionModelIf } from './selection-model.if';
5
- import { FocusModelIf } from '../focus/focus-model.if';
6
- import { OnActionTriggeredIf } from '../action/on-action-triggered.if';
7
- import { ActionId } from '../action/action-id.type';
1
+ import { GeMouseEvent } from '../data/common/event/ge-mouse-event.js';
2
+ import { TableScope } from '../table-scope.js';
3
+ import { GetT } from '../data/common/get-t.js';
4
+ import { SelectionModelIf } from './selection-model.if.js';
5
+ import { FocusModelIf } from '../focus/focus-model.if.js';
6
+ import { CellRange } from '../data/common/cell-range.js';
7
+ import { OnActionTriggeredIf } from '../action/on-action-triggered.if.js';
8
+ import { ActionId } from '../action/action-id.type.js';
9
+ import { SelectionSnapshot } from './selection-model.js';
8
10
 
11
+ /** @category Internals */
9
12
  export declare class SelectionService implements OnActionTriggeredIf {
10
13
  protected readonly tableScope: TableScope;
11
14
  getSelectionModel?: GetT<SelectionModelIf>;
@@ -13,6 +16,10 @@ export declare class SelectionService implements OnActionTriggeredIf {
13
16
  protected previousEvt?: GeMouseEvent;
14
17
  /** A drag selection ends with a click on another cell – that click must not clear the new range. */
15
18
  protected ignoreNextClick: boolean;
19
+ /** The ranges the anchor click (or the last shift-click) added – the next shift-click replaces them. */
20
+ protected anchorRanges: CellRange[];
21
+ /** The selection before a Ctrl/⌘-drag – each drag frame replaces only the dragged rectangle. */
22
+ protected dragSnapshot?: SelectionSnapshot;
16
23
  constructor(tableScope: TableScope);
17
24
  /**
18
25
  * Called on mouse down: a new gesture starts.
@@ -21,13 +28,34 @@ export declare class SelectionService implements OnActionTriggeredIf {
21
28
  /**
22
29
  * Selects a range by dragging the mouse over body cells (selection type "range").
23
30
  * The cell where the drag started stays the anchor, so a following shift-click extends from there.
31
+ * With Ctrl/⌘ held at the start the dragged range is added to the existing selection, otherwise it replaces it.
24
32
  *
25
33
  * @param {GeMouseEvent} evt - the current mouse position
26
34
  * @param {GeMouseEvent} startEvt - the mouse down event that started the drag
27
35
  * @returns {boolean} true if the selection changed (repaint needed)
28
36
  */
29
37
  onMouseDragging(evt: GeMouseEvent, startEvt: GeMouseEvent | undefined): boolean;
38
+ /**
39
+ * A click on a body cell: moves the focus and changes the selection.
40
+ * - plain click: new selection (the clicked cell, row or column – by selection type);
41
+ * - Shift: the rectangle from the previous click (the anchor) to this cell replaces what that click had selected –
42
+ * repeated Shift-clicks change the rectangle, ranges added before the anchor stay;
43
+ * - Ctrl/⌘: toggles the cell (row, column); Ctrl/⌘+Alt: deselects it.
44
+ *
45
+ * Header/footer clicks and the second click of a double click (`clickCount` 2) do not change selection or focus.
46
+ * All changes of one click are reported as one `onSelectionChanged` event.
47
+ *
48
+ * @param {GeMouseEvent} evt - the click
49
+ * @param {GeMouseEvent | undefined} _previousEvt - not used (the service keeps its own anchor)
50
+ * @returns {boolean} true if focus or selection changed (repaint needed)
51
+ */
30
52
  onMouseClicked(evt: GeMouseEvent, _previousEvt: GeMouseEvent | undefined): boolean;
31
53
  onActionTriggered(actionId: ActionId): boolean;
54
+ /** Speaks a message for screen readers – only if the selection model can select anything. */
55
+ private announce;
56
+ /** Runs `fn` so that all selection changes in it reach the table's listener as ONE onSelectionChanged event. */
57
+ private batch;
58
+ /** The built-in SelectionModel can save and restore its state; an own SelectionModelIf implementation may not. */
59
+ private static hasSnapshots;
32
60
  private createRangeByEvents;
33
61
  }
@@ -1,3 +1,6 @@
1
+ /** @category Selection & focus */
1
2
  export type ExtendedSelectionType = SelectionType | "range";
3
+ /** @category Selection & focus */
2
4
  export type SelectionType = "none" | "cell" | "row" | "column";
5
+ /** @category Selection & focus */
3
6
  export type SelectionMode = "single" | "multi";
@@ -1,4 +1,4 @@
1
- import { GetStorageKeyFn } from '../data/options/auto-restore-options.if';
1
+ import { GetStorageKeyFn } from '../data/options/auto-restore-options.if.js';
2
2
 
3
3
  export declare abstract class AbstractStoreStateService {
4
4
  protected getStorageKeyFn?: undefined | GetStorageKeyFn;
@@ -1,16 +1,17 @@
1
- import { DomServiceIf } from './dom-service.if';
2
- import { DivScope } from './../data/div-scope.type';
3
- import { GeoData } from './../data/geo-data';
4
- import { TreeArrowType } from '../data/common/tree-arrow.type';
5
- import { TreeOptionsIf } from '../data/options/tree-options.if';
6
- import { AreaIdent } from '../data/tablemodel/area-ident.type';
7
- import { TableOptionsIf } from '../data/options/table-options.if';
8
- import { CheckedType } from '../data/common/checked-type';
9
- import { SideIdent } from '../data/side-ident.type';
10
- import { SortState } from '../data/common/sort-state.type';
11
- import { SortedOptionsIf } from '../data/options/sorted-options.if';
12
- import { HtmlStyle } from './data/html-style.type';
1
+ import { DomServiceIf } from './dom-service.if.js';
2
+ import { DivScope } from './../data/div-scope.type.js';
3
+ import { GeoData } from './../data/geo-data.js';
4
+ import { TreeArrowType } from '../data/common/tree-arrow.type.js';
5
+ import { TreeOptionsIf } from '../data/options/tree-options.if.js';
6
+ import { AreaIdent } from '../data/tablemodel/area-ident.type.js';
7
+ import { TableOptionsIf } from '../data/options/table-options.if.js';
8
+ import { CheckedType } from '../data/common/checked-type.js';
9
+ import { SideIdent } from '../data/side-ident.type.js';
10
+ import { SortState } from '../data/common/sort-state.type.js';
11
+ import { SortedOptionsIf } from '../data/options/sorted-options.if.js';
12
+ import { HtmlStyle } from './data/html-style.type.js';
13
13
 
14
+ /** @category DOM */
14
15
  export interface AddColumnDivPara {
15
16
  parent: HTMLDivElement;
16
17
  geo: GeoData;
@@ -23,9 +24,14 @@ export interface AddColumnDivPara {
23
24
  tableOptions?: TableOptionsIf;
24
25
  checkedType?: CheckedType | undefined;
25
26
  sortState?: SortState;
27
+ /** Accessible name of the row checkbox (`showCheckboxWihoutExtraColumn`), e.g. "Select row 5". @since 1.1.91 */
28
+ checkboxAriaLabel?: string;
26
29
  }
30
+ /** @category DOM */
27
31
  export declare class ConvenienceDomService {
28
32
  readonly domService: DomServiceIf;
33
+ /** Width of the focus frame of a cell in px (WCAG 2.4.7: visible focus, not only a color). @since 1.1.91 */
34
+ static focusBorderWidthInPx: number;
29
35
  constructor(domService: DomServiceIf);
30
36
  setStyle(el: any, style: string, value: any): any;
31
37
  applyStyle(ele: HTMLDivElement, style: HtmlStyle): HTMLDivElement;
@@ -43,16 +49,33 @@ export declare class ConvenienceDomService {
43
49
  removeClass(clazz: string, div: HTMLDivElement): HTMLDivElement;
44
50
  addClasses(classes: string[] | undefined, div: HTMLDivElement): HTMLDivElement;
45
51
  setAttribute(div: HTMLDivElement, key: string, value: string): HTMLDivElement;
52
+ /**
53
+ * Removes an attribute (via {@link DomServiceIf.removeAttribute} if the DOM service has it).
54
+ *
55
+ * @since 1.1.91
56
+ */
57
+ removeAttribute(ele: HTMLElement, key: string): HTMLElement;
58
+ /**
59
+ * Hides a purely decorative element (border, hover, icon …) from screen readers: `aria-hidden="true"`.
60
+ *
61
+ * @since 1.1.91
62
+ */
63
+ setAriaHidden<T extends HTMLElement>(ele: T): T;
46
64
  createAreaDivWithClass(clazz: string, parent: HTMLDivElement, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
47
65
  createDivWithClass(clazz: string, parent: HTMLDivElement): HTMLDivElement;
48
66
  addRowDiv(divScope: DivScope, geo: GeoData, rowIndex: number | undefined, areaIdent: AreaIdent, sideIdent: SideIdent, text?: string): HTMLDivElement;
49
67
  addColumnDiv(para: AddColumnDivPara): HTMLDivElement;
50
- addCheckboxToDiv(parent: HTMLDivElement, checkedType: CheckedType, areaIdent: AreaIdent, rowIndex: number): HTMLDivElement;
68
+ addCheckboxToDiv(parent: HTMLDivElement, checkedType: CheckedType, areaIdent: AreaIdent, rowIndex: number, ariaLabel?: string): HTMLDivElement;
51
69
  addLabelDiv(parent: HTMLDivElement, text?: string, firstTreeColumn?: boolean, rowIndex?: number, columnIndex?: number, areaIdent?: AreaIdent): HTMLDivElement;
52
70
  addSortedIcon(parent: HTMLDivElement, sorted?: SortState, sortedOptions?: SortedOptionsIf, columnIndex?: number): HTMLDivElement;
53
71
  addArrowDiv(parent: HTMLDivElement, arrow?: TreeArrowType, treeOptions?: TreeOptionsIf, rowIndex?: number, columnIndex?: number, areaIdent?: AreaIdent): HTMLDivElement;
54
72
  addColumnBorderDivs(tableOptions: TableOptionsIf, parent: HTMLDivElement, geo: GeoData, areaIdent: AreaIdent, sideIdent: SideIdent): HTMLDivElement;
55
73
  addHorizontalBorder(geo: GeoData, parent: HTMLDivElement, clazz?: string): HTMLDivElement;
74
+ /**
75
+ * Draws the focus frame of a cell: four divs with the class `ge-table-focus-border` (2 px, color
76
+ * `--ge-table-focus-outline-color` resp. `--ge-table-focus-border`). Hidden from screen readers – they get the
77
+ * focus through `aria-activedescendant`.
78
+ */
56
79
  addFocusBorderDivs(parent: HTMLDivElement, geo: GeoData, style: HtmlStyle): HTMLDivElement;
57
80
  addVerticalBorder(geo: GeoData, parent: HTMLDivElement, clazz?: string): HTMLDivElement;
58
81
  addDiv(parent: HTMLDivElement, geo: GeoData, clazz?: string): HTMLDivElement;
@@ -1,14 +1,28 @@
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';
1
+ import { TableModelIf } from '../data/tablemodel/table-model.if.js';
2
+ import { SelectionModelIf } from '../selection/selection-model.if.js';
3
+ import { FocusModelIf } from '../focus/focus-model.if.js';
4
+ import { CopyServiceIf } from './copy-service.if.js';
5
5
 
6
+ /** @category Export & clipboard */
6
7
  export declare class CopyService implements CopyServiceIf {
8
+ /**
9
+ * Upper limit for the number of cells {@link createContent} copies (e.g. after Ctrl+A on a table with millions
10
+ * of rows). Larger selections are rejected instead of building a huge string and blocking the browser.
11
+ *
12
+ * @example
13
+ * CopyService.maxCopyCells = 5_000_000; // allow bigger copies
14
+ */
15
+ static maxCopyCells: number;
7
16
  static columnSeparatorChar: string;
8
17
  static rowSeparatorChar: string;
9
18
  /**
10
19
  * Returns the content to be copied based on the provided table model, selection model, and focus model.
11
20
  *
21
+ * - Selection: the bounding box of all selected ranges, one line per row, cells separated by TAB; cells inside the
22
+ * box that are not selected become empty strings, hidden columns are left out.
23
+ * - Everything selected ({@link SelectionModelIf.selectAll}, ⌘/Ctrl+A): all displayed body rows × all columns.
24
+ * - No selection: the text of the focused cell.
25
+ *
12
26
  * @param {TableModelIf} tableModel - The table model for data retrieval.
13
27
  * @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
14
28
  * @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
@@ -1,7 +1,8 @@
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';
1
+ import { TableModelIf } from '../data/tablemodel/table-model.if.js';
2
+ import { SelectionModelIf } from '../selection/selection-model.if.js';
3
+ import { FocusModelIf } from '../focus/focus-model.if.js';
4
4
 
5
+ /** @category Export & clipboard */
5
6
  export interface CopyServiceIf {
6
7
  /**
7
8
  * Copies the selected data from the table to the clipboard.
@@ -1,3 +1,4 @@
1
+ /** @category Internals */
1
2
  export declare class CollapsedExpandedData {
2
3
  mode: "collapsed" | "expanded";
3
4
  rowIds: Array<string | number>;
@@ -1,3 +1,4 @@
1
+ /** @category DOM */
1
2
  export type HtmlStyle = {
2
3
  [key: string]: string | number;
3
4
  };
@@ -1,10 +1,40 @@
1
+ /**
2
+ * All DOM changes of the table go through this service – the third argument of `new TableScope(…)`.
3
+ * Plain TypeScript and most wrappers use {@link SimpleDomService}; Angular uses its `Renderer2`.
4
+ * Cell renderers get it as last argument of {@link CellRendererIf.render}.
5
+ *
6
+ * @example
7
+ * // inside CellRendererIf.render(cellDiv, …, cellValue, dom)
8
+ * const badge = dom.createElement<HTMLSpanElement>("span");
9
+ * dom.addClass(badge, "status-badge");
10
+ * dom.setStyle(badge, "margin-left", "4px");
11
+ * badge.textContent = String(cellValue);
12
+ * dom.appendChild(cellDiv, badge);
13
+ *
14
+ * @category DOM
15
+ */
1
16
  export interface DomServiceIf {
17
+ /** Sets one CSS property: `setStyle(el, "background-color", "#fdf2f8")`. */
2
18
  setStyle(el: any, style: string, value: any): any;
19
+ /** Adds a CSS class. */
3
20
  addClass(div: HTMLElement, clazz: string): HTMLDivElement;
21
+ /** Removes a CSS class. */
4
22
  removeClass(div: HTMLElement, clazz: string): HTMLDivElement;
23
+ /** Creates an element: `createElement<HTMLSpanElement>("span")`. */
5
24
  createElement<T>(ele: string): T;
25
+ /** Creates a text node. */
6
26
  createText(text: string): HTMLElement;
27
+ /** Appends text to an element (no HTML parsing). */
7
28
  appendText(parent: HTMLDivElement, text: string): HTMLDivElement;
29
+ /** Appends a child element. */
8
30
  appendChild(parent: HTMLElement, child: HTMLElement): void;
31
+ /** Sets an attribute. */
9
32
  setAttribute(ele: HTMLElement, key: string, value: string): void;
33
+ /**
34
+ * Removes an attribute (used for ARIA attributes of reused row divs). Optional: without it the table calls
35
+ * `ele.removeAttribute(key)` itself.
36
+ *
37
+ * @since 1.1.91
38
+ */
39
+ removeAttribute?(ele: HTMLElement, key: string): void;
10
40
  }