@overmap-ai/blocks 0.0.10-alpha.2 → 0.0.10-alpha.4

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 CHANGED
@@ -1,3 +1,3 @@
1
- # overmap-ai blocks
2
-
3
- Contains basic components used by overmap-ai libraries.
1
+ # overmap-ai blocks
2
+
3
+ Contains basic components used by overmap-ai libraries.
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { TableProps } from "./typings";
3
+ export declare const Table: FC<TableProps>;
@@ -0,0 +1,151 @@
1
+ export declare const TableData: string[][];
2
+ export declare const DefaultTableColumns: (sort?: boolean, search?: boolean, filter?: boolean) => ({
3
+ id: string;
4
+ label: string;
5
+ sort: boolean;
6
+ search: boolean;
7
+ filter?: undefined;
8
+ } | {
9
+ id: string;
10
+ label: string;
11
+ sort: boolean;
12
+ search: boolean;
13
+ filter: boolean;
14
+ } | {
15
+ id: string;
16
+ label: string;
17
+ sort: boolean;
18
+ search?: undefined;
19
+ filter?: undefined;
20
+ })[];
21
+ export declare const DefaultTableRows: (len: number) => {
22
+ id: string;
23
+ columns: {
24
+ full_name: {
25
+ id: string;
26
+ value: string | undefined;
27
+ label: string | undefined;
28
+ };
29
+ job_title: {
30
+ id: string;
31
+ value: string | undefined;
32
+ label: string | undefined;
33
+ };
34
+ gender: {
35
+ id: string;
36
+ value: string | undefined;
37
+ label: string | undefined;
38
+ };
39
+ age: {
40
+ id: string;
41
+ value: string | undefined;
42
+ label: string | undefined;
43
+ };
44
+ annual_salary: {
45
+ id: string;
46
+ value: string | undefined;
47
+ label: string | undefined;
48
+ };
49
+ country: {
50
+ id: string;
51
+ value: string | undefined;
52
+ label: string | undefined;
53
+ };
54
+ };
55
+ }[];
56
+ export declare const AdvancedTableColumns: () => ({
57
+ id: string;
58
+ label: string;
59
+ sort: boolean;
60
+ search: boolean;
61
+ width: string;
62
+ filter?: undefined;
63
+ filterValues?: undefined;
64
+ } | {
65
+ id: string;
66
+ label: string;
67
+ search: boolean;
68
+ filter: boolean;
69
+ width: string;
70
+ sort?: undefined;
71
+ filterValues?: undefined;
72
+ } | {
73
+ id: string;
74
+ label: string;
75
+ sort: boolean;
76
+ filter: boolean;
77
+ search?: undefined;
78
+ width?: undefined;
79
+ filterValues?: undefined;
80
+ } | {
81
+ id: string;
82
+ label: string;
83
+ sort: boolean;
84
+ search?: undefined;
85
+ width?: undefined;
86
+ filter?: undefined;
87
+ filterValues?: undefined;
88
+ } | {
89
+ id: string;
90
+ label: string;
91
+ sort: boolean;
92
+ filter: boolean;
93
+ filterValues: {
94
+ value: number;
95
+ label: import("react/jsx-runtime").JSX.Element;
96
+ }[];
97
+ search?: undefined;
98
+ width?: undefined;
99
+ } | {
100
+ id: string;
101
+ label: string;
102
+ sort?: undefined;
103
+ search?: undefined;
104
+ width?: undefined;
105
+ filter?: undefined;
106
+ filterValues?: undefined;
107
+ })[];
108
+ export declare const AdvancedTableRows: (len: number) => {
109
+ id: string;
110
+ onClick: () => void;
111
+ columns: {
112
+ full_name: {
113
+ id: string;
114
+ value: string | undefined;
115
+ label: string | undefined;
116
+ };
117
+ job_title: {
118
+ id: string;
119
+ value: string | undefined;
120
+ label: string | undefined;
121
+ };
122
+ gender: {
123
+ id: string;
124
+ value: string | undefined;
125
+ label: import("react/jsx-runtime").JSX.Element;
126
+ sortValue: number;
127
+ };
128
+ age: {
129
+ id: string;
130
+ value: string | undefined;
131
+ label: string | undefined;
132
+ };
133
+ annual_salary: {
134
+ id: string;
135
+ value: string | undefined;
136
+ label: string | undefined;
137
+ filterValue: number;
138
+ };
139
+ country: {
140
+ id: string;
141
+ value: string | undefined;
142
+ label: string | undefined;
143
+ searchValue: string;
144
+ };
145
+ remove_user: {
146
+ id: string;
147
+ value: number;
148
+ label: import("react/jsx-runtime").JSX.Element;
149
+ };
150
+ };
151
+ }[];
@@ -0,0 +1,3 @@
1
+ export * from "./Table";
2
+ export * from "./typings.ts";
3
+ export * from "./constants.tsx";
@@ -0,0 +1,63 @@
1
+ import { ReactNode } from "react";
2
+ export type IdLabel = string | number;
3
+ export type ValueLabel = IdLabel | null | undefined;
4
+ export type TableLabel = ValueLabel | ReactNode;
5
+ export interface FilterValue {
6
+ value: ValueLabel;
7
+ label: ReactNode;
8
+ }
9
+ export interface TableCell {
10
+ id: IdLabel;
11
+ value: ValueLabel;
12
+ label: TableLabel;
13
+ onClick?: (cell: TableCell) => void;
14
+ filterValue?: ValueLabel;
15
+ sortValue?: ValueLabel;
16
+ searchValue?: ValueLabel;
17
+ className?: string;
18
+ }
19
+ export interface TableColumn {
20
+ id: IdLabel;
21
+ label: TableLabel;
22
+ sort?: boolean;
23
+ search?: boolean;
24
+ filter?: boolean;
25
+ width?: string;
26
+ className?: string;
27
+ filterValues?: FilterValue[];
28
+ }
29
+ export interface TableRow {
30
+ id: IdLabel;
31
+ onClick?: (row: TableRow) => void;
32
+ className?: string;
33
+ columns: {
34
+ [columnId: string]: TableCell;
35
+ };
36
+ }
37
+ export interface TableProps {
38
+ columns: TableColumn[];
39
+ data: TableRow[];
40
+ color?: "light" | "dark";
41
+ title?: string | ReactNode;
42
+ description?: string | ReactNode;
43
+ rowsPerPage?: number[];
44
+ showSearchBar?: boolean;
45
+ searchBarPlaceholder?: string;
46
+ showSelect?: boolean;
47
+ showFilterButton?: boolean;
48
+ showContainer?: boolean;
49
+ showRowsPerPage?: boolean;
50
+ showPageNumber?: boolean;
51
+ showPageNavigation?: boolean;
52
+ children?: ReactNode;
53
+ /**
54
+ * Show top bar content which includes search bar, filter button, and edit and delete buttons
55
+ * @default false
56
+ */
57
+ showTopBar?: boolean;
58
+ showBottomBar?: boolean;
59
+ className?: string;
60
+ columnClassName?: string;
61
+ rowClassName?: string;
62
+ cellClassName?: string;
63
+ }