@nar-bus/lena-ui-shared 1.0.0
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/index.d.ts +2935 -0
- package/dist/index.js +17416 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.css +464 -0
- package/package.json +106 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2935 @@
|
|
|
1
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
6
|
+
import { ClassValue } from 'clsx';
|
|
7
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
8
|
+
import { Column } from '@tanstack/react-table';
|
|
9
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
10
|
+
import { Command as Command_2 } from 'cmdk';
|
|
11
|
+
import { Component } from 'react';
|
|
12
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
13
|
+
import { Control } from 'react-hook-form';
|
|
14
|
+
import { DayPicker } from 'react-day-picker';
|
|
15
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
16
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
17
|
+
import { FieldPath } from 'react-hook-form';
|
|
18
|
+
import { FieldValues } from 'react-hook-form';
|
|
19
|
+
import { Group } from 'react-resizable-panels';
|
|
20
|
+
import { JSX } from 'react/jsx-runtime';
|
|
21
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
22
|
+
import { LucideIcon } from 'lucide-react';
|
|
23
|
+
import { NamedExoticComponent } from 'react';
|
|
24
|
+
import { Panel } from 'react-resizable-panels';
|
|
25
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
26
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
27
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
28
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
29
|
+
import * as React_2 from 'react';
|
|
30
|
+
import { ReactNode } from 'react';
|
|
31
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
32
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
33
|
+
import { Separator as Separator_2 } from 'react-resizable-panels';
|
|
34
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
35
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
36
|
+
import { StoreApi } from 'zustand';
|
|
37
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
38
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
39
|
+
import { ToasterProps } from 'sonner';
|
|
40
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
41
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
42
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
43
|
+
import { UseBoundStore } from 'zustand';
|
|
44
|
+
import { VariantProps } from 'class-variance-authority';
|
|
45
|
+
import { z } from 'zod';
|
|
46
|
+
|
|
47
|
+
export declare function Accordion({ ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Root>): JSX.Element;
|
|
48
|
+
|
|
49
|
+
export declare function AccordionContent({ className, children, ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Content>): JSX.Element;
|
|
50
|
+
|
|
51
|
+
export declare function AccordionItem({ className, ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Item>): JSX.Element;
|
|
52
|
+
|
|
53
|
+
export declare function AccordionTrigger({ className, children, ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Trigger>): JSX.Element;
|
|
54
|
+
|
|
55
|
+
export declare function AdvancedJsonEditor({ value, onChange, onSave, title, icon: Icon, defaultOpen, maxViewHeight, rows, placeholder, defaultMode, allowModeSwitch, schema, editable, disabled, disabledReason, isSaving, showLineNumbers, showValidation, showStats, }: AdvancedJsonEditorProps): JSX.Element;
|
|
56
|
+
|
|
57
|
+
export declare interface AdvancedJsonEditorProps {
|
|
58
|
+
value: string;
|
|
59
|
+
onChange?: (value: string) => void;
|
|
60
|
+
onSave?: (value: string) => void;
|
|
61
|
+
title?: string;
|
|
62
|
+
icon?: LucideIcon;
|
|
63
|
+
defaultOpen?: boolean;
|
|
64
|
+
maxViewHeight?: number;
|
|
65
|
+
rows?: number;
|
|
66
|
+
placeholder?: string;
|
|
67
|
+
defaultMode?: EditorMode;
|
|
68
|
+
allowModeSwitch?: boolean;
|
|
69
|
+
schema?: z.ZodType<unknown>;
|
|
70
|
+
editable?: boolean;
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
disabledReason?: string;
|
|
73
|
+
isSaving?: boolean;
|
|
74
|
+
showLineNumbers?: boolean;
|
|
75
|
+
showValidation?: boolean;
|
|
76
|
+
showStats?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export declare function Alert({ className, variant, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof alertVariants>): JSX.Element;
|
|
80
|
+
|
|
81
|
+
export declare function AlertDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
82
|
+
|
|
83
|
+
export declare function AlertDialog({ ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Root>): JSX.Element;
|
|
84
|
+
|
|
85
|
+
export declare function AlertDialogAction({ className, variant, size, ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Action> & Pick<React_2.ComponentProps<typeof Button>, "variant" | "size">): JSX.Element;
|
|
86
|
+
|
|
87
|
+
export declare function AlertDialogCancel({ className, variant, size, ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Cancel> & Pick<React_2.ComponentProps<typeof Button>, "variant" | "size">): JSX.Element;
|
|
88
|
+
|
|
89
|
+
export declare function AlertDialogContent({ className, size, ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
90
|
+
size?: "default" | "sm";
|
|
91
|
+
}): JSX.Element;
|
|
92
|
+
|
|
93
|
+
export declare function AlertDialogDescription({ className, ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Description>): JSX.Element;
|
|
94
|
+
|
|
95
|
+
export declare function AlertDialogFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
96
|
+
|
|
97
|
+
export declare function AlertDialogHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
98
|
+
|
|
99
|
+
export declare function AlertDialogTitle({ className, ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Title>): JSX.Element;
|
|
100
|
+
|
|
101
|
+
export declare function AlertDialogTrigger({ ...props }: React_2.ComponentProps<typeof AlertDialogPrimitive.Trigger>): JSX.Element;
|
|
102
|
+
|
|
103
|
+
export declare function AlertTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
104
|
+
|
|
105
|
+
declare const alertVariants: (props?: ({
|
|
106
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
107
|
+
} & ClassProp) | undefined) => string;
|
|
108
|
+
|
|
109
|
+
export declare interface ApiResponse<T> {
|
|
110
|
+
status: number;
|
|
111
|
+
success: boolean;
|
|
112
|
+
message: string;
|
|
113
|
+
data: T;
|
|
114
|
+
meta: MetaInfo;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export declare function AppHeader({ breadcrumbs, theme, onThemeChange, user, isAuthenticated, onLogout, onLogin, homeHref, className, }: AppHeaderProps): JSX.Element;
|
|
118
|
+
|
|
119
|
+
export declare interface AppHeaderProps {
|
|
120
|
+
breadcrumbs: BreadcrumbItem[];
|
|
121
|
+
theme: 'light' | 'dark' | 'system';
|
|
122
|
+
onThemeChange: (theme: 'light' | 'dark' | 'system') => void;
|
|
123
|
+
user?: AppHeaderUser | null;
|
|
124
|
+
isAuthenticated?: boolean;
|
|
125
|
+
onLogout: () => void;
|
|
126
|
+
onLogin?: () => void;
|
|
127
|
+
homeHref?: string;
|
|
128
|
+
className?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare interface AppHeaderUser {
|
|
132
|
+
firstName?: string;
|
|
133
|
+
lastName?: string;
|
|
134
|
+
email?: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare function AppSidebar({ items, collapsed, onToggleCollapse, logo, version, }: AppSidebarProps): JSX.Element;
|
|
138
|
+
|
|
139
|
+
export declare interface AppSidebarProps {
|
|
140
|
+
items: SidebarNavItem[];
|
|
141
|
+
collapsed: boolean;
|
|
142
|
+
onToggleCollapse: () => void;
|
|
143
|
+
logo?: {
|
|
144
|
+
title: string;
|
|
145
|
+
subtitle?: string;
|
|
146
|
+
letter?: string;
|
|
147
|
+
};
|
|
148
|
+
version?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Operators that use the `values` array instead of single `value`
|
|
153
|
+
*/
|
|
154
|
+
export declare const ARRAY_OPERATORS: FilterOperator[];
|
|
155
|
+
|
|
156
|
+
export declare function AsyncSelectField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, searchPlaceholder, emptyText, loadingText, loadOptions, debounceMs, disabled, className, cols, }: AsyncSelectFieldProps<TFieldValues>): JSX.Element;
|
|
157
|
+
|
|
158
|
+
declare interface AsyncSelectFieldProps<TFieldValues extends FieldValues> {
|
|
159
|
+
name: FieldPath<TFieldValues>;
|
|
160
|
+
control: Control<TFieldValues>;
|
|
161
|
+
label?: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
required?: boolean;
|
|
164
|
+
placeholder?: string;
|
|
165
|
+
searchPlaceholder?: string;
|
|
166
|
+
emptyText?: string;
|
|
167
|
+
loadingText?: string;
|
|
168
|
+
loadOptions: (search: string) => Promise<SelectOption[]>;
|
|
169
|
+
debounceMs?: number;
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
className?: string;
|
|
172
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare function Avatar({ className, size, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
176
|
+
size?: "default" | "sm" | "lg";
|
|
177
|
+
}): JSX.Element;
|
|
178
|
+
|
|
179
|
+
export declare function AvatarFallback({ className, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Fallback>): JSX.Element;
|
|
180
|
+
|
|
181
|
+
export declare function AvatarImage({ className, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Image>): JSX.Element;
|
|
182
|
+
|
|
183
|
+
export declare function Badge({ className, variant, asChild, ...props }: React_2.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
184
|
+
asChild?: boolean;
|
|
185
|
+
}): JSX.Element;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Simple badge cell for displaying values like port numbers or version numbers.
|
|
189
|
+
* Use StatusBadge for colored enum/status values instead.
|
|
190
|
+
*/
|
|
191
|
+
export declare function BadgeCell({ value, variant, className, }: BadgeCellProps): JSX.Element;
|
|
192
|
+
|
|
193
|
+
declare interface BadgeCellProps {
|
|
194
|
+
value: string | number | null | undefined;
|
|
195
|
+
variant?: 'default' | 'accent';
|
|
196
|
+
className?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare const badgeVariants: (props?: ({
|
|
200
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
201
|
+
} & ClassProp) | undefined) => string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Boolean cell for displaying true/false values.
|
|
205
|
+
* Shows check/X icons with consistent styling.
|
|
206
|
+
*/
|
|
207
|
+
export declare function BooleanCell({ value, trueIcon, falseIcon, trueLabel, falseLabel, showLabel, className, }: BooleanCellProps): JSX.Element;
|
|
208
|
+
|
|
209
|
+
declare interface BooleanCellProps {
|
|
210
|
+
value: boolean | null | undefined;
|
|
211
|
+
trueIcon?: React.ReactNode;
|
|
212
|
+
falseIcon?: React.ReactNode;
|
|
213
|
+
trueLabel?: string;
|
|
214
|
+
falseLabel?: string;
|
|
215
|
+
showLabel?: boolean;
|
|
216
|
+
className?: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare const booleanColors: {
|
|
220
|
+
readonly true: "bg-status-success/10 text-status-success-foreground border-status-success/30";
|
|
221
|
+
readonly false: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export declare function Breadcrumb({ ...props }: React_2.ComponentProps<"nav">): JSX.Element;
|
|
225
|
+
|
|
226
|
+
export declare function BreadcrumbEllipsis({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
227
|
+
|
|
228
|
+
export declare interface BreadcrumbItem {
|
|
229
|
+
label: string;
|
|
230
|
+
href?: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export declare function BreadcrumbLink({ asChild, className, ...props }: React_2.ComponentProps<"a"> & {
|
|
234
|
+
asChild?: boolean;
|
|
235
|
+
}): JSX.Element;
|
|
236
|
+
|
|
237
|
+
export declare function BreadcrumbList({ className, ...props }: React_2.ComponentProps<"ol">): JSX.Element;
|
|
238
|
+
|
|
239
|
+
export declare function BreadcrumbPage({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
240
|
+
|
|
241
|
+
export declare function BreadcrumbSeparator({ children, className, ...props }: React_2.ComponentProps<"li">): JSX.Element;
|
|
242
|
+
|
|
243
|
+
export declare function BreadcrumbUIItem({ className, ...props }: React_2.ComponentProps<"li">): JSX.Element;
|
|
244
|
+
|
|
245
|
+
export declare interface BulkAction<TData> {
|
|
246
|
+
id: string;
|
|
247
|
+
label: string;
|
|
248
|
+
icon?: ReactNode;
|
|
249
|
+
variant?: 'default' | 'primary' | 'destructive';
|
|
250
|
+
onClick: (rows: TData[]) => void | Promise<void>;
|
|
251
|
+
disabled?: boolean | ((rows: TData[]) => boolean);
|
|
252
|
+
confirm?: {
|
|
253
|
+
title: string;
|
|
254
|
+
description: string;
|
|
255
|
+
confirmLabel?: string;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export declare function BulkActionBar({ selectedCount, onClearSelection, actions, moreActions, itemLabel, cancelLabel, cancelHint, className, }: BulkActionBarProps): JSX.Element | null;
|
|
260
|
+
|
|
261
|
+
export declare interface BulkActionBarProps {
|
|
262
|
+
selectedCount: number;
|
|
263
|
+
onClearSelection: () => void;
|
|
264
|
+
actions?: BulkActionItem[];
|
|
265
|
+
moreActions?: BulkActionItem[];
|
|
266
|
+
itemLabel?: (count: number) => string;
|
|
267
|
+
cancelLabel?: string;
|
|
268
|
+
cancelHint?: string;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export declare interface BulkActionItem {
|
|
273
|
+
id: string;
|
|
274
|
+
label: string;
|
|
275
|
+
icon?: ReactNode;
|
|
276
|
+
onClick: () => void;
|
|
277
|
+
variant?: 'default' | 'primary' | 'destructive';
|
|
278
|
+
separator?: boolean;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
282
|
+
asChild?: boolean;
|
|
283
|
+
}): JSX.Element;
|
|
284
|
+
|
|
285
|
+
declare type ButtonProps = React.ComponentProps<typeof Button> & VariantProps<typeof buttonVariants>;
|
|
286
|
+
|
|
287
|
+
export declare const buttonVariants: (props?: ({
|
|
288
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
289
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
290
|
+
} & ClassProp) | undefined) => string;
|
|
291
|
+
|
|
292
|
+
export declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React_2.ComponentProps<typeof DayPicker> & {
|
|
293
|
+
buttonVariant?: React_2.ComponentProps<typeof Button>["variant"];
|
|
294
|
+
}): JSX.Element;
|
|
295
|
+
|
|
296
|
+
export declare function Card({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
297
|
+
|
|
298
|
+
export declare function CardAction({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
299
|
+
|
|
300
|
+
export declare function CardContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
301
|
+
|
|
302
|
+
export declare function CardDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
303
|
+
|
|
304
|
+
export declare function CardFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
305
|
+
|
|
306
|
+
export declare function CardHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
307
|
+
|
|
308
|
+
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
309
|
+
|
|
310
|
+
export declare function Checkbox({ className, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>): JSX.Element;
|
|
311
|
+
|
|
312
|
+
export declare function CheckboxField<TFieldValues extends FieldValues>({ name, control, label, description, disabled, className, cols, }: CheckboxFieldProps<TFieldValues>): JSX.Element;
|
|
313
|
+
|
|
314
|
+
declare interface CheckboxFieldProps<TFieldValues extends FieldValues> {
|
|
315
|
+
name: FieldPath<TFieldValues>;
|
|
316
|
+
control: Control<TFieldValues>;
|
|
317
|
+
label?: string;
|
|
318
|
+
description?: string;
|
|
319
|
+
disabled?: boolean;
|
|
320
|
+
className?: string;
|
|
321
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare function CircularGauge({ value, max, target, title, icon, size, strokeWidth, footerStats, formatValue, getStatus, targetLabel, onTargetLabel, belowTargetLabel, className, animationDelay, }: CircularGaugeProps): JSX.Element;
|
|
325
|
+
|
|
326
|
+
export declare interface CircularGaugeProps {
|
|
327
|
+
value: number;
|
|
328
|
+
max?: number;
|
|
329
|
+
target?: number;
|
|
330
|
+
title?: string;
|
|
331
|
+
icon?: ReactNode;
|
|
332
|
+
size?: number;
|
|
333
|
+
strokeWidth?: number;
|
|
334
|
+
footerStats?: GaugeFooterStat[];
|
|
335
|
+
formatValue?: (value: number) => string;
|
|
336
|
+
getStatus?: (value: number, target?: number) => 'excellent' | 'good' | 'warning' | 'critical';
|
|
337
|
+
targetLabel?: string;
|
|
338
|
+
onTargetLabel?: string;
|
|
339
|
+
belowTargetLabel?: (diff: number) => string;
|
|
340
|
+
className?: string;
|
|
341
|
+
animationDelay?: number;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
345
|
+
|
|
346
|
+
export declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): JSX.Element;
|
|
347
|
+
|
|
348
|
+
export declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): JSX.Element;
|
|
349
|
+
|
|
350
|
+
export declare function CollapsibleSection({ title, icon: Icon, children, status, defaultOpen, itemCount, editable, isEditing, isSaving, onEdit, onSave, onCancel, }: CollapsibleSectionProps): JSX.Element;
|
|
351
|
+
|
|
352
|
+
declare interface CollapsibleSectionProps {
|
|
353
|
+
title: string;
|
|
354
|
+
icon: LucideIcon;
|
|
355
|
+
children: React.ReactNode;
|
|
356
|
+
defaultOpen?: boolean;
|
|
357
|
+
itemCount?: number;
|
|
358
|
+
status?: 'online' | 'offline';
|
|
359
|
+
editable?: boolean;
|
|
360
|
+
isEditing?: boolean;
|
|
361
|
+
isSaving?: boolean;
|
|
362
|
+
onEdit?: () => void;
|
|
363
|
+
onSave?: () => void;
|
|
364
|
+
onCancel?: () => void;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): JSX.Element;
|
|
368
|
+
|
|
369
|
+
export declare function ComboboxField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, searchPlaceholder, emptyText, options, disabled, className, cols, errorHint, }: ComboboxFieldProps<TFieldValues>): JSX.Element;
|
|
370
|
+
|
|
371
|
+
declare interface ComboboxFieldProps<TFieldValues extends FieldValues> {
|
|
372
|
+
name: FieldPath<TFieldValues>;
|
|
373
|
+
control: Control<TFieldValues>;
|
|
374
|
+
label?: string;
|
|
375
|
+
description?: string;
|
|
376
|
+
required?: boolean;
|
|
377
|
+
placeholder?: string;
|
|
378
|
+
searchPlaceholder?: string;
|
|
379
|
+
emptyText?: string;
|
|
380
|
+
options: SelectOption[];
|
|
381
|
+
disabled?: boolean;
|
|
382
|
+
className?: string;
|
|
383
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
384
|
+
errorHint?: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export declare function Command({ className, ...props }: React_2.ComponentProps<typeof Command_2>): JSX.Element;
|
|
388
|
+
|
|
389
|
+
export declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React_2.ComponentProps<typeof Dialog> & {
|
|
390
|
+
title?: string;
|
|
391
|
+
description?: string;
|
|
392
|
+
className?: string;
|
|
393
|
+
showCloseButton?: boolean;
|
|
394
|
+
}): JSX.Element;
|
|
395
|
+
|
|
396
|
+
export declare function CommandEmpty({ ...props }: React_2.ComponentProps<typeof Command_2.Empty>): JSX.Element;
|
|
397
|
+
|
|
398
|
+
export declare function CommandGroup({ className, ...props }: React_2.ComponentProps<typeof Command_2.Group>): JSX.Element;
|
|
399
|
+
|
|
400
|
+
export declare function CommandInput({ className, ...props }: React_2.ComponentProps<typeof Command_2.Input>): JSX.Element;
|
|
401
|
+
|
|
402
|
+
export declare function CommandItem({ className, ...props }: React_2.ComponentProps<typeof Command_2.Item>): JSX.Element;
|
|
403
|
+
|
|
404
|
+
export declare function CommandList({ className, ...props }: React_2.ComponentProps<typeof Command_2.List>): JSX.Element;
|
|
405
|
+
|
|
406
|
+
export declare function CommandSeparator({ className, ...props }: React_2.ComponentProps<typeof Command_2.Separator>): JSX.Element;
|
|
407
|
+
|
|
408
|
+
export declare function CommandShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
409
|
+
|
|
410
|
+
export declare interface CommonLabels {
|
|
411
|
+
actions: string;
|
|
412
|
+
edit: string;
|
|
413
|
+
delete: string;
|
|
414
|
+
create: string;
|
|
415
|
+
save: string;
|
|
416
|
+
cancel: string;
|
|
417
|
+
close: string;
|
|
418
|
+
confirm: string;
|
|
419
|
+
back: string;
|
|
420
|
+
next: string;
|
|
421
|
+
loading: string;
|
|
422
|
+
noData: string;
|
|
423
|
+
refresh: string;
|
|
424
|
+
search: string;
|
|
425
|
+
yes: string;
|
|
426
|
+
no: string;
|
|
427
|
+
active: string;
|
|
428
|
+
inactive: string;
|
|
429
|
+
enabled: string;
|
|
430
|
+
disabled: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export declare function ContextMenu({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Root>): JSX.Element;
|
|
434
|
+
|
|
435
|
+
export declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): JSX.Element;
|
|
436
|
+
|
|
437
|
+
export declare function ContextMenuContent({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Content>): JSX.Element;
|
|
438
|
+
|
|
439
|
+
export declare function ContextMenuGroup({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Group>): JSX.Element;
|
|
440
|
+
|
|
441
|
+
export declare function ContextMenuItem({ className, inset, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
442
|
+
inset?: boolean;
|
|
443
|
+
}): JSX.Element;
|
|
444
|
+
|
|
445
|
+
export declare function ContextMenuLabel({ className, inset, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
446
|
+
inset?: boolean;
|
|
447
|
+
}): JSX.Element;
|
|
448
|
+
|
|
449
|
+
export declare function ContextMenuPortal({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Portal>): JSX.Element;
|
|
450
|
+
|
|
451
|
+
export declare function ContextMenuRadioGroup({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): JSX.Element;
|
|
452
|
+
|
|
453
|
+
export declare function ContextMenuRadioItem({ className, children, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): JSX.Element;
|
|
454
|
+
|
|
455
|
+
export declare function ContextMenuSeparator({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Separator>): JSX.Element;
|
|
456
|
+
|
|
457
|
+
export declare function ContextMenuShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
458
|
+
|
|
459
|
+
export declare function ContextMenuSub({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Sub>): JSX.Element;
|
|
460
|
+
|
|
461
|
+
export declare function ContextMenuSubContent({ className, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.SubContent>): JSX.Element;
|
|
462
|
+
|
|
463
|
+
export declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
464
|
+
inset?: boolean;
|
|
465
|
+
}): JSX.Element;
|
|
466
|
+
|
|
467
|
+
export declare function ContextMenuTrigger({ ...props }: React_2.ComponentProps<typeof ContextMenuPrimitive.Trigger>): JSX.Element;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Convert UI FilterState array to backend-compatible SearchCriteria array
|
|
471
|
+
* Handles the value/values field distinction based on operator
|
|
472
|
+
* @param filters - Array of filter states from UI
|
|
473
|
+
* @param fieldConfigs - Optional field configurations to determine field types
|
|
474
|
+
*/
|
|
475
|
+
export declare function convertFiltersToSearchCriteria(filters: FilterState[], fieldConfigs?: FieldConfig[]): SearchCriteria[];
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Copyable text cell for table columns.
|
|
479
|
+
* Shows copy button on hover and provides feedback.
|
|
480
|
+
*
|
|
481
|
+
* Ideal for: ICCID, IP addresses, serial numbers, etc.
|
|
482
|
+
*/
|
|
483
|
+
export declare function CopyableCell({ value, truncate, maxWidth, className, successMessage, }: CopyableCellProps): JSX.Element;
|
|
484
|
+
|
|
485
|
+
declare interface CopyableCellProps {
|
|
486
|
+
value: string | null | undefined;
|
|
487
|
+
truncate?: boolean;
|
|
488
|
+
maxWidth?: string;
|
|
489
|
+
className?: string;
|
|
490
|
+
successMessage?: string;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export declare function CopyButton({ value }: CopyButtonProps): JSX.Element;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Copy Button - Click to copy value to clipboard
|
|
497
|
+
*/
|
|
498
|
+
declare interface CopyButtonProps {
|
|
499
|
+
value: string;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export declare function createDataTableStore(options?: CreateDataTableStoreOptions): UseBoundStore<Omit<StoreApi<DataTableStore>, "setState"> & {
|
|
503
|
+
setState(nextStateOrUpdater: DataTableStore | Partial<DataTableStore> | ((state: {
|
|
504
|
+
generalSearch: string;
|
|
505
|
+
filters: {
|
|
506
|
+
id: string;
|
|
507
|
+
field: string;
|
|
508
|
+
operator: FilterOperator;
|
|
509
|
+
value?: string | number | boolean | null | undefined;
|
|
510
|
+
values?: (string | number | boolean)[] | undefined;
|
|
511
|
+
enabled: boolean;
|
|
512
|
+
}[];
|
|
513
|
+
page: number;
|
|
514
|
+
size: number;
|
|
515
|
+
sortBy: string;
|
|
516
|
+
sortDirection: "ASC" | "DESC";
|
|
517
|
+
rowSelection: {
|
|
518
|
+
[x: string]: boolean;
|
|
519
|
+
};
|
|
520
|
+
setGeneralSearch: (value: string) => void;
|
|
521
|
+
addFilter: (filter: Omit<FilterState, "id" | "enabled">) => void;
|
|
522
|
+
updateFilter: (id: string, updates: Partial<FilterState>) => void;
|
|
523
|
+
removeFilter: (id: string) => void;
|
|
524
|
+
toggleFilter: (id: string) => void;
|
|
525
|
+
clearFilters: () => void;
|
|
526
|
+
applyQuickFilter: (quickFilter: QuickFilter) => void;
|
|
527
|
+
setFilters: (filters: FilterState[]) => void;
|
|
528
|
+
setPage: (page: number) => void;
|
|
529
|
+
setSize: (size: number) => void;
|
|
530
|
+
setSort: (sortBy: string, sortDirection: "ASC" | "DESC") => void;
|
|
531
|
+
toggleSort: (field: string) => void;
|
|
532
|
+
setRowSelection: (selection: Record<string, boolean>) => void;
|
|
533
|
+
toggleRowSelection: (rowId: string) => void;
|
|
534
|
+
selectAll: (rowIds: string[]) => void;
|
|
535
|
+
clearSelection: () => void;
|
|
536
|
+
reset: () => void;
|
|
537
|
+
hydrateFromUrl: (urlState: UrlState) => void;
|
|
538
|
+
getSearchRequest: () => SearchRequest;
|
|
539
|
+
getActiveFilterCount: () => number;
|
|
540
|
+
getSelectedRowIds: () => string[];
|
|
541
|
+
}) => void), shouldReplace?: false): void;
|
|
542
|
+
setState(nextStateOrUpdater: DataTableStore | ((state: {
|
|
543
|
+
generalSearch: string;
|
|
544
|
+
filters: {
|
|
545
|
+
id: string;
|
|
546
|
+
field: string;
|
|
547
|
+
operator: FilterOperator;
|
|
548
|
+
value?: string | number | boolean | null | undefined;
|
|
549
|
+
values?: (string | number | boolean)[] | undefined;
|
|
550
|
+
enabled: boolean;
|
|
551
|
+
}[];
|
|
552
|
+
page: number;
|
|
553
|
+
size: number;
|
|
554
|
+
sortBy: string;
|
|
555
|
+
sortDirection: "ASC" | "DESC";
|
|
556
|
+
rowSelection: {
|
|
557
|
+
[x: string]: boolean;
|
|
558
|
+
};
|
|
559
|
+
setGeneralSearch: (value: string) => void;
|
|
560
|
+
addFilter: (filter: Omit<FilterState, "id" | "enabled">) => void;
|
|
561
|
+
updateFilter: (id: string, updates: Partial<FilterState>) => void;
|
|
562
|
+
removeFilter: (id: string) => void;
|
|
563
|
+
toggleFilter: (id: string) => void;
|
|
564
|
+
clearFilters: () => void;
|
|
565
|
+
applyQuickFilter: (quickFilter: QuickFilter) => void;
|
|
566
|
+
setFilters: (filters: FilterState[]) => void;
|
|
567
|
+
setPage: (page: number) => void;
|
|
568
|
+
setSize: (size: number) => void;
|
|
569
|
+
setSort: (sortBy: string, sortDirection: "ASC" | "DESC") => void;
|
|
570
|
+
toggleSort: (field: string) => void;
|
|
571
|
+
setRowSelection: (selection: Record<string, boolean>) => void;
|
|
572
|
+
toggleRowSelection: (rowId: string) => void;
|
|
573
|
+
selectAll: (rowIds: string[]) => void;
|
|
574
|
+
clearSelection: () => void;
|
|
575
|
+
reset: () => void;
|
|
576
|
+
hydrateFromUrl: (urlState: UrlState) => void;
|
|
577
|
+
getSearchRequest: () => SearchRequest;
|
|
578
|
+
getActiveFilterCount: () => number;
|
|
579
|
+
getSelectedRowIds: () => string[];
|
|
580
|
+
}) => void), shouldReplace: true): void;
|
|
581
|
+
}>;
|
|
582
|
+
|
|
583
|
+
export declare interface CreateDataTableStoreOptions {
|
|
584
|
+
defaultSize?: number;
|
|
585
|
+
defaultSortBy?: string;
|
|
586
|
+
defaultSortDirection?: 'ASC' | 'DESC';
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Create a new empty filter with defaults
|
|
591
|
+
*/
|
|
592
|
+
export declare function createEmptyFilter(field: string, operator?: FilterState['operator']): Omit<FilterState, 'id'>;
|
|
593
|
+
|
|
594
|
+
export declare function CRUDTabContent<T extends {
|
|
595
|
+
id: number;
|
|
596
|
+
}>({ isActive, columns, fieldConfig, defaultSortBy, getRowId, allQueryKey, detailKey, listKey, fetchDetail, fetchList, useSearchHook, deleteItem, isDeleting, detailPath, searchPlaceholder, emptyTitle, emptyDescription, entityType, getEntityName, viewLabel, deleteLabel, refreshLabel, createLabel, CreateSheetComponent, hideToolbar, externalCreateSheetOpen, onExternalCreateSheetOpenChange, }: CRUDTabContentProps<T>): JSX.Element;
|
|
597
|
+
|
|
598
|
+
export declare interface CRUDTabContentProps<T extends {
|
|
599
|
+
id: number;
|
|
600
|
+
}> {
|
|
601
|
+
/** Whether this tab is currently active */
|
|
602
|
+
isActive: boolean;
|
|
603
|
+
/** Table column definitions */
|
|
604
|
+
columns: ColumnDef<T, unknown>[];
|
|
605
|
+
/** Field configuration for filtering */
|
|
606
|
+
fieldConfig: FieldConfig[];
|
|
607
|
+
/** Default sort field */
|
|
608
|
+
defaultSortBy: string;
|
|
609
|
+
/** Row ID accessor */
|
|
610
|
+
getRowId?: (row: T) => string;
|
|
611
|
+
/** Query key for invalidation */
|
|
612
|
+
allQueryKey: readonly string[];
|
|
613
|
+
/** Detail query key factory */
|
|
614
|
+
detailKey: (id: number) => readonly unknown[];
|
|
615
|
+
/** List query key factory */
|
|
616
|
+
listKey: (params: SearchRequest) => readonly unknown[];
|
|
617
|
+
/** Fetch detail function for prefetch */
|
|
618
|
+
fetchDetail: (id: number) => Promise<T>;
|
|
619
|
+
/** Fetch list function for prefetch */
|
|
620
|
+
fetchList: (params: SearchRequest) => Promise<PagedResponse<T>>;
|
|
621
|
+
/** Search hook factory */
|
|
622
|
+
useSearchHook: (params: SearchRequest, enabled: boolean) => {
|
|
623
|
+
data: PagedResponse<T> | undefined;
|
|
624
|
+
isLoading: boolean;
|
|
625
|
+
error: Error | null;
|
|
626
|
+
refetch: () => void;
|
|
627
|
+
};
|
|
628
|
+
/** Delete mutation handler */
|
|
629
|
+
deleteItem: (id: number, options: {
|
|
630
|
+
onSuccess: () => void;
|
|
631
|
+
}) => void;
|
|
632
|
+
/** Whether delete is in progress */
|
|
633
|
+
isDeleting: boolean;
|
|
634
|
+
/** Route path for detail page */
|
|
635
|
+
detailPath: string;
|
|
636
|
+
/** Search placeholder text */
|
|
637
|
+
searchPlaceholder: string;
|
|
638
|
+
/** Empty state title */
|
|
639
|
+
emptyTitle: string;
|
|
640
|
+
/** Empty state description */
|
|
641
|
+
emptyDescription: string;
|
|
642
|
+
/** Entity type name (for delete dialog) */
|
|
643
|
+
entityType: string;
|
|
644
|
+
/** Get display name from entity (for delete dialog) */
|
|
645
|
+
getEntityName: (item: T) => string;
|
|
646
|
+
/** View action label */
|
|
647
|
+
viewLabel?: string;
|
|
648
|
+
/** Delete action label */
|
|
649
|
+
deleteLabel?: string;
|
|
650
|
+
/** Refresh button label */
|
|
651
|
+
refreshLabel?: string;
|
|
652
|
+
/** Create button label */
|
|
653
|
+
createLabel?: string;
|
|
654
|
+
/** Create sheet component */
|
|
655
|
+
CreateSheetComponent: React.ComponentType<{
|
|
656
|
+
open: boolean;
|
|
657
|
+
onOpenChange: (open: boolean) => void;
|
|
658
|
+
}>;
|
|
659
|
+
/** Hide internal toolbar (for external toolbar control) */
|
|
660
|
+
hideToolbar?: boolean;
|
|
661
|
+
/** External create sheet open state */
|
|
662
|
+
externalCreateSheetOpen?: boolean;
|
|
663
|
+
/** External create sheet open change handler */
|
|
664
|
+
onExternalCreateSheetOpenChange?: (open: boolean) => void;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export declare function DataTable<TData>({ columns, getRowId, data, isLoading, error, pagination, onPageChange, onPageSizeChange, onPrefetchPage, pageSizeOptions, sortBy, sortDirection, onSortChange, searchValue, onSearchChange, searchPlaceholder, searchDebounceMs, fieldConfig, filters, onFiltersChange, enableRowSelection, rowSelection, onRowSelectionChange, bulkActions, rowActions, toolbarStart, toolbarEnd, className, emptyIcon, emptyTitle, emptyDescription, onRowClick, onRowHover, rowClassName, meta, }: DataTableComponentProps<TData>): JSX.Element;
|
|
668
|
+
|
|
669
|
+
declare interface DataTableActions {
|
|
670
|
+
setGeneralSearch: (value: string) => void;
|
|
671
|
+
addFilter: (filter: Omit<FilterState, 'id' | 'enabled'>) => void;
|
|
672
|
+
updateFilter: (id: string, updates: Partial<FilterState>) => void;
|
|
673
|
+
removeFilter: (id: string) => void;
|
|
674
|
+
toggleFilter: (id: string) => void;
|
|
675
|
+
clearFilters: () => void;
|
|
676
|
+
applyQuickFilter: (quickFilter: QuickFilter) => void;
|
|
677
|
+
setFilters: (filters: FilterState[]) => void;
|
|
678
|
+
setPage: (page: number) => void;
|
|
679
|
+
setSize: (size: number) => void;
|
|
680
|
+
setSort: (sortBy: string, sortDirection: 'ASC' | 'DESC') => void;
|
|
681
|
+
toggleSort: (field: string) => void;
|
|
682
|
+
setRowSelection: (selection: Record<string, boolean>) => void;
|
|
683
|
+
toggleRowSelection: (rowId: string) => void;
|
|
684
|
+
selectAll: (rowIds: string[]) => void;
|
|
685
|
+
clearSelection: () => void;
|
|
686
|
+
reset: () => void;
|
|
687
|
+
hydrateFromUrl: (urlState: UrlState) => void;
|
|
688
|
+
getSearchRequest: () => SearchRequest;
|
|
689
|
+
getActiveFilterCount: () => number;
|
|
690
|
+
getSelectedRowIds: () => string[];
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/** Actions props */
|
|
694
|
+
export declare interface DataTableActionsProps<TData> {
|
|
695
|
+
bulkActions?: BulkAction<TData>[];
|
|
696
|
+
rowActions?: RowAction<TData>[];
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export declare function DataTableColumnHeader<TData, TValue>({ column, title, sortable, className, }: DataTableColumnHeaderProps<TData, TValue>): JSX.Element;
|
|
700
|
+
|
|
701
|
+
declare interface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {
|
|
702
|
+
column: Column<TData, TValue>;
|
|
703
|
+
title: string;
|
|
704
|
+
sortable?: boolean;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
declare interface DataTableComponentProps<TData> {
|
|
708
|
+
columns: ColumnDef<TData, unknown>[];
|
|
709
|
+
getRowId: (row: TData) => string;
|
|
710
|
+
data: TData[];
|
|
711
|
+
isLoading?: boolean;
|
|
712
|
+
error?: Error | null;
|
|
713
|
+
pagination: PaginationInfo;
|
|
714
|
+
onPageChange: (page: number) => void;
|
|
715
|
+
onPageSizeChange: (size: number) => void;
|
|
716
|
+
onPrefetchPage?: (page: number) => void;
|
|
717
|
+
pageSizeOptions?: number[];
|
|
718
|
+
sortBy: string;
|
|
719
|
+
sortDirection: 'ASC' | 'DESC';
|
|
720
|
+
onSortChange: (sortBy: string, sortDirection: 'ASC' | 'DESC') => void;
|
|
721
|
+
searchValue?: string;
|
|
722
|
+
onSearchChange?: (value: string) => void;
|
|
723
|
+
searchPlaceholder?: string;
|
|
724
|
+
searchDebounceMs?: number;
|
|
725
|
+
fieldConfig?: FieldConfig[];
|
|
726
|
+
filters?: FilterState[];
|
|
727
|
+
onFiltersChange?: (filters: FilterState[]) => void;
|
|
728
|
+
enableRowSelection?: boolean | ((row: TData) => boolean);
|
|
729
|
+
rowSelection?: Record<string, boolean>;
|
|
730
|
+
onRowSelectionChange?: (selection: Record<string, boolean>) => void;
|
|
731
|
+
bulkActions?: BulkAction<TData>[];
|
|
732
|
+
rowActions?: RowAction<TData>[];
|
|
733
|
+
toolbarStart?: React.ReactNode;
|
|
734
|
+
toolbarEnd?: React.ReactNode;
|
|
735
|
+
className?: string;
|
|
736
|
+
emptyIcon?: React.ReactNode;
|
|
737
|
+
emptyTitle?: string;
|
|
738
|
+
emptyDescription?: string;
|
|
739
|
+
onRowClick?: (row: TData) => void;
|
|
740
|
+
onRowHover?: (row: TData) => void;
|
|
741
|
+
rowClassName?: (row: TData) => string;
|
|
742
|
+
meta?: Record<string, unknown>;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/** Customization props */
|
|
746
|
+
export declare interface DataTableCustomizationProps<TData> {
|
|
747
|
+
className?: string;
|
|
748
|
+
emptyIcon?: ReactNode;
|
|
749
|
+
emptyTitle?: string;
|
|
750
|
+
emptyDescription?: string;
|
|
751
|
+
onRowClick?: (row: TData) => void;
|
|
752
|
+
rowClassName?: (row: TData) => string;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/** Data props for the table */
|
|
756
|
+
export declare interface DataTableDataProps<TData> {
|
|
757
|
+
data: TData[];
|
|
758
|
+
isLoading?: boolean;
|
|
759
|
+
error?: Error | null;
|
|
760
|
+
getRowId: (row: TData) => string;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** Filter props */
|
|
764
|
+
export declare interface DataTableFilterProps {
|
|
765
|
+
fieldConfig: FieldConfig[];
|
|
766
|
+
filters: FilterState[];
|
|
767
|
+
onFiltersChange: (filters: FilterState[]) => void;
|
|
768
|
+
quickFilters?: QuickFilter[];
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
export declare interface DataTableLabels {
|
|
772
|
+
show: string;
|
|
773
|
+
entries: string;
|
|
774
|
+
showing: string;
|
|
775
|
+
to: string;
|
|
776
|
+
of: string;
|
|
777
|
+
results: string;
|
|
778
|
+
noResults: string;
|
|
779
|
+
page: string;
|
|
780
|
+
emptyTitle: string;
|
|
781
|
+
emptyDescription: string;
|
|
782
|
+
searchPlaceholder: string;
|
|
783
|
+
filter: string;
|
|
784
|
+
clear: string;
|
|
785
|
+
apply: string;
|
|
786
|
+
operators: Record<string, string>;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/** Pagination props */
|
|
790
|
+
export declare interface DataTablePaginationProps {
|
|
791
|
+
pagination: PaginationInfo;
|
|
792
|
+
onPageChange: (page: number) => void;
|
|
793
|
+
onPageSizeChange: (size: number) => void;
|
|
794
|
+
pageSizeOptions?: number[];
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
export declare interface DataTableProps<TData> extends DataTableDataProps<TData>, DataTablePaginationProps, DataTableSortingProps, DataTableSearchProps, DataTableFilterProps, DataTableSelectionProps<TData>, DataTableActionsProps<TData>, DataTableToolbarProps, DataTableCustomizationProps<TData> {
|
|
798
|
+
/** Column definitions for TanStack Table */
|
|
799
|
+
columns: ColumnDef<TData, unknown>[];
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/** Search props */
|
|
803
|
+
export declare interface DataTableSearchProps {
|
|
804
|
+
searchValue: string;
|
|
805
|
+
onSearchChange: (value: string) => void;
|
|
806
|
+
searchPlaceholder?: string;
|
|
807
|
+
searchDebounceMs?: number;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/** Selection props */
|
|
811
|
+
export declare interface DataTableSelectionProps<TData> {
|
|
812
|
+
enableRowSelection?: boolean | ((row: TData) => boolean);
|
|
813
|
+
rowSelection: Record<string, boolean>;
|
|
814
|
+
onRowSelectionChange: (selection: Record<string, boolean>) => void;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/** Sorting props */
|
|
818
|
+
export declare interface DataTableSortingProps {
|
|
819
|
+
sortBy: string;
|
|
820
|
+
sortDirection: 'ASC' | 'DESC';
|
|
821
|
+
onSortChange: (sortBy: string, sortDirection: 'ASC' | 'DESC') => void;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
export declare interface DataTableState {
|
|
825
|
+
generalSearch: string;
|
|
826
|
+
filters: FilterState[];
|
|
827
|
+
page: number;
|
|
828
|
+
size: number;
|
|
829
|
+
sortBy: string;
|
|
830
|
+
sortDirection: 'ASC' | 'DESC';
|
|
831
|
+
rowSelection: Record<string, boolean>;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
export declare type DataTableStore = DataTableState & DataTableActions;
|
|
835
|
+
|
|
836
|
+
export declare type DataTableStoreApi = ReturnType<typeof createDataTableStore>;
|
|
837
|
+
|
|
838
|
+
/** Toolbar props */
|
|
839
|
+
export declare interface DataTableToolbarProps {
|
|
840
|
+
toolbarStart?: ReactNode;
|
|
841
|
+
toolbarEnd?: ReactNode;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Date cell for table columns.
|
|
846
|
+
* Formats dates consistently across the application.
|
|
847
|
+
*/
|
|
848
|
+
export declare function DateCell({ value, format, className, showTooltip, }: DateCellProps): JSX.Element;
|
|
849
|
+
|
|
850
|
+
declare interface DateCellProps {
|
|
851
|
+
value: DateInput;
|
|
852
|
+
format?: 'date' | 'datetime' | 'relative';
|
|
853
|
+
className?: string;
|
|
854
|
+
showTooltip?: boolean;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export declare function DateField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, minDate, maxDate, disabledDates, dateFormat, disabled, className, cols, clearable, errorHint, }: DateFieldProps<TFieldValues>): JSX.Element;
|
|
858
|
+
|
|
859
|
+
declare interface DateFieldProps<TFieldValues extends FieldValues> {
|
|
860
|
+
name: FieldPath<TFieldValues>;
|
|
861
|
+
control: Control<TFieldValues>;
|
|
862
|
+
label?: string;
|
|
863
|
+
description?: string;
|
|
864
|
+
required?: boolean;
|
|
865
|
+
placeholder?: string;
|
|
866
|
+
minDate?: Date;
|
|
867
|
+
maxDate?: Date;
|
|
868
|
+
disabledDates?: Date[];
|
|
869
|
+
dateFormat?: string;
|
|
870
|
+
disabled?: boolean;
|
|
871
|
+
className?: string;
|
|
872
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
873
|
+
clearable?: boolean;
|
|
874
|
+
errorHint?: string;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
declare type DateInput = number | string | Date | null | undefined;
|
|
878
|
+
|
|
879
|
+
declare type DateInput_2 = number | string | Date | null | undefined;
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Shared date formatting utilities for detail pages and table cells
|
|
883
|
+
*/
|
|
884
|
+
declare type DateInput_3 = number | string | Date | null | undefined;
|
|
885
|
+
|
|
886
|
+
export declare function DateRangeField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, minDate, maxDate, dateFormat, disabled, className, cols, clearable, errorHint, }: DateRangeFieldProps<TFieldValues>): JSX.Element;
|
|
887
|
+
|
|
888
|
+
declare interface DateRangeFieldProps<TFieldValues extends FieldValues> {
|
|
889
|
+
name: FieldPath<TFieldValues>;
|
|
890
|
+
control: Control<TFieldValues>;
|
|
891
|
+
label?: string;
|
|
892
|
+
description?: string;
|
|
893
|
+
required?: boolean;
|
|
894
|
+
placeholder?: string;
|
|
895
|
+
minDate?: Date;
|
|
896
|
+
maxDate?: Date;
|
|
897
|
+
dateFormat?: string;
|
|
898
|
+
disabled?: boolean;
|
|
899
|
+
className?: string;
|
|
900
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
901
|
+
clearable?: boolean;
|
|
902
|
+
errorHint?: string;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Convert date string (YYYY-MM-DD) to Unix timestamp (milliseconds)
|
|
907
|
+
* @param dateStr - Date string in YYYY-MM-DD format
|
|
908
|
+
* @param endOfDay - If true, sets time to 23:59:59.999; otherwise 00:00:00.000
|
|
909
|
+
* @returns Unix timestamp in milliseconds
|
|
910
|
+
*/
|
|
911
|
+
export declare function dateStringToTimestamp(dateStr: string, endOfDay?: boolean): number;
|
|
912
|
+
|
|
913
|
+
/**
|
|
914
|
+
* Default pagination options
|
|
915
|
+
*/
|
|
916
|
+
export declare const DEFAULT_PAGE_SIZE_OPTIONS: number[];
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Default values
|
|
920
|
+
*/
|
|
921
|
+
export declare const DEFAULTS: {
|
|
922
|
+
PAGE_SIZE: number;
|
|
923
|
+
PAGE: number;
|
|
924
|
+
SORT_BY: string;
|
|
925
|
+
SORT_DIRECTION: "ASC";
|
|
926
|
+
SEARCH_DEBOUNCE_MS: number;
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
export declare const defaultSearchRequest: SearchRequest;
|
|
930
|
+
|
|
931
|
+
export declare interface DeleteDialogLabels {
|
|
932
|
+
title: string;
|
|
933
|
+
description: string;
|
|
934
|
+
cancel: string;
|
|
935
|
+
confirm: string;
|
|
936
|
+
deleting: string;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
export declare function DetailPageMetadataFooter({ id, createdBy, updatedBy, rightContent, className, }: DetailPageMetadataFooterProps): JSX.Element;
|
|
940
|
+
|
|
941
|
+
/**
|
|
942
|
+
* Detail Page Metadata Footer
|
|
943
|
+
* Displays entity ID and audit information (created/updated by or timestamps)
|
|
944
|
+
*/
|
|
945
|
+
declare interface DetailPageMetadataFooterProps {
|
|
946
|
+
/** Entity ID to display */
|
|
947
|
+
id: number | string;
|
|
948
|
+
/** User who created the entity */
|
|
949
|
+
createdBy?: string | null;
|
|
950
|
+
/** User who last updated the entity */
|
|
951
|
+
updatedBy?: string | null;
|
|
952
|
+
/** Custom right-side content (overrides createdBy/updatedBy) */
|
|
953
|
+
rightContent?: React.ReactNode;
|
|
954
|
+
/** Additional class names */
|
|
955
|
+
className?: string;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
export declare const deviceStatusColors: {
|
|
959
|
+
readonly ACTIVE: "bg-status-success/10 text-status-success-foreground border-status-success/30";
|
|
960
|
+
readonly INACTIVE: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
961
|
+
readonly MAINTENANCE: "bg-status-warning/10 text-status-warning border-status-warning/30";
|
|
962
|
+
readonly FAULTY: "bg-status-error/10 text-status-error border-status-error/30";
|
|
963
|
+
readonly ONLINE: "bg-status-success/10 text-status-success-foreground border-status-success/30";
|
|
964
|
+
readonly OFFLINE: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
965
|
+
readonly PENDING: "bg-status-warning/10 text-status-warning border-status-warning/30";
|
|
966
|
+
readonly CONNECTED: "bg-status-success/10 text-status-success-foreground border-status-success/30";
|
|
967
|
+
readonly DISCONNECTED: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
export declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
|
|
971
|
+
|
|
972
|
+
export declare function DialogClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
|
|
973
|
+
|
|
974
|
+
export declare function DialogContent({ className, children, showCloseButton, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
975
|
+
showCloseButton?: boolean;
|
|
976
|
+
}): JSX.Element;
|
|
977
|
+
|
|
978
|
+
export declare function DialogDescription({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Description>): JSX.Element;
|
|
979
|
+
|
|
980
|
+
export declare function DialogFooter({ className, showCloseButton, children, ...props }: React_2.ComponentProps<"div"> & {
|
|
981
|
+
showCloseButton?: boolean;
|
|
982
|
+
}): JSX.Element;
|
|
983
|
+
|
|
984
|
+
export declare function DialogHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
985
|
+
|
|
986
|
+
export declare function DialogTitle({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Title>): JSX.Element;
|
|
987
|
+
|
|
988
|
+
export declare function DialogTrigger({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
|
|
989
|
+
|
|
990
|
+
export declare function DropdownMenu({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Root>): JSX.Element;
|
|
991
|
+
|
|
992
|
+
export declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): JSX.Element;
|
|
993
|
+
|
|
994
|
+
export declare function DropdownMenuContent({ className, sideOffset, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Content>): JSX.Element;
|
|
995
|
+
|
|
996
|
+
export declare function DropdownMenuGroup({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Group>): JSX.Element;
|
|
997
|
+
|
|
998
|
+
export declare function DropdownMenuItem({ className, inset, variant, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
999
|
+
inset?: boolean;
|
|
1000
|
+
variant?: "default" | "destructive";
|
|
1001
|
+
}): JSX.Element;
|
|
1002
|
+
|
|
1003
|
+
export declare function DropdownMenuLabel({ className, inset, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
1004
|
+
inset?: boolean;
|
|
1005
|
+
}): JSX.Element;
|
|
1006
|
+
|
|
1007
|
+
export declare function DropdownMenuPortal({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Portal>): JSX.Element;
|
|
1008
|
+
|
|
1009
|
+
export declare function DropdownMenuRadioGroup({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): JSX.Element;
|
|
1010
|
+
|
|
1011
|
+
export declare function DropdownMenuRadioItem({ className, children, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): JSX.Element;
|
|
1012
|
+
|
|
1013
|
+
export declare function DropdownMenuSeparator({ className, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Separator>): JSX.Element;
|
|
1014
|
+
|
|
1015
|
+
export declare function DropdownMenuShortcut({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
1016
|
+
|
|
1017
|
+
export declare function DropdownMenuSub({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Sub>): JSX.Element;
|
|
1018
|
+
|
|
1019
|
+
export declare function DropdownMenuSubContent({ className, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): JSX.Element;
|
|
1020
|
+
|
|
1021
|
+
export declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
1022
|
+
inset?: boolean;
|
|
1023
|
+
}): JSX.Element;
|
|
1024
|
+
|
|
1025
|
+
export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): JSX.Element;
|
|
1026
|
+
|
|
1027
|
+
export declare type EditorMode = 'text' | 'tree';
|
|
1028
|
+
|
|
1029
|
+
export declare const enLabels: LenaUILabels;
|
|
1030
|
+
|
|
1031
|
+
export declare function EntityDeleteDialog({ open, onOpenChange, onDelete, isDeleting, entityType, entityName, description, }: EntityDeleteDialogProps): JSX.Element;
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Generic Entity Delete Confirmation Dialog
|
|
1035
|
+
* Reusable component for delete confirmations across detail pages
|
|
1036
|
+
*/
|
|
1037
|
+
declare interface EntityDeleteDialogProps {
|
|
1038
|
+
/** Whether the dialog is open */
|
|
1039
|
+
open: boolean;
|
|
1040
|
+
/** Callback when open state changes */
|
|
1041
|
+
onOpenChange: (open: boolean) => void;
|
|
1042
|
+
/** Callback when delete is confirmed */
|
|
1043
|
+
onDelete: () => void;
|
|
1044
|
+
/** Whether delete is in progress */
|
|
1045
|
+
isDeleting: boolean;
|
|
1046
|
+
/** Entity type name (e.g., "SIM Card", "Protocol") */
|
|
1047
|
+
entityType: string;
|
|
1048
|
+
/** Display name/identifier of the entity being deleted */
|
|
1049
|
+
entityName: string;
|
|
1050
|
+
/** Optional custom description. If not provided, uses default template */
|
|
1051
|
+
description?: string;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Error Boundary Component
|
|
1056
|
+
* Catches JavaScript errors in child component tree and displays fallback UI
|
|
1057
|
+
*
|
|
1058
|
+
* @example
|
|
1059
|
+
* ```tsx
|
|
1060
|
+
* <ErrorBoundary>
|
|
1061
|
+
* <MyComponent />
|
|
1062
|
+
* </ErrorBoundary>
|
|
1063
|
+
*
|
|
1064
|
+
* // With custom fallback
|
|
1065
|
+
* <ErrorBoundary fallback={<CustomErrorUI />}>
|
|
1066
|
+
* <MyComponent />
|
|
1067
|
+
* </ErrorBoundary>
|
|
1068
|
+
* ```
|
|
1069
|
+
*/
|
|
1070
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
1071
|
+
constructor(props: ErrorBoundaryProps);
|
|
1072
|
+
static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
|
|
1073
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
1074
|
+
handleReset: () => void;
|
|
1075
|
+
handleReload: () => void;
|
|
1076
|
+
handleGoHome: () => void;
|
|
1077
|
+
render(): ReactNode;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
export declare interface ErrorBoundaryLabels {
|
|
1081
|
+
title: string;
|
|
1082
|
+
description: string;
|
|
1083
|
+
retry: string;
|
|
1084
|
+
reload: string;
|
|
1085
|
+
goHome: string;
|
|
1086
|
+
appError: string;
|
|
1087
|
+
appErrorDescription: string;
|
|
1088
|
+
reloadPage: string;
|
|
1089
|
+
sectionError: string;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
declare interface ErrorBoundaryProps {
|
|
1093
|
+
children: ReactNode;
|
|
1094
|
+
/** Custom fallback component */
|
|
1095
|
+
fallback?: ReactNode;
|
|
1096
|
+
/** Called when error is caught */
|
|
1097
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
1098
|
+
/** Whether to show technical details */
|
|
1099
|
+
showDetails?: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
declare interface ErrorBoundaryState {
|
|
1103
|
+
hasError: boolean;
|
|
1104
|
+
error: Error | null;
|
|
1105
|
+
errorInfo: React.ErrorInfo | null;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
export declare interface FieldConfig {
|
|
1109
|
+
/** API field path - supports dot notation (e.g., 'gatewayModel.id') */
|
|
1110
|
+
field: string;
|
|
1111
|
+
/** Display label for the field */
|
|
1112
|
+
label: string;
|
|
1113
|
+
/** Field data type - determines available operators */
|
|
1114
|
+
type: FieldType;
|
|
1115
|
+
/** Options for enum fields */
|
|
1116
|
+
options?: SelectOption[];
|
|
1117
|
+
/** Async function to load options */
|
|
1118
|
+
loadOptions?: () => Promise<SelectOption[]>;
|
|
1119
|
+
/** Placeholder text for input */
|
|
1120
|
+
placeholder?: string;
|
|
1121
|
+
/** Default operator when adding a filter for this field */
|
|
1122
|
+
defaultOperator?: FilterOperator;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export declare type FieldType = 'string' | 'number' | 'date' | 'boolean' | 'enum' | 'timestamp';
|
|
1126
|
+
|
|
1127
|
+
export declare function FileField<TFieldValues extends FieldValues>({ name, control, label, description, required, accept, allowedTypes, maxSize, multiple, disabled, className, cols, errorHint, }: FileFieldProps<TFieldValues>): JSX.Element;
|
|
1128
|
+
|
|
1129
|
+
declare interface FileFieldProps<TFieldValues extends FieldValues> {
|
|
1130
|
+
name: FieldPath<TFieldValues>;
|
|
1131
|
+
control: Control<TFieldValues>;
|
|
1132
|
+
label?: string;
|
|
1133
|
+
description?: string;
|
|
1134
|
+
required?: boolean;
|
|
1135
|
+
accept?: string;
|
|
1136
|
+
allowedTypes?: string[];
|
|
1137
|
+
maxSize?: number;
|
|
1138
|
+
multiple?: boolean;
|
|
1139
|
+
disabled?: boolean;
|
|
1140
|
+
className?: string;
|
|
1141
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1142
|
+
errorHint?: string;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
export declare type FilterOperator = 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'ENDS_WITH' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN' | 'LESS_THAN_OR_EQUALS' | 'IN' | 'NOT_IN' | 'BETWEEN' | 'IS_NULL' | 'IS_NOT_NULL';
|
|
1146
|
+
|
|
1147
|
+
export declare interface FilterState {
|
|
1148
|
+
/** Unique filter ID (UI only, for React keys) */
|
|
1149
|
+
id: string;
|
|
1150
|
+
/** Field path (same as SearchCriteria) */
|
|
1151
|
+
field: string;
|
|
1152
|
+
/** Filter operator */
|
|
1153
|
+
operator: FilterOperator;
|
|
1154
|
+
/** Single value for simple operators */
|
|
1155
|
+
value?: string | number | boolean | null;
|
|
1156
|
+
/** Array of values for IN, NOT_IN, BETWEEN */
|
|
1157
|
+
values?: (string | number | boolean)[];
|
|
1158
|
+
/** Whether the filter is enabled (UI only) */
|
|
1159
|
+
enabled: boolean;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Format backend timestamp to short datetime (e.g., "27 Oca 00:44")
|
|
1164
|
+
*/
|
|
1165
|
+
export declare function formatBackendTimestamp(timestamp: number | string | null | undefined): string;
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* Format a timestamp to a short date string (e.g., "Jan 1, 2024")
|
|
1169
|
+
*/
|
|
1170
|
+
export declare function formatDate(timestamp: DateInput_3): string;
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* Format a timestamp to date with time (e.g., "Jan 1, 2024 14:30")
|
|
1174
|
+
*/
|
|
1175
|
+
export declare function formatDateTime(timestamp: DateInput_3): string;
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Format a timestamp to full date with seconds (e.g., "Jan 1, 2024 14:30:45")
|
|
1179
|
+
*/
|
|
1180
|
+
export declare function formatDateTimeFull(timestamp: DateInput_3): string;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Format a timestamp to ISO string (e.g., "2024-01-01T14:30:00Z")
|
|
1184
|
+
*/
|
|
1185
|
+
export declare function formatISODate(timestamp: DateInput_3): string;
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Format a timestamp to relative time (e.g., "2 hours ago")
|
|
1189
|
+
*/
|
|
1190
|
+
export declare function formatRelativeTime(timestamp: DateInput_3, locale?: 'en' | 'tr'): string;
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Format a timestamp to a short time string (e.g., "14:30")
|
|
1194
|
+
*/
|
|
1195
|
+
export declare function formatTime(timestamp: DateInput_3): string;
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Format Zod errors for display
|
|
1199
|
+
*/
|
|
1200
|
+
export declare function formatZodErrors(errors: z.ZodIssue[]): string[];
|
|
1201
|
+
|
|
1202
|
+
export declare function FormField<TFieldValues extends FieldValues>({ name, control, label, description, required, className, cols, errorHint, floatingLabel, labelClassName, isActive, children, }: FormFieldProps<TFieldValues>): JSX.Element;
|
|
1203
|
+
|
|
1204
|
+
declare interface FormFieldProps<TFieldValues extends FieldValues> {
|
|
1205
|
+
name: FieldPath<TFieldValues>;
|
|
1206
|
+
control: Control<TFieldValues>;
|
|
1207
|
+
label?: string;
|
|
1208
|
+
description?: string;
|
|
1209
|
+
required?: boolean;
|
|
1210
|
+
className?: string;
|
|
1211
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1212
|
+
errorHint?: string;
|
|
1213
|
+
floatingLabel?: boolean;
|
|
1214
|
+
labelClassName?: string;
|
|
1215
|
+
/** When true, floating label stays in active/focused position (e.g. popover open) */
|
|
1216
|
+
isActive?: boolean;
|
|
1217
|
+
children: (field: {
|
|
1218
|
+
value: unknown;
|
|
1219
|
+
onChange: (value: unknown) => void;
|
|
1220
|
+
onBlur: () => void;
|
|
1221
|
+
name: string;
|
|
1222
|
+
ref: React.Ref<unknown>;
|
|
1223
|
+
disabled?: boolean;
|
|
1224
|
+
error?: string;
|
|
1225
|
+
}) => ReactNode;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
export declare interface FormLabels {
|
|
1229
|
+
save: string;
|
|
1230
|
+
cancel: string;
|
|
1231
|
+
processing: string;
|
|
1232
|
+
saving: string;
|
|
1233
|
+
selectPlaceholder: string;
|
|
1234
|
+
searchPlaceholder: string;
|
|
1235
|
+
noResults: string;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
export declare function FormSection({ title, children, className, collapsible, defaultOpen, icon, }: FormSectionProps): JSX.Element;
|
|
1239
|
+
|
|
1240
|
+
declare interface FormSectionProps {
|
|
1241
|
+
title: string;
|
|
1242
|
+
description?: string;
|
|
1243
|
+
children: ReactNode;
|
|
1244
|
+
className?: string;
|
|
1245
|
+
collapsible?: boolean;
|
|
1246
|
+
defaultOpen?: boolean;
|
|
1247
|
+
icon?: ReactNode;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
export declare function FormSheet({ open, onOpenChange, title, description, children, onSubmit, onCancel, isSubmitting, submitLabel, cancelLabel, side, className, icon, }: FormSheetProps): JSX.Element;
|
|
1251
|
+
|
|
1252
|
+
declare interface FormSheetProps {
|
|
1253
|
+
open: boolean;
|
|
1254
|
+
onOpenChange: (open: boolean) => void;
|
|
1255
|
+
title: string;
|
|
1256
|
+
description?: string;
|
|
1257
|
+
children: ReactNode;
|
|
1258
|
+
onSubmit: () => void;
|
|
1259
|
+
onCancel?: () => void;
|
|
1260
|
+
isSubmitting?: boolean;
|
|
1261
|
+
submitLabel?: string;
|
|
1262
|
+
cancelLabel?: string;
|
|
1263
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
1264
|
+
className?: string;
|
|
1265
|
+
icon?: ReactNode;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Parse URLSearchParams to UrlSearchParams object
|
|
1270
|
+
*/
|
|
1271
|
+
export declare function fromURLSearchParams(searchParams: URLSearchParams): Record<string, string | undefined>;
|
|
1272
|
+
|
|
1273
|
+
export declare interface GaugeFooterStat {
|
|
1274
|
+
label: string;
|
|
1275
|
+
value: string | number;
|
|
1276
|
+
colorClass?: string;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Get error path for highlighting in tree view
|
|
1281
|
+
*/
|
|
1282
|
+
export declare function getErrorPaths(errors: z.ZodIssue[]): string[][];
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Get display value for a filter (for UI chips)
|
|
1286
|
+
*/
|
|
1287
|
+
export declare function getFilterDisplayValue(filter: FilterState): string;
|
|
1288
|
+
|
|
1289
|
+
/**
|
|
1290
|
+
* Get status color classes for a given value from a color map
|
|
1291
|
+
*/
|
|
1292
|
+
export declare function getStatusColor<T extends string>(value: T | null | undefined, colorMap: Record<T, string>, fallback?: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30"): string;
|
|
1293
|
+
|
|
1294
|
+
/**
|
|
1295
|
+
* getTabDirection — Calculates slide direction based on tab index positions.
|
|
1296
|
+
*
|
|
1297
|
+
* @returns -1 (slide from left), 0 (no direction / same tab), 1 (slide from right)
|
|
1298
|
+
*/
|
|
1299
|
+
export declare function getTabDirection(tabIds: string[], fromTab: string | null, toTab: string): -1 | 0 | 1;
|
|
1300
|
+
|
|
1301
|
+
export declare function HistoryList({ items, className }: HistoryListProps): JSX.Element;
|
|
1302
|
+
|
|
1303
|
+
declare interface HistoryListItem {
|
|
1304
|
+
id: string | number;
|
|
1305
|
+
date: string | Date | number;
|
|
1306
|
+
value: string;
|
|
1307
|
+
isCurrent?: boolean;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
declare interface HistoryListProps {
|
|
1311
|
+
items: HistoryListItem[];
|
|
1312
|
+
className?: string;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
export declare type IconProp = string | React.ComponentType<{
|
|
1316
|
+
className?: string;
|
|
1317
|
+
}>;
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* Cell with icon + text combination.
|
|
1321
|
+
* Useful for displaying items like SIM cards, gateway assignments, etc.
|
|
1322
|
+
*/
|
|
1323
|
+
export declare function IconTextCell({ value, icon, className }: IconTextCellProps): JSX.Element;
|
|
1324
|
+
|
|
1325
|
+
declare interface IconTextCellProps {
|
|
1326
|
+
value: string | null | undefined;
|
|
1327
|
+
icon: React.ReactNode;
|
|
1328
|
+
className?: string;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
export declare function InfoCard({ icon, label, value, variant, iconColor, className, }: InfoCardProps): JSX.Element;
|
|
1332
|
+
|
|
1333
|
+
export declare function InfoCardGrid({ children, columns, className, }: InfoCardGridProps): JSX.Element;
|
|
1334
|
+
|
|
1335
|
+
declare interface InfoCardGridProps {
|
|
1336
|
+
children: React.ReactNode;
|
|
1337
|
+
columns?: 2 | 3 | 4;
|
|
1338
|
+
className?: string;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
declare interface InfoCardProps {
|
|
1342
|
+
icon?: React.ReactNode;
|
|
1343
|
+
label: string;
|
|
1344
|
+
value: React.ReactNode;
|
|
1345
|
+
variant?: 'default' | 'highlighted' | 'muted';
|
|
1346
|
+
iconColor?: 'primary' | 'blue' | 'green' | 'orange' | 'purple' | 'slate';
|
|
1347
|
+
className?: string;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
export declare function Input({ className, type, ...props }: React_2.ComponentProps<"input">): JSX.Element;
|
|
1351
|
+
|
|
1352
|
+
/**
|
|
1353
|
+
* Check if a filter has a valid value
|
|
1354
|
+
*/
|
|
1355
|
+
export declare function isFilterComplete(filter: FilterState): boolean;
|
|
1356
|
+
|
|
1357
|
+
export declare function JsonBadge({ data, maxLength, className }: JsonBadgeProps): JSX.Element;
|
|
1358
|
+
|
|
1359
|
+
declare interface JsonBadgeProps {
|
|
1360
|
+
data: Record<string, unknown> | unknown[] | string | null | undefined;
|
|
1361
|
+
maxLength?: number;
|
|
1362
|
+
className?: string;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
export declare interface JsonEditorLabels {
|
|
1366
|
+
clickToEdit: string;
|
|
1367
|
+
addValue: string;
|
|
1368
|
+
delete: string;
|
|
1369
|
+
lines: string;
|
|
1370
|
+
copySuccess: string;
|
|
1371
|
+
formatSuccess: string;
|
|
1372
|
+
validJson: string;
|
|
1373
|
+
invalidJson: string;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
export declare function JsonEditorSection({ title, value, onChange, onSave, isSaving, editable, disabled, disabledReason, rows, maxViewHeight, placeholder, defaultOpen, }: JsonEditorSectionProps): JSX.Element;
|
|
1377
|
+
|
|
1378
|
+
/**
|
|
1379
|
+
* JsonEditorSection - CollapsibleSection wrapper for JSON editing
|
|
1380
|
+
* Standalone component without React Hook Form dependency
|
|
1381
|
+
*/
|
|
1382
|
+
declare interface JsonEditorSectionProps {
|
|
1383
|
+
title?: string;
|
|
1384
|
+
value: string;
|
|
1385
|
+
onChange?: (value: string) => void;
|
|
1386
|
+
onSave?: (value: string) => void;
|
|
1387
|
+
isSaving?: boolean;
|
|
1388
|
+
editable?: boolean;
|
|
1389
|
+
disabled?: boolean;
|
|
1390
|
+
disabledReason?: string;
|
|
1391
|
+
rows?: number;
|
|
1392
|
+
maxViewHeight?: number;
|
|
1393
|
+
placeholder?: string;
|
|
1394
|
+
defaultOpen?: boolean;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export declare function JsonTextEditor({ value, onChange, rows, placeholder, showLineNumbers, isValid, disabled, }: JsonTextEditorProps): JSX.Element;
|
|
1398
|
+
|
|
1399
|
+
export declare interface JsonTextEditorProps {
|
|
1400
|
+
value: string;
|
|
1401
|
+
onChange: (value: string) => void;
|
|
1402
|
+
rows?: number;
|
|
1403
|
+
placeholder?: string;
|
|
1404
|
+
showLineNumbers?: boolean;
|
|
1405
|
+
isValid?: boolean;
|
|
1406
|
+
disabled?: boolean;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
export declare function JsonToolbar({ mode, onModeChange, onFormat, onCopy, isValid, allowModeSwitch, copied, }: JsonToolbarProps): JSX.Element;
|
|
1410
|
+
|
|
1411
|
+
export declare interface JsonToolbarProps {
|
|
1412
|
+
mode: EditorMode;
|
|
1413
|
+
onModeChange: (mode: EditorMode) => void;
|
|
1414
|
+
onFormat: () => void;
|
|
1415
|
+
onCopy: () => void;
|
|
1416
|
+
isValid: boolean;
|
|
1417
|
+
allowModeSwitch?: boolean;
|
|
1418
|
+
copied?: boolean;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
export declare function JsonTreeEditor({ value, onChange, maxHeight, disabled, }: JsonTreeEditorProps): JSX.Element;
|
|
1422
|
+
|
|
1423
|
+
export declare interface JsonTreeEditorProps {
|
|
1424
|
+
value: unknown;
|
|
1425
|
+
onChange: (value: unknown) => void;
|
|
1426
|
+
maxHeight?: number;
|
|
1427
|
+
disabled?: boolean;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
export declare function JsonTreeNode({ node, depth, isArrayItem, parentType: _parentType, onToggleExpand, onUpdateValue, onAddChild, onDeleteChild, onRenameKey, disabled, isError, }: JsonTreeNodeProps): JSX.Element;
|
|
1431
|
+
|
|
1432
|
+
declare interface JsonTreeNodeProps {
|
|
1433
|
+
node: TreeNode;
|
|
1434
|
+
depth: number;
|
|
1435
|
+
isArrayItem?: boolean;
|
|
1436
|
+
parentType?: 'object' | 'array';
|
|
1437
|
+
onToggleExpand: (path: string[]) => void;
|
|
1438
|
+
onUpdateValue: (path: string[], value: unknown) => void;
|
|
1439
|
+
onAddChild: (parentPath: string[], key: string, value: unknown) => void;
|
|
1440
|
+
onDeleteChild: (parentPath: string[], key: string) => void;
|
|
1441
|
+
onRenameKey: (parentPath: string[], oldKey: string, newKey: string) => void;
|
|
1442
|
+
disabled?: boolean;
|
|
1443
|
+
isError?: boolean;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export declare type JsonValueType = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
|
|
1447
|
+
|
|
1448
|
+
export declare function JsonViewer({ data, collapsible, copyable, maxHeight, className, }: JsonViewerProps): JSX.Element;
|
|
1449
|
+
|
|
1450
|
+
declare interface JsonViewerProps {
|
|
1451
|
+
data: Record<string, unknown> | unknown[] | string | null | undefined;
|
|
1452
|
+
collapsible?: boolean;
|
|
1453
|
+
copyable?: boolean;
|
|
1454
|
+
maxHeight?: number;
|
|
1455
|
+
className?: string;
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
export declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>): JSX.Element;
|
|
1459
|
+
|
|
1460
|
+
export declare interface LenaUILabels {
|
|
1461
|
+
dataTable: DataTableLabels;
|
|
1462
|
+
form: FormLabels;
|
|
1463
|
+
errorBoundary: ErrorBoundaryLabels;
|
|
1464
|
+
jsonEditor: JsonEditorLabels;
|
|
1465
|
+
common: CommonLabels;
|
|
1466
|
+
deleteDialog: DeleteDialogLabels;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* Provider for overriding default labels across all @nar-bus/lena-ui-shared components.
|
|
1471
|
+
*
|
|
1472
|
+
* @example
|
|
1473
|
+
* ```tsx
|
|
1474
|
+
* // Use Turkish defaults (zero config — backward compatible)
|
|
1475
|
+
* <LenaUIProvider>
|
|
1476
|
+
* <App />
|
|
1477
|
+
* </LenaUIProvider>
|
|
1478
|
+
*
|
|
1479
|
+
* // With locale switching
|
|
1480
|
+
* import { useLocale } from '@nar-bus/lena-ui-core';
|
|
1481
|
+
* const locale = useLocale();
|
|
1482
|
+
* <LenaUIProvider locale={locale}>
|
|
1483
|
+
* <App />
|
|
1484
|
+
* </LenaUIProvider>
|
|
1485
|
+
* ```
|
|
1486
|
+
*/
|
|
1487
|
+
export declare function LenaUIProvider({ locale, labels, children }: LenaUIProviderProps): JSX.Element;
|
|
1488
|
+
|
|
1489
|
+
export declare interface LenaUIProviderProps {
|
|
1490
|
+
/** Active locale — passed from app (reads from @nar-bus/lena-ui-core) */
|
|
1491
|
+
locale?: string;
|
|
1492
|
+
/** Override specific labels */
|
|
1493
|
+
labels?: Partial<LenaUILabels>;
|
|
1494
|
+
children: ReactNode;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Link cell for navigable table values.
|
|
1499
|
+
* Shows external link icon on hover and supports different hover colors.
|
|
1500
|
+
*/
|
|
1501
|
+
export declare function LinkCell({ to, params, value, showExternalIcon, hoverColor, className, }: LinkCellProps): JSX.Element;
|
|
1502
|
+
|
|
1503
|
+
declare interface LinkCellProps {
|
|
1504
|
+
to: string;
|
|
1505
|
+
params?: Record<string, string>;
|
|
1506
|
+
value: string | null | undefined;
|
|
1507
|
+
showExternalIcon?: boolean;
|
|
1508
|
+
hoverColor?: 'cyan' | 'violet';
|
|
1509
|
+
className?: string;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
export declare function LocaleToggle({ locale, onLocaleChange }: LocaleToggleProps): JSX.Element;
|
|
1513
|
+
|
|
1514
|
+
declare interface LocaleToggleProps {
|
|
1515
|
+
locale: string;
|
|
1516
|
+
onLocaleChange: (locale: string) => void;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
export declare function LocationMap({ lat, lon, height, zoom, title, linkLabel, className, }: LocationMapProps): JSX.Element;
|
|
1520
|
+
|
|
1521
|
+
export declare interface LocationMapProps {
|
|
1522
|
+
lat: number;
|
|
1523
|
+
lon: number;
|
|
1524
|
+
height?: number;
|
|
1525
|
+
zoom?: number;
|
|
1526
|
+
title?: string;
|
|
1527
|
+
linkLabel?: string;
|
|
1528
|
+
className?: string;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
export declare interface MetaInfo {
|
|
1532
|
+
timestamp: string;
|
|
1533
|
+
version: string;
|
|
1534
|
+
requestId: string;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
export declare type MountStrategy = 'eager' | 'lazy-persist' | 'lazy-remount';
|
|
1538
|
+
|
|
1539
|
+
export declare function MultiSelectField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, searchPlaceholder, emptyText, options, maxItems, disabled, className, cols, errorHint, }: MultiSelectFieldProps<TFieldValues>): JSX.Element;
|
|
1540
|
+
|
|
1541
|
+
declare interface MultiSelectFieldProps<TFieldValues extends FieldValues> {
|
|
1542
|
+
name: FieldPath<TFieldValues>;
|
|
1543
|
+
control: Control<TFieldValues>;
|
|
1544
|
+
label?: string;
|
|
1545
|
+
description?: string;
|
|
1546
|
+
required?: boolean;
|
|
1547
|
+
placeholder?: string;
|
|
1548
|
+
searchPlaceholder?: string;
|
|
1549
|
+
emptyText?: string;
|
|
1550
|
+
options: SelectOption[];
|
|
1551
|
+
maxItems?: number;
|
|
1552
|
+
disabled?: boolean;
|
|
1553
|
+
className?: string;
|
|
1554
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1555
|
+
errorHint?: string;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Operators that don't require any value
|
|
1560
|
+
*/
|
|
1561
|
+
export declare const NO_VALUE_OPERATORS: FilterOperator[];
|
|
1562
|
+
|
|
1563
|
+
export declare function NumberField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, min, max, step, disabled, className, cols, showControls, errorHint, }: NumberFieldProps<TFieldValues>): JSX.Element;
|
|
1564
|
+
|
|
1565
|
+
declare interface NumberFieldProps<TFieldValues extends FieldValues> {
|
|
1566
|
+
name: FieldPath<TFieldValues>;
|
|
1567
|
+
control: Control<TFieldValues>;
|
|
1568
|
+
label?: string;
|
|
1569
|
+
description?: string;
|
|
1570
|
+
required?: boolean;
|
|
1571
|
+
placeholder?: string;
|
|
1572
|
+
min?: number;
|
|
1573
|
+
max?: number;
|
|
1574
|
+
step?: number;
|
|
1575
|
+
disabled?: boolean;
|
|
1576
|
+
className?: string;
|
|
1577
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1578
|
+
showControls?: boolean;
|
|
1579
|
+
errorHint?: string;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Human-readable labels for filter operators
|
|
1584
|
+
*/
|
|
1585
|
+
export declare const OPERATOR_LABELS: Record<FilterOperator, string>;
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* Available operators grouped by field type
|
|
1589
|
+
* Matches backend GenericSpecification supported operations
|
|
1590
|
+
*/
|
|
1591
|
+
export declare const OPERATORS_BY_TYPE: Record<FieldType, FilterOperator[]>;
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* Action types for optimistic list operations
|
|
1595
|
+
*/
|
|
1596
|
+
export declare type OptimisticAction<T> = {
|
|
1597
|
+
type: 'add';
|
|
1598
|
+
item: T;
|
|
1599
|
+
} | {
|
|
1600
|
+
type: 'update';
|
|
1601
|
+
item: T;
|
|
1602
|
+
} | {
|
|
1603
|
+
type: 'delete';
|
|
1604
|
+
id: number | string;
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1607
|
+
export declare interface PagedResponse<T> {
|
|
1608
|
+
status: number;
|
|
1609
|
+
success: boolean;
|
|
1610
|
+
message: string;
|
|
1611
|
+
data: T[];
|
|
1612
|
+
pagination: PaginationInfo;
|
|
1613
|
+
meta: MetaInfo;
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Page-level Error Boundary with full-page fallback
|
|
1618
|
+
*/
|
|
1619
|
+
export declare function PageErrorBoundary({ children }: {
|
|
1620
|
+
children: ReactNode;
|
|
1621
|
+
}): JSX.Element;
|
|
1622
|
+
|
|
1623
|
+
export declare function PageHeader({ title, description, icon: Icon, breadcrumbs, actions, className, onBreadcrumbsChange, }: PageHeaderProps): JSX.Element;
|
|
1624
|
+
|
|
1625
|
+
export declare interface PageHeaderProps {
|
|
1626
|
+
title: string;
|
|
1627
|
+
description?: string;
|
|
1628
|
+
icon: React.ComponentType<{
|
|
1629
|
+
className?: string;
|
|
1630
|
+
}>;
|
|
1631
|
+
breadcrumbs: BreadcrumbItem[];
|
|
1632
|
+
actions?: React.ReactNode;
|
|
1633
|
+
className?: string;
|
|
1634
|
+
/** Callback to sync breadcrumbs with external store (e.g. uiStore) */
|
|
1635
|
+
onBreadcrumbsChange?: (breadcrumbs: BreadcrumbItem[]) => void;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
export declare function Pagination({ className, ...props }: React_2.ComponentProps<"nav">): JSX.Element;
|
|
1639
|
+
|
|
1640
|
+
export declare function PaginationContent({ className, ...props }: React_2.ComponentProps<"ul">): JSX.Element;
|
|
1641
|
+
|
|
1642
|
+
export declare function PaginationEllipsis({ className, ...props }: React_2.ComponentProps<"span">): JSX.Element;
|
|
1643
|
+
|
|
1644
|
+
export declare interface PaginationInfo {
|
|
1645
|
+
page: number;
|
|
1646
|
+
size: number;
|
|
1647
|
+
totalElements: number;
|
|
1648
|
+
totalPages: number;
|
|
1649
|
+
hasNext: boolean;
|
|
1650
|
+
hasPrevious: boolean;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
export declare function PaginationItem({ ...props }: React_2.ComponentProps<"li">): JSX.Element;
|
|
1654
|
+
|
|
1655
|
+
export declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): JSX.Element;
|
|
1656
|
+
|
|
1657
|
+
declare type PaginationLinkProps = {
|
|
1658
|
+
isActive?: boolean;
|
|
1659
|
+
} & Pick<React_2.ComponentProps<typeof Button>, "size"> & React_2.ComponentProps<"a">;
|
|
1660
|
+
|
|
1661
|
+
export declare function PaginationNext({ className, ...props }: React_2.ComponentProps<typeof PaginationLink>): JSX.Element;
|
|
1662
|
+
|
|
1663
|
+
export declare function PaginationPrevious({ className, ...props }: React_2.ComponentProps<typeof PaginationLink>): JSX.Element;
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Parse backend timestamp format (YYYYMMDDHHmmssSSS) to Date
|
|
1667
|
+
* Example: 20260127004431907 -> Date(2026, 0, 27, 0, 44, 31)
|
|
1668
|
+
*/
|
|
1669
|
+
export declare function parseBackendTimestamp(timestamp: number | string | null | undefined): Date | null;
|
|
1670
|
+
|
|
1671
|
+
/**
|
|
1672
|
+
* Parse URL search params into UrlState
|
|
1673
|
+
*/
|
|
1674
|
+
export declare function parseUrlState(params: Record<string, string | undefined>): UrlState;
|
|
1675
|
+
|
|
1676
|
+
export declare function PasswordField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, disabled, className, cols, showIcon, errorHint, }: PasswordFieldProps<TFieldValues>): JSX.Element;
|
|
1677
|
+
|
|
1678
|
+
declare interface PasswordFieldProps<TFieldValues extends FieldValues> {
|
|
1679
|
+
name: FieldPath<TFieldValues>;
|
|
1680
|
+
control: Control<TFieldValues>;
|
|
1681
|
+
label?: string;
|
|
1682
|
+
description?: string;
|
|
1683
|
+
required?: boolean;
|
|
1684
|
+
placeholder?: string;
|
|
1685
|
+
disabled?: boolean;
|
|
1686
|
+
className?: string;
|
|
1687
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1688
|
+
showIcon?: boolean;
|
|
1689
|
+
errorHint?: string;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
export declare function Popover({ ...props }: React_2.ComponentProps<typeof PopoverPrimitive.Root>): JSX.Element;
|
|
1693
|
+
|
|
1694
|
+
export declare function PopoverContent({ className, align, sideOffset, ...props }: React_2.ComponentProps<typeof PopoverPrimitive.Content>): JSX.Element;
|
|
1695
|
+
|
|
1696
|
+
export declare function PopoverTrigger({ ...props }: React_2.ComponentProps<typeof PopoverPrimitive.Trigger>): JSX.Element;
|
|
1697
|
+
|
|
1698
|
+
export declare const priorityColors: {
|
|
1699
|
+
readonly HIGH: "bg-status-error/10 text-status-error border-status-error/30";
|
|
1700
|
+
readonly MEDIUM: "bg-status-warning/10 text-status-warning border-status-warning/30";
|
|
1701
|
+
readonly LOW: "bg-status-info/10 text-status-info-foreground border-status-info/30";
|
|
1702
|
+
readonly CRITICAL: "bg-status-error/10 text-status-error border-status-error/30";
|
|
1703
|
+
readonly NORMAL: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
export declare function Progress({ className, value, ...props }: React_2.ComponentProps<typeof ProgressPrimitive.Root>): JSX.Element;
|
|
1707
|
+
|
|
1708
|
+
export declare function PropertyRow({ label, value, copyable, badge, badgeVariant, isEditing, fieldType, options, onChange, placeholder, disabled, }: PropertyRowProps): JSX.Element;
|
|
1709
|
+
|
|
1710
|
+
declare interface PropertyRowProps {
|
|
1711
|
+
label: string;
|
|
1712
|
+
value: string | number | boolean | null | undefined;
|
|
1713
|
+
copyable?: boolean;
|
|
1714
|
+
badge?: boolean;
|
|
1715
|
+
badgeVariant?: 'default' | 'secondary' | 'destructive' | 'outline';
|
|
1716
|
+
isEditing?: boolean;
|
|
1717
|
+
fieldType?: 'text' | 'number' | 'select' | 'switch' | 'password';
|
|
1718
|
+
options?: SelectOption_2[];
|
|
1719
|
+
onChange?: (value: string | number | boolean) => void;
|
|
1720
|
+
placeholder?: string;
|
|
1721
|
+
disabled?: boolean;
|
|
1722
|
+
}
|
|
1723
|
+
|
|
1724
|
+
export declare const protocolTypeColors: {
|
|
1725
|
+
readonly DLMS: "bg-status-info/10 text-status-info-foreground border-status-info/30";
|
|
1726
|
+
readonly MODBUS: "bg-status-purple/10 text-status-purple-foreground border-status-purple/30";
|
|
1727
|
+
readonly IEC_62056_21: "bg-accent-cyan/10 text-accent-cyan border-accent-cyan/30";
|
|
1728
|
+
readonly ANSI_C12_18: "bg-status-warning/10 text-status-warning border-status-warning/30";
|
|
1729
|
+
};
|
|
1730
|
+
|
|
1731
|
+
export declare function QuickActionTile({ title, description, icon, href, onClick, variant, badge, className, animationDelay, }: QuickActionTileProps): JSX.Element;
|
|
1732
|
+
|
|
1733
|
+
export declare interface QuickActionTileProps {
|
|
1734
|
+
title: string;
|
|
1735
|
+
description: string;
|
|
1736
|
+
icon: ReactNode;
|
|
1737
|
+
href?: string;
|
|
1738
|
+
onClick?: () => void;
|
|
1739
|
+
variant?: 'default' | 'primary' | 'warning' | 'danger';
|
|
1740
|
+
badge?: string | number;
|
|
1741
|
+
className?: string;
|
|
1742
|
+
animationDelay?: number;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
export declare interface QuickFilter {
|
|
1746
|
+
id: string;
|
|
1747
|
+
label: string;
|
|
1748
|
+
icon?: ReactNode;
|
|
1749
|
+
filters: Omit<FilterState, 'id' | 'enabled'>[];
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
export declare function RadioGroup({ className, ...props }: React_2.ComponentProps<typeof RadioGroupPrimitive.Root>): JSX.Element;
|
|
1753
|
+
|
|
1754
|
+
export declare function RadioGroupField<TFieldValues extends FieldValues>({ name, control, label, description, required, options, orientation, disabled, className, cols, }: RadioGroupFieldProps<TFieldValues>): JSX.Element;
|
|
1755
|
+
|
|
1756
|
+
declare interface RadioGroupFieldProps<TFieldValues extends FieldValues> {
|
|
1757
|
+
name: FieldPath<TFieldValues>;
|
|
1758
|
+
control: Control<TFieldValues>;
|
|
1759
|
+
label?: string;
|
|
1760
|
+
description?: string;
|
|
1761
|
+
required?: boolean;
|
|
1762
|
+
options: RadioOption[];
|
|
1763
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1764
|
+
disabled?: boolean;
|
|
1765
|
+
className?: string;
|
|
1766
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
export declare function RadioGroupItem({ className, ...props }: React_2.ComponentProps<typeof RadioGroupPrimitive.Item>): JSX.Element;
|
|
1770
|
+
|
|
1771
|
+
declare interface RadioOption {
|
|
1772
|
+
value: string;
|
|
1773
|
+
label: string;
|
|
1774
|
+
description?: string;
|
|
1775
|
+
icon?: React.ReactNode;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
/**
|
|
1779
|
+
* Relative time cell for displaying "time ago" values.
|
|
1780
|
+
* Changes color based on how old the timestamp is.
|
|
1781
|
+
*
|
|
1782
|
+
* Ideal for: lastSeen, lastSync, updatedAt fields
|
|
1783
|
+
*/
|
|
1784
|
+
export declare function RelativeTimeCell({ value, className, warningThresholdMs, errorThresholdMs, }: RelativeTimeCellProps): JSX.Element;
|
|
1785
|
+
|
|
1786
|
+
declare interface RelativeTimeCellProps {
|
|
1787
|
+
value: DateInput_2;
|
|
1788
|
+
className?: string;
|
|
1789
|
+
warningThresholdMs?: number;
|
|
1790
|
+
errorThresholdMs?: number;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
export declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof Separator_2> & {
|
|
1794
|
+
withHandle?: boolean;
|
|
1795
|
+
}): JSX.Element;
|
|
1796
|
+
|
|
1797
|
+
export declare function ResizablePanel({ ...props }: React.ComponentProps<typeof Panel>): JSX.Element;
|
|
1798
|
+
|
|
1799
|
+
export declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof Group>): JSX.Element;
|
|
1800
|
+
|
|
1801
|
+
export declare function resolveIcon(icon: IconProp): React.ComponentType<{
|
|
1802
|
+
className?: string;
|
|
1803
|
+
}>;
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Common route param schemas
|
|
1807
|
+
*/
|
|
1808
|
+
export declare const routeParamSchemas: {
|
|
1809
|
+
/** Numeric ID parameter (e.g., /entity/$id) */
|
|
1810
|
+
numericId: z.ZodObject<{
|
|
1811
|
+
id: z.ZodCoercedNumber<unknown>;
|
|
1812
|
+
}, z.core.$strip>;
|
|
1813
|
+
/** String ID parameter */
|
|
1814
|
+
stringId: z.ZodObject<{
|
|
1815
|
+
id: z.ZodString;
|
|
1816
|
+
}, z.core.$strip>;
|
|
1817
|
+
/** UUID parameter */
|
|
1818
|
+
uuid: z.ZodObject<{
|
|
1819
|
+
id: z.ZodString;
|
|
1820
|
+
}, z.core.$strip>;
|
|
1821
|
+
};
|
|
1822
|
+
|
|
1823
|
+
export declare interface RowAction<TData> {
|
|
1824
|
+
id: string;
|
|
1825
|
+
label: string;
|
|
1826
|
+
icon?: ReactNode;
|
|
1827
|
+
variant?: 'default' | 'destructive';
|
|
1828
|
+
onClick: (row: TData) => void;
|
|
1829
|
+
hidden?: (row: TData) => boolean;
|
|
1830
|
+
disabled?: (row: TData) => boolean;
|
|
1831
|
+
separator?: boolean;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* Safe param validation without throwing
|
|
1836
|
+
* Returns null if validation fails
|
|
1837
|
+
*/
|
|
1838
|
+
export declare function safeValidateParams<TSchema extends z.ZodType>(params: unknown, schema: TSchema): z.infer<TSchema> | null;
|
|
1839
|
+
|
|
1840
|
+
export declare function ScrollArea({ className, children, ...props }: React_2.ComponentProps<typeof ScrollAreaPrimitive.Root>): JSX.Element;
|
|
1841
|
+
|
|
1842
|
+
export declare function ScrollBar({ className, orientation, ...props }: React_2.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): JSX.Element;
|
|
1843
|
+
|
|
1844
|
+
export declare function SearchBar({ value, onChange, onFilterToggle, filterActive, placeholder, recentSearches, onRecentSearchSelect, recentSearchesLabel, filterLabel, clearLabel, keyboardShortcut, className, }: SearchBarProps): JSX.Element;
|
|
1845
|
+
|
|
1846
|
+
export declare interface SearchBarProps {
|
|
1847
|
+
value: string;
|
|
1848
|
+
onChange: (value: string) => void;
|
|
1849
|
+
onFilterToggle?: () => void;
|
|
1850
|
+
filterActive?: boolean;
|
|
1851
|
+
placeholder?: string;
|
|
1852
|
+
recentSearches?: string[];
|
|
1853
|
+
onRecentSearchSelect?: (search: string) => void;
|
|
1854
|
+
recentSearchesLabel?: string;
|
|
1855
|
+
filterLabel?: string;
|
|
1856
|
+
clearLabel?: string;
|
|
1857
|
+
keyboardShortcut?: string;
|
|
1858
|
+
className?: string;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
export declare interface SearchCriteria {
|
|
1862
|
+
field: string;
|
|
1863
|
+
operator: FilterOperator;
|
|
1864
|
+
value?: string | number | boolean | null;
|
|
1865
|
+
values?: (string | number | boolean)[];
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
export declare interface SearchRequest {
|
|
1869
|
+
page: number;
|
|
1870
|
+
size: number;
|
|
1871
|
+
generalSearch?: string;
|
|
1872
|
+
filters: SearchCriteria[];
|
|
1873
|
+
sortBy: string;
|
|
1874
|
+
sortDirection: 'ASC' | 'DESC';
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* Section-level Error Boundary with compact fallback
|
|
1879
|
+
*/
|
|
1880
|
+
export declare function SectionErrorBoundary({ children, title, }: {
|
|
1881
|
+
children: ReactNode;
|
|
1882
|
+
title?: string;
|
|
1883
|
+
}): JSX.Element;
|
|
1884
|
+
|
|
1885
|
+
export declare const SegmentedControl: <T extends string = string>(props: SegmentedControlProps<T>) => React.JSX.Element;
|
|
1886
|
+
|
|
1887
|
+
export declare interface SegmentedControlItem<T extends string = string> {
|
|
1888
|
+
key: T;
|
|
1889
|
+
label: string;
|
|
1890
|
+
icon?: ReactNode;
|
|
1891
|
+
count?: number;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
export declare interface SegmentedControlProps<T extends string = string> {
|
|
1895
|
+
items: SegmentedControlItem<T>[];
|
|
1896
|
+
activeKey: T;
|
|
1897
|
+
onActiveChange: (key: T) => void;
|
|
1898
|
+
showLabels?: boolean;
|
|
1899
|
+
className?: string;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
export declare function Select({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Root>): JSX.Element;
|
|
1903
|
+
|
|
1904
|
+
export declare const SelectableCard: NamedExoticComponent<SelectableCardProps>;
|
|
1905
|
+
|
|
1906
|
+
export declare interface SelectableCardProps {
|
|
1907
|
+
title: string;
|
|
1908
|
+
icon?: ReactNode;
|
|
1909
|
+
isSelected: boolean;
|
|
1910
|
+
onSelect: () => void;
|
|
1911
|
+
description?: string;
|
|
1912
|
+
className?: string;
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/** Select active filter count */
|
|
1916
|
+
export declare const selectActiveFilterCount: (state: DataTableStore) => number;
|
|
1917
|
+
|
|
1918
|
+
export declare function SelectContent({ className, children, position, align, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Content>): JSX.Element;
|
|
1919
|
+
|
|
1920
|
+
export declare function SelectField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, searchPlaceholder, emptyText, options, disabled, className, cols, errorHint, }: SelectFieldProps<TFieldValues>): JSX.Element;
|
|
1921
|
+
|
|
1922
|
+
declare interface SelectFieldProps<TFieldValues extends FieldValues> {
|
|
1923
|
+
name: FieldPath<TFieldValues>;
|
|
1924
|
+
control: Control<TFieldValues>;
|
|
1925
|
+
label?: string;
|
|
1926
|
+
description?: string;
|
|
1927
|
+
required?: boolean;
|
|
1928
|
+
placeholder?: string;
|
|
1929
|
+
searchPlaceholder?: string;
|
|
1930
|
+
emptyText?: string;
|
|
1931
|
+
options: SelectOption[];
|
|
1932
|
+
disabled?: boolean;
|
|
1933
|
+
className?: string;
|
|
1934
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
1935
|
+
errorHint?: string;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
/** Select filters array */
|
|
1939
|
+
export declare const selectFilters: (state: DataTableStore) => FilterState[];
|
|
1940
|
+
|
|
1941
|
+
/** Select general search value */
|
|
1942
|
+
export declare const selectGeneralSearch: (state: DataTableStore) => string;
|
|
1943
|
+
|
|
1944
|
+
export declare function SelectGroup({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Group>): JSX.Element;
|
|
1945
|
+
|
|
1946
|
+
/** Select if there are any active filters */
|
|
1947
|
+
export declare const selectHasActiveFilters: (state: DataTableStore) => boolean;
|
|
1948
|
+
|
|
1949
|
+
export declare function SelectItem({ className, children, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Item>): JSX.Element;
|
|
1950
|
+
|
|
1951
|
+
export declare function SelectLabel({ className, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Label>): JSX.Element;
|
|
1952
|
+
|
|
1953
|
+
export declare interface SelectOption {
|
|
1954
|
+
value: string | number;
|
|
1955
|
+
label: string;
|
|
1956
|
+
color?: string;
|
|
1957
|
+
icon?: ReactNode;
|
|
1958
|
+
description?: string;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* Property Row - Simple key-value row for property panels
|
|
1963
|
+
* Supports inline editing mode
|
|
1964
|
+
*/
|
|
1965
|
+
declare interface SelectOption_2 {
|
|
1966
|
+
value: string;
|
|
1967
|
+
label: string;
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
/** Select page number */
|
|
1971
|
+
export declare const selectPage: (state: DataTableStore) => number;
|
|
1972
|
+
|
|
1973
|
+
/** Select pagination info */
|
|
1974
|
+
export declare const selectPaginationState: (state: DataTableStore) => {
|
|
1975
|
+
page: number;
|
|
1976
|
+
size: number;
|
|
1977
|
+
};
|
|
1978
|
+
|
|
1979
|
+
/** Select row selection */
|
|
1980
|
+
export declare const selectRowSelection: (state: DataTableStore) => Record<string, boolean>;
|
|
1981
|
+
|
|
1982
|
+
/** Select search request - use with useShallow for object comparison */
|
|
1983
|
+
export declare const selectSearchRequest: (state: DataTableStore) => SearchRequest;
|
|
1984
|
+
|
|
1985
|
+
/** Select selected row count */
|
|
1986
|
+
export declare const selectSelectedRowCount: (state: DataTableStore) => number;
|
|
1987
|
+
|
|
1988
|
+
/** Select selected row IDs */
|
|
1989
|
+
export declare const selectSelectedRowIds: (state: DataTableStore) => string[];
|
|
1990
|
+
|
|
1991
|
+
export declare function SelectSeparator({ className, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Separator>): JSX.Element;
|
|
1992
|
+
|
|
1993
|
+
/** Select page size */
|
|
1994
|
+
export declare const selectSize: (state: DataTableStore) => number;
|
|
1995
|
+
|
|
1996
|
+
/** Select sort field */
|
|
1997
|
+
export declare const selectSortBy: (state: DataTableStore) => string;
|
|
1998
|
+
|
|
1999
|
+
/** Select sort direction */
|
|
2000
|
+
export declare const selectSortDirection: (state: DataTableStore) => "ASC" | "DESC";
|
|
2001
|
+
|
|
2002
|
+
/** Select sorting info */
|
|
2003
|
+
export declare const selectSortingState: (state: DataTableStore) => {
|
|
2004
|
+
sortBy: string;
|
|
2005
|
+
sortDirection: "ASC" | "DESC";
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
export declare function SelectTrigger({ className, size, children, ...props }: React_2.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
2009
|
+
size?: "sm" | "default";
|
|
2010
|
+
}): JSX.Element;
|
|
2011
|
+
|
|
2012
|
+
export declare function SelectValue({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Value>): JSX.Element;
|
|
2013
|
+
|
|
2014
|
+
export declare function Separator({ className, orientation, decorative, ...props }: React_2.ComponentProps<typeof SeparatorPrimitive.Root>): JSX.Element;
|
|
2015
|
+
|
|
2016
|
+
export declare function serializeSearchParams(params: SearchRequest): string;
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* Serialize DataTableState to URL search params
|
|
2020
|
+
* Only includes non-default values to keep URLs clean
|
|
2021
|
+
*/
|
|
2022
|
+
export declare function serializeToUrl(state: DataTableState): UrlSearchParams;
|
|
2023
|
+
|
|
2024
|
+
export declare function Sheet({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
|
|
2025
|
+
|
|
2026
|
+
export declare function SheetClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
|
|
2027
|
+
|
|
2028
|
+
export declare function SheetContent({ className, children, side, showCloseButton, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
2029
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
2030
|
+
showCloseButton?: boolean;
|
|
2031
|
+
}): JSX.Element;
|
|
2032
|
+
|
|
2033
|
+
export declare function SheetDescription({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Description>): JSX.Element;
|
|
2034
|
+
|
|
2035
|
+
export declare function SheetFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
2036
|
+
|
|
2037
|
+
export declare function SheetHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
2038
|
+
|
|
2039
|
+
export declare function SheetTitle({ className, ...props }: React_2.ComponentProps<typeof DialogPrimitive.Title>): JSX.Element;
|
|
2040
|
+
|
|
2041
|
+
export declare function SheetTrigger({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
|
|
2042
|
+
|
|
2043
|
+
export declare interface SidebarNavItem {
|
|
2044
|
+
title: string;
|
|
2045
|
+
href: string;
|
|
2046
|
+
icon: IconProp;
|
|
2047
|
+
children?: SidebarNavItem[];
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
export declare function SimpleDataTable<TData>({ columns, data, getRowId, isLoading, error, meta, enableSearch, searchPlaceholder, searchColumn, emptyIcon, emptyTitle, emptyDescription, onRowClick, rowClassName, className, loadingRows, }: SimpleDataTableProps<TData>): JSX.Element;
|
|
2051
|
+
|
|
2052
|
+
declare interface SimpleDataTableProps<TData> {
|
|
2053
|
+
/** Column definitions */
|
|
2054
|
+
columns: ColumnDef<TData, unknown>[];
|
|
2055
|
+
/** Table data */
|
|
2056
|
+
data: TData[];
|
|
2057
|
+
/** Function to get unique row ID */
|
|
2058
|
+
getRowId: (row: TData) => string;
|
|
2059
|
+
/** Loading state */
|
|
2060
|
+
isLoading?: boolean;
|
|
2061
|
+
/** Error state */
|
|
2062
|
+
error?: Error | null;
|
|
2063
|
+
/** Custom meta passed to column cells */
|
|
2064
|
+
meta?: Record<string, unknown>;
|
|
2065
|
+
/** Enable client-side search */
|
|
2066
|
+
enableSearch?: boolean;
|
|
2067
|
+
/** Search placeholder */
|
|
2068
|
+
searchPlaceholder?: string;
|
|
2069
|
+
/** Column to search (accessorKey) - defaults to global filter */
|
|
2070
|
+
searchColumn?: string;
|
|
2071
|
+
/** Empty state icon */
|
|
2072
|
+
emptyIcon?: React.ReactNode;
|
|
2073
|
+
/** Empty state title */
|
|
2074
|
+
emptyTitle?: string;
|
|
2075
|
+
/** Empty state description */
|
|
2076
|
+
emptyDescription?: string;
|
|
2077
|
+
/** Row click handler */
|
|
2078
|
+
onRowClick?: (row: TData) => void;
|
|
2079
|
+
/** Custom row class */
|
|
2080
|
+
rowClassName?: (row: TData) => string;
|
|
2081
|
+
/** Container class */
|
|
2082
|
+
className?: string;
|
|
2083
|
+
/** Number of skeleton rows for loading state */
|
|
2084
|
+
loadingRows?: number;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
export declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
2088
|
+
|
|
2089
|
+
export declare function Slider({ className, defaultValue, value, min, max, ...props }: React_2.ComponentProps<typeof SliderPrimitive.Root>): JSX.Element;
|
|
2090
|
+
|
|
2091
|
+
/**
|
|
2092
|
+
* Two-line stacked text cell.
|
|
2093
|
+
* Useful for displaying model + brand or similar hierarchical information.
|
|
2094
|
+
*/
|
|
2095
|
+
export declare function StackedTextCell({ primary, secondary, primaryClassName, }: StackedTextCellProps): JSX.Element;
|
|
2096
|
+
|
|
2097
|
+
declare interface StackedTextCellProps {
|
|
2098
|
+
primary: string | null | undefined;
|
|
2099
|
+
secondary?: string | null | undefined;
|
|
2100
|
+
primaryClassName?: string;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
export declare function StatCard({ title, value, unit, trend, trendLabel, status, icon, sparklineData, className, animationDelay, isLoading, }: StatCardProps): JSX.Element;
|
|
2104
|
+
|
|
2105
|
+
export declare interface StatCardProps {
|
|
2106
|
+
title: string;
|
|
2107
|
+
value: string | number;
|
|
2108
|
+
unit?: string;
|
|
2109
|
+
trend?: {
|
|
2110
|
+
value: number;
|
|
2111
|
+
direction: 'up' | 'down' | 'neutral';
|
|
2112
|
+
};
|
|
2113
|
+
trendLabel?: string;
|
|
2114
|
+
status?: 'online' | 'warning' | 'error' | 'neutral';
|
|
2115
|
+
icon?: ReactNode;
|
|
2116
|
+
sparklineData?: number[];
|
|
2117
|
+
className?: string;
|
|
2118
|
+
animationDelay?: number;
|
|
2119
|
+
isLoading?: boolean;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Status badge for displaying enum/status values.
|
|
2124
|
+
* Provides consistent styling across all tables.
|
|
2125
|
+
*
|
|
2126
|
+
* @example
|
|
2127
|
+
* ```tsx
|
|
2128
|
+
* <StatusBadge
|
|
2129
|
+
* value={row.status}
|
|
2130
|
+
* colorMap={{
|
|
2131
|
+
* ACTIVE: statusColors.success,
|
|
2132
|
+
* INACTIVE: statusColors.neutral,
|
|
2133
|
+
* }}
|
|
2134
|
+
* labelMap={{
|
|
2135
|
+
* ACTIVE: 'Active',
|
|
2136
|
+
* INACTIVE: 'Inactive',
|
|
2137
|
+
* }}
|
|
2138
|
+
* showDot
|
|
2139
|
+
* icon={<Wifi className="h-3 w-3" />}
|
|
2140
|
+
* />
|
|
2141
|
+
* ```
|
|
2142
|
+
*/
|
|
2143
|
+
export declare function StatusBadge<T extends string>({ value, colorMap, labelMap, icon, showDot, dotColorMap, pulse, size, showLabel, className, }: StatusBadgeProps<T>): JSX.Element;
|
|
2144
|
+
|
|
2145
|
+
declare interface StatusBadgeProps<T extends string> {
|
|
2146
|
+
value: T | null | undefined;
|
|
2147
|
+
colorMap: Record<T, string>;
|
|
2148
|
+
labelMap?: Record<T, string>;
|
|
2149
|
+
icon?: React.ReactNode;
|
|
2150
|
+
showDot?: boolean;
|
|
2151
|
+
dotColorMap?: Record<T, string>;
|
|
2152
|
+
pulse?: boolean | Record<T, boolean>;
|
|
2153
|
+
size?: 'sm' | 'md';
|
|
2154
|
+
showLabel?: boolean;
|
|
2155
|
+
className?: string;
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
export declare type StatusColor = keyof typeof statusColors;
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* Standardized color palette for status badges and indicators.
|
|
2162
|
+
* Semantic colors with consistent light/dark mode support.
|
|
2163
|
+
*/
|
|
2164
|
+
export declare const statusColors: {
|
|
2165
|
+
readonly success: "bg-status-success/10 text-status-success-foreground border-status-success/30";
|
|
2166
|
+
readonly warning: "bg-status-warning/10 text-status-warning border-status-warning/30";
|
|
2167
|
+
readonly error: "bg-status-error/10 text-status-error border-status-error/30";
|
|
2168
|
+
readonly info: "bg-status-info/10 text-status-info-foreground border-status-info/30";
|
|
2169
|
+
readonly neutral: "bg-status-neutral/10 text-status-neutral-foreground border-status-neutral/30";
|
|
2170
|
+
readonly accent: "bg-accent-cyan/10 text-accent-cyan border-accent-cyan/30";
|
|
2171
|
+
readonly purple: "bg-status-purple/10 text-status-purple-foreground border-status-purple/30";
|
|
2172
|
+
};
|
|
2173
|
+
|
|
2174
|
+
/**
|
|
2175
|
+
* Submit button that automatically shows loading state during form submission.
|
|
2176
|
+
*
|
|
2177
|
+
* Works with:
|
|
2178
|
+
* 1. React 19 form actions (automatic via useFormStatus)
|
|
2179
|
+
* 2. react-hook-form (pass isPending prop)
|
|
2180
|
+
*
|
|
2181
|
+
* @example
|
|
2182
|
+
* ```tsx
|
|
2183
|
+
* // With React 19 form actions
|
|
2184
|
+
* <form action={formAction}>
|
|
2185
|
+
* <SubmitButton>Save</SubmitButton>
|
|
2186
|
+
* </form>
|
|
2187
|
+
*
|
|
2188
|
+
* // With react-hook-form
|
|
2189
|
+
* <form onSubmit={handleSubmit(onSubmit)}>
|
|
2190
|
+
* <SubmitButton isPending={isSubmitting}>Save</SubmitButton>
|
|
2191
|
+
* </form>
|
|
2192
|
+
* ```
|
|
2193
|
+
*/
|
|
2194
|
+
export declare function SubmitButton({ children, loadingText, isPending: isPendingProp, disabled, ...props }: SubmitButtonProps): JSX.Element;
|
|
2195
|
+
|
|
2196
|
+
declare interface SubmitButtonProps extends Omit<ButtonProps, 'type'> {
|
|
2197
|
+
/** Loading text shown when form is submitting */
|
|
2198
|
+
loadingText?: string;
|
|
2199
|
+
/** Override pending state (useful with react-hook-form) */
|
|
2200
|
+
isPending?: boolean;
|
|
2201
|
+
}
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* Form submit button with custom loading indicator
|
|
2205
|
+
* Provides more control over the loading state UI
|
|
2206
|
+
*/
|
|
2207
|
+
export declare function SubmitButtonWithStatus({ children, loadingContent, isPending: isPendingProp, disabled, ...props }: Omit<SubmitButtonProps, 'loadingText'> & {
|
|
2208
|
+
loadingContent: React.ReactNode;
|
|
2209
|
+
}): JSX.Element;
|
|
2210
|
+
|
|
2211
|
+
export declare function SupportBadge({ value, label, className }: SupportBadgeProps): JSX.Element;
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* Support Badge
|
|
2215
|
+
* Displays a boolean support status with check/x icon and label
|
|
2216
|
+
*/
|
|
2217
|
+
declare interface SupportBadgeProps {
|
|
2218
|
+
/** Whether the feature is supported */
|
|
2219
|
+
value: boolean;
|
|
2220
|
+
/** Label to display (e.g., "IEC", "DLMS", "Supported") */
|
|
2221
|
+
label: string;
|
|
2222
|
+
/** Additional class names */
|
|
2223
|
+
className?: string;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
export declare type SurfaceColor = keyof typeof surfaceColors;
|
|
2227
|
+
|
|
2228
|
+
/** Surface colors for containers, cards, banners - more opaque than statusColors */
|
|
2229
|
+
export declare const surfaceColors: {
|
|
2230
|
+
readonly success: "bg-surface-success text-surface-success-foreground";
|
|
2231
|
+
readonly warning: "bg-surface-warning text-surface-warning-foreground";
|
|
2232
|
+
readonly error: "bg-surface-error text-surface-error-foreground";
|
|
2233
|
+
readonly info: "bg-surface-info text-surface-info-foreground";
|
|
2234
|
+
readonly purple: "bg-surface-purple text-surface-purple-foreground";
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
/**
|
|
2238
|
+
* Reusable Suspense boundary with configurable fallback
|
|
2239
|
+
*
|
|
2240
|
+
* @example
|
|
2241
|
+
* ```tsx
|
|
2242
|
+
* // With default skeleton
|
|
2243
|
+
* <SuspenseWrapper>
|
|
2244
|
+
* <AsyncComponent />
|
|
2245
|
+
* </SuspenseWrapper>
|
|
2246
|
+
*
|
|
2247
|
+
* // With custom height
|
|
2248
|
+
* <SuspenseWrapper skeletonHeight="h-[600px]">
|
|
2249
|
+
* <LargeDataTable />
|
|
2250
|
+
* </SuspenseWrapper>
|
|
2251
|
+
*
|
|
2252
|
+
* // With custom fallback
|
|
2253
|
+
* <SuspenseWrapper fallback={<CustomLoader />}>
|
|
2254
|
+
* <AsyncComponent />
|
|
2255
|
+
* </SuspenseWrapper>
|
|
2256
|
+
* ```
|
|
2257
|
+
*/
|
|
2258
|
+
export declare function SuspenseWrapper({ children, fallback, skeletonHeight, className, }: SuspenseWrapperProps): JSX.Element;
|
|
2259
|
+
|
|
2260
|
+
declare interface SuspenseWrapperProps {
|
|
2261
|
+
children: ReactNode;
|
|
2262
|
+
/** Custom fallback component */
|
|
2263
|
+
fallback?: ReactNode;
|
|
2264
|
+
/** Height of the skeleton fallback */
|
|
2265
|
+
skeletonHeight?: string;
|
|
2266
|
+
/** Additional className for the fallback container */
|
|
2267
|
+
className?: string;
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
export declare function Switch({ className, size, ...props }: React_2.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
2271
|
+
size?: "sm" | "default";
|
|
2272
|
+
}): JSX.Element;
|
|
2273
|
+
|
|
2274
|
+
export declare function SwitchField<TFieldValues extends FieldValues>({ name, control, label, description, disabled, className, cols, }: SwitchFieldProps<TFieldValues>): JSX.Element;
|
|
2275
|
+
|
|
2276
|
+
declare interface SwitchFieldProps<TFieldValues extends FieldValues> {
|
|
2277
|
+
name: FieldPath<TFieldValues>;
|
|
2278
|
+
control: Control<TFieldValues>;
|
|
2279
|
+
label?: string;
|
|
2280
|
+
description?: string;
|
|
2281
|
+
disabled?: boolean;
|
|
2282
|
+
className?: string;
|
|
2283
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
export declare interface TabConfig {
|
|
2287
|
+
/** Unique identifier for the tab */
|
|
2288
|
+
id: string;
|
|
2289
|
+
/** Display label */
|
|
2290
|
+
label: string;
|
|
2291
|
+
/** Optional icon component */
|
|
2292
|
+
icon?: React.ComponentType<{
|
|
2293
|
+
className?: string;
|
|
2294
|
+
}>;
|
|
2295
|
+
/** Static count to display as badge */
|
|
2296
|
+
count?: number;
|
|
2297
|
+
/** Special badge indicator */
|
|
2298
|
+
badge?: 'new' | 'beta';
|
|
2299
|
+
/** Tab grouping for overflow variant: 'primary' = visible, 'overflow' = in dropdown */
|
|
2300
|
+
group?: 'primary' | 'overflow';
|
|
2301
|
+
/** Description shown in dropdown tooltip */
|
|
2302
|
+
description?: string;
|
|
2303
|
+
/** Per-tab mount strategy override (only used when lazyMount is enabled) */
|
|
2304
|
+
mountStrategy?: MountStrategy;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
export declare function Table({ className, ...props }: React_2.ComponentProps<"table">): JSX.Element;
|
|
2308
|
+
|
|
2309
|
+
export declare function TableBody({ className, ...props }: React_2.ComponentProps<"tbody">): JSX.Element;
|
|
2310
|
+
|
|
2311
|
+
export declare function TableCaption({ className, ...props }: React_2.ComponentProps<"caption">): JSX.Element;
|
|
2312
|
+
|
|
2313
|
+
export declare function TableCell({ className, ...props }: React_2.ComponentProps<"td">): JSX.Element;
|
|
2314
|
+
|
|
2315
|
+
export declare function TableFooter({ className, ...props }: React_2.ComponentProps<"tfoot">): JSX.Element;
|
|
2316
|
+
|
|
2317
|
+
export declare function TableHead({ className, ...props }: React_2.ComponentProps<"th">): JSX.Element;
|
|
2318
|
+
|
|
2319
|
+
export declare function TableHeader({ className, ...props }: React_2.ComponentProps<"thead">): JSX.Element;
|
|
2320
|
+
|
|
2321
|
+
export declare function TableRow({ className, ...props }: React_2.ComponentProps<"tr">): JSX.Element;
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* TabPanel — Lazy mount wrapper for tab content.
|
|
2325
|
+
*
|
|
2326
|
+
* - `shouldMount=false` → renders nothing (tab not yet visited)
|
|
2327
|
+
* - `shouldMount=true` + `isActive=false` → hidden with `display: none`
|
|
2328
|
+
* - `shouldMount=true` + `isActive=true` → visible, with optional animation
|
|
2329
|
+
*/
|
|
2330
|
+
export declare const TabPanel: NamedExoticComponent<TabPanelProps>;
|
|
2331
|
+
|
|
2332
|
+
export declare interface TabPanelProps {
|
|
2333
|
+
/** Unique tab identifier */
|
|
2334
|
+
tabId: string;
|
|
2335
|
+
/** Whether this tab is currently active */
|
|
2336
|
+
isActive: boolean;
|
|
2337
|
+
/** Whether this tab should be mounted in the DOM */
|
|
2338
|
+
shouldMount: boolean;
|
|
2339
|
+
/** Enable enter transition animation */
|
|
2340
|
+
transition?: boolean;
|
|
2341
|
+
/** Slide direction: -1 = from left, 0 = fade only, 1 = from right */
|
|
2342
|
+
direction?: -1 | 0 | 1;
|
|
2343
|
+
/** Tab content */
|
|
2344
|
+
children: React.ReactNode;
|
|
2345
|
+
/** Additional CSS classes */
|
|
2346
|
+
className?: string;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
export declare function Tabs({ className, orientation, ...props }: React_2.ComponentProps<typeof TabsPrimitive.Root>): JSX.Element;
|
|
2350
|
+
|
|
2351
|
+
export declare function TabsContent({ className, ...props }: React_2.ComponentProps<typeof TabsPrimitive.Content>): JSX.Element;
|
|
2352
|
+
|
|
2353
|
+
export declare function TabsList({ className, variant, ...props }: React_2.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): JSX.Element;
|
|
2354
|
+
|
|
2355
|
+
export declare const tabsListVariants: (props?: ({
|
|
2356
|
+
variant?: "line" | "default" | null | undefined;
|
|
2357
|
+
} & ClassProp) | undefined) => string;
|
|
2358
|
+
|
|
2359
|
+
export declare function TabsTrigger({ className, ...props }: React_2.ComponentProps<typeof TabsPrimitive.Trigger>): JSX.Element;
|
|
2360
|
+
|
|
2361
|
+
export declare function Textarea({ className, ...props }: React_2.ComponentProps<"textarea">): JSX.Element;
|
|
2362
|
+
|
|
2363
|
+
export declare function TextareaField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, rows, maxLength, showCount, disabled, className, cols, errorHint, }: TextareaFieldProps<TFieldValues>): JSX.Element;
|
|
2364
|
+
|
|
2365
|
+
declare interface TextareaFieldProps<TFieldValues extends FieldValues> {
|
|
2366
|
+
name: FieldPath<TFieldValues>;
|
|
2367
|
+
control: Control<TFieldValues>;
|
|
2368
|
+
label?: string;
|
|
2369
|
+
description?: string;
|
|
2370
|
+
required?: boolean;
|
|
2371
|
+
placeholder?: string;
|
|
2372
|
+
rows?: number;
|
|
2373
|
+
maxLength?: number;
|
|
2374
|
+
showCount?: boolean;
|
|
2375
|
+
disabled?: boolean;
|
|
2376
|
+
className?: string;
|
|
2377
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
2378
|
+
errorHint?: string;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/**
|
|
2382
|
+
* Standard text cell for table columns.
|
|
2383
|
+
* Handles null/undefined values and provides consistent styling.
|
|
2384
|
+
*/
|
|
2385
|
+
export declare function TextCell({ value, variant, className, truncate, maxWidth, }: TextCellProps): JSX.Element;
|
|
2386
|
+
|
|
2387
|
+
declare interface TextCellProps {
|
|
2388
|
+
value: string | null | undefined;
|
|
2389
|
+
variant?: 'primary' | 'secondary' | 'muted';
|
|
2390
|
+
className?: string;
|
|
2391
|
+
truncate?: boolean;
|
|
2392
|
+
maxWidth?: string;
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
export declare function TextField<TFieldValues extends FieldValues>({ name, control, label, description, required, placeholder, type, disabled, className, cols, icon, errorHint, list, suggestions, }: TextFieldProps<TFieldValues>): JSX.Element;
|
|
2396
|
+
|
|
2397
|
+
declare interface TextFieldProps<TFieldValues extends FieldValues> {
|
|
2398
|
+
name: FieldPath<TFieldValues>;
|
|
2399
|
+
control: Control<TFieldValues>;
|
|
2400
|
+
label?: string;
|
|
2401
|
+
description?: string;
|
|
2402
|
+
required?: boolean;
|
|
2403
|
+
placeholder?: string;
|
|
2404
|
+
type?: 'text' | 'email' | 'password' | 'tel' | 'url' | 'number';
|
|
2405
|
+
disabled?: boolean;
|
|
2406
|
+
className?: string;
|
|
2407
|
+
cols?: 1 | 2 | 3 | 4 | 6 | 12;
|
|
2408
|
+
icon?: React.ReactNode;
|
|
2409
|
+
errorHint?: string;
|
|
2410
|
+
/** Datalist ID for suggestions (use with datalist element) */
|
|
2411
|
+
list?: string;
|
|
2412
|
+
/** Suggestions for datalist (alternative to providing list ID separately) */
|
|
2413
|
+
suggestions?: string[];
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
export declare function Timeline({ items, className, relativeTime, maxItems, emptyMessage, animated, animationDelay, }: TimelineProps): JSX.Element;
|
|
2417
|
+
|
|
2418
|
+
export declare interface TimelineItem {
|
|
2419
|
+
id: string | number;
|
|
2420
|
+
date: string | Date | number;
|
|
2421
|
+
title: string;
|
|
2422
|
+
description?: string;
|
|
2423
|
+
type?: 'default' | 'success' | 'warning' | 'error' | 'info' | 'action';
|
|
2424
|
+
isCurrent?: boolean;
|
|
2425
|
+
icon?: ReactNode;
|
|
2426
|
+
meta?: Record<string, string | number | undefined>;
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
declare interface TimelineProps {
|
|
2430
|
+
items: TimelineItem[];
|
|
2431
|
+
className?: string;
|
|
2432
|
+
/** Show relative time (e.g. "5m ago") instead of absolute dates */
|
|
2433
|
+
relativeTime?: boolean;
|
|
2434
|
+
/** Max number of items to display */
|
|
2435
|
+
maxItems?: number;
|
|
2436
|
+
/** Empty state message */
|
|
2437
|
+
emptyMessage?: string;
|
|
2438
|
+
/** Enable staggered animation */
|
|
2439
|
+
animated?: boolean;
|
|
2440
|
+
/** Animation delay offset in ms */
|
|
2441
|
+
animationDelay?: number;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
/**
|
|
2445
|
+
* Convert Unix timestamp (milliseconds) to date string (YYYY-MM-DD)
|
|
2446
|
+
* @param timestamp - Unix timestamp in milliseconds
|
|
2447
|
+
* @returns Date string in YYYY-MM-DD format
|
|
2448
|
+
*/
|
|
2449
|
+
export declare function timestampToDateString(timestamp: number): string;
|
|
2450
|
+
|
|
2451
|
+
export declare const Toaster: ({ ...props }: ToasterProps) => JSX.Element;
|
|
2452
|
+
|
|
2453
|
+
export declare function Toggle({ className, variant, size, ...props }: React_2.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): JSX.Element;
|
|
2454
|
+
|
|
2455
|
+
export declare function ToggleGroup({ className, variant, size, children, ...props }: React_2.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): JSX.Element;
|
|
2456
|
+
|
|
2457
|
+
export declare function ToggleGroupItem({ className, children, variant, size, ...props }: React_2.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): JSX.Element;
|
|
2458
|
+
|
|
2459
|
+
export declare const toggleVariants: (props?: ({
|
|
2460
|
+
variant?: "default" | "outline" | null | undefined;
|
|
2461
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
2462
|
+
} & ClassProp) | undefined) => string;
|
|
2463
|
+
|
|
2464
|
+
export declare function Tooltip({ ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Root>): JSX.Element;
|
|
2465
|
+
|
|
2466
|
+
export declare function TooltipContent({ className, sideOffset, children, ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Content>): JSX.Element;
|
|
2467
|
+
|
|
2468
|
+
export declare function TooltipProvider({ delayDuration, ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Provider>): JSX.Element;
|
|
2469
|
+
|
|
2470
|
+
export declare function TooltipTrigger({ ...props }: React_2.ComponentProps<typeof TooltipPrimitive.Trigger>): JSX.Element;
|
|
2471
|
+
|
|
2472
|
+
/**
|
|
2473
|
+
* Convert UrlSearchParams to URLSearchParams for navigation
|
|
2474
|
+
*/
|
|
2475
|
+
export declare function toURLSearchParams(params: UrlSearchParams): URLSearchParams;
|
|
2476
|
+
|
|
2477
|
+
export declare interface TreeNode {
|
|
2478
|
+
id: string;
|
|
2479
|
+
key: string;
|
|
2480
|
+
value: unknown;
|
|
2481
|
+
type: JsonValueType;
|
|
2482
|
+
children?: TreeNode[];
|
|
2483
|
+
expanded: boolean;
|
|
2484
|
+
path: string[];
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
declare interface TreeNodeOperation {
|
|
2488
|
+
type: 'update' | 'add' | 'delete' | 'rename';
|
|
2489
|
+
path: string[];
|
|
2490
|
+
key?: string;
|
|
2491
|
+
value?: unknown;
|
|
2492
|
+
newKey?: string;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
export declare const trLabels: LenaUILabels;
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* UnifiedTabs - Single tab component for both list and detail pages
|
|
2499
|
+
*/
|
|
2500
|
+
export declare function UnifiedTabs({ tabs, activeTab, onTabChange, children, variant, getTabCount, className, transition, urlSync, lazyMount, contentCard, }: UnifiedTabsProps): JSX.Element;
|
|
2501
|
+
|
|
2502
|
+
export declare interface UnifiedTabsProps {
|
|
2503
|
+
/** Array of tab configurations */
|
|
2504
|
+
tabs: TabConfig[];
|
|
2505
|
+
/** Currently active tab ID */
|
|
2506
|
+
activeTab: string;
|
|
2507
|
+
/** Callback fired when active tab changes */
|
|
2508
|
+
onTabChange: (tabId: string) => void;
|
|
2509
|
+
/** Tab content - use TabsContent for overflow variant, conditional render for simple */
|
|
2510
|
+
children: React.ReactNode;
|
|
2511
|
+
/** Tab variant: 'simple' for list pages, 'overflow' for detail pages */
|
|
2512
|
+
variant?: 'simple' | 'overflow';
|
|
2513
|
+
/** Dynamic count getter - overrides static count in TabConfig */
|
|
2514
|
+
getTabCount?: (tabId: string) => number | undefined;
|
|
2515
|
+
/** Additional CSS classes for the container */
|
|
2516
|
+
className?: string;
|
|
2517
|
+
/** Tab transition animation: true/'fade' = fade, 'slide' = directional slide */
|
|
2518
|
+
transition?: boolean | 'fade' | 'slide';
|
|
2519
|
+
/** URL sync: true = ?tab=, string = custom param key */
|
|
2520
|
+
urlSync?: boolean | string;
|
|
2521
|
+
/** Lazy mount strategy: true = 'lazy-persist', or specify strategy */
|
|
2522
|
+
lazyMount?: boolean | MountStrategy;
|
|
2523
|
+
/** Wrap tab content in a card container (border + background + rounded) */
|
|
2524
|
+
contentCard?: boolean;
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/**
|
|
2528
|
+
* URL Search params (serialized string format)
|
|
2529
|
+
*/
|
|
2530
|
+
declare interface UrlSearchParams {
|
|
2531
|
+
q?: string;
|
|
2532
|
+
p?: string;
|
|
2533
|
+
ps?: string;
|
|
2534
|
+
s?: string;
|
|
2535
|
+
sd?: string;
|
|
2536
|
+
f?: string;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
export declare interface UrlState {
|
|
2540
|
+
q?: string;
|
|
2541
|
+
p?: number;
|
|
2542
|
+
ps?: number;
|
|
2543
|
+
s?: string;
|
|
2544
|
+
sd?: 'ASC' | 'DESC';
|
|
2545
|
+
f?: FilterState[];
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
export declare function useDataTable<TData>(options: UseDataTableOptions<TData>): UseDataTableReturn<TData>;
|
|
2549
|
+
|
|
2550
|
+
declare interface UseDataTableOptions<TData> extends CreateDataTableStoreOptions {
|
|
2551
|
+
/** Unique ID for multiple tables on same page */
|
|
2552
|
+
storeId?: string;
|
|
2553
|
+
/** Enable URL state synchronization */
|
|
2554
|
+
syncWithUrl?: boolean;
|
|
2555
|
+
/** Filter field configuration */
|
|
2556
|
+
fieldConfig: FieldConfig[];
|
|
2557
|
+
/** Function to get unique row ID */
|
|
2558
|
+
getRowId: (row: TData) => string;
|
|
2559
|
+
/** Current data (for computing selectedRows) */
|
|
2560
|
+
data?: TData[];
|
|
2561
|
+
}
|
|
2562
|
+
|
|
2563
|
+
declare interface UseDataTableReturn<TData> {
|
|
2564
|
+
/** Search request ready for API call (100% backend compatible) */
|
|
2565
|
+
searchRequest: SearchRequest;
|
|
2566
|
+
/** Pagination props to spread to DataTable */
|
|
2567
|
+
paginationProps: {
|
|
2568
|
+
page: number;
|
|
2569
|
+
size: number;
|
|
2570
|
+
onPageChange: (page: number) => void;
|
|
2571
|
+
onPageSizeChange: (size: number) => void;
|
|
2572
|
+
};
|
|
2573
|
+
/** Sorting props to spread to DataTable */
|
|
2574
|
+
sortingProps: DataTableSortingProps;
|
|
2575
|
+
/** Search props to spread to DataTable */
|
|
2576
|
+
searchProps: {
|
|
2577
|
+
searchValue: string;
|
|
2578
|
+
onSearchChange: (value: string) => void;
|
|
2579
|
+
};
|
|
2580
|
+
/** Filter props to spread to DataTable */
|
|
2581
|
+
filterProps: {
|
|
2582
|
+
filters: FilterState[];
|
|
2583
|
+
onFiltersChange: (filters: FilterState[]) => void;
|
|
2584
|
+
};
|
|
2585
|
+
/** Selection props to spread to DataTable */
|
|
2586
|
+
selectionProps: {
|
|
2587
|
+
rowSelection: Record<string, boolean>;
|
|
2588
|
+
onRowSelectionChange: (selection: Record<string, boolean>) => void;
|
|
2589
|
+
};
|
|
2590
|
+
/** Currently selected rows */
|
|
2591
|
+
selectedRows: TData[];
|
|
2592
|
+
/** Number of selected rows */
|
|
2593
|
+
selectedCount: number;
|
|
2594
|
+
/** Whether there are any active filters */
|
|
2595
|
+
hasActiveFilters: boolean;
|
|
2596
|
+
/** Number of active filters */
|
|
2597
|
+
activeFilterCount: number;
|
|
2598
|
+
/** Direct store access for advanced use cases */
|
|
2599
|
+
store: DataTableStoreApi;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
/**
|
|
2603
|
+
* Hook to synchronize DataTable state with URL search params
|
|
2604
|
+
* - Hydrates store from URL on mount
|
|
2605
|
+
* - Updates URL when store state changes (debounced)
|
|
2606
|
+
*/
|
|
2607
|
+
export declare function useDataTableUrl(store: DataTableStoreApi, options?: UseDataTableUrlOptions): void;
|
|
2608
|
+
|
|
2609
|
+
declare interface UseDataTableUrlOptions {
|
|
2610
|
+
enabled?: boolean;
|
|
2611
|
+
debounceMs?: number;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
export declare function useJsonTree({ value, onChange }: UseJsonTreeOptions): UseJsonTreeReturn;
|
|
2615
|
+
|
|
2616
|
+
declare interface UseJsonTreeOptions {
|
|
2617
|
+
value: unknown;
|
|
2618
|
+
onChange: (value: unknown) => void;
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
declare interface UseJsonTreeReturn {
|
|
2622
|
+
tree: TreeNode | null;
|
|
2623
|
+
toggleExpand: (path: string[]) => void;
|
|
2624
|
+
updateValue: (path: string[], value: unknown) => void;
|
|
2625
|
+
addChild: (parentPath: string[], key: string, value: unknown) => void;
|
|
2626
|
+
deleteChild: (parentPath: string[], key: string) => void;
|
|
2627
|
+
renameKey: (parentPath: string[], oldKey: string, newKey: string) => void;
|
|
2628
|
+
applyOp: (operation: TreeNodeOperation) => void;
|
|
2629
|
+
expandAll: () => void;
|
|
2630
|
+
collapseAll: () => void;
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
export declare function useJsonValidation({ value, schema }: UseJsonValidationOptions): ValidationResult;
|
|
2634
|
+
|
|
2635
|
+
declare interface UseJsonValidationOptions {
|
|
2636
|
+
value: string;
|
|
2637
|
+
schema?: z.ZodType<unknown>;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
/**
|
|
2641
|
+
* useLazyTabs — Controls tab mount/unmount behavior with three strategies:
|
|
2642
|
+
*
|
|
2643
|
+
* - `eager`: Always mounted (current default behavior)
|
|
2644
|
+
* - `lazy-persist`: Mount on first visit, keep mounted (display: none when inactive)
|
|
2645
|
+
* - `lazy-remount`: Mount only when active, unmount on leave
|
|
2646
|
+
*/
|
|
2647
|
+
export declare function useLazyTabs({ activeTab, defaultStrategy, strategyOverrides, }: UseLazyTabsOptions): UseLazyTabsReturn;
|
|
2648
|
+
|
|
2649
|
+
export declare interface UseLazyTabsOptions {
|
|
2650
|
+
/** All tab IDs in order */
|
|
2651
|
+
tabIds: string[];
|
|
2652
|
+
/** Currently active tab ID */
|
|
2653
|
+
activeTab: string;
|
|
2654
|
+
/** Default strategy for all tabs (default: 'lazy-persist') */
|
|
2655
|
+
defaultStrategy?: MountStrategy;
|
|
2656
|
+
/** Per-tab strategy overrides */
|
|
2657
|
+
strategyOverrides?: Record<string, MountStrategy>;
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
export declare interface UseLazyTabsReturn {
|
|
2661
|
+
/** Whether a tab should be mounted in the DOM */
|
|
2662
|
+
shouldMount: (tabId: string) => boolean;
|
|
2663
|
+
/** Whether a tab is currently active */
|
|
2664
|
+
isActive: (tabId: string) => boolean;
|
|
2665
|
+
/** Set of tab IDs that have been visited at least once */
|
|
2666
|
+
visitedTabs: ReadonlySet<string>;
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
/**
|
|
2670
|
+
* Hook to get merged labels for a specific namespace.
|
|
2671
|
+
* Merge order: base locale < context overrides < component overrides
|
|
2672
|
+
*
|
|
2673
|
+
* @example
|
|
2674
|
+
* ```tsx
|
|
2675
|
+
* const t = useLenaLabels('dataTable');
|
|
2676
|
+
* return <span>{t.searchPlaceholder}</span>;
|
|
2677
|
+
*
|
|
2678
|
+
* // With component-level overrides
|
|
2679
|
+
* const t = useLenaLabels('dataTable', { searchPlaceholder: 'Find...' });
|
|
2680
|
+
* ```
|
|
2681
|
+
*/
|
|
2682
|
+
export declare function useLenaLabels<K extends keyof LenaUILabels>(namespace: K, overrides?: Partial<LenaUILabels[K]>): LenaUILabels[K];
|
|
2683
|
+
|
|
2684
|
+
/**
|
|
2685
|
+
* Hook specifically for numeric ID params (most common case)
|
|
2686
|
+
* Returns validated numeric ID or redirects
|
|
2687
|
+
*
|
|
2688
|
+
* @example
|
|
2689
|
+
* ```tsx
|
|
2690
|
+
* function GatewayDetailPage() {
|
|
2691
|
+
* const id = useNumericIdParam({
|
|
2692
|
+
* from: '/device-management/gateway/$id',
|
|
2693
|
+
* fallbackPath: '/device-management/gateways',
|
|
2694
|
+
* });
|
|
2695
|
+
*
|
|
2696
|
+
* if (id === null) return <Loading />;
|
|
2697
|
+
*
|
|
2698
|
+
* const { data } = useGateway(id);
|
|
2699
|
+
* // ...
|
|
2700
|
+
* }
|
|
2701
|
+
* ```
|
|
2702
|
+
*/
|
|
2703
|
+
export declare function useNumericIdParam(options: {
|
|
2704
|
+
from: string;
|
|
2705
|
+
fallbackPath?: string;
|
|
2706
|
+
}): number | null;
|
|
2707
|
+
|
|
2708
|
+
/**
|
|
2709
|
+
* Generic optimistic list hook using React 19's useOptimistic
|
|
2710
|
+
*
|
|
2711
|
+
* Provides immediate UI feedback for list operations (add/update/delete)
|
|
2712
|
+
* before the actual API call completes.
|
|
2713
|
+
*
|
|
2714
|
+
* @example
|
|
2715
|
+
* ```tsx
|
|
2716
|
+
* function SimCardList() {
|
|
2717
|
+
* const { data: simCards } = useSimCards();
|
|
2718
|
+
* const {
|
|
2719
|
+
* optimisticItems,
|
|
2720
|
+
* addItem,
|
|
2721
|
+
* updateItem,
|
|
2722
|
+
* deleteItem
|
|
2723
|
+
* } = useOptimisticList(simCards ?? []);
|
|
2724
|
+
*
|
|
2725
|
+
* const handleDelete = async (id: number) => {
|
|
2726
|
+
* deleteItem(id); // Immediate UI update
|
|
2727
|
+
* await deleteMutation.mutateAsync(id); // API call
|
|
2728
|
+
* };
|
|
2729
|
+
*
|
|
2730
|
+
* return <DataTable data={optimisticItems} />;
|
|
2731
|
+
* }
|
|
2732
|
+
* ```
|
|
2733
|
+
*/
|
|
2734
|
+
export declare function useOptimisticList<T extends {
|
|
2735
|
+
id: number | string;
|
|
2736
|
+
}>(items: T[], idKey?: keyof T): {
|
|
2737
|
+
/** Items with optimistic updates applied */
|
|
2738
|
+
optimisticItems: T[];
|
|
2739
|
+
/** Raw update function for custom operations */
|
|
2740
|
+
updateOptimistic: (action: OptimisticAction<T>) => void;
|
|
2741
|
+
/** Add a new item optimistically */
|
|
2742
|
+
addItem: (item: T) => void;
|
|
2743
|
+
/** Update an existing item optimistically */
|
|
2744
|
+
updateItem: (item: T) => void;
|
|
2745
|
+
/** Delete an item optimistically */
|
|
2746
|
+
deleteItem: (id: number | string) => void;
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
/**
|
|
2750
|
+
* Hook for optimistic page response updates (paginated data)
|
|
2751
|
+
* Works with LENA HES API's PagedResponse structure
|
|
2752
|
+
*
|
|
2753
|
+
* @example
|
|
2754
|
+
* ```tsx
|
|
2755
|
+
* function SimCardList() {
|
|
2756
|
+
* const { data } = useSimCardsSearch(searchRequest);
|
|
2757
|
+
* const {
|
|
2758
|
+
* optimisticData,
|
|
2759
|
+
* deleteItem
|
|
2760
|
+
* } = useOptimisticPageResponse(data);
|
|
2761
|
+
*
|
|
2762
|
+
* return <DataTable data={optimisticData?.data ?? []} />;
|
|
2763
|
+
* }
|
|
2764
|
+
* ```
|
|
2765
|
+
*/
|
|
2766
|
+
export declare function useOptimisticPageResponse<T extends {
|
|
2767
|
+
id: number | string;
|
|
2768
|
+
}>(pageResponse: {
|
|
2769
|
+
data: T[];
|
|
2770
|
+
pagination: {
|
|
2771
|
+
totalElements: number;
|
|
2772
|
+
[key: string]: unknown;
|
|
2773
|
+
};
|
|
2774
|
+
[key: string]: unknown;
|
|
2775
|
+
} | undefined, idKey?: keyof T): {
|
|
2776
|
+
/** Page response with optimistic updates applied */
|
|
2777
|
+
optimisticData: {
|
|
2778
|
+
[key: string]: unknown;
|
|
2779
|
+
data: T[];
|
|
2780
|
+
pagination: {
|
|
2781
|
+
totalElements: number;
|
|
2782
|
+
[key: string]: unknown;
|
|
2783
|
+
};
|
|
2784
|
+
} | undefined;
|
|
2785
|
+
/** Raw update function for custom operations */
|
|
2786
|
+
updateOptimistic: (action: OptimisticAction<T>) => void;
|
|
2787
|
+
/** Add a new item optimistically */
|
|
2788
|
+
addItem: (item: T) => void;
|
|
2789
|
+
/** Update an existing item optimistically */
|
|
2790
|
+
updateItem: (item: T) => void;
|
|
2791
|
+
/** Delete an item optimistically */
|
|
2792
|
+
deleteItem: (id: number | string) => void;
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2795
|
+
/**
|
|
2796
|
+
* Hook for prefetching list and detail data on hover.
|
|
2797
|
+
* Improves perceived performance by loading data before user navigates.
|
|
2798
|
+
*
|
|
2799
|
+
* @example
|
|
2800
|
+
* ```tsx
|
|
2801
|
+
* const { prefetchDetail, prefetchPage } = usePrefetch({
|
|
2802
|
+
* detailKey: simCardKeys.detail,
|
|
2803
|
+
* listKey: simCardKeys.list,
|
|
2804
|
+
* fetchDetail: getSimCard,
|
|
2805
|
+
* fetchList: searchSimCards,
|
|
2806
|
+
* searchParams: table.searchRequest,
|
|
2807
|
+
* });
|
|
2808
|
+
*
|
|
2809
|
+
* <DataTable
|
|
2810
|
+
* onRowHover={(row) => prefetchDetail(row.id)}
|
|
2811
|
+
* onPrefetchPage={prefetchPage}
|
|
2812
|
+
* />
|
|
2813
|
+
* ```
|
|
2814
|
+
*/
|
|
2815
|
+
export declare function usePrefetch<TData>({ detailKey, listKey, fetchDetail, fetchList, searchParams, staleTime, }: UsePrefetchOptions<TData>): {
|
|
2816
|
+
prefetchDetail: (id: number) => void;
|
|
2817
|
+
prefetchPage: (page: number) => void;
|
|
2818
|
+
clearPrefetchCache: () => void;
|
|
2819
|
+
};
|
|
2820
|
+
|
|
2821
|
+
declare interface UsePrefetchOptions<TData> {
|
|
2822
|
+
/** Query key factory for detail queries */
|
|
2823
|
+
detailKey: (id: number) => QueryKey;
|
|
2824
|
+
/** Query key factory for list queries */
|
|
2825
|
+
listKey: (params: SearchRequest) => QueryKey;
|
|
2826
|
+
/** Function to fetch detail data */
|
|
2827
|
+
fetchDetail?: (id: number) => Promise<TData>;
|
|
2828
|
+
/** Function to fetch list data */
|
|
2829
|
+
fetchList?: (params: SearchRequest) => Promise<unknown>;
|
|
2830
|
+
/** Current search params (for pagination prefetch) */
|
|
2831
|
+
searchParams?: SearchRequest;
|
|
2832
|
+
/** Stale time for prefetched data (default: 30s) */
|
|
2833
|
+
staleTime?: number;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
/**
|
|
2837
|
+
* useTabUrlSync — Synchronizes active tab state with URL search params.
|
|
2838
|
+
*
|
|
2839
|
+
* - On mount: reads tab from URL and calls onTabChange if valid
|
|
2840
|
+
* - On tab change: updates URL param (replaceState by default)
|
|
2841
|
+
* - Default tab cleans the param from URL for cleaner URLs
|
|
2842
|
+
* - Uses window.history directly — no router dependency
|
|
2843
|
+
*/
|
|
2844
|
+
export declare function useTabUrlSync({ validTabIds, defaultTab, activeTab, onTabChange, paramKey, replace, }: UseTabUrlSyncOptions): void;
|
|
2845
|
+
|
|
2846
|
+
export declare interface UseTabUrlSyncOptions {
|
|
2847
|
+
/** Valid tab IDs for URL validation */
|
|
2848
|
+
validTabIds: string[];
|
|
2849
|
+
/** Default tab (URL param removed when this is active) */
|
|
2850
|
+
defaultTab: string;
|
|
2851
|
+
/** Currently active tab */
|
|
2852
|
+
activeTab: string;
|
|
2853
|
+
/** Callback to change the active tab */
|
|
2854
|
+
onTabChange: (tabId: string) => void;
|
|
2855
|
+
/** URL search param key (default: 'tab') */
|
|
2856
|
+
paramKey?: string;
|
|
2857
|
+
/** Use replaceState instead of pushState (default: true) */
|
|
2858
|
+
replace?: boolean;
|
|
2859
|
+
}
|
|
2860
|
+
|
|
2861
|
+
/**
|
|
2862
|
+
* Hook to get validated route params with Zod
|
|
2863
|
+
* Redirects to fallback path if validation fails
|
|
2864
|
+
*
|
|
2865
|
+
* @example
|
|
2866
|
+
* ```tsx
|
|
2867
|
+
* function EntityDetailPage() {
|
|
2868
|
+
* const params = useValidatedParams({
|
|
2869
|
+
* from: '/entity/$id',
|
|
2870
|
+
* schema: z.object({ id: z.coerce.number().positive() }),
|
|
2871
|
+
* fallbackPath: '/entity',
|
|
2872
|
+
* });
|
|
2873
|
+
*
|
|
2874
|
+
* if (!params) return <Loading />; // Redirecting due to invalid params
|
|
2875
|
+
*
|
|
2876
|
+
* const { id } = params; // id is typed as number
|
|
2877
|
+
* // ...
|
|
2878
|
+
* }
|
|
2879
|
+
* ```
|
|
2880
|
+
*/
|
|
2881
|
+
export declare function useValidatedParams<TFrom extends string, TSchema extends z.ZodType>(options: {
|
|
2882
|
+
/** Route path to get params from */
|
|
2883
|
+
from: TFrom;
|
|
2884
|
+
/** Zod schema to validate params */
|
|
2885
|
+
schema: TSchema;
|
|
2886
|
+
/** Path to redirect if validation fails */
|
|
2887
|
+
fallbackPath?: string;
|
|
2888
|
+
/** Custom error handler */
|
|
2889
|
+
onError?: (error: z.ZodError) => void;
|
|
2890
|
+
}): z.infer<TSchema> | null;
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* Simple param validation without redirect
|
|
2894
|
+
* Throws error if validation fails (for use in loaders/guards)
|
|
2895
|
+
*/
|
|
2896
|
+
export declare function validateParams<TSchema extends z.ZodType>(params: unknown, schema: TSchema): z.infer<TSchema>;
|
|
2897
|
+
|
|
2898
|
+
/**
|
|
2899
|
+
* Compact validation badge for toolbar
|
|
2900
|
+
*/
|
|
2901
|
+
export declare function ValidationBadge({ isValid, className, }: {
|
|
2902
|
+
isValid: boolean;
|
|
2903
|
+
className?: string;
|
|
2904
|
+
}): JSX.Element;
|
|
2905
|
+
|
|
2906
|
+
export declare interface ValidationResult {
|
|
2907
|
+
isValid: boolean;
|
|
2908
|
+
parseError: string | null;
|
|
2909
|
+
schemaErrors: z.ZodIssue[];
|
|
2910
|
+
parsed: unknown;
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
export declare function ValidationStatus({ validation, showDetails, }: ValidationStatusProps): JSX.Element | null;
|
|
2914
|
+
|
|
2915
|
+
export declare interface ValidationStatusProps {
|
|
2916
|
+
validation: ValidationResult;
|
|
2917
|
+
showDetails?: boolean;
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
export { }
|
|
2921
|
+
|
|
2922
|
+
|
|
2923
|
+
/**
|
|
2924
|
+
* Extend TanStack Table's ColumnMeta to support custom sort field mapping.
|
|
2925
|
+
* Used when the display field differs from the backend sort field
|
|
2926
|
+
* (e.g., nested entity fields like 'protocol.protocolName').
|
|
2927
|
+
*/
|
|
2928
|
+
declare module '@tanstack/react-table' {
|
|
2929
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
2930
|
+
/** Backend field path for sorting (when different from accessorKey) */
|
|
2931
|
+
sortField?: string;
|
|
2932
|
+
/** Sticky column positioning */
|
|
2933
|
+
sticky?: 'right' | 'left';
|
|
2934
|
+
}
|
|
2935
|
+
}
|