@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,3 +1,25 @@
|
|
|
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 { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
24
|
import styles from './MaterialTextAreaStep.module.css';
|
|
3
25
|
import { useController } from 'react-hook-form';
|
|
@@ -5,108 +27,124 @@ import { Editor } from 'react-draft-wysiwyg'; //Load programatically only if ste
|
|
|
5
27
|
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
|
|
6
28
|
import './DraftEditor.css';
|
|
7
29
|
import { useCallback, useState } from 'react';
|
|
30
|
+
import { ClickAwayListener } from '@material-ui/core';
|
|
8
31
|
import { useAppSelector } from '../../../hooks';
|
|
9
32
|
import { useStepDependency } from '../../StepHooks';
|
|
10
33
|
import { EditorState, convertFromRaw } from 'draft-js';
|
|
11
34
|
import { getRawText } from '../../../Utils/DraftFunctions';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
function TextAreaStep(_a) {
|
|
36
|
+
var _b;
|
|
37
|
+
var step = _a.step, editable = _a.editable;
|
|
38
|
+
var _c = useAppSelector(function (state) { return state.global; }), formStyle = _c.formStyle, postview = _c.postview;
|
|
39
|
+
var _d = useState(false), hovering = _d[0], setHovering = _d[1];
|
|
40
|
+
var _e = useState(false), focus = _e[0], setFocus = _e[1];
|
|
41
|
+
var _f = useState(), timer = _f[0], setTimer = _f[1];
|
|
42
|
+
var _g = useStepDependency(step, getRawText()), handleStepDep = _g.handleStepDep, originalValue = _g.originalValue, isDependency = _g.isDependency;
|
|
43
|
+
var _h = useController({
|
|
20
44
|
name: step.id,
|
|
21
45
|
shouldUnregister: true,
|
|
22
46
|
rules: step.required
|
|
23
47
|
? {
|
|
24
|
-
validate: (editorState)
|
|
48
|
+
validate: function (editorState) {
|
|
49
|
+
return editorState.getCurrentContent().hasText();
|
|
50
|
+
},
|
|
25
51
|
}
|
|
26
52
|
: {},
|
|
27
53
|
defaultValue: EditorState.createWithContent(convertFromRaw(originalValue)),
|
|
28
|
-
});
|
|
29
|
-
|
|
54
|
+
}), _j = _h.field, ref = _j.ref, onChange = _j.onChange, field = __rest(_j, ["ref", "onChange"]), error = _h.fieldState.error;
|
|
55
|
+
var handleChange = useCallback(function (value) {
|
|
30
56
|
if (isDependency) {
|
|
31
|
-
|
|
32
|
-
|
|
57
|
+
try {
|
|
58
|
+
clearTimeout(timer);
|
|
59
|
+
// eslint-disable-next-line no-empty
|
|
60
|
+
}
|
|
61
|
+
catch (e) { }
|
|
62
|
+
setTimer(setTimeout(function () {
|
|
33
63
|
handleStepDep(value.getCurrentContent().getPlainText());
|
|
34
64
|
setTimer(undefined);
|
|
35
65
|
}, 1000));
|
|
36
66
|
}
|
|
37
67
|
onChange(value);
|
|
38
68
|
}, [handleStepDep, isDependency, onChange]);
|
|
39
|
-
|
|
40
|
-
|
|
69
|
+
var calcStyle = function () {
|
|
70
|
+
var backgroundColor = formStyle.stepBackgroundColor;
|
|
41
71
|
if (focus) {
|
|
42
72
|
return {
|
|
43
73
|
border: '2px solid ' + formStyle.primaryColor,
|
|
44
74
|
marginTop: -1,
|
|
45
75
|
marginLeft: -1,
|
|
46
76
|
marginBottom: 0,
|
|
47
|
-
backgroundColor,
|
|
77
|
+
backgroundColor: backgroundColor,
|
|
48
78
|
};
|
|
49
79
|
}
|
|
50
80
|
else if (hovering) {
|
|
51
81
|
return {
|
|
52
82
|
border: '1px solid ' + formStyle.primaryColor,
|
|
53
|
-
backgroundColor,
|
|
83
|
+
backgroundColor: backgroundColor,
|
|
54
84
|
};
|
|
55
85
|
}
|
|
56
86
|
else {
|
|
57
87
|
return {
|
|
58
88
|
border: '1px solid ' + formStyle.outlineColor,
|
|
59
|
-
backgroundColor,
|
|
89
|
+
backgroundColor: backgroundColor,
|
|
60
90
|
};
|
|
61
91
|
}
|
|
62
92
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
93
|
+
var canEdit = editable && !postview;
|
|
94
|
+
var value = field.value;
|
|
95
|
+
var editorClassName = styles.editor;
|
|
66
96
|
if (!value.getCurrentContent().hasText()) {
|
|
67
|
-
if (value.getCurrentContent().getBlockMap().first().getType() !==
|
|
97
|
+
if (value.getCurrentContent().getBlockMap().first().getType() !==
|
|
98
|
+
'unstyled') {
|
|
68
99
|
editorClassName += ' RichEditor-hidePlaceholder';
|
|
69
100
|
}
|
|
70
101
|
}
|
|
71
102
|
if (!canEdit) {
|
|
72
103
|
editorClassName += ' postview-editor';
|
|
73
104
|
}
|
|
74
|
-
return (_jsxs("div", { className: styles.textEditorContainer, style: {
|
|
105
|
+
return (_jsxs("div", __assign({ className: styles.textEditorContainer, style: {
|
|
75
106
|
'--eureka-outline': formStyle.outlineColor,
|
|
76
107
|
'--eureka-primary': formStyle.primaryColor,
|
|
77
|
-
}, children: [step.label && (_jsxs("div", { className: styles.textEditorLabel, style: {
|
|
78
|
-
color: error
|
|
79
|
-
|
|
108
|
+
} }, { children: [step.label && (_jsxs("div", __assign({ className: styles.textEditorLabel, style: {
|
|
109
|
+
color: error
|
|
110
|
+
? formStyle.errorColor
|
|
111
|
+
: formStyle.textColor,
|
|
112
|
+
} }, { children: [step.label, " ", step.required ? ' *' : ''] }))), _jsx(ClickAwayListener, __assign({ mouseEvent: "onMouseDown", onClickAway: function () {
|
|
80
113
|
if (canEdit) {
|
|
81
114
|
setFocus(false);
|
|
82
115
|
}
|
|
83
|
-
}, children: _jsx("div", { className: postview
|
|
84
|
-
? styles.postViewContainer + '
|
|
85
|
-
: styles.textContainer + '
|
|
116
|
+
} }, { children: _jsx("div", __assign({ className: postview
|
|
117
|
+
? styles.postViewContainer + ' EF-DraftContainer'
|
|
118
|
+
: styles.textContainer + ' EF-DraftContainer', style: calcStyle(), onMouseEnter: function () {
|
|
86
119
|
if (canEdit) {
|
|
87
120
|
setHovering(true);
|
|
88
121
|
}
|
|
89
|
-
}, onMouseLeave: ()
|
|
122
|
+
}, onMouseLeave: function () {
|
|
90
123
|
if (canEdit) {
|
|
91
124
|
setHovering(false);
|
|
92
125
|
}
|
|
93
|
-
}, onClick: ()
|
|
126
|
+
}, onClick: function () {
|
|
94
127
|
if (canEdit) {
|
|
95
128
|
setFocus(true);
|
|
96
129
|
}
|
|
97
|
-
}, "data-testid": step.id, children: _jsx(Editor, {
|
|
130
|
+
}, "data-testid": step.id }, { children: _jsx(Editor, __assign({}, field, { editorRef: ref, onFocus: function () {
|
|
98
131
|
setFocus(true);
|
|
99
|
-
}, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange: handleChange, toolbarClassName: !canEdit ? ' postview-editor-toolbar' : '', editorState: value, editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: step.description
|
|
132
|
+
}, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange: handleChange, toolbarClassName: !canEdit ? ' postview-editor-toolbar' : '', editorState: value, editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
|
|
100
133
|
options: ['inline', 'list', 'history'],
|
|
101
134
|
inline: {
|
|
102
|
-
options: [
|
|
135
|
+
options: [
|
|
136
|
+
'bold',
|
|
137
|
+
'italic',
|
|
138
|
+
'underline',
|
|
139
|
+
'strikethrough',
|
|
140
|
+
],
|
|
103
141
|
},
|
|
104
142
|
list: {
|
|
105
143
|
options: ['unordered'],
|
|
106
144
|
},
|
|
107
|
-
} }) }) }), _jsx("div", { className: styles.errorMsg, style: {
|
|
145
|
+
} })) })) })), _jsx("div", __assign({ className: styles.errorMsg, style: {
|
|
108
146
|
color: formStyle.errorColor,
|
|
109
147
|
height: !postview && editable ? '0.75rem' : 0,
|
|
110
|
-
}, children: !!error && 'Este campo es obligatorio' })] }));
|
|
148
|
+
} }, { children: !!error && 'Este campo es obligatorio' }))] })));
|
|
111
149
|
}
|
|
112
150
|
export default TextAreaStep;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TextAreaStepProps } from '../TextAreaStep';
|
|
2
3
|
export interface Payload {
|
|
3
4
|
text: string;
|
|
4
5
|
draft: any;
|
|
5
6
|
}
|
|
6
|
-
declare function TextAreaStep({ step, editable, maxLength }: TextAreaStepProps): JSX.Element;
|
|
7
|
+
declare function TextAreaStep({ step, editable, maxLength, }: TextAreaStepProps): JSX.Element;
|
|
7
8
|
export default TextAreaStep;
|
|
@@ -1,31 +1,47 @@
|
|
|
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
|
-
import
|
|
13
|
+
import RoundedTextField from '../../../Shared/RoundedTextField/RoundedTextField';
|
|
3
14
|
import styles from './MaterialTextAreaStep.module.css';
|
|
4
15
|
import React from 'react';
|
|
5
16
|
import { useAppSelector } from '../../../hooks';
|
|
6
17
|
import { useFormStep } from '../../StepHooks';
|
|
7
|
-
function TextAreaStep(
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
function TextAreaStep(_a) {
|
|
19
|
+
var _b, _c;
|
|
20
|
+
var step = _a.step, editable = _a.editable, maxLength = _a.maxLength;
|
|
21
|
+
var _d = useAppSelector(function (state) { return state.global; }), formStyle = _d.formStyle, postview = _d.postview, partial = _d.partial;
|
|
22
|
+
var _e = useFormStep(step, {
|
|
10
23
|
debounce: true,
|
|
11
24
|
defaultValue: '',
|
|
12
25
|
rules: {
|
|
13
26
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
14
27
|
},
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
}), ref = _e.ref, value = _e.value, onChange = _e.onChange, error = _e.error, field = _e.field;
|
|
29
|
+
var canEdit = editable && !postview;
|
|
30
|
+
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
31
|
+
paddingBottom: step.required || step.description || !!error
|
|
32
|
+
? '0px'
|
|
33
|
+
: '5px',
|
|
34
|
+
} }, { children: [_jsx("div", __assign({ className: styles.erkTextArea }, { children: _jsx(RoundedTextField, __assign({}, field, { inputRef: ref, value: value, onChange: function (e) { return onChange(e.target.value); }, "data-testid": step.id, maxLength: maxLength, label: step.label, required: step.required, cantEdit: !canEdit, fontWeight: 400, multiline: true, minRows: postview && partial ? undefined : 4, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.stepBackgroundColor, helperTextColor: formStyle.descriptionTextColor, helperText: (_c = (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : step.description) !== null && _c !== void 0 ? _c : (step.required ? ' ' : null), error: !!error })) })), _jsxs("div", __assign({ className: styles.print }, { children: [value && (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.printLbl, style: {
|
|
19
35
|
color: formStyle.descriptionTextColor,
|
|
20
|
-
}, children: step.label }), _jsx("div", { className: styles.printLine, style: {
|
|
36
|
+
} }, { children: step.label })), _jsx("div", __assign({ className: styles.printLine, style: {
|
|
21
37
|
color: formStyle.stepBackgroundColor,
|
|
22
38
|
backgroundColor: formStyle.stepBackgroundColor,
|
|
23
|
-
}, children: step.label })] })), !value && (_jsx("div", { className: styles.emptyPrintLbl, style: {
|
|
39
|
+
} }, { children: step.label }))] })), !value && (_jsx("div", __assign({ className: styles.emptyPrintLbl, style: {
|
|
24
40
|
color: formStyle.textColor + '8a',
|
|
25
|
-
}, children: step.label })), _jsx("p", { className: styles.printContainer, style: {
|
|
41
|
+
} }, { children: step.label }))), _jsx("p", __assign({ className: styles.printContainer, style: {
|
|
26
42
|
backgroundColor: formStyle.stepBackgroundColor,
|
|
27
43
|
borderColor: formStyle.outlineColor,
|
|
28
44
|
whiteSpace: 'pre-wrap',
|
|
29
|
-
}, children: value })] })] }));
|
|
45
|
+
} }, { children: value }))] }))] })));
|
|
30
46
|
}
|
|
31
47
|
export default TextAreaStep;
|
|
@@ -1,17 +1,28 @@
|
|
|
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 { useAppSelector } from '../../hooks';
|
|
3
14
|
import { FormStyleTypes } from '../../constants/FormStepTypes';
|
|
4
15
|
import MaterialTextAreaStep from './MaterialTextAreaStep/MaterialTextAreaStep';
|
|
5
16
|
import MaterialTextAreaEditorStep from './MaterialTextAreaStep/MaterialTextAreaEditorStep';
|
|
6
17
|
function TextAreaStep(props) {
|
|
7
|
-
|
|
18
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
8
19
|
switch (formStyle.type) {
|
|
9
20
|
case FormStyleTypes.MATERIAL:
|
|
10
21
|
default: {
|
|
11
22
|
if (props.step.hasTextEditor)
|
|
12
|
-
return _jsx(MaterialTextAreaEditorStep, {
|
|
23
|
+
return _jsx(MaterialTextAreaEditorStep, __assign({}, props));
|
|
13
24
|
else
|
|
14
|
-
return _jsx(MaterialTextAreaStep, {
|
|
25
|
+
return _jsx(MaterialTextAreaStep, __assign({}, props));
|
|
15
26
|
}
|
|
16
27
|
}
|
|
17
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TextInputStepProps } from '../TextInputStep';
|
|
2
|
-
declare function TextInputStep({ step, editable, maxLength,
|
|
3
|
+
declare function TextInputStep({ icon, step, editable, maxLength, defaultValue, validation, }: TextInputStepProps): JSX.Element;
|
|
3
4
|
export default TextInputStep;
|
|
@@ -1,17 +1,30 @@
|
|
|
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 RoundedTextField from '../../../Shared/RoundedTextField/RoundedTextField';
|
|
3
14
|
import styles from './MaterialTextInputStep.module.css';
|
|
4
15
|
import { calcStepWidth } from '../../StepFunctions';
|
|
5
16
|
import { useContext } from 'react';
|
|
6
17
|
import FormContext from '../../../Contexts/FormContext';
|
|
7
18
|
import { selectBreakPoint, useAppSelector } from '../../../hooks';
|
|
8
19
|
import { useFormStep } from '../../StepHooks';
|
|
9
|
-
function TextInputStep(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
function TextInputStep(_a) {
|
|
21
|
+
var _b;
|
|
22
|
+
var icon = _a.icon, step = _a.step, editable = _a.editable, maxLength = _a.maxLength, _c = _a.defaultValue, defaultValue = _c === void 0 ? step.defaultValue : _c, _d = _a.validation, validation = _d === void 0 ? step.validation : _d;
|
|
23
|
+
var currentBreakPoint = useAppSelector(selectBreakPoint);
|
|
24
|
+
var _e = useAppSelector(function (state) { return state.global; }), formStyle = _e.formStyle, postview = _e.postview;
|
|
25
|
+
var form = useContext(FormContext);
|
|
26
|
+
var _f = useFormStep(step, {
|
|
27
|
+
defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : '',
|
|
15
28
|
debounce: true,
|
|
16
29
|
rules: {
|
|
17
30
|
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
@@ -25,10 +38,15 @@ function TextInputStep({ step, editable, maxLength, IconComponent, defaultValue
|
|
|
25
38
|
}
|
|
26
39
|
: undefined,
|
|
27
40
|
},
|
|
28
|
-
});
|
|
29
|
-
return (_jsx("div", { className: styles.container, style: {
|
|
30
|
-
width: currentBreakPoint <= step.size
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
}), ref = _f.ref, value = _f.value, onChange = _f.onChange, error = _f.error, field = _f.field;
|
|
42
|
+
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
43
|
+
width: currentBreakPoint <= step.size
|
|
44
|
+
? '100%'
|
|
45
|
+
: calcStepWidth(step.size, form.size),
|
|
46
|
+
minHeight: step.description ||
|
|
47
|
+
(!postview && editable && (step.required || validation))
|
|
48
|
+
? '55px'
|
|
49
|
+
: '43px',
|
|
50
|
+
} }, { children: _jsx(RoundedTextField, __assign({}, field, { inputRef: ref, value: value, onChange: function (e) { return onChange(e.target.value); }, maxLength: maxLength, "data-testid": step.id, label: step.label, cantEdit: !editable || postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.stepBackgroundColor, helperText: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : step.description, helperTextColor: formStyle.descriptionTextColor, error: !!error, icon: step.showIcon ? icon : undefined })) })));
|
|
33
51
|
}
|
|
34
52
|
export default TextInputStep;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TextInput } from '../../@Types/FormStep';
|
|
2
3
|
import { StepProps } from '../Step';
|
|
3
4
|
export interface TextInputStepProps extends StepProps {
|
|
4
5
|
/** The TextInputStep to display */
|
|
5
6
|
step: TextInput;
|
|
6
7
|
/** The icon to display */
|
|
7
|
-
|
|
8
|
+
icon?: React.ReactNode;
|
|
8
9
|
/** Default value to display */
|
|
9
10
|
defaultValue?: string;
|
|
10
11
|
/** Custom Validation to display */
|
|
@@ -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 MaterialTextInputStep from './MaterialTextInputStep/MaterialTextInputStep';
|
|
4
15
|
import { useAppSelector } from '../../hooks';
|
|
5
16
|
function TextInputStep(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(MaterialTextInputStep, {
|
|
21
|
+
return _jsx(MaterialTextInputStep, __assign({}, props));
|
|
11
22
|
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TimePickerStepProps } from '../TimePickerStep';
|
|
2
|
-
declare function TimePickerStep({ step, editable, defaultValue }: TimePickerStepProps): JSX.Element;
|
|
3
|
+
declare function TimePickerStep({ step, editable, defaultValue, }: TimePickerStepProps): JSX.Element;
|
|
3
4
|
export default TimePickerStep;
|
|
@@ -1,23 +1,40 @@
|
|
|
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 RoundedTimePicker from '../../../Shared/RoundedTimePicker/RoundedTimePicker';
|
|
3
14
|
import { useAppSelector } from '../../../hooks';
|
|
4
15
|
import { useFormStep } from '../../StepHooks';
|
|
5
16
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
6
|
-
function TimePickerStep(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
17
|
+
function TimePickerStep(_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,
|
|
10
23
|
rules: {
|
|
11
|
-
validate: (value)
|
|
24
|
+
validate: function (value) {
|
|
12
25
|
if (step.required) {
|
|
13
|
-
if (!value ||
|
|
26
|
+
if (!value ||
|
|
27
|
+
!(value.hours ||
|
|
28
|
+
value.minutes ||
|
|
29
|
+
value.days ||
|
|
30
|
+
value.working !== undefined)) {
|
|
14
31
|
return 'Este campo es obligatorio';
|
|
15
32
|
}
|
|
16
33
|
}
|
|
17
34
|
return true;
|
|
18
35
|
},
|
|
19
36
|
},
|
|
20
|
-
});
|
|
21
|
-
return (_jsx(MaterialInputContainer, { step: step, editable: editable, children: _jsx(
|
|
37
|
+
}), ref = _d.ref, value = _d.value, onChange = _d.onChange, error = _d.error, field = _d.field;
|
|
38
|
+
return (_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedTimePicker, __assign({}, field, { value: value, onChange: onChange, inputRef: ref, cantEdit: !editable || postview, errorColor: formStyle.errorColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, helperTextColor: formStyle.descriptionTextColor, backgroundColor: formStyle.stepBackgroundColor, fontWeight: 400, height: '31px', containerMargin: "0px", 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, pickDays: step.pickDays, minDays: step.minDays, maxDays: step.maxDays, pickHours: step.pickHours, minHours: step.minHours, maxHours: step.maxHours, pickMinutes: step.pickMinutes, minMinutes: step.minMinutes, maxMinutes: step.maxMinutes, working: step.working })) })));
|
|
22
39
|
}
|
|
23
40
|
export default TimePickerStep;
|
|
@@ -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 { useAppSelector } from '../../hooks';
|
|
4
15
|
import MaterialTimePickerStep from './MaterialTimePickerStep/MaterialTimePickerStep';
|
|
5
16
|
function TimePickerStep(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(MaterialTimePickerStep, {
|
|
21
|
+
return _jsx(MaterialTimePickerStep, __assign({}, props));
|
|
11
22
|
}
|
|
12
23
|
}
|
|
13
24
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
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
|
+
};
|
|
1
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
22
|
import { calcStepWidth } from '../../StepFunctions';
|
|
3
23
|
import styles from './MaterialTitleStep.module.css';
|
|
@@ -8,36 +28,49 @@ import { selectDependencies, useFormStep } from '../../StepHooks';
|
|
|
8
28
|
import { stringToDraft } from '../../../Utils/DraftFunctions';
|
|
9
29
|
import SmartDraftRenderer from '../../../Shared/SmartDraftRenderer/SmartDraftRenderer';
|
|
10
30
|
//**Pendientes a mejorar, esperar antes de enviar, en local (actividades), usar el value envez de el draft en actividades, esperar a que dejen de escribir, optimizar para que use lo que tiene en local y si necesita ahi si pregunte. */
|
|
11
|
-
function TitleStep(
|
|
12
|
-
|
|
31
|
+
function TitleStep(_a) {
|
|
32
|
+
var _b;
|
|
33
|
+
var step = _a.step;
|
|
34
|
+
var _c = useFormStep(step, {
|
|
13
35
|
defaultValue: undefined,
|
|
36
|
+
}), value = _c.value, onChange = _c.onChange;
|
|
37
|
+
var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
|
|
38
|
+
var form = useContext(FormContext);
|
|
39
|
+
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
40
|
+
var size = (_b = step.size) !== null && _b !== void 0 ? _b : form.size.blockNum;
|
|
41
|
+
var title = useMemo(function () { var _a; return calcBaseDraft((_a = value === null || value === void 0 ? void 0 : value.title) !== null && _a !== void 0 ? _a : step.title); }, //Usa por defecto lo que venga en el value, pero no escucha cambios
|
|
42
|
+
[step.title]);
|
|
43
|
+
var description = useMemo(function () { var _a; return calcBaseDraft((_a = value === null || value === void 0 ? void 0 : value.description) !== null && _a !== void 0 ? _a : step.description); }, //Usa por defecto lo que venga en el value, pero no escucha cambios
|
|
44
|
+
[step.description]);
|
|
45
|
+
var dependencies = useAppSelector(function (state) {
|
|
46
|
+
return selectDependencies(state, step.dependencies);
|
|
14
47
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[step.title, value?.title]);
|
|
21
|
-
const description = useMemo(() => calcBaseDraft(value?.description ?? step.description), //Usa por defecto lo que venga en el value, pero no escucha cambios
|
|
22
|
-
[step.description, value?.description]);
|
|
23
|
-
const dependencies = useAppSelector((state) => selectDependencies(state, step.dependencies));
|
|
24
|
-
const values = useMemo(() => {
|
|
25
|
-
const values = {};
|
|
26
|
-
for (const { idOriginal, value } of Object.values(dependencies)) {
|
|
27
|
-
values[idOriginal] = value;
|
|
48
|
+
var values = useMemo(function () {
|
|
49
|
+
var values = {};
|
|
50
|
+
for (var _i = 0, _a = Object.values(dependencies); _i < _a.length; _i++) {
|
|
51
|
+
var _b = _a[_i], idOriginal = _b.idOriginal, value_1 = _b.value;
|
|
52
|
+
values[idOriginal] = value_1;
|
|
28
53
|
}
|
|
29
54
|
return values;
|
|
30
55
|
}, [dependencies]);
|
|
31
|
-
return (
|
|
56
|
+
var path = useMemo(function () { return __spreadArray(__spreadArray([], step.stepPath, true), [step.id], false).join('.'); }, [step.stepPath, step.id]);
|
|
57
|
+
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
32
58
|
color: formStyle.textColor,
|
|
33
|
-
width: widthStats.currentBreakPoint <= size
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
width: widthStats.currentBreakPoint <= size
|
|
60
|
+
? '100%'
|
|
61
|
+
: calcStepWidth(size, form.size),
|
|
62
|
+
} }, { children: [_jsx("div", __assign({ className: styles.titleLbl, style: {
|
|
63
|
+
textAlign: widthStats.isMobile &&
|
|
64
|
+
widthStats.currentBreakPoint <= size
|
|
65
|
+
? 'center'
|
|
66
|
+
: 'start',
|
|
67
|
+
} }, { children: _jsx(SmartDraftRenderer, { draft: title, dependencies: values, property: "".concat(path, ".title"), onChange: function (title) { return onChange(__assign(__assign({}, value), { title: title })); } }) })), _jsx("div", __assign({ className: styles.descriptionPar }, { children: _jsx(SmartDraftRenderer, { draft: description, dependencies: values, margin: title ? '10px 0px' : '0px 0px 5px 0px', property: "".concat(path, ".description"), onChange: function (description) {
|
|
68
|
+
return onChange(__assign(__assign({}, value), { description: description }));
|
|
69
|
+
} }) }))] })));
|
|
37
70
|
}
|
|
38
71
|
export default TitleStep;
|
|
39
72
|
function calcBaseDraft(value) {
|
|
40
73
|
return typeof value === 'string'
|
|
41
74
|
? stringToDraft(value)
|
|
42
|
-
:
|
|
75
|
+
: value !== null && value !== void 0 ? value : stringToDraft('');
|
|
43
76
|
}
|