@lavalogic/scoria 0.37.44 → 0.37.46

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 (239) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +46 -46
  3. package/dist/Components/AccordionGroupButton.svelte +76 -76
  4. package/dist/Components/Action.svelte +136 -136
  5. package/dist/Components/ActionProps.d.ts +2 -6
  6. package/dist/Components/AlertModal.svelte +195 -183
  7. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
  8. package/dist/Components/Base/BaseModal.svelte +125 -125
  9. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  10. package/dist/Components/Base/Pagination.svelte +198 -198
  11. package/dist/Components/Base/Snippets.svelte +36 -36
  12. package/dist/Components/BigRadioSet.svelte +38 -38
  13. package/dist/Components/Bubble.svelte +101 -101
  14. package/dist/Components/Button.svelte +209 -209
  15. package/dist/Components/ButtonProps.d.ts +2 -6
  16. package/dist/Components/Checkbox.svelte +86 -86
  17. package/dist/Components/CollapsibleCard.svelte +78 -78
  18. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  19. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  20. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  21. package/dist/Components/Contexts/Toast.svelte +86 -83
  22. package/dist/Components/Contexts/Toast.svelte.d.ts +8 -5
  23. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  24. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  25. package/dist/Components/DataMatrixIcon.svelte +112 -112
  26. package/dist/Components/DataMatrixIconProps.d.ts +3 -13
  27. package/dist/Components/DateInput.svelte +148 -148
  28. package/dist/Components/DatePicker.svelte +300 -300
  29. package/dist/Components/DesktopModal.svelte +90 -90
  30. package/dist/Components/Dial.svelte +204 -204
  31. package/dist/Components/DialProps.d.ts +1 -18
  32. package/dist/Components/DimensionInput.svelte +170 -170
  33. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  34. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  35. package/dist/Components/FileCard.svelte +24 -24
  36. package/dist/Components/FileUpload.svelte +236 -236
  37. package/dist/Components/GridInput.svelte +196 -200
  38. package/dist/Components/GridInputSet.svelte +29 -29
  39. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  40. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  41. package/dist/Components/Icon.svelte +128 -128
  42. package/dist/Components/IconProps.d.ts +2 -7
  43. package/dist/Components/Icons.js +357 -357
  44. package/dist/Components/LoadingAnimation.svelte +29 -29
  45. package/dist/Components/LoadingModal.svelte +45 -45
  46. package/dist/Components/LoadingOverlay.svelte +25 -25
  47. package/dist/Components/LoadingOverlayProps.d.ts +3 -7
  48. package/dist/Components/Modal.svelte +258 -258
  49. package/dist/Components/ModalProps.d.ts +0 -3
  50. package/dist/Components/MultiSelect.svelte +220 -220
  51. package/dist/Components/MultiSelectCommonProps.d.ts +6 -17
  52. package/dist/Components/Nav/Nav.svelte +110 -99
  53. package/dist/Components/Nav/NavProps.d.ts +4 -11
  54. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  55. package/dist/Components/Nav/NavTab.svelte +62 -62
  56. package/dist/Components/Nav/ServiceMenuItem.svelte +100 -100
  57. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  58. package/dist/Components/NumberInput.svelte +157 -157
  59. package/dist/Components/PageHeading.svelte +25 -25
  60. package/dist/Components/PasswordInput.svelte +88 -88
  61. package/dist/Components/Portal.svelte +36 -36
  62. package/dist/Components/ProgressBubble.svelte +107 -108
  63. package/dist/Components/ProgressBubbleProps.d.ts +3 -3
  64. package/dist/Components/QuerySelect.svelte +366 -366
  65. package/dist/Components/QuerySelectProps.d.ts +4 -14
  66. package/dist/Components/SingleSelect.svelte +250 -250
  67. package/dist/Components/SingleSelectCommonProps.d.ts +3 -19
  68. package/dist/Components/StepButton.svelte +70 -70
  69. package/dist/Components/StepForm.svelte +140 -140
  70. package/dist/Components/Switch.svelte +69 -69
  71. package/dist/Components/Table/ARCHITECTURE.md +298 -0
  72. package/dist/Components/Table/Body/QuickSearchCell.svelte +683 -694
  73. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  74. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  75. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +456 -478
  76. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  77. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -188
  78. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
  79. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  80. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +230 -230
  81. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  82. package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +12 -9
  83. package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -5
  84. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  85. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  86. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  87. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  88. package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -4
  89. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  90. package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +6 -5
  91. package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +7 -6
  92. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -257
  93. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  94. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -229
  95. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +11 -11
  96. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  97. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  98. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  99. package/dist/Components/Table/Body/TableBody.svelte +155 -155
  100. package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +2 -3
  101. package/dist/Components/Table/ColumnFactory.svelte.d.ts +9 -11
  102. package/dist/Components/Table/ColumnFactory.svelte.js +110 -143
  103. package/dist/Components/Table/ColumnKindRegistry.d.ts +112 -0
  104. package/dist/Components/Table/ColumnKindRegistry.js +63 -0
  105. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  106. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  107. package/dist/Components/Table/Headers/TableHead.svelte +415 -413
  108. package/dist/Components/Table/Misc/ColumnPanel.svelte +94 -94
  109. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -112
  110. package/dist/Components/Table/Misc/FilterInput.svelte +620 -644
  111. package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
  112. package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
  113. package/dist/Components/Table/Misc/FilterPanel.svelte +257 -257
  114. package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -30
  115. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  116. package/dist/Components/Table/Misc/TableFooter.svelte +311 -311
  117. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +125 -125
  118. package/dist/Components/Table/Misc/TableSidebar.svelte +157 -157
  119. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  120. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  121. package/dist/Components/Table/NestedTable.svelte +130 -133
  122. package/dist/Components/Table/SubApis.svelte.d.ts +1 -5
  123. package/dist/Components/Table/SubApis.svelte.js +33 -32
  124. package/dist/Components/Table/Table.svelte +692 -745
  125. package/dist/Components/Table/TableHelpers.svelte.d.ts +6 -19
  126. package/dist/Components/Table/TableHelpers.svelte.js +6 -14
  127. package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
  128. package/dist/Components/Table/Types/Columns/DateColumn.d.ts +3 -3
  129. package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -7
  130. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +7 -8
  131. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +4 -5
  132. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +11 -14
  133. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +3 -4
  134. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +7 -11
  135. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +3 -3
  136. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +13 -18
  137. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +4 -5
  138. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -5
  139. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +2 -2
  140. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +15 -12
  141. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +4 -5
  142. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +8 -12
  143. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +3 -3
  144. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +6 -6
  145. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -3
  146. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +49 -16
  147. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +27 -5
  148. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -7
  149. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +4 -4
  150. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -5
  151. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +2 -2
  152. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +5 -5
  153. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +2 -2
  154. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -5
  155. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +2 -2
  156. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +5 -5
  157. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -2
  158. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +11 -19
  159. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +4 -8
  160. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -7
  161. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +3 -4
  162. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +9 -9
  163. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +4 -4
  164. package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +5 -5
  165. package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +6 -6
  166. package/dist/Components/Table/Types/Columns/TableCell.d.ts +7 -6
  167. package/dist/Components/Table/Types/Context/ClipboardState.svelte.d.ts +98 -0
  168. package/dist/Components/Table/Types/Context/ClipboardState.svelte.js +290 -0
  169. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +17 -45
  170. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +17 -45
  171. package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +9 -20
  172. package/dist/Components/Table/Types/Context/FilteringState.svelte.js +9 -20
  173. package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +23 -42
  174. package/dist/Components/Table/Types/Context/FocusState.svelte.js +32 -59
  175. package/dist/Components/Table/Types/Context/ITable.d.ts +5 -8
  176. package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +29 -56
  177. package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +28 -55
  178. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.d.ts +50 -0
  179. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.js +62 -0
  180. package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +17 -28
  181. package/dist/Components/Table/Types/Context/SelectionState.svelte.js +17 -28
  182. package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +15 -29
  183. package/dist/Components/Table/Types/Context/SortingState.svelte.js +17 -31
  184. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +212 -325
  185. package/dist/Components/Table/Types/Context/TableContext.svelte.js +292 -706
  186. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +62 -79
  187. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +54 -73
  188. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +16 -27
  189. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +16 -27
  190. package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +12 -15
  191. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +15 -30
  192. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -28
  193. package/dist/Components/Table/Types/Header.d.ts +4 -4
  194. package/dist/Components/Table/Types/HeaderGroup.d.ts +5 -5
  195. package/dist/Components/Table/Types/Public/index.d.ts +2 -4
  196. package/dist/Components/Table/Types/Public/index.js +2 -4
  197. package/dist/Components/Table/clipboardEscape.d.ts +32 -0
  198. package/dist/Components/Table/clipboardEscape.js +45 -0
  199. package/dist/Components/Table/createTable.svelte.d.ts +8 -18
  200. package/dist/Components/Table/createTable.svelte.js +19 -47
  201. package/dist/Components/Test/TestContextConsumer.svelte +13 -13
  202. package/dist/Components/TextArea.svelte +130 -130
  203. package/dist/Components/TextInput.svelte +176 -176
  204. package/dist/Components/ThreeStateRadio.svelte +131 -131
  205. package/dist/Components/Touch/BoolCard.svelte +45 -45
  206. package/dist/Components/Touch/DateModal.svelte +209 -209
  207. package/dist/Components/Touch/EditCard.svelte +59 -59
  208. package/dist/Components/Touch/InfoCard.svelte +31 -31
  209. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  210. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  211. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  212. package/dist/Components/Touch/NumberModal.svelte +79 -79
  213. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  214. package/dist/Components/Touch/SelectModal.svelte +123 -123
  215. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  216. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  217. package/dist/Components/Touch/TextModal.svelte +106 -106
  218. package/dist/Components/Touch/TouchCard.svelte +33 -33
  219. package/dist/Components/Touch/TouchModal.svelte +274 -274
  220. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  221. package/dist/Components/VerticalTabGroup.svelte +79 -79
  222. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  223. package/dist/Contexts/ToastContext.svelte.js +3 -4
  224. package/dist/Helpers/Datamatrix.d.ts +19 -19
  225. package/dist/Helpers/Datamatrix.js +291 -291
  226. package/dist/Helpers/Helpers.svelte.d.ts +47 -4
  227. package/dist/Helpers/Helpers.svelte.js +97 -4
  228. package/dist/Helpers/dropdownPortal.d.ts +26 -41
  229. package/dist/Helpers/dropdownPortal.js +62 -116
  230. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  231. package/dist/index.d.ts +1 -2
  232. package/dist/index.js +1 -1
  233. package/dist/scss/_basics.scss +12 -12
  234. package/dist/scss/_colours.scss +134 -134
  235. package/dist/scss/_mixins.scss +3358 -3360
  236. package/dist/scss/_motion.scss +57 -57
  237. package/dist/scss/_sizing.scss +85 -85
  238. package/dist/scss/_transitions.scss +8 -8
  239. package/package.json +8 -6
@@ -1,76 +1,63 @@
1
1
  import type { Row } from './Row.js';
2
2
  /**
3
3
  * Dependency surface that `VirtualisationState` reads from the
4
- * surrounding `TableContext`. Every dependency is passed as a thunk so
5
- * the sub-context never holds a direct reference to the parent;
6
- * reactivity threads through `$derived` exactly as it does for the
7
- * other Phase 6 sub-contexts.
4
+ * surrounding `TableContext`. Each dependency is a thunk so the
5
+ * sub-context never holds a direct reference to the parent; reactivity
6
+ * threads through `$derived`.
8
7
  */
9
8
  export interface VirtualisationStateDeps<T extends object> {
10
- /** The full, ordered list of rows currently in scope (the
11
- * `paginationRowModel.rows` array from `TableContext`). */
9
+ /** Full, ordered row list currently in scope
10
+ * (`paginationRowModel.rows` from `TableContext`). */
12
11
  getRows: () => ReadonlyArray<Row<T>>;
13
- /** Per-row height lookup. The implementation reads from the
14
- * `_columnLayout` row-height pool (Phase 7.1 Item B) - whichever
15
- * side has the tallest registered height for the row. Returning
16
- * `undefined` (or 0) means "no observation yet" and the
17
- * estimated-row-height fallback is used. */
12
+ /** Per-row height lookup. Reads the largest observed height across
13
+ * sides from the `_columnLayout` row-height pool. Returning
14
+ * `undefined` or 0 means "not observed yet" and the estimated
15
+ * row-height fallback is used. */
18
16
  getRowHeight: (rowId: string) => number | undefined;
19
- /** Estimated row height used when no observed height is available
20
- * yet for a row. Defaults to 48 (the CSS `--height: 3rem` baseline).
21
- * Compact tables (`isCompact = true`) pass a smaller estimate via
22
- * this thunk so the totalHeight is in the right ballpark before
23
- * any row has been observed. */
17
+ /** Estimated row height when no observation is available yet.
18
+ * Defaults to 48 (the `--height: 3rem` baseline); compact tables
19
+ * pass a smaller estimate so `totalHeight` is in the right
20
+ * ballpark before any row is observed. */
24
21
  getEstimatedRowHeight: () => number;
25
22
  }
26
23
  /**
27
- * Phase 7.4 row virtualisation. When the current row count exceeds
28
- * `_virtualisationThreshold` (default 100) only the rows currently in
29
- * the viewport (plus a small overscan band above and below) are
30
- * rendered; the rest of the body height is reserved by two spacer
31
- * `<tr>` rows in `TableBody.svelte`. Below the threshold every row is
32
- * rendered directly, matching the legacy behaviour.
24
+ * Row virtualisation. When the row count exceeds
25
+ * `_virtualisationThreshold` (default 100), only viewport rows plus a
26
+ * small overscan band above and below are rendered; the remaining body
27
+ * height is reserved by two spacer `<tr>` rows in `TableBody.svelte`.
28
+ * Below threshold every row is rendered directly.
33
29
  *
34
- * The state is a sibling to `_columnLayout`, `_filtering`, `_sorting`,
35
- * etc. Three reasons it lives in its own sub-context rather than on
36
- * `_columnLayout`:
37
- *
38
- * - the threshold + overscan + scroll position are virtualisation-
39
- * specific concerns the column-layout code does not need;
40
- * - the heights map on `_columnLayout` is keyed by `(side, rowId)`
41
- * while virtualisation only ever wants the max across sides
42
- * (which determines the row's slot height);
30
+ * Owns its own sub-context (rather than living on `_columnLayout`)
31
+ * because:
32
+ * - threshold + overscan + scroll position are virtualisation-only;
33
+ * - `_columnLayout`'s height map is keyed by `(side, rowId)` whereas
34
+ * virtualisation needs the max across sides (the row's slot height);
43
35
  * - the `visibleRange` / `visibleRows` derived chain is read by all
44
- * three `TableBody` instances; keeping it on its own state object
45
- * means `_columnLayout` does not become a god-object again.
36
+ * three `TableBody` instances and keeping it separate avoids growing
37
+ * `_columnLayout` into a god-object.
46
38
  *
47
- * Scroll synchronisation: the three side `<table>` elements sit inside
48
- * the same `.datatable` overflow container (see `Table.svelte`), so
49
- * vertical scrolling is already shared. Only ONE scroll listener is
50
- * needed - it is attached in `Table.svelte` on the outer
51
- * `.datatable` element and reports both `scrollTop` and
52
- * `clientHeight` via `registerScrollPosition`.
39
+ * Scroll synchronisation: the three side `<table>` elements share the
40
+ * same `.datatable` overflow container, so vertical scrolling is
41
+ * already shared. ONE scroll listener (attached in `Table.svelte` on
42
+ * the outer `.datatable`) reports `scrollTop` and `clientHeight` via
43
+ * `registerScrollPosition`.
53
44
  *
54
- * Stability across sort / filter / pagination: rows are keyed by
55
- * `row.id` (the visible index as a string assigned by
45
+ * Keying: rows are keyed by `row.id` (the visible index assigned by
56
46
  * `paginationRowModel`), so `{#each visibleRows as { row } (row.id)}`
57
- * remains the keying surface and Svelte's diffing stays unchanged.
58
- * The `_selection._keyCache` (Phase 6.5) is keyed by `row.original`,
59
- * not by index or `row.id`, so virtualisation is transparent to it.
47
+ * keeps Svelte's diffing intact. `_selection._keyCache` is keyed by
48
+ * `row.original`, so virtualisation is transparent to it.
60
49
  */
61
50
  export declare class VirtualisationState<T extends object> {
62
51
  private readonly _deps;
63
52
  private readonly _virtualisationThreshold;
64
53
  private readonly _overscan;
65
54
  /** Latest scroll position reported by the host. 0 by default so the
66
- * first paint (before any scroll event) shows the top of the
67
- * list. */
55
+ * first paint (before any scroll event) shows the top of the list. */
68
56
  private _scrollTop;
69
- /** Latest viewport height reported by the host. The fallback of
70
- * 600 is chosen so that virtualisation has SOMETHING to clip
71
- * against before the first measurement - the overscan band keeps
72
- * the initial paint reasonable even if the real height is
73
- * smaller. */
57
+ /** Latest viewport height reported by the host. 600 is a sensible
58
+ * pre-measurement fallback so virtualisation has something to clip
59
+ * against; overscan keeps the initial paint reasonable when the
60
+ * real height is smaller. */
74
61
  private _viewportHeight;
75
62
  constructor(deps: VirtualisationStateDeps<T>, options?: {
76
63
  threshold?: number;
@@ -81,11 +68,11 @@ export declare class VirtualisationState<T extends object> {
81
68
  get scrollTop(): number;
82
69
  get viewportHeight(): number;
83
70
  /**
84
- * Returns true when the current row count is above the
85
- * virtualisation threshold. Below threshold the public API still
86
- * works (visibleRows returns every row, padding spacers are 0),
87
- * but consumers can short-circuit DOM work that is only needed in
88
- * the virtualised path by reading this flag.
71
+ * True when the current row count is above the virtualisation
72
+ * threshold. Below threshold the public API still works
73
+ * (`visibleRows` returns every row, padding spacers are 0), but
74
+ * consumers can short-circuit virtualisation-only DOM work by
75
+ * reading this flag.
89
76
  */
90
77
  readonly isVirtualised: boolean;
91
78
  /**
@@ -96,26 +83,23 @@ export declare class VirtualisationState<T extends object> {
96
83
  */
97
84
  private _resolveHeight;
98
85
  /**
99
- * Sum of all row heights. This is the height the body container
100
- * must reserve so the scrollbar matches the un-virtualised height.
86
+ * Sum of all row heights. The body container reserves this height
87
+ * so the scrollbar matches the un-virtualised height.
101
88
  *
102
- * Below threshold the value is still correct (sum of all observed
103
- * row heights or fallbacks), but consumers should generally not
104
- * apply it as `min-height` to the body container when below
105
- * threshold - the natural row flow does the right thing.
89
+ * Below threshold the value is still correct, but consumers should
90
+ * generally not apply it as `min-height` - the natural row flow is
91
+ * fine and forcing the min-height fights against zero-row layout.
106
92
  */
107
93
  readonly totalHeight: number;
108
94
  /**
109
- * Half-open `[start, end)` row-index range that should be rendered
110
- * in the DOM. Below the virtualisation threshold this is the full
111
- * `[0, rows.length)`. Above threshold it is the slice covering the
112
- * viewport (scrollTop -> scrollTop + viewportHeight) widened by
113
- * `_overscan` rows above and below.
95
+ * Half-open `[start, end)` row-index range to render. Below threshold
96
+ * this is the full `[0, rows.length)`. Above threshold it is the
97
+ * slice covering `[scrollTop, scrollTop + viewportHeight]` widened
98
+ * by `_overscan` rows on each side.
114
99
  *
115
- * The walk over row heights is O(N) per re-derive but only fires
116
- * when `_scrollTop`, `_viewportHeight`, the rows array, or any
117
- * relevant row height changes; for N <= a few thousand this is
118
- * well under a millisecond.
100
+ * The O(N) walk re-runs only when `_scrollTop`, `_viewportHeight`,
101
+ * the rows array, or a relevant row height changes; well under a
102
+ * millisecond for N up to a few thousand.
119
103
  */
120
104
  readonly visibleRange: {
121
105
  start: number;
@@ -153,15 +137,14 @@ export declare class VirtualisationState<T extends object> {
153
137
  */
154
138
  readonly bottomSpacerHeight: number;
155
139
  /**
156
- * Reports the current scroll position and viewport height. Called
157
- * by `Table.svelte` from a single scroll listener on the outer
158
- * `.datatable` container; the three side TableBody instances all
159
- * read the resulting `visibleRows` so they stay in sync without
160
- * extra plumbing.
140
+ * Report the current scroll position and viewport height. Called by
141
+ * `Table.svelte` from a single scroll listener on the outer
142
+ * `.datatable` container; the three side TableBody instances read
143
+ * the resulting `visibleRows` and stay in sync.
161
144
  *
162
- * The setter early-exits when neither value changed so identical
163
- * back-to-back scroll events (common on macOS rubber-band) do not
164
- * retrigger the derived chain.
145
+ * Early-exits when neither value changed so identical back-to-back
146
+ * scroll events (common on macOS rubber-band) do not re-trigger the
147
+ * derived chain.
165
148
  */
166
149
  readonly registerScrollPosition: (scrollTop: number, viewportHeight: number) => void;
167
150
  }
@@ -1,65 +1,50 @@
1
1
  /**
2
- * Phase 7.4 row virtualisation. When the current row count exceeds
3
- * `_virtualisationThreshold` (default 100) only the rows currently in
4
- * the viewport (plus a small overscan band above and below) are
5
- * rendered; the rest of the body height is reserved by two spacer
6
- * `<tr>` rows in `TableBody.svelte`. Below the threshold every row is
7
- * rendered directly, matching the legacy behaviour.
2
+ * Row virtualisation. When the row count exceeds
3
+ * `_virtualisationThreshold` (default 100), only viewport rows plus a
4
+ * small overscan band above and below are rendered; the remaining body
5
+ * height is reserved by two spacer `<tr>` rows in `TableBody.svelte`.
6
+ * Below threshold every row is rendered directly.
8
7
  *
9
- * The state is a sibling to `_columnLayout`, `_filtering`, `_sorting`,
10
- * etc. Three reasons it lives in its own sub-context rather than on
11
- * `_columnLayout`:
12
- *
13
- * - the threshold + overscan + scroll position are virtualisation-
14
- * specific concerns the column-layout code does not need;
15
- * - the heights map on `_columnLayout` is keyed by `(side, rowId)`
16
- * while virtualisation only ever wants the max across sides
17
- * (which determines the row's slot height);
8
+ * Owns its own sub-context (rather than living on `_columnLayout`)
9
+ * because:
10
+ * - threshold + overscan + scroll position are virtualisation-only;
11
+ * - `_columnLayout`'s height map is keyed by `(side, rowId)` whereas
12
+ * virtualisation needs the max across sides (the row's slot height);
18
13
  * - the `visibleRange` / `visibleRows` derived chain is read by all
19
- * three `TableBody` instances; keeping it on its own state object
20
- * means `_columnLayout` does not become a god-object again.
14
+ * three `TableBody` instances and keeping it separate avoids growing
15
+ * `_columnLayout` into a god-object.
21
16
  *
22
- * Scroll synchronisation: the three side `<table>` elements sit inside
23
- * the same `.datatable` overflow container (see `Table.svelte`), so
24
- * vertical scrolling is already shared. Only ONE scroll listener is
25
- * needed - it is attached in `Table.svelte` on the outer
26
- * `.datatable` element and reports both `scrollTop` and
27
- * `clientHeight` via `registerScrollPosition`.
17
+ * Scroll synchronisation: the three side `<table>` elements share the
18
+ * same `.datatable` overflow container, so vertical scrolling is
19
+ * already shared. ONE scroll listener (attached in `Table.svelte` on
20
+ * the outer `.datatable`) reports `scrollTop` and `clientHeight` via
21
+ * `registerScrollPosition`.
28
22
  *
29
- * Stability across sort / filter / pagination: rows are keyed by
30
- * `row.id` (the visible index as a string assigned by
23
+ * Keying: rows are keyed by `row.id` (the visible index assigned by
31
24
  * `paginationRowModel`), so `{#each visibleRows as { row } (row.id)}`
32
- * remains the keying surface and Svelte's diffing stays unchanged.
33
- * The `_selection._keyCache` (Phase 6.5) is keyed by `row.original`,
34
- * not by index or `row.id`, so virtualisation is transparent to it.
25
+ * keeps Svelte's diffing intact. `_selection._keyCache` is keyed by
26
+ * `row.original`, so virtualisation is transparent to it.
35
27
  */
36
28
  export class VirtualisationState {
37
29
  _deps;
38
30
  _virtualisationThreshold;
39
31
  _overscan;
40
32
  /** Latest scroll position reported by the host. 0 by default so the
41
- * first paint (before any scroll event) shows the top of the
42
- * list. */
33
+ * first paint (before any scroll event) shows the top of the list. */
43
34
  _scrollTop = $state(0);
44
- /** Latest viewport height reported by the host. The fallback of
45
- * 600 is chosen so that virtualisation has SOMETHING to clip
46
- * against before the first measurement - the overscan band keeps
47
- * the initial paint reasonable even if the real height is
48
- * smaller. */
35
+ /** Latest viewport height reported by the host. 600 is a sensible
36
+ * pre-measurement fallback so virtualisation has something to clip
37
+ * against; overscan keeps the initial paint reasonable when the
38
+ * real height is smaller. */
49
39
  _viewportHeight = $state(600);
50
40
  constructor(deps, options = {}) {
51
41
  this._deps = deps;
52
42
  this._virtualisationThreshold = options.threshold ?? 100;
53
- // Overscan controls how many rows above/below the viewport are
54
- // kept rendered so a fast wheel-scroll does not surface an empty
55
- // grey band before the next paint. The previous default of 10
56
- // was too tight on tables with hundreds of rows: a single wheel
57
- // flick easily moves the viewport past the overscan band before
58
- // the `$derived` chain reschedules and re-renders the visible
59
- // slice. 30 rows is enough to absorb a typical wheel flick at
60
- // 60Hz while still keeping the rendered cell count bounded
61
- // (~52 rows for a 600px viewport at the default 28-48px row
62
- // height: 12 visible + 30 below + 10 above = 52).
43
+ // Overscan rows above and below the viewport stay rendered so a
44
+ // fast wheel-scroll does not surface an empty grey band before
45
+ // the next paint. 30 rows is enough to absorb a typical 60Hz
46
+ // wheel flick while keeping the rendered cell count bounded
47
+ // (~52 rows for a 600px viewport at default row heights).
63
48
  this._overscan = options.overscan ?? 30;
64
49
  }
65
50
  get virtualisationThreshold() {
@@ -75,11 +60,11 @@ export class VirtualisationState {
75
60
  return this._viewportHeight;
76
61
  }
77
62
  /**
78
- * Returns true when the current row count is above the
79
- * virtualisation threshold. Below threshold the public API still
80
- * works (visibleRows returns every row, padding spacers are 0),
81
- * but consumers can short-circuit DOM work that is only needed in
82
- * the virtualised path by reading this flag.
63
+ * True when the current row count is above the virtualisation
64
+ * threshold. Below threshold the public API still works
65
+ * (`visibleRows` returns every row, padding spacers are 0), but
66
+ * consumers can short-circuit virtualisation-only DOM work by
67
+ * reading this flag.
83
68
  */
84
69
  isVirtualised = $derived.by(() => this._deps.getRows().length > this._virtualisationThreshold);
85
70
  /**
@@ -96,13 +81,12 @@ export class VirtualisationState {
96
81
  return this._deps.getEstimatedRowHeight();
97
82
  }
98
83
  /**
99
- * Sum of all row heights. This is the height the body container
100
- * must reserve so the scrollbar matches the un-virtualised height.
84
+ * Sum of all row heights. The body container reserves this height
85
+ * so the scrollbar matches the un-virtualised height.
101
86
  *
102
- * Below threshold the value is still correct (sum of all observed
103
- * row heights or fallbacks), but consumers should generally not
104
- * apply it as `min-height` to the body container when below
105
- * threshold - the natural row flow does the right thing.
87
+ * Below threshold the value is still correct, but consumers should
88
+ * generally not apply it as `min-height` - the natural row flow is
89
+ * fine and forcing the min-height fights against zero-row layout.
106
90
  */
107
91
  totalHeight = $derived.by(() => {
108
92
  const rows = this._deps.getRows();
@@ -113,16 +97,14 @@ export class VirtualisationState {
113
97
  return total;
114
98
  });
115
99
  /**
116
- * Half-open `[start, end)` row-index range that should be rendered
117
- * in the DOM. Below the virtualisation threshold this is the full
118
- * `[0, rows.length)`. Above threshold it is the slice covering the
119
- * viewport (scrollTop -> scrollTop + viewportHeight) widened by
120
- * `_overscan` rows above and below.
100
+ * Half-open `[start, end)` row-index range to render. Below threshold
101
+ * this is the full `[0, rows.length)`. Above threshold it is the
102
+ * slice covering `[scrollTop, scrollTop + viewportHeight]` widened
103
+ * by `_overscan` rows on each side.
121
104
  *
122
- * The walk over row heights is O(N) per re-derive but only fires
123
- * when `_scrollTop`, `_viewportHeight`, the rows array, or any
124
- * relevant row height changes; for N <= a few thousand this is
125
- * well under a millisecond.
105
+ * The O(N) walk re-runs only when `_scrollTop`, `_viewportHeight`,
106
+ * the rows array, or a relevant row height changes; well under a
107
+ * millisecond for N up to a few thousand.
126
108
  */
127
109
  visibleRange = $derived.by(() => {
128
110
  const rows = this._deps.getRows();
@@ -216,15 +198,14 @@ export class VirtualisationState {
216
198
  return total;
217
199
  });
218
200
  /**
219
- * Reports the current scroll position and viewport height. Called
220
- * by `Table.svelte` from a single scroll listener on the outer
221
- * `.datatable` container; the three side TableBody instances all
222
- * read the resulting `visibleRows` so they stay in sync without
223
- * extra plumbing.
201
+ * Report the current scroll position and viewport height. Called by
202
+ * `Table.svelte` from a single scroll listener on the outer
203
+ * `.datatable` container; the three side TableBody instances read
204
+ * the resulting `visibleRows` and stay in sync.
224
205
  *
225
- * The setter early-exits when neither value changed so identical
226
- * back-to-back scroll events (common on macOS rubber-band) do not
227
- * retrigger the derived chain.
206
+ * Early-exits when neither value changed so identical back-to-back
207
+ * scroll events (common on macOS rubber-band) do not re-trigger the
208
+ * derived chain.
228
209
  */
229
210
  registerScrollPosition = (scrollTop, viewportHeight) => {
230
211
  if (scrollTop === this._scrollTop && viewportHeight === this._viewportHeight) {
@@ -1,36 +1,25 @@
1
1
  /**
2
- * Built-in remote data repository used by `createTable({ rows: { kind: 'remote' } })`.
2
+ * Built-in remote data repository used by
3
+ * `createTable({ rows: { kind: 'remote' } })`. Owns URL construction,
4
+ * filter encoding, pagination, sort, debouncing, and page-size
5
+ * persistence so consumers do not have to reimplement them.
3
6
  *
4
- * Phase 1 of the new Table API: this class absorbs the URL construction,
5
- * filter encoding, pagination, sort, debouncing, and page-size persistence
6
- * that every consumer was previously reimplementing for itself (see the
7
- * FloWMS-owned `RemoteTableDataRepository.svelte.ts` for the prior shape).
7
+ * The default filter-encoding strategy is `'query-string'`, producing
8
+ * `?filter[<id>]=<value>&page=<n>&pageSize=<m>&sort=<col>&direction=<asc|desc>`.
9
+ * Pass a custom `filterEncoding: { encode }` for backends that expect a
10
+ * different shape, or drop to `kind: 'custom'` for full control.
8
11
  *
9
- * The default filter-encoding strategy is `'query-string'`, which produces
10
- * a flat `?filter[<id>]=<value>&page=<n>&pageSize=<m>&sort=<col>&direction=<asc|desc>`
11
- * URL. Consumers whose backend expects a different shape pass a custom
12
- * `filterEncoding: { encode }` function. Consumers needing complete
13
- * control over the request lifecycle drop to `kind: 'custom'`, which
14
- * bypasses this repository entirely.
15
- *
16
- * The repository extends `TableDataRepository` for its pagination-state /
17
- * filter-modes / force-refresh plumbing and implements
18
- * `IRemoteDataRepository<TRow>` for the surface `TableContext` consumes.
12
+ * Extends `TableDataRepository` for pagination / filter-modes /
13
+ * force-refresh plumbing and implements `IRemoteDataRepository<TRow>`
14
+ * for the surface `TableContext` consumes.
19
15
  *
20
16
  * @remarks
21
17
  *
22
- * Out of scope for Phase 1:
23
- *
24
- * - Sophisticated filter-mode encoding (`StringFilterMode.NotIn`, the
25
- * `[min, max]` tuple form for ranges, etc.). The Phase 1 default
26
- * encoder emits raw `?filter[<id>]=<JSON-encoded-value>`. Consumers
27
- * needing the rich encoding the FloWMS repo currently does should pass
28
- * a custom encoder in Phase 1 and we will lift the common encodings
29
- * into the library in Phase 2 once the audit of the consumer's actual
30
- * backend shape is complete.
31
- * - The five filter callbacks (`dateFilter` / `numberFilter` / etc.).
32
- * These are local-only and not meaningful for a remote source. The
33
- * interface inherits them as optional; left undefined here.
18
+ * The default encoder emits raw `?filter[<id>]=<JSON-encoded-value>` and
19
+ * does NOT cover rich filter modes (`StringFilterMode.NotIn`, `[min,max]`
20
+ * range tuples, etc.); pass a custom encoder if the backend needs them.
21
+ * The five local-only filter callbacks (`dateFilter` / `numberFilter` /
22
+ * etc.) are inherited as optional and left undefined here.
34
23
  */
35
24
  import type { ColumnFiltersState } from '../Filtering/ColumnFiltersState.js';
36
25
  import type { FilterMode } from '../Filtering/FilterMode.js';
@@ -1,36 +1,25 @@
1
1
  /**
2
- * Built-in remote data repository used by `createTable({ rows: { kind: 'remote' } })`.
2
+ * Built-in remote data repository used by
3
+ * `createTable({ rows: { kind: 'remote' } })`. Owns URL construction,
4
+ * filter encoding, pagination, sort, debouncing, and page-size
5
+ * persistence so consumers do not have to reimplement them.
3
6
  *
4
- * Phase 1 of the new Table API: this class absorbs the URL construction,
5
- * filter encoding, pagination, sort, debouncing, and page-size persistence
6
- * that every consumer was previously reimplementing for itself (see the
7
- * FloWMS-owned `RemoteTableDataRepository.svelte.ts` for the prior shape).
7
+ * The default filter-encoding strategy is `'query-string'`, producing
8
+ * `?filter[<id>]=<value>&page=<n>&pageSize=<m>&sort=<col>&direction=<asc|desc>`.
9
+ * Pass a custom `filterEncoding: { encode }` for backends that expect a
10
+ * different shape, or drop to `kind: 'custom'` for full control.
8
11
  *
9
- * The default filter-encoding strategy is `'query-string'`, which produces
10
- * a flat `?filter[<id>]=<value>&page=<n>&pageSize=<m>&sort=<col>&direction=<asc|desc>`
11
- * URL. Consumers whose backend expects a different shape pass a custom
12
- * `filterEncoding: { encode }` function. Consumers needing complete
13
- * control over the request lifecycle drop to `kind: 'custom'`, which
14
- * bypasses this repository entirely.
15
- *
16
- * The repository extends `TableDataRepository` for its pagination-state /
17
- * filter-modes / force-refresh plumbing and implements
18
- * `IRemoteDataRepository<TRow>` for the surface `TableContext` consumes.
12
+ * Extends `TableDataRepository` for pagination / filter-modes /
13
+ * force-refresh plumbing and implements `IRemoteDataRepository<TRow>`
14
+ * for the surface `TableContext` consumes.
19
15
  *
20
16
  * @remarks
21
17
  *
22
- * Out of scope for Phase 1:
23
- *
24
- * - Sophisticated filter-mode encoding (`StringFilterMode.NotIn`, the
25
- * `[min, max]` tuple form for ranges, etc.). The Phase 1 default
26
- * encoder emits raw `?filter[<id>]=<JSON-encoded-value>`. Consumers
27
- * needing the rich encoding the FloWMS repo currently does should pass
28
- * a custom encoder in Phase 1 and we will lift the common encodings
29
- * into the library in Phase 2 once the audit of the consumer's actual
30
- * backend shape is complete.
31
- * - The five filter callbacks (`dateFilter` / `numberFilter` / etc.).
32
- * These are local-only and not meaningful for a remote source. The
33
- * interface inherits them as optional; left undefined here.
18
+ * The default encoder emits raw `?filter[<id>]=<JSON-encoded-value>` and
19
+ * does NOT cover rich filter modes (`StringFilterMode.NotIn`, `[min,max]`
20
+ * range tuples, etc.); pass a custom encoder if the backend needs them.
21
+ * The five local-only filter callbacks (`dateFilter` / `numberFilter` /
22
+ * etc.) are inherited as optional and left undefined here.
34
23
  */
35
24
  import { browser } from '$app/environment';
36
25
  import { devCatch } from '../../../../Helpers/Helpers.svelte.js';
@@ -10,23 +10,21 @@ import type { SortingState } from './SortingState.js';
10
10
  /**
11
11
  * Union surface implemented by both `LocalTableDataRepository` and any
12
12
  * consumer-supplied remote repository. `TableContext` reads from `dataRepo`
13
- * and `paginationRepo` via this contract; everything reactive is exposed
14
- * through the underlying `$state`-backed properties on the implementation.
13
+ * and `paginationRepo` via this contract; reactivity is exposed through
14
+ * the underlying `$state`-backed properties on the implementation.
15
15
  *
16
- * Implementers are responsible for:
16
+ * Implementers must guarantee:
17
17
  *
18
18
  * - Snapshot consistency: `data`, `totalRows`, `pageStartIndex`,
19
- * `pageEndIndexExclusive`, and `paginationState` must all describe the
20
- * same logical page when read together.
21
- * - Filter safety (remote): `filterBy` accepts `unknown` here for backwards
22
- * compatibility; remote implementations MUST escape values before
23
- * forwarding to a backend (URL encoding, parameterised SQL, etc.). Nothing
24
- * in scoria enforces this and no validation happens server-side on
25
- * scoria's behalf.
26
- * - LSP: `setPageSize: (size: number) => void` is widened to
27
- * `(size: number | string) => void` in the concrete repositories so they
28
- * can accept page-size inputs from a `<select>` element. Callers that hold
29
- * the base interface should always pass `number`.
19
+ * `pageEndIndexExclusive`, and `paginationState` must describe the same
20
+ * logical page when read together.
21
+ * - Filter safety (remote): `filterBy` accepts `unknown`; remote
22
+ * implementations MUST escape values before forwarding to a backend
23
+ * (URL encoding, parameterised SQL, etc.). scoria does not enforce
24
+ * this and no validation happens server-side on its behalf.
25
+ * - LSP: concrete repositories widen `setPageSize` to
26
+ * `(size: number | string) => void` so they can accept raw `<select>`
27
+ * values; callers holding the base interface should pass `number`.
30
28
  */
31
29
  export interface IDataRepository<T extends object> {
32
30
  paginationState: PaginationState;
@@ -52,7 +50,6 @@ export interface IDataRepository<T extends object> {
52
50
  pageStartIndex: number;
53
51
  pageEndIndexExclusive: number;
54
52
  previouslyViewedPage: number;
55
- __queryValues: SvelteMap<string, unknown>;
56
53
  readonly paginationType: PaginationType;
57
54
  filterType: FilterType;
58
55
  data: Array<T>;
@@ -8,9 +8,9 @@ import type { IDataRepository } from './IDataRepository.js';
8
8
  import type { SortingState } from './SortingState.js';
9
9
  /**
10
10
  * Pagination state with the read-only contract enforced at the type
11
- * level. Both fields are read-only because consumers should never mutate
12
- * an existing pagination object - they must reassign the whole shape
13
- * through the public setter so the previously viewed page is tracked.
11
+ * level. Consumers reassign the whole shape through the public setter
12
+ * (rather than mutating fields) so the previously-viewed page is
13
+ * tracked.
14
14
  */
15
15
  export interface ReadonlyPaginationState extends PaginationState {
16
16
  readonly pageIndex: number;
@@ -21,12 +21,6 @@ export interface ReadonlyPaginationState extends PaginationState {
21
21
  * Owns pagination state with localStorage write-through on `pageSize`,
22
22
  * the reactive filter-mode map, the force-refresh hook, and shared
23
23
  * static helpers for parsing comma-separated filter input.
24
- *
25
- * The `out FilterValueType` variance annotation is currently advisory:
26
- * `filtering` reads the parameter (contravariant) but `__queryValues`
27
- * does not currently use it. A proper variance audit is deferred to a
28
- * future workorder; the existing annotation does not break type
29
- * checking.
30
24
  */
31
25
  export declare abstract class TableDataRepository<T extends object, out FilterValueType> implements IDataRepository<T> {
32
26
  private tableName;
@@ -58,22 +52,14 @@ export declare abstract class TableDataRepository<T extends object, out FilterVa
58
52
  abstract pageStartIndex: number;
59
53
  abstract pageEndIndexExclusive: number;
60
54
  constructor(tableName: string, getUserId: () => string | undefined);
61
- /**
62
- * Reactive bag of consumer-defined query values keyed by column id.
63
- * Stored as `unknown` because the shape depends on the column type;
64
- * narrowing to `FilterValueType` is deferred (would force consumers
65
- * to choose a single value type at construction time, which is too
66
- * restrictive for tables mixing several filter modes).
67
- */
68
- __queryValues: SvelteMap<string, unknown>;
69
55
  private _paginationState;
70
56
  /** Current page index plus the configured page size. */
71
57
  get paginationState(): ReadonlyPaginationState;
72
58
  /**
73
- * Replaces pagination state and writes the new `pageSize` through to
59
+ * Replace pagination state and write the new `pageSize` through to
74
60
  * localStorage. Idempotent: identical states are dropped so the
75
- * previously-viewed-page tracker does not lose its value when the
76
- * same state is reassigned (e.g. from a `$derived` re-evaluation).
61
+ * previously-viewed-page tracker keeps its value when the same state
62
+ * is reassigned (e.g. from a `$derived` re-evaluation).
77
63
  */
78
64
  set paginationState(v: ReadonlyPaginationState);
79
65
  private _previouslyViewedPage;
@@ -96,21 +82,20 @@ export declare abstract class TableDataRepository<T extends object, out FilterVa
96
82
  */
97
83
  get forceRefresh(): () => void;
98
84
  /**
99
- * Replaces the force-refresh callback. Also invokes the new callback
100
- * immediately so callers wiring up a remote repo can request a fresh
101
- * payload as a single assignment.
85
+ * @deprecated Assigning the setter both replaces the callback AND
86
+ * invokes it immediately, which is a footgun for callers wiring it up
87
+ * inside a constructor or `$effect.pre`. Use `registerRefreshMethod`
88
+ * to assign without the implicit invoke; call `repo.forceRefresh()`
89
+ * via the getter when an explicit refresh is wanted.
102
90
  *
103
- * The implicit invocation on set is a known footgun (TableDataRepository
104
- * P1 finding): a future workorder will introduce a dedicated
105
- * `triggerRefresh()` method and remove the side effect from the
106
- * setter. Behaviour preserved here to avoid breaking existing
107
- * consumers.
91
+ * Behaviour is preserved for backwards compatibility; the setter logs
92
+ * a dev-only warning so existing call sites surface in development.
108
93
  */
109
94
  set forceRefresh(v: () => void);
110
95
  /**
111
96
  * Registers a refresh callback without invoking it. Preferred over
112
- * the `forceRefresh` setter when the caller does not want the
113
- * implicit immediate refresh.
97
+ * the deprecated `forceRefresh` setter; call `repo.forceRefresh()`
98
+ * separately when an explicit refresh is wanted.
114
99
  */
115
100
  readonly registerRefreshMethod: (method: () => void) => void;
116
101
  /**