@simplysm/solid 13.0.97 → 13.0.99
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 +256 -0
- package/docs/data.md +342 -0
- package/docs/disclosure.md +188 -0
- package/docs/display.md +137 -0
- package/docs/features.md +310 -0
- package/docs/feedback.md +233 -0
- package/docs/form-control.md +620 -0
- package/docs/helpers.md +206 -0
- package/docs/hooks.md +142 -0
- package/docs/layout.md +212 -0
- package/docs/providers.md +197 -0
- package/docs/styles.md +133 -0
- package/package.json +5 -5
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Disclosure Components
|
|
2
|
+
|
|
3
|
+
Source: `src/components/disclosure/**`
|
|
4
|
+
|
|
5
|
+
## `Collapse`
|
|
6
|
+
|
|
7
|
+
Animated collapsible container using CSS margin-top transition.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface CollapseProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
open?: boolean;
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Description |
|
|
16
|
+
|------|------|-------------|
|
|
17
|
+
| `open` | `boolean` | Whether content is visible. Default: `false` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## `Dropdown`
|
|
22
|
+
|
|
23
|
+
Popup dropdown component with trigger/content slot pattern. Supports auto-positioning, keyboard navigation, and context menu mode.
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
export interface DropdownProps {
|
|
27
|
+
position?: { x: number; y: number };
|
|
28
|
+
open?: boolean;
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
maxHeight?: number;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
keyboardNav?: boolean;
|
|
33
|
+
class?: string;
|
|
34
|
+
style?: JSX.CSSProperties;
|
|
35
|
+
children: JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Description |
|
|
40
|
+
|------|------|-------------|
|
|
41
|
+
| `position` | `{ x: number; y: number }` | Absolute position for context menu mode |
|
|
42
|
+
| `open` | `boolean` | Popup open state |
|
|
43
|
+
| `onOpenChange` | `(open: boolean) => void` | Open state change callback |
|
|
44
|
+
| `maxHeight` | `number` | Popup max height in px. Default: `300` |
|
|
45
|
+
| `disabled` | `boolean` | Disable trigger click |
|
|
46
|
+
| `keyboardNav` | `boolean` | Enable ArrowUp/ArrowDown keyboard navigation |
|
|
47
|
+
|
|
48
|
+
### Sub-components
|
|
49
|
+
|
|
50
|
+
- **`Dropdown.Trigger`** -- Trigger element slot (click toggles popup)
|
|
51
|
+
- **`Dropdown.Content`** -- Popup content slot
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## `Dialog`
|
|
56
|
+
|
|
57
|
+
Modal/float dialog with dragging, 8-directional resizing, automatic z-index management, and slot-based header/action areas.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
export interface DialogProps {
|
|
61
|
+
open?: boolean;
|
|
62
|
+
onOpenChange?: (open: boolean) => void;
|
|
63
|
+
withCloseButton?: boolean;
|
|
64
|
+
closeOnInteractOutside?: boolean;
|
|
65
|
+
closeOnEscape?: boolean;
|
|
66
|
+
resizable?: boolean;
|
|
67
|
+
draggable?: boolean;
|
|
68
|
+
mode?: "float" | "fill";
|
|
69
|
+
width?: number;
|
|
70
|
+
height?: number;
|
|
71
|
+
minWidth?: number;
|
|
72
|
+
minHeight?: number;
|
|
73
|
+
position?: "bottom-right" | "top-right";
|
|
74
|
+
headerStyle?: JSX.CSSProperties | string;
|
|
75
|
+
beforeClose?: () => boolean;
|
|
76
|
+
onCloseComplete?: () => void;
|
|
77
|
+
class?: string;
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| Prop | Type | Description |
|
|
82
|
+
|------|------|-------------|
|
|
83
|
+
| `open` | `boolean` | Dialog open state |
|
|
84
|
+
| `onOpenChange` | `(open: boolean) => void` | Open state change callback |
|
|
85
|
+
| `withCloseButton` | `boolean` | Show close button. Default: `true` |
|
|
86
|
+
| `closeOnInteractOutside` | `boolean` | Close on backdrop click. Default: `false` |
|
|
87
|
+
| `closeOnEscape` | `boolean` | Close on ESC key. Default: `true` |
|
|
88
|
+
| `resizable` | `boolean` | Enable 8-directional resizing. Default: `false` |
|
|
89
|
+
| `draggable` | `boolean` | Enable header dragging. Default: `true` |
|
|
90
|
+
| `mode` | `"float" \| "fill"` | Display mode |
|
|
91
|
+
| `width` / `height` | `number` | Initial dimensions in px |
|
|
92
|
+
| `minWidth` / `minHeight` | `number` | Minimum dimensions in px |
|
|
93
|
+
| `position` | `"bottom-right" \| "top-right"` | Absolute position mode |
|
|
94
|
+
| `beforeClose` | `() => boolean` | Close guard (return `false` to cancel) |
|
|
95
|
+
| `onCloseComplete` | `() => void` | Callback after close animation completes |
|
|
96
|
+
|
|
97
|
+
### Sub-components
|
|
98
|
+
|
|
99
|
+
- **`Dialog.Header`** -- Header slot (enables dragging)
|
|
100
|
+
- **`Dialog.Action`** -- Action slot in header area (before close button)
|
|
101
|
+
|
|
102
|
+
### `DialogProvider`
|
|
103
|
+
|
|
104
|
+
Provider for programmatic dialog management via `useDialog().show()`.
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
export interface DialogProviderProps extends DialogDefaults {}
|
|
108
|
+
|
|
109
|
+
export interface DialogDefaults {
|
|
110
|
+
closeOnEscape?: boolean;
|
|
111
|
+
closeOnInteractOutside?: boolean;
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### `useDialog`
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
export function useDialog(): DialogContextValue;
|
|
119
|
+
|
|
120
|
+
export interface DialogContextValue {
|
|
121
|
+
show<P extends Record<string, any>>(
|
|
122
|
+
component: Component<P>,
|
|
123
|
+
props: Omit<P, "close">,
|
|
124
|
+
options?: DialogShowOptions,
|
|
125
|
+
): Promise<ExtractCloseResult<P> | undefined>;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### `DialogShowOptions`
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
export interface DialogShowOptions {
|
|
133
|
+
header?: JSX.Element;
|
|
134
|
+
withCloseButton?: boolean;
|
|
135
|
+
closeOnInteractOutside?: boolean;
|
|
136
|
+
closeOnEscape?: boolean;
|
|
137
|
+
resizable?: boolean;
|
|
138
|
+
draggable?: boolean;
|
|
139
|
+
mode?: "float" | "fill";
|
|
140
|
+
width?: number;
|
|
141
|
+
height?: number;
|
|
142
|
+
minWidth?: number;
|
|
143
|
+
minHeight?: number;
|
|
144
|
+
position?: "bottom-right" | "top-right";
|
|
145
|
+
headerStyle?: JSX.CSSProperties | string;
|
|
146
|
+
beforeClose?: () => boolean;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `DialogDefaultsContext`
|
|
151
|
+
|
|
152
|
+
Context for setting default dialog options across the app.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## `Tabs`
|
|
157
|
+
|
|
158
|
+
Tab bar component with underline indicator and keyboard support.
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
interface TabsProps {
|
|
162
|
+
value?: string;
|
|
163
|
+
onValueChange?: (value: string) => void;
|
|
164
|
+
size?: ComponentSize;
|
|
165
|
+
class?: string;
|
|
166
|
+
style?: JSX.CSSProperties;
|
|
167
|
+
children?: JSX.Element;
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
| Prop | Type | Description |
|
|
172
|
+
|------|------|-------------|
|
|
173
|
+
| `value` | `string` | Currently selected tab value |
|
|
174
|
+
| `onValueChange` | `(value: string) => void` | Tab change callback |
|
|
175
|
+
| `size` | `ComponentSize` | Tab size |
|
|
176
|
+
|
|
177
|
+
### Sub-components
|
|
178
|
+
|
|
179
|
+
- **`Tabs.Tab`** -- Individual tab button
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
interface TabsTabProps {
|
|
183
|
+
value: string;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
class?: string;
|
|
186
|
+
children?: JSX.Element;
|
|
187
|
+
}
|
|
188
|
+
```
|
package/docs/display.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Display Components
|
|
2
|
+
|
|
3
|
+
Source: `src/components/display/**`
|
|
4
|
+
|
|
5
|
+
## `Barcode`
|
|
6
|
+
|
|
7
|
+
SVG barcode renderer using bwip-js. Supports 100+ barcode formats.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface BarcodeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
type: BarcodeType;
|
|
12
|
+
value?: string;
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Description |
|
|
17
|
+
|------|------|-------------|
|
|
18
|
+
| `type` | `BarcodeType` | Barcode format (e.g., `"qrcode"`, `"code128"`, `"ean13"`) |
|
|
19
|
+
| `value` | `string` | Data to encode |
|
|
20
|
+
|
|
21
|
+
### `BarcodeType`
|
|
22
|
+
|
|
23
|
+
Union of 100+ barcode format strings including `"qrcode"`, `"code128"`, `"ean13"`, `"datamatrix"`, `"pdf417"`, `"azteccode"`, etc.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## `Card`
|
|
28
|
+
|
|
29
|
+
Surface container with shadow, hover effects, and fade-in animation.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
export interface CardProps extends JSX.HTMLAttributes<HTMLDivElement> {}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## `Echarts`
|
|
38
|
+
|
|
39
|
+
Apache ECharts wrapper with auto-resize and loading state support.
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
export interface EchartsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
option: echarts.EChartsOption;
|
|
44
|
+
busy?: boolean;
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Description |
|
|
49
|
+
|------|------|-------------|
|
|
50
|
+
| `option` | `echarts.EChartsOption` | ECharts configuration object |
|
|
51
|
+
| `busy` | `boolean` | Show loading overlay |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## `Icon`
|
|
56
|
+
|
|
57
|
+
Wrapper for Tabler Icons with consistent sizing and vertical alignment.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
export interface IconProps extends Omit<TablerIconProps, "size"> {
|
|
61
|
+
icon: Component<TablerIconProps>;
|
|
62
|
+
size?: string | number;
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Description |
|
|
67
|
+
|------|------|-------------|
|
|
68
|
+
| `icon` | `Component<TablerIconProps>` | Tabler icon component |
|
|
69
|
+
| `size` | `string \| number` | Icon size. Default: `"1.25em"` |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## `Tag`
|
|
74
|
+
|
|
75
|
+
Inline badge/tag with semantic theme colors.
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
export interface TagProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
79
|
+
theme?: TagTheme;
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Prop | Type | Description |
|
|
84
|
+
|------|------|-------------|
|
|
85
|
+
| `theme` | `SemanticTheme` | Color theme. Default: `"base"` |
|
|
86
|
+
|
|
87
|
+
### `TagTheme`
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
export type TagTheme = SemanticTheme;
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## `Link`
|
|
96
|
+
|
|
97
|
+
Styled anchor element with theme colors and disabled state.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
export interface LinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
101
|
+
theme?: LinkTheme;
|
|
102
|
+
disabled?: boolean;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Prop | Type | Description |
|
|
107
|
+
|------|------|-------------|
|
|
108
|
+
| `theme` | `SemanticTheme` | Color theme. Default: `"primary"` |
|
|
109
|
+
| `disabled` | `boolean` | Disabled state |
|
|
110
|
+
|
|
111
|
+
### `LinkTheme`
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
export type LinkTheme = SemanticTheme;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## `Alert`
|
|
120
|
+
|
|
121
|
+
Block-level alert container with semantic theme background.
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
export interface AlertProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
125
|
+
theme?: AlertTheme;
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| Prop | Type | Description |
|
|
130
|
+
|------|------|-------------|
|
|
131
|
+
| `theme` | `SemanticTheme` | Color theme. Default: `"base"` |
|
|
132
|
+
|
|
133
|
+
### `AlertTheme`
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
export type AlertTheme = SemanticTheme;
|
|
137
|
+
```
|
package/docs/features.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
# Feature Components
|
|
2
|
+
|
|
3
|
+
Source: `src/components/features/**`
|
|
4
|
+
|
|
5
|
+
## `AddressSearchContent`
|
|
6
|
+
|
|
7
|
+
Korean address search dialog content using Daum Postcode API.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface AddressSearchResult {
|
|
11
|
+
postNumber: string | undefined;
|
|
12
|
+
address: string | undefined;
|
|
13
|
+
buildingName: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Props: `{ close?: (result?: AddressSearchResult) => void }`
|
|
18
|
+
|
|
19
|
+
Designed to be used with `useDialog().show()`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## `SharedDataSelect`
|
|
24
|
+
|
|
25
|
+
Select component integrated with `SharedDataAccessor` for reactive shared data selection. Supports single and multiple modes with search, tree structure, and dialog selection.
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Description |
|
|
28
|
+
|------|------|-------------|
|
|
29
|
+
| `data` | `SharedDataAccessor<TItem>` | Shared data accessor |
|
|
30
|
+
| `value` | `TKey \| TKey[]` | Selected key(s) |
|
|
31
|
+
| `onValueChange` | `(value) => void` | Value change callback |
|
|
32
|
+
| `multiple` | `boolean` | Multiple selection mode |
|
|
33
|
+
| `required` | `boolean` | Required input |
|
|
34
|
+
| `disabled` | `boolean` | Disabled state |
|
|
35
|
+
| `size` | `ComponentSize` | Trigger size |
|
|
36
|
+
| `inset` | `boolean` | Borderless style |
|
|
37
|
+
| `filterFn` | `(item, index) => boolean` | Item filter function |
|
|
38
|
+
| `dialog` | `Component<TDialogProps>` | Selection dialog component |
|
|
39
|
+
| `dialogOptions` | `DialogShowOptions` | Dialog display options |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## `SharedDataSelectButton`
|
|
44
|
+
|
|
45
|
+
Button-based select component for shared data. Opens a dialog for selection. Supports single and multiple modes.
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Description |
|
|
48
|
+
|------|------|-------------|
|
|
49
|
+
| `data` | `SharedDataAccessor<TItem>` | Shared data accessor |
|
|
50
|
+
| `value` | `string \| number \| (string \| number)[]` | Selected key(s) |
|
|
51
|
+
| `onValueChange` | `(value) => void` | Value change callback |
|
|
52
|
+
| `multiple` | `boolean` | Multiple selection mode |
|
|
53
|
+
| `required` | `boolean` | Required input |
|
|
54
|
+
| `disabled` | `boolean` | Disabled state |
|
|
55
|
+
| `size` | `ComponentSize` | Trigger size |
|
|
56
|
+
| `inset` | `boolean` | Borderless style |
|
|
57
|
+
| `dialog` | `Component<TDialogProps>` | Selection dialog component (required) |
|
|
58
|
+
| `dialogOptions` | `DialogShowOptions` | Dialog display options |
|
|
59
|
+
| `children` | `(item: TItem) => JSX.Element` | Item rendering function |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## `SharedDataSelectList`
|
|
64
|
+
|
|
65
|
+
List-based selection component for shared data with pagination and search.
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
export interface SharedDataSelectListProps<TItem> {
|
|
69
|
+
data: SharedDataAccessor<TItem>;
|
|
70
|
+
value?: TItem;
|
|
71
|
+
onValueChange?: (value: TItem | undefined) => void;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
filterFn?: (item: TItem, index: number) => boolean;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Sub-components
|
|
79
|
+
|
|
80
|
+
- **`SharedDataSelectList.ItemTemplate`** -- Template for item rendering
|
|
81
|
+
- **`SharedDataSelectList.Filter`** -- Custom filter UI slot
|
|
82
|
+
|
|
83
|
+
### `SharedDataSelectListContextValue`
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
export interface SharedDataSelectListContextValue {
|
|
87
|
+
setItemTemplate: (fn: ((...args: unknown[]) => JSX.Element) | undefined) => void;
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## `DataSelectButton`
|
|
94
|
+
|
|
95
|
+
Generic button-based select component that opens a dialog for selection. Works with any data source (not tied to SharedData).
|
|
96
|
+
|
|
97
|
+
### `SelectDialogBaseProps`
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
export interface SelectDialogBaseProps<TKey = string | number> {
|
|
101
|
+
close?: (result?: DataSelectDialogResult<TKey>) => void;
|
|
102
|
+
selectionMode: "single" | "multiple";
|
|
103
|
+
selectedKeys: TKey[];
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### `DataSelectDialogResult`
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
export interface DataSelectDialogResult<TKey> {
|
|
111
|
+
selectedKeys: TKey[];
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### `DialogPropsField`
|
|
116
|
+
|
|
117
|
+
Conditional type that makes `dialogProps` required only when the dialog component has required custom props.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
export type DialogPropsField<P, TKey = string | number> =
|
|
121
|
+
{} extends UserDialogProps<P, TKey>
|
|
122
|
+
? { dialogProps?: UserDialogProps<P, TKey> }
|
|
123
|
+
: { dialogProps: UserDialogProps<P, TKey> };
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## `CrudSheet`
|
|
129
|
+
|
|
130
|
+
Full-featured CRUD data grid with inline/dialog editing, sorting, pagination, selection, excel import/export, and toolbar management.
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
export type CrudSheetProps<TItem, TFilter extends Record<string, unknown>> =
|
|
134
|
+
CrudSheetBaseProps<TItem, TFilter> & (
|
|
135
|
+
| { inlineEdit: InlineEditConfig<TItem>; dialogEdit?: never }
|
|
136
|
+
| { dialogEdit: DialogEditConfig<TItem>; inlineEdit?: never }
|
|
137
|
+
| { inlineEdit?: never; dialogEdit?: never }
|
|
138
|
+
);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
| Prop | Type | Description |
|
|
142
|
+
|------|------|-------------|
|
|
143
|
+
| `search` | `(filter, page, sorts) => Promise<SearchResult<TItem>>` | Data fetch function |
|
|
144
|
+
| `getItemKey` | `(item) => string \| number \| undefined` | Item key extractor |
|
|
145
|
+
| `storageKey` | `string` | Config persistence key |
|
|
146
|
+
| `editable` | `boolean` | Enable editing |
|
|
147
|
+
| `inlineEdit` | `InlineEditConfig<TItem>` | Inline editing configuration |
|
|
148
|
+
| `dialogEdit` | `DialogEditConfig<TItem>` | Dialog editing configuration |
|
|
149
|
+
| `excel` | `ExcelConfig<TItem>` | Excel download/upload |
|
|
150
|
+
| `selectionMode` | `"single" \| "multiple"` | Selection mode |
|
|
151
|
+
| `filterInitial` | `TFilter` | Initial filter state |
|
|
152
|
+
|
|
153
|
+
### `SearchResult`
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
export interface SearchResult<TItem> {
|
|
157
|
+
items: TItem[];
|
|
158
|
+
pageCount?: number;
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `InlineEditConfig`
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
export interface InlineEditConfig<TItem> {
|
|
166
|
+
submit: (diffs: ArrayOneWayDiffResult<TItem>[]) => Promise<void>;
|
|
167
|
+
newItem: () => TItem;
|
|
168
|
+
deleteProp?: keyof TItem & string;
|
|
169
|
+
diffsExcludes?: string[];
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### `DialogEditConfig`
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
export interface DialogEditConfig<TItem> {
|
|
177
|
+
editItem: (item?: TItem) => Promise<boolean | undefined>;
|
|
178
|
+
deleteItems?: (items: TItem[]) => Promise<boolean>;
|
|
179
|
+
restoreItems?: (items: TItem[]) => Promise<boolean>;
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `ExcelConfig`
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
export interface ExcelConfig<TItem> {
|
|
187
|
+
download: (items: TItem[]) => Promise<void>;
|
|
188
|
+
upload?: (file: File) => Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### `CrudSheetCellContext`
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
export interface CrudSheetCellContext<TItem> {
|
|
196
|
+
item: TItem;
|
|
197
|
+
index: number;
|
|
198
|
+
row: number;
|
|
199
|
+
depth: number;
|
|
200
|
+
setItem: <TKey extends keyof TItem>(key: TKey, value: TItem[TKey]) => void;
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### `CrudSheetContext`
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
export interface CrudSheetContext<TItem> {
|
|
208
|
+
items(): TItem[];
|
|
209
|
+
selection(): TItem[];
|
|
210
|
+
page(): number;
|
|
211
|
+
sorts(): SortingDef[];
|
|
212
|
+
busy(): boolean;
|
|
213
|
+
hasChanges(): boolean;
|
|
214
|
+
save(): Promise<void>;
|
|
215
|
+
refresh(): Promise<void>;
|
|
216
|
+
addItem(): void;
|
|
217
|
+
clearSelection(): void;
|
|
218
|
+
setPage(page: number): void;
|
|
219
|
+
setSorts(sorts: SortingDef[]): void;
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### `SelectResult`
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
export interface SelectResult<TItem> {
|
|
227
|
+
items: TItem[];
|
|
228
|
+
keys: (string | number)[];
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### `CrudSheetColumnProps`
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
export interface CrudSheetColumnProps<TItem> extends Omit<DataSheetColumnProps<TItem>, "children"> {
|
|
236
|
+
editTrigger?: boolean;
|
|
237
|
+
children: (ctx: CrudSheetCellContext<TItem>) => JSX.Element;
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## `CrudDetail`
|
|
244
|
+
|
|
245
|
+
CRUD detail view with controlled store, save/refresh lifecycle, and delete toggle.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
export interface CrudDetailProps<TData extends object> {
|
|
249
|
+
load: () => Promise<{ data: TData; info: CrudDetailInfo }>;
|
|
250
|
+
children: (ctx: CrudDetailContext<TData>) => JSX.Element;
|
|
251
|
+
submit?: (data: TData) => Promise<boolean | undefined>;
|
|
252
|
+
toggleDelete?: (del: boolean) => Promise<boolean | undefined>;
|
|
253
|
+
editable?: boolean;
|
|
254
|
+
deletable?: boolean;
|
|
255
|
+
data?: TData;
|
|
256
|
+
onDataChange?: (data: TData) => void;
|
|
257
|
+
close?: (result?: boolean) => void;
|
|
258
|
+
class?: string;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### `CrudDetailInfo`
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
export interface CrudDetailInfo {
|
|
266
|
+
isNew: boolean;
|
|
267
|
+
isDeleted: boolean;
|
|
268
|
+
lastModifiedAt?: DateTime;
|
|
269
|
+
lastModifiedBy?: string;
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `CrudDetailContext`
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
export interface CrudDetailContext<TData> {
|
|
277
|
+
data: TData;
|
|
278
|
+
setData: SetStoreFunction<TData>;
|
|
279
|
+
info: () => CrudDetailInfo;
|
|
280
|
+
busy: () => boolean;
|
|
281
|
+
hasChanges: () => boolean;
|
|
282
|
+
save: () => Promise<void>;
|
|
283
|
+
refresh: () => Promise<void>;
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## `PermissionTable`
|
|
290
|
+
|
|
291
|
+
Permission management table displaying a tree of `AppPerm` items with checkbox columns for each permission type.
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
export interface PermissionTableProps<TModule = string> {
|
|
295
|
+
items?: AppPerm<TModule>[];
|
|
296
|
+
value?: Record<string, boolean>;
|
|
297
|
+
onValueChange?: (value: Record<string, boolean>) => void;
|
|
298
|
+
modules?: TModule[];
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
class?: string;
|
|
301
|
+
style?: JSX.CSSProperties;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Utility Functions
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
export function collectAllPerms<TModule>(items: AppPerm<TModule>[]): string[];
|
|
309
|
+
export function filterByModules<TModule>(items: AppPerm<TModule>[], modules: TModule[]): AppPerm<TModule>[];
|
|
310
|
+
```
|