@ukhomeoffice/cop-react-form-renderer 5.41.0 → 5.41.1
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/components/CheckYourAnswers/Answer.js +1 -2
- package/dist/components/CheckYourAnswers/CheckYourAnswers.js +4 -8
- package/dist/components/CheckYourAnswers/index.js +1 -2
- package/dist/components/CollectionPage/CollectionPage.js +2 -4
- package/dist/components/CollectionPage/index.js +1 -2
- package/dist/components/CollectionSummary/BannerStrip.js +2 -4
- package/dist/components/CollectionSummary/CollectionSummary.js +2 -4
- package/dist/components/CollectionSummary/Confirmation.js +4 -8
- package/dist/components/CollectionSummary/SummaryCard.js +9 -18
- package/dist/components/CollectionSummary/index.js +1 -2
- package/dist/components/FormComponent/Collection.js +3 -5
- package/dist/components/FormComponent/Container.js +2 -4
- package/dist/components/FormComponent/FormComponent.js +1 -2
- package/dist/components/FormComponent/helpers/addLabel.js +1 -2
- package/dist/components/FormComponent/helpers/getComponentDisabled.js +1 -2
- package/dist/components/FormComponent/helpers/getComponentError.js +1 -2
- package/dist/components/FormComponent/helpers/getComponentFieldSet.js +2 -3
- package/dist/components/FormComponent/index.js +1 -2
- package/dist/components/FormPage/FormPage.js +2 -4
- package/dist/components/FormPage/index.js +1 -2
- package/dist/components/FormRenderer/FormRenderer.js +2 -4
- package/dist/components/FormRenderer/handlers/cyaAction.js +1 -2
- package/dist/components/FormRenderer/handlers/getPageId.js +1 -2
- package/dist/components/FormRenderer/handlers/index.js +1 -2
- package/dist/components/FormRenderer/handlers/navigate.js +1 -2
- package/dist/components/FormRenderer/handlers/submissionError.js +1 -2
- package/dist/components/FormRenderer/helpers/canActionProceed.js +1 -2
- package/dist/components/FormRenderer/helpers/canCYASubmit.js +1 -2
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +2 -3
- package/dist/components/FormRenderer/helpers/getCYA.js +1 -2
- package/dist/components/FormRenderer/helpers/getFormState.js +1 -2
- package/dist/components/FormRenderer/helpers/getNextPageId.js +2 -3
- package/dist/components/FormRenderer/helpers/getPage.js +1 -2
- package/dist/components/FormRenderer/helpers/getRelevantPages.js +1 -2
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +1 -2
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +1 -2
- package/dist/components/FormRenderer/helpers/index.js +1 -2
- package/dist/components/FormRenderer/index.js +1 -2
- package/dist/components/FormRenderer/onCYAAction.js +1 -2
- package/dist/components/FormRenderer/onPageAction.js +1 -2
- package/dist/components/FormRenderer/onTaskAction.js +1 -2
- package/dist/components/PageActions/ActionButton.js +2 -4
- package/dist/components/PageActions/PageActions.js +1 -2
- package/dist/components/PageActions/index.js +1 -2
- package/dist/components/SummaryList/GroupAction.js +1 -2
- package/dist/components/SummaryList/RowAction.js +1 -2
- package/dist/components/SummaryList/SummaryList.js +2 -4
- package/dist/components/SummaryList/SummaryListHeadingRow.js +1 -2
- package/dist/components/SummaryList/SummaryListRow.js +1 -2
- package/dist/components/SummaryList/SummaryListTitleRow.js +1 -2
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +1 -2
- package/dist/components/SummaryList/helpers/getRowActionAttributes.js +1 -2
- package/dist/components/SummaryList/index.js +1 -2
- package/dist/components/TaskList/Task.js +2 -4
- package/dist/components/TaskList/TaskList.js +3 -6
- package/dist/components/TaskList/TaskState.js +2 -4
- package/dist/components/TaskList/index.js +1 -2
- package/dist/context/HooksContext/HooksContext.js +3 -6
- package/dist/context/HooksContext/index.js +1 -2
- package/dist/context/ValidationContext/ValidationContext.js +2 -4
- package/dist/context/ValidationContext/index.js +1 -2
- package/dist/hooks/useAxios.js +1 -2
- package/dist/hooks/useGetRequest.js +6 -12
- package/dist/hooks/useHooks.js +1 -2
- package/dist/hooks/useRefData.js +3 -6
- package/dist/hooks/useValidation.js +1 -2
- package/dist/index.js +1 -2
- package/dist/models/CollectionLabels.js +1 -2
- package/dist/models/ComponentTypes.js +1 -2
- package/dist/models/EventTypes.js +1 -2
- package/dist/models/FormPages.js +1 -2
- package/dist/models/FormTypes.js +1 -2
- package/dist/models/HubFormats.js +1 -2
- package/dist/models/PageAction.js +3 -6
- package/dist/models/TaskStates.js +2 -4
- package/dist/models/index.js +1 -2
- package/dist/setupTests.js +6 -11
- package/dist/utils/CheckYourAnswers/getCYAAction.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYARow.js +2 -3
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +1 -2
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +1 -2
- package/dist/utils/CheckYourAnswers/index.js +1 -2
- package/dist/utils/CheckYourAnswers/showComponentCYA.js +2 -4
- package/dist/utils/CollectionPage/addCollectionPageEntry.js +1 -2
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +1 -2
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +1 -2
- package/dist/utils/CollectionPage/getCollectionPageActiveId.js +1 -2
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +1 -2
- package/dist/utils/CollectionPage/getCollectionPageData.js +1 -2
- package/dist/utils/CollectionPage/getQuickEditPage.js +2 -3
- package/dist/utils/CollectionPage/index.js +1 -2
- package/dist/utils/CollectionPage/mergeCollectionPages.js +1 -2
- package/dist/utils/CollectionPage/removeCollectionPageEntry.js +1 -2
- package/dist/utils/CollectionPage/setCollectionPageData.js +1 -2
- package/dist/utils/Component/addShowWhen.js +1 -2
- package/dist/utils/Component/applyToComponentTree.js +1 -2
- package/dist/utils/Component/cleanAttributes.js +2 -4
- package/dist/utils/Component/elevateNestedComponents.js +3 -4
- package/dist/utils/Component/getComponent.js +2 -4
- package/dist/utils/Component/getDefaultValue.js +1 -2
- package/dist/utils/Component/getDefaultValueFromConfig.js +1 -2
- package/dist/utils/Component/index.js +1 -2
- package/dist/utils/Component/isEditable.js +2 -4
- package/dist/utils/Component/optionIsSelected.js +1 -2
- package/dist/utils/Component/setupContainerComponentsPath.js +1 -2
- package/dist/utils/Component/showComponent.js +1 -2
- package/dist/utils/Component/wrapInFormGroup.js +1 -2
- package/dist/utils/Condition/index.js +1 -2
- package/dist/utils/Condition/meetsAllConditions.js +1 -2
- package/dist/utils/Condition/meetsCondition.js +1 -2
- package/dist/utils/Condition/meetsOneCondition.js +1 -2
- package/dist/utils/Condition/setupConditions.js +1 -2
- package/dist/utils/Container/getEditableComponents.js +1 -2
- package/dist/utils/Container/index.js +1 -2
- package/dist/utils/Container/setupNesting.js +3 -4
- package/dist/utils/Container/showContainer.js +1 -2
- package/dist/utils/Data/applyFormula.js +1 -2
- package/dist/utils/Data/getAutocompleteSource.js +1 -2
- package/dist/utils/Data/getDataPath.js +1 -2
- package/dist/utils/Data/getOptions.js +1 -2
- package/dist/utils/Data/getSourceData.js +1 -2
- package/dist/utils/Data/index.js +1 -2
- package/dist/utils/Data/refDataToOptions.js +1 -2
- package/dist/utils/Data/setDataItem.js +1 -2
- package/dist/utils/Data/setupFormData.js +1 -2
- package/dist/utils/Data/setupRefDataUrlForComponent.js +1 -2
- package/dist/utils/FormPage/applyConditionalProperties.js +1 -2
- package/dist/utils/FormPage/getFormPage.js +1 -2
- package/dist/utils/FormPage/getFormPages.js +1 -2
- package/dist/utils/FormPage/getPageActions.js +1 -2
- package/dist/utils/FormPage/getPageTitle.js +1 -2
- package/dist/utils/FormPage/getParagraphFromText.js +1 -2
- package/dist/utils/FormPage/index.js +1 -2
- package/dist/utils/FormPage/showFormPage.js +1 -2
- package/dist/utils/FormPage/showFormPageCYA.js +1 -2
- package/dist/utils/FormPage/useComponent.js +1 -2
- package/dist/utils/Format/formatData.js +1 -2
- package/dist/utils/Format/formatDataForComponent.js +2 -4
- package/dist/utils/Format/formatDataForForm.js +1 -2
- package/dist/utils/Format/formatDataForPage.js +2 -4
- package/dist/utils/Format/index.js +1 -2
- package/dist/utils/Hub/getFormHub.js +1 -2
- package/dist/utils/Hub/index.js +1 -2
- package/dist/utils/Meta/constants.js +2 -4
- package/dist/utils/Meta/documents/getDocuments.js +1 -2
- package/dist/utils/Meta/documents/index.js +1 -2
- package/dist/utils/Meta/documents/setDocumentsForField.js +1 -2
- package/dist/utils/Meta/index.js +1 -2
- package/dist/utils/Operate/checkValueIsTruthy.js +1 -2
- package/dist/utils/Operate/getFirstOf.js +1 -2
- package/dist/utils/Operate/getIndexOfMatchingValueIn.js +1 -2
- package/dist/utils/Operate/index.js +1 -2
- package/dist/utils/Operate/persistValueInFormData.js +1 -2
- package/dist/utils/Operate/runPageOperations.js +1 -2
- package/dist/utils/Operate/setValueInFormData.js +1 -2
- package/dist/utils/Operate/shouldRun.js +1 -2
- package/dist/utils/Validate/additional/conditionallyRequired.js +1 -2
- package/dist/utils/Validate/additional/index.js +1 -2
- package/dist/utils/Validate/additional/mustBeAfter.js +1 -2
- package/dist/utils/Validate/additional/mustBeBefore.js +1 -2
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +1 -2
- package/dist/utils/Validate/additional/mustBeGreaterThan.js +1 -2
- package/dist/utils/Validate/additional/mustBeInTheFuture.js +1 -2
- package/dist/utils/Validate/additional/mustBeInThePast.js +1 -2
- package/dist/utils/Validate/additional/mustBeLessThan.js +1 -2
- package/dist/utils/Validate/additional/mustBeLongerThan.js +1 -2
- package/dist/utils/Validate/additional/mustBeNumbersOnly.js +1 -2
- package/dist/utils/Validate/additional/mustBeShorterThan.js +1 -2
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +1 -2
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +1 -2
- package/dist/utils/Validate/additional/mustNotContainSql.js +1 -2
- package/dist/utils/Validate/additional/mustSelectOnlyOne.js +1 -2
- package/dist/utils/Validate/additional/utils.js +3 -6
- package/dist/utils/Validate/index.js +1 -2
- package/dist/utils/Validate/validateCollection.js +1 -2
- package/dist/utils/Validate/validateComponent.js +2 -3
- package/dist/utils/Validate/validateContainer.js +1 -2
- package/dist/utils/Validate/validateDate.js +2 -4
- package/dist/utils/Validate/validateEmail.js +1 -2
- package/dist/utils/Validate/validateMultifile.js +2 -4
- package/dist/utils/Validate/validatePage.js +1 -2
- package/dist/utils/Validate/validateRegex.js +1 -2
- package/dist/utils/Validate/validateRequired.js +1 -2
- package/dist/utils/Validate/validateTextArea.js +1 -2
- package/dist/utils/Validate/validateTime.js +1 -2
- package/dist/utils/index.js +1 -2
- package/package.json +2 -2
|
@@ -18,5 +18,4 @@ var mustBeGreaterThan = function mustBeGreaterThan(value, config) {
|
|
|
18
18
|
var finalValue = typeof value === 'string' ? value.replace(/,/g, '') : value;
|
|
19
19
|
return parseFloat(finalValue) > config.value;
|
|
20
20
|
};
|
|
21
|
-
var _default = mustBeGreaterThan;
|
|
22
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = mustBeGreaterThan;
|
|
@@ -29,5 +29,4 @@ var mustBeInTheFuture = function mustBeInTheFuture(date, config) {
|
|
|
29
29
|
}
|
|
30
30
|
return !!(config !== null && config !== void 0 && config.todayAllowed) && (0, _dayjs.default)((0, _utils.formatString)(date), _utils.DATE_FORMAT).isToday();
|
|
31
31
|
};
|
|
32
|
-
var _default = mustBeInTheFuture;
|
|
33
|
-
exports.default = _default;
|
|
32
|
+
var _default = exports.default = mustBeInTheFuture;
|
|
@@ -32,5 +32,4 @@ var mustBeInThePast = function mustBeInThePast(date, config) {
|
|
|
32
32
|
}
|
|
33
33
|
return dateIsToday && !!(config !== null && config !== void 0 && config.todayAllowed);
|
|
34
34
|
};
|
|
35
|
-
var _default = mustBeInThePast;
|
|
36
|
-
exports.default = _default;
|
|
35
|
+
var _default = exports.default = mustBeInThePast;
|
|
@@ -18,5 +18,4 @@ var mustBeLessThan = function mustBeLessThan(value, config) {
|
|
|
18
18
|
var finalValue = typeof value === 'string' ? value.replace(/,/g, '') : value;
|
|
19
19
|
return parseFloat(finalValue) < config.value;
|
|
20
20
|
};
|
|
21
|
-
var _default = mustBeLessThan;
|
|
22
|
-
exports.default = _default;
|
|
21
|
+
var _default = exports.default = mustBeLessThan;
|
|
@@ -20,5 +20,4 @@ var mustBeNumbersOnly = function mustBeNumbersOnly(value, config) {
|
|
|
20
20
|
var regex = config !== null && config !== void 0 && config.allowCommas ? /^[0-9,]*\.?[0-9]*$/ : /^[0-9]*\.?[0-9]*$/;
|
|
21
21
|
return regex.test(value);
|
|
22
22
|
};
|
|
23
|
-
var _default = mustBeNumbersOnly;
|
|
24
|
-
exports.default = _default;
|
|
23
|
+
var _default = exports.default = mustBeNumbersOnly;
|
|
@@ -15,5 +15,4 @@ var mustHaveLessThanDecimalPlaces = function mustHaveLessThanDecimalPlaces(strin
|
|
|
15
15
|
}
|
|
16
16
|
return string.split('.')[1].length < config.maxDecimals;
|
|
17
17
|
};
|
|
18
|
-
var _default = mustHaveLessThanDecimalPlaces;
|
|
19
|
-
exports.default = _default;
|
|
18
|
+
var _default = exports.default = mustHaveLessThanDecimalPlaces;
|
|
@@ -29,7 +29,7 @@ var formatInTwoDigits = function formatInTwoDigits(dateComponent) {
|
|
|
29
29
|
}
|
|
30
30
|
return '';
|
|
31
31
|
};
|
|
32
|
-
var formatString = function formatString(date) {
|
|
32
|
+
var formatString = exports.formatString = function formatString(date) {
|
|
33
33
|
var _date$split = date.split('-'),
|
|
34
34
|
_date$split2 = _slicedToArray(_date$split, 3),
|
|
35
35
|
day = _date$split2[0],
|
|
@@ -37,14 +37,11 @@ var formatString = function formatString(date) {
|
|
|
37
37
|
year = _date$split2[2];
|
|
38
38
|
return "".concat(formatInTwoDigits(day), "-").concat(formatInTwoDigits(month), "-").concat(year);
|
|
39
39
|
};
|
|
40
|
-
exports.
|
|
41
|
-
var formattedTime = function formattedTime(time) {
|
|
40
|
+
var formattedTime = exports.formattedTime = function formattedTime(time) {
|
|
42
41
|
var _time$split = time.split(':'),
|
|
43
42
|
_time$split2 = _slicedToArray(_time$split, 2),
|
|
44
43
|
hour = _time$split2[0],
|
|
45
44
|
minute = _time$split2[1];
|
|
46
45
|
return "".concat(formatInTwoDigits(hour), ":").concat(formatInTwoDigits(minute));
|
|
47
46
|
};
|
|
48
|
-
exports.
|
|
49
|
-
var DATE_FORMAT = 'DD-MM-YYYY';
|
|
50
|
-
exports.DATE_FORMAT = DATE_FORMAT;
|
|
47
|
+
var DATE_FORMAT = exports.DATE_FORMAT = 'DD-MM-YYYY';
|
|
@@ -69,7 +69,7 @@ var validateComponent = function validateComponent(component, outerData, formDat
|
|
|
69
69
|
{
|
|
70
70
|
var _component$data$optio;
|
|
71
71
|
var nestedErrors = [];
|
|
72
|
-
(_component$data$optio = component.data.options) === null || _component$data$optio === void 0
|
|
72
|
+
(_component$data$optio = component.data.options) === null || _component$data$optio === void 0 || _component$data$optio.forEach(function (option) {
|
|
73
73
|
if (option.nested && (0, _optionIsSelected.default)(formData[component.id], option)) {
|
|
74
74
|
nestedErrors = nestedErrors.concat((0, _validateContainer.default)({
|
|
75
75
|
components: option.nested
|
|
@@ -114,5 +114,4 @@ var validateComponent = function validateComponent(component, outerData, formDat
|
|
|
114
114
|
}
|
|
115
115
|
return undefined;
|
|
116
116
|
};
|
|
117
|
-
var _default = validateComponent;
|
|
118
|
-
exports.default = _default;
|
|
117
|
+
var _default = exports.default = validateComponent;
|
|
@@ -20,7 +20,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // Global
|
|
|
20
20
|
_dayjs.default.extend(_customParseFormat.default);
|
|
21
21
|
_dayjs.default.extend(_isToday.default);
|
|
22
22
|
_dayjs.default.extend(_isLeapYear.default);
|
|
23
|
-
var maxMonthDays = function maxMonthDays(month, year) {
|
|
23
|
+
var maxMonthDays = exports.maxMonthDays = function maxMonthDays(month, year) {
|
|
24
24
|
if (month === '02') {
|
|
25
25
|
return (0, _dayjs.default)().year(year).isLeapYear() ? 29 : 28;
|
|
26
26
|
}
|
|
@@ -29,7 +29,6 @@ var maxMonthDays = function maxMonthDays(month, year) {
|
|
|
29
29
|
}
|
|
30
30
|
return 31;
|
|
31
31
|
};
|
|
32
|
-
exports.maxMonthDays = maxMonthDays;
|
|
33
32
|
/**
|
|
34
33
|
* Checks if a date passed is a valid date.
|
|
35
34
|
* This will validate for 'leap years', missing components, invalid day, monnth or year components.
|
|
@@ -121,5 +120,4 @@ var validateDate = function validateDate(date) {
|
|
|
121
120
|
propsInError: undefined
|
|
122
121
|
};
|
|
123
122
|
};
|
|
124
|
-
var _default = validateDate;
|
|
125
|
-
exports.default = _default;
|
|
123
|
+
var _default = exports.default = validateDate;
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.DEFAULT_ERROR = void 0;
|
|
7
|
-
var DEFAULT_ERROR = 'Invalid files must be deleted';
|
|
8
|
-
exports.DEFAULT_ERROR = DEFAULT_ERROR;
|
|
7
|
+
var DEFAULT_ERROR = exports.DEFAULT_ERROR = 'Invalid files must be deleted';
|
|
9
8
|
var validateMultifile = function validateMultifile(value, customErrors) {
|
|
10
9
|
if (!value) {
|
|
11
10
|
return undefined;
|
|
@@ -28,5 +27,4 @@ var validateMultifile = function validateMultifile(value, customErrors) {
|
|
|
28
27
|
}
|
|
29
28
|
return undefined;
|
|
30
29
|
};
|
|
31
|
-
var _default = validateMultifile;
|
|
32
|
-
exports.default = _default;
|
|
30
|
+
var _default = exports.default = validateMultifile;
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukhomeoffice/cop-react-form-renderer",
|
|
3
|
-
"version": "5.41.
|
|
3
|
+
"version": "5.41.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"post-compile": "rimraf dist/*.test.* dist/**/*.test.* dist/**/*.stories.* dist/docs dist/assets"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ukhomeoffice/cop-react-components": "3.15.
|
|
19
|
+
"@ukhomeoffice/cop-react-components": "^3.15.6",
|
|
20
20
|
"axios": "^0.23.0",
|
|
21
21
|
"dayjs": "^1.11.0",
|
|
22
22
|
"govuk-frontend": "^4.3.1",
|