@facter/ds-core 1.20.0 → 1.21.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/dist/index.d.mts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +51 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2715,6 +2715,52 @@ declare function useAvailableHeight<T extends HTMLElement = HTMLDivElement>(opti
|
|
|
2715
2715
|
} | undefined;
|
|
2716
2716
|
};
|
|
2717
2717
|
|
|
2718
|
+
interface UseAutoPageSizeOptions {
|
|
2719
|
+
/** Height of each row in pixels (default: 49 — default density + border) */
|
|
2720
|
+
rowHeight?: number;
|
|
2721
|
+
/** Height of the column header in pixels (default: 41) */
|
|
2722
|
+
headerHeight?: number;
|
|
2723
|
+
/** Height of the pagination bar in pixels (default: 52) */
|
|
2724
|
+
paginationHeight?: number;
|
|
2725
|
+
/** Extra bottom offset in pixels (default: 16) */
|
|
2726
|
+
bottomOffset?: number;
|
|
2727
|
+
/** Minimum rows per page (default: 5) */
|
|
2728
|
+
minRows?: number;
|
|
2729
|
+
/** Maximum rows per page (default: 50) */
|
|
2730
|
+
maxRows?: number;
|
|
2731
|
+
/** Whether auto calculation is enabled (default: true) */
|
|
2732
|
+
enabled?: boolean;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* Hook that calculates the optimal number of rows per page
|
|
2736
|
+
* based on the available viewport height.
|
|
2737
|
+
*
|
|
2738
|
+
* Returns the calculated perPage as default. If the user manually
|
|
2739
|
+
* changes the page size, respects their choice.
|
|
2740
|
+
*
|
|
2741
|
+
* @example
|
|
2742
|
+
* ```tsx
|
|
2743
|
+
* function MyTable() {
|
|
2744
|
+
* const { ref, perPage, setPerPage } = useAutoPageSize()
|
|
2745
|
+
* return (
|
|
2746
|
+
* <div ref={ref}>
|
|
2747
|
+
* <DataTable data={data} columns={columns}>
|
|
2748
|
+
* <DataTable.Pagination onPageSizeChange={setPerPage} />
|
|
2749
|
+
* </DataTable>
|
|
2750
|
+
* </div>
|
|
2751
|
+
* )
|
|
2752
|
+
* }
|
|
2753
|
+
* ```
|
|
2754
|
+
*/
|
|
2755
|
+
declare function useAutoPageSize<T extends HTMLElement = HTMLDivElement>(options?: UseAutoPageSizeOptions): {
|
|
2756
|
+
ref: React$1.RefObject<T | null>;
|
|
2757
|
+
perPage: number;
|
|
2758
|
+
setPerPage: (size: number) => void;
|
|
2759
|
+
autoPerPage: number;
|
|
2760
|
+
isAutoSized: boolean;
|
|
2761
|
+
isReady: boolean;
|
|
2762
|
+
};
|
|
2763
|
+
|
|
2718
2764
|
type Theme = 'dark' | 'light' | 'system';
|
|
2719
2765
|
interface ThemeProviderProps {
|
|
2720
2766
|
children: React$1.ReactNode;
|
|
@@ -2737,4 +2783,4 @@ declare const useTheme: () => ThemeProviderState;
|
|
|
2737
2783
|
*/
|
|
2738
2784
|
declare function cn(...inputs: ClassValue[]): string;
|
|
2739
2785
|
|
|
2740
|
-
export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
|
2786
|
+
export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAutoPageSize, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
package/dist/index.d.ts
CHANGED
|
@@ -2715,6 +2715,52 @@ declare function useAvailableHeight<T extends HTMLElement = HTMLDivElement>(opti
|
|
|
2715
2715
|
} | undefined;
|
|
2716
2716
|
};
|
|
2717
2717
|
|
|
2718
|
+
interface UseAutoPageSizeOptions {
|
|
2719
|
+
/** Height of each row in pixels (default: 49 — default density + border) */
|
|
2720
|
+
rowHeight?: number;
|
|
2721
|
+
/** Height of the column header in pixels (default: 41) */
|
|
2722
|
+
headerHeight?: number;
|
|
2723
|
+
/** Height of the pagination bar in pixels (default: 52) */
|
|
2724
|
+
paginationHeight?: number;
|
|
2725
|
+
/** Extra bottom offset in pixels (default: 16) */
|
|
2726
|
+
bottomOffset?: number;
|
|
2727
|
+
/** Minimum rows per page (default: 5) */
|
|
2728
|
+
minRows?: number;
|
|
2729
|
+
/** Maximum rows per page (default: 50) */
|
|
2730
|
+
maxRows?: number;
|
|
2731
|
+
/** Whether auto calculation is enabled (default: true) */
|
|
2732
|
+
enabled?: boolean;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* Hook that calculates the optimal number of rows per page
|
|
2736
|
+
* based on the available viewport height.
|
|
2737
|
+
*
|
|
2738
|
+
* Returns the calculated perPage as default. If the user manually
|
|
2739
|
+
* changes the page size, respects their choice.
|
|
2740
|
+
*
|
|
2741
|
+
* @example
|
|
2742
|
+
* ```tsx
|
|
2743
|
+
* function MyTable() {
|
|
2744
|
+
* const { ref, perPage, setPerPage } = useAutoPageSize()
|
|
2745
|
+
* return (
|
|
2746
|
+
* <div ref={ref}>
|
|
2747
|
+
* <DataTable data={data} columns={columns}>
|
|
2748
|
+
* <DataTable.Pagination onPageSizeChange={setPerPage} />
|
|
2749
|
+
* </DataTable>
|
|
2750
|
+
* </div>
|
|
2751
|
+
* )
|
|
2752
|
+
* }
|
|
2753
|
+
* ```
|
|
2754
|
+
*/
|
|
2755
|
+
declare function useAutoPageSize<T extends HTMLElement = HTMLDivElement>(options?: UseAutoPageSizeOptions): {
|
|
2756
|
+
ref: React$1.RefObject<T | null>;
|
|
2757
|
+
perPage: number;
|
|
2758
|
+
setPerPage: (size: number) => void;
|
|
2759
|
+
autoPerPage: number;
|
|
2760
|
+
isAutoSized: boolean;
|
|
2761
|
+
isReady: boolean;
|
|
2762
|
+
};
|
|
2763
|
+
|
|
2718
2764
|
type Theme = 'dark' | 'light' | 'system';
|
|
2719
2765
|
interface ThemeProviderProps {
|
|
2720
2766
|
children: React$1.ReactNode;
|
|
@@ -2737,4 +2783,4 @@ declare const useTheme: () => ThemeProviderState;
|
|
|
2737
2783
|
*/
|
|
2738
2784
|
declare function cn(...inputs: ClassValue[]): string;
|
|
2739
2785
|
|
|
2740
|
-
export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
|
2786
|
+
export { AuthLayout, type AuthLayoutBodyProps, type AuthLayoutContentProps, type AuthLayoutDividerProps, type AuthLayoutFooterProps, type AuthLayoutHeaderProps, type AuthLayoutImageProps, type AuthLayoutLinkProps, type AuthLayoutProps, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarImage, type AvatarImageProps, type AvatarProps, Badge, type BadgeProps, type BadgeVariant, type BaseFieldProps, BigNumberCard, type BigNumberCardContentProps, type BigNumberCardHeaderProps, type BigNumberCardLinkProps, type BigNumberCardRootProps, type BigNumberCardSize, type BigNumberCardSparklineProps, type BigNumberCardTitleProps, type BigNumberCardTrendProps, type BigNumberCardValueProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type ChartDataPoint, Checkbox, type CheckboxProps, type Company, DENSITY_CONFIG, DashboardLayout, type DashboardLayoutBreadcrumbsProps, type DashboardLayoutContentProps, type DashboardLayoutContextValue, type DashboardLayoutHeaderActionsProps, type DashboardLayoutHeaderProps, type DashboardLayoutHeaderTitleProps, type DashboardLayoutHeaderUserProps, type DashboardLayoutMobileNavItemProps, type DashboardLayoutMobileNavProps, type DashboardLayoutProps, type DashboardLayoutSidebarFooterProps, type DashboardLayoutSidebarHeaderProps, type DashboardLayoutSidebarNavGroupProps, type DashboardLayoutSidebarNavItemProps, type DashboardLayoutSidebarNavProps, type DashboardLayoutSidebarProps, type DashboardLayoutSidebarSectionProps, DataTable, type DataTableBulkActionsProps, type DataTableColumnHeaderProps, type DataTableColumnVisibilityProps, type DataTableContentProps, type DataTableContextValue, type DataTableDensity, type DataTableDensityToggleProps, type DataTableEmptyStateProps, type DataTableExportFormat, type DataTableExportProps, type DataTableFilterOption, type DataTableFilterProps, type DataTableFiltersProps, type DataTableLoadingProps, type DataTableMeta, type DataTablePaginationMode, type DataTablePaginationProps, type DataTableProps, type DataTableRowActionsProps, type DataTableSearchProps, type DataTableState, type DataTableTab, type DataTableTabsProps, type DataTableToolbarProps, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, type DialogWrapperProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FloatingBarCompound as FloatingBar, FloatingBarAction, type FloatingBarActionProps, FloatingBarCounter, type FloatingBarCounterProps, FloatingBarDivider, type FloatingBarDividerProps, FloatingBarIconAction, type FloatingBarIconActionProps, type FloatingBarProps, Form, FormCheckbox, type FormCheckboxProps, type FormContextValue, FormDescription, type FormDescriptionProps, FormError, type FormErrorProps, type FormFieldContextValue, FormFieldProvider, FormFieldWrapper, type FormFieldWrapperProps, FormInput, type FormInputProps, FormLabel, type FormLabelProps, FormRadioGroup, type FormRadioGroupProps, type FormRootProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, FormTextarea, type FormTextareaProps, GlobalLoaderController, Input, type InputProps, ItemCard, ItemCardActionButton, type ItemCardActionButtonProps, ItemCardActions, type ItemCardActionsProps, ItemCardActionsRow, type ItemCardActionsRowProps, ItemCardBadge, type ItemCardBadgeProps, ItemCardContent, ItemCardContentItem, type ItemCardContentItemProps, type ItemCardContentProps, ItemCardEmpty, type ItemCardEmptyProps, ItemCardFooter, ItemCardFooterDivider, type ItemCardFooterDividerProps, ItemCardFooterItem, type ItemCardFooterItemProps, type ItemCardFooterProps, ItemCardHeader, type ItemCardHeaderProps, ItemCardIcon, type ItemCardIconProps, ItemCardRoot, type ItemCardRootProps, ItemCardSubtitle, type ItemCardSubtitleProps, ItemCardTitle, ItemCardTitleGroup, type ItemCardTitleGroupProps, type ItemCardTitleProps, Kanban, type KanbanBoardProps, type KanbanCardProps, type KanbanColumnConfig, type KanbanColumnProps, type KanbanContextValue, type KanbanDragResult, type KanbanEmptyProps, type KanbanItem, Loader, type LoaderProps, LoaderProvider, Logo, type LogoProps, type MaskType, MobileNav, type MobileNavFabAction, MobileNavItem, type MobileNavItemConfig, type MobileNavItemProps, type MobileNavProps, Navbar, NavbarCompanyProfile, type NavbarCompanyProfileProps, NavbarNotification, type NavbarNotificationProps, type NavbarProps, NavbarUserMenu, type NavbarUserMenuProps, type NotificationItem, PageHeader, type PageHeaderProps, type PaginatedResponse, type PaginationMeta, type PaginationParams, Popover, PopoverContent, PopoverTrigger, type RadioOption, type RadioOptionColor, RippleBackground, type RippleBackgroundProps, RippleEffect, type RippleEffectProps, RippleWrapper, type RippleWrapperProps, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderBadge, type SectionHeaderBadgeProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderIcon, type SectionHeaderIconProps, SectionHeaderRoot, type SectionHeaderRootProps, SectionHeaderSubtitle, type SectionHeaderSubtitleProps, SectionHeaderTitle, type SectionHeaderTitleProps, Select, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectOption, type SelectProps, SelectSeparator, SelectionLayout, type SelectionLayoutCardProps, type SelectionLayoutEmptyProps, type SelectionLayoutHeaderProps, type SelectionLayoutHeadlineProps, type SelectionLayoutListProps, type SelectionLayoutLogoProps, type SelectionLayoutMainProps, type SelectionLayoutProps, type SelectionLayoutSearchProps, type SelectionLayoutSidebarProps, type SelectionLayoutStatsProps, type SelectionLayoutTabProps, type SelectionLayoutTabsProps, Separator, Sidebar, type SidebarContextValue, type SidebarFooterMenuItem, type SidebarFooterProps, type SidebarFooterUser, type SidebarHeaderProps, type SidebarNavGroupProps, type SidebarNavItemProps, type SidebarNavProps, type SidebarProps, type SidebarSectionProps, SimpleTooltip, type SimpleTooltipProps, Skeleton, type SkeletonProps, Sparkline, type SparklineColor, StatsCard, type StatsCardChangeProps, type StatsCardChartProps, type ColorScheme as StatsCardColorScheme, type StatsCardContentProps, type StatsCardHeaderProps, type StatsCardIconProps, type StatsCardRootProps, type StatsCardSubtitleProps, type StatsCardTitleProps, type StatsCardTodayProps, type StatsCardValueProps, type Variant as StatsCardVariant, type StepState, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, Toaster, type ToasterProps, Tooltip, TooltipAction, type TooltipActionProps, TooltipActions, type TooltipActionsProps, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipDescription, type TooltipDescriptionProps, TooltipHeader, type TooltipHeaderProps, TooltipIcon, type TooltipIconProps, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTitle, type TooltipTitleProps, TooltipTrigger, type UseDataTableConfig, type UserMenuItemConfig, type ValidationSchema, Wizard, WizardContent, type WizardContentProps, type WizardContextValue, WizardNavigation, type WizardNavigationProps, WizardPanel, type WizardPanelProps, WizardProgress, type WizardProgressProps, type WizardProps, WizardProvider, type WizardStepConfig, WizardStepConnector, type WizardStepConnectorProps, WizardStepIndicator, type WizardStepIndicatorProps, WizardSteps, type WizardStepsProps, cn, itemCardBadgeVariants, itemCardIconVariants, itemCardVariants, loader, toast, useAutoPageSize, useAvailableHeight, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useItemCard, useKanban, useKanbanOptional, useLoader, useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
package/dist/index.js
CHANGED
|
@@ -663,15 +663,15 @@ var SelectItem = React10__namespace.forwardRef(({ className, children, ...props
|
|
|
663
663
|
{
|
|
664
664
|
ref,
|
|
665
665
|
className: cn(
|
|
666
|
-
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5
|
|
666
|
+
"relative flex w-full cursor-pointer select-none items-center justify-between rounded-sm py-1.5 px-3 text-sm outline-none",
|
|
667
667
|
"focus:bg-accent focus:text-accent-foreground",
|
|
668
668
|
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
669
669
|
className
|
|
670
670
|
),
|
|
671
671
|
...props,
|
|
672
672
|
children: [
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
674
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemText, { children }),
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center ml-2", children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4 text-primary" }) }) })
|
|
675
675
|
]
|
|
676
676
|
}
|
|
677
677
|
));
|
|
@@ -1449,6 +1449,52 @@ function useAvailableHeight(options = {}) {
|
|
|
1449
1449
|
style: height ? { maxHeight: `${height}px` } : void 0
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
1452
|
+
function useAutoPageSize(options = {}) {
|
|
1453
|
+
const {
|
|
1454
|
+
rowHeight = 49,
|
|
1455
|
+
headerHeight = 41,
|
|
1456
|
+
paginationHeight = 52,
|
|
1457
|
+
bottomOffset = 16,
|
|
1458
|
+
minRows = 5,
|
|
1459
|
+
maxRows = 50,
|
|
1460
|
+
enabled = true
|
|
1461
|
+
} = options;
|
|
1462
|
+
const ref = React10.useRef(null);
|
|
1463
|
+
const [autoPerPage, setAutoPerPage] = React10.useState(minRows);
|
|
1464
|
+
const [userOverride, setUserOverride] = React10.useState(null);
|
|
1465
|
+
const hasCalculated = React10.useRef(false);
|
|
1466
|
+
const calculate = React10.useCallback(() => {
|
|
1467
|
+
const el = ref.current;
|
|
1468
|
+
if (!el || !enabled) return;
|
|
1469
|
+
const rect = el.getBoundingClientRect();
|
|
1470
|
+
const availableHeight = window.innerHeight - rect.top - headerHeight - paginationHeight - bottomOffset;
|
|
1471
|
+
const rows = Math.floor(availableHeight / rowHeight);
|
|
1472
|
+
const clamped = Math.max(minRows, Math.min(maxRows, rows));
|
|
1473
|
+
setAutoPerPage(clamped);
|
|
1474
|
+
hasCalculated.current = true;
|
|
1475
|
+
}, [rowHeight, headerHeight, paginationHeight, bottomOffset, minRows, maxRows, enabled]);
|
|
1476
|
+
React10.useEffect(() => {
|
|
1477
|
+
if (!enabled) return;
|
|
1478
|
+
const frame = requestAnimationFrame(calculate);
|
|
1479
|
+
window.addEventListener("resize", calculate);
|
|
1480
|
+
return () => {
|
|
1481
|
+
cancelAnimationFrame(frame);
|
|
1482
|
+
window.removeEventListener("resize", calculate);
|
|
1483
|
+
};
|
|
1484
|
+
}, [calculate, enabled]);
|
|
1485
|
+
const setPerPage = React10.useCallback((size) => {
|
|
1486
|
+
setUserOverride(size);
|
|
1487
|
+
}, []);
|
|
1488
|
+
const perPage = userOverride ?? autoPerPage;
|
|
1489
|
+
return {
|
|
1490
|
+
ref,
|
|
1491
|
+
perPage,
|
|
1492
|
+
setPerPage,
|
|
1493
|
+
autoPerPage,
|
|
1494
|
+
isAutoSized: userOverride === null,
|
|
1495
|
+
isReady: hasCalculated.current
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1452
1498
|
var Table = React10__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
1499
|
"table",
|
|
1454
1500
|
{
|
|
@@ -1533,7 +1579,7 @@ var DataTableContent = React10__namespace.memo(function DataTableContent2({
|
|
|
1533
1579
|
highlightOnHover = true,
|
|
1534
1580
|
onRowClick,
|
|
1535
1581
|
scrollable = false,
|
|
1536
|
-
scrollBottomOffset =
|
|
1582
|
+
scrollBottomOffset = 68,
|
|
1537
1583
|
className
|
|
1538
1584
|
}) {
|
|
1539
1585
|
const table = useDataTable();
|
|
@@ -8749,6 +8795,7 @@ exports.itemCardIconVariants = itemCardIconVariants;
|
|
|
8749
8795
|
exports.itemCardVariants = itemCardVariants;
|
|
8750
8796
|
exports.loader = loader;
|
|
8751
8797
|
exports.toast = toast;
|
|
8798
|
+
exports.useAutoPageSize = useAutoPageSize;
|
|
8752
8799
|
exports.useAvailableHeight = useAvailableHeight;
|
|
8753
8800
|
exports.useDashboardLayout = useDashboardLayout;
|
|
8754
8801
|
exports.useDataTable = useDataTable;
|