tot-ui-kit 1.0.0
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 +72 -0
- package/dist/index.cjs +1222 -0
- package/dist/index.css +319 -0
- package/dist/index.d.cts +106 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +1095 -0
- package/dist/singleMenuData-HQDGG4SS.js +78 -0
- package/package.json +65 -0
- package/src/global.css +81 -0
package/dist/index.css
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/* src/components/Layout/styles.css */
|
|
2
|
+
.sc-layout {
|
|
3
|
+
min-height: 100vh;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
transition:
|
|
8
|
+
padding-left 0.3s ease,
|
|
9
|
+
background-color 0.3s ease,
|
|
10
|
+
color 0.3s ease;
|
|
11
|
+
}
|
|
12
|
+
.sc-layout_theme_light {
|
|
13
|
+
background-color: var(--sc-page-bg, #eaedf1);
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
16
|
+
.sc-layout_theme_dark {
|
|
17
|
+
background-color: var(--sc-page-bg, #000000);
|
|
18
|
+
color: inherit;
|
|
19
|
+
}
|
|
20
|
+
.sc-layout_menu_full {
|
|
21
|
+
}
|
|
22
|
+
.sc-layout_menu_compact {
|
|
23
|
+
}
|
|
24
|
+
.sc-layout__header {
|
|
25
|
+
border-bottom: 1px solid;
|
|
26
|
+
padding: 15px 24px;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 8px;
|
|
30
|
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
|
31
|
+
}
|
|
32
|
+
.sc-layout_theme_light .sc-layout__header {
|
|
33
|
+
border-color: #e0e0e0;
|
|
34
|
+
background-color: #fff;
|
|
35
|
+
}
|
|
36
|
+
.sc-layout_theme_dark .sc-layout__header {
|
|
37
|
+
border-color: rgba(148, 163, 184, 0.3);
|
|
38
|
+
background-color: #1e293b;
|
|
39
|
+
}
|
|
40
|
+
.sc-layout__upper-menu {
|
|
41
|
+
border-bottom: 1px solid;
|
|
42
|
+
transition: background-color 0.3s ease, border-color 0.3s ease;
|
|
43
|
+
}
|
|
44
|
+
.sc-layout_theme_light .sc-layout__upper-menu {
|
|
45
|
+
border-color: #e0e0e0;
|
|
46
|
+
background-color: #fff;
|
|
47
|
+
}
|
|
48
|
+
.sc-layout_theme_dark .sc-layout__upper-menu {
|
|
49
|
+
border-color: rgba(148, 163, 184, 0.3);
|
|
50
|
+
background-color: #1e293b;
|
|
51
|
+
}
|
|
52
|
+
.sc-layout__main {
|
|
53
|
+
flex: 1;
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
overflow: auto;
|
|
56
|
+
transition: background-color 0.3s ease;
|
|
57
|
+
}
|
|
58
|
+
.sc-layout_theme_light .sc-layout__main {
|
|
59
|
+
background-color: var(--sc-main-bg, transparent);
|
|
60
|
+
}
|
|
61
|
+
.sc-layout_theme_dark .sc-layout__main {
|
|
62
|
+
background-color: var(--sc-main-bg, transparent);
|
|
63
|
+
}
|
|
64
|
+
.sc-layout__footer {
|
|
65
|
+
border-top: 1px solid;
|
|
66
|
+
padding: 8px 24px;
|
|
67
|
+
font-size: 12px;
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
align-items: center;
|
|
71
|
+
transition:
|
|
72
|
+
background-color 0.3s ease,
|
|
73
|
+
border-color 0.3s ease,
|
|
74
|
+
color 0.3s ease;
|
|
75
|
+
}
|
|
76
|
+
.sc-layout_theme_light .sc-layout__footer {
|
|
77
|
+
border-color: #e0e0e0;
|
|
78
|
+
background-color: #fff;
|
|
79
|
+
color: #777;
|
|
80
|
+
}
|
|
81
|
+
.sc-layout_theme_dark .sc-layout__footer {
|
|
82
|
+
border-color: rgba(148, 163, 184, 0.3);
|
|
83
|
+
background-color: #1e293b;
|
|
84
|
+
color: #f1f5f9;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* src/components/MainMenu/MainMenu.css */
|
|
88
|
+
.sc-main-menu {
|
|
89
|
+
position: fixed;
|
|
90
|
+
left: 0;
|
|
91
|
+
top: 0;
|
|
92
|
+
bottom: 0;
|
|
93
|
+
width: 48px;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
box-sizing: border-box;
|
|
97
|
+
padding: 12px 8px;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
border-right: none;
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
line-height: 1.2;
|
|
102
|
+
border-radius: 0;
|
|
103
|
+
transition: width 0.3s ease;
|
|
104
|
+
}
|
|
105
|
+
.sc-main-menu.sc-main-menu_layout_full {
|
|
106
|
+
width: 220px;
|
|
107
|
+
padding: 12px 8px;
|
|
108
|
+
}
|
|
109
|
+
.sc-main-menu.sc-main-menu_layout_compact {
|
|
110
|
+
width: 48px;
|
|
111
|
+
}
|
|
112
|
+
.sc-main-menu_theme_light {
|
|
113
|
+
background-color: var(--sc-menu-bg, transparent);
|
|
114
|
+
color: #3b4750;
|
|
115
|
+
}
|
|
116
|
+
.sc-main-menu_theme_dark {
|
|
117
|
+
background-color: var(--sc-menu-bg, transparent);
|
|
118
|
+
color: #f1f5f9;
|
|
119
|
+
}
|
|
120
|
+
.sc-main-menu__left {
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
align-items: center;
|
|
125
|
+
gap: 0;
|
|
126
|
+
margin-bottom: 0;
|
|
127
|
+
}
|
|
128
|
+
.sc-main-menu__systemLogo {
|
|
129
|
+
width: 24px;
|
|
130
|
+
height: 24px;
|
|
131
|
+
object-fit: contain;
|
|
132
|
+
}
|
|
133
|
+
.sc-main-menu__center {
|
|
134
|
+
flex: 1;
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
align-items: stretch;
|
|
138
|
+
gap: 8px;
|
|
139
|
+
overflow-y: auto;
|
|
140
|
+
padding-right: 0;
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
.sc-main-menu.sc-main-menu_layout_full .sc-main-menu__center {
|
|
144
|
+
align-items: stretch;
|
|
145
|
+
}
|
|
146
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__center {
|
|
147
|
+
align-items: center;
|
|
148
|
+
}
|
|
149
|
+
.sc-main-menu__right {
|
|
150
|
+
flex-shrink: 0;
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
align-items: stretch;
|
|
154
|
+
gap: 8px;
|
|
155
|
+
margin-top: 0;
|
|
156
|
+
width: 100%;
|
|
157
|
+
}
|
|
158
|
+
.sc-main-menu.sc-main-menu_layout_full .sc-main-menu__right {
|
|
159
|
+
align-items: stretch;
|
|
160
|
+
}
|
|
161
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__right {
|
|
162
|
+
align-items: center;
|
|
163
|
+
}
|
|
164
|
+
.sc-main-menu__divider {
|
|
165
|
+
width: 100%;
|
|
166
|
+
height: 1px;
|
|
167
|
+
background-color: #e7e9ee;
|
|
168
|
+
margin: 0;
|
|
169
|
+
border: none;
|
|
170
|
+
}
|
|
171
|
+
.sc-main-menu_theme_dark .sc-main-menu__divider {
|
|
172
|
+
background-color: rgba(255, 255, 255, 0.12);
|
|
173
|
+
}
|
|
174
|
+
.sc-main-menu__appItem {
|
|
175
|
+
border: none;
|
|
176
|
+
background: transparent;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
padding: 0;
|
|
179
|
+
border-radius: 8px;
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: row;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: flex-start;
|
|
184
|
+
gap: 10px;
|
|
185
|
+
color: inherit;
|
|
186
|
+
text-decoration: none;
|
|
187
|
+
width: 100%;
|
|
188
|
+
height: 32px;
|
|
189
|
+
padding: 0 8px;
|
|
190
|
+
transition: background-color 0.15s ease-in-out;
|
|
191
|
+
}
|
|
192
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__appItem {
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
width: 32px;
|
|
196
|
+
height: 32px;
|
|
197
|
+
padding: 0;
|
|
198
|
+
gap: 0;
|
|
199
|
+
}
|
|
200
|
+
.sc-main-menu_theme_light .sc-main-menu__appItem:hover {
|
|
201
|
+
background-color: rgba(231, 233, 238, 0.5);
|
|
202
|
+
}
|
|
203
|
+
.sc-main-menu_theme_dark .sc-main-menu__appItem:hover {
|
|
204
|
+
background-color: rgba(148, 163, 184, 0.25);
|
|
205
|
+
}
|
|
206
|
+
.sc-main-menu_theme_light .sc-main-menu__appItem_active {
|
|
207
|
+
background-color: #e7e9ee;
|
|
208
|
+
}
|
|
209
|
+
.sc-main-menu_theme_dark .sc-main-menu__appItem_active {
|
|
210
|
+
background-color: rgba(96, 165, 250, 0.22);
|
|
211
|
+
}
|
|
212
|
+
.sc-main-menu__appIcon {
|
|
213
|
+
width: 24px;
|
|
214
|
+
height: 24px;
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
flex-shrink: 0;
|
|
219
|
+
}
|
|
220
|
+
.sc-main-menu__appIcon svg {
|
|
221
|
+
width: 20px;
|
|
222
|
+
height: 20px;
|
|
223
|
+
flex-shrink: 0;
|
|
224
|
+
}
|
|
225
|
+
.sc-main-menu__appIcon img {
|
|
226
|
+
width: 20px;
|
|
227
|
+
height: 20px;
|
|
228
|
+
object-fit: contain;
|
|
229
|
+
}
|
|
230
|
+
.sc-main-menu__toggleButton {
|
|
231
|
+
border: none;
|
|
232
|
+
background: transparent;
|
|
233
|
+
cursor: pointer;
|
|
234
|
+
padding: 0 8px;
|
|
235
|
+
border-radius: 8px;
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: row;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: flex-start;
|
|
240
|
+
gap: 10px;
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 32px;
|
|
243
|
+
transition: background-color 0.15s ease-in-out;
|
|
244
|
+
}
|
|
245
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__toggleButton {
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
width: 32px;
|
|
249
|
+
height: 32px;
|
|
250
|
+
padding: 0;
|
|
251
|
+
gap: 0;
|
|
252
|
+
}
|
|
253
|
+
.sc-main-menu__toggleButton:hover {
|
|
254
|
+
background-color: rgba(231, 233, 238, 0.5);
|
|
255
|
+
}
|
|
256
|
+
.sc-main-menu_theme_dark .sc-main-menu__toggleButton:hover {
|
|
257
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
258
|
+
}
|
|
259
|
+
.sc-main-menu_theme_dark .sc-main-menu__toggleButton,
|
|
260
|
+
.sc-main-menu_theme_dark .sc-main-menu__toggleText,
|
|
261
|
+
.sc-main-menu_theme_dark .sc-main-menu__toggleIcon {
|
|
262
|
+
color: #f1f5f9;
|
|
263
|
+
}
|
|
264
|
+
.sc-main-menu__toggleIcon {
|
|
265
|
+
width: 16px;
|
|
266
|
+
height: 16px;
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
justify-content: center;
|
|
270
|
+
flex-shrink: 0;
|
|
271
|
+
}
|
|
272
|
+
.sc-main-menu__toggleIconRotated {
|
|
273
|
+
transform: rotate(180deg);
|
|
274
|
+
}
|
|
275
|
+
.sc-main-menu__toggleText {
|
|
276
|
+
display: none;
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
font-size: 14px;
|
|
279
|
+
line-height: 1.2;
|
|
280
|
+
}
|
|
281
|
+
.sc-main-menu.sc-main-menu_layout_full .sc-main-menu__toggleText {
|
|
282
|
+
display: block;
|
|
283
|
+
}
|
|
284
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__toggleText {
|
|
285
|
+
display: none;
|
|
286
|
+
}
|
|
287
|
+
.sc-main-menu__appName {
|
|
288
|
+
display: none;
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
font-size: 14px;
|
|
291
|
+
line-height: 1.2;
|
|
292
|
+
}
|
|
293
|
+
.sc-main-menu.sc-main-menu_layout_full .sc-main-menu__appName {
|
|
294
|
+
display: block;
|
|
295
|
+
}
|
|
296
|
+
.sc-main-menu.sc-main-menu_layout_compact .sc-main-menu__appName {
|
|
297
|
+
display: none;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* src/components/UpperMenu/styles.css */
|
|
301
|
+
.sc-upper-menu {
|
|
302
|
+
display: flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
justify-content: space-between;
|
|
305
|
+
padding: 8px 0;
|
|
306
|
+
}
|
|
307
|
+
.sc-upper-menu__left {
|
|
308
|
+
display: flex;
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
gap: 2px;
|
|
311
|
+
}
|
|
312
|
+
.sc-upper-menu__right {
|
|
313
|
+
display: flex;
|
|
314
|
+
align-items: center;
|
|
315
|
+
gap: 12px;
|
|
316
|
+
}
|
|
317
|
+
.sc-upper-menu__app {
|
|
318
|
+
background-color: var(--triplex-next-color-brand-0);
|
|
319
|
+
}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, PropsWithChildren, FC } from 'react';
|
|
3
|
+
|
|
4
|
+
type Theme = 'light' | 'dark';
|
|
5
|
+
interface AppDescriptor {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
shortName?: string;
|
|
9
|
+
/** Внешний URL (куда переходим при клике) */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Внутренний роут, если когда-нибудь понадобится */
|
|
12
|
+
routeName?: string;
|
|
13
|
+
/** Локальная иконка в виде React-узла */
|
|
14
|
+
iconNode?: ReactNode;
|
|
15
|
+
/** Старый вариант с URL, можно оставить как fallback */
|
|
16
|
+
iconUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
interface BaseMenuProps {
|
|
19
|
+
apps?: AppDescriptor[];
|
|
20
|
+
activeAppId?: string;
|
|
21
|
+
onAppClick?: (app: AppDescriptor) => void;
|
|
22
|
+
theme?: Theme;
|
|
23
|
+
onThemeToggle?: () => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
systemTitle?: string;
|
|
26
|
+
systemLogoUrl?: string;
|
|
27
|
+
centerOverride?: ReactNode;
|
|
28
|
+
rightSlot?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface MainMenuFullProps extends BaseMenuProps {
|
|
32
|
+
layout?: 'full' | 'compact';
|
|
33
|
+
onLayoutToggle?: () => void;
|
|
34
|
+
}
|
|
35
|
+
declare const MainMenuFull: ({ layout, onLayoutToggle, ...restProps }: MainMenuFullProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface MenuItem {
|
|
38
|
+
client_id: string;
|
|
39
|
+
app_name: string;
|
|
40
|
+
link: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
icon?: string;
|
|
43
|
+
order?: number;
|
|
44
|
+
available?: boolean;
|
|
45
|
+
}
|
|
46
|
+
type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
47
|
+
interface ScMainMenuProps extends Omit<MainMenuFullProps, 'layout' | 'onLayoutToggle' | 'theme' | 'onThemeToggle' | 'apps'> {
|
|
48
|
+
apps?: AppDescriptor[];
|
|
49
|
+
dataUrl?: string;
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
menuId?: string;
|
|
52
|
+
fetchOptions?: RequestInit;
|
|
53
|
+
fetcher?: Fetcher;
|
|
54
|
+
useMockData?: boolean;
|
|
55
|
+
mockData?: MenuItem[];
|
|
56
|
+
onAppsLoaded?: (apps: AppDescriptor[]) => void;
|
|
57
|
+
onError?: (error: unknown) => void;
|
|
58
|
+
iconResolver?: (item: MenuItem, index: number) => AppDescriptor;
|
|
59
|
+
defaultLayout?: 'full' | 'compact';
|
|
60
|
+
layout?: 'full' | 'compact';
|
|
61
|
+
defaultTheme?: Theme;
|
|
62
|
+
theme?: Theme;
|
|
63
|
+
onLayoutChange?: (layout: 'full' | 'compact') => void;
|
|
64
|
+
onThemeChange?: (theme: Theme) => void;
|
|
65
|
+
}
|
|
66
|
+
declare const ScMainMenu: ({ apps, dataUrl, baseUrl, menuId, fetchOptions, fetcher, useMockData, mockData, onAppsLoaded, onError, iconResolver, defaultLayout, layout, onLayoutChange, defaultTheme, theme, onThemeChange, ...rest }: ScMainMenuProps) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
interface LayoutProps extends PropsWithChildren {
|
|
69
|
+
menuProps?: Omit<ScMainMenuProps, 'layout' | 'theme'>;
|
|
70
|
+
initialMenuLayout?: 'full' | 'compact';
|
|
71
|
+
initialTheme?: Theme;
|
|
72
|
+
pageBackgroundColor?: string;
|
|
73
|
+
contentBackgroundColor?: string;
|
|
74
|
+
menuBackgroundColor?: string;
|
|
75
|
+
}
|
|
76
|
+
declare const Layout: ({ children, menuProps, initialMenuLayout, initialTheme, pageBackgroundColor, contentBackgroundColor, menuBackgroundColor, }: LayoutProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface MainMenuBaseProps extends BaseMenuProps {
|
|
79
|
+
layout: 'full' | 'compact';
|
|
80
|
+
onLayoutToggle?: () => void;
|
|
81
|
+
}
|
|
82
|
+
declare const MainMenuBase: ({ layout, apps, activeAppId, onAppClick, theme, onThemeToggle, systemTitle, systemLogoUrl, rightSlot, centerOverride, className, onLayoutToggle, }: MainMenuBaseProps) => react_jsx_runtime.JSX.Element;
|
|
83
|
+
|
|
84
|
+
type PageLabelProps = {
|
|
85
|
+
title: string;
|
|
86
|
+
subtitle: string;
|
|
87
|
+
};
|
|
88
|
+
declare const PageLabel: FC<PageLabelProps>;
|
|
89
|
+
|
|
90
|
+
interface UpperMenuProps {
|
|
91
|
+
title?: string;
|
|
92
|
+
subtitle?: string;
|
|
93
|
+
rightSlot?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
declare const UpperMenu: ({ title, subtitle, rightSlot, }: UpperMenuProps) => react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Получить текущую тему из localStorage
|
|
99
|
+
*/
|
|
100
|
+
declare function getCurrentTheme(): Theme;
|
|
101
|
+
/**
|
|
102
|
+
* Хук для получения текущей темы с автоматическим обновлением
|
|
103
|
+
*/
|
|
104
|
+
declare function useTheme(): Theme;
|
|
105
|
+
|
|
106
|
+
export { type AppDescriptor, type BaseMenuProps, Layout, type LayoutProps, MainMenuBase, MainMenuFull, type MainMenuFullProps, PageLabel, ScMainMenu, type ScMainMenuProps, type Theme, UpperMenu, type UpperMenuProps, getCurrentTheme, useTheme };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, PropsWithChildren, FC } from 'react';
|
|
3
|
+
|
|
4
|
+
type Theme = 'light' | 'dark';
|
|
5
|
+
interface AppDescriptor {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
shortName?: string;
|
|
9
|
+
/** Внешний URL (куда переходим при клике) */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Внутренний роут, если когда-нибудь понадобится */
|
|
12
|
+
routeName?: string;
|
|
13
|
+
/** Локальная иконка в виде React-узла */
|
|
14
|
+
iconNode?: ReactNode;
|
|
15
|
+
/** Старый вариант с URL, можно оставить как fallback */
|
|
16
|
+
iconUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
interface BaseMenuProps {
|
|
19
|
+
apps?: AppDescriptor[];
|
|
20
|
+
activeAppId?: string;
|
|
21
|
+
onAppClick?: (app: AppDescriptor) => void;
|
|
22
|
+
theme?: Theme;
|
|
23
|
+
onThemeToggle?: () => void;
|
|
24
|
+
className?: string;
|
|
25
|
+
systemTitle?: string;
|
|
26
|
+
systemLogoUrl?: string;
|
|
27
|
+
centerOverride?: ReactNode;
|
|
28
|
+
rightSlot?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface MainMenuFullProps extends BaseMenuProps {
|
|
32
|
+
layout?: 'full' | 'compact';
|
|
33
|
+
onLayoutToggle?: () => void;
|
|
34
|
+
}
|
|
35
|
+
declare const MainMenuFull: ({ layout, onLayoutToggle, ...restProps }: MainMenuFullProps) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface MenuItem {
|
|
38
|
+
client_id: string;
|
|
39
|
+
app_name: string;
|
|
40
|
+
link: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
icon?: string;
|
|
43
|
+
order?: number;
|
|
44
|
+
available?: boolean;
|
|
45
|
+
}
|
|
46
|
+
type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
47
|
+
interface ScMainMenuProps extends Omit<MainMenuFullProps, 'layout' | 'onLayoutToggle' | 'theme' | 'onThemeToggle' | 'apps'> {
|
|
48
|
+
apps?: AppDescriptor[];
|
|
49
|
+
dataUrl?: string;
|
|
50
|
+
baseUrl?: string;
|
|
51
|
+
menuId?: string;
|
|
52
|
+
fetchOptions?: RequestInit;
|
|
53
|
+
fetcher?: Fetcher;
|
|
54
|
+
useMockData?: boolean;
|
|
55
|
+
mockData?: MenuItem[];
|
|
56
|
+
onAppsLoaded?: (apps: AppDescriptor[]) => void;
|
|
57
|
+
onError?: (error: unknown) => void;
|
|
58
|
+
iconResolver?: (item: MenuItem, index: number) => AppDescriptor;
|
|
59
|
+
defaultLayout?: 'full' | 'compact';
|
|
60
|
+
layout?: 'full' | 'compact';
|
|
61
|
+
defaultTheme?: Theme;
|
|
62
|
+
theme?: Theme;
|
|
63
|
+
onLayoutChange?: (layout: 'full' | 'compact') => void;
|
|
64
|
+
onThemeChange?: (theme: Theme) => void;
|
|
65
|
+
}
|
|
66
|
+
declare const ScMainMenu: ({ apps, dataUrl, baseUrl, menuId, fetchOptions, fetcher, useMockData, mockData, onAppsLoaded, onError, iconResolver, defaultLayout, layout, onLayoutChange, defaultTheme, theme, onThemeChange, ...rest }: ScMainMenuProps) => react_jsx_runtime.JSX.Element;
|
|
67
|
+
|
|
68
|
+
interface LayoutProps extends PropsWithChildren {
|
|
69
|
+
menuProps?: Omit<ScMainMenuProps, 'layout' | 'theme'>;
|
|
70
|
+
initialMenuLayout?: 'full' | 'compact';
|
|
71
|
+
initialTheme?: Theme;
|
|
72
|
+
pageBackgroundColor?: string;
|
|
73
|
+
contentBackgroundColor?: string;
|
|
74
|
+
menuBackgroundColor?: string;
|
|
75
|
+
}
|
|
76
|
+
declare const Layout: ({ children, menuProps, initialMenuLayout, initialTheme, pageBackgroundColor, contentBackgroundColor, menuBackgroundColor, }: LayoutProps) => react_jsx_runtime.JSX.Element;
|
|
77
|
+
|
|
78
|
+
interface MainMenuBaseProps extends BaseMenuProps {
|
|
79
|
+
layout: 'full' | 'compact';
|
|
80
|
+
onLayoutToggle?: () => void;
|
|
81
|
+
}
|
|
82
|
+
declare const MainMenuBase: ({ layout, apps, activeAppId, onAppClick, theme, onThemeToggle, systemTitle, systemLogoUrl, rightSlot, centerOverride, className, onLayoutToggle, }: MainMenuBaseProps) => react_jsx_runtime.JSX.Element;
|
|
83
|
+
|
|
84
|
+
type PageLabelProps = {
|
|
85
|
+
title: string;
|
|
86
|
+
subtitle: string;
|
|
87
|
+
};
|
|
88
|
+
declare const PageLabel: FC<PageLabelProps>;
|
|
89
|
+
|
|
90
|
+
interface UpperMenuProps {
|
|
91
|
+
title?: string;
|
|
92
|
+
subtitle?: string;
|
|
93
|
+
rightSlot?: ReactNode;
|
|
94
|
+
}
|
|
95
|
+
declare const UpperMenu: ({ title, subtitle, rightSlot, }: UpperMenuProps) => react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Получить текущую тему из localStorage
|
|
99
|
+
*/
|
|
100
|
+
declare function getCurrentTheme(): Theme;
|
|
101
|
+
/**
|
|
102
|
+
* Хук для получения текущей темы с автоматическим обновлением
|
|
103
|
+
*/
|
|
104
|
+
declare function useTheme(): Theme;
|
|
105
|
+
|
|
106
|
+
export { type AppDescriptor, type BaseMenuProps, Layout, type LayoutProps, MainMenuBase, MainMenuFull, type MainMenuFullProps, PageLabel, ScMainMenu, type ScMainMenuProps, type Theme, UpperMenu, type UpperMenuProps, getCurrentTheme, useTheme };
|