cynx-lib 1.3.80 → 1.3.81
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/gen.js +77 -77
- package/package.json +1 -1
- package/ui/components/Drawer.jsx +208 -208
- package/ui/components/Layout.jsx +138 -138
- package/ui/components/LoginPage.jsx +405 -405
- package/ui/components/Pagination.jsx +145 -145
- package/ui/components/PrivacyBlur.jsx +603 -603
- package/ui/components/Sidebar.jsx +820 -820
- package/utils/index.js +20 -20
- package/utils/utils/duration.js +139 -139
- package/utils/utils/oidc.js +214 -214
- package/utils/utils/realtime.js +1634 -1634
- package/utils/utils/session.js +58 -58
- package/utils/utils/storage.js +393 -393
- package/utils/utils/storage_manager.cjs +55 -4
- package/utils/utils/storage_manager.js +64 -4
- package/utils/utils/ui.js +111 -111
- package/vue/components/Badge.vue +79 -79
- package/vue/components/Button.vue +209 -209
- package/vue/components/Checkbox.vue +103 -103
- package/vue/components/CircularProgress.vue +383 -383
- package/vue/components/Divider.vue +94 -94
- package/vue/components/Drawer.vue +243 -243
- package/vue/components/InfoBadge.vue +223 -223
- package/vue/components/Input.vue +341 -341
- package/vue/components/LinearProgress.vue +268 -268
- package/vue/components/Modal.vue +226 -226
- package/vue/components/Pagination.vue +199 -199
- package/vue/components/Select.vue +713 -713
- package/vue/components/Sidebar.vue +955 -955
- package/vue/components/Skeleton.vue +91 -91
- package/vue/components/Spinner.vue +263 -263
- package/vue/components/StatusTag.vue +89 -89
- package/vue/components/TabBar.vue +176 -176
- package/vue/components/Table.vue +388 -388
- package/vue/components/TimePicker.vue +399 -399
- package/vue/components/Toggle.vue +115 -115
- package/vue/components/XTable.vue +119 -119
- package/vue/composables/useAutoSkeletonRows.ts +71 -71
- package/vue/index.d.ts +67 -67
- package/vue/index.js +86 -86
package/ui/components/Layout.jsx
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Outlet } from 'react-router-dom';
|
|
3
|
-
import Sidebar, { isDarkColor } from './Sidebar.jsx';
|
|
4
|
-
import { ConfirmRoot } from './Confirm.jsx';
|
|
5
|
-
|
|
6
|
-
export { isDarkColor };
|
|
7
|
-
|
|
8
|
-
export default function Layout({
|
|
9
|
-
brand,
|
|
10
|
-
navSections = [],
|
|
11
|
-
navItems = [],
|
|
12
|
-
user,
|
|
13
|
-
onLogout,
|
|
14
|
-
onLock,
|
|
15
|
-
collapsible = true,
|
|
16
|
-
isCollapsed,
|
|
17
|
-
onToggleCollapse,
|
|
18
|
-
storageKey = 'app_sidebar_collapsed',
|
|
19
|
-
// Sidebar styling props
|
|
20
|
-
sidebarBg,
|
|
21
|
-
sidebarColor,
|
|
22
|
-
sidebarMutedColor,
|
|
23
|
-
sidebarBorder,
|
|
24
|
-
sidebarStyle = {},
|
|
25
|
-
sidebarClassName,
|
|
26
|
-
// Active states
|
|
27
|
-
activeBg,
|
|
28
|
-
activeColor,
|
|
29
|
-
activeSubBg,
|
|
30
|
-
activeSubColor,
|
|
31
|
-
subItemsIndent = 12,
|
|
32
|
-
// Topbar
|
|
33
|
-
topbarLeft,
|
|
34
|
-
topbarCenter,
|
|
35
|
-
topbarRight,
|
|
36
|
-
hasPermission = () => true,
|
|
37
|
-
outletContext,
|
|
38
|
-
contentStyle = {},
|
|
39
|
-
contentClassName,
|
|
40
|
-
children,
|
|
41
|
-
}) {
|
|
42
|
-
return (
|
|
43
|
-
<div
|
|
44
|
-
style={{
|
|
45
|
-
display: 'flex',
|
|
46
|
-
height: '100vh',
|
|
47
|
-
width: '100vw',
|
|
48
|
-
overflow: 'hidden',
|
|
49
|
-
background: 'var(--bg, #ffffff)',
|
|
50
|
-
color: 'var(--primary-text, #09090b)',
|
|
51
|
-
fontFamily: 'var(--sans, inherit)',
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
{/* Standalone Reusable Sidebar Component */}
|
|
55
|
-
<Sidebar
|
|
56
|
-
brand={brand}
|
|
57
|
-
navSections={navSections}
|
|
58
|
-
navItems={navItems}
|
|
59
|
-
user={user}
|
|
60
|
-
onLogout={onLogout}
|
|
61
|
-
onLock={onLock}
|
|
62
|
-
collapsible={collapsible}
|
|
63
|
-
isCollapsed={isCollapsed}
|
|
64
|
-
onToggleCollapse={onToggleCollapse}
|
|
65
|
-
storageKey={storageKey}
|
|
66
|
-
sidebarBg={sidebarBg}
|
|
67
|
-
sidebarColor={sidebarColor}
|
|
68
|
-
sidebarMutedColor={sidebarMutedColor}
|
|
69
|
-
sidebarBorder={sidebarBorder}
|
|
70
|
-
sidebarStyle={sidebarStyle}
|
|
71
|
-
sidebarClassName={sidebarClassName}
|
|
72
|
-
activeBg={activeBg}
|
|
73
|
-
activeColor={activeColor}
|
|
74
|
-
activeSubBg={activeSubBg}
|
|
75
|
-
activeSubColor={activeSubColor}
|
|
76
|
-
subItemsIndent={subItemsIndent}
|
|
77
|
-
hasPermission={hasPermission}
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
{/* Main Content Area */}
|
|
81
|
-
<div
|
|
82
|
-
style={{
|
|
83
|
-
flex: 1,
|
|
84
|
-
display: 'flex',
|
|
85
|
-
flexDirection: 'column',
|
|
86
|
-
height: '100vh',
|
|
87
|
-
overflow: 'hidden',
|
|
88
|
-
minWidth: 0,
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
91
|
-
{/* Top Navbar Header */}
|
|
92
|
-
<header
|
|
93
|
-
style={{
|
|
94
|
-
height: 56,
|
|
95
|
-
minHeight: 56,
|
|
96
|
-
borderBottom: '1px solid var(--border-light, #f4f4f5)',
|
|
97
|
-
background: 'var(--surface, #ffffff)',
|
|
98
|
-
display: 'flex',
|
|
99
|
-
alignItems: 'center',
|
|
100
|
-
justifyContent: 'space-between',
|
|
101
|
-
padding: '0 24px',
|
|
102
|
-
flexShrink: 0,
|
|
103
|
-
boxSizing: 'border-box',
|
|
104
|
-
}}
|
|
105
|
-
>
|
|
106
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
|
107
|
-
{topbarLeft}
|
|
108
|
-
</div>
|
|
109
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
|
110
|
-
{topbarCenter}
|
|
111
|
-
</div>
|
|
112
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginLeft: 'auto' }}>
|
|
113
|
-
{topbarRight}
|
|
114
|
-
</div>
|
|
115
|
-
</header>
|
|
116
|
-
|
|
117
|
-
{/* Content Area */}
|
|
118
|
-
<main
|
|
119
|
-
className={contentClassName}
|
|
120
|
-
style={{
|
|
121
|
-
flex: 1,
|
|
122
|
-
display: 'flex',
|
|
123
|
-
flexDirection: 'column',
|
|
124
|
-
minHeight: 0,
|
|
125
|
-
overflowY: 'auto',
|
|
126
|
-
background: 'var(--bg, #ffffff)',
|
|
127
|
-
boxSizing: 'border-box',
|
|
128
|
-
...contentStyle,
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
{children || <Outlet context={outletContext} />}
|
|
132
|
-
</main>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<ConfirmRoot />
|
|
136
|
-
</div>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
3
|
+
import Sidebar, { isDarkColor } from './Sidebar.jsx';
|
|
4
|
+
import { ConfirmRoot } from './Confirm.jsx';
|
|
5
|
+
|
|
6
|
+
export { isDarkColor };
|
|
7
|
+
|
|
8
|
+
export default function Layout({
|
|
9
|
+
brand,
|
|
10
|
+
navSections = [],
|
|
11
|
+
navItems = [],
|
|
12
|
+
user,
|
|
13
|
+
onLogout,
|
|
14
|
+
onLock,
|
|
15
|
+
collapsible = true,
|
|
16
|
+
isCollapsed,
|
|
17
|
+
onToggleCollapse,
|
|
18
|
+
storageKey = 'app_sidebar_collapsed',
|
|
19
|
+
// Sidebar styling props
|
|
20
|
+
sidebarBg,
|
|
21
|
+
sidebarColor,
|
|
22
|
+
sidebarMutedColor,
|
|
23
|
+
sidebarBorder,
|
|
24
|
+
sidebarStyle = {},
|
|
25
|
+
sidebarClassName,
|
|
26
|
+
// Active states
|
|
27
|
+
activeBg,
|
|
28
|
+
activeColor,
|
|
29
|
+
activeSubBg,
|
|
30
|
+
activeSubColor,
|
|
31
|
+
subItemsIndent = 12,
|
|
32
|
+
// Topbar
|
|
33
|
+
topbarLeft,
|
|
34
|
+
topbarCenter,
|
|
35
|
+
topbarRight,
|
|
36
|
+
hasPermission = () => true,
|
|
37
|
+
outletContext,
|
|
38
|
+
contentStyle = {},
|
|
39
|
+
contentClassName,
|
|
40
|
+
children,
|
|
41
|
+
}) {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
display: 'flex',
|
|
46
|
+
height: '100vh',
|
|
47
|
+
width: '100vw',
|
|
48
|
+
overflow: 'hidden',
|
|
49
|
+
background: 'var(--bg, #ffffff)',
|
|
50
|
+
color: 'var(--primary-text, #09090b)',
|
|
51
|
+
fontFamily: 'var(--sans, inherit)',
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{/* Standalone Reusable Sidebar Component */}
|
|
55
|
+
<Sidebar
|
|
56
|
+
brand={brand}
|
|
57
|
+
navSections={navSections}
|
|
58
|
+
navItems={navItems}
|
|
59
|
+
user={user}
|
|
60
|
+
onLogout={onLogout}
|
|
61
|
+
onLock={onLock}
|
|
62
|
+
collapsible={collapsible}
|
|
63
|
+
isCollapsed={isCollapsed}
|
|
64
|
+
onToggleCollapse={onToggleCollapse}
|
|
65
|
+
storageKey={storageKey}
|
|
66
|
+
sidebarBg={sidebarBg}
|
|
67
|
+
sidebarColor={sidebarColor}
|
|
68
|
+
sidebarMutedColor={sidebarMutedColor}
|
|
69
|
+
sidebarBorder={sidebarBorder}
|
|
70
|
+
sidebarStyle={sidebarStyle}
|
|
71
|
+
sidebarClassName={sidebarClassName}
|
|
72
|
+
activeBg={activeBg}
|
|
73
|
+
activeColor={activeColor}
|
|
74
|
+
activeSubBg={activeSubBg}
|
|
75
|
+
activeSubColor={activeSubColor}
|
|
76
|
+
subItemsIndent={subItemsIndent}
|
|
77
|
+
hasPermission={hasPermission}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
{/* Main Content Area */}
|
|
81
|
+
<div
|
|
82
|
+
style={{
|
|
83
|
+
flex: 1,
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'column',
|
|
86
|
+
height: '100vh',
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
minWidth: 0,
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
{/* Top Navbar Header */}
|
|
92
|
+
<header
|
|
93
|
+
style={{
|
|
94
|
+
height: 56,
|
|
95
|
+
minHeight: 56,
|
|
96
|
+
borderBottom: '1px solid var(--border-light, #f4f4f5)',
|
|
97
|
+
background: 'var(--surface, #ffffff)',
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
justifyContent: 'space-between',
|
|
101
|
+
padding: '0 24px',
|
|
102
|
+
flexShrink: 0,
|
|
103
|
+
boxSizing: 'border-box',
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
|
107
|
+
{topbarLeft}
|
|
108
|
+
</div>
|
|
109
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
|
|
110
|
+
{topbarCenter}
|
|
111
|
+
</div>
|
|
112
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginLeft: 'auto' }}>
|
|
113
|
+
{topbarRight}
|
|
114
|
+
</div>
|
|
115
|
+
</header>
|
|
116
|
+
|
|
117
|
+
{/* Content Area */}
|
|
118
|
+
<main
|
|
119
|
+
className={contentClassName}
|
|
120
|
+
style={{
|
|
121
|
+
flex: 1,
|
|
122
|
+
display: 'flex',
|
|
123
|
+
flexDirection: 'column',
|
|
124
|
+
minHeight: 0,
|
|
125
|
+
overflowY: 'auto',
|
|
126
|
+
background: 'var(--bg, #ffffff)',
|
|
127
|
+
boxSizing: 'border-box',
|
|
128
|
+
...contentStyle,
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
{children || <Outlet context={outletContext} />}
|
|
132
|
+
</main>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<ConfirmRoot />
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|