@arquimedes.co/eureka-forms 1.9.134 → 2.0.1-test
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/@Types/Form.d.ts +1 -1
- package/dist/@Types/FormStep.d.ts +2 -2
- package/dist/@Types/GenericFormSteps.d.ts +1 -0
- package/dist/App/App.css +6 -0
- package/dist/{App.d.ts → App/App.d.ts} +13 -21
- package/dist/App/App.js +76 -0
- package/dist/App/AppFunctions.d.ts +17 -0
- package/dist/App/AppFunctions.js +210 -0
- package/dist/App/AppHooks.d.ts +10 -0
- package/dist/App/AppHooks.js +235 -0
- package/dist/Contexts/CustomContext.d.ts +11 -0
- package/dist/Contexts/CustomContext.js +6 -0
- package/dist/Contexts/FormContext.d.ts +4 -0
- package/dist/Contexts/FormContext.js +19 -0
- package/dist/Contexts/SectionContext.d.ts +3 -0
- package/dist/Contexts/SectionContext.js +3 -0
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -4
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +3 -1
- package/dist/Form/Form.d.ts +17 -34
- package/dist/Form/Form.js +73 -124
- package/dist/Form/FormFunctions.d.ts +5 -4
- package/dist/Form/FormFunctions.js +24 -25
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -1
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -58
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.module.css +0 -4
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +122 -3
- package/dist/Form/FormTypes/StepperForm/StepperForm.module.css +53 -0
- package/dist/Form/Hooks.d.ts +9 -0
- package/dist/Form/Hooks.js +7 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -1
- package/dist/Form/Section/MaterialSection/MaterialSection.js +15 -16
- package/dist/Form/Section/Section.d.ts +2 -34
- package/dist/Form/Section/Section.js +11 -5
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -1
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +19 -14
- package/dist/Form/Terms/Term/Term.d.ts +1 -8
- package/dist/Form/Terms/Term/Term.js +3 -1
- package/dist/Form/Terms/Terms.d.ts +1 -2
- package/dist/Form/Terms/Terms.js +17 -8
- package/dist/Form/Terms/Terms.module.css +3 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +3 -3
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +49 -38
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +3 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +2 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +11 -5
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +29 -27
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +0 -6
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +39 -31
- package/dist/FormSteps/AYFStepMapper.js +42 -43
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -1
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +4 -14
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +84 -97
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.module.css +0 -9
- package/dist/FormSteps/CBRStepMapper.js +78 -74
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -1
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +4 -14
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +33 -26
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +17 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -1
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +4 -14
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +34 -27
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -1
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +4 -2
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +16 -11
- package/dist/FormSteps/CustomStep.d.ts +22 -0
- package/dist/FormSteps/CustomStep.js +37 -0
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +3 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +26 -14
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -1
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +4 -14
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +93 -112
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.module.css +0 -9
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +3 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +1 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +0 -7
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +32 -18
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +0 -7
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +2 -2
- package/dist/FormSteps/MapperStep/MapperStep.js +4 -14
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -9
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +7 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.d.ts +3 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.js +18 -10
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -9
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +7 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +44 -228
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.module.css +0 -7
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +30 -14
- package/dist/FormSteps/RatingStep/RatingStep.js +3 -1
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +36 -26
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -1
- package/dist/FormSteps/SelectorStep/SelectorStep.js +4 -14
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -1
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -1
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -1
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +4 -14
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +5 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +119 -199
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +9 -10
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +3 -1
- package/dist/FormSteps/Step.d.ts +3 -4
- package/dist/FormSteps/Step.js +12 -8
- package/dist/FormSteps/StepFunctions.d.ts +10 -0
- package/dist/FormSteps/StepFunctions.js +156 -1
- package/dist/FormSteps/StepHooks.d.ts +23 -0
- package/dist/FormSteps/StepHooks.js +87 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +10 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +148 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -6
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +40 -186
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +0 -9
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +8 -2
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +43 -42
- package/dist/FormSteps/TextInputStep/TextInputStep.js +3 -1
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +11 -6
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -1
- package/dist/FormSteps/TitleStep/TitleStep.js +4 -14
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +2 -1
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +2 -1
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +2 -1
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +2 -1
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +2 -1
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +2 -1
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -1
- package/dist/Icons/Entities/GenericEntityIcon.js +1 -1
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -1
- package/dist/Icons/Entities/HandshakeIcon.js +1 -1
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -1
- package/dist/Icons/Entities/SupplierIcon.js +4 -1
- package/dist/{controllers → Services}/FileService.d.ts +1 -1
- package/dist/{controllers → Services}/FileService.js +5 -5
- package/dist/Services/FormService.d.ts +5 -0
- package/dist/Services/FormService.js +59 -0
- package/dist/Services/OrganizationService.d.ts +2 -0
- package/dist/Services/OrganizationService.js +65 -0
- package/dist/Shared/Navbar/Navbar.module.css +8 -0
- package/dist/{shared → Shared}/Rating/Rating.d.ts +1 -1
- package/dist/Shared/Rating/Rating.module.css +18 -0
- package/dist/{shared → Shared}/Rating/Ratings/LikeRating.js +5 -5
- package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.js +9 -9
- package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.js +1 -2
- package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.d.ts +1 -1
- package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.js +4 -4
- package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.d.ts +1 -1
- package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.js +3 -2
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.d.ts +24 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +25 -0
- package/dist/States/GlobalStateReducer.d.ts +35 -0
- package/dist/States/GlobalStateReducer.js +34 -0
- package/dist/States/SiteStateReducer.d.ts +63 -0
- package/dist/States/SiteStateReducer.js +110 -0
- package/dist/States/WidthStatsStateReducer.d.ts +11 -0
- package/dist/States/WidthStatsStateReducer.js +64 -0
- package/dist/Utils/DraftFunctions.d.ts +3 -0
- package/dist/Utils/DraftFunctions.js +42 -0
- package/dist/Utils/MaterialProviders.d.ts +6 -0
- package/dist/Utils/MaterialProviders.js +31 -0
- package/dist/Utils/store.d.ts +25 -0
- package/dist/Utils/store.js +52 -0
- package/dist/Widget.js +3 -3
- package/dist/constants/CBRFormStepTypes.d.ts +2 -2
- package/dist/constants/CBRFormStepTypes.js +22 -22
- package/dist/hooks.d.ts +5 -0
- package/dist/hooks.js +7 -0
- package/dist/index.js +1 -1
- package/dist/index.lib.d.ts +1 -1
- package/dist/index.lib.js +1 -1
- package/package.json +63 -44
- package/dist/App.js +0 -472
- package/dist/shared/Navbar/Navbar.module.css +0 -18
- package/dist/shared/Rating/Rating.module.css +0 -32
- package/dist/{App.module.css → App/App.module.css} +0 -0
- package/dist/{shared → Shared}/InputIcon/InputIcon.d.ts +0 -0
- package/dist/{shared → Shared}/InputIcon/InputIcon.js +0 -0
- package/dist/{shared → Shared}/Loader/Loader.d.ts +0 -0
- package/dist/{shared → Shared}/Loader/Loader.js +0 -0
- package/dist/{shared → Shared}/Loader/Loader.module.css +0 -0
- package/dist/{shared → Shared}/Navbar/Navbar.d.ts +0 -0
- package/dist/{shared → Shared}/Navbar/Navbar.js +0 -0
- package/dist/{shared → Shared}/Rating/Rating.js +2 -2
- /package/dist/{shared → Shared}/Rating/Ratings/LikeRating.d.ts +0 -0
- /package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.d.ts +0 -0
- /package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedButton/RoundedButton.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedButton/RoundedButton.js +0 -0
- /package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.js +0 -0
- /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.js +0 -0
- /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.d.ts +0 -0
- /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.js +0 -0
- /package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -0
- /package/dist/{AxiosAPI.d.ts → Utils/AxiosAPI.d.ts} +0 -0
- /package/dist/{AxiosAPI.js → Utils/AxiosAPI.js} +0 -0
- /package/dist/{AxiosWidget.d.ts → Utils/AxiosWidget.d.ts} +0 -0
- /package/dist/{AxiosWidget.js → Utils/AxiosWidget.js} +0 -0
- /package/dist/{utils/CbrFunctions.d.ts → Utils/CBRFunctions.d.ts} +0 -0
- /package/dist/{utils/CbrFunctions.js → Utils/CBRFunctions.js} +0 -0
package/package.json
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":
|
|
4
|
+
"version":"2.0.1-test",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
7
7
|
"build": "react-scripts build",
|
|
8
|
-
"e2e": "percy exec -- cypress run",
|
|
9
8
|
"lint": "eslint 'src/**/*.ts'",
|
|
10
|
-
"
|
|
9
|
+
"test": "jest --verbose --runInBand --passWithNoTests",
|
|
10
|
+
"test-ci": "jest --ci --reporters=default --reporters=jest-junit --coverage",
|
|
11
|
+
"tsc-build": "tsc --noEmit false --outDir ./dist",
|
|
12
|
+
"storybook": "storybook dev -p 6006"
|
|
11
13
|
},
|
|
12
14
|
"dependencies": {
|
|
13
|
-
"@date-io/date-fns": "^
|
|
14
|
-
"@material-ui/core": "^4.
|
|
15
|
-
"@material-ui/icons": "^4.11.
|
|
16
|
-
"@material-ui/lab": "
|
|
17
|
-
"@material-ui/pickers": "^3.3.
|
|
18
|
-
"@
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"@types/react-google-recaptcha": "^2.1.5",
|
|
22
|
-
"axios": "^0.21.x",
|
|
23
|
-
"date-fns": "^2.23.x",
|
|
15
|
+
"@date-io/date-fns": "^2.17.0",
|
|
16
|
+
"@material-ui/core": "^4.12.4",
|
|
17
|
+
"@material-ui/icons": "^4.11.3",
|
|
18
|
+
"@material-ui/lab": "4.0.0-alpha.61",
|
|
19
|
+
"@material-ui/pickers": "^3.3.11",
|
|
20
|
+
"@reduxjs/toolkit": "^1.9.7",
|
|
21
|
+
"axios": "^1.6.x",
|
|
22
|
+
"date-fns": "^2.30.x",
|
|
24
23
|
"draft-js": "^0.11.x",
|
|
25
|
-
"nanoid": "^3.3.
|
|
26
|
-
"react-draft-wysiwyg": "^1.
|
|
27
|
-
"react-google-recaptcha": "^
|
|
28
|
-
"react-hook-form": "^7.6.4",
|
|
29
|
-
"react-router-dom": "^5.2.0",
|
|
30
|
-
"react-scripts": "5.0.1",
|
|
24
|
+
"nanoid": "^3.3.7",
|
|
25
|
+
"react-draft-wysiwyg": "^1.15.x",
|
|
26
|
+
"react-google-recaptcha": "^3.1.0",
|
|
31
27
|
"typescript": "^4.9.5"
|
|
32
28
|
},
|
|
33
29
|
"eslintConfig": {
|
|
@@ -49,38 +45,61 @@
|
|
|
49
45
|
]
|
|
50
46
|
},
|
|
51
47
|
"devDependencies": {
|
|
52
|
-
"@babel/core": "^7.
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
48
|
+
"@babel/core": "^7.23.5",
|
|
49
|
+
"@storybook/addon-coverage": "^1.0.0",
|
|
50
|
+
"@storybook/addon-essentials": "^7.6.3",
|
|
51
|
+
"@storybook/addon-interactions": "^7.6.3",
|
|
52
|
+
"@storybook/addon-links": "^7.6.3",
|
|
53
|
+
"@storybook/addon-onboarding": "^1.0.9",
|
|
54
|
+
"@storybook/addon-themes": "^7.6.3",
|
|
55
|
+
"@storybook/blocks": "^7.6.3",
|
|
56
|
+
"@storybook/react": "^7.6.3",
|
|
57
|
+
"@storybook/react-webpack5": "^7.6.3",
|
|
58
|
+
"@storybook/test": "^7.6.3",
|
|
59
|
+
"@testing-library/dom": "^9.3.3",
|
|
60
|
+
"@testing-library/jest-dom": "^6.1.5",
|
|
61
|
+
"@testing-library/react": "^12.1.5",
|
|
62
|
+
"@testing-library/user-event": "^14.5.1",
|
|
63
|
+
"@types/draft-js": "^0.11.16",
|
|
64
|
+
"@types/jest": "^29.5.10",
|
|
65
|
+
"@types/react": "^17.0.71",
|
|
66
|
+
"@types/react-dom": "^17.0.25",
|
|
67
|
+
"@types/react-draft-wysiwyg": "^1.13.7",
|
|
68
|
+
"@types/react-google-recaptcha": "^2.1.8",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
|
70
|
+
"@typescript-eslint/parser": "^6.13.1",
|
|
71
|
+
"chromatic": "^10.0.0",
|
|
72
|
+
"css-loader": "^6.8.1",
|
|
73
|
+
"cypress": "^13.6.0",
|
|
74
|
+
"dotenv-webpack": "^8.0.1",
|
|
75
|
+
"eslint": "^8.55.0",
|
|
76
|
+
"eslint-config-prettier": "^9.1.0",
|
|
77
|
+
"eslint-plugin-css-modules": "^2.12.0",
|
|
78
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
79
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
80
|
+
"jest": "^29.7.0",
|
|
81
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
82
|
+
"jest-junit": "^16.0.0",
|
|
69
83
|
"postcss-normalize": "^10.0.1",
|
|
70
|
-
"prettier": "^
|
|
84
|
+
"prettier": "^3.1.0",
|
|
71
85
|
"react": "^17.0.2",
|
|
72
|
-
"react-dom": "^17.0.2"
|
|
86
|
+
"react-dom": "^17.0.2",
|
|
87
|
+
"react-scripts": "5.0.1",
|
|
88
|
+
"storybook": "^7.6.3",
|
|
89
|
+
"ts-jest": "^29.1.1"
|
|
73
90
|
},
|
|
74
91
|
"peerDependencies": {
|
|
75
|
-
"axios": "^
|
|
92
|
+
"axios": "^1.6.x",
|
|
76
93
|
"babel-plugin-add-react-displayname": "0.0.x",
|
|
77
|
-
"date-fns": "^2.
|
|
94
|
+
"date-fns": "^2.30.x",
|
|
78
95
|
"draft-js": "^0.11.x",
|
|
79
96
|
"logrocket": "^2.x.x",
|
|
80
|
-
"react": "^17.
|
|
97
|
+
"react": "^17.0.2",
|
|
81
98
|
"react-dom": "^17.x.x",
|
|
82
|
-
"react-draft-wysiwyg": "^1.
|
|
83
|
-
"react-hook-form": "^7.
|
|
99
|
+
"react-draft-wysiwyg": "^1.15.x",
|
|
100
|
+
"react-hook-form": "^7.48.2",
|
|
101
|
+
"@reduxjs/toolkit": "^1.9.7",
|
|
102
|
+
"react-redux": "^8.1.3"
|
|
84
103
|
},
|
|
85
104
|
"publishConfig": {
|
|
86
105
|
"access": "public"
|
package/dist/App.js
DELETED
|
@@ -1,472 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
-
var t = {};
|
|
50
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
-
t[p] = s[p];
|
|
52
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
-
t[p[i]] = s[p[i]];
|
|
56
|
-
}
|
|
57
|
-
return t;
|
|
58
|
-
};
|
|
59
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
60
|
-
import { useEffect, useRef, useState } from 'react';
|
|
61
|
-
import Loader from './shared/Loader/Loader';
|
|
62
|
-
import styles from './App.module.css';
|
|
63
|
-
import FormComponent from './Form/Form';
|
|
64
|
-
import StepTypes from './constants/FormStepTypes';
|
|
65
|
-
import axiosInstance from './AxiosAPI';
|
|
66
|
-
import widgetInstance from './AxiosWidget';
|
|
67
|
-
import { calcCbrForm } from './utils/CbrFunctions';
|
|
68
|
-
import CBRStepTypes from './constants/CBRFormStepTypes';
|
|
69
|
-
import { nanoid } from 'nanoid';
|
|
70
|
-
import { EditorState, convertFromRaw } from 'draft-js';
|
|
71
|
-
import { stringToDraft, getRawText, } from './FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep';
|
|
72
|
-
function App(_a) {
|
|
73
|
-
var _this = this;
|
|
74
|
-
var _b, _c, _d, _e;
|
|
75
|
-
var apiKey = _a.apiKey, domain = _a.domain, preview = _a.preview, partial = _a.partial, formData = _a.formData, postview = _a.postview, _f = _a.editable, editable = _f === void 0 ? true : _f, isWidget = _a.isWidget, internal = _a.internal, valuesData = _a.valuesData, customSend = _a.customSend, customSteps = _a.customSteps, classifiers = _a.classifiers, handleConfirmed = _a.handleConfirmed, customStepProps = _a.customStepProps, others = __rest(_a, ["apiKey", "domain", "preview", "partial", "formData", "postview", "editable", "isWidget", "internal", "valuesData", "customSend", "customSteps", "classifiers", "handleConfirmed", "customStepProps"]);
|
|
76
|
-
var _g = useState(undefined), form = _g[0], setForm = _g[1];
|
|
77
|
-
var _h = useState({}), originalValues = _h[0], setOriginalValues = _h[1];
|
|
78
|
-
var _j = useState(undefined), organizationInfo = _j[0], setOrganizationInfo = _j[1];
|
|
79
|
-
var _k = useState(), branding = _k[0], setBranding = _k[1];
|
|
80
|
-
var migrateFormData = function (formData, valuesData) {
|
|
81
|
-
var form = migrateForm(formData, classifiers);
|
|
82
|
-
var steps = Object.values(form.steps);
|
|
83
|
-
var hasCBR = steps.find(function (step) {
|
|
84
|
-
return step.type.startsWith('CBR');
|
|
85
|
-
});
|
|
86
|
-
if (hasCBR !== undefined) {
|
|
87
|
-
var CBRForm = calcCbrForm(form, valuesData !== null && valuesData !== void 0 ? valuesData : {});
|
|
88
|
-
setForm(CBRForm);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
setForm(form);
|
|
92
|
-
}
|
|
93
|
-
setOriginalValues(mapOriginalValues(valuesData !== null && valuesData !== void 0 ? valuesData : {}, form));
|
|
94
|
-
};
|
|
95
|
-
function fetchPreview(formData, valuesData) {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
-
var response;
|
|
98
|
-
return __generator(this, function (_a) {
|
|
99
|
-
switch (_a.label) {
|
|
100
|
-
case 0: return [4 /*yield*/, widgetInstance.get('/organization')];
|
|
101
|
-
case 1:
|
|
102
|
-
response = _a.sent();
|
|
103
|
-
if (response.data) {
|
|
104
|
-
if (!response.data.customBrandings) {
|
|
105
|
-
setBranding(response.data.branding);
|
|
106
|
-
}
|
|
107
|
-
setOrganizationInfo(response.data);
|
|
108
|
-
migrateFormData(formData, valuesData);
|
|
109
|
-
}
|
|
110
|
-
return [2 /*return*/];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
useEffect(function () {
|
|
116
|
-
if (formData !== undefined) {
|
|
117
|
-
if (preview && formData.isStandAlone) {
|
|
118
|
-
fetchPreview(formData, valuesData);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
migrateFormData(__assign({}, formData), valuesData);
|
|
122
|
-
setBranding(undefined);
|
|
123
|
-
setOrganizationInfo(null);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else if (!isWidget && apiKey) {
|
|
127
|
-
//Is iframe
|
|
128
|
-
loadOrgInfo(domain);
|
|
129
|
-
loadInfo(apiKey, domain);
|
|
130
|
-
}
|
|
131
|
-
else if (isWidget && apiKey && domain) {
|
|
132
|
-
//Is widget
|
|
133
|
-
loadOrgInfo(domain);
|
|
134
|
-
loadInfo(apiKey, domain);
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
console.error('ERROREMBED');
|
|
138
|
-
//Error in embed
|
|
139
|
-
setForm(null);
|
|
140
|
-
setBranding(undefined);
|
|
141
|
-
setOrganizationInfo(null);
|
|
142
|
-
}
|
|
143
|
-
}, []);
|
|
144
|
-
var loadLogRocket = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
145
|
-
var LogRocket, error_1;
|
|
146
|
-
return __generator(this, function (_a) {
|
|
147
|
-
switch (_a.label) {
|
|
148
|
-
case 0:
|
|
149
|
-
if (!(organizationInfo && form !== undefined)) return [3 /*break*/, 4];
|
|
150
|
-
if (!(process.env.NODE_ENV === 'production' &&
|
|
151
|
-
apiKey !== 'rCgWiEfOSN1TlUmHO28Y0' &&
|
|
152
|
-
apiKey !== 'FORMSTEST' &&
|
|
153
|
-
!internal &&
|
|
154
|
-
!postview &&
|
|
155
|
-
!preview)) return [3 /*break*/, 4];
|
|
156
|
-
_a.label = 1;
|
|
157
|
-
case 1:
|
|
158
|
-
_a.trys.push([1, 3, , 4]);
|
|
159
|
-
return [4 /*yield*/, import('logrocket')];
|
|
160
|
-
case 2:
|
|
161
|
-
LogRocket = _a.sent();
|
|
162
|
-
LogRocket.default.init('63mg8a/forms-uv0gd');
|
|
163
|
-
LogRocket.default.identify(organizationInfo.idOrganization + '/' + apiKey, {
|
|
164
|
-
name: organizationInfo.name +
|
|
165
|
-
'/' +
|
|
166
|
-
((form === null || form === void 0 ? void 0 : form.name) ? form === null || form === void 0 ? void 0 : form.name : '404'),
|
|
167
|
-
});
|
|
168
|
-
return [3 /*break*/, 4];
|
|
169
|
-
case 3:
|
|
170
|
-
error_1 = _a.sent();
|
|
171
|
-
console.error('LogRocker Error', error_1);
|
|
172
|
-
return [3 /*break*/, 4];
|
|
173
|
-
case 4: return [2 /*return*/];
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}); };
|
|
177
|
-
useEffect(function () {
|
|
178
|
-
loadLogRocket();
|
|
179
|
-
}, [organizationInfo, form]);
|
|
180
|
-
var containerRef = useRef();
|
|
181
|
-
var loadOrgInfo = function (domain) { return __awaiter(_this, void 0, void 0, function () {
|
|
182
|
-
var response, _a, error_2;
|
|
183
|
-
return __generator(this, function (_b) {
|
|
184
|
-
switch (_b.label) {
|
|
185
|
-
case 0:
|
|
186
|
-
_b.trys.push([0, 5, , 6]);
|
|
187
|
-
if (!domain) return [3 /*break*/, 2];
|
|
188
|
-
return [4 /*yield*/, widgetInstance.get("/organization?idOrganization=".concat(domain))];
|
|
189
|
-
case 1:
|
|
190
|
-
_a = _b.sent();
|
|
191
|
-
return [3 /*break*/, 4];
|
|
192
|
-
case 2: return [4 /*yield*/, axiosInstance.get('/organization')];
|
|
193
|
-
case 3:
|
|
194
|
-
_a = _b.sent();
|
|
195
|
-
_b.label = 4;
|
|
196
|
-
case 4:
|
|
197
|
-
response = _a;
|
|
198
|
-
if (response === null || response === void 0 ? void 0 : response.data) {
|
|
199
|
-
// document.title = currentOrg.name;
|
|
200
|
-
// const favicon: any = document.getElementById('favicon');
|
|
201
|
-
// if (favicon !== undefined) {
|
|
202
|
-
// favicon.href = currentOrg.partialLogoUrl;
|
|
203
|
-
// }
|
|
204
|
-
//TODO cambiar el color del navbar en movil
|
|
205
|
-
// eslint-disable-next-line no-console
|
|
206
|
-
setOrganizationInfo(response === null || response === void 0 ? void 0 : response.data);
|
|
207
|
-
if (!response.data.customBrandings) {
|
|
208
|
-
setBranding(response === null || response === void 0 ? void 0 : response.data.branding);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
setBranding(undefined);
|
|
213
|
-
setOrganizationInfo(null);
|
|
214
|
-
}
|
|
215
|
-
return [3 /*break*/, 6];
|
|
216
|
-
case 5:
|
|
217
|
-
error_2 = _b.sent();
|
|
218
|
-
console.error(error_2);
|
|
219
|
-
setBranding(undefined);
|
|
220
|
-
setOrganizationInfo(null);
|
|
221
|
-
return [3 /*break*/, 6];
|
|
222
|
-
case 6: return [2 /*return*/];
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
}); };
|
|
226
|
-
var loadInfo = function (apiKey, domain) { return __awaiter(_this, void 0, void 0, function () {
|
|
227
|
-
var response, error_3;
|
|
228
|
-
return __generator(this, function (_a) {
|
|
229
|
-
switch (_a.label) {
|
|
230
|
-
case 0:
|
|
231
|
-
_a.trys.push([0, 2, , 3]);
|
|
232
|
-
return [4 /*yield*/, (domain
|
|
233
|
-
? widgetInstance.get("/form/".concat(apiKey, "?idOrganization=").concat(domain))
|
|
234
|
-
: axiosInstance.get("/form/".concat(apiKey)))];
|
|
235
|
-
case 1:
|
|
236
|
-
response = _a.sent();
|
|
237
|
-
if (response) {
|
|
238
|
-
if (response.data.branding)
|
|
239
|
-
setBranding(response.data.branding);
|
|
240
|
-
migrateFormData(response.data, valuesData);
|
|
241
|
-
}
|
|
242
|
-
return [3 /*break*/, 3];
|
|
243
|
-
case 2:
|
|
244
|
-
error_3 = _a.sent();
|
|
245
|
-
console.error(error_3);
|
|
246
|
-
setForm(null);
|
|
247
|
-
return [3 /*break*/, 3];
|
|
248
|
-
case 3: return [2 /*return*/];
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
}); };
|
|
252
|
-
if (form === undefined || organizationInfo === undefined) {
|
|
253
|
-
if (isWidget) {
|
|
254
|
-
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: _jsx(Loader, { size: 50, color: (_c = (_b = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _b === void 0 ? void 0 : _b.primaryColor) !== null && _c !== void 0 ? _c : '#b8b8b8' }) })) })));
|
|
255
|
-
}
|
|
256
|
-
return (_jsx("div", __assign({ className: styles.curtain }, { children: _jsx(Loader, { size: 50, color: (_e = (_d = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _d === void 0 ? void 0 : _d.primaryColor) !== null && _e !== void 0 ? _e : '#b8b8b8' }) })));
|
|
257
|
-
}
|
|
258
|
-
else if (form === null) {
|
|
259
|
-
if (organizationInfo === null) {
|
|
260
|
-
if (isWidget) {
|
|
261
|
-
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "Error" })) })));
|
|
262
|
-
}
|
|
263
|
-
return _jsx("div", __assign({ className: styles.curtain }, { children: "Error" }));
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
if (isWidget) {
|
|
267
|
-
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "404" })) })));
|
|
268
|
-
}
|
|
269
|
-
return _jsx("div", __assign({ className: styles.curtain }, { children: "404" }));
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
return (_jsx("div", __assign({ ref: containerRef, className: styles.container }, { children: _jsx(FormComponent, __assign({}, others, { form: form, branding: branding, reload: function () {
|
|
274
|
-
var tempForm = __assign({}, form);
|
|
275
|
-
setForm(undefined);
|
|
276
|
-
setTimeout(function () {
|
|
277
|
-
setForm(tempForm);
|
|
278
|
-
}, 100);
|
|
279
|
-
if (handleConfirmed) {
|
|
280
|
-
handleConfirmed();
|
|
281
|
-
}
|
|
282
|
-
}, editable: editable, postview: postview === true, preview: preview === true, partial: partial === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo !== null && organizationInfo !== void 0 ? organizationInfo : { idOrganization: domain }, customSteps: customSteps !== null && customSteps !== void 0 ? customSteps : {}, customStepProps: customStepProps !== null && customStepProps !== void 0 ? customStepProps : {}, isWidget: isWidget === true })) })));
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
export default App;
|
|
286
|
-
var migrateForm = function (form, classifiers) {
|
|
287
|
-
var steps = {};
|
|
288
|
-
for (var _i = 0, _a = Object.keys(form.steps); _i < _a.length; _i++) {
|
|
289
|
-
var idStep = _a[_i];
|
|
290
|
-
steps[idStep] = migrateStep(form.steps, form.steps[idStep]);
|
|
291
|
-
}
|
|
292
|
-
var newForm = __assign(__assign({}, form), { steps: steps });
|
|
293
|
-
if (form.classifiers) {
|
|
294
|
-
var mappedClassifiers = {};
|
|
295
|
-
for (var _b = 0, _c = Object.keys(form.classifiers); _b < _c.length; _b++) {
|
|
296
|
-
var idClassifier = _c[_b];
|
|
297
|
-
var classifier = __assign({}, form.classifiers[idClassifier]);
|
|
298
|
-
if (classifier.children &&
|
|
299
|
-
classifier.children.find(function (child) { return typeof child !== 'string'; })) {
|
|
300
|
-
var children = [];
|
|
301
|
-
for (var _d = 0, _e = classifier.children; _d < _e.length; _d++) {
|
|
302
|
-
var child = _e[_d];
|
|
303
|
-
if (typeof child === 'string') {
|
|
304
|
-
children.push(child);
|
|
305
|
-
}
|
|
306
|
-
else if (child._id) {
|
|
307
|
-
mappedClassifiers[child._id] = child;
|
|
308
|
-
children.push(child._id);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
classifier.children = children;
|
|
312
|
-
}
|
|
313
|
-
mappedClassifiers[idClassifier] = classifier;
|
|
314
|
-
}
|
|
315
|
-
newForm.classifiers = mappedClassifiers;
|
|
316
|
-
}
|
|
317
|
-
else if (classifiers) {
|
|
318
|
-
newForm.classifiers = classifiers;
|
|
319
|
-
}
|
|
320
|
-
return newForm;
|
|
321
|
-
};
|
|
322
|
-
var migrateStep = function (steps, pStep) {
|
|
323
|
-
var step = __assign({}, pStep);
|
|
324
|
-
if (step.type === StepTypes.MAPPER) {
|
|
325
|
-
var newSteps = {};
|
|
326
|
-
for (var _i = 0, _a = Object.keys(step.steps); _i < _a.length; _i++) {
|
|
327
|
-
var idStep = _a[_i];
|
|
328
|
-
newSteps[idStep] = migrateStep(__assign(__assign({}, steps), step.steps), step.steps[idStep]);
|
|
329
|
-
}
|
|
330
|
-
step.steps = newSteps;
|
|
331
|
-
}
|
|
332
|
-
//TODO: Pasar esto al back
|
|
333
|
-
if (step.type === CBRStepTypes.CBR_EMAIL) {
|
|
334
|
-
step.validation = {
|
|
335
|
-
value: /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
336
|
-
.source,
|
|
337
|
-
message: 'El correo no es válido',
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
else if (step.type === CBRStepTypes.CBR_PHONE ||
|
|
341
|
-
step.type === CBRStepTypes.CBR_CEL) {
|
|
342
|
-
step.validation = {
|
|
343
|
-
value: /^(\+[0-9])|([0-9])$/.source,
|
|
344
|
-
message: 'El teléfono no es válido',
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
return step;
|
|
348
|
-
};
|
|
349
|
-
var mapOriginalValues = function (originalValues, form) {
|
|
350
|
-
var newValues = {};
|
|
351
|
-
for (var _i = 0, _a = Object.keys(originalValues); _i < _a.length; _i++) {
|
|
352
|
-
var idValue = _a[_i];
|
|
353
|
-
var step = form.steps[idValue];
|
|
354
|
-
if (step) {
|
|
355
|
-
var value = mapOriginalValue(step, originalValues[step.id], newValues, form);
|
|
356
|
-
if (value !== undefined) {
|
|
357
|
-
newValues[step.id] = value;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
newValues[idValue] = originalValues[idValue];
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
for (var _b = 0, _c = Object.values(form.steps); _b < _c.length; _b++) {
|
|
365
|
-
var step = _c[_b];
|
|
366
|
-
if (step.type !== StepTypes.MAPPER ||
|
|
367
|
-
newValues[step.id] ||
|
|
368
|
-
!step.required)
|
|
369
|
-
continue;
|
|
370
|
-
addInitialMapper(newValues, step);
|
|
371
|
-
}
|
|
372
|
-
return newValues;
|
|
373
|
-
};
|
|
374
|
-
export var addInitialMapper = function (newValues, step) {
|
|
375
|
-
var idElement = nanoid();
|
|
376
|
-
var newElement = {
|
|
377
|
-
ids: {},
|
|
378
|
-
id: idElement,
|
|
379
|
-
originalValues: {},
|
|
380
|
-
isOriginal: false,
|
|
381
|
-
};
|
|
382
|
-
var newSteps = {};
|
|
383
|
-
for (var _i = 0, _a = Object.keys(step.steps); _i < _a.length; _i++) {
|
|
384
|
-
var idStep = _a[_i];
|
|
385
|
-
var baseStep = JSON.parse(JSON.stringify(step.steps[idStep]));
|
|
386
|
-
var newIdStep = step.id + '-' + idStep + '-' + idElement;
|
|
387
|
-
baseStep.id = newIdStep;
|
|
388
|
-
newElement.ids[idStep] = newIdStep;
|
|
389
|
-
newSteps[newIdStep] = baseStep;
|
|
390
|
-
if (baseStep.type === StepTypes.MAPPER) {
|
|
391
|
-
addInitialMapper(newValues, baseStep);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
newValues[step.id] = [newElement];
|
|
395
|
-
};
|
|
396
|
-
export var mapOriginalValue = function (step, value, newValues, form) {
|
|
397
|
-
var _a, _b, _c, _d, _e;
|
|
398
|
-
if (!value)
|
|
399
|
-
return value;
|
|
400
|
-
switch (step === null || step === void 0 ? void 0 : step.type) {
|
|
401
|
-
case StepTypes.MAPPER: {
|
|
402
|
-
var elements = value;
|
|
403
|
-
var mappedElements = [];
|
|
404
|
-
for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {
|
|
405
|
-
var element = elements_1[_i];
|
|
406
|
-
var idElement = (_a = element.id) !== null && _a !== void 0 ? _a : nanoid();
|
|
407
|
-
var mappedElement = {
|
|
408
|
-
id: idElement,
|
|
409
|
-
ids: {},
|
|
410
|
-
originalValues: {},
|
|
411
|
-
isOriginal: true,
|
|
412
|
-
};
|
|
413
|
-
if (element.value) {
|
|
414
|
-
mappedElement.value = element.value;
|
|
415
|
-
}
|
|
416
|
-
for (var _f = 0, _g = Object.keys(step.steps); _f < _g.length; _f++) {
|
|
417
|
-
var idStep = _g[_f];
|
|
418
|
-
var newIdStep = step.id + '-' + idStep + '-' + idElement;
|
|
419
|
-
mappedElement.ids[idStep] = newIdStep;
|
|
420
|
-
var value_1 = mapOriginalValue(step.steps[idStep], element[idStep], newValues, form);
|
|
421
|
-
if (value_1 !== undefined) {
|
|
422
|
-
newValues[newIdStep] = value_1;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
for (var _h = 0, _j = Object.keys(element); _h < _j.length; _h++) {
|
|
426
|
-
var key = _j[_h];
|
|
427
|
-
if (step.steps[key])
|
|
428
|
-
continue;
|
|
429
|
-
mappedElement.originalValues[key] = element[key];
|
|
430
|
-
}
|
|
431
|
-
mappedElements.push(mappedElement);
|
|
432
|
-
}
|
|
433
|
-
return mappedElements;
|
|
434
|
-
}
|
|
435
|
-
case StepTypes.TEXTAREA: {
|
|
436
|
-
if (step.hasTextEditor) {
|
|
437
|
-
return calcDefaultDraftValue(value);
|
|
438
|
-
}
|
|
439
|
-
return (_b = value.value) !== null && _b !== void 0 ? _b : value;
|
|
440
|
-
}
|
|
441
|
-
case StepTypes.SELECTOR: {
|
|
442
|
-
var option = step.options.find(function (option) { return option.value == value; });
|
|
443
|
-
if (!(value === null || value === void 0 ? void 0 : value.value))
|
|
444
|
-
return option;
|
|
445
|
-
return value;
|
|
446
|
-
}
|
|
447
|
-
case StepTypes.CLASSIFIER_SELECTOR: {
|
|
448
|
-
var stepClassifier = (_c = form === null || form === void 0 ? void 0 : form.classifiers) === null || _c === void 0 ? void 0 : _c[(_d = step.idClassifier) !== null && _d !== void 0 ? _d : ''];
|
|
449
|
-
if (stepClassifier) {
|
|
450
|
-
var classifier = (_e = form.classifiers) === null || _e === void 0 ? void 0 : _e[value];
|
|
451
|
-
if (!(value === null || value === void 0 ? void 0 : value.value))
|
|
452
|
-
return { value: value, label: classifier === null || classifier === void 0 ? void 0 : classifier.name };
|
|
453
|
-
}
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
default:
|
|
457
|
-
if (step.type.startsWith('CBR_') &&
|
|
458
|
-
(value === null || value === void 0 ? void 0 : value.id) &&
|
|
459
|
-
typeof value.id === 'number') {
|
|
460
|
-
return __assign(__assign({}, value), { id: value.id.toString() });
|
|
461
|
-
}
|
|
462
|
-
return value;
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
var calcDefaultDraftValue = function (defaultValue) {
|
|
466
|
-
if (typeof defaultValue === 'string') {
|
|
467
|
-
return EditorState.createWithContent(convertFromRaw(stringToDraft(defaultValue)));
|
|
468
|
-
}
|
|
469
|
-
else {
|
|
470
|
-
return EditorState.createWithContent(convertFromRaw(getRawText(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.draft, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text)));
|
|
471
|
-
}
|
|
472
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
.navContainer {
|
|
2
|
-
height: 60px;
|
|
3
|
-
display: flex;
|
|
4
|
-
}
|
|
5
|
-
.navImage {
|
|
6
|
-
height: 40px;
|
|
7
|
-
margin: auto 0 auto 15px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.toogle {
|
|
11
|
-
margin: auto 5px auto auto;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@media screen and (max-width: 576px) {
|
|
15
|
-
.toogle {
|
|
16
|
-
display: unset !important;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.ratingContainer {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.disabledSentimentContainer,
|
|
8
|
-
.sentimentContainer {
|
|
9
|
-
font-size: 60px;
|
|
10
|
-
height: 60px;
|
|
11
|
-
color: var(--eureka-outline);
|
|
12
|
-
}
|
|
13
|
-
.disabledLikeContainer,
|
|
14
|
-
.likeContainer {
|
|
15
|
-
font-size: 60px;
|
|
16
|
-
height: 75px;
|
|
17
|
-
color: var(--eureka-outline);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.likeContainer:hover,
|
|
21
|
-
.sentimentContainer:hover {
|
|
22
|
-
transform: scale(1.2);
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
color: var(--eureka-primary);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.hiddenInput {
|
|
28
|
-
height: 0;
|
|
29
|
-
width: 0;
|
|
30
|
-
padding: 0;
|
|
31
|
-
border-width: 0;
|
|
32
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|