@visns-studio/visns-components 4.3.2 → 4.3.4
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/components/crm/Breadcrumb.jsx +31 -28
- package/components/crm/DataGrid.jsx +16 -4
- package/components/crm/Navigation.jsx +3 -7
- package/components/crm/generic/GenericAuth.jsx +2 -0
- package/components/crm/generic/GenericMain.jsx +3 -0
- package/components/crm/styles/Field.module.css +1 -1
- package/package.json +1 -1
|
@@ -6,42 +6,45 @@ function Breadcrumb({ data, page }) {
|
|
|
6
6
|
const getNestedData = (data, keys) =>
|
|
7
7
|
keys.reduce((acc, key) => (acc && acc[key] ? acc[key] : null), data);
|
|
8
8
|
|
|
9
|
+
const nestedData =
|
|
10
|
+
data && page.parentTitleKey
|
|
11
|
+
? getNestedData(data, page.parentTitleKey)
|
|
12
|
+
: null;
|
|
13
|
+
|
|
9
14
|
return (
|
|
10
15
|
<h1>
|
|
11
16
|
{page?.parentTitle && page?.parentUrl && (
|
|
12
17
|
<>
|
|
13
|
-
<Link to={page.parentUrl}>
|
|
14
|
-
|
|
15
|
-
<CircleChevronRight strokeWidth={2} size={18} />
|
|
16
|
-
</Link>
|
|
17
|
-
|
|
18
|
-
{data &&
|
|
19
|
-
page.parentTitleKey &&
|
|
20
|
-
getNestedData(data, page.parentTitleKey) ? (
|
|
21
|
-
<Link
|
|
22
|
-
to={`${page.parentUrl}/${getNestedData(
|
|
23
|
-
data,
|
|
24
|
-
page.parentUrlKey
|
|
25
|
-
)}`}
|
|
26
|
-
>
|
|
27
|
-
{getNestedData(data, page.parentTitleKey)}
|
|
28
|
-
<CircleChevronRight
|
|
29
|
-
strokeWidth={2}
|
|
30
|
-
size={18}
|
|
31
|
-
/>{' '}
|
|
32
|
-
</Link>
|
|
33
|
-
) : null}
|
|
18
|
+
<Link to={page.parentUrl}>{page.parentTitle}</Link>
|
|
19
|
+
<CircleChevronRight strokeWidth={2} size={18} />
|
|
34
20
|
</>
|
|
35
21
|
)}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</Link>{' '}
|
|
39
|
-
{page?.titleKey && data && data[page.titleKey] ? (
|
|
22
|
+
|
|
23
|
+
{nestedData ? (
|
|
40
24
|
<>
|
|
41
|
-
<
|
|
42
|
-
|
|
25
|
+
<Link
|
|
26
|
+
to={`${page.parentUrl}/${getNestedData(
|
|
27
|
+
data,
|
|
28
|
+
page.parentUrlKey
|
|
29
|
+
)}`}
|
|
30
|
+
>
|
|
31
|
+
{nestedData}
|
|
32
|
+
</Link>
|
|
33
|
+
<CircleChevronRight strokeWidth={2} size={18} />
|
|
43
34
|
</>
|
|
44
|
-
) :
|
|
35
|
+
) : (
|
|
36
|
+
page &&
|
|
37
|
+
page.title && (
|
|
38
|
+
<>
|
|
39
|
+
<Link to={page.previousUrl}>{page.title}</Link>
|
|
40
|
+
<CircleChevronRight strokeWidth={2} size={18} />
|
|
41
|
+
</>
|
|
42
|
+
)
|
|
43
|
+
)}
|
|
44
|
+
|
|
45
|
+
{page.titleKey && data && data[page.titleKey] && (
|
|
46
|
+
<>{data[page.titleKey]}</>
|
|
47
|
+
)}
|
|
45
48
|
</h1>
|
|
46
49
|
);
|
|
47
50
|
}
|
|
@@ -173,7 +173,9 @@ const DataGrid = forwardRef(
|
|
|
173
173
|
useEffect(() => {
|
|
174
174
|
setFormData(form);
|
|
175
175
|
}, [form]);
|
|
176
|
+
|
|
176
177
|
/** Table States */
|
|
178
|
+
const dataRef = useRef(null);
|
|
177
179
|
const [dSearch, setDSearch] = useState('');
|
|
178
180
|
const dataSource = useCallback(
|
|
179
181
|
(params) => {
|
|
@@ -187,6 +189,8 @@ const DataGrid = forwardRef(
|
|
|
187
189
|
setTotal(res.count);
|
|
188
190
|
}
|
|
189
191
|
setDataCount(res.count);
|
|
192
|
+
|
|
193
|
+
dataRef.current = res.data;
|
|
190
194
|
});
|
|
191
195
|
|
|
192
196
|
return sqlResult;
|
|
@@ -684,10 +688,18 @@ const DataGrid = forwardRef(
|
|
|
684
688
|
try {
|
|
685
689
|
toast.success('Starting export please wait...');
|
|
686
690
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
+
let payload;
|
|
692
|
+
|
|
693
|
+
if (form.export.useData) {
|
|
694
|
+
payload = { data: dataRef.current };
|
|
695
|
+
} else {
|
|
696
|
+
payload = {
|
|
697
|
+
filter: filterValue,
|
|
698
|
+
paramId: paramValue || '',
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const res = await Download(form.export.url, 'POST', payload);
|
|
691
703
|
|
|
692
704
|
if (res.data.error) {
|
|
693
705
|
toast.error(res.data.error);
|
|
@@ -325,19 +325,15 @@ function Navigation({
|
|
|
325
325
|
return () => {
|
|
326
326
|
window.removeEventListener('scroll', handleScroll);
|
|
327
327
|
};
|
|
328
|
+
|
|
329
|
+
console.info(layout);
|
|
328
330
|
}, []);
|
|
329
331
|
|
|
330
332
|
return layout === 'simple' || layout === 'cms' ? (
|
|
331
333
|
<div className="cwrap">
|
|
332
334
|
<aside
|
|
333
335
|
className={
|
|
334
|
-
|
|
335
|
-
? isOpen
|
|
336
|
-
? 'aside--cms'
|
|
337
|
-
: 'aside--cms aside--cms--open'
|
|
338
|
-
: isOpen
|
|
339
|
-
? 'aside'
|
|
340
|
-
: 'aside aside--open'
|
|
336
|
+
isOpen ? 'aside--cms' : 'aside--cms aside--cms--open'
|
|
341
337
|
}
|
|
342
338
|
>
|
|
343
339
|
<div className="logo">
|
|
@@ -27,6 +27,7 @@ const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const GenericAuth = ({
|
|
30
|
+
layout = 'full',
|
|
30
31
|
logo,
|
|
31
32
|
headerLogo,
|
|
32
33
|
providers,
|
|
@@ -106,6 +107,7 @@ const GenericAuth = ({
|
|
|
106
107
|
path="/*"
|
|
107
108
|
element={
|
|
108
109
|
<GenericMain
|
|
110
|
+
layout={layout}
|
|
109
111
|
logo={headerLogo}
|
|
110
112
|
navigation={navigation}
|
|
111
113
|
routeConfig={routeConfig}
|
|
@@ -4,8 +4,10 @@ import { Routes, Route, Navigate } from 'react-router-dom';
|
|
|
4
4
|
import Call from '../Call';
|
|
5
5
|
import Loader from '../Loader';
|
|
6
6
|
import Navigation from '../Navigation';
|
|
7
|
+
import { FullScreen } from 'akar-icons';
|
|
7
8
|
|
|
8
9
|
const GenericMain = ({
|
|
10
|
+
layout = 'full',
|
|
9
11
|
logo,
|
|
10
12
|
navigation,
|
|
11
13
|
routeConfig,
|
|
@@ -65,6 +67,7 @@ const GenericMain = ({
|
|
|
65
67
|
<div>
|
|
66
68
|
<header className="header">
|
|
67
69
|
<Navigation
|
|
70
|
+
layout={layout}
|
|
68
71
|
logo={logo}
|
|
69
72
|
navConfig={navigation}
|
|
70
73
|
setSystemAuth={setSystemAuth}
|
package/package.json
CHANGED