tp-react-elements 1.0.0 → 1.0.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/_virtual/index.esm11.js +2 -2
- package/dist/_virtual/index.esm12.js +2 -2
- package/dist/_virtual/index.esm13.js +2 -2
- package/dist/_virtual/index.esm14.js +2 -2
- package/dist/_virtual/index.esm4.js +2 -2
- package/dist/_virtual/index.esm5.js +2 -2
- package/dist/_virtual/index.esm6.js +2 -2
- package/dist/_virtual/index.esm7.js +2 -2
- package/dist/components/DatePicker/index.esm.js +6 -2
- package/dist/components/DateRangePicker/DateRangePicker.esm.js +1 -1
- package/dist/components/FileUpload/index.esm.js +7 -3
- package/dist/components/Form/Form.styles.esm.js +1 -1
- package/dist/components/Form/FormRenderWrapper.esm.js +2 -2
- package/dist/components/FormComponents/index.esm.js +2 -2
- package/dist/components/TimePicker/index.esm.js +5 -1
- package/dist/index.esm.js +6 -6
- package/dist/node_modules/axios/lib/adapters/fetch.esm.js +2 -2
- package/dist/node_modules/axios/lib/cancel/CanceledError.esm.js +15 -18
- package/dist/node_modules/axios/lib/core/Axios.esm.js +11 -2
- package/dist/node_modules/axios/lib/core/AxiosError.esm.js +65 -102
- package/dist/node_modules/axios/lib/core/InterceptorManager.esm.js +1 -0
- package/dist/node_modules/axios/lib/core/mergeConfig.esm.js +22 -9
- package/dist/node_modules/axios/lib/defaults/transitional.esm.js +2 -1
- package/dist/node_modules/axios/lib/env/data.esm.js +1 -1
- package/dist/node_modules/axios/lib/helpers/buildURL.esm.js +7 -10
- package/dist/node_modules/axios/lib/helpers/composeSignals.esm.js +1 -1
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.esm.js +4 -0
- package/dist/node_modules/axios/lib/helpers/spread.esm.js +1 -1
- package/dist/node_modules/axios/lib/utils.esm.js +198 -117
- package/dist/node_modules/date-fns/_lib/defaultLocale.esm.js +2 -2
- package/dist/node_modules/date-fns/addDays.esm.js +1 -1
- package/dist/node_modules/date-fns/constructFrom.esm.js +1 -1
- package/dist/node_modules/date-fns/differenceInCalendarDays.esm.js +1 -1
- package/dist/node_modules/date-fns/format.esm.js +1 -1
- package/dist/node_modules/date-fns/format.esm2.js +4 -4
- package/dist/node_modules/date-fns/getDayOfYear.esm.js +1 -1
- package/dist/node_modules/date-fns/getDefaultOptions.esm.js +1 -1
- package/dist/node_modules/date-fns/getISODay.esm.js +1 -1
- package/dist/node_modules/date-fns/getISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/getISOWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/getWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/getWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/index.esm.js +491 -491
- package/dist/node_modules/date-fns/isDate.esm.js +1 -1
- package/dist/node_modules/date-fns/isValid.esm.js +1 -1
- package/dist/node_modules/date-fns/lightFormat.esm.js +3 -3
- package/dist/node_modules/date-fns/locale/en-US.esm.js +1 -1
- package/dist/node_modules/date-fns/parse.esm.js +1 -1
- package/dist/node_modules/date-fns/parse.esm2.js +4 -4
- package/dist/node_modules/date-fns/setDay.esm.js +1 -1
- package/dist/node_modules/date-fns/setISODay.esm.js +1 -1
- package/dist/node_modules/date-fns/setISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/setWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfDay.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfISOWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfISOWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfWeek.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfWeekYear.esm.js +1 -1
- package/dist/node_modules/date-fns/startOfYear.esm.js +1 -1
- package/dist/node_modules/date-fns/toDate.esm.js +1 -1
- package/dist/node_modules/date-fns/transpose.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DayCell/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
- package/dist/node_modules/react-date-range/dist/index.esm.js +9 -9
- package/dist/node_modules/react-list/react-list.esm.js +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Month = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Month as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DayCell = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DayCell as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateInput = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateInput as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var InputRangeField = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { InputRangeField as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Calendar = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { Calendar as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DefinedRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DefinedRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRange = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRange as __exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var DateRangePicker = {};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { DateRangePicker as __exports };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import DatepickerWrapperV2 from '../FormComponents/DatePicker/DatepickerWrapperV2.esm.js';
|
|
2
2
|
export { default as MonthPicker } from '../FormComponents/DatePicker/MonthPicker.esm.js';
|
|
3
|
-
|
|
3
|
+
import Monthpickerrender from '../FormComponents/DatePicker/Monthpickerrender.esm.js';
|
|
4
4
|
export { default as YearPickerField } from '../FormComponents/YearPickerField/YearPickerField.esm.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export { DatepickerWrapperV2, Monthpickerrender };
|
|
@@ -6,7 +6,7 @@ import 'dayjs';
|
|
|
6
6
|
import { renderLabel } from '../../utils/Constants/FormConstants.esm.js';
|
|
7
7
|
import FormBottomField from '../FormComponents/FormBottomField/FormBottomField.esm.js';
|
|
8
8
|
import { Box, TextField, Popover } from '@mui/material';
|
|
9
|
-
import {
|
|
9
|
+
import { format } from '../../node_modules/date-fns/format.esm.js';
|
|
10
10
|
import { parse } from '../../node_modules/date-fns/parse.esm.js';
|
|
11
11
|
import { isValid } from '../../node_modules/date-fns/isValid.esm.js';
|
|
12
12
|
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import FormRenderFileUpload from '../FormComponents/FileUpload/FormRenderFileUpload.esm.js';
|
|
2
|
+
import FormRenderMultiFileUpload from '../FormComponents/FileUpload/FormRenderMultiFileUpload.esm.js';
|
|
3
|
+
import MultiFileWithPreview from '../FormComponents/FileUpload/MultiFileWithPreview.esm.js';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export { FormRenderFileUpload, FormRenderMultiFileUpload, MultiFileWithPreview };
|
|
@@ -29,7 +29,7 @@ const Formitem = styled(Grid, {
|
|
|
29
29
|
paddingRight: '15px',
|
|
30
30
|
marginBottom: theme.spacing(1),
|
|
31
31
|
[theme.breakpoints.down('md')]: {
|
|
32
|
-
width:
|
|
32
|
+
width: `calc(100%/${noOfColumn})`,
|
|
33
33
|
},
|
|
34
34
|
}));
|
|
35
35
|
const ErrorMessageComponent = styled(Box)(({ theme }) => ({
|
|
@@ -28,6 +28,6 @@ const FormRenderWrapper = ({ formArray, name = '', numberOfColumns = 3, form, va
|
|
|
28
28
|
* Export the FormRenderWrapper component for use in form containers
|
|
29
29
|
* This component is the main entry point for rendering form fields
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
31
|
+
var FormRenderWrapper_default = React__default.memo(FormRenderWrapper);
|
|
32
32
|
|
|
33
|
-
export {
|
|
33
|
+
export { FormRenderWrapper_default as default };
|
|
@@ -32,7 +32,7 @@ import '@mui/icons-material/UploadFile';
|
|
|
32
32
|
import '@mui/icons-material/PictureAsPdf';
|
|
33
33
|
import '@mui/icons-material/TableChart';
|
|
34
34
|
import '@mui/icons-material/Description';
|
|
35
|
-
export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
|
|
36
|
-
export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
|
|
37
35
|
export { default as FormErrorField } from './FormErrorField/FormErrorField.esm.js';
|
|
38
36
|
export { default as HelperText } from './HelperText/HelperText.esm.js';
|
|
37
|
+
export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
|
|
38
|
+
export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
|
package/dist/index.esm.js
CHANGED
|
@@ -5,10 +5,10 @@ export { default as DeleteField } from './components/DeleteComponent/DeleteField
|
|
|
5
5
|
export { default as SessionTimeoutField } from './components/SessionTimeOut/SessionTimeOut.esm.js';
|
|
6
6
|
export { default as useFormValidatingContext } from './components/Form/FormConstants.esm.js';
|
|
7
7
|
export { TPElementsProvider } from './auth/authContext.esm.js';
|
|
8
|
-
import * as index from './utils/index.esm.js';
|
|
9
|
-
export { index as Utils };
|
|
10
|
-
import * as index$
|
|
11
|
-
export { index$
|
|
12
|
-
import * as index
|
|
13
|
-
export { index
|
|
8
|
+
import * as index$1 from './utils/index.esm.js';
|
|
9
|
+
export { index$1 as Utils };
|
|
10
|
+
import * as index$2 from './validation/index.esm.js';
|
|
11
|
+
export { index$2 as ValidationSchemas };
|
|
12
|
+
import * as index from './theme/index.esm.js';
|
|
13
|
+
export { index as Theme };
|
|
14
14
|
export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor } from './utils/Constants/FunctionConstants.esm.js';
|
|
@@ -247,14 +247,14 @@ const factory = (env) => {
|
|
|
247
247
|
|
|
248
248
|
if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
|
|
249
249
|
throw Object.assign(
|
|
250
|
-
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
250
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
|
|
251
251
|
{
|
|
252
252
|
cause: err.cause || err
|
|
253
253
|
}
|
|
254
254
|
)
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
throw AxiosError.from(err, err && err.code, config, request);
|
|
257
|
+
throw AxiosError.from(err, err && err.code, config, request, err && err.response);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
};
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import AxiosError from '../core/AxiosError.esm.js';
|
|
2
|
-
import utils from '../utils.esm.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
class CanceledError extends AxiosError {
|
|
4
|
+
/**
|
|
5
|
+
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
6
|
+
*
|
|
7
|
+
* @param {string=} message The message.
|
|
8
|
+
* @param {Object=} config The config.
|
|
9
|
+
* @param {Object=} request The request.
|
|
10
|
+
*
|
|
11
|
+
* @returns {CanceledError} The created error.
|
|
12
|
+
*/
|
|
13
|
+
constructor(message, config, request) {
|
|
14
|
+
super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
|
15
|
+
this.name = 'CanceledError';
|
|
16
|
+
this.__CANCEL__ = true;
|
|
17
|
+
}
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
utils.inherits(CanceledError, AxiosError, {
|
|
20
|
-
__CANCEL__: true
|
|
21
|
-
});
|
|
22
|
-
|
|
23
20
|
export { CanceledError as default };
|
|
@@ -6,6 +6,7 @@ import mergeConfig from './mergeConfig.esm.js';
|
|
|
6
6
|
import buildFullPath from './buildFullPath.esm.js';
|
|
7
7
|
import validator from '../helpers/validator.esm.js';
|
|
8
8
|
import AxiosHeaders from './AxiosHeaders.esm.js';
|
|
9
|
+
import transitionalDefaults from '../defaults/transitional.esm.js';
|
|
9
10
|
|
|
10
11
|
const validators = validator.validators;
|
|
11
12
|
|
|
@@ -78,7 +79,8 @@ class Axios {
|
|
|
78
79
|
validator.assertOptions(transitional, {
|
|
79
80
|
silentJSONParsing: validators.transitional(validators.boolean),
|
|
80
81
|
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
81
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
82
|
+
clarifyTimeoutError: validators.transitional(validators.boolean),
|
|
83
|
+
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
|
|
82
84
|
}, false);
|
|
83
85
|
}
|
|
84
86
|
|
|
@@ -135,7 +137,14 @@ class Axios {
|
|
|
135
137
|
|
|
136
138
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
137
139
|
|
|
138
|
-
|
|
140
|
+
const transitional = config.transitional || transitionalDefaults;
|
|
141
|
+
const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
|
|
142
|
+
|
|
143
|
+
if (legacyInterceptorReqResOrdering) {
|
|
144
|
+
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
145
|
+
} else {
|
|
146
|
+
requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
147
|
+
}
|
|
139
148
|
});
|
|
140
149
|
|
|
141
150
|
const responseInterceptorChain = [];
|
|
@@ -1,108 +1,71 @@
|
|
|
1
1
|
import utils from '../utils.esm.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
class AxiosError extends Error {
|
|
4
|
+
static from(error, code, config, request, response, customProps) {
|
|
5
|
+
const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
|
|
6
|
+
axiosError.cause = error;
|
|
7
|
+
axiosError.name = error.name;
|
|
8
|
+
customProps && Object.assign(axiosError, customProps);
|
|
9
|
+
return axiosError;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Create an Error with the specified message, config, error code, request and response.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} message The error message.
|
|
16
|
+
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
17
|
+
* @param {Object} [config] The config.
|
|
18
|
+
* @param {Object} [request] The request.
|
|
19
|
+
* @param {Object} [response] The response.
|
|
20
|
+
*
|
|
21
|
+
* @returns {Error} The created error.
|
|
22
|
+
*/
|
|
23
|
+
constructor(message, code, config, request, response) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.name = 'AxiosError';
|
|
26
|
+
this.isAxiosError = true;
|
|
27
|
+
code && (this.code = code);
|
|
28
|
+
config && (this.config = config);
|
|
29
|
+
request && (this.request = request);
|
|
30
|
+
if (response) {
|
|
31
|
+
this.response = response;
|
|
32
|
+
this.status = response.status;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
toJSON() {
|
|
37
|
+
return {
|
|
38
|
+
// Standard
|
|
39
|
+
message: this.message,
|
|
40
|
+
name: this.name,
|
|
41
|
+
// Microsoft
|
|
42
|
+
description: this.description,
|
|
43
|
+
number: this.number,
|
|
44
|
+
// Mozilla
|
|
45
|
+
fileName: this.fileName,
|
|
46
|
+
lineNumber: this.lineNumber,
|
|
47
|
+
columnNumber: this.columnNumber,
|
|
48
|
+
stack: this.stack,
|
|
49
|
+
// Axios
|
|
50
|
+
config: utils.toJSONObject(this.config),
|
|
51
|
+
code: this.code,
|
|
52
|
+
status: this.status,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
32
55
|
}
|
|
33
56
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
stack: this.stack,
|
|
48
|
-
// Axios
|
|
49
|
-
config: utils.toJSONObject(this.config),
|
|
50
|
-
code: this.code,
|
|
51
|
-
status: this.status
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const prototype = AxiosError.prototype;
|
|
57
|
-
const descriptors = {};
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
'ERR_BAD_OPTION_VALUE',
|
|
61
|
-
'ERR_BAD_OPTION',
|
|
62
|
-
'ECONNABORTED',
|
|
63
|
-
'ETIMEDOUT',
|
|
64
|
-
'ERR_NETWORK',
|
|
65
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
66
|
-
'ERR_DEPRECATED',
|
|
67
|
-
'ERR_BAD_RESPONSE',
|
|
68
|
-
'ERR_BAD_REQUEST',
|
|
69
|
-
'ERR_CANCELED',
|
|
70
|
-
'ERR_NOT_SUPPORT',
|
|
71
|
-
'ERR_INVALID_URL'
|
|
72
|
-
// eslint-disable-next-line func-names
|
|
73
|
-
].forEach(code => {
|
|
74
|
-
descriptors[code] = {value: code};
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
78
|
-
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
79
|
-
|
|
80
|
-
// eslint-disable-next-line func-names
|
|
81
|
-
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
82
|
-
const axiosError = Object.create(prototype);
|
|
83
|
-
|
|
84
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
85
|
-
return obj !== Error.prototype;
|
|
86
|
-
}, prop => {
|
|
87
|
-
return prop !== 'isAxiosError';
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const msg = error && error.message ? error.message : 'Error';
|
|
91
|
-
|
|
92
|
-
// Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
|
|
93
|
-
const errCode = code == null && error ? error.code : code;
|
|
94
|
-
AxiosError.call(axiosError, msg, errCode, config, request, response);
|
|
95
|
-
|
|
96
|
-
// Chain the original error on the standard field; non-enumerable to avoid JSON noise
|
|
97
|
-
if (error && axiosError.cause == null) {
|
|
98
|
-
Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
axiosError.name = (error && error.name) || 'Error';
|
|
102
|
-
|
|
103
|
-
customProps && Object.assign(axiosError, customProps);
|
|
104
|
-
|
|
105
|
-
return axiosError;
|
|
106
|
-
};
|
|
57
|
+
// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
|
|
58
|
+
AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
|
|
59
|
+
AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
|
|
60
|
+
AxiosError.ECONNABORTED = 'ECONNABORTED';
|
|
61
|
+
AxiosError.ETIMEDOUT = 'ETIMEDOUT';
|
|
62
|
+
AxiosError.ERR_NETWORK = 'ERR_NETWORK';
|
|
63
|
+
AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
|
|
64
|
+
AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
|
|
65
|
+
AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
|
|
66
|
+
AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
|
|
67
|
+
AxiosError.ERR_CANCELED = 'ERR_CANCELED';
|
|
68
|
+
AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
|
|
69
|
+
AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
|
|
107
70
|
|
|
108
71
|
export { AxiosError as default };
|
|
@@ -10,6 +10,7 @@ class InterceptorManager {
|
|
|
10
10
|
*
|
|
11
11
|
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
12
12
|
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
13
|
+
* @param {Object} options The options for the interceptor, synchronous and runWhen
|
|
13
14
|
*
|
|
14
15
|
* @return {Number} An ID used to remove interceptor later
|
|
15
16
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import utils from '../utils.esm.js';
|
|
2
2
|
import AxiosHeaders from './AxiosHeaders.esm.js';
|
|
3
3
|
|
|
4
|
-
const headersToObject = (thing) =>
|
|
4
|
+
const headersToObject = (thing) =>
|
|
5
|
+
thing instanceof AxiosHeaders ? { ...thing } : thing;
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Config-specific merge-function which creates a new config-object
|
|
@@ -19,7 +20,7 @@ function mergeConfig(config1, config2) {
|
|
|
19
20
|
|
|
20
21
|
function getMergedValue(target, source, prop, caseless) {
|
|
21
22
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
22
|
-
return utils.merge.call({caseless}, target, source);
|
|
23
|
+
return utils.merge.call({ caseless }, target, source);
|
|
23
24
|
} else if (utils.isPlainObject(source)) {
|
|
24
25
|
return utils.merge({}, source);
|
|
25
26
|
} else if (utils.isArray(source)) {
|
|
@@ -28,7 +29,6 @@ function mergeConfig(config1, config2) {
|
|
|
28
29
|
return source;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
// eslint-disable-next-line consistent-return
|
|
32
32
|
function mergeDeepProperties(a, b, prop, caseless) {
|
|
33
33
|
if (!utils.isUndefined(b)) {
|
|
34
34
|
return getMergedValue(a, b, prop, caseless);
|
|
@@ -91,14 +91,27 @@ function mergeConfig(config1, config2) {
|
|
|
91
91
|
socketPath: defaultToConfig2,
|
|
92
92
|
responseEncoding: defaultToConfig2,
|
|
93
93
|
validateStatus: mergeDirectKeys,
|
|
94
|
-
headers: (a, b, prop) =>
|
|
94
|
+
headers: (a, b, prop) =>
|
|
95
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
95
96
|
};
|
|
96
97
|
|
|
97
|
-
utils.forEach(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
utils.forEach(
|
|
99
|
+
Object.keys({ ...config1, ...config2 }),
|
|
100
|
+
function computeConfigValue(prop) {
|
|
101
|
+
if (
|
|
102
|
+
prop === "__proto__" ||
|
|
103
|
+
prop === "constructor" ||
|
|
104
|
+
prop === "prototype"
|
|
105
|
+
)
|
|
106
|
+
return;
|
|
107
|
+
const merge = utils.hasOwnProp(mergeMap, prop)
|
|
108
|
+
? mergeMap[prop]
|
|
109
|
+
: mergeDeepProperties;
|
|
110
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
111
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) ||
|
|
112
|
+
(config[prop] = configValue);
|
|
113
|
+
},
|
|
114
|
+
);
|
|
102
115
|
|
|
103
116
|
return config;
|
|
104
117
|
}
|
|
@@ -27,29 +27,26 @@ function encode(val) {
|
|
|
27
27
|
* @returns {string} The formatted url
|
|
28
28
|
*/
|
|
29
29
|
function buildURL(url, params, options) {
|
|
30
|
-
/*eslint no-param-reassign:0*/
|
|
31
30
|
if (!params) {
|
|
32
31
|
return url;
|
|
33
32
|
}
|
|
34
|
-
|
|
33
|
+
|
|
35
34
|
const _encode = options && options.encode || encode;
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
options
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
}
|
|
36
|
+
const _options = utils.isFunction(options) ? {
|
|
37
|
+
serialize: options
|
|
38
|
+
} : options;
|
|
42
39
|
|
|
43
|
-
const serializeFn =
|
|
40
|
+
const serializeFn = _options && _options.serialize;
|
|
44
41
|
|
|
45
42
|
let serializedParams;
|
|
46
43
|
|
|
47
44
|
if (serializeFn) {
|
|
48
|
-
serializedParams = serializeFn(params,
|
|
45
|
+
serializedParams = serializeFn(params, _options);
|
|
49
46
|
} else {
|
|
50
47
|
serializedParams = utils.isURLSearchParams(params) ?
|
|
51
48
|
params.toString() :
|
|
52
|
-
new AxiosURLSearchParams(params,
|
|
49
|
+
new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
if (serializedParams) {
|
|
@@ -21,7 +21,7 @@ const composeSignals = (signals, timeout) => {
|
|
|
21
21
|
|
|
22
22
|
let timer = timeout && setTimeout(() => {
|
|
23
23
|
timer = null;
|
|
24
|
-
onabort(new AxiosError(`timeout ${timeout}
|
|
24
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
25
25
|
}, timeout);
|
|
26
26
|
|
|
27
27
|
const unsubscribe = () => {
|
|
@@ -9,6 +9,10 @@ function isAbsoluteURL(url) {
|
|
|
9
9
|
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
|
|
10
10
|
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
|
|
11
11
|
// by any combination of letters, digits, plus, period, or hyphen.
|
|
12
|
+
if (typeof url !== 'string') {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
13
17
|
}
|
|
14
18
|
|