lecom-ui 2.6.8 → 2.7.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.
@@ -5,7 +5,8 @@ import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from '.
5
5
  function DataTable({
6
6
  columns,
7
7
  data,
8
- noResults
8
+ noResults,
9
+ onRowSelectionChange
9
10
  }) {
10
11
  const [sorting, setSorting] = React.useState([]);
11
12
  const [rowSelection, setRowSelection] = React.useState({});
@@ -28,6 +29,9 @@ function DataTable({
28
29
  }
29
30
  return meta["style"] ?? {};
30
31
  };
32
+ React.useEffect(() => {
33
+ onRowSelectionChange?.(rowSelection);
34
+ }, [onRowSelectionChange, rowSelection]);
31
35
  return /* @__PURE__ */ React.createElement("div", { className: "bg-white rounded-[8px] py-0 px-2 pb-2" }, /* @__PURE__ */ React.createElement(Table, null, /* @__PURE__ */ React.createElement(TableHeader, { className: "[&_tr]:border-b-[1.5px] [&_tr]:border-grey-400" }, table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ React.createElement(TableRow, { key: headerGroup.id }, headerGroup.headers.map((header) => /* @__PURE__ */ React.createElement(
32
36
  TableHead,
33
37
  {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Button } from '../Button/Button.js';
3
3
  import { cn } from '../../lib/utils.js';
4
- import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
4
+ import { ChevronFirst, ChevronLast, ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
5
5
 
6
6
  const Pagination = ({ className, ...props }) => /* @__PURE__ */ React.createElement(
7
7
  "nav",
@@ -24,6 +24,44 @@ const PaginationContent = React.forwardRef(({ className, ...props }, ref) => /*
24
24
  PaginationContent.displayName = "PaginationContent";
25
25
  const PaginationItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React.createElement("li", { ref, className: cn("", className), ...props }));
26
26
  PaginationItem.displayName = "PaginationItem";
27
+ const PaginationFirst = ({
28
+ className,
29
+ disabled,
30
+ isActive,
31
+ onClick
32
+ }) => /* @__PURE__ */ React.createElement(
33
+ Button,
34
+ {
35
+ disabled,
36
+ iconButton: true,
37
+ variant: "ghost",
38
+ color: "grey",
39
+ size: "small",
40
+ onClick,
41
+ className: cn(isActive && "bg-white", className)
42
+ },
43
+ /* @__PURE__ */ React.createElement(ChevronFirst, { size: 20 })
44
+ );
45
+ PaginationFirst.displayName = "PaginationFirst";
46
+ const PaginationLast = ({
47
+ className,
48
+ disabled,
49
+ isActive,
50
+ onClick
51
+ }) => /* @__PURE__ */ React.createElement(
52
+ Button,
53
+ {
54
+ disabled,
55
+ iconButton: true,
56
+ variant: "ghost",
57
+ color: "grey",
58
+ size: "small",
59
+ onClick,
60
+ className: cn(isActive && "bg-white", className)
61
+ },
62
+ /* @__PURE__ */ React.createElement(ChevronLast, { size: 20 })
63
+ );
64
+ PaginationLast.displayName = "PaginationLast";
27
65
  const PaginationPrevious = ({
28
66
  className,
29
67
  disabled,
@@ -108,4 +146,4 @@ const PaginationIndex = ({
108
146
  );
109
147
  PaginationIndex.displayName = "PaginationIndex";
110
148
 
111
- export { Pagination, PaginationContent, PaginationEllipsis, PaginationIndex, PaginationItem, PaginationNext, PaginationPrevious };
149
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious };
package/dist/index.d.ts CHANGED
@@ -243,8 +243,11 @@ interface DataTableProps<TData, TValue> {
243
243
  columns: ColumnDef<TData, TValue>[];
244
244
  data: TData[];
245
245
  noResults?: React.ReactNode;
246
+ onRowSelectionChange?: (rowSelection: {
247
+ [key: string]: string;
248
+ }) => void;
246
249
  }
247
- declare function DataTable<TData, TValue>({ columns, data, noResults, }: DataTableProps<TData, TValue>): React.JSX.Element;
250
+ declare function DataTable<TData, TValue>({ columns, data, noResults, onRowSelectionChange, }: DataTableProps<TData, TValue>): React.JSX.Element;
248
251
 
249
252
  declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
250
253
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -512,6 +515,14 @@ declare const Pagination: {
512
515
  };
513
516
  declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
514
517
  declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
518
+ declare const PaginationFirst: {
519
+ ({ className, disabled, isActive, onClick, }: PaginationButtonProps): React.JSX.Element;
520
+ displayName: string;
521
+ };
522
+ declare const PaginationLast: {
523
+ ({ className, disabled, isActive, onClick, }: PaginationButtonProps): React.JSX.Element;
524
+ displayName: string;
525
+ };
515
526
  declare const PaginationPrevious: {
516
527
  ({ className, disabled, isActive, onClick, }: PaginationButtonProps): React.JSX.Element;
517
528
  displayName: string;
@@ -578,4 +589,4 @@ declare const fonts: {
578
589
  ibm: string[];
579
590
  };
580
591
 
581
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Pagination, PaginationContent, PaginationEllipsis, PaginationIndex, PaginationItem, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, type SideBarProps, Skeleton, Switch, TOAST_REMOVE_DELAY, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TypeMessageNotification, Typography, type TypographyProps, accordionVariants, buttonVariants, colors, fonts, getPositionClass, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast };
592
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, type BgColor, Button, type ButtonProps, CadastroFacil, type CadastroFacilProps, type CalloutNotificationProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, type Color, type ColorToken, type CustomStyles$1 as CustomStyles, DataTable, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type FillColor, type Fonts, type HeaderProps, type InlineNotificationProps, Layout, type LayoutProps, LogoLecom, LogoLecomBrand, type LogoLecomBrandProps, type LogoLecomProps, ModoTeste, type ModoTesteProps, Notification, type NotificationProps, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, Rpa, type RpaProps, type SideBarProps, Skeleton, Switch, TOAST_REMOVE_DELAY, Tag, type TagProps, type TextColor, type ToastNotificationProps, type ToasterToast, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, TypeMessageNotification, Typography, type TypographyProps, accordionVariants, buttonVariants, colors, fonts, getPositionClass, notificationVariants, reducer, tagVariants, toast, typographyVariants, useNotificationToast };
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMe
13
13
  export { Layout } from './components/Layout/Layout.js';
14
14
  export { Notification, TypeMessageNotification, getPositionClass, notificationVariants } from './components/Notification/Notification.js';
15
15
  export { TOAST_REMOVE_DELAY, reducer, toast, useNotificationToast } from './components/Notification/useNotificationToast.js';
16
- export { Pagination, PaginationContent, PaginationEllipsis, PaginationIndex, PaginationItem, PaginationNext, PaginationPrevious } from './components/Pagination/Pagination.js';
16
+ export { Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious } from './components/Pagination/Pagination.js';
17
17
  export { Popover, PopoverContent, PopoverTrigger } from './components/Popover/Popover.js';
18
18
  export { Skeleton } from './components/Skeleton/Skeleton.js';
19
19
  export { Switch } from './components/Switch/Switch.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "2.6.8",
3
+ "version": "2.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",