@krak-stack/registry 0.1.9 → 0.1.11
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 +2 -0
- package/dist/components/ui/data-table.d.ts +145 -19
- package/dist/components/ui/data-table.js +1522 -1252
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/sidebar-layout.d.ts +1 -0
- package/dist/components/ui/sidebar-layout.js +6 -1
- package/dist/lib/docs-ai.d.ts +6 -0
- package/dist/lib/docs-ai.js +3 -0
- package/dist/lib/docs-core.d.ts +52 -0
- package/dist/lib/docs-core.js +46 -4
- package/dist/services/file-extraction/index.d.ts +70 -0
- package/dist/services/file-extraction/index.js +119 -0
- package/dist/services/file-extraction/schema.d.ts +13 -0
- package/dist/services/file-extraction/schema.js +14 -0
- package/package.json +14 -2
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ import { createMdxDocsSource, makeDocs } from "@krak-stack/registry/docs";
|
|
|
21
21
|
import { makeChatDocumentation } from "@krak-stack/registry/docs-ai";
|
|
22
22
|
import { Query } from "@krak-stack/registry/query";
|
|
23
23
|
import { createSeo } from "@krak-stack/registry/seo";
|
|
24
|
+
import { FileExtractionService } from "@krak-stack/registry/service-file-extraction";
|
|
25
|
+
import { FileExtractedTextSchema } from "@krak-stack/registry/service-file-extraction/schema";
|
|
24
26
|
import { NotificationService } from "@krak-stack/registry/service-notification";
|
|
25
27
|
```
|
|
26
28
|
|
|
@@ -1,13 +1,112 @@
|
|
|
1
1
|
import { type PaginationMessages } from "./pagination.js";
|
|
2
|
-
import { type ValidateFromPath } from "@tanstack/react-router";
|
|
3
|
-
import { type Column, type ColumnDef, type Header, type RowData, type Table as TanstackTable, type VisibilityState } from "@tanstack/react-table";
|
|
4
|
-
declare module "@tanstack/react-table" {
|
|
5
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
6
|
-
truncate?: boolean;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
import { type HTMLAttributes, type ReactNode } from "react";
|
|
10
2
|
import { Schema } from "effect";
|
|
3
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
4
|
+
import { type ValidateFromPath } from "@tanstack/react-router";
|
|
5
|
+
import { type Column, type ColumnDef, type Header, type RowData, type ColumnVisibilityState, type AppReactTable, type TableState } from "@tanstack/react-table";
|
|
6
|
+
type DataTableColumnMeta = {
|
|
7
|
+
truncate?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const dataTableFeatures: {
|
|
10
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
11
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
12
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
13
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
14
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
15
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
16
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
17
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
18
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
19
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
20
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
21
|
+
columnMeta: DataTableColumnMeta;
|
|
22
|
+
};
|
|
23
|
+
export declare const createDataTableColumnHelper: <TData extends RowData>() => import("@tanstack/react-table").AppColumnHelper<{
|
|
24
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
25
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
26
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
27
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
28
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
29
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
30
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
31
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
32
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
33
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
34
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
35
|
+
columnMeta: DataTableColumnMeta;
|
|
36
|
+
}, TData, {}, {}>, useDataTable: <TData extends RowData, TSelected = import("@tanstack/react-table").TableState_ColumnFiltering & import("@tanstack/react-table").TableState_ColumnResizing & import("@tanstack/react-table").TableState_ColumnSizing & import("@tanstack/react-table").TableState_ColumnVisibility & import("@tanstack/react-table").TableState_GlobalFiltering & import("@tanstack/react-table").TableState_RowPagination & import("@tanstack/react-table").TableState_RowSelection & import("@tanstack/react-table").TableState_RowSorting>(tableOptions: Omit<import("@tanstack/react-table").TableOptions<{
|
|
37
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
38
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
39
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
40
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
41
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
42
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
43
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
44
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
45
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
46
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
47
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
48
|
+
columnMeta: DataTableColumnMeta;
|
|
49
|
+
}, TData>, "features">, selector?: ((state: import("@tanstack/react-table").TableState_ColumnFiltering & import("@tanstack/react-table").TableState_ColumnResizing & import("@tanstack/react-table").TableState_ColumnSizing & import("@tanstack/react-table").TableState_ColumnVisibility & import("@tanstack/react-table").TableState_GlobalFiltering & import("@tanstack/react-table").TableState_RowPagination & import("@tanstack/react-table").TableState_RowSelection & import("@tanstack/react-table").TableState_RowSorting) => TSelected) | undefined) => AppReactTable<{
|
|
50
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
51
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
52
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
53
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
54
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
55
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
56
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
57
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
58
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
59
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
60
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
61
|
+
columnMeta: DataTableColumnMeta;
|
|
62
|
+
}, TData, TSelected, {}, {}, {}>, useDataTableCellContext: <TValue extends import("@tanstack/react-table").CellData = unknown>() => import("@tanstack/react-table").Cell_Core<{
|
|
63
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
64
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
65
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
66
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
67
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
68
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
69
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
70
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
71
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
72
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
73
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
74
|
+
columnMeta: DataTableColumnMeta;
|
|
75
|
+
}, any, TValue> & {
|
|
76
|
+
FlexRender: () => ReactNode;
|
|
77
|
+
}, useDataTableHeaderContext: <TValue extends import("@tanstack/react-table").CellData = unknown>() => import("@tanstack/react-table").Header_Core<{
|
|
78
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
79
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
80
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
81
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
82
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
83
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
84
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
85
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
86
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
87
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
88
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
89
|
+
columnMeta: DataTableColumnMeta;
|
|
90
|
+
}, any, TValue> & import("@tanstack/react-table").Header_ColumnResizing & import("@tanstack/react-table").Header_ColumnSizing & {
|
|
91
|
+
FlexRender: () => ReactNode;
|
|
92
|
+
}, useDataTableContext: <TData extends RowData = RowData, TSelected = import("@tanstack/react-table").TableState_ColumnFiltering & import("@tanstack/react-table").TableState_ColumnResizing & import("@tanstack/react-table").TableState_ColumnSizing & import("@tanstack/react-table").TableState_ColumnVisibility & import("@tanstack/react-table").TableState_GlobalFiltering & import("@tanstack/react-table").TableState_RowPagination & import("@tanstack/react-table").TableState_RowSelection & import("@tanstack/react-table").TableState_RowSorting>() => AppReactTable<{
|
|
93
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
94
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
95
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
96
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
97
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
98
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
99
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
100
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
101
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
102
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
103
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
104
|
+
columnMeta: DataTableColumnMeta;
|
|
105
|
+
}, TData, TSelected, {}, {}, {}>;
|
|
106
|
+
export type DataTableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<typeof dataTableFeatures, TData, TValue>;
|
|
107
|
+
type DataTableColumn<TData extends RowData, TValue = unknown> = Column<typeof dataTableFeatures, TData, TValue>;
|
|
108
|
+
type DataTableHeader<TData extends RowData, TValue = unknown> = Header<typeof dataTableFeatures, TData, TValue>;
|
|
109
|
+
type DataTableInstance<TData extends RowData> = AppReactTable<typeof dataTableFeatures, TData, TableState<typeof dataTableFeatures>, Record<never, never>, Record<never, never>, Record<never, never>>;
|
|
11
110
|
export declare const TableSearchSchema: Schema.Struct<{
|
|
12
111
|
readonly page: Schema.optional<Schema.Int>;
|
|
13
112
|
readonly pageSize: Schema.optional<Schema.Int>;
|
|
@@ -42,6 +141,9 @@ export type DataTableMessages = PaginationMessages & {
|
|
|
42
141
|
reorder: string;
|
|
43
142
|
resizeColumn: (column: string) => string;
|
|
44
143
|
listOthers: (count: number) => string;
|
|
144
|
+
selectAllRows: string;
|
|
145
|
+
selectRow: string;
|
|
146
|
+
selected: string;
|
|
45
147
|
};
|
|
46
148
|
export type DataTableMessageOverrides = Partial<DataTableMessages>;
|
|
47
149
|
export declare const dataTableMessages: (overrides?: DataTableMessageOverrides) => {
|
|
@@ -74,6 +176,9 @@ export declare const dataTableMessages: (overrides?: DataTableMessageOverrides)
|
|
|
74
176
|
reorder: string;
|
|
75
177
|
resizeColumn: (column: string) => string;
|
|
76
178
|
listOthers: (count: number) => string;
|
|
179
|
+
selectAllRows: string;
|
|
180
|
+
selectRow: string;
|
|
181
|
+
selected: string;
|
|
77
182
|
} | {
|
|
78
183
|
pageSize: string;
|
|
79
184
|
results: (count: number) => string;
|
|
@@ -104,6 +209,9 @@ export declare const dataTableMessages: (overrides?: DataTableMessageOverrides)
|
|
|
104
209
|
reorder: string;
|
|
105
210
|
resizeColumn: (column: string) => string;
|
|
106
211
|
listOthers: (count: number) => string;
|
|
212
|
+
selectAllRows: string;
|
|
213
|
+
selectRow: string;
|
|
214
|
+
selected: string;
|
|
107
215
|
};
|
|
108
216
|
export interface DataTableGroupingField<TData> {
|
|
109
217
|
id: string;
|
|
@@ -148,6 +256,14 @@ export type DataTableRowAction<TData> = {
|
|
|
148
256
|
onClick: (data: TData) => void;
|
|
149
257
|
visible?: (data: TData) => boolean;
|
|
150
258
|
};
|
|
259
|
+
export type DataTableBulkAction<TData> = {
|
|
260
|
+
id?: string;
|
|
261
|
+
name: string;
|
|
262
|
+
icon?: ReactNode;
|
|
263
|
+
variant?: "default" | "destructive" | undefined;
|
|
264
|
+
onClick: (rows: TData[]) => void;
|
|
265
|
+
visible?: (rows: TData[]) => boolean;
|
|
266
|
+
};
|
|
151
267
|
export type DataTableGroupAction = {
|
|
152
268
|
name: string;
|
|
153
269
|
icon?: ReactNode;
|
|
@@ -177,7 +293,16 @@ export interface DataTableRowActionsFeature<TData> {
|
|
|
177
293
|
items: readonly DataTableRowAction<TData>[];
|
|
178
294
|
}
|
|
179
295
|
export interface DataTableColumnVisibilityFeature {
|
|
180
|
-
default?:
|
|
296
|
+
default?: ColumnVisibilityState;
|
|
297
|
+
}
|
|
298
|
+
export interface DataTableSelectionFeature<TData> {
|
|
299
|
+
bulkActions?: false | {
|
|
300
|
+
label?: string;
|
|
301
|
+
items: readonly DataTableBulkAction<TData>[];
|
|
302
|
+
};
|
|
303
|
+
getRowId: (row: TData) => string;
|
|
304
|
+
isRowSelectable?: (row: TData) => boolean;
|
|
305
|
+
onSelectionChange?: (rows: TData[]) => void;
|
|
181
306
|
}
|
|
182
307
|
export interface DataTableFeatures<TData> {
|
|
183
308
|
pagination?: DataTablePaginationFeature;
|
|
@@ -187,12 +312,13 @@ export interface DataTableFeatures<TData> {
|
|
|
187
312
|
gallery?: false | DataTableGalleryConfig;
|
|
188
313
|
sorting?: boolean;
|
|
189
314
|
rowActions?: false | DataTableRowActionsFeature<TData>;
|
|
315
|
+
selection?: false | DataTableSelectionFeature<TData>;
|
|
190
316
|
}
|
|
191
317
|
type LegacyDataTableRowAction<TData> = Omit<DataTableRowAction<TData>, "id"> & {
|
|
192
318
|
id?: string;
|
|
193
319
|
};
|
|
194
|
-
interface DataTableProps<TData
|
|
195
|
-
columns:
|
|
320
|
+
interface DataTableProps<TData extends RowData> {
|
|
321
|
+
columns: DataTableColumnDef<TData>[];
|
|
196
322
|
data: TData[];
|
|
197
323
|
state?: DataTableState;
|
|
198
324
|
search?: TableParams;
|
|
@@ -221,18 +347,18 @@ export declare const DataTableRowActions: <TData>({ actions, contentClassName, r
|
|
|
221
347
|
row: TData;
|
|
222
348
|
title?: string | undefined;
|
|
223
349
|
}) => import("react").JSX.Element | null;
|
|
224
|
-
export declare const getHeaderNames: (headers:
|
|
350
|
+
export declare const getHeaderNames: <TData extends RowData>(headers: DataTableHeader<TData, unknown>[]) => string[];
|
|
225
351
|
export type CsvValue = string | number | boolean | null | undefined;
|
|
226
352
|
export declare const downloadCsv: (headers: CsvValue[], data: CsvValue[][], fileName?: string) => void;
|
|
227
353
|
export declare const downloadJson: (data: unknown, fileName?: string) => void;
|
|
228
|
-
export declare function DataTable<TData
|
|
229
|
-
interface DataTablePaginationProps<TData> {
|
|
354
|
+
export declare function DataTable<TData extends RowData>({ columns, data, state, search: controlledSearch, onSearchChange, searchState, emptyLabel, messages, exportFileName, isLoading: legacyIsLoading, onRefresh, onRowClick, from, routeFrom, grouping, gallery, rowActions: legacyRowActions, reordering, serverPagination, features, }: DataTableProps<TData>): import("react").JSX.Element;
|
|
355
|
+
interface DataTablePaginationProps<TData extends RowData> {
|
|
230
356
|
messages?: DataTableMessageOverrides;
|
|
231
357
|
pageSizes?: readonly number[] | undefined;
|
|
232
358
|
rowCount?: number | undefined;
|
|
233
|
-
table:
|
|
359
|
+
table: DataTableInstance<TData>;
|
|
234
360
|
}
|
|
235
|
-
export declare function DataTablePagination<TData>({ messages, pageSizes, rowCount, table, }: DataTablePaginationProps<TData>): import("react").JSX.Element;
|
|
361
|
+
export declare function DataTablePagination<TData extends RowData>({ messages, pageSizes, rowCount, table, }: DataTablePaginationProps<TData>): import("react").JSX.Element;
|
|
236
362
|
export declare function DataTableRelationshipCell({ emptyLabel, manageLabel, onAdd, onRemove, options, value, }: {
|
|
237
363
|
emptyLabel: string;
|
|
238
364
|
from?: ValidateFromPath;
|
|
@@ -255,10 +381,10 @@ export declare function DataTableListSummary({ emptyLabel, expandable, items, ov
|
|
|
255
381
|
variant?: "icon" | "text" | undefined;
|
|
256
382
|
visibleCount?: number | undefined;
|
|
257
383
|
}): import("react").JSX.Element;
|
|
258
|
-
interface DataTableColumnHeaderProps<TData, TValue> extends HTMLAttributes<HTMLDivElement> {
|
|
259
|
-
column:
|
|
384
|
+
interface DataTableColumnHeaderProps<TData extends RowData, TValue> extends HTMLAttributes<HTMLDivElement> {
|
|
385
|
+
column: DataTableColumn<TData, TValue>;
|
|
260
386
|
messages?: DataTableMessageOverrides;
|
|
261
387
|
title: string;
|
|
262
388
|
}
|
|
263
|
-
export declare function DataTableColumnHeader<TData, TValue>({ column, messages, title, className, }: DataTableColumnHeaderProps<TData, TValue>): import("react").JSX.Element;
|
|
389
|
+
export declare function DataTableColumnHeader<TData extends RowData, TValue>({ column, messages, title, className, }: DataTableColumnHeaderProps<TData, TValue>): import("react").JSX.Element;
|
|
264
390
|
export {};
|