@6thbridge/hexa 0.0.66 → 0.0.67

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 CHANGED
@@ -13,6 +13,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
14
  import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
15
15
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
16
+ import * as zustand from 'zustand';
16
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
17
18
  import dayjs from 'dayjs';
18
19
  import { ClassValue } from 'clsx';
@@ -438,6 +439,7 @@ type FilterContentProps = {
438
439
  filters: FilterListItem[];
439
440
  values?: Record<string, any>;
440
441
  setAppliedFilters?: (values: Record<string, any>) => void;
442
+ onChange?: (values: Record<string, any>) => void;
441
443
  id?: string;
442
444
  };
443
445
  type FilterListOptions = FilterListItem[];
@@ -482,8 +484,9 @@ type TableProps<T extends RowData> = {
482
484
  pagination?: TablePaginationProps;
483
485
  search?: TableSearchProps;
484
486
  table: Table$1<T>;
487
+ onFilterChange?: (values: Record<string, any>) => void;
485
488
  };
486
- declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
489
+ declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, onFilterChange, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
487
490
 
488
491
  type PageDataToolbarProps = {
489
492
  onRefetch?: () => void;
@@ -494,10 +497,11 @@ type PageDataToolbarProps = {
494
497
  download?: TableDownloadProps;
495
498
  isRefetching?: boolean;
496
499
  setAppliedFilters?: (values: Record<string, any>) => void;
500
+ onFilterChange?: (values: Record<string, any>) => void;
497
501
  filterListOptions?: FilterListItem[];
498
502
  id?: string;
499
503
  };
500
- declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, id, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
504
+ declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, onFilterChange, id, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
501
505
 
502
506
  type ResourcePermission = {
503
507
  resource: string;
@@ -553,8 +557,16 @@ type FilterPopoverProps = FilterContentProps & {
553
557
  isOpen?: boolean;
554
558
  trigger?: ReactNode;
555
559
  id?: string;
560
+ onChange?: (values: Record<string, any>) => void;
556
561
  };
557
- declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, id, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
562
+ declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, onChange, id, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
563
+
564
+ interface FilterSliceType {
565
+ filters: Record<string, any> | null;
566
+ upDateFilter: (items: Record<string, any> | ((prev: Record<string, any> | null) => Record<string, any> | null) | null) => void;
567
+ resetFilters: () => void;
568
+ }
569
+ declare const useFilterStore: () => zustand.UseBoundStore<zustand.StoreApi<FilterSliceType>>;
558
570
 
559
571
  interface TextOverflowProps extends React__default.HTMLAttributes<HTMLElement> {
560
572
  children: React__default.ReactNode;
@@ -603,4 +615,4 @@ declare class DateAction {
603
615
 
604
616
  declare function cn(...inputs: ClassValue[]): string;
605
617
 
606
- export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TablePaginationProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };
618
+ export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TablePaginationProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
14
  import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
15
15
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
16
+ import * as zustand from 'zustand';
16
17
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
17
18
  import dayjs from 'dayjs';
18
19
  import { ClassValue } from 'clsx';
@@ -438,6 +439,7 @@ type FilterContentProps = {
438
439
  filters: FilterListItem[];
439
440
  values?: Record<string, any>;
440
441
  setAppliedFilters?: (values: Record<string, any>) => void;
442
+ onChange?: (values: Record<string, any>) => void;
441
443
  id?: string;
442
444
  };
443
445
  type FilterListOptions = FilterListItem[];
@@ -482,8 +484,9 @@ type TableProps<T extends RowData> = {
482
484
  pagination?: TablePaginationProps;
483
485
  search?: TableSearchProps;
484
486
  table: Table$1<T>;
487
+ onFilterChange?: (values: Record<string, any>) => void;
485
488
  };
486
- declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
489
+ declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, onFilterChange, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
487
490
 
488
491
  type PageDataToolbarProps = {
489
492
  onRefetch?: () => void;
@@ -494,10 +497,11 @@ type PageDataToolbarProps = {
494
497
  download?: TableDownloadProps;
495
498
  isRefetching?: boolean;
496
499
  setAppliedFilters?: (values: Record<string, any>) => void;
500
+ onFilterChange?: (values: Record<string, any>) => void;
497
501
  filterListOptions?: FilterListItem[];
498
502
  id?: string;
499
503
  };
500
- declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, id, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
504
+ declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, onFilterChange, id, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
501
505
 
502
506
  type ResourcePermission = {
503
507
  resource: string;
@@ -553,8 +557,16 @@ type FilterPopoverProps = FilterContentProps & {
553
557
  isOpen?: boolean;
554
558
  trigger?: ReactNode;
555
559
  id?: string;
560
+ onChange?: (values: Record<string, any>) => void;
556
561
  };
557
- declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, id, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
562
+ declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, onChange, id, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
563
+
564
+ interface FilterSliceType {
565
+ filters: Record<string, any> | null;
566
+ upDateFilter: (items: Record<string, any> | ((prev: Record<string, any> | null) => Record<string, any> | null) | null) => void;
567
+ resetFilters: () => void;
568
+ }
569
+ declare const useFilterStore: () => zustand.UseBoundStore<zustand.StoreApi<FilterSliceType>>;
558
570
 
559
571
  interface TextOverflowProps extends React__default.HTMLAttributes<HTMLElement> {
560
572
  children: React__default.ReactNode;
@@ -603,4 +615,4 @@ declare class DateAction {
603
615
 
604
616
  declare function cn(...inputs: ClassValue[]): string;
605
617
 
606
- export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TablePaginationProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };
618
+ export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, ScrollArea, Select, Sidebar, Status, Table, type TablePaginationProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };