@nar-bus/lena-ui-shared 1.3.2 → 1.3.3
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 +2 -54
- package/dist/index.js +3660 -3722
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ import { NamedExoticComponent } from 'react';
|
|
|
26
26
|
import { Panel } from 'react-resizable-panels';
|
|
27
27
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
28
28
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
29
|
-
import { QueryKey } from '@tanstack/react-query';
|
|
30
29
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
31
30
|
import * as React_2 from 'react';
|
|
32
31
|
import { ReactNode } from 'react';
|
|
@@ -668,7 +667,7 @@ export declare function createEmptyFilter(field: string, operator?: FilterState[
|
|
|
668
667
|
|
|
669
668
|
export declare function CRUDTabContent<T extends {
|
|
670
669
|
id: number;
|
|
671
|
-
}>({ isActive, columns, fieldConfig, defaultSortBy, getRowId, allQueryKey,
|
|
670
|
+
}>({ isActive, columns, fieldConfig, defaultSortBy, getRowId, allQueryKey, useSearchHook, deleteItem, isDeleting, detailPath, searchPlaceholder, emptyTitle, emptyDescription, entityType, getEntityName, viewLabel: viewLabelProp, deleteLabel: deleteLabelProp, refreshLabel: refreshLabelProp, createLabel: createLabelProp, CreateSheetComponent, hideToolbar, externalCreateSheetOpen, onExternalCreateSheetOpenChange, }: CRUDTabContentProps<T>): JSX.Element;
|
|
672
671
|
|
|
673
672
|
export declare interface CRUDTabContentProps<T extends {
|
|
674
673
|
id: number;
|
|
@@ -685,14 +684,6 @@ export declare interface CRUDTabContentProps<T extends {
|
|
|
685
684
|
getRowId?: (row: T) => string;
|
|
686
685
|
/** Query key for invalidation */
|
|
687
686
|
allQueryKey: readonly string[];
|
|
688
|
-
/** Detail query key factory */
|
|
689
|
-
detailKey: (id: number) => readonly unknown[];
|
|
690
|
-
/** List query key factory */
|
|
691
|
-
listKey: (params: SearchRequest) => readonly unknown[];
|
|
692
|
-
/** Fetch detail function for prefetch */
|
|
693
|
-
fetchDetail: (id: number) => Promise<T>;
|
|
694
|
-
/** Fetch list function for prefetch */
|
|
695
|
-
fetchList: (params: SearchRequest) => Promise<PagedResponse<T>>;
|
|
696
687
|
/** Search hook factory */
|
|
697
688
|
useSearchHook: (params: SearchRequest, enabled: boolean) => {
|
|
698
689
|
data: PagedResponse<T> | undefined;
|
|
@@ -750,7 +741,7 @@ export declare interface DataRowProps {
|
|
|
750
741
|
size?: 'sm' | 'md';
|
|
751
742
|
}
|
|
752
743
|
|
|
753
|
-
export declare function DataTable<TData>({ columns, getRowId, data, isLoading, error, pagination, onPageChange, onPageSizeChange,
|
|
744
|
+
export declare function DataTable<TData>({ columns, getRowId, data, isLoading, error, pagination, onPageChange, onPageSizeChange, pageSizeOptions, sortBy, sortDirection, onSortChange, searchValue, onSearchChange, searchPlaceholder, searchDebounceMs, fieldConfig, filters, onFiltersChange, enableRowSelection, rowSelection, onRowSelectionChange, bulkActions, rowActions, toolbarStart, toolbarEnd, className, toolbarVariant, emptyIcon, emptyTitle, emptyDescription, onRowClick, rowClassName, meta, headerColor, }: DataTableComponentProps<TData>): JSX.Element;
|
|
754
745
|
|
|
755
746
|
declare interface DataTableActions {
|
|
756
747
|
setGeneralSearch: (value: string) => void;
|
|
@@ -799,7 +790,6 @@ declare interface DataTableComponentProps<TData> {
|
|
|
799
790
|
pagination: PaginationInfo;
|
|
800
791
|
onPageChange: (page: number) => void;
|
|
801
792
|
onPageSizeChange: (size: number) => void;
|
|
802
|
-
onPrefetchPage?: (page: number) => void;
|
|
803
793
|
pageSizeOptions?: number[];
|
|
804
794
|
sortBy: string;
|
|
805
795
|
sortDirection: 'ASC' | 'DESC';
|
|
@@ -825,7 +815,6 @@ declare interface DataTableComponentProps<TData> {
|
|
|
825
815
|
emptyTitle?: string;
|
|
826
816
|
emptyDescription?: string;
|
|
827
817
|
onRowClick?: (row: TData) => void;
|
|
828
|
-
onRowHover?: (row: TData) => void;
|
|
829
818
|
rowClassName?: (row: TData) => string;
|
|
830
819
|
meta?: Record<string, unknown>;
|
|
831
820
|
/** Custom header color (CSS color value). Overrides --table-header variable */
|
|
@@ -3163,47 +3152,6 @@ export declare function useOptimisticPageResponse<T extends {
|
|
|
3163
3152
|
deleteItem: (id: number | string) => void;
|
|
3164
3153
|
};
|
|
3165
3154
|
|
|
3166
|
-
/**
|
|
3167
|
-
* Hook for prefetching list and detail data on hover.
|
|
3168
|
-
* Improves perceived performance by loading data before user navigates.
|
|
3169
|
-
*
|
|
3170
|
-
* @example
|
|
3171
|
-
* ```tsx
|
|
3172
|
-
* const { prefetchDetail, prefetchPage } = usePrefetch({
|
|
3173
|
-
* detailKey: simCardKeys.detail,
|
|
3174
|
-
* listKey: simCardKeys.list,
|
|
3175
|
-
* fetchDetail: getSimCard,
|
|
3176
|
-
* fetchList: searchSimCards,
|
|
3177
|
-
* searchParams: table.searchRequest,
|
|
3178
|
-
* });
|
|
3179
|
-
*
|
|
3180
|
-
* <DataTable
|
|
3181
|
-
* onRowHover={(row) => prefetchDetail(row.id)}
|
|
3182
|
-
* onPrefetchPage={prefetchPage}
|
|
3183
|
-
* />
|
|
3184
|
-
* ```
|
|
3185
|
-
*/
|
|
3186
|
-
export declare function usePrefetch<TData>({ detailKey, listKey, fetchDetail, fetchList, searchParams, staleTime, }: UsePrefetchOptions<TData>): {
|
|
3187
|
-
prefetchDetail: (id: number) => void;
|
|
3188
|
-
prefetchPage: (page: number) => void;
|
|
3189
|
-
clearPrefetchCache: () => void;
|
|
3190
|
-
};
|
|
3191
|
-
|
|
3192
|
-
declare interface UsePrefetchOptions<TData> {
|
|
3193
|
-
/** Query key factory for detail queries */
|
|
3194
|
-
detailKey?: (id: number) => QueryKey;
|
|
3195
|
-
/** Query key factory for list queries */
|
|
3196
|
-
listKey: (params: SearchRequest) => QueryKey;
|
|
3197
|
-
/** Function to fetch detail data */
|
|
3198
|
-
fetchDetail?: (id: number) => Promise<TData>;
|
|
3199
|
-
/** Function to fetch list data */
|
|
3200
|
-
fetchList?: (params: SearchRequest) => Promise<unknown>;
|
|
3201
|
-
/** Current search params (for pagination prefetch) */
|
|
3202
|
-
searchParams?: SearchRequest;
|
|
3203
|
-
/** Stale time for prefetched data (default: 30s) */
|
|
3204
|
-
staleTime?: number;
|
|
3205
|
-
}
|
|
3206
|
-
|
|
3207
3155
|
/**
|
|
3208
3156
|
* useTabUrlSync — Synchronizes active tab state with URL search params.
|
|
3209
3157
|
*
|