@katlux/toolkit 0.1.1-alpha.136 → 0.1.1-alpha.137

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 (39) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
  3. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
  4. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  5. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +1 -1
  6. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
  7. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +1 -1
  8. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
  9. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +1 -1
  10. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +1 -1
  11. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +1 -1
  12. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +1 -1
  13. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +1 -1
  14. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +1 -1
  15. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +1 -1
  16. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +1 -1
  17. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +1 -1
  18. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
  19. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  20. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  21. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
  22. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
  23. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +1 -1
  24. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +1 -1
  25. package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
  26. package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
  27. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +1 -1
  28. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +1 -1
  29. package/dist/runtime/components/KTree/KTree.logic.js +3 -1
  30. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +2 -2
  31. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +2 -2
  32. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +1 -1
  33. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +1 -1
  34. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +93 -2
  35. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +91 -2
  36. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +1 -1
  37. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +1 -1
  38. package/dist/skills/katlux-config/SKILL.md +7 -7
  39. package/package.json +2 -2
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.1-alpha.136",
4
+ "version": "0.1.1-alpha.137",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -55,7 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
58
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
59
59
  iconOnly: boolean;
60
60
  disabled: boolean;
61
61
  href: string;
@@ -55,7 +55,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
58
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
59
59
  iconOnly: boolean;
60
60
  disabled: boolean;
61
61
  href: string;
@@ -23,7 +23,7 @@ export interface KButtonEmits {
23
23
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
24
24
  isLink: import("vue").ComputedRef<boolean>;
25
25
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
26
- buttonClasses: import("vue").ComputedRef<("small" | "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | "large" | "medium" | {
26
+ buttonClasses: import("vue").ComputedRef<("small" | "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | "large" | "medium" | {
27
27
  disabled: boolean | undefined;
28
28
  'icon-only': boolean | undefined;
29
29
  })[]>;
@@ -77,11 +77,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
+ value: any;
80
81
  validation: "error" | "success" | "warning" | null | undefined;
81
82
  validationText: string;
82
83
  idKey: string;
83
84
  indeterminate: boolean;
84
- value: any;
85
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
86
86
  declare const _default: typeof __VLS_export;
87
87
  export default _default;
@@ -77,11 +77,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
+ value: any;
80
81
  validation: "error" | "success" | "warning" | null | undefined;
81
82
  validationText: string;
82
83
  idKey: string;
83
84
  indeterminate: boolean;
84
- value: any;
85
85
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
86
86
  declare const _default: typeof __VLS_export;
87
87
  export default _default;
@@ -226,7 +226,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
226
226
  label: string;
227
227
  disabled: boolean;
228
228
  validation: "error" | "success" | "warning" | null | undefined;
229
- validationText: string;
230
229
  searchbox: boolean;
231
230
  searchtext: string;
232
231
  searchPlaceholder: string;
@@ -237,6 +236,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
237
236
  placeholder: string;
238
237
  teleportTo: string;
239
238
  fullWidth: boolean;
239
+ validationText: string;
240
240
  maxHeight: number;
241
241
  closeOnSelect: boolean;
242
242
  multiSelect: boolean;
@@ -226,7 +226,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
226
226
  label: string;
227
227
  disabled: boolean;
228
228
  validation: "error" | "success" | "warning" | null | undefined;
229
- validationText: string;
230
229
  searchbox: boolean;
231
230
  searchtext: string;
232
231
  searchPlaceholder: string;
@@ -237,6 +236,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
237
236
  placeholder: string;
238
237
  teleportTo: string;
239
238
  fullWidth: boolean;
239
+ validationText: string;
240
240
  maxHeight: number;
241
241
  closeOnSelect: boolean;
242
242
  multiSelect: boolean;
@@ -192,11 +192,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
192
192
  type: import("./KCompositeInput.logic.js").CompositeInputType;
193
193
  label: string;
194
194
  validation: "error" | "success" | "warning" | null | undefined;
195
- validationText: string;
196
195
  searchbox: boolean;
197
196
  labelField: string;
198
197
  placeholder: string;
199
198
  teleportTo: string;
199
+ validationText: string;
200
200
  mask: string;
201
201
  valueField: string;
202
202
  inputType: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
@@ -192,11 +192,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
192
192
  type: import("./KCompositeInput.logic.js").CompositeInputType;
193
193
  label: string;
194
194
  validation: "error" | "success" | "warning" | null | undefined;
195
- validationText: string;
196
195
  searchbox: boolean;
197
196
  labelField: string;
198
197
  placeholder: string;
199
198
  teleportTo: string;
199
+ validationText: string;
200
200
  mask: string;
201
201
  valueField: string;
202
202
  inputType: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
@@ -131,9 +131,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
131
131
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
132
132
  day: string | Date;
133
133
  validation: "error" | "success" | "warning" | null | undefined;
134
- validationText: string;
135
134
  placeholder: string;
136
135
  teleportTo: string;
136
+ validationText: string;
137
137
  showClear: boolean;
138
138
  align: "left" | "right" | undefined;
139
139
  format: string;
@@ -131,9 +131,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
131
131
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
132
132
  day: string | Date;
133
133
  validation: "error" | "success" | "warning" | null | undefined;
134
- validationText: string;
135
134
  placeholder: string;
136
135
  teleportTo: string;
136
+ validationText: string;
137
137
  showClear: boolean;
138
138
  align: "left" | "right" | undefined;
139
139
  format: string;
@@ -133,9 +133,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
133
133
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
134
134
  day: string | Date;
135
135
  validation: "error" | "success" | "warning" | null | undefined;
136
- validationText: string;
137
136
  placeholder: string;
138
137
  teleportTo: string;
138
+ validationText: string;
139
139
  showClear: boolean;
140
140
  format: string;
141
141
  timeFormat: string;
@@ -133,9 +133,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
133
133
  markedDays: import("../KCalendar/types.js").IMarkedDay[];
134
134
  day: string | Date;
135
135
  validation: "error" | "success" | "warning" | null | undefined;
136
- validationText: string;
137
136
  placeholder: string;
138
137
  teleportTo: string;
138
+ validationText: string;
139
139
  showClear: boolean;
140
140
  format: string;
141
141
  timeFormat: string;
@@ -111,8 +111,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
111
111
  label: string;
112
112
  disabled: boolean;
113
113
  validation: "error" | "success" | "warning" | null | undefined;
114
- validationText: string;
115
114
  placeholder: string;
115
+ validationText: string;
116
116
  showClear: boolean;
117
117
  format: string;
118
118
  step: number;
@@ -111,8 +111,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
111
111
  label: string;
112
112
  disabled: boolean;
113
113
  validation: "error" | "success" | "warning" | null | undefined;
114
- validationText: string;
115
114
  placeholder: string;
115
+ validationText: string;
116
116
  showClear: boolean;
117
117
  format: string;
118
118
  step: number;
@@ -67,8 +67,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
67
67
  modelValue: string;
68
68
  label: string;
69
69
  validation: "error" | "success" | "warning" | null | undefined;
70
- validationText: string;
71
70
  placeholder: string;
71
+ validationText: string;
72
72
  showClear: boolean;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
@@ -67,8 +67,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
67
67
  modelValue: string;
68
68
  label: string;
69
69
  validation: "error" | "success" | "warning" | null | undefined;
70
- validationText: string;
71
70
  placeholder: string;
71
+ validationText: string;
72
72
  showClear: boolean;
73
73
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
74
  declare const _default: typeof __VLS_export;
@@ -58,8 +58,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
58
58
  }>, {
59
59
  label: string;
60
60
  validation: "error" | "success" | "warning" | null | undefined;
61
- validationText: string;
62
61
  placeholder: string;
62
+ validationText: string;
63
63
  rows: number;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
@@ -58,8 +58,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
58
58
  }>, {
59
59
  label: string;
60
60
  validation: "error" | "success" | "warning" | null | undefined;
61
- validationText: string;
62
61
  placeholder: string;
62
+ validationText: string;
63
63
  rows: number;
64
64
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
65
65
  declare const _default: typeof __VLS_export;
@@ -70,8 +70,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
70
70
  type: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
71
71
  label: string;
72
72
  validation: "error" | "success" | "warning" | null | undefined;
73
- validationText: string;
74
73
  placeholder: string;
74
+ validationText: string;
75
75
  showClear: boolean;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
@@ -70,8 +70,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
70
70
  type: "number" | "search" | "url" | "text" | "password" | "email" | "tel" | undefined;
71
71
  label: string;
72
72
  validation: "error" | "success" | "warning" | null | undefined;
73
- validationText: string;
74
73
  placeholder: string;
74
+ validationText: string;
75
75
  showClear: boolean;
76
76
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
77
  declare const _default: typeof __VLS_export;
@@ -73,8 +73,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  title: string;
74
74
  text: string;
75
75
  timeout: number;
76
- teleport: boolean;
77
76
  pauseOnHover: boolean;
77
+ teleport: boolean;
78
78
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
79
  declare const _default: typeof __VLS_export;
80
80
  export default _default;
@@ -73,8 +73,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  title: string;
74
74
  text: string;
75
75
  timeout: number;
76
- teleport: boolean;
77
76
  pauseOnHover: boolean;
77
+ teleport: boolean;
78
78
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
79
  declare const _default: typeof __VLS_export;
80
80
  export default _default;
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  }>> & Readonly<{}>, {
28
28
  disabled: boolean;
29
29
  text: string;
30
- position: "top" | "left" | "right" | "bottom";
30
+ position: "left" | "right" | "top" | "bottom";
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
27
27
  }>> & Readonly<{}>, {
28
28
  disabled: boolean;
29
29
  text: string;
30
- position: "top" | "left" | "right" | "bottom";
30
+ position: "left" | "right" | "top" | "bottom";
31
31
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -162,13 +162,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
162
162
  modelValue: any;
163
163
  disabled: boolean;
164
164
  loading: boolean;
165
- idKey: string;
166
165
  searchtext: string;
167
166
  virtualScroll: boolean;
168
167
  itemHeight: number;
169
168
  buffer: number;
170
169
  labelField: string;
171
170
  multiSelect: boolean;
171
+ idKey: string;
172
172
  viewportHeight: number;
173
173
  expandedNodes: (string | number)[] | Set<string | number>;
174
174
  iconField: string;
@@ -162,13 +162,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
162
162
  modelValue: any;
163
163
  disabled: boolean;
164
164
  loading: boolean;
165
- idKey: string;
166
165
  searchtext: string;
167
166
  virtualScroll: boolean;
168
167
  itemHeight: number;
169
168
  buffer: number;
170
169
  labelField: string;
171
170
  multiSelect: boolean;
171
+ idKey: string;
172
172
  viewportHeight: number;
173
173
  expandedNodes: (string | number)[] | Set<string | number>;
174
174
  iconField: string;
@@ -106,7 +106,9 @@ export function useKTreeLogic(props, emit) {
106
106
  if (typeof props.dataProvider.updatePageData === "function") {
107
107
  props.dataProvider.updatePageData();
108
108
  }
109
- if (typeof props.dataProvider.notify === "function") {
109
+ if (props.dataProvider.isEncryptionEnabled && typeof props.dataProvider.loadPageData === "function") {
110
+ props.dataProvider.loadPageData();
111
+ } else if (typeof props.dataProvider.notify === "function") {
110
112
  props.dataProvider.notify();
111
113
  }
112
114
  }
@@ -236,8 +236,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
236
236
  disabled: boolean;
237
237
  loading: boolean;
238
238
  validation: "error" | "success" | "warning" | null | undefined;
239
- validationText: string;
240
- idKey: string;
241
239
  searchbox: boolean;
242
240
  searchtext: string;
243
241
  searchPlaceholder: string;
@@ -247,9 +245,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
247
245
  isOptionsOpen: boolean;
248
246
  placeholder: string;
249
247
  fullWidth: boolean;
248
+ validationText: string;
250
249
  closeOnSelect: boolean;
251
250
  multiSelect: boolean;
252
251
  valueField: string;
252
+ idKey: string;
253
253
  viewportHeight: number;
254
254
  expandedNodes: any;
255
255
  parentKey: string;
@@ -236,8 +236,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
236
236
  disabled: boolean;
237
237
  loading: boolean;
238
238
  validation: "error" | "success" | "warning" | null | undefined;
239
- validationText: string;
240
- idKey: string;
241
239
  searchbox: boolean;
242
240
  searchtext: string;
243
241
  searchPlaceholder: string;
@@ -247,9 +245,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
247
245
  isOptionsOpen: boolean;
248
246
  placeholder: string;
249
247
  fullWidth: boolean;
248
+ validationText: string;
250
249
  closeOnSelect: boolean;
251
250
  multiSelect: boolean;
252
251
  valueField: string;
252
+ idKey: string;
253
253
  viewportHeight: number;
254
254
  expandedNodes: any;
255
255
  parentKey: string;
@@ -142,10 +142,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
142
142
  selectedRows: any[];
143
143
  bulkActions: import("@katlux/providers").IKDatatableAction[];
144
144
  selectAll: boolean;
145
- idKey: string;
146
145
  virtualScroll: boolean;
147
146
  itemHeight: number;
148
147
  buffer: number;
148
+ idKey: string;
149
149
  rowActions: import("@katlux/providers").IKDatatableAction[];
150
150
  viewportHeight: number;
151
151
  cellSlots: Record<string, any>;
@@ -142,10 +142,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
142
142
  selectedRows: any[];
143
143
  bulkActions: import("@katlux/providers").IKDatatableAction[];
144
144
  selectAll: boolean;
145
- idKey: string;
146
145
  virtualScroll: boolean;
147
146
  itemHeight: number;
148
147
  buffer: number;
148
+ idKey: string;
149
149
  rowActions: import("@katlux/providers").IKDatatableAction[];
150
150
  viewportHeight: number;
151
151
  cellSlots: Record<string, any>;
@@ -46,7 +46,7 @@
46
46
  </template>
47
47
 
48
48
  <script setup lang="ts">
49
- import { computed } from 'vue'
49
+ import { computed, watch, shallowRef } from 'vue'
50
50
  import { ADataProvider } from '@katlux/providers'
51
51
  import type { IKDatatableAction } from '@katlux/providers'
52
52
  import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
@@ -95,6 +95,8 @@ const selectAll = computed({
95
95
  set: (val) => emit('update:selectAll', val)
96
96
  })
97
97
 
98
+ const rowIdKey = computed(() => (props.dataProvider as any)?.idKey || 'id')
99
+
98
100
  const { pageData, virtualRows, loading: dpLoading, initialLoad: dpInitialLoad } = useDataProvider(props.dataProvider)
99
101
  const pageRows = computed(() => pageData.value || [])
100
102
 
@@ -144,9 +146,98 @@ const {
144
146
  }
145
147
  })
146
148
 
149
+ const deliveredRowsCache = shallowRef<Map<any, any>>(new Map())
150
+ const requestedPages = new Set<number>()
151
+
152
+ // Track delivered page rows in persistent cache so previously loaded pages stay decrypted
153
+ watch(pageRows, (rows) => {
154
+ if (Array.isArray(rows) && rows.length > 0) {
155
+ const idKey = rowIdKey.value
156
+ const nextCache = new Map(deliveredRowsCache.value)
157
+ for (const r of rows) {
158
+ const id = (r as any)?.[idKey] ?? (r as any)?.id
159
+ if (id !== undefined && id !== null) {
160
+ nextCache.set(id, r)
161
+ }
162
+ }
163
+ deliveredRowsCache.value = nextCache
164
+ }
165
+ }, { immediate: true, deep: true })
166
+
167
+ // Reset cache on filter or sort updates
168
+ watch([() => (props.dataProvider as any)?.filter, () => (props.dataProvider as any)?.sortList], () => {
169
+ deliveredRowsCache.value = new Map()
170
+ requestedPages.clear()
171
+ const curPage = (props.dataProvider as any)?.currentPage || 1
172
+ requestedPages.add(curPage)
173
+ }, { deep: true })
174
+
175
+ let isFetchingPage = false
176
+ const pageQueue: number[] = []
177
+
178
+ const processPageQueue = async () => {
179
+ if (isFetchingPage || pageQueue.length === 0) return
180
+ const nextPage = pageQueue.shift()!
181
+ const dp = props.dataProvider as any
182
+ if (dp && typeof dp.setCurrentPage === 'function') {
183
+ isFetchingPage = true
184
+ try {
185
+ dp.setCurrentPage(nextPage)
186
+ if (typeof dp.loadPageData === 'function') {
187
+ const res = dp.loadPageData()
188
+ if (res instanceof Promise) await res
189
+ }
190
+ } finally {
191
+ isFetchingPage = false
192
+ if (pageQueue.length > 0) {
193
+ processPageQueue()
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ const queuePage = (page: number) => {
200
+ if (!requestedPages.has(page)) {
201
+ requestedPages.add(page)
202
+ pageQueue.push(page)
203
+ processPageQueue()
204
+ }
205
+ }
206
+
207
+ const ensureVisiblePagesLoaded = () => {
208
+ if (!props.virtualScroll) return
209
+ const ps = (props.dataProvider as any)?.pageSize ?? 10
210
+ if (!ps || ps <= 0) return
211
+
212
+ const start = startIndex.value
213
+ const end = endIndex.value
214
+ const startPage = Math.floor(start / ps) + 1
215
+ const endPage = Math.floor(Math.max(0, end - 1) / ps) + 1
216
+
217
+ for (let p = startPage; p <= endPage; p++) {
218
+ queuePage(p)
219
+ }
220
+ }
221
+
222
+ watch([startIndex, endIndex], () => {
223
+ ensureVisiblePagesLoaded()
224
+ }, { immediate: true })
225
+
147
226
  const displayRows = computed(() => {
148
227
  if (props.virtualScroll) {
149
- return visibleItems.value
228
+ const items = visibleItems.value
229
+ const cache = deliveredRowsCache.value
230
+ if (cache.size > 0) {
231
+ const idKey = rowIdKey.value
232
+ return items.map(item => {
233
+ const id = (item as any)?.[idKey] ?? (item as any)?.id
234
+ if (id !== undefined && id !== null && cache.has(id)) {
235
+ return cache.get(id)
236
+ }
237
+ return item
238
+ })
239
+ }
240
+ return items
150
241
  }
151
242
  return pageRows.value
152
243
  })
@@ -89,7 +89,7 @@
89
89
  </template>
90
90
 
91
91
  <script setup lang="ts">
92
- import { ref, computed, isRef } from 'vue'
92
+ import { ref, computed, isRef, watch, shallowRef } from 'vue'
93
93
  import { ADataProvider } from '@katlux/providers'
94
94
  import type { IKDatatableAction } from '@katlux/providers'
95
95
  import { useKatluxI18n } from '#toolkit/composables/useKatluxI18n'
@@ -391,9 +391,98 @@ const {
391
391
  }
392
392
  })
393
393
 
394
+ const deliveredRowsCache = shallowRef<Map<any, any>>(new Map())
395
+ const requestedPages = new Set<number>()
396
+
397
+ // Track delivered page rows in persistent cache so previously loaded pages stay decrypted
398
+ watch(pageRows, (rows) => {
399
+ if (Array.isArray(rows) && rows.length > 0) {
400
+ const idKey = rowIdKey.value
401
+ const nextCache = new Map(deliveredRowsCache.value)
402
+ for (const r of rows) {
403
+ const id = (r as any)?.[idKey] ?? (r as any)?.id
404
+ if (id !== undefined && id !== null) {
405
+ nextCache.set(id, r)
406
+ }
407
+ }
408
+ deliveredRowsCache.value = nextCache
409
+ }
410
+ }, { immediate: true, deep: true })
411
+
412
+ // Reset cache on filter or sort updates
413
+ watch([dpFilter, () => (props.dataProvider as any)?.sortList], () => {
414
+ deliveredRowsCache.value = new Map()
415
+ requestedPages.clear()
416
+ const curPage = (props.dataProvider as any)?.currentPage || 1
417
+ requestedPages.add(curPage)
418
+ }, { deep: true })
419
+
420
+ let isFetchingPage = false
421
+ const pageQueue: number[] = []
422
+
423
+ const processPageQueue = async () => {
424
+ if (isFetchingPage || pageQueue.length === 0) return
425
+ const nextPage = pageQueue.shift()!
426
+ const dp = props.dataProvider as any
427
+ if (dp && typeof dp.setCurrentPage === 'function') {
428
+ isFetchingPage = true
429
+ try {
430
+ dp.setCurrentPage(nextPage)
431
+ if (typeof dp.loadPageData === 'function') {
432
+ const res = dp.loadPageData()
433
+ if (res instanceof Promise) await res
434
+ }
435
+ } finally {
436
+ isFetchingPage = false
437
+ if (pageQueue.length > 0) {
438
+ processPageQueue()
439
+ }
440
+ }
441
+ }
442
+ }
443
+
444
+ const queuePage = (page: number) => {
445
+ if (!requestedPages.has(page)) {
446
+ requestedPages.add(page)
447
+ pageQueue.push(page)
448
+ processPageQueue()
449
+ }
450
+ }
451
+
452
+ const ensureVisiblePagesLoaded = () => {
453
+ if (!props.virtualScroll) return
454
+ const ps = effectivePageSize.value
455
+ if (!ps || ps <= 0) return
456
+
457
+ const start = startIndex.value
458
+ const end = endIndex.value
459
+ const startPage = Math.floor(start / ps) + 1
460
+ const endPage = Math.floor(Math.max(0, end - 1) / ps) + 1
461
+
462
+ for (let p = startPage; p <= endPage; p++) {
463
+ queuePage(p)
464
+ }
465
+ }
466
+
467
+ watch([startIndex, endIndex], () => {
468
+ ensureVisiblePagesLoaded()
469
+ }, { immediate: true })
470
+
394
471
  const displayRows = computed(() => {
395
472
  if (props.virtualScroll) {
396
- return visibleItems.value
473
+ const items = visibleItems.value
474
+ const cache = deliveredRowsCache.value
475
+ if (cache.size > 0) {
476
+ const idKey = rowIdKey.value
477
+ return items.map(item => {
478
+ const id = (item as any)?.[idKey] ?? (item as any)?.id
479
+ if (id !== undefined && id !== null && cache.has(id)) {
480
+ return cache.get(id)
481
+ }
482
+ return item
483
+ })
484
+ }
485
+ return items
397
486
  }
398
487
  return pageRows.value
399
488
  })
@@ -28,13 +28,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
28
28
  }>, {
29
29
  disabled: boolean;
30
30
  loading: boolean;
31
- idKey: string;
32
31
  searchtext: string;
33
32
  virtualScroll: boolean;
34
33
  itemHeight: number;
35
34
  buffer: number;
36
35
  labelField: string;
37
36
  multiSelect: boolean;
37
+ idKey: string;
38
38
  viewportHeight: number;
39
39
  iconField: string;
40
40
  selectable: boolean;
@@ -28,13 +28,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
28
28
  }>, {
29
29
  disabled: boolean;
30
30
  loading: boolean;
31
- idKey: string;
32
31
  searchtext: string;
33
32
  virtualScroll: boolean;
34
33
  itemHeight: number;
35
34
  buffer: number;
36
35
  labelField: string;
37
36
  multiSelect: boolean;
37
+ idKey: string;
38
38
  viewportHeight: number;
39
39
  iconField: string;
40
40
  selectable: boolean;
@@ -104,13 +104,13 @@ export default defineAppConfig({
104
104
 
105
105
  | Package Name | Current Version | Description | Installation Command |
106
106
  | --- | --- | --- | --- |
107
- | `@katlux/toolkit` | `0.1.1-alpha.135` | Core Nuxt module, UI toolkit, presets, and components | `npm install @katlux/toolkit@alpha` |
108
- | `@katlux/providers` | `0.1.1-alpha.122` | Core data providers, client caching, and state structures | `npm install @katlux/providers@alpha` |
109
- | `@katlux/preset-modern` | `0.1.1-alpha.110` | Modern design preset and styling variables | `npm install @katlux/preset-modern@alpha` |
110
- | `@katlux/preset-dark` | `0.1.1-alpha.41` | Sleek Dark Mode design preset | `npm install @katlux/preset-dark@alpha` |
111
- | `@katlux/block-charts` | `0.1.1-alpha.110` | Pre-built charting block components | `npm install @katlux/block-charts@alpha` |
112
- | `@katlux/block-ecommerce` | `0.1.1-alpha.110` | Pre-built eCommerce block components | `npm install @katlux/block-ecommerce@alpha` |
113
- | `@katlux/mcp` | `0.1.0-alpha.14` | Model Context Protocol server for AI assistant integration | `npm install @katlux/mcp@alpha` |
107
+ | `@katlux/toolkit` | `0.1.1-alpha.136` | Core Nuxt module, UI toolkit, presets, and components | `npm install @katlux/toolkit@alpha` |
108
+ | `@katlux/providers` | `0.1.1-alpha.123` | Core data providers, client caching, and state structures | `npm install @katlux/providers@alpha` |
109
+ | `@katlux/preset-modern` | `0.1.1-alpha.111` | Modern design preset and styling variables | `npm install @katlux/preset-modern@alpha` |
110
+ | `@katlux/preset-dark` | `0.1.1-alpha.42` | Sleek Dark Mode design preset | `npm install @katlux/preset-dark@alpha` |
111
+ | `@katlux/block-charts` | `0.1.1-alpha.111` | Pre-built charting block components | `npm install @katlux/block-charts@alpha` |
112
+ | `@katlux/block-ecommerce` | `0.1.1-alpha.111` | Pre-built eCommerce block components | `npm install @katlux/block-ecommerce@alpha` |
113
+ | `@katlux/mcp` | `0.1.0-alpha.15` | Model Context Protocol server for AI assistant integration | `npm install @katlux/mcp@alpha` |
114
114
 
115
115
  > [!NOTE]
116
116
  > Katlux packages are currently published under the `@alpha` tag on NPM. Always append `@alpha` or the specific version tag when adding dependencies.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.1-alpha.136",
3
+ "version": "0.1.1-alpha.137",
4
4
  "description": "Core UI toolkit and utilities for the Katlux ecosystem",
5
5
  "author": "Katlux",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "**/*.sass"
55
55
  ],
56
56
  "dependencies": {
57
- "@katlux/providers": "^0.1.1-alpha.123",
57
+ "@katlux/providers": "^0.1.1-alpha.124",
58
58
  "@nuxt/kit": "^3.12.0",
59
59
  "@nuxtjs/i18n": "^10.4.0",
60
60
  "pug": "^3.0.0",