@katlux/toolkit 0.1.1-alpha.145 → 0.1.1-alpha.147

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 (298) hide show
  1. package/README.md +32 -22
  2. package/bin/ai-init.mjs +575 -0
  3. package/bin/ai-tokens/adapters/antigravityAdapter.mjs +22 -0
  4. package/bin/ai-tokens/adapters/claudeCodeAdapter.mjs +192 -0
  5. package/bin/ai-tokens/adapters/codexAdapter.mjs +176 -0
  6. package/bin/ai-tokens/adapters/cursorAdapter.mjs +202 -0
  7. package/bin/ai-tokens/adapters/index.mjs +30 -0
  8. package/bin/ai-tokens/cliViews.mjs +301 -0
  9. package/bin/ai-tokens/formatAndDates.mjs +89 -0
  10. package/bin/ai-tokens/reportGenerator.mjs +232 -0
  11. package/bin/ai-tokens/transcriptParser.mjs +299 -0
  12. package/bin/ai-tokens.mjs +38 -872
  13. package/bin/cli.mjs +81 -48
  14. package/bin/create-preset.mjs +1 -0
  15. package/bin/preset-contracts.json +2997 -0
  16. package/dist/compiled/composables/locales/asianAndPacific.mjs +296 -0
  17. package/dist/compiled/composables/locales/northernAndEasternEuropean.mjs +342 -0
  18. package/dist/compiled/composables/locales/westernEuropean.mjs +268 -0
  19. package/dist/compiled/composables/locales.mjs +32 -720
  20. package/dist/compiled/composables/useDataProvider.mjs +39 -26
  21. package/dist/compiled/composables/useFilterLogic.mjs +10 -2
  22. package/dist/compiled/composables/useKatluxForm.mjs +13 -11
  23. package/dist/compiled/composables/usePresetComponent.mjs +2 -0
  24. package/dist/compiled/composables/useRequestQueue.mjs +3 -1
  25. package/dist/compiled/composables/useVirtualDataset.mjs +657 -0
  26. package/dist/compiled/composables/useVirtualScroll.mjs +93 -66
  27. package/dist/compiled/composables/virtualDataset/cacheStateHelpers.mjs +76 -0
  28. package/dist/compiled/composables/virtualDataset/keyboardNavHelpers.mjs +60 -0
  29. package/dist/compiled/composables/virtualDataset/treeSelectionHelpers.mjs +103 -0
  30. package/dist/compiled/composables/virtualDataset/types.mjs +0 -0
  31. package/dist/compiled/utils/deprecation.mjs +44 -0
  32. package/dist/compiled/utils/dom.mjs +124 -0
  33. package/dist/module.cjs +58 -77
  34. package/dist/module.d.cts +5 -0
  35. package/dist/module.d.mts +4 -1
  36. package/dist/module.json +1 -1
  37. package/dist/module.mjs +54 -77
  38. package/dist/runtime/app.config.d.ts +3 -0
  39. package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +1 -1
  40. package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +1 -1
  41. package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +7 -3
  42. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +4 -1
  43. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +7 -3
  44. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +12 -2
  45. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +40 -41
  46. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
  47. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
  48. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  49. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +19 -10
  50. package/dist/runtime/components/KCalendar/KCalendar.global.vue +7 -2
  51. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +19 -10
  52. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +14 -201
  53. package/dist/runtime/components/KCalendar/KCalendar.logic.js +67 -14
  54. package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
  55. package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +15 -1
  56. package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
  57. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +21 -3
  58. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +136 -7
  59. package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
  60. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
  61. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
  62. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +18 -3
  63. package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
  64. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +18 -3
  65. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +16 -2
  66. package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
  67. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +8 -8
  68. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +8 -8
  69. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
  70. package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -3
  71. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +4 -1
  72. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -3
  73. package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +24 -4
  74. package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +43 -22
  75. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +38 -11
  76. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +39 -20
  77. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +38 -11
  78. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +31 -8
  79. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +69 -24
  80. package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +10 -14
  81. package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
  82. package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +10 -14
  83. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
  84. package/dist/runtime/components/KDatatable/KDatatable.logic.js +32 -24
  85. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +33 -15
  86. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +60 -16
  87. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +33 -15
  88. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +30 -6
  89. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +249 -59
  90. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
  91. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
  92. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
  93. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +4 -4
  94. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +4 -4
  95. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +3 -2
  96. package/dist/runtime/components/KDropdown/KDropdown.logic.js +14 -13
  97. package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +55 -4
  98. package/dist/runtime/components/KGantt/KGantt.global.vue +18 -3
  99. package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -4
  100. package/dist/runtime/components/KGantt/KGantt.logic.d.ts +33 -5
  101. package/dist/runtime/components/KGantt/KGantt.logic.js +39 -6
  102. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  103. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  104. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
  105. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
  106. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  107. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  108. package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +4 -1
  109. package/dist/runtime/components/KLayout/KLayout.global.vue +4 -1
  110. package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +4 -1
  111. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +9 -0
  112. package/dist/runtime/components/KLoader/KLoader.global.vue +3 -0
  113. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +9 -0
  114. package/dist/runtime/components/KLoader/KLoader.logic.d.ts +5 -0
  115. package/dist/runtime/components/KLoader/KLoader.logic.js +4 -0
  116. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
  117. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
  118. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +30 -7
  119. package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +1 -0
  120. package/dist/runtime/components/KMultiTabs/MultiTabs.global.d.vue.ts +23 -0
  121. package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +24 -0
  122. package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
  123. package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +3 -1
  124. package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
  125. package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +3 -1
  126. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +2 -1
  127. package/dist/runtime/components/KPagination/KPagination.logic.js +74 -14
  128. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
  129. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
  130. package/dist/runtime/components/KTabs/KTabs.logic.js +33 -11
  131. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
  132. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
  133. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +15 -4
  134. package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
  135. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +15 -4
  136. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +5 -0
  137. package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -0
  138. package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +11 -2
  139. package/dist/runtime/components/KTooltip/KTooltip.logic.js +7 -5
  140. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +4 -4
  141. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +4 -4
  142. package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
  143. package/dist/runtime/components/KTree/KTree.logic.js +37 -13
  144. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -5
  145. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -6
  146. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -5
  147. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +3 -2
  148. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +10 -1
  149. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +40 -6
  150. package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
  151. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +40 -6
  152. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +24 -4
  153. package/dist/runtime/components/KTreeView/KTreeView.logic.js +105 -11
  154. package/dist/runtime/composables/locales/asianAndPacific.d.ts +11 -0
  155. package/dist/runtime/composables/locales/asianAndPacific.js +296 -0
  156. package/dist/runtime/composables/locales/northernAndEasternEuropean.d.ts +12 -0
  157. package/dist/runtime/composables/locales/northernAndEasternEuropean.js +342 -0
  158. package/dist/runtime/composables/locales/westernEuropean.d.ts +10 -0
  159. package/dist/runtime/composables/locales/westernEuropean.js +268 -0
  160. package/dist/runtime/composables/locales.d.ts +4 -24
  161. package/dist/runtime/composables/locales.js +32 -720
  162. package/dist/runtime/composables/useDataProvider.d.ts +5 -3
  163. package/dist/runtime/composables/useDataProvider.js +39 -26
  164. package/dist/runtime/composables/useFilterLogic.d.ts +16 -4
  165. package/dist/runtime/composables/useFilterLogic.js +10 -2
  166. package/dist/runtime/composables/useKatluxForm.d.ts +4 -4
  167. package/dist/runtime/composables/useKatluxForm.js +13 -11
  168. package/dist/runtime/composables/usePresetComponent.js +2 -0
  169. package/dist/runtime/composables/useRequestQueue.d.ts +2 -0
  170. package/dist/runtime/composables/useRequestQueue.js +3 -1
  171. package/dist/runtime/composables/useSortLogic.d.ts +1 -1
  172. package/dist/runtime/composables/useVirtualDataset.d.ts +9 -0
  173. package/dist/runtime/composables/useVirtualDataset.js +657 -0
  174. package/dist/runtime/composables/useVirtualScroll.d.ts +14 -10
  175. package/dist/runtime/composables/useVirtualScroll.js +93 -66
  176. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.d.ts +49 -0
  177. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.js +76 -0
  178. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.d.ts +26 -0
  179. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.js +60 -0
  180. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.d.ts +24 -0
  181. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.js +103 -0
  182. package/dist/runtime/composables/virtualDataset/types.d.ts +113 -0
  183. package/dist/runtime/composables/virtualDataset/types.js +0 -0
  184. package/dist/runtime/directives/clickOutside.d.ts +1 -1
  185. package/dist/runtime/directives/clickOutside.js +41 -13
  186. package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -1
  187. package/dist/runtime/plugins/nuxtCompatPlugin.js +16 -1
  188. package/dist/runtime/plugins/toastPlugin.client.js +2 -2
  189. package/dist/runtime/presets/default/assets/scss/css-variables.css +3 -0
  190. package/dist/runtime/presets/default/assets/scss/css-variables.scss +6 -1
  191. package/dist/runtime/presets/default/assets/scss/index.css +3 -0
  192. package/dist/runtime/presets/default/assets/svg/katlux-logo.svg +7 -0
  193. package/dist/runtime/presets/default/assets/svg/katlux.svg +6 -0
  194. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +3 -2
  195. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +31 -3
  196. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +3 -2
  197. package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
  198. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +6 -0
  199. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
  200. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +7 -0
  201. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +57 -2
  202. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +7 -0
  203. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +6 -5
  204. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -1
  205. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +27 -17
  206. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -1
  207. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -1
  208. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +10 -10
  209. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -1
  210. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +2 -0
  211. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +67 -22
  212. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
  213. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +41 -8
  214. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +184 -174
  215. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +41 -8
  216. package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +17 -10
  217. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +113 -394
  218. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +17 -10
  219. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +6 -0
  220. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +71 -4
  221. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +6 -0
  222. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +5 -2
  223. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +15 -12
  224. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +5 -2
  225. package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +11 -2
  226. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +46 -29
  227. package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -2
  228. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
  229. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +23 -8
  230. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +6 -2
  231. package/dist/runtime/presets/default/components/KLayout/KLayout.vue +2 -2
  232. package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +1 -0
  233. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
  234. package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +1 -0
  235. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -94
  236. package/dist/runtime/presets/default/components/KMultiTabs/KMultiTabs.vue +69 -4
  237. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +18 -46
  238. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +11 -23
  239. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  240. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +24 -8
  241. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  242. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +3 -3
  243. package/dist/runtime/presets/default/components/KTree/KTree.vue +61 -56
  244. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +3 -3
  245. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +1 -0
  246. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +12 -2
  247. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +1 -0
  248. package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +11 -2
  249. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +14 -2
  250. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +11 -2
  251. package/dist/runtime/server/middleware/session.js +7 -0
  252. package/dist/runtime/utils/deprecation.d.ts +14 -0
  253. package/dist/runtime/utils/deprecation.js +44 -0
  254. package/dist/runtime/utils/dom.d.ts +31 -0
  255. package/dist/runtime/utils/dom.js +124 -0
  256. package/dist/skills/KATLUX_INDEX.md +18 -19
  257. package/dist/skills/katlux-components/SKILL.md +2 -0
  258. package/dist/skills/katlux-components/components/KBulkActions.md +26 -2
  259. package/dist/skills/katlux-components/components/KCombobox.md +2 -2
  260. package/dist/skills/katlux-components/components/KDataIterator.md +17 -4
  261. package/dist/skills/katlux-components/components/KDatatable.md +38 -0
  262. package/dist/skills/katlux-components/components/KDatePicker.md +3 -1
  263. package/dist/skills/katlux-components/components/KGantt.md +9 -0
  264. package/dist/skills/katlux-components/components/KIcon.md +1 -1
  265. package/dist/skills/katlux-components/components/KLayout.md +4 -0
  266. package/dist/skills/katlux-components/components/KLineChart.md +3 -0
  267. package/dist/skills/katlux-components/components/KLoader.md +3 -0
  268. package/dist/skills/katlux-components/components/KProductList.md +0 -1
  269. package/dist/skills/katlux-components/components/KScatterChart.md +3 -0
  270. package/dist/skills/katlux-components/components/KTextbox.md +1 -0
  271. package/dist/skills/katlux-components/components/KTreePicker.md +2 -1
  272. package/dist/skills/katlux-components/components/KTreeView.md +12 -0
  273. package/dist/skills/katlux-config/SKILL.md +27 -8
  274. package/dist/skills/katlux-presets/SKILL.md +163 -3
  275. package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
  276. package/dist/skills/katlux-providers/SKILL.md +19 -5
  277. package/dist/skills/katlux-providers/providers/ADataProvider.md +17 -9
  278. package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +27 -3
  279. package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +11 -1
  280. package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
  281. package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +19 -4
  282. package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +4 -2
  283. package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
  284. package/dist/skills/katlux-providers/providers/RequestProvider.md +10 -0
  285. package/dist/skills/katlux-providers/providers/encryption-field-level.md +67 -20
  286. package/dist/skills/katlux-providers/providers/encryption-key-management.md +23 -2
  287. package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
  288. package/dist/skills/katlux-providers/providers/encryption-searchable.md +341 -0
  289. package/dist/skills/katlux-providers/providers/encryption-symmetric.md +29 -2
  290. package/dist/skills/katlux-providers/providers/encryption-threat-model.md +70 -1
  291. package/dist/skills/katlux-providers/providers/encryption.md +26 -1
  292. package/dist/skills/katlux-providers/providers/types.md +3 -1
  293. package/dist/skills/katlux-providers/providers/useDataProvider.md +2 -1
  294. package/dist/skills/katlux-providers/providers/useVirtualDataset.md +154 -0
  295. package/dist/skills/katlux-tokens/SKILL.md +2 -1
  296. package/dist/types.d.mts +1 -1
  297. package/package.json +7 -3
  298. package/bin/add-ai-reference.mjs +0 -259
@@ -9,6 +9,18 @@ Katlux uses a unified **preset** system to allow full visual customization witho
9
9
 
10
10
  - [Step-by-step: Creating a Preset from Scratch](creating-a-preset.md)
11
11
 
12
+ ## Project-Level Configuration
13
+
14
+ Preset selection and available presets are registered in the global `app.config.ts` under `katluxToolkit` (see [katlux-config](../katlux-config/SKILL.md#appconfigts)):
15
+
16
+ ```typescript
17
+ // app.config.ts
18
+ katluxToolkit: {
19
+ presetList: [{ name: 'Default', value: 'default' }],
20
+ activePreset: 'default', // Single preset string or priority array ['dark', 'modern']
21
+ }
22
+ ```
23
+
12
24
  ## Unified Preset Architecture
13
25
 
14
26
  > [!IMPORTANT]
@@ -33,10 +45,11 @@ npx @katlux/toolkit create-preset cyber-brand --base=modern
33
45
  npx @katlux/toolkit create-preset cyber-brand
34
46
  ```
35
47
 
36
- ### Option B: Model Context Protocol (MCP) Tool (`katlux_create_preset`)
48
+ ### Option B: Model Context Protocol (MCP) Tool (`katlux_scaffold`)
37
49
  ```json
38
- // Call katlux_create_preset tool on @katlux/mcp server:
50
+ // Call katlux_scaffold tool on katlux MCP server:
39
51
  {
52
+ "kind": "preset",
40
53
  "name": "cyber-brand",
41
54
  "base": "modern"
42
55
  }
@@ -179,7 +192,127 @@ defineProps<{
179
192
  ```
180
193
 
181
194
  > [!NOTE]
182
- > Custom preset component files are **case-sensitive**. The folder name and file name must exactly match the component name (e.g., `KButton/KButton.vue`). Component-level props come from the internal logic layer — inspect the built-in default preset for the canonical prop list.
195
+ > Custom preset component files are **case-sensitive**. The folder name and file name must exactly match the component name (e.g., `KButton/KButton.vue`). Component-level props come from the internal logic layer (`templateProps`).
196
+
197
+ ### Scaffolding a Preset Component Override (MCP Tool: `katlux_scaffold_preset_component`)
198
+
199
+ Instead of manually inspecting canonical source code, AI agents scaffold compile-safe atomic preset component templates with exact typed contracts via the MCP server:
200
+
201
+ ```json
202
+ {
203
+ "component": "KButton",
204
+ "presetName": "my-brand",
205
+ "density": "minimal",
206
+ "format": "pug",
207
+ "writeToDisk": true
208
+ }
209
+ ```
210
+ *Features:*
211
+ - **Self-contained**: Bundled inside `@katlux/mcp` with zero dependency on `node_modules` or monorepo files.
212
+ - **In-Memory or Disk Writes**: Set `writeToDisk: false` to return the code directly to chat for design customization, or `writeToDisk: true` to scaffold to `presets/<preset>/components/<Component>/<Component>.vue`.
213
+ - **Non-destructive collision guard**: Skips writing if target file already exists on disk.
214
+ - **Contract accuracy**: Guaranteed prop and event contracts matching Katlux's two-tier architecture.
215
+ - **Atomic scaffolding**: Scaffolds strictly one component at a time to preserve the Zero-Copy Cascade.
216
+
217
+ ---
218
+
219
+ ### Overriding Data Components in Presets (`KDatatable`, `KDataIterator`)
220
+
221
+ > [!IMPORTANT]
222
+ > **Data Component Architecture Rule for AI Agents & Developers**:
223
+ > When creating or overriding data-driven components in a preset (`KDatatable`, `KDataIterator`, or custom virtual tables/grids):
224
+ > 1. **Never copy-paste raw virtual scrolling math, row caches, or slice queue algorithms** into the preset component.
225
+ > 2. **Always consume `useVirtualDataset`** from `#toolkit/composables/useVirtualDataset`.
226
+ > 3. The preset component is strictly responsible for **DOM markup, CSS variables, slot rendering, and ARIA attributes**. All data provider bridging, windowing, and selection are handled by `useVirtualDataset`.
227
+
228
+ #### Canonical Data Component Recipe (`KDatatable.vue` in a Preset)
229
+
230
+ ```vue
231
+ <template lang="pug">
232
+ .k-datatable(
233
+ :ref="tableContainerRef"
234
+ @scroll="virtual.onScroll"
235
+ :style="{ maxHeight: `${viewportHeight}px`, overflowY: 'auto' }"
236
+ )
237
+ table
238
+ thead
239
+ tr
240
+ th(v-if="multiSelect")
241
+ KCheckbox(:modelValue="virtual.selectAll.value" @update:modelValue="virtual.toggleSelectAll")
242
+ th(v-for="field in activeFields" :key="field" @click="handleSort(field)")
243
+ slot(:name="`header-${field}`" :field="field")
244
+ | {{ columnHeaders?.[field] || field }}
245
+ tbody
246
+ // 1. Top Spacer: Maintains proportional scrollbar height
247
+ tr.spacer-top(v-if="virtualScroll && virtual.topSpacerHeight.value > 0")
248
+ td(:colspan="colSpan" :style="{ height: `${virtual.topSpacerHeight.value}px`, padding: 0 }")
249
+
250
+ // 2. Visible Window Rows
251
+ tr(
252
+ v-for="(row, idx) in virtual.visibleRows.value"
253
+ :key="row[idKey] || (virtual.startIndex.value + idx)"
254
+ :class="{ 'is-selected': virtual.isRowSelected(row) }"
255
+ )
256
+ td(v-if="multiSelect")
257
+ KCheckbox(:modelValue="virtual.isRowSelected(row)" @update:modelValue="virtual.toggleSelection(row)")
258
+ td(v-for="field in activeFields" :key="field")
259
+ slot(:name="`cell-${field}`" :row="row" :value="row[field]")
260
+ | {{ row[field] }}
261
+
262
+ // 3. Bottom Spacer: Maintains proportional scrollbar height
263
+ tr.spacer-bottom(v-if="virtualScroll && virtual.bottomSpacerHeight.value > 0")
264
+ td(:colspan="colSpan" :style="{ height: `${virtual.bottomSpacerHeight.value}px`, padding: 0 }")
265
+ </template>
266
+
267
+ <script setup lang="ts">
268
+ import { ref, computed } from 'vue'
269
+ import { useVirtualDataset } from '#toolkit/composables/useVirtualDataset'
270
+
271
+ const props = withDefaults(defineProps<{
272
+ dataProvider?: any
273
+ items?: any[]
274
+ visibleFields?: string[] | null
275
+ columnHeaders?: Record<string, string>
276
+ virtualScroll?: boolean
277
+ itemHeight?: number
278
+ viewportHeight?: number
279
+ multiSelect?: boolean
280
+ idKey?: string
281
+ }>(), {
282
+ virtualScroll: true,
283
+ itemHeight: 40,
284
+ viewportHeight: 500,
285
+ multiSelect: false,
286
+ idKey: 'id'
287
+ })
288
+
289
+ const tableContainerRef = ref<HTMLElement | null>(null)
290
+
291
+ // Centralized virtual dataset bridge handles viewport, cache, encryption, and selection:
292
+ const virtual = useVirtualDataset({
293
+ provider: () => props.dataProvider,
294
+ items: () => props.items,
295
+ itemHeight: () => props.itemHeight,
296
+ viewportHeight: () => props.viewportHeight,
297
+ virtualScroll: () => props.virtualScroll,
298
+ scrollContainerRef: tableContainerRef,
299
+ idKey: props.idKey
300
+ })
301
+
302
+ const colSpan = computed(() => (props.visibleFields?.length || 1) + (props.multiSelect ? 1 : 0))
303
+ </script>
304
+
305
+ <style lang="scss" scoped>
306
+ .k-datatable {
307
+ width: 100%;
308
+ border-collapse: collapse;
309
+ th, td {
310
+ padding: var(--gap-sm) var(--gap-md);
311
+ border-bottom: 1px solid var(--border-color-light);
312
+ }
313
+ }
314
+ </style>
315
+ ```
183
316
 
184
317
  ---
185
318
 
@@ -356,3 +489,30 @@ const { metadata, isCustomTemplate, templateName, refreshTemplate } = useTemplat
356
489
  })
357
490
  ```
358
491
 
492
+ ---
493
+
494
+ ## Preset DOM & Component Integration Contracts
495
+
496
+ Custom preset components (`.vue`) are free to use any HTML structure, custom element tags, Tailwind/utility classes, or multi-root fragments without keeping default CSS classes (e.g., `.modal-portal`, `.KCalendarMonth`, `.KTextbox`). To integrate cleanly with `@katlux/toolkit` logic layers (`*.logic.ts`) and form helpers (`useKatluxForm`), custom presets should observe the following component contracts:
497
+
498
+ ### 1. Imperative Focus Exposure (`defineExpose({ focus })`)
499
+ - **`KTextbox` / `KCombobox`**: Expose `focus()` via `defineExpose({ focus })` on preset templates so parent components (such as `KComboboxList` focusing its filter `KTextbox`) and `useKatluxForm` (`focusTarget()`) can move focus without querying internal `<input>` elements or relying on single-root `.$el`.
500
+ - When a custom preset does not expose `focus()`, `focusTarget()` falls back safely across single-root and multi-root fragment DOM nodes.
501
+
502
+ ### 2. Modal Teleport Host (`KModal` & `modalId`)
503
+ - **`KModal`** injects/provides a unique `modalPortalId` string to descendants and passes `modalId` as a prop to its preset template.
504
+ - Render an element with `:id="modalId"` (no `.modal-portal` CSS class required) inside custom `KModal` templates so nested overlays (`KDropdown`, `KContextMenu`) teleport inside the modal's top-layer `<dialog>` stacking context.
505
+ - If a custom `KModal` omits an element with `id === modalId`, `resolveModalTeleportTarget()` automatically falls back to `'body'` rather than mounting into a missing selector.
506
+
507
+ ### 3. Overlay Geometry & Event Fallbacks (`KDropdown`, `KContextMenu`, `KTooltip`)
508
+ - **`KDropdown` (`anchorEl`)** & **`KContextMenu` (`target`)**: Accept a raw `Element`, `Ref`, or Vue `ComponentPublicInstance` (single-root or multi-root fragment); `resolveElement()` / `resolveElements()` unwraps all roots cleanly and guards missing elements or SSR environments (`typeof document === 'undefined'`).
509
+ - **`KContextMenu`**: Bind `@contextmenu="onContextMenu"` in custom presets directly (emitting `registerSourceRef` is optional). Intentional dismissals (`closeMenu()`) increment the reactive `focusRequestId` prop so presets restore focus without inspecting `document.activeElement` containment on outside clicks.
510
+ - **`KTooltip`**: Bind `@mouseenter="showTooltip($event)"` / `@mouseleave="hideTooltip"` in custom presets; omitting `registerWrapperRef` falls back safely to `event.currentTarget`.
511
+
512
+ ### 4. Reactive Composite & Input Controls (`KCalendarMonth`, `KGantt`, `KTree`, `KMaskTextbox`, `KSlider`, `KRangeSlider`)
513
+ - **`KCalendarMonth`**: `KCalendarMonth.logic.ts` updates reactive `focusedDay` and increments `focusRequestId` on arrow key navigation without querying DOM nodes; presets watch `focusRequestId` to focus their own day elements across any table/grid nesting.
514
+ - **`KGantt` (`KGanttTimeline`)**: `KGanttTimeline` emits `@timeline-panstart` on cell mousedown (with `.stop` on task bars), passes `wrapperWidth` as a number in `@task-dragstart`, and passes the click event in `@task-click`, eliminating `.closest()` DOM queries and capture-phase DOM click listeners in `KGantt`.
515
+ - **`KTree` (`KTreeNodeItem`)**: `KTree` increments reactive `focusRequestId` and passes it to `KTreeNodeItem` (which focuses its own node ref when `isFocused` is true) instead of querying `.tree-node[data-node-id="..."]`.
516
+ - **`KMaskTextbox`, `KSlider`, `KRangeSlider`**: `KMaskTextbox.logic.ts` validates date/time pattern segments (`DD`, `MM`, `HH`, `mm`, `ss`) purely on string values without `@beforeinput` / `HTMLInputElement` inspection; `KSlider` and `KRangeSlider` use `v-model.number` computed bindings without `HTMLElement` track-click or `HTMLInputElement` casts.
517
+
518
+
@@ -160,6 +160,73 @@ withDefaults(defineProps<ButtonProps>(), {
160
160
  </style>
161
161
  ```
162
162
 
163
+ ### Overriding Data Components (`KDatatable`, `KDataIterator`)
164
+ When overriding a data-intensive component like `KDatatable` in your preset, **never copy-paste virtual scroll math, page slice queuing, or row caching**. Use the `@katlux/toolkit` composable `useVirtualDataset`:
165
+
166
+ ```vue
167
+ <!-- presets/my-brand/components/KDatatable/KDatatable.vue -->
168
+ <template lang="pug">
169
+ .KDatatable.my-brand-datatable(:ref="containerRef" @scroll="virtual.onScroll" :style="{ maxHeight: `${viewportHeight}px`, overflowY: 'auto' }")
170
+ table
171
+ thead
172
+ tr
173
+ th(v-if="multiSelect")
174
+ KCheckbox(:modelValue="virtual.selectAll.value" @update:modelValue="virtual.toggleSelectAll")
175
+ th(v-for="field in activeFields" :key="field")
176
+ slot(:name="`header-${field}`" :field="field") {{ columnHeaders?.[field] || field }}
177
+ tbody
178
+ tr.spacer-top(v-if="virtualScroll && virtual.topSpacerHeight.value > 0")
179
+ td(:colspan="colSpan" :style="{ height: `${virtual.topSpacerHeight.value}px`, padding: 0 }")
180
+ tr(
181
+ v-for="(row, idx) in virtual.visibleRows.value"
182
+ :key="row[idKey] || (virtual.startIndex.value + idx)"
183
+ :class="{ 'is-selected': virtual.isRowSelected(row) }"
184
+ )
185
+ td(v-if="multiSelect")
186
+ KCheckbox(:modelValue="virtual.isRowSelected(row)" @update:modelValue="virtual.toggleSelection(row)")
187
+ td(v-for="field in activeFields" :key="field")
188
+ slot(:name="`cell-${field}`" :row="row" :value="row[field]") {{ row[field] }}
189
+ tr.spacer-bottom(v-if="virtualScroll && virtual.bottomSpacerHeight.value > 0")
190
+ td(:colspan="colSpan" :style="{ height: `${virtual.bottomSpacerHeight.value}px`, padding: 0 }")
191
+ </template>
192
+
193
+ <script setup lang="ts">
194
+ import { ref, computed } from 'vue'
195
+ import { useVirtualDataset } from '#toolkit/composables/useVirtualDataset'
196
+
197
+ const props = withDefaults(defineProps<{
198
+ dataProvider?: any
199
+ items?: any[]
200
+ visibleFields?: string[] | null
201
+ columnHeaders?: Record<string, string>
202
+ virtualScroll?: boolean
203
+ itemHeight?: number
204
+ viewportHeight?: number
205
+ multiSelect?: boolean
206
+ idKey?: string
207
+ }>(), {
208
+ virtualScroll: true,
209
+ itemHeight: 40,
210
+ viewportHeight: 500,
211
+ multiSelect: false,
212
+ idKey: 'id'
213
+ })
214
+
215
+ const containerRef = ref<HTMLElement | null>(null)
216
+ const virtual = useVirtualDataset({
217
+ provider: () => props.dataProvider,
218
+ items: () => props.items,
219
+ itemHeight: () => props.itemHeight,
220
+ viewportHeight: () => props.viewportHeight,
221
+ virtualScroll: () => props.virtualScroll,
222
+ scrollContainerRef: containerRef,
223
+ idKey: props.idKey
224
+ })
225
+
226
+ const colSpan = computed(() => (props.visibleFields?.length || 1) + (props.multiSelect ? 1 : 0))
227
+ </script>
228
+ ```
229
+
163
230
  ---
164
231
 
165
232
  ## 6. Step 3: Registering & Activating the Preset (`app.config.ts`)
@@ -7,6 +7,17 @@ description: Complete reference and atomic index for Katlux data management arch
7
7
 
8
8
  > **Atomic Architecture**: Data providers and architectural subsystems are divided into atomic, focused specification files under [`providers/`](providers/). To minimize token consumption and avoid context bloat, read **only** the atomic provider file needed for your task.
9
9
 
10
+ ## Project-Level Configuration
11
+
12
+ Provider defaults are registered in the global `app.config.ts` under `katluxProviders` (see [katlux-config](../katlux-config/SKILL.md#appconfigts)) or programmatically via `setGlobalDataProviderConfig({ locale })`:
13
+
14
+ ```typescript
15
+ // app.config.ts
16
+ katluxProviders: {
17
+ locale: 'en-US', // Tier 2 fallback: instance locale -> project config -> $i18n.locale -> undefined
18
+ }
19
+ ```
20
+
10
21
  ---
11
22
 
12
23
  ## 1. Core Architecture & Base Engine
@@ -16,17 +27,19 @@ description: Complete reference and atomic index for Katlux data management arch
16
27
  | `ADataProvider` | Core abstract base class | Foundation for all providers. Constructor options, native state properties, observer events, URL serialization | [ADataProvider.md](providers/ADataProvider.md) |
17
28
  | Core Types & Interfaces | Standard interfaces and enums | `IDataResult`, `IDataFilter`, `IDataSort`, `ECacheStrategy`, filter operators | [types.md](providers/types.md) |
18
29
  | `useDataProvider` | Vue 3 reactivity bridge composable | Binds native `ADataProvider` to Vue refs (`pageData`, `loading`, `rowCount`), Pinia store sync, SSR cleanup | [useDataProvider.md](providers/useDataProvider.md) |
30
+ | `useVirtualDataset` | Virtual dataset & windowing bridge | Combines `useDataProvider` and `useVirtualScroll`, row delivery cache, encryption retention, page queue, selection | [useVirtualDataset.md](providers/useVirtualDataset.md) |
19
31
  | React 18+ Integration | React integration guide | `useSyncExternalStore` binding for zero-overhead React 18+ concurrent rendering | [react-integration.md](providers/react-integration.md) |
20
32
 
21
33
  ---
22
34
 
23
35
  ## 2. Client-Side Data Providers
24
36
 
25
- | Class | Description | Caching / Performance | Spec Link |
37
+ | Class | Description | Caching / Performance / Batching | Spec Link |
26
38
  | :--- | :--- | :--- | :--- |
27
- | `CFlatClientDataProvider` | In-memory client data engine | Instant sorting, complex AST filtering, local pagination for preloaded arrays | [CFlatClientDataProvider.md](providers/CFlatClientDataProvider.md) |
28
- | `CTreeClientDataProvider` | Hierarchical client tree engine | Parent-child relationship management, recursive expansion, tree filtering | [CTreeClientDataProvider.md](providers/CTreeClientDataProvider.md) |
29
- | `CAPIFlatClientDataProvider` | Remote fetch with client-side ops | Fetches dataset from API once, then performs all filtering/sorting locally | [CAPIFlatClientDataProvider.md](providers/CAPIFlatClientDataProvider.md) |
39
+ | `CFlatClientDataProvider` | In-memory client data engine | Instant sorting, complex AST filtering, local pagination for preloaded arrays. Progressive chunked ingestion via `batchSize`. | [CFlatClientDataProvider.md](providers/CFlatClientDataProvider.md) |
40
+ | `CTreeClientDataProvider` | Hierarchical client tree engine | Parent-child relationship management, recursive expansion, tree filtering. Progressive chunked tree ingestion via `batchSize`. | [CTreeClientDataProvider.md](providers/CTreeClientDataProvider.md) |
41
+ | `CAPIFlatClientDataProvider` | Remote fetch with client-side ops | Fetches dataset from API once, then performs all filtering/sorting locally. Supports sequential background batch ingestion (`batchSize`, `batchLoad: 'initially' \| 'onDemand'`). | [CAPIFlatClientDataProvider.md](providers/CAPIFlatClientDataProvider.md) |
42
+ | `CAPITreeClientDataProvider` | Remote hierarchical tree client provider | Fetches hierarchical data with client-side tree traversal, local filtering, and incremental batch ingestion (`batchSize`). | [CAPIFlatClientDataProvider.md](providers/CAPIFlatClientDataProvider.md) |
30
43
 
31
44
  ---
32
45
 
@@ -37,6 +50,7 @@ description: Complete reference and atomic index for Katlux data management arch
37
50
  | `CAPIFlatServerDataProvider` | Remote HTTP REST flat server provider | Offloads pagination, sorting, and filter AST to backend endpoints via HTTP GET/POST | [CAPIFlatServerDataProvider.md](providers/CAPIFlatServerDataProvider.md) |
38
51
  | `CFlatServerDataProvider` | Base remote server data provider | Generic server provider extensible for custom network layers (GraphQL, gRPC, RPC) | [CFlatServerDataProvider.md](providers/CFlatServerDataProvider.md) |
39
52
  | `CTreeServerDataProvider` | Remote hierarchical tree server provider | Server-side lazy loading of child tree nodes and sub-branches | [CTreeServerDataProvider.md](providers/CTreeServerDataProvider.md) |
53
+ | `CAPITreeServerDataProvider` | Remote HTTP REST hierarchical tree server provider | Extends `CTreeServerDataProvider` with `RequestProvider` (API URL, caching, deduplication, `expandedNodes` query serialization) | [CAPITreeServerDataProvider.md](providers/CAPITreeServerDataProvider.md) |
40
54
  | API Communication Protocol | Standard query params & filter JSON AST | Specification for backend developers to implement Katlux-compatible endpoints | [api-protocol.md](providers/api-protocol.md) |
41
55
  | Provider Testing Isolation | Test patterns & `nuxtAppCompat` | Safe unit testing of server providers without full Nuxt runtime overhead | [testing-isolation.md](providers/testing-isolation.md) |
42
56
 
@@ -50,7 +64,7 @@ description: Complete reference and atomic index for Katlux data management arch
50
64
  | `RequestQueue` | Offline PWA operation queue | Queues mutations offline in IndexedDB, auto-flushes on reconnect | [RequestQueue.md](providers/RequestQueue.md) |
51
65
  | `KatluxIndexedDB` | High-performance IndexedDB wrapper | Client-side persistent storage for offline data and large cache entries | [KatluxIndexedDB.md](providers/KatluxIndexedDB.md) |
52
66
  | `CacheProvider` | Tiered multi-layer caching engine | Memory, BrowserSession, LocalStorage, IndexedDB, Cookie tiers | [caching.md](providers/caching.md) |
53
- | `EncryptionProvider` & `CKeyManager` | WebCrypto & NodeCrypto cryptographic suite | AES-GCM, asymmetric hybrid, ADEK re-wrapping, RFC 8785 grants, domain KDF, TOFU pinning, streaming AEAD, blind indexing | [encryption.md](providers/encryption.md) (Index: [threat-model](providers/encryption-threat-model.md) · [symmetric](providers/encryption-symmetric.md) · [asymmetric](providers/encryption-asymmetric.md) · [key-mgmt](providers/encryption-key-management.md) · [key-pinning](providers/encryption-key-pinning.md) · [streaming](providers/encryption-streaming.md) · [field-level](providers/encryption-field-level.md)) |
67
+ | `EncryptionProvider` & `CKeyManager` | WebCrypto & NodeCrypto cryptographic suite | AES-GCM, asymmetric hybrid, ADEK re-wrapping, RFC 8785 grants, domain KDF, TOFU pinning, streaming AEAD, blind indexing | [encryption.md](providers/encryption.md) (Index: [threat-model](providers/encryption-threat-model.md) · [symmetric](providers/encryption-symmetric.md) · [asymmetric](providers/encryption-asymmetric.md) · [key-mgmt](providers/encryption-key-management.md) · [key-pinning](providers/encryption-key-pinning.md) · [streaming](providers/encryption-streaming.md) · [field-level](providers/encryption-field-level.md) · [searchable](providers/encryption-searchable.md)) |
54
68
 
55
69
  ---
56
70
 
@@ -15,14 +15,14 @@
15
15
  | --- | --- | --- | --- |
16
16
  | `filter` | `IDataFilter` | `null` | Initial filter configuration |
17
17
  | `sortList` | `IDataSort[]` | `[]` | Initial sort configuration |
18
- | `pageSize` | `number` | `10` | Items per page |
18
+ | `pageSize` | `number` | `10` | Items per page. Set `<= 0` for unpaged mode. |
19
19
  | `currentPage` | `number` | `1` | Starting page |
20
20
  | `SSR` | `boolean` | `false` | Server-side rendering flag |
21
- | `urlPageParam` | `string` | `undefined` | URL query key for page sync (e.g. `'p'`) |
22
21
  | `cacheStrategy` | `ECacheStrategy` | `undefined` | Persistence engine |
23
22
  | `cacheLifetime` | `number` | `undefined` | Cache expiration in milliseconds |
24
23
  | `filterDebounce` | `number` | `300` | Debounce time in ms for `setFilter` |
25
24
  | `sortDebounce` | `number` | `200` | Debounce time in ms for `setSortList` |
25
+ | `locale` | `string` | `undefined` | BCP 47 locale tag for `Intl.Collator` string sorting (numeric collation enabled) |
26
26
  | `context` | `Record<string, unknown>` | `undefined` | Framework-agnostic SSR context (React SSR state, Next.js context, or Nuxt app instance) |
27
27
  | `nuxtApp` | `unknown` | `undefined` | *(Deprecated, use `context`)* Nuxt app instance for backward compatibility |
28
28
  | `refreshOnMutation` | `boolean` | `true` | Reload data after `create`/`update`/`delete` |
@@ -36,21 +36,29 @@
36
36
  - **`pageSize`**: `number` - Items per page.
37
37
  - **`filter`**: `IDataFilter | null` - Active filter configuration.
38
38
  - **`sortList`**: `IDataSort[]` - Active multi-column sort array.
39
- - **`urlPageParam`**: `string` - URL query key for pagination (e.g., `'p'`).
39
+ - **`stateVersion`**: `number` - Monotonically increasing version counter incremented on every `notify()` or mutation.
40
40
  - **`SSR`**: `boolean` - Server-side rendering flag.
41
41
 
42
- > **Architecture Note (Headless Data Layer)**: Selection state (`selectedRows`, `selectAll`, `selectAllScope`, `unselectedRows`) is transient UI state owned exclusively by presentation components like `KDatatable`. DataProviders remain pure headless data engines (fetching, caching, sorting, filtering, pagination) with zero selection state, ensuring multiple components (e.g. Datatable + Combobox) can safely share the same provider without cross-component selection collisions.
42
+ > **Architecture Note (Headless Data Layer & Client/Server Parity)**:
43
+ > - **Zero Selection Crosstalk**: Selection state (`selectedRows`, `selectAll`, `selectAllScope`, `unselectedRows`) is transient UI state owned exclusively by presentation components like `KDatatable`. DataProviders remain pure headless data engines (fetching, caching, sorting, filtering, pagination) with zero selection state, ensuring multiple components (e.g. Datatable + Combobox) can safely share the same provider without cross-component selection collisions.
44
+ > - **Unified Contract Across Client & Server**: DataProvider semantics are identical whether using a client-side provider (`CFlatClientDataProvider`) or server-side provider (`CAPIFlatServerDataProvider`). In dataset-scope selection and virtual scrolling, `selectedRows` is passed as `[]` because massive datasets cannot be enumerated in client memory. Handlers must inspect `isAllSelected` and `filter` to perform dataset/query-level operations. DataProviders do not fabricate artificial DOM viewport slices.
43
45
 
44
46
  ### Methods
45
47
  - **`setFilter(filter: IDataFilter | null, immediate: boolean = false)`**: Updates filter and resets to page 1. Set `immediate: true` to bypass the 300ms debounce.
46
48
  - **`setSortList(sort: IDataSort[], immediate: boolean = false)`**: Updates sorting and resets to page 1.
47
- - **`setCurrentPage(page: number)`**: Direct page navigation.
48
- - **`setPageSize(size: number)`**: Updates items per page; resets to page 1.
49
+ - **`setCurrentPage(page: number): Promise<void>`**: Direct page navigation. Returns a Promise resolving only after network/provider data has loaded and processed.
50
+ - **`setPageSize(size: number): Promise<void>`**: Updates items per page; resets to page 1 and awaits data loading.
51
+ - **`prevPage(): Promise<void>`**: Navigates to previous page and awaits data loading.
52
+ - **`nextPage(): Promise<void>`**: Navigates to next page and awaits data loading.
53
+ - **`batchUpdates<R>(fn: () => R): R`**: Batches multiple state updates or mutations so that `notify()` and subscriber events fire exactly once upon completion rather than on every state change. Supports nested calls and asynchronous handlers.
49
54
  - **`loadPageData(options?)`**: (Abstract) Core logic for data retrieval. Supports `{ disableCache: true }` to force a fresh fetch.
50
55
  - **`refresh(hardRefresh?: boolean)`**: Re-runs the last request and reloads data. Cache will only be overridden if `hardRefresh` is true.
51
- - **`subscribe(listener: (state) => void): () => void`**: Subscribes a listener to provider state updates. Returns an unsubscribe function.
52
- - **`notify()`**: Dispatches current state to all active subscribers.
53
- - **`getState(): IDataProviderState<T>`**: Returns an immutable snapshot object of current state (`currentPage`, `pageSize`, `filter`, `sortList`).
56
+ - **`subscribe(listener: (provider) => void): () => void`**: Subscribes a listener to provider state updates. Returns an unsubscribe function.
57
+ - **`notify()`**: Dispatches current state to all active subscribers and increments `stateVersion`.
58
+ - **`onSortChanged(listener: (sortList: IDataSort[]) => void): () => void`**: Subscribes specifically to sort changes.
59
+ - **`onFilterChanged(listener: (filter: IDataFilter | null) => void): () => void`**: Subscribes specifically to filter changes.
60
+ - **`onDataChanged(listener: (pageData: T[]) => void): () => void`**: Subscribes specifically to page data changes.
61
+ - **`getState(): IDataProviderState<T>`**: Returns an immutable snapshot object of current state (`currentPage`, `pageSize`, `filter`, `sortList`, `stateVersion`).
54
62
  - **`setState(partial: Partial<IDataProviderState<T>>, options?: IDataProviderSetStateOptions): void`**: Atomically updates provider state. Supports `{ silent: true }` to avoid auto-triggering data loads.
55
63
  - **`onStateChange(listener: TDataProviderStateChangeListener<T>): () => void`**: Subscribes specifically to state change events, providing an array of changed keys. Returns unsubscribe function.
56
64
  - **`serializeState(): string`**: Serializes active pagination, filters, and sorts to a URL query string (e.g. `page=2&pageSize=25`).
@@ -1,12 +1,36 @@
1
1
  ### `CAPIFlatClientDataProvider` / `CAPITreeClientDataProvider`
2
2
  Specialized versions that fetch a dataset **once** from an API and then manage it locally as flat or tree data.
3
- - **Purpose**: Ideal for small-to-medium datasets that need local filtering/sorting after an initial fetch.
3
+ - **Purpose**: Ideal for datasets that need local filtering/sorting after an initial fetch.
4
+ - **Batch Ingestion (`batchSize: number | false`)**:
5
+ - When `batchSize: false` (default), fetches the entire dataset in a single request (`pageSize: 0` or standard endpoint).
6
+ - When `batchSize: number` (e.g. `50`), fetches data using standard server-side pagination query parameters (`pageNumber: 1, 2, ...`, `pageSize: batchSize`), expecting standard `IDataResult<TRow>` (`{ rowCount: number, rows: TRow[] }`).
7
+ - **Fast UI Readiness**: Batch 1 is displayed immediately (`loading` turns `false`), allowing immediate user interaction.
8
+ - **Batch Loading Strategies (`batchLoad`)**:
9
+ - `'initially'` (default): Sequentially streams remaining batches in the background while `isBatchLoading` is `true`. Each batch accumulates into `allData`, updates `batchProgress`, and triggers `onBatchLoaded(event)`.
10
+ - `'onDemand'`: Loads only Batch 1 on initial fetch, setting `rowCount` from `result.rowCount` and registering batch 1 in `loadedBatches`. Defers subsequent batch requests until user interaction requires records outside loaded memory (pagination navigation, virtual scroll viewport shifts, or explicit calls to `loadBatch` / `ensureRangeLoaded`).
11
+ - **On-Demand Buffer Management**:
12
+ - `loadedBatches: Set<number>`: Registry tracking all currently ingested batch indices.
13
+ - Splicing: On-demand batches are spliced directly into `allData` at `(batchNumber - 1) * batchSize`, maintaining an efficient sparse data buffer.
14
+ - Viewport & Pagination Triggers: Navigating to page $P$ via `setCurrentPage(P)` computes record range $[(P - 1) \cdot \text{pageSize}, P \cdot \text{pageSize}]$ and lazily queries any missing batches covering that range.
15
+ - Virtual Scrolling: Window shifts invoke `ensureRangeLoaded(startIndex, endIndex)` to lazily fetch missing batch ranges.
16
+ - In-Flight Deduplication: Simultaneous requests for the same batch are deduplicated into a shared single Promise.
17
+ - **Filter & Sort Invalidation Strategy (`onDemandFilterPolicy`)**:
18
+ - `'ingestAll'` (default): When a client-side filter or sort is applied while only a subset of batches are loaded, automatically streams all remaining batches in the background to guarantee 100% accurate client-side evaluation across the full dataset.
19
+ - `'warnOnly'`: Issues a development warning and sorts/filters only the records currently in memory without issuing remote requests.
20
+ - **Generation Tracking**: Switching URLs via `setAPIUrl()` or triggering `refresh()` increments the generation token, immediately aborting any active background batch stream to prevent race conditions or stale data contamination.
4
21
  - **Methods**:
5
22
  | Method | Params | Description |
6
23
  | --- | --- | --- |
7
24
  | `setAPIUrl(url)` | `string` | Sets endpoint and triggers initial fetch |
8
- | `refresh(hardRefresh?)`| `boolean` | Manually refetch the entire dataset. Cache will only be overridden if `hardRefresh` parameter is true. |
9
- | `setFilter(filter)` | `IDataFilter \| null` | Applies a structured filter to the locally cached dataset. Filtering runs client-side via `useFilterLogic()`. Resets to page 1. |
25
+ | `loadMore()` | None | Progressively fetches and accumulates the next page into `allData` with deduplication |
26
+ | `refresh(hardRefresh?)`| `boolean` | Manually refetch the entire dataset. Cache will only be overridden if `hardRefresh` parameter is true. Resets batch registry. |
27
+ | `loadBatch(batchNumber)` | `number` | On-demand fetch of a specific batch index; splices into `allData`. |
28
+ | `ensureRangeLoaded(start, end)` | `number, number` | Ensures all batches covering index range `[start, end)` are loaded. |
29
+ | `loadRange(start, end)` | `number, number` | Alias for `ensureRangeLoaded`. |
30
+ | `ingestAllBatches()` | None | Sequentially fetches all missing on-demand batches. |
31
+ | `setCurrentPage(page)` | `number` | Navigates to page, fetching missing on-demand batches if required before page slice render. |
32
+ | `setFilter(filter, immediate?)` | `IDataFilter \| null, boolean?` | Applies a structured filter. When in on-demand mode with unloaded batches, executes `onDemandFilterPolicy`. |
33
+ | `setSortList(sortList, immediate?)` | `IDataSort[], boolean?` | Applies client-side sorting. When in on-demand mode with unloaded batches, executes `onDemandFilterPolicy`. |
10
34
  | `create(item)` | `TRow` | POST to API and update local state |
11
35
  | `update(item)` | `TRow` | PUT to API and update local item |
12
36
  | `delete(items)` | `TRow[]` | DELETE from API and remove locally |
@@ -16,9 +16,11 @@ Handle full API integration with automatic query generation. Pagination, filteri
16
16
  | --- | --- | --- |
17
17
  | `refresh(hardRefresh?)`| `boolean` | Manual trigger for reload. Cache will only be overridden if `hardRefresh` parameter is true. |
18
18
  | `loadPageData(opts)` | `{ disableCache?: boolean }` | Core logic for data retrieval |
19
+ | `fetchAll(opts?)` | `{ disableCache?: boolean; signal?: AbortSignal }` | Fetches unpaginated dataset (`pageSize: 0`) into `_allData` without altering active `pageSize` |
19
20
  | `create(item)` | `TRow` | Async POST request to creation endpoint |
20
21
  | `update(item)` | `TRow` | Async PUT request to update endpoint |
21
22
  | `delete(items)` | `TRow[]` | Async batch deletion via endpoint |
23
+ | `batchUpdates(fn)` | `() => R` | Inherited from `ADataProvider`. Groups multiple mutations or state changes so `notify()` fires once. |
22
24
 
23
25
  #### Server-Side Encrypted Datatable & Search Integration
24
26
  When querying backend persistence endpoints (e.g. server-side datatable backends or Cloudflare stateless edge workers) that store and return encrypted records:
@@ -28,7 +30,8 @@ const provider = new CAPIFlatServerDataProvider({
28
30
  cacheStrategy: ECacheStrategy.IndexedDB,
29
31
  encryption: {
30
32
  enabled: true,
31
- key: 'user-secret-encryption-key',
33
+ // In production, retrieve key dynamically from runtimeConfig or authenticated session callback:
34
+ key: () => useRuntimeConfig().public.dataEncryptionKey, // or KMS session callback
32
35
  fields: ['name', 'email', 'salary']
33
36
  }
34
37
  })
@@ -43,3 +46,10 @@ provider.setFilter({
43
46
  active: true
44
47
  })
45
48
  ```
49
+
50
+ #### Chart Visualization Architecture & Full-Dataset Loading
51
+ Server-side data providers (`CAPIFlatServerDataProvider`, `CFlatServerDataProvider`) display `pageData` (the current page) by default. For full unpaginated charting:
52
+ 1. Pass `{ fetchAll: true }` to `useChartData(provider, { fetchAll: true })` — this calls `provider.fetchAll()`, which requests `pageSize: 0` without mutating the provider's active paginated `pageSize`.
53
+ 2. Or call `await provider.fetchAll()` manually — this loads and decrypts the complete dataset into `_allData` and returns it.
54
+ 3. Or enable accumulation via infinite-scroll / `loadMore()` so `_allData` contains all loaded pages.
55
+
@@ -0,0 +1,13 @@
1
+ ### `CAPITreeServerDataProvider`
2
+ API-based Server-side Tree Data Provider extending `CTreeServerDataProvider` and implementing `AAPIDataProvider`.
3
+ - **Purpose**: Connects server-side tree logic with `RequestProvider` for remote HTTP endpoints expecting node expansion queries (`expandedNodes`).
4
+ - **Features**: API URL configuration (`setAPIUrl(url)`), request caching/deduplication, stale response discarding, and field-level/payload encryption (`setEncryption()`, `clearEncryption()`).
5
+
6
+ ```typescript
7
+ const provider = new CAPITreeServerDataProvider({
8
+ cacheStrategy: ECacheStrategy.Memory,
9
+ cacheLifetime: 30000
10
+ })
11
+ provider.setAPIUrl('/api/v1/taxonomy')
12
+ ```
13
+
@@ -1,11 +1,26 @@
1
1
  ### `CFlatClientDataProvider`
2
2
  Manages local arrays with client-side logic, extending `AEncryptedClientProvider`.
3
- - **`setData(data: TRow[]): Promise<void> | void`**: Ingests dataset into provider. When encryption is enabled, eagerly encrypts designated `fields` before storing in `allData`. Plaintext never persists in `allData`. Pre-encrypted envelopes (`__encrypted: true`) pass through unchanged (idempotent). Zero overhead synchronous fast-path when encryption is disabled.
3
+ - **`setData(data: TRow[]): Promise<void> | void`**: Ingests dataset into provider. When `batchSize` is set to a number (default `false`), ingests the dataset in sequential batches: Batch 1 is loaded immediately and rendered to `pageData` so the UI is interactive without delay, while remaining batches are ingested in the background yielding to the event loop (`setTimeout(0)`), updating `isBatchLoading`, `batchProgress`, and firing `onBatchLoaded`. When encryption is enabled, eagerly encrypts designated `fields` before storing in `allData`. Plaintext never persists in `allData`. Pre-encrypted envelopes (`__encrypted: true`) pass through unchanged (idempotent). Zero overhead synchronous fast-path when encryption is disabled and `batchSize` is `false`.
4
4
  - **`setDataChunked(data: TRow[], options?: ISetDataChunkedOptions): Promise<void>`**: Ingests massive datasets in batches, yielding to the event loop between chunks to keep the browser UI responsive (`chunkSize`, `onProgress`, `yieldStrategy`).
5
5
  - **`setEncryption(options)` / `clearEncryption()`**: Dynamically updates, rotates, or wipes cryptographic keys and cached ciphers at runtime.
6
- - **`allData`**: `Ref<TRow[]>` - The complete source dataset (holds ciphertext for encrypted fields in JS memory).
7
- - **`pageData`**: `Ref<TRow[]>` - Active visible page slice (lazily decrypted into plaintext on active page render). Only `pageSize` rows are plaintext in JS memory.
6
+ - **`allData`**: `Ref<TRow[]>` - The complete source dataset (holds ciphertext for encrypted fields in JS memory). **Zero-bulk plaintext in memory**: Plaintext never persists in `allData`. Bulk data remains 100% encrypted in RAM.
7
+ - **`pageData`**: `Ref<TRow[]>` - Active visible page slice (lazily decrypted into plaintext on active page render on-the-fly). Only `pageSize` rows (e.g. 10 or 25) are plaintext in JS memory.
8
+ - **`decryptedCache` & Controlled Information Leakage**:
9
+ - `decryptedCache: false` (Default): Decrypted rows are garbage-collected upon page transition. Client filtering operates on ciphertext tags via `searchIndex` (HMAC blind indexing, trigrams, and shadow bucketing). Candidate false-positive rows from coarse buckets or trigrams are pruned automatically via `verifyDecryptedRows()` on the decrypted page slice.
10
+ - `decryptedCache: true`: In-memory decrypted cache enabling instant client-side filtering on all fields in RAM without blind indexing. Leaves decrypted plaintext in browser memory until page unmount.
11
+ - **Security Warning on Searchable Toggles**: Blind indexing (`blindIndex`) leaks frequency distribution and is strictly forbidden on low-cardinality fields. Shadow bucketing (`rangeBuckets`) leaks coarse ranges. Trigram search (`trigrams`) leaks approximate string length.
8
12
  - **`rowMap`**: `readonly TRow[]` - Reference map array maintaining the active filtered & sorted row references. When a page is requested, a portion of this array is served directly in $O(1)$ without re-evaluating filters or sorts.
13
+ - **`pageSize` & Unpaged Mode (`pageSize <= 0`)**:
14
+ - `pageSize > 0` (Default: `10`): Slices dataset to the current page. Only the visible page slice (e.g. 10 rows) is decrypted into `pageData`, while `_rowMap` retains encrypted ciphertext envelopes for zero-trust at rest.
15
+ - `pageSize <= 0` (Unpaged mode): Disables pagination; the entire filtered dataset becomes the active page. As a result, all records are decrypted into `pageData` and `_rowMap` so downstream consumers (charts, export utilities) have immediate access to plaintext data.
16
+ - **Developer Decision & Guidance**: Developers decide the appropriate `pageSize` based on dataset volume. For large datasets (e.g., 5,000–100,000 records), developers should always use discrete pagination (`pageSize: 20` or `50`) or virtual windowing. Setting `pageSize <= 0` on 100k items attempts to load and decrypt all records into browser DOM/memory simultaneously, leading to tab freezes regardless of whether data is encrypted or plaintext.
9
17
  - **`updateMap()`**: Explicitly forces recalculation of the `rowMap` if items inside `allData` were modified in-place.
10
- - **`setFilter(filter: IDataFilter | null, immediate: boolean = false)`**: Applies a structured filter. When `encryption.searchIndex: true`, performs exact match (`==`, `!=`) and substring search (`in`) on encrypted fields using HMAC-SHA256 blind index tokens and trigram sets via `CSearchIndex`. Resets to page 1.
11
18
  - **`filter`**: `Ref<IDataFilter | null>` - The currently active filter configuration.
19
+ - **Batch Ingestion Options & Properties (Client-side Only)**:
20
+ - `batchSize`: `number | false` (default: `false`) - Size of sequential batches for chunked in-memory loading. When a positive integer, `setData()` ingests batch 1 immediately and streams subsequent batches via `setTimeout(0)`.
21
+ - `batchLoad`: `'initially' | 'onDemand'` (default: `'initially'`) - When `'initially'`, streams all remaining batches sequentially into `allData`. When `'onDemand'`, stops after batch 1 until subsequent batches are explicitly triggered (via `loadBatch`, `ensureRangeLoaded`, or pagination).
22
+ - `onDemandFilterPolicy`: `'ingestAll' | 'warnOnly'` (default: `'ingestAll'`) - Invalidation policy when filtering or sorting with partial on-demand batches.
23
+ - `loadedBatches`: `Set<number>` - Registry of loaded batch numbers.
24
+ - `onBatchLoaded`: `(event: IBatchLoadedEvent) => void` - Callback executed every time a batch chunk is ingested.
25
+ - `isBatchLoading`: `boolean` - Reactive state property indicating whether background batch streaming is actively in progress.
26
+ - `batchProgress`: `IBatchProgress | undefined` - `{ loaded: number, total: number, percent: number }` representing current streaming completion percentage.
@@ -9,7 +9,6 @@ Handler-based server-side flat data provider that delegates pagination, filterin
9
9
  | `filter` | `IDataFilter \| null` | `null` | Initial filter structure |
10
10
  | `sortList` | `IDataSort[]` | `[]` | Initial sorting rules |
11
11
  | `SSR` | `boolean` | `false` | Enable Nuxt SSR hydration via `getAsyncData` |
12
- | `urlPageParam` | `string` | `''` | Optional URL query parameter for page syncing |
13
12
  | `deduplicate` | `boolean` | `true` | Prevent duplicate concurrent fetches |
14
13
 
15
14
  - **Reactive Properties**:
@@ -27,10 +26,13 @@ Handler-based server-side flat data provider that delegates pagination, filterin
27
26
  | --- | --- | --- |
28
27
  | `setContextKey(key)` | `string` | Sets a stable unique key for Nuxt SSR hydration |
29
28
  | `setPageDataHandler(handler)` | `TPageDataHandler` | Sets the async fetching function and triggers initial load |
30
- | `loadPageData(opts?)` | `{ disableCache?: boolean }` | Triggers the registered handler |
29
+ | `loadPageData(opts?)` | `{ disableCache?: boolean; page?: number }` | Triggers the registered handler |
30
+ | `fetchAll(opts?)` | `{ disableCache?: boolean; signal?: AbortSignal }` | Fetches unpaginated dataset (`pageSize: 0`) into `_allData` without altering active `pageSize` |
31
+ | `loadMore()` | `none` | Progressively fetches and accumulates the next page into `allData` with deduplication |
31
32
  | `refresh(hardRefresh?)` | `boolean` | Re-runs the handler; overrides cache if `hardRefresh = true` |
32
33
  | `setFilter(filter)` | `IDataFilter \| null` | Updates active filter criteria and resets to page 1 |
33
34
  | `setSortList(sorts)` | `IDataSort[]` | Updates sort order and resets to page 1 |
35
+ | `batchUpdates(fn)` | `() => R` | Inherited from `ADataProvider`. Groups multiple mutations or state changes so `notify()` fires once. |
34
36
 
35
37
  - **Example Usage**:
36
38
  ```ts
@@ -1,6 +1,6 @@
1
1
  ### `CTreeClientDataProvider`
2
2
  Builds and manages reactive trees from flat arrays, extending `CFlatClientDataProvider`.
3
- - **`setData(data: TRow[]): Promise<void> | void`**: Ingests hierarchical items. Encrypts sensitive fields eagerly while preserving structural keys (`idKey`, `parentKey`) in plaintext.
3
+ - **`setData(data: TRow[]): Promise<void> | void`**: Ingests hierarchical items. When `batchSize` is set to a number, ingests nodes in sequential batches, displaying the initial batch immediately and rebuilding hierarchical structures progressively in the background while yielding to the event loop. Encrypts sensitive fields eagerly while preserving structural keys (`idKey`, `parentKey`) in plaintext.
4
4
  - **`setDataChunked(data: TRow[], options?: ISetDataChunkedOptions)`**: Non-blocking chunked ingestion for large trees.
5
5
  - **Constructor Options (`ITreeDataProviderOptions`)**:
6
6
  | Option | Type | Default | Description |
@@ -10,5 +10,5 @@ Builds and manages reactive trees from flat arrays, extending `CFlatClientDataPr
10
10
  | `expandedByDefault`| `boolean` | `false` | Initial node state |
11
11
  | `paginateBy` | `string` | `'all'` | `'all'` (flat) or `'root'` (hierarchical) |
12
12
  | `encryption` | `IProviderEncryptionOptions` | `undefined` | AES-GCM or custom cipher encryption configuration |
13
- - **`setFilter(filter: IDataFilter | null)`**: Applies a structured filter across tree nodes client-side. When `searchIndex: true`, matches on encrypted fields using blind index search and automatically expands parent ancestors of matching child nodes. Resets to page 1.
13
+ - **`setFilter(filter: IDataFilter | null)`**: Applies a structured filter across tree nodes client-side. When `decryptedCache: true` or `searchIndex: true`, matches on encrypted fields and automatically expands parent ancestors of matching child nodes. When filtering without either support, logs an informative warning and never matches raw `[object Object]` envelopes. Resets to page 1.
14
14
  - **`filter`**: `Ref<IDataFilter | null>` - The currently active filter configuration.
@@ -29,12 +29,22 @@ The core engine for all HTTP communication, supporting deduplication, tag-based
29
29
  | `cacheKey` | `string` | Namespace/context key for shared cache storage |
30
30
  | `deduplicate` | `boolean` | Override global deduplication setting |
31
31
  | `disableCache` | `boolean` | Explicitly override cache for this request |
32
+ | `signal` | `AbortSignal` | Caller abort signal; bridged across deduplicated callers so aborting one does not cancel others |
33
+ | `context` | `any` | Framework or SSR request context (e.g., `{ event }` or Nitro H3Event) |
34
+ | `event` | `any` | Direct H3Event/SSR event forwarding for server cookie and tenant resolution |
32
35
  | `tags` | `string[]` | Associated tags for invalidation / auto-refresh upon mutation |
33
36
  | `queue` | `boolean` | When true (for non-GET requests), enqueues the mutation into `RequestQueue` instead of dispatching immediately |
34
37
  | `label` | `string` | Human-readable description for queued mutation display in UI |
38
+ | `encryption` | `IProviderEncryptionOptions` | Per-request encryption overrides (e.g. `encryptBinary: true` for offline queue) |
35
39
  | `nuxtApp` | `unknown` | Nuxt app instance — enables SSR cookie forwarding via h3 |
36
40
  | `_generation` | `number` | Internal request generation counter to discard stale responses |
37
41
 
42
+ - **Static Context Resolution & Multi-Subscriber Abort Bridge**:
43
+ - `RequestProvider.setContextResolver(fn)`: Pluggable resolver returning `{ event, headers }` for SSR environments (e.g. Nuxt `useRequestEvent()` and `useRequestHeaders(['cookie'])`).
44
+ - **Multi-Subscriber Abort Bridge**: Concurrent GET requests joining an in-flight deduplication promise register independent subscriber listeners. The underlying network request is only aborted when **all** active subscribers have aborted their signals.
45
+ - **Offline Queue Binary Encryption**: When `encryption.enabled = true` and `encryption.encryptBinary = true`, binary payloads (`FormData`, `Blob`, `File`, `ArrayBuffer`) are encrypted into ciphertext envelopes before persistence into IndexedDB, and transparently decrypted on flush.
46
+ - **SSR Cache & Tenant Isolation**: On SSR (`isServer`), when request context is uncontextualized (`!event`) and per-tenant encryption key ID is missing, shared server cache reads and writes are automatically bypassed to prevent cross-tenant data leaks. When inside a Nuxt SSR context, cookies are automatically forwarded on same-origin requests via `event` or `useRequestHeaders(['cookie'])`. A developer warning is logged only if relative same-origin requests lack both event context and Nuxt request headers to forward cookies.
47
+
38
48
  ### `RequestProviderRegistry`
39
49
  Framework-agnostic static registry mapping active `RequestProvider` instances to tag arrays. When mutations complete (or offline queues flush), `RequestProviderRegistry` automatically triggers `refresh(true)` on all matching registered GET providers.
40
50