@universe-platform/ui 0.1.0-beta.8 → 0.1.0-beta.80
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 +2103 -35
- package/dist/index.d.mts +844 -49
- package/dist/index.d.ts +844 -49
- package/dist/index.js +22163 -3230
- package/dist/index.mjs +21904 -3094
- package/dist/phone.d.mts +12 -1
- package/dist/phone.d.ts +12 -1
- package/dist/phone.js +20 -0
- package/dist/phone.mjs +19 -0
- package/package.json +10 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
+
import { ColumnDef } from './columns';
|
|
3
|
+
export { BaseColumnDef, COLUMN_CAPABILITIES, COLUMN_DEFAULT_INPUT_CONFIG, COLUMN_TYPES, COLUMN_TYPE_LABELS, ColumnCapabilities, ColumnConfig, ColumnConfigMap, ColumnDef, ColumnDefaultInputConfig, ColumnInfo, ColumnType, CurrencyConfig, ExtendedColumnInfo, GoogleContactConfig, GoogleContactNamePart, PhoneConfig, RelationConfig, SubTableConfig, TEXT_REPRESENTABLE_TYPES, TextRepresentableColumnType, TypedColumnDef, isTextRepresentable } from './columns';
|
|
4
|
+
import { RecordData, CellValue } from './records';
|
|
5
|
+
export { CellValue, ColumnValueMap, DriveFileValue, GoogleContactValue, LinkValue, RecordData, SubTableEntryValue, SubTableResolvedEntryValue } from './records';
|
|
6
|
+
import { WhatsAppConfig } from './pages';
|
|
7
|
+
export { BaseComponent, ComponentType, EditorApp, EditorPage, PageComponent, PageInput, TableComponent, WhatsAppConfig } from './pages';
|
|
8
|
+
import { SchemaDef } from './schema';
|
|
9
|
+
export { SchemaDef, TableImportSettings, TableMeta } from './schema';
|
|
10
|
+
import { TemplateIdentity } from './whatsappValidation';
|
|
11
|
+
export * from './whatsappValidation';
|
|
12
|
+
export { StatusConfig, TemplateIdentity, TemplateValidationParams, TemplateValidationResult, extractUniqueVariableIndices, extractVariableIndices, findVariableAtPosition, formatFileSize, getNextVariableIndex, getStatusConfig, hasBracketSpaces, hasConsecutiveVariables, hasFloatingVariables, hasInsufficientContextBetweenVariables, isDuplicateTemplate, isDuplicateTemplateName, isValidTemplateName, isWordToken, reindexVariables, sanitizeTemplateNameInput, seamlessVariableEngine, validateSequentialVariables, validateTemplateBody, validateWhatsAppTemplate, validateWordToVariableRatio } from './whatsappValidation';
|
|
13
|
+
export * from './formula';
|
|
14
|
+
export * from './relationCopy';
|
|
15
|
+
export * from './lookup';
|
|
16
|
+
export * from './relationButtons';
|
|
17
|
+
export * from './rangeFilter';
|
|
18
|
+
export * from './defaultFilters';
|
|
19
|
+
export * from './formulaFilters';
|
|
20
|
+
export * from './formulaBuilder';
|
|
2
21
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
22
|
+
import * as react from 'react';
|
|
23
|
+
import react__default, { ReactNode } from 'react';
|
|
4
24
|
|
|
5
25
|
declare function cn(...inputs: ClassValue[]): string;
|
|
6
26
|
|
|
@@ -18,6 +38,48 @@ declare function openWhatsAppChat(phone: string, defaultCountryCode?: string): v
|
|
|
18
38
|
*/
|
|
19
39
|
declare function formatPhoneDisplay(phone: string): string;
|
|
20
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Phone number sanitization, validation, and WhatsApp link generation utilities.
|
|
43
|
+
* Pure functions with zero React or DOM dependencies for universal (server & client) usage.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* Sanitizes phone numbers by stripping whitespace, dashes, and non-numeric characters,
|
|
47
|
+
* preserving a leading '+' if present.
|
|
48
|
+
*/
|
|
49
|
+
declare function sanitizePhoneNumber(phone: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Validates whether a phone number is valid (after sanitization).
|
|
52
|
+
* Supports Israeli formats (e.g. 0501234567, 031234567) and international formats (+972..., 9-15 digits).
|
|
53
|
+
*/
|
|
54
|
+
declare function isValidPhoneNumber(phone: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Generates an official wa.me WhatsApp direct message link.
|
|
57
|
+
*
|
|
58
|
+
* @param phone Raw or sanitized phone number
|
|
59
|
+
* @param defaultCountryCode Defaults to Israeli code '972'
|
|
60
|
+
* @returns WhatsApp URL or null if phone is empty
|
|
61
|
+
*/
|
|
62
|
+
declare function generateWhatsAppLink(phone: string, defaultCountryCode?: string): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* Normalizes a phone number for WhatsApp sending (Meta international format without leading '+').
|
|
65
|
+
* - Returns empty string if input is falsy.
|
|
66
|
+
* - Trims input and removes leading '+' if it exists.
|
|
67
|
+
* - Strips all non-digit characters.
|
|
68
|
+
* - If starting with '972', returns it as is.
|
|
69
|
+
* - If starting with '0' (Israeli mobile/landline), strips '0' and prepends '972'.
|
|
70
|
+
* - If exactly 9 digits long (omitted leading zero), prepends '972'.
|
|
71
|
+
* - Returns the processed digits string.
|
|
72
|
+
*/
|
|
73
|
+
declare function normalizePhoneForWhatsApp(phone: string): string;
|
|
74
|
+
|
|
75
|
+
interface PastelPalette {
|
|
76
|
+
bg: string;
|
|
77
|
+
text: string;
|
|
78
|
+
border: string;
|
|
79
|
+
}
|
|
80
|
+
declare const PASTEL_PALETTES: PastelPalette[];
|
|
81
|
+
declare function getDeterministicPastelBadge(key: string): PastelPalette;
|
|
82
|
+
|
|
21
83
|
/**
|
|
22
84
|
* Core definitions for Universe UI components.
|
|
23
85
|
* These interfaces define the standard contract that all generic visual components
|
|
@@ -57,76 +119,799 @@ interface BaseComponentProps<TData = any, TConfig = Record<string, any>> extends
|
|
|
57
119
|
"data-testid"?: string;
|
|
58
120
|
}
|
|
59
121
|
|
|
122
|
+
type OrgRole = "OWNER" | "EDITOR" | "VIEWER";
|
|
123
|
+
interface RolePermissions {
|
|
124
|
+
permissions: ComponentPermissions;
|
|
125
|
+
readOnly: boolean;
|
|
126
|
+
}
|
|
127
|
+
declare function getRolePermissions(role?: OrgRole | null): RolePermissions;
|
|
128
|
+
|
|
129
|
+
interface TableConfig extends SchemaDef {
|
|
130
|
+
}
|
|
131
|
+
type TableData = RecordData[];
|
|
132
|
+
type RowStatusType = "success" | "failed" | "skipped" | "partial";
|
|
133
|
+
interface TableBlockProps extends Partial<BaseComponentProps<TableData, TableConfig>> {
|
|
134
|
+
exportAction?: (payload: any) => Promise<any>;
|
|
135
|
+
role?: OrgRole | null;
|
|
136
|
+
permissions?: ComponentPermissions;
|
|
137
|
+
readOnly?: boolean;
|
|
138
|
+
selectedRowIds?: string[];
|
|
139
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
140
|
+
onRowToggle?: (rowId: string, checked: boolean) => void;
|
|
141
|
+
rowStatusMap?: Record<string, {
|
|
142
|
+
status: RowStatusType;
|
|
143
|
+
tooltip?: string;
|
|
144
|
+
} | RowStatusType>;
|
|
145
|
+
editModelUrl?: string;
|
|
146
|
+
hideRelationButtons?: boolean;
|
|
147
|
+
rowExtraHeader?: string;
|
|
148
|
+
renderRowExtra?: (row: any) => ReactNode;
|
|
149
|
+
}
|
|
150
|
+
interface CreateRecordPayload {
|
|
151
|
+
records: RecordData[];
|
|
152
|
+
}
|
|
153
|
+
interface UpdateRecordPayload {
|
|
154
|
+
modifications: Record<string, Record<string, any>>;
|
|
155
|
+
}
|
|
156
|
+
interface DeleteRecordPayload {
|
|
157
|
+
ids: string[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare function TableBlockClient({ data: initialRecords, settings: schema, executeAction, exportAction, emitEvent, pageState, isLoading, isUpdating, error, isEmpty: isStateEmpty, componentId, orgId, className, 'data-testid': dataTestId, role, permissions, readOnly, selectedRowIds, onSelectionChange, onRowToggle, rowStatusMap, editModelUrl, hideRelationButtons, rowExtraHeader, renderRowExtra, }: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
161
|
+
|
|
162
|
+
declare function TableBlock(props: TableBlockProps): react_jsx_runtime.JSX.Element;
|
|
163
|
+
|
|
164
|
+
interface UseColumnResizeOptions {
|
|
165
|
+
storageKey: string;
|
|
166
|
+
defaultWidth?: number;
|
|
167
|
+
minWidth?: number;
|
|
168
|
+
maxWidth?: number;
|
|
169
|
+
getMinColWidth?: (colName: string) => number;
|
|
170
|
+
}
|
|
171
|
+
declare function useColumnResize({ storageKey, defaultWidth, minWidth, maxWidth, getMinColWidth, }: UseColumnResizeOptions): {
|
|
172
|
+
columnWidths: Record<string, number>;
|
|
173
|
+
setColumnWidths: react.Dispatch<react.SetStateAction<Record<string, number>>>;
|
|
174
|
+
resizingCol: {
|
|
175
|
+
name: string;
|
|
176
|
+
startWidth: number;
|
|
177
|
+
startX: number;
|
|
178
|
+
minWidth: number;
|
|
179
|
+
} | null;
|
|
180
|
+
startResize: (colName: string, currentWidth: number, clientX: number, customMinWidth?: number) => void;
|
|
181
|
+
getWidth: (colName: string, fallback?: number) => number;
|
|
182
|
+
minWidth: number;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
interface UseColumnReorderOptions {
|
|
186
|
+
onReorder: (draggedName: string, dropTargetName: string) => void | Promise<void>;
|
|
187
|
+
disabled?: boolean;
|
|
188
|
+
}
|
|
189
|
+
declare function useColumnReorder({ onReorder, disabled, }: UseColumnReorderOptions): {
|
|
190
|
+
draggedColName: string | null;
|
|
191
|
+
dragOverColName: string | null;
|
|
192
|
+
isDragging: (colName: string) => boolean;
|
|
193
|
+
isDragOver: (colName: string) => boolean;
|
|
194
|
+
getHeaderDragProps: (colName: string) => {
|
|
195
|
+
draggable: boolean;
|
|
196
|
+
onDragStart?: undefined;
|
|
197
|
+
onDragOver?: undefined;
|
|
198
|
+
onDragLeave?: undefined;
|
|
199
|
+
onDrop?: undefined;
|
|
200
|
+
onDragEnd?: undefined;
|
|
201
|
+
} | {
|
|
202
|
+
draggable: boolean;
|
|
203
|
+
onDragStart: (e: React.DragEvent) => void;
|
|
204
|
+
onDragOver: (e: React.DragEvent) => void;
|
|
205
|
+
onDragLeave: () => void;
|
|
206
|
+
onDrop: (e: React.DragEvent) => void;
|
|
207
|
+
onDragEnd: () => void;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
|
|
60
211
|
/**
|
|
61
|
-
*
|
|
212
|
+
* Measure the width of a given text string in canvas 2D context using the specified font.
|
|
62
213
|
*/
|
|
63
|
-
|
|
214
|
+
declare function measureTextWidth(text: string, font?: string): number;
|
|
215
|
+
interface SplitTitleResult {
|
|
216
|
+
isSingleWord: boolean;
|
|
217
|
+
line1: string;
|
|
218
|
+
line2?: string;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Splits a header title:
|
|
222
|
+
* - 1 word: stays on 1 line.
|
|
223
|
+
* - 2 or more words: divided as equally as possible between 2 lines without cutting any word.
|
|
224
|
+
*/
|
|
225
|
+
declare function splitHeaderTitle(name: string): SplitTitleResult;
|
|
226
|
+
/**
|
|
227
|
+
* Calculate the minimum column width needed to display the header title cleanly:
|
|
228
|
+
* - If 1 word: minimum width is that word + padding + icon.
|
|
229
|
+
* - If 2+ words: minimum width is the longest line + padding + icon.
|
|
230
|
+
* - For specialized field types like GOOGLE_CONTACT: ensures room for button.
|
|
231
|
+
* Words are NEVER cut or truncated with ellipsis.
|
|
232
|
+
*/
|
|
233
|
+
declare function calculateMinColumnWidth(name: string, isSubTable?: boolean, colType?: string): number;
|
|
234
|
+
interface ColumnHeaderTitleProps {
|
|
235
|
+
name: string;
|
|
236
|
+
width?: number;
|
|
237
|
+
isSubTable?: boolean;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Header title component:
|
|
241
|
+
* - Default / when enough width: takes up entire line on 1 single row.
|
|
242
|
+
* - When column is shrunk below full-line width: divides evenly into 2 rows without cutting any word.
|
|
243
|
+
* - Single words always stay on 1 row.
|
|
244
|
+
*/
|
|
245
|
+
declare function ColumnHeaderTitle({ name, width, isSubTable }: ColumnHeaderTitleProps): react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
declare function formatConflictCellValue(rawVal: any, colDef?: ColumnDef | {
|
|
64
248
|
name: string;
|
|
65
249
|
type?: string;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
250
|
+
config?: any;
|
|
251
|
+
}, relationOptionsMap?: Record<string, any[]>): react__default.ReactNode;
|
|
252
|
+
|
|
253
|
+
interface DatePickerCellProps {
|
|
254
|
+
value: CellValue<'DATE'> | Date | number;
|
|
255
|
+
onChange: (value: CellValue<'DATE'>) => void;
|
|
256
|
+
column?: ColumnDef;
|
|
257
|
+
readOnly?: boolean;
|
|
258
|
+
}
|
|
259
|
+
declare function DatePickerCell({ value, onChange, readOnly }: DatePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
260
|
+
|
|
261
|
+
interface TimePickerCellProps {
|
|
262
|
+
value: CellValue<'TIME'> | Date;
|
|
263
|
+
onChange: (value: CellValue<'TIME'>) => void;
|
|
264
|
+
column?: ColumnDef;
|
|
265
|
+
readOnly?: boolean;
|
|
266
|
+
}
|
|
267
|
+
declare function parseTimeParts(val: any): {
|
|
268
|
+
hour: number;
|
|
269
|
+
minute: number;
|
|
270
|
+
} | null;
|
|
271
|
+
declare function formatTimeIso(hour: number, minute: number): string;
|
|
272
|
+
declare function formatTimeInput(input: string | null | undefined): string;
|
|
273
|
+
declare function TimePickerCell({ value, onChange, readOnly }: TimePickerCellProps): react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
interface LinkPickerCellProps {
|
|
276
|
+
value: CellValue<'LINK'> | string;
|
|
277
|
+
onChange: (value: CellValue<'LINK'>) => void;
|
|
278
|
+
column?: ColumnDef;
|
|
279
|
+
readOnly?: boolean;
|
|
280
|
+
}
|
|
281
|
+
declare function parseLinkValue(val: CellValue<'LINK'> | string): {
|
|
282
|
+
url: string;
|
|
283
|
+
label: string;
|
|
284
|
+
};
|
|
285
|
+
declare function resolveProtocol(url: string): string;
|
|
286
|
+
declare function LinkPickerCell({ value, onChange, column, readOnly }: LinkPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
287
|
+
|
|
288
|
+
interface RelationPickerCellProps {
|
|
289
|
+
value: CellValue<'RELATION'> | string;
|
|
290
|
+
onChange: (value: CellValue<'RELATION'>) => void;
|
|
291
|
+
column: ColumnDef<'RELATION'> | ColumnDef;
|
|
292
|
+
context?: any;
|
|
293
|
+
rowId?: string;
|
|
294
|
+
readOnly?: boolean;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Normalizes any relation value into a canonical string[] of record IDs.
|
|
298
|
+
* Handles legacy single-string records, empty strings, null/undefined, and object shapes.
|
|
299
|
+
*/
|
|
300
|
+
declare function normalizeRelationValue(val: any): string[];
|
|
301
|
+
declare function RelationPickerCell({ value, onChange, column, context, rowId, readOnly, }: RelationPickerCellProps): react_jsx_runtime.JSX.Element;
|
|
302
|
+
|
|
303
|
+
interface RelationFilterOption {
|
|
304
|
+
id: string;
|
|
305
|
+
label: string;
|
|
306
|
+
}
|
|
307
|
+
type RelationFilterPayload = string[] | {
|
|
308
|
+
operator: 'notIn';
|
|
309
|
+
values: string[];
|
|
310
|
+
} | undefined;
|
|
311
|
+
interface RelationFilterPopoverProps {
|
|
312
|
+
isOpen: boolean;
|
|
313
|
+
onClose: () => void;
|
|
314
|
+
column: ColumnDef;
|
|
315
|
+
triggerRect: DOMRect | null;
|
|
316
|
+
options: RelationFilterOption[];
|
|
317
|
+
filterValue?: string[] | {
|
|
318
|
+
operator: 'notIn';
|
|
319
|
+
values: string[];
|
|
320
|
+
};
|
|
321
|
+
selectedValues?: string[];
|
|
322
|
+
onSelectionChange: (payload: RelationFilterPayload) => void;
|
|
323
|
+
isLoading?: boolean;
|
|
324
|
+
}
|
|
325
|
+
declare function RelationFilterPopover({ isOpen, onClose, column, triggerRect, options, filterValue, selectedValues, onSelectionChange, isLoading, }: RelationFilterPopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* checkElementTruncation - Standard browser-accurate truncation detection using the Range API.
|
|
329
|
+
* Measures the exact unconstrained bounding box of rendered text without container padding interference.
|
|
330
|
+
*/
|
|
331
|
+
declare const checkElementTruncation: (el: HTMLElement | null) => boolean;
|
|
332
|
+
/**
|
|
333
|
+
* useSmartTooltip - Reusable hook for detecting text truncation and rendering
|
|
334
|
+
* a custom portal tooltip bubble strictly when content is clipped (scrollWidth > el.clientWidth).
|
|
335
|
+
*/
|
|
336
|
+
declare function useSmartTooltip<T extends HTMLElement = HTMLElement>(): {
|
|
337
|
+
targetRef: react__default.RefObject<T | null>;
|
|
338
|
+
checkTruncation: () => boolean;
|
|
339
|
+
handleMouseEnter: () => void;
|
|
340
|
+
handleMouseLeave: () => void;
|
|
341
|
+
hideBubble: () => void;
|
|
342
|
+
renderTooltip: (text?: string, dir?: "ltr" | "rtl" | "auto") => react__default.ReactPortal | null;
|
|
343
|
+
isTruncated: boolean;
|
|
344
|
+
showBubble: boolean;
|
|
345
|
+
};
|
|
346
|
+
interface TruncatedTooltipProps {
|
|
347
|
+
text: string;
|
|
348
|
+
tooltipText?: string;
|
|
349
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
350
|
+
className?: string;
|
|
351
|
+
wrapperClassName?: string;
|
|
352
|
+
children?: react__default.ReactNode;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* TruncatedTooltip - A text container that applies ellipsis truncation
|
|
356
|
+
* and only displays a custom portal tooltip when text overflows horizontal bounds.
|
|
357
|
+
* Expands to full cell dimensions (w-full h-full min-h-[inherit]) for reliable hover detection.
|
|
358
|
+
* No native browser title attribute is rendered.
|
|
359
|
+
*/
|
|
360
|
+
declare const TruncatedTooltip: react__default.FC<TruncatedTooltipProps>;
|
|
361
|
+
interface SmartTextCellProps {
|
|
362
|
+
value: any;
|
|
363
|
+
onChange?: (val: any) => void;
|
|
364
|
+
readOnly?: boolean;
|
|
365
|
+
type?: 'text' | 'number' | 'tel';
|
|
366
|
+
placeholder?: string;
|
|
367
|
+
className?: string;
|
|
368
|
+
prefix?: react__default.ReactNode;
|
|
369
|
+
suffix?: react__default.ReactNode;
|
|
370
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
371
|
+
tooltipText?: string;
|
|
372
|
+
step?: string;
|
|
373
|
+
onFocus?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
374
|
+
onBlur?: (e: react__default.FocusEvent<HTMLInputElement>) => void;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* SmartTextCell - Text cell with intelligent hover tooltip.
|
|
378
|
+
* Only displays the custom portal tooltip bubble if the text is actually
|
|
379
|
+
* clipped/truncated within its visible boundary (scrollWidth > clientWidth).
|
|
380
|
+
* Native title attributes are omitted to prevent duplicate tooltips.
|
|
381
|
+
*/
|
|
382
|
+
declare const SmartTextCell: react__default.FC<SmartTextCellProps>;
|
|
383
|
+
|
|
384
|
+
interface PlacementConfig {
|
|
385
|
+
sourceTableId: string;
|
|
386
|
+
sourceDisplayFieldId: string;
|
|
387
|
+
targetTableId: string;
|
|
388
|
+
targetFilterField1Id: string;
|
|
389
|
+
targetFilterField2Id: string;
|
|
390
|
+
targetSelectorFieldId: string;
|
|
391
|
+
targetAssignmentFieldId: string;
|
|
392
|
+
targetFilterDefaults?: Record<string, string>;
|
|
393
|
+
title?: string;
|
|
394
|
+
statusColors?: PlacementStatusSetting[];
|
|
395
|
+
defaultReturnStatusId?: string;
|
|
396
|
+
returnToSourceStatusId?: string;
|
|
397
|
+
}
|
|
398
|
+
interface PlacementStatusSetting {
|
|
399
|
+
id: string;
|
|
400
|
+
hex: string;
|
|
401
|
+
label: string;
|
|
402
|
+
}
|
|
403
|
+
declare const DEFAULT_PLACEMENT_STATUS_COLORS: PlacementStatusSetting[];
|
|
404
|
+
/** מחזיר את מזהה הסטטוס ההתחלתי התקף: זה שהוגדר, אחרת "3" אם קיים (תאימות לאחור), אחרת הראשון */
|
|
405
|
+
declare function resolveDefaultStatusId(list: PlacementStatusSetting[], wanted?: string): string;
|
|
406
|
+
/** הסטטוס שמוחל בהחזרת רשומה לרשימת המקור: זה שהוגדר להחזרה, ואם אין - ברירת המחדל */
|
|
407
|
+
declare function resolveReturnStatusId(list: PlacementStatusSetting[], returnWanted?: string, defaultWanted?: string): string;
|
|
408
|
+
interface PlacementSettingsProps {
|
|
409
|
+
config: PlacementConfig;
|
|
410
|
+
onChange: (newConfig: PlacementConfig) => void;
|
|
411
|
+
tables: Array<{
|
|
412
|
+
id: string;
|
|
413
|
+
name: string;
|
|
414
|
+
isGlobal?: boolean;
|
|
415
|
+
fields?: any[];
|
|
416
|
+
columns?: any[];
|
|
417
|
+
}>;
|
|
418
|
+
}
|
|
419
|
+
declare const PlacementStatusEditor: react__default.FC<{
|
|
420
|
+
config: PlacementConfig;
|
|
421
|
+
onChange: (newConfig: PlacementConfig) => void;
|
|
422
|
+
}>;
|
|
423
|
+
declare const PlacementSettings: react__default.FC<PlacementSettingsProps>;
|
|
424
|
+
|
|
425
|
+
interface PlacementStatusColor {
|
|
426
|
+
id: string;
|
|
427
|
+
hex: string;
|
|
428
|
+
label: string;
|
|
429
|
+
}
|
|
430
|
+
type ExecuteAction = (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
431
|
+
interface PlacementBlockProps {
|
|
432
|
+
settings?: any;
|
|
433
|
+
executeAction?: ExecuteAction;
|
|
434
|
+
componentId?: string;
|
|
435
|
+
orgId?: string;
|
|
436
|
+
/** תפקיד המשתמש בארגון - קובע הרשאות עריכה וכפתור "עריכת רכיב השיבוץ" (למנהל בלבד) */
|
|
437
|
+
role?: OrgRole | null;
|
|
438
|
+
permissions?: ComponentPermissions;
|
|
439
|
+
readOnly?: boolean;
|
|
440
|
+
/** קישור מותאם לעריכת הרכיב בדשבורד (אם לא הועבר - נבנה אוטומטית מ-orgId + componentId) */
|
|
441
|
+
editComponentUrl?: string;
|
|
442
|
+
className?: string;
|
|
443
|
+
config?: PlacementConfig;
|
|
444
|
+
fetchSourceData?: (tableId: string) => Promise<any[]>;
|
|
445
|
+
fetchTargetData?: (tableId: string) => Promise<any[]>;
|
|
446
|
+
updateAssignment?: (targetRecordId: string, sourceRecordId: string) => Promise<void>;
|
|
447
|
+
}
|
|
448
|
+
declare const PlacementBlock: react__default.FC<PlacementBlockProps>;
|
|
449
|
+
|
|
450
|
+
declare const RELATION_SEP = "::";
|
|
451
|
+
declare const RELATION_LABEL_KEY = "__label";
|
|
452
|
+
declare const NON_TEXT_TYPES: string[];
|
|
453
|
+
interface PlacementColumnOption {
|
|
454
|
+
/** הערך שנשמר ב-config (שם עמודה, או "קשר::עמודה") */
|
|
455
|
+
id: string;
|
|
456
|
+
/** מה שמוצג למשתמש */
|
|
457
|
+
name: string;
|
|
458
|
+
type?: string;
|
|
459
|
+
/** תיאור משני (סוג שדה / מאיזו טבלה) */
|
|
460
|
+
description?: string;
|
|
461
|
+
/** שם עמודת הקשר, אם העמודה באה מטבלה קשורה */
|
|
462
|
+
viaRelation?: string;
|
|
463
|
+
/** שם הטבלה הקשורה, אם העמודה באה מטבלה קשורה */
|
|
464
|
+
fromTableName?: string;
|
|
465
|
+
fromGlobalTable?: boolean;
|
|
466
|
+
}
|
|
467
|
+
type AnyTable = {
|
|
468
|
+
id: string;
|
|
469
|
+
name: string;
|
|
470
|
+
isGlobal?: boolean;
|
|
471
|
+
fields?: any[];
|
|
472
|
+
columns?: any[];
|
|
473
|
+
};
|
|
474
|
+
declare const tableColumns: (table?: {
|
|
475
|
+
fields?: any[];
|
|
476
|
+
columns?: any[];
|
|
477
|
+
} | null) => any[];
|
|
478
|
+
declare const isUserColumn: (c: any) => boolean;
|
|
479
|
+
declare const buildRelationRef: (relationColumn: string, field: string) => string;
|
|
480
|
+
declare function parseColumnRef(ref: string): {
|
|
481
|
+
relationColumn?: string;
|
|
482
|
+
field: string;
|
|
483
|
+
};
|
|
484
|
+
/** שם ידידותי להצגה: "עיר מגורים › שם העיר" */
|
|
485
|
+
declare const columnRefLabel: (ref: string) => string;
|
|
486
|
+
/**
|
|
487
|
+
* בונה את רשימת העמודות לבחירה בטבלה: עמודות הטבלה עצמה,
|
|
488
|
+
* ואחריהן (כשהן מותרות) עמודות מכל טבלה שמקושרת אליה ב-RELATION - כולל טבלאות מערכת.
|
|
489
|
+
* עמודות קשר מוצגות רק ברמה אחת (לא קשר בתוך קשר).
|
|
490
|
+
*/
|
|
491
|
+
declare function buildColumnOptions(table: AnyTable | undefined | null, allTables: AnyTable[] | undefined, opts?: {
|
|
492
|
+
textOnly?: boolean;
|
|
493
|
+
includeRelated?: boolean;
|
|
494
|
+
}): PlacementColumnOption[];
|
|
495
|
+
/**
|
|
496
|
+
* מעשיר רשומות בעמודות וירטואליות מהטבלאות הקשורות, לפי relationOptions שחזר מהשרת:
|
|
497
|
+
* data["<קשר>::<עמודה>"] = ערך העמודה ברשומה/ות הקשורות
|
|
498
|
+
* data["<קשר>::__label"] = התווית (displayField) של הרשומה/ות הקשורות
|
|
499
|
+
* הערך המקורי של עמודת הקשר (ה-IDs) נשאר כמות שהוא, כי הוא משמש לשמירה.
|
|
500
|
+
*/
|
|
501
|
+
declare function enrichRowsWithRelations<T extends {
|
|
502
|
+
data: Record<string, any>;
|
|
503
|
+
}>(rows: T[], columns: any[], relationOptions: Record<string, any[]> | undefined): T[];
|
|
504
|
+
/** קורא ערך עמודה (רגילה או מטבלה קשורה); עמודת קשר "חשופה" מוצגת לפי התווית שלה ולא לפי ה-ID */
|
|
505
|
+
declare function readColumnValue(data: Record<string, any> | undefined, ref: string): any;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* הגדרות רכיב "דיווחים לתשלום" (נשמרות ב-config של הרכיב בעמוד).
|
|
509
|
+
* שלוש טבלאות מקושרות: מדווחים <- דיווחים -> תשלומים.
|
|
510
|
+
* שמות העמודות חופשיים לגמרי - הרכיב רק צריך לדעת איזו עמודה משמשת לאיזה תפקיד.
|
|
511
|
+
*/
|
|
512
|
+
interface PaymentReportsConfig {
|
|
513
|
+
title?: string;
|
|
514
|
+
reportsTableId: string;
|
|
515
|
+
/** עמודת RELATION אל טבלת המדווחים (חובה) */
|
|
516
|
+
reportReporterColumn: string;
|
|
517
|
+
/** עמודת RELATION אל טבלת התשלומים. ריקה = הדיווח טרם שולם (חובה) */
|
|
518
|
+
reportPaymentColumn: string;
|
|
519
|
+
/** עמודת סכום (NUMBER / CURRENCY) שמסוכמת לתשלום (חובה) */
|
|
520
|
+
reportAmountColumn: string;
|
|
521
|
+
/** עמודת תאריך (DATE) - מאפשרת סינון לפי חודש (אופציונלי) */
|
|
522
|
+
reportDateColumn?: string;
|
|
523
|
+
/** עמודת כמות, למשל מספר שיעורים - מוסיפה סיכום וממוצע (אופציונלי) */
|
|
524
|
+
reportQuantityColumn?: string;
|
|
525
|
+
/** אילו עמודות להציג בלשונית הדיווחים, ובאיזה סדר. ריק = כל העמודות */
|
|
526
|
+
reportDisplayColumns?: string[];
|
|
527
|
+
paymentsTableId: string;
|
|
528
|
+
/** עמודת הסכום הכולל בתשלום (חובה) */
|
|
529
|
+
paymentTotalColumn: string;
|
|
530
|
+
/** עמודת תאריך קבלה (DATE). ריקה = ממתין לקבלה, מלאה = עבר להנה"ח (חובה) */
|
|
531
|
+
paymentReceiptDateColumn: string;
|
|
532
|
+
/** עמודת אסמכתא מסוג GOOGLE_DRIVE_FILE (אופציונלי) */
|
|
533
|
+
paymentProofColumn?: string;
|
|
534
|
+
/** עמודת RELATION אל המדווח בתשלום - נכתבת אוטומטית בעת יצירת תשלום (אופציונלי) */
|
|
535
|
+
paymentReporterColumn?: string;
|
|
536
|
+
portalEnabled?: boolean;
|
|
537
|
+
/** טבלת המדווחים (נגזרת מעמודת הקשר למדווח בטבלת הדיווחים) */
|
|
538
|
+
reportersTableId?: string;
|
|
539
|
+
/** עמודת האימייל בטבלת המדווחים: מזהה ייחודי והרשאת כניסה */
|
|
540
|
+
reporterEmailColumn?: string;
|
|
541
|
+
reporterFirstNameColumn?: string;
|
|
542
|
+
reporterLastNameColumn?: string;
|
|
543
|
+
reporterPhoneColumn?: string;
|
|
544
|
+
/** עמודות נוספות של המדווח שמוצגות לקריאה בלבד בטופס הדיווח (למשל שיעור לשעה) */
|
|
545
|
+
reporterDisplayColumns?: string[];
|
|
546
|
+
/** רכיב FORM על טבלת המדווחים: הטופס הראשון (הרשמה) */
|
|
547
|
+
registrationFormId?: string;
|
|
548
|
+
/** רכיב FORM על טבלת הדיווחים: נותן לטופס הדיווח עיצוב, כותרת והודעת הצלחה (אופציונלי) */
|
|
549
|
+
reportFormId?: string;
|
|
72
550
|
currencySymbol?: string;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
551
|
+
/** שם תיקיית ה-Drive של האסמכתאות */
|
|
552
|
+
proofFolderName?: string;
|
|
553
|
+
}
|
|
554
|
+
type PaymentReportsTab = 'unpaid' | 'paid' | 'receipts';
|
|
555
|
+
interface PaymentReportsBlockProps {
|
|
556
|
+
config?: any;
|
|
557
|
+
settings?: any;
|
|
558
|
+
executeAction?: (actionType: string, payload?: any) => Promise<any>;
|
|
559
|
+
orgId?: string;
|
|
560
|
+
componentId?: string;
|
|
561
|
+
/** תפקיד המשתמש (אם הוזן) - השרת הוא הגורם המכריע בהרשאות */
|
|
562
|
+
role?: string | null;
|
|
563
|
+
readOnly?: boolean;
|
|
564
|
+
permissions?: {
|
|
565
|
+
canUpdate?: boolean;
|
|
566
|
+
canDelete?: boolean;
|
|
567
|
+
canCreate?: boolean;
|
|
568
|
+
};
|
|
569
|
+
className?: string;
|
|
570
|
+
}
|
|
571
|
+
/** שדות החובה של ההגדרה - משמשים לבדיקת תקינות בעורך וברכיב */
|
|
572
|
+
declare const PAYMENT_REPORTS_REQUIRED: Array<keyof PaymentReportsConfig>;
|
|
573
|
+
declare function missingPaymentReportsFields(c?: Partial<PaymentReportsConfig> | null): string[];
|
|
574
|
+
/** שמות הפעולות בשרת */
|
|
575
|
+
declare const PAYMENT_REPORTS_ACTIONS: {
|
|
576
|
+
readonly CREATE_PAYMENT: "PAYMENT_REPORTS_CREATE_PAYMENT";
|
|
577
|
+
readonly CANCEL_PAYMENT: "PAYMENT_REPORTS_CANCEL_PAYMENT";
|
|
578
|
+
readonly CONFIRM_RECEIPT: "PAYMENT_REPORTS_CONFIRM_RECEIPT";
|
|
579
|
+
readonly UNDO_RECEIPT: "PAYMENT_REPORTS_UNDO_RECEIPT";
|
|
580
|
+
readonly SET_PROOF: "PAYMENT_REPORTS_SET_PROOF";
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
declare const PaymentReportsBlock: react__default.FC<PaymentReportsBlockProps>;
|
|
584
|
+
|
|
585
|
+
interface MetaTemplateComponent {
|
|
586
|
+
type: "HEADER" | "BODY" | "FOOTER" | "BUTTONS" | string;
|
|
587
|
+
format?: "TEXT" | "IMAGE" | "DOCUMENT" | "VIDEO" | string;
|
|
588
|
+
text?: string;
|
|
589
|
+
example?: {
|
|
590
|
+
header_handle?: string[];
|
|
591
|
+
body_text?: string[][];
|
|
89
592
|
[key: string]: any;
|
|
90
|
-
}
|
|
593
|
+
};
|
|
594
|
+
[key: string]: any;
|
|
91
595
|
}
|
|
92
|
-
interface
|
|
93
|
-
|
|
596
|
+
interface MetaWhatsAppTemplate {
|
|
597
|
+
id: string;
|
|
598
|
+
name: string;
|
|
599
|
+
status: "APPROVED" | "PENDING" | "IN_REVIEW" | "REJECTED" | "PAUSED" | string;
|
|
600
|
+
category: "MARKETING" | "UTILITY" | string;
|
|
601
|
+
language: string;
|
|
602
|
+
components?: MetaTemplateComponent[];
|
|
94
603
|
[key: string]: any;
|
|
95
604
|
}
|
|
96
|
-
interface
|
|
605
|
+
interface TargetPhoneOption {
|
|
97
606
|
id: string;
|
|
98
|
-
|
|
607
|
+
label: string;
|
|
608
|
+
type: "DIRECT" | "SUBTABLE";
|
|
609
|
+
columnName: string;
|
|
610
|
+
parentColumnName?: string;
|
|
611
|
+
referencedTableId?: string;
|
|
99
612
|
}
|
|
100
|
-
interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
613
|
+
interface PostSendTargetColumnOption {
|
|
614
|
+
id: string;
|
|
615
|
+
targetType: "MAIN" | "SUBTABLE";
|
|
616
|
+
columnName: string;
|
|
617
|
+
parentColumnName?: string;
|
|
618
|
+
referencedTableId?: string;
|
|
619
|
+
type: "BOOLEAN" | "RELATION";
|
|
620
|
+
label: string;
|
|
621
|
+
config?: any;
|
|
622
|
+
}
|
|
623
|
+
interface WhatsAppRecipient {
|
|
624
|
+
targetPhone: string;
|
|
625
|
+
mainRowId: string;
|
|
626
|
+
subtableRowId?: string;
|
|
627
|
+
recordData: Record<string, any>;
|
|
628
|
+
}
|
|
629
|
+
type WhatsAppData = any;
|
|
630
|
+
interface TemplateVariableMappingItem {
|
|
631
|
+
type: "column" | "static";
|
|
632
|
+
value: string;
|
|
633
|
+
}
|
|
634
|
+
type TemplateVariableMapping = Record<string, TemplateVariableMappingItem>;
|
|
635
|
+
interface TextableColumnOption {
|
|
636
|
+
id: string;
|
|
637
|
+
label: string;
|
|
638
|
+
columnName: string;
|
|
639
|
+
source: "MAIN" | "SUBTABLE";
|
|
640
|
+
parentColumnName?: string;
|
|
641
|
+
type?: string;
|
|
642
|
+
}
|
|
643
|
+
interface WhatsAppComponentProps extends Partial<BaseComponentProps<WhatsAppData, WhatsAppConfig>> {
|
|
644
|
+
permissions?: ComponentPermissions;
|
|
645
|
+
orgId?: string;
|
|
646
|
+
organizationId?: string;
|
|
105
647
|
}
|
|
106
648
|
|
|
107
|
-
interface
|
|
649
|
+
interface SkippedRecipientDetail {
|
|
650
|
+
mainRowId: string;
|
|
651
|
+
subtableRowId?: string;
|
|
652
|
+
reason?: string;
|
|
108
653
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* WhatsAppComponent
|
|
657
|
+
* High-level orchestrator for the WhatsApp messaging interface.
|
|
658
|
+
* Coordinates template selection, dynamic filters, recipient settings/actions,
|
|
659
|
+
* and the embedded data grid.
|
|
660
|
+
*/
|
|
661
|
+
declare function WhatsAppComponent(props: WhatsAppComponentProps): react_jsx_runtime.JSX.Element;
|
|
662
|
+
|
|
663
|
+
interface CreateTemplateModalProps {
|
|
664
|
+
isOpen: boolean;
|
|
665
|
+
onClose: () => void;
|
|
666
|
+
onSuccess: () => void;
|
|
667
|
+
existingTemplateNames?: string[];
|
|
668
|
+
existingTemplates?: TemplateIdentity[];
|
|
669
|
+
executeAction?: (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
670
|
+
orgId?: string;
|
|
113
671
|
}
|
|
114
|
-
|
|
115
|
-
|
|
672
|
+
/**
|
|
673
|
+
* CreateTemplateModal
|
|
674
|
+
* Enterprise modal dialog for authoring and submitting WhatsApp message templates
|
|
675
|
+
* with atomic variable deletion, flexible editing, and strict word-to-variable ratio validation.
|
|
676
|
+
*/
|
|
677
|
+
declare function CreateTemplateModal({ isOpen, onClose, onSuccess, existingTemplateNames, existingTemplates, executeAction, orgId, }: CreateTemplateModalProps): react_jsx_runtime.JSX.Element | null;
|
|
678
|
+
|
|
679
|
+
interface BroadcastProgressState {
|
|
680
|
+
current: number;
|
|
681
|
+
total: number;
|
|
682
|
+
successful: number;
|
|
683
|
+
failed: number;
|
|
684
|
+
skipped: number;
|
|
685
|
+
percent: number;
|
|
116
686
|
}
|
|
117
|
-
interface
|
|
118
|
-
|
|
687
|
+
interface BroadcastSummaryState {
|
|
688
|
+
successful: number;
|
|
689
|
+
failed: number;
|
|
690
|
+
skipped: number;
|
|
691
|
+
total: number;
|
|
692
|
+
successfulRowIds: string[];
|
|
693
|
+
failedRowIds: string[];
|
|
694
|
+
skippedRowIds: string[];
|
|
695
|
+
}
|
|
696
|
+
declare function useWhatsAppState(props: WhatsAppComponentProps): {
|
|
697
|
+
orgId: any;
|
|
698
|
+
tableColumns: ColumnDef[];
|
|
699
|
+
rawRecords: RecordData[];
|
|
700
|
+
relationOptions: Record<string, {
|
|
701
|
+
id: string;
|
|
702
|
+
label: string;
|
|
703
|
+
}[]>;
|
|
704
|
+
isLoadingTableData: boolean;
|
|
705
|
+
tableError: string | null;
|
|
706
|
+
loadTableData: () => Promise<void>;
|
|
707
|
+
embeddedTableExecuteAction: (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
708
|
+
filteredRecords: RecordData[];
|
|
709
|
+
filters: Record<string, string>;
|
|
710
|
+
filterableColumns: ColumnDef[];
|
|
711
|
+
handleFilterChange: (colName: string, val: string) => void;
|
|
712
|
+
handleClearFilters: () => void;
|
|
713
|
+
activeFiltersCount: number;
|
|
714
|
+
selectedRowIds: string[];
|
|
715
|
+
handleSelectionChange: (selectedIds: string[]) => void;
|
|
716
|
+
handleRowToggle: (rowId: string, checked?: boolean) => void;
|
|
717
|
+
toggleRowSelection: (rowId: string, checked?: boolean) => void;
|
|
718
|
+
autoSelectCount: number | null;
|
|
719
|
+
setAutoSelectCount: react.Dispatch<react.SetStateAction<number | null>>;
|
|
720
|
+
filteredData: RecordData[];
|
|
721
|
+
targetPhoneOptions: TargetPhoneOption[];
|
|
722
|
+
phoneColumns: {
|
|
723
|
+
name: string;
|
|
724
|
+
id: string;
|
|
725
|
+
type: "PHONE";
|
|
726
|
+
}[];
|
|
727
|
+
phoneColumnId: string;
|
|
728
|
+
setPhoneColumnId: react.Dispatch<react.SetStateAction<string>>;
|
|
729
|
+
selectedPhoneOption: TargetPhoneOption;
|
|
730
|
+
isScanningPhoneColumns: boolean;
|
|
731
|
+
hasPhoneColumn: boolean;
|
|
732
|
+
subtableFilterableColumns: ColumnDef[];
|
|
733
|
+
selectedSubtableFilterCol: ColumnDef | undefined;
|
|
734
|
+
subtableFilterColumn: string;
|
|
735
|
+
setSubtableFilterColumn: react.Dispatch<react.SetStateAction<string>>;
|
|
736
|
+
subtableFilterValue: string;
|
|
737
|
+
setSubtableFilterValue: react.Dispatch<react.SetStateAction<string>>;
|
|
738
|
+
subtableSendLimit: "ALL" | "PRIMARY" | "FIRST";
|
|
739
|
+
setSubtableSendLimit: react.Dispatch<react.SetStateAction<"ALL" | "PRIMARY" | "FIRST">>;
|
|
740
|
+
getRelationOptionsForCol: (colName: string, parentColName?: string) => {
|
|
741
|
+
id: string;
|
|
742
|
+
label: string;
|
|
743
|
+
}[];
|
|
744
|
+
isSubtableFilterIncomplete: boolean;
|
|
745
|
+
enablePostSendAction: boolean;
|
|
746
|
+
setEnablePostSendAction: react.Dispatch<react.SetStateAction<boolean>>;
|
|
747
|
+
postSendActionColumn: string;
|
|
748
|
+
setPostSendActionColumn: react.Dispatch<react.SetStateAction<string>>;
|
|
749
|
+
postSendActionValue: string;
|
|
750
|
+
setPostSendActionValue: react.Dispatch<react.SetStateAction<string>>;
|
|
751
|
+
postSendActionTargetType: "SUBTABLE" | "MAIN";
|
|
752
|
+
setPostSendActionTargetType: react.Dispatch<react.SetStateAction<"SUBTABLE" | "MAIN">>;
|
|
753
|
+
postSendActionTargetOptions: PostSendTargetColumnOption[];
|
|
754
|
+
selectedPostSendCol: PostSendTargetColumnOption | undefined;
|
|
755
|
+
isPostSendActionIncomplete: boolean;
|
|
756
|
+
preparedRecipients: WhatsAppRecipient[] & {
|
|
757
|
+
skippedRowIds: string[];
|
|
758
|
+
skippedDetails: SkippedRecipientDetail[];
|
|
759
|
+
};
|
|
760
|
+
finalRecipientCount: number;
|
|
761
|
+
validMainRowsCount: number;
|
|
762
|
+
isSendDisabled: boolean;
|
|
763
|
+
isTestDisabled: boolean;
|
|
764
|
+
sendButtonTitle: string;
|
|
765
|
+
testButtonTitle: string;
|
|
766
|
+
requiresMediaHeader: boolean;
|
|
767
|
+
isMediaMissing: boolean;
|
|
768
|
+
templates: MetaWhatsAppTemplate[];
|
|
769
|
+
selectedTemplateId: string | null;
|
|
770
|
+
setSelectedTemplateId: react.Dispatch<react.SetStateAction<string | null>>;
|
|
771
|
+
selectedTemplate: MetaWhatsAppTemplate | null;
|
|
772
|
+
templateBodyText: string;
|
|
773
|
+
templateHeaderComp: MetaTemplateComponent | null;
|
|
774
|
+
headerMediaUrl: string;
|
|
775
|
+
handleHeaderMediaUrlChange: (newUrl: string) => void;
|
|
776
|
+
handleResetHeaderMediaUrl: () => void;
|
|
777
|
+
isUploadingMedia: boolean;
|
|
778
|
+
handleFileUpload: (file: File, templateName?: string) => Promise<void>;
|
|
779
|
+
templateVariables: string[];
|
|
780
|
+
variableMapping: TemplateVariableMapping;
|
|
781
|
+
textableColumnOptions: TextableColumnOption[];
|
|
782
|
+
handleVariableTypeChange: (varKey: string, newType: "column" | "static") => void;
|
|
783
|
+
handleVariableValueChange: (varKey: string, newValue: string) => void;
|
|
784
|
+
isLoadingTemplates: boolean;
|
|
785
|
+
fetchError: string | null;
|
|
786
|
+
isModalOpen: boolean;
|
|
787
|
+
setIsModalOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
788
|
+
isDropdownOpen: boolean;
|
|
789
|
+
setIsDropdownOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
790
|
+
isDeleting: boolean;
|
|
791
|
+
handleDeleteTemplate: () => Promise<void>;
|
|
792
|
+
existingTemplateNames: string[];
|
|
793
|
+
loadTemplates: () => Promise<void>;
|
|
794
|
+
isTestPromptOpen: boolean;
|
|
795
|
+
setIsTestPromptOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
796
|
+
testPhoneNumber: string;
|
|
797
|
+
handleTestPhoneChange: (val: string) => void;
|
|
798
|
+
testFeedback: string | null;
|
|
799
|
+
setTestFeedback: react.Dispatch<react.SetStateAction<string | null>>;
|
|
800
|
+
isSendingTest: boolean;
|
|
801
|
+
isSendingBroadcast: boolean;
|
|
802
|
+
broadcastProgress: BroadcastProgressState;
|
|
803
|
+
broadcastSummary: BroadcastSummaryState | null;
|
|
804
|
+
rowStatusMap: Record<string, {
|
|
805
|
+
status: "success" | "failed" | "skipped" | "partial";
|
|
806
|
+
tooltip: string;
|
|
807
|
+
}>;
|
|
808
|
+
clearBroadcastSummary: () => void;
|
|
809
|
+
handleSendTest: () => Promise<void>;
|
|
810
|
+
handleSendMessages: () => Promise<void>;
|
|
811
|
+
feedback: {
|
|
812
|
+
type: "success" | "error";
|
|
813
|
+
message: string;
|
|
814
|
+
} | null;
|
|
815
|
+
setFeedback: react.Dispatch<react.SetStateAction<{
|
|
816
|
+
type: "success" | "error";
|
|
817
|
+
message: string;
|
|
818
|
+
} | null>>;
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
interface DynamicFiltersBlockProps {
|
|
822
|
+
filterableColumns: ColumnDef[];
|
|
823
|
+
filters: Record<string, string>;
|
|
824
|
+
handleFilterChange: (colName: string, val: string) => void;
|
|
825
|
+
handleClearFilters: () => void;
|
|
826
|
+
activeFiltersCount: number;
|
|
827
|
+
relationOptions: Record<string, any[]>;
|
|
828
|
+
getRelationOptionsForCol?: (colName: string, parentColName?: string) => any[];
|
|
829
|
+
selectedRowIds: string[];
|
|
830
|
+
filteredRecordsCount: number;
|
|
831
|
+
rawRecordsCount: number;
|
|
832
|
+
loadTableData: () => void;
|
|
833
|
+
isLoadingTableData: boolean;
|
|
119
834
|
}
|
|
835
|
+
declare function DynamicFiltersBlock({ filterableColumns, filters, handleFilterChange, handleClearFilters, activeFiltersCount, relationOptions, getRelationOptionsForCol, selectedRowIds, filteredRecordsCount, rawRecordsCount, loadTableData, isLoadingTableData, }: DynamicFiltersBlockProps): react_jsx_runtime.JSX.Element;
|
|
120
836
|
|
|
121
|
-
|
|
837
|
+
interface SettingsAndActionsBlockProps {
|
|
838
|
+
isScanningPhoneColumns: boolean;
|
|
839
|
+
targetPhoneOptions: TargetPhoneOption[];
|
|
840
|
+
phoneColumnId: string;
|
|
841
|
+
setPhoneColumnId: (id: string) => void;
|
|
842
|
+
selectedPhoneOption: TargetPhoneOption | null;
|
|
843
|
+
autoSelectCount?: number | null;
|
|
844
|
+
setAutoSelectCount?: (count: number | null) => void;
|
|
845
|
+
subtableFilterColumn: string;
|
|
846
|
+
setSubtableFilterColumn: (col: string) => void;
|
|
847
|
+
subtableFilterValue: string;
|
|
848
|
+
setSubtableFilterValue: (val: string) => void;
|
|
849
|
+
subtableSendLimit: "PRIMARY" | "FIRST" | "ALL";
|
|
850
|
+
setSubtableSendLimit: (limit: "PRIMARY" | "FIRST" | "ALL") => void;
|
|
851
|
+
subtableFilterableColumns: ColumnDef[];
|
|
852
|
+
selectedSubtableFilterCol: ColumnDef | undefined;
|
|
853
|
+
getRelationOptionsForCol: (colName: string, parentColName?: string) => any[];
|
|
854
|
+
relationOptions: Record<string, any[]>;
|
|
855
|
+
enablePostSendAction: boolean;
|
|
856
|
+
setEnablePostSendAction: (enable: boolean) => void;
|
|
857
|
+
postSendActionColumn: string;
|
|
858
|
+
setPostSendActionColumn: (col: string) => void;
|
|
859
|
+
postSendActionValue: string;
|
|
860
|
+
setPostSendActionValue: (val: string) => void;
|
|
861
|
+
postSendActionTargetType: "MAIN" | "SUBTABLE";
|
|
862
|
+
setPostSendActionTargetType: (type: "MAIN" | "SUBTABLE") => void;
|
|
863
|
+
postSendActionTargetOptions: PostSendTargetColumnOption[];
|
|
864
|
+
selectedPostSendOption: PostSendTargetColumnOption | undefined;
|
|
865
|
+
isTestDisabled: boolean;
|
|
866
|
+
testButtonTitle: string;
|
|
867
|
+
setIsTestPromptOpen: (open: boolean) => void;
|
|
868
|
+
isSendDisabled: boolean;
|
|
869
|
+
sendButtonTitle: string;
|
|
870
|
+
handleSendMessages: () => void;
|
|
871
|
+
selectedRowIdsCount: number;
|
|
872
|
+
finalRecipientCount: number;
|
|
873
|
+
validMainRowsCount: number;
|
|
874
|
+
isSendingBroadcast?: boolean;
|
|
875
|
+
broadcastProgress?: BroadcastProgressState;
|
|
876
|
+
broadcastSummary?: BroadcastSummaryState | null;
|
|
877
|
+
clearBroadcastSummary?: () => void;
|
|
878
|
+
}
|
|
879
|
+
declare function SettingsAndActionsBlock({ isScanningPhoneColumns, targetPhoneOptions, phoneColumnId, setPhoneColumnId, selectedPhoneOption, autoSelectCount, setAutoSelectCount, subtableFilterColumn, setSubtableFilterColumn, subtableFilterValue, setSubtableFilterValue, subtableSendLimit, setSubtableSendLimit, subtableFilterableColumns, selectedSubtableFilterCol, getRelationOptionsForCol, relationOptions, enablePostSendAction, setEnablePostSendAction, postSendActionColumn, setPostSendActionColumn, postSendActionValue, setPostSendActionValue, setPostSendActionTargetType, postSendActionTargetOptions, selectedPostSendOption, isTestDisabled, testButtonTitle, setIsTestPromptOpen, isSendDisabled, sendButtonTitle, handleSendMessages, selectedRowIdsCount, finalRecipientCount, validMainRowsCount, isSendingBroadcast, broadcastProgress, broadcastSummary, clearBroadcastSummary, }: SettingsAndActionsBlockProps): react_jsx_runtime.JSX.Element;
|
|
880
|
+
|
|
881
|
+
interface StyledFormBlockProps {
|
|
882
|
+
settings: any;
|
|
883
|
+
executeAction?: (actionType: string, payload: Record<string, any>) => Promise<any>;
|
|
884
|
+
componentId?: string;
|
|
885
|
+
className?: string;
|
|
886
|
+
onSuccess?: () => void;
|
|
887
|
+
/** תצוגה מקדימה בעורך: בלי שליחה ובלי קריאות שרת, השדות נעולים */
|
|
888
|
+
previewMode?: boolean;
|
|
889
|
+
/** אם הועבר: אפשר לגרור שדות בתוך הטופס לשינוי הסדר (משמש את עורך העיצוב) */
|
|
890
|
+
onReorder?: (fieldOrder: string[]) => void;
|
|
891
|
+
/** אם הועבר: אפשר לשנות גודל שדות בגרירה (ידית בפינה). reset=true מחזיר לגודל ברירת המחדל */
|
|
892
|
+
onFieldResize?: (fieldName: string, patch: {
|
|
893
|
+
span?: number;
|
|
894
|
+
height?: number;
|
|
895
|
+
reset?: boolean;
|
|
896
|
+
}) => void;
|
|
897
|
+
/** ערכים התחלתיים לשדות (למשל נתונים שמולאו בטופס הראשון) */
|
|
898
|
+
initialValues?: Record<string, any>;
|
|
899
|
+
/** create (ברירת מחדל): יוצר רשומה חדשה. update: מעדכן את הרשומה recordId (CREATE_RECORD לא נשלח) */
|
|
900
|
+
submitMode?: 'create' | 'update';
|
|
901
|
+
recordId?: string;
|
|
902
|
+
}
|
|
122
903
|
|
|
123
904
|
/**
|
|
124
905
|
* UNIVERSE_COMPONENTS
|
|
125
|
-
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE")
|
|
906
|
+
* Dynamic Component Registry dictionary mapping component type strings (e.g., "TABLE", "WHATSAPP")
|
|
126
907
|
* to their respective React component implementation.
|
|
127
908
|
*/
|
|
128
909
|
declare const UNIVERSE_COMPONENTS: {
|
|
129
|
-
readonly TABLE:
|
|
910
|
+
readonly TABLE: react.ComponentType<TableBlockProps>;
|
|
911
|
+
readonly WHATSAPP: react.ComponentType<WhatsAppComponentProps>;
|
|
912
|
+
readonly FORM: react.ComponentType<StyledFormBlockProps>;
|
|
913
|
+
readonly PLACEMENT: react.ComponentType<PlacementBlockProps>;
|
|
914
|
+
readonly PAYMENT_REPORTS: react.ComponentType<PaymentReportsBlockProps>;
|
|
130
915
|
};
|
|
131
916
|
type ComponentRegistry = typeof UNIVERSE_COMPONENTS;
|
|
132
917
|
type UniverseComponentType = keyof ComponentRegistry;
|
|
@@ -144,11 +929,21 @@ interface ToastContextType {
|
|
|
144
929
|
showError: (error: string | Error | null | undefined, title?: string) => void;
|
|
145
930
|
removeToast: (id: string) => void;
|
|
146
931
|
}
|
|
147
|
-
declare const ToastContext:
|
|
932
|
+
declare const ToastContext: react__default.Context<ToastContextType | undefined>;
|
|
148
933
|
declare function ToastProvider({ children }: {
|
|
149
934
|
children: ReactNode;
|
|
150
935
|
}): react_jsx_runtime.JSX.Element;
|
|
151
936
|
|
|
152
937
|
declare function useToast(): ToastContextType;
|
|
153
938
|
|
|
154
|
-
|
|
939
|
+
declare const UNIVERSE_THEME_IDS: readonly ["classic", "clean", "ocean", "warm"];
|
|
940
|
+
type UniverseThemeId = (typeof UNIVERSE_THEME_IDS)[number];
|
|
941
|
+
declare function resolveUniverseTheme(value: unknown): UniverseThemeId;
|
|
942
|
+
/**
|
|
943
|
+
* עוטף רכיב ב-data-theme לפי settings.theme (או config.theme) שהפלטפורמה מוסיפה לכל רכיב.
|
|
944
|
+
* display: contents אומר שהעטיפה לא משנה את הפריסה. משתני CSS עדיין עוברים בירושה לילדים.
|
|
945
|
+
* הערה: חלונות שנפתחים מחוץ לעץ (portal) לא יהיו בתוך העטיפה, ולכן עדיף להגדיר data-theme גם על <html> באתר.
|
|
946
|
+
*/
|
|
947
|
+
declare function withThemeScope<P extends object>(Component: react.ComponentType<P>): react.ComponentType<P>;
|
|
948
|
+
|
|
949
|
+
export { type BaseComponentProps, ColumnHeaderTitle, type ColumnHeaderTitleProps, type ComponentCommunication, type ComponentConfig, type ComponentData, type ComponentPermissions, type ComponentRegistry, type ComponentState, type CreateRecordPayload, CreateTemplateModal, type CreateTemplateModalProps, DEFAULT_PLACEMENT_STATUS_COLORS, DatePickerCell, type DeleteRecordPayload, DynamicFiltersBlock, type DynamicFiltersBlockProps, LinkPickerCell, type MetaTemplateComponent, type MetaWhatsAppTemplate, NON_TEXT_TYPES, type OrgRole, PASTEL_PALETTES, PAYMENT_REPORTS_ACTIONS, PAYMENT_REPORTS_REQUIRED, type PastelPalette, PaymentReportsBlock, type PaymentReportsBlockProps, type PaymentReportsConfig, type PaymentReportsTab, PlacementBlock, type PlacementBlockProps, type PlacementColumnOption, type PlacementConfig, PlacementSettings, type PlacementStatusColor, PlacementStatusEditor, type PlacementStatusSetting, RELATION_LABEL_KEY, RELATION_SEP, type RelationFilterOption, type RelationFilterPayload, RelationFilterPopover, type RelationFilterPopoverProps, RelationPickerCell, type RolePermissions, type RowStatusType, SettingsAndActionsBlock, type SettingsAndActionsBlockProps, SmartTextCell, type SplitTitleResult, TableBlock, TableBlockClient, type TableBlockProps, type TableConfig, type TableData, TimePickerCell, ToastContext, type ToastContextType, type ToastItem, ToastProvider, TruncatedTooltip, UNIVERSE_COMPONENTS, UNIVERSE_THEME_IDS, type UniverseComponentType, type UniverseThemeId, type UpdateRecordPayload, type UseColumnReorderOptions, type UseColumnResizeOptions, WhatsAppComponent, type WhatsAppComponentProps, type WhatsAppData, buildColumnOptions, buildRelationRef, calculateMinColumnWidth, checkElementTruncation, cn, columnRefLabel, enrichRowsWithRelations, formatConflictCellValue, formatPhoneDisplay, formatTimeInput, formatTimeIso, generateWhatsAppLink, getDeterministicPastelBadge, getRolePermissions, isUserColumn, isValidPhoneNumber, measureTextWidth, missingPaymentReportsFields, normalizePhoneForWhatsApp, normalizeRelationValue, openWhatsAppChat, parseColumnRef, parseLinkValue, parseTimeParts, readColumnValue, resolveDefaultStatusId, resolveProtocol, resolveReturnStatusId, resolveUniverseTheme, sanitizePhoneNumber, splitHeaderTitle, tableColumns, useColumnReorder, useColumnResize, useSmartTooltip, useToast, useWhatsAppState, withThemeScope };
|