@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/layout.md
CHANGED
|
@@ -1,143 +1,177 @@
|
|
|
1
|
-
# Layout
|
|
1
|
+
# Layout Components
|
|
2
2
|
|
|
3
|
-
Source: `src/components/layout
|
|
3
|
+
Source: `src/components/layout/**`
|
|
4
4
|
|
|
5
|
-
## FormGroup
|
|
5
|
+
## `FormGroup`
|
|
6
6
|
|
|
7
|
-
Vertical or inline form field
|
|
7
|
+
Vertical or inline form field grouping component.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
interface FormGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
-
inline?: boolean;
|
|
9
|
+
```typescript
|
|
10
|
+
export interface FormGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
inline?: boolean;
|
|
12
12
|
}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
| Prop | Type | Description |
|
|
16
|
+
|------|------|-------------|
|
|
17
|
+
| `inline` | `boolean` | Display items horizontally in a row |
|
|
18
|
+
|
|
15
19
|
### Sub-components
|
|
16
20
|
|
|
17
|
-
- **`FormGroup.Item`** --
|
|
21
|
+
- **`FormGroup.Item`** -- Individual form field with optional label
|
|
18
22
|
|
|
19
|
-
```
|
|
20
|
-
interface FormGroupItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
```typescript
|
|
24
|
+
export interface FormGroupItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
21
25
|
label?: JSX.Element;
|
|
22
26
|
}
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## `FormTable`
|
|
26
32
|
|
|
27
|
-
Table-based form layout
|
|
33
|
+
Table-based form layout with label-value pairs.
|
|
28
34
|
|
|
29
|
-
```
|
|
30
|
-
interface FormTableProps extends JSX.HTMLAttributes<HTMLTableElement> {}
|
|
35
|
+
```typescript
|
|
36
|
+
export interface FormTableProps extends JSX.HTMLAttributes<HTMLTableElement> {}
|
|
31
37
|
```
|
|
32
38
|
|
|
33
39
|
### Sub-components
|
|
34
40
|
|
|
35
|
-
- **`FormTable.Row`** -- Table row
|
|
36
|
-
- **`FormTable.Item`** --
|
|
41
|
+
- **`FormTable.Row`** -- Table row wrapper
|
|
42
|
+
- **`FormTable.Item`** -- Table cell with optional label (`th` + `td`)
|
|
37
43
|
|
|
38
|
-
```
|
|
39
|
-
interface FormTableItemProps extends JSX.TdHTMLAttributes<HTMLTableCellElement> {
|
|
44
|
+
```typescript
|
|
45
|
+
export interface FormTableItemProps extends JSX.TdHTMLAttributes<HTMLTableCellElement> {
|
|
40
46
|
label?: JSX.Element;
|
|
41
47
|
}
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## `Sidebar`
|
|
45
53
|
|
|
46
|
-
|
|
54
|
+
Responsive sidebar navigation with user info and menu sections. Collapses on mobile with overlay backdrop.
|
|
47
55
|
|
|
48
|
-
```
|
|
49
|
-
interface SidebarProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
56
|
+
```typescript
|
|
57
|
+
export interface SidebarProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
50
58
|
children: JSX.Element;
|
|
51
59
|
}
|
|
52
60
|
```
|
|
53
61
|
|
|
54
|
-
###
|
|
62
|
+
### Sub-components
|
|
63
|
+
|
|
64
|
+
- **`Sidebar.Container`** -- Root container providing sidebar context and responsive padding
|
|
65
|
+
- **`Sidebar.Menu`** -- Recursive menu list with pathname-based selection
|
|
66
|
+
- **`Sidebar.User`** -- User info section with optional dropdown menus
|
|
55
67
|
|
|
56
|
-
|
|
68
|
+
### `Sidebar.Container`
|
|
57
69
|
|
|
58
|
-
```
|
|
59
|
-
interface SidebarContainerProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
70
|
+
```typescript
|
|
71
|
+
export interface SidebarContainerProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
60
72
|
children: JSX.Element;
|
|
61
73
|
}
|
|
62
74
|
```
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
- Mobile (<640px): renders backdrop overlay. Auto-closes on navigation.
|
|
76
|
+
### `Sidebar.Menu`
|
|
66
77
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Recursive sidebar menu with route-based selection.
|
|
70
|
-
|
|
71
|
-
```ts
|
|
72
|
-
interface SidebarMenuProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
78
|
+
```typescript
|
|
79
|
+
export interface SidebarMenuProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
73
80
|
menus: AppMenu[];
|
|
74
|
-
defaultOpen?: boolean;
|
|
81
|
+
defaultOpen?: boolean;
|
|
75
82
|
}
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
| Prop | Type | Description |
|
|
86
|
+
|------|------|-------------|
|
|
87
|
+
| `menus` | `AppMenu[]` | Menu items array |
|
|
88
|
+
| `defaultOpen` | `boolean` | Expand all nested menus initially. Default: `false` |
|
|
80
89
|
|
|
81
|
-
### Sidebar.User
|
|
90
|
+
### `Sidebar.User`
|
|
82
91
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
interface SidebarUserProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onClick"> {
|
|
92
|
+
```typescript
|
|
93
|
+
export interface SidebarUserProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onClick"> {
|
|
87
94
|
name: string;
|
|
88
95
|
icon?: Component<TablerIconProps>;
|
|
89
96
|
description?: string;
|
|
90
97
|
menus?: SidebarUserMenu[];
|
|
91
98
|
}
|
|
99
|
+
```
|
|
92
100
|
|
|
93
|
-
|
|
101
|
+
| Prop | Type | Description |
|
|
102
|
+
|------|------|-------------|
|
|
103
|
+
| `name` | `string` | User name (required) |
|
|
104
|
+
| `icon` | `Component<TablerIconProps>` | Avatar icon. Default: user icon |
|
|
105
|
+
| `description` | `string` | Additional info (email, etc.) |
|
|
106
|
+
| `menus` | `SidebarUserMenu[]` | Dropdown menu items |
|
|
107
|
+
|
|
108
|
+
### `SidebarUserMenu`
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
export interface SidebarUserMenu {
|
|
94
112
|
title: string;
|
|
95
113
|
onClick: () => void;
|
|
96
114
|
}
|
|
97
115
|
```
|
|
98
116
|
|
|
99
|
-
###
|
|
117
|
+
### `SidebarContextValue`
|
|
100
118
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
```ts
|
|
104
|
-
function useSidebar(): {
|
|
119
|
+
```typescript
|
|
120
|
+
export interface SidebarContextValue {
|
|
105
121
|
toggle: Accessor<boolean>;
|
|
106
122
|
setToggle: Setter<boolean>;
|
|
107
|
-
}
|
|
108
|
-
// Also available: useSidebar.optional() returns undefined if no context
|
|
123
|
+
}
|
|
109
124
|
```
|
|
110
125
|
|
|
111
|
-
|
|
126
|
+
### `useSidebar`
|
|
127
|
+
|
|
128
|
+
Hook to access sidebar toggle state. Also has `useSidebar.optional()` variant.
|
|
129
|
+
|
|
130
|
+
### `SM_MEDIA_QUERY`
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
export const SM_MEDIA_QUERY = "(min-width: 640px)";
|
|
134
|
+
```
|
|
112
135
|
|
|
113
|
-
|
|
136
|
+
---
|
|
114
137
|
|
|
115
|
-
|
|
116
|
-
|
|
138
|
+
## `Topbar`
|
|
139
|
+
|
|
140
|
+
Top navigation bar with sidebar toggle integration, dropdown menus, user section, and dynamic actions.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
export interface TopbarProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
117
144
|
children: JSX.Element;
|
|
118
145
|
}
|
|
119
146
|
```
|
|
120
147
|
|
|
121
|
-
###
|
|
148
|
+
### Sub-components
|
|
149
|
+
|
|
150
|
+
- **`Topbar.Container`** -- Layout container wrapping Topbar and content, provides actions context
|
|
151
|
+
- **`Topbar.Menu`** -- Dropdown navigation menu (responsive: desktop buttons / mobile hamburger)
|
|
152
|
+
- **`Topbar.User`** -- User information section with optional dropdown
|
|
153
|
+
- **`Topbar.Actions`** -- Renders actions set via `useTopbarActions()`
|
|
122
154
|
|
|
123
|
-
|
|
155
|
+
### `Topbar.Container`
|
|
124
156
|
|
|
125
|
-
```
|
|
126
|
-
interface TopbarContainerProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
157
|
+
```typescript
|
|
158
|
+
export interface TopbarContainerProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
127
159
|
children: JSX.Element;
|
|
128
160
|
}
|
|
129
161
|
```
|
|
130
162
|
|
|
131
|
-
### Topbar.Menu
|
|
163
|
+
### `Topbar.Menu`
|
|
132
164
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
interface TopbarMenuProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children"> {
|
|
165
|
+
```typescript
|
|
166
|
+
export interface TopbarMenuProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "children"> {
|
|
137
167
|
menus: TopbarMenuItem[];
|
|
138
168
|
}
|
|
169
|
+
```
|
|
139
170
|
|
|
140
|
-
|
|
171
|
+
### `TopbarMenuItem`
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
export interface TopbarMenuItem {
|
|
141
175
|
title: string;
|
|
142
176
|
href?: string;
|
|
143
177
|
icon?: Component<IconProps>;
|
|
@@ -145,38 +179,34 @@ interface TopbarMenuItem {
|
|
|
145
179
|
}
|
|
146
180
|
```
|
|
147
181
|
|
|
148
|
-
### Topbar.User
|
|
149
|
-
|
|
150
|
-
User information component with optional dropdown menu.
|
|
182
|
+
### `Topbar.User`
|
|
151
183
|
|
|
152
|
-
```
|
|
153
|
-
interface TopbarUserProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onClick"> {
|
|
184
|
+
```typescript
|
|
185
|
+
export interface TopbarUserProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "onClick"> {
|
|
154
186
|
menus?: TopbarUserMenu[];
|
|
155
187
|
children: JSX.Element;
|
|
156
188
|
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### `TopbarUserMenu`
|
|
157
192
|
|
|
158
|
-
|
|
193
|
+
```typescript
|
|
194
|
+
export interface TopbarUserMenu {
|
|
159
195
|
title: string;
|
|
160
196
|
onClick: () => void;
|
|
161
197
|
}
|
|
162
198
|
```
|
|
163
199
|
|
|
164
|
-
###
|
|
165
|
-
|
|
166
|
-
Renders action elements registered by `useTopbarActions()`.
|
|
167
|
-
|
|
168
|
-
### useTopbarActions()
|
|
200
|
+
### `TopbarContextValue`
|
|
169
201
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
202
|
+
```typescript
|
|
203
|
+
export interface TopbarContextValue {
|
|
204
|
+
actions: Accessor<JSX.Element | undefined>;
|
|
205
|
+
setActions: Setter<JSX.Element | undefined>;
|
|
206
|
+
}
|
|
174
207
|
```
|
|
175
208
|
|
|
176
|
-
###
|
|
209
|
+
### Hooks
|
|
177
210
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
function useTopbarActionsAccessor(): Accessor<JSX.Element | undefined>;
|
|
182
|
-
```
|
|
211
|
+
- **`useTopbarActions(accessor: () => JSX.Element)`** -- Register dynamic actions for display in Topbar
|
|
212
|
+
- **`useTopbarActionsAccessor()`** -- Read registered actions
|
package/docs/providers.md
CHANGED
|
@@ -1,177 +1,197 @@
|
|
|
1
1
|
# Providers
|
|
2
2
|
|
|
3
|
-
Source: `src/providers
|
|
3
|
+
Source: `src/providers/**`
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## `ConfigProvider`
|
|
6
6
|
|
|
7
|
-
App-
|
|
7
|
+
App-wide configuration context providing `clientName` used as storage key prefix.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
interface AppConfig {
|
|
9
|
+
```typescript
|
|
10
|
+
export interface AppConfig {
|
|
11
11
|
clientName: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const ConfigContext: Context<AppConfig>;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const ConfigProvider: ParentComponent<{ clientName: string }>;
|
|
14
|
+
export const ConfigContext: Context<AppConfig>;
|
|
15
|
+
export function useConfig(): AppConfig;
|
|
16
|
+
export const ConfigProvider: ParentComponent<{ clientName: string }>;
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
---
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
## `SyncStorageProvider`
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
interface StorageAdapter {
|
|
27
|
-
getItem: (key: string) => Promise<string | null>;
|
|
28
|
-
setItem: (key: string, value: string) => Promise<void>;
|
|
29
|
-
removeItem: (key: string) => Promise<void>;
|
|
30
|
-
}
|
|
23
|
+
Sync storage provider with configurable adapter (defaults to localStorage). Supports async adapters for cross-device sync.
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
```typescript
|
|
26
|
+
export interface StorageAdapter {
|
|
27
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
28
|
+
setItem(key: string, value: string): void | Promise<unknown>;
|
|
29
|
+
removeItem(key: string): void | Promise<void>;
|
|
35
30
|
}
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
export interface SyncStorageContextValue {
|
|
33
|
+
adapter: Accessor<StorageAdapter>;
|
|
34
|
+
configure: (fn: (origin: StorageAdapter) => StorageAdapter) => void;
|
|
35
|
+
}
|
|
40
36
|
|
|
41
|
-
const
|
|
37
|
+
export const SyncStorageContext: Context<SyncStorageContextValue>;
|
|
38
|
+
export function useSyncStorage(): SyncStorageContextValue | undefined;
|
|
39
|
+
export const SyncStorageProvider: ParentComponent;
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## `LoggerProvider`
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Logger adapter provider. Defaults to consola. Configurable via decorator pattern.
|
|
47
47
|
|
|
48
|
-
```
|
|
49
|
-
interface LogAdapter {
|
|
50
|
-
write
|
|
48
|
+
```typescript
|
|
49
|
+
export interface LogAdapter {
|
|
50
|
+
write(severity: "error" | "warn" | "info" | "log", ...data: any[]): Promise<void> | void;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
interface LoggerContextValue {
|
|
54
|
-
adapter: Accessor<LogAdapter
|
|
53
|
+
export interface LoggerContextValue {
|
|
54
|
+
adapter: Accessor<LogAdapter>;
|
|
55
55
|
configure: (fn: (origin: LogAdapter) => LogAdapter) => void;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const LoggerContext: Context<LoggerContextValue>;
|
|
59
|
-
|
|
60
|
-
const LoggerProvider: ParentComponent;
|
|
58
|
+
export const LoggerContext: Context<LoggerContextValue>;
|
|
59
|
+
export const LoggerProvider: ParentComponent;
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## `ThemeProvider`
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
Theme mode provider with OS dark mode detection. Persists to storage via `useSyncConfig`. Toggles `dark` class on `<html>`.
|
|
66
67
|
|
|
67
|
-
```
|
|
68
|
-
type ThemeMode = "light" | "dark" | "system";
|
|
69
|
-
type ResolvedTheme = "light" | "dark";
|
|
68
|
+
```typescript
|
|
69
|
+
export type ThemeMode = "light" | "dark" | "system";
|
|
70
|
+
export type ResolvedTheme = "light" | "dark";
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
mode:
|
|
73
|
-
resolved: Accessor<ResolvedTheme>;
|
|
72
|
+
export function useTheme(): {
|
|
73
|
+
mode: () => ThemeMode;
|
|
74
74
|
setMode: (mode: ThemeMode) => void;
|
|
75
|
+
resolvedTheme: () => ResolvedTheme;
|
|
75
76
|
cycleMode: () => void;
|
|
76
|
-
}
|
|
77
|
+
};
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const ThemeProvider: ParentComponent;
|
|
79
|
+
export const ThemeProvider: ParentComponent;
|
|
81
80
|
```
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
- `resolved`: the actual applied theme after resolving "system" via `prefers-color-scheme`.
|
|
82
|
+
---
|
|
85
83
|
|
|
86
|
-
## ServiceClientProvider
|
|
84
|
+
## `ServiceClientProvider`
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
WebSocket service client provider with key-based multi-connection management. Displays request/response progress via notifications.
|
|
89
87
|
|
|
90
|
-
```
|
|
91
|
-
interface ServiceClientContextValue {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
```typescript
|
|
89
|
+
export interface ServiceClientContextValue {
|
|
90
|
+
connect: (key?: string, options?: Partial<ServiceConnectionOptions>) => Promise<void>;
|
|
91
|
+
close: (key?: string) => Promise<void>;
|
|
92
|
+
get: (key?: string) => ServiceClient;
|
|
93
|
+
isConnected: (key?: string) => boolean;
|
|
95
94
|
}
|
|
96
95
|
|
|
97
|
-
const ServiceClientContext: Context<ServiceClientContextValue>;
|
|
96
|
+
export const ServiceClientContext: Context<ServiceClientContextValue>;
|
|
97
|
+
export function useServiceClient(): ServiceClientContextValue;
|
|
98
|
+
export const ServiceClientProvider: ParentComponent;
|
|
99
|
+
```
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
---
|
|
100
102
|
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
+
## `SharedDataProvider`
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
Reactive shared data provider that subscribes to server events for real-time data updates.
|
|
105
106
|
|
|
106
|
-
|
|
107
|
+
### `SharedDataDefinition`
|
|
107
108
|
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
```typescript
|
|
110
|
+
export interface SharedDataDefinition<TData> {
|
|
111
|
+
serviceKey?: string;
|
|
112
|
+
fetch: (changeKeys?: Array<string | number>) => Promise<TData[]>;
|
|
113
|
+
getKey: (item: TData) => string | number;
|
|
114
|
+
orderBy: [(item: TData) => unknown, "asc" | "desc"][];
|
|
115
|
+
filter?: unknown;
|
|
116
|
+
itemSearchText?: (item: TData) => string;
|
|
117
|
+
isItemHidden?: (item: TData) => boolean;
|
|
118
|
+
getParentKey?: (item: TData) => string | number | undefined;
|
|
119
|
+
}
|
|
113
120
|
```
|
|
114
121
|
|
|
115
|
-
|
|
122
|
+
### `SharedDataAccessor`
|
|
116
123
|
|
|
117
|
-
|
|
124
|
+
```typescript
|
|
125
|
+
export interface SharedDataAccessor<TData> {
|
|
126
|
+
items: Accessor<TData[]>;
|
|
127
|
+
get: (key: string | number | undefined) => TData | undefined;
|
|
128
|
+
emit: (changeKeys?: Array<string | number>) => Promise<void>;
|
|
129
|
+
getKey: (item: TData) => string | number;
|
|
130
|
+
itemSearchText?: (item: TData) => string;
|
|
131
|
+
isItemHidden?: (item: TData) => boolean;
|
|
132
|
+
getParentKey?: (item: TData) => string | number | undefined;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
118
135
|
|
|
119
|
-
|
|
136
|
+
---
|
|
120
137
|
|
|
121
|
-
|
|
122
|
-
interface I18nContextValue {
|
|
123
|
-
locale: Accessor<string>;
|
|
124
|
-
t: (key: string, params?: Record<string, string>) => string;
|
|
125
|
-
configure: (options: I18nConfigureOptions) => void;
|
|
126
|
-
}
|
|
138
|
+
## `SharedDataChangeEvent`
|
|
127
139
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
140
|
+
Server-client shared data change event definition.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
export const SharedDataChangeEvent: EventDefinition<
|
|
144
|
+
{ name: string; filter: unknown },
|
|
145
|
+
(string | number)[] | undefined
|
|
146
|
+
>;
|
|
147
|
+
```
|
|
133
148
|
|
|
134
|
-
|
|
149
|
+
---
|
|
135
150
|
|
|
136
|
-
|
|
151
|
+
## `SystemProvider`
|
|
137
152
|
|
|
138
|
-
|
|
153
|
+
All-in-one provider that composes Config, I18n, SyncStorage, Logger, Notification, ErrorLogger, PwaUpdate, Clipboard, Theme, ServiceClient, SharedData, and Busy providers.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
export const SystemProvider: ParentComponent<{
|
|
157
|
+
clientName: string;
|
|
158
|
+
busyVariant?: BusyVariant;
|
|
159
|
+
}>;
|
|
139
160
|
```
|
|
140
161
|
|
|
141
|
-
|
|
142
|
-
- `configure()`: merges new dictionaries into existing translations.
|
|
162
|
+
---
|
|
143
163
|
|
|
144
|
-
##
|
|
164
|
+
## `I18nProvider`
|
|
145
165
|
|
|
146
|
-
|
|
166
|
+
Internationalization provider with built-in `en` and `ko` dictionaries.
|
|
147
167
|
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
getKey: (item: TData) => string | number;
|
|
153
|
-
getSearchText?: (item: TData) => string;
|
|
154
|
-
getChildren?: (item: TData, allItems: TData[]) => TData[];
|
|
155
|
-
}
|
|
168
|
+
```typescript
|
|
169
|
+
export function useI18n(): I18nContextValue;
|
|
170
|
+
export const I18nProvider: ParentComponent;
|
|
171
|
+
```
|
|
156
172
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
173
|
+
### `I18nContextValue`
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
export interface I18nContextValue {
|
|
177
|
+
t: (key: string, params?: Record<string, string>) => string;
|
|
178
|
+
locale: Accessor<string>;
|
|
179
|
+
setLocale: (locale: string) => void;
|
|
180
|
+
configure: (options: I18nConfigureOptions) => void;
|
|
162
181
|
}
|
|
182
|
+
```
|
|
163
183
|
|
|
164
|
-
|
|
184
|
+
### `I18nConfigureOptions`
|
|
165
185
|
|
|
166
|
-
|
|
186
|
+
```typescript
|
|
187
|
+
export interface I18nConfigureOptions {
|
|
188
|
+
locale?: string;
|
|
189
|
+
dict?: Record<string, Record<string, unknown>>;
|
|
190
|
+
}
|
|
167
191
|
```
|
|
168
192
|
|
|
169
|
-
###
|
|
193
|
+
### `FlatDict`
|
|
170
194
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
```ts
|
|
174
|
-
const SharedDataChangeEvent: EventDefinition<{
|
|
175
|
-
key: string;
|
|
176
|
-
}>;
|
|
195
|
+
```typescript
|
|
196
|
+
export type FlatDict = Record<string, string>;
|
|
177
197
|
```
|