@simplysm/solid 13.0.98 → 13.0.100
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 +166 -259
- package/docs/data.md +246 -120
- package/docs/disclosure.md +85 -61
- package/docs/display.md +87 -44
- package/docs/features.md +186 -155
- package/docs/feedback.md +130 -107
- package/docs/form-control.md +337 -254
- package/docs/helpers.md +120 -82
- package/docs/hooks.md +69 -70
- package/docs/layout.md +115 -85
- package/docs/providers.md +130 -110
- package/docs/styles.md +91 -85
- package/package.json +5 -5
package/docs/data.md
CHANGED
|
@@ -1,125 +1,167 @@
|
|
|
1
1
|
# Data Components
|
|
2
2
|
|
|
3
|
-
Source: `src/components/data
|
|
3
|
+
Source: `src/components/data/**`
|
|
4
4
|
|
|
5
|
-
## Table
|
|
5
|
+
## `Table`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Simple HTML table component with border and padding styles.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
interface TableProps extends JSX.HTMLAttributes<HTMLTableElement> {
|
|
11
|
-
inset?: boolean;
|
|
9
|
+
```typescript
|
|
10
|
+
export interface TableProps extends JSX.HTMLAttributes<HTMLTableElement> {
|
|
11
|
+
inset?: boolean;
|
|
12
12
|
}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
| Prop | Type | Description |
|
|
16
|
+
|------|------|-------------|
|
|
17
|
+
| `inset` | `boolean` | Remove outer border and rounded corners |
|
|
18
|
+
|
|
15
19
|
### Sub-components
|
|
16
20
|
|
|
17
|
-
- **`Table.Row`** -- `<tr>`
|
|
18
|
-
- **`Table.HeaderCell`** -- `<th>`
|
|
19
|
-
- **`Table.Cell`** -- `<td>`
|
|
21
|
+
- **`Table.Row`** -- Table row (`<tr>`)
|
|
22
|
+
- **`Table.HeaderCell`** -- Header cell (`<th>`) with bold text and muted background
|
|
23
|
+
- **`Table.Cell`** -- Body cell (`<td>`)
|
|
24
|
+
|
|
25
|
+
---
|
|
20
26
|
|
|
21
|
-
## List
|
|
27
|
+
## `List`
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Container component for list items with tree-view keyboard navigation (Space/Enter, ArrowUp/Down, ArrowLeft/Right, Home/End).
|
|
24
30
|
|
|
25
|
-
```
|
|
26
|
-
interface ListProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
27
|
-
inset?: boolean;
|
|
31
|
+
```typescript
|
|
32
|
+
export interface ListProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
inset?: boolean;
|
|
28
34
|
}
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
| Prop | Type | Description |
|
|
38
|
+
|------|------|-------------|
|
|
39
|
+
| `inset` | `boolean` | Transparent background, no outer border |
|
|
40
|
+
|
|
41
|
+
### Sub-components
|
|
42
|
+
|
|
43
|
+
- **`List.Item`** -- Interactive list item (see `ListItem` below)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## `ListContext`
|
|
32
48
|
|
|
33
|
-
|
|
49
|
+
Context for tracking nesting level in nested lists.
|
|
34
50
|
|
|
35
|
-
```
|
|
36
|
-
interface ListContextValue {
|
|
51
|
+
```typescript
|
|
52
|
+
export interface ListContextValue {
|
|
37
53
|
level: number;
|
|
38
54
|
}
|
|
39
55
|
|
|
40
|
-
const ListContext: Context<ListContextValue>;
|
|
41
|
-
|
|
56
|
+
export const ListContext: Context<ListContextValue>;
|
|
57
|
+
export const useListContext: () => ListContextValue;
|
|
42
58
|
```
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
---
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
## `ListItem.styles`
|
|
47
63
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
Shared style constants for list items.
|
|
65
|
+
|
|
66
|
+
| Export | Type | Description |
|
|
67
|
+
|--------|------|-------------|
|
|
68
|
+
| `listItemBaseClass` | `string` | Base item styles |
|
|
69
|
+
| `listItemSizeClasses` | `Record<ComponentSize, string>` | Size-specific padding |
|
|
70
|
+
| `listItemSelectedClass` | `string` | Selected state styles |
|
|
71
|
+
| `listItemDisabledClass` | `string` | Disabled state styles |
|
|
72
|
+
| `listItemReadonlyClass` | `string` | Read-only state styles |
|
|
73
|
+
| `listItemIndentGuideClass` | `string` | Indent guide line styles |
|
|
74
|
+
| `listItemBasePadLeft` | `Record<ComponentSize, number>` | Base left padding per size (rem) |
|
|
75
|
+
| `LIST_ITEM_INDENT_SIZE` | `number` | Indent size per nesting level (1.5 rem) |
|
|
76
|
+
| `listItemContentClass` | `string` | Item content area styles |
|
|
77
|
+
| `getListItemSelectedIconClass` | `(selected: boolean) => string` | Selection icon color |
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
---
|
|
61
80
|
|
|
62
|
-
## Pagination
|
|
81
|
+
## `Pagination`
|
|
63
82
|
|
|
64
|
-
Page navigation
|
|
83
|
+
Page navigation component with first/prev/next/last buttons and page number buttons.
|
|
65
84
|
|
|
66
|
-
```
|
|
67
|
-
interface PaginationProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
85
|
+
```typescript
|
|
86
|
+
export interface PaginationProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
68
87
|
page: number;
|
|
69
88
|
onPageChange?: (page: number) => void;
|
|
70
89
|
totalPageCount: number;
|
|
71
|
-
displayPageCount?: number;
|
|
90
|
+
displayPageCount?: number;
|
|
72
91
|
size?: ComponentSize;
|
|
73
92
|
}
|
|
74
93
|
```
|
|
75
94
|
|
|
76
|
-
|
|
95
|
+
| Prop | Type | Description |
|
|
96
|
+
|------|------|-------------|
|
|
97
|
+
| `page` | `number` | Current page (1-based) |
|
|
98
|
+
| `onPageChange` | `(page: number) => void` | Page change callback |
|
|
99
|
+
| `totalPageCount` | `number` | Total number of pages |
|
|
100
|
+
| `displayPageCount` | `number` | Visible page buttons. Default: `10` |
|
|
101
|
+
| `size` | `ComponentSize` | Button size |
|
|
77
102
|
|
|
78
|
-
|
|
103
|
+
---
|
|
79
104
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
## `DataSheet`
|
|
106
|
+
|
|
107
|
+
Feature-rich data grid with sorting, pagination, selection, tree expansion, column resizing/reordering, fixed columns, and config persistence.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
export interface DataSheetProps<TItem> {
|
|
111
|
+
items?: TItem[];
|
|
85
112
|
storageKey?: string;
|
|
113
|
+
hideConfigBar?: boolean;
|
|
86
114
|
inset?: boolean;
|
|
115
|
+
contentStyle?: JSX.CSSProperties | string;
|
|
116
|
+
sorts?: SortingDef[];
|
|
117
|
+
onSortsChange?: (sorts: SortingDef[]) => void;
|
|
118
|
+
autoSort?: boolean;
|
|
87
119
|
page?: number;
|
|
88
120
|
onPageChange?: (page: number) => void;
|
|
89
121
|
totalPageCount?: number;
|
|
90
|
-
|
|
91
|
-
|
|
122
|
+
pageSize?: number;
|
|
123
|
+
displayPageCount?: number;
|
|
92
124
|
selectionMode?: "single" | "multiple";
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
125
|
+
selection?: TItem[];
|
|
126
|
+
onSelectionChange?: (items: TItem[]) => void;
|
|
127
|
+
autoSelect?: boolean;
|
|
128
|
+
isItemSelectable?: (item: TItem) => boolean | string;
|
|
129
|
+
expandedItems?: TItem[];
|
|
130
|
+
onExpandedItemsChange?: (items: TItem[]) => void;
|
|
131
|
+
itemChildren?: (item: TItem, index: number) => TItem[] | undefined;
|
|
132
|
+
cellClass?: (item: TItem, colKey: string) => string | undefined;
|
|
133
|
+
cellStyle?: (item: TItem, colKey: string) => string | undefined;
|
|
134
|
+
onItemsReorder?: (event: DataSheetReorderEvent<TItem>) => void;
|
|
97
135
|
class?: string;
|
|
98
|
-
style?: JSX.CSSProperties;
|
|
99
136
|
children: JSX.Element;
|
|
100
137
|
}
|
|
101
138
|
```
|
|
102
139
|
|
|
103
|
-
###
|
|
104
|
-
|
|
105
|
-
- **`DataSheet.Column<TItem>`** -- Column definition.
|
|
140
|
+
### `DataSheetColumnProps`
|
|
106
141
|
|
|
107
|
-
```
|
|
108
|
-
interface DataSheetColumnProps<TItem> {
|
|
142
|
+
```typescript
|
|
143
|
+
export interface DataSheetColumnProps<TItem> {
|
|
109
144
|
key: string;
|
|
110
145
|
header?: string | string[];
|
|
111
|
-
|
|
112
|
-
|
|
146
|
+
headerContent?: () => JSX.Element;
|
|
147
|
+
headerStyle?: string;
|
|
148
|
+
summary?: () => JSX.Element;
|
|
149
|
+
tooltip?: string;
|
|
113
150
|
fixed?: boolean;
|
|
114
|
-
|
|
151
|
+
hidden?: boolean;
|
|
152
|
+
collapse?: boolean;
|
|
153
|
+
width?: string;
|
|
154
|
+
class?: string;
|
|
115
155
|
sortable?: boolean;
|
|
116
|
-
sortKey?: string;
|
|
117
156
|
resizable?: boolean;
|
|
118
|
-
summary?: (items: TItem[]) => JSX.Element;
|
|
119
157
|
children: (ctx: DataSheetCellContext<TItem>) => JSX.Element;
|
|
120
158
|
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### `DataSheetCellContext`
|
|
121
162
|
|
|
122
|
-
|
|
163
|
+
```typescript
|
|
164
|
+
export interface DataSheetCellContext<TItem> {
|
|
123
165
|
item: TItem;
|
|
124
166
|
index: number;
|
|
125
167
|
row: number;
|
|
@@ -127,90 +169,174 @@ interface DataSheetCellContext<TItem> {
|
|
|
127
169
|
}
|
|
128
170
|
```
|
|
129
171
|
|
|
130
|
-
###
|
|
172
|
+
### `SortingDef`
|
|
131
173
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
columns: DataSheetConfigColumn[];
|
|
174
|
+
```typescript
|
|
175
|
+
export interface SortingDef {
|
|
176
|
+
key: string;
|
|
177
|
+
desc: boolean;
|
|
137
178
|
}
|
|
179
|
+
```
|
|
138
180
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
181
|
+
### `DataSheetReorderEvent`
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
export interface DataSheetReorderEvent<TItem> {
|
|
185
|
+
item: TItem;
|
|
186
|
+
targetItem: TItem;
|
|
187
|
+
position: DataSheetDragPosition;
|
|
143
188
|
}
|
|
189
|
+
|
|
190
|
+
export type DataSheetDragPosition = "before" | "after" | "inside";
|
|
144
191
|
```
|
|
145
192
|
|
|
146
|
-
###
|
|
193
|
+
### `DataSheetConfig` / `DataSheetConfigColumn`
|
|
147
194
|
|
|
148
|
-
```
|
|
149
|
-
interface
|
|
150
|
-
|
|
151
|
-
desc: boolean;
|
|
195
|
+
```typescript
|
|
196
|
+
export interface DataSheetConfig {
|
|
197
|
+
columnRecord?: Partial<Record<string, DataSheetConfigColumn>>;
|
|
152
198
|
}
|
|
153
199
|
|
|
154
|
-
interface
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
200
|
+
export interface DataSheetConfigColumn {
|
|
201
|
+
fixed?: boolean;
|
|
202
|
+
width?: string;
|
|
203
|
+
displayOrder?: number;
|
|
204
|
+
hidden?: boolean;
|
|
158
205
|
}
|
|
159
206
|
```
|
|
160
207
|
|
|
161
|
-
|
|
208
|
+
### `FlatItem`
|
|
162
209
|
|
|
163
|
-
|
|
210
|
+
```typescript
|
|
211
|
+
export interface FlatItem<TItem> {
|
|
212
|
+
item: TItem;
|
|
213
|
+
index: number;
|
|
214
|
+
row: number;
|
|
215
|
+
depth: number;
|
|
216
|
+
hasChildren: boolean;
|
|
217
|
+
parent?: TItem;
|
|
218
|
+
}
|
|
219
|
+
```
|
|
164
220
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## `DataSheet.styles`
|
|
224
|
+
|
|
225
|
+
Shared style constants for DataSheet rendering. Key exports:
|
|
226
|
+
|
|
227
|
+
| Export | Description |
|
|
228
|
+
|--------|-------------|
|
|
229
|
+
| `dataSheetContainerClass` | Container class |
|
|
230
|
+
| `tableClass` | Table element class |
|
|
231
|
+
| `thClass` / `tdClass` | Header/body cell classes |
|
|
232
|
+
| `summaryThClass` | Summary row header class |
|
|
233
|
+
| `sortableThClass` | Sortable header class |
|
|
234
|
+
| `fixedClass` / `fixedLastClass` | Fixed column classes |
|
|
235
|
+
| `resizerClass` | Column resize handle class |
|
|
236
|
+
| `resizeIndicatorClass` | Resize drag indicator class |
|
|
237
|
+
| `featureThClass` / `featureTdClass` | Feature column classes |
|
|
238
|
+
| `expandToggleClass` | Expand toggle button class |
|
|
239
|
+
| `selectSingleClass` | Single select icon class |
|
|
240
|
+
| `reorderHandleClass` | Drag reorder handle class |
|
|
241
|
+
| `reorderIndicatorClass` | Reorder drag indicator class |
|
|
242
|
+
| `toolbarClass` | Toolbar class |
|
|
243
|
+
| `trRowClass` | Body row class with hover/selected overlays |
|
|
244
|
+
| `configButtonClass` | Settings button class |
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## `Calendar`
|
|
249
|
+
|
|
250
|
+
Monthly calendar grid displaying items by date.
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
export interface CalendarProps<TValue> extends Omit<
|
|
254
|
+
JSX.HTMLAttributes<HTMLTableElement>,
|
|
255
|
+
"children"
|
|
256
|
+
> {
|
|
257
|
+
items: TValue[];
|
|
258
|
+
getItemDate: (item: TValue, index: number) => DateOnly;
|
|
259
|
+
renderItem: (item: TValue, index: number) => JSX.Element;
|
|
260
|
+
yearMonth?: DateOnly;
|
|
261
|
+
onYearMonthChange?: (value: DateOnly) => void;
|
|
262
|
+
weekStartDay?: number;
|
|
263
|
+
minDaysInFirstWeek?: number;
|
|
178
264
|
}
|
|
179
265
|
```
|
|
180
266
|
|
|
181
|
-
|
|
267
|
+
| Prop | Type | Description |
|
|
268
|
+
|------|------|-------------|
|
|
269
|
+
| `items` | `TValue[]` | Data items to display |
|
|
270
|
+
| `getItemDate` | `(item, index) => DateOnly` | Extract date from item |
|
|
271
|
+
| `renderItem` | `(item, index) => JSX.Element` | Render item content |
|
|
272
|
+
| `yearMonth` | `DateOnly` | Displayed month |
|
|
273
|
+
| `onYearMonthChange` | `(value: DateOnly) => void` | Month change callback |
|
|
274
|
+
| `weekStartDay` | `number` | Week start day (0=Sun). Default: `0` |
|
|
275
|
+
| `minDaysInFirstWeek` | `number` | Min days in first week. Default: `1` |
|
|
182
276
|
|
|
183
|
-
|
|
277
|
+
---
|
|
184
278
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
279
|
+
## `Kanban`
|
|
280
|
+
|
|
281
|
+
Drag-and-drop kanban board with lanes, cards, and multi-select support.
|
|
282
|
+
|
|
283
|
+
### Types
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
export interface KanbanCardRef<TLaneValue, TCardValue> {
|
|
287
|
+
value: TCardValue | undefined;
|
|
288
|
+
laneValue: TLaneValue | undefined;
|
|
289
|
+
heightOnDrag: number;
|
|
189
290
|
}
|
|
190
291
|
|
|
191
|
-
interface KanbanDropInfo<TLaneValue, TCardValue> {
|
|
192
|
-
|
|
193
|
-
|
|
292
|
+
export interface KanbanDropInfo<TLaneValue, TCardValue> {
|
|
293
|
+
sourceValue?: TCardValue;
|
|
294
|
+
targetLaneValue?: TLaneValue;
|
|
295
|
+
targetCardValue?: TCardValue;
|
|
296
|
+
position?: "before" | "after";
|
|
194
297
|
}
|
|
195
|
-
```
|
|
196
298
|
|
|
197
|
-
|
|
299
|
+
export interface KanbanDropTarget<TCardValue> {
|
|
300
|
+
element: HTMLElement;
|
|
301
|
+
value: TCardValue | undefined;
|
|
302
|
+
position: "before" | "after";
|
|
303
|
+
}
|
|
198
304
|
|
|
199
|
-
|
|
305
|
+
export interface KanbanCardProps<TCardValue = unknown> {
|
|
306
|
+
value?: TCardValue;
|
|
307
|
+
draggable?: boolean;
|
|
308
|
+
selectable?: boolean;
|
|
309
|
+
contentClass?: string;
|
|
310
|
+
children?: JSX.Element;
|
|
311
|
+
}
|
|
312
|
+
```
|
|
200
313
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
314
|
+
### `KanbanContextValue`
|
|
315
|
+
|
|
316
|
+
```typescript
|
|
317
|
+
export interface KanbanContextValue<TLaneValue, TCardValue> {
|
|
318
|
+
dragCard: Accessor<KanbanCardRef<TLaneValue, TCardValue> | undefined>;
|
|
319
|
+
setDragCard: Setter<KanbanCardRef<TLaneValue, TCardValue> | undefined>;
|
|
320
|
+
onDropTo: (targetLaneValue, targetCardValue, position) => void;
|
|
321
|
+
selectedValues: Accessor<TCardValue[]>;
|
|
322
|
+
setSelectedValues: (updater) => void;
|
|
323
|
+
toggleSelection: (value: TCardValue) => void;
|
|
206
324
|
}
|
|
207
325
|
```
|
|
208
326
|
|
|
209
|
-
|
|
327
|
+
### `KanbanLaneContextValue`
|
|
210
328
|
|
|
211
|
-
```
|
|
212
|
-
interface
|
|
213
|
-
value:
|
|
214
|
-
|
|
329
|
+
```typescript
|
|
330
|
+
export interface KanbanLaneContextValue<TLaneValue, TCardValue> {
|
|
331
|
+
value: Accessor<TLaneValue | undefined>;
|
|
332
|
+
dropTarget: Accessor<KanbanDropTarget<TCardValue> | undefined>;
|
|
333
|
+
setDropTarget: (target) => void;
|
|
334
|
+
registerCard: (id, info) => void;
|
|
335
|
+
unregisterCard: (id) => void;
|
|
215
336
|
}
|
|
216
337
|
```
|
|
338
|
+
|
|
339
|
+
### Hooks
|
|
340
|
+
|
|
341
|
+
- **`useKanbanContext()`** -- Access board-level context
|
|
342
|
+
- **`useKanbanLaneContext()`** -- Access lane-level context
|