@katlux/toolkit 0.1.1-alpha.138 → 0.1.1-alpha.140
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 +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +11 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue +3 -0
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +11 -0
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +7 -1
- package/dist/runtime/components/KGantt/KGantt.logic.js +26 -7
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +11 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +52 -12
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -0
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +2 -0
- package/dist/skills/KATLUX_INDEX.md +1 -0
- package/dist/skills/katlux-config/SKILL.md +7 -7
- package/dist/skills/katlux-presets/SKILL.md +2 -0
- package/dist/skills/katlux-presets/creating-a-preset.md +269 -0
- package/dist/skills/katlux-providers/SKILL.md +1 -1
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +25 -0
- package/dist/skills/katlux-providers/providers/encryption.md +124 -8
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -135,8 +135,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
135
135
|
placeholder: string;
|
|
136
136
|
teleportTo: string;
|
|
137
137
|
showClear: boolean;
|
|
138
|
-
align: "left" | "right" | undefined;
|
|
139
138
|
format: string;
|
|
139
|
+
align: "left" | "right" | undefined;
|
|
140
140
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
141
141
|
declare const _default: typeof __VLS_export;
|
|
142
142
|
export default _default;
|
|
@@ -135,8 +135,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
135
135
|
placeholder: string;
|
|
136
136
|
teleportTo: string;
|
|
137
137
|
showClear: boolean;
|
|
138
|
-
align: "left" | "right" | undefined;
|
|
139
138
|
format: string;
|
|
139
|
+
align: "left" | "right" | undefined;
|
|
140
140
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
141
141
|
declare const _default: typeof __VLS_export;
|
|
142
142
|
export default _default;
|
|
@@ -59,6 +59,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
type: StringConstructor;
|
|
60
60
|
default: string;
|
|
61
61
|
};
|
|
62
|
+
inclusiveEndDate: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
62
66
|
cellSlots: {
|
|
63
67
|
type: ObjectConstructor;
|
|
64
68
|
default: () => {};
|
|
@@ -94,6 +98,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
94
98
|
"task-contextmenu": (...args: any[]) => void;
|
|
95
99
|
"task-rightclick": (...args: any[]) => void;
|
|
96
100
|
"update:task": (...args: any[]) => void;
|
|
101
|
+
"task-change": (...args: any[]) => void;
|
|
97
102
|
"update:startingPoint": (...args: any[]) => void;
|
|
98
103
|
"update:endingPoint": (...args: any[]) => void;
|
|
99
104
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -157,6 +162,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
157
162
|
type: StringConstructor;
|
|
158
163
|
default: string;
|
|
159
164
|
};
|
|
165
|
+
inclusiveEndDate: {
|
|
166
|
+
type: BooleanConstructor;
|
|
167
|
+
default: boolean;
|
|
168
|
+
};
|
|
160
169
|
cellSlots: {
|
|
161
170
|
type: ObjectConstructor;
|
|
162
171
|
default: () => {};
|
|
@@ -189,6 +198,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
189
198
|
"onTask-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
190
199
|
"onTask-rightclick"?: ((...args: any[]) => any) | undefined;
|
|
191
200
|
"onUpdate:task"?: ((...args: any[]) => any) | undefined;
|
|
201
|
+
"onTask-change"?: ((...args: any[]) => any) | undefined;
|
|
192
202
|
"onUpdate:startingPoint"?: ((...args: any[]) => any) | undefined;
|
|
193
203
|
"onUpdate:endingPoint"?: ((...args: any[]) => any) | undefined;
|
|
194
204
|
}>, {
|
|
@@ -209,6 +219,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
209
219
|
treeColumnIndex: number;
|
|
210
220
|
taskTypeField: string;
|
|
211
221
|
endingPoint: string | number | Date;
|
|
222
|
+
inclusiveEndDate: boolean;
|
|
212
223
|
startingPoint: string | number | Date;
|
|
213
224
|
taskMapping: Record<string, any>;
|
|
214
225
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -19,6 +19,7 @@ const emit = defineEmits([
|
|
|
19
19
|
"update:startingPoint",
|
|
20
20
|
"update:endingPoint",
|
|
21
21
|
"update:task",
|
|
22
|
+
"task-change",
|
|
22
23
|
"update:selectedRows",
|
|
23
24
|
"update:selectAll",
|
|
24
25
|
"task-click",
|
|
@@ -64,6 +65,7 @@ const templateProps = computed(() => ({
|
|
|
64
65
|
startingPoint: props.startingPoint,
|
|
65
66
|
endingPoint: props.endingPoint,
|
|
66
67
|
mode: props.mode,
|
|
68
|
+
inclusiveEndDate: props.inclusiveEndDate,
|
|
67
69
|
moveTime,
|
|
68
70
|
zoom,
|
|
69
71
|
selectedRows: selectedRows.value,
|
|
@@ -81,6 +83,7 @@ component(
|
|
|
81
83
|
:is="presetComponent"
|
|
82
84
|
v-bind="templateProps"
|
|
83
85
|
@update:task="$emit('update:task', $event)"
|
|
86
|
+
@task-change="$emit('task-change', $event)"
|
|
84
87
|
@update:selectedRows="$emit('update:selectedRows', $event)"
|
|
85
88
|
@update:selectAll="$emit('update:selectAll', $event)"
|
|
86
89
|
@task-click="$emit('task-click', $event)"
|
|
@@ -59,6 +59,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
type: StringConstructor;
|
|
60
60
|
default: string;
|
|
61
61
|
};
|
|
62
|
+
inclusiveEndDate: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
62
66
|
cellSlots: {
|
|
63
67
|
type: ObjectConstructor;
|
|
64
68
|
default: () => {};
|
|
@@ -94,6 +98,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
94
98
|
"task-contextmenu": (...args: any[]) => void;
|
|
95
99
|
"task-rightclick": (...args: any[]) => void;
|
|
96
100
|
"update:task": (...args: any[]) => void;
|
|
101
|
+
"task-change": (...args: any[]) => void;
|
|
97
102
|
"update:startingPoint": (...args: any[]) => void;
|
|
98
103
|
"update:endingPoint": (...args: any[]) => void;
|
|
99
104
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -157,6 +162,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
157
162
|
type: StringConstructor;
|
|
158
163
|
default: string;
|
|
159
164
|
};
|
|
165
|
+
inclusiveEndDate: {
|
|
166
|
+
type: BooleanConstructor;
|
|
167
|
+
default: boolean;
|
|
168
|
+
};
|
|
160
169
|
cellSlots: {
|
|
161
170
|
type: ObjectConstructor;
|
|
162
171
|
default: () => {};
|
|
@@ -189,6 +198,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
189
198
|
"onTask-contextmenu"?: ((...args: any[]) => any) | undefined;
|
|
190
199
|
"onTask-rightclick"?: ((...args: any[]) => any) | undefined;
|
|
191
200
|
"onUpdate:task"?: ((...args: any[]) => any) | undefined;
|
|
201
|
+
"onTask-change"?: ((...args: any[]) => any) | undefined;
|
|
192
202
|
"onUpdate:startingPoint"?: ((...args: any[]) => any) | undefined;
|
|
193
203
|
"onUpdate:endingPoint"?: ((...args: any[]) => any) | undefined;
|
|
194
204
|
}>, {
|
|
@@ -209,6 +219,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
209
219
|
treeColumnIndex: number;
|
|
210
220
|
taskTypeField: string;
|
|
211
221
|
endingPoint: string | number | Date;
|
|
222
|
+
inclusiveEndDate: boolean;
|
|
212
223
|
startingPoint: string | number | Date;
|
|
213
224
|
taskMapping: Record<string, any>;
|
|
214
225
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -58,6 +58,8 @@ export interface KGanttProps {
|
|
|
58
58
|
taskTypeField?: string;
|
|
59
59
|
/** 'date' (Standard calendar) or 'numeric' (Plain numbers) */
|
|
60
60
|
mode?: 'date' | 'numeric';
|
|
61
|
+
/** When true in date mode, date-only string end dates span the full day (+24h) and single-day tasks remain visible */
|
|
62
|
+
inclusiveEndDate?: boolean;
|
|
61
63
|
virtualScroll?: boolean;
|
|
62
64
|
itemHeight?: number;
|
|
63
65
|
viewportHeight?: number;
|
|
@@ -124,6 +126,10 @@ export declare const KGanttDefaultProps: {
|
|
|
124
126
|
type: StringConstructor;
|
|
125
127
|
default: string;
|
|
126
128
|
};
|
|
129
|
+
inclusiveEndDate: {
|
|
130
|
+
type: BooleanConstructor;
|
|
131
|
+
default: boolean;
|
|
132
|
+
};
|
|
127
133
|
cellSlots: {
|
|
128
134
|
type: ObjectConstructor;
|
|
129
135
|
default: () => {};
|
|
@@ -207,4 +213,4 @@ export declare function getGanttMarkers(start: number, end: number, mode?: 'date
|
|
|
207
213
|
*/
|
|
208
214
|
export declare function calculateGanttMinWidth(startMs: number, endMs: number, minMarkerWidth?: number, mode?: 'date' | 'numeric'): string;
|
|
209
215
|
export declare function getSnapMs(snapTo: string): number;
|
|
210
|
-
export declare function isTaskOverlapping(task: any, tasks: any[], startDateField: string, endDateField: string): boolean;
|
|
216
|
+
export declare function isTaskOverlapping(task: any, tasks: any[], startDateField: string, endDateField: string, inclusiveEndDate?: boolean): boolean;
|
|
@@ -70,6 +70,10 @@ export const KGanttDefaultProps = {
|
|
|
70
70
|
default: "date"
|
|
71
71
|
// 'date' | 'numeric'
|
|
72
72
|
},
|
|
73
|
+
inclusiveEndDate: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: true
|
|
76
|
+
},
|
|
73
77
|
cellSlots: {
|
|
74
78
|
type: Object,
|
|
75
79
|
default: () => ({})
|
|
@@ -128,8 +132,15 @@ export function useKGanttLogic(props) {
|
|
|
128
132
|
const getTaskStyle = (task) => {
|
|
129
133
|
const m = resolvedMapping.value;
|
|
130
134
|
const isDate = props.mode === "date";
|
|
131
|
-
const
|
|
132
|
-
const
|
|
135
|
+
const rawStart = task[m.startDate];
|
|
136
|
+
const rawEnd = task[m.endDate];
|
|
137
|
+
const startMs = isDate ? new Date(rawStart).getTime() : Number(rawStart);
|
|
138
|
+
let endMs = isDate ? new Date(rawEnd).getTime() : Number(rawEnd);
|
|
139
|
+
const isDateOnly = typeof rawEnd === "string" && /^\d{4}-\d{2}-\d{2}$/.test(rawEnd);
|
|
140
|
+
const inclusive = props.inclusiveEndDate !== false;
|
|
141
|
+
if (isDate && inclusive && (isDateOnly || endMs === startMs)) {
|
|
142
|
+
endMs += 24 * 60 * 60 * 1e3;
|
|
143
|
+
}
|
|
133
144
|
const rangeStart = globalDateRange.value.start;
|
|
134
145
|
const totalMs = totalDuration.value;
|
|
135
146
|
if (totalMs <= 0) return { display: "none" };
|
|
@@ -310,13 +321,21 @@ export function getSnapMs(snapTo) {
|
|
|
310
321
|
return 1;
|
|
311
322
|
}
|
|
312
323
|
}
|
|
313
|
-
export function isTaskOverlapping(task, tasks, startDateField, endDateField) {
|
|
314
|
-
const
|
|
315
|
-
const
|
|
324
|
+
export function isTaskOverlapping(task, tasks, startDateField, endDateField, inclusiveEndDate = false) {
|
|
325
|
+
const isDateOnly = (val) => typeof val === "string" && /^\d{4}-\d{2}-\d{2}$/.test(val);
|
|
326
|
+
const getMs = (val, isEnd) => {
|
|
327
|
+
const ms = new Date(val).getTime();
|
|
328
|
+
if (inclusiveEndDate && isEnd && isDateOnly(val)) {
|
|
329
|
+
return ms + 24 * 60 * 60 * 1e3;
|
|
330
|
+
}
|
|
331
|
+
return ms;
|
|
332
|
+
};
|
|
333
|
+
const tStart = getMs(task[startDateField], false);
|
|
334
|
+
const tEnd = getMs(task[endDateField], true);
|
|
316
335
|
return tasks.some((other) => {
|
|
317
336
|
if (other.id === task.id) return false;
|
|
318
|
-
const oStart =
|
|
319
|
-
const oEnd =
|
|
337
|
+
const oStart = getMs(other[startDateField], false);
|
|
338
|
+
const oEnd = getMs(other[endDateField], true);
|
|
320
339
|
return tStart < oEnd && tEnd > oStart;
|
|
321
340
|
});
|
|
322
341
|
}
|
|
@@ -25,6 +25,7 @@ type __VLS_Props = {
|
|
|
25
25
|
headerSlots?: any;
|
|
26
26
|
endingPoint?: Date | string | number;
|
|
27
27
|
mode?: 'date' | 'numeric';
|
|
28
|
+
inclusiveEndDate?: boolean;
|
|
28
29
|
virtualScroll?: boolean;
|
|
29
30
|
itemHeight?: number;
|
|
30
31
|
viewportHeight?: number;
|
|
@@ -50,6 +51,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
50
51
|
sourceRow: any;
|
|
51
52
|
targetRow?: any;
|
|
52
53
|
}) => any;
|
|
54
|
+
"task-change": (payload: {
|
|
55
|
+
task: IGanttTask;
|
|
56
|
+
sourceRow: any;
|
|
57
|
+
targetRow?: any;
|
|
58
|
+
}) => any;
|
|
53
59
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
54
60
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
55
61
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
@@ -68,6 +74,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
68
74
|
sourceRow: any;
|
|
69
75
|
targetRow?: any;
|
|
70
76
|
}) => any) | undefined;
|
|
77
|
+
"onTask-change"?: ((payload: {
|
|
78
|
+
task: IGanttTask;
|
|
79
|
+
sourceRow: any;
|
|
80
|
+
targetRow?: any;
|
|
81
|
+
}) => any) | undefined;
|
|
71
82
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
83
|
declare const _default: typeof __VLS_export;
|
|
73
84
|
export default _default;
|
|
@@ -95,6 +95,7 @@ const props = defineProps<{
|
|
|
95
95
|
|
|
96
96
|
endingPoint?: Date | string | number
|
|
97
97
|
mode?: 'date' | 'numeric'
|
|
98
|
+
inclusiveEndDate?: boolean
|
|
98
99
|
|
|
99
100
|
virtualScroll?: boolean
|
|
100
101
|
itemHeight?: number
|
|
@@ -107,6 +108,7 @@ const props = defineProps<{
|
|
|
107
108
|
|
|
108
109
|
const emit = defineEmits<{
|
|
109
110
|
(e: 'update:task', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
111
|
+
(e: 'task-change', payload: { task: IGanttTask; sourceRow: any; targetRow?: any }): void
|
|
110
112
|
(e: 'update:selectedRows', value: any[]): void
|
|
111
113
|
(e: 'update:selectAll', value: boolean): void
|
|
112
114
|
(e: 'task-click', payload: { task: IGanttTask; row: any }): void
|
|
@@ -124,6 +126,7 @@ interface ActiveDrag {
|
|
|
124
126
|
currentHoverRow: any
|
|
125
127
|
mode: 'move' | 'resize-left' | 'resize-right'
|
|
126
128
|
startX: number
|
|
129
|
+
startY: number
|
|
127
130
|
wrapperWidth: number
|
|
128
131
|
originalStartMs: number
|
|
129
132
|
originalEndMs: number
|
|
@@ -202,6 +205,22 @@ const onTaskClick = (payload: { task: IGanttTask; row: any }) => {
|
|
|
202
205
|
emit('task-click', payload)
|
|
203
206
|
}
|
|
204
207
|
|
|
208
|
+
function formatTaskDate(originalValue: any, ms: number, mode?: 'date' | 'numeric') {
|
|
209
|
+
if (mode === 'numeric' || typeof originalValue === 'number') return ms
|
|
210
|
+
if (originalValue instanceof Date) return new Date(ms)
|
|
211
|
+
if (typeof originalValue === 'string') {
|
|
212
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(originalValue)) {
|
|
213
|
+
const d = new Date(ms)
|
|
214
|
+
const year = d.getFullYear()
|
|
215
|
+
const month = String(d.getMonth() + 1).padStart(2, '0')
|
|
216
|
+
const day = String(d.getDate()).padStart(2, '0')
|
|
217
|
+
return `${year}-${month}-${day}`
|
|
218
|
+
}
|
|
219
|
+
return new Date(ms).toISOString()
|
|
220
|
+
}
|
|
221
|
+
return ms
|
|
222
|
+
}
|
|
223
|
+
|
|
205
224
|
const onTaskDragStart = (
|
|
206
225
|
{ event, task, rowId, mode, wrapperEl }: { event: MouseEvent; task: IGanttTask; rowId: any; mode: string; wrapperEl: HTMLElement | null },
|
|
207
226
|
row: any
|
|
@@ -226,6 +245,7 @@ const onTaskDragStart = (
|
|
|
226
245
|
currentHoverRow: row,
|
|
227
246
|
mode: mode as ActiveDrag['mode'],
|
|
228
247
|
startX: event.clientX,
|
|
248
|
+
startY: event.clientY,
|
|
229
249
|
wrapperWidth,
|
|
230
250
|
originalStartMs,
|
|
231
251
|
originalEndMs,
|
|
@@ -250,7 +270,8 @@ const onMouseMove = (e: MouseEvent) => {
|
|
|
250
270
|
|
|
251
271
|
const state = activeDragState.value
|
|
252
272
|
const deltaX = e.clientX - state.startX
|
|
253
|
-
|
|
273
|
+
const deltaY = e.clientY - state.startY
|
|
274
|
+
if (Math.abs(deltaX) > 4 || Math.abs(deltaY) > 4) {
|
|
254
275
|
wasDragging = true
|
|
255
276
|
}
|
|
256
277
|
const msPerPx = (props.globalDateRange.end - props.globalDateRange.start) / state.wrapperWidth
|
|
@@ -280,12 +301,6 @@ const onMouseUp = () => {
|
|
|
280
301
|
window.removeEventListener('mousemove', onMouseMove)
|
|
281
302
|
window.removeEventListener('mouseup', onMouseUp)
|
|
282
303
|
|
|
283
|
-
if (wasDragging) {
|
|
284
|
-
setTimeout(() => {
|
|
285
|
-
wasDragging = false
|
|
286
|
-
}, 150)
|
|
287
|
-
}
|
|
288
|
-
|
|
289
304
|
if (!activeDragState.value) { return }
|
|
290
305
|
|
|
291
306
|
const state = activeDragState.value
|
|
@@ -299,6 +314,22 @@ const onMouseUp = () => {
|
|
|
299
314
|
state.currentEndMs !== state.originalEndMs ||
|
|
300
315
|
(state.currentHoverRow && state.currentHoverRow !== state.sourceRow)
|
|
301
316
|
|
|
317
|
+
if (hasMoved || wasDragging) {
|
|
318
|
+
wasDragging = true
|
|
319
|
+
// Intercept and prevent the browser's subsequent click event in the capture phase
|
|
320
|
+
const captureClick = (e: MouseEvent) => {
|
|
321
|
+
e.stopPropagation()
|
|
322
|
+
e.stopImmediatePropagation()
|
|
323
|
+
e.preventDefault()
|
|
324
|
+
window.removeEventListener('click', captureClick, true)
|
|
325
|
+
}
|
|
326
|
+
window.addEventListener('click', captureClick, true)
|
|
327
|
+
setTimeout(() => {
|
|
328
|
+
window.removeEventListener('click', captureClick, true)
|
|
329
|
+
wasDragging = false
|
|
330
|
+
}, 100)
|
|
331
|
+
}
|
|
332
|
+
|
|
302
333
|
if (!hasMoved) {
|
|
303
334
|
activeDragState.value = null
|
|
304
335
|
return
|
|
@@ -306,8 +337,8 @@ const onMouseUp = () => {
|
|
|
306
337
|
|
|
307
338
|
const updatedTask = {
|
|
308
339
|
...state.task,
|
|
309
|
-
[startField]: state.currentStartMs,
|
|
310
|
-
[endField]: state.currentEndMs
|
|
340
|
+
[startField]: formatTaskDate(state.task[startField], state.currentStartMs, props.mode),
|
|
341
|
+
[endField]: formatTaskDate(state.task[endField], state.currentEndMs, props.mode)
|
|
311
342
|
}
|
|
312
343
|
|
|
313
344
|
let targetRow = state.sourceRow
|
|
@@ -347,18 +378,27 @@ const onMouseUp = () => {
|
|
|
347
378
|
? props.getTasksForRow(targetRow)
|
|
348
379
|
: (targetRow?.[tasksField] || [])
|
|
349
380
|
|
|
350
|
-
const overlapping = isTaskOverlapping(
|
|
381
|
+
const overlapping = isTaskOverlapping(
|
|
382
|
+
updatedTask,
|
|
383
|
+
targetTasks,
|
|
384
|
+
startField,
|
|
385
|
+
endField,
|
|
386
|
+
props.inclusiveEndDate ?? (props.mode === 'date')
|
|
387
|
+
)
|
|
351
388
|
|
|
352
389
|
if (overlapping) {
|
|
353
390
|
activeDragState.value = null
|
|
354
391
|
return
|
|
355
392
|
}
|
|
356
393
|
|
|
357
|
-
|
|
394
|
+
const emitPayload = {
|
|
358
395
|
task: updatedTask,
|
|
359
396
|
sourceRow: state.sourceRow,
|
|
360
397
|
targetRow: targetRow !== state.sourceRow ? targetRow : undefined
|
|
361
|
-
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
emit('update:task', emitPayload)
|
|
401
|
+
emit('task-change', emitPayload)
|
|
362
402
|
|
|
363
403
|
activeDragState.value = null
|
|
364
404
|
}
|
|
@@ -25,6 +25,7 @@ type __VLS_Props = {
|
|
|
25
25
|
headerSlots?: any;
|
|
26
26
|
endingPoint?: Date | string | number;
|
|
27
27
|
mode?: 'date' | 'numeric';
|
|
28
|
+
inclusiveEndDate?: boolean;
|
|
28
29
|
virtualScroll?: boolean;
|
|
29
30
|
itemHeight?: number;
|
|
30
31
|
viewportHeight?: number;
|
|
@@ -50,6 +51,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
50
51
|
sourceRow: any;
|
|
51
52
|
targetRow?: any;
|
|
52
53
|
}) => any;
|
|
54
|
+
"task-change": (payload: {
|
|
55
|
+
task: IGanttTask;
|
|
56
|
+
sourceRow: any;
|
|
57
|
+
targetRow?: any;
|
|
58
|
+
}) => any;
|
|
53
59
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
54
60
|
"onUpdate:selectedRows"?: ((value: any[]) => any) | undefined;
|
|
55
61
|
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
|
@@ -68,6 +74,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
68
74
|
sourceRow: any;
|
|
69
75
|
targetRow?: any;
|
|
70
76
|
}) => any) | undefined;
|
|
77
|
+
"onTask-change"?: ((payload: {
|
|
78
|
+
task: IGanttTask;
|
|
79
|
+
sourceRow: any;
|
|
80
|
+
targetRow?: any;
|
|
81
|
+
}) => any) | undefined;
|
|
71
82
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
83
|
declare const _default: typeof __VLS_export;
|
|
73
84
|
export default _default;
|
|
@@ -25,11 +25,13 @@
|
|
|
25
25
|
.gantt-resize-handle.left(
|
|
26
26
|
v-if="editable"
|
|
27
27
|
@mousedown.left.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-left', wrapperEl: wrapperRef })"
|
|
28
|
+
@click.stop
|
|
28
29
|
)
|
|
29
30
|
span.gantt-title {{ task[titleField] || '' }}
|
|
30
31
|
.gantt-resize-handle.right(
|
|
31
32
|
v-if="editable"
|
|
32
33
|
@mousedown.left.stop="$emit('task-dragstart', { event: $event, task, rowId: row?.id, mode: 'resize-right', wrapperEl: wrapperRef })"
|
|
34
|
+
@click.stop
|
|
33
35
|
)
|
|
34
36
|
</template>
|
|
35
37
|
|
|
@@ -14,6 +14,7 @@ When the **Katlux MCP Server** (`katlux` / `@katlux/mcp`) is configured in your
|
|
|
14
14
|
| `katlux_lookup_prop` | Ultra-compact atomic lookup for a single prop, event, or slot on a component (e.g. `component: 'KDatatable', prop: 'selectAllScope'`) | **~40 tokens** (ideal for micro-edits & single property checks) |
|
|
15
15
|
| `katlux_list_components` | Discover components filtered by category (`form`, `data`, `layout`, `navigation`, `feedback`, `charts`, `ecommerce`) or search query | ~150 tokens vs reading entire docs |
|
|
16
16
|
| `katlux_get_provider` | Data provider architecture, constructor options, caching, encryption, and recipes for `ADataProvider`, `CFlatClientDataProvider`, `CAPIFlatServerDataProvider` | ~400 tokens vs 15k in `katlux-providers` |
|
|
17
|
+
| `katlux_get_encryption` | Cryptographic architectures, cipher provider APIs, E2EE recipes, field-level encryption, tenant key wrapping, blind search indexing, and security instructions | ~200-500 tokens vs 14k in encryption spec |
|
|
17
18
|
| `katlux_list_icons` | Fuzzy search available SVG icons for `KIcon` and `icon` props | ~100 tokens vs guessing icon names |
|
|
18
19
|
| `katlux_get_tokens` | CSS design tokens by category (`color`, `surface`, `border`, `typography`, `button`, `input`, `table`, `other`) | ~300 tokens vs 6k in `katlux-tokens` |
|
|
19
20
|
| `katlux_scaffold` | Boilerplate code generator for common patterns (`datatable-page`, `form-with-validation`, `tree-explorer`, `chart-dashboard`) | Clean boilerplate with zero prompt bloat |
|
|
@@ -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.
|
|
108
|
-
| `@katlux/providers` | `0.1.1-alpha.
|
|
109
|
-
| `@katlux/preset-modern` | `0.1.1-alpha.
|
|
110
|
-
| `@katlux/preset-dark` | `0.1.1-alpha.
|
|
111
|
-
| `@katlux/block-charts` | `0.1.1-alpha.
|
|
112
|
-
| `@katlux/block-ecommerce` | `0.1.1-alpha.
|
|
113
|
-
| `@katlux/mcp` | `0.1.0-alpha.
|
|
107
|
+
| `@katlux/toolkit` | `0.1.1-alpha.139` | Core Nuxt module, UI toolkit, presets, and components | `npm install @katlux/toolkit@alpha` |
|
|
108
|
+
| `@katlux/providers` | `0.1.1-alpha.127` | Core data providers, client caching, and state structures | `npm install @katlux/providers@alpha` |
|
|
109
|
+
| `@katlux/preset-modern` | `0.1.1-alpha.114` | Modern design preset and styling variables | `npm install @katlux/preset-modern@alpha` |
|
|
110
|
+
| `@katlux/preset-dark` | `0.1.1-alpha.45` | Sleek Dark Mode design preset | `npm install @katlux/preset-dark@alpha` |
|
|
111
|
+
| `@katlux/block-charts` | `0.1.1-alpha.114` | Pre-built charting block components | `npm install @katlux/block-charts@alpha` |
|
|
112
|
+
| `@katlux/block-ecommerce` | `0.1.1-alpha.114` | Pre-built eCommerce block components | `npm install @katlux/block-ecommerce@alpha` |
|
|
113
|
+
| `@katlux/mcp` | `0.1.0-alpha.19` | 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.
|
|
@@ -7,6 +7,8 @@ description: Complete reference for the Katlux preset and theming system. Covers
|
|
|
7
7
|
|
|
8
8
|
Katlux uses a unified **preset** system to allow full visual customization without forking components. Each component has a `*.global.vue` wrapper that delegates rendering to a preset-specific implementation via `usePresetComponent()`.
|
|
9
9
|
|
|
10
|
+
- [Step-by-step: Creating a Preset from Scratch](creating-a-preset.md)
|
|
11
|
+
|
|
10
12
|
## Unified Preset Architecture
|
|
11
13
|
|
|
12
14
|
> [!IMPORTANT]
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Creating a Custom Katlux Preset from Scratch
|
|
2
|
+
|
|
3
|
+
This guide details how to create and maintain a custom preset in a Katlux project from scratch, covering both **project-level presets** (in a Nuxt application) and **reusable standalone npm preset packages**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Overview of Katlux Presets
|
|
8
|
+
|
|
9
|
+
Katlux presets are designed around a **zero-copy, cascading fallback** architecture:
|
|
10
|
+
- **Token-Only by default**: Over 90% of theming is handled purely through CSS custom properties without modifying component templates.
|
|
11
|
+
- **Selective Component Overrides**: You only create component templates (`.vue` files) for the specific components you want to restructure or customize beyond CSS.
|
|
12
|
+
- **Automatic Fallback Cascade**: Any token or component not defined in your preset automatically cascades back to the base preset (e.g. `modern`) or the built-in `default` preset.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Quick Scaffolding
|
|
17
|
+
|
|
18
|
+
### Option A: Using the CLI
|
|
19
|
+
Run the `create-preset` command from the root of your project:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Based on 'modern' preset
|
|
23
|
+
npx @katlux/toolkit create-preset my-brand --base=modern
|
|
24
|
+
|
|
25
|
+
# Or without a base (falls back directly to 'default')
|
|
26
|
+
npx @katlux/toolkit create-preset my-brand
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Option B: Using the MCP Tool
|
|
30
|
+
If you have Katlux MCP installed:
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"name": "my-brand",
|
|
34
|
+
"base": "modern"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
Tool: `katlux_create_preset`
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 3. Directory Structure
|
|
42
|
+
|
|
43
|
+
A project preset lives in the `presets/` folder at your project root:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
presets/
|
|
47
|
+
└── my-brand/
|
|
48
|
+
├── assets/
|
|
49
|
+
│ └── css-variables.scss # Design tokens scoped to the preset
|
|
50
|
+
└── components/ # Optional component template overrides
|
|
51
|
+
├── KButton/
|
|
52
|
+
│ └── KButton.vue
|
|
53
|
+
└── KLayout/
|
|
54
|
+
└── KLayout.vue
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
> `@katlux/toolkit` **automatically discovers and injects** stylesheets found in `presets/<preset-name>/assets/css-variables.scss` (or `.css`). No manual import in `nuxt.config.ts` is required.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 4. Step 1: Defining Design Tokens (`css-variables.scss`)
|
|
63
|
+
|
|
64
|
+
All CSS custom properties must be scoped to the preset's attribute selector: `[data-preset~="<preset-name>"]`.
|
|
65
|
+
|
|
66
|
+
```scss
|
|
67
|
+
/* presets/my-brand/assets/css-variables.scss */
|
|
68
|
+
|
|
69
|
+
[data-preset~="my-brand"] {
|
|
70
|
+
/* 1. Brand Colors */
|
|
71
|
+
--primary-50: #eef2ff;
|
|
72
|
+
--primary-500: #6366f1;
|
|
73
|
+
--primary-600: #4f46e5;
|
|
74
|
+
--primary-700: #4338ca;
|
|
75
|
+
|
|
76
|
+
/* 2. Surfaces & Backgrounds */
|
|
77
|
+
--bg-primary: #ffffff;
|
|
78
|
+
--bg-secondary: #f8fafc;
|
|
79
|
+
--border-color: #e2e8f0;
|
|
80
|
+
|
|
81
|
+
/* 3. Typography & Spacing */
|
|
82
|
+
--font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
83
|
+
--border-radius-sm: 6px;
|
|
84
|
+
--border-radius-md: 10px;
|
|
85
|
+
--border-radius-lg: 16px;
|
|
86
|
+
|
|
87
|
+
/* 4. Component-Specific Tokens */
|
|
88
|
+
--button-padding: 0.625rem 1.25rem;
|
|
89
|
+
--button-radius: var(--border-radius-md);
|
|
90
|
+
--button-bg-primary: var(--primary-500);
|
|
91
|
+
--button-color-primary: #ffffff;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
> [!TIP]
|
|
96
|
+
> Always use `[data-preset~="my-brand"]` (space-separated attribute selector) to support preset stacks like `activePreset: ['my-brand', 'dark']`. Avoid using `!important`.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 5. Step 2: Overriding Component Templates (Optional)
|
|
101
|
+
|
|
102
|
+
You only need to add components if you want to alter the DOM structure, replace internal sub-elements, or customize behavior beyond CSS variables.
|
|
103
|
+
|
|
104
|
+
### Folder and Naming Conventions
|
|
105
|
+
- Component overrides are **case-sensitive**.
|
|
106
|
+
- The path must follow: `presets/<preset-name>/components/<ComponentName>/<ComponentName>.vue`.
|
|
107
|
+
- Example: `presets/my-brand/components/KButton/KButton.vue`.
|
|
108
|
+
|
|
109
|
+
### Writing a Component Template
|
|
110
|
+
Use the component's logic props and standard slots.
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<!-- presets/my-brand/components/KButton/KButton.vue -->
|
|
114
|
+
<template lang="pug">
|
|
115
|
+
button.KButton.my-brand(
|
|
116
|
+
:type="type"
|
|
117
|
+
:class="[buttonClasses, customClasses]"
|
|
118
|
+
:disabled="disabled || loading"
|
|
119
|
+
@click="handleClick"
|
|
120
|
+
)
|
|
121
|
+
span.k-spinner(v-if="loading")
|
|
122
|
+
slot(name="prefix")
|
|
123
|
+
slot
|
|
124
|
+
slot(name="suffix")
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<script lang="ts" setup>
|
|
128
|
+
interface ButtonProps {
|
|
129
|
+
type?: 'button' | 'submit' | 'reset'
|
|
130
|
+
buttonClasses?: any
|
|
131
|
+
disabled?: boolean
|
|
132
|
+
loading?: boolean
|
|
133
|
+
customClasses?: string
|
|
134
|
+
handleClick?: (e: MouseEvent) => void
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
withDefaults(defineProps<ButtonProps>(), {
|
|
138
|
+
type: 'button',
|
|
139
|
+
disabled: false,
|
|
140
|
+
loading: false
|
|
141
|
+
})
|
|
142
|
+
</script>
|
|
143
|
+
|
|
144
|
+
<style lang="scss" scoped>
|
|
145
|
+
.KButton.my-brand {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
gap: var(--gap-sm, 0.5rem);
|
|
150
|
+
padding: var(--button-padding);
|
|
151
|
+
border-radius: var(--button-radius);
|
|
152
|
+
font-family: var(--font-family-base);
|
|
153
|
+
transition: all 0.2s ease-in-out;
|
|
154
|
+
|
|
155
|
+
&:hover:not(:disabled) {
|
|
156
|
+
transform: translateY(-1px);
|
|
157
|
+
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## 6. Step 3: Registering & Activating the Preset (`app.config.ts`)
|
|
166
|
+
|
|
167
|
+
Enable your preset in your project's `app.config.ts`:
|
|
168
|
+
|
|
169
|
+
### A. When Based on Another Preset (e.g. `modern`)
|
|
170
|
+
```typescript
|
|
171
|
+
// app.config.ts
|
|
172
|
+
export default defineAppConfig({
|
|
173
|
+
katluxToolkit: {
|
|
174
|
+
presetList: [
|
|
175
|
+
{ name: 'Default', value: 'default' },
|
|
176
|
+
{ name: 'Modern', value: 'modern' },
|
|
177
|
+
{ name: 'My Brand', value: ['my-brand', 'modern'] }
|
|
178
|
+
],
|
|
179
|
+
// Priority: my-brand -> modern -> default
|
|
180
|
+
activePreset: ['my-brand', 'modern']
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### B. When Standalone (Direct Fallback to `default`)
|
|
186
|
+
```typescript
|
|
187
|
+
// app.config.ts
|
|
188
|
+
export default defineAppConfig({
|
|
189
|
+
katluxToolkit: {
|
|
190
|
+
presetList: [
|
|
191
|
+
{ name: 'Default', value: 'default' },
|
|
192
|
+
{ name: 'My Brand', value: 'my-brand' }
|
|
193
|
+
],
|
|
194
|
+
activePreset: 'my-brand'
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 7. Creating an Installable NPM Preset Package
|
|
202
|
+
|
|
203
|
+
If you are developing a standalone preset package (e.g. `@my-org/katlux-preset-corp`):
|
|
204
|
+
|
|
205
|
+
### 1. Package Directory Structure
|
|
206
|
+
```text
|
|
207
|
+
katlux-preset-corp/
|
|
208
|
+
├── package.json
|
|
209
|
+
├── src/
|
|
210
|
+
│ ├── module.ts # Nuxt module definition
|
|
211
|
+
│ └── runtime/
|
|
212
|
+
│ ├── assets/
|
|
213
|
+
│ │ └── css-variables.scss
|
|
214
|
+
│ ├── components/
|
|
215
|
+
│ │ └── KButton/KButton.vue
|
|
216
|
+
│ └── plugin.ts # Runtime component registration
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 2. Runtime Plugin (`src/runtime/plugin.ts`)
|
|
220
|
+
Register component loaders using `registerPresetComponents`:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
import { defineNuxtPlugin } from '#app'
|
|
224
|
+
// @ts-ignore
|
|
225
|
+
import { registerPresetComponents } from '#imports'
|
|
226
|
+
|
|
227
|
+
export default defineNuxtPlugin(() => {
|
|
228
|
+
const loaders = {
|
|
229
|
+
'./components/KButton/KButton.vue': () => import('./components/KButton/KButton.vue')
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (typeof registerPresetComponents === 'function') {
|
|
233
|
+
registerPresetComponents('corp', loaders)
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 3. Nuxt Module (`src/module.ts`)
|
|
239
|
+
Inject the stylesheet and register the runtime plugin:
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit'
|
|
243
|
+
|
|
244
|
+
export default defineNuxtModule({
|
|
245
|
+
meta: {
|
|
246
|
+
name: '@my-org/katlux-preset-corp',
|
|
247
|
+
configKey: 'katluxPresetCorp'
|
|
248
|
+
},
|
|
249
|
+
setup(options, nuxt) {
|
|
250
|
+
const resolver = createResolver(import.meta.url)
|
|
251
|
+
|
|
252
|
+
// Automatically inject CSS variables
|
|
253
|
+
nuxt.options.css = nuxt.options.css || []
|
|
254
|
+
nuxt.options.css.push(resolver.resolve('./runtime/assets/css-variables.scss'))
|
|
255
|
+
|
|
256
|
+
// Register runtime plugin
|
|
257
|
+
addPlugin(resolver.resolve('./runtime/plugin'))
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 8. Best Practices Checklist
|
|
265
|
+
|
|
266
|
+
- [ ] **Do not copy entire base presets**: Only write tokens you intend to customize. Let uncustomized tokens fall back.
|
|
267
|
+
- [ ] **Scope to `[data-preset~="name"]`**: Avoid unscoped root styles or `!important`.
|
|
268
|
+
- [ ] **Preserve logic and props**: When overriding a component template, maintain the props and slot signatures exposed by the component logic layer.
|
|
269
|
+
- [ ] **Persist dynamic UI state externally**: Switching presets with structural component overrides causes container unmounting; keep transient state (active tabs, table selections) in Pinia or URL query params.
|
|
@@ -50,7 +50,7 @@ description: Complete reference and atomic index for Katlux data management arch
|
|
|
50
50
|
| `RequestQueue` | Offline PWA operation queue | Queues mutations offline in IndexedDB, auto-flushes on reconnect | [RequestQueue.md](providers/RequestQueue.md) |
|
|
51
51
|
| `KatluxIndexedDB` | High-performance IndexedDB wrapper | Client-side persistent storage for offline data and large cache entries | [KatluxIndexedDB.md](providers/KatluxIndexedDB.md) |
|
|
52
52
|
| `CacheProvider` | Tiered multi-layer caching engine | Memory, BrowserSession, LocalStorage, IndexedDB, Cookie tiers | [caching.md](providers/caching.md) |
|
|
53
|
-
| `EncryptionProvider` | WebCrypto & NodeCrypto
|
|
53
|
+
| `EncryptionProvider` & `CKeyManager` | WebCrypto & NodeCrypto cryptographic suite | AES-GCM 256-bit field/payload encryption, built-in keyring rotation, strict decryption, dynamic AAD, zero-leak ADEK re-wrapping, RFC 8785 JCS access grants, domain-separated derivation | [encryption.md](providers/encryption.md) |
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
@@ -9,6 +9,7 @@ Handle full API integration with automatic query generation. Pagination, filteri
|
|
|
9
9
|
| `cacheStrategy` | `ECacheStrategy`| Persistence engine for this provider |
|
|
10
10
|
| `cacheLifetime` | `number` | Expiration in milliseconds |
|
|
11
11
|
| `refreshOnMutation`| `boolean` | Reload data after `delete`/`update` (Default: true) |
|
|
12
|
+
| `encryption` | `IProviderEncryptionOptions` | Client-side decryption config (`fields: string[]`, `key`, `strict`). Automatically decrypts received page slices on-the-fly via `decryptPageRows()`. |
|
|
12
13
|
|
|
13
14
|
- **Methods**:
|
|
14
15
|
| Method | Params | Description |
|
|
@@ -18,3 +19,27 @@ Handle full API integration with automatic query generation. Pagination, filteri
|
|
|
18
19
|
| `create(item)` | `any` | Async POST request to creation endpoint |
|
|
19
20
|
| `update(item)` | `any` | Async PUT request to update endpoint |
|
|
20
21
|
| `delete(items)` | `any[]` | Async batch deletion via endpoint |
|
|
22
|
+
|
|
23
|
+
#### Server-Side Encrypted Datatable & Search Integration
|
|
24
|
+
When querying backend persistence endpoints (e.g. server-side datatable backends or Cloudflare stateless edge workers) that store and return encrypted records:
|
|
25
|
+
```ts
|
|
26
|
+
const provider = new CAPIFlatServerDataProvider({
|
|
27
|
+
pageSize: 10,
|
|
28
|
+
cacheStrategy: ECacheStrategy.IndexedDB,
|
|
29
|
+
encryption: {
|
|
30
|
+
enabled: true,
|
|
31
|
+
key: 'user-secret-encryption-key',
|
|
32
|
+
fields: ['name', 'email', 'salary']
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
provider.setAPIUrl('/api/encryptedDataList')
|
|
36
|
+
|
|
37
|
+
// Filtering triggers structured queries to the server;
|
|
38
|
+
// The server matches queries against HMAC blind indices / GIN trigrams and returns encrypted envelopes.
|
|
39
|
+
// CAPIFlatServerDataProvider automatically decrypts the 10 received page rows for KDatatable.
|
|
40
|
+
provider.setFilter({
|
|
41
|
+
operator: EDataFilterOperator.In,
|
|
42
|
+
field: { name: 'Elena' },
|
|
43
|
+
active: true
|
|
44
|
+
})
|
|
45
|
+
```
|
|
@@ -19,20 +19,51 @@ Zero-dependency, native cryptographic toolkit for end-to-end client-side, in-fli
|
|
|
19
19
|
- `CWebCryptoEncryptionProvider`: AES-GCM-256 with optional PBKDF2/HKDF key derivation. Built-in AEAD, 100% backward-compatible.
|
|
20
20
|
- `CWebCryptoAESCBCProvider`: Authenticated AES-CBC-256 + HMAC-SHA-256 (Encrypt-then-MAC) for legacy system compatibility.
|
|
21
21
|
- `CRSAEncryptionProvider`: Asymmetric RSA-OAEP-4096 + AES-GCM-256 hybrid cipher for arbitrary-sized single-recipient payloads.
|
|
22
|
-
- `CECDHEncryptionProvider`: Forward-secure Elliptic Curve Diffie-Hellman (P-256/384/521) + HKDF + AES-GCM. Ephemeral key per encryption. Ideal for multi-user role sharing (e.g.
|
|
22
|
+
- `CECDHEncryptionProvider`: Forward-secure Elliptic Curve Diffie-Hellman (P-256/384/521) + HKDF + AES-GCM. Ephemeral key per encryption. Ideal for multi-user role sharing (e.g. Account Symmetric Key wrapping).
|
|
23
23
|
- `CNodeCryptoEncryptionProvider`: Server-side synchronous AES-GCM via `node:crypto` (`encryptSync`/`decryptSync`). 100% binary-interoperable with `CWebCryptoEncryptionProvider`.
|
|
24
24
|
- **Provider Methods (`IEncryptionProvider` / `AEncryptionProvider`)**:
|
|
25
|
-
- `encrypt(data: any, options?: IEncryptionContext): Promise<IEncryptedPayload | any>`: Encrypts data into an envelope or field-encrypted record (strictly idempotent; already-encrypted fields/envelopes are never double-encrypted). Attaches `kid` when specified
|
|
26
|
-
- `decrypt(payload: any, options?: IEncryptionContext): Promise<any>`: Decrypts envelope back into original data, immediately zeroing plaintext byte buffers in memory. Automatically leverages record-level DEK caching across multi-field records for up to 90% latency reduction.
|
|
27
|
-
- `
|
|
25
|
+
- `encrypt(data: any, options?: IEncryptionContext): Promise<IEncryptedPayload | any>`: Encrypts data into an envelope or field-encrypted record (strictly idempotent; already-encrypted fields/envelopes are never double-encrypted). Attaches `kid` when specified or uses `activeKid`.
|
|
26
|
+
- `decrypt(payload: any, options?: IEncryptionContext): Promise<any>`: Decrypts envelope back into original data, immediately zeroing plaintext byte buffers in memory. Dynamically routes decryption through `keys[envelope.kid]` or fallback keys, validating against `allowedKids`. Automatically leverages record-level DEK caching across multi-field records for up to 90% latency reduction.
|
|
27
|
+
- `encryptField(value: any, context?: IFieldEncryptionContext): Promise<IEncryptedPayload>`: Atomically encrypts a single scalar value with contextual AAD binding (`recordId`, `fieldName`, sibling `aadFields`) into an `IEncryptedPayload` envelope without requiring dummy object allocation.
|
|
28
|
+
- `decryptField(envelope: IEncryptedPayload, context?: IFieldEncryptionContext): Promise<any>`: Symmetrically decrypts a single scalar field envelope, verifying contextual AAD integrity and tamper resistance.
|
|
29
|
+
- `computeBlindIndex(value: any, hmacKey?: CryptoKey | TKeyProvider): Promise<string>`: Computes deterministic HMAC-SHA256 blind index hex hash with Unicode NFKC normalization and lowercasing for exact-match database lookups.
|
|
30
|
+
- `warmupKey(options?: IEncryptionContext): Promise<void>`: Pre-derives and caches CryptoKey / Buffer in memory. When a keyring (`keys`) is configured, resolves and warms up all keys concurrently via `Promise.all`. Supported on `CWebCrypto`, `CWebCryptoAESCBC`, and `CNodeCrypto` (`warmupKeySync` also available on Node).
|
|
31
|
+
- `setKeyring(keys: Record<string, TKeyProvider | IKeyPair>, activeKid?: string): void`: Replaces or updates the active keyring dictionary and optionally sets the active outbound key identifier.
|
|
32
|
+
- `getKeyring(): Record<string, TKeyProvider | IKeyPair>`: Returns the currently configured keyring dictionary.
|
|
33
|
+
- `setActiveKid(kid: string): void`: Sets the active key identifier used for all outbound encryption.
|
|
34
|
+
- `getActiveKid(): string | undefined`: Returns the currently active outbound key identifier.
|
|
28
35
|
- `isEncrypted(payload: any): boolean`: Polymorphic check if given object is an encrypted envelope. Also available as static `AEncryptionProvider.isEncrypted(payload)`.
|
|
29
|
-
- `clearKeys() / dispose()`: Wipes in-memory key caches, zeroes mutable Buffer bytes, and clears sensitive asymmetric keys upon logout/session end.
|
|
36
|
+
- `clearKeys() / dispose()`: Wipes in-memory key caches, zeroes mutable Buffer bytes and keyring caches, and clears sensitive asymmetric keys upon logout/session end.
|
|
30
37
|
- `resolveRawKey(keyProvider?: TKeyProvider)`: (Protected on `AEncryptionProvider`) Resolves key or async keyProvider callback. Supports `string`, `Uint8Array`, `ArrayBuffer`, and `CryptoKey` without byte corruption.
|
|
31
38
|
- **PEM Import/Export (`CKeyManager` / `CRSA` / `CECDH`)**:
|
|
32
|
-
- `importPublicKeyFromPEM(pem,
|
|
33
|
-
- `importPrivateKeyFromPEM(pem,
|
|
39
|
+
- `importPublicKeyFromPEM(pem, algorithm?, curve?, hash?)`: Imports SPKI PEM string to `CryptoKey` (`RSA-OAEP`, `ECDH`, or `ECDSA`).
|
|
40
|
+
- `importPrivateKeyFromPEM(pem, algorithm?, curve?, hash?)`: Imports PKCS#8 PEM string to `CryptoKey` (`RSA-OAEP`, `ECDH`, or `ECDSA`).
|
|
41
|
+
- `importECDSAPublicKeyFromPEM(pem, curve?): Promise<CryptoKey>`: Imports an ECDSA public key from PEM SPKI for signature verification.
|
|
42
|
+
- `importECDSAPrivateKeyFromPEM(pem, curve?): Promise<CryptoKey>`: Imports an ECDSA private key from PEM PKCS#8 for signing.
|
|
34
43
|
- `exportPublicKeyToPEM(key)`: Exports `CryptoKey` to standard SPKI PEM string.
|
|
35
44
|
- `exportPrivateKeyToPEM(key)`: Exports `CryptoKey` to standard PKCS#8 PEM string.
|
|
45
|
+
- **Account & HMAC Key Wrapping (`CKeyManager`)**:
|
|
46
|
+
- `wrapAccountKeyForUser(adek, userPublicKey): Promise<string>`: Wraps an ADEK for a user using RSA-OAEP.
|
|
47
|
+
- `unwrapAccountKeyForUser(wrappedKeyBase64, userPrivateKey, unwrappedKeyAlgorithm?, extractable?): Promise<CryptoKey>`: Restores an unextractable AES-GCM ADEK from envelope using RSA-OAEP.
|
|
48
|
+
- `wrapHMACKeyForUser(hmacKey, userPublicKey): Promise<string>`: Wraps an HMAC blind indexing key for a user using RSA-OAEP.
|
|
49
|
+
- `unwrapHMACKeyForUser(wrappedKeyBase64, userPrivateKey, hash?, extractable?): Promise<CryptoKey>`: Restores an HMAC search key using recipient RSA-OAEP private key.
|
|
50
|
+
- `rewrapAccountKeyForUser(wrappedKeyBase64, myPrivateKey, recipientPublicKey): Promise<string>`: Atomically re-wraps an ADEK envelope for a new recipient without exposing raw extractable keys to application memory, guaranteeing memory zeroization via `finally`.
|
|
51
|
+
- **Blind Index & Token Utilities (`CKeyManager` / `CSearchIndex`)**:
|
|
52
|
+
- `CKeyManager.computeBlindIndex(value, hmacKey): Promise<string>`: Computes deterministic HMAC-SHA256 blind index hash for arbitrary values.
|
|
53
|
+
- `searchIndex.computeBlindIndex(term): Promise<string>`: Computes blind index using configured search HMAC key.
|
|
54
|
+
- `searchIndex.indexRowDecrypted(row, decryptedPlaintext): Promise<void>`: Indexes a row using pre-decrypted plaintext fields while preserving raw ciphertext in data tables.
|
|
55
|
+
- **Digital Signatures & Access Grants (`CKeyManager` / `canonicalizeJson`)**:
|
|
56
|
+
- `canonicalizeJson(value): string`: Serializes a JavaScript value to a deterministic, canonical JSON string conforming to RFC 8785 (JCS).
|
|
57
|
+
- `generateSigningKeyPair(curve?, extractable?): Promise<IKeyPair>` / `generateECDSAKeyPair()`: Generates an ECDSA signing key pair (`P-256`, `P-384`, `P-521`).
|
|
58
|
+
- `getKeyFingerprint(publicKey): Promise<string>`: Generates a deterministic SHA-256 fingerprint for a public key formatted as `SHA256:<base64url>`.
|
|
59
|
+
- `sign(data, privateKey): Promise<string>`: Signs arbitrary data or JSON objects using an ECDSA P-256 private key (objects automatically canonicalized via RFC 8785).
|
|
60
|
+
- `verify(data, signature, publicKey): Promise<boolean>`: Verifies an ECDSA P-256 signature against original data or JSON object.
|
|
61
|
+
- `signGrant(grant: IAccessGrant, granterPrivateKey, granterPublicKey?): Promise<ISignedGrant>`: Signs a structured access grant, embedding signature and granter key fingerprint.
|
|
62
|
+
- `verifyGrant(signedGrant: ISignedGrant, granterPublicKey, options?): Promise<boolean>`: Verifies authenticity, integrity, and granter key fingerprint of an access grant, defeating key-substitution attacks.
|
|
63
|
+
- **Domain-Separated Key Derivation (`CKeyManager.deriveAuthAndEncryptionKeys`)**:
|
|
64
|
+
- `deriveAuthAndEncryptionKeys(password, salt?, options?): Promise<IDomainDerivedKeys>`: Hardened two-stage derivation pipeline. PBKDF2 stretches low-entropy user password and salt, then HKDF-Expand produces two cryptographically isolated keys (`authKey` for authentication challenges and `encryptionKey` for AES-GCM data encryption) using domain-separated context tags (`katlux-auth-key-v1` and `katlux-encryption-key-v1`). Full compromise of `authKey` reveals zero mathematical information about `encryptionKey`. Intermediate master secret buffers are immediately zeroized in memory.
|
|
65
|
+
|
|
66
|
+
|
|
36
67
|
|
|
37
68
|
- **Envelope Contract (`IEncryptedPayload`)**:
|
|
38
69
|
```ts
|
|
@@ -56,11 +87,21 @@ interface IEncryptedPayload {
|
|
|
56
87
|
```ts
|
|
57
88
|
interface IProviderEncryptionOptions {
|
|
58
89
|
enabled?: boolean // Master toggle (default: false)
|
|
59
|
-
key?: TKeyProvider //
|
|
90
|
+
key?: TKeyProvider // Single key or key provider (legacy/simple mode)
|
|
91
|
+
keys?: Record<string, TKeyProvider | IKeyPair> // Built-in Keyring dictionary mapping kid to keys
|
|
92
|
+
activeKid?: string // Active key identifier from keys to use for outbound encryption
|
|
60
93
|
kid?: string // Key identifier / version (e.g. 'v1', 'tenant-a-key-2026')
|
|
94
|
+
aad?: string | Uint8Array | ArrayBuffer | ((record: any, field: string) => string | Uint8Array | ArrayBuffer) // AEAD Additional Data or dynamic callback
|
|
95
|
+
aadFields?: string[] // Sibling record fields to deterministically bind into AAD (e.g. ['contact_id', 'version'])
|
|
96
|
+
baseAad?: string // Optional base prefix for AAD context binding
|
|
61
97
|
decryptOnSSR?: boolean // default: false. Prevents SSR decryption unless explicitly enabled with server secrets
|
|
62
98
|
fields?: string[] // Field-level encryption: only encrypt listed fields
|
|
99
|
+
strict?: boolean // Enforces strict decryption: unencrypted plaintext in `fields` triggers injection violation; defaults allowedAlgorithms to ['AES-GCM']
|
|
100
|
+
allowedAlgorithms?: string[] // Whitelist of permitted cipher algorithms (e.g. ['AES-GCM'])
|
|
101
|
+
allowedKids?: string[] // Whitelist of permitted Key Identifiers (kid); defaults to Object.keys(keys)
|
|
102
|
+
onDecryptError?: ((info: IDecryptErrorInfo) => any) | boolean | string // Per-field error hook, safe fallback marker, or true for '[⚠ Decryption Error]'
|
|
63
103
|
searchIndex?: boolean // Enables HMAC-SHA256 blind index and trigram search index on encrypted fields
|
|
104
|
+
preEncrypted?: boolean // Set to true if API endpoints return pre-encrypted ciphertext envelopes; enables in-memory index decryption
|
|
64
105
|
hmacKey?: TKeyProvider // Optional dedicated HMAC key for search indexing (defaults to encryption key)
|
|
65
106
|
algorithm?: 'AES-GCM' | string // default: 'AES-GCM'
|
|
66
107
|
customProvider?: IEncryptionProvider // Custom cipher adapter (e.g. CRSA, CECDH, AES-CBC)
|
|
@@ -91,6 +132,7 @@ Supported uniformly across **all** client and server data providers:
|
|
|
91
132
|
|
|
92
133
|
#### Local DataProvider Encryption Architecture
|
|
93
134
|
- **Eager Encryption**: `setData(rows)` encrypts designated `fields` immediately before storing in `allData`. Plaintext never persists in `allData`.
|
|
135
|
+
- **Pre-Encrypted Ingest & Search**: When datasets arrive already encrypted (`preEncrypted: true`), data providers (`CFlatClientDataProvider`, `CAPIFlatClientDataProvider`) perform a transient in-memory decryption pass on indexed fields to populate `CSearchIndex` without modifying or leaking the persistent ciphertext rows in `allData`.
|
|
94
136
|
- **Non-blocking Ingestion**: `setDataChunked(rows, { chunkSize: 250, yieldStrategy: 'idle' })` yields between chunks to prevent main-thread freezing on large datasets.
|
|
95
137
|
- **Idempotent Ingestion**: Pre-encrypted envelopes (`__encrypted: true`, e.g. from IndexedDB or Web Workers) pass through untouched without double-encryption.
|
|
96
138
|
- **Lazy Page-Level Decryption**: `loadPageData()` slices `allData` and decrypts only the active page (`pageSize` rows) into `pageData`. Only visible rows are plaintext in memory.
|
|
@@ -148,4 +190,78 @@ In multi-tenant, field-encrypted, and SSR scenarios, Katlux cryptographic provid
|
|
|
148
190
|
- **Nonce Misuse Resistance**: Initialization Vectors (IVs) are freshly generated via cryptographically secure RNG per operation (12 bytes for GCM, 16 bytes for CBC) with proven uniqueness across sibling fields, batch arrays, and concurrent executions.
|
|
149
191
|
- **Deterministic Search Token Segregation**: `CSearchIndex` HMAC-SHA256 blind index tokens are deterministic for search matching and strictly segregated from non-deterministic ciphertext IVs.
|
|
150
192
|
- **Non-Extractable Tenant Keys**: `CKeyManager.generateAccountDataKey()` and `CKeyManager.unwrapAccountKeyForUser()` produce `CryptoKey` instances with `extractable: false` by default, safeguarding unwrapped symmetric tenant keys against exfiltration via developer tools or malicious extensions.
|
|
193
|
+
- **Atomic Key Re-Wrapping (`CKeyManager.rewrapAccountKeyForUser`)**: When sharing an Account Data Encryption Key (ADEK) between users, `CKeyManager.rewrapAccountKeyForUser(wrappedKey, myPrivateKey, recipientPublicKey)` atomically decrypts the raw key material and re-encrypts it with the recipient's RSA-OAEP public key without ever exposing the raw extractable symmetric key to caller application memory or leaving extractable CryptoKeys in memory. Immediate memory zeroization (`fill(0)`) is guaranteed across all paths.
|
|
151
194
|
- **SSR Confidentiality & Cache Auth Guard**: With `decryptOnSSR: false` (the secure zero-trust default), plaintext is never exposed in server memory or serialized HTML hydration payloads. Requests with `cookie` or `Authorization` headers automatically bypass shared server caches (`CApplicationCache`), preventing cross-user session cache poisoning.
|
|
195
|
+
|
|
196
|
+
#### Built-in Keyring & Multi-Key Rotation Architecture
|
|
197
|
+
- **Zero-Downtime Key Rotation**: Configuring `keys: { 'k2025': key1, 'k2026': key2 }` alongside `activeKid: 'k2026'` ensures all outbound writes are automatically tagged with `kid: 'k2026'` and encrypted with `key2`, while legacy records tagged with `k2025` decrypt seamlessly under `key1`.
|
|
198
|
+
- **Automatic Whitelisting & Untrusted `kid` Protection**: `allowedKids` automatically defaults to `Object.keys(keys)` when `keys` is provided. Incoming envelopes carrying an unknown or unregistered `kid` are immediately rejected with an unauthorized key security error (`Unauthorized key: kid '${payload.kid}' is not in allowedKids.`).
|
|
199
|
+
- **Concurrent Multi-Key Warmup**: Calling `warmupKey()` (or `warmupKeySync()` on Node) resolves and primes all cryptographic keys across the entire keyring concurrently using `Promise.all`, preventing runtime latency spikes or race conditions during rotation periods.
|
|
200
|
+
- **Dynamic Runtime Keyring Management**: Keyrings can be rotated dynamically at runtime using `provider.setKeyring(newKeys, newActiveKid)` or `provider.setActiveKid(newKid)` without recreating provider instances or dropping existing session caches.
|
|
201
|
+
|
|
202
|
+
#### Backend Persistence & Datatable Encrypted Search Architecture
|
|
203
|
+
To enable fast exact-match and substring search across AES-256-GCM encrypted records in persisted storage and server-side datatables without decrypting rows or leaking plaintext to the persistence server:
|
|
204
|
+
|
|
205
|
+
1. **Schema Column Mapping**:
|
|
206
|
+
- **Ciphertext (`JSONB` or `TEXT`)**: Holds the complete Katlux envelope `{ __encrypted: true, ciphertext, iv, tag, v: 1 }`.
|
|
207
|
+
- **Blind Index (`CHAR(64)`)**: Deterministic HMAC-SHA256 hash of normalized plaintext, indexed with a **B-Tree** for $O(\log N)$ point lookups (`=` / `IN`).
|
|
208
|
+
- **Trigram Array (`TEXT[]` or `BIGINT[]`)**: Set of hashed 3-character slices, indexed with an **inverted index (e.g. GIN / array index)** for substring queries.
|
|
209
|
+
|
|
210
|
+
```sql
|
|
211
|
+
CREATE TABLE contacts (
|
|
212
|
+
id SERIAL PRIMARY KEY,
|
|
213
|
+
name_encrypted JSONB NOT NULL,
|
|
214
|
+
email_encrypted JSONB NOT NULL,
|
|
215
|
+
salary_encrypted JSONB,
|
|
216
|
+
name_bidx CHAR(64) NOT NULL,
|
|
217
|
+
email_bidx CHAR(64) NOT NULL,
|
|
218
|
+
name_trigrams TEXT[] NOT NULL,
|
|
219
|
+
email_trigrams TEXT[] NOT NULL,
|
|
220
|
+
role VARCHAR(100),
|
|
221
|
+
department VARCHAR(100),
|
|
222
|
+
status VARCHAR(50) DEFAULT 'Active'
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
-- B-Tree for exact lookups:
|
|
226
|
+
CREATE INDEX idx_contacts_name_bidx ON contacts (name_bidx);
|
|
227
|
+
CREATE INDEX idx_contacts_email_bidx ON contacts (email_bidx);
|
|
228
|
+
|
|
229
|
+
-- Inverted index for fast array containment substring search:
|
|
230
|
+
CREATE INDEX idx_contacts_name_trigrams ON contacts USING GIN (name_trigrams);
|
|
231
|
+
CREATE INDEX idx_contacts_email_trigrams ON contacts USING GIN (email_trigrams);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
2. **Ingestion Pipeline**:
|
|
235
|
+
- Normalize plaintext (`NFKC` + lowercase).
|
|
236
|
+
- Generate exact blind index token via `CKeyManager.computeBlindIndex(plain, hmacKey)` or `searchIndex.computeToken(plain)`.
|
|
237
|
+
- Extract 3-character slices via `extractTrigrams(plain)` and hash each trigram with `searchIndex.computeTrigramTokens(plain)`.
|
|
238
|
+
- Encrypt sensitive columns with `cipher.encryptField(plain, { recordId: id, fieldName: 'name' })`.
|
|
239
|
+
- Persist encrypted envelopes and token arrays into the persistence datatable storage.
|
|
240
|
+
|
|
241
|
+
3. **Query Execution**:
|
|
242
|
+
- **Exact Match (`name = $1`)**:
|
|
243
|
+
```sql
|
|
244
|
+
-- Compute HMAC token in API, then point-lookup using B-Tree:
|
|
245
|
+
SELECT id, name_encrypted, email_encrypted, role FROM contacts WHERE name_bidx = $1;
|
|
246
|
+
```
|
|
247
|
+
- **Substring Search (`name CONTAINS $1`)**:
|
|
248
|
+
```sql
|
|
249
|
+
-- Extract & hash search query trigrams, then query via array containment operator (@>):
|
|
250
|
+
SELECT id, name_encrypted, email_encrypted, role
|
|
251
|
+
FROM contacts
|
|
252
|
+
WHERE name_trigrams @> $1::text[]
|
|
253
|
+
ORDER BY id ASC
|
|
254
|
+
LIMIT 10 OFFSET 0;
|
|
255
|
+
```
|
|
256
|
+
- **Compound Filtering**:
|
|
257
|
+
Combine plain columns with encrypted token clauses:
|
|
258
|
+
```sql
|
|
259
|
+
WHERE name_trigrams @> $1::text[] AND department = 'Security'
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
4. **Security & Production Best Practices**:
|
|
263
|
+
- **Strict Key Isolation**: Isolate `DATA_ENCRYPTION_KEY` (AES-256-GCM) from `BLIND_INDEX_HMAC_KEY`. Persistence storage compromise cannot decrypt plaintext; cipher key exposure cannot reverse blind indices.
|
|
264
|
+
- **Short Queries (< 3 chars)**: Substring search requires at least 3 characters to form a valid trigram. Enforce a 3-character minimum in client UI.
|
|
265
|
+
- **Low-Cardinality Isolation**: Never blind index low-cardinality fields (boolean flags, binary status) to avoid frequency analysis leakage.
|
|
266
|
+
- **Client Decryption Pipeline**: API responses return encrypted envelopes (`__encrypted: true`). Frontend `CAPIFlatServerDataProvider` decrypts only the received page slice via `decryptPageRows()` on arrival.
|
|
267
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@katlux/toolkit",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.140",
|
|
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.
|
|
57
|
+
"@katlux/providers": "^0.1.1-alpha.128",
|
|
58
58
|
"@nuxt/kit": "^3.12.0",
|
|
59
59
|
"@nuxtjs/i18n": "^10.4.0",
|
|
60
60
|
"pug": "^3.0.0",
|