@simplysm/solid 13.0.84 → 13.0.86
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 +143 -28
- package/dist/components/data/list/ListItem.d.ts.map +1 -1
- package/dist/components/data/list/ListItem.js +11 -4
- package/dist/components/data/list/ListItem.js.map +2 -2
- package/dist/components/data/list/ListItem.styles.d.ts +2 -0
- package/dist/components/data/list/ListItem.styles.d.ts.map +1 -1
- package/dist/components/data/list/ListItem.styles.js +11 -1
- package/dist/components/data/list/ListItem.styles.js.map +1 -1
- package/dist/components/data/sheet/DataSheet.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.js +6 -9
- package/dist/components/data/sheet/DataSheet.js.map +2 -2
- package/dist/components/data/sheet/hooks/createDataSheetExpansion.d.ts.map +1 -1
- package/dist/components/data/sheet/hooks/createDataSheetExpansion.js +15 -17
- package/dist/components/data/sheet/hooks/createDataSheetExpansion.js.map +1 -1
- package/dist/components/data/sheet/hooks/createDataSheetReorder.d.ts.map +1 -1
- package/dist/components/data/sheet/hooks/createDataSheetReorder.js +12 -12
- package/dist/components/data/sheet/hooks/createDataSheetReorder.js.map +1 -1
- package/dist/components/data/sheet/hooks/createDataSheetSelection.d.ts.map +1 -1
- package/dist/components/data/sheet/hooks/createDataSheetSelection.js +9 -3
- package/dist/components/data/sheet/hooks/createDataSheetSelection.js.map +1 -1
- package/dist/components/disclosure/Dialog.d.ts.map +1 -1
- package/dist/components/disclosure/Dialog.js +3 -21
- package/dist/components/disclosure/Dialog.js.map +2 -2
- package/dist/components/disclosure/Dropdown.d.ts.map +1 -1
- package/dist/components/disclosure/Dropdown.js +1 -11
- package/dist/components/disclosure/Dropdown.js.map +2 -2
- package/dist/components/disclosure/Tabs.d.ts.map +1 -1
- package/dist/components/disclosure/Tabs.js +1 -3
- package/dist/components/disclosure/Tabs.js.map +2 -2
- package/dist/components/features/crud-detail/CrudDetail.js +103 -102
- package/dist/components/features/crud-detail/CrudDetail.js.map +2 -2
- package/dist/components/features/crud-sheet/CrudSheet.d.ts.map +1 -1
- package/dist/components/features/crud-sheet/CrudSheet.js +10 -5
- package/dist/components/features/crud-sheet/CrudSheet.js.map +2 -2
- package/dist/components/features/data-select-button/DataSelectButton.d.ts.map +1 -1
- package/dist/components/features/data-select-button/DataSelectButton.js +30 -26
- package/dist/components/features/data-select-button/DataSelectButton.js.map +2 -2
- package/dist/components/features/permission-table/PermissionTable.js +5 -1
- package/dist/components/features/permission-table/PermissionTable.js.map +2 -2
- package/dist/components/feedback/busy/BusyContainer.d.ts.map +1 -1
- package/dist/components/feedback/busy/BusyContainer.js +1 -6
- package/dist/components/feedback/busy/BusyContainer.js.map +2 -2
- package/dist/components/form-control/DropdownTrigger.styles.js +1 -1
- package/dist/components/form-control/checkbox/SelectableBase.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/SelectableBase.js +2 -4
- package/dist/components/form-control/checkbox/SelectableBase.js.map +2 -2
- package/dist/components/form-control/combobox/Combobox.d.ts +19 -5
- package/dist/components/form-control/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/form-control/combobox/Combobox.js +2 -4
- package/dist/components/form-control/combobox/Combobox.js.map +1 -1
- package/dist/components/form-control/date-range-picker/DateRangePicker.d.ts +2 -2
- package/dist/components/form-control/date-range-picker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/form-control/date-range-picker/DateRangePicker.js +11 -3
- package/dist/components/form-control/date-range-picker/DateRangePicker.js.map +2 -2
- package/dist/components/form-control/editor/RichTextEditor.d.ts +2 -2
- package/dist/components/form-control/editor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/form-control/editor/RichTextEditor.js +2 -4
- package/dist/components/form-control/editor/RichTextEditor.js.map +2 -2
- package/dist/components/form-control/field/DatePicker.d.ts +2 -2
- package/dist/components/form-control/field/DatePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DatePicker.js.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.d.ts +2 -2
- package/dist/components/form-control/field/DateTimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.js.map +1 -1
- package/dist/components/form-control/field/Field.styles.d.ts +6 -7
- package/dist/components/form-control/field/Field.styles.d.ts.map +1 -1
- package/dist/components/form-control/field/Field.styles.js.map +1 -1
- package/dist/components/form-control/field/NumberInput.d.ts +2 -2
- package/dist/components/form-control/field/NumberInput.d.ts.map +1 -1
- package/dist/components/form-control/field/NumberInput.js +7 -7
- package/dist/components/form-control/field/NumberInput.js.map +2 -2
- package/dist/components/form-control/field/TextInput.d.ts +2 -2
- package/dist/components/form-control/field/TextInput.d.ts.map +1 -1
- package/dist/components/form-control/field/TextInput.js.map +1 -1
- package/dist/components/form-control/field/Textarea.d.ts +2 -2
- package/dist/components/form-control/field/Textarea.d.ts.map +1 -1
- package/dist/components/form-control/field/Textarea.js +1 -3
- package/dist/components/form-control/field/Textarea.js.map +2 -2
- package/dist/components/form-control/field/TimePicker.d.ts +2 -2
- package/dist/components/form-control/field/TimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/TimePicker.js.map +1 -1
- package/dist/components/form-control/numpad/Numpad.d.ts.map +1 -1
- package/dist/components/form-control/numpad/Numpad.js +4 -17
- package/dist/components/form-control/numpad/Numpad.js.map +2 -2
- package/dist/components/form-control/select/Select.d.ts +2 -0
- package/dist/components/form-control/select/Select.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.js +29 -15
- package/dist/components/form-control/select/Select.js.map +2 -2
- package/dist/components/form-control/state-preset/StatePreset.d.ts +1 -3
- package/dist/components/form-control/state-preset/StatePreset.d.ts.map +1 -1
- package/dist/components/form-control/state-preset/StatePreset.js +69 -95
- package/dist/components/form-control/state-preset/StatePreset.js.map +2 -2
- package/dist/components/layout/FormGroup.js +1 -1
- package/dist/components/layout/FormGroup.js.map +1 -1
- package/dist/components/layout/FormTable.js +3 -3
- package/dist/components/layout/FormTable.js.map +1 -1
- package/dist/components/layout/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/layout/sidebar/Sidebar.js +3 -6
- package/dist/components/layout/sidebar/Sidebar.js.map +2 -2
- package/dist/components/layout/topbar/Topbar.js +1 -3
- package/dist/components/layout/topbar/Topbar.js.map +2 -2
- package/dist/hooks/createControllableStore.d.ts.map +1 -1
- package/dist/hooks/createControllableStore.js +8 -5
- package/dist/hooks/createControllableStore.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts.map +1 -1
- package/dist/hooks/useLocalStorage.js +3 -2
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/useSyncConfig.d.ts.map +1 -1
- package/dist/hooks/useSyncConfig.js +5 -4
- package/dist/hooks/useSyncConfig.js.map +1 -1
- package/dist/providers/i18n/locales/en.d.ts +2 -3
- package/dist/providers/i18n/locales/en.d.ts.map +1 -1
- package/dist/providers/i18n/locales/en.js +3 -4
- package/dist/providers/i18n/locales/en.js.map +1 -1
- package/dist/providers/i18n/locales/ko.d.ts +2 -3
- package/dist/providers/i18n/locales/ko.d.ts.map +1 -1
- package/dist/providers/i18n/locales/ko.js +3 -4
- package/dist/providers/i18n/locales/ko.js.map +1 -1
- package/dist/providers/shared-data/SharedDataProvider.d.ts.map +1 -1
- package/dist/providers/shared-data/SharedDataProvider.js +0 -1
- package/dist/providers/shared-data/SharedDataProvider.js.map +1 -1
- package/docs/display-feedback.md +279 -0
- package/docs/features.md +357 -213
- package/docs/form-controls.md +261 -403
- package/docs/layout-data.md +386 -0
- package/docs/providers-hooks.md +411 -0
- package/package.json +5 -5
- package/src/components/data/list/ListItem.styles.ts +14 -2
- package/src/components/data/list/ListItem.tsx +13 -4
- package/src/components/data/sheet/DataSheet.tsx +6 -10
- package/src/components/data/sheet/hooks/createDataSheetExpansion.ts +17 -18
- package/src/components/data/sheet/hooks/createDataSheetReorder.ts +12 -13
- package/src/components/data/sheet/hooks/createDataSheetSelection.ts +9 -3
- package/src/components/disclosure/Dialog.tsx +45 -59
- package/src/components/disclosure/Dropdown.tsx +4 -14
- package/src/components/disclosure/Tabs.tsx +12 -17
- package/src/components/features/crud-detail/CrudDetail.tsx +4 -4
- package/src/components/features/crud-sheet/CrudSheet.tsx +12 -5
- package/src/components/features/data-select-button/DataSelectButton.tsx +39 -32
- package/src/components/features/permission-table/PermissionTable.tsx +1 -1
- package/src/components/feedback/busy/BusyContainer.tsx +12 -18
- package/src/components/form-control/DropdownTrigger.styles.ts +1 -1
- package/src/components/form-control/checkbox/SelectableBase.tsx +10 -16
- package/src/components/form-control/combobox/Combobox.tsx +42 -16
- package/src/components/form-control/date-range-picker/DateRangePicker.tsx +7 -8
- package/src/components/form-control/editor/RichTextEditor.tsx +14 -16
- package/src/components/form-control/field/DatePicker.tsx +3 -2
- package/src/components/form-control/field/DateTimePicker.tsx +3 -2
- package/src/components/form-control/field/Field.styles.ts +6 -8
- package/src/components/form-control/field/NumberInput.tsx +9 -10
- package/src/components/form-control/field/TextInput.tsx +3 -2
- package/src/components/form-control/field/Textarea.tsx +14 -12
- package/src/components/form-control/field/TimePicker.tsx +3 -2
- package/src/components/form-control/numpad/Numpad.tsx +16 -18
- package/src/components/form-control/select/Select.tsx +41 -13
- package/src/components/form-control/state-preset/StatePreset.tsx +39 -71
- package/src/components/layout/FormGroup.tsx +1 -1
- package/src/components/layout/FormTable.tsx +3 -3
- package/src/components/layout/sidebar/Sidebar.tsx +2 -3
- package/src/components/layout/topbar/Topbar.tsx +2 -2
- package/src/hooks/createControllableStore.ts +8 -4
- package/src/hooks/useLocalStorage.ts +3 -2
- package/src/hooks/useSyncConfig.ts +5 -4
- package/src/providers/i18n/locales/en.ts +2 -3
- package/src/providers/i18n/locales/ko.ts +2 -3
- package/src/providers/shared-data/SharedDataProvider.tsx +0 -1
- package/tests/components/features/crud-detail/CrudDetail.spec.tsx +49 -0
- package/tests/components/features/data-select-button/DataSelectButton.spec.tsx +62 -7
- package/tests/components/form-control/combobox/Combobox.spec.tsx +3 -3
- package/tests/components/form-control/date-range-picker/DateRangePicker.spec.tsx +56 -0
- package/tests/components/form-control/select/SelectItem.spec.tsx +5 -0
- package/tests/providers/shared-data/SharedDataProvider.spec.tsx +0 -104
- package/docs/data.md +0 -204
- package/docs/disclosure.md +0 -146
- package/docs/display.md +0 -125
- package/docs/feedback.md +0 -156
- package/docs/helpers.md +0 -173
- package/docs/hooks.md +0 -146
- package/docs/layout.md +0 -94
- package/docs/providers.md +0 -180
package/docs/display.md
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# Display
|
|
2
|
-
|
|
3
|
-
## Card
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
interface CardProps extends JSX.HTMLAttributes<HTMLDivElement> {}
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Simple card container with default border and background styling.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Icon
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
interface IconProps extends Omit<TablerIconProps, "size"> {
|
|
17
|
-
icon: Component<TablerIconProps>;
|
|
18
|
-
size?: string | number;
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Renders a Tabler icon. Pass the icon component via the `icon` prop.
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { Icon } from "@simplysm/solid";
|
|
26
|
-
import { IconUser } from "@tabler/icons-solidjs";
|
|
27
|
-
|
|
28
|
-
<Icon icon={IconUser} size={24} />
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Tag
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
interface TagProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
37
|
-
theme?: "base" | "primary" | "info" | "success" | "warning" | "danger";
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Inline badge/tag with semantic theming.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Link
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
interface LinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
49
|
-
theme?: "base" | "primary" | "info" | "success" | "warning" | "danger";
|
|
50
|
-
disabled?: boolean;
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Styled anchor link with theme and disabled state.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Alert
|
|
59
|
-
|
|
60
|
-
```typescript
|
|
61
|
-
interface AlertProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
62
|
-
theme?: "base" | "primary" | "info" | "success" | "warning" | "danger";
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Alert banner with semantic theming.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Barcode
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
interface BarcodeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
74
|
-
type: BarcodeType;
|
|
75
|
-
value?: string;
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Renders barcodes and QR codes using bwip-js. `type` supports 111+ barcode formats including `"qrcode"`, `"code128"`, `"ean13"`, `"datamatrix"`, etc.
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Echarts
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
interface EchartsProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
87
|
-
option: echarts.EChartsOption;
|
|
88
|
-
busy?: boolean;
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Apache ECharts wrapper. Requires `echarts` as a peer dependency. Set `busy` to show a loading overlay.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Progress
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
100
|
-
value: number;
|
|
101
|
-
theme?: "base" | "primary" | "info" | "success" | "warning" | "danger";
|
|
102
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
103
|
-
inset?: boolean;
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Progress bar. `value` is in the range 0--100 (0 = 0%, 100 = 100%). Pass `children` to display custom content instead of the default percentage text.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Usage Examples
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
import { Card, Tag, Alert, Progress, Icon } from "@simplysm/solid";
|
|
115
|
-
import { IconCheck } from "@tabler/icons-solidjs";
|
|
116
|
-
|
|
117
|
-
<Card>
|
|
118
|
-
<Tag theme="success">Active</Tag>
|
|
119
|
-
<Progress value={75} theme="primary" />
|
|
120
|
-
</Card>
|
|
121
|
-
|
|
122
|
-
<Alert theme="warning">
|
|
123
|
-
<Icon icon={IconCheck} /> Operation completed with warnings.
|
|
124
|
-
</Alert>
|
|
125
|
-
```
|
package/docs/feedback.md
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# Feedback
|
|
2
|
-
|
|
3
|
-
## Notification System
|
|
4
|
-
|
|
5
|
-
### NotificationProvider / useNotification
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
type NotificationTheme = "info" | "success" | "warning" | "danger";
|
|
9
|
-
|
|
10
|
-
interface NotificationAction {
|
|
11
|
-
label: string;
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface NotificationOptions {
|
|
16
|
-
action?: NotificationAction;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
interface NotificationUpdateOptions {
|
|
20
|
-
renotify?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface NotificationContextValue {
|
|
24
|
-
items: Accessor<NotificationItem[]>;
|
|
25
|
-
unreadCount: Accessor<number>;
|
|
26
|
-
latestUnread: Accessor<NotificationItem | undefined>;
|
|
27
|
-
|
|
28
|
-
info(title: string, message?: string, options?: NotificationOptions): string;
|
|
29
|
-
success(title: string, message?: string, options?: NotificationOptions): string;
|
|
30
|
-
warning(title: string, message?: string, options?: NotificationOptions): string;
|
|
31
|
-
danger(title: string, message?: string, options?: NotificationOptions): string;
|
|
32
|
-
error(err?: any, header?: string): void;
|
|
33
|
-
|
|
34
|
-
update(id: string, updates: Partial<NotificationItem>, options?: NotificationUpdateOptions): void;
|
|
35
|
-
remove(id: string): void;
|
|
36
|
-
markAsRead(id: string): void;
|
|
37
|
-
markAllAsRead(): void;
|
|
38
|
-
dismissBanner(): void;
|
|
39
|
-
clear(): void;
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Centralized notification management. Each `info`/`success`/`warning`/`danger` call creates a notification and returns its `id`. Use `error(err)` to display an error object as a danger notification. Maintains up to 50 notifications; older items are removed when exceeded.
|
|
44
|
-
|
|
45
|
-
Notifications can include an `action` button via the `options` parameter.
|
|
46
|
-
|
|
47
|
-
### NotificationBell
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
interface NotificationBellProps {
|
|
51
|
-
showBanner?: boolean;
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Bell icon button showing unread notification count. Set `showBanner` to display the latest notification as a banner.
|
|
56
|
-
|
|
57
|
-
### NotificationBanner
|
|
58
|
-
|
|
59
|
-
Displays the latest unread notification as a dismissible banner. No props.
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## Busy Overlay
|
|
64
|
-
|
|
65
|
-
### BusyProvider / useBusy
|
|
66
|
-
|
|
67
|
-
```typescript
|
|
68
|
-
type BusyVariant = "spinner" | "bar";
|
|
69
|
-
|
|
70
|
-
interface BusyContextValue {
|
|
71
|
-
variant: Accessor<BusyVariant>;
|
|
72
|
-
show(message?: string): void;
|
|
73
|
-
hide(): void;
|
|
74
|
-
setProgress(percent: number | undefined): void;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
interface BusyProviderProps {
|
|
78
|
-
variant?: BusyVariant;
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Full-screen loading overlay with nestable `show`/`hide` calls (managed with an internal counter). Each `show` must have a matching `hide`.
|
|
83
|
-
|
|
84
|
-
- `variant="spinner"` -- centered spinner (default)
|
|
85
|
-
- `variant="bar"` -- top progress bar animation
|
|
86
|
-
- `setProgress(percent)` -- display a determinate progress bar (0--100, `undefined` for indeterminate)
|
|
87
|
-
|
|
88
|
-
### BusyContainer
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
interface BusyContainerProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
92
|
-
busy?: boolean;
|
|
93
|
-
ready?: boolean;
|
|
94
|
-
variant?: BusyVariant;
|
|
95
|
-
message?: string;
|
|
96
|
-
progressPercent?: number;
|
|
97
|
-
children?: JSX.Element;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Local loading overlay for a specific container. Two modes:
|
|
102
|
-
- `busy` -- shows overlay while preserving children
|
|
103
|
-
- `ready={false}` -- hides children entirely until data is loaded
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Print System
|
|
108
|
-
|
|
109
|
-
### PrintProvider / usePrint
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
interface PrintContextValue {
|
|
113
|
-
toPrinter(factory: () => JSX.Element, options?: PrintOptions): Promise<void>;
|
|
114
|
-
toPdf(factory: () => JSX.Element, options?: PrintOptions): Promise<Uint8Array>;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
interface PrintOptions {
|
|
118
|
-
size?: string;
|
|
119
|
-
margin?: string;
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
Print and PDF generation. `toPrinter` opens the browser print dialog. `toPdf` generates a PDF as a byte array.
|
|
124
|
-
|
|
125
|
-
### Print
|
|
126
|
-
|
|
127
|
-
Component used inside the print factory to signal readiness via `usePrintInstance().ready()`.
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Usage Examples
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
import { useNotification, useBusy, BusyContainer } from "@simplysm/solid";
|
|
135
|
-
|
|
136
|
-
// Notifications
|
|
137
|
-
const notification = useNotification();
|
|
138
|
-
notification.success("Saved", "Record updated successfully");
|
|
139
|
-
notification.error(new Error("Connection failed"));
|
|
140
|
-
|
|
141
|
-
// Notification with action button
|
|
142
|
-
notification.info("Update available", "A new version is ready", {
|
|
143
|
-
action: { label: "Refresh", onClick: () => location.reload() },
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// Global loading
|
|
147
|
-
const busy = useBusy();
|
|
148
|
-
busy.show("Loading data...");
|
|
149
|
-
try { await fetchData(); }
|
|
150
|
-
finally { busy.hide(); }
|
|
151
|
-
|
|
152
|
-
// Local loading container
|
|
153
|
-
<BusyContainer busy={isLoading()} variant="spinner">
|
|
154
|
-
<DataContent />
|
|
155
|
-
</BusyContainer>
|
|
156
|
-
```
|
package/docs/helpers.md
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# Helpers
|
|
2
|
-
|
|
3
|
-
## mergeStyles
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
function mergeStyles(
|
|
7
|
-
...styles: (JSX.CSSProperties | string | undefined)[]
|
|
8
|
-
): JSX.CSSProperties;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Merges multiple style objects or CSS strings into a single `JSX.CSSProperties` object. Handles `undefined` values gracefully.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## createAppStructure
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
function createAppStructure<TModule, const TItems extends AppStructureItem<TModule>[]>(
|
|
19
|
-
getOpts: () => {
|
|
20
|
-
items: TItems;
|
|
21
|
-
usableModules?: Accessor<TModule[] | undefined>;
|
|
22
|
-
permRecord?: Accessor<Record<string, boolean> | undefined>;
|
|
23
|
-
},
|
|
24
|
-
): {
|
|
25
|
-
AppStructureProvider: ParentComponent;
|
|
26
|
-
useAppStructure(): AppStructure<TModule>;
|
|
27
|
-
};
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Creates an application navigation/permission structure from a declarative item tree. Returns a provider and a hook.
|
|
31
|
-
|
|
32
|
-
### AppStructure types
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
interface AppStructureGroupItem<TModule> {
|
|
36
|
-
code: string;
|
|
37
|
-
title: string;
|
|
38
|
-
icon?: Component<IconProps>;
|
|
39
|
-
modules?: TModule[];
|
|
40
|
-
requiredModules?: TModule[];
|
|
41
|
-
children: AppStructureItem<TModule>[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface AppStructureLeafItem<TModule> {
|
|
45
|
-
code: string;
|
|
46
|
-
title: string;
|
|
47
|
-
icon?: Component<IconProps>;
|
|
48
|
-
modules?: TModule[];
|
|
49
|
-
requiredModules?: TModule[];
|
|
50
|
-
component?: Component;
|
|
51
|
-
perms?: ("use" | "edit")[];
|
|
52
|
-
subPerms?: AppStructureSubPerm<TModule>[];
|
|
53
|
-
isNotMenu?: boolean;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
interface AppMenu {
|
|
57
|
-
title: string;
|
|
58
|
-
href?: string;
|
|
59
|
-
icon?: Component<IconProps>;
|
|
60
|
-
children?: AppMenu[];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
interface AppStructure<TModule> {
|
|
64
|
-
items: AppStructureItem<TModule>[];
|
|
65
|
-
usableRoutes: Accessor<AppRoute[]>;
|
|
66
|
-
usableMenus: Accessor<AppMenu[]>;
|
|
67
|
-
usableFlatMenus: Accessor<AppFlatMenu[]>;
|
|
68
|
-
usablePerms: Accessor<AppPerm<TModule>[]>;
|
|
69
|
-
allFlatPerms: AppFlatPerm<TModule>[];
|
|
70
|
-
getTitleChainByHref(href: string): string[];
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
The structure automatically derives routes, menus, and permissions from the item tree, filtering by `usableModules` and `permRecord`.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## createSlot
|
|
79
|
-
|
|
80
|
-
```typescript
|
|
81
|
-
function createSlot<TProps extends { children: JSX.Element }>():
|
|
82
|
-
[Component<TProps>, () => [Accessor<TProps | undefined>, ParentComponent]];
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Creates a slot pattern for compound components. Returns a slot component and a hook to access the slot content.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## createSlots
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
interface SlotRegistrar<TItem> {
|
|
93
|
-
add(item: TItem): void;
|
|
94
|
-
remove(item: TItem): void;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function createSlots<TItem>():
|
|
98
|
-
[Component, () => [Accessor<TItem[]>, ParentComponent]];
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Like `createSlot` but for multiple items. Items are collected from all rendered slot components.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## ripple (Directive)
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
function ripple(el: HTMLElement, accessor: Accessor<boolean>): void;
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
SolidJS directive that adds a Material-style ripple effect on click.
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
import { ripple } from "@simplysm/solid";
|
|
115
|
-
|
|
116
|
-
// Register the directive (required for TypeScript)
|
|
117
|
-
void ripple;
|
|
118
|
-
|
|
119
|
-
<div use:ripple={true}>Click me</div>
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Style Constants
|
|
125
|
-
|
|
126
|
-
### base.styles
|
|
127
|
-
|
|
128
|
-
Background, border, and text color utilities mapped to the theme system:
|
|
129
|
-
|
|
130
|
-
- `bg.surface`, `bg.muted`, `bg.subtle` -- background colors
|
|
131
|
-
- `border.default`, `border.subtle` -- border colors
|
|
132
|
-
- `text.default`, `text.muted`, `text.placeholder` -- text colors
|
|
133
|
-
|
|
134
|
-
### control.styles
|
|
135
|
-
|
|
136
|
-
Component sizing and state utilities:
|
|
137
|
-
|
|
138
|
-
- `pad.xs`, `pad.sm`, `pad.md`, `pad.lg`, `pad.xl` -- padding by size
|
|
139
|
-
- `gap.xs` ... `gap.xl` -- gap by size
|
|
140
|
-
- `state.disabled` -- disabled state styling
|
|
141
|
-
- `ComponentSize` -- `"xs" | "sm" | "md" | "lg" | "xl"`
|
|
142
|
-
|
|
143
|
-
### theme.styles
|
|
144
|
-
|
|
145
|
-
Semantic theme tokens:
|
|
146
|
-
|
|
147
|
-
- `SemanticTheme` -- `"base" | "primary" | "info" | "success" | "warning" | "danger"`
|
|
148
|
-
- `themeTokens` -- maps each theme to `{ solid, solidHover, light, text, hoverBg, border }` Tailwind class sets
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Usage Examples
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
import { createAppStructure, mergeStyles } from "@simplysm/solid";
|
|
156
|
-
|
|
157
|
-
// App structure
|
|
158
|
-
const { AppStructureProvider, useAppStructure } = createAppStructure(() => ({
|
|
159
|
-
items: [
|
|
160
|
-
{ code: "home", title: "Home", component: HomePage },
|
|
161
|
-
{
|
|
162
|
-
code: "admin", title: "Admin", children: [
|
|
163
|
-
{ code: "users", title: "Users", component: UsersPage, perms: ["use", "edit"] },
|
|
164
|
-
],
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
usableModules: () => currentModules(),
|
|
168
|
-
permRecord: () => userPerms(),
|
|
169
|
-
}));
|
|
170
|
-
|
|
171
|
-
// Merge styles
|
|
172
|
-
const style = mergeStyles(props.style, { padding: "8px" }, "color: red");
|
|
173
|
-
```
|
package/docs/hooks.md
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
# Hooks
|
|
2
|
-
|
|
3
|
-
## useLocalStorage
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
function useLocalStorage<TValue>(
|
|
7
|
-
key: string,
|
|
8
|
-
initialValue?: TValue,
|
|
9
|
-
): [Accessor<TValue | undefined>, StorageSetter<TValue>];
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
Reactive `localStorage` binding. Returns a signal-like tuple. Automatically serializes/deserializes values as JSON.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## useSyncConfig
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
function useSyncConfig<TValue>(
|
|
20
|
-
key: string,
|
|
21
|
-
defaultValue: TValue,
|
|
22
|
-
): [Accessor<TValue>, Setter<TValue>, Accessor<boolean>];
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Persisted configuration backed by `SyncStorageProvider`. Returns `[value, setValue, ready]`. The `ready` accessor becomes `true` once the stored value has been loaded.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## useLogger
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
interface Logger {
|
|
33
|
-
log(...args: unknown[]): void;
|
|
34
|
-
info(...args: unknown[]): void;
|
|
35
|
-
warn(...args: unknown[]): void;
|
|
36
|
-
error(...args: unknown[]): void;
|
|
37
|
-
configure(fn: (origin: LogAdapter) => LogAdapter): void;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function useLogger(): Logger;
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Access the logging system from `LoggerProvider`. Supports middleware composition via `configure()`.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## createControllableSignal
|
|
48
|
-
|
|
49
|
-
```typescript
|
|
50
|
-
function createControllableSignal<TValue>(options: {
|
|
51
|
-
value: Accessor<TValue>;
|
|
52
|
-
onChange: Accessor<((value: TValue) => void) | undefined>;
|
|
53
|
-
}): [Accessor<TValue>, (newValue: TValue | ((prev: TValue) => TValue)) => TValue];
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Creates a signal that supports both controlled and uncontrolled modes. When `onChange` is provided, the component is controlled; otherwise, internal state is used. This is the primitive behind all form control `value`/`onValueChange` pairs.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## createControllableStore
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
function createControllableStore<TValue extends object>(options: {
|
|
64
|
-
value: () => TValue;
|
|
65
|
-
onChange: () => ((value: TValue) => void) | undefined;
|
|
66
|
-
}): [TValue, SetStoreFunction<TValue>];
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Like `createControllableSignal` but for SolidJS stores (deep reactive objects).
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## createIMEHandler
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
function createIMEHandler(setValue: (value: string) => void): {
|
|
77
|
-
composingValue: Accessor<string | null>;
|
|
78
|
-
handleCompositionStart(): void;
|
|
79
|
-
handleInput(value: string, isComposing: boolean): void;
|
|
80
|
-
handleCompositionEnd(value: string): void;
|
|
81
|
-
flushComposition(): void;
|
|
82
|
-
};
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Handles IME composition events (Korean, Chinese, Japanese input). Buffers intermediate composition states and only commits the final value. Used internally by `TextInput` and `Textarea`.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## createMountTransition
|
|
90
|
-
|
|
91
|
-
```typescript
|
|
92
|
-
function createMountTransition(
|
|
93
|
-
open: () => boolean,
|
|
94
|
-
): {
|
|
95
|
-
mounted: () => boolean;
|
|
96
|
-
animating: () => boolean;
|
|
97
|
-
unmount: () => void;
|
|
98
|
-
};
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
Manages mount/unmount transitions. While `open()` is true, `mounted` and `animating` are true. When `open()` becomes false, `animating` becomes false (triggering CSS transition), and `unmount()` should be called after the transition ends to set `mounted` to false.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## useRouterLink
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
interface RouterLinkOptions {
|
|
109
|
-
href: string;
|
|
110
|
-
state?: Record<string, unknown>;
|
|
111
|
-
window?: { width?: number; height?: number };
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function useRouterLink(): (options: RouterLinkOptions) => (e: MouseEvent | KeyboardEvent) => void;
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Creates click handlers for SolidJS Router navigation. Supports opening links in new windows with specified dimensions via the `window` option.
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Usage Examples
|
|
122
|
-
|
|
123
|
-
```typescript
|
|
124
|
-
import {
|
|
125
|
-
useLocalStorage,
|
|
126
|
-
useSyncConfig,
|
|
127
|
-
createControllableSignal,
|
|
128
|
-
useLogger,
|
|
129
|
-
} from "@simplysm/solid";
|
|
130
|
-
|
|
131
|
-
// Local storage
|
|
132
|
-
const [theme, setTheme] = useLocalStorage<string>("app-theme", "light");
|
|
133
|
-
|
|
134
|
-
// Sync config (persisted to SyncStorageProvider)
|
|
135
|
-
const [pageSize, setPageSize, ready] = useSyncConfig("pageSize", 20);
|
|
136
|
-
|
|
137
|
-
// Logger
|
|
138
|
-
const logger = useLogger();
|
|
139
|
-
logger.info("Application started");
|
|
140
|
-
|
|
141
|
-
// Controlled/uncontrolled primitive
|
|
142
|
-
const [value, setValue] = createControllableSignal({
|
|
143
|
-
value: () => props.value,
|
|
144
|
-
onChange: () => props.onValueChange,
|
|
145
|
-
});
|
|
146
|
-
```
|
package/docs/layout.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# Layout
|
|
2
|
-
|
|
3
|
-
## FormGroup
|
|
4
|
-
|
|
5
|
-
```typescript
|
|
6
|
-
interface FormGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
inline?: boolean;
|
|
8
|
-
}
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Groups form fields vertically (default) or horizontally with `inline`.
|
|
12
|
-
|
|
13
|
-
**Sub-component:** `FormGroup.Item` — `{ label?: JSX.Element } & JSX.HTMLAttributes<HTMLDivElement>`
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## FormTable
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
interface FormTableProps extends JSX.HTMLAttributes<HTMLTableElement> {}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Arranges form fields in a label-value table layout.
|
|
24
|
-
|
|
25
|
-
**Sub-components:**
|
|
26
|
-
- `FormTable.Row` — table row
|
|
27
|
-
- `FormTable.Item` — `{ label?: JSX.Element } & JSX.TdHTMLAttributes<HTMLTableCellElement>`
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Sidebar
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
interface SidebarProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
35
|
-
children: JSX.Element;
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Collapsible sidebar navigation. Must be wrapped in `Sidebar.Container`.
|
|
40
|
-
|
|
41
|
-
**Sub-components:**
|
|
42
|
-
- `Sidebar.Container` — layout wrapper that includes both sidebar and main content
|
|
43
|
-
- `Sidebar.Menu` — `{ menus: AppMenu[] }` — renders navigation tree from `AppMenu` data
|
|
44
|
-
- `Sidebar.User` — `{ name: string; icon?: Component; description?: string; menus?: SidebarUserMenu[] }` — user profile section with optional dropdown menus
|
|
45
|
-
|
|
46
|
-
**Hook:** `useSidebar()` — access sidebar state (collapsed, toggle, etc.)
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Topbar
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
interface TopbarProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
54
|
-
children: JSX.Element;
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Top navigation bar. Must be wrapped in `Topbar.Container`.
|
|
59
|
-
|
|
60
|
-
**Sub-components:**
|
|
61
|
-
- `Topbar.Container` — layout wrapper
|
|
62
|
-
- `Topbar.Menu` — `{ menus: TopbarMenuItem[] }` — renders top-level navigation
|
|
63
|
-
- `Topbar.User` — `{ menus?: TopbarUserMenu[]; children: JSX.Element }` — user section with dropdown
|
|
64
|
-
|
|
65
|
-
**Hooks:**
|
|
66
|
-
- `useTopbarActionsAccessor()` — access topbar actions element
|
|
67
|
-
- `useTopbarActions(accessor)` — register topbar actions from child components
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Usage Examples
|
|
72
|
-
|
|
73
|
-
```typescript
|
|
74
|
-
import { Sidebar, FormGroup, FormTable } from "@simplysm/solid";
|
|
75
|
-
|
|
76
|
-
// Sidebar layout
|
|
77
|
-
<Sidebar.Container>
|
|
78
|
-
<Sidebar>
|
|
79
|
-
<Sidebar.User name="John" description="Admin" />
|
|
80
|
-
<Sidebar.Menu menus={appMenus} />
|
|
81
|
-
</Sidebar>
|
|
82
|
-
<main>Content</main>
|
|
83
|
-
</Sidebar.Container>
|
|
84
|
-
|
|
85
|
-
// Form with labeled fields
|
|
86
|
-
<FormGroup>
|
|
87
|
-
<FormGroup.Item label="Name">
|
|
88
|
-
<TextInput value={name()} onValueChange={setName} />
|
|
89
|
-
</FormGroup.Item>
|
|
90
|
-
<FormGroup.Item label="Email">
|
|
91
|
-
<TextInput value={email()} onValueChange={setEmail} type="email" />
|
|
92
|
-
</FormGroup.Item>
|
|
93
|
-
</FormGroup>
|
|
94
|
-
```
|