kanbase 0.0.1 → 0.0.3
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 +1 -1
- package/assets/kanbase.png +0 -0
- package/dist/index.d.ts +347 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,347 @@
|
|
|
1
|
-
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { StoreApi } from 'zustand';
|
|
3
|
+
import { UseBoundStore } from 'zustand';
|
|
4
|
+
|
|
5
|
+
export declare interface AddCardRenderProps<TCard = KanboomCard> {
|
|
6
|
+
columnId: string;
|
|
7
|
+
onAdd: (data: Omit<TCard, 'id'>) => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare interface AddColumnRenderProps<TColumn = KanboomColumn> {
|
|
12
|
+
onAdd: (data: Omit<TColumn, 'id' | 'cardIds'>) => void;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare const BenchmarkStats: ({ cardCount, columnCount }: BenchmarkStatsProps) => JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare interface BenchmarkStatsProps {
|
|
19
|
+
cardCount: number;
|
|
20
|
+
columnCount: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare interface CardRenderProps<TCard = KanboomCard> {
|
|
24
|
+
card: TCard;
|
|
25
|
+
isDragging: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare interface ColumnEmptyRenderProps {
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface ColumnHeaderRenderProps<TColumn = KanboomColumn> {
|
|
32
|
+
column: TColumn;
|
|
33
|
+
cardCount: number;
|
|
34
|
+
isOver: boolean;
|
|
35
|
+
dragHandleProps?: {
|
|
36
|
+
attributes: any;
|
|
37
|
+
listeners: any;
|
|
38
|
+
};
|
|
39
|
+
onAddCard?: () => void;
|
|
40
|
+
onEditColumn?: () => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare interface DiscoveredField {
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
type: 'text' | 'number' | 'boolean' | 'other';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export declare function discoverFields(cards: Record<string, KanboomCard>): DiscoveredField[];
|
|
50
|
+
|
|
51
|
+
export declare interface EditCardRenderProps<TCard = KanboomCard> {
|
|
52
|
+
card: TCard;
|
|
53
|
+
onSave: (updates: Partial<TCard>) => void;
|
|
54
|
+
onCancel: () => void;
|
|
55
|
+
onDelete?: () => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export declare interface EditColumnRenderProps<TColumn = KanboomColumn> {
|
|
59
|
+
column: TColumn;
|
|
60
|
+
onSave: (updates: Partial<TColumn>) => void;
|
|
61
|
+
onCancel: () => void;
|
|
62
|
+
onDelete?: () => void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare function evaluateFilter(card: KanboomCard, filters: {
|
|
66
|
+
searchQuery: string;
|
|
67
|
+
groups: FilterGroup[];
|
|
68
|
+
}): boolean;
|
|
69
|
+
|
|
70
|
+
export declare interface FilterDefinition {
|
|
71
|
+
field: string;
|
|
72
|
+
label: string;
|
|
73
|
+
type: 'text' | 'number' | 'date' | 'select' | 'boolean';
|
|
74
|
+
options?: {
|
|
75
|
+
label: string;
|
|
76
|
+
value: any;
|
|
77
|
+
}[];
|
|
78
|
+
getFieldValue?: (card: any) => any;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export declare interface FilterGroup {
|
|
82
|
+
id: string;
|
|
83
|
+
conjunction: 'and' | 'or';
|
|
84
|
+
rules: (FilterRule | FilterGroup)[];
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export declare type FilterOperator = 'eq' | 'neq' | 'contains' | 'notContains' | 'in' | 'notIn' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'isEmpty' | 'isNotEmpty';
|
|
89
|
+
|
|
90
|
+
export declare interface FilterRule {
|
|
91
|
+
id: string;
|
|
92
|
+
field: string;
|
|
93
|
+
operator: FilterOperator;
|
|
94
|
+
value: any;
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
type?: 'text' | 'number' | 'date' | 'select' | 'boolean';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export declare interface KanbanFilters {
|
|
100
|
+
searchQuery: string;
|
|
101
|
+
groups: FilterGroup[];
|
|
102
|
+
quickFilters: string[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare interface KanbanStore extends KanboomData {
|
|
106
|
+
config: KanboomConfig;
|
|
107
|
+
activeId: string | null;
|
|
108
|
+
viewingCardId: string | null;
|
|
109
|
+
editingCardId: string | null;
|
|
110
|
+
addingCardInColumnId: string | null;
|
|
111
|
+
editingColumnId: string | null;
|
|
112
|
+
addCard: (columnId: string, card: Omit<KanboomCard, 'id'>) => string;
|
|
113
|
+
updateCard: (cardId: string, updates: Partial<KanboomCard>) => void;
|
|
114
|
+
deleteCard: (cardId: string) => void;
|
|
115
|
+
duplicateCard: (cardId: string) => string;
|
|
116
|
+
addColumn: (column: Omit<KanboomColumn, 'id' | 'cardIds'>, position?: number) => string;
|
|
117
|
+
updateColumn: (columnId: string, updates: Partial<KanboomColumn>) => void;
|
|
118
|
+
deleteColumn: (columnId: string, moveCardsTo?: string) => void;
|
|
119
|
+
moveCard: (cardId: string, sourceColId: string, targetColId: string, newIndex: number) => void;
|
|
120
|
+
moveColumn: (columnId: string, newIndex: number) => void;
|
|
121
|
+
addColumnWithCard: (cardId: string, sourceColId: string, columnData: Omit<KanboomColumn, 'id' | 'cardIds'>) => void;
|
|
122
|
+
filters: KanbanFilters;
|
|
123
|
+
setSearchQuery: (query: string) => void;
|
|
124
|
+
addFilterGroup: (group: FilterGroup) => void;
|
|
125
|
+
updateFilterGroup: (groupId: string, updates: Partial<FilterGroup>) => void;
|
|
126
|
+
removeFilterGroup: (groupId: string) => void;
|
|
127
|
+
removeFilterRule: (groupId: string, ruleId: string) => void;
|
|
128
|
+
setFilters: (filters: KanbanFilters) => void;
|
|
129
|
+
clearFilters: () => void;
|
|
130
|
+
setBoardData: (data: KanboomData) => void;
|
|
131
|
+
setConfig: (config: Partial<KanboomConfig>) => void;
|
|
132
|
+
setActiveId: (id: string | null) => void;
|
|
133
|
+
setViewingCardId: (id: string | null) => void;
|
|
134
|
+
clearViewingCardId: () => void;
|
|
135
|
+
setEditingCardId: (id: string | null) => void;
|
|
136
|
+
clearEditingCardId: () => void;
|
|
137
|
+
setAddingCardInColumnId: (id: string | null) => void;
|
|
138
|
+
clearAddingCardInColumnId: () => void;
|
|
139
|
+
setEditingColumnId: (id: string | null) => void;
|
|
140
|
+
clearEditingColumnId: () => void;
|
|
141
|
+
clearBoard: () => void;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare function KanboomBoard<TCard extends {
|
|
145
|
+
id: string;
|
|
146
|
+
} = KanboomCard, TColumn extends {
|
|
147
|
+
id: string;
|
|
148
|
+
title: string;
|
|
149
|
+
} = KanboomColumn>({ config }: KanboomBoardProps<TCard, TColumn>): JSX.Element;
|
|
150
|
+
export { KanboomBoard as Kanban }
|
|
151
|
+
export { KanboomBoard as Kanbase }
|
|
152
|
+
export { KanboomBoard }
|
|
153
|
+
|
|
154
|
+
declare interface KanboomBoardProps<TCard extends {
|
|
155
|
+
id: string;
|
|
156
|
+
} = KanboomCard, TColumn extends {
|
|
157
|
+
id: string;
|
|
158
|
+
title: string;
|
|
159
|
+
} = KanboomColumn> {
|
|
160
|
+
config?: KanboomConfig<TCard, TColumn>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare interface KanboomCard {
|
|
164
|
+
id: string;
|
|
165
|
+
title: string;
|
|
166
|
+
description?: string;
|
|
167
|
+
content?: any;
|
|
168
|
+
metadata?: any;
|
|
169
|
+
previousColumnId?: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export declare interface KanboomColumn {
|
|
173
|
+
id: string;
|
|
174
|
+
title: string;
|
|
175
|
+
cardIds: string[];
|
|
176
|
+
metadata?: any;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare interface KanboomConfig<TCard = KanboomCard, TColumn = KanboomColumn> {
|
|
180
|
+
renderCard?: (props: CardRenderProps<TCard>) => React.ReactNode;
|
|
181
|
+
renderColumnHeader?: (props: ColumnHeaderRenderProps<TColumn>) => React.ReactNode;
|
|
182
|
+
renderColumnEmpty?: (props: ColumnEmptyRenderProps) => React.ReactNode;
|
|
183
|
+
renderAddButton?: (props: {
|
|
184
|
+
onClick: () => void;
|
|
185
|
+
columnId: string;
|
|
186
|
+
}) => React.ReactNode;
|
|
187
|
+
renderAddForm?: (props: AddCardRenderProps<TCard>) => React.ReactNode;
|
|
188
|
+
renderEditForm?: (props: EditCardRenderProps<TCard>) => React.ReactNode;
|
|
189
|
+
renderAddColumnButton?: (props: {
|
|
190
|
+
onClick: () => void;
|
|
191
|
+
}) => React.ReactNode;
|
|
192
|
+
renderAddColumnForm?: (props: AddColumnRenderProps<TColumn>) => React.ReactNode;
|
|
193
|
+
renderEditColumnForm?: (props: EditColumnRenderProps<TColumn>) => React.ReactNode;
|
|
194
|
+
renderCardView?: (props: ViewCardRenderProps<TCard>) => React.ReactNode;
|
|
195
|
+
allowAdd?: boolean;
|
|
196
|
+
allowEdit?: boolean;
|
|
197
|
+
allowColumnAdd?: boolean;
|
|
198
|
+
allowColumnEdit?: boolean;
|
|
199
|
+
allowColumnDelete?: boolean;
|
|
200
|
+
allowColumnReorder?: boolean;
|
|
201
|
+
allowFilters?: boolean;
|
|
202
|
+
showURLSync?: boolean;
|
|
203
|
+
dragActivationDistance?: number;
|
|
204
|
+
touchActivationDelay?: number;
|
|
205
|
+
virtualOverscan?: number;
|
|
206
|
+
estimatedCardHeight?: number;
|
|
207
|
+
columnWidth?: number;
|
|
208
|
+
columnMinHeight?: number;
|
|
209
|
+
gap?: number;
|
|
210
|
+
onCardMove?: (cardId: string, fromColumn: string, toColumn: string, index: number) => void;
|
|
211
|
+
onCardClick?: (card: TCard) => void;
|
|
212
|
+
onEditCard?: (card: TCard) => void;
|
|
213
|
+
onColumnClick?: (column: TColumn) => void;
|
|
214
|
+
onEditColumn?: (column: TColumn) => void;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export declare interface KanboomData<TCard = KanboomCard> {
|
|
218
|
+
cards: Record<string, TCard>;
|
|
219
|
+
columns: Record<string, KanboomColumn>;
|
|
220
|
+
columnOrder: string[];
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export declare const selectAllCards: (state: KanbanStore) => Record<string, KanboomCard>;
|
|
224
|
+
|
|
225
|
+
export declare const selectAllColumns: (state: KanbanStore) => Record<string, KanboomColumn>;
|
|
226
|
+
|
|
227
|
+
export declare const selectBoardData: (state: KanbanStore) => {
|
|
228
|
+
cards: Record<string, KanboomCard>;
|
|
229
|
+
columns: Record<string, KanboomColumn>;
|
|
230
|
+
columnOrder: string[];
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Zustand selectors for optimized component subscriptions
|
|
235
|
+
* Components should use these instead of subscribing to the entire store
|
|
236
|
+
*/
|
|
237
|
+
export declare const selectCard: (cardId: string) => (state: KanbanStore) => KanboomCard | undefined;
|
|
238
|
+
|
|
239
|
+
export declare const selectCardCount: (state: KanbanStore) => number;
|
|
240
|
+
|
|
241
|
+
export declare const selectCardsByIds: (cardIds: string[]) => (state: KanbanStore) => KanboomCard[];
|
|
242
|
+
|
|
243
|
+
export declare const selectColumn: (columnId: string) => (state: KanbanStore) => KanboomColumn | undefined;
|
|
244
|
+
|
|
245
|
+
export declare const selectColumnCardIds: (columnId: string) => (state: KanbanStore) => string[];
|
|
246
|
+
|
|
247
|
+
export declare const selectColumnCards: (columnId: string) => (state: KanbanStore) => KanboomCard[];
|
|
248
|
+
|
|
249
|
+
export declare const selectColumnCount: (state: KanbanStore) => number;
|
|
250
|
+
|
|
251
|
+
export declare const selectColumnOrder: (state: KanbanStore) => string[];
|
|
252
|
+
|
|
253
|
+
export declare const selectMoveCard: (state: KanbanStore) => (cardId: string, sourceColId: string, targetColId: string, newIndex: number) => void;
|
|
254
|
+
|
|
255
|
+
export declare const selectMoveColumn: (state: KanbanStore) => (columnId: string, newIndex: number) => void;
|
|
256
|
+
|
|
257
|
+
export declare const selectSetBoardData: (state: KanbanStore) => (data: KanboomData) => void;
|
|
258
|
+
|
|
259
|
+
export declare const useFPS: () => number;
|
|
260
|
+
|
|
261
|
+
export declare function useKanban<TCard = any, TColumn = any>(config?: KanboomConfig<TCard, TColumn>): {
|
|
262
|
+
activeId: string | null;
|
|
263
|
+
overId: string | null;
|
|
264
|
+
overSide: "top" | "bottom" | "left" | "right" | null;
|
|
265
|
+
viewingCardId: string | null;
|
|
266
|
+
editingCardId: string | null;
|
|
267
|
+
addingCardInColumnId: string | null;
|
|
268
|
+
editingColumnId: string | null;
|
|
269
|
+
setViewingCardId: (id: string | null) => void;
|
|
270
|
+
clearViewingCardId: () => void;
|
|
271
|
+
handleDragStart: (cardId: string) => void;
|
|
272
|
+
handleDragOver: (id: string | null, side?: "top" | "bottom" | "left" | "right" | null) => void;
|
|
273
|
+
handleDragEnd: () => void;
|
|
274
|
+
moveCard: (cardId: string, sourceColumnId: string, targetColumnId: string, index: number) => void;
|
|
275
|
+
addCard: (columnId: string, card: Omit<KanboomCard, "id">) => string;
|
|
276
|
+
updateCard: (cardId: string, updates: Partial<KanboomCard>) => void;
|
|
277
|
+
deleteCard: (cardId: string) => void;
|
|
278
|
+
duplicateCard: (cardId: string) => string;
|
|
279
|
+
setEditingCardId: (id: string | null) => void;
|
|
280
|
+
clearEditingCardId: () => void;
|
|
281
|
+
setAddingCardInColumnId: (id: string | null) => void;
|
|
282
|
+
clearAddingCardInColumnId: () => void;
|
|
283
|
+
addColumn: (column: Omit<KanboomColumn, "id" | "cardIds">, position?: number) => string;
|
|
284
|
+
addColumnWithCard: (cardId: string, sourceColId: string, columnData: Omit<KanboomColumn, "id" | "cardIds">) => void;
|
|
285
|
+
updateColumn: (columnId: string, updates: Partial<KanboomColumn>) => void;
|
|
286
|
+
deleteColumn: (columnId: string, moveCardsTo?: string) => void;
|
|
287
|
+
moveColumn: (columnId: string, newIndex: number) => void;
|
|
288
|
+
setEditingColumnId: (id: string | null) => void;
|
|
289
|
+
clearEditingColumnId: () => void;
|
|
290
|
+
clearBoard: () => void;
|
|
291
|
+
config: {
|
|
292
|
+
dragActivationDistance: number;
|
|
293
|
+
touchActivationDelay: number;
|
|
294
|
+
virtualOverscan: number;
|
|
295
|
+
estimatedCardHeight: number;
|
|
296
|
+
columnWidth: number;
|
|
297
|
+
columnMinHeight: number;
|
|
298
|
+
gap: number;
|
|
299
|
+
allowAdd: boolean;
|
|
300
|
+
allowEdit: boolean;
|
|
301
|
+
allowColumnAdd: boolean;
|
|
302
|
+
allowColumnEdit: boolean;
|
|
303
|
+
allowColumnDelete: boolean;
|
|
304
|
+
allowColumnReorder: boolean;
|
|
305
|
+
allowFilters: boolean;
|
|
306
|
+
showURLSync: boolean;
|
|
307
|
+
};
|
|
308
|
+
filters: KanbanFilters;
|
|
309
|
+
setSearchQuery: (query: string) => void;
|
|
310
|
+
addFilterGroup: (group: FilterGroup) => void;
|
|
311
|
+
updateFilterGroup: (groupId: string, updates: Partial<FilterGroup>) => void;
|
|
312
|
+
removeFilterGroup: (groupId: string) => void;
|
|
313
|
+
removeFilterRule: (groupId: string, ruleId: string) => void;
|
|
314
|
+
setFilters: (filters: KanbanFilters) => void;
|
|
315
|
+
clearFilters: () => void;
|
|
316
|
+
setBoardData: (data: KanboomData) => void;
|
|
317
|
+
setConfig: (config: Partial<KanboomConfig>) => void;
|
|
318
|
+
setActiveId: (id: string | null) => void;
|
|
319
|
+
cards: Record<string, KanboomCard>;
|
|
320
|
+
columns: Record<string, KanboomColumn>;
|
|
321
|
+
columnOrder: string[];
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export declare const useKanbanStore: UseBoundStore<Omit<StoreApi<KanbanStore>, "setState" | "devtools"> & {
|
|
325
|
+
setState(partial: KanbanStore | Partial<KanbanStore> | ((state: KanbanStore) => KanbanStore | Partial<KanbanStore>), replace?: false | undefined, action?: (string | {
|
|
326
|
+
[x: string]: unknown;
|
|
327
|
+
[x: number]: unknown;
|
|
328
|
+
[x: symbol]: unknown;
|
|
329
|
+
type: string;
|
|
330
|
+
}) | undefined): void;
|
|
331
|
+
setState(state: KanbanStore | ((state: KanbanStore) => KanbanStore), replace: true, action?: (string | {
|
|
332
|
+
[x: string]: unknown;
|
|
333
|
+
[x: number]: unknown;
|
|
334
|
+
[x: symbol]: unknown;
|
|
335
|
+
type: string;
|
|
336
|
+
}) | undefined): void;
|
|
337
|
+
devtools: {
|
|
338
|
+
cleanup: () => void;
|
|
339
|
+
};
|
|
340
|
+
}>;
|
|
341
|
+
|
|
342
|
+
export declare interface ViewCardRenderProps<TCard = KanboomCard> {
|
|
343
|
+
card: TCard;
|
|
344
|
+
onClose: () => void;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kanbase",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "High-performance, enterprise-grade Kanban component for React with virtualization, advanced filtering, and fluid precision interactions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/kanbase.umd.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
|
+
"assets",
|
|
11
12
|
"README.md"
|
|
12
13
|
],
|
|
13
14
|
"exports": {
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"license": "MIT",
|
|
49
50
|
"repository": {
|
|
50
51
|
"type": "git",
|
|
51
|
-
"url": "https://github.com/wesleyxmns/kanbase.git"
|
|
52
|
+
"url": "git+https://github.com/wesleyxmns/kanbase.git"
|
|
52
53
|
},
|
|
53
54
|
"bugs": {
|
|
54
55
|
"url": "https://github.com/wesleyxmns/kanbase/issues"
|