@serkonda7/solid-components 0.2.0 → 0.3.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/README.md CHANGED
@@ -34,7 +34,7 @@ export default defineConfig({ plugins: [tablerIcons(), solid()] })
34
34
  ```
35
35
 
36
36
  These components are available:
37
- - `DataTable` - generic table with optional sorting, row selection, actions, loading, empty states, and column customizer.
37
+ - `DataTable` - generic table with optional sorting, actions, loading, empty states, and column customizer.
38
38
  - `FilterTable` - `DataTable` with filtering: quick search, a grouped filter form, and removable filter pills.
39
39
  - `Combobox` - searchable, accessible dropdown with keyboard navigation, option icons, a detail column, and an optional "Add …" entry.
40
40
  - `SearchBar` - search input with clear button and a global Ctrl/Cmd+K focus shortcut.
@@ -10,6 +10,12 @@ export interface DataTableColumn<TRow> {
10
10
  sortable?: boolean;
11
11
  sortValue?: (row: TRow) => unknown;
12
12
  class?: string;
13
+ /** Column width: a number (px) or any CSS length, e.g. `'12rem'` or `'20%'`. */
14
+ width?: number | string;
15
+ /** Minimum column width: a number (px) or any CSS length. */
16
+ minWidth?: number | string;
17
+ /** Maximum column width: a number (px) or any CSS length. */
18
+ maxWidth?: number | string;
13
19
  ariaLabel?: string;
14
20
  getValue?: (row: TRow) => JSX.Element;
15
21
  /** Whether the column is visible by default when the column customizer is used. Defaults to `true`. */
@@ -23,9 +29,6 @@ export interface DataTableProps<TRow> {
23
29
  getRowId: (row: TRow) => string | number;
24
30
  getCell?: (row: TRow, column: DataTableColumn<TRow>) => JSX.Element;
25
31
  rowActions?: (row: TRow) => JSX.Element;
26
- selected?: string[] | number[] | Accessor<string[] | number[]>;
27
- onSelectionChange?: (ids: (string | number)[]) => void;
28
- selectionLabel?: string;
29
32
  sortKey?: string | Accessor<string | undefined>;
30
33
  sortDirection?: DataTableSortDirection | Accessor<DataTableSortDirection>;
31
34
  defaultSort?: DataTableSort;
@@ -39,13 +42,15 @@ export interface DataTableProps<TRow> {
39
42
  columnOrder?: string[] | Accessor<string[]>;
40
43
  defaultColumnOrder?: string[];
41
44
  onColumnOrderChange?: (orderedKeys: string[]) => void;
45
+ /** Shows a drag handle between column headers to resize columns. */
46
+ resizableColumns?: boolean;
47
+ /** Called with all current pixel widths (by column key) after a resize. */
48
+ onColumnWidthsChange?: (widths: Record<string, number>) => void;
42
49
  showColumnCustomizer?: boolean | Accessor<boolean>;
43
50
  columnCustomizerLabel?: string;
44
51
  columnCustomizerTitle?: string;
45
52
  columnCustomizerShowAllLabel?: string;
46
53
  columnCustomizerResetLabel?: string;
47
- columnCustomizerMoveUpLabel?: string;
48
- columnCustomizerMoveDownLabel?: string;
49
54
  /** Content rendered at the start of the toolbar, before the column customizer. */
50
55
  toolbar?: JSX.Element;
51
56
  loading?: boolean | Accessor<boolean>;
@@ -57,6 +62,6 @@ export interface DataTableProps<TRow> {
57
62
  /**
58
63
  * Generic accessible data table. Data fetching, navigation, and cell content
59
64
  * stay with the consuming app; this component owns table structure and the
60
- * repeated selection/sort/loading states.
65
+ * repeated sort/loading states.
61
66
  */
62
67
  export declare function DataTable<TRow>(props: DataTableProps<TRow>): JSX.Element;
@@ -60,7 +60,7 @@ export interface FilterTableProps<TRow> extends Omit<DataTableProps<TRow>, 'tool
60
60
  saveLabel?: string;
61
61
  saveNameLabel?: string;
62
62
  cancelLabel?: string;
63
- deleteSavedFilterLabel?: string;
63
+ clearSavedFilterLabel?: string;
64
64
  }
65
65
  /**
66
66
  * `DataTable` with filtering: a Results tab with a quick search and