@ministryofjustice/frontend 6.0.0 → 7.0.0
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/moj/all.bundle.js +16 -6
- package/moj/all.bundle.js.map +1 -1
- package/moj/all.bundle.mjs +16 -6
- package/moj/all.bundle.mjs.map +1 -1
- package/moj/common/moj-frontend-version.mjs +2 -2
- package/moj/common/moj-frontend-version.mjs.map +1 -1
- package/moj/components/date-picker/date-picker.bundle.js +11 -1
- package/moj/components/date-picker/date-picker.bundle.js.map +1 -1
- package/moj/components/date-picker/date-picker.bundle.mjs +11 -1
- package/moj/components/date-picker/date-picker.bundle.mjs.map +1 -1
- package/moj/components/date-picker/date-picker.mjs +11 -1
- package/moj/components/date-picker/date-picker.mjs.map +1 -1
- package/moj/components/messages/README.md +1 -1
- package/moj/components/multi-file-upload/multi-file-upload.bundle.js +3 -3
- package/moj/components/multi-file-upload/multi-file-upload.bundle.js.map +1 -1
- package/moj/components/multi-file-upload/multi-file-upload.bundle.mjs +3 -3
- package/moj/components/multi-file-upload/multi-file-upload.bundle.mjs.map +1 -1
- package/moj/components/multi-file-upload/multi-file-upload.mjs +3 -3
- package/moj/components/multi-file-upload/multi-file-upload.mjs.map +1 -1
- package/moj/components/pagination/template.njk +2 -2
- package/moj/components/timeline/README.md +1 -1
- package/moj/core/_moj-frontend-properties.scss +1 -1
- package/moj/moj-frontend.min.css +1 -1
- package/moj/moj-frontend.min.css.map +1 -1
- package/moj/moj-frontend.min.js +1 -1
- package/moj/moj-frontend.min.js.map +1 -1
- package/moj/objects/_scrollable-pane.scss +2 -2
- package/moj/objects/_scrollable-pane.scss.map +1 -1
- package/package.json +1 -1
package/moj/all.bundle.js
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* MOJ Frontend release version
|
|
14
14
|
*
|
|
15
15
|
* {@link https://github.com/ministryofjustice/moj-frontend/releases}
|
|
16
16
|
*/
|
|
17
|
-
const version = '
|
|
17
|
+
const version = '7.0.0';
|
|
18
18
|
|
|
19
19
|
class AddAnother extends govukFrontend.Component {
|
|
20
20
|
/**
|
|
@@ -1048,7 +1048,7 @@
|
|
|
1048
1048
|
const day = match[1];
|
|
1049
1049
|
const month = match[3];
|
|
1050
1050
|
const year = match[4];
|
|
1051
|
-
formattedDate = new Date(
|
|
1051
|
+
formattedDate = new Date(Number(year), Number(month) - 1, Number(day));
|
|
1052
1052
|
if (formattedDate instanceof Date && Number.isFinite(formattedDate.getTime())) {
|
|
1053
1053
|
return formattedDate;
|
|
1054
1054
|
}
|
|
@@ -1224,6 +1224,16 @@
|
|
|
1224
1224
|
|
|
1225
1225
|
// get the date from the input element
|
|
1226
1226
|
this.inputDate = this.formattedDateFromString(this.$input.value);
|
|
1227
|
+
// move current date to the closest selectable date if it is out of range
|
|
1228
|
+
if (this.minDate && this.minDate > this.inputDate) {
|
|
1229
|
+
this.inputDate = new Date(this.minDate.getTime());
|
|
1230
|
+
}
|
|
1231
|
+
if (this.maxDate && this.maxDate < this.inputDate) {
|
|
1232
|
+
this.inputDate = new Date(this.maxDate.getTime());
|
|
1233
|
+
}
|
|
1234
|
+
if (this.minDate && this.maxDate && this.minDate > this.maxDate) {
|
|
1235
|
+
console.error('min date is after max date. No dates will be selectable');
|
|
1236
|
+
}
|
|
1227
1237
|
this.currentDate = this.inputDate;
|
|
1228
1238
|
this.currentDate.setHours(0, 0, 0, 0);
|
|
1229
1239
|
this.updateCalendar();
|
|
@@ -2171,13 +2181,13 @@
|
|
|
2171
2181
|
$message.innerHTML = this.getSuccessHtml(xhr.response.success);
|
|
2172
2182
|
this.$status.textContent = xhr.response.success.messageText;
|
|
2173
2183
|
$actions.append(this.getDeleteButton(xhr.response.file));
|
|
2174
|
-
this.config.hooks.exitHook(this, file, xhr, xhr.
|
|
2184
|
+
this.config.hooks.exitHook(this, file, xhr, xhr.statusText);
|
|
2175
2185
|
};
|
|
2176
2186
|
const onError = () => {
|
|
2177
2187
|
const error = new Error(xhr.response && 'error' in xhr.response ? xhr.response.error.message : xhr.statusText || 'Upload failed');
|
|
2178
2188
|
$message.innerHTML = this.getErrorHtml(error);
|
|
2179
2189
|
this.$status.textContent = error.message;
|
|
2180
|
-
this.config.hooks.errorHook(this, file, xhr, xhr.
|
|
2190
|
+
this.config.hooks.errorHook(this, file, xhr, xhr.statusText, error);
|
|
2181
2191
|
};
|
|
2182
2192
|
xhr.addEventListener('load', onLoad);
|
|
2183
2193
|
xhr.addEventListener('error', onError);
|
|
@@ -2214,7 +2224,7 @@
|
|
|
2214
2224
|
}
|
|
2215
2225
|
const $rowDelete = $rows.find($row => $row.contains($button));
|
|
2216
2226
|
if ($rowDelete) $rowDelete.remove();
|
|
2217
|
-
this.config.hooks.deleteHook(this, undefined, xhr, xhr.
|
|
2227
|
+
this.config.hooks.deleteHook(this, undefined, xhr, xhr.statusText);
|
|
2218
2228
|
});
|
|
2219
2229
|
xhr.open('POST', this.config.deleteUrl);
|
|
2220
2230
|
xhr.setRequestHeader('Content-Type', 'application/json');
|