lecom-ui 5.2.90 → 5.2.92

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.
@@ -113,8 +113,10 @@ function buildColumns({
113
113
  width: externalColumn.width,
114
114
  fixed: externalColumn.fixed,
115
115
  truncate: !!externalColumn.truncate,
116
+ align: externalColumn.align,
116
117
  headerClassName: externalColumn.headerClassName,
117
- headerStyle: externalColumn.headerStyle
118
+ headerStyle: externalColumn.headerStyle,
119
+ cellClassName: externalColumn.cellClassName
118
120
  },
119
121
  sortingFn: (rowA, rowB, columnId) => {
120
122
  if (externalColumn.onSortClient) {
@@ -19,11 +19,13 @@ function Table({
19
19
  overflow: "hidden",
20
20
  maxWidth: "0",
21
21
  textOverflow: "ellipsis",
22
- whiteSpace: "nowrap"
22
+ whiteSpace: "nowrap",
23
+ textAlign: meta.align || "left"
23
24
  };
24
25
  }
25
26
  return {
26
- width: meta.width
27
+ width: meta.width,
28
+ textAlign: meta.align || "left"
27
29
  };
28
30
  };
29
31
  const getFixed = (meta) => meta.fixed;
@@ -51,10 +53,10 @@ function Table({
51
53
  ),
52
54
  "data-header": header.id,
53
55
  "data-fixed": getFixed(header.column.columnDef.meta),
54
- style: styleColumn(
55
- header.column.columnDef.meta,
56
- "th"
57
- ),
56
+ style: {
57
+ ...styleColumn(header.column.columnDef.meta, "th"),
58
+ ...header.column.columnDef.meta?.headerStyle
59
+ },
58
60
  onClick: header.column.getToggleSortingHandler()
59
61
  },
60
62
  header.isPlaceholder ? null : flexRender(
@@ -72,7 +74,10 @@ function Table({
72
74
  "td",
73
75
  {
74
76
  key: cell.id,
75
- className: "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
77
+ className: cn(
78
+ "p-4 py-0 h-10 [&:has([role=checkbox])]:pr-0 transition-colors shadow-[0_-0.5px_0px_0px_#c9c9c9_inset] text-left",
79
+ cell.column.columnDef.meta?.cellClassName
80
+ ),
76
81
  "data-column": cell.column.id,
77
82
  "data-fixed": getFixed(cell.column.columnDef.meta),
78
83
  style: styleColumn(cell.column.columnDef.meta, "td")
package/dist/index.d.ts CHANGED
@@ -473,8 +473,10 @@ interface Column<TData, TValue> {
473
473
  width?: number | string;
474
474
  fixed?: string;
475
475
  truncate?: boolean;
476
+ align?: 'left' | 'center' | 'right';
476
477
  headerClassName?: string;
477
478
  headerStyle?: React.CSSProperties;
479
+ cellClassName?: string;
478
480
  customHeaderRender?: ({ table, column, }: ColumnSort<TData, TValue>) => React.ReactNode;
479
481
  render?: (({ value, row }: ColumnRender<TData, TValue>) => React.ReactNode) | React.ReactNode;
480
482
  onSort?: ({ table, column }: ColumnSort<TData, TValue>) => void;
@@ -520,7 +522,15 @@ interface BuildCellSelect<TData, TValue> {
520
522
  checkedCell: Column<TData, TValue>['checkedCell'];
521
523
  onCheckedCellChange: Column<TData, TValue>['onCheckedCellChange'];
522
524
  }
523
- type Meta = Record<string, string | number>;
525
+ interface Meta {
526
+ width?: number | string;
527
+ fixed?: string;
528
+ truncate?: boolean;
529
+ align?: 'left' | 'center' | 'right';
530
+ headerClassName?: string;
531
+ headerStyle?: React.CSSProperties;
532
+ cellClassName?: string;
533
+ }
524
534
  interface TableProps<TData, TValue> {
525
535
  table: Table<TData>;
526
536
  isLoading?: boolean;
@@ -1100,12 +1110,12 @@ type ComboboxProps = {
1100
1110
  };
1101
1111
  declare function Combobox({ options, value, onChange, placeholder, disabled, notFoundContent, status, searchTerm, triggerClassName, contentClassName, }: ComboboxProps): React$1.JSX.Element;
1102
1112
 
1103
- interface TagValue {
1113
+ interface TagItem {
1104
1114
  label: string;
1105
1115
  value: string;
1106
1116
  }
1107
1117
  interface TagInputProps extends React$1.HTMLAttributes<HTMLDivElement> {
1108
- value: TagValue[];
1118
+ value: TagItem[];
1109
1119
  onRemove: (value: string) => void;
1110
1120
  placeholder?: string;
1111
1121
  disabled?: boolean;
@@ -1196,4 +1206,4 @@ declare const SheetTitle: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive
1196
1206
  declare const SheetDescription: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React$1.RefAttributes<HTMLParagraphElement>, "ref"> & React$1.RefAttributes<HTMLParagraphElement>>;
1197
1207
 
1198
1208
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CadastroFacil, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapse, Combobox, CustomDivider, DataTable, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogScroll, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ErrorEmptyDisplay, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Layout, LogoLecom, LogoLecomBrand, ModoTeste, MultiSelect, Notification, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationIndex, PaginationItem, PaginationLast, PaginationNext, PaginationPrevious, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, Rpa, SairModoTeste, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Spin, Steps, Switch, TOAST_REMOVE_DELAY, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TagInput, Textarea, ToggleGroup, ToggleGroupItem, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, Translations, TypeMessageNotification, Typography, Upload, accordionVariants, buttonVariants, collapseTriggerVariants, colors, fonts, initializeI18n, inputVariants, notificationVariants, reducer, tagVariants, textareaVariants, toast, typographyVariants, useFormField, useIsMobile, useNotificationToast, usePagination, useSidebar };
1199
- export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, ChartConfig, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnSortClient, ColumnTitle, ComboboxGroup, ComboboxOption, ComboboxProps, CustomStyles$1 as CustomStyles, DataTableProps, DatePickerProps, DialogContentProps, ErrorEmptyDisplayProps, ExpandIconPosition, File, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, StepsProps, SwitchProps, TableProps, TagInputProps, TagProps, TagValue, TextColor, TextareaProps, TimelineStepItem, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
1209
+ export type { BgColor, BuildCellSelect, BuildColumns, BuildHeaderSelect, ButtonProps, CadastroFacilProps, CalloutNotificationProps, ChartConfig, CheckboxProps, CheckedCell, CheckedCellChange, CheckedHeader, CheckedHeaderChange, Color, ColorToken, Column, ColumnRender, ColumnSort, ColumnSortClient, ColumnTitle, ComboboxGroup, ComboboxOption, ComboboxProps, CustomStyles$1 as CustomStyles, DataTableProps, DatePickerProps, DialogContentProps, ErrorEmptyDisplayProps, ExpandIconPosition, File, FillColor, Fonts, Header, HeaderProps, InlineNotificationProps, InputProps, LayoutProps, LogoLecomBrandProps, LogoLecomProps, Meta, ModoTesteProps, NotificationProps, PaginationProps, Row, RpaProps, SideBarProps, SpinProps, StepsProps, SwitchProps, TableProps, TagInputProps, TagItem, TagProps, TextColor, TextareaProps, TimelineStepItem, ToastNotificationProps, ToasterToast, TooltipContentProps, TypographyProps, UploadProps, UsePaginationItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.2.90",
3
+ "version": "5.2.92",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",