@modernman00/shared-js-lib 1.2.33 → 1.2.35
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/axiosWrapper.js +1 -7
- package/config/version.php +1 -1
- package/general.js +10 -0
- package/index.js +1 -1
- package/package.json +1 -1
package/axiosWrapper.js
CHANGED
|
@@ -8,17 +8,11 @@ const csrfToken = getCookieValue('XSRF-TOKEN');
|
|
|
8
8
|
|
|
9
9
|
axios.interceptors.request.use(config => {
|
|
10
10
|
config.headers['X-Requested-With'] = 'XMLHttpRequest';
|
|
11
|
-
config.headers['Accept'] = 'application/json';
|
|
11
|
+
// config.headers['Accept'] = 'application/json';
|
|
12
12
|
|
|
13
13
|
if (csrfToken) {
|
|
14
14
|
config.headers['X-XSRF-TOKEN'] = csrfToken;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
// ✅ Detect if data is FormData
|
|
18
|
-
if (!(config.data instanceof FormData)) {
|
|
19
|
-
// Only set JSON content-type for non-FormData
|
|
20
|
-
config.headers['Content-Type'] = 'application/json';
|
|
21
|
-
}
|
|
22
16
|
|
|
23
17
|
return config;
|
|
24
18
|
});
|
package/config/version.php
CHANGED
package/general.js
CHANGED
|
@@ -59,4 +59,14 @@ export const parseErrorResponse = (error) => {
|
|
|
59
59
|
return errorMessage;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
export const showFileName = (fileCss) => {
|
|
63
|
+
const fileInput = document.querySelector(`#${fileCss} input[type=file]`);
|
|
64
|
+
fileInput.onchange = () => {
|
|
65
|
+
if (fileInput.files.length > 0) {
|
|
66
|
+
const fileName = document.querySelector(`#${fileCss} .file-name`);
|
|
67
|
+
fileName.textContent = fileInput.files[0].name;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
62
72
|
|
package/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export * from './UtilityHtml.js';
|
|
|
3
3
|
export * from './Utility.js';
|
|
4
4
|
export * from './Loader.js';
|
|
5
5
|
export * from './Cookie.js';
|
|
6
|
-
export
|
|
6
|
+
export * from './FormHelper.js'
|
|
7
7
|
export * from './Loader.js';
|
|
8
8
|
export * from './ShowResponse.js';
|
|
9
9
|
export * from './DateTime.js';
|
package/package.json
CHANGED