@hotelrank/raw-grids 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/README.md +0 -0
- package/dist/index.cjs +10 -0
- package/dist/index.d.ts +513 -0
- package/dist/index.js +6160 -0
- package/dist/vite.svg +1 -0
- package/package.json +69 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import { ButtonProps } from '@chakra-ui/react';
|
|
2
|
+
import { ComboboxInputProps } from '@chakra-ui/react';
|
|
3
|
+
import { ComboboxRootProps } from '@chakra-ui/react';
|
|
4
|
+
import { ConditionalValue } from '@chakra-ui/react';
|
|
5
|
+
import { default as default_2 } from 'react';
|
|
6
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
7
|
+
import { JSX } from 'react';
|
|
8
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { RefAttributes } from 'react';
|
|
11
|
+
import { Store } from '@tanstack/store';
|
|
12
|
+
|
|
13
|
+
export declare type ActionHeaderProps = {
|
|
14
|
+
backgroundColor?: string;
|
|
15
|
+
children?: default_2.ReactNode;
|
|
16
|
+
showActionColumn?: boolean;
|
|
17
|
+
width?: string;
|
|
18
|
+
showColumnVisibilityMenu?: boolean;
|
|
19
|
+
backgroundColorColumnVisibilityMenu?: string;
|
|
20
|
+
showSNo?: boolean;
|
|
21
|
+
indexChildren?: default_2.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export declare const addPreset: (pageKey: string, item: PresetItem) => void;
|
|
25
|
+
|
|
26
|
+
export declare interface Column {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
minWidth?: number | string;
|
|
30
|
+
align?: 'left' | 'center' | 'right';
|
|
31
|
+
sortable?: boolean;
|
|
32
|
+
backgroundColor?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare interface ConfirmActionDialogProps {
|
|
36
|
+
open: boolean;
|
|
37
|
+
onClose: () => void;
|
|
38
|
+
onConfirm: () => void;
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
confirmLabel?: string;
|
|
42
|
+
cancelLabel?: string;
|
|
43
|
+
icon?: React.ReactNode;
|
|
44
|
+
confirmButtonColorScheme?: string;
|
|
45
|
+
isLoading?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare interface ConfirmDeleteDialogProps {
|
|
49
|
+
open: boolean;
|
|
50
|
+
onClose: () => void;
|
|
51
|
+
onConfirm: () => void;
|
|
52
|
+
title?: string;
|
|
53
|
+
entityName: string;
|
|
54
|
+
confirmText?: string;
|
|
55
|
+
confirmLabel?: string;
|
|
56
|
+
isLoading?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export declare function DataTable<T extends Record<string, unknown>>({ tableId, data: rowData, headers, loading, loadingChildren, skeletonLoading, emptyMessage, actions, page, pageSize, onPageChange, onPageSizeChange, density, totalCount, actionConfig, pageSizeOptions, onRowSelect, onRowSelectEvent, }: DataTableProps<T>): JSX_2.Element;
|
|
60
|
+
|
|
61
|
+
export declare interface DataTableAction<T> {
|
|
62
|
+
icon: JSX.Element;
|
|
63
|
+
label: string;
|
|
64
|
+
onClick: (row: T) => void;
|
|
65
|
+
visible?: (row: T) => boolean;
|
|
66
|
+
colorScheme?: 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare interface DataTableProps<T> {
|
|
70
|
+
tableId: string;
|
|
71
|
+
headers?: Column[];
|
|
72
|
+
data?: T[];
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
emptyMessage?: string;
|
|
75
|
+
actions?: DataTableAction<T>[];
|
|
76
|
+
page?: number;
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
onPageChange?: (page: number) => void | undefined;
|
|
79
|
+
onPageSizeChange?: (size: number) => void | undefined;
|
|
80
|
+
density?: DensityType;
|
|
81
|
+
totalCount?: number;
|
|
82
|
+
actionConfig?: ActionHeaderProps;
|
|
83
|
+
loadingChildren?: JSX.Element;
|
|
84
|
+
skeletonLoading?: boolean;
|
|
85
|
+
pageSizeOptions?: number[];
|
|
86
|
+
onRowSelect?: (row: T, event?: default_2.MouseEvent) => void;
|
|
87
|
+
onRowSelectEvent?: 'left' | 'right';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export declare type DateTimeVariant = 'date' | 'time' | 'dateTime' | 'full' | 'relative' | 'short';
|
|
91
|
+
|
|
92
|
+
export declare const deletePreset: (pageKey: string, id: string) => void;
|
|
93
|
+
|
|
94
|
+
export declare type DensityType = 'sm' | 'md' | 'lg';
|
|
95
|
+
|
|
96
|
+
export declare interface FilterOption<T = unknown> {
|
|
97
|
+
label: ReactNode;
|
|
98
|
+
value: T;
|
|
99
|
+
displayValue?: string | ReactNode;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare const Filters: ({ title, filters, onVisibilityChange, onReorder, onSizeChange, onClear, maxToolbarUnits, pageKey, onLoadPreset, activePresetName, filterDrawerSize, }: IMainFilterType) => JSX_2.Element;
|
|
103
|
+
|
|
104
|
+
export declare function formatDateTime({ value, variant, format, fallback, }: FormatDateTimeProps): string;
|
|
105
|
+
|
|
106
|
+
export declare interface FormatDateTimeProps {
|
|
107
|
+
value: string | Date | number | null | undefined;
|
|
108
|
+
variant?: DateTimeVariant;
|
|
109
|
+
format?: string;
|
|
110
|
+
fallback?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare const getColumnWidthKey: (tableId: string) => string;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* getOption – outside React
|
|
117
|
+
*/
|
|
118
|
+
export declare function getOption<T = any>(client: OptionsClient, key: string): Promise<T | undefined>;
|
|
119
|
+
|
|
120
|
+
export declare const getPresets: (pageKey: string) => PresetItem[];
|
|
121
|
+
|
|
122
|
+
export declare class HttpOptionsApi implements OptionsApi {
|
|
123
|
+
private baseUrl;
|
|
124
|
+
constructor(baseUrl: string);
|
|
125
|
+
fetchLatest(keys: string[]): Promise<OptionValue[]>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare interface IFilterConfig<T = unknown> {
|
|
129
|
+
id: string;
|
|
130
|
+
label: string;
|
|
131
|
+
type?: 'date' | 'text' | 'select' | 'checkbox' | 'radio' | 'number' | 'combobox' | 'date-range';
|
|
132
|
+
value: string | number | undefined | boolean | Date;
|
|
133
|
+
options?: FilterOption<T>[];
|
|
134
|
+
onChange?: (value: any) => void;
|
|
135
|
+
visible: boolean;
|
|
136
|
+
size?: 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5;
|
|
137
|
+
customComponent?: JSX.Element;
|
|
138
|
+
placeholder?: string;
|
|
139
|
+
startDate?: string | null;
|
|
140
|
+
endDate?: string | null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export declare interface IFilterDrawerProps {
|
|
144
|
+
filters: IFilterConfig[];
|
|
145
|
+
onVisibilityChange?: (id: string, visible: boolean) => void;
|
|
146
|
+
onReorder?: (newOrder: IFilterConfig[]) => void;
|
|
147
|
+
onSizeChange?: (id: string, size: number) => void;
|
|
148
|
+
onClear?: () => void;
|
|
149
|
+
maxToolbarUnits?: number;
|
|
150
|
+
filterDrawerSize?: 'md' | 'lg' | 'sm';
|
|
151
|
+
pageKey?: string;
|
|
152
|
+
onLoadPreset?: (filters: IFilterConfig[], presetName?: string) => void;
|
|
153
|
+
activePresetName?: string | null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export declare interface IMainFilterType {
|
|
157
|
+
title?: JSX.Element;
|
|
158
|
+
filters: IFilterConfig[];
|
|
159
|
+
onVisibilityChange?: (id: string, visible: boolean) => void;
|
|
160
|
+
onReorder?: (newOrder: IFilterConfig[]) => void;
|
|
161
|
+
onSizeChange?: (id: string, size: number) => void;
|
|
162
|
+
onClear?: () => void;
|
|
163
|
+
maxToolbarUnits?: number;
|
|
164
|
+
filterDrawerSize?: 'md' | 'lg' | 'sm';
|
|
165
|
+
pageKey?: string;
|
|
166
|
+
currentFilters?: Record<string, unknown>;
|
|
167
|
+
onLoadPreset?: (filters: IFilterConfig[], presetName?: string) => void;
|
|
168
|
+
activePresetName?: string | null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export declare interface IMDSButtonTypes {
|
|
172
|
+
onClick?: () => void;
|
|
173
|
+
size?: 'sm' | 'md' | 'lg' | 'xs';
|
|
174
|
+
variant?: ConditionalValue<'subtle' | 'solid' | 'outline' | 'ghost' | 'plain'>;
|
|
175
|
+
label?: string;
|
|
176
|
+
leftIcon?: React.ReactNode;
|
|
177
|
+
rightIcon?: React.ReactNode;
|
|
178
|
+
isDisabled?: boolean;
|
|
179
|
+
colorScheme?: 'blue' | 'red' | 'green' | 'yellow' | 'gray' | 'cyan' | 'orange' | 'purple' | string;
|
|
180
|
+
loading?: boolean;
|
|
181
|
+
loadingText?: string;
|
|
182
|
+
rounded?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'xs';
|
|
183
|
+
type?: 'submit' | 'reset' | 'button';
|
|
184
|
+
textColor?: string;
|
|
185
|
+
borderColor?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export declare interface IMDSCheckboxTypes {
|
|
189
|
+
value?: boolean;
|
|
190
|
+
onChange?: (value: boolean) => void;
|
|
191
|
+
size?: 'sm' | 'md' | 'lg';
|
|
192
|
+
label?: string;
|
|
193
|
+
helperText?: string;
|
|
194
|
+
isDisabled?: boolean;
|
|
195
|
+
required?: boolean;
|
|
196
|
+
errorText?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export declare interface IMDSComboboxTypes<T> {
|
|
200
|
+
label?: string;
|
|
201
|
+
size?: 'sm' | 'md' | 'lg';
|
|
202
|
+
width?: string | number;
|
|
203
|
+
variant?: 'outline' | 'subtle';
|
|
204
|
+
items?: T[];
|
|
205
|
+
loading?: boolean;
|
|
206
|
+
error?: boolean;
|
|
207
|
+
placeholder?: string;
|
|
208
|
+
helpText?: string;
|
|
209
|
+
errorMessage?: string;
|
|
210
|
+
value?: T | null;
|
|
211
|
+
itemToString: (item: T) => string;
|
|
212
|
+
itemToValue: (item: T) => string;
|
|
213
|
+
renderItem: (item: T) => React.ReactNode;
|
|
214
|
+
onInputChange?: (value: string) => void;
|
|
215
|
+
onSelect?: (item: T) => void;
|
|
216
|
+
rootProps?: Partial<ComboboxRootProps>;
|
|
217
|
+
inputProps?: Partial<ComboboxInputProps>;
|
|
218
|
+
controlProps?: any;
|
|
219
|
+
contentProps?: any;
|
|
220
|
+
itemProps?: any;
|
|
221
|
+
visible?: boolean;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export declare type IMDSDatePickerTypes = {
|
|
225
|
+
value?: Date;
|
|
226
|
+
onChange: (date: Date | null) => void;
|
|
227
|
+
width?: string;
|
|
228
|
+
visible?: boolean;
|
|
229
|
+
label?: string;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export declare type IMDSDateRangePickerTypes = {
|
|
233
|
+
startDate?: Date;
|
|
234
|
+
endDate?: Date;
|
|
235
|
+
onChange: (start: Date | null, end: Date | null) => void;
|
|
236
|
+
width?: string;
|
|
237
|
+
showLabel?: boolean;
|
|
238
|
+
label?: string;
|
|
239
|
+
visible?: boolean;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export declare interface IMDSInputTypes {
|
|
243
|
+
icon?: React.ReactNode;
|
|
244
|
+
value?: string | number;
|
|
245
|
+
onChange?: (value: string) => void;
|
|
246
|
+
placeholder?: string;
|
|
247
|
+
size?: 'sm' | 'md' | 'lg' | 'xs';
|
|
248
|
+
width?: string;
|
|
249
|
+
variant?: ConditionalValue<'subtle' | 'outline' | 'flushed' | undefined>;
|
|
250
|
+
label?: string;
|
|
251
|
+
helperText?: string;
|
|
252
|
+
isDisabled?: boolean;
|
|
253
|
+
required?: boolean;
|
|
254
|
+
errorText?: string;
|
|
255
|
+
visible?: boolean;
|
|
256
|
+
type?: string;
|
|
257
|
+
min?: number;
|
|
258
|
+
max?: number;
|
|
259
|
+
step?: number;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export declare interface IMDSPinInputTypes {
|
|
263
|
+
value: string;
|
|
264
|
+
onChange?: (value: string) => void;
|
|
265
|
+
length?: number;
|
|
266
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
267
|
+
isDisabled?: boolean;
|
|
268
|
+
label?: string;
|
|
269
|
+
helperText?: string;
|
|
270
|
+
errorText?: string;
|
|
271
|
+
required?: boolean;
|
|
272
|
+
visible?: boolean;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export declare interface IMDSSelectBoxTypes<T = unknown> {
|
|
276
|
+
options: FilterOption<T>[];
|
|
277
|
+
value?: string;
|
|
278
|
+
onChange?: (value: T | undefined) => void;
|
|
279
|
+
placeholder?: string;
|
|
280
|
+
size?: 'sm' | 'md' | 'lg' | 'xs';
|
|
281
|
+
width?: string;
|
|
282
|
+
variant?: ConditionalValue<'subtle' | 'outline' | undefined>;
|
|
283
|
+
label?: string;
|
|
284
|
+
helperText?: string;
|
|
285
|
+
isDisabled?: boolean;
|
|
286
|
+
required?: boolean;
|
|
287
|
+
errorText?: string;
|
|
288
|
+
visible?: boolean;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare type Listener = (value: OptionValue | undefined) => void;
|
|
292
|
+
|
|
293
|
+
export declare const loadOrder: (pageKey: string) => string[];
|
|
294
|
+
|
|
295
|
+
export declare const MDSButton: ({ onClick, size, variant, label, leftIcon, rightIcon, isDisabled, colorScheme, loading, loadingText, rounded, type, textColor, borderColor, }: IMDSButtonTypes) => JSX_2.Element;
|
|
296
|
+
|
|
297
|
+
export declare const MDSCheckbox: ({ value, onChange, size, label, helperText, isDisabled, required, errorText, }: IMDSCheckboxTypes) => JSX_2.Element;
|
|
298
|
+
|
|
299
|
+
export declare function MDSCombobox<T>({ label, size, width, variant, items, itemToString, itemToValue, renderItem, value, loading, error, errorMessage, placeholder, helpText, onInputChange, onSelect, visible, rootProps, inputProps, controlProps, contentProps, itemProps, }: IMDSComboboxTypes<T>): JSX_2.Element;
|
|
300
|
+
|
|
301
|
+
export declare function MDSConfirmActionDialog({ open, onClose, onConfirm, title, description, confirmLabel, cancelLabel, icon, isLoading, confirmButtonColorScheme, }: ConfirmActionDialogProps): JSX_2.Element;
|
|
302
|
+
|
|
303
|
+
export declare function MDSConfirmDeleteDialog({ open, onClose, onConfirm, title, entityName, confirmText, confirmLabel, isLoading, }: ConfirmDeleteDialogProps): JSX_2.Element;
|
|
304
|
+
|
|
305
|
+
export declare function MDSDatePicker({ value, onChange, width, visible, label, }: IMDSDatePickerTypes): JSX_2.Element;
|
|
306
|
+
|
|
307
|
+
export declare function MDSDateRangePicker({ startDate, endDate, onChange, width, // Slightly wider for " to "
|
|
308
|
+
showLabel, label, visible, }: IMDSDateRangePickerTypes): JSX_2.Element;
|
|
309
|
+
|
|
310
|
+
export declare const MDSDialogAction: default_2.ForwardRefExoticComponent<ButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
311
|
+
|
|
312
|
+
export declare const MDSDialogActions: default_2.FC<SlotProps>;
|
|
313
|
+
|
|
314
|
+
export declare const MDSDialogBody: default_2.FC<SlotProps>;
|
|
315
|
+
|
|
316
|
+
export declare const MDSDialogWrapper: ({ open, onClose, title, children, width, position, refetch, loading, }: MDSDialogWrapperProps) => JSX_2.Element;
|
|
317
|
+
|
|
318
|
+
export declare interface MDSDialogWrapperProps {
|
|
319
|
+
open: boolean;
|
|
320
|
+
onClose: () => void;
|
|
321
|
+
title: string;
|
|
322
|
+
children: ReactNode;
|
|
323
|
+
width?: string;
|
|
324
|
+
position?: string;
|
|
325
|
+
refetch?: () => Promise<any>;
|
|
326
|
+
loading?: boolean;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export declare const MDSInput: ({ icon, value, onChange, placeholder, size, variant, width, label, helperText, isDisabled, required, errorText, visible, type, min, max, step, }: IMDSInputTypes) => JSX_2.Element;
|
|
330
|
+
|
|
331
|
+
export declare const MDSPinInput: ({ value, onChange, length, size, isDisabled, label, helperText, errorText, required, visible, }: IMDSPinInputTypes) => JSX_2.Element;
|
|
332
|
+
|
|
333
|
+
export declare const MDSSelectBox: ({ options, label, value, onChange, placeholder, size, width, variant, helperText, isDisabled, required, errorText, visible, }: IMDSSelectBoxTypes) => JSX_2.Element;
|
|
334
|
+
|
|
335
|
+
export declare interface OptionsApi {
|
|
336
|
+
fetchLatest(keys: string[]): Promise<OptionValue[]>;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export declare interface OptionsClient {
|
|
340
|
+
getKey<T = any>(key: string): Promise<T | undefined>;
|
|
341
|
+
getMultiKey<T = any>(keys: string[]): Promise<Record<string, T>>;
|
|
342
|
+
getRaw(key: string): OptionValue | undefined;
|
|
343
|
+
subscribe(key: string, cb: (value: OptionValue | undefined) => void): () => void;
|
|
344
|
+
hydrate(data: OptionValue[]): void;
|
|
345
|
+
clear(): void;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export declare class OptionsClientImpl implements OptionsClient {
|
|
349
|
+
private api;
|
|
350
|
+
private store;
|
|
351
|
+
private inflight;
|
|
352
|
+
constructor(api: OptionsApi);
|
|
353
|
+
getRaw(key: string): OptionValue | undefined;
|
|
354
|
+
getKey<T = any>(key: string): Promise<T | undefined>;
|
|
355
|
+
getMultiKey<T = any>(keys: string[]): Promise<Record<string, T>>;
|
|
356
|
+
subscribe(key: string, cb: Listener): () => void;
|
|
357
|
+
hydrate(data: OptionValue[]): void;
|
|
358
|
+
clear(): void;
|
|
359
|
+
private fetchMissing;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export declare function OptionsProvider({ client: { apiUrl }, children, }: {
|
|
363
|
+
client: {
|
|
364
|
+
apiUrl: string;
|
|
365
|
+
};
|
|
366
|
+
children: ReactNode;
|
|
367
|
+
}): JSX_2.Element;
|
|
368
|
+
|
|
369
|
+
export declare class OptionsStore {
|
|
370
|
+
private state;
|
|
371
|
+
private listeners;
|
|
372
|
+
get(key: string): OptionValue | undefined;
|
|
373
|
+
set(option: OptionValue): void;
|
|
374
|
+
setMany(options: OptionValue[]): void;
|
|
375
|
+
subscribe(key: string, listener: Listener): () => void;
|
|
376
|
+
private notify;
|
|
377
|
+
clear(): void;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export declare interface OptionValue {
|
|
381
|
+
key: string;
|
|
382
|
+
value: any;
|
|
383
|
+
value_type: ValueType;
|
|
384
|
+
timestamp: string;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* prefetchOptions – warm cache
|
|
389
|
+
*/
|
|
390
|
+
export declare function prefetchOptions(client: OptionsClient, keys: string[]): Promise<void>;
|
|
391
|
+
|
|
392
|
+
export declare interface PresetItem {
|
|
393
|
+
id: string;
|
|
394
|
+
name: string;
|
|
395
|
+
date: string;
|
|
396
|
+
values: Record<string, any>;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare function RefreshButton({ refetch, isLoading, label, }: RefreshButtonProps): JSX_2.Element;
|
|
400
|
+
export { RefreshButton as MDSRefreshButton }
|
|
401
|
+
export { RefreshButton }
|
|
402
|
+
|
|
403
|
+
declare type RefreshButtonProps = {
|
|
404
|
+
refetch: () => Promise<any>;
|
|
405
|
+
isLoading?: boolean;
|
|
406
|
+
label?: string;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export declare const saveOrder: (pageKey: string, filters: string[]) => void;
|
|
410
|
+
|
|
411
|
+
export declare const savePresets: (pageKey: string, items: PresetItem[]) => void;
|
|
412
|
+
|
|
413
|
+
export declare const setActionsConfig: (actionsConfig: ActionHeaderProps) => void;
|
|
414
|
+
|
|
415
|
+
export declare function setColumnWidth(columnId: string, width: number): void;
|
|
416
|
+
|
|
417
|
+
export declare function setData(newData: any[], headers?: Column[]): void;
|
|
418
|
+
|
|
419
|
+
export declare function setTableId(tableId: string): void;
|
|
420
|
+
|
|
421
|
+
declare type SlotProps = {
|
|
422
|
+
children: ReactNode;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
export declare type SortOrder = 'asc' | 'desc';
|
|
426
|
+
|
|
427
|
+
export declare function StackedDateTime({ value, dateVariant, timeVariant, dateFormat, timeFormat, align, dateColor, dateFontSize, dateFontWeight, timeColor, timeFontSize, timeFontWeight, showTime, }: StackedDateTimeProps): JSX_2.Element;
|
|
428
|
+
|
|
429
|
+
declare interface StackedDateTimeProps {
|
|
430
|
+
value: string | Date | number | null | undefined;
|
|
431
|
+
dateVariant?: 'date' | 'short' | 'full';
|
|
432
|
+
timeVariant?: 'time';
|
|
433
|
+
dateFormat?: string;
|
|
434
|
+
timeFormat?: string;
|
|
435
|
+
align?: 'start' | 'center' | 'end';
|
|
436
|
+
dateColor?: string;
|
|
437
|
+
dateFontSize?: string | number;
|
|
438
|
+
dateFontWeight?: string | number;
|
|
439
|
+
timeFontSize?: string | number;
|
|
440
|
+
timeFontWeight?: string | number;
|
|
441
|
+
timeColor?: string;
|
|
442
|
+
showTime?: boolean;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
declare interface TableState {
|
|
446
|
+
tableId: string;
|
|
447
|
+
sortColumn: string | null;
|
|
448
|
+
sortDirection: 'asc' | 'desc';
|
|
449
|
+
visibility: Record<string, boolean>;
|
|
450
|
+
columnWidths: Record<string, number>;
|
|
451
|
+
columnOrder: Column[];
|
|
452
|
+
data: any[];
|
|
453
|
+
sortableColumns: {
|
|
454
|
+
id: string;
|
|
455
|
+
label: string | default_2.ReactNode;
|
|
456
|
+
sortable: boolean;
|
|
457
|
+
backgroundColor?: string;
|
|
458
|
+
}[];
|
|
459
|
+
actionsConfig?: ActionHeaderProps;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export declare const tableStore: Store<TableState, (cb: TableState) => TableState>;
|
|
463
|
+
|
|
464
|
+
export declare function useDebouncedSearch(options?: UseDebouncedSearchOptions): UseDebouncedSearchResult;
|
|
465
|
+
|
|
466
|
+
export declare interface UseDebouncedSearchOptions {
|
|
467
|
+
initialValue?: string;
|
|
468
|
+
delay?: number;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
declare interface UseDebouncedSearchResult {
|
|
472
|
+
search: string;
|
|
473
|
+
debouncedSearch: string;
|
|
474
|
+
onSearchChange: (value: string) => void;
|
|
475
|
+
reset: () => void;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* useOption – reactive single key
|
|
480
|
+
*/
|
|
481
|
+
export declare function useOption<T = any>(key: string): T | undefined;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* useOptions – reactive multiple keys
|
|
485
|
+
*/
|
|
486
|
+
export declare function useOptions<T = any>(keys: string[]): Record<string, T>;
|
|
487
|
+
|
|
488
|
+
export declare function usePagination(options?: UsePaginationOptions): UsePaginationResult;
|
|
489
|
+
|
|
490
|
+
export declare interface UsePaginationOptions {
|
|
491
|
+
initialPage?: number;
|
|
492
|
+
initialLimit?: number;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
declare interface UsePaginationResult {
|
|
496
|
+
page: number;
|
|
497
|
+
limit: number;
|
|
498
|
+
setPage: (page: number) => void;
|
|
499
|
+
setLimit: (limit: number) => void;
|
|
500
|
+
nextPage: () => void;
|
|
501
|
+
prevPage: () => void;
|
|
502
|
+
reset: () => void;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export declare type ValueType = 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Chakra v3 / Ark UI slot components do NOT expose `children` in their typings.
|
|
509
|
+
* This wrapper intentionally loosens typing to make them library-safe.
|
|
510
|
+
*/
|
|
511
|
+
export declare function withChildren(Component: any): ForwardRefExoticComponent<Omit<any, "ref"> & RefAttributes<any>>;
|
|
512
|
+
|
|
513
|
+
export { }
|