@ram_28/kf-ai-sdk 1.0.11 → 1.0.13
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/README.md +55 -48
- package/dist/api/client.d.ts +14 -14
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/datetime.d.ts +5 -5
- package/dist/api/datetime.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/metadata.d.ts +2 -2
- package/dist/api/metadata.d.ts.map +1 -1
- package/dist/api.cjs +1 -0
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.mjs +27 -0
- package/dist/api.types.cjs +1 -0
- package/dist/api.types.d.ts +4 -0
- package/dist/api.types.d.ts.map +1 -0
- package/dist/api.types.mjs +1 -0
- package/dist/auth/AuthProvider.d.ts +3 -3
- package/dist/auth/AuthProvider.d.ts.map +1 -1
- package/dist/auth/authClient.d.ts +4 -4
- package/dist/auth/authClient.d.ts.map +1 -1
- package/dist/auth/authConfig.d.ts +5 -5
- package/dist/auth/authConfig.d.ts.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/types.d.ts +21 -21
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/useAuth.d.ts +2 -2
- package/dist/auth/useAuth.d.ts.map +1 -1
- package/dist/auth.cjs +1 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.mjs +280 -0
- package/dist/auth.types.cjs +1 -0
- package/dist/auth.types.d.ts +2 -0
- package/dist/auth.types.d.ts.map +1 -0
- package/dist/auth.types.mjs +1 -0
- package/dist/base-types.d.ts +2 -0
- package/dist/base-types.d.ts.map +1 -0
- package/dist/client-C15j4O5B.cjs +1 -0
- package/dist/client-CfvLiGfP.js +233 -0
- package/dist/cn-Dr87sK3i.js +2775 -0
- package/dist/cn-mXUIg4vp.cjs +1 -0
- package/dist/components/hooks/index.d.ts +3 -3
- package/dist/components/hooks/index.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/index.d.ts +2 -2
- package/dist/components/hooks/useFilter/index.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/types.d.ts +19 -31
- package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/useFilter.d.ts +2 -2
- package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
- package/dist/components/hooks/useForm/apiClient.d.ts +6 -6
- package/dist/components/hooks/useForm/apiClient.d.ts.map +1 -1
- package/dist/components/hooks/useForm/expressionValidator.utils.d.ts +7 -7
- package/dist/components/hooks/useForm/expressionValidator.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/index.d.ts +5 -5
- package/dist/components/hooks/useForm/index.d.ts.map +1 -1
- package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts +10 -10
- package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts +7 -12
- package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/schemaParser.utils.d.ts +7 -7
- package/dist/components/hooks/useForm/schemaParser.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/types.d.ts +67 -76
- package/dist/components/hooks/useForm/types.d.ts.map +1 -1
- package/dist/components/hooks/useForm/useForm.d.ts +2 -2
- package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/apiClient.d.ts +16 -16
- package/dist/components/hooks/useKanban/apiClient.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/context.d.ts +3 -3
- package/dist/components/hooks/useKanban/context.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/dragDropManager.d.ts +7 -7
- package/dist/components/hooks/useKanban/dragDropManager.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/index.d.ts +1 -1
- package/dist/components/hooks/useKanban/index.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/types.d.ts +65 -67
- package/dist/components/hooks/useKanban/types.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/useKanban.d.ts +2 -2
- package/dist/components/hooks/useKanban/useKanban.d.ts.map +1 -1
- package/dist/components/hooks/useTable/index.d.ts +1 -1
- package/dist/components/hooks/useTable/index.d.ts.map +1 -1
- package/dist/components/hooks/useTable/types.d.ts +10 -10
- package/dist/components/hooks/useTable/types.d.ts.map +1 -1
- package/dist/components/hooks/useTable/useTable.d.ts +2 -2
- package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
- package/dist/filter.cjs +1 -0
- package/dist/filter.d.ts +3 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.mjs +6 -0
- package/dist/filter.types.cjs +1 -0
- package/dist/filter.types.d.ts +2 -0
- package/dist/filter.types.d.ts.map +1 -0
- package/dist/filter.types.mjs +1 -0
- package/dist/form.cjs +1 -0
- package/dist/form.d.ts +3 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.mjs +2355 -0
- package/dist/form.types.cjs +1 -0
- package/dist/form.types.d.ts +2 -0
- package/dist/form.types.d.ts.map +1 -0
- package/dist/form.types.mjs +1 -0
- package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
- package/dist/jsx-runtime-DGlMoOmv.js +630 -0
- package/dist/kanban.cjs +13 -0
- package/dist/kanban.d.ts +5 -0
- package/dist/kanban.d.ts.map +1 -0
- package/dist/kanban.mjs +1060 -0
- package/dist/kanban.types.cjs +1 -0
- package/dist/kanban.types.d.ts +2 -0
- package/dist/kanban.types.d.ts.map +1 -0
- package/dist/kanban.types.mjs +1 -0
- package/dist/kanban.ui.cjs +1 -0
- package/dist/kanban.ui.d.ts +2 -0
- package/dist/kanban.ui.d.ts.map +1 -0
- package/dist/kanban.ui.mjs +104 -0
- package/dist/metadata-2FLBsFcf.cjs +1 -0
- package/dist/metadata-DBcoDth-.js +43 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.mjs +148 -0
- package/dist/table.types.cjs +1 -0
- package/dist/table.types.d.ts +2 -0
- package/dist/table.types.d.ts.map +1 -0
- package/dist/table.types.mjs +1 -0
- package/dist/types/base-fields.d.ts +45 -45
- package/dist/types/base-fields.d.ts.map +1 -1
- package/dist/types/common.d.ts +45 -61
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types.cjs +1 -0
- package/dist/types.mjs +1 -0
- package/dist/useFilter-CXFqEHyI.js +129 -0
- package/dist/useFilter-D-bCDo6Z.cjs +1 -0
- package/dist/useQuery-BScHEo7x.cjs +1 -0
- package/dist/useQuery-KpZFg80c.js +748 -0
- package/dist/utils/formatting.d.ts +4 -4
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils.cjs +4 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.mjs +105 -0
- package/package.json +147 -9
- package/sdk/api/client.ts +51 -51
- package/sdk/api/datetime.ts +5 -5
- package/sdk/api/index.ts +28 -33
- package/sdk/api/metadata.ts +4 -4
- package/sdk/api.ts +24 -0
- package/sdk/api.types.ts +58 -0
- package/sdk/auth/AuthProvider.tsx +18 -18
- package/sdk/auth/authClient.ts +9 -9
- package/sdk/auth/authConfig.ts +9 -9
- package/sdk/auth/index.ts +5 -5
- package/sdk/auth/types.ts +21 -21
- package/sdk/auth/useAuth.ts +2 -2
- package/sdk/auth.ts +22 -0
- package/sdk/auth.types.ts +28 -0
- package/sdk/base-types.ts +45 -0
- package/sdk/components/hooks/index.ts +22 -22
- package/sdk/components/hooks/useFilter/index.ts +8 -14
- package/sdk/components/hooks/useFilter/types.ts +29 -58
- package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
- package/sdk/components/hooks/useForm/apiClient.ts +8 -8
- package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
- package/sdk/components/hooks/useForm/index.ts +24 -24
- package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
- package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
- package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
- package/sdk/components/hooks/useForm/types.ts +66 -82
- package/sdk/components/hooks/useForm/useForm.ts +15 -21
- package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
- package/sdk/components/hooks/useKanban/context.ts +3 -3
- package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
- package/sdk/components/hooks/useKanban/index.ts +26 -26
- package/sdk/components/hooks/useKanban/types.ts +69 -71
- package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
- package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
- package/sdk/components/hooks/useTable/index.ts +5 -1
- package/sdk/components/hooks/useTable/types.ts +10 -10
- package/sdk/components/hooks/useTable/useTable.ts +10 -10
- package/sdk/filter.ts +13 -0
- package/sdk/filter.types.ts +17 -0
- package/sdk/form.ts +15 -0
- package/sdk/form.types.ts +46 -0
- package/sdk/kanban.ts +23 -0
- package/sdk/kanban.types.ts +50 -0
- package/sdk/kanban.ui.ts +16 -0
- package/sdk/table.ts +7 -0
- package/sdk/table.types.ts +13 -0
- package/sdk/types/base-fields.ts +47 -47
- package/sdk/types/common.ts +47 -71
- package/sdk/types/index.ts +1 -1
- package/sdk/utils/formatting.ts +4 -4
- package/sdk/utils.ts +10 -0
- package/dist/index.cjs +0 -45
- package/dist/index.mjs +0 -6387
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// Core TypeScript interfaces for the kanban board functionality
|
|
5
5
|
// Following patterns from useTable and useForm
|
|
6
6
|
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
7
|
+
import type { ConditionType, ConditionGroupType, UseFilterReturnType } from "../useFilter";
|
|
8
|
+
import type { ConditionGroupOperatorType } from "../../../types/common";
|
|
9
9
|
|
|
10
10
|
// ============================================================
|
|
11
11
|
// CORE DATA STRUCTURES
|
|
@@ -15,7 +15,7 @@ import type { ConditionGroupOperator } from "../../../types/common";
|
|
|
15
15
|
* Static column configuration (no CRUD operations)
|
|
16
16
|
* Columns are defined once in the hook configuration
|
|
17
17
|
*/
|
|
18
|
-
export interface
|
|
18
|
+
export interface ColumnConfigType {
|
|
19
19
|
/** Unique column identifier */
|
|
20
20
|
id: string;
|
|
21
21
|
/** Display title */
|
|
@@ -32,7 +32,7 @@ export interface ColumnConfig {
|
|
|
32
32
|
* Base kanban card interface
|
|
33
33
|
* @template T - Custom fields for the card
|
|
34
34
|
*/
|
|
35
|
-
export type
|
|
35
|
+
export type KanbanCardType<T = Record<string, any>> = {
|
|
36
36
|
/** Unique identifier */
|
|
37
37
|
_id: string;
|
|
38
38
|
/** Card title */
|
|
@@ -50,12 +50,12 @@ export type KanbanCard<T = Record<string, any>> = {
|
|
|
50
50
|
/**
|
|
51
51
|
* Kanban card with custom fields
|
|
52
52
|
*/
|
|
53
|
-
export type
|
|
53
|
+
export type KanbanCardWithDataType<T> = KanbanCardType<Record<string, never>> & T;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Base kanban card without custom fields
|
|
57
57
|
*/
|
|
58
|
-
export interface
|
|
58
|
+
export interface BaseKanbanCardType {
|
|
59
59
|
/** Unique identifier */
|
|
60
60
|
_id: string;
|
|
61
61
|
/** Card title */
|
|
@@ -74,7 +74,7 @@ export interface BaseKanbanCard {
|
|
|
74
74
|
* Kanban column interface
|
|
75
75
|
* @template T - Custom fields for cards in this column
|
|
76
76
|
*/
|
|
77
|
-
export interface
|
|
77
|
+
export interface KanbanColumnType<T = Record<string, any>> {
|
|
78
78
|
/** Unique identifier */
|
|
79
79
|
_id: string;
|
|
80
80
|
/** Column title */
|
|
@@ -82,7 +82,7 @@ export interface KanbanColumn<T = Record<string, any>> {
|
|
|
82
82
|
/** Position among columns (0-indexed) */
|
|
83
83
|
position: number;
|
|
84
84
|
/** Cards in this column */
|
|
85
|
-
cards:
|
|
85
|
+
cards: KanbanCardType<T>[];
|
|
86
86
|
/** Optional color for the column header */
|
|
87
87
|
color?: string;
|
|
88
88
|
/** Optional limit on number of cards (WIP limit) */
|
|
@@ -99,7 +99,7 @@ export interface KanbanColumn<T = Record<string, any>> {
|
|
|
99
99
|
* Column definition for display and behavior
|
|
100
100
|
* Similar to ColumnDefinition in useTable
|
|
101
101
|
*/
|
|
102
|
-
export interface
|
|
102
|
+
export interface ColumnDefinitionType<T> {
|
|
103
103
|
/** Field name from the card type */
|
|
104
104
|
fieldId: keyof T;
|
|
105
105
|
/** Display label (optional, defaults to fieldId) */
|
|
@@ -119,11 +119,11 @@ export interface ColumnDefinition<T> {
|
|
|
119
119
|
/**
|
|
120
120
|
* Drag and drop state management
|
|
121
121
|
*/
|
|
122
|
-
export interface
|
|
122
|
+
export interface DragDropStateType<T> {
|
|
123
123
|
/** Whether a drag operation is in progress */
|
|
124
124
|
isDragging: boolean;
|
|
125
125
|
/** The card currently being dragged */
|
|
126
|
-
draggedCard:
|
|
126
|
+
draggedCard: KanbanCardType<T> | null;
|
|
127
127
|
/** The column currently being hovered over */
|
|
128
128
|
dragOverColumn: string | null;
|
|
129
129
|
/** The position within the column being hovered over */
|
|
@@ -135,9 +135,9 @@ export interface DragDropState<T> {
|
|
|
135
135
|
/**
|
|
136
136
|
* Drag event handlers
|
|
137
137
|
*/
|
|
138
|
-
export interface
|
|
138
|
+
export interface DragDropHandlersType<T> {
|
|
139
139
|
/** Handle drag start event */
|
|
140
|
-
handleDragStart: (event: DragEvent, card:
|
|
140
|
+
handleDragStart: (event: DragEvent, card: KanbanCardType<T>) => void;
|
|
141
141
|
/** Handle drag over event */
|
|
142
142
|
handleDragOver: (event: DragEvent, columnId?: string) => void;
|
|
143
143
|
/** Handle drop event */
|
|
@@ -145,9 +145,9 @@ export interface DragDropHandlers<T> {
|
|
|
145
145
|
/** Handle drag end event */
|
|
146
146
|
handleDragEnd: () => void;
|
|
147
147
|
/** Handle keyboard navigation */
|
|
148
|
-
handleKeyDown: (event: KeyboardEvent, card:
|
|
148
|
+
handleKeyDown: (event: KeyboardEvent, card: KanbanCardType<T>) => void;
|
|
149
149
|
/** Handle touch start for mobile */
|
|
150
|
-
handleTouchStart: (event: TouchEvent, card:
|
|
150
|
+
handleTouchStart: (event: TouchEvent, card: KanbanCardType<T>) => void;
|
|
151
151
|
/** Handle touch move for mobile */
|
|
152
152
|
handleTouchMove: (event: TouchEvent) => void;
|
|
153
153
|
/** Handle touch end for mobile */
|
|
@@ -157,12 +157,12 @@ export interface DragDropHandlers<T> {
|
|
|
157
157
|
/**
|
|
158
158
|
* Combined drag and drop interface
|
|
159
159
|
*/
|
|
160
|
-
export interface
|
|
161
|
-
extends
|
|
162
|
-
|
|
160
|
+
export interface DragDropManagerType<T>
|
|
161
|
+
extends DragDropStateType<T>,
|
|
162
|
+
DragDropHandlersType<T> {
|
|
163
163
|
/** Announce moves for accessibility */
|
|
164
164
|
announceMove: (
|
|
165
|
-
card:
|
|
165
|
+
card: KanbanCardType<T>,
|
|
166
166
|
fromColumn: string,
|
|
167
167
|
toColumn: string
|
|
168
168
|
) => void;
|
|
@@ -177,14 +177,12 @@ export interface DragDropManager<T>
|
|
|
177
177
|
/**
|
|
178
178
|
* Configuration options for the useKanban hook
|
|
179
179
|
*/
|
|
180
|
-
export interface
|
|
180
|
+
export interface UseKanbanOptionsType<T> {
|
|
181
181
|
/** Card data source identifier */
|
|
182
|
-
|
|
183
|
-
/** Card data source identifier (alias for cardSource) */
|
|
184
|
-
source?: string;
|
|
182
|
+
source: string;
|
|
185
183
|
|
|
186
184
|
/** Static column definitions (required) */
|
|
187
|
-
columns:
|
|
185
|
+
columns: ColumnConfigType[];
|
|
188
186
|
|
|
189
187
|
/** Enable drag and drop functionality */
|
|
190
188
|
enableDragDrop?: boolean;
|
|
@@ -198,9 +196,9 @@ export interface UseKanbanOptions<T> {
|
|
|
198
196
|
/** Initial state */
|
|
199
197
|
initialState?: {
|
|
200
198
|
/** Initial filter conditions */
|
|
201
|
-
filters?: Array<
|
|
199
|
+
filters?: Array<ConditionType | ConditionGroupType>;
|
|
202
200
|
/** Initial filter operator for combining filter conditions */
|
|
203
|
-
filterOperator?:
|
|
201
|
+
filterOperator?: ConditionGroupOperatorType;
|
|
204
202
|
/** Initial search query */
|
|
205
203
|
search?: string;
|
|
206
204
|
/** Initial column order */
|
|
@@ -214,12 +212,12 @@ export interface UseKanbanOptions<T> {
|
|
|
214
212
|
|
|
215
213
|
/** Event callbacks */
|
|
216
214
|
onCardMove?: (
|
|
217
|
-
card:
|
|
215
|
+
card: KanbanCardType<T>,
|
|
218
216
|
fromColumnId: string,
|
|
219
217
|
toColumnId: string
|
|
220
218
|
) => void;
|
|
221
|
-
onCardCreate?: (card:
|
|
222
|
-
onCardUpdate?: (card:
|
|
219
|
+
onCardCreate?: (card: KanbanCardType<T>) => void;
|
|
220
|
+
onCardUpdate?: (card: KanbanCardType<T>) => void;
|
|
223
221
|
onCardDelete?: (cardId: string) => void;
|
|
224
222
|
onSuccess?: (data: any) => void;
|
|
225
223
|
onError?: (error: Error) => void;
|
|
@@ -232,13 +230,13 @@ export interface UseKanbanOptions<T> {
|
|
|
232
230
|
/**
|
|
233
231
|
* Card operations interface
|
|
234
232
|
*/
|
|
235
|
-
export interface
|
|
233
|
+
export interface CardOperationsType<T> {
|
|
236
234
|
/** Create a new card */
|
|
237
235
|
create: (
|
|
238
|
-
card: Partial<
|
|
236
|
+
card: Partial<KanbanCardType<T>> & { columnId: string }
|
|
239
237
|
) => Promise<string>;
|
|
240
238
|
/** Update an existing card */
|
|
241
|
-
update: (id: string, updates: Partial<
|
|
239
|
+
update: (id: string, updates: Partial<KanbanCardType<T>>) => Promise<void>;
|
|
242
240
|
/** Delete a card */
|
|
243
241
|
delete: (id: string) => Promise<void>;
|
|
244
242
|
/** Move a card to a different column */
|
|
@@ -255,7 +253,7 @@ export interface CardOperations<T> {
|
|
|
255
253
|
/**
|
|
256
254
|
* Search functionality interface
|
|
257
255
|
*/
|
|
258
|
-
export interface
|
|
256
|
+
export interface SearchOperationsType {
|
|
259
257
|
/** Current search query */
|
|
260
258
|
query: string;
|
|
261
259
|
/** Set search query */
|
|
@@ -268,13 +266,13 @@ export interface SearchOperations {
|
|
|
268
266
|
* Main return interface for useKanban hook
|
|
269
267
|
* Follows useTable pattern with flat access
|
|
270
268
|
*/
|
|
271
|
-
export interface
|
|
269
|
+
export interface UseKanbanReturnType<T> {
|
|
272
270
|
// ============================================================
|
|
273
271
|
// DATA
|
|
274
272
|
// ============================================================
|
|
275
273
|
|
|
276
274
|
/** All columns with their cards */
|
|
277
|
-
columns:
|
|
275
|
+
columns: KanbanColumnType<T>[];
|
|
278
276
|
/** Total number of cards across all columns */
|
|
279
277
|
totalCards: number;
|
|
280
278
|
|
|
@@ -302,10 +300,10 @@ export interface UseKanbanReturn<T> {
|
|
|
302
300
|
|
|
303
301
|
/** Create a new card */
|
|
304
302
|
createCard: (
|
|
305
|
-
card: Partial<
|
|
303
|
+
card: Partial<KanbanCardType<T>> & { columnId: string }
|
|
306
304
|
) => Promise<string>;
|
|
307
305
|
/** Update an existing card */
|
|
308
|
-
updateCard: (id: string, updates: Partial<
|
|
306
|
+
updateCard: (id: string, updates: Partial<KanbanCardType<T>>) => Promise<void>;
|
|
309
307
|
/** Delete a card */
|
|
310
308
|
deleteCard: (id: string) => Promise<void>;
|
|
311
309
|
/** Move a card to a different column */
|
|
@@ -334,7 +332,7 @@ export interface UseKanbanReturn<T> {
|
|
|
334
332
|
// ============================================================
|
|
335
333
|
|
|
336
334
|
/** Filter functionality */
|
|
337
|
-
filter:
|
|
335
|
+
filter: UseFilterReturnType;
|
|
338
336
|
|
|
339
337
|
// ============================================================
|
|
340
338
|
// DRAG DROP (Flat Access)
|
|
@@ -343,11 +341,11 @@ export interface UseKanbanReturn<T> {
|
|
|
343
341
|
/** Whether a drag operation is in progress */
|
|
344
342
|
isDragging: boolean;
|
|
345
343
|
/** The card currently being dragged */
|
|
346
|
-
draggedCard:
|
|
344
|
+
draggedCard: KanbanCardType<T> | null;
|
|
347
345
|
/** The column currently being hovered over during drag */
|
|
348
346
|
dragOverColumn: string | null;
|
|
349
347
|
/** Handle drag start event */
|
|
350
|
-
handleDragStart: (event: DragEvent, card:
|
|
348
|
+
handleDragStart: (event: DragEvent, card: KanbanCardType<T>) => void;
|
|
351
349
|
/** Handle drag over event */
|
|
352
350
|
handleDragOver: (event: DragEvent, columnId?: string) => void;
|
|
353
351
|
/** Handle drop event */
|
|
@@ -355,7 +353,7 @@ export interface UseKanbanReturn<T> {
|
|
|
355
353
|
/** Handle drag end event */
|
|
356
354
|
handleDragEnd: () => void;
|
|
357
355
|
/** Handle keyboard navigation */
|
|
358
|
-
handleKeyDown: (event: KeyboardEvent, card:
|
|
356
|
+
handleKeyDown: (event: KeyboardEvent, card: KanbanCardType<T>) => void;
|
|
359
357
|
|
|
360
358
|
// ============================================================
|
|
361
359
|
// PROP GETTERS
|
|
@@ -364,7 +362,7 @@ export interface UseKanbanReturn<T> {
|
|
|
364
362
|
/**
|
|
365
363
|
* Get props for a draggable card
|
|
366
364
|
*/
|
|
367
|
-
getCardProps: (card:
|
|
365
|
+
getCardProps: (card: KanbanCardType<T>) => {
|
|
368
366
|
draggable: boolean;
|
|
369
367
|
role: string;
|
|
370
368
|
"aria-selected": boolean;
|
|
@@ -404,21 +402,21 @@ export interface UseKanbanReturn<T> {
|
|
|
404
402
|
/**
|
|
405
403
|
* API response for card operations
|
|
406
404
|
*/
|
|
407
|
-
export interface
|
|
408
|
-
Data:
|
|
405
|
+
export interface CardApiResponseType<T> {
|
|
406
|
+
Data: KanbanCardType<T>[];
|
|
409
407
|
}
|
|
410
408
|
|
|
411
409
|
/**
|
|
412
410
|
* API response for column operations
|
|
413
411
|
*/
|
|
414
|
-
export interface
|
|
415
|
-
Data:
|
|
412
|
+
export interface ColumnApiResponseType<T> {
|
|
413
|
+
Data: KanbanColumnType<T>[];
|
|
416
414
|
}
|
|
417
415
|
|
|
418
416
|
/**
|
|
419
417
|
* Request payload for moving a card
|
|
420
418
|
*/
|
|
421
|
-
export interface
|
|
419
|
+
export interface MoveCardRequestType {
|
|
422
420
|
cardId: string;
|
|
423
421
|
toColumnId: string;
|
|
424
422
|
position?: number;
|
|
@@ -427,7 +425,7 @@ export interface MoveCardRequest {
|
|
|
427
425
|
/**
|
|
428
426
|
* Request payload for reordering items
|
|
429
427
|
*/
|
|
430
|
-
export interface
|
|
428
|
+
export interface ReorderRequestType {
|
|
431
429
|
itemIds: string[];
|
|
432
430
|
containerId?: string;
|
|
433
431
|
}
|
|
@@ -435,20 +433,20 @@ export interface ReorderRequest {
|
|
|
435
433
|
/**
|
|
436
434
|
* Bulk card update request
|
|
437
435
|
*/
|
|
438
|
-
export interface
|
|
436
|
+
export interface BulkCardUpdateRequestType<T> {
|
|
439
437
|
updates: Array<{
|
|
440
438
|
cardId: string;
|
|
441
|
-
data: Partial<
|
|
439
|
+
data: Partial<KanbanCardType<T>>;
|
|
442
440
|
}>;
|
|
443
441
|
}
|
|
444
442
|
|
|
445
443
|
/**
|
|
446
444
|
* Bulk column update request
|
|
447
445
|
*/
|
|
448
|
-
export interface
|
|
446
|
+
export interface BulkColumnUpdateRequestType<T> {
|
|
449
447
|
updates: Array<{
|
|
450
448
|
columnId: string;
|
|
451
|
-
data: Partial<
|
|
449
|
+
data: Partial<KanbanColumnType<T>>;
|
|
452
450
|
}>;
|
|
453
451
|
}
|
|
454
452
|
|
|
@@ -459,7 +457,7 @@ export interface BulkColumnUpdateRequest<T> {
|
|
|
459
457
|
/**
|
|
460
458
|
* Validation result interface
|
|
461
459
|
*/
|
|
462
|
-
export interface
|
|
460
|
+
export interface ValidationResultType {
|
|
463
461
|
isValid: boolean;
|
|
464
462
|
message?: string;
|
|
465
463
|
errors?: Array<{
|
|
@@ -471,18 +469,18 @@ export interface ValidationResult {
|
|
|
471
469
|
/**
|
|
472
470
|
* Card validation context
|
|
473
471
|
*/
|
|
474
|
-
export interface
|
|
475
|
-
card: Partial<
|
|
476
|
-
column?:
|
|
477
|
-
allColumns:
|
|
472
|
+
export interface CardValidationContextType<T> {
|
|
473
|
+
card: Partial<KanbanCardType<T>>;
|
|
474
|
+
column?: KanbanColumnType<T>;
|
|
475
|
+
allColumns: KanbanColumnType<T>[];
|
|
478
476
|
}
|
|
479
477
|
|
|
480
478
|
/**
|
|
481
479
|
* Column validation context
|
|
482
480
|
*/
|
|
483
|
-
export interface
|
|
484
|
-
column: Partial<
|
|
485
|
-
allColumns:
|
|
481
|
+
export interface ColumnValidationContextType<T> {
|
|
482
|
+
column: Partial<KanbanColumnType<T>>;
|
|
483
|
+
allColumns: KanbanColumnType<T>[];
|
|
486
484
|
}
|
|
487
485
|
|
|
488
486
|
// ============================================================
|
|
@@ -492,7 +490,7 @@ export interface ColumnValidationContext<T> {
|
|
|
492
490
|
/**
|
|
493
491
|
* Kanban event types for callbacks
|
|
494
492
|
*/
|
|
495
|
-
export type
|
|
493
|
+
export type KanbanEventTypeType =
|
|
496
494
|
| "card-created"
|
|
497
495
|
| "card-updated"
|
|
498
496
|
| "card-deleted"
|
|
@@ -502,12 +500,12 @@ export type KanbanEventType =
|
|
|
502
500
|
/**
|
|
503
501
|
* Kanban event data
|
|
504
502
|
*/
|
|
505
|
-
export interface
|
|
506
|
-
type:
|
|
503
|
+
export interface KanbanEventType<T> {
|
|
504
|
+
type: KanbanEventTypeType;
|
|
507
505
|
timestamp: Date;
|
|
508
506
|
data: any;
|
|
509
|
-
card?:
|
|
510
|
-
column?:
|
|
507
|
+
card?: KanbanCardType<T>;
|
|
508
|
+
column?: KanbanColumnType<T>;
|
|
511
509
|
fromColumnId?: string;
|
|
512
510
|
toColumnId?: string;
|
|
513
511
|
}
|
|
@@ -519,25 +517,25 @@ export interface KanbanEvent<T> {
|
|
|
519
517
|
/**
|
|
520
518
|
* Utility type for extracting card type from column
|
|
521
519
|
*/
|
|
522
|
-
export type
|
|
520
|
+
export type ExtractCardTypeType<C> = C extends KanbanColumnType<infer T> ? T : never;
|
|
523
521
|
|
|
524
522
|
/**
|
|
525
523
|
* Utility type for making certain fields optional
|
|
526
524
|
*/
|
|
527
|
-
export type
|
|
525
|
+
export type PartialByType<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
528
526
|
|
|
529
527
|
/**
|
|
530
528
|
* Utility type for card creation (auto-generated fields optional)
|
|
531
529
|
*/
|
|
532
|
-
export type
|
|
533
|
-
|
|
530
|
+
export type CreateCardInputType<T> = PartialByType<
|
|
531
|
+
KanbanCardType<T>,
|
|
534
532
|
"_id" | "position" | "_created_at" | "_modified_at"
|
|
535
533
|
>;
|
|
536
534
|
|
|
537
535
|
/**
|
|
538
536
|
* Utility type for column creation (auto-generated fields optional)
|
|
539
537
|
*/
|
|
540
|
-
export type
|
|
541
|
-
|
|
538
|
+
export type CreateColumnInputType<T> = PartialByType<
|
|
539
|
+
KanbanColumnType<T>,
|
|
542
540
|
"_id" | "position" | "cards" | "_created_at" | "_modified_at"
|
|
543
541
|
>;
|