@visns-studio/visns-components 4.7.0 → 4.7.2
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/dist/104e5636d8ddb791614c.woff2 +0 -0
- package/dist/11fe6a83d647de5daf95.woff +0 -0
- package/dist/141e2a8c7836495afe2a.woff +0 -0
- package/dist/2ba5877f7079830b5383.woff +0 -0
- package/dist/2d6836f45b2037be41f3.woff +0 -0
- package/dist/399.0a0f3e0d21be1057d599.css +8 -0
- package/dist/399.b8f57fa3f8c0c10119e4.js +1 -0
- package/dist/47d566c3b1293dfd9d77.woff +0 -0
- package/dist/6282a13cbba671a71913.woff2 +0 -0
- package/dist/78266f551031aa9db127.woff +0 -0
- package/dist/7b7da89f1e3fdcbfe36c.woff2 +0 -0
- package/dist/7e78e8338af7efeda712.woff2 +0 -0
- package/dist/7fa387951673abf164b1.woff2 +0 -0
- package/dist/819d59862c2d0640aad8.woff +0 -0
- package/dist/b615e1a6c838ea059a56.woff +0 -0
- package/dist/b9b1aa739c660c4ce67c.woff2 +0 -0
- package/dist/c5f3640b11df9414facb.woff +0 -0
- package/dist/da26d162ff5af71d6590.woff2 +0 -0
- package/dist/dd5b2912dbf896310865.woff2 +0 -0
- package/dist/f282b331272463c1aa6c.woff2 +0 -0
- package/dist/index.css +2902 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +150 -0
- package/dist/main.83b033670d64419bb497.css +1 -0
- package/dist/main.b1723d17cd2d3513ab62.js +1 -0
- package/dist/report.html +39 -0
- package/dist/runtime.33c276593b23f8035b8d.js +1 -0
- package/package.json +26 -6
- package/.idea/codeStyles/Project.xml +0 -50
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/deployment.xml +0 -4
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -19
- package/.idea/vcs.xml +0 -6
- package/.idea/visns-components.iml +0 -8
- package/.prettierrc.json +0 -7
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/releases/yarn-3.6.1.cjs +0 -874
- package/.yarnrc.yml +0 -7
- package/components/cms/DataGrid.jsx +0 -1461
- package/components/cms/DropZone.jsx +0 -349
- package/components/cms/Field.jsx +0 -802
- package/components/cms/Form.jsx +0 -476
- package/components/cms/generic/CmsDetail.jsx +0 -36
- package/components/cms/generic/CmsIndex.jsx +0 -73
- package/components/cms/generic/CmsSort.jsx +0 -125
- package/components/cms/sorting/Item.jsx +0 -115
- package/components/cms/sorting/List.jsx +0 -30
- package/components/crm/AsyncSelect.jsx +0 -125
- package/components/crm/Autocomplete.jsx +0 -174
- package/components/crm/Breadcrumb.jsx +0 -52
- package/components/crm/Call.jsx +0 -220
- package/components/crm/DataGrid.jsx +0 -2701
- package/components/crm/Download.jsx +0 -101
- package/components/crm/Fetch.jsx +0 -119
- package/components/crm/Field.jsx +0 -1557
- package/components/crm/Form.jsx +0 -1409
- package/components/crm/Loader.jsx +0 -29
- package/components/crm/MultiSelect.jsx +0 -78
- package/components/crm/Navigation.jsx +0 -619
- package/components/crm/Notification.jsx +0 -197
- package/components/crm/QrCode.jsx +0 -83
- package/components/crm/Select.jsx +0 -58
- package/components/crm/SelectList.jsx +0 -21
- package/components/crm/TableFilter.jsx +0 -198
- package/components/crm/auth/Login.jsx +0 -223
- package/components/crm/auth/Profile.jsx +0 -280
- package/components/crm/auth/Reset.jsx +0 -111
- package/components/crm/auth/Verify.jsx +0 -174
- package/components/crm/auth/styles/Login.module.css +0 -243
- package/components/crm/auth/styles/Profile.module.css +0 -222
- package/components/crm/auth/styles/Reset.module.css +0 -216
- package/components/crm/auth/styles/Verify.module.css +0 -216
- package/components/crm/generic/AuditLog.jsx +0 -108
- package/components/crm/generic/AuditLogs.jsx +0 -115
- package/components/crm/generic/GenericAuth.jsx +0 -166
- package/components/crm/generic/GenericDashboard.jsx +0 -42
- package/components/crm/generic/GenericDetail.jsx +0 -1499
- package/components/crm/generic/GenericDynamic.jsx +0 -915
- package/components/crm/generic/GenericFormBuilder.jsx +0 -1765
- package/components/crm/generic/GenericIndex.jsx +0 -376
- package/components/crm/generic/GenericMain.jsx +0 -129
- package/components/crm/generic/GenericSort.jsx +0 -188
- package/components/crm/generic/NotificationList.jsx +0 -64
- package/components/crm/generic/styles/AuditLog.module.css +0 -147
- package/components/crm/generic/styles/AuditLogs.module.css +0 -92
- package/components/crm/generic/styles/GenericDetail.module.css +0 -634
- package/components/crm/generic/styles/GenericDynamic.module.css +0 -932
- package/components/crm/generic/styles/GenericFormBuilder.module.css +0 -944
- package/components/crm/generic/styles/GenericIndex.module.css +0 -247
- package/components/crm/generic/styles/GenericMain.module.css +0 -91
- package/components/crm/generic/styles/GenericSort.module.css +0 -123
- package/components/crm/generic/styles/NotificationList.module.css +0 -67
- package/components/crm/sorting/Item.jsx +0 -117
- package/components/crm/sorting/List.jsx +0 -32
- package/components/crm/sorting/styles/Item.module.css +0 -68
- package/components/crm/sorting/styles/List.module.css +0 -68
- package/components/crm/styles/AsyncSelect.module.css +0 -8
- package/components/crm/styles/Autocomplete.module.css +0 -44
- package/components/crm/styles/DataGrid.module.css +0 -210
- package/components/crm/styles/Field.module.css +0 -311
- package/components/crm/styles/Form.module.css +0 -499
- package/components/crm/styles/Loader.module.css +0 -94
- package/components/crm/styles/MultiSelect.module.css +0 -8
- package/components/crm/styles/Navigation.module.css +0 -978
- package/components/crm/styles/Notification.module.css +0 -147
- package/components/crm/styles/QrCode.module.css +0 -87
- package/components/crm/styles/TableFilter.module.css +0 -52
- package/components/styles/global.css +0 -73
- package/index.js +0 -86
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
useNavigate,
|
|
4
|
-
useLocation,
|
|
5
|
-
Routes,
|
|
6
|
-
Route,
|
|
7
|
-
Navigate,
|
|
8
|
-
Outlet,
|
|
9
|
-
} from 'react-router-dom';
|
|
10
|
-
import { ToastContainer } from 'react-toastify';
|
|
11
|
-
import { Tooltip } from 'react-tooltip';
|
|
12
|
-
import 'react-tooltip/dist/react-tooltip.css';
|
|
13
|
-
import 'react-toastify/dist/ReactToastify.css';
|
|
14
|
-
|
|
15
|
-
import CustomFetch from '../Fetch';
|
|
16
|
-
import GenericMain from './GenericMain';
|
|
17
|
-
import Login from '../auth/Login';
|
|
18
|
-
import Reset from '../auth/Reset';
|
|
19
|
-
import Verify from '../auth/Verify';
|
|
20
|
-
|
|
21
|
-
const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
|
|
22
|
-
const location = useLocation();
|
|
23
|
-
|
|
24
|
-
return loading ? null : !user || !user.id ? (
|
|
25
|
-
<Navigate
|
|
26
|
-
to={redirectPath}
|
|
27
|
-
replace
|
|
28
|
-
state={{ previousUrl: location.pathname }}
|
|
29
|
-
/>
|
|
30
|
-
) : (
|
|
31
|
-
<Outlet />
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const GenericAuth = ({
|
|
36
|
-
layout = 'full',
|
|
37
|
-
loginBg,
|
|
38
|
-
logo,
|
|
39
|
-
headerLogo,
|
|
40
|
-
providers,
|
|
41
|
-
navigation,
|
|
42
|
-
routeConfig,
|
|
43
|
-
themeType = 'primary',
|
|
44
|
-
}) => {
|
|
45
|
-
const navigate = useNavigate();
|
|
46
|
-
const location = useLocation();
|
|
47
|
-
const [userProfile, setUserProfile] = useState({});
|
|
48
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
49
|
-
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
|
50
|
-
|
|
51
|
-
const updateAuthStatus = async () => {
|
|
52
|
-
try {
|
|
53
|
-
const { data } = await CustomFetch('/ajax/user/profile', 'GET');
|
|
54
|
-
setUserProfile(data);
|
|
55
|
-
setIsAuthenticated(true);
|
|
56
|
-
setIsLoading(false);
|
|
57
|
-
|
|
58
|
-
if (location.pathname.split('/')[1] === 'login') {
|
|
59
|
-
navigate('/', { replace: true });
|
|
60
|
-
}
|
|
61
|
-
} catch (error) {
|
|
62
|
-
setIsLoading(false);
|
|
63
|
-
if (['Unauthenticatdata.'].includes(error)) {
|
|
64
|
-
const currentUrl = window.location.pathname;
|
|
65
|
-
|
|
66
|
-
setIsAuthenticated(false);
|
|
67
|
-
navigate('/login', { state: { previousUrl: currentUrl } });
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
updateAuthStatus();
|
|
74
|
-
}, [isAuthenticated]);
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<>
|
|
78
|
-
<Routes>
|
|
79
|
-
<Route
|
|
80
|
-
path="login"
|
|
81
|
-
element={
|
|
82
|
-
<LoginComponent
|
|
83
|
-
loginBg={loginBg}
|
|
84
|
-
logo={logo}
|
|
85
|
-
providers={providers}
|
|
86
|
-
setIsAuthenticated={setIsAuthenticated}
|
|
87
|
-
setUserProfile={setUserProfile}
|
|
88
|
-
/>
|
|
89
|
-
}
|
|
90
|
-
/>
|
|
91
|
-
<Route
|
|
92
|
-
path="reset"
|
|
93
|
-
element={
|
|
94
|
-
<ResetComponent
|
|
95
|
-
loginBg={loginBg}
|
|
96
|
-
logo={logo}
|
|
97
|
-
setIsAuthenticated={setIsAuthenticated}
|
|
98
|
-
/>
|
|
99
|
-
}
|
|
100
|
-
/>
|
|
101
|
-
<Route
|
|
102
|
-
path="verify/:code"
|
|
103
|
-
element={
|
|
104
|
-
<VerifyComponent
|
|
105
|
-
loginBg={loginBg}
|
|
106
|
-
logo={logo}
|
|
107
|
-
setIsAuthenticated={setIsAuthenticated}
|
|
108
|
-
/>
|
|
109
|
-
}
|
|
110
|
-
/>
|
|
111
|
-
<Route
|
|
112
|
-
element={
|
|
113
|
-
<ProtectedRoute
|
|
114
|
-
user={userProfile}
|
|
115
|
-
loading={isLoading}
|
|
116
|
-
/>
|
|
117
|
-
}
|
|
118
|
-
>
|
|
119
|
-
<Route
|
|
120
|
-
path="/*"
|
|
121
|
-
element={
|
|
122
|
-
<GenericMain
|
|
123
|
-
layout={layout}
|
|
124
|
-
logo={headerLogo}
|
|
125
|
-
navigation={navigation}
|
|
126
|
-
routeConfig={routeConfig}
|
|
127
|
-
setUserProfile={setUserProfile}
|
|
128
|
-
setSystemAuth={setIsAuthenticated}
|
|
129
|
-
themeType={themeType}
|
|
130
|
-
userProfile={userProfile}
|
|
131
|
-
/>
|
|
132
|
-
}
|
|
133
|
-
/>
|
|
134
|
-
</Route>
|
|
135
|
-
</Routes>
|
|
136
|
-
<ToastContainer
|
|
137
|
-
theme="light"
|
|
138
|
-
position="bottom-center"
|
|
139
|
-
style={{ width: '600px' }}
|
|
140
|
-
/>
|
|
141
|
-
<Tooltip id="system-tooltip" />
|
|
142
|
-
</>
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
const LoginComponent = React.memo(
|
|
147
|
-
({ loginBg, logo, providers, setIsAuthenticated, setUserProfile }) => (
|
|
148
|
-
<Login
|
|
149
|
-
loginBg={loginBg}
|
|
150
|
-
logo={logo}
|
|
151
|
-
providers={providers}
|
|
152
|
-
setSystemAuth={setIsAuthenticated}
|
|
153
|
-
setUserProfile={setUserProfile}
|
|
154
|
-
/>
|
|
155
|
-
)
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
const ResetComponent = React.memo(({ loginBg, logo, setIsAuthenticated }) => (
|
|
159
|
-
<Reset loginBg={loginBg} logo={logo} setSystemAuth={setIsAuthenticated} />
|
|
160
|
-
));
|
|
161
|
-
|
|
162
|
-
const VerifyComponent = React.memo(({ loginBg, logo, setIsAuthenticated }) => (
|
|
163
|
-
<Verify loginBg={loginBg} logo={logo} setSystemAuth={setIsAuthenticated} />
|
|
164
|
-
));
|
|
165
|
-
|
|
166
|
-
export default GenericAuth;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { toast } from 'react-toastify';
|
|
3
|
-
import CustomFetch from '../../crm/Fetch';
|
|
4
|
-
|
|
5
|
-
const GenericDashboard = ({ userProfile }) => {
|
|
6
|
-
const [data, setData] = useState([]);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div className="grid">
|
|
10
|
-
<div className="grid__row">
|
|
11
|
-
<div className="grid__three dashtopwidge">
|
|
12
|
-
<div className="dashtopwidge__left">
|
|
13
|
-
<h2>
|
|
14
|
-
Current
|
|
15
|
-
<span>
|
|
16
|
-
<strong>Enquiries</strong>
|
|
17
|
-
</span>
|
|
18
|
-
</h2>
|
|
19
|
-
</div>
|
|
20
|
-
<div className="dashtopwidge__right">
|
|
21
|
-
<span>0</span>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
<div className="grid__three dashtopwidge">
|
|
25
|
-
<div className="dashtopwidge__left">
|
|
26
|
-
<h2>
|
|
27
|
-
Current{' '}
|
|
28
|
-
<span>
|
|
29
|
-
<strong>Enquiries</strong>
|
|
30
|
-
</span>
|
|
31
|
-
</h2>
|
|
32
|
-
</div>
|
|
33
|
-
<div className="dashtopwidge__right">
|
|
34
|
-
<span>0</span>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default GenericDashboard;
|