@guiexpert/table 1.1.90 → 1.1.92

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 (217) hide show
  1. package/README.md +8 -2
  2. package/css/main.css +129 -4
  3. package/css/table-classes.css +93 -0
  4. package/css/table-color-classes.css +3 -1
  5. package/css/table-color-vars.css +20 -2
  6. package/css/table-tree.css +13 -1
  7. package/index.cjs +111 -96
  8. package/index.d.ts +203 -184
  9. package/index.js +4927 -2096
  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 +62 -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 +72 -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/ge-state-change-event.d.ts +30 -0
  77. package/lib/table/data/common/event/input/table-cell-update-event.d.ts +14 -10
  78. package/lib/table/data/common/event/input/table-cell-update-event.if.d.ts +3 -1
  79. package/lib/table/data/common/filter-function.d.ts +2 -0
  80. package/lib/table/data/common/get-t.d.ts +2 -0
  81. package/lib/table/data/common/index-and-px.d.ts +2 -0
  82. package/lib/table/data/common/size-unit.type.d.ts +2 -0
  83. package/lib/table/data/common/size.d.ts +13 -2
  84. package/lib/table/data/common/size.if.d.ts +3 -1
  85. package/lib/table/data/common/sizes.d.ts +133 -1
  86. package/lib/table/data/common/sort-item.d.ts +16 -3
  87. package/lib/table/data/common/sort-state.type.d.ts +2 -0
  88. package/lib/table/data/common/tree-arrow.type.d.ts +2 -0
  89. package/lib/table/data/common/tree-row-if.d.ts +22 -1
  90. package/lib/table/data/common/tree-row.d.ts +3 -1
  91. package/lib/table/data/common/value-label.d.ts +2 -1
  92. package/lib/table/data/common/value-label.if.d.ts +1 -0
  93. package/lib/table/data/div-scope.type.d.ts +2 -0
  94. package/lib/table/data/event/mouse-target-data.d.ts +5 -3
  95. package/lib/table/data/geo-data.d.ts +2 -0
  96. package/lib/table/data/options/auto-restore-options.d.ts +44 -1
  97. package/lib/table/data/options/auto-restore-options.if.d.ts +95 -45
  98. package/lib/table/data/options/default-row-heights.d.ts +20 -2
  99. package/lib/table/data/options/default-row-heights.if.d.ts +4 -1
  100. package/lib/table/data/options/default-row-id.d.ts +4 -0
  101. package/lib/table/data/options/header-group-options.d.ts +3 -2
  102. package/lib/table/data/options/header-group-options.if.d.ts +3 -4
  103. package/lib/table/data/options/icon.d.ts +2 -1
  104. package/lib/table/data/options/icon.if.d.ts +2 -0
  105. package/lib/table/data/options/overlay-options.d.ts +30 -0
  106. package/lib/table/data/options/overlay-options.if.d.ts +79 -0
  107. package/lib/table/data/options/sorted-options.d.ts +3 -2
  108. package/lib/table/data/options/sorted-options.if.d.ts +3 -1
  109. package/lib/table/data/options/table-options.d.ts +40 -13
  110. package/lib/table/data/options/table-options.if.d.ts +152 -44
  111. package/lib/table/data/options/tree-options.d.ts +3 -2
  112. package/lib/table/data/options/tree-options.if.d.ts +3 -1
  113. package/lib/table/data/side-ident.type.d.ts +2 -0
  114. package/lib/table/data/table-model-and-options.d.ts +5 -3
  115. package/lib/table/data/table-model-and-options.if.d.ts +4 -2
  116. package/lib/table/data/tablemodel/area-ident.type.d.ts +4 -0
  117. package/lib/table/data/tablemodel/areamodel/abstract-area-model.d.ts +10 -9
  118. package/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +13 -4
  119. package/lib/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +44 -12
  120. package/lib/table/data/tablemodel/areamodel/area-model-hidden.d.ts +9 -7
  121. package/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +16 -14
  122. package/lib/table/data/tablemodel/areamodel/area-model-object-array.d.ts +48 -31
  123. package/lib/table/data/tablemodel/areamodel/area-model-tree.d.ts +162 -11
  124. package/lib/table/data/tablemodel/areamodel/area-model.d.ts +66 -104
  125. package/lib/table/data/tablemodel/areamodel/area-model.if.d.ts +75 -50
  126. package/lib/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +5 -5
  127. package/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +14 -3
  128. package/lib/table/data/tablemodel/areamodel/cover-grid-body-model.d.ts +17 -8
  129. package/lib/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +1 -0
  130. package/lib/table/data/tablemodel/areamodel/object-array-holder.if.d.ts +1 -0
  131. package/lib/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +3 -2
  132. package/lib/table/data/tablemodel/cellgroup/cell-group.d.ts +4 -1
  133. package/lib/table/data/tablemodel/cellgroup/cell-group.if.d.ts +34 -0
  134. package/lib/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +4 -3
  135. package/lib/table/data/tablemodel/column/column-def.d.ts +67 -10
  136. package/lib/table/data/tablemodel/column/column-def.if.d.ts +63 -96
  137. package/lib/table/data/tablemodel/column/column-visibility.d.ts +11 -0
  138. package/lib/table/data/tablemodel/cover-grid-table-model.d.ts +11 -10
  139. package/lib/table/data/tablemodel/padding.d.ts +2 -0
  140. package/lib/table/data/tablemodel/table-model.d.ts +75 -14
  141. package/lib/table/data/tablemodel/table-model.if.d.ts +52 -8
  142. package/lib/table/ele-scope.d.ts +53 -5
  143. package/lib/table/event-adapter.d.ts +20 -10
  144. package/lib/table/event-checkbox-changed-handler.d.ts +2 -1
  145. package/lib/table/event-listener.if.d.ts +50 -9
  146. package/lib/table/factory/cover-grid-factory.d.ts +4 -3
  147. package/lib/table/factory/table-factory.d.ts +103 -64
  148. package/lib/table/factory/tree-factory.d.ts +45 -3
  149. package/lib/table/focus/event-focus-changed-listener.if.d.ts +5 -3
  150. package/lib/table/focus/focus-model.d.ts +7 -5
  151. package/lib/table/focus/focus-model.if.d.ts +22 -1
  152. package/lib/table/focus/focus.type.d.ts +2 -0
  153. package/lib/table/input-handler.d.ts +5 -1
  154. package/lib/table/instanceof-workaround.d.ts +16 -0
  155. package/lib/table/license-manager.d.ts +2 -0
  156. package/lib/table/mouse-handler.d.ts +20 -9
  157. package/lib/table/overlay/calc-overlay-kind.d.ts +31 -0
  158. package/lib/table/overlay/ge-overlay-kind.type.d.ts +17 -0
  159. package/lib/table/overlay/table-overlay.d.ts +108 -0
  160. package/lib/table/render-scope.d.ts +141 -27
  161. package/lib/table/renderer/action/action-event-listener.if.d.ts +2 -1
  162. package/lib/table/renderer/action/action-event.d.ts +4 -3
  163. package/lib/table/renderer/action/action-event.if.d.ts +2 -1
  164. package/lib/table/renderer/action/actions-cell-renderer.d.ts +8 -7
  165. package/lib/table/renderer/cell-group-ext-cell-renderer.d.ts +8 -7
  166. package/lib/table/renderer/cell-render.if.d.ts +41 -4
  167. package/lib/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +7 -5
  168. package/lib/table/renderer/checkbox-cell-renderer.d.ts +8 -5
  169. package/lib/table/renderer/date-to-int-date-cell-renderer.d.ts +6 -5
  170. package/lib/table/renderer/date-to-iso-cell-renderer.d.ts +6 -5
  171. package/lib/table/renderer/date-to-locale-date-cell-renderer.d.ts +6 -5
  172. package/lib/table/renderer/date-to-tec-cell-renderer.d.ts +6 -5
  173. package/lib/table/renderer/edit/edit-cell-renderer.type.d.ts +2 -1
  174. package/lib/table/renderer/edit/edit-input-pipe-for-number.d.ts +2 -1
  175. package/lib/table/renderer/edit/edit-input-pipe.if.d.ts +2 -0
  176. package/lib/table/renderer/edit/input-cell-renderer.d.ts +6 -5
  177. package/lib/table/renderer/edit/select-cell-renderer.d.ts +7 -6
  178. package/lib/table/renderer/male-female-to-icon-cell-renderer.d.ts +19 -6
  179. package/lib/table/renderer/number-cell-progress-bar-cell-renderer.d.ts +11 -6
  180. package/lib/table/renderer/number-cell-renderer.d.ts +6 -5
  181. package/lib/table/renderer/positive-and-negative-number-renderer.d.ts +6 -5
  182. package/lib/table/renderer/progress-bar-cell-renderer.d.ts +12 -6
  183. package/lib/table/renderer/renderer-cleanup-fn.type.d.ts +1 -0
  184. package/lib/table/renderer/renderer.d.ts +3 -2
  185. package/lib/table/renderer/simple-array-cell-renderer.d.ts +6 -5
  186. package/lib/table/renderer/star-rating-cell-renderer.d.ts +12 -6
  187. package/lib/table/renderer/true-false-cell-renderer.d.ts +17 -5
  188. package/lib/table/resize-handler.d.ts +3 -1
  189. package/lib/table/selection/event-selection-changed-listener.if.d.ts +2 -1
  190. package/lib/table/selection/multi-rows-selection-model.d.ts +7 -4
  191. package/lib/table/selection/selection-model.d.ts +112 -10
  192. package/lib/table/selection/selection-model.if.d.ts +48 -3
  193. package/lib/table/selection/selection-service.d.ts +35 -7
  194. package/lib/table/selection/selection.type.d.ts +3 -0
  195. package/lib/table/service/abstract-store-state.service.d.ts +1 -1
  196. package/lib/table/service/convenience-dom.service.d.ts +37 -14
  197. package/lib/table/service/copy-service.d.ts +18 -4
  198. package/lib/table/service/copy-service.if.d.ts +4 -3
  199. package/lib/table/service/data/collapsed-expanded.data.d.ts +1 -0
  200. package/lib/table/service/data/html-style.type.d.ts +1 -0
  201. package/lib/table/service/dom-service.if.d.ts +30 -0
  202. package/lib/table/service/excel-service.d.ts +24 -1
  203. package/lib/table/service/excel-service.if.d.ts +7 -0
  204. package/lib/table/service/ge-filter.service.d.ts +1 -0
  205. package/lib/table/service/simple-dom-service.d.ts +3 -1
  206. package/lib/table/service/store-state-collapsed-expand.service.d.ts +4 -3
  207. package/lib/table/service/store-state-scroll-pos.service.d.ts +3 -2
  208. package/lib/table/service/store-state-sorting.service.d.ts +4 -3
  209. package/lib/table/service/tree-row.service.d.ts +5 -1
  210. package/lib/table/state/state-storage.if.d.ts +39 -0
  211. package/lib/table/state/table-state-migration.d.ts +36 -0
  212. package/lib/table/state/table-state-part.d.ts +13 -0
  213. package/lib/table/state/table-state.if.d.ts +181 -0
  214. package/lib/table/state/table-state.service.d.ts +158 -0
  215. package/lib/table/table-api.d.ts +450 -550
  216. package/lib/table/table-scope.d.ts +288 -114
  217. package/package.json +23 -8
@@ -0,0 +1,158 @@
1
+ import { TableScope } from '../table-scope.js';
2
+ import { TableStateIf, TableStatePart } from './table-state.if.js';
3
+
4
+ /**
5
+ * Collects and applies the {@link TableStateIf} of one table, stores it ({@link AutoRestoreOptionsIf}) and reports
6
+ * changes ({@link EventListenerIf.onStateChanged}). One instance per {@link TableScope} (`tableScope.stateService`);
7
+ * use the methods of {@link TableApi} instead.
8
+ *
9
+ * Changes are only marked ({@link markDirty}); after {@link TableOptionsIf.stateChangedDebounceDelay} the dirty
10
+ * parts are computed once, compared with the last reported state, stored with ONE storage write and reported with
11
+ * ONE event – no storage access per scroll frame.
12
+ *
13
+ * @category Internals
14
+ * @since 1.1.92
15
+ */
16
+ export declare class TableStateService {
17
+ private readonly scope;
18
+ /** Suffix of the storage key: `<key>tableState`. */
19
+ static readonly STORAGE_SUFFIX = "tableState";
20
+ /** Parts that need a pass over all rows: no baseline at the start, computed only when they are used. */
21
+ private static readonly EXPENSIVE;
22
+ /** The restore of the first `firstInit()` is running (or has not finished). */
23
+ private restoring;
24
+ private started;
25
+ private destroyed;
26
+ private readonly dirty;
27
+ private timer?;
28
+ /** JSON per part of the last reported (or restored) state. */
29
+ private readonly lastReported;
30
+ /** The last reported state – a flush recomputes only the dirty parts. */
31
+ private reported;
32
+ /** The scroll position of the last reported state (a number compare – no string prefixes). */
33
+ private reportedScroll?;
34
+ /** The last stored JSON (no second write for the same state). */
35
+ private lastPersisted?;
36
+ /** The keys before 1.1.92 are removed with the first save of this table. */
37
+ private legacyRemoved;
38
+ /** Properties of the sorted columns, primary key first (the header shows only the sort states). */
39
+ private sortPriority;
40
+ /** The widths of the column definitions before anything was restored (a width is stored only if it changed). */
41
+ private readonly initialWidths;
42
+ /** The state right after the table was built – {@link resetState}. */
43
+ private defaultState?;
44
+ /** The state applied at the start: stored state over `initialState`. */
45
+ private startState;
46
+ private custom;
47
+ private warnedNoRowObject;
48
+ private warnedNoId;
49
+ constructor(scope: TableScope);
50
+ /**
51
+ * First `firstInit()` only, before `tableModel.init()`: reads the start state and applies the header groups
52
+ * (they decide which column definitions exist).
53
+ */
54
+ initBeforeModel(): void;
55
+ /** After `tableModel.init()`: remembers the defaults, applies the column layout. */
56
+ initAfterModel(): void;
57
+ /** After the external filter: tree, sorting, checked rows, selection. */
58
+ initAfterFilter(): void;
59
+ /** After the layout (scroll height known): scroll position; the restore is finished. */
60
+ initAfterLayout(): void;
61
+ /**
62
+ * The current state (all parts, or the given ones). Parts that do not apply to the table are left out (e.g. `tree`
63
+ * without a tree, `columns` without column definitions).
64
+ *
65
+ * @param {TableStatePart[]} [parts] - the parts to read, default: all
66
+ * @returns {TableStateIf} the state
67
+ */
68
+ getState(parts?: readonly TableStatePart[]): TableStateIf;
69
+ /**
70
+ * Applies the parts of a state (only the parts it contains, optionally only the given ones) and repaints.
71
+ * Reports the change with `onStateChanged` and stores it.
72
+ *
73
+ * @param {Partial<TableStateIf>} state - the state
74
+ * @param {TableStatePart[]} [parts] - only these parts
75
+ */
76
+ applyState(state: Partial<TableStateIf>, parts?: readonly TableStatePart[]): void;
77
+ /**
78
+ * Back to the state right after the table was built (the code's column layout, sort icons, header groups, without
79
+ * the restored state; tree, checked rows and selection when they are stored or were given as `initialState`),
80
+ * scrolled to the top, custom data removed – and removes the stored state.
81
+ */
82
+ resetState(): void;
83
+ /** Sets the part `custom` (data of the application). */
84
+ setCustomState(custom: unknown): void;
85
+ /** The column was sorted by a header click / `sortByColumn` – it becomes the primary sort key. */
86
+ sortedByColumn(property: string | undefined): void;
87
+ /**
88
+ * Marks a part as changed. After {@link TableOptionsIf.stateChangedDebounceDelay} the state is stored and
89
+ * reported – only if it really changed. No effect before the table is built.
90
+ *
91
+ * @param {TableStatePart} part - the changed part
92
+ */
93
+ markDirty(part: TableStatePart): void;
94
+ /** Called after each render pass: marks the scroll position as changed if it changed. */
95
+ rendered(): void;
96
+ /**
97
+ * Stores and reports the dirty parts now (normally called by the timer of {@link markDirty}).
98
+ */
99
+ flush(): void;
100
+ /** Stops the timer and stores / reports a pending change (called by `TableScope.destroy()`). */
101
+ destroy(): void;
102
+ private storageKey;
103
+ private storage;
104
+ /** The parts switched on in {@link AutoRestoreOptionsIf}. */
105
+ private persistedParts;
106
+ private warnWithoutStorageKey;
107
+ /** The stored state (or the one of the keys before 1.1.92) over `tableOptions.initialState`. */
108
+ private readStartState;
109
+ private persist;
110
+ private rememberAsReported;
111
+ private partJson;
112
+ private computePart;
113
+ private computeColumns;
114
+ private computeSort;
115
+ private computeScroll;
116
+ private computeTree;
117
+ private computeChecked;
118
+ private computeSelection;
119
+ /**
120
+ * A cell range → ids and properties. A range to the last row / column (`MAX_SAFE_INTEGER`) has no `toRowId` /
121
+ * `toProperty` ("to the end"); a range over all rows / columns has neither.
122
+ */
123
+ private toStateRange;
124
+ /** @returns true if a group changed */
125
+ private applyHeaderGroups;
126
+ /**
127
+ * Order, visibility and widths of the columns.
128
+ *
129
+ * @param {TableColumnStateIf[]} columns - the stored columns
130
+ * @param {boolean} resetMissingWidths - columns without width get the width of the code back (applyState)
131
+ * @returns true if the widths must be recalculated (a `%` or weight width came back)
132
+ */
133
+ private applyColumns;
134
+ private applyTree;
135
+ private applySort;
136
+ private applyChecked;
137
+ private applySelection;
138
+ private applyScroll;
139
+ private columnDefs;
140
+ private body;
141
+ private headerGroupModel;
142
+ /** Warn about rows without id only for parts that are stored (a `getState()` for an own use stays quiet). */
143
+ private warns;
144
+ /** The own `getRowId`, `undefined` for the default of {@link AutoRestoreOptions} (or none). */
145
+ private ownGetRowId;
146
+ /** The id of the displayed row at `index`. */
147
+ private idAt;
148
+ /**
149
+ * The id of a row (tree rows: of `row.data`): an own `getRowId`, otherwise the property `id` or `uuid`. Rows
150
+ * without id are not stored – the JSON fallback of the default `getRowId` would write whole rows (personal data)
151
+ * into the storage. Rows without an object get an id only from an own `getRowId` that declares the second
152
+ * parameter (`(_row, rowIndex) => rowIndex`).
153
+ */
154
+ private idOfRow;
155
+ /** id → displayed row index (one pass over the displayed rows). */
156
+ private rowIndexMap;
157
+ private walkTree;
158
+ }