@sustaina/shared-ui 1.9.4 → 1.9.5
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 +24 -20
- package/dist/index.d.ts +24 -20
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -214,7 +214,7 @@ type DataTableColumnGrouping = {
|
|
|
214
214
|
};
|
|
215
215
|
type RowClickType = "single" | "double";
|
|
216
216
|
type DataTableRowClickHandler<TData extends RowData$1> = (rowData: TData, info: {
|
|
217
|
-
event:
|
|
217
|
+
event: React__default.MouseEvent<HTMLTableRowElement>;
|
|
218
218
|
row: Row<TData>;
|
|
219
219
|
table: Table$1<TData>;
|
|
220
220
|
clickType: RowClickType;
|
|
@@ -223,7 +223,7 @@ type DataTableRowIdKeyHandler<TData extends RowData$1> = (originalRow: TData, in
|
|
|
223
223
|
type DataTableHeaderCell<TData extends RowData$1> = {
|
|
224
224
|
id: string;
|
|
225
225
|
columnId: string;
|
|
226
|
-
content:
|
|
226
|
+
content: React__default.ReactNode;
|
|
227
227
|
originalCell: Header<TData, unknown>;
|
|
228
228
|
};
|
|
229
229
|
type DataTableRenderHeaderProps<TData extends RowData$1> = {
|
|
@@ -231,11 +231,11 @@ type DataTableRenderHeaderProps<TData extends RowData$1> = {
|
|
|
231
231
|
table: Table$1<TData>;
|
|
232
232
|
cells: DataTableHeaderCell<TData>[];
|
|
233
233
|
};
|
|
234
|
-
type DataTableRenderHeaderHandler<TData extends RowData$1> = (props: DataTableRenderHeaderProps<TData>) =>
|
|
234
|
+
type DataTableRenderHeaderHandler<TData extends RowData$1> = (props: DataTableRenderHeaderProps<TData>) => React__default.ReactNode;
|
|
235
235
|
type DataTableRowCell<TData extends RowData$1> = {
|
|
236
236
|
id: string;
|
|
237
237
|
columnId: string;
|
|
238
|
-
content:
|
|
238
|
+
content: React__default.ReactNode;
|
|
239
239
|
originalCell: Cell<TData, unknown>;
|
|
240
240
|
};
|
|
241
241
|
type DataTableRenderRowProps<TData extends RowData$1> = {
|
|
@@ -243,7 +243,7 @@ type DataTableRenderRowProps<TData extends RowData$1> = {
|
|
|
243
243
|
cells: DataTableRowCell<TData>[];
|
|
244
244
|
table: Table$1<TData>;
|
|
245
245
|
};
|
|
246
|
-
type DataTableRenderRowHandler<TData extends RowData$1> = (props: DataTableRenderRowProps<TData>) =>
|
|
246
|
+
type DataTableRenderRowHandler<TData extends RowData$1> = (props: DataTableRenderRowProps<TData>) => React__default.ReactNode;
|
|
247
247
|
type DataTableChildrenKeyHandler<TData> = (originalRow: TData, index: number) => TData[] | undefined;
|
|
248
248
|
type DatatableColumnResizing = {
|
|
249
249
|
enabled: boolean;
|
|
@@ -253,27 +253,27 @@ type DataTableColumnSeparatorProps = {
|
|
|
253
253
|
headerCell?: ColumnSeparatorProps;
|
|
254
254
|
};
|
|
255
255
|
type DataTableComponentProps<TData> = {
|
|
256
|
-
containerProps?:
|
|
257
|
-
tableProps?:
|
|
258
|
-
tableHeaderProps?:
|
|
259
|
-
tableHeadCellProps?:
|
|
256
|
+
containerProps?: React__default.ComponentProps<typeof TableContainer>;
|
|
257
|
+
tableProps?: React__default.ComponentProps<typeof Table>;
|
|
258
|
+
tableHeaderProps?: React__default.ComponentProps<typeof TableHeader>;
|
|
259
|
+
tableHeadCellProps?: React__default.ComponentProps<typeof TableHead> | ((info: {
|
|
260
260
|
header: Header<TData, unknown>;
|
|
261
261
|
table: Table$1<TData>;
|
|
262
|
-
}) =>
|
|
263
|
-
tableBodyProps?:
|
|
264
|
-
tableDataRowProps?:
|
|
262
|
+
}) => React__default.ComponentProps<typeof TableHead>);
|
|
263
|
+
tableBodyProps?: React__default.ComponentProps<typeof TableBody>;
|
|
264
|
+
tableDataRowProps?: React__default.ComponentProps<typeof TableRow> | ((info: {
|
|
265
265
|
row: Row<TData>;
|
|
266
266
|
table: Table$1<TData>;
|
|
267
|
-
}) =>
|
|
268
|
-
tableDataCellProps?:
|
|
267
|
+
}) => React__default.ComponentProps<typeof TableRow>);
|
|
268
|
+
tableDataCellProps?: React__default.ComponentProps<typeof TableCell> | ((info: {
|
|
269
269
|
row: Row<TData>;
|
|
270
270
|
cell: Cell<TData, unknown>;
|
|
271
271
|
table: Table$1<TData>;
|
|
272
|
-
}) =>
|
|
273
|
-
tableFilterCellProps?:
|
|
272
|
+
}) => React__default.ComponentProps<typeof TableCell>);
|
|
273
|
+
tableFilterCellProps?: React__default.ComponentProps<typeof TableCell> | ((info: {
|
|
274
274
|
column: Column$1<TData>;
|
|
275
275
|
table: Table$1<TData>;
|
|
276
|
-
}) =>
|
|
276
|
+
}) => React__default.ComponentProps<typeof TableCell>);
|
|
277
277
|
columnResizerProps?: Omit<ColumnResizerProps, "header">;
|
|
278
278
|
columnSeparatorProps?: DataTableColumnSeparatorProps;
|
|
279
279
|
};
|
|
@@ -284,6 +284,7 @@ type DataTableStatusContent = {
|
|
|
284
284
|
emptyData?: ContentSlot;
|
|
285
285
|
emptyFilteredData?: ContentSlot;
|
|
286
286
|
};
|
|
287
|
+
type StatusContentKey = keyof DataTableStatusContent;
|
|
287
288
|
type ScrollInfo = {
|
|
288
289
|
scrollTop: number;
|
|
289
290
|
scrollHeight: number;
|
|
@@ -315,15 +316,18 @@ type DataTableProps<TData extends RowData$1> = {
|
|
|
315
316
|
rowExpansion?: DataTableRowExpansion<TData>;
|
|
316
317
|
scrollFetch?: DataTableScrollFetch;
|
|
317
318
|
components?: DataTableComponentProps<TData>;
|
|
319
|
+
activeStatusContent?: (StatusContentKey | null) | ((info: {
|
|
320
|
+
defaultComputedValue: StatusContentKey | null;
|
|
321
|
+
}) => StatusContentKey | null);
|
|
318
322
|
statusContent?: DataTableStatusContent;
|
|
319
|
-
tableRef?:
|
|
323
|
+
tableRef?: React__default.RefObject<Table$1<TData> | null>;
|
|
320
324
|
isInitialLoading?: boolean;
|
|
321
325
|
debug?: boolean;
|
|
322
326
|
rowIdKey?: DataTableRowIdKeyHandler<TData>;
|
|
323
327
|
childrenKey?: DataTableChildrenKeyHandler<TData>;
|
|
324
328
|
onRowClick?: DataTableRowClickHandler<TData>;
|
|
325
329
|
};
|
|
326
|
-
declare const
|
|
330
|
+
declare const _default$1: React__default.MemoExoticComponent<(<TData extends RowData$1>({ tableRef, isInitialLoading, columns, data, filters, sorting, columnOrder, columnVisibility, columnPinning, columnGrouping, columnResizing, rowSelection, rowExpansion, scrollFetch, activeStatusContent, statusContent, rowIdKey, childrenKey, onRowClick, debug, components }: DataTableProps<TData>) => react_jsx_runtime.JSX.Element)>;
|
|
327
331
|
|
|
328
332
|
declare module "@tanstack/react-table" {
|
|
329
333
|
interface ColumnMeta<TData extends RowData> {
|
|
@@ -990,4 +994,4 @@ type UseTruncatedOptions<T> = {
|
|
|
990
994
|
type UseTruncatedResult = boolean;
|
|
991
995
|
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
992
996
|
|
|
993
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, type Column, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertProps, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Input, type InputProps, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SorterProps, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, Textarea, Tooltip$1 as Tooltip, TooltipArrow, TooltipContent$1 as TooltipContent, TooltipProvider$1 as TooltipProvider, TooltipTrigger$1 as TooltipTrigger, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
|
997
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, type Column, _default$1 as DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertProps, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Input, type InputProps, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SorterProps, type StatusContentKey, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, Textarea, Tooltip$1 as Tooltip, TooltipArrow, TooltipContent$1 as TooltipContent, TooltipProvider$1 as TooltipProvider, TooltipTrigger$1 as TooltipTrigger, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
package/dist/index.d.ts
CHANGED
|
@@ -214,7 +214,7 @@ type DataTableColumnGrouping = {
|
|
|
214
214
|
};
|
|
215
215
|
type RowClickType = "single" | "double";
|
|
216
216
|
type DataTableRowClickHandler<TData extends RowData$1> = (rowData: TData, info: {
|
|
217
|
-
event:
|
|
217
|
+
event: React__default.MouseEvent<HTMLTableRowElement>;
|
|
218
218
|
row: Row<TData>;
|
|
219
219
|
table: Table$1<TData>;
|
|
220
220
|
clickType: RowClickType;
|
|
@@ -223,7 +223,7 @@ type DataTableRowIdKeyHandler<TData extends RowData$1> = (originalRow: TData, in
|
|
|
223
223
|
type DataTableHeaderCell<TData extends RowData$1> = {
|
|
224
224
|
id: string;
|
|
225
225
|
columnId: string;
|
|
226
|
-
content:
|
|
226
|
+
content: React__default.ReactNode;
|
|
227
227
|
originalCell: Header<TData, unknown>;
|
|
228
228
|
};
|
|
229
229
|
type DataTableRenderHeaderProps<TData extends RowData$1> = {
|
|
@@ -231,11 +231,11 @@ type DataTableRenderHeaderProps<TData extends RowData$1> = {
|
|
|
231
231
|
table: Table$1<TData>;
|
|
232
232
|
cells: DataTableHeaderCell<TData>[];
|
|
233
233
|
};
|
|
234
|
-
type DataTableRenderHeaderHandler<TData extends RowData$1> = (props: DataTableRenderHeaderProps<TData>) =>
|
|
234
|
+
type DataTableRenderHeaderHandler<TData extends RowData$1> = (props: DataTableRenderHeaderProps<TData>) => React__default.ReactNode;
|
|
235
235
|
type DataTableRowCell<TData extends RowData$1> = {
|
|
236
236
|
id: string;
|
|
237
237
|
columnId: string;
|
|
238
|
-
content:
|
|
238
|
+
content: React__default.ReactNode;
|
|
239
239
|
originalCell: Cell<TData, unknown>;
|
|
240
240
|
};
|
|
241
241
|
type DataTableRenderRowProps<TData extends RowData$1> = {
|
|
@@ -243,7 +243,7 @@ type DataTableRenderRowProps<TData extends RowData$1> = {
|
|
|
243
243
|
cells: DataTableRowCell<TData>[];
|
|
244
244
|
table: Table$1<TData>;
|
|
245
245
|
};
|
|
246
|
-
type DataTableRenderRowHandler<TData extends RowData$1> = (props: DataTableRenderRowProps<TData>) =>
|
|
246
|
+
type DataTableRenderRowHandler<TData extends RowData$1> = (props: DataTableRenderRowProps<TData>) => React__default.ReactNode;
|
|
247
247
|
type DataTableChildrenKeyHandler<TData> = (originalRow: TData, index: number) => TData[] | undefined;
|
|
248
248
|
type DatatableColumnResizing = {
|
|
249
249
|
enabled: boolean;
|
|
@@ -253,27 +253,27 @@ type DataTableColumnSeparatorProps = {
|
|
|
253
253
|
headerCell?: ColumnSeparatorProps;
|
|
254
254
|
};
|
|
255
255
|
type DataTableComponentProps<TData> = {
|
|
256
|
-
containerProps?:
|
|
257
|
-
tableProps?:
|
|
258
|
-
tableHeaderProps?:
|
|
259
|
-
tableHeadCellProps?:
|
|
256
|
+
containerProps?: React__default.ComponentProps<typeof TableContainer>;
|
|
257
|
+
tableProps?: React__default.ComponentProps<typeof Table>;
|
|
258
|
+
tableHeaderProps?: React__default.ComponentProps<typeof TableHeader>;
|
|
259
|
+
tableHeadCellProps?: React__default.ComponentProps<typeof TableHead> | ((info: {
|
|
260
260
|
header: Header<TData, unknown>;
|
|
261
261
|
table: Table$1<TData>;
|
|
262
|
-
}) =>
|
|
263
|
-
tableBodyProps?:
|
|
264
|
-
tableDataRowProps?:
|
|
262
|
+
}) => React__default.ComponentProps<typeof TableHead>);
|
|
263
|
+
tableBodyProps?: React__default.ComponentProps<typeof TableBody>;
|
|
264
|
+
tableDataRowProps?: React__default.ComponentProps<typeof TableRow> | ((info: {
|
|
265
265
|
row: Row<TData>;
|
|
266
266
|
table: Table$1<TData>;
|
|
267
|
-
}) =>
|
|
268
|
-
tableDataCellProps?:
|
|
267
|
+
}) => React__default.ComponentProps<typeof TableRow>);
|
|
268
|
+
tableDataCellProps?: React__default.ComponentProps<typeof TableCell> | ((info: {
|
|
269
269
|
row: Row<TData>;
|
|
270
270
|
cell: Cell<TData, unknown>;
|
|
271
271
|
table: Table$1<TData>;
|
|
272
|
-
}) =>
|
|
273
|
-
tableFilterCellProps?:
|
|
272
|
+
}) => React__default.ComponentProps<typeof TableCell>);
|
|
273
|
+
tableFilterCellProps?: React__default.ComponentProps<typeof TableCell> | ((info: {
|
|
274
274
|
column: Column$1<TData>;
|
|
275
275
|
table: Table$1<TData>;
|
|
276
|
-
}) =>
|
|
276
|
+
}) => React__default.ComponentProps<typeof TableCell>);
|
|
277
277
|
columnResizerProps?: Omit<ColumnResizerProps, "header">;
|
|
278
278
|
columnSeparatorProps?: DataTableColumnSeparatorProps;
|
|
279
279
|
};
|
|
@@ -284,6 +284,7 @@ type DataTableStatusContent = {
|
|
|
284
284
|
emptyData?: ContentSlot;
|
|
285
285
|
emptyFilteredData?: ContentSlot;
|
|
286
286
|
};
|
|
287
|
+
type StatusContentKey = keyof DataTableStatusContent;
|
|
287
288
|
type ScrollInfo = {
|
|
288
289
|
scrollTop: number;
|
|
289
290
|
scrollHeight: number;
|
|
@@ -315,15 +316,18 @@ type DataTableProps<TData extends RowData$1> = {
|
|
|
315
316
|
rowExpansion?: DataTableRowExpansion<TData>;
|
|
316
317
|
scrollFetch?: DataTableScrollFetch;
|
|
317
318
|
components?: DataTableComponentProps<TData>;
|
|
319
|
+
activeStatusContent?: (StatusContentKey | null) | ((info: {
|
|
320
|
+
defaultComputedValue: StatusContentKey | null;
|
|
321
|
+
}) => StatusContentKey | null);
|
|
318
322
|
statusContent?: DataTableStatusContent;
|
|
319
|
-
tableRef?:
|
|
323
|
+
tableRef?: React__default.RefObject<Table$1<TData> | null>;
|
|
320
324
|
isInitialLoading?: boolean;
|
|
321
325
|
debug?: boolean;
|
|
322
326
|
rowIdKey?: DataTableRowIdKeyHandler<TData>;
|
|
323
327
|
childrenKey?: DataTableChildrenKeyHandler<TData>;
|
|
324
328
|
onRowClick?: DataTableRowClickHandler<TData>;
|
|
325
329
|
};
|
|
326
|
-
declare const
|
|
330
|
+
declare const _default$1: React__default.MemoExoticComponent<(<TData extends RowData$1>({ tableRef, isInitialLoading, columns, data, filters, sorting, columnOrder, columnVisibility, columnPinning, columnGrouping, columnResizing, rowSelection, rowExpansion, scrollFetch, activeStatusContent, statusContent, rowIdKey, childrenKey, onRowClick, debug, components }: DataTableProps<TData>) => react_jsx_runtime.JSX.Element)>;
|
|
327
331
|
|
|
328
332
|
declare module "@tanstack/react-table" {
|
|
329
333
|
interface ColumnMeta<TData extends RowData> {
|
|
@@ -990,4 +994,4 @@ type UseTruncatedOptions<T> = {
|
|
|
990
994
|
type UseTruncatedResult = boolean;
|
|
991
995
|
declare const useTruncated: <T extends HTMLElement = any>({ elementRef, onChange, resizeDetectDelay }: UseTruncatedOptions<T>) => UseTruncatedResult;
|
|
992
996
|
|
|
993
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, type Column, DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertProps, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Input, type InputProps, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SorterProps, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, Textarea, Tooltip$1 as Tooltip, TooltipArrow, TooltipContent$1 as TooltipContent, TooltipProvider$1 as TooltipProvider, TooltipTrigger$1 as TooltipTrigger, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
|
997
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch, ArrowIcon, type Breakpoints, Button, Checkbox, type Column, _default$1 as DataTable, type DataTableChildrenKeyHandler, type DataTableColumnFilter, type DataTableColumnFilterProps, type DataTableColumnGrouping, type DataTableColumnOrdering, type DataTableColumnPinning, type DataTableColumnSeparatorProps, type DataTableColumnSorting, type DataTableColumnVisibility, type DataTableComponentProps, type DataTableFilterConfig, type DataTableFilters, type DataTableGlobalFilter, type DataTableHeaderCell, type DataTableProps, type DataTableRenderHeaderHandler, type DataTableRenderHeaderProps, type DataTableRenderRowHandler, type DataTableRenderRowProps, type DataTableRowCell, type DataTableRowClickHandler, type DataTableRowExpansion, type DataTableRowIdKeyHandler, type DataTableRowSelection, type DataTableScrollFetch, type DataTableStatusContent, type DatatableColumnResizing, DatePicker, type DatePickerProps, type DebounceOptions, type DebouncedFunction, Dialog, DialogAlert, type DialogAlertProps, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, type DialogVariant, type FieldSchema, type FieldType, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type GridPayload, GridSettingsModal, type GridSettingsModalProps, HeaderCell, type HeaderCellProps, Input, type InputProps, List, ListContainer, type ListContainerProps, ListHeader, type ListHeaderProps, type ListProps, ListTable, type ListTableProps, LookupSelect, type LookupSelectOption, type LookupSelectProps, MonthPicker, type MonthPickerProps, _default as Navbar, type NavbarProps, NotFoundIcon, type Params, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, type RowClickType, type RowState, type ScrollInfo, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SorterProps, type StatusContentKey, SuiCalendarIcon, SuiCheckIcon, SuiDotsVerticalIcon, SuiEmptyDataIcon, SuiExpandIcon, SuiFilterIcon, SuiSettingIcon, SuiTriangleDownIcon, SuiWarningIcon, Switch, Textarea, Tooltip$1 as Tooltip, TooltipArrow, TooltipContent$1 as TooltipContent, TooltipProvider$1 as TooltipProvider, TooltipTrigger$1 as TooltipTrigger, index as UI, type UseHoverResult, type UseMediaQueryOptions, type UseMediaQueryResult, type UsePreventPageLeaveOptions, type UseScreenSizeResult, type UseTruncatedOptions, type UseTruncatedResult, booleanToSelectValue, buttonVariants, cn, compareAlphanumeric, debounce, inputVariants, isDefined, isEmptyObject, selectValueToBoolean, stripNullishObject, throttle, useFormField, useGridSettingsStore, useHover, useIntersectionObserver, useMediaQuery, usePreventPageLeave, usePreventPageLeaveStore, useScreenSize, useTruncated };
|
package/dist/index.js
CHANGED
|
@@ -3712,7 +3712,7 @@ var StatusContentSlot = ({
|
|
|
3712
3712
|
content
|
|
3713
3713
|
] });
|
|
3714
3714
|
};
|
|
3715
|
-
var StatusContentSlot_default = StatusContentSlot;
|
|
3715
|
+
var StatusContentSlot_default = React6__namespace.default.memo(StatusContentSlot);
|
|
3716
3716
|
var stateOptions = [
|
|
3717
3717
|
"columnFilters",
|
|
3718
3718
|
"globalFilter",
|
|
@@ -3929,6 +3929,7 @@ var DataTable = ({
|
|
|
3929
3929
|
rowSelection,
|
|
3930
3930
|
rowExpansion,
|
|
3931
3931
|
scrollFetch,
|
|
3932
|
+
activeStatusContent,
|
|
3932
3933
|
statusContent,
|
|
3933
3934
|
rowIdKey,
|
|
3934
3935
|
childrenKey,
|
|
@@ -4044,6 +4045,31 @@ var DataTable = ({
|
|
|
4044
4045
|
);
|
|
4045
4046
|
return { isSomeColumnsFilterable: isSomeColumnsFilterable2, filterableColumns: mergedColumns };
|
|
4046
4047
|
}, [centerVisibleLeafColumns, leftVisibleLeftColumns, rightVisibleLeafColumns]);
|
|
4048
|
+
const autoStatusKey = React6.useMemo(() => {
|
|
4049
|
+
if (isInitialLoading) return "initialLoading";
|
|
4050
|
+
if (isTableEmpty) return "emptyData";
|
|
4051
|
+
if (isTableEmptyAfterFiltering) return "emptyFilteredData";
|
|
4052
|
+
if (scrollFetch?.enabled && !isFiltering && !isInitialLoading) {
|
|
4053
|
+
if (scrollFetch.isFetchingMore) return "fetchingMore";
|
|
4054
|
+
if (scrollFetch.hasMore === false && !scrollFetch.isFetchingMore) return "noMoreData";
|
|
4055
|
+
}
|
|
4056
|
+
return null;
|
|
4057
|
+
}, [
|
|
4058
|
+
isInitialLoading,
|
|
4059
|
+
isFiltering,
|
|
4060
|
+
isTableEmpty,
|
|
4061
|
+
isTableEmptyAfterFiltering,
|
|
4062
|
+
scrollFetch?.enabled,
|
|
4063
|
+
scrollFetch?.hasMore,
|
|
4064
|
+
scrollFetch?.isFetchingMore
|
|
4065
|
+
]);
|
|
4066
|
+
const activeStatusContentComputed = React6.useMemo(() => {
|
|
4067
|
+
if (!activeStatusContent) return autoStatusKey;
|
|
4068
|
+
if (typeof activeStatusContent === "function") {
|
|
4069
|
+
return activeStatusContent({ defaultComputedValue: autoStatusKey });
|
|
4070
|
+
}
|
|
4071
|
+
return activeStatusContent;
|
|
4072
|
+
}, [activeStatusContent, autoStatusKey]);
|
|
4047
4073
|
const fetchMoreOnScrollReached = React6.useCallback(
|
|
4048
4074
|
(containerRefElement) => {
|
|
4049
4075
|
if (!scrollFetch?.enabled || !containerRefElement || scrollFetch?.isFetchingMore || !scrollFetch?.hasMore || !scrollFetch?.fetchMore) {
|
|
@@ -4092,7 +4118,7 @@ var DataTable = ({
|
|
|
4092
4118
|
),
|
|
4093
4119
|
onScroll: (e) => fetchMoreOnScrollReached(e.currentTarget),
|
|
4094
4120
|
children: [
|
|
4095
|
-
|
|
4121
|
+
activeStatusContentComputed === "initialLoading" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4096
4122
|
StatusContentSlot_default,
|
|
4097
4123
|
{
|
|
4098
4124
|
content: statusContent?.initialLoading?.content ?? "Loading...",
|
|
@@ -4103,7 +4129,7 @@ var DataTable = ({
|
|
|
4103
4129
|
},
|
|
4104
4130
|
defaultIcon: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 48 })
|
|
4105
4131
|
}
|
|
4106
|
-
) :
|
|
4132
|
+
) : activeStatusContentComputed === "emptyData" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4107
4133
|
StatusContentSlot_default,
|
|
4108
4134
|
{
|
|
4109
4135
|
content: statusContent?.emptyData?.content ?? "There's nothing here yet.",
|
|
@@ -4252,7 +4278,7 @@ var DataTable = ({
|
|
|
4252
4278
|
);
|
|
4253
4279
|
}) })
|
|
4254
4280
|
] }),
|
|
4255
|
-
|
|
4281
|
+
activeStatusContentComputed === "emptyFilteredData" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4256
4282
|
StatusContentSlot_default,
|
|
4257
4283
|
{
|
|
4258
4284
|
content: statusContent?.emptyFilteredData?.content ?? "No records found. Please try a different search.",
|
|
@@ -4264,7 +4290,7 @@ var DataTable = ({
|
|
|
4264
4290
|
defaultIcon: /* @__PURE__ */ jsxRuntime.jsx(empty_data_default, { className: "text-[128px]" })
|
|
4265
4291
|
}
|
|
4266
4292
|
),
|
|
4267
|
-
|
|
4293
|
+
activeStatusContentComputed === "fetchingMore" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4268
4294
|
StatusContentSlot_default,
|
|
4269
4295
|
{
|
|
4270
4296
|
content: statusContent?.fetchingMore?.content ?? "Loading more...",
|
|
@@ -4274,7 +4300,7 @@ var DataTable = ({
|
|
|
4274
4300
|
}
|
|
4275
4301
|
}
|
|
4276
4302
|
),
|
|
4277
|
-
|
|
4303
|
+
activeStatusContentComputed === "noMoreData" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4278
4304
|
StatusContentSlot_default,
|
|
4279
4305
|
{
|
|
4280
4306
|
content: statusContent?.noMoreData?.content,
|
|
@@ -4291,7 +4317,7 @@ var DataTable = ({
|
|
|
4291
4317
|
}
|
|
4292
4318
|
);
|
|
4293
4319
|
};
|
|
4294
|
-
var DataTable_default = DataTable;
|
|
4320
|
+
var DataTable_default = React6__namespace.default.memo(DataTable);
|
|
4295
4321
|
function Dialog(props) {
|
|
4296
4322
|
return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
|
|
4297
4323
|
}
|