@vesture/react 0.1.0 → 0.2.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.css +172 -17
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +27 -2
- package/dist/index.js +514 -106
- package/dist/index.js.map +1 -1
- package/package.json +10 -4
package/dist/index.d.ts
CHANGED
|
@@ -284,6 +284,14 @@ interface DataGridColumn<T> {
|
|
|
284
284
|
minWidth?: number;
|
|
285
285
|
sortable?: boolean;
|
|
286
286
|
resizable?: boolean;
|
|
287
|
+
/** Freeze this column to an edge so it stays visible during horizontal scroll. */
|
|
288
|
+
pinned?: "left" | "right";
|
|
289
|
+
/** Allow this column's cells to be edited when the row is in edit mode. */
|
|
290
|
+
editable?: boolean;
|
|
291
|
+
/** Allow this column to be filtered via the filter row. */
|
|
292
|
+
filterable?: boolean;
|
|
293
|
+
/** Filter input type when filterable is true. Defaults to 'text'. */
|
|
294
|
+
filterType?: "text" | "select";
|
|
287
295
|
accessor?: (row: T) => string | number;
|
|
288
296
|
render?: (row: T) => ReactNode;
|
|
289
297
|
}
|
|
@@ -292,6 +300,10 @@ interface SortState {
|
|
|
292
300
|
key: string;
|
|
293
301
|
direction: SortDirection;
|
|
294
302
|
}
|
|
303
|
+
interface FilterState {
|
|
304
|
+
key: string;
|
|
305
|
+
value: string;
|
|
306
|
+
}
|
|
295
307
|
|
|
296
308
|
interface DataGridProps<T> {
|
|
297
309
|
columns: DataGridColumn<T>[];
|
|
@@ -305,8 +317,21 @@ interface DataGridProps<T> {
|
|
|
305
317
|
onSelectionChange?: (ids: Set<string>) => void;
|
|
306
318
|
sort?: SortState | null;
|
|
307
319
|
onSortChange?: (sort: SortState | null) => void;
|
|
320
|
+
filters?: FilterState[];
|
|
321
|
+
onFilterChange?: (filters: FilterState[]) => void;
|
|
308
322
|
emptyMessage?: ReactNode;
|
|
309
|
-
|
|
310
|
-
|
|
323
|
+
/** Enables inline row editing; called when a row's edit is saved. */
|
|
324
|
+
onRowEdit?: (rowId: string, values: Record<string, string>) => void;
|
|
325
|
+
/** When true, `data` is treated as already sorted/filtered/paginated by the caller. */
|
|
326
|
+
serverSide?: boolean;
|
|
327
|
+
/** Shows a loading overlay over the grid without unmounting existing rows. */
|
|
328
|
+
loading?: boolean;
|
|
329
|
+
/** True total row count on the server, used for pagination controls. */
|
|
330
|
+
totalRowCount?: number;
|
|
331
|
+
page?: number;
|
|
332
|
+
pageSize?: number;
|
|
333
|
+
onPageChange?: (page: number) => void;
|
|
334
|
+
}
|
|
335
|
+
declare function DataGrid<T>({ columns, data, getRowId, rowHeight, height, overscan, selectable, selectedIds: controlledSelectedIds, onSelectionChange, sort: controlledSort, onSortChange, filters: controlledFilters, onFilterChange, emptyMessage, onRowEdit, serverSide, loading, totalRowCount, page, pageSize, onPageChange, }: DataGridProps<T>): ReactElement;
|
|
311
336
|
|
|
312
337
|
export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, type ButtonProps, type ButtonVariant, Card, type CardElevation, type CardProps, Checkbox, type CheckboxProps, DataGrid, type DataGridColumn, type DataGridProps, Divider, type DividerOrientation, type DividerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, Radio, type RadioProps, Select, type SelectProps, type SortDirection, type SortState, Spinner, type SpinnerProps, type SpinnerSize, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastContextValue, type ToastOptions, ToastProvider, type ToastVariant, Tooltip, type TooltipProps, useToast };
|