@guiexpert/table 1.1.17 → 1.1.20

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 (326) hide show
  1. package/.eslintrc.json +16 -0
  2. package/dist/README.md +101 -0
  3. package/dist/css/main.css +350 -0
  4. package/dist/css/table-classes.css +42 -0
  5. package/dist/css/table-color-classes.css +98 -0
  6. package/dist/css/table-color-vars.css +158 -0
  7. package/dist/css/table-tree.css +53 -0
  8. package/dist/index.cjs +351 -0
  9. package/{index.d.ts → dist/index.d.ts} +3 -0
  10. package/{index.js → dist/index.js} +902 -831
  11. package/dist/lib/common/decorator/avoid-double-execution.decorator.d.ts +7 -0
  12. package/{lib → dist/lib}/table/event-listener.if.d.ts +3 -1
  13. package/dist/lib/table/focus/event-focus-changed-listener.if.d.ts +4 -0
  14. package/{lib → dist/lib}/table/focus/focus-model.d.ts +6 -0
  15. package/dist/lib/table/focus/focus-model.if.d.ts +12 -0
  16. package/dist/lib/table/renderer/positive-and-negative-number-renderer.d.ts +8 -0
  17. package/dist/lib/table/selection/event-selection-changed-listener.if.d.ts +4 -0
  18. package/{lib → dist/lib}/table/selection/multi-rows-selection-model.d.ts +9 -0
  19. package/{lib → dist/lib}/table/selection/selection-model.d.ts +7 -0
  20. package/{lib → dist/lib}/table/selection/selection-model.if.d.ts +4 -0
  21. package/{lib → dist/lib}/table/table-scope.d.ts +6 -2
  22. package/dist/package.json +51 -0
  23. package/doc.css +1565 -0
  24. package/package.json +27 -8
  25. package/patch.js +16 -0
  26. package/src/index.ts +176 -0
  27. package/src/lib/common/decorator/avoid-double-execution.decorator.ts +21 -0
  28. package/src/lib/table/action/action-id.type.ts +36 -0
  29. package/src/lib/table/action/on-action-triggered.if.ts +14 -0
  30. package/src/lib/table/action/osx-shortcut-actionId-mapping.ts +39 -0
  31. package/src/lib/table/action/shortcut-actionid-mapping.type.ts +7 -0
  32. package/src/lib/table/action/shortcut.service.ts +162 -0
  33. package/src/lib/table/action/windows-shortcut-actionId-mapping.ts +35 -0
  34. package/src/lib/table/checkbox/checkbox-model.if.ts +16 -0
  35. package/src/lib/table/checkbox/checkbox-model.ts +62 -0
  36. package/src/lib/table/checkbox/tree-checkbox-model.ts +123 -0
  37. package/src/lib/table/color/color-rgb.if.ts +12 -0
  38. package/src/lib/table/color/color-rgb.ts +10 -0
  39. package/src/lib/table/color/ge-css-color-util.ts +43 -0
  40. package/src/lib/table/color/three-color-gradient-arg.if.ts +15 -0
  41. package/src/lib/table/color/three-color-gradient-arg.ts +14 -0
  42. package/src/lib/table/color/two-color-gradient-arg.if.ts +12 -0
  43. package/src/lib/table/color/two-color-gradient-arg.ts +12 -0
  44. package/src/lib/table/css-vars.ts +243 -0
  45. package/src/lib/table/data/chunk/chunk.data-event.if.ts +8 -0
  46. package/src/lib/table/data/chunk/chunk.data-event.ts +27 -0
  47. package/src/lib/table/data/chunk/request-chunk.if.ts +9 -0
  48. package/src/lib/table/data/chunk/request-chunk.ts +15 -0
  49. package/src/lib/table/data/common/aligns.ts +42 -0
  50. package/src/lib/table/data/common/area-map-factory.ts +20 -0
  51. package/src/lib/table/data/common/area-map.ts +18 -0
  52. package/src/lib/table/data/common/area-map.type.ts +5 -0
  53. package/src/lib/table/data/common/args-adjust-columns-to-row-parent-params.ts +21 -0
  54. package/src/lib/table/data/common/args-render-cell-div.ts +34 -0
  55. package/src/lib/table/data/common/boolean-function.ts +16 -0
  56. package/src/lib/table/data/common/cell-range.ts +66 -0
  57. package/src/lib/table/data/common/checkbox-column-def.ts +31 -0
  58. package/src/lib/table/data/common/checked-type.ts +6 -0
  59. package/src/lib/table/data/common/event/ge-cell-indices.ts +12 -0
  60. package/src/lib/table/data/common/event/ge-key-event.ts +15 -0
  61. package/src/lib/table/data/common/event/ge-model-change-event.ts +16 -0
  62. package/src/lib/table/data/common/event/ge-mouse-event.ts +41 -0
  63. package/src/lib/table/data/common/event/input/table-cell-update-event.if.ts +58 -0
  64. package/src/lib/table/data/common/event/input/table-cell-update-event.ts +27 -0
  65. package/src/lib/table/data/common/filter-function.ts +9 -0
  66. package/src/lib/table/data/common/get-t.ts +7 -0
  67. package/src/lib/table/data/common/index-and-px.ts +12 -0
  68. package/src/lib/table/data/common/size.if.ts +8 -0
  69. package/src/lib/table/data/common/size.ts +9 -0
  70. package/src/lib/table/data/common/sizes.ts +35 -0
  71. package/src/lib/table/data/common/sort-item.ts +14 -0
  72. package/src/lib/table/data/common/sort-state.type.ts +7 -0
  73. package/src/lib/table/data/common/tree-arrow.type.ts +8 -0
  74. package/src/lib/table/data/common/tree-row-if.ts +15 -0
  75. package/src/lib/table/data/common/tree-row.ts +22 -0
  76. package/src/lib/table/data/common/value-label.if.ts +6 -0
  77. package/src/lib/table/data/common/value-label.ts +13 -0
  78. package/src/lib/table/data/div-scope.type.ts +14 -0
  79. package/src/lib/table/data/event/mouse-target-data.ts +48 -0
  80. package/src/lib/table/data/geo-data.ts +16 -0
  81. package/src/lib/table/data/options/auto-restore-options.if.ts +21 -0
  82. package/src/lib/table/data/options/auto-restore-options.ts +50 -0
  83. package/src/lib/table/data/options/default-row-heights.if.ts +5 -0
  84. package/src/lib/table/data/options/default-row-heights.ts +10 -0
  85. package/src/lib/table/data/options/header-group-options.if.ts +9 -0
  86. package/src/lib/table/data/options/header-group-options.ts +23 -0
  87. package/src/lib/table/data/options/icon.if.ts +20 -0
  88. package/src/lib/table/data/options/icon.ts +10 -0
  89. package/src/lib/table/data/options/sorted-options.if.ts +13 -0
  90. package/src/lib/table/data/options/sorted-options.ts +15 -0
  91. package/src/lib/table/data/options/table-options.if.ts +240 -0
  92. package/src/lib/table/data/options/table-options.ts +68 -0
  93. package/src/lib/table/data/options/tree-options.if.ts +10 -0
  94. package/src/lib/table/data/options/tree-options.ts +32 -0
  95. package/src/lib/table/data/side-ident.type.ts +4 -0
  96. package/src/lib/table/data/table-model-and-options.if.ts +11 -0
  97. package/src/lib/table/data/table-model-and-options.ts +16 -0
  98. package/src/lib/table/data/tablemodel/area-ident.type.ts +18 -0
  99. package/src/lib/table/data/tablemodel/areamodel/abstract-area-model.ts +184 -0
  100. package/src/lib/table/data/tablemodel/areamodel/area-model-array-of-arrays.ts +63 -0
  101. package/src/lib/table/data/tablemodel/areamodel/area-model-cell-groups.ts +236 -0
  102. package/src/lib/table/data/tablemodel/areamodel/area-model-hidden.ts +126 -0
  103. package/src/lib/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.ts +28 -0
  104. package/src/lib/table/data/tablemodel/areamodel/area-model-object-array.ts +120 -0
  105. package/src/lib/table/data/tablemodel/areamodel/area-model-tree.ts +224 -0
  106. package/src/lib/table/data/tablemodel/areamodel/area-model.if.ts +192 -0
  107. package/src/lib/table/data/tablemodel/areamodel/area-model.ts +117 -0
  108. package/src/lib/table/data/tablemodel/areamodel/async-area-model-object-array.ts +110 -0
  109. package/src/lib/table/data/tablemodel/areamodel/col-and-rowspan-model.ts +64 -0
  110. package/src/lib/table/data/tablemodel/areamodel/has-default-row-height-if.ts +3 -0
  111. package/src/lib/table/data/tablemodel/areamodel/object-array-holder.if.ts +8 -0
  112. package/src/lib/table/data/tablemodel/cellgroup/cell-group-ext.ts +172 -0
  113. package/src/lib/table/data/tablemodel/cellgroup/cell-group.if.ts +12 -0
  114. package/src/lib/table/data/tablemodel/cellgroup/cell-group.ts +18 -0
  115. package/src/lib/table/data/tablemodel/cellgroup/cellgroup-factory.ts +148 -0
  116. package/src/lib/table/data/tablemodel/column/column-def.if.ts +141 -0
  117. package/src/lib/table/data/tablemodel/column/column-def.ts +108 -0
  118. package/src/lib/table/data/tablemodel/padding.ts +12 -0
  119. package/src/lib/table/data/tablemodel/table-model.if.ts +256 -0
  120. package/src/lib/table/data/tablemodel/table-model.ts +542 -0
  121. package/src/lib/table/ele-scope.ts +309 -0
  122. package/src/lib/table/event-adapter.ts +43 -0
  123. package/src/lib/table/event-listener.if.ts +32 -0
  124. package/src/lib/table/factory/table-factory.ts +379 -0
  125. package/src/lib/table/factory/tree-factory.ts +52 -0
  126. package/src/lib/table/focus/event-focus-changed-listener.if.ts +8 -0
  127. package/src/lib/table/focus/focus-model.if.ts +20 -0
  128. package/src/lib/table/focus/focus-model.ts +76 -0
  129. package/src/lib/table/focus/focus.type.ts +4 -0
  130. package/src/lib/table/input-handler.ts +48 -0
  131. package/src/lib/table/instanceof-workaround.ts +41 -0
  132. package/src/lib/table/license-manager.ts +47 -0
  133. package/src/lib/table/mouse-handler.ts +307 -0
  134. package/src/lib/table/render-scope.ts +1440 -0
  135. package/src/lib/table/renderer/cell-group-ext-cell-renderer.ts +123 -0
  136. package/src/lib/table/renderer/cell-render.if.ts +16 -0
  137. package/src/lib/table/renderer/checkbox-boolean-property-cell-renderer.ts +63 -0
  138. package/src/lib/table/renderer/checkbox-cell-renderer.ts +39 -0
  139. package/src/lib/table/renderer/date-to-int-date-cell-renderer.ts +39 -0
  140. package/src/lib/table/renderer/date-to-iso-cell-renderer.ts +25 -0
  141. package/src/lib/table/renderer/date-to-locale-date-cell-renderer.ts +24 -0
  142. package/src/lib/table/renderer/date-to-tec-cell-renderer.ts +28 -0
  143. package/src/lib/table/renderer/edit/edit-cell-renderer.type.ts +3 -0
  144. package/src/lib/table/renderer/edit/edit-input-pipe-for-number.ts +6 -0
  145. package/src/lib/table/renderer/edit/edit-input-pipe.if.ts +15 -0
  146. package/src/lib/table/renderer/edit/input-cell-renderer.ts +41 -0
  147. package/src/lib/table/renderer/edit/select-cell-renderer.ts +60 -0
  148. package/src/lib/table/renderer/male-female-to-icon-cell-renderer.ts +26 -0
  149. package/src/lib/table/renderer/number-cell-progress-bar-cell-renderer.ts +57 -0
  150. package/src/lib/table/renderer/number-cell-renderer.ts +38 -0
  151. package/src/lib/table/renderer/positive-and-negative-number-renderer.ts +45 -0
  152. package/src/lib/table/renderer/progress-bar-cell-renderer.ts +60 -0
  153. package/src/lib/table/renderer/renderer-cleanup-fn.type.ts +1 -0
  154. package/src/lib/table/renderer/renderer.ts +11 -0
  155. package/src/lib/table/renderer/star-rating-cell-renderer.ts +45 -0
  156. package/src/lib/table/renderer/true-false-cell-renderer.ts +28 -0
  157. package/src/lib/table/selection/event-selection-changed-listener.if.ts +8 -0
  158. package/src/lib/table/selection/multi-rows-selection-model.ts +118 -0
  159. package/src/lib/table/selection/selection-model.if.ts +56 -0
  160. package/src/lib/table/selection/selection-model.ts +182 -0
  161. package/src/lib/table/selection/selection-service.ts +129 -0
  162. package/src/lib/table/selection/selection.type.ts +6 -0
  163. package/src/lib/table/service/abstract-store-state.service.ts +105 -0
  164. package/src/lib/table/service/convenience-dom.service.ts +574 -0
  165. package/src/lib/table/service/copy-service.if.ts +45 -0
  166. package/src/lib/table/service/copy-service.ts +130 -0
  167. package/src/lib/table/service/data/collapsed-expanded.data.ts +11 -0
  168. package/src/lib/table/service/data/html-style.type.ts +1 -0
  169. package/src/lib/table/service/dom-service.if.ts +18 -0
  170. package/src/lib/table/service/ge-filter.service.ts +123 -0
  171. package/src/lib/table/service/simple-dom-service.ts +55 -0
  172. package/src/lib/table/service/sorter.service.ts +30 -0
  173. package/src/lib/table/service/store-state-collapsed-expand.service.ts +76 -0
  174. package/src/lib/table/service/store-state-scroll-pos.service.ts +40 -0
  175. package/src/lib/table/service/store-state-sorting.service.ts +41 -0
  176. package/src/lib/table/service/tree-row.service.ts +32 -0
  177. package/src/lib/table/table-api.ts +234 -0
  178. package/src/lib/table/table-scope.ts +770 -0
  179. package/tsconfig.json +21 -0
  180. package/tsconfig.lib.json +10 -0
  181. package/tsconfig.spec.json +25 -0
  182. package/vite.config.ts +56 -0
  183. package/index.cjs +0 -351
  184. package/lib/table/focus/focus-model.if.d.ts +0 -8
  185. package/lib/table/renderer/positive-and-negative-number-renderer.d.ts +0 -4
  186. /package/{lib → dist/lib}/table/action/action-id.type.d.ts +0 -0
  187. /package/{lib → dist/lib}/table/action/on-action-triggered.if.d.ts +0 -0
  188. /package/{lib → dist/lib}/table/action/osx-shortcut-actionId-mapping.d.ts +0 -0
  189. /package/{lib → dist/lib}/table/action/shortcut-actionid-mapping.type.d.ts +0 -0
  190. /package/{lib → dist/lib}/table/action/shortcut.service.d.ts +0 -0
  191. /package/{lib → dist/lib}/table/action/windows-shortcut-actionId-mapping.d.ts +0 -0
  192. /package/{lib → dist/lib}/table/checkbox/checkbox-model.d.ts +0 -0
  193. /package/{lib → dist/lib}/table/checkbox/checkbox-model.if.d.ts +0 -0
  194. /package/{lib → dist/lib}/table/checkbox/tree-checkbox-model.d.ts +0 -0
  195. /package/{lib → dist/lib}/table/color/color-rgb.d.ts +0 -0
  196. /package/{lib → dist/lib}/table/color/color-rgb.if.d.ts +0 -0
  197. /package/{lib → dist/lib}/table/color/ge-css-color-util.d.ts +0 -0
  198. /package/{lib → dist/lib}/table/color/three-color-gradient-arg.d.ts +0 -0
  199. /package/{lib → dist/lib}/table/color/three-color-gradient-arg.if.d.ts +0 -0
  200. /package/{lib → dist/lib}/table/color/two-color-gradient-arg.d.ts +0 -0
  201. /package/{lib → dist/lib}/table/color/two-color-gradient-arg.if.d.ts +0 -0
  202. /package/{lib → dist/lib}/table/css-vars.d.ts +0 -0
  203. /package/{lib → dist/lib}/table/data/chunk/chunk.data-event.d.ts +0 -0
  204. /package/{lib → dist/lib}/table/data/chunk/chunk.data-event.if.d.ts +0 -0
  205. /package/{lib → dist/lib}/table/data/chunk/request-chunk.d.ts +0 -0
  206. /package/{lib → dist/lib}/table/data/chunk/request-chunk.if.d.ts +0 -0
  207. /package/{lib → dist/lib}/table/data/common/aligns.d.ts +0 -0
  208. /package/{lib → dist/lib}/table/data/common/area-map-factory.d.ts +0 -0
  209. /package/{lib → dist/lib}/table/data/common/area-map.d.ts +0 -0
  210. /package/{lib → dist/lib}/table/data/common/area-map.type.d.ts +0 -0
  211. /package/{lib → dist/lib}/table/data/common/args-adjust-columns-to-row-parent-params.d.ts +0 -0
  212. /package/{lib → dist/lib}/table/data/common/args-render-cell-div.d.ts +0 -0
  213. /package/{lib → dist/lib}/table/data/common/boolean-function.d.ts +0 -0
  214. /package/{lib → dist/lib}/table/data/common/cell-range.d.ts +0 -0
  215. /package/{lib → dist/lib}/table/data/common/checkbox-column-def.d.ts +0 -0
  216. /package/{lib → dist/lib}/table/data/common/checked-type.d.ts +0 -0
  217. /package/{lib → dist/lib}/table/data/common/event/ge-cell-indices.d.ts +0 -0
  218. /package/{lib → dist/lib}/table/data/common/event/ge-key-event.d.ts +0 -0
  219. /package/{lib → dist/lib}/table/data/common/event/ge-model-change-event.d.ts +0 -0
  220. /package/{lib → dist/lib}/table/data/common/event/ge-mouse-event.d.ts +0 -0
  221. /package/{lib → dist/lib}/table/data/common/event/input/table-cell-update-event.d.ts +0 -0
  222. /package/{lib → dist/lib}/table/data/common/event/input/table-cell-update-event.if.d.ts +0 -0
  223. /package/{lib → dist/lib}/table/data/common/filter-function.d.ts +0 -0
  224. /package/{lib → dist/lib}/table/data/common/get-t.d.ts +0 -0
  225. /package/{lib → dist/lib}/table/data/common/index-and-px.d.ts +0 -0
  226. /package/{lib → dist/lib}/table/data/common/size.d.ts +0 -0
  227. /package/{lib → dist/lib}/table/data/common/size.if.d.ts +0 -0
  228. /package/{lib → dist/lib}/table/data/common/sizes.d.ts +0 -0
  229. /package/{lib → dist/lib}/table/data/common/sort-item.d.ts +0 -0
  230. /package/{lib → dist/lib}/table/data/common/sort-state.type.d.ts +0 -0
  231. /package/{lib → dist/lib}/table/data/common/tree-arrow.type.d.ts +0 -0
  232. /package/{lib → dist/lib}/table/data/common/tree-row-if.d.ts +0 -0
  233. /package/{lib → dist/lib}/table/data/common/tree-row.d.ts +0 -0
  234. /package/{lib → dist/lib}/table/data/common/value-label.d.ts +0 -0
  235. /package/{lib → dist/lib}/table/data/common/value-label.if.d.ts +0 -0
  236. /package/{lib → dist/lib}/table/data/div-scope.type.d.ts +0 -0
  237. /package/{lib → dist/lib}/table/data/event/mouse-target-data.d.ts +0 -0
  238. /package/{lib → dist/lib}/table/data/geo-data.d.ts +0 -0
  239. /package/{lib → dist/lib}/table/data/options/auto-restore-options.d.ts +0 -0
  240. /package/{lib → dist/lib}/table/data/options/auto-restore-options.if.d.ts +0 -0
  241. /package/{lib → dist/lib}/table/data/options/default-row-heights.d.ts +0 -0
  242. /package/{lib → dist/lib}/table/data/options/default-row-heights.if.d.ts +0 -0
  243. /package/{lib → dist/lib}/table/data/options/header-group-options.d.ts +0 -0
  244. /package/{lib → dist/lib}/table/data/options/header-group-options.if.d.ts +0 -0
  245. /package/{lib → dist/lib}/table/data/options/icon.d.ts +0 -0
  246. /package/{lib → dist/lib}/table/data/options/icon.if.d.ts +0 -0
  247. /package/{lib → dist/lib}/table/data/options/sorted-options.d.ts +0 -0
  248. /package/{lib → dist/lib}/table/data/options/sorted-options.if.d.ts +0 -0
  249. /package/{lib → dist/lib}/table/data/options/table-options.d.ts +0 -0
  250. /package/{lib → dist/lib}/table/data/options/table-options.if.d.ts +0 -0
  251. /package/{lib → dist/lib}/table/data/options/tree-options.d.ts +0 -0
  252. /package/{lib → dist/lib}/table/data/options/tree-options.if.d.ts +0 -0
  253. /package/{lib → dist/lib}/table/data/side-ident.type.d.ts +0 -0
  254. /package/{lib → dist/lib}/table/data/table-model-and-options.d.ts +0 -0
  255. /package/{lib → dist/lib}/table/data/table-model-and-options.if.d.ts +0 -0
  256. /package/{lib → dist/lib}/table/data/tablemodel/area-ident.type.d.ts +0 -0
  257. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/abstract-area-model.d.ts +0 -0
  258. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-array-of-arrays.d.ts +0 -0
  259. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-cell-groups.d.ts +0 -0
  260. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-hidden.d.ts +0 -0
  261. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-object-array-with-columndefs.d.ts +0 -0
  262. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-object-array.d.ts +0 -0
  263. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model-tree.d.ts +0 -0
  264. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model.d.ts +0 -0
  265. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/area-model.if.d.ts +0 -0
  266. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/async-area-model-object-array.d.ts +0 -0
  267. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/col-and-rowspan-model.d.ts +0 -0
  268. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/has-default-row-height-if.d.ts +0 -0
  269. /package/{lib → dist/lib}/table/data/tablemodel/areamodel/object-array-holder.if.d.ts +0 -0
  270. /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group-ext.d.ts +0 -0
  271. /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group.d.ts +0 -0
  272. /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cell-group.if.d.ts +0 -0
  273. /package/{lib → dist/lib}/table/data/tablemodel/cellgroup/cellgroup-factory.d.ts +0 -0
  274. /package/{lib → dist/lib}/table/data/tablemodel/column/column-def.d.ts +0 -0
  275. /package/{lib → dist/lib}/table/data/tablemodel/column/column-def.if.d.ts +0 -0
  276. /package/{lib → dist/lib}/table/data/tablemodel/padding.d.ts +0 -0
  277. /package/{lib → dist/lib}/table/data/tablemodel/table-model.d.ts +0 -0
  278. /package/{lib → dist/lib}/table/data/tablemodel/table-model.if.d.ts +0 -0
  279. /package/{lib → dist/lib}/table/ele-scope.d.ts +0 -0
  280. /package/{lib → dist/lib}/table/event-adapter.d.ts +0 -0
  281. /package/{lib → dist/lib}/table/factory/table-factory.d.ts +0 -0
  282. /package/{lib → dist/lib}/table/factory/tree-factory.d.ts +0 -0
  283. /package/{lib → dist/lib}/table/focus/focus.type.d.ts +0 -0
  284. /package/{lib → dist/lib}/table/input-handler.d.ts +0 -0
  285. /package/{lib → dist/lib}/table/instanceof-workaround.d.ts +0 -0
  286. /package/{lib → dist/lib}/table/license-manager.d.ts +0 -0
  287. /package/{lib → dist/lib}/table/mouse-handler.d.ts +0 -0
  288. /package/{lib → dist/lib}/table/render-scope.d.ts +0 -0
  289. /package/{lib → dist/lib}/table/renderer/cell-group-ext-cell-renderer.d.ts +0 -0
  290. /package/{lib → dist/lib}/table/renderer/cell-render.if.d.ts +0 -0
  291. /package/{lib → dist/lib}/table/renderer/checkbox-boolean-property-cell-renderer.d.ts +0 -0
  292. /package/{lib → dist/lib}/table/renderer/checkbox-cell-renderer.d.ts +0 -0
  293. /package/{lib → dist/lib}/table/renderer/date-to-int-date-cell-renderer.d.ts +0 -0
  294. /package/{lib → dist/lib}/table/renderer/date-to-iso-cell-renderer.d.ts +0 -0
  295. /package/{lib → dist/lib}/table/renderer/date-to-locale-date-cell-renderer.d.ts +0 -0
  296. /package/{lib → dist/lib}/table/renderer/date-to-tec-cell-renderer.d.ts +0 -0
  297. /package/{lib → dist/lib}/table/renderer/edit/edit-cell-renderer.type.d.ts +0 -0
  298. /package/{lib → dist/lib}/table/renderer/edit/edit-input-pipe-for-number.d.ts +0 -0
  299. /package/{lib → dist/lib}/table/renderer/edit/edit-input-pipe.if.d.ts +0 -0
  300. /package/{lib → dist/lib}/table/renderer/edit/input-cell-renderer.d.ts +0 -0
  301. /package/{lib → dist/lib}/table/renderer/edit/select-cell-renderer.d.ts +0 -0
  302. /package/{lib → dist/lib}/table/renderer/male-female-to-icon-cell-renderer.d.ts +0 -0
  303. /package/{lib → dist/lib}/table/renderer/number-cell-progress-bar-cell-renderer.d.ts +0 -0
  304. /package/{lib → dist/lib}/table/renderer/number-cell-renderer.d.ts +0 -0
  305. /package/{lib → dist/lib}/table/renderer/progress-bar-cell-renderer.d.ts +0 -0
  306. /package/{lib → dist/lib}/table/renderer/renderer-cleanup-fn.type.d.ts +0 -0
  307. /package/{lib → dist/lib}/table/renderer/renderer.d.ts +0 -0
  308. /package/{lib → dist/lib}/table/renderer/star-rating-cell-renderer.d.ts +0 -0
  309. /package/{lib → dist/lib}/table/renderer/true-false-cell-renderer.d.ts +0 -0
  310. /package/{lib → dist/lib}/table/selection/selection-service.d.ts +0 -0
  311. /package/{lib → dist/lib}/table/selection/selection.type.d.ts +0 -0
  312. /package/{lib → dist/lib}/table/service/abstract-store-state.service.d.ts +0 -0
  313. /package/{lib → dist/lib}/table/service/convenience-dom.service.d.ts +0 -0
  314. /package/{lib → dist/lib}/table/service/copy-service.d.ts +0 -0
  315. /package/{lib → dist/lib}/table/service/copy-service.if.d.ts +0 -0
  316. /package/{lib → dist/lib}/table/service/data/collapsed-expanded.data.d.ts +0 -0
  317. /package/{lib → dist/lib}/table/service/data/html-style.type.d.ts +0 -0
  318. /package/{lib → dist/lib}/table/service/dom-service.if.d.ts +0 -0
  319. /package/{lib → dist/lib}/table/service/ge-filter.service.d.ts +0 -0
  320. /package/{lib → dist/lib}/table/service/simple-dom-service.d.ts +0 -0
  321. /package/{lib → dist/lib}/table/service/sorter.service.d.ts +0 -0
  322. /package/{lib → dist/lib}/table/service/store-state-collapsed-expand.service.d.ts +0 -0
  323. /package/{lib → dist/lib}/table/service/store-state-scroll-pos.service.d.ts +0 -0
  324. /package/{lib → dist/lib}/table/service/store-state-sorting.service.d.ts +0 -0
  325. /package/{lib → dist/lib}/table/service/tree-row.service.d.ts +0 -0
  326. /package/{lib → dist/lib}/table/table-api.d.ts +0 -0
@@ -0,0 +1,34 @@
1
+ import { AreaModelIf } from "../tablemodel/areamodel/area-model.if";
2
+ import { AreaIdent } from "../tablemodel/area-ident.type";
3
+ import { SideIdent } from "../side-ident.type";
4
+
5
+ /**
6
+ * Represents the arguments required to render a cell div.
7
+ *
8
+ * @interface ArgsRenderCellDiv
9
+ * @property {AreaModelIf} areaModel - The area model for the cell.
10
+ * @property {AreaIdent} areaIdent - The identifier of the area.
11
+ * @property {SideIdent} sideIdent - The identifier of the side.
12
+ * @property {number} rowIndex - The index of the row.
13
+ * @property {number} index - The index of the cell.
14
+ * @property {number} left - The left position of the cell.
15
+ * @property {number} width - The width of the cell.
16
+ * @property {number} height - The height of the cell.
17
+ * @property {number} top - The top position of the cell.
18
+ * @property {HTMLDivElement} parent - The parent element of the cell.
19
+ * @property {boolean} lastRowOfModel - Indicates if the cell is in the last row of the model.
20
+ */
21
+ export interface ArgsRenderCellDiv {
22
+ areaModel: AreaModelIf;
23
+ areaIdent: AreaIdent;
24
+ sideIdent: SideIdent;
25
+ rowIndex: number;
26
+ index: number;
27
+ left: number;
28
+ width: number;
29
+ height: number;
30
+ top: number;
31
+ parent: HTMLDivElement;
32
+ lastRowOfModel: boolean;
33
+ // gammaRange: boolean;
34
+ }
@@ -0,0 +1,16 @@
1
+ export type BooleanFunction = () => boolean;
2
+
3
+ /**
4
+ * Represents a function that always returns true.
5
+ *
6
+ * @function
7
+ * @returns {boolean} - Always returns true
8
+ */
9
+ export const TrueFn = () => true;
10
+ /**
11
+ * Represents a function that always returns `false`.
12
+ *
13
+ * @function
14
+ * @returns {boolean} Always returns `false`.
15
+ */
16
+ export const FalseFn = () => false;
@@ -0,0 +1,66 @@
1
+ export class CellRange {
2
+
3
+
4
+ /**
5
+ * Represents a constructor for a class.
6
+ * @constructor
7
+ * @param {number} r1 - The value for r1.
8
+ * @param {number} c1 - The value for c1.
9
+ * @param {number} r2 - The value for r2.
10
+ * @param {number} c2 - The value for c2.
11
+ * @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
12
+ */
13
+ constructor(
14
+ public r1: number,
15
+ public c1: number,
16
+ public r2: number,
17
+ public c2: number,
18
+ public gammaRange: boolean = false) {
19
+ }
20
+
21
+ static create(params: {
22
+ rowIndex1: number,
23
+ columnIndex1: number,
24
+ rowIndex2: number,
25
+ columnIndex2: number,
26
+ gammaRange?: boolean
27
+ }): CellRange {
28
+ if (params.gammaRange === undefined) {
29
+ params.gammaRange = false;
30
+ }
31
+ return new CellRange(
32
+ params.rowIndex1,
33
+ params.columnIndex1,
34
+ params.rowIndex2,
35
+ params.columnIndex2,
36
+ params.gammaRange
37
+ );
38
+ }
39
+
40
+ static singleCell(
41
+ rowIndex: number,
42
+ columnIndex: number
43
+ ): CellRange {
44
+ return new CellRange(rowIndex, columnIndex, rowIndex, columnIndex);
45
+ }
46
+
47
+ static singleRow(
48
+ rowIndex: number
49
+ ): CellRange {
50
+ return new CellRange(rowIndex, 0, rowIndex, Number.MAX_SAFE_INTEGER);
51
+ }
52
+
53
+ static singleColumn(
54
+ columnIndex: number
55
+ ): CellRange {
56
+ return new CellRange(0, columnIndex, Number.MAX_SAFE_INTEGER, columnIndex);
57
+ }
58
+
59
+ isInRange(rowIndex: number, columnIndex: number): boolean {
60
+ return rowIndex >= this.r1
61
+ && rowIndex <= this.r2
62
+ && columnIndex >= this.c1
63
+ && columnIndex <= this.c2;
64
+ }
65
+
66
+ }
@@ -0,0 +1,31 @@
1
+ import { Size } from "./size";
2
+ import { SizeIf } from "./size.if";
3
+ import { ColumnDefIf } from "../tablemodel/column/column-def.if";
4
+ import { CellRendererIf } from "../../renderer/cell-render.if";
5
+ import { CheckboxCellRenderer } from "../../renderer/checkbox-cell-renderer";
6
+ import { AreaObjectMapType } from "./area-map.type";
7
+ import { AreaObjectMap } from "./area-map";
8
+
9
+ /**
10
+ * A pre-defined column definition for a checkbox representation.
11
+ *
12
+ * @implements {ColumnDefIf}
13
+ */
14
+ export class CheckboxColumnDef implements ColumnDefIf {
15
+
16
+ public type = 'CheckboxColumnDef';
17
+
18
+ public property = "CheckboxColumn";
19
+ public headerLabel = "";
20
+ public width: SizeIf = new Size(50, "px");
21
+ public minWidth: SizeIf = new Size(50, "px");
22
+ public maxWidth: SizeIf = new Size(100, "px");
23
+ public rendererMap: AreaObjectMapType<CellRendererIf> = new AreaObjectMap<CellRendererIf>(new CheckboxCellRenderer(), new CheckboxCellRenderer(), undefined);
24
+ public classes: AreaObjectMapType<string[]> = new AreaObjectMap<string[]>(
25
+ [],
26
+ ["ge-table-text-align-left"],
27
+ []
28
+ );
29
+
30
+
31
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Represents a checked type.
3
+ *
4
+ * @typedef {'none' | 'semi' | 'full'} CheckedType
5
+ */
6
+ export type CheckedType = "none" | "semi" | "full";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents the indices (position) of a cell in a table area.
3
+ */
4
+ export class GeCellIndices {
5
+
6
+ constructor(
7
+ public rowIndex: number = -1,
8
+ public columnIndex: number = -1
9
+ ) {
10
+ }
11
+
12
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Represents a keyboard event.
3
+ *
4
+ * @class GeKeyEvent
5
+ */
6
+ export class GeKeyEvent {
7
+
8
+ constructor(
9
+ public status: "down" | "up" = "down",
10
+ public originalEvent?: KeyboardEvent
11
+ ) {
12
+ }
13
+
14
+
15
+ }
@@ -0,0 +1,16 @@
1
+ import { GeCellIndices } from "./ge-cell-indices";
2
+
3
+ /**
4
+ * Indicates that changes have occurred in the given cells.
5
+ */
6
+ export class GeModelChangeEvent {
7
+
8
+ constructor(
9
+ public cells: GeCellIndices[]
10
+ ) {
11
+ }
12
+
13
+ static createSingle(rowIndex: number, columnIndex: number) {
14
+ return new GeModelChangeEvent([new GeCellIndices(rowIndex, columnIndex)]);
15
+ }
16
+ }
@@ -0,0 +1,41 @@
1
+ import { AreaIdent } from "../../tablemodel/area-ident.type";
2
+ import { SideIdent } from "../../side-ident.type";
3
+
4
+ /**
5
+ * Represents a mouse event in the table.
6
+ */
7
+ export class GeMouseEvent {
8
+
9
+
10
+ constructor(
11
+ public rowIndex: number = -1,
12
+ public rowTop: number = -1,
13
+ public columnIndex: number = -1,
14
+ public columnLeft: number = -1,
15
+ public areaIdent?: AreaIdent,
16
+ public sideIdent?: SideIdent,
17
+ public originalEvent?: MouseEvent,
18
+ public clickCount: number = 0,
19
+ public draggingX: number = 0,
20
+ public draggingY: number = 0,
21
+ public action: string | null = ""
22
+ ) {
23
+ }
24
+
25
+ clone(): GeMouseEvent {
26
+ return new GeMouseEvent(
27
+ this.rowIndex,
28
+ this.rowTop,
29
+ this.columnIndex,
30
+ this.columnLeft,
31
+ this.areaIdent,
32
+ this.sideIdent,
33
+ this.originalEvent,
34
+ this.clickCount,
35
+ this.draggingX,
36
+ this.draggingY,
37
+ this.action
38
+ );
39
+ }
40
+
41
+ }
@@ -0,0 +1,58 @@
1
+ import { AreaIdent } from "../../../tablemodel/area-ident.type";
2
+
3
+ /**
4
+ * One event defines one table cell update operation.
5
+ * You can send an array of these event via TableApi#updateCells(events: TableCellUpdateEventIf[], repaintAll: boolean = false).
6
+ */
7
+ export interface TableCellUpdateEventIf {
8
+
9
+ /**
10
+ * Represents an area identifier ("header" | "body" | "footer"), which defines the part of the table.
11
+ *
12
+ * @typedef {number} AreaIdent
13
+ */
14
+ area: AreaIdent;
15
+
16
+ /**
17
+ * Represents the index of a row of the table.
18
+ *
19
+ * @typedef {number} rowIndex
20
+ */
21
+ rowIndex: number;
22
+
23
+ /**
24
+ * Represents the index of a column in a data table.
25
+ *
26
+ * @typedef {number} columnIndex
27
+ */
28
+ columnIndex: number;
29
+
30
+
31
+ /**
32
+ * The value can be any data type.
33
+ * It can store a string, number, boolean, object, function, or null.
34
+ * It is a flexible variable that can hold any value.
35
+ *
36
+ * This valie will be set to the area model for the cell (rowIndex, columnIndex).
37
+ *
38
+ * @type {*} - Represents any data type
39
+ */
40
+ value: any;
41
+
42
+
43
+ /**
44
+ * Represents a collection of CSS classes with their corresponding boolean values.
45
+ * For each key-value pair of the object with a truthy value the corresponding key is used as a class name.
46
+ * For each key-value pair of the object with a falsy value the corresponding key will be removed from the class list of the cell div (dom node).
47
+ * Example:
48
+ * {
49
+ * low: val >= 0 && val <=5,
50
+ * medium: val > 5 && val <= 10,
51
+ * high: val > 10
52
+ * }
53
+ *
54
+ * @typedef {Object.<string, boolean>} CssClasses
55
+ */
56
+ cssClasses: {[key:string]: boolean};
57
+
58
+ }
@@ -0,0 +1,27 @@
1
+ import { TableCellUpdateEventIf } from "./table-cell-update-event.if";
2
+ import { AreaIdent } from "../../../tablemodel/area-ident.type";
3
+
4
+ /**
5
+ * Represents an event that occurs when a table cell is updated.
6
+ *
7
+ * @class
8
+ * @implements TableCellUpdateEventIf
9
+ *
10
+ * @param {AreaIdent} area - The identification of the area where the cell belongs.
11
+ * @param {number} rowIndex - The index of the row where the cell is located.
12
+ * @param {number} columnIndex - The index of the column where the cell is located.
13
+ * @param {any} value - The new value for the cell.
14
+ * @param {Object.<string, boolean>} cssClasses - An object containing CSS classes to be applied to the cell.
15
+ */
16
+ export class TableCellUpdateEvent implements TableCellUpdateEventIf {
17
+
18
+ constructor(
19
+ public area: AreaIdent,
20
+ public rowIndex: number,
21
+ public columnIndex: number,
22
+ public value: any,
23
+ public cssClasses: {[key:string]: boolean} = {},
24
+ ) {
25
+ }
26
+
27
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents a filter function that is used to determine if an element should be included in a filtered array.
3
+ * @template T The type of the elements in the array.
4
+ * @param {T} value The current element being evaluated.
5
+ * @param {number} index The index of the current element being evaluated.
6
+ * @param {T[]} array The array that the filter function was called upon.
7
+ * @returns {unknown} The result of the filter function evaluation: `true` if the element should be included, `false` otherwise.
8
+ */
9
+ export type FilterFunction<T> = (value: T, index: number, array: T[]) => unknown;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Represents a function that retrieves a value of type T.
3
+ * Returns the value of type T if it exists, otherwise undefined.
4
+ *
5
+ * @template T - The type of the value to be retrieved.
6
+ */
7
+ export type GetT<T> = () => T | undefined;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents an index and pixel value pair.
3
+ */
4
+ export class IndexAndPx {
5
+
6
+ constructor(
7
+ public index: number,
8
+ public px: number
9
+ ) {
10
+ }
11
+
12
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Represents a size with a value and unit. At the moment only unit 'px' is implemented in the calculations.
3
+ * @interface
4
+ */
5
+ export interface SizeIf {
6
+ value: number;
7
+ unit: "px" | "%";
8
+ }
@@ -0,0 +1,9 @@
1
+ import { SizeIf } from "./size.if";
2
+
3
+ export class Size implements SizeIf {
4
+ constructor(
5
+ public value: number = 100,
6
+ public unit: "px" | "%" = "px"
7
+ ) {
8
+ }
9
+ }
@@ -0,0 +1,35 @@
1
+ import { Size } from "./size";
2
+
3
+
4
+ export const px300 = new Size(300, "px");
5
+ export const px290 = new Size(290, "px");
6
+ export const px280 = new Size(280, "px");
7
+ export const px270 = new Size(270, "px");
8
+ export const px260 = new Size(260, "px");
9
+ export const px250 = new Size(250, "px");
10
+ export const px240 = new Size(240, "px");
11
+ export const px230 = new Size(230, "px");
12
+ export const px220 = new Size(220, "px");
13
+ export const px210 = new Size(210, "px");
14
+ export const px200 = new Size(200, "px");
15
+ export const px190 = new Size(190, "px");
16
+ export const px180 = new Size(180, "px");
17
+ export const px170 = new Size(170, "px");
18
+ export const px160 = new Size(160, "px");
19
+ export const px150 = new Size(150, "px");
20
+ export const px140 = new Size(140, "px");
21
+ export const px130 = new Size(130, "px");
22
+ export const px120 = new Size(120, "px");
23
+ export const px110 = new Size(110, "px");
24
+ export const px100 = new Size(100, "px");
25
+ export const px90 = new Size(90, "px");
26
+ export const px80 = new Size(80, "px");
27
+ export const px70 = new Size(70, "px");
28
+ export const px60 = new Size(60, "px");
29
+ export const px50 = new Size(50, "px");
30
+ export const px40 = new Size(40, "px");
31
+ export const px30 = new Size(30, "px");
32
+ export const px20 = new Size(20, "px");
33
+ export const px10 = new Size(10, "px");
34
+ export const px0 = new Size(0, "px");
35
+
@@ -0,0 +1,14 @@
1
+ import { SortState } from "./sort-state.type";
2
+
3
+ /**
4
+ * Represents a sortable column with its sort order..
5
+ */
6
+ export class SortItem {
7
+
8
+ constructor(
9
+ public columnIndex: number,
10
+ public sortState: SortState
11
+ ) {
12
+ }
13
+
14
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Represents the sort state of a list or table.
3
+ * It can take one of the following values: "asc", "desc", or "" (empty string).
4
+ *
5
+ * @typedef {("asc" | "desc" | "")} SortState
6
+ */
7
+ export type SortState = "asc" | "desc" | "";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Represents the arrow type for a tree node in a hierarchical structure.
3
+ *
4
+ * The arrow type determines the visual representation of the arrow icon associated with a tree node.
5
+ *
6
+ * @typedef {("none" | "hidden" | "collapsed" | "expanded")} TreeArrowType
7
+ */
8
+ export type TreeArrowType = "none" | "hidden" | "collapsed" | "expanded";
@@ -0,0 +1,15 @@
1
+
2
+
3
+ /**
4
+ * Represents a (table) row in a tree structure. It's a container object for T with additional tree node information.@template T - The type of data stored in each row.
5
+ */
6
+ export interface TreeRowIf<T> {
7
+ type?:'TreeRow'|'';
8
+ data: T;
9
+ expanded: boolean;
10
+ children: TreeRowIf<T>[] | undefined;
11
+ parent: TreeRowIf<T> | undefined;
12
+ deep: number;
13
+ checked: boolean;
14
+ keep: boolean;
15
+ }
@@ -0,0 +1,22 @@
1
+ import { TreeRowIf } from "./tree-row-if";
2
+
3
+ /**
4
+ * Represents a (table) row in a tree structure. It's a container object for T with additional tree node information.
5
+ * @template T - The type of data stored in the row.
6
+ */
7
+ export class TreeRow<T> implements TreeRowIf<T> {
8
+
9
+ public type:'TreeRow'|'' = 'TreeRow';
10
+
11
+ constructor(
12
+ public data: T,
13
+ public expanded: boolean = true,
14
+ public children: TreeRowIf<T>[] | undefined,
15
+ public parent: TreeRowIf<T> | undefined,
16
+ public deep: number = 0,
17
+ public checked: boolean = false,
18
+ public keep: boolean = false
19
+ ) {
20
+ }
21
+
22
+ }
@@ -0,0 +1,6 @@
1
+ export interface ValueLabelIf {
2
+
3
+ value: any;
4
+ label: string;
5
+
6
+ }
@@ -0,0 +1,13 @@
1
+ import { ValueLabelIf } from "./value-label.if";
2
+
3
+
4
+ export class ValueLabel implements ValueLabelIf {
5
+
6
+
7
+ constructor(
8
+ public value: any,
9
+ public label: string
10
+ ) {
11
+ }
12
+
13
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Represents a DivScope object.
3
+ *
4
+ * @typedef {{
5
+ * parent: HTMLDivElement,
6
+ * child: HTMLDivElement,
7
+ * cache: { [key: number]: HTMLDivElement }
8
+ * }} DivScope
9
+ */
10
+ export type DivScope = {
11
+ parent: HTMLDivElement,
12
+ child: HTMLDivElement,
13
+ cache: { [key: number]: HTMLDivElement }
14
+ };
@@ -0,0 +1,48 @@
1
+ import { AreaIdent, getAreaIdentByString } from "../tablemodel/area-ident.type";
2
+ import { AreaModelIf } from "../tablemodel/areamodel/area-model.if";
3
+ import { TableScope } from "../../table-scope";
4
+
5
+ /**
6
+ * Represents data about a mouse target. It's a helper class to extract all information from the target HTMLElement.
7
+ */
8
+ export class MouseTargetData {
9
+
10
+ rowIdx: number = -1;
11
+ colIdx: number = -1;
12
+ areaIdent?: AreaIdent;
13
+ areaModel?: AreaModelIf;
14
+ row?: any;
15
+ value?: any;
16
+ action: string | null = null;
17
+ inputType: string | null = null;
18
+ className: string = "";
19
+
20
+
21
+ constructor(
22
+ eventTarget: EventTarget | null,
23
+ tableScope: TableScope) {
24
+
25
+ if (eventTarget === null) return; // skip
26
+
27
+ if (eventTarget instanceof HTMLDivElement
28
+ || eventTarget instanceof HTMLSpanElement
29
+ || eventTarget instanceof HTMLInputElement) {
30
+
31
+ this.className = eventTarget.className;
32
+ this.action = eventTarget.getAttribute("data-ge-action");
33
+ this.inputType = eventTarget.getAttribute("data-input-type");
34
+ this.rowIdx = Number(eventTarget.getAttribute("data-row-index"));
35
+ this.colIdx = Number(eventTarget.getAttribute("data-col-index"));
36
+ const area = eventTarget.getAttribute("data-area");
37
+ if (area) {
38
+ this.areaIdent = getAreaIdentByString(area);
39
+ this.areaModel = tableScope.tableModel.getAreaModel(this.areaIdent);
40
+ this.row = this.areaModel.getRowByIndex(this.rowIdx);
41
+ }
42
+ if (eventTarget instanceof HTMLInputElement) {
43
+ const target = eventTarget as HTMLInputElement;
44
+ this.value = target.value;
45
+ }
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Represents geometric data with left, width, height, top coordinates and an optional index.
3
+ */
4
+ export class GeoData {
5
+
6
+ constructor(
7
+ public left: number = 0,
8
+ public width: number = 0,
9
+ public height: number = 0,
10
+ public top: number = 0,
11
+ public index?: number
12
+ ) {
13
+ }
14
+
15
+
16
+ }
@@ -0,0 +1,21 @@
1
+ export type IsSameFn<T> = (r1: T, r2: T, optionsIf: AutoRestoreOptionsIf<T>) => boolean;
2
+ export type GetRowIdFn<T> = ((row: T) => string | number);
3
+ export type GetStorageKeyFn = (() => string);
4
+
5
+ /**
6
+ * See TableOptionsIf#autoRestoreOptions()
7
+ */
8
+ export interface AutoRestoreOptionsIf<T> {
9
+
10
+ autoRestoreSortingState: boolean;
11
+ autoRestoreCollapsedExpandedState?: boolean;
12
+ autoRestoreScrollPosition?: boolean;
13
+
14
+ autoRestoreCheckedState?: boolean;
15
+ autoRestoreSelectedState?: boolean;
16
+
17
+ getRowId?: undefined | GetRowIdFn<T>;
18
+ getStorageKeyFn?: undefined | GetStorageKeyFn;
19
+ isSame?: undefined | IsSameFn<T>;
20
+
21
+ }
@@ -0,0 +1,50 @@
1
+ import { AutoRestoreOptionsIf } from "./auto-restore-options.if";
2
+
3
+
4
+ export class AutoRestoreOptions<T> implements AutoRestoreOptionsIf<T> {
5
+
6
+ public autoRestoreSortingState = false;
7
+ public autoRestoreCollapsedExpandedState = false;
8
+ public autoRestoreScrollPosition = false;
9
+
10
+ public autoRestoreCheckedState = false;
11
+ public autoRestoreSelectedState = false;
12
+
13
+
14
+ public getStorageKeyFn = undefined;
15
+
16
+
17
+ public isSame = (r1: T, r2: T, options: AutoRestoreOptionsIf<T>) => {
18
+ if (r1 && r2) {
19
+ if (options.getRowId) {
20
+ const id1 = options.getRowId(r1);
21
+ const id2 = options.getRowId(r2);
22
+ return id1 === id2;
23
+ }
24
+ }
25
+ return false;
26
+ };
27
+
28
+ public getRowId = (row: T): string | number => {
29
+ if (row) {
30
+ // First try:
31
+ for (const key of ["id", "uuid"]) {
32
+ // @ts-ignore
33
+ const id = row[key];
34
+ if (id !== undefined && id !== null) {
35
+ return id;
36
+ }
37
+ }
38
+
39
+ // Second try:
40
+ try {
41
+ return JSON.stringify(row);
42
+ } catch (e) {
43
+ console.error(e);
44
+ }
45
+ }
46
+ console.warn("One of following options set to true without a valid \"getRowId()\": autoRestoreExpandedState, autoRestoreCheckedState.");
47
+ return -1;
48
+ };
49
+
50
+ }