@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,101 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import { trackPromise } from 'react-promise-tracker';
|
|
4
|
-
import { toast } from 'react-toastify';
|
|
5
|
-
import parse from 'html-react-parser';
|
|
6
|
-
|
|
7
|
-
const CustomDownload = (
|
|
8
|
-
url,
|
|
9
|
-
method,
|
|
10
|
-
formData,
|
|
11
|
-
successCallback = null,
|
|
12
|
-
errorCallback = null
|
|
13
|
-
) => {
|
|
14
|
-
let headers = {};
|
|
15
|
-
let options = {};
|
|
16
|
-
|
|
17
|
-
if (method.toUpperCase() === 'PUT' || method.toUpperCase() === 'PATCH') {
|
|
18
|
-
formData = { ...formData, _method: method };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (!(formData instanceof FormData)) {
|
|
22
|
-
headers['Content-Type'] = 'application/json';
|
|
23
|
-
formData = JSON.stringify(formData);
|
|
24
|
-
} else {
|
|
25
|
-
headers['Content-Type'] = 'multipart/form-data';
|
|
26
|
-
headers.contentType = false;
|
|
27
|
-
headers.processData = false;
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
method.toUpperCase() === 'PUT' ||
|
|
31
|
-
method.toUpperCase() === 'PATCH'
|
|
32
|
-
) {
|
|
33
|
-
formData.append('_method', method);
|
|
34
|
-
method = 'POST';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
options = {
|
|
39
|
-
method: method,
|
|
40
|
-
data: formData,
|
|
41
|
-
headers: headers,
|
|
42
|
-
url: url,
|
|
43
|
-
responseType: 'blob',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return trackPromise(
|
|
47
|
-
new Promise((resolve, reject) => {
|
|
48
|
-
axios(options)
|
|
49
|
-
.then((response) => {
|
|
50
|
-
if (successCallback) {
|
|
51
|
-
successCallback(response.data);
|
|
52
|
-
} else {
|
|
53
|
-
const error = response.data.error;
|
|
54
|
-
|
|
55
|
-
if (error && error !== '') {
|
|
56
|
-
toast.error(<div>{parse(error)}</div>);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
resolve(response);
|
|
60
|
-
})
|
|
61
|
-
.catch((error) => {
|
|
62
|
-
let errorMessage = '';
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
error.response &&
|
|
66
|
-
error.response.data &&
|
|
67
|
-
error.response.data.message
|
|
68
|
-
) {
|
|
69
|
-
const { data } = error.response;
|
|
70
|
-
|
|
71
|
-
if (data.errors) {
|
|
72
|
-
const { errors } = data;
|
|
73
|
-
|
|
74
|
-
Object.values(errors).forEach((errorArray) => {
|
|
75
|
-
errorArray.forEach((errorMsg) => {
|
|
76
|
-
errorMessage += `${errorMsg}<br />`;
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
} else {
|
|
80
|
-
if (data.message === 'CSRF token mismatch.') {
|
|
81
|
-
window.location.replace('/login');
|
|
82
|
-
} else {
|
|
83
|
-
errorMessage = data.message;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
errorMessage = error.message;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (errorCallback) {
|
|
91
|
-
errorCallback(errorMessage);
|
|
92
|
-
} else {
|
|
93
|
-
toast.error(<div>{parse(errorMessage)}</div>);
|
|
94
|
-
}
|
|
95
|
-
reject(error);
|
|
96
|
-
});
|
|
97
|
-
})
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export default CustomDownload;
|
package/components/crm/Fetch.jsx
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import { trackPromise } from 'react-promise-tracker';
|
|
4
|
-
import { toast } from 'react-toastify';
|
|
5
|
-
import parse from 'html-react-parser';
|
|
6
|
-
|
|
7
|
-
const CustomFetch = (
|
|
8
|
-
url,
|
|
9
|
-
method,
|
|
10
|
-
formData,
|
|
11
|
-
successCallback = null,
|
|
12
|
-
errorCallback = null
|
|
13
|
-
) => {
|
|
14
|
-
const baseUrl = '';
|
|
15
|
-
const headers = {
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
};
|
|
18
|
-
const MAX_PAYLOAD_SIZE_MB =
|
|
19
|
-
parseFloat(import.meta.env.VITE_MAX_PAYLOAD_SIZE_MB) || 4.5;
|
|
20
|
-
const MAX_PAYLOAD_SIZE = MAX_PAYLOAD_SIZE_MB * 1024 * 1024; // Convert MB to bytes
|
|
21
|
-
|
|
22
|
-
// Estimate headers size
|
|
23
|
-
const headersSize = JSON.stringify(headers).length;
|
|
24
|
-
|
|
25
|
-
// Estimate cookies size (if any)
|
|
26
|
-
const cookies = document.cookie;
|
|
27
|
-
const cookiesSize = cookies ? cookies.length : 0;
|
|
28
|
-
|
|
29
|
-
// Check payload size
|
|
30
|
-
const payloadSize = new Blob([JSON.stringify(formData)]).size;
|
|
31
|
-
const totalRequestSize = payloadSize + headersSize + cookiesSize;
|
|
32
|
-
|
|
33
|
-
if (totalRequestSize > MAX_PAYLOAD_SIZE) {
|
|
34
|
-
const errorMessage =
|
|
35
|
-
'The request is too large. Please try again with a smaller payload.';
|
|
36
|
-
if (errorCallback) {
|
|
37
|
-
errorCallback(errorMessage);
|
|
38
|
-
} else {
|
|
39
|
-
toast.error(errorMessage);
|
|
40
|
-
}
|
|
41
|
-
return Promise.reject(new Error(errorMessage));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (method.toUpperCase() === 'PUT' || method.toUpperCase() === 'PATCH') {
|
|
45
|
-
formData = {
|
|
46
|
-
...formData,
|
|
47
|
-
_method: method,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const options = {
|
|
52
|
-
method: method,
|
|
53
|
-
data: formData,
|
|
54
|
-
headers: headers,
|
|
55
|
-
url: baseUrl + url,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return trackPromise(
|
|
59
|
-
new Promise((resolve, reject) => {
|
|
60
|
-
axios(options)
|
|
61
|
-
.then((response) => {
|
|
62
|
-
if (successCallback) {
|
|
63
|
-
successCallback(response.data);
|
|
64
|
-
} else {
|
|
65
|
-
const error = response.data.error;
|
|
66
|
-
|
|
67
|
-
if (error && error !== '') {
|
|
68
|
-
toast.error(<div>{parse(error)}</div>);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
resolve(response);
|
|
72
|
-
})
|
|
73
|
-
.catch((error) => {
|
|
74
|
-
let errorMessage = '';
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
error.response &&
|
|
78
|
-
error.response.data &&
|
|
79
|
-
error.response.data.message
|
|
80
|
-
) {
|
|
81
|
-
const { data } = error.response;
|
|
82
|
-
|
|
83
|
-
if (data.errors) {
|
|
84
|
-
const { errors } = data;
|
|
85
|
-
|
|
86
|
-
Object.values(errors).forEach((errorArray) => {
|
|
87
|
-
errorArray.forEach((errorMsg) => {
|
|
88
|
-
errorMessage += `${errorMsg}<br />`;
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
} else {
|
|
92
|
-
if (data.message === 'CSRF token mismatch.') {
|
|
93
|
-
window.location.replace('/login');
|
|
94
|
-
} else {
|
|
95
|
-
errorMessage = data.message;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
errorMessage = error.message;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (errorCallback) {
|
|
103
|
-
errorCallback(errorMessage);
|
|
104
|
-
} else {
|
|
105
|
-
if (errorMessage !== 'Unauthenticated.') {
|
|
106
|
-
toast.error(<div>{parse(errorMessage)}</div>);
|
|
107
|
-
} else {
|
|
108
|
-
console.info(
|
|
109
|
-
'You are not authenticated into the system.'
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
reject(error);
|
|
114
|
-
});
|
|
115
|
-
})
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export default CustomFetch;
|