@universe-platform/ui 0.1.0-beta.8 → 0.1.0-beta.9
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/dist/globals.css +394 -21
- package/dist/index.d.mts +153 -50
- package/dist/index.d.ts +153 -50
- package/dist/index.js +2278 -670
- package/dist/index.mjs +2307 -671
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
+
import { RecordData, SchemaDef, ColumnDef, CellValue } from '@universe-platform/shared';
|
|
3
|
+
export * from '@universe-platform/shared';
|
|
2
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode } from 'react';
|
|
4
7
|
|
|
5
8
|
declare function cn(...inputs: ClassValue[]): string;
|
|
6
9
|
|
|
@@ -18,6 +21,14 @@ declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): v
|
|
|
18
21
|
*/
|
|
19
22
|
declare function formatPhoneDisplay(phone: string): string;
|
|
20
23
|
|
|
24
|
+
interface PastelPalette {
|
|
25
|
+
bg: string;
|
|
26
|
+
text: string;
|
|
27
|
+
border: string;
|
|
28
|
+
}
|
|
29
|
+
declare const PASTEL_PALETTES: PastelPalette[];
|
|
30
|
+
declare function getDeterministicPastelBadge(key: string): PastelPalette;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Core definitions for Universe UI components.
|
|
23
34
|
* These interfaces define the standard contract that all generic visual components
|
|
@@ -57,53 +68,6 @@ interface BaseComponentProps<TData = any, TConfig = Record<string, any>> extends
|
|
|
57
68
|
"data-testid"?: string;
|
|
58
69
|
}
|
|
59
70
|
|
|
60
|
-
/**
|
|
61
|
-
* Table data schemas and record definitions for Universe UI components.
|
|
62
|
-
*/
|
|
63
|
-
interface ColumnDef {
|
|
64
|
-
name: string;
|
|
65
|
-
type?: string;
|
|
66
|
-
defaultValue?: any;
|
|
67
|
-
isRequired?: boolean;
|
|
68
|
-
isUnique?: boolean;
|
|
69
|
-
referencedTableId?: string;
|
|
70
|
-
referencedTableName?: string;
|
|
71
|
-
displayField?: string;
|
|
72
|
-
currencySymbol?: string;
|
|
73
|
-
subTableDisplayFields?: string[];
|
|
74
|
-
contactMapping?: {
|
|
75
|
-
phoneCol?: string;
|
|
76
|
-
emailCol?: string;
|
|
77
|
-
nameParts?: Array<{
|
|
78
|
-
type: 'LOCAL' | 'PARENT';
|
|
79
|
-
parentTableId?: string;
|
|
80
|
-
columnId: string;
|
|
81
|
-
}>;
|
|
82
|
-
} | null;
|
|
83
|
-
order?: number;
|
|
84
|
-
isHidden?: boolean;
|
|
85
|
-
config?: {
|
|
86
|
-
enableWhatsApp?: boolean;
|
|
87
|
-
actionType?: string;
|
|
88
|
-
actionPhoneColumn?: string;
|
|
89
|
-
[key: string]: any;
|
|
90
|
-
} | null;
|
|
91
|
-
}
|
|
92
|
-
interface SchemaDef {
|
|
93
|
-
columns?: ColumnDef[];
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}
|
|
96
|
-
interface RecordData {
|
|
97
|
-
id: string;
|
|
98
|
-
data: Record<string, any>;
|
|
99
|
-
}
|
|
100
|
-
interface DriveFileValue {
|
|
101
|
-
fileId: string;
|
|
102
|
-
fileUrl: string;
|
|
103
|
-
fileName: string;
|
|
104
|
-
url?: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
71
|
interface TableConfig extends SchemaDef {
|
|
108
72
|
}
|
|
109
73
|
type TableData = RecordData[];
|
|
@@ -120,6 +84,145 @@ interface DeleteRecordPayload {
|
|
|
120
84
|
|
|
121
85
|
declare function TableBlock(props: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
122
86
|
|
|
87
|
+
interface UseColumnResizeOptions {
|
|
88
|
+
storageKey: string;
|
|
89
|
+
defaultWidth?: number;
|
|
90
|
+
minWidth?: number;
|
|
91
|
+
maxWidth?: number;
|
|
92
|
+
getMinColWidth?: (colName: string) => number;
|
|
93
|
+
}
|
|
94
|
+
declare function useColumnResize({ storageKey, defaultWidth, minWidth, maxWidth, getMinColWidth, }: UseColumnResizeOptions): {
|
|
95
|
+
columnWidths: Record<string, number>;
|
|
96
|
+
setColumnWidths: react.Dispatch<react.SetStateAction<Record<string, number>>>;
|
|
97
|
+
resizingCol: {
|
|
98
|
+
name: string;
|
|
99
|
+
startWidth: number;
|
|
100
|
+
startX: number;
|
|
101
|
+
minWidth: number;
|
|
102
|
+
} | null;
|
|
103
|
+
startResize: (colName: string, currentWidth: number, clientX: number, customMinWidth?: number) => void;
|
|
104
|
+
getWidth: (colName: string, fallback?: number) => number;
|
|
105
|
+
minWidth: number;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
interface UseColumnReorderOptions {
|
|
109
|
+
onReorder: (draggedName: string, dropTargetName: string) => void | Promise<void>;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare function useColumnReorder({ onReorder, disabled, }: UseColumnReorderOptions): {
|
|
113
|
+
draggedColName: string | null;
|
|
114
|
+
dragOverColName: string | null;
|
|
115
|
+
isDragging: (colName: string) => boolean;
|
|
116
|
+
isDragOver: (colName: string) => boolean;
|
|
117
|
+
getHeaderDragProps: (colName: string) => {
|
|
118
|
+
draggable: boolean;
|
|
119
|
+
onDragStart?: undefined;
|
|
120
|
+
onDragOver?: undefined;
|
|
121
|
+
onDragLeave?: undefined;
|
|
122
|
+
onDrop?: undefined;
|
|
123
|
+
onDragEnd?: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
draggable: boolean;
|
|
126
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
127
|
+
onDragOver: (e: React.DragEvent) => void;
|
|
128
|
+
onDragLeave: () => void;
|
|
129
|
+
onDrop: (e: React.DragEvent) => void;
|
|
130
|
+
onDragEnd: () => void;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Measure the width of a given text string in canvas 2D context using the specified font.
|
|
136
|
+
*/
|
|
137
|
+
declare function measureTextWidth(text: string, font?: string): number;
|
|
138
|
+
interface SplitTitleResult {
|
|
139
|
+
isSingleWord: boolean;
|
|
140
|
+
line1: string;
|
|
141
|
+
line2?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Splits a header title:
|
|
145
|
+
* - 1 word: stays on 1 line.
|
|
146
|
+
* - 2 or more words: divided as equally as possible between 2 lines without cutting any word.
|
|
147
|
+
*/
|
|
148
|
+
declare function splitHeaderTitle(name: string): SplitTitleResult;
|
|
149
|
+
/**
|
|
150
|
+
* Calculate the minimum column width needed to display the header title cleanly:
|
|
151
|
+
* - If 1 word: minimum width is that word + padding + icon.
|
|
152
|
+
* - If 2+ words: minimum width is the longest line + padding + icon.
|
|
153
|
+
* - For specialized field types like GOOGLE_CONTACT: ensures room for button.
|
|
154
|
+
* Words are NEVER cut or truncated with ellipsis.
|
|
155
|
+
*/
|
|
156
|
+
declare function calculateMinColumnWidth(name: string, isSubTable?: boolean, colType?: string): number;
|
|
157
|
+
interface ColumnHeaderTitleProps {
|
|
158
|
+
name: string;
|
|
159
|
+
width?: number;
|
|
160
|
+
isSubTable?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Header title component:
|
|
164
|
+
* - Default / when enough width: takes up entire line on 1 single row.
|
|
165
|
+
* - When column is shrunk below full-line width: divides evenly into 2 rows without cutting any word.
|
|
166
|
+
* - Single words always stay on 1 row.
|
|
167
|
+
*/
|
|
168
|
+
declare function ColumnHeaderTitle({ name, width, isSubTable }: ColumnHeaderTitleProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
declare function formatConflictCellValue(rawVal: any, colDef?: ColumnDef | {
|
|
171
|
+
name: string;
|
|
172
|
+
type?: string;
|
|
173
|
+
config?: any;
|
|
174
|
+
}, relationOptionsMap?: Record<string, any[]>): react__default.ReactNode;
|
|
175
|
+
|
|
176
|
+
interface DatePickerCellProps {
|
|
177
|
+
value: CellValue<'DATE'> | Date | number;
|
|
178
|
+
onChange: (value: CellValue<'DATE'>) => void;
|
|
179
|
+
column?: ColumnDef;
|
|
180
|
+
readOnly?: boolean;
|
|
181
|
+
}
|
|
182
|
+
declare function DatePickerCell({ value, onChange, readOnly }: DatePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
|
|
184
|
+
interface TimePickerCellProps {
|
|
185
|
+
value: CellValue<'TIME'> | Date;
|
|
186
|
+
onChange: (value: CellValue<'TIME'>) => void;
|
|
187
|
+
column?: ColumnDef;
|
|
188
|
+
readOnly?: boolean;
|
|
189
|
+
}
|
|
190
|
+
declare function parseTimeParts(val: any): {
|
|
191
|
+
hour: number;
|
|
192
|
+
minute: number;
|
|
193
|
+
} | null;
|
|
194
|
+
declare function formatTimeIso(hour: number, minute: number): string;
|
|
195
|
+
declare function formatTimeInput(input: string | null | undefined): string;
|
|
196
|
+
declare function TimePickerCell({ value, onChange, readOnly }: TimePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
197
|
+
|
|
198
|
+
interface LinkPickerCellProps {
|
|
199
|
+
value: CellValue<'LINK'> | string;
|
|
200
|
+
onChange: (value: CellValue<'LINK'>) => void;
|
|
201
|
+
column?: ColumnDef;
|
|
202
|
+
readOnly?: boolean;
|
|
203
|
+
}
|
|
204
|
+
declare function parseLinkValue(val: CellValue<'LINK'> | string): {
|
|
205
|
+
url: string;
|
|
206
|
+
label: string;
|
|
207
|
+
};
|
|
208
|
+
declare function resolveProtocol(url: string): string;
|
|
209
|
+
declare function LinkPickerCell({ value, onChange, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
interface RelationPickerCellProps {
|
|
212
|
+
value: CellValue<'RELATION'> | string;
|
|
213
|
+
onChange: (value: CellValue<'RELATION'>) => void;
|
|
214
|
+
column: ColumnDef<'RELATION'> | ColumnDef;
|
|
215
|
+
context?: any;
|
|
216
|
+
rowId?: string;
|
|
217
|
+
readOnly?: boolean;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Normalizes any relation value into a canonical string[] of record IDs.
|
|
221
|
+
* Handles legacy single-string records, empty strings, null/undefined, and object shapes.
|
|
222
|
+
*/
|
|
223
|
+
declare function normalizeRelationValue(val: any): string[];
|
|
224
|
+
declare function RelationPickerCell({ value, onChange, column, context, rowId, readOnly, }: RelationPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
|
|
123
226
|
/**
|
|
124
227
|
* UNIVERSE_COMPONENTS
|
|
125
228
|
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
@@ -144,11 +247,11 @@ interface ToastContextType {
|
|
|
144
247
|
showError: (error: string | Error | null | undefined, title?: string) => void;
|
|
145
248
|
removeToast: (id: string) => void;
|
|
146
249
|
}
|
|
147
|
-
declare const ToastContext:
|
|
250
|
+
declare const ToastContext: react__default.Context<ToastContextType | undefined>;
|
|
148
251
|
declare function ToastProvider({ children }: {
|
|
149
252
|
children: ReactNode;
|
|
150
253
|
}): react_jsx_runtime.JSX.Element;
|
|
151
254
|
|
|
152
255
|
declare function useToast(): ToastContextType;
|
|
153
256
|
|
|
154
|
-
export { type BaseComponentProps, type
|
|
257
|
+
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, PASTEL_PALETTES, type PastelPalette, RelationPickerCell, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, getDeterministicPastelBadge, measureTextWidth, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, splitHeaderTitle, useColumnReorder, useColumnResize, useToast };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
+
import { RecordData, SchemaDef, ColumnDef, CellValue } from '@universe-platform/shared';
|
|
3
|
+
export * from '@universe-platform/shared';
|
|
2
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import react__default, { ReactNode } from 'react';
|
|
4
7
|
|
|
5
8
|
declare function cn(...inputs: ClassValue[]): string;
|
|
6
9
|
|
|
@@ -18,6 +21,14 @@ declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): v
|
|
|
18
21
|
*/
|
|
19
22
|
declare function formatPhoneDisplay(phone: string): string;
|
|
20
23
|
|
|
24
|
+
interface PastelPalette {
|
|
25
|
+
bg: string;
|
|
26
|
+
text: string;
|
|
27
|
+
border: string;
|
|
28
|
+
}
|
|
29
|
+
declare const PASTEL_PALETTES: PastelPalette[];
|
|
30
|
+
declare function getDeterministicPastelBadge(key: string): PastelPalette;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Core definitions for Universe UI components.
|
|
23
34
|
* These interfaces define the standard contract that all generic visual components
|
|
@@ -57,53 +68,6 @@ interface BaseComponentProps<TData = any, TConfig = Record<string, any>> extends
|
|
|
57
68
|
"data-testid"?: string;
|
|
58
69
|
}
|
|
59
70
|
|
|
60
|
-
/**
|
|
61
|
-
* Table data schemas and record definitions for Universe UI components.
|
|
62
|
-
*/
|
|
63
|
-
interface ColumnDef {
|
|
64
|
-
name: string;
|
|
65
|
-
type?: string;
|
|
66
|
-
defaultValue?: any;
|
|
67
|
-
isRequired?: boolean;
|
|
68
|
-
isUnique?: boolean;
|
|
69
|
-
referencedTableId?: string;
|
|
70
|
-
referencedTableName?: string;
|
|
71
|
-
displayField?: string;
|
|
72
|
-
currencySymbol?: string;
|
|
73
|
-
subTableDisplayFields?: string[];
|
|
74
|
-
contactMapping?: {
|
|
75
|
-
phoneCol?: string;
|
|
76
|
-
emailCol?: string;
|
|
77
|
-
nameParts?: Array<{
|
|
78
|
-
type: 'LOCAL' | 'PARENT';
|
|
79
|
-
parentTableId?: string;
|
|
80
|
-
columnId: string;
|
|
81
|
-
}>;
|
|
82
|
-
} | null;
|
|
83
|
-
order?: number;
|
|
84
|
-
isHidden?: boolean;
|
|
85
|
-
config?: {
|
|
86
|
-
enableWhatsApp?: boolean;
|
|
87
|
-
actionType?: string;
|
|
88
|
-
actionPhoneColumn?: string;
|
|
89
|
-
[key: string]: any;
|
|
90
|
-
} | null;
|
|
91
|
-
}
|
|
92
|
-
interface SchemaDef {
|
|
93
|
-
columns?: ColumnDef[];
|
|
94
|
-
[key: string]: any;
|
|
95
|
-
}
|
|
96
|
-
interface RecordData {
|
|
97
|
-
id: string;
|
|
98
|
-
data: Record<string, any>;
|
|
99
|
-
}
|
|
100
|
-
interface DriveFileValue {
|
|
101
|
-
fileId: string;
|
|
102
|
-
fileUrl: string;
|
|
103
|
-
fileName: string;
|
|
104
|
-
url?: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
71
|
interface TableConfig extends SchemaDef {
|
|
108
72
|
}
|
|
109
73
|
type TableData = RecordData[];
|
|
@@ -120,6 +84,145 @@ interface DeleteRecordPayload {
|
|
|
120
84
|
|
|
121
85
|
declare function TableBlock(props: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
122
86
|
|
|
87
|
+
interface UseColumnResizeOptions {
|
|
88
|
+
storageKey: string;
|
|
89
|
+
defaultWidth?: number;
|
|
90
|
+
minWidth?: number;
|
|
91
|
+
maxWidth?: number;
|
|
92
|
+
getMinColWidth?: (colName: string) => number;
|
|
93
|
+
}
|
|
94
|
+
declare function useColumnResize({ storageKey, defaultWidth, minWidth, maxWidth, getMinColWidth, }: UseColumnResizeOptions): {
|
|
95
|
+
columnWidths: Record<string, number>;
|
|
96
|
+
setColumnWidths: react.Dispatch<react.SetStateAction<Record<string, number>>>;
|
|
97
|
+
resizingCol: {
|
|
98
|
+
name: string;
|
|
99
|
+
startWidth: number;
|
|
100
|
+
startX: number;
|
|
101
|
+
minWidth: number;
|
|
102
|
+
} | null;
|
|
103
|
+
startResize: (colName: string, currentWidth: number, clientX: number, customMinWidth?: number) => void;
|
|
104
|
+
getWidth: (colName: string, fallback?: number) => number;
|
|
105
|
+
minWidth: number;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
interface UseColumnReorderOptions {
|
|
109
|
+
onReorder: (draggedName: string, dropTargetName: string) => void | Promise<void>;
|
|
110
|
+
disabled?: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare function useColumnReorder({ onReorder, disabled, }: UseColumnReorderOptions): {
|
|
113
|
+
draggedColName: string | null;
|
|
114
|
+
dragOverColName: string | null;
|
|
115
|
+
isDragging: (colName: string) => boolean;
|
|
116
|
+
isDragOver: (colName: string) => boolean;
|
|
117
|
+
getHeaderDragProps: (colName: string) => {
|
|
118
|
+
draggable: boolean;
|
|
119
|
+
onDragStart?: undefined;
|
|
120
|
+
onDragOver?: undefined;
|
|
121
|
+
onDragLeave?: undefined;
|
|
122
|
+
onDrop?: undefined;
|
|
123
|
+
onDragEnd?: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
draggable: boolean;
|
|
126
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
127
|
+
onDragOver: (e: React.DragEvent) => void;
|
|
128
|
+
onDragLeave: () => void;
|
|
129
|
+
onDrop: (e: React.DragEvent) => void;
|
|
130
|
+
onDragEnd: () => void;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Measure the width of a given text string in canvas 2D context using the specified font.
|
|
136
|
+
*/
|
|
137
|
+
declare function measureTextWidth(text: string, font?: string): number;
|
|
138
|
+
interface SplitTitleResult {
|
|
139
|
+
isSingleWord: boolean;
|
|
140
|
+
line1: string;
|
|
141
|
+
line2?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Splits a header title:
|
|
145
|
+
* - 1 word: stays on 1 line.
|
|
146
|
+
* - 2 or more words: divided as equally as possible between 2 lines without cutting any word.
|
|
147
|
+
*/
|
|
148
|
+
declare function splitHeaderTitle(name: string): SplitTitleResult;
|
|
149
|
+
/**
|
|
150
|
+
* Calculate the minimum column width needed to display the header title cleanly:
|
|
151
|
+
* - If 1 word: minimum width is that word + padding + icon.
|
|
152
|
+
* - If 2+ words: minimum width is the longest line + padding + icon.
|
|
153
|
+
* - For specialized field types like GOOGLE_CONTACT: ensures room for button.
|
|
154
|
+
* Words are NEVER cut or truncated with ellipsis.
|
|
155
|
+
*/
|
|
156
|
+
declare function calculateMinColumnWidth(name: string, isSubTable?: boolean, colType?: string): number;
|
|
157
|
+
interface ColumnHeaderTitleProps {
|
|
158
|
+
name: string;
|
|
159
|
+
width?: number;
|
|
160
|
+
isSubTable?: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Header title component:
|
|
164
|
+
* - Default / when enough width: takes up entire line on 1 single row.
|
|
165
|
+
* - When column is shrunk below full-line width: divides evenly into 2 rows without cutting any word.
|
|
166
|
+
* - Single words always stay on 1 row.
|
|
167
|
+
*/
|
|
168
|
+
declare function ColumnHeaderTitle({ name, width, isSubTable }: ColumnHeaderTitleProps): react_jsx_runtime.JSX.Element;
|
|
169
|
+
|
|
170
|
+
declare function formatConflictCellValue(rawVal: any, colDef?: ColumnDef | {
|
|
171
|
+
name: string;
|
|
172
|
+
type?: string;
|
|
173
|
+
config?: any;
|
|
174
|
+
}, relationOptionsMap?: Record<string, any[]>): react__default.ReactNode;
|
|
175
|
+
|
|
176
|
+
interface DatePickerCellProps {
|
|
177
|
+
value: CellValue<'DATE'> | Date | number;
|
|
178
|
+
onChange: (value: CellValue<'DATE'>) => void;
|
|
179
|
+
column?: ColumnDef;
|
|
180
|
+
readOnly?: boolean;
|
|
181
|
+
}
|
|
182
|
+
declare function DatePickerCell({ value, onChange, readOnly }: DatePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
183
|
+
|
|
184
|
+
interface TimePickerCellProps {
|
|
185
|
+
value: CellValue<'TIME'> | Date;
|
|
186
|
+
onChange: (value: CellValue<'TIME'>) => void;
|
|
187
|
+
column?: ColumnDef;
|
|
188
|
+
readOnly?: boolean;
|
|
189
|
+
}
|
|
190
|
+
declare function parseTimeParts(val: any): {
|
|
191
|
+
hour: number;
|
|
192
|
+
minute: number;
|
|
193
|
+
} | null;
|
|
194
|
+
declare function formatTimeIso(hour: number, minute: number): string;
|
|
195
|
+
declare function formatTimeInput(input: string | null | undefined): string;
|
|
196
|
+
declare function TimePickerCell({ value, onChange, readOnly }: TimePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
197
|
+
|
|
198
|
+
interface LinkPickerCellProps {
|
|
199
|
+
value: CellValue<'LINK'> | string;
|
|
200
|
+
onChange: (value: CellValue<'LINK'>) => void;
|
|
201
|
+
column?: ColumnDef;
|
|
202
|
+
readOnly?: boolean;
|
|
203
|
+
}
|
|
204
|
+
declare function parseLinkValue(val: CellValue<'LINK'> | string): {
|
|
205
|
+
url: string;
|
|
206
|
+
label: string;
|
|
207
|
+
};
|
|
208
|
+
declare function resolveProtocol(url: string): string;
|
|
209
|
+
declare function LinkPickerCell({ value, onChange, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
interface RelationPickerCellProps {
|
|
212
|
+
value: CellValue<'RELATION'> | string;
|
|
213
|
+
onChange: (value: CellValue<'RELATION'>) => void;
|
|
214
|
+
column: ColumnDef<'RELATION'> | ColumnDef;
|
|
215
|
+
context?: any;
|
|
216
|
+
rowId?: string;
|
|
217
|
+
readOnly?: boolean;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Normalizes any relation value into a canonical string[] of record IDs.
|
|
221
|
+
* Handles legacy single-string records, empty strings, null/undefined, and object shapes.
|
|
222
|
+
*/
|
|
223
|
+
declare function normalizeRelationValue(val: any): string[];
|
|
224
|
+
declare function RelationPickerCell({ value, onChange, column, context, rowId, readOnly, }: RelationPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
225
|
+
|
|
123
226
|
/**
|
|
124
227
|
* UNIVERSE_COMPONENTS
|
|
125
228
|
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
@@ -144,11 +247,11 @@ interface ToastContextType {
|
|
|
144
247
|
showError: (error: string | Error | null | undefined, title?: string) => void;
|
|
145
248
|
removeToast: (id: string) => void;
|
|
146
249
|
}
|
|
147
|
-
declare const ToastContext:
|
|
250
|
+
declare const ToastContext: react__default.Context<ToastContextType | undefined>;
|
|
148
251
|
declare function ToastProvider({ children }: {
|
|
149
252
|
children: ReactNode;
|
|
150
253
|
}): react_jsx_runtime.JSX.Element;
|
|
151
254
|
|
|
152
255
|
declare function useToast(): ToastContextType;
|
|
153
256
|
|
|
154
|
-
export { type BaseComponentProps, type
|
|
257
|
+
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, DatePickerCell, type DeleteRecordPayload, LinkPickerCell, PASTEL_PALETTES, type PastelPalette, RelationPickerCell, type SplitTitleResult, TableBlock, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, UNIVERSE_COMPONENTS, type UniverseComponentType, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, calculateMinColumnWidth, cn, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, getDeterministicPastelBadge, measureTextWidth, normalizeRelationValue, openWhatsAppChat, parseLinkValue, parseTimeParts, resolveProtocol, splitHeaderTitle, useColumnReorder, useColumnResize, useToast };
|