@katlux/toolkit 0.1.1-alpha.127 → 0.1.1-alpha.129

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.
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.127",
4
+ "version": "0.1.1-alpha.129",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
58
  type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
- iconOnly: boolean;
60
59
  disabled: boolean;
61
60
  href: string;
62
61
  loading: boolean;
62
+ iconOnly: boolean;
63
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
64
64
  declare const _default: typeof __VLS_export;
65
65
  export default _default;
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
56
56
  }>, {
57
57
  size: "small" | "large" | "medium" | undefined;
58
58
  type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
- iconOnly: boolean;
60
59
  disabled: boolean;
61
60
  href: string;
62
61
  loading: boolean;
62
+ iconOnly: boolean;
63
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
64
64
  declare const _default: typeof __VLS_export;
65
65
  export default _default;
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
75
75
  onBlur?: ((event: FocusEvent) => any) | undefined;
76
76
  "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
77
77
  }>, {
78
- label: string;
79
78
  disabled: boolean;
79
+ label: string;
80
80
  validation: "error" | "success" | "warning" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
75
75
  onBlur?: ((event: FocusEvent) => any) | undefined;
76
76
  "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
77
77
  }>, {
78
- label: string;
79
78
  disabled: boolean;
79
+ label: string;
80
80
  validation: "error" | "success" | "warning" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
223
223
  }) => any) | undefined;
224
224
  }>, {
225
225
  modelValue: any;
226
- label: string;
227
226
  disabled: boolean;
227
+ label: string;
228
228
  validation: "error" | "success" | "warning" | null | undefined;
229
229
  validationText: string;
230
230
  searchbox: boolean;
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
223
223
  }) => any) | undefined;
224
224
  }>, {
225
225
  modelValue: any;
226
- label: string;
227
226
  disabled: boolean;
227
+ label: string;
228
228
  validation: "error" | "success" | "warning" | null | undefined;
229
229
  validationText: string;
230
230
  searchbox: boolean;
@@ -40,10 +40,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
40
40
  "onSearch-change"?: ((value: string) => any) | undefined;
41
41
  }>, {
42
42
  search: string;
43
+ loading: boolean;
43
44
  selectedRows: any[];
44
45
  bulkActions: IKDatatableAction[];
45
46
  selectAll: boolean;
46
- loading: boolean;
47
47
  currentPage: number;
48
48
  pageSize: number;
49
49
  virtualScroll: boolean;
@@ -40,10 +40,10 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {},
40
40
  "onSearch-change"?: ((value: string) => any) | undefined;
41
41
  }>, {
42
42
  search: string;
43
+ loading: boolean;
43
44
  selectedRows: any[];
44
45
  bulkActions: IKDatatableAction[];
45
46
  selectAll: boolean;
46
- loading: boolean;
47
47
  currentPage: number;
48
48
  pageSize: number;
49
49
  virtualScroll: boolean;
@@ -123,6 +123,17 @@ export function useKDatatableLogic(props, emit) {
123
123
  }, { deep: true });
124
124
  let lastSyncedSelectAll = Boolean(selectAll.value);
125
125
  const getTargetRows = () => {
126
+ if (props.virtualScroll) {
127
+ const dp = props.dataProvider;
128
+ if (Array.isArray(dp?.rowMap)) return dp.rowMap;
129
+ if (Array.isArray(dp?.rowMap?.value)) return dp.rowMap.value;
130
+ if (Array.isArray(virtualRows?.value) && virtualRows.value.length > 0) return virtualRows.value;
131
+ if (Array.isArray(dp?.allVisibleRows)) return dp.allVisibleRows;
132
+ if (Array.isArray(dp?.allVisibleRows?.value)) return dp.allVisibleRows.value;
133
+ if (Array.isArray(dp?.allData?.value)) return dp.allData.value;
134
+ if (Array.isArray(dp?.allData)) return dp.allData;
135
+ if (Array.isArray(dp?.data)) return dp.data;
136
+ }
126
137
  return pageRows.value;
127
138
  };
128
139
  watch(() => selectAll.value, (newVal) => {
@@ -108,8 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
108
108
  }>, {
109
109
  modelValue: string;
110
110
  isOpen: boolean;
111
- label: string;
112
111
  disabled: boolean;
112
+ label: string;
113
113
  validation: "error" | "success" | "warning" | null | undefined;
114
114
  validationText: string;
115
115
  placeholder: string;
@@ -108,8 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
108
108
  }>, {
109
109
  modelValue: string;
110
110
  isOpen: boolean;
111
- label: string;
112
111
  disabled: boolean;
112
+ label: string;
113
113
  validation: "error" | "success" | "warning" | null | undefined;
114
114
  validationText: string;
115
115
  placeholder: string;
@@ -74,8 +74,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
74
74
  "onUpdate:maxValue"?: ((value: number | undefined) => any) | undefined;
75
75
  }>, {
76
76
  modelValue: number[] | [number, number];
77
- label: string;
78
77
  disabled: boolean;
78
+ label: string;
79
79
  step: number;
80
80
  min: number;
81
81
  max: number;
@@ -74,8 +74,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
74
74
  "onUpdate:maxValue"?: ((value: number | undefined) => any) | undefined;
75
75
  }>, {
76
76
  modelValue: number[] | [number, number];
77
- label: string;
78
77
  disabled: boolean;
78
+ label: string;
79
79
  step: number;
80
80
  min: number;
81
81
  max: number;
@@ -64,8 +64,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
64
64
  "onUpdate:value"?: ((value: number | undefined) => any) | undefined;
65
65
  }>, {
66
66
  modelValue: number;
67
- label: string;
68
67
  disabled: boolean;
68
+ label: string;
69
69
  value: number;
70
70
  step: number;
71
71
  min: number;
@@ -64,8 +64,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
64
64
  "onUpdate:value"?: ((value: number | undefined) => any) | undefined;
65
65
  }>, {
66
66
  modelValue: number;
67
- label: string;
68
67
  disabled: boolean;
68
+ label: string;
69
69
  value: number;
70
70
  step: number;
71
71
  min: number;
@@ -232,9 +232,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
232
232
  "onNode-toggle"?: ((nodeId: string | number) => any) | undefined;
233
233
  }>, {
234
234
  modelValue: any;
235
- label: string;
236
235
  disabled: boolean;
237
236
  loading: boolean;
237
+ label: string;
238
238
  validation: "error" | "success" | "warning" | null | undefined;
239
239
  validationText: string;
240
240
  idKey: string;
@@ -232,9 +232,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
232
232
  "onNode-toggle"?: ((nodeId: string | number) => any) | undefined;
233
233
  }>, {
234
234
  modelValue: any;
235
- label: string;
236
235
  disabled: boolean;
237
236
  loading: boolean;
237
+ label: string;
238
238
  validation: "error" | "success" | "warning" | null | undefined;
239
239
  validationText: string;
240
240
  idKey: string;
@@ -345,9 +345,27 @@ const isLoading = computed(() => {
345
345
  return dpLoading.value || dpInitialLoad.value || false
346
346
  })
347
347
 
348
- // Data source for datatable: pageRows contains the prepared, decrypted data from the provider
348
+ // Data source for virtualization: full items array when virtualScroll is true
349
349
  const datatableItems = computed(() => {
350
- return pageRows.value
350
+ const currentRows = pageRows.value
351
+ const dp = props.dataProvider as any
352
+ if (props.virtualScroll) {
353
+ // In zero-trust encryption mode with page-level decryption (pageSize > 0), only pageRows is decrypted
354
+ if (dp?.isEncryptionEnabled && (dp?.pageSize > 0 || (isRef(dp?.pageSize) && dp.pageSize.value > 0))) {
355
+ return currentRows
356
+ }
357
+ if (Array.isArray(virtualRows?.value) && virtualRows.value.length > 0) return virtualRows.value
358
+ if (Array.isArray(dp?.rowMap)) return dp.rowMap
359
+ if (Array.isArray(dp?.rowMap?.value)) return dp.rowMap.value
360
+ if (Array.isArray(dp?.allVisibleRows)) return dp.allVisibleRows
361
+ if (Array.isArray(dp?.allVisibleRows?.value)) return dp.allVisibleRows.value
362
+ if (Array.isArray(dp?.allVisibleNodes)) return dp.allVisibleNodes
363
+ if (Array.isArray(dp?.allVisibleNodes?.value)) return dp.allVisibleNodes.value
364
+ if (Array.isArray(dp?.allData?.value)) return dp.allData.value
365
+ if (Array.isArray(dp?.allData)) return dp.allData
366
+ if (Array.isArray(dp?.data)) return dp.data
367
+ }
368
+ return currentRows
351
369
  })
352
370
 
353
371
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
- "version": "0.1.1-alpha.127",
3
+ "version": "0.1.1-alpha.129",
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.115",
57
+ "@katlux/providers": "^0.1.1-alpha.117",
58
58
  "@nuxt/kit": "^3.12.0",
59
59
  "@nuxtjs/i18n": "^10.4.0",
60
60
  "pug": "^3.0.0",