@arquimedes.co/eureka-forms 3.0.33-test → 3.0.33
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/Condition.d.ts +6 -4
- package/dist/@Types/ErkValue.d.ts +16 -0
- package/dist/@Types/Form.d.ts +1 -0
- package/dist/@Types/FormStep.d.ts +12 -8
- package/dist/@Types/GenericFormSteps.d.ts +0 -8
- package/dist/@Types/User.d.ts +13 -0
- package/dist/App/App.d.ts +3 -1
- package/dist/App/App.js +46 -21
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +336 -177
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +252 -146
- package/dist/Contexts/CustomContext.d.ts +1 -0
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +2 -3
- package/dist/Contexts/SectionContext.d.ts +1 -0
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +62 -36
- package/dist/Form/Form.d.ts +2 -1
- package/dist/Form/Form.js +164 -71
- package/dist/Form/Form.module.css +9 -0
- package/dist/Form/FormFunctions.js +112 -63
- package/dist/Form/FormHooks.d.ts +1 -0
- package/dist/Form/FormHooks.js +21 -13
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +105 -32
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +2 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +110 -46
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.js +23 -10
- package/dist/Form/Section/MaterialSection/MaterialSection.module.css +2 -0
- package/dist/Form/Section/Section.d.ts +1 -0
- package/dist/Form/Section/Section.js +15 -4
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -0
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +65 -30
- package/dist/Form/Terms/Term/Term.d.ts +1 -0
- package/dist/Form/Terms/Term/Term.js +13 -2
- package/dist/Form/Terms/Terms.d.ts +1 -0
- package/dist/Form/Terms/Terms.js +27 -11
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +107 -34
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +40 -12
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +77 -56
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +115 -45
- package/dist/FormSteps/AYFStepMapper.d.ts +1 -0
- package/dist/FormSteps/AYFStepMapper.js +137 -60
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +13 -2
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +173 -64
- package/dist/FormSteps/CBRStepMapper.d.ts +1 -0
- package/dist/FormSteps/CBRStepMapper.js +168 -56
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +13 -2
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +37 -19
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +13 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +2 -1
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +81 -44
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +26 -3
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +61 -31
- package/dist/FormSteps/CustomStep.d.ts +1 -0
- package/dist/FormSteps/CustomStep.js +31 -17
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +20 -9
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +13 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +32 -16
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +2 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +302 -106
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +95 -33
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +180 -85
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MapperStep.js +13 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +38 -16
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +31 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +175 -85
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +47 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +115 -70
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +2 -1
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +33 -15
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +1 -0
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +13 -2
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +31 -17
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/RatingStep.js +13 -2
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +61 -31
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/SelectorStep.js +13 -2
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -2
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +13 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +2 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +155 -73
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormSteps/Step.d.ts +1 -0
- package/dist/FormSteps/Step.js +58 -33
- package/dist/FormSteps/StepFunctions.d.ts +6 -4
- package/dist/FormSteps/StepFunctions.js +208 -153
- package/dist/FormSteps/StepHooks.d.ts +14 -68
- package/dist/FormSteps/StepHooks.js +154 -88
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +20 -18
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +74 -36
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +2 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +28 -12
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +14 -3
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +30 -12
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +2 -1
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +26 -9
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +1 -0
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +13 -2
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +54 -21
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/TitleStep.js +13 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +2 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +27 -14
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +3 -2
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +23 -8
- package/dist/Icons/@IconTypes.d.ts +7 -0
- package/dist/Icons/CalendarIcon.d.ts +3 -2
- package/dist/Icons/CalendarIcon.js +14 -4
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +13 -3
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +13 -3
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +13 -3
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +13 -3
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +13 -3
- package/dist/Icons/EmailIcon.d.ts +4 -0
- package/dist/Icons/EmailIcon.js +17 -0
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +13 -3
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +15 -5
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +15 -5
- package/dist/Icons/Entities/SchoolIcon.d.ts +2 -0
- package/dist/Icons/Entities/SchoolIcon.js +17 -0
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +15 -5
- package/dist/Icons/GroupIcon.d.ts +4 -0
- package/dist/Icons/GroupIcon.js +17 -0
- package/dist/Icons/LocationIcon.d.ts +3 -2
- package/dist/Icons/LocationIcon.js +14 -4
- package/dist/Icons/LockedIcon.d.ts +4 -0
- package/dist/Icons/LockedIcon.js +17 -0
- package/dist/Icons/PersonIcon.d.ts +3 -2
- package/dist/Icons/PersonIcon.js +16 -6
- package/dist/Login/Login.module.css +135 -0
- package/dist/Login/LoginLayout.module.css +68 -0
- package/dist/Login/LoginPage.d.ts +11 -0
- package/dist/Login/LoginPage.js +177 -0
- package/dist/Login/LoginTextField.d.ts +15 -0
- package/dist/Login/LoginTextField.js +134 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +72 -22
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +86 -29
- package/dist/Services/FormService.js +56 -11
- package/dist/Services/IntegrationService.d.ts +21 -0
- package/dist/Services/IntegrationService.js +69 -0
- package/dist/Services/OrganizationService.js +62 -11
- package/dist/Services/UserService.d.ts +10 -0
- package/dist/Services/UserService.js +71 -0
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +2 -1
- package/dist/Shared/CustomBtn/CustomBtn.js +88 -24
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +112 -29
- package/dist/Shared/Loader/Loader.d.ts +1 -0
- package/dist/Shared/Loader/Loader.js +18 -6
- package/dist/Shared/Navbar/Navbar.d.ts +3 -1
- package/dist/Shared/Navbar/Navbar.js +96 -3
- package/dist/Shared/Navbar/Navbar.module.css +15 -0
- package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/Shared/Navbar/Navbar.stories.js +2 -2
- package/dist/Shared/Rating/Rating.d.ts +5 -3
- package/dist/Shared/Rating/Rating.js +27 -4
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +19 -13
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/LikeRating.js +33 -19
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +47 -27
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/ScaleRating.js +54 -23
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +30 -0
- package/dist/Shared/RoundedButton/RoundedButton.js +45 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +49 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +351 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +43 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +226 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +68 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.js +214 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +236 -0
- package/dist/Shared/{ErkSmartSelect/ErkSmartSelect.stories.d.ts → RoundedSmartSelect/RoundedSmartSelect.stories.d.ts} +13 -3
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +45 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.js +175 -0
- package/dist/Shared/{ErkTextField/ErkTextField.stories.d.ts → RoundedTextField/RoundedTextField.stories.d.ts} +17 -4
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +224 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +41 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +314 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +22 -8
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +60 -0
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +43 -27
- package/dist/Shared/Toggle/Toggle.d.ts +14 -5
- package/dist/Shared/Toggle/Toggle.js +32 -29
- package/dist/States/GlobalSlice.d.ts +12 -7
- package/dist/States/GlobalSlice.js +22 -6
- package/dist/States/SiteSlice.d.ts +48 -30
- package/dist/States/SiteSlice.js +76 -58
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +9 -8
- package/dist/Utils/AxiosAPI.d.ts +5 -4
- package/dist/Utils/AxiosAPI.js +73 -23
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +30 -29
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +143 -102
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +45 -27
- package/dist/Utils/MaterialProviders.d.ts +1 -21
- package/dist/Utils/MaterialProviders.js +28 -46
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +81 -60
- package/dist/Utils/TestUtils.js +57 -28
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +8 -10
- package/dist/Utils/store.d.ts +17 -9
- package/dist/Utils/store.js +74 -15
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +26 -16
- package/dist/__mocks__/axios.d.ts +2 -0
- package/dist/__mocks__/axios.js +2 -0
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/ErkValueTypes.d.ts +6 -0
- package/dist/constants/ErkValueTypes.js +7 -0
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/FormStepTypes.d.ts +2 -2
- package/dist/constants/FormStepTypes.js +1 -1
- package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
- package/dist/constants/IconTypes.js +18 -0
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
- package/dist/constants/MaterialClassNameSeed.js +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +77 -14
- package/dist/index.js +31 -0
- package/dist/index.lib.d.ts +1 -0
- package/dist/index.lib.js +1 -0
- package/package.json +125 -104
- package/dist/App/AppFunctions.test.js +0 -708
- package/dist/App/AppHooks.test.js +0 -154
- package/dist/Form/FormFunctions.test.js +0 -458
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +0 -10
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +0 -14
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +0 -3
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +0 -34
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
- package/dist/FormSteps/StepFunctions.test.js +0 -702
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +0 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +0 -2
- package/dist/Icons/@ErkIcon.d.ts +0 -14
- package/dist/Icons/@ErkIcon.js +0 -9
- package/dist/Icons/ArrowLeftIcon.d.ts +0 -3
- package/dist/Icons/ArrowLeftIcon.js +0 -7
- package/dist/Icons/ArrowRightIcon.d.ts +0 -3
- package/dist/Icons/ArrowRightIcon.js +0 -7
- package/dist/Icons/CheckCircleIcon.d.ts +0 -3
- package/dist/Icons/CheckCircleIcon.js +0 -7
- package/dist/Icons/CheckboxCheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxCheckedIcon.js +0 -7
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxUncheckedIcon.js +0 -7
- package/dist/Icons/ClockIcon.d.ts +0 -3
- package/dist/Icons/ClockIcon.js +0 -7
- package/dist/Icons/CloseIcon.d.ts +0 -3
- package/dist/Icons/CloseIcon.js +0 -7
- package/dist/Icons/DeleteIcon.d.ts +0 -3
- package/dist/Icons/DeleteIcon.js +0 -7
- package/dist/Icons/Entities/WorkIcon.d.ts +0 -3
- package/dist/Icons/Entities/WorkIcon.js +0 -7
- package/dist/Icons/ErrorIcon.d.ts +0 -3
- package/dist/Icons/ErrorIcon.js +0 -7
- package/dist/Icons/ExpandLessIcon.d.ts +0 -3
- package/dist/Icons/ExpandLessIcon.js +0 -7
- package/dist/Icons/ExpandMoreIcon.d.ts +0 -3
- package/dist/Icons/ExpandMoreIcon.js +0 -7
- package/dist/Icons/FileIcon.d.ts +0 -3
- package/dist/Icons/FileIcon.js +0 -7
- package/dist/Icons/InfoIcon.d.ts +0 -3
- package/dist/Icons/InfoIcon.js +0 -7
- package/dist/Icons/Ratings/DislikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DislikeIcon.js +0 -7
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/LikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/LikeIcon.js +0 -7
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/SatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/StarIcon.d.ts +0 -3
- package/dist/Icons/Ratings/StarIcon.js +0 -7
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +0 -7
- package/dist/Icons/WarningIcon.d.ts +0 -3
- package/dist/Icons/WarningIcon.js +0 -7
- package/dist/Init.d.ts +0 -1
- package/dist/Init.js +0 -2
- package/dist/Shared/ErkButton/ErkButton.d.ts +0 -25
- package/dist/Shared/ErkButton/ErkButton.js +0 -31
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
- package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +0 -19
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +0 -31
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +0 -18
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +0 -266
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +0 -18
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +0 -162
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +0 -36
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +0 -274
- package/dist/Shared/ErkMenuItem.d.ts +0 -4
- package/dist/Shared/ErkMenuItem.js +0 -18
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
- package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
- package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
- package/dist/Utils/LocaleUtils.d.ts +0 -2
- package/dist/Utils/LocaleUtils.js +0 -12
- package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
- package/dist/Utils/MuiClassnameSetup.js +0 -3
- package/dist/constants/ErkIconTypes.js +0 -16
- package/dist/index.css +0 -15
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -25
- /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
- /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
- /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
- /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
- /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
- /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
|
@@ -1,6 +1,17 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import styles from './MaterialCheckBoxStep.module.css';
|
|
3
|
-
import
|
|
14
|
+
import RoundedCheckBox from '../../../Shared/RoundedCheckBox/RoundedCheckBox';
|
|
4
15
|
import React, { useContext } from 'react';
|
|
5
16
|
import StepComponent from '../../Step';
|
|
6
17
|
import FormContext from '../../../Contexts/FormContext';
|
|
@@ -9,34 +20,41 @@ import { useFormStep } from '../../StepHooks';
|
|
|
9
20
|
import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
|
|
10
21
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
11
22
|
import { calcStepWidth } from '../../StepFunctions';
|
|
12
|
-
function CheckBoxStep(
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
function CheckBoxStep(_a) {
|
|
24
|
+
var _b;
|
|
25
|
+
var step = _a.step, editable = _a.editable;
|
|
26
|
+
var _c = useFormStep(step, {
|
|
27
|
+
defaultValue: (_b = step.defaultValue) !== null && _b !== void 0 ? _b : false,
|
|
15
28
|
rules: {
|
|
16
29
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
17
30
|
},
|
|
18
31
|
sizeChange: true,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return (_jsx(React.Fragment, { children: steps
|
|
25
|
-
|
|
26
|
-
return _jsx(StepComponent, { editable: editable, step: subStep }, idStep);
|
|
32
|
+
}), ref = _c.ref, value = _c.value, onChange = _c.onChange, error = _c.error, field = _c.field;
|
|
33
|
+
var _d = useAppSelector(function (state) { return state.global; }), formStyle = _d.formStyle, postview = _d.postview;
|
|
34
|
+
var form = useContext(FormContext);
|
|
35
|
+
var renderNested = function () {
|
|
36
|
+
var steps = value ? step.steps : step.uncheckedSteps;
|
|
37
|
+
return (_jsx(React.Fragment, { children: steps === null || steps === void 0 ? void 0 : steps.map(function (idStep) {
|
|
38
|
+
var subStep = form.steps[idStep];
|
|
39
|
+
return (_jsx(StepComponent, { editable: editable, step: subStep }, idStep));
|
|
27
40
|
}) }));
|
|
28
41
|
};
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
var renderLabel = function (colon) {
|
|
43
|
+
if (colon === void 0) { colon = false; }
|
|
44
|
+
return (_jsxs("div", __assign({ className: step.size === 4 ? styles.checkboxLbl : styles.overflowLbl, style: {
|
|
31
45
|
maxWidth: calcStepWidth(step.size, form.size) - 45,
|
|
32
|
-
}, children: [step.label, step.required ? ' *' : '', colon ? ':' : ''] }));
|
|
46
|
+
} }, { children: [step.label, step.required ? ' *' : '', colon ? ':' : ''] })));
|
|
33
47
|
};
|
|
34
|
-
return (_jsxs(StepFillerContainer, { step: step, children: [_jsx(MaterialInputContainer, { step: step, editable: editable, maxHeight: step.size < 4, children: _jsxs("div", { className: styles.container, children: [_jsxs("div", { className: styles.labelCheckBoxContainer, style: {
|
|
48
|
+
return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable, maxHeight: step.size < 4 }, { children: _jsxs("div", __assign({ className: styles.container }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer, style: {
|
|
35
49
|
height: step.size < 4 ? 31 : undefined,
|
|
36
50
|
minHeight: 31,
|
|
37
51
|
alignItems: step.isList ? 'start' : 'center',
|
|
38
|
-
}, children: [step.label && !step.isList && renderLabel(true), _jsx(
|
|
39
|
-
color: error
|
|
40
|
-
|
|
52
|
+
} }, { children: [step.label && !step.isList && renderLabel(true), _jsx(RoundedCheckBox, __assign({}, field, { inputRef: ref, onChange: onChange, "data-testid": step.id, padding: "0px", size: "1.6rem", error: !!error, cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: value })), step.label && step.isList && renderLabel()] })), (step.description || !!error) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
53
|
+
color: error
|
|
54
|
+
? formStyle.errorColor
|
|
55
|
+
: formStyle.descriptionTextColor,
|
|
56
|
+
} }, { children: error
|
|
57
|
+
? 'Este campo es obligatorio'
|
|
58
|
+
: step.description })))] })) })), renderNested()] })));
|
|
41
59
|
}
|
|
42
60
|
export default CheckBoxStep;
|
|
@@ -1,13 +1,24 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
13
|
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
3
14
|
import MaterialClassifierSelectorStep from './MaterialClassifierSelectorStep/MaterialClassifierSelectorStep';
|
|
4
15
|
import { useAppSelector } from '../../hooks';
|
|
5
16
|
function ClassifierSelectorStep(props) {
|
|
6
|
-
|
|
17
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
7
18
|
switch (formStyle.type) {
|
|
8
19
|
case FormStyleTypes.MATERIAL:
|
|
9
20
|
default: {
|
|
10
|
-
return _jsx(MaterialClassifierSelectorStep, {
|
|
21
|
+
return _jsx(MaterialClassifierSelectorStep, __assign({}, props));
|
|
11
22
|
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ClassifierSelectorStepProps } from '../ClassifierSelectorStep';
|
|
2
|
-
declare function ClassifierSelectorStep({ step, editable }: ClassifierSelectorStepProps): JSX.Element;
|
|
3
|
+
declare function ClassifierSelectorStep({ step, editable, }: ClassifierSelectorStepProps): JSX.Element;
|
|
3
4
|
export default ClassifierSelectorStep;
|
|
@@ -1,70 +1,107 @@
|
|
|
1
|
-
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
22
|
import React, { useContext, useEffect, useMemo } from 'react';
|
|
3
23
|
import { ClassifierOptionTypes } from '../../../constants/FormStepTypes';
|
|
4
24
|
import StepComponent from '../../Step';
|
|
5
|
-
import
|
|
25
|
+
import RoundedSmartSelect from '../../../Shared/RoundedSmartSelect/RoundedSmartSelect';
|
|
6
26
|
import FormContext from '../../../Contexts/FormContext';
|
|
7
27
|
import { useAppSelector } from '../../../hooks';
|
|
8
|
-
import { recursivelyCalcConditionSteps, selectDependencies, useFormStep } from '../../StepHooks';
|
|
28
|
+
import { recursivelyCalcConditionSteps, selectDependencies, useFormStep, } from '../../StepHooks';
|
|
9
29
|
import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
|
|
10
30
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
11
31
|
import { calcDefaultValue, evaluateCondition } from '../../StepFunctions';
|
|
12
|
-
function ClassifierSelectorStep(
|
|
13
|
-
|
|
32
|
+
function ClassifierSelectorStep(_a) {
|
|
33
|
+
var _b, _c, _d, _e;
|
|
34
|
+
var step = _a.step, editable = _a.editable;
|
|
35
|
+
var _f = useFormStep(step, {
|
|
14
36
|
defaultValue: calcDefaultValue(step),
|
|
15
37
|
sizeChange: true,
|
|
16
38
|
rules: {
|
|
17
39
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
18
40
|
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
}), ref = _f.ref, value = _f.value, onChange = _f.onChange, error = _f.error, field = _f.field;
|
|
42
|
+
var idDependencies = useMemo(function () {
|
|
43
|
+
var _a;
|
|
44
|
+
var dependencies = __spreadArray([], ((_a = step.dependencies) !== null && _a !== void 0 ? _a : []), true);
|
|
45
|
+
for (var _i = 0, _b = Object.values(step.options); _i < _b.length; _i++) {
|
|
46
|
+
var option = _b[_i];
|
|
47
|
+
if (option.type !== ClassifierOptionTypes.HIDE &&
|
|
48
|
+
option.condition) {
|
|
49
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
25
50
|
}
|
|
26
51
|
}
|
|
27
52
|
return dependencies;
|
|
28
53
|
}, []);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
54
|
+
var dependencies = useAppSelector(function (state) {
|
|
55
|
+
return selectDependencies(state, idDependencies);
|
|
56
|
+
});
|
|
57
|
+
var _g = useAppSelector(function (state) { return state.global; }), formStyle = _g.formStyle, postview = _g.postview, preview = _g.preview;
|
|
58
|
+
var form = useContext(FormContext);
|
|
59
|
+
if (!step.idClassifier)
|
|
60
|
+
return _jsx("div", {});
|
|
61
|
+
var classifier = (_b = form.classifiers) === null || _b === void 0 ? void 0 : _b[step.idClassifier];
|
|
62
|
+
if (!classifier)
|
|
63
|
+
return _jsx("div", {});
|
|
64
|
+
var options = useMemo(function () {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
return ((_b = (_a = classifier.children) === null || _a === void 0 ? void 0 : _a.filter(function (idClassifier) {
|
|
67
|
+
var _a;
|
|
68
|
+
var option = step.options[idClassifier];
|
|
69
|
+
if ((option === null || option === void 0 ? void 0 : option.type) === ClassifierOptionTypes.HIDE ||
|
|
70
|
+
!((_a = form.classifiers) === null || _a === void 0 ? void 0 : _a[idClassifier])) {
|
|
38
71
|
return false;
|
|
39
72
|
}
|
|
40
|
-
return !option
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
73
|
+
return (!option ||
|
|
74
|
+
!(option === null || option === void 0 ? void 0 : option.condition) ||
|
|
75
|
+
evaluateCondition(option.condition, dependencies));
|
|
76
|
+
}).map(function (idClassifier) {
|
|
77
|
+
var _a, _b, _c;
|
|
78
|
+
var classifier = (_a = form.classifiers) === null || _a === void 0 ? void 0 : _a[idClassifier];
|
|
44
79
|
return {
|
|
45
|
-
value: classifier
|
|
46
|
-
label: classifier
|
|
80
|
+
value: classifier === null || classifier === void 0 ? void 0 : classifier._id,
|
|
81
|
+
label: ((_c = (_b = classifier === null || classifier === void 0 ? void 0 : classifier.clientName) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) && preview
|
|
82
|
+
? classifier === null || classifier === void 0 ? void 0 : classifier.clientName
|
|
83
|
+
: classifier === null || classifier === void 0 ? void 0 : classifier.name,
|
|
47
84
|
};
|
|
48
|
-
});
|
|
49
|
-
}, idDependencies.map((id)
|
|
50
|
-
|
|
51
|
-
if (value
|
|
85
|
+
})) !== null && _b !== void 0 ? _b : []);
|
|
86
|
+
}, idDependencies.map(function (id) { return dependencies[id].value; }));
|
|
87
|
+
var mapNestedOption = function () {
|
|
88
|
+
if (value) {
|
|
89
|
+
var currentOption = step.options[value.value];
|
|
90
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ClassifierOptionTypes.NESTED) {
|
|
91
|
+
return (_jsx(React.Fragment, { children: currentOption.steps.map(function (idStep) {
|
|
92
|
+
var subStep = form.steps[idStep];
|
|
93
|
+
return (_jsx(StepComponent, { step: subStep, editable: editable }, idStep));
|
|
94
|
+
}) }));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
if (value && !options.find(function (option) { return option.value === (value === null || value === void 0 ? void 0 : value.value); })) {
|
|
52
100
|
onChange('');
|
|
53
101
|
}
|
|
54
102
|
}, [options]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!value)
|
|
59
|
-
return null;
|
|
60
|
-
const currentOption = step.options[value.value];
|
|
61
|
-
if (currentOption?.type !== ClassifierOptionTypes.NESTED)
|
|
62
|
-
return null;
|
|
63
|
-
return (_jsx(React.Fragment, { children: currentOption.steps.map((idStep) => {
|
|
64
|
-
const subStep = form.steps[idStep];
|
|
65
|
-
return _jsx(StepComponent, { step: subStep, editable: editable }, idStep);
|
|
66
|
-
}) }));
|
|
67
|
-
};
|
|
68
|
-
return (_jsxs(StepFillerContainer, { step: step, children: [_jsx(MaterialInputContainer, { step: step, editable: editable, children: _jsx(ErkSmartSelect, { ...field, value: value, inputRef: ref, error: !!error, options: options, onChange: onChange, readOnly: !editable || postview, label: step.label ? step.label : classifier.name, required: step.required, searchable: step.searchable, helperText: error?.message?.toString() ?? step.description, getOptionSelected: (option, value) => option.value === value?.value }) }), mapNestedOption()] }));
|
|
103
|
+
return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedSmartSelect, __assign({}, field, { inputRef: ref, value: value, disabled: false, loading: false, options: options, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_c = formStyle.stepBackgroundColor) !== null && _c !== void 0 ? _c : 'white', label: step.label ? step.label : classifier.name, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: onChange, getOptionSelected: function (option, value) {
|
|
104
|
+
return option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
105
|
+
}, helperText: (_e = (_d = error === null || error === void 0 ? void 0 : error.message) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : step.description, error: !!error })) })), mapNestedOption()] })));
|
|
69
106
|
}
|
|
70
107
|
export default ClassifierSelectorStep;
|
|
@@ -1,15 +1,38 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
1
23
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
24
|
import { useAppSelector } from '../../hooks';
|
|
3
25
|
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
4
26
|
import MaterialCollapsibleStep from './MaterialTitleStep/MaterialCollapsibleStep';
|
|
5
|
-
function CollapsibleStep(
|
|
6
|
-
|
|
27
|
+
function CollapsibleStep(_a) {
|
|
28
|
+
var step = _a.step, others = __rest(_a, ["step"]);
|
|
29
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
7
30
|
if (step.steps.length === 0)
|
|
8
31
|
return _jsx(_Fragment, {});
|
|
9
32
|
switch (formStyle.type) {
|
|
10
33
|
case FormStyleTypes.MATERIAL:
|
|
11
34
|
default: {
|
|
12
|
-
return _jsx(MaterialCollapsibleStep, { step: step,
|
|
35
|
+
return _jsx(MaterialCollapsibleStep, __assign({ step: step }, others));
|
|
13
36
|
}
|
|
14
37
|
}
|
|
15
38
|
}
|
|
@@ -1,58 +1,88 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
1
23
|
import { createElement as _createElement } from "react";
|
|
2
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
25
|
import React, { useContext, useEffect, useState } from 'react';
|
|
4
26
|
import styles from './MaterialCollapsibleStep.module.css';
|
|
5
27
|
import { Controller, useFormContext } from 'react-hook-form';
|
|
6
28
|
import StepComponent from '../../Step';
|
|
29
|
+
import ExpandMoreRoundedIcon from '@material-ui/icons/ExpandMoreRounded';
|
|
30
|
+
import ExpandLessRoundedIcon from '@material-ui/icons/ExpandLessRounded';
|
|
7
31
|
import FormContext from '../../../Contexts/FormContext';
|
|
8
32
|
import { useAppSelector } from '../../../hooks';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
useEffect(()
|
|
18
|
-
|
|
33
|
+
function Collapsible(_a) {
|
|
34
|
+
var _b, _c, _d;
|
|
35
|
+
var step = _a.step, open = _a.open, setOpen = _a.setOpen, others = __rest(_a, ["step", "open", "setOpen"]);
|
|
36
|
+
var _e = useState(true), firstTime = _e[0], setFirstTime = _e[1];
|
|
37
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
38
|
+
var form = useContext(FormContext);
|
|
39
|
+
var errors = useFormContext().formState.errors;
|
|
40
|
+
var contentRef = React.useRef(null);
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
var _a;
|
|
43
|
+
if (!open && ((_a = step.dependencies) === null || _a === void 0 ? void 0 : _a.find(function (dep) { return !!errors[dep]; }))) {
|
|
19
44
|
setOpen(true);
|
|
20
45
|
}
|
|
21
|
-
}, step.dependencies
|
|
22
|
-
return (_jsxs("div", { style: { maxWidth: '100%' }, children: [_jsxs("div", { className: styles.container, style: {
|
|
46
|
+
}, (_c = (_b = step.dependencies) === null || _b === void 0 ? void 0 : _b.map(function (dep) { return errors[dep]; })) !== null && _c !== void 0 ? _c : []);
|
|
47
|
+
return (_jsxs("div", __assign({ style: { maxWidth: '100%' } }, { children: [_jsxs("div", __assign({ className: styles.container, style: {
|
|
23
48
|
color: formStyle.textColor,
|
|
24
49
|
borderColor: formStyle.primaryColor,
|
|
25
|
-
}, children: [_jsx("div", { className: styles.collapsibleLabel, onClick: ()
|
|
50
|
+
} }, { children: [_jsx("div", __assign({ className: styles.collapsibleLabel, onClick: function () {
|
|
26
51
|
if (firstTime)
|
|
27
52
|
setFirstTime(false);
|
|
28
53
|
setOpen(!open);
|
|
29
|
-
}, children: step.label }), _jsx("div", { className: styles.expand, onClick: ()
|
|
54
|
+
} }, { children: step.label })), _jsx("div", __assign({ className: styles.expand, onClick: function () {
|
|
30
55
|
if (firstTime)
|
|
31
56
|
setFirstTime(false);
|
|
32
57
|
setOpen(!open);
|
|
33
|
-
}, children: _jsx("div", { className: styles.expandIcon, children: open ? (_jsx(
|
|
58
|
+
} }, { children: _jsx("div", __assign({ className: styles.expandIcon }, { children: open ? (_jsx(ExpandLessRoundedIcon, { fontSize: "inherit" })) : (_jsx(ExpandMoreRoundedIcon, { fontSize: "inherit" })) })) }))] })), _jsx("div", __assign({ className: styles.content, style: {
|
|
34
59
|
height: open
|
|
35
60
|
? firstTime
|
|
36
61
|
? 'auto'
|
|
37
|
-
: contentRef.current
|
|
62
|
+
: (_d = contentRef.current) === null || _d === void 0 ? void 0 : _d.offsetHeight
|
|
38
63
|
: 0,
|
|
39
|
-
}, children: _jsx("div", { className: styles.contentContainer, ref: contentRef, children: step.steps.map((idSubStep)
|
|
40
|
-
|
|
41
|
-
return (_createElement(StepComponent, {
|
|
42
|
-
}) }) }), _jsx("div", { className: styles.separator, style: {
|
|
64
|
+
} }, { children: _jsx("div", __assign({ className: styles.contentContainer, ref: contentRef }, { children: step.steps.map(function (idSubStep) {
|
|
65
|
+
var subStep = form.steps[idSubStep];
|
|
66
|
+
return (_createElement(StepComponent, __assign({}, others, { step: subStep, key: idSubStep })));
|
|
67
|
+
}) })) })), _jsx("div", { className: styles.separator, style: {
|
|
43
68
|
backgroundColor: formStyle.primaryColor,
|
|
44
|
-
} })] }));
|
|
69
|
+
} })] })));
|
|
45
70
|
}
|
|
46
71
|
function CollapsibleStep(props) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
var _a;
|
|
73
|
+
var postview = useAppSelector(function (state) { return state.global; }).postview;
|
|
74
|
+
var _b = useFormContext(), clearErrors = _b.clearErrors, errors = _b.formState.errors;
|
|
75
|
+
return (_jsx(Controller, { name: props.step.id, defaultValue: (_a = props.step.defaultValue) !== null && _a !== void 0 ? _a : (postview ? false : true), render: function (_a) {
|
|
76
|
+
var _b = _a.field, value = _b.value, onChange = _b.onChange;
|
|
77
|
+
return (_jsx(Collapsible, __assign({}, props, { open: value, setOpen: function (open) {
|
|
78
|
+
var _a;
|
|
79
|
+
if (!open) {
|
|
80
|
+
var deps = (_a = props.step.dependencies) === null || _a === void 0 ? void 0 : _a.filter(function (dep) { return !!errors[dep]; });
|
|
81
|
+
if (deps)
|
|
82
|
+
clearErrors(deps);
|
|
83
|
+
}
|
|
84
|
+
onChange(open);
|
|
85
|
+
} })));
|
|
86
|
+
} }));
|
|
57
87
|
}
|
|
58
88
|
export default CollapsibleStep;
|
|
@@ -1,24 +1,38 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
1
23
|
import FormContext from '../Contexts/FormContext';
|
|
2
24
|
import { useAppSelector } from '../hooks';
|
|
3
25
|
import CustomStepPropsContext from '../Contexts/CustomContext';
|
|
4
26
|
import { useContext } from 'react';
|
|
5
27
|
import { useStepDependency } from './StepHooks';
|
|
6
|
-
function CustomStepComponent(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
...dependencyInfo,
|
|
16
|
-
...props,
|
|
17
|
-
dependencyStore,
|
|
18
|
-
widthStats,
|
|
19
|
-
form,
|
|
20
|
-
customStepProps,
|
|
21
|
-
...customProps,
|
|
22
|
-
});
|
|
28
|
+
function CustomStepComponent(_a) {
|
|
29
|
+
var customComponent = _a.customComponent, _b = _a.customProps, customProps = _b === void 0 ? {} : _b, props = __rest(_a, ["customComponent", "customProps"]);
|
|
30
|
+
var form = useContext(FormContext);
|
|
31
|
+
var global = useAppSelector(function (state) { return state.global; });
|
|
32
|
+
var customStepProps = useContext(CustomStepPropsContext).customStepProps;
|
|
33
|
+
var dependencyStore = useAppSelector(function (state) { return state.site.dependencies; });
|
|
34
|
+
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
35
|
+
var dependencyInfo = useStepDependency(props.step, undefined);
|
|
36
|
+
return customComponent(__assign(__assign(__assign(__assign(__assign({}, global), dependencyInfo), props), { dependencyStore: dependencyStore, widthStats: widthStats, form: form, customStepProps: customStepProps }), customProps));
|
|
23
37
|
}
|
|
24
38
|
export default CustomStepComponent;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DatePicker } from '../../@Types/FormStep';
|
|
2
3
|
import { StepProps } from '../Step';
|
|
3
4
|
export interface DatePickerStepProps extends StepProps {
|
|
4
5
|
/** The DatePickerStep to display */
|
|
5
6
|
step: DatePicker;
|
|
6
7
|
/** Default value to display */
|
|
7
|
-
defaultValue?:
|
|
8
|
+
defaultValue?: Date | null;
|
|
8
9
|
}
|
|
9
10
|
declare function DatePickerStep(props: DatePickerStepProps): JSX.Element;
|
|
10
11
|
export default DatePickerStep;
|
|
@@ -1,13 +1,24 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
13
|
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
3
14
|
import MaterialDatePickerStep from './MaterialDatePickerStep/MaterialDatePickerStep';
|
|
4
15
|
import { useAppSelector } from '../../hooks';
|
|
5
16
|
function DatePickerStep(props) {
|
|
6
|
-
|
|
17
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
7
18
|
switch (formStyle.type) {
|
|
8
19
|
case FormStyleTypes.MATERIAL:
|
|
9
20
|
default: {
|
|
10
|
-
return _jsx(MaterialDatePickerStep, {
|
|
21
|
+
return _jsx(MaterialDatePickerStep, __assign({}, props));
|
|
11
22
|
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DatePickerStepProps } from '../DatePickerStep';
|
|
2
|
-
declare function DatePickerStep({ step, editable, defaultValue }: DatePickerStepProps): JSX.Element;
|
|
3
|
+
declare function DatePickerStep({ step, editable, defaultValue, }: DatePickerStepProps): JSX.Element;
|
|
3
4
|
export default DatePickerStep;
|
|
@@ -1,18 +1,29 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
13
|
+
import RoundedDatePicker from '../../../Shared/RoundedDatePicker/RoundedDatePicker';
|
|
3
14
|
import { useAppSelector } from '../../../hooks';
|
|
4
15
|
import { useFormStep } from '../../StepHooks';
|
|
5
16
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
function DatePickerStep(_a) {
|
|
18
|
+
var _b;
|
|
19
|
+
var step = _a.step, editable = _a.editable, defaultValue = _a.defaultValue;
|
|
20
|
+
var _c = useAppSelector(function (state) { return state.global; }), formStyle = _c.formStyle, postview = _c.postview;
|
|
21
|
+
var _d = useFormStep(step, {
|
|
22
|
+
defaultValue: defaultValue,
|
|
11
23
|
rules: {
|
|
12
24
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
13
25
|
},
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
return (_jsx(MaterialInputContainer, { step: step, editable: editable, children: _jsx(ErkDatePicker, { ...field, value: value ? new Date(value) : null, inputRef: ref, error: !!error, labelMargin: 0, label: step.label, onChange: handleChange, pickTime: step.pickTime, required: step.required, readOnly: !editable || postview, helperText: error?.message ?? step.description }) }));
|
|
26
|
+
}), ref = _d.ref, value = _d.value, onChange = _d.onChange, error = _d.error, field = _d.field;
|
|
27
|
+
return (_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedDatePicker, __assign({}, field, { value: value, onChange: onChange, pickTime: step.pickTime, clearable: !step.required, clearLabel: "Borrar", inputRef: ref, cantEdit: !editable || postview, secondaryColor: formStyle.secondaryColor, contrastColor: formStyle.secondaryContrastColor, accentColor: formStyle.textColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, helperTextColor: formStyle.descriptionTextColor, fontWeight: 400, label: step.label, helperText: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : step.description, error: !!error, required: step.required })) })));
|
|
17
28
|
}
|
|
18
29
|
export default DatePickerStep;
|