@ukhomeoffice/cop-react-form-renderer 0.1.0-beta
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 +38 -0
- package/dist/components/CheckYourAnswers/CheckYourAnswers.js +77 -0
- package/dist/components/CheckYourAnswers/CheckYourAnswers.scss +9 -0
- package/dist/components/CheckYourAnswers/index.js +13 -0
- package/dist/components/FormComponent/FormComponent.js +95 -0
- package/dist/components/FormComponent/index.js +13 -0
- package/dist/components/FormPage/FormPage.js +121 -0
- package/dist/components/FormPage/FormPage.scss +7 -0
- package/dist/components/FormPage/index.js +13 -0
- package/dist/components/FormRenderer/FormRenderer.js +203 -0
- package/dist/components/FormRenderer/FormRenderer.scss +5 -0
- package/dist/components/FormRenderer/helpers.js +66 -0
- package/dist/components/FormRenderer/helpers.test.js +158 -0
- package/dist/components/FormRenderer/index.js +13 -0
- package/dist/components/PageActions/PageActions.js +49 -0
- package/dist/components/PageActions/index.js +13 -0
- package/dist/components/SummaryList/RowAction.js +75 -0
- package/dist/components/SummaryList/SummaryList.js +93 -0
- package/dist/components/SummaryList/SummaryList.scss +2 -0
- package/dist/components/SummaryList/index.js +13 -0
- package/dist/components/index.js +31 -0
- package/dist/hooks/index.js +39 -0
- package/dist/hooks/useAxios.js +80 -0
- package/dist/hooks/useGetRequest.js +149 -0
- package/dist/hooks/useHooks.js +51 -0
- package/dist/hooks/useRefData.js +91 -0
- package/dist/index.js +48 -0
- package/dist/models/ComponentTypes.js +26 -0
- package/dist/models/FormTypes.js +18 -0
- package/dist/models/HubFormats.js +12 -0
- package/dist/models/index.js +31 -0
- package/dist/utils/CheckYourAnswers/getCYAAction.js +22 -0
- package/dist/utils/CheckYourAnswers/getCYAAction.test.js +92 -0
- package/dist/utils/CheckYourAnswers/getCYARow.js +27 -0
- package/dist/utils/CheckYourAnswers/getCYARow.test.js +151 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.js +24 -0
- package/dist/utils/CheckYourAnswers/getCYARowsForPage.test.js +134 -0
- package/dist/utils/CheckYourAnswers/index.js +17 -0
- package/dist/utils/CheckYourAnswers/showComponentCYA.js +37 -0
- package/dist/utils/CheckYourAnswers/showComponentCYA.test.js +54 -0
- package/dist/utils/Component/cleanAttributes.js +55 -0
- package/dist/utils/Component/cleanAttributes.test.js +69 -0
- package/dist/utils/Component/getComponent.js +117 -0
- package/dist/utils/Component/getComponent.test.js +329 -0
- package/dist/utils/Component/index.js +28 -0
- package/dist/utils/Component/isEditable.js +19 -0
- package/dist/utils/Component/isEditable.test.js +42 -0
- package/dist/utils/Component/showComponent.js +44 -0
- package/dist/utils/Component/showComponent.test.js +94 -0
- package/dist/utils/Component/wrapInFormGroup.js +23 -0
- package/dist/utils/Data/getAutocompleteSource.js +28 -0
- package/dist/utils/Data/getAutocompleteSource.test.js +146 -0
- package/dist/utils/Data/getOptions.js +21 -0
- package/dist/utils/Data/getOptions.test.js +71 -0
- package/dist/utils/Data/getSourceData.js +34 -0
- package/dist/utils/Data/getSourceData.test.js +125 -0
- package/dist/utils/Data/index.js +34 -0
- package/dist/utils/Data/refDataToOptions.js +33 -0
- package/dist/utils/Data/refDataToOptions.test.js +99 -0
- package/dist/utils/Data/setupFormData.js +63 -0
- package/dist/utils/Data/setupFormData.test.js +216 -0
- package/dist/utils/Data/setupRefDataUrlForComponent.js +29 -0
- package/dist/utils/Data/setupRefDataUrlForComponent.test.js +83 -0
- package/dist/utils/FormPage/getFormPage.js +45 -0
- package/dist/utils/FormPage/getFormPages.js +33 -0
- package/dist/utils/FormPage/getParagraphFromText.js +20 -0
- package/dist/utils/FormPage/index.js +19 -0
- package/dist/utils/FormPage/useComponent.js +31 -0
- package/dist/utils/Hub/getFormHub.js +30 -0
- package/dist/utils/Hub/index.js +20 -0
- package/dist/utils/Validate/index.js +26 -0
- package/dist/utils/Validate/validateComponent.js +49 -0
- package/dist/utils/Validate/validateComponent.test.js +119 -0
- package/dist/utils/Validate/validateEmail.js +39 -0
- package/dist/utils/Validate/validateEmail.test.js +57 -0
- package/dist/utils/Validate/validatePage.js +35 -0
- package/dist/utils/Validate/validatePage.test.js +122 -0
- package/dist/utils/Validate/validateRequired.js +38 -0
- package/dist/utils/Validate/validateRequired.test.js +50 -0
- package/dist/utils/index.js +43 -0
- package/dist/utils/meetsCondition.js +79 -0
- package/package.json +91 -0
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ukhomeoffice/cop-react-form-renderer",
|
|
3
|
+
"version": "0.1.0-beta",
|
|
4
|
+
"private": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"clean": "rimraf dist",
|
|
7
|
+
"test": "react-scripts test",
|
|
8
|
+
"lint": "eslint --ext .js,.jsx src",
|
|
9
|
+
"storybook:start": "start-storybook --docs --no-manager-cache -p 6007",
|
|
10
|
+
"storybook:build": "build-storybook --docs",
|
|
11
|
+
"storybook": "yarn storybook:start",
|
|
12
|
+
"compile": "yarn clean && cross-env NODE_ENV=production babel src --out-dir dist --copy-files && yarn post-compile",
|
|
13
|
+
"post-compile": "rimraf dist/**/*.test.* dist/**/*.stories.* dist/json dist/assets"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@ukhomeoffice/cop-react-components": "^0.5.0",
|
|
17
|
+
"axios": "^0.21.1",
|
|
18
|
+
"govuk-frontend": "^3.13.0",
|
|
19
|
+
"web-vitals": "^1.0.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/cli": "^7.15.4",
|
|
23
|
+
"@babel/preset-env": "^7.15.6",
|
|
24
|
+
"@babel/preset-react": "^7.14.5",
|
|
25
|
+
"@storybook/addon-a11y": "^6.3.8",
|
|
26
|
+
"@storybook/addon-actions": "^6.3.8",
|
|
27
|
+
"@storybook/addon-docs": "^6.3.8",
|
|
28
|
+
"@storybook/addon-essentials": "^6.3.8",
|
|
29
|
+
"@storybook/addon-knobs": "^6.3.1",
|
|
30
|
+
"@storybook/addon-links": "^6.3.8",
|
|
31
|
+
"@storybook/node-logger": "^6.3.8",
|
|
32
|
+
"@storybook/preset-create-react-app": "^3.2.0",
|
|
33
|
+
"@storybook/react": "^6.3.8",
|
|
34
|
+
"@storybook/storybook-deployer": "^2.8.10",
|
|
35
|
+
"@storybook/theming": "^6.3.8",
|
|
36
|
+
"@testing-library/jest-dom": "^5.11.4",
|
|
37
|
+
"@testing-library/react": "^11.1.0",
|
|
38
|
+
"@testing-library/react-hooks": "^7.0.2",
|
|
39
|
+
"@testing-library/user-event": "^12.1.10",
|
|
40
|
+
"axios-mock-adapter": "^1.18.1",
|
|
41
|
+
"cross-env": "^7.0.3",
|
|
42
|
+
"html-react-parser": "^0.10.5",
|
|
43
|
+
"node-sass": "^6.0.1",
|
|
44
|
+
"react": "^17.0.2",
|
|
45
|
+
"react-dom": "^17.0.2",
|
|
46
|
+
"react-scripts": "4.0.3",
|
|
47
|
+
"storybook-addon-mock": "^2.0.1"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": "^17.0.2",
|
|
51
|
+
"react-dom": "^17.0.2",
|
|
52
|
+
"react-scripts": "4.0.3"
|
|
53
|
+
},
|
|
54
|
+
"optionalDependencies": {
|
|
55
|
+
"babel-loader": "8.1.0",
|
|
56
|
+
"webpack": "4.44.2"
|
|
57
|
+
},
|
|
58
|
+
"main": "dist/index.js",
|
|
59
|
+
"files": [
|
|
60
|
+
"dist",
|
|
61
|
+
"README.md"
|
|
62
|
+
],
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "https://github.com/UKHomeOffice/cop-react-form-renderer"
|
|
66
|
+
},
|
|
67
|
+
"eslintConfig": {
|
|
68
|
+
"extends": [
|
|
69
|
+
"react-app",
|
|
70
|
+
"react-app/jest"
|
|
71
|
+
],
|
|
72
|
+
"overrides": [
|
|
73
|
+
{
|
|
74
|
+
"files": [ "**/*.stories.*" ],
|
|
75
|
+
"rules": { "import/no-anonymous-default-export": "off" }
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"browserslist": {
|
|
80
|
+
"production": [
|
|
81
|
+
">0.2%",
|
|
82
|
+
"not dead",
|
|
83
|
+
"not op_mini all"
|
|
84
|
+
],
|
|
85
|
+
"development": [
|
|
86
|
+
"last 1 chrome version",
|
|
87
|
+
"last 1 firefox version",
|
|
88
|
+
"last 1 safari version"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|