@douglasneuroinformatics/libui 3.1.1 → 3.1.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@douglasneuroinformatics/libui",
3
3
  "type": "module",
4
- "version": "3.1.1",
4
+ "version": "3.1.3",
5
5
  "packageManager": "pnpm@9.3.0",
6
6
  "description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
7
7
  "author": "Joshua Unrau",
@@ -53,6 +53,7 @@ export type ClientTableColumnProps<T extends ClientTableEntry> = {
53
53
  };
54
54
 
55
55
  export type ClientTableProps<T extends ClientTableEntry> = {
56
+ [key: `data-${string}`]: unknown;
56
57
  className?: string;
57
58
  columnDropdownOptions?: ClientTableDropdownOptions<T>;
58
59
  columns: ClientTableColumn<T>[];
@@ -71,7 +72,8 @@ export const ClientTable = <T extends ClientTableEntry>({
71
72
  entriesPerPage = 10,
72
73
  minRows,
73
74
  noWrap,
74
- onEntryClick
75
+ onEntryClick,
76
+ ...props
75
77
  }: ClientTableProps<T>) => {
76
78
  const [currentPage, setCurrentPage] = useState(1);
77
79
 
@@ -83,7 +85,7 @@ export const ClientTable = <T extends ClientTableEntry>({
83
85
  const nRows = Math.max(currentEntries.length, minRows ?? -1);
84
86
 
85
87
  return (
86
- <div className={className}>
88
+ <div className={className} {...props}>
87
89
  <div className="rounded-md border bg-card tracking-tight text-muted-foreground shadow-sm">
88
90
  <Table>
89
91
  <Table.Header>
@@ -42,7 +42,7 @@ export const NumberFieldSelect = <T extends number = number>({
42
42
  // Option needs to be type number (this was a design flaw), but is actually always coerced to string anyways
43
43
  const text = (disableAutoPrefix ? '' : `${option} - `) + options[option as any as T];
44
44
  return (
45
- <Select.Item data-cy={`${name}-select-item`} key={option} value={option}>
45
+ <Select.Item data-cy={`${name}-select-item-${option}`} key={option} value={option}>
46
46
  {text}
47
47
  </Select.Item>
48
48
  );
@@ -38,7 +38,7 @@ export const StringFieldSelect = <T extends string = string>({
38
38
  </Select.Trigger>
39
39
  <Select.Content data-cy={`${name}-select-content`} data-testid={`${name}-select-content`}>
40
40
  {Object.keys(options).map((option) => (
41
- <Select.Item data-cy={`${name}-select-item`} key={option} value={option}>
41
+ <Select.Item data-cy={`${name}-select-item-${option}`} key={option} value={option}>
42
42
  {options[option as T]}
43
43
  </Select.Item>
44
44
  ))}