warqadui 0.0.11 → 0.0.13
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.mts +170 -29
- package/dist/index.d.ts +170 -29
- package/dist/index.js +1330 -532
- package/dist/index.mjs +1311 -518
- package/dist/styles.js +1 -1
- package/dist/styles.mjs +1 -1
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import * as react_hook_form from 'react-hook-form';
|
|
5
5
|
import { FieldValues, Path, UseFormReturn } from 'react-hook-form';
|
|
6
6
|
import { ColumnDef, SortingState, ColumnFiltersState, RowData } from '@tanstack/react-table';
|
|
7
|
+
import * as react_to_print from 'react-to-print';
|
|
7
8
|
|
|
8
9
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
10
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "warning";
|
|
@@ -13,6 +14,55 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
13
14
|
}
|
|
14
15
|
declare const Button: React__default.FC<ButtonProps>;
|
|
15
16
|
|
|
17
|
+
interface InfoItem {
|
|
18
|
+
label: string;
|
|
19
|
+
value: React__default.ReactNode;
|
|
20
|
+
/** Use monospace font for the value (useful for account numbers, IDs, etc.) */
|
|
21
|
+
mono?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface InfoGridProps {
|
|
24
|
+
items: InfoItem[];
|
|
25
|
+
/** Grid columns count, defaults to 3 */
|
|
26
|
+
cols?: number;
|
|
27
|
+
/** Optional container class */
|
|
28
|
+
className?: string;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* InfoGrid Component
|
|
33
|
+
*
|
|
34
|
+
* A clean, rounded grid container for displaying key information items
|
|
35
|
+
* with labels and values.
|
|
36
|
+
*/
|
|
37
|
+
declare const InfoGrid: React__default.FC<InfoGridProps>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Props for the PageA4 component
|
|
41
|
+
*/
|
|
42
|
+
interface PageA4Props {
|
|
43
|
+
/** The content to render inside the A4 page */
|
|
44
|
+
children: React__default.ReactNode;
|
|
45
|
+
/** Optional container class for the outer document viewer wrapper */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Optional class for the paper itself */
|
|
48
|
+
pageClassName?: string;
|
|
49
|
+
/** Optional page number for the footer */
|
|
50
|
+
pageNumber?: number;
|
|
51
|
+
/** Optional total pages for the footer */
|
|
52
|
+
totalPages?: number;
|
|
53
|
+
/** Whether this is the final page being printed */
|
|
54
|
+
isLastPage?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* PageA4 Component
|
|
58
|
+
*
|
|
59
|
+
* A reusable React component that renders its children inside a container that always
|
|
60
|
+
* maintains an exact A4 paper width (210mm).
|
|
61
|
+
*
|
|
62
|
+
* It scales down proportionally on smaller screens.
|
|
63
|
+
*/
|
|
64
|
+
declare const PageA4: React__default.FC<PageA4Props>;
|
|
65
|
+
|
|
16
66
|
interface NavItem {
|
|
17
67
|
label: string;
|
|
18
68
|
icon?: React__default.ReactNode;
|
|
@@ -149,7 +199,7 @@ interface UseModalReturn {
|
|
|
149
199
|
declare const useModal: (initialState?: boolean) => UseModalReturn;
|
|
150
200
|
|
|
151
201
|
interface DateInputProps<T extends FieldValues> {
|
|
152
|
-
label
|
|
202
|
+
label?: string;
|
|
153
203
|
error?: string;
|
|
154
204
|
containerClassName?: string;
|
|
155
205
|
name?: Path<T>;
|
|
@@ -227,7 +277,7 @@ interface PhoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
|
|
|
227
277
|
declare const PhoneInput: React$1.ForwardRefExoticComponent<PhoneInputProps & React$1.RefAttributes<any>>;
|
|
228
278
|
|
|
229
279
|
interface InputProps<T extends FieldValues> extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "name" | "form"> {
|
|
230
|
-
label
|
|
280
|
+
label?: string;
|
|
231
281
|
icon?: React.ReactNode;
|
|
232
282
|
error?: string;
|
|
233
283
|
containerClassName?: string;
|
|
@@ -255,10 +305,12 @@ declare const Fields: {
|
|
|
255
305
|
}) => React.ReactElement;
|
|
256
306
|
};
|
|
257
307
|
|
|
308
|
+
type DataTableColumn<TData = any, TValue = any> = ColumnDef<TData, TValue> & {
|
|
309
|
+
key?: string;
|
|
310
|
+
hide?: boolean;
|
|
311
|
+
};
|
|
258
312
|
interface DataTableProps<TData, TValue> {
|
|
259
|
-
columns:
|
|
260
|
-
key?: string;
|
|
261
|
-
})[];
|
|
313
|
+
columns: DataTableColumn<TData, TValue>[];
|
|
262
314
|
data: TData[];
|
|
263
315
|
isLoading?: boolean;
|
|
264
316
|
pageRows?: number;
|
|
@@ -285,9 +337,11 @@ interface DataTableProps<TData, TValue> {
|
|
|
285
337
|
selectedRows: TData[];
|
|
286
338
|
filteredData: TData[];
|
|
287
339
|
}) => void;
|
|
340
|
+
selectable?: boolean;
|
|
341
|
+
filterables?: boolean;
|
|
288
342
|
}
|
|
289
343
|
declare function DataTable<TData, TValue>({ columns: userColumns, data, isLoading, pageRows, searchPlaceholder, className, verticalLines, rowPadding, index, renderSubComponent, hasSubComponent, // default to true
|
|
290
|
-
defaultExpanded, onChange, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
344
|
+
defaultExpanded, onChange, selectable, filterables, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
291
345
|
|
|
292
346
|
declare module "@tanstack/react-table" {
|
|
293
347
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
@@ -325,17 +379,31 @@ interface PostTableProps<TData> {
|
|
|
325
379
|
declare function PostTable<TData extends Record<string, any>>({ columns: userColumns, data: controlledData, onChange, isLoading, className, verticalLines, rowPadding, index, renderAddButton, renderSubComponent, hasSubComponent, // default to true if renderSubComponent is provided
|
|
326
380
|
defaultExpanded, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
327
381
|
|
|
382
|
+
type SimpleTableColumn<TData> = ColumnDef<TData, any> & {
|
|
383
|
+
key?: string;
|
|
384
|
+
render?: (row: TData) => React__default.ReactNode;
|
|
385
|
+
renderFooter?: (data: TData[]) => React__default.ReactNode;
|
|
386
|
+
className?: string;
|
|
387
|
+
width?: number | string;
|
|
388
|
+
minWidth?: number | string;
|
|
389
|
+
maxWidth?: number | string;
|
|
390
|
+
flex?: number;
|
|
391
|
+
hide?: boolean;
|
|
392
|
+
};
|
|
328
393
|
interface SimpleTableProps<TData> {
|
|
329
|
-
columns:
|
|
330
|
-
key?: string;
|
|
331
|
-
})[];
|
|
394
|
+
columns: SimpleTableColumn<TData>[];
|
|
332
395
|
data: TData[];
|
|
333
396
|
className?: string;
|
|
334
397
|
renderFooter?: () => React__default.ReactNode;
|
|
335
398
|
rowPadding?: string;
|
|
336
399
|
verticalLines?: boolean;
|
|
400
|
+
index?: boolean;
|
|
401
|
+
startIndex?: number;
|
|
402
|
+
isLoading?: boolean;
|
|
403
|
+
title?: string;
|
|
404
|
+
enableSearch?: boolean;
|
|
337
405
|
}
|
|
338
|
-
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter, rowPadding, verticalLines, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
406
|
+
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
339
407
|
|
|
340
408
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
341
409
|
variant?: "primary" | "danger" | "warning" | "success";
|
|
@@ -360,27 +428,10 @@ interface BrandingProps {
|
|
|
360
428
|
}
|
|
361
429
|
declare const Branding: React__default.FC<BrandingProps>;
|
|
362
430
|
|
|
363
|
-
interface ThemeConfig {
|
|
364
|
-
primaryColor?: string;
|
|
365
|
-
}
|
|
366
|
-
interface WarqadConfig {
|
|
367
|
-
api?: string;
|
|
368
|
-
theme?: ThemeConfig;
|
|
369
|
-
}
|
|
370
|
-
interface WarqadConfigContextType {
|
|
371
|
-
config: WarqadConfig;
|
|
372
|
-
}
|
|
373
|
-
declare const useWarqadConfig: () => WarqadConfig;
|
|
374
|
-
interface WarqadProviderProps {
|
|
375
|
-
children: ReactNode;
|
|
376
|
-
config?: WarqadConfig;
|
|
377
|
-
}
|
|
378
|
-
declare const WarqadProvider: ({ children, config, }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
|
|
379
|
-
|
|
380
431
|
interface FetchProps {
|
|
381
432
|
url: string;
|
|
382
433
|
body?: Record<string, any>;
|
|
383
|
-
v?: 1 | 2;
|
|
434
|
+
v?: 0 | 1 | 2;
|
|
384
435
|
params?: Record<string, any>;
|
|
385
436
|
delay?: number;
|
|
386
437
|
form?: {
|
|
@@ -423,6 +474,96 @@ declare const useApi: () => {
|
|
|
423
474
|
}>;
|
|
424
475
|
};
|
|
425
476
|
|
|
477
|
+
declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
478
|
+
url?: string;
|
|
479
|
+
v?: 0 | 1 | 2;
|
|
480
|
+
delay?: number;
|
|
481
|
+
params?: Record<string, any>;
|
|
482
|
+
}) => {
|
|
483
|
+
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, headers, }: {
|
|
484
|
+
columns?: SimpleTableColumn<any>[];
|
|
485
|
+
data?: any[];
|
|
486
|
+
error?: string | null;
|
|
487
|
+
info?: any[];
|
|
488
|
+
index?: boolean;
|
|
489
|
+
title?: string;
|
|
490
|
+
subtitle?: string;
|
|
491
|
+
printable?: boolean;
|
|
492
|
+
rowPadding?: string;
|
|
493
|
+
headers?: React.ReactNode;
|
|
494
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
495
|
+
data: any;
|
|
496
|
+
isLoading: boolean;
|
|
497
|
+
get: FetchFunction;
|
|
498
|
+
reactToPrintFn: react_to_print.UseReactToPrintFn;
|
|
499
|
+
};
|
|
500
|
+
type A4DataViewProps = Parameters<ReturnType<typeof useA4StatementView>["A4DataView"]>[0] & Parameters<typeof useA4StatementView>[0];
|
|
501
|
+
declare const A4DataView: (props: A4DataViewProps) => react_jsx_runtime.JSX.Element;
|
|
502
|
+
|
|
503
|
+
declare const useTransaction: ({ url, v, delay, params, }: {
|
|
504
|
+
url: string;
|
|
505
|
+
v?: 0 | 1 | 2;
|
|
506
|
+
delay?: number;
|
|
507
|
+
params?: Record<string, any>;
|
|
508
|
+
}) => {
|
|
509
|
+
TransactionViewComponent: ({ columns, data, error, pageRows, searchPlaceholder, selectable, filterables, verticalLines, index, rowPadding, className, title, description, onCreate, createTitle, ...rest }: {
|
|
510
|
+
columns: DataTableColumn[];
|
|
511
|
+
data: any[];
|
|
512
|
+
error?: any;
|
|
513
|
+
pageRows?: number;
|
|
514
|
+
searchPlaceholder?: string;
|
|
515
|
+
selectable?: boolean;
|
|
516
|
+
filterables?: boolean;
|
|
517
|
+
verticalLines?: boolean;
|
|
518
|
+
index?: boolean;
|
|
519
|
+
rowPadding?: string;
|
|
520
|
+
className?: string;
|
|
521
|
+
title?: string;
|
|
522
|
+
description?: string;
|
|
523
|
+
onCreate?: () => void;
|
|
524
|
+
createTitle?: string;
|
|
525
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
526
|
+
data: any;
|
|
527
|
+
isLoading: boolean;
|
|
528
|
+
get: FetchFunction;
|
|
529
|
+
reload: () => void;
|
|
530
|
+
error: string | null;
|
|
531
|
+
date: String | null | undefined;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
interface ThemeConfig {
|
|
535
|
+
primaryColor?: string;
|
|
536
|
+
}
|
|
537
|
+
interface StoreConfig {
|
|
538
|
+
name?: string;
|
|
539
|
+
address?: string;
|
|
540
|
+
phone?: string;
|
|
541
|
+
email?: string;
|
|
542
|
+
logo?: string;
|
|
543
|
+
}
|
|
544
|
+
interface WarqadConfig {
|
|
545
|
+
api?: string;
|
|
546
|
+
theme?: ThemeConfig;
|
|
547
|
+
store?: StoreConfig;
|
|
548
|
+
}
|
|
549
|
+
interface WarqadConfigContextType {
|
|
550
|
+
config: WarqadConfig;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Hook to access the current Warqad configuration.
|
|
554
|
+
*/
|
|
555
|
+
declare const useWarqadConfig: () => WarqadConfig;
|
|
556
|
+
interface WarqadProviderProps {
|
|
557
|
+
children: ReactNode;
|
|
558
|
+
config?: WarqadConfig;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* WarqadProvider
|
|
562
|
+
*
|
|
563
|
+
* Provides configuration and theme values to the entire application.
|
|
564
|
+
*/
|
|
565
|
+
declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
|
|
566
|
+
|
|
426
567
|
interface PdfOptions {
|
|
427
568
|
orientation?: "portrait" | "landscape";
|
|
428
569
|
unit?: "mm" | "cm" | "in" | "px";
|
|
@@ -441,4 +582,4 @@ interface PdfOptions {
|
|
|
441
582
|
*/
|
|
442
583
|
declare const generatePdf: (elementId: string, options?: PdfOptions) => Promise<void>;
|
|
443
584
|
|
|
444
|
-
export { Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ClassicSpin, CodeBlock, DashboardLayout, DataTable, DateInput, type DateInputProps, Fields, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, PostTable, type PostTableActions, SearchApi, type SearchApiProps, Select, type SelectProps, SimpleTable, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, useApi, useModal, useTheme, useWarqadConfig };
|
|
585
|
+
export { A4DataView, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ClassicSpin, CodeBlock, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, Fields, InfoGrid, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, PostTable, type PostTableActions, SearchApi, type SearchApiProps, Select, type SelectProps, SimpleTable, type SimpleTableColumn, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, useA4StatementView, useApi, useModal, useTheme, useTransaction, useWarqadConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
4
4
|
import * as react_hook_form from 'react-hook-form';
|
|
5
5
|
import { FieldValues, Path, UseFormReturn } from 'react-hook-form';
|
|
6
6
|
import { ColumnDef, SortingState, ColumnFiltersState, RowData } from '@tanstack/react-table';
|
|
7
|
+
import * as react_to_print from 'react-to-print';
|
|
7
8
|
|
|
8
9
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
10
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "warning";
|
|
@@ -13,6 +14,55 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
13
14
|
}
|
|
14
15
|
declare const Button: React__default.FC<ButtonProps>;
|
|
15
16
|
|
|
17
|
+
interface InfoItem {
|
|
18
|
+
label: string;
|
|
19
|
+
value: React__default.ReactNode;
|
|
20
|
+
/** Use monospace font for the value (useful for account numbers, IDs, etc.) */
|
|
21
|
+
mono?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface InfoGridProps {
|
|
24
|
+
items: InfoItem[];
|
|
25
|
+
/** Grid columns count, defaults to 3 */
|
|
26
|
+
cols?: number;
|
|
27
|
+
/** Optional container class */
|
|
28
|
+
className?: string;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* InfoGrid Component
|
|
33
|
+
*
|
|
34
|
+
* A clean, rounded grid container for displaying key information items
|
|
35
|
+
* with labels and values.
|
|
36
|
+
*/
|
|
37
|
+
declare const InfoGrid: React__default.FC<InfoGridProps>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Props for the PageA4 component
|
|
41
|
+
*/
|
|
42
|
+
interface PageA4Props {
|
|
43
|
+
/** The content to render inside the A4 page */
|
|
44
|
+
children: React__default.ReactNode;
|
|
45
|
+
/** Optional container class for the outer document viewer wrapper */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Optional class for the paper itself */
|
|
48
|
+
pageClassName?: string;
|
|
49
|
+
/** Optional page number for the footer */
|
|
50
|
+
pageNumber?: number;
|
|
51
|
+
/** Optional total pages for the footer */
|
|
52
|
+
totalPages?: number;
|
|
53
|
+
/** Whether this is the final page being printed */
|
|
54
|
+
isLastPage?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* PageA4 Component
|
|
58
|
+
*
|
|
59
|
+
* A reusable React component that renders its children inside a container that always
|
|
60
|
+
* maintains an exact A4 paper width (210mm).
|
|
61
|
+
*
|
|
62
|
+
* It scales down proportionally on smaller screens.
|
|
63
|
+
*/
|
|
64
|
+
declare const PageA4: React__default.FC<PageA4Props>;
|
|
65
|
+
|
|
16
66
|
interface NavItem {
|
|
17
67
|
label: string;
|
|
18
68
|
icon?: React__default.ReactNode;
|
|
@@ -149,7 +199,7 @@ interface UseModalReturn {
|
|
|
149
199
|
declare const useModal: (initialState?: boolean) => UseModalReturn;
|
|
150
200
|
|
|
151
201
|
interface DateInputProps<T extends FieldValues> {
|
|
152
|
-
label
|
|
202
|
+
label?: string;
|
|
153
203
|
error?: string;
|
|
154
204
|
containerClassName?: string;
|
|
155
205
|
name?: Path<T>;
|
|
@@ -227,7 +277,7 @@ interface PhoneInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
|
|
|
227
277
|
declare const PhoneInput: React$1.ForwardRefExoticComponent<PhoneInputProps & React$1.RefAttributes<any>>;
|
|
228
278
|
|
|
229
279
|
interface InputProps<T extends FieldValues> extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "name" | "form"> {
|
|
230
|
-
label
|
|
280
|
+
label?: string;
|
|
231
281
|
icon?: React.ReactNode;
|
|
232
282
|
error?: string;
|
|
233
283
|
containerClassName?: string;
|
|
@@ -255,10 +305,12 @@ declare const Fields: {
|
|
|
255
305
|
}) => React.ReactElement;
|
|
256
306
|
};
|
|
257
307
|
|
|
308
|
+
type DataTableColumn<TData = any, TValue = any> = ColumnDef<TData, TValue> & {
|
|
309
|
+
key?: string;
|
|
310
|
+
hide?: boolean;
|
|
311
|
+
};
|
|
258
312
|
interface DataTableProps<TData, TValue> {
|
|
259
|
-
columns:
|
|
260
|
-
key?: string;
|
|
261
|
-
})[];
|
|
313
|
+
columns: DataTableColumn<TData, TValue>[];
|
|
262
314
|
data: TData[];
|
|
263
315
|
isLoading?: boolean;
|
|
264
316
|
pageRows?: number;
|
|
@@ -285,9 +337,11 @@ interface DataTableProps<TData, TValue> {
|
|
|
285
337
|
selectedRows: TData[];
|
|
286
338
|
filteredData: TData[];
|
|
287
339
|
}) => void;
|
|
340
|
+
selectable?: boolean;
|
|
341
|
+
filterables?: boolean;
|
|
288
342
|
}
|
|
289
343
|
declare function DataTable<TData, TValue>({ columns: userColumns, data, isLoading, pageRows, searchPlaceholder, className, verticalLines, rowPadding, index, renderSubComponent, hasSubComponent, // default to true
|
|
290
|
-
defaultExpanded, onChange, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
344
|
+
defaultExpanded, onChange, selectable, filterables, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
291
345
|
|
|
292
346
|
declare module "@tanstack/react-table" {
|
|
293
347
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
@@ -325,17 +379,31 @@ interface PostTableProps<TData> {
|
|
|
325
379
|
declare function PostTable<TData extends Record<string, any>>({ columns: userColumns, data: controlledData, onChange, isLoading, className, verticalLines, rowPadding, index, renderAddButton, renderSubComponent, hasSubComponent, // default to true if renderSubComponent is provided
|
|
326
380
|
defaultExpanded, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
327
381
|
|
|
382
|
+
type SimpleTableColumn<TData> = ColumnDef<TData, any> & {
|
|
383
|
+
key?: string;
|
|
384
|
+
render?: (row: TData) => React__default.ReactNode;
|
|
385
|
+
renderFooter?: (data: TData[]) => React__default.ReactNode;
|
|
386
|
+
className?: string;
|
|
387
|
+
width?: number | string;
|
|
388
|
+
minWidth?: number | string;
|
|
389
|
+
maxWidth?: number | string;
|
|
390
|
+
flex?: number;
|
|
391
|
+
hide?: boolean;
|
|
392
|
+
};
|
|
328
393
|
interface SimpleTableProps<TData> {
|
|
329
|
-
columns:
|
|
330
|
-
key?: string;
|
|
331
|
-
})[];
|
|
394
|
+
columns: SimpleTableColumn<TData>[];
|
|
332
395
|
data: TData[];
|
|
333
396
|
className?: string;
|
|
334
397
|
renderFooter?: () => React__default.ReactNode;
|
|
335
398
|
rowPadding?: string;
|
|
336
399
|
verticalLines?: boolean;
|
|
400
|
+
index?: boolean;
|
|
401
|
+
startIndex?: number;
|
|
402
|
+
isLoading?: boolean;
|
|
403
|
+
title?: string;
|
|
404
|
+
enableSearch?: boolean;
|
|
337
405
|
}
|
|
338
|
-
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter, rowPadding, verticalLines, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
406
|
+
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
339
407
|
|
|
340
408
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
341
409
|
variant?: "primary" | "danger" | "warning" | "success";
|
|
@@ -360,27 +428,10 @@ interface BrandingProps {
|
|
|
360
428
|
}
|
|
361
429
|
declare const Branding: React__default.FC<BrandingProps>;
|
|
362
430
|
|
|
363
|
-
interface ThemeConfig {
|
|
364
|
-
primaryColor?: string;
|
|
365
|
-
}
|
|
366
|
-
interface WarqadConfig {
|
|
367
|
-
api?: string;
|
|
368
|
-
theme?: ThemeConfig;
|
|
369
|
-
}
|
|
370
|
-
interface WarqadConfigContextType {
|
|
371
|
-
config: WarqadConfig;
|
|
372
|
-
}
|
|
373
|
-
declare const useWarqadConfig: () => WarqadConfig;
|
|
374
|
-
interface WarqadProviderProps {
|
|
375
|
-
children: ReactNode;
|
|
376
|
-
config?: WarqadConfig;
|
|
377
|
-
}
|
|
378
|
-
declare const WarqadProvider: ({ children, config, }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
|
|
379
|
-
|
|
380
431
|
interface FetchProps {
|
|
381
432
|
url: string;
|
|
382
433
|
body?: Record<string, any>;
|
|
383
|
-
v?: 1 | 2;
|
|
434
|
+
v?: 0 | 1 | 2;
|
|
384
435
|
params?: Record<string, any>;
|
|
385
436
|
delay?: number;
|
|
386
437
|
form?: {
|
|
@@ -423,6 +474,96 @@ declare const useApi: () => {
|
|
|
423
474
|
}>;
|
|
424
475
|
};
|
|
425
476
|
|
|
477
|
+
declare const useA4StatementView: ({ url, v, delay, params, }?: {
|
|
478
|
+
url?: string;
|
|
479
|
+
v?: 0 | 1 | 2;
|
|
480
|
+
delay?: number;
|
|
481
|
+
params?: Record<string, any>;
|
|
482
|
+
}) => {
|
|
483
|
+
A4DataView: ({ columns, data, error, info, index, title, subtitle, printable, rowPadding, headers, }: {
|
|
484
|
+
columns?: SimpleTableColumn<any>[];
|
|
485
|
+
data?: any[];
|
|
486
|
+
error?: string | null;
|
|
487
|
+
info?: any[];
|
|
488
|
+
index?: boolean;
|
|
489
|
+
title?: string;
|
|
490
|
+
subtitle?: string;
|
|
491
|
+
printable?: boolean;
|
|
492
|
+
rowPadding?: string;
|
|
493
|
+
headers?: React.ReactNode;
|
|
494
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
495
|
+
data: any;
|
|
496
|
+
isLoading: boolean;
|
|
497
|
+
get: FetchFunction;
|
|
498
|
+
reactToPrintFn: react_to_print.UseReactToPrintFn;
|
|
499
|
+
};
|
|
500
|
+
type A4DataViewProps = Parameters<ReturnType<typeof useA4StatementView>["A4DataView"]>[0] & Parameters<typeof useA4StatementView>[0];
|
|
501
|
+
declare const A4DataView: (props: A4DataViewProps) => react_jsx_runtime.JSX.Element;
|
|
502
|
+
|
|
503
|
+
declare const useTransaction: ({ url, v, delay, params, }: {
|
|
504
|
+
url: string;
|
|
505
|
+
v?: 0 | 1 | 2;
|
|
506
|
+
delay?: number;
|
|
507
|
+
params?: Record<string, any>;
|
|
508
|
+
}) => {
|
|
509
|
+
TransactionViewComponent: ({ columns, data, error, pageRows, searchPlaceholder, selectable, filterables, verticalLines, index, rowPadding, className, title, description, onCreate, createTitle, ...rest }: {
|
|
510
|
+
columns: DataTableColumn[];
|
|
511
|
+
data: any[];
|
|
512
|
+
error?: any;
|
|
513
|
+
pageRows?: number;
|
|
514
|
+
searchPlaceholder?: string;
|
|
515
|
+
selectable?: boolean;
|
|
516
|
+
filterables?: boolean;
|
|
517
|
+
verticalLines?: boolean;
|
|
518
|
+
index?: boolean;
|
|
519
|
+
rowPadding?: string;
|
|
520
|
+
className?: string;
|
|
521
|
+
title?: string;
|
|
522
|
+
description?: string;
|
|
523
|
+
onCreate?: () => void;
|
|
524
|
+
createTitle?: string;
|
|
525
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
526
|
+
data: any;
|
|
527
|
+
isLoading: boolean;
|
|
528
|
+
get: FetchFunction;
|
|
529
|
+
reload: () => void;
|
|
530
|
+
error: string | null;
|
|
531
|
+
date: String | null | undefined;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
interface ThemeConfig {
|
|
535
|
+
primaryColor?: string;
|
|
536
|
+
}
|
|
537
|
+
interface StoreConfig {
|
|
538
|
+
name?: string;
|
|
539
|
+
address?: string;
|
|
540
|
+
phone?: string;
|
|
541
|
+
email?: string;
|
|
542
|
+
logo?: string;
|
|
543
|
+
}
|
|
544
|
+
interface WarqadConfig {
|
|
545
|
+
api?: string;
|
|
546
|
+
theme?: ThemeConfig;
|
|
547
|
+
store?: StoreConfig;
|
|
548
|
+
}
|
|
549
|
+
interface WarqadConfigContextType {
|
|
550
|
+
config: WarqadConfig;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Hook to access the current Warqad configuration.
|
|
554
|
+
*/
|
|
555
|
+
declare const useWarqadConfig: () => WarqadConfig;
|
|
556
|
+
interface WarqadProviderProps {
|
|
557
|
+
children: ReactNode;
|
|
558
|
+
config?: WarqadConfig;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* WarqadProvider
|
|
562
|
+
*
|
|
563
|
+
* Provides configuration and theme values to the entire application.
|
|
564
|
+
*/
|
|
565
|
+
declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
|
|
566
|
+
|
|
426
567
|
interface PdfOptions {
|
|
427
568
|
orientation?: "portrait" | "landscape";
|
|
428
569
|
unit?: "mm" | "cm" | "in" | "px";
|
|
@@ -441,4 +582,4 @@ interface PdfOptions {
|
|
|
441
582
|
*/
|
|
442
583
|
declare const generatePdf: (elementId: string, options?: PdfOptions) => Promise<void>;
|
|
443
584
|
|
|
444
|
-
export { Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ClassicSpin, CodeBlock, DashboardLayout, DataTable, DateInput, type DateInputProps, Fields, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, PostTable, type PostTableActions, SearchApi, type SearchApiProps, Select, type SelectProps, SimpleTable, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, useApi, useModal, useTheme, useWarqadConfig };
|
|
585
|
+
export { A4DataView, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ClassicSpin, CodeBlock, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, Fields, InfoGrid, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, PostTable, type PostTableActions, SearchApi, type SearchApiProps, Select, type SelectProps, SimpleTable, type SimpleTableColumn, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, useA4StatementView, useApi, useModal, useTheme, useTransaction, useWarqadConfig };
|