warqadui 0.0.29 → 0.0.31
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 +39 -4
- package/dist/index.d.ts +39 -4
- package/dist/index.js +294 -140
- package/dist/index.mjs +295 -142
- package/dist/styles.js +17 -30
- package/dist/styles.mjs +17 -30
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -229,6 +229,8 @@ interface SearchApiProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
|
|
|
229
229
|
placeholder?: string;
|
|
230
230
|
value?: any;
|
|
231
231
|
onChange?: (value: any) => void;
|
|
232
|
+
onSelect?: (option: any) => void;
|
|
233
|
+
onClear?: () => void;
|
|
232
234
|
queryKey?: string;
|
|
233
235
|
labelKey?: string;
|
|
234
236
|
valueKey?: string;
|
|
@@ -249,6 +251,8 @@ interface SearchApiContextValue {
|
|
|
249
251
|
setSearchTerm: (v: string) => void;
|
|
250
252
|
selectedValue: any;
|
|
251
253
|
setSelectedValue: (v: any) => void;
|
|
254
|
+
onSelect?: (option: any) => void;
|
|
255
|
+
onClear?: () => void;
|
|
252
256
|
activeIndex: number;
|
|
253
257
|
setActiveIndex: (v: number) => void;
|
|
254
258
|
isFocused: boolean;
|
|
@@ -417,9 +421,10 @@ interface DataTableProps<TData, TValue> {
|
|
|
417
421
|
}) => void;
|
|
418
422
|
selectable?: boolean;
|
|
419
423
|
filterables?: boolean;
|
|
424
|
+
emptyState?: React__default.ReactNode;
|
|
420
425
|
}
|
|
421
426
|
declare function DataTable<TData, TValue>({ columns: userColumns, data, isLoading, pageRows, searchPlaceholder, className, verticalLines, rowPadding, index, renderSubComponent, hasSubComponent, // default to true
|
|
422
|
-
defaultExpanded, onChange, selectable, filterables, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
427
|
+
defaultExpanded, onChange, selectable, filterables, emptyState, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
423
428
|
|
|
424
429
|
declare module "@tanstack/react-table" {
|
|
425
430
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
@@ -460,9 +465,10 @@ interface PostTableProps<TData> {
|
|
|
460
465
|
}) => React__default.ReactNode;
|
|
461
466
|
hasSubComponent?: (row: TData) => boolean;
|
|
462
467
|
defaultExpanded?: boolean;
|
|
468
|
+
submitLoading?: boolean;
|
|
463
469
|
}
|
|
464
470
|
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
|
|
465
|
-
defaultExpanded, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
471
|
+
defaultExpanded, submitLoading, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
466
472
|
|
|
467
473
|
type SimpleTableColumn<TData> = ColumnDef<TData, any> & {
|
|
468
474
|
key?: string;
|
|
@@ -487,8 +493,9 @@ interface SimpleTableProps<TData> {
|
|
|
487
493
|
isLoading?: boolean;
|
|
488
494
|
title?: string;
|
|
489
495
|
enableSearch?: boolean;
|
|
496
|
+
emptyState?: React__default.ReactNode;
|
|
490
497
|
}
|
|
491
|
-
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
498
|
+
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, emptyState, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
492
499
|
|
|
493
500
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
494
501
|
variant?: "primary" | "danger" | "warning" | "success";
|
|
@@ -668,4 +675,32 @@ interface PdfOptions {
|
|
|
668
675
|
*/
|
|
669
676
|
declare const generatePdf: (elementId: string, options?: PdfOptions) => Promise<void>;
|
|
670
677
|
|
|
671
|
-
|
|
678
|
+
/**
|
|
679
|
+
* A robust localStorage manager utility with TypeScript support.
|
|
680
|
+
* Suitable for production environments and reusable frontend packages.
|
|
681
|
+
*/
|
|
682
|
+
/**
|
|
683
|
+
* Interface for the storage utility to support method overloads.
|
|
684
|
+
*/
|
|
685
|
+
interface StorageManager {
|
|
686
|
+
/** Saves a value to localStorage using JSON.stringify. */
|
|
687
|
+
set<T>(key: string, value: T): void;
|
|
688
|
+
/** Retrieves a parsed value from localStorage. */
|
|
689
|
+
get<T>(key: string): T | null;
|
|
690
|
+
/** Retrieves all items from localStorage as an object. */
|
|
691
|
+
get(): Record<string, any>;
|
|
692
|
+
/** Removes a specific key from localStorage. */
|
|
693
|
+
remove(key: string): void;
|
|
694
|
+
/** Clears all localStorage. */
|
|
695
|
+
clear(): void;
|
|
696
|
+
/** Returns true if the key exists. */
|
|
697
|
+
has(key: string): boolean;
|
|
698
|
+
/** Returns all localStorage keys. */
|
|
699
|
+
keys(): string[];
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Storage utility to manage browser localStorage with type safety and error handling.
|
|
703
|
+
*/
|
|
704
|
+
declare const storage: StorageManager;
|
|
705
|
+
|
|
706
|
+
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, type DeleteFunction, type FetchFunction, type FetchProps, Fields, InfoGrid, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PutFunction, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, storage, useA4StatementView, useApi, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -229,6 +229,8 @@ interface SearchApiProps extends Omit<React__default.InputHTMLAttributes<HTMLInp
|
|
|
229
229
|
placeholder?: string;
|
|
230
230
|
value?: any;
|
|
231
231
|
onChange?: (value: any) => void;
|
|
232
|
+
onSelect?: (option: any) => void;
|
|
233
|
+
onClear?: () => void;
|
|
232
234
|
queryKey?: string;
|
|
233
235
|
labelKey?: string;
|
|
234
236
|
valueKey?: string;
|
|
@@ -249,6 +251,8 @@ interface SearchApiContextValue {
|
|
|
249
251
|
setSearchTerm: (v: string) => void;
|
|
250
252
|
selectedValue: any;
|
|
251
253
|
setSelectedValue: (v: any) => void;
|
|
254
|
+
onSelect?: (option: any) => void;
|
|
255
|
+
onClear?: () => void;
|
|
252
256
|
activeIndex: number;
|
|
253
257
|
setActiveIndex: (v: number) => void;
|
|
254
258
|
isFocused: boolean;
|
|
@@ -417,9 +421,10 @@ interface DataTableProps<TData, TValue> {
|
|
|
417
421
|
}) => void;
|
|
418
422
|
selectable?: boolean;
|
|
419
423
|
filterables?: boolean;
|
|
424
|
+
emptyState?: React__default.ReactNode;
|
|
420
425
|
}
|
|
421
426
|
declare function DataTable<TData, TValue>({ columns: userColumns, data, isLoading, pageRows, searchPlaceholder, className, verticalLines, rowPadding, index, renderSubComponent, hasSubComponent, // default to true
|
|
422
|
-
defaultExpanded, onChange, selectable, filterables, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
427
|
+
defaultExpanded, onChange, selectable, filterables, emptyState, }: DataTableProps<TData, TValue>): react_jsx_runtime.JSX.Element;
|
|
423
428
|
|
|
424
429
|
declare module "@tanstack/react-table" {
|
|
425
430
|
interface ColumnMeta<TData extends RowData, TValue> {
|
|
@@ -460,9 +465,10 @@ interface PostTableProps<TData> {
|
|
|
460
465
|
}) => React__default.ReactNode;
|
|
461
466
|
hasSubComponent?: (row: TData) => boolean;
|
|
462
467
|
defaultExpanded?: boolean;
|
|
468
|
+
submitLoading?: boolean;
|
|
463
469
|
}
|
|
464
470
|
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
|
|
465
|
-
defaultExpanded, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
471
|
+
defaultExpanded, submitLoading, }: PostTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
466
472
|
|
|
467
473
|
type SimpleTableColumn<TData> = ColumnDef<TData, any> & {
|
|
468
474
|
key?: string;
|
|
@@ -487,8 +493,9 @@ interface SimpleTableProps<TData> {
|
|
|
487
493
|
isLoading?: boolean;
|
|
488
494
|
title?: string;
|
|
489
495
|
enableSearch?: boolean;
|
|
496
|
+
emptyState?: React__default.ReactNode;
|
|
490
497
|
}
|
|
491
|
-
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
498
|
+
declare function SimpleTable<TData>({ columns: userColumns, data, className, renderFooter: componentFooter, rowPadding, verticalLines, index, startIndex, isLoading, title, enableSearch, emptyState, }: SimpleTableProps<TData>): react_jsx_runtime.JSX.Element;
|
|
492
499
|
|
|
493
500
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
494
501
|
variant?: "primary" | "danger" | "warning" | "success";
|
|
@@ -668,4 +675,32 @@ interface PdfOptions {
|
|
|
668
675
|
*/
|
|
669
676
|
declare const generatePdf: (elementId: string, options?: PdfOptions) => Promise<void>;
|
|
670
677
|
|
|
671
|
-
|
|
678
|
+
/**
|
|
679
|
+
* A robust localStorage manager utility with TypeScript support.
|
|
680
|
+
* Suitable for production environments and reusable frontend packages.
|
|
681
|
+
*/
|
|
682
|
+
/**
|
|
683
|
+
* Interface for the storage utility to support method overloads.
|
|
684
|
+
*/
|
|
685
|
+
interface StorageManager {
|
|
686
|
+
/** Saves a value to localStorage using JSON.stringify. */
|
|
687
|
+
set<T>(key: string, value: T): void;
|
|
688
|
+
/** Retrieves a parsed value from localStorage. */
|
|
689
|
+
get<T>(key: string): T | null;
|
|
690
|
+
/** Retrieves all items from localStorage as an object. */
|
|
691
|
+
get(): Record<string, any>;
|
|
692
|
+
/** Removes a specific key from localStorage. */
|
|
693
|
+
remove(key: string): void;
|
|
694
|
+
/** Clears all localStorage. */
|
|
695
|
+
clear(): void;
|
|
696
|
+
/** Returns true if the key exists. */
|
|
697
|
+
has(key: string): boolean;
|
|
698
|
+
/** Returns all localStorage keys. */
|
|
699
|
+
keys(): string[];
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Storage utility to manage browser localStorage with type safety and error handling.
|
|
703
|
+
*/
|
|
704
|
+
declare const storage: StorageManager;
|
|
705
|
+
|
|
706
|
+
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, type DeleteFunction, type FetchFunction, type FetchProps, Fields, InfoGrid, Input, type InputProps, LoadingBox, LoadingSpin, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PutFunction, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, type UseModalReturn, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, generatePdf, storage, useA4StatementView, useApi, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig };
|