@universe-platform/ui 0.1.0-beta.7 → 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 +524 -18
- package/dist/index.d.mts +167 -45
- package/dist/index.d.ts +167 -45
- package/dist/index.js +2988 -715
- package/dist/index.mjs +3005 -706
- package/dist/phone.d.mts +38 -0
- package/dist/phone.d.ts +38 -0
- package/dist/phone.js +90 -0
- package/dist/phone.mjs +59 -0
- package/package.json +7 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
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
|
|
|
10
|
+
/**
|
|
11
|
+
* WhatsApp opener and phone formatting utilities.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Robust WhatsApp Opener (Desktop App with Web Fallback).
|
|
15
|
+
* Tries the direct protocol first (whatsapp://) and falls back to WhatsApp Web
|
|
16
|
+
* if the app is not installed (window didn't lose focus).
|
|
17
|
+
*/
|
|
18
|
+
declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Formats a phone number for local UI display (e.g. Israeli 05X-XXX-XXXX format).
|
|
21
|
+
*/
|
|
22
|
+
declare function formatPhoneDisplay(phone: string): string;
|
|
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
|
+
|
|
7
32
|
/**
|
|
8
33
|
* Core definitions for Universe UI components.
|
|
9
34
|
* These interfaces define the standard contract that all generic visual components
|
|
@@ -43,48 +68,6 @@ interface BaseComponentProps<TData = any, TConfig = Record<string, any>> extends
|
|
|
43
68
|
"data-testid"?: string;
|
|
44
69
|
}
|
|
45
70
|
|
|
46
|
-
/**
|
|
47
|
-
* Table data schemas and record definitions for Universe UI components.
|
|
48
|
-
*/
|
|
49
|
-
interface ColumnDef {
|
|
50
|
-
name: string;
|
|
51
|
-
type?: string;
|
|
52
|
-
defaultValue?: any;
|
|
53
|
-
isRequired?: boolean;
|
|
54
|
-
isUnique?: boolean;
|
|
55
|
-
referencedTableId?: string;
|
|
56
|
-
referencedTableName?: string;
|
|
57
|
-
displayField?: string;
|
|
58
|
-
currencySymbol?: string;
|
|
59
|
-
subTableDisplayFields?: string[];
|
|
60
|
-
actionTemplate?: string | null;
|
|
61
|
-
contactMapping?: {
|
|
62
|
-
phoneCol?: string;
|
|
63
|
-
emailCol?: string;
|
|
64
|
-
nameParts?: Array<{
|
|
65
|
-
type: 'LOCAL' | 'PARENT';
|
|
66
|
-
parentTableId?: string;
|
|
67
|
-
columnId: string;
|
|
68
|
-
}>;
|
|
69
|
-
} | null;
|
|
70
|
-
order?: number;
|
|
71
|
-
isHidden?: boolean;
|
|
72
|
-
}
|
|
73
|
-
interface SchemaDef {
|
|
74
|
-
columns?: ColumnDef[];
|
|
75
|
-
[key: string]: any;
|
|
76
|
-
}
|
|
77
|
-
interface RecordData {
|
|
78
|
-
id: string;
|
|
79
|
-
data: Record<string, any>;
|
|
80
|
-
}
|
|
81
|
-
interface DriveFileValue {
|
|
82
|
-
fileId: string;
|
|
83
|
-
fileUrl: string;
|
|
84
|
-
fileName: string;
|
|
85
|
-
url?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
71
|
interface TableConfig extends SchemaDef {
|
|
89
72
|
}
|
|
90
73
|
type TableData = RecordData[];
|
|
@@ -101,6 +84,145 @@ interface DeleteRecordPayload {
|
|
|
101
84
|
|
|
102
85
|
declare function TableBlock(props: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
103
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
|
+
|
|
104
226
|
/**
|
|
105
227
|
* UNIVERSE_COMPONENTS
|
|
106
228
|
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
@@ -125,11 +247,11 @@ interface ToastContextType {
|
|
|
125
247
|
showError: (error: string | Error | null | undefined, title?: string) => void;
|
|
126
248
|
removeToast: (id: string) => void;
|
|
127
249
|
}
|
|
128
|
-
declare const ToastContext:
|
|
250
|
+
declare const ToastContext: react__default.Context<ToastContextType | undefined>;
|
|
129
251
|
declare function ToastProvider({ children }: {
|
|
130
252
|
children: ReactNode;
|
|
131
253
|
}): react_jsx_runtime.JSX.Element;
|
|
132
254
|
|
|
133
255
|
declare function useToast(): ToastContextType;
|
|
134
256
|
|
|
135
|
-
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,9 +1,34 @@
|
|
|
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
|
|
|
10
|
+
/**
|
|
11
|
+
* WhatsApp opener and phone formatting utilities.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Robust WhatsApp Opener (Desktop App with Web Fallback).
|
|
15
|
+
* Tries the direct protocol first (whatsapp://) and falls back to WhatsApp Web
|
|
16
|
+
* if the app is not installed (window didn't lose focus).
|
|
17
|
+
*/
|
|
18
|
+
declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Formats a phone number for local UI display (e.g. Israeli 05X-XXX-XXXX format).
|
|
21
|
+
*/
|
|
22
|
+
declare function formatPhoneDisplay(phone: string): string;
|
|
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
|
+
|
|
7
32
|
/**
|
|
8
33
|
* Core definitions for Universe UI components.
|
|
9
34
|
* These interfaces define the standard contract that all generic visual components
|
|
@@ -43,48 +68,6 @@ interface BaseComponentProps<TData = any, TConfig = Record<string, any>> extends
|
|
|
43
68
|
"data-testid"?: string;
|
|
44
69
|
}
|
|
45
70
|
|
|
46
|
-
/**
|
|
47
|
-
* Table data schemas and record definitions for Universe UI components.
|
|
48
|
-
*/
|
|
49
|
-
interface ColumnDef {
|
|
50
|
-
name: string;
|
|
51
|
-
type?: string;
|
|
52
|
-
defaultValue?: any;
|
|
53
|
-
isRequired?: boolean;
|
|
54
|
-
isUnique?: boolean;
|
|
55
|
-
referencedTableId?: string;
|
|
56
|
-
referencedTableName?: string;
|
|
57
|
-
displayField?: string;
|
|
58
|
-
currencySymbol?: string;
|
|
59
|
-
subTableDisplayFields?: string[];
|
|
60
|
-
actionTemplate?: string | null;
|
|
61
|
-
contactMapping?: {
|
|
62
|
-
phoneCol?: string;
|
|
63
|
-
emailCol?: string;
|
|
64
|
-
nameParts?: Array<{
|
|
65
|
-
type: 'LOCAL' | 'PARENT';
|
|
66
|
-
parentTableId?: string;
|
|
67
|
-
columnId: string;
|
|
68
|
-
}>;
|
|
69
|
-
} | null;
|
|
70
|
-
order?: number;
|
|
71
|
-
isHidden?: boolean;
|
|
72
|
-
}
|
|
73
|
-
interface SchemaDef {
|
|
74
|
-
columns?: ColumnDef[];
|
|
75
|
-
[key: string]: any;
|
|
76
|
-
}
|
|
77
|
-
interface RecordData {
|
|
78
|
-
id: string;
|
|
79
|
-
data: Record<string, any>;
|
|
80
|
-
}
|
|
81
|
-
interface DriveFileValue {
|
|
82
|
-
fileId: string;
|
|
83
|
-
fileUrl: string;
|
|
84
|
-
fileName: string;
|
|
85
|
-
url?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
71
|
interface TableConfig extends SchemaDef {
|
|
89
72
|
}
|
|
90
73
|
type TableData = RecordData[];
|
|
@@ -101,6 +84,145 @@ interface DeleteRecordPayload {
|
|
|
101
84
|
|
|
102
85
|
declare function TableBlock(props: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
103
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
|
+
|
|
104
226
|
/**
|
|
105
227
|
* UNIVERSE_COMPONENTS
|
|
106
228
|
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
@@ -125,11 +247,11 @@ interface ToastContextType {
|
|
|
125
247
|
showError: (error: string | Error | null | undefined, title?: string) => void;
|
|
126
248
|
removeToast: (id: string) => void;
|
|
127
249
|
}
|
|
128
|
-
declare const ToastContext:
|
|
250
|
+
declare const ToastContext: react__default.Context<ToastContextType | undefined>;
|
|
129
251
|
declare function ToastProvider({ children }: {
|
|
130
252
|
children: ReactNode;
|
|
131
253
|
}): react_jsx_runtime.JSX.Element;
|
|
132
254
|
|
|
133
255
|
declare function useToast(): ToastContextType;
|
|
134
256
|
|
|
135
|
-
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 };
|