@cobre-npm/ds-v3 0.134.0 → 0.135.1
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.
|
@@ -70,6 +70,7 @@ export type { CobreSelectableItem } from './molecules/CobreAccountOptionSelect/C
|
|
|
70
70
|
export { default as CobreMultiOptionsFilter } from './molecules/CobreMultiOptionsFilter/CobreMultiOptionsFilter.vue';
|
|
71
71
|
export { default as CobreHeader } from './organisms/CobreHeader/CobreHeader.vue';
|
|
72
72
|
export { default as CobreSideMenu } from './organisms/CobreSideMenu/CobreSideMenu.vue';
|
|
73
|
+
export { default as CobreTable } from './organisms/CobreTable/CobreTable.vue';
|
|
73
74
|
export { default as CobreDateFilter } from './organisms/CobreDateFilter/CobreDateFilter.vue';
|
|
74
75
|
export { default as CobreTimeLine } from './organisms/CobreTimeline/CobreTimeline.vue';
|
|
75
76
|
export { default as CobreDynamicForm } from './organisms/CobreDynamicForm/CobreDynamicForm.vue';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Table as TanStackTable, ColumnDef } from '@tanstack/vue-table';
|
|
2
|
+
import type { RowAction } from '../../atoms/CobreRowActions/interfaces/CobreRowActions.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for the empty state display
|
|
5
|
+
*/
|
|
6
|
+
export interface EmptyStateProps {
|
|
7
|
+
/** Title displayed when table is empty */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Description text shown in empty state */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Icon to display: 'error' for error state, 'box' for no data, 'cards' for generic */
|
|
12
|
+
icon?: 'error' | 'box' | 'cards';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* CobreTable component props
|
|
16
|
+
*
|
|
17
|
+
* Generic table component powered by TanStack Vue Table that provides:
|
|
18
|
+
* - Headless table rendering with full column customization
|
|
19
|
+
* - Bulk selection with checkboxes
|
|
20
|
+
* - Row actions (edit, delete, etc.)
|
|
21
|
+
* - Row click handlers for navigation
|
|
22
|
+
* - Loading skeleton state
|
|
23
|
+
* - Custom empty state display
|
|
24
|
+
* - Slot-based custom cell rendering
|
|
25
|
+
*/
|
|
26
|
+
export interface CobreTableProps<T> {
|
|
27
|
+
/** TanStack Vue Table instance (created with useDataTable or useVueTable) */
|
|
28
|
+
table: TanStackTable<T>;
|
|
29
|
+
/** Array of row data to display */
|
|
30
|
+
data: T[];
|
|
31
|
+
/** Column definitions from TanStack (configure column behavior, sizing, custom cell rendering) */
|
|
32
|
+
columns: ColumnDef<T>[];
|
|
33
|
+
/** Show loading skeleton rows instead of data rows */
|
|
34
|
+
isLoading?: boolean;
|
|
35
|
+
/** Error state indicator (unused in display but available for context) */
|
|
36
|
+
error?: unknown;
|
|
37
|
+
/** Enable bulk selection checkboxes in header and rows */
|
|
38
|
+
allowBulkActions?: boolean;
|
|
39
|
+
/** Function returning row actions (edit, delete, etc.) for each row. If provided, a sticky row actions column is shown */
|
|
40
|
+
getRowActions?: (row: T) => RowAction<T>[];
|
|
41
|
+
/** Callback when a row cell is clicked (excluding checkboxes and actions). Useful for navigation */
|
|
42
|
+
onRowClick?: (row: T) => void;
|
|
43
|
+
/** Configuration for empty state display (title, description, icon) */
|
|
44
|
+
emptyStateProps?: EmptyStateProps;
|
|
45
|
+
}
|
|
46
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
47
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & CobreTableProps<T> & Partial<{}>> & import("vue").PublicProps;
|
|
48
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
49
|
+
attrs: any;
|
|
50
|
+
slots: {
|
|
51
|
+
[x: `cell-${string}`]: ((props: {
|
|
52
|
+
value: unknown;
|
|
53
|
+
row: T;
|
|
54
|
+
}) => any) | undefined;
|
|
55
|
+
} & {
|
|
56
|
+
'empty-state'?: (props: {}) => any;
|
|
57
|
+
};
|
|
58
|
+
emit: {};
|
|
59
|
+
}>) => import("vue").VNode & {
|
|
60
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
61
|
+
};
|
|
62
|
+
export default _default;
|
|
63
|
+
type __VLS_PrettifyLocal<T> = {
|
|
64
|
+
[K in keyof T]: T[K];
|
|
65
|
+
} & {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CobreTable.vue';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cobre-npm/ds-v3",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "pnpm@11.0.4",
|
|
6
6
|
"engines": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@popperjs/core": "^2.11.8",
|
|
32
|
+
"@tanstack/vue-table": "^8.21.3",
|
|
32
33
|
"@vueuse/components": "^10.11.0",
|
|
33
34
|
"@vueuse/core": "^10.11.0",
|
|
34
35
|
"all-good-emails": "^0.0.5",
|