@ukhomeoffice/cop-react-form-renderer 7.3.2 → 8.0.0-alpha
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/README.md +106 -32
- package/dist/components/CheckYourAnswers/Answer.d.ts +10 -0
- package/dist/components/CheckYourAnswers/CheckYourAnswers.d.ts +35 -0
- package/dist/components/CheckYourAnswers/index.d.ts +2 -0
- package/dist/components/CollectionPage/CollectionPage.d.ts +24 -0
- package/dist/components/CollectionPage/index.d.ts +1 -0
- package/dist/components/CollectionSummary/BannerStrip.d.ts +9 -0
- package/dist/components/CollectionSummary/CollectionSummary.d.ts +53 -0
- package/dist/components/CollectionSummary/Confirmation.d.ts +15 -0
- package/dist/components/CollectionSummary/RenderListView.d.ts +42 -0
- package/dist/components/CollectionSummary/SummaryCard.d.ts +62 -0
- package/dist/components/CollectionSummary/SummaryCardButtons.d.ts +21 -0
- package/dist/components/CollectionSummary/SummaryCardDetails.d.ts +14 -0
- package/dist/components/CollectionSummary/SummaryCardValidationContext.d.ts +9 -0
- package/dist/components/CollectionSummary/index.d.ts +2 -0
- package/dist/components/FormComponent/Collection.d.ts +39 -0
- package/dist/components/FormComponent/Container.d.ts +26 -0
- package/dist/components/FormComponent/FormComponent.d.ts +39 -0
- package/dist/components/FormComponent/helpers/addLabel.d.ts +7 -0
- package/dist/components/FormComponent/helpers/getComponentDisabled.d.ts +2 -0
- package/dist/components/FormComponent/helpers/getComponentError.d.ts +4 -0
- package/dist/components/FormComponent/helpers/getComponentFieldSet.d.ts +2 -0
- package/dist/components/FormComponent/helpers/index.d.ts +5 -0
- package/dist/components/FormComponent/index.d.ts +2 -0
- package/dist/components/FormPage/FormPage.d.ts +36 -0
- package/dist/components/FormPage/index.d.ts +2 -0
- package/dist/components/FormRenderer/FormRenderer.d.ts +39 -0
- package/dist/components/FormRenderer/handlers/cyaAction.d.ts +9 -0
- package/dist/components/FormRenderer/handlers/getPageId.d.ts +8 -0
- package/dist/components/FormRenderer/handlers/index.d.ts +6 -0
- package/dist/components/FormRenderer/handlers/navigate.d.ts +10 -0
- package/dist/components/FormRenderer/handlers/submissionError.d.ts +7 -0
- package/dist/components/FormRenderer/helpers/canActionProceed.d.ts +12 -0
- package/dist/components/FormRenderer/helpers/canCYASubmit.d.ts +10 -0
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.d.ts +2 -0
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.d.ts +51 -0
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.d.ts +179 -0
- package/dist/components/FormRenderer/helpers/getCYA.d.ts +20 -0
- package/dist/components/FormRenderer/helpers/getFormState.d.ts +25 -0
- package/dist/components/FormRenderer/helpers/getNextPageId.d.ts +2 -0
- package/dist/components/FormRenderer/helpers/getPage.d.ts +9 -0
- package/dist/components/FormRenderer/helpers/getRelevantPages.d.ts +2 -0
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.d.ts +2 -0
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.d.ts +10 -0
- package/dist/components/FormRenderer/helpers/index.d.ts +29 -0
- package/dist/components/FormRenderer/index.d.ts +2 -0
- package/dist/components/FormRenderer/onCYAAction.d.ts +6 -0
- package/dist/components/FormRenderer/onPageAction.d.ts +2 -0
- package/dist/components/FormRenderer/onTaskAction.d.ts +2 -0
- package/dist/components/PageActions/ActionButton.d.ts +7 -0
- package/dist/components/PageActions/PageActions.d.ts +7 -0
- package/dist/components/PageActions/index.d.ts +2 -0
- package/dist/components/SummaryList/GroupAction.d.ts +12 -0
- package/dist/components/SummaryList/RowAction.d.ts +12 -0
- package/dist/components/SummaryList/SummaryList.d.ts +28 -0
- package/dist/components/SummaryList/SummaryList.stories.d.ts +10 -0
- package/dist/components/SummaryList/SummaryListHeadingRow.d.ts +7 -0
- package/dist/components/SummaryList/SummaryListHeadingRowWithAction.d.ts +16 -0
- package/dist/components/SummaryList/SummaryListRow.d.ts +19 -0
- package/dist/components/SummaryList/SummaryListTitleRow.d.ts +7 -0
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.d.ts +17 -0
- package/dist/components/SummaryList/helpers/getRowActionAttributes.d.ts +17 -0
- package/dist/components/SummaryList/helpers/index.d.ts +2 -0
- package/dist/components/SummaryList/index.d.ts +2 -0
- package/dist/components/TaskList/Task.d.ts +12 -0
- package/dist/components/TaskList/TaskList.d.ts +40 -0
- package/dist/components/TaskList/TaskState.d.ts +6 -0
- package/dist/components/TaskList/index.d.ts +2 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/context/HooksContext/HooksContext.d.ts +23 -0
- package/dist/context/HooksContext/index.d.ts +3 -0
- package/dist/context/ValidationContext/ValidationContext.d.ts +7 -0
- package/dist/context/ValidationContext/index.d.ts +3 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/useAxios.d.ts +2 -0
- package/dist/hooks/useGetRequest.d.ts +12 -0
- package/dist/hooks/useHooks.d.ts +2 -0
- package/dist/hooks/useRefData.d.ts +7 -0
- package/dist/hooks/useValidation.d.ts +2 -0
- package/dist/index.cjs +5 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6124 -81
- package/dist/models/CollectionLabels.d.ts +7 -0
- package/dist/models/ComponentTypes.d.ts +27 -0
- package/dist/models/EventTypes.d.ts +6 -0
- package/dist/models/FormPages.d.ts +6 -0
- package/dist/models/FormTypes.d.ts +10 -0
- package/dist/models/HubFormats.d.ts +5 -0
- package/dist/models/PageAction.d.ts +89 -0
- package/dist/models/TaskStates.d.ts +39 -0
- package/dist/models/index.d.ts +143 -0
- package/dist/setupTests.d.ts +14 -0
- package/dist/utils/CheckYourAnswers/getCYAAction.d.ts +20 -0
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.d.ts +22 -0
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.d.ts +22 -0
- package/dist/utils/CheckYourAnswers/getCYARow.d.ts +26 -0
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.d.ts +17 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.d.ts +2 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.d.ts +23 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.d.ts +2 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.d.ts +11 -0
- package/dist/utils/CheckYourAnswers/getSummaryListRowForDetails.d.ts +3 -0
- package/dist/utils/CheckYourAnswers/index.d.ts +5 -0
- package/dist/utils/CheckYourAnswers/showComponentCYA.d.ts +11 -0
- package/dist/utils/CollectionPage/addCollectionPageEntry.d.ts +12 -0
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.d.ts +13 -0
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.d.ts +13 -0
- package/dist/utils/CollectionPage/getCollectionPageActiveId.d.ts +14 -0
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.d.ts +15 -0
- package/dist/utils/CollectionPage/getCollectionPageData.d.ts +15 -0
- package/dist/utils/CollectionPage/getErrorsForCollection.d.ts +2 -0
- package/dist/utils/CollectionPage/getQuickEditPage.d.ts +40 -0
- package/dist/utils/CollectionPage/index.d.ts +13 -0
- package/dist/utils/CollectionPage/mergeCollectionPages.d.ts +13 -0
- package/dist/utils/CollectionPage/removeCollectionPageEntry.d.ts +11 -0
- package/dist/utils/CollectionPage/setCollectionPageData.d.ts +16 -0
- package/dist/utils/Component/addShowWhen.d.ts +13 -0
- package/dist/utils/Component/applyToComponentTree.d.ts +15 -0
- package/dist/utils/Component/cleanAttributes.d.ts +14 -0
- package/dist/utils/Component/elevateNestedComponents.d.ts +28 -0
- package/dist/utils/Component/getDefaultValue.d.ts +2 -0
- package/dist/utils/Component/getDefaultValueFromConfig.d.ts +2 -0
- package/dist/utils/Component/index.d.ts +12 -0
- package/dist/utils/Component/isEditable.d.ts +3 -0
- package/dist/utils/Component/optionIsSelected.d.ts +10 -0
- package/dist/utils/Component/setupContainerComponentsPath.d.ts +2 -0
- package/dist/utils/Component/showComponent.d.ts +2 -0
- package/dist/utils/Condition/index.d.ts +6 -0
- package/dist/utils/Condition/meetsAllConditions.d.ts +8 -0
- package/dist/utils/Condition/meetsCondition.d.ts +14 -0
- package/dist/utils/Condition/meetsOneCondition.d.ts +8 -0
- package/dist/utils/Condition/setupConditions.d.ts +2 -0
- package/dist/utils/Container/getEditableComponents.d.ts +7 -0
- package/dist/utils/Container/index.d.ts +6 -0
- package/dist/utils/Container/setupNesting.d.ts +2 -0
- package/dist/utils/Container/showContainer.d.ts +8 -0
- package/dist/utils/Data/applyFormula.d.ts +2 -0
- package/dist/utils/Data/deleteValues.d.ts +8 -0
- package/dist/utils/Data/getAutocompleteSource.d.ts +2 -0
- package/dist/utils/Data/getDataPath.d.ts +21 -0
- package/dist/utils/Data/getOptions.d.ts +2 -0
- package/dist/utils/Data/getSourceData.d.ts +17 -0
- package/dist/utils/Data/index.d.ts +15 -0
- package/dist/utils/Data/nestInRefdataOptions.d.ts +10 -0
- package/dist/utils/Data/refDataToOptions.d.ts +8 -0
- package/dist/utils/Data/setDataItem.d.ts +2 -0
- package/dist/utils/Data/setupFormData.d.ts +15 -0
- package/dist/utils/Data/setupRefDataUrlForComponent.d.ts +2 -0
- package/dist/utils/FormPage/applyConditionalProperties.d.ts +8 -0
- package/dist/utils/FormPage/getConditionalText.d.ts +23 -0
- package/dist/utils/FormPage/getFormPage.d.ts +9 -0
- package/dist/utils/FormPage/getFormPages.d.ts +9 -0
- package/dist/utils/FormPage/getPageActions.d.ts +13 -0
- package/dist/utils/FormPage/getParagraphFromText.d.ts +11 -0
- package/dist/utils/FormPage/index.d.ts +10 -0
- package/dist/utils/FormPage/showFormPage.d.ts +8 -0
- package/dist/utils/FormPage/showFormPageCYA.d.ts +8 -0
- package/dist/utils/FormPage/useComponent.d.ts +9 -0
- package/dist/utils/Format/formatData.d.ts +8 -0
- package/dist/utils/Format/formatDataForComponent.d.ts +15 -0
- package/dist/utils/Format/formatDataForForm.d.ts +8 -0
- package/dist/utils/Format/formatDataForPage.d.ts +15 -0
- package/dist/utils/Format/index.d.ts +7 -0
- package/dist/utils/Hub/getFormHub.d.ts +15 -0
- package/dist/utils/Hub/index.d.ts +4 -0
- package/dist/utils/Meta/constants.d.ts +2 -0
- package/dist/utils/Meta/documents/getDocuments.d.ts +2 -0
- package/dist/utils/Meta/documents/index.d.ts +6 -0
- package/dist/utils/Meta/documents/setDocumentsForField.d.ts +2 -0
- package/dist/utils/Meta/index.d.ts +9 -0
- package/dist/utils/Operate/checkValueIsTruthy.d.ts +9 -0
- package/dist/utils/Operate/deleteValueInFormData.d.ts +8 -0
- package/dist/utils/Operate/doesContainValue.d.ts +11 -0
- package/dist/utils/Operate/getFirstOf.d.ts +2 -0
- package/dist/utils/Operate/getIndexOfMatchingValueIn.d.ts +11 -0
- package/dist/utils/Operate/getLength.d.ts +11 -0
- package/dist/utils/Operate/index.d.ts +4 -0
- package/dist/utils/Operate/persistValueInFormData.d.ts +9 -0
- package/dist/utils/Operate/runPageOperations.d.ts +19 -0
- package/dist/utils/Operate/setValueInFormData.d.ts +2 -0
- package/dist/utils/Operate/shouldRun.d.ts +9 -0
- package/dist/utils/Validate/additional/conditionallyPermittedChange.d.ts +14 -0
- package/dist/utils/Validate/additional/conditionallyRequired.d.ts +11 -0
- package/dist/utils/Validate/additional/index.d.ts +2 -0
- package/dist/utils/Validate/additional/mustBeAfter.d.ts +14 -0
- package/dist/utils/Validate/additional/mustBeBefore.d.ts +14 -0
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.d.ts +15 -0
- package/dist/utils/Validate/additional/mustBeGreaterThan.d.ts +7 -0
- package/dist/utils/Validate/additional/mustBeInTheFuture.d.ts +8 -0
- package/dist/utils/Validate/additional/mustBeInThePast.d.ts +9 -0
- package/dist/utils/Validate/additional/mustBeLessThan.d.ts +7 -0
- package/dist/utils/Validate/additional/mustBeLongerThan.d.ts +9 -0
- package/dist/utils/Validate/additional/mustBeNumbersOnly.d.ts +9 -0
- package/dist/utils/Validate/additional/mustBeOneOf.d.ts +8 -0
- package/dist/utils/Validate/additional/mustBeShorterThan.d.ts +9 -0
- package/dist/utils/Validate/additional/mustBeUniqueInCollection.d.ts +10 -0
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.d.ts +9 -0
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.d.ts +7 -0
- package/dist/utils/Validate/additional/mustNotContainSql.d.ts +2 -0
- package/dist/utils/Validate/additional/mustSelectOnlyOne.d.ts +8 -0
- package/dist/utils/Validate/additional/utils.d.ts +4 -0
- package/dist/utils/Validate/index.d.ts +42 -0
- package/dist/utils/Validate/validateCollection.d.ts +9 -0
- package/dist/utils/Validate/validateComponent.d.ts +16 -0
- package/dist/utils/Validate/validateContainer.d.ts +12 -0
- package/dist/utils/Validate/validateDate.d.ts +29 -0
- package/dist/utils/Validate/validateEmail.d.ts +13 -0
- package/dist/utils/Validate/validateMultifile.d.ts +3 -0
- package/dist/utils/Validate/validateOnPageLoad.d.ts +1 -0
- package/dist/utils/Validate/validatePage.d.ts +8 -0
- package/dist/utils/Validate/validateRegex.d.ts +13 -0
- package/dist/utils/Validate/validateRequired.d.ts +9 -0
- package/dist/utils/Validate/validateTextArea.d.ts +13 -0
- package/dist/utils/Validate/validateTime.d.ts +20 -0
- package/dist/utils/canOverrideFieldRequired.d.ts +9 -0
- package/dist/utils/index.d.ts +140 -0
- package/package.json +80 -167
- package/LICENCE.md +0 -21
- package/dist/components/CheckYourAnswers/Answer.js +0 -59
- package/dist/components/CheckYourAnswers/Answer.test.js +0 -142
- package/dist/components/CheckYourAnswers/CheckYourAnswers.js +0 -252
- package/dist/components/CheckYourAnswers/CheckYourAnswers.scss +0 -43
- package/dist/components/CheckYourAnswers/CheckYourAnswers.stories.mdx +0 -409
- package/dist/components/CheckYourAnswers/CheckYourAnswers.test.js +0 -603
- package/dist/components/CheckYourAnswers/index.js +0 -10
- package/dist/components/CollectionPage/CollectionPage.js +0 -178
- package/dist/components/CollectionPage/CollectionPage.test.js +0 -507
- package/dist/components/CollectionPage/index.js +0 -10
- package/dist/components/CollectionSummary/BannerStrip.js +0 -65
- package/dist/components/CollectionSummary/BannerStrip.scss +0 -60
- package/dist/components/CollectionSummary/BannerStrip.test.js +0 -167
- package/dist/components/CollectionSummary/CollectionSummary.js +0 -362
- package/dist/components/CollectionSummary/CollectionSummary.scss +0 -26
- package/dist/components/CollectionSummary/CollectionSummary.test.js +0 -368
- package/dist/components/CollectionSummary/Confirmation.js +0 -65
- package/dist/components/CollectionSummary/Confirmation.scss +0 -26
- package/dist/components/CollectionSummary/Confirmation.test.js +0 -109
- package/dist/components/CollectionSummary/RenderListView.js +0 -162
- package/dist/components/CollectionSummary/RenderListView.scss +0 -295
- package/dist/components/CollectionSummary/RenderListView.test.js +0 -303
- package/dist/components/CollectionSummary/SummaryCard.js +0 -277
- package/dist/components/CollectionSummary/SummaryCard.scss +0 -114
- package/dist/components/CollectionSummary/SummaryCard.test.js +0 -1442
- package/dist/components/CollectionSummary/SummaryCardButtons.js +0 -76
- package/dist/components/CollectionSummary/SummaryCardButtons.test.js +0 -87
- package/dist/components/CollectionSummary/SummaryCardDetails.js +0 -206
- package/dist/components/CollectionSummary/SummaryCardDetails.scss +0 -216
- package/dist/components/CollectionSummary/SummaryCardDetails.test.js +0 -654
- package/dist/components/CollectionSummary/SummaryCardValidationContext.js +0 -79
- package/dist/components/CollectionSummary/SummaryCardValidationContext.test.js +0 -104
- package/dist/components/CollectionSummary/index.js +0 -10
- package/dist/components/FormComponent/Collection.js +0 -234
- package/dist/components/FormComponent/Collection.scss +0 -24
- package/dist/components/FormComponent/Collection.test.js +0 -934
- package/dist/components/FormComponent/Container.js +0 -130
- package/dist/components/FormComponent/Container.scss +0 -15
- package/dist/components/FormComponent/Container.test.js +0 -456
- package/dist/components/FormComponent/FormComponent.js +0 -238
- package/dist/components/FormComponent/FormComponent.stories.mdx +0 -186
- package/dist/components/FormComponent/FormComponent.test.js +0 -436
- package/dist/components/FormComponent/helpers/addLabel.js +0 -25
- package/dist/components/FormComponent/helpers/getComponentDisabled.js +0 -15
- package/dist/components/FormComponent/helpers/getComponentDisabled.test.js +0 -27
- package/dist/components/FormComponent/helpers/getComponentError.js +0 -23
- package/dist/components/FormComponent/helpers/getComponentError.test.js +0 -51
- package/dist/components/FormComponent/helpers/getComponentFieldSet.js +0 -11
- package/dist/components/FormComponent/helpers/getComponentFieldSet.test.js +0 -30
- package/dist/components/FormComponent/helpers/index.js +0 -35
- package/dist/components/FormComponent/index.js +0 -10
- package/dist/components/FormPage/FormPage.js +0 -212
- package/dist/components/FormPage/FormPage.scss +0 -7
- package/dist/components/FormPage/FormPage.stories.mdx +0 -157
- package/dist/components/FormPage/FormPage.test.js +0 -454
- package/dist/components/FormPage/index.js +0 -10
- package/dist/components/FormRenderer/FormRenderer.js +0 -426
- package/dist/components/FormRenderer/FormRenderer.scss +0 -5
- package/dist/components/FormRenderer/FormRenderer.stories.mdx +0 -178
- package/dist/components/FormRenderer/FormRenderer.test.js +0 -799
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/cop-reassign-task-to-rcc.json +0 -446
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens-containerised.json +0 -120
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens-dependent-component-nested-block.json +0 -113
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens-dependent-component-nested.json +0 -106
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens-refdata.json +0 -106
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens-target-component-nested.json +0 -99
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-component-show-whens.json +0 -106
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-chained-show-whens-page-hidden.json +0 -113
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-cop-airpax.json +0 -26408
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-cop-mandec.json +0 -9405
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-collection-component-dependent-on-external-data.json +0 -158
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-collection-component.json +0 -86
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-referring-to-collection.json +0 -173
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-referring-to-hidden-collection.json +0 -202
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-show-when-in-component-and-page.json +0 -63
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-with-nested-questions-visible-elsewhere.json +0 -118
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component-with-nested-questions.json +0 -112
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-component.json +0 -58
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-containerised-component.json +0 -97
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-embedded-collection-component.json +0 -83
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-embedded-component.json +0 -55
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-entire-collection.json +0 -114
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-multilevel-containerised-component-leaf-hidden.json +0 -106
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-multilevel-containerised-component.json +0 -106
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-options.json +0 -99
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-collection.json +0 -128
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-component-used-elsewhere.json +0 -109
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page-same-component-reused.json +0 -62
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-hidden-page.json +0 -96
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-nested-answers-hidden-by-option-visible-elsewhere.json +0 -113
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-nested-answers-hidden-by-option.json +0 -112
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-nested-component.json +0 -26003
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-nested-radio-component.json +0 -201
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-page-same-component-reused-one-shown.json +0 -75
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/forms/form-variance-breach.json +0 -4272
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-carrier.json +0 -407
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-change-what-happened-before.json +0 -300
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-airpax-remove-photos-before.json +0 -384
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-mandec-remove-business-interests-before.json +0 -140
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-mandec-remove-criminality-before.json +0 -186
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-mandec-remove-unspent-convictions-before.json +0 -143
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/cop-variance-breach-with-upload-files.json +0 -1264
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens-containerised.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens-dependent-component-nested-block.json +0 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens-dependent-component-nested.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens-refdata.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens-target-component-nested.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-component-show-whens.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-chained-show-whens-page-hidden.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-collection-component-dependent-on-external-data.json +0 -26
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-collection-component.json +0 -15
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-referring-to-collection.json +0 -25
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-referring-to-hidden-collection.json +0 -26
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-show-when-in-component-and-page.json +0 -6
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-with-nested-questions-visible-elsewhere.json +0 -12
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component-with-nested-questions.json +0 -12
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-component.json +0 -5
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-containerised-component.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-embedded-collection-component.json +0 -15
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-embedded-component.json +0 -5
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-entire-collection.json +0 -20
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-multilevel-containerised-component-leaf-hidden.json +0 -14
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-multilevel-containerised-component.json +0 -14
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-options.json +0 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-collection.json +0 -18
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-component-used-elsewhere.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page-same-component-reused.json +0 -6
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-hidden-page.json +0 -9
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-nested-answers-hidden-by-option-visible-elsewhere.json +0 -12
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-nested-answers-hidden-by-option.json +0 -12
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-nested-component.json +0 -63
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-nested-radio-component.json +0 -45
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/data-page-same-component-reused-one-shown.json +0 -8
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/input/reassign-to-rcc.json +0 -72
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-airpax-change-what-happened-after.json +0 -280
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-airpax-remove-photos-after.json +0 -355
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-mandec-base-file.json +0 -80
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-mandec-remove-business-interests-after.json +0 -122
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-mandec-remove-criminality-after.json +0 -86
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/cop-mandec-remove-unspent-convictions-after.json +0 -127
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-containerised-removed.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-dependent-component-nested-block-removed.json +0 -7
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-dependent-component-nested-removed.json +0 -7
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-refdata-removed.json +0 -7
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-removed.json +0 -7
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-component-show-whens-target-component-nested-removed.json +0 -6
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-chained-show-whens-page-hidden-removed.json +0 -6
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-collection-component-dependent-on-external-data-removed.json +0 -23
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-collection-component-removed.json +0 -4
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-referring-to-collection-removed.json +0 -21
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-referring-to-hidden-collection-removed.json +0 -6
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-removed.json +0 -4
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-show-when-in-component-and-page-removed.json +0 -5
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-with-nested-questions-removed.json +0 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-component-with-nested-questions-visible-elsewhere-removed.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-containerised-component-removed.json +0 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-embedded-collection-component-removed.json +0 -4
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-embedded-component-removed.json +0 -4
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-entire-collection-removed.json +0 -3
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-multilevel-containerised-component-leaf-hidden-removed.json +0 -13
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-multilevel-containerised-component-removed.json +0 -10
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-options-removed.json +0 -8
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-collection-removed.json +0 -15
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-component-used-elsewhere-removed.json +0 -5
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-removed.json +0 -4
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-hidden-page-same-component-reused-removed.json +0 -5
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-nested-answers-hidden-by-option-removed.json +0 -11
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-nested-answers-hidden-by-option-visible-elsewhere-removed.json +0 -12
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-nested-component.json +0 -63
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-nested-radio-component-removed.json +0 -45
- package/dist/components/FormRenderer/clear-uncompleted-routes/test-data/output/data-page-same-component-reused-one-shown-removed.json +0 -7
- package/dist/components/FormRenderer/handlers/cyaAction.js +0 -23
- package/dist/components/FormRenderer/handlers/getPageId.js +0 -15
- package/dist/components/FormRenderer/handlers/getPageId.test.js +0 -35
- package/dist/components/FormRenderer/handlers/handlers.test.js +0 -81
- package/dist/components/FormRenderer/handlers/index.js +0 -17
- package/dist/components/FormRenderer/handlers/navigate.js +0 -25
- package/dist/components/FormRenderer/handlers/submissionError.js +0 -18
- package/dist/components/FormRenderer/helpers/canActionProceed.js +0 -27
- package/dist/components/FormRenderer/helpers/canActionProceed.test.js +0 -84
- package/dist/components/FormRenderer/helpers/canCYASubmit.js +0 -17
- package/dist/components/FormRenderer/helpers/canCYASubmit.test.js +0 -75
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.js +0 -63
- package/dist/components/FormRenderer/helpers/cleanHiddenNestedData.test.js +0 -191
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.js +0 -338
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutes.test.js +0 -434
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.js +0 -399
- package/dist/components/FormRenderer/helpers/clearOutUncompletedRoutesUtils.test.js +0 -559
- package/dist/components/FormRenderer/helpers/getCYA.js +0 -42
- package/dist/components/FormRenderer/helpers/getCYA.test.js +0 -46
- package/dist/components/FormRenderer/helpers/getFormState.js +0 -25
- package/dist/components/FormRenderer/helpers/getFormState.test.js +0 -60
- package/dist/components/FormRenderer/helpers/getNextPageId.js +0 -76
- package/dist/components/FormRenderer/helpers/getNextPageId.test.js +0 -292
- package/dist/components/FormRenderer/helpers/getPage.js +0 -27
- package/dist/components/FormRenderer/helpers/getPage.test.js +0 -45
- package/dist/components/FormRenderer/helpers/getRelevantPages.js +0 -27
- package/dist/components/FormRenderer/helpers/getRelevantPages.test.js +0 -70
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.js +0 -65
- package/dist/components/FormRenderer/helpers/getSubmissionStatus.test.js +0 -309
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.js +0 -201
- package/dist/components/FormRenderer/helpers/getUpdatedSectionStates.test.js +0 -473
- package/dist/components/FormRenderer/helpers/index.js +0 -33
- package/dist/components/FormRenderer/index.js +0 -10
- package/dist/components/FormRenderer/onCYAAction.js +0 -150
- package/dist/components/FormRenderer/onCYAAction.test.js +0 -741
- package/dist/components/FormRenderer/onPageAction.js +0 -227
- package/dist/components/FormRenderer/onPageAction.test.js +0 -960
- package/dist/components/FormRenderer/onTaskAction.js +0 -47
- package/dist/components/FormRenderer/onTaskAction.test.js +0 -247
- package/dist/components/PageActions/ActionButton.js +0 -48
- package/dist/components/PageActions/ActionButton.test.js +0 -73
- package/dist/components/PageActions/PageActions.js +0 -37
- package/dist/components/PageActions/PageActions.stories.mdx +0 -74
- package/dist/components/PageActions/PageActions.test.js +0 -106
- package/dist/components/PageActions/index.js +0 -10
- package/dist/components/SummaryList/GroupAction.js +0 -50
- package/dist/components/SummaryList/GroupAction.test.js +0 -86
- package/dist/components/SummaryList/RowAction.js +0 -48
- package/dist/components/SummaryList/RowAction.test.js +0 -86
- package/dist/components/SummaryList/SummaryList.js +0 -128
- package/dist/components/SummaryList/SummaryList.scss +0 -79
- package/dist/components/SummaryList/SummaryList.stories.mdx +0 -84
- package/dist/components/SummaryList/SummaryList.test.js +0 -504
- package/dist/components/SummaryList/SummaryListHeadingRow.js +0 -39
- package/dist/components/SummaryList/SummaryListHeadingRowWithAction.js +0 -65
- package/dist/components/SummaryList/SummaryListHeadingRowWithAction.scss +0 -38
- package/dist/components/SummaryList/SummaryListRow.js +0 -58
- package/dist/components/SummaryList/SummaryListTitleRow.js +0 -32
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.js +0 -29
- package/dist/components/SummaryList/helpers/getGroupActionAttributes.test.js +0 -72
- package/dist/components/SummaryList/helpers/getRowActionAttributes.js +0 -29
- package/dist/components/SummaryList/helpers/getRowActionAttributes.test.js +0 -72
- package/dist/components/SummaryList/helpers/index.js +0 -14
- package/dist/components/SummaryList/index.js +0 -10
- package/dist/components/TaskList/Task.js +0 -62
- package/dist/components/TaskList/Task.test.js +0 -176
- package/dist/components/TaskList/TaskList.js +0 -175
- package/dist/components/TaskList/TaskList.scss +0 -123
- package/dist/components/TaskList/TaskList.stories.mdx +0 -164
- package/dist/components/TaskList/TaskList.test.js +0 -535
- package/dist/components/TaskList/TaskState.js +0 -37
- package/dist/components/TaskList/TaskState.test.js +0 -95
- package/dist/components/TaskList/index.js +0 -10
- package/dist/components/index.js +0 -56
- package/dist/context/HooksContext/HooksContext.js +0 -122
- package/dist/context/HooksContext/HooksContext.test.js +0 -45
- package/dist/context/HooksContext/index.js +0 -16
- package/dist/context/ValidationContext/ValidationContext.js +0 -98
- package/dist/context/ValidationContext/ValidationContext.test.js +0 -107
- package/dist/context/ValidationContext/index.js +0 -16
- package/dist/context/index.js +0 -21
- package/dist/hooks/index.js +0 -55
- package/dist/hooks/useAxios.js +0 -36
- package/dist/hooks/useGetRequest.js +0 -89
- package/dist/hooks/useHooks.js +0 -15
- package/dist/hooks/useRefData.js +0 -62
- package/dist/hooks/useValidation.js +0 -15
- package/dist/json/actions.json +0 -17
- package/dist/json/actionsNoSave.json +0 -17
- package/dist/json/addressDetails.json +0 -149
- package/dist/json/areYouACivilServant.json +0 -7
- package/dist/json/firstForm.json +0 -94
- package/dist/json/grade.json +0 -108
- package/dist/json/group.data.json +0 -21
- package/dist/json/group.json +0 -402
- package/dist/json/groupOfRow.json +0 -137
- package/dist/json/groupOfRowData.json +0 -15
- package/dist/json/port.json +0 -346
- package/dist/json/saveAndContinue.json +0 -98
- package/dist/json/sublocation.json +0 -859
- package/dist/json/taskList.json +0 -265
- package/dist/json/team.json +0 -17351
- package/dist/json/terminal.json +0 -81
- package/dist/json/userProfile.data.json +0 -21
- package/dist/json/userProfile.json +0 -276
- package/dist/models/CollectionLabels.js +0 -15
- package/dist/models/ComponentTypes.js +0 -58
- package/dist/models/EventTypes.js +0 -16
- package/dist/models/FormPages.js +0 -16
- package/dist/models/FormTypes.js +0 -24
- package/dist/models/HubFormats.js +0 -14
- package/dist/models/PageAction.js +0 -65
- package/dist/models/TaskStates.js +0 -46
- package/dist/models/index.js +0 -77
- package/dist/setupTests.js +0 -54
- package/dist/utils/CheckYourAnswers/getCYAAction.js +0 -44
- package/dist/utils/CheckYourAnswers/getCYAAction.test.js +0 -120
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.js +0 -57
- package/dist/utils/CheckYourAnswers/getCYACollectionChangeAction.test.js +0 -162
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.js +0 -66
- package/dist/utils/CheckYourAnswers/getCYACollectionDeleteAction.test.js +0 -198
- package/dist/utils/CheckYourAnswers/getCYARow.js +0 -58
- package/dist/utils/CheckYourAnswers/getCYARow.test.js +0 -373
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.js +0 -69
- package/dist/utils/CheckYourAnswers/getCYARowForGroup.test.js +0 -70
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.js +0 -71
- package/dist/utils/CheckYourAnswers/getCYARowsForCollection.test.js +0 -285
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.js +0 -237
- package/dist/utils/CheckYourAnswers/getCYARowsForCollectionPage.test.js +0 -844
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.js +0 -45
- package/dist/utils/CheckYourAnswers/getCYARowsForContainer.test.js +0 -535
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +0 -72
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +0 -343
- package/dist/utils/CheckYourAnswers/getSummaryListRowForDetails.js +0 -42
- package/dist/utils/CheckYourAnswers/getSummaryListRowForDetails.test.js +0 -56
- package/dist/utils/CheckYourAnswers/index.js +0 -15
- package/dist/utils/CheckYourAnswers/showComponentCYA.js +0 -53
- package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +0 -149
- package/dist/utils/CollectionPage/addCollectionPageEntry.js +0 -23
- package/dist/utils/CollectionPage/addCollectionPageEntry.test.js +0 -17
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.js +0 -26
- package/dist/utils/CollectionPage/duplicateCollectionPageActiveEntry.test.js +0 -70
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.js +0 -51
- package/dist/utils/CollectionPage/duplicateCollectionPageEntry.test.js +0 -125
- package/dist/utils/CollectionPage/getCollectionPageActiveId.js +0 -24
- package/dist/utils/CollectionPage/getCollectionPageActiveId.test.js +0 -26
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.js +0 -44
- package/dist/utils/CollectionPage/getCollectionPageActiveIndex.test.js +0 -88
- package/dist/utils/CollectionPage/getCollectionPageData.js +0 -53
- package/dist/utils/CollectionPage/getCollectionPageData.test.js +0 -103
- package/dist/utils/CollectionPage/getErrorsForCollection.js +0 -55
- package/dist/utils/CollectionPage/getErrorsForCollection.test.js +0 -154
- package/dist/utils/CollectionPage/getQuickEditPage.js +0 -122
- package/dist/utils/CollectionPage/getQuickEditPage.test.js +0 -143
- package/dist/utils/CollectionPage/index.js +0 -33
- package/dist/utils/CollectionPage/mergeCollectionPages.js +0 -128
- package/dist/utils/CollectionPage/mergeCollectionPages.test.js +0 -198
- package/dist/utils/CollectionPage/removeCollectionPageEntry.js +0 -36
- package/dist/utils/CollectionPage/removeCollectionPageEntry.test.js +0 -62
- package/dist/utils/CollectionPage/setCollectionPageData.js +0 -60
- package/dist/utils/CollectionPage/setCollectionPageData.test.js +0 -182
- package/dist/utils/Component/addShowWhen.js +0 -43
- package/dist/utils/Component/addShowWhen.test.js +0 -217
- package/dist/utils/Component/applyToComponentTree.js +0 -68
- package/dist/utils/Component/applyToComponentTree.test.js +0 -125
- package/dist/utils/Component/cleanAttributes.js +0 -42
- package/dist/utils/Component/cleanAttributes.test.js +0 -67
- package/dist/utils/Component/elevateNestedComponents.js +0 -58
- package/dist/utils/Component/elevateNestedComponents.test.js +0 -305
- package/dist/utils/Component/getComponent.js +0 -305
- package/dist/utils/Component/getComponentTests/getComponent.autocomplete.test.js +0 -73
- package/dist/utils/Component/getComponentTests/getComponent.calculation.test.js +0 -251
- package/dist/utils/Component/getComponentTests/getComponent.checkboxes.test.js +0 -156
- package/dist/utils/Component/getComponentTests/getComponent.date.test.js +0 -104
- package/dist/utils/Component/getComponentTests/getComponent.details.test.js +0 -56
- package/dist/utils/Component/getComponentTests/getComponent.email.test.js +0 -60
- package/dist/utils/Component/getComponentTests/getComponent.file.test.js +0 -60
- package/dist/utils/Component/getComponentTests/getComponent.heading.test.js +0 -31
- package/dist/utils/Component/getComponentTests/getComponent.html.test.js +0 -42
- package/dist/utils/Component/getComponentTests/getComponent.insetText.test.js +0 -29
- package/dist/utils/Component/getComponentTests/getComponent.list.test.js +0 -47
- package/dist/utils/Component/getComponentTests/getComponent.multifile.test.js +0 -66
- package/dist/utils/Component/getComponentTests/getComponent.nested.test.js +0 -211
- package/dist/utils/Component/getComponentTests/getComponent.paragraph.test.js +0 -46
- package/dist/utils/Component/getComponentTests/getComponent.phoneNumber.test.js +0 -60
- package/dist/utils/Component/getComponentTests/getComponent.radios.test.js +0 -221
- package/dist/utils/Component/getComponentTests/getComponent.select.test.js +0 -62
- package/dist/utils/Component/getComponentTests/getComponent.text.test.js +0 -60
- package/dist/utils/Component/getComponentTests/getComponent.textArea.test.js +0 -104
- package/dist/utils/Component/getComponentTests/getComponent.time.test.js +0 -80
- package/dist/utils/Component/getComponentTests/getComponent.unknown.test.js +0 -14
- package/dist/utils/Component/getComponentTests/getComponent.warningText.test.js +0 -29
- package/dist/utils/Component/getDefaultValue.js +0 -22
- package/dist/utils/Component/getDefaultValue.test.js +0 -62
- package/dist/utils/Component/getDefaultValueFromConfig.js +0 -106
- package/dist/utils/Component/getDefaultValueFromConfig.test.js +0 -141
- package/dist/utils/Component/index.js +0 -29
- package/dist/utils/Component/isEditable.js +0 -13
- package/dist/utils/Component/isEditable.test.js +0 -42
- package/dist/utils/Component/optionIsSelected.js +0 -25
- package/dist/utils/Component/optionIsSelected.test.js +0 -69
- package/dist/utils/Component/setupContainerComponentsPath.js +0 -35
- package/dist/utils/Component/setupContainerComponentsPath.test.js +0 -79
- package/dist/utils/Component/showComponent.js +0 -25
- package/dist/utils/Component/showComponent.test.js +0 -157
- package/dist/utils/Component/wrapInFormGroup.js +0 -26
- package/dist/utils/Condition/index.js +0 -17
- package/dist/utils/Condition/meetsAllConditions.js +0 -44
- package/dist/utils/Condition/meetsAllConditions.test.js +0 -109
- package/dist/utils/Condition/meetsCondition.js +0 -165
- package/dist/utils/Condition/meetsCondition.test.js +0 -899
- package/dist/utils/Condition/meetsOneCondition.js +0 -32
- package/dist/utils/Condition/meetsOneCondition.test.js +0 -101
- package/dist/utils/Condition/setupConditions.js +0 -36
- package/dist/utils/Condition/setupConditions.test.js +0 -34
- package/dist/utils/Container/getEditableComponents.js +0 -29
- package/dist/utils/Container/getEditableComponents.test.js +0 -134
- package/dist/utils/Container/index.js +0 -17
- package/dist/utils/Container/setupNesting.js +0 -53
- package/dist/utils/Container/setupNesting.test.js +0 -143
- package/dist/utils/Container/showContainer.js +0 -52
- package/dist/utils/Container/showContainer.test.js +0 -179
- package/dist/utils/Data/applyFormula.js +0 -90
- package/dist/utils/Data/applyFormula.test.js +0 -264
- package/dist/utils/Data/deleteValues.js +0 -19
- package/dist/utils/Data/deleteValues.test.js +0 -58
- package/dist/utils/Data/getAutocompleteSource.js +0 -87
- package/dist/utils/Data/getAutocompleteSource.test.js +0 -335
- package/dist/utils/Data/getDataPath.js +0 -66
- package/dist/utils/Data/getDataPath.test.js +0 -49
- package/dist/utils/Data/getOptions.js +0 -86
- package/dist/utils/Data/getOptions.test.js +0 -279
- package/dist/utils/Data/getSourceData.js +0 -44
- package/dist/utils/Data/getSourceData.test.js +0 -158
- package/dist/utils/Data/index.js +0 -35
- package/dist/utils/Data/nestInRefdataOptions.js +0 -47
- package/dist/utils/Data/nestInRefdataOptions.test.js +0 -237
- package/dist/utils/Data/refDataToOptions.js +0 -44
- package/dist/utils/Data/refDataToOptions.test.js +0 -197
- package/dist/utils/Data/setDataItem.js +0 -26
- package/dist/utils/Data/setDataItem.test.js +0 -136
- package/dist/utils/Data/setupFormData.js +0 -49
- package/dist/utils/Data/setupFormData.test.js +0 -215
- package/dist/utils/Data/setupRefDataUrlForComponent.js +0 -44
- package/dist/utils/Data/setupRefDataUrlForComponent.test.js +0 -150
- package/dist/utils/FormPage/applyConditionalProperties.js +0 -34
- package/dist/utils/FormPage/applyConditionalProperties.test.js +0 -61
- package/dist/utils/FormPage/getConditionalText.js +0 -55
- package/dist/utils/FormPage/getConditionalText.test.js +0 -163
- package/dist/utils/FormPage/getFormPage.js +0 -54
- package/dist/utils/FormPage/getFormPage.test.js +0 -206
- package/dist/utils/FormPage/getFormPages.js +0 -30
- package/dist/utils/FormPage/getFormPages.test.js +0 -97
- package/dist/utils/FormPage/getPageActions.js +0 -58
- package/dist/utils/FormPage/getPageActions.test.js +0 -115
- package/dist/utils/FormPage/getParagraphFromText.js +0 -21
- package/dist/utils/FormPage/getParagraphFromText.test.js +0 -28
- package/dist/utils/FormPage/index.js +0 -24
- package/dist/utils/FormPage/showFormPage.js +0 -52
- package/dist/utils/FormPage/showFormPage.test.js +0 -181
- package/dist/utils/FormPage/showFormPageCYA.js +0 -23
- package/dist/utils/FormPage/showFormPageCYA.test.js +0 -29
- package/dist/utils/FormPage/useComponent.js +0 -83
- package/dist/utils/FormPage/useComponent.test.js +0 -216
- package/dist/utils/Format/formatData.js +0 -27
- package/dist/utils/Format/formatData.test.js +0 -46
- package/dist/utils/Format/formatDataForComponent.js +0 -35
- package/dist/utils/Format/formatDataForComponent.test.js +0 -114
- package/dist/utils/Format/formatDataForForm.js +0 -27
- package/dist/utils/Format/formatDataForForm.test.js +0 -79
- package/dist/utils/Format/formatDataForPage.js +0 -31
- package/dist/utils/Format/formatDataForPage.test.js +0 -94
- package/dist/utils/Format/index.js +0 -21
- package/dist/utils/Hub/getFormHub.js +0 -40
- package/dist/utils/Hub/getFormHub.test.js +0 -105
- package/dist/utils/Hub/index.js +0 -15
- package/dist/utils/Meta/constants.js +0 -9
- package/dist/utils/Meta/documents/getDocuments.js +0 -15
- package/dist/utils/Meta/documents/getDocuments.test.js +0 -46
- package/dist/utils/Meta/documents/index.js +0 -19
- package/dist/utils/Meta/documents/setDocumentsForField.js +0 -30
- package/dist/utils/Meta/documents/setDocumentsForField.test.js +0 -97
- package/dist/utils/Meta/index.js +0 -17
- package/dist/utils/Operate/checkValueIsTruthy.js +0 -29
- package/dist/utils/Operate/checkValueIsTruthy.test.js +0 -43
- package/dist/utils/Operate/deleteValueInFormData.js +0 -27
- package/dist/utils/Operate/deleteValueInFormData.test.js +0 -61
- package/dist/utils/Operate/doesContainValue.js +0 -35
- package/dist/utils/Operate/doesContainValue.test.js +0 -76
- package/dist/utils/Operate/getFirstOf.js +0 -31
- package/dist/utils/Operate/getFirstOf.test.js +0 -87
- package/dist/utils/Operate/getIndexOfMatchingValueIn.js +0 -68
- package/dist/utils/Operate/getIndexOfMatchingValueIn.test.js +0 -158
- package/dist/utils/Operate/getLength.js +0 -51
- package/dist/utils/Operate/getLength.test.js +0 -90
- package/dist/utils/Operate/index.js +0 -13
- package/dist/utils/Operate/persistValueInFormData.js +0 -40
- package/dist/utils/Operate/persistValueInFormData.test.js +0 -118
- package/dist/utils/Operate/runPageOperations.js +0 -75
- package/dist/utils/Operate/runPageOperations.test.js +0 -105
- package/dist/utils/Operate/setValueInFormData.js +0 -22
- package/dist/utils/Operate/setValueInFormData.test.js +0 -45
- package/dist/utils/Operate/shouldRun.js +0 -57
- package/dist/utils/Operate/shouldRun.test.js +0 -65
- package/dist/utils/Validate/additional/conditionallyPermittedChange.js +0 -26
- package/dist/utils/Validate/additional/conditionallyPermittedChange.test.js +0 -34
- package/dist/utils/Validate/additional/conditionallyRequired.js +0 -24
- package/dist/utils/Validate/additional/conditionallyRequired.test.js +0 -74
- package/dist/utils/Validate/additional/index.js +0 -74
- package/dist/utils/Validate/additional/index.test.js +0 -130
- package/dist/utils/Validate/additional/mustBeAfter.js +0 -34
- package/dist/utils/Validate/additional/mustBeAfter.test.js +0 -109
- package/dist/utils/Validate/additional/mustBeBefore.js +0 -34
- package/dist/utils/Validate/additional/mustBeBefore.test.js +0 -77
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.js +0 -57
- package/dist/utils/Validate/additional/mustBeEarlierDateTime.test.js +0 -128
- package/dist/utils/Validate/additional/mustBeGreaterThan.js +0 -22
- package/dist/utils/Validate/additional/mustBeGreaterThan.test.js +0 -57
- package/dist/utils/Validate/additional/mustBeInTheFuture.js +0 -33
- package/dist/utils/Validate/additional/mustBeInTheFuture.test.js +0 -32
- package/dist/utils/Validate/additional/mustBeInThePast.js +0 -36
- package/dist/utils/Validate/additional/mustBeInThePast.test.js +0 -32
- package/dist/utils/Validate/additional/mustBeLessThan.js +0 -22
- package/dist/utils/Validate/additional/mustBeLessThan.test.js +0 -53
- package/dist/utils/Validate/additional/mustBeLongerThan.js +0 -23
- package/dist/utils/Validate/additional/mustBeLongerThan.test.js +0 -49
- package/dist/utils/Validate/additional/mustBeNumbersOnly.js +0 -24
- package/dist/utils/Validate/additional/mustBeNumbersOnly.test.js +0 -45
- package/dist/utils/Validate/additional/mustBeOneOf.js +0 -22
- package/dist/utils/Validate/additional/mustBeOneOf.test.js +0 -37
- package/dist/utils/Validate/additional/mustBeShorterThan.js +0 -23
- package/dist/utils/Validate/additional/mustBeShorterThan.test.js +0 -49
- package/dist/utils/Validate/additional/mustBeUniqueInCollection.js +0 -40
- package/dist/utils/Validate/additional/mustBeUniqueInCollection.test.js +0 -163
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.js +0 -26
- package/dist/utils/Validate/additional/mustEnterAtLeastOne.test.js +0 -37
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.js +0 -19
- package/dist/utils/Validate/additional/mustHaveLessThanDecimalPlaces.test.js +0 -37
- package/dist/utils/Validate/additional/mustNotContainSql.js +0 -19
- package/dist/utils/Validate/additional/mustNotContainSql.test.js +0 -33
- package/dist/utils/Validate/additional/mustSelectOnlyOne.js +0 -29
- package/dist/utils/Validate/additional/mustSelectOnlyOne.test.js +0 -55
- package/dist/utils/Validate/additional/utils.js +0 -35
- package/dist/utils/Validate/index.js +0 -33
- package/dist/utils/Validate/validateCollection.js +0 -50
- package/dist/utils/Validate/validateCollection.test.js +0 -134
- package/dist/utils/Validate/validateComponent.js +0 -126
- package/dist/utils/Validate/validateComponent.test.js +0 -435
- package/dist/utils/Validate/validateContainer.js +0 -52
- package/dist/utils/Validate/validateContainer.test.js +0 -115
- package/dist/utils/Validate/validateDate.js +0 -112
- package/dist/utils/Validate/validateDate.test.js +0 -133
- package/dist/utils/Validate/validateEmail.js +0 -45
- package/dist/utils/Validate/validateEmail.test.js +0 -78
- package/dist/utils/Validate/validateMultifile.js +0 -29
- package/dist/utils/Validate/validateMultifile.test.js +0 -46
- package/dist/utils/Validate/validateOnPageLoad.js +0 -24
- package/dist/utils/Validate/validateOnPageLoad.test.js +0 -89
- package/dist/utils/Validate/validatePage.js +0 -56
- package/dist/utils/Validate/validatePage.test.js +0 -795
- package/dist/utils/Validate/validateRegex.js +0 -41
- package/dist/utils/Validate/validateRegex.test.js +0 -43
- package/dist/utils/Validate/validateRequired.js +0 -37
- package/dist/utils/Validate/validateRequired.test.js +0 -64
- package/dist/utils/Validate/validateTextArea.js +0 -36
- package/dist/utils/Validate/validateTextArea.test.js +0 -71
- package/dist/utils/Validate/validateTime.js +0 -76
- package/dist/utils/Validate/validateTime.test.js +0 -116
- package/dist/utils/canOverrideFieldRequired.js +0 -23
- package/dist/utils/index.js +0 -42
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple operation to check if a given value in data is truthy or not.
|
|
3
|
+
* Supports getting a value from an interpolated field string.
|
|
4
|
+
* @param {object} config The operation config.
|
|
5
|
+
* @param {object} data The page's formData.
|
|
6
|
+
* @returns true if the value is truthy, false if it isn't or doesn't exist.
|
|
7
|
+
*/
|
|
8
|
+
declare const checkValueIsTruthy: (config: any, data: any) => boolean;
|
|
9
|
+
export default checkValueIsTruthy;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple operation to delete a value in the form data.
|
|
3
|
+
* @param {object} config The operation config.
|
|
4
|
+
* @param {object} data The page's formData.
|
|
5
|
+
* @param {function} onChange The page's onChange handler.
|
|
6
|
+
*/
|
|
7
|
+
declare const deleteValueInFormData: (config: any, data: any, onChange: any) => void;
|
|
8
|
+
export default deleteValueInFormData;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns if it can find a value in the form data. supports searching in arrays and objects
|
|
3
|
+
* @param {object} config The config of the operation.
|
|
4
|
+
* @param {string} config.target the JPath to the object/array that contains the data we want to checkon
|
|
5
|
+
* @param {string} config.key the JPath to the field we want to check
|
|
6
|
+
* @param {string} config.value the value that we want to check the the data against
|
|
7
|
+
* @param {object} data A page's formData.
|
|
8
|
+
* @returns The index of the matching value if one exists, or null.
|
|
9
|
+
*/
|
|
10
|
+
declare const doesContainValue: (config: any, data: any) => boolean;
|
|
11
|
+
export default doesContainValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Searches for a value in an array in data that matches a value given
|
|
3
|
+
* in config. A cutoff index can be provided in config if the search
|
|
4
|
+
* should stop after a certain number of entries. An index to ignore
|
|
5
|
+
* can also be provided.
|
|
6
|
+
* @param {object} config The config of the operation.
|
|
7
|
+
* @param {object} data A page's formData.
|
|
8
|
+
* @returns The index of the matching value if one exists, or null.
|
|
9
|
+
*/
|
|
10
|
+
declare const getIndexOfMatchingValueIn: (config: any, data: any) => any;
|
|
11
|
+
export default getIndexOfMatchingValueIn;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds a field within data and returns its length
|
|
3
|
+
* @param {object} config The config of the operation.
|
|
4
|
+
* @param {string} config.target The path to the target field. If the path
|
|
5
|
+
* goes through a collection this can be specified as 'collectionName[]'
|
|
6
|
+
* and this function will use the active entry within that collection.
|
|
7
|
+
* @param {object} data A page's formData.
|
|
8
|
+
* @returns The length of a field if found or 0
|
|
9
|
+
*/
|
|
10
|
+
declare const getLength: (config: any, data: any) => any;
|
|
11
|
+
export default getLength;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple operation to call the page's onChange handler with a specific value
|
|
3
|
+
* and name. Supports getting a value from an interpolated field string.
|
|
4
|
+
* @param {object} config The operation config.
|
|
5
|
+
* @param {object} data The page's formData.
|
|
6
|
+
* @param {function} onChange The page's onChange handler.
|
|
7
|
+
*/
|
|
8
|
+
declare const persistValueInFormData: (config: any, data: any, onChange: any) => void;
|
|
9
|
+
export default persistValueInFormData;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run operations, specified in a page's config, on formData.
|
|
3
|
+
*
|
|
4
|
+
* The result of an operation will be placed in data according
|
|
5
|
+
* to the operations 'output' string. This string is a dot
|
|
6
|
+
* separated fieldId. If any part of the output doesn't exist,
|
|
7
|
+
* then it is created.
|
|
8
|
+
*
|
|
9
|
+
* The page's onChange handler is passed in here in case any
|
|
10
|
+
* operation needs to persist its value within formData. Normally
|
|
11
|
+
* any operation result only lasts until the page is re-rendered.
|
|
12
|
+
*
|
|
13
|
+
* @param {object} config The config for the page.
|
|
14
|
+
* @param {object} data The page's formData.
|
|
15
|
+
* @param {function} onChange The page's onChange handler.
|
|
16
|
+
* @returns data with the results of any operations included.
|
|
17
|
+
*/
|
|
18
|
+
declare const runPageOperations: (config: any, data: any, onChange: any) => any;
|
|
19
|
+
export default runPageOperations;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether or not a page operation should run
|
|
3
|
+
* based on the provided run_when config.
|
|
4
|
+
* @param {object} config The run_when config.
|
|
5
|
+
* @param {object} data The page's formData.
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare const shouldRun: (config: any, data: any) => boolean;
|
|
9
|
+
export default shouldRun;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional validator to not permit a value change if a specified item exists in formData.
|
|
3
|
+
* @param {object} data the changed value
|
|
4
|
+
* @param {object} config the config for the validation must contain
|
|
5
|
+
* a property 'base' holding the value for checking
|
|
6
|
+
* a property 'check' holding the formData item name to check if exists
|
|
7
|
+
* @param {object} formData the form data
|
|
8
|
+
* @returns false if:
|
|
9
|
+
* the 'base' value is not the same as the changed value AND
|
|
10
|
+
* the 'check' value exists in formData as an item
|
|
11
|
+
* otherwise returns true
|
|
12
|
+
*/
|
|
13
|
+
declare const conditionallyPermittedChange: (data: any, config: any, _: any, formData: any) => boolean;
|
|
14
|
+
export default conditionallyPermittedChange;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional validator for the Container component type.
|
|
3
|
+
* @param {object} data the form data
|
|
4
|
+
* @param {object} config the config for the validation, must contain a property 'base' with the id of the conditionally required component and
|
|
5
|
+
* a property 'check' which if the corresponding component has a value will turn off the required check for 'base'
|
|
6
|
+
* @param {object} component the container component
|
|
7
|
+
* @returns true if the user has entered data into the 'base' field or entered a value into the 'check' field to turn off the validation
|
|
8
|
+
* otherwise returns false
|
|
9
|
+
*/
|
|
10
|
+
declare const conditionallyRequired: (data: any, config: any, component: any) => boolean;
|
|
11
|
+
export default conditionallyRequired;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks that a date is after either:
|
|
3
|
+
* - A specified, fixed date.
|
|
4
|
+
* Or
|
|
5
|
+
* - An offset to the current date in days/months/years.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} date - date string in a valid date format e.g. DD-MM-YYYY
|
|
8
|
+
* @param {string} config.date - fixed date string that date must be after, in the format DD-MM-YYYY
|
|
9
|
+
* @param {string} config.unit - day, month or year
|
|
10
|
+
* @param {number} config.value - number of the unit to be after
|
|
11
|
+
* @returns false if date is not after the given date/offset or true if it is.
|
|
12
|
+
*/
|
|
13
|
+
declare const mustBeAfter: (date: any, config: any) => boolean;
|
|
14
|
+
export default mustBeAfter;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks that a date is before either:
|
|
3
|
+
* - A specified, fixed date.
|
|
4
|
+
* Or
|
|
5
|
+
* - An offset to the current date in days/months/years.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} date - date string in a valid date format e.g. DD-MM-YYYY
|
|
8
|
+
* @param {string} config.date - fixed date string that date must be before, in the format DD-MM-YYYY
|
|
9
|
+
* @param {string} config.unit - day, month or year
|
|
10
|
+
* @param {number} config.value - number of the unit to be before
|
|
11
|
+
* @returns false if date is not before the given date/offset or true if it is.
|
|
12
|
+
*/
|
|
13
|
+
declare const mustBeBefore: (date: any, config: any) => boolean;
|
|
14
|
+
export default mustBeBefore;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks whether the combination of a given date & time input is in the past.
|
|
3
|
+
* NOTE: This additional validation will only work for containers. They get the
|
|
4
|
+
* date & time from their children - if there's an error then it can be displayed
|
|
5
|
+
* by wrapping both components.
|
|
6
|
+
*
|
|
7
|
+
* @param {object} data A page's formData.
|
|
8
|
+
* @param {object} config An additionalValidation config obj.
|
|
9
|
+
* @param {object} container A config obj for a container.
|
|
10
|
+
* @returns True if the date & time are in the past, or there are errors with
|
|
11
|
+
* the individual components. False if the date & time is in the future, or
|
|
12
|
+
* the date/time component can't be found.
|
|
13
|
+
*/
|
|
14
|
+
declare const mustBeEarlierDateTime: (data: any, config: any, container: any) => boolean;
|
|
15
|
+
export default mustBeEarlierDateTime;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {*} value - the value to check.
|
|
3
|
+
* @param {number} config.value - the value must be greater than config.value.
|
|
4
|
+
* @returns true if value is greater than config.value, false if not.
|
|
5
|
+
*/
|
|
6
|
+
declare const mustBeGreaterThan: (value: any, config: any) => boolean;
|
|
7
|
+
export default mustBeGreaterThan;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function returns true if the date parameter is a date after today, else returns false
|
|
3
|
+
* @param {string} date - date string e.g. '03-12-2021'
|
|
4
|
+
* @param {boolean} config.todayAllowed - true if today should be a valid date
|
|
5
|
+
* @returns true if date is after current date
|
|
6
|
+
*/
|
|
7
|
+
declare const mustBeInTheFuture: (date: any, config: any) => boolean;
|
|
8
|
+
export default mustBeInTheFuture;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function returns true if the date parameter is a date before today, else returns false
|
|
3
|
+
* dayjs counts today as before today so also cover same day inputs
|
|
4
|
+
* @param {string} date - date string e.g. '03-12-2021'
|
|
5
|
+
* @param {boolean} config.todayAllowed - true if today should be a valid date
|
|
6
|
+
* @returns true if date is before current date
|
|
7
|
+
*/
|
|
8
|
+
declare const mustBeInThePast: (date: any, config: any) => boolean;
|
|
9
|
+
export default mustBeInThePast;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {*} value - the value to check.
|
|
3
|
+
* @param {number} config.value - the value must be equal or less than config.value.
|
|
4
|
+
* @returns true if value is equal to or less then config.value, false if not.
|
|
5
|
+
*/
|
|
6
|
+
declare const mustBeLessThan: (value: any, config: any) => boolean;
|
|
7
|
+
export default mustBeLessThan;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function returns true if the string parameter is longer than a given length, false
|
|
3
|
+
* if it is not.
|
|
4
|
+
* @param {string} string - the string to check the length of.
|
|
5
|
+
* @param {number} config.value - the length that string.length must be greater than.
|
|
6
|
+
* @returns true if string.length is greater than config.value, false if not.
|
|
7
|
+
*/
|
|
8
|
+
declare const mustBeLongerThan: (string: any, config: any) => boolean;
|
|
9
|
+
export default mustBeLongerThan;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a string contains only numberical characters.
|
|
3
|
+
* An optional flag in config can be used to allow commas.
|
|
4
|
+
* @param {*} value The value to check for only numerical characters.
|
|
5
|
+
* @param {object} config The config of the validation check.
|
|
6
|
+
* @returns true if value passes the regex, false if not.
|
|
7
|
+
*/
|
|
8
|
+
declare const mustBeNumbersOnly: (value: any, config: any) => boolean;
|
|
9
|
+
export default mustBeNumbersOnly;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function returns true if the string parameter is contained in the passed in array.
|
|
3
|
+
* @param {string} string - the string to check.
|
|
4
|
+
* @param {array} config.array - the array that the string will be checked against.
|
|
5
|
+
* @returns true if string is contained in config.array, false if not.
|
|
6
|
+
*/
|
|
7
|
+
declare const mustBeOneOf: (string: any, config: any) => any;
|
|
8
|
+
export default mustBeOneOf;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Function returns true if the string parameter is shorter than a given length, false
|
|
3
|
+
* if it is not.
|
|
4
|
+
* @param {string} string - the string to check the length of.
|
|
5
|
+
* @param {number} config.value - the length that string.length must be less than.
|
|
6
|
+
* @returns true if string.length is greater than config.value, false if not.
|
|
7
|
+
*/
|
|
8
|
+
declare const mustBeShorterThan: (string: any, config: any) => boolean;
|
|
9
|
+
export default mustBeShorterThan;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {*} value - the value to check.
|
|
3
|
+
* @param {string} config.collectionPath - the path to the collection within formData
|
|
4
|
+
* @param {string} config.caseInsensitive - true to ignore case, assumes string values
|
|
5
|
+
* @param {object} component - the component definition
|
|
6
|
+
* @param {object} formData - the current form data
|
|
7
|
+
* @returns true if components value is not the same in any other entry in the collection
|
|
8
|
+
*/
|
|
9
|
+
declare const mustBeUniqueInCollection: (value: any, config: any, component: any, formData: any) => boolean;
|
|
10
|
+
export default mustBeUniqueInCollection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional validator for the Container component type.
|
|
3
|
+
* @param {*} data the form data
|
|
4
|
+
* @param {*} component the container component
|
|
5
|
+
* @returns true if the user has entered data into at least one component within the collection
|
|
6
|
+
* otherwise returns false
|
|
7
|
+
*/
|
|
8
|
+
declare const mustEnterAtLeastOne: (data: any, _: any, component: any) => any;
|
|
9
|
+
export default mustEnterAtLeastOne;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} string - the string to check
|
|
3
|
+
* @param {number} config.maxDecimals - the maximum amount of decimal places to allow
|
|
4
|
+
* @returns true if string has less than maxDecimals decimal places else returns false
|
|
5
|
+
*/
|
|
6
|
+
declare const mustHaveLessThanDecimalPlaces: (string: any, config: any) => boolean;
|
|
7
|
+
export default mustHaveLessThanDecimalPlaces;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Additional validator for the Container component type.
|
|
3
|
+
* @param {object} data the form data
|
|
4
|
+
* @param {object} component the container component
|
|
5
|
+
* @returns true if the user has only provided a value for one of the components in the container, otherwise false.
|
|
6
|
+
*/
|
|
7
|
+
declare const mustSelectOnlyOne: (data: any, _: any, component: any) => boolean;
|
|
8
|
+
export default mustSelectOnlyOne;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const Validate: {
|
|
2
|
+
component: (component: any, outerData: any, formData: any) => any[] | {
|
|
3
|
+
id: any;
|
|
4
|
+
error: never;
|
|
5
|
+
} | {
|
|
6
|
+
id: any;
|
|
7
|
+
error: any;
|
|
8
|
+
properties: {} | undefined;
|
|
9
|
+
} | undefined;
|
|
10
|
+
container: (container: any, outerData: any, formData: any) => any[] | {
|
|
11
|
+
id: any;
|
|
12
|
+
error: never;
|
|
13
|
+
};
|
|
14
|
+
email: (value: any, label?: string, customErrors?: never[]) => any;
|
|
15
|
+
date: (date: any) => {
|
|
16
|
+
message: undefined;
|
|
17
|
+
propsInError: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
message: string;
|
|
20
|
+
propsInError: {};
|
|
21
|
+
} | {
|
|
22
|
+
message: string;
|
|
23
|
+
propsInError: {
|
|
24
|
+
day: boolean;
|
|
25
|
+
month: boolean;
|
|
26
|
+
year: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
multifile: (value: any, customErrors: any) => any;
|
|
30
|
+
page: (page: any, queuedErrors?: never[]) => any;
|
|
31
|
+
regex: (value: any, label: any, pattern: any, customErrors: any) => any;
|
|
32
|
+
required: (value: any, label: any, customErrors: any) => any;
|
|
33
|
+
textarea: (label: any, value: any, showCharacterCount: any, customErrors: any, required: any, maxLength?: number) => any;
|
|
34
|
+
time: (time: any) => {
|
|
35
|
+
message: undefined;
|
|
36
|
+
propsInError: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
message: string;
|
|
39
|
+
propsInError: {};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export default Validate;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates all of the items within a collection.
|
|
3
|
+
* @param {object} collection The collection to validate.
|
|
4
|
+
* @param {object} items The data items in the collection.
|
|
5
|
+
* @param {object} formData The data at the top level of the form.
|
|
6
|
+
* @returns Errors for all components for all items within the collection.
|
|
7
|
+
*/
|
|
8
|
+
declare const validateCollection: (collection: any, items: any, formData: any) => any[];
|
|
9
|
+
export default validateCollection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a single component.
|
|
3
|
+
* @param {object} component The component to validate.
|
|
4
|
+
* @param {object} outerData The data to use that holds this component's value.
|
|
5
|
+
* @param {object} formData The data at the top level of the form.
|
|
6
|
+
* @returns The first encountered error with the component.
|
|
7
|
+
*/
|
|
8
|
+
declare const validateComponent: (component: any, outerData: any, formData: any) => any[] | {
|
|
9
|
+
id: any;
|
|
10
|
+
error: never;
|
|
11
|
+
} | {
|
|
12
|
+
id: any;
|
|
13
|
+
error: any;
|
|
14
|
+
properties: {} | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
export default validateComponent;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates all components within a container.
|
|
3
|
+
* @param {object} container The container to validate.
|
|
4
|
+
* @param {object} outerData The data to use that holds this component's value.
|
|
5
|
+
* @param {object} formData The data at the top level of the form.
|
|
6
|
+
* @returns Errors for all components within the container.
|
|
7
|
+
*/
|
|
8
|
+
declare const validateContainer: (container: any, outerData: any, formData: any) => any[] | {
|
|
9
|
+
id: any;
|
|
10
|
+
error: never;
|
|
11
|
+
};
|
|
12
|
+
export default validateContainer;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare const maxMonthDays: (month: any, year: any) => 29 | 28 | 30 | 31;
|
|
2
|
+
export { maxMonthDays };
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a date passed is a valid date.
|
|
5
|
+
* This will validate for 'leap years', missing components, invalid day, month or year components.
|
|
6
|
+
* EXAMPLE USE : const { message, propsInError } = validateDate('2-11-2020')
|
|
7
|
+
*
|
|
8
|
+
* Note that an empty string is not considered invalid. You should use
|
|
9
|
+
* validateRequired (Validate.required) for that sort of validation.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} date date as a string
|
|
12
|
+
* @returns an object with an error message and instructions for which parts of the date are in error
|
|
13
|
+
* or undefined for both if the date is valid
|
|
14
|
+
*/
|
|
15
|
+
declare const validateDate: (date: any) => {
|
|
16
|
+
message: undefined;
|
|
17
|
+
propsInError: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
message: string;
|
|
20
|
+
propsInError: {};
|
|
21
|
+
} | {
|
|
22
|
+
message: string;
|
|
23
|
+
propsInError: {
|
|
24
|
+
day: boolean;
|
|
25
|
+
month: boolean;
|
|
26
|
+
year: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default validateDate;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an email address, ensuring it is in the correct domain and
|
|
3
|
+
* complies with the Home Office email address standards.
|
|
4
|
+
*
|
|
5
|
+
* Note that an empty string is not considered invalid. You should use
|
|
6
|
+
* validateRequired (Validate.required) for that sort of validation.
|
|
7
|
+
* @param {*} value The value to validate.
|
|
8
|
+
* @param {string} label The label to use in any error message.
|
|
9
|
+
* @param {array} customErrors The array of custom errors to use for format message.
|
|
10
|
+
* @returns An error if the email address is invalid.
|
|
11
|
+
*/
|
|
12
|
+
declare const validateEmail: (value: any, label?: string, customErrors?: never[]) => any;
|
|
13
|
+
export default validateEmail;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const doValidateOnPageLoad: (page: any) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate all of the components on a page.
|
|
3
|
+
* @param {object} page The page to validate
|
|
4
|
+
* @param {array} queuedErrors Any errors that have been found before this validation.
|
|
5
|
+
* @returns An array containing all of the errors.
|
|
6
|
+
*/
|
|
7
|
+
declare const validatePage: (page: any, queuedErrors?: never[]) => any;
|
|
8
|
+
export default validatePage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an components value against a given regex pattern.
|
|
3
|
+
*
|
|
4
|
+
* An empty string for value is considered valid as not all components
|
|
5
|
+
* with pattern validation have to be required.
|
|
6
|
+
* @param {*} value The value to validate.
|
|
7
|
+
* @param {string} label The label to use in the default error message.
|
|
8
|
+
* @param {string} pattern The regex pattern to validate against.
|
|
9
|
+
* @param {array} customErrors The array of custom errors for the component.
|
|
10
|
+
* @returns An error if the value doesn't match the regex pattern.
|
|
11
|
+
*/
|
|
12
|
+
declare const validateRegex: (value: any, label: any, pattern: any, customErrors: any) => any;
|
|
13
|
+
export default validateRegex;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates that a value is not nullish, which includes ensuring
|
|
3
|
+
* a string isn't just whitespace, an array is not empty, etc.
|
|
4
|
+
* @param {any} value The value to validate.
|
|
5
|
+
* @param {string} label The label to use in any error message.
|
|
6
|
+
* @returns An error if the value is nullish.
|
|
7
|
+
*/
|
|
8
|
+
declare const validateRequired: (value: any, label: any, customErrors: any) => any;
|
|
9
|
+
export default validateRequired;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a text area when showCharacterCount property has been set.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} label The label to use in any error message.
|
|
5
|
+
* @param {*} value The value to validate.
|
|
6
|
+
* @param {string} showCharacterCount The flag to enable character count validation.
|
|
7
|
+
* @param {array} customErrors An array of custom errors for the component.
|
|
8
|
+
* @param {boolean} required If the component is required.
|
|
9
|
+
* @param {number} maxLength The maximum allowable number of characters (by default, this is 1000 characters).
|
|
10
|
+
* @returns An error if the value exceeds the maximum allowable number of characters.
|
|
11
|
+
*/
|
|
12
|
+
declare const validateTextArea: (label: any, value: any, showCharacterCount: any, customErrors: any, required: any, maxLength?: number) => any;
|
|
13
|
+
export default validateTextArea;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a time passed is a valid time.
|
|
3
|
+
* This will validate for missing components, invalid hour or minute components.
|
|
4
|
+
* EXAMPLE USE : const { message, propsInError } = validateTime('15:30')
|
|
5
|
+
*
|
|
6
|
+
* Note that an empty string is not considered invalid. You should use
|
|
7
|
+
* validateRequired (Validate.required) for that sort of validation.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} time time as a string
|
|
10
|
+
* @returns an object with an error message and instructions for which parts of the time are in error
|
|
11
|
+
* or undefined for both if the time is valid
|
|
12
|
+
*/
|
|
13
|
+
declare const validateTime: (time: any) => {
|
|
14
|
+
message: undefined;
|
|
15
|
+
propsInError: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
message: string;
|
|
18
|
+
propsInError: {};
|
|
19
|
+
};
|
|
20
|
+
export default validateTime;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check to see if the field required status can be overridden.
|
|
3
|
+
* All conditions need to be met in order for the override to be permitted.
|
|
4
|
+
* @param {array} requiredOverrideConditions The conditions to evaluate.
|
|
5
|
+
* @param {object} data The form data to check.
|
|
6
|
+
* @returns true or false.
|
|
7
|
+
*/
|
|
8
|
+
declare const canOverrideFieldRequired: (requiredOverrideConditions: any, data: any) => boolean;
|
|
9
|
+
export default canOverrideFieldRequired;
|