@dvrd/dvr-controls 1.0.16 → 1.0.17
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/package.json
CHANGED
|
@@ -48,7 +48,7 @@ export default function DvrdDatePicker(props: Props) {
|
|
|
48
48
|
const format = dateFormat ?? 'YYYY-MM-DD';
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
|
-
<div className={classNames('dvrd-date-picker', className, error && 'error')}>
|
|
51
|
+
<div className={classNames('dvrd-date-picker', className, error && 'error', disabled && 'disabled')}>
|
|
52
52
|
<label className='field-label'>{label}</label>
|
|
53
53
|
<div className='value-container' onClick={onClickContainer}>
|
|
54
54
|
<label className={classNames('value', !value && 'placeholder')}>{value?.format(format) ?? placeholder ??
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
position: relative;
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
background-color: white;
|
|
28
|
+
color: $color-blue-text;
|
|
28
29
|
|
|
29
30
|
.value {
|
|
30
31
|
transition: color .1s ease-in-out;
|
|
31
32
|
|
|
32
33
|
&.placeholder {
|
|
33
|
-
color: $color-gray-
|
|
34
|
+
color: $color-gray-3;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -92,12 +93,12 @@
|
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
&.year {
|
|
95
|
-
grid-template-columns: fit-content(100%)
|
|
96
|
+
grid-template-columns: fit-content(100%) 2.5rem fit-content(100%);
|
|
96
97
|
padding-bottom: .25rem;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
&.month {
|
|
100
|
-
grid-template-columns: fit-content(100%)
|
|
101
|
+
grid-template-columns: fit-content(100%) 5rem fit-content(100%);
|
|
101
102
|
padding-top: .25rem;
|
|
102
103
|
}
|
|
103
104
|
|
|
@@ -304,4 +305,14 @@
|
|
|
304
305
|
opacity: 1;
|
|
305
306
|
}
|
|
306
307
|
}
|
|
308
|
+
|
|
309
|
+
&.disabled {
|
|
310
|
+
* {
|
|
311
|
+
cursor: not-allowed;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.value-container {
|
|
315
|
+
background-color: rgba(239, 239, 239, 0.3);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
307
318
|
}
|
|
@@ -79,8 +79,8 @@ export function sendFetch(config: FetchOptions, legacySupport: boolean = false):
|
|
|
79
79
|
fetch(baseUrl + url, options).then((response: Response) => {
|
|
80
80
|
_handleResponse(response, config);
|
|
81
81
|
}).catch((reason: any) => {
|
|
82
|
-
if (reason.code === DOMException.ABORT_ERR)
|
|
83
|
-
|
|
82
|
+
if (reason.code === DOMException.ABORT_ERR) return; // Request aborted
|
|
83
|
+
else if (config.errorCallback)
|
|
84
84
|
config.errorCallback(reason);
|
|
85
85
|
});
|
|
86
86
|
return abortController;
|
|
@@ -111,6 +111,7 @@ function _handleResponse(response: Response, config: FetchOptions) {
|
|
|
111
111
|
function _onErrorResponse(response: Response, config: FetchOptions) {
|
|
112
112
|
if (config.errorHandler) config.errorHandler(response, config);
|
|
113
113
|
else if (config.errorCallback) config.errorCallback(response);
|
|
114
|
+
else if (defaultErrorHandler) defaultErrorHandler(response, config);
|
|
114
115
|
else if (config.callback) config.callback({status: 'error', message: 'Er is iets misgegaan in het systeem.'});
|
|
115
116
|
}
|
|
116
117
|
|