@arquimedes.co/eureka-forms 3.0.31 → 3.0.32
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 -6
- 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 +300 -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 +93 -72
- 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 -27
- 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 -160
- 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,18 +1,18 @@
|
|
|
1
1
|
import { nanoid } from '@reduxjs/toolkit';
|
|
2
|
-
import { DraftEntityDataMappingTypes, DraftEntityDataTypes } from '../constants/Draft/DraftEntityDataTypes';
|
|
2
|
+
import { DraftEntityDataMappingTypes, DraftEntityDataTypes, } from '../constants/Draft/DraftEntityDataTypes';
|
|
3
3
|
import { DraftEntityTypes } from '../constants/Draft/DraftEntityTypes';
|
|
4
4
|
import { evaluateCondition } from '../FormSteps/StepFunctions';
|
|
5
|
+
import { getLocale } from '../Form/Form';
|
|
5
6
|
import { TicketPropertyTypes } from '../constants/TicketPropertyTypes';
|
|
6
7
|
import { format } from 'date-fns';
|
|
7
8
|
import EntityPropertyTypes from '../constants/EntityPropertyTypes';
|
|
8
9
|
import FormStepTypes, { RatingTypes } from '../constants/FormStepTypes';
|
|
9
|
-
import { getLocale } from './LocaleUtils';
|
|
10
10
|
export function stringToDraft(text) {
|
|
11
|
-
|
|
11
|
+
var draftStructure = {
|
|
12
12
|
blocks: [],
|
|
13
13
|
entityMap: {},
|
|
14
14
|
};
|
|
15
|
-
text.split('\n').forEach((element, index)
|
|
15
|
+
text.split('\n').forEach(function (element, index) {
|
|
16
16
|
draftStructure.blocks.push({
|
|
17
17
|
key: String(index),
|
|
18
18
|
text: element,
|
|
@@ -25,7 +25,7 @@ export function stringToDraft(text) {
|
|
|
25
25
|
});
|
|
26
26
|
return draftStructure;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export var getRawText = function (draft, text) {
|
|
29
29
|
if (draft !== undefined) {
|
|
30
30
|
return draft;
|
|
31
31
|
}
|
|
@@ -49,28 +49,33 @@ export const getRawText = (draft, text) => {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
export function mapDraftEntities(cache, draft, mapToId
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
export function mapDraftEntities(cache, draft, mapToId) {
|
|
53
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
54
|
+
var newBlocks = [];
|
|
55
|
+
var _a = JSON.parse(JSON.stringify(draft)), blocks = _a.blocks, entityMap = _a.entityMap;
|
|
56
|
+
for (var _i = 0, blocks_1 = blocks; _i < blocks_1.length; _i++) {
|
|
57
|
+
var block = blocks_1[_i];
|
|
58
|
+
newBlocks.push.apply(newBlocks, setBlockEntities(cache, block, entityMap, mapToId));
|
|
57
59
|
}
|
|
58
|
-
return { blocks, entityMap };
|
|
60
|
+
return { blocks: blocks, entityMap: entityMap };
|
|
59
61
|
}
|
|
60
|
-
function setBlockEntities(cache, block, entityMap, mapToId
|
|
62
|
+
function setBlockEntities(cache, block, entityMap, mapToId) {
|
|
63
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
61
64
|
//Con esta funcion saca el texto remplazado de la entidad
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
for (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
var entities = block.entityRanges.sort(function (s1, s2) { return s2.offset - s1.offset; });
|
|
66
|
+
var newEntities = [];
|
|
67
|
+
for (var _i = 0, entities_1 = entities; _i < entities_1.length; _i++) {
|
|
68
|
+
var entity = entities_1[_i];
|
|
69
|
+
var styles = block.inlineStyleRanges.sort(function (s1, s2) { return s2.offset - s1.offset; });
|
|
70
|
+
var entityEnd = entity.offset + entity.length - 1;
|
|
71
|
+
var entityData = entityMap[entity.key];
|
|
68
72
|
if (entityData.type === DraftEntityTypes.EUREKA) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
for (
|
|
73
|
-
|
|
73
|
+
var mappedBlock = draftEntityMapper(cache, entityData.data, mapToId);
|
|
74
|
+
var entityText = mappedBlock.text;
|
|
75
|
+
var entitySizeDelta = entityText.length - entity.length;
|
|
76
|
+
for (var _a = 0, styles_1 = styles; _a < styles_1.length; _a++) {
|
|
77
|
+
var style = styles_1[_a];
|
|
78
|
+
var styleEnd = style.offset + style.length - 1;
|
|
74
79
|
//revisa si el estilo termina después del inicio del entity, de lo contrario el estilo no se ve afectado por el entity
|
|
75
80
|
if (styleEnd > entity.offset) {
|
|
76
81
|
//si el estilo termina en la mitad del entity
|
|
@@ -78,8 +83,10 @@ function setBlockEntities(cache, block, entityMap, mapToId = false) {
|
|
|
78
83
|
style.length = entityEnd - style.offset + 1;
|
|
79
84
|
}
|
|
80
85
|
//si el estilo empieza en la mitad del entity
|
|
81
|
-
if (style.offset < entityEnd &&
|
|
82
|
-
style.
|
|
86
|
+
if (style.offset < entityEnd &&
|
|
87
|
+
style.offset > entity.offset) {
|
|
88
|
+
style.length =
|
|
89
|
+
style.length + style.offset - entity.offset;
|
|
83
90
|
style.offset = entity.offset;
|
|
84
91
|
}
|
|
85
92
|
//Ahora se modifica el style con base en el tamaño del entityText a reemplazar
|
|
@@ -94,43 +101,56 @@ function setBlockEntities(cache, block, entityMap, mapToId = false) {
|
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
103
|
//reemplaza el entity por su text
|
|
97
|
-
|
|
104
|
+
var originalBlockText = block.text;
|
|
98
105
|
block.text =
|
|
99
106
|
block.text.substring(0, entity.offset) +
|
|
100
107
|
entityText +
|
|
101
108
|
originalBlockText.substring(entityEnd + 1, originalBlockText.length);
|
|
102
|
-
block.entityRanges = block.entityRanges.filter((entity)
|
|
109
|
+
block.entityRanges = block.entityRanges.filter(function (entity) {
|
|
110
|
+
return newEntities.includes(entity.key);
|
|
111
|
+
});
|
|
103
112
|
delete entityMap[entity.key];
|
|
104
113
|
/** Add new block styles */
|
|
105
114
|
if (!mappedBlock.inlineStyleRanges)
|
|
106
115
|
continue;
|
|
107
|
-
|
|
116
|
+
var _loop_1 = function (style) {
|
|
108
117
|
style.offset += entity.offset;
|
|
109
118
|
/** Obs: no hay estilos(ya existentes) que se partan en la mitad de la entidad! */
|
|
110
119
|
/** If new style intersects with current style of same type modify the current one */
|
|
111
|
-
|
|
112
|
-
blockStyle.offset
|
|
113
|
-
|
|
120
|
+
var currentInStart = block.inlineStyleRanges.find(function (blockStyle) {
|
|
121
|
+
return blockStyle.offset <= style.offset &&
|
|
122
|
+
blockStyle.offset + blockStyle.length > style.offset &&
|
|
123
|
+
blockStyle.style === style.style;
|
|
124
|
+
});
|
|
114
125
|
if (currentInStart) {
|
|
115
126
|
//If the current style covers the new style's range, ignore it
|
|
116
|
-
if (currentInStart.offset + currentInStart.length >
|
|
117
|
-
|
|
127
|
+
if (currentInStart.offset + currentInStart.length >
|
|
128
|
+
style.offset + style.length)
|
|
129
|
+
return "continue";
|
|
118
130
|
else {
|
|
119
131
|
//Modify the current style to cover the new style's range
|
|
120
|
-
currentInStart.length =
|
|
121
|
-
|
|
132
|
+
currentInStart.length =
|
|
133
|
+
style.offset + style.length - currentInStart.offset;
|
|
134
|
+
return "continue";
|
|
122
135
|
}
|
|
123
136
|
}
|
|
124
|
-
|
|
125
|
-
blockStyle.offset
|
|
126
|
-
|
|
137
|
+
var currentInEnd = block.inlineStyleRanges.find(function (blockStyle) {
|
|
138
|
+
return blockStyle.offset < style.offset + style.length &&
|
|
139
|
+
blockStyle.offset + blockStyle.length >
|
|
140
|
+
style.offset + style.length &&
|
|
141
|
+
blockStyle.style === style.style;
|
|
142
|
+
});
|
|
127
143
|
if (currentInEnd) {
|
|
128
144
|
if (currentInEnd.offset < style.offset)
|
|
129
|
-
continue;
|
|
145
|
+
return "continue";
|
|
130
146
|
currentInEnd.offset = style.offset;
|
|
131
|
-
continue;
|
|
147
|
+
return "continue";
|
|
132
148
|
}
|
|
133
149
|
block.inlineStyleRanges.push(style);
|
|
150
|
+
};
|
|
151
|
+
for (var _b = 0, _c = mappedBlock.inlineStyleRanges; _b < _c.length; _b++) {
|
|
152
|
+
var style = _c[_b];
|
|
153
|
+
_loop_1(style);
|
|
134
154
|
}
|
|
135
155
|
//No filtrar sino cambiar? o poner en estado "Mappeado?"
|
|
136
156
|
//Actualmente el draft queda sin entityMap y sin entityRanges en los bloques. para cambiarlo quitar el delete y el filter
|
|
@@ -142,89 +162,97 @@ function setBlockEntities(cache, block, entityMap, mapToId = false) {
|
|
|
142
162
|
block.entityRanges = newEntities;
|
|
143
163
|
return [block];
|
|
144
164
|
}
|
|
145
|
-
export
|
|
146
|
-
|
|
165
|
+
export var draftEntityMapper = function (cache, entityData, mapToId) {
|
|
166
|
+
var _a;
|
|
167
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
168
|
+
if (entityData.condition &&
|
|
169
|
+
entityData.type !== DraftEntityDataTypes.CONDITION_MET) {
|
|
147
170
|
if (!evaluateCondition(entityData.condition, cache.dependencies))
|
|
148
171
|
return { text: '' };
|
|
149
172
|
}
|
|
150
|
-
|
|
151
|
-
if (!value
|
|
173
|
+
var value = entityMapper(cache, entityData, mapToId);
|
|
174
|
+
if (!(value === null || value === void 0 ? void 0 : value.text) && entityData.fallback) {
|
|
152
175
|
value = { text: entityData.fallback };
|
|
153
176
|
}
|
|
154
|
-
if (value
|
|
177
|
+
if ((value === null || value === void 0 ? void 0 : value.text) && entityData.prefix) {
|
|
155
178
|
value.text = entityData.prefix + value.text;
|
|
156
179
|
}
|
|
157
|
-
if (value
|
|
180
|
+
if ((value === null || value === void 0 ? void 0 : value.text) && entityData.suffix) {
|
|
158
181
|
value.text = value.text + entityData.suffix;
|
|
159
182
|
}
|
|
160
183
|
return {
|
|
161
|
-
text: value
|
|
162
|
-
inlineStyleRanges: value
|
|
184
|
+
text: (_a = value === null || value === void 0 ? void 0 : value.text) !== null && _a !== void 0 ? _a : '',
|
|
185
|
+
inlineStyleRanges: value === null || value === void 0 ? void 0 : value.inlineStyleRanges,
|
|
163
186
|
};
|
|
164
187
|
};
|
|
165
|
-
|
|
188
|
+
var entityMapper = function (cache, entityData, mapToId) {
|
|
189
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
190
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
166
191
|
switch (entityData.type) {
|
|
167
192
|
case DraftEntityDataTypes.CONDITION_MET: {
|
|
168
193
|
if (evaluateCondition(entityData.condition, cache.dependencies)) {
|
|
169
|
-
return { text: entityData.ifTrue
|
|
194
|
+
return { text: (_a = entityData.ifTrue) !== null && _a !== void 0 ? _a : 'Sí' };
|
|
170
195
|
}
|
|
171
|
-
return { text: entityData.ifFalse
|
|
196
|
+
return { text: (_b = entityData.ifFalse) !== null && _b !== void 0 ? _b : 'No' };
|
|
172
197
|
}
|
|
173
198
|
case DraftEntityDataMappingTypes.ENTITYVALUE_MAPPING: {
|
|
174
|
-
if (!cache
|
|
199
|
+
if (!(cache === null || cache === void 0 ? void 0 : cache.entityValue))
|
|
175
200
|
throw new Error('Invalid EntityValue Mapping');
|
|
176
|
-
|
|
201
|
+
var property = (_c = cache.entity) === null || _c === void 0 ? void 0 : _c.steps[entityData.idProperty];
|
|
177
202
|
if (!property)
|
|
178
203
|
return null;
|
|
179
|
-
|
|
180
|
-
return text ? { text } : null;
|
|
204
|
+
var text = calcEntityProperty(property, cache.entityValue[entityData.idProperty]);
|
|
205
|
+
return text ? { text: text } : null;
|
|
181
206
|
}
|
|
182
207
|
case DraftEntityDataTypes.COMPANY: {
|
|
183
|
-
|
|
208
|
+
var company = cache.company;
|
|
184
209
|
if (company) {
|
|
185
|
-
|
|
210
|
+
var property = (_d = cache.entity) === null || _d === void 0 ? void 0 : _d.steps[entityData.idProperty];
|
|
186
211
|
if (!property)
|
|
187
212
|
return null;
|
|
188
|
-
|
|
189
|
-
return text ? { text } : null;
|
|
213
|
+
var text = calcEntityProperty(property, company[entityData.idProperty]);
|
|
214
|
+
return text ? { text: text } : null;
|
|
190
215
|
}
|
|
191
216
|
break;
|
|
192
217
|
}
|
|
193
218
|
case DraftEntityDataTypes.TICKET: {
|
|
194
|
-
|
|
195
|
-
return text ? { text } : null;
|
|
219
|
+
var text = calcTicketProperty(cache, entityData);
|
|
220
|
+
return text ? { text: text } : null;
|
|
196
221
|
}
|
|
197
222
|
case DraftEntityDataTypes.NESTED: {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
for (
|
|
201
|
-
|
|
223
|
+
var blocks = setBlockEntities(cache, JSON.parse(JSON.stringify(entityData.block)), JSON.parse(JSON.stringify(entityData.entityMap)));
|
|
224
|
+
var block = { text: '', inlineStyleRanges: [] };
|
|
225
|
+
for (var i = 0; i < blocks.length; i++) {
|
|
226
|
+
var nested = blocks[i];
|
|
202
227
|
if (i > 0)
|
|
203
228
|
block.text += ' ';
|
|
204
|
-
|
|
229
|
+
var offset = block.text.length;
|
|
205
230
|
block.text += nested.text;
|
|
206
|
-
for (
|
|
231
|
+
for (var _i = 0, _h = nested.inlineStyleRanges; _i < _h.length; _i++) {
|
|
232
|
+
var style = _h[_i];
|
|
207
233
|
style.offset += offset;
|
|
208
|
-
block.inlineStyleRanges
|
|
234
|
+
(_e = block.inlineStyleRanges) === null || _e === void 0 ? void 0 : _e.push(style);
|
|
209
235
|
}
|
|
210
236
|
}
|
|
211
237
|
return block;
|
|
212
238
|
}
|
|
213
239
|
case DraftEntityDataTypes.FORM_STEP: {
|
|
214
|
-
|
|
240
|
+
var step = cache.form.steps[entityData.idStep];
|
|
215
241
|
if (!step)
|
|
216
242
|
return null;
|
|
217
|
-
|
|
243
|
+
var text = formStepToString(step, (_f = cache.dependencies[step.id]) === null || _f === void 0 ? void 0 : _f.value, mapToId);
|
|
218
244
|
if (text === null)
|
|
219
245
|
return null;
|
|
220
|
-
return { text, inlineStyleRanges: [] };
|
|
246
|
+
return { text: text, inlineStyleRanges: [] };
|
|
221
247
|
}
|
|
222
248
|
case DraftEntityDataTypes.DATE: {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
249
|
+
var millis = entityData.days * 86400000 +
|
|
250
|
+
entityData.hours * 3600000 +
|
|
251
|
+
entityData.minutes * 60000;
|
|
252
|
+
var subtract = false;
|
|
253
|
+
var date = new Date(new Date().getTime() + (subtract ? -millis : millis));
|
|
226
254
|
return {
|
|
227
|
-
text: format(date, entityData.format
|
|
255
|
+
text: format(date, (_g = entityData.format) !== null && _g !== void 0 ? _g : 'Pp', {
|
|
228
256
|
locale: getLocale(),
|
|
229
257
|
}),
|
|
230
258
|
};
|
|
@@ -235,10 +263,11 @@ const entityMapper = (cache, entityData, mapToId = false) => {
|
|
|
235
263
|
return null;
|
|
236
264
|
};
|
|
237
265
|
function calcTicketProperty(cache, entityData) {
|
|
238
|
-
|
|
266
|
+
var _a, _b;
|
|
267
|
+
var property = entityData.property;
|
|
239
268
|
switch (property) {
|
|
240
269
|
case TicketPropertyTypes.CASENUMBER:
|
|
241
|
-
return cache.ticket
|
|
270
|
+
return (_b = (_a = cache.ticket) === null || _a === void 0 ? void 0 : _a.caseNumber) !== null && _b !== void 0 ? _b : null;
|
|
242
271
|
default:
|
|
243
272
|
break;
|
|
244
273
|
}
|
|
@@ -268,13 +297,14 @@ function calcEntityProperty(property, value) {
|
|
|
268
297
|
/**
|
|
269
298
|
* The function will generate text for given draftjs editorContent.
|
|
270
299
|
*/
|
|
271
|
-
export function draftToString(cache, draft, mapToId
|
|
272
|
-
|
|
300
|
+
export function draftToString(cache, draft, mapToId) {
|
|
301
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
302
|
+
var text = [];
|
|
273
303
|
if (draft) {
|
|
274
|
-
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
|
|
304
|
+
var _a = JSON.parse(JSON.stringify(draft)), blocks_2 = _a.blocks, entityMap_1 = _a.entityMap;
|
|
305
|
+
if (blocks_2 && blocks_2.length > 0) {
|
|
306
|
+
blocks_2.forEach(function (block) {
|
|
307
|
+
var content = getBlockText(cache, block, entityMap_1, blocks_2.length === 1, mapToId);
|
|
278
308
|
if (isList(block.type)) {
|
|
279
309
|
content = getDepthPadding(block.depth) + content;
|
|
280
310
|
}
|
|
@@ -282,7 +312,7 @@ export function draftToString(cache, draft, mapToId = false) {
|
|
|
282
312
|
});
|
|
283
313
|
}
|
|
284
314
|
}
|
|
285
|
-
|
|
315
|
+
var response = text.join('');
|
|
286
316
|
if (response === '\n') {
|
|
287
317
|
return '';
|
|
288
318
|
}
|
|
@@ -291,8 +321,10 @@ export function draftToString(cache, draft, mapToId = false) {
|
|
|
291
321
|
/**
|
|
292
322
|
* Function will return text for the block.
|
|
293
323
|
*/
|
|
294
|
-
function getBlockText(cache, block, entityMap, skipNextLine
|
|
295
|
-
|
|
324
|
+
function getBlockText(cache, block, entityMap, skipNextLine, mapToId) {
|
|
325
|
+
if (skipNextLine === void 0) { skipNextLine = false; }
|
|
326
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
327
|
+
var blockMarkdown = [];
|
|
296
328
|
blockMarkdown.push(getBlockContentText(cache, block, entityMap, mapToId));
|
|
297
329
|
if (!isAtomicBlock(block) && !skipNextLine)
|
|
298
330
|
blockMarkdown.push('\n');
|
|
@@ -301,7 +333,8 @@ function getBlockText(cache, block, entityMap, skipNextLine = false, mapToId = f
|
|
|
301
333
|
/**
|
|
302
334
|
* Function will return the text for block content.
|
|
303
335
|
*/
|
|
304
|
-
function getBlockContentText(cache, block, entityMap, mapToId
|
|
336
|
+
function getBlockContentText(cache, block, entityMap, mapToId) {
|
|
337
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
305
338
|
if (isAtomicBlock(block)) {
|
|
306
339
|
return getEntityText(entityMap, block.entityRanges[0].key, block.text);
|
|
307
340
|
}
|
|
@@ -312,14 +345,14 @@ function getBlockContentText(cache, block, entityMap, mapToId = false) {
|
|
|
312
345
|
* Function to check if a block is of type list.
|
|
313
346
|
*/
|
|
314
347
|
export function isList(blockType) {
|
|
315
|
-
return blockType === 'unordered-list-item' || blockType === 'ordered-list-item';
|
|
348
|
+
return (blockType === 'unordered-list-item' || blockType === 'ordered-list-item');
|
|
316
349
|
}
|
|
317
350
|
/**
|
|
318
351
|
* Function will return text for Entity.
|
|
319
352
|
*/
|
|
320
353
|
export function getEntityText(entityMap, entityKey, blockText) {
|
|
321
|
-
|
|
322
|
-
if (entity && entity.type ===
|
|
354
|
+
var entity = entityMap[entityKey];
|
|
355
|
+
if (entity && entity.type === 'EUREKA') {
|
|
323
356
|
return blockText;
|
|
324
357
|
}
|
|
325
358
|
return '';
|
|
@@ -337,38 +370,44 @@ export function isAtomicBlock(block) {
|
|
|
337
370
|
* The function returns true if the string passed to it has no content.
|
|
338
371
|
*/
|
|
339
372
|
export function isEmptyString(str) {
|
|
340
|
-
if (str === undefined ||
|
|
373
|
+
if (str === undefined ||
|
|
374
|
+
str === null ||
|
|
375
|
+
str.length === 0 ||
|
|
376
|
+
str.trim().length === 0) {
|
|
341
377
|
return true;
|
|
342
378
|
}
|
|
343
379
|
return false;
|
|
344
380
|
}
|
|
345
381
|
export function getDepthPadding(depth) {
|
|
346
|
-
|
|
347
|
-
for (
|
|
382
|
+
var padding = '';
|
|
383
|
+
for (var i = 0; i < depth * 4; i += 1) {
|
|
348
384
|
padding += ' ';
|
|
349
385
|
}
|
|
350
386
|
return padding;
|
|
351
387
|
}
|
|
352
|
-
export function formStepToString(step, value, mapToId
|
|
388
|
+
export function formStepToString(step, value, mapToId) {
|
|
389
|
+
if (mapToId === void 0) { mapToId = false; }
|
|
353
390
|
if (value === undefined || value === null)
|
|
354
391
|
return null;
|
|
355
392
|
switch (step.type) {
|
|
356
393
|
case FormStepTypes.TIMEPICKER: {
|
|
357
|
-
|
|
358
|
-
|
|
394
|
+
var time = value;
|
|
395
|
+
var parts = [];
|
|
359
396
|
if (time.days) {
|
|
360
|
-
parts.push(
|
|
397
|
+
parts.push("".concat(time.days, " d\u00EDa").concat(time.days > 1 ? 's' : ''));
|
|
361
398
|
}
|
|
362
399
|
if (time.hours) {
|
|
363
|
-
parts.push(
|
|
400
|
+
parts.push("".concat(time.hours, " hora").concat(time.hours > 1 ? 's' : ''));
|
|
364
401
|
}
|
|
365
402
|
if (time.minutes) {
|
|
366
|
-
parts.push(
|
|
403
|
+
parts.push("".concat(time.minutes, " minuto").concat(time.minutes > 1 ? 's' : ''));
|
|
367
404
|
}
|
|
368
405
|
if (parts.length === 0)
|
|
369
|
-
return time.working
|
|
406
|
+
return time.working
|
|
407
|
+
? 'horario hábil más cercano'
|
|
408
|
+
: 'inmediatamente';
|
|
370
409
|
if (time.working) {
|
|
371
|
-
|
|
410
|
+
var isMultiple = parts.length > 1 || parts[0].includes('s');
|
|
372
411
|
return parts.join(', ') + (isMultiple ? ' hábiles' : 'hábil');
|
|
373
412
|
}
|
|
374
413
|
return parts.join(', ');
|
|
@@ -397,7 +436,9 @@ export function formStepToString(step, value, mapToId = false) {
|
|
|
397
436
|
return value[step.labelAttribute];
|
|
398
437
|
return null;
|
|
399
438
|
case FormStepTypes.FILEUPLOAD: {
|
|
400
|
-
return value
|
|
439
|
+
return value
|
|
440
|
+
.map(function (file) { var _a; return (_a = file.fileName) !== null && _a !== void 0 ? _a : 'Archivo'; })
|
|
441
|
+
.join(', ');
|
|
401
442
|
}
|
|
402
443
|
case FormStepTypes.RATING:
|
|
403
444
|
switch (step.ratingType) {
|
|
@@ -12,4 +12,4 @@ export declare const calcRecursiveCondition: (condition: Condition, ids: Record<
|
|
|
12
12
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
13
13
|
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
14
14
|
*/
|
|
15
|
-
export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: (idSubStep: string) => string) => string[];
|
|
15
|
+
export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: ((idSubStep: string) => string) | undefined) => string[];
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
2
11
|
import CBRFormStepTypes from '../constants/CBRFormStepTypes';
|
|
3
12
|
import ConditionTypes from '../constants/ConditionTypes';
|
|
@@ -5,36 +14,38 @@ import FormStepTypes, { ClassifierOptionTypes, EntityValueDataTypes, EntityValue
|
|
|
5
14
|
export function calcRecursiveData(element, newSteps, customSteps) {
|
|
6
15
|
if (!newSteps)
|
|
7
16
|
return;
|
|
8
|
-
for (
|
|
17
|
+
for (var _i = 0, _a = Object.entries(newSteps); _i < _a.length; _i++) {
|
|
18
|
+
var _b = _a[_i], idStep = _b[0], step = _b[1];
|
|
9
19
|
step.id = idStep;
|
|
10
20
|
if (step.dependencies) {
|
|
11
|
-
for (
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
for (var i = 0; i < step.dependencies.length; i++) {
|
|
22
|
+
var idDep = step.dependencies[i];
|
|
23
|
+
var newId = element.ids[idDep];
|
|
14
24
|
if (newId) {
|
|
15
25
|
step.dependencies[i] = newId;
|
|
16
26
|
}
|
|
17
27
|
}
|
|
18
28
|
}
|
|
19
|
-
|
|
20
|
-
if (custom
|
|
29
|
+
var custom = customSteps[step === null || step === void 0 ? void 0 : step.type];
|
|
30
|
+
if (custom === null || custom === void 0 ? void 0 : custom.calcRecursiveData) {
|
|
21
31
|
custom.calcRecursiveData(step, element.ids);
|
|
22
32
|
}
|
|
23
33
|
if (step.condition) {
|
|
24
34
|
calcRecursiveCondition(step.condition, element.ids);
|
|
25
35
|
}
|
|
26
|
-
calcSubSteps(step.id, newSteps, (idStep)
|
|
36
|
+
calcSubSteps(step.id, newSteps, function (idStep) { var _a; return (_a = element.ids[idStep]) !== null && _a !== void 0 ? _a : idStep; });
|
|
27
37
|
}
|
|
28
38
|
}
|
|
29
|
-
export
|
|
39
|
+
export var calcRecursiveCondition = function (condition, ids) {
|
|
30
40
|
switch (condition.type) {
|
|
31
41
|
case ConditionTypes.EXPRESSION:
|
|
32
|
-
for (
|
|
42
|
+
for (var _i = 0, _a = condition.conditions; _i < _a.length; _i++) {
|
|
43
|
+
var subCondition = _a[_i];
|
|
33
44
|
calcRecursiveCondition(subCondition, ids);
|
|
34
45
|
}
|
|
35
46
|
break;
|
|
36
47
|
case ConditionTypes.FORM_STEP: {
|
|
37
|
-
|
|
48
|
+
var newId = ids[condition.idStep];
|
|
38
49
|
if (newId) {
|
|
39
50
|
condition.idStep = newId;
|
|
40
51
|
}
|
|
@@ -50,22 +61,24 @@ export const calcRecursiveCondition = (condition, ids) => {
|
|
|
50
61
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
51
62
|
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
52
63
|
*/
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
65
|
+
var _a;
|
|
66
|
+
var step = allSteps[idStep];
|
|
67
|
+
var subSteps = [];
|
|
56
68
|
if (!step)
|
|
57
69
|
return [];
|
|
58
|
-
|
|
59
|
-
for (
|
|
60
|
-
|
|
70
|
+
var handleSteps = function (steps) {
|
|
71
|
+
for (var i = 0; i < steps.length; i++) {
|
|
72
|
+
var idSubStep = steps[i];
|
|
61
73
|
if (idModifier)
|
|
62
74
|
steps[i] = idModifier(steps[i]);
|
|
63
|
-
subSteps.push(idSubStep,
|
|
75
|
+
subSteps.push.apply(subSteps, __spreadArray([idSubStep], calcSubSteps(idSubStep, allSteps, idModifier), false));
|
|
64
76
|
}
|
|
65
77
|
};
|
|
66
78
|
switch (step.type) {
|
|
67
79
|
case FormStepTypes.SELECTOR: {
|
|
68
|
-
for (
|
|
80
|
+
for (var _i = 0, _b = step.options; _i < _b.length; _i++) {
|
|
81
|
+
var option = _b[_i];
|
|
69
82
|
if (option.type === OptionTypes.NESTED) {
|
|
70
83
|
handleSteps(option.steps);
|
|
71
84
|
}
|
|
@@ -73,8 +86,9 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
73
86
|
break;
|
|
74
87
|
}
|
|
75
88
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
76
|
-
for (
|
|
77
|
-
|
|
89
|
+
for (var _c = 0, _d = Object.keys(step.options); _c < _d.length; _c++) {
|
|
90
|
+
var idOption = _d[_c];
|
|
91
|
+
var option = step.options[idOption];
|
|
78
92
|
if (option.type === ClassifierOptionTypes.NESTED) {
|
|
79
93
|
handleSteps(option.steps);
|
|
80
94
|
}
|
|
@@ -82,7 +96,8 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
82
96
|
break;
|
|
83
97
|
case FormStepTypes.RATING:
|
|
84
98
|
if (step.nestedSteps) {
|
|
85
|
-
for (
|
|
99
|
+
for (var _e = 0, _f = step.nestedSteps; _e < _f.length; _e++) {
|
|
100
|
+
var steps = _f[_e];
|
|
86
101
|
handleSteps(steps);
|
|
87
102
|
}
|
|
88
103
|
}
|
|
@@ -100,19 +115,22 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
100
115
|
}
|
|
101
116
|
case FormStepTypes.ENTITYVALUEPICKER:
|
|
102
117
|
if (idModifier) {
|
|
103
|
-
for (
|
|
118
|
+
for (var _g = 0, _h = step.path; _g < _h.length; _g++) {
|
|
119
|
+
var path = _h[_g];
|
|
104
120
|
if (path.type === EntityValueDataTypes.STEP) {
|
|
105
121
|
path.idStep = idModifier(path.idStep);
|
|
106
122
|
}
|
|
107
123
|
}
|
|
108
|
-
for (
|
|
124
|
+
for (var _j = 0, _k = step.filters; _j < _k.length; _j++) {
|
|
125
|
+
var filter = _k[_j];
|
|
109
126
|
if (filter.type === EntityValueDataTypes.STEP) {
|
|
110
127
|
filter.idStep = idModifier(filter.idStep);
|
|
111
128
|
}
|
|
112
129
|
}
|
|
113
130
|
}
|
|
114
|
-
for (
|
|
115
|
-
|
|
131
|
+
for (var _l = 0, _m = Object.keys((_a = step.options) !== null && _a !== void 0 ? _a : {}); _l < _m.length; _l++) {
|
|
132
|
+
var idOption = _m[_l];
|
|
133
|
+
var option = step.options[idOption];
|
|
116
134
|
if (option.type === EntityValueOptionTypes.NESTED) {
|
|
117
135
|
handleSteps(option.steps);
|
|
118
136
|
}
|
|
@@ -120,7 +138,7 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
120
138
|
break;
|
|
121
139
|
case CBRFormStepTypes.CBR_LOCATIVAS:
|
|
122
140
|
{
|
|
123
|
-
|
|
141
|
+
var elementStep = step;
|
|
124
142
|
if (elementStep.subStep) {
|
|
125
143
|
if (idModifier)
|
|
126
144
|
elementStep.subStep = idModifier(elementStep.subStep);
|
|
@@ -129,7 +147,7 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
129
147
|
}
|
|
130
148
|
break;
|
|
131
149
|
case AYFFormStepTypes.AYF_ICA_CITY: {
|
|
132
|
-
|
|
150
|
+
var cityStep = step;
|
|
133
151
|
if (cityStep.idNitStep) {
|
|
134
152
|
if (idModifier)
|
|
135
153
|
cityStep.idNitStep = idModifier(cityStep.idNitStep);
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormStyle } from '../@Types/Form';
|
|
3
|
-
import { Palette, PaletteColor } from '@mui/material/styles';
|
|
4
|
-
declare module '@mui/material/styles' {
|
|
5
|
-
interface Palette {
|
|
6
|
-
outline: Palette['primary'];
|
|
7
|
-
helperText: Palette['text'];
|
|
8
|
-
greyBtn: Palette['primary'];
|
|
9
|
-
stepBackgroundColor: Palette['background'];
|
|
10
|
-
}
|
|
11
|
-
interface PaletteOptions {
|
|
12
|
-
outline: PaletteOptions['primary'];
|
|
13
|
-
helperText: PaletteOptions['text'];
|
|
14
|
-
greyBtn: PaletteOptions['primary'];
|
|
15
|
-
stepBackgroundColor: PaletteOptions['background'];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export type PaletteKey = keyof {
|
|
19
|
-
[Key in keyof Palette as Palette[Key] extends PaletteColor ? Key : never]: true;
|
|
20
|
-
};
|
|
21
2
|
interface MaterialProvidersProps {
|
|
22
3
|
children: React.ReactNode;
|
|
23
|
-
formStyle: FormStyle;
|
|
24
4
|
}
|
|
25
|
-
declare function MaterialProviders({ children
|
|
5
|
+
declare function MaterialProviders({ children }: MaterialProvidersProps): JSX.Element;
|
|
26
6
|
export default MaterialProviders;
|