@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
@@ -0,0 +1,58 @@
1
+ import { TreeRowIf } from '../data/common/tree-row-if.js';
2
+
3
+ /**
4
+ * The part of {@link AreaModelTree} that {@link TreeAriaInfo} reads.
5
+ *
6
+ * @since 1.1.91
7
+ * @category Accessibility
8
+ */
9
+ export interface TreeAriaModel {
10
+ getRowByIndex(rowIndex: number): TreeRowIf<unknown> | undefined;
11
+ getFilteredFlattenRows(): TreeRowIf<unknown>[];
12
+ getDisplayedRootRows(): TreeRowIf<unknown>[];
13
+ getDisplayedChildren(row: TreeRowIf<unknown>): TreeRowIf<unknown>[];
14
+ hasDisplayedChildren(row: TreeRowIf<unknown>): boolean;
15
+ }
16
+ /**
17
+ * The screen reader attributes of one tree row (`role="treegrid"`), see {@link TreeAriaInfo}.
18
+ *
19
+ * @since 1.1.91
20
+ * @category Accessibility
21
+ */
22
+ export interface TreeAriaRowInfo {
23
+ /** `aria-level`: 1 for top-level rows. */
24
+ level: number;
25
+ /** `aria-setsize`: number of displayed siblings (including the row). */
26
+ setSize: number;
27
+ /** `aria-posinset`: 1-based position among the displayed siblings. */
28
+ posInSet: number;
29
+ /** `aria-expanded`: `true`/`false` for rows with displayed children, `undefined` for leaves. */
30
+ expanded?: boolean;
31
+ }
32
+ /**
33
+ * Computes `aria-level`, `aria-setsize`, `aria-posinset` and `aria-expanded` of the rows of a tree body
34
+ * ({@link AreaModelTree}). Sizes and positions count the **displayed** siblings, i.e. with an active filter only
35
+ * the matching ones. The positions of a group of siblings are computed once and cached until the displayed rows
36
+ * change (expand, collapse, filter, sort) – so the cost per rendered row is O(1), also with a million siblings.
37
+ *
38
+ * @example
39
+ * const info = new TreeAriaInfo();
40
+ * const attrs = info.get(tableModel.getBodyModel() as AreaModelTree<OrderNode>, 0);
41
+ * // → { level: 1, setSize: 3, posInSet: 1, expanded: true }
42
+ *
43
+ * @since 1.1.91
44
+ * @category Accessibility
45
+ */
46
+ export declare class TreeAriaInfo {
47
+ private displayedRows?;
48
+ private positions;
49
+ private sizes;
50
+ /**
51
+ * The ARIA attributes of a displayed row.
52
+ *
53
+ * @param {TreeAriaModel} model - the tree body model (an {@link AreaModelTree})
54
+ * @param {number} rowIndex - index of the displayed row
55
+ * @returns {TreeAriaRowInfo | undefined} undefined if there is no such row
56
+ */
57
+ get(model: TreeAriaModel, rowIndex: number): TreeAriaRowInfo | undefined;
58
+ }
@@ -0,0 +1,31 @@
1
+ import { CheckedType } from '../data/common/checked-type.js';
2
+ import { AreaModelIf } from '../data/tablemodel/areamodel/area-model.if.js';
3
+ import { CheckboxModelIf } from './checkbox-model.if.js';
4
+
5
+ /**
6
+ * Checkbox model of the HEADER checkbox of a `CheckboxColumnDef`: it stands for all (filtered) rows of the body.
7
+ * - `isRowChecked()`: `"full"` if every body row is checked, `"semi"` if some are, `"none"` otherwise;
8
+ * - `checkRow(_, true)` checks all body rows, `checkRow(_, false)` unchecks all;
9
+ * - `getCheckedRows()` = the checked rows of the body (reported by `onCheckboxChanged`).
10
+ *
11
+ * Set by `TableModel` for a `CheckboxColumnDef` in column 0 (internal, not exported).
12
+ */
13
+ export declare class AllRowsCheckboxModel<T> implements CheckboxModelIf<T> {
14
+ private readonly bodyAreaModel;
15
+ private cache?;
16
+ constructor(bodyAreaModel: AreaModelIf);
17
+ getCheckedRows(): T[];
18
+ setCheckedRows(rows: T[]): void;
19
+ addCheckedRows(rows: T[]): void;
20
+ checkRow(_row: T, check: boolean): void;
21
+ isRowChecked(_row: T): CheckedType;
22
+ /**
23
+ * Checks the given rows of the body in addition to the checked ones; an empty array unchecks all rows.
24
+ *
25
+ * @param {T[]} rows - the rows to check (`[]` = uncheck all)
26
+ */
27
+ checkAll(rows: T[]): void;
28
+ /** The displayed top-level tree rows (with a filter: the matching ones) – cheap, no walk over all rows. */
29
+ private getTopTreeRows;
30
+ private getBodyRows;
31
+ }
@@ -1,6 +1,7 @@
1
- import { CheckedType } from '../data/common/checked-type';
2
- import { CheckboxModelIf } from './checkbox-model.if';
1
+ import { CheckedType } from '../data/common/checked-type.js';
2
+ import { CheckboxModelIf } from './checkbox-model.if.js';
3
3
 
4
+ /** @category Tree & checkboxes */
4
5
  export declare class CheckboxModel<T> implements CheckboxModelIf<T> {
5
6
  protected checkedRows: Array<T>;
6
7
  getCheckedRows(): T[];
@@ -1,5 +1,6 @@
1
- import { CheckedType } from '../data/common/checked-type';
1
+ import { CheckedType } from '../data/common/checked-type.js';
2
2
 
3
+ /** @category Tree & checkboxes */
3
4
  export interface CheckboxModelIf<T> {
4
5
  getCheckedRows(): T[];
5
6
  setCheckedRows(value: T[]): void;
@@ -1,18 +1,33 @@
1
- import { CheckedType } from '../data/common/checked-type';
2
- import { CheckboxModelIf } from './checkbox-model.if';
3
- import { TreeRowIf } from '../data/common/tree-row-if';
1
+ import { CheckedType } from '../data/common/checked-type.js';
2
+ import { CheckboxModelIf } from './checkbox-model.if.js';
3
+ import { TreeRowIf } from '../data/common/tree-row-if.js';
4
4
 
5
+ /** @category Tree & checkboxes */
5
6
  export declare class TreeCheckboxModel<T extends TreeRowIf<any>> implements CheckboxModelIf<T> {
6
7
  protected allRootNodes: T[];
7
8
  constructor(allRootNodes?: T[]);
8
9
  checkRow(row: T, sel: boolean): void;
9
- checkAll(_arr: T[]): void;
10
+ /**
11
+ * Unchecks the given rows and all their descendants – despite its name, like {@link CheckboxModel.checkAll}
12
+ * (which clears all checked rows). The parents of the given rows are updated ("semi" or "none").
13
+ *
14
+ * @param arr - the rows to uncheck together with their descendants; default: the root nodes (whole tree)
15
+ *
16
+ * @example
17
+ * const checkboxModel = new TreeCheckboxModel(TreeFactory.buildTreeRows<OrderNode>(nodes));
18
+ * checkboxModel.checkAll(); // uncheck every row of the tree
19
+ */
20
+ checkAll(arr?: T[]): void;
10
21
  getCheckedRows(): T[];
11
22
  isRowChecked(row: T): CheckedType;
23
+ /** True if the descendants of `row` are partly checked (stops at the first checked + unchecked pair). */
24
+ private hasMixedDescendants;
25
+ private setCheckedRecursive;
12
26
  setCheckedRows(rows: T[]): void;
13
27
  addCheckedRows(rows: T[]): void;
14
28
  private autoCheckParent;
15
29
  private areAllChildrenChecked;
16
30
  private areAllChildrenUnchecked;
31
+ private uncheckRecursive;
17
32
  private addSelectedRecursive;
18
33
  }
@@ -1,5 +1,6 @@
1
- import { ColorRgbIf } from './color-rgb.if';
1
+ import { ColorRgbIf } from './color-rgb.if.js';
2
2
 
3
+ /** @category Styling */
3
4
  export declare class ColorRgb implements ColorRgbIf {
4
5
  r: number;
5
6
  g: number;
@@ -2,6 +2,8 @@
2
2
  * Represents a color in RGB format.
3
3
  *
4
4
  * @interface
5
+ *
6
+ * @category Styling
5
7
  */
6
8
  export interface ColorRgbIf {
7
9
  r: number;
@@ -1,8 +1,31 @@
1
- import { TwoColorGradientArgIf } from './two-color-gradient-arg.if';
2
- import { ThreeColorGradientArgIf } from './three-color-gradient-arg.if';
1
+ import { TwoColorGradientArgIf } from './two-color-gradient-arg.if.js';
2
+ import { ThreeColorGradientArgIf } from './three-color-gradient-arg.if.js';
3
3
 
4
+ /**
5
+ * Colour gradients for heatmaps and conditional formatting – returns CSS colours like `rgb(244, 114, 182)`.
6
+ *
7
+ * @example
8
+ * const gradient = new ThreeColorGradientArg(
9
+ * 0, new ColorRgb(255, 255, 255), // min → white
10
+ * 50, new ColorRgb(244, 114, 182), // middle → pink
11
+ * 100, new ColorRgb(79, 70, 229)); // max → indigo
12
+ *
13
+ * class HeatmapModel extends AreaModelArrayOfArrays<number> {
14
+ * override getCustomStyleAt(rowIndex: number, columnIndex: number) {
15
+ * const value = Number(this.getValueAt(rowIndex, columnIndex));
16
+ * return { "background-color": GeCssColorUtil.getThreeColorGradientRGB(value, gradient) };
17
+ * }
18
+ * }
19
+ *
20
+ * @see Training: [Heatmaps and conditional formatting](https://gui.expert/training/heatmap/)
21
+ *
22
+ * @category Styling
23
+ */
4
24
  export declare class GeCssColorUtil {
25
+ /** Maps `value` from the range [fromSource, toSource] linearly to [fromTarget, toTarget]. */
5
26
  static normalize(value: number, fromSource: number, toSource: number, fromTarget?: number, toTarget?: number): number;
27
+ /** The colour for `value` between `minColor` (at `minValue`) and `maxColor` (at `maxValue`). */
6
28
  static getTwoColorGradientRGB(value: number, para: TwoColorGradientArgIf): string;
29
+ /** The colour for `value` on a min → middle → max gradient (e.g. red → white → green for negative / positive). */
7
30
  static getThreeColorGradientRGB(value: number, para: ThreeColorGradientArgIf): string;
8
31
  }
@@ -1,6 +1,7 @@
1
- import { ColorRgbIf } from './color-rgb.if';
2
- import { ThreeColorGradientArgIf } from './three-color-gradient-arg.if';
1
+ import { ColorRgbIf } from './color-rgb.if.js';
2
+ import { ThreeColorGradientArgIf } from './three-color-gradient-arg.if.js';
3
3
 
4
+ /** @category Styling */
4
5
  export declare class ThreeColorGradientArg implements ThreeColorGradientArgIf {
5
6
  minValue: number;
6
7
  minColor: ColorRgbIf;
@@ -1,9 +1,11 @@
1
- import { ColorRgbIf } from './color-rgb.if';
1
+ import { ColorRgbIf } from './color-rgb.if.js';
2
2
 
3
3
  /**
4
4
  * Interface for defining the arguments of a three-color gradient.
5
5
  *
6
6
  * @interface
7
+ *
8
+ * @category Styling
7
9
  */
8
10
  export interface ThreeColorGradientArgIf {
9
11
  minValue: number;
@@ -1,6 +1,7 @@
1
- import { ColorRgbIf } from './color-rgb.if';
2
- import { TwoColorGradientArgIf } from './two-color-gradient-arg.if';
1
+ import { ColorRgbIf } from './color-rgb.if.js';
2
+ import { TwoColorGradientArgIf } from './two-color-gradient-arg.if.js';
3
3
 
4
+ /** @category Styling */
4
5
  export declare class TwoColorGradientArg implements TwoColorGradientArgIf {
5
6
  minValue: number;
6
7
  minColor: ColorRgbIf;
@@ -1,8 +1,10 @@
1
- import { ColorRgbIf } from './color-rgb.if';
1
+ import { ColorRgbIf } from './color-rgb.if.js';
2
2
 
3
3
  /**
4
4
  * Interface representing arguments for a two-color gradient.
5
5
  * @interface
6
+ *
7
+ * @category Styling
6
8
  */
7
9
  export interface TwoColorGradientArgIf {
8
10
  minValue: number;
@@ -1,5 +1,6 @@
1
- import { ColumnWidthsIf } from './column-widths.if';
1
+ import { ColumnWidthsIf } from './column-widths.if.js';
2
2
 
3
+ /** @category CRUD */
3
4
  export declare class ColumnWidths implements ColumnWidthsIf {
4
5
  autoCalc: boolean;
5
6
  takeHeaderLabelsIntoAccount: boolean;
@@ -1,3 +1,4 @@
1
+ /** @category CRUD */
1
2
  export interface ColumnWidthsIf {
2
3
  autoCalc: boolean;
3
4
  takeHeaderLabelsIntoAccount: boolean;
@@ -1,3 +1,4 @@
1
+ /** @category CRUD */
1
2
  export declare class CrudAction {
2
3
  action: string;
3
4
  label: string;
@@ -1,11 +1,33 @@
1
+ /**
2
+ * Edit dialog (`<dialog>` with one form) for an object: one input per property, nested objects flattened
3
+ * (`address.city`), the id property (`idKey`) is not editable.
4
+ *
5
+ * - Works on a deep copy – the object passed in is not changed.
6
+ * - Values keep their type: numbers stay numbers (an empty number field becomes `null`), booleans are checkboxes
7
+ * (unchecking saves `false`), `null`/`undefined` stay as they are while their text field is left empty.
8
+ * - Labels and values are escaped – data is shown as text, never as markup.
9
+ * - Save calls `onSave(editedCopy)`; Save, Cancel and Escape close and remove the dialog.
10
+ *
11
+ * @example
12
+ * new CrudObjectEdit('id', { id: 7, name: 'Ada', age: 36, vip: true }, 'Edit customer')
13
+ * .openDialog(updated => console.info(updated)); // { id: 7, name: '…', age: 37, vip: false }
14
+ *
15
+ * @category CRUD
16
+ */
1
17
  export declare class CrudObjectEdit<T extends Record<string, any>> {
2
18
  private idKey;
3
19
  dialogTitle: string;
4
20
  private object;
21
+ /** Property path of every input (index = `data-field-index`) – a key may contain a dot itself. */
22
+ private fieldPaths;
5
23
  constructor(idKey: keyof T, obj: T, dialogTitle?: string);
6
24
  openDialog(onSave: (updatedObject: T) => void): void;
7
- private generateForm;
25
+ /** The input fields for all properties of `obj` (recursive for nested objects – no nested `<form>`). */
26
+ private generateFields;
27
+ /** The value of an input, in the type of the original value. */
28
+ private readInput;
29
+ private getNestedValue;
8
30
  private setNestedValue;
9
- private getCombinedKey;
10
- private getLabel;
31
+ /** A deep copy (structuredClone; JSON as fallback for objects that cannot be cloned, e.g. with functions). */
32
+ private static deepCopy;
11
33
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Read-only dialog (`<dialog>`) that lists all properties of an object (nested objects flattened). Labels and values
3
+ * are escaped – data is shown as text, never as markup.
4
+ *
5
+ * @category CRUD
6
+ */
1
7
  export declare class CrudObjectView<T extends Record<string, any>> {
2
8
  private object;
3
9
  constructor(obj: T);
@@ -1,8 +1,37 @@
1
- import { CrudOptionsIf } from './crud-options.if';
2
- import { UrlsIf } from './urls.if';
3
- import { CrudAction } from './crud-action';
4
- import { ColumnWidthsIf } from './column-widths.if';
1
+ import { CrudOptionsIf } from './crud-options.if.js';
2
+ import { UrlsIf } from './urls.if.js';
3
+ import { CrudAction } from './crud-action.js';
4
+ import { ColumnWidthsIf } from './column-widths.if.js';
5
5
 
6
+ /**
7
+ * Settings and REST calls of a CRUD table ({@link CrudTableModelFactory}).
8
+ *
9
+ * The default REST calls use `fetch`:
10
+ * - `{id}` in a URL is replaced by the URL-encoded id (`/api/items/{id}` → `/api/items/a%2Fb`);
11
+ * - requests with a body (`updateItem`, `createItem`) send JSON with `Content-Type: application/json`
12
+ * (unless `getHeadersInit()` already sets a `Content-Type`);
13
+ * - the promise is rejected for an HTTP error status (4xx/5xx) and when no URL is configured;
14
+ * an empty response body (e.g. `204 No Content`) resolves with `undefined`.
15
+ *
16
+ * Every call can be replaced, e.g. to use your own HTTP client.
17
+ *
18
+ * @example
19
+ * const crudOptions: CrudOptions = {
20
+ * ...new CrudOptions(),
21
+ * urls: {
22
+ * list: new UrlInfo('GET', '/api/customers'),
23
+ * read: new UrlInfo('GET', '/api/customers/{id}'),
24
+ * update: new UrlInfo('PUT', '/api/customers/{id}'),
25
+ * create: new UrlInfo('POST', '/api/customers'),
26
+ * delete: new UrlInfo('DELETE', '/api/customers/{id}'),
27
+ * },
28
+ * getHeadersInit: () => ({ Authorization: 'Bearer my-token' }),
29
+ * getIdKey: () => 'customerId',
30
+ * getEmptyItem: () => ({ name: '', vip: false, credit: 0 }),
31
+ * };
32
+ *
33
+ * @category CRUD
34
+ */
6
35
  export declare class CrudOptions implements CrudOptionsIf {
7
36
  urls: UrlsIf;
8
37
  singleRowActions: CrudAction[];
@@ -11,7 +40,9 @@ export declare class CrudOptions implements CrudOptionsIf {
11
40
  columnWidths: ColumnWidthsIf;
12
41
  calcFixedRightColumnCount: (columnCount: number) => number;
13
42
  getHeadersInit: (() => HeadersInit);
43
+ /** The property that holds the id of an item (default `'id'`). */
14
44
  getIdKey: () => string;
45
+ /** The id of an item: the value of its `getIdKey()` property (`undefined` if it has none). */
15
46
  getIdByObject: <T extends Record<string, unknown>>(o: T) => any;
16
47
  fetchList: <T>(crudOptions: CrudOptionsIf) => Promise<T[]>;
17
48
  fetchItem: <T>(crudOptions: CrudOptionsIf, id: any) => Promise<T>;
@@ -1,6 +1,7 @@
1
- import { UrlsIf } from './urls.if';
2
- import { CrudAction } from './crud-action';
1
+ import { UrlsIf } from './urls.if.js';
2
+ import { CrudAction } from './crud-action.js';
3
3
 
4
+ /** @category CRUD */
4
5
  export interface CrudOptionsIf {
5
6
  getHeadersInit?: () => HeadersInit;
6
7
  urls: UrlsIf;
@@ -1,12 +1,42 @@
1
- import { CrudOptions } from './crud-options';
2
- import { CreateTableModelPara } from '../factory/table-factory';
3
- import { TableModelAndOptionsIf } from '../data/table-model-and-options.if';
4
- import { ActionEventListenerIf } from '../renderer/action/action-event-listener.if';
5
- import { ActionEventIf } from '../renderer/action/action-event.if';
6
- import { TableModelIf } from '../data/tablemodel/table-model.if';
7
- import { TableOptionsIf } from '../data/options/table-options.if';
8
- import { AreaModelObjectArrayWithColumndefs } from '../data/tablemodel/areamodel/area-model-object-array-with-columndefs';
1
+ import { CrudOptions } from './crud-options.js';
2
+ import { CreateTableModelPara } from '../factory/table-factory.js';
3
+ import { TableModelAndOptionsIf } from '../data/table-model-and-options.if.js';
4
+ import { ActionEventListenerIf } from '../renderer/action/action-event-listener.if.js';
5
+ import { ActionEventIf } from '../renderer/action/action-event.if.js';
6
+ import { TableModelIf } from '../data/tablemodel/table-model.if.js';
7
+ import { TableOptionsIf } from '../data/options/table-options.if.js';
8
+ import { AreaModelObjectArrayWithColumndefs } from '../data/tablemodel/areamodel/area-model-object-array-with-columndefs.js';
9
9
 
10
+ /**
11
+ * Builds a table for a REST resource: loads the list (`crudOptions.fetchList`), derives the columns from the first item
12
+ * (nested objects flattened, e.g. `address.city`) and adds an "Actions" column (View / Edit / Clone / Delete) whose
13
+ * links open the CRUD dialogs ({@link CrudTableModelFactory.onActionEvent}). The table shows the result of a save or
14
+ * delete without reloading the list.
15
+ *
16
+ * @example
17
+ * const factory = new CrudTableModelFactory();
18
+ * factory.createTableModel(
19
+ * {
20
+ * ...new CrudOptions(),
21
+ * urls: {
22
+ * list: new UrlInfo('GET', '/api/customers'),
23
+ * read: new UrlInfo('GET', '/api/customers/{id}'),
24
+ * update: new UrlInfo('PUT', '/api/customers/{id}'),
25
+ * create: new UrlInfo('POST', '/api/customers'),
26
+ * delete: new UrlInfo('DELETE', '/api/customers/{id}'),
27
+ * },
28
+ * getEmptyItem: () => ({ name: '', vip: false }),
29
+ * },
30
+ * {},
31
+ * ({ tableModel, tableOptions }) => {
32
+ * const tableScope = new TableScope(hostDiv, tableModel, new SimpleDomService(), tableOptions, new EventAdapter());
33
+ * tableScope.firstInit();
34
+ * }
35
+ * );
36
+ * document.querySelector('#create')!.addEventListener('click', () => factory.openDialogForCreate());
37
+ *
38
+ * @category CRUD
39
+ */
10
40
  export declare class CrudTableModelFactory implements ActionEventListenerIf {
11
41
  tableModel: TableModelIf | undefined;
12
42
  bodyModel: AreaModelObjectArrayWithColumndefs<any> | undefined;
@@ -15,7 +45,33 @@ export declare class CrudTableModelFactory implements ActionEventListenerIf {
15
45
  listenActionEvent: (actionEvent: ActionEventIf) => void;
16
46
  createTableModel<T>(crudOptions: CrudOptions, p: Partial<CreateTableModelPara>, callback?: (tableModelAndOptions: TableModelAndOptionsIf) => void, listenActionEvent?: (actionEvent: ActionEventIf) => void): void;
17
47
  openDialogForCreate(): void;
48
+ /**
49
+ * Handles the actions of the action column (and `CREATE`): the listener of {@link createTableModel} is called first,
50
+ * then
51
+ * - `VIEW`: `fetchItem` → {@link CrudObjectView};
52
+ * - `EDIT`: `fetchItem` → {@link CrudObjectEdit} → Save: `updateItem(id, item)`, the row shows the saved values
53
+ * (the response, if it is an item with id – otherwise the edited item);
54
+ * - `CLONE` / `CREATE`: `fetchItem` resp. `getEmptyItem()` → {@link CrudObjectEdit} → Save: `createItem(item)` – without
55
+ * the id property, the server assigns it. If the response is an item with id, it is added as last row, otherwise the
56
+ * list is loaded again (`fetchList`);
57
+ * - `DELETE`: `deleteItem(id)` → the row is removed.
58
+ *
59
+ * A failed request is logged with `console.error`; the table stays unchanged.
60
+ */
18
61
  onActionEvent(actionEvent: ActionEventIf): void;
62
+ /** `createItem` without the id property (the server assigns it), then shows the new row. */
63
+ private createItem;
64
+ /** Copies the saved values into the row with the given id (rows, filter and sort order stay as they are). */
65
+ private updateRow;
66
+ /** Appends a new row (shown as last row, also with an active filter or sort order). */
67
+ private addRow;
68
+ /** Loads the list again (`fetchList`) – after a create whose response does not contain the new item. */
69
+ private reloadRows;
70
+ private getIdKey;
71
+ /** The action column carries the id as text (data-id) – compare as strings. */
72
+ private hasId;
73
+ private isItemWithId;
74
+ private logError;
19
75
  private calcAutoColumnWidths;
20
76
  private getValueByT;
21
77
  private getPropertyValue;
@@ -1,5 +1,6 @@
1
- import { UrlInfoIf } from './url-info.if';
1
+ import { UrlInfoIf } from './url-info.if.js';
2
2
 
3
+ /** @category CRUD */
3
4
  export declare class UrlInfo implements UrlInfoIf {
4
5
  method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'PATCH';
5
6
  url: string;
@@ -1,3 +1,4 @@
1
+ /** @category CRUD */
1
2
  export interface UrlInfoIf {
2
3
  url: string;
3
4
  method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'PATCH';
@@ -1,5 +1,6 @@
1
- import { UrlInfoIf } from './url-info.if';
1
+ import { UrlInfoIf } from './url-info.if.js';
2
2
 
3
+ /** @category CRUD */
3
4
  export interface UrlsIf {
4
5
  list: UrlInfoIf;
5
6
  create?: UrlInfoIf;
@@ -1,3 +1,4 @@
1
+ /** @category Styling */
1
2
  export declare class CssVars {
2
3
  static readonly themes: string[];
3
4
  static readonly vars: {
@@ -1,6 +1,7 @@
1
- import { ChunkDataIf } from './chunk.data-event.if';
2
- import { RequestChunk } from './request-chunk';
1
+ import { ChunkDataIf } from './chunk.data-event.if.js';
2
+ import { RequestChunk } from './request-chunk.js';
3
3
 
4
+ /** @category Utilities */
4
5
  export declare class ChunkData<T> extends RequestChunk implements ChunkDataIf<T> {
5
6
  rows: T[];
6
7
  constructor(emmitDataKey: string, emmitCancelKey: string, queryId: string, // which sql
@@ -1,5 +1,6 @@
1
- import { RequestChunkIf } from './request-chunk.if';
1
+ import { RequestChunkIf } from './request-chunk.if.js';
2
2
 
3
+ /** @category Utilities */
3
4
  export interface ChunkDataIf<T> extends RequestChunkIf {
4
5
  rows: T[];
5
6
  }
@@ -1,5 +1,6 @@
1
- import { RequestChunkIf } from './request-chunk.if';
1
+ import { RequestChunkIf } from './request-chunk.if.js';
2
2
 
3
+ /** @category Utilities */
3
4
  export declare class RequestChunk implements RequestChunkIf {
4
5
  emmitDataKey: string;
5
6
  emmitCancelKey: string;
@@ -1,3 +1,4 @@
1
+ /** @category Utilities */
1
2
  export interface RequestChunkIf {
2
3
  emmitDataKey: string;
3
4
  emmitCancelKey: string;
@@ -1,9 +1,21 @@
1
+ /**
2
+ * CSS classes for {@link ColumnDefIf.classes}: body cells left-aligned – `new ColumnDef("city", "City", px120, bodyLeft)`.
3
+ * @category Columns
4
+ */
1
5
  export declare const bodyLeft: {
2
6
  body: string[];
3
7
  };
8
+ /**
9
+ * CSS classes for {@link ColumnDefIf.classes}: body cells centered – `new ColumnDef("city", "City", px120, bodyCenter)`.
10
+ * @category Columns
11
+ */
4
12
  export declare const bodyCenter: {
5
13
  body: string[];
6
14
  };
15
+ /**
16
+ * CSS classes for {@link ColumnDefIf.classes}: body cells right-aligned – `new ColumnDef("city", "City", px120, bodyRight)`.
17
+ * @category Columns
18
+ */
7
19
  export declare const bodyRight: {
8
20
  body: string[];
9
21
  };
@@ -13,6 +25,8 @@ export declare const bodyRight: {
13
25
  * @property {Array.<string>} header - The CSS class(es) for aligning text to the left in the table header.
14
26
  * @property {Array.<string>} body - The CSS class(es) for aligning text to the left in the table body.
15
27
  * @property {Array.<string>} footer - The CSS class(es) for aligning text to the left in the table footer.
28
+ *
29
+ * @category Columns
16
30
  */
17
31
  export declare const allLeft: {
18
32
  header: string[];
@@ -26,6 +40,8 @@ export declare const allLeft: {
26
40
  * @property {Array.<string>} header - The alignment classes for the table header.
27
41
  * @property {Array.<string>} body - The alignment classes for the table body.
28
42
  * @property {Array.<string>} footer - The alignment classes for the table footer.
43
+ *
44
+ * @category Columns
29
45
  */
30
46
  export declare const allCenter: {
31
47
  header: string[];
@@ -39,6 +55,8 @@ export declare const allCenter: {
39
55
  * @property {Array} header - An array containing CSS classes for aligning text right in the table header.
40
56
  * @property {Array} body - An array containing CSS classes for aligning text right in the table body.
41
57
  * @property {Array} footer - An array containing CSS classes for aligning text right in the table footer.
58
+ *
59
+ * @category Columns
42
60
  */
43
61
  export declare const allRight: {
44
62
  header: string[];
@@ -1,6 +1,7 @@
1
- import { AreaObjectMap } from './area-map';
2
- import { CellRendererIf } from '../../renderer/cell-render.if';
1
+ import { AreaObjectMap } from './area-map.js';
2
+ import { CellRendererIf } from '../../renderer/cell-render.if.js';
3
3
 
4
+ /** @category Columns */
4
5
  export declare class AreaMapFactory {
5
6
  /**
6
7
  * A factory that creates a new AreaObjectMap with the given body renderer.
@@ -1,4 +1,4 @@
1
- import { AreaObjectMapType } from './area-map.type';
1
+ import { AreaObjectMapType } from './area-map.type.js';
2
2
 
3
3
  /**
4
4
  * An object map as container for all three areas.
@@ -6,6 +6,8 @@ import { AreaObjectMapType } from './area-map.type';
6
6
  * @template T - The type of objects stored in the map.
7
7
  * @class
8
8
  * @implements {AreaObjectMapType<T>}
9
+ *
10
+ * @category Columns
9
11
  */
10
12
  export declare class AreaObjectMap<T> implements AreaObjectMapType<T> {
11
13
  header?: T | undefined;
@@ -1,3 +1,4 @@
1
+ /** @category Columns */
1
2
  export type AreaObjectMapType<T> = {
2
3
  header?: T | undefined;
3
4
  body?: T | undefined;
@@ -1,11 +1,13 @@
1
- import { AreaIdent } from '../tablemodel/area-ident.type';
2
- import { SideIdent } from '../side-ident.type';
3
- import { AreaModelIf } from '../tablemodel/areamodel/area-model.if';
4
- import { GeoData } from '../geo-data';
1
+ import { AreaIdent } from '../tablemodel/area-ident.type.js';
2
+ import { SideIdent } from '../side-ident.type.js';
3
+ import { AreaModelIf } from '../tablemodel/areamodel/area-model.if.js';
4
+ import { GeoData } from '../geo-data.js';
5
5
 
6
6
  /**
7
7
  * Represents the parameters required for adjusting columns to the row parent.
8
8
  * @interface ArgsAdjustColumnsToRowParentParams
9
+ *
10
+ * @category Internals
9
11
  */
10
12
  export interface ArgsAdjustColumnsToRowParentParams {
11
13
  areaIdent: AreaIdent;