@serkonda7/solid-components 0.2.1 → 0.3.1
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 +1 -1
- package/dist/combobox.d.ts +3 -2
- package/dist/data-table.d.ts +11 -6
- package/dist/index.js +707 -581
- package/dist/styles.css +51 -33
- package/package.json +1 -1
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,
|
|
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.
|
package/dist/combobox.d.ts
CHANGED
|
@@ -44,7 +44,8 @@ export interface ComboboxProps {
|
|
|
44
44
|
/**
|
|
45
45
|
* Searchable dropdown of `options`, with an optional leading empty choice.
|
|
46
46
|
* A text combobox: typing filters the options by label and detail, arrow keys
|
|
47
|
-
* move the highlight (wrapping around), Enter picks it,
|
|
48
|
-
* input shows the selected label while closed;
|
|
47
|
+
* move the highlight (wrapping around), Enter picks it, Tab picks it and moves
|
|
48
|
+
* focus on, Escape closes. The input shows the selected label while closed;
|
|
49
|
+
* the value sits in `data-value`.
|
|
49
50
|
*/
|
|
50
51
|
export declare function Combobox(props: ComboboxProps): JSX.Element;
|
package/dist/data-table.d.ts
CHANGED
|
@@ -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
|
|
65
|
+
* repeated sort/loading states.
|
|
61
66
|
*/
|
|
62
67
|
export declare function DataTable<TRow>(props: DataTableProps<TRow>): JSX.Element;
|