@arquimedes.co/eureka-forms 3.0.35 → 3.0.36-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/Condition.d.ts +4 -6
- package/dist/@Types/Form.d.ts +0 -1
- package/dist/@Types/FormStep.d.ts +8 -12
- package/dist/@Types/GenericFormSteps.d.ts +8 -0
- package/dist/App/App.d.ts +1 -3
- package/dist/App/App.js +21 -46
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +177 -336
- package/dist/App/AppFunctions.test.js +708 -0
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +149 -252
- package/dist/App/AppHooks.test.js +154 -0
- package/dist/Contexts/CustomContext.d.ts +0 -1
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +3 -2
- package/dist/Contexts/SectionContext.d.ts +0 -1
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +1 -2
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +36 -62
- package/dist/Form/Form.d.ts +2 -3
- package/dist/Form/Form.js +74 -164
- package/dist/Form/Form.module.css +0 -9
- package/dist/Form/FormFunctions.js +63 -112
- package/dist/Form/FormFunctions.test.js +458 -0
- package/dist/Form/FormHooks.d.ts +1 -2
- package/dist/Form/FormHooks.js +14 -21
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -105
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +48 -110
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -1
- package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
- package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
- package/dist/Form/Section/Section.d.ts +0 -1
- package/dist/Form/Section/Section.js +4 -15
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -1
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
- package/dist/Form/Terms/Term/Term.d.ts +0 -1
- package/dist/Form/Terms/Term/Term.js +2 -13
- package/dist/Form/Terms/Terms.d.ts +0 -1
- package/dist/Form/Terms/Terms.js +17 -29
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +34 -107
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +66 -93
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.d.ts +2 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.js +22 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +45 -115
- package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
- package/dist/FormSteps/AYFStepMapper.js +60 -137
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +66 -172
- package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
- package/dist/FormSteps/CBRStepMapper.js +56 -168
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +49 -81
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +35 -66
- package/dist/FormSteps/CustomStep.d.ts +0 -1
- package/dist/FormSteps/CustomStep.js +17 -31
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +10 -0
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +14 -0
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +3 -0
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +34 -0
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +1 -2
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +9 -20
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +107 -302
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -1
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -1
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +91 -184
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +22 -33
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +89 -175
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +78 -117
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +1 -2
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -1
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -1
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -1
- package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -1
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +37 -61
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -1
- package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -1
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -1
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +80 -155
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
- package/dist/FormSteps/Step.d.ts +0 -1
- package/dist/FormSteps/Step.js +33 -58
- package/dist/FormSteps/StepFunctions.d.ts +4 -6
- package/dist/FormSteps/StepFunctions.js +153 -208
- package/dist/FormSteps/StepFunctions.test.js +702 -0
- package/dist/FormSteps/StepHooks.d.ts +68 -14
- package/dist/FormSteps/StepHooks.js +96 -155
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +18 -20
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +39 -75
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
- package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +21 -54
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
- package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +15 -27
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +1 -0
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +2 -0
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +2 -3
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +8 -23
- package/dist/Icons/@ErkIcon.d.ts +14 -0
- package/dist/Icons/@ErkIcon.js +9 -0
- package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
- package/dist/Icons/ArrowLeftIcon.js +7 -0
- package/dist/Icons/ArrowRightIcon.d.ts +3 -0
- package/dist/Icons/ArrowRightIcon.js +7 -0
- package/dist/Icons/CalendarIcon.d.ts +2 -3
- package/dist/Icons/CalendarIcon.js +4 -14
- package/dist/Icons/CheckCircleIcon.d.ts +3 -0
- package/dist/Icons/CheckCircleIcon.js +7 -0
- package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
- package/dist/Icons/CheckboxCheckedIcon.js +7 -0
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
- package/dist/Icons/CheckboxUncheckedIcon.js +7 -0
- package/dist/Icons/ClockIcon.d.ts +3 -0
- package/dist/Icons/ClockIcon.js +7 -0
- package/dist/Icons/CloseIcon.d.ts +3 -0
- package/dist/Icons/CloseIcon.js +7 -0
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +3 -13
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +3 -13
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +3 -13
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +3 -13
- package/dist/Icons/DeleteIcon.d.ts +3 -0
- package/dist/Icons/DeleteIcon.js +7 -0
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +3 -13
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +3 -13
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +5 -15
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +5 -15
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +5 -15
- package/dist/Icons/Entities/WorkIcon.d.ts +3 -0
- package/dist/Icons/Entities/WorkIcon.js +7 -0
- package/dist/Icons/ErrorIcon.d.ts +3 -0
- package/dist/Icons/ErrorIcon.js +7 -0
- package/dist/Icons/ExpandLessIcon.d.ts +3 -0
- package/dist/Icons/ExpandLessIcon.js +7 -0
- package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
- package/dist/Icons/ExpandMoreIcon.js +7 -0
- package/dist/Icons/FileIcon.d.ts +3 -0
- package/dist/Icons/FileIcon.js +7 -0
- package/dist/Icons/InfoIcon.d.ts +3 -0
- package/dist/Icons/InfoIcon.js +7 -0
- package/dist/Icons/LocationIcon.d.ts +2 -3
- package/dist/Icons/LocationIcon.js +4 -14
- package/dist/Icons/PersonIcon.d.ts +2 -3
- package/dist/Icons/PersonIcon.js +6 -16
- package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DislikeIcon.js +7 -0
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DissatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/LikeIcon.js +7 -0
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/SatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
- package/dist/Icons/Ratings/StarIcon.js +7 -0
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +7 -0
- package/dist/Icons/WarningIcon.d.ts +3 -0
- package/dist/Icons/WarningIcon.js +7 -0
- package/dist/Init.d.ts +1 -0
- package/dist/Init.js +2 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +22 -72
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +29 -86
- package/dist/Services/FormService.js +11 -56
- package/dist/Services/OrganizationService.js +11 -62
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
- package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
- package/dist/Shared/ErkButton/ErkButton.d.ts +25 -0
- package/dist/Shared/ErkButton/ErkButton.js +31 -0
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +16 -0
- package/dist/Shared/ErkButton/ErkButton.stories.js +28 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +31 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +13 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +34 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +18 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +275 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +98 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +18 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +180 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.d.ts +36 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.js +274 -0
- package/dist/Shared/ErkMenuItem.d.ts +2 -0
- package/dist/Shared/ErkMenuItem.js +18 -0
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +17 -0
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +96 -0
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +48 -0
- package/dist/Shared/ErkSelect/ErkSelect.js +142 -0
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +21 -0
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +87 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +54 -0
- package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +3 -13
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +159 -0
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +34 -0
- package/dist/Shared/ErkTextField/ErkTextField.js +149 -0
- package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +4 -17
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +99 -0
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +32 -0
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +107 -0
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +29 -112
- package/dist/Shared/Loader/Loader.d.ts +0 -1
- package/dist/Shared/Loader/Loader.js +6 -18
- package/dist/Shared/Navbar/Navbar.d.ts +1 -3
- package/dist/Shared/Navbar/Navbar.js +3 -96
- package/dist/Shared/Navbar/Navbar.module.css +0 -15
- 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 +3 -5
- package/dist/Shared/Rating/Rating.js +4 -27
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +13 -19
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +1 -0
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +2 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +1 -2
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +8 -22
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +1 -2
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +27 -43
- package/dist/Shared/Toggle/Toggle.d.ts +5 -14
- package/dist/Shared/Toggle/Toggle.js +29 -32
- package/dist/States/GlobalSlice.d.ts +7 -12
- package/dist/States/GlobalSlice.js +6 -22
- package/dist/States/SiteSlice.d.ts +30 -48
- package/dist/States/SiteSlice.js +58 -76
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +8 -9
- package/dist/Utils/AxiosAPI.d.ts +4 -5
- package/dist/Utils/AxiosAPI.js +23 -73
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +29 -30
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +102 -143
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +27 -45
- package/dist/Utils/LocaleUtils.d.ts +2 -0
- package/dist/Utils/LocaleUtils.js +12 -0
- package/dist/Utils/MaterialProviders.d.ts +21 -1
- package/dist/Utils/MaterialProviders.js +46 -28
- package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
- package/dist/Utils/MuiClassnameSetup.js +3 -0
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +60 -81
- package/dist/Utils/TestUtils.js +28 -57
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +10 -8
- package/dist/Utils/store.d.ts +9 -17
- package/dist/Utils/store.js +15 -74
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +17 -27
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/{IconTypes.d.ts → ErkIconTypes.d.ts} +2 -4
- package/dist/constants/ErkIconTypes.js +16 -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/InternalFormStyle.js +1 -1
- package/dist/hooks.d.ts +0 -3
- package/dist/hooks.js +14 -77
- package/dist/index.css +15 -0
- package/dist/index.lib.d.ts +0 -1
- package/dist/index.lib.js +0 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +25 -0
- package/package.json +111 -125
- package/dist/@Types/ErkValue.d.ts +0 -16
- package/dist/@Types/User.d.ts +0 -13
- package/dist/Icons/@IconTypes.d.ts +0 -7
- package/dist/Icons/EmailIcon.d.ts +0 -4
- package/dist/Icons/EmailIcon.js +0 -17
- package/dist/Icons/Entities/SchoolIcon.d.ts +0 -2
- package/dist/Icons/Entities/SchoolIcon.js +0 -17
- package/dist/Icons/GroupIcon.d.ts +0 -4
- package/dist/Icons/GroupIcon.js +0 -17
- package/dist/Icons/LockedIcon.d.ts +0 -4
- package/dist/Icons/LockedIcon.js +0 -17
- package/dist/Login/Login.module.css +0 -135
- package/dist/Login/LoginLayout.module.css +0 -68
- package/dist/Login/LoginPage.d.ts +0 -11
- package/dist/Login/LoginPage.js +0 -177
- package/dist/Login/LoginTextField.d.ts +0 -15
- package/dist/Login/LoginTextField.js +0 -134
- package/dist/Services/ApiSelectorService.d.ts +0 -57
- package/dist/Services/ApiSelectorService.js +0 -253
- package/dist/Services/IntegrationService.d.ts +0 -21
- package/dist/Services/IntegrationService.js +0 -69
- package/dist/Services/UserService.d.ts +0 -10
- package/dist/Services/UserService.js +0 -71
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +0 -30
- package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +0 -23
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +0 -36
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +0 -21
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +0 -36
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
- package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +0 -28
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
- package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +0 -41
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +0 -14
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +0 -60
- package/dist/__mocks__/axios.d.ts +0 -2
- package/dist/__mocks__/axios.js +0 -2
- package/dist/constants/ErkValueTypes.d.ts +0 -6
- package/dist/constants/ErkValueTypes.js +0 -7
- package/dist/constants/IconTypes.js +0 -18
- package/dist/constants/MaterialClassNameSeed.d.ts +0 -1
- package/dist/constants/MaterialClassNameSeed.js +0 -1
- package/dist/index.js +0 -31
- /package/dist/{@Types/ErkValue.js → App/AppFunctions.test.d.ts} +0 -0
- /package/dist/{@Types/User.js → App/AppHooks.test.d.ts} +0 -0
- /package/dist/{Icons/@IconTypes.js → Form/FormFunctions.test.d.ts} +0 -0
- /package/dist/{index.d.ts → FormSteps/StepFunctions.test.d.ts} +0 -0
- /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
- /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
- /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
|
@@ -25,10 +25,10 @@ interface FormCache {
|
|
|
25
25
|
export declare function stringToDraft(text: string): RawDraftContentState;
|
|
26
26
|
export declare const getRawText: (draft?: RawDraftContentState, text?: string) => RawDraftContentState;
|
|
27
27
|
export declare function mapDraftEntities(cache: FormCache, draft: EurekaDraft, mapToId?: boolean): RawDraftContentState;
|
|
28
|
-
|
|
28
|
+
interface MappedBlock {
|
|
29
29
|
text: string;
|
|
30
30
|
inlineStyleRanges?: RawDraftContentBlock['inlineStyleRanges'];
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
export declare const draftEntityMapper: (cache: FormCache, entityData: DraftEntityData, mapToId?: boolean) => MappedBlock;
|
|
33
33
|
type DraftBlock = EurekaDraft['blocks'][0];
|
|
34
34
|
/**
|
|
@@ -52,5 +52,5 @@ export declare function isAtomicBlock(block: DraftBlock): boolean;
|
|
|
52
52
|
*/
|
|
53
53
|
export declare function isEmptyString(str: string): boolean;
|
|
54
54
|
export declare function getDepthPadding(depth: number): string;
|
|
55
|
-
export declare function formStepToString(step: FormStep, value: any
|
|
55
|
+
export declare function formStepToString(step: FormStep, value: any, mapToId?: boolean): string | null;
|
|
56
56
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { nanoid } from '@reduxjs/toolkit';
|
|
2
|
-
import { DraftEntityDataMappingTypes, 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';
|
|
6
5
|
import { TicketPropertyTypes } from '../constants/TicketPropertyTypes';
|
|
7
6
|
import { format } from 'date-fns';
|
|
8
7
|
import EntityPropertyTypes from '../constants/EntityPropertyTypes';
|
|
9
8
|
import FormStepTypes, { RatingTypes } from '../constants/FormStepTypes';
|
|
9
|
+
import { getLocale } from './LocaleUtils';
|
|
10
10
|
export function stringToDraft(text) {
|
|
11
|
-
|
|
11
|
+
const draftStructure = {
|
|
12
12
|
blocks: [],
|
|
13
13
|
entityMap: {},
|
|
14
14
|
};
|
|
15
|
-
text.split('\n').forEach(
|
|
15
|
+
text.split('\n').forEach((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 const getRawText = (draft, text) => {
|
|
29
29
|
if (draft !== undefined) {
|
|
30
30
|
return draft;
|
|
31
31
|
}
|
|
@@ -49,33 +49,28 @@ export var getRawText = function (draft, text) {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
export function mapDraftEntities(cache, draft, mapToId) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var block = blocks_1[_i];
|
|
58
|
-
newBlocks.push.apply(newBlocks, setBlockEntities(cache, block, entityMap, mapToId));
|
|
52
|
+
export function mapDraftEntities(cache, draft, mapToId = false) {
|
|
53
|
+
const newBlocks = [];
|
|
54
|
+
const { blocks, entityMap } = JSON.parse(JSON.stringify(draft));
|
|
55
|
+
for (const block of blocks) {
|
|
56
|
+
newBlocks.push(...setBlockEntities(cache, block, entityMap, mapToId));
|
|
59
57
|
}
|
|
60
|
-
return { blocks
|
|
58
|
+
return { blocks, entityMap };
|
|
61
59
|
}
|
|
62
|
-
function setBlockEntities(cache, block, entityMap, mapToId) {
|
|
63
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
60
|
+
function setBlockEntities(cache, block, entityMap, mapToId = false) {
|
|
64
61
|
//Con esta funcion saca el texto remplazado de la entidad
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
for (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var entityData = entityMap[entity.key];
|
|
62
|
+
const entities = block.entityRanges.sort((s1, s2) => s2.offset - s1.offset);
|
|
63
|
+
const newEntities = [];
|
|
64
|
+
for (const entity of entities) {
|
|
65
|
+
const styles = block.inlineStyleRanges.sort((s1, s2) => s2.offset - s1.offset);
|
|
66
|
+
const entityEnd = entity.offset + entity.length - 1;
|
|
67
|
+
const entityData = entityMap[entity.key];
|
|
72
68
|
if (entityData.type === DraftEntityTypes.EUREKA) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
for (
|
|
77
|
-
|
|
78
|
-
var styleEnd = style.offset + style.length - 1;
|
|
69
|
+
const mappedBlock = draftEntityMapper(cache, entityData.data, mapToId);
|
|
70
|
+
const entityText = mappedBlock.text;
|
|
71
|
+
const entitySizeDelta = entityText.length - entity.length;
|
|
72
|
+
for (const style of styles) {
|
|
73
|
+
const styleEnd = style.offset + style.length - 1;
|
|
79
74
|
//revisa si el estilo termina después del inicio del entity, de lo contrario el estilo no se ve afectado por el entity
|
|
80
75
|
if (styleEnd > entity.offset) {
|
|
81
76
|
//si el estilo termina en la mitad del entity
|
|
@@ -83,10 +78,8 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
|
|
|
83
78
|
style.length = entityEnd - style.offset + 1;
|
|
84
79
|
}
|
|
85
80
|
//si el estilo empieza en la mitad del entity
|
|
86
|
-
if (style.offset < entityEnd &&
|
|
87
|
-
style.offset
|
|
88
|
-
style.length =
|
|
89
|
-
style.length + style.offset - entity.offset;
|
|
81
|
+
if (style.offset < entityEnd && style.offset > entity.offset) {
|
|
82
|
+
style.length = style.length + style.offset - entity.offset;
|
|
90
83
|
style.offset = entity.offset;
|
|
91
84
|
}
|
|
92
85
|
//Ahora se modifica el style con base en el tamaño del entityText a reemplazar
|
|
@@ -101,56 +94,43 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
|
|
|
101
94
|
}
|
|
102
95
|
}
|
|
103
96
|
//reemplaza el entity por su text
|
|
104
|
-
|
|
97
|
+
const originalBlockText = block.text;
|
|
105
98
|
block.text =
|
|
106
99
|
block.text.substring(0, entity.offset) +
|
|
107
100
|
entityText +
|
|
108
101
|
originalBlockText.substring(entityEnd + 1, originalBlockText.length);
|
|
109
|
-
block.entityRanges = block.entityRanges.filter(
|
|
110
|
-
return newEntities.includes(entity.key);
|
|
111
|
-
});
|
|
102
|
+
block.entityRanges = block.entityRanges.filter((entity) => newEntities.includes(entity.key));
|
|
112
103
|
delete entityMap[entity.key];
|
|
113
104
|
/** Add new block styles */
|
|
114
105
|
if (!mappedBlock.inlineStyleRanges)
|
|
115
106
|
continue;
|
|
116
|
-
|
|
107
|
+
for (const style of mappedBlock.inlineStyleRanges) {
|
|
117
108
|
style.offset += entity.offset;
|
|
118
109
|
/** Obs: no hay estilos(ya existentes) que se partan en la mitad de la entidad! */
|
|
119
110
|
/** If new style intersects with current style of same type modify the current one */
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
blockStyle.style === style.style;
|
|
124
|
-
});
|
|
111
|
+
const currentInStart = block.inlineStyleRanges.find((blockStyle) => blockStyle.offset <= style.offset &&
|
|
112
|
+
blockStyle.offset + blockStyle.length > style.offset &&
|
|
113
|
+
blockStyle.style === style.style);
|
|
125
114
|
if (currentInStart) {
|
|
126
115
|
//If the current style covers the new style's range, ignore it
|
|
127
|
-
if (currentInStart.offset + currentInStart.length >
|
|
128
|
-
|
|
129
|
-
return "continue";
|
|
116
|
+
if (currentInStart.offset + currentInStart.length > style.offset + style.length)
|
|
117
|
+
continue;
|
|
130
118
|
else {
|
|
131
119
|
//Modify the current style to cover the new style's range
|
|
132
|
-
currentInStart.length =
|
|
133
|
-
|
|
134
|
-
return "continue";
|
|
120
|
+
currentInStart.length = style.offset + style.length - currentInStart.offset;
|
|
121
|
+
continue;
|
|
135
122
|
}
|
|
136
123
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
style.offset + style.length &&
|
|
141
|
-
blockStyle.style === style.style;
|
|
142
|
-
});
|
|
124
|
+
const currentInEnd = block.inlineStyleRanges.find((blockStyle) => blockStyle.offset < style.offset + style.length &&
|
|
125
|
+
blockStyle.offset + blockStyle.length > style.offset + style.length &&
|
|
126
|
+
blockStyle.style === style.style);
|
|
143
127
|
if (currentInEnd) {
|
|
144
128
|
if (currentInEnd.offset < style.offset)
|
|
145
|
-
|
|
129
|
+
continue;
|
|
146
130
|
currentInEnd.offset = style.offset;
|
|
147
|
-
|
|
131
|
+
continue;
|
|
148
132
|
}
|
|
149
133
|
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);
|
|
154
134
|
}
|
|
155
135
|
//No filtrar sino cambiar? o poner en estado "Mappeado?"
|
|
156
136
|
//Actualmente el draft queda sin entityMap y sin entityRanges en los bloques. para cambiarlo quitar el delete y el filter
|
|
@@ -162,97 +142,89 @@ function setBlockEntities(cache, block, entityMap, mapToId) {
|
|
|
162
142
|
block.entityRanges = newEntities;
|
|
163
143
|
return [block];
|
|
164
144
|
}
|
|
165
|
-
export
|
|
166
|
-
|
|
167
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
168
|
-
if (entityData.condition &&
|
|
169
|
-
entityData.type !== DraftEntityDataTypes.CONDITION_MET) {
|
|
145
|
+
export const draftEntityMapper = (cache, entityData, mapToId = false) => {
|
|
146
|
+
if (entityData.condition && entityData.type !== DraftEntityDataTypes.CONDITION_MET) {
|
|
170
147
|
if (!evaluateCondition(entityData.condition, cache.dependencies))
|
|
171
148
|
return { text: '' };
|
|
172
149
|
}
|
|
173
|
-
|
|
174
|
-
if (!
|
|
150
|
+
let value = entityMapper(cache, entityData, mapToId);
|
|
151
|
+
if (!value?.text && entityData.fallback) {
|
|
175
152
|
value = { text: entityData.fallback };
|
|
176
153
|
}
|
|
177
|
-
if (
|
|
154
|
+
if (value?.text && entityData.prefix) {
|
|
178
155
|
value.text = entityData.prefix + value.text;
|
|
179
156
|
}
|
|
180
|
-
if (
|
|
157
|
+
if (value?.text && entityData.suffix) {
|
|
181
158
|
value.text = value.text + entityData.suffix;
|
|
182
159
|
}
|
|
183
160
|
return {
|
|
184
|
-
text:
|
|
185
|
-
inlineStyleRanges: value
|
|
161
|
+
text: value?.text ?? '',
|
|
162
|
+
inlineStyleRanges: value?.inlineStyleRanges,
|
|
186
163
|
};
|
|
187
164
|
};
|
|
188
|
-
|
|
189
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
190
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
165
|
+
const entityMapper = (cache, entityData, mapToId = false) => {
|
|
191
166
|
switch (entityData.type) {
|
|
192
167
|
case DraftEntityDataTypes.CONDITION_MET: {
|
|
193
168
|
if (evaluateCondition(entityData.condition, cache.dependencies)) {
|
|
194
|
-
return { text:
|
|
169
|
+
return { text: entityData.ifTrue ?? 'Sí' };
|
|
195
170
|
}
|
|
196
|
-
return { text:
|
|
171
|
+
return { text: entityData.ifFalse ?? 'No' };
|
|
197
172
|
}
|
|
198
173
|
case DraftEntityDataMappingTypes.ENTITYVALUE_MAPPING: {
|
|
199
|
-
if (!
|
|
174
|
+
if (!cache?.entityValue)
|
|
200
175
|
throw new Error('Invalid EntityValue Mapping');
|
|
201
|
-
|
|
176
|
+
const property = cache.entity?.steps[entityData.idProperty];
|
|
202
177
|
if (!property)
|
|
203
178
|
return null;
|
|
204
|
-
|
|
205
|
-
return text ? { text
|
|
179
|
+
const text = calcEntityProperty(property, cache.entityValue[entityData.idProperty]);
|
|
180
|
+
return text ? { text } : null;
|
|
206
181
|
}
|
|
207
182
|
case DraftEntityDataTypes.COMPANY: {
|
|
208
|
-
|
|
183
|
+
const company = cache.company;
|
|
209
184
|
if (company) {
|
|
210
|
-
|
|
185
|
+
const property = cache.entity?.steps[entityData.idProperty];
|
|
211
186
|
if (!property)
|
|
212
187
|
return null;
|
|
213
|
-
|
|
214
|
-
return text ? { text
|
|
188
|
+
const text = calcEntityProperty(property, company[entityData.idProperty]);
|
|
189
|
+
return text ? { text } : null;
|
|
215
190
|
}
|
|
216
191
|
break;
|
|
217
192
|
}
|
|
218
193
|
case DraftEntityDataTypes.TICKET: {
|
|
219
|
-
|
|
220
|
-
return text ? { text
|
|
194
|
+
const text = calcTicketProperty(cache, entityData);
|
|
195
|
+
return text ? { text } : null;
|
|
221
196
|
}
|
|
222
197
|
case DraftEntityDataTypes.NESTED: {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
for (
|
|
226
|
-
|
|
198
|
+
const blocks = setBlockEntities(cache, JSON.parse(JSON.stringify(entityData.block)), JSON.parse(JSON.stringify(entityData.entityMap)));
|
|
199
|
+
const block = { text: '', inlineStyleRanges: [] };
|
|
200
|
+
for (let i = 0; i < blocks.length; i++) {
|
|
201
|
+
const nested = blocks[i];
|
|
227
202
|
if (i > 0)
|
|
228
203
|
block.text += ' ';
|
|
229
|
-
|
|
204
|
+
const offset = block.text.length;
|
|
230
205
|
block.text += nested.text;
|
|
231
|
-
for (
|
|
232
|
-
var style = _h[_i];
|
|
206
|
+
for (const style of nested.inlineStyleRanges) {
|
|
233
207
|
style.offset += offset;
|
|
234
|
-
|
|
208
|
+
block.inlineStyleRanges?.push(style);
|
|
235
209
|
}
|
|
236
210
|
}
|
|
237
211
|
return block;
|
|
238
212
|
}
|
|
239
213
|
case DraftEntityDataTypes.FORM_STEP: {
|
|
240
|
-
|
|
214
|
+
const step = cache.form.steps[entityData.idStep];
|
|
241
215
|
if (!step)
|
|
242
216
|
return null;
|
|
243
|
-
|
|
217
|
+
const text = formStepToString(step, cache.dependencies[step.id]?.value, mapToId);
|
|
244
218
|
if (text === null)
|
|
245
219
|
return null;
|
|
246
|
-
return { text
|
|
220
|
+
return { text, inlineStyleRanges: [] };
|
|
247
221
|
}
|
|
248
222
|
case DraftEntityDataTypes.DATE: {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
var subtract = false;
|
|
253
|
-
var date = new Date(new Date().getTime() + (subtract ? -millis : millis));
|
|
223
|
+
const millis = entityData.days * 86400000 + entityData.hours * 3600000 + entityData.minutes * 60000;
|
|
224
|
+
const subtract = false;
|
|
225
|
+
const date = new Date(new Date().getTime() + (subtract ? -millis : millis));
|
|
254
226
|
return {
|
|
255
|
-
text: format(date,
|
|
227
|
+
text: format(date, entityData.format ?? 'Pp', {
|
|
256
228
|
locale: getLocale(),
|
|
257
229
|
}),
|
|
258
230
|
};
|
|
@@ -263,11 +235,10 @@ var entityMapper = function (cache, entityData, mapToId) {
|
|
|
263
235
|
return null;
|
|
264
236
|
};
|
|
265
237
|
function calcTicketProperty(cache, entityData) {
|
|
266
|
-
|
|
267
|
-
var property = entityData.property;
|
|
238
|
+
const property = entityData.property;
|
|
268
239
|
switch (property) {
|
|
269
240
|
case TicketPropertyTypes.CASENUMBER:
|
|
270
|
-
return
|
|
241
|
+
return cache.ticket?.caseNumber ?? null;
|
|
271
242
|
default:
|
|
272
243
|
break;
|
|
273
244
|
}
|
|
@@ -297,14 +268,13 @@ function calcEntityProperty(property, value) {
|
|
|
297
268
|
/**
|
|
298
269
|
* The function will generate text for given draftjs editorContent.
|
|
299
270
|
*/
|
|
300
|
-
export function draftToString(cache, draft, mapToId) {
|
|
301
|
-
|
|
302
|
-
var text = [];
|
|
271
|
+
export function draftToString(cache, draft, mapToId = false) {
|
|
272
|
+
const text = [];
|
|
303
273
|
if (draft) {
|
|
304
|
-
|
|
305
|
-
if (
|
|
306
|
-
|
|
307
|
-
|
|
274
|
+
const { blocks, entityMap } = JSON.parse(JSON.stringify(draft));
|
|
275
|
+
if (blocks && blocks.length > 0) {
|
|
276
|
+
blocks.forEach((block) => {
|
|
277
|
+
let content = getBlockText(cache, block, entityMap, blocks.length === 1, mapToId);
|
|
308
278
|
if (isList(block.type)) {
|
|
309
279
|
content = getDepthPadding(block.depth) + content;
|
|
310
280
|
}
|
|
@@ -312,7 +282,7 @@ export function draftToString(cache, draft, mapToId) {
|
|
|
312
282
|
});
|
|
313
283
|
}
|
|
314
284
|
}
|
|
315
|
-
|
|
285
|
+
const response = text.join('');
|
|
316
286
|
if (response === '\n') {
|
|
317
287
|
return '';
|
|
318
288
|
}
|
|
@@ -321,10 +291,8 @@ export function draftToString(cache, draft, mapToId) {
|
|
|
321
291
|
/**
|
|
322
292
|
* Function will return text for the block.
|
|
323
293
|
*/
|
|
324
|
-
function getBlockText(cache, block, entityMap, skipNextLine, mapToId) {
|
|
325
|
-
|
|
326
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
327
|
-
var blockMarkdown = [];
|
|
294
|
+
function getBlockText(cache, block, entityMap, skipNextLine = false, mapToId = false) {
|
|
295
|
+
const blockMarkdown = [];
|
|
328
296
|
blockMarkdown.push(getBlockContentText(cache, block, entityMap, mapToId));
|
|
329
297
|
if (!isAtomicBlock(block) && !skipNextLine)
|
|
330
298
|
blockMarkdown.push('\n');
|
|
@@ -333,8 +301,7 @@ function getBlockText(cache, block, entityMap, skipNextLine, mapToId) {
|
|
|
333
301
|
/**
|
|
334
302
|
* Function will return the text for block content.
|
|
335
303
|
*/
|
|
336
|
-
function getBlockContentText(cache, block, entityMap, mapToId) {
|
|
337
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
304
|
+
function getBlockContentText(cache, block, entityMap, mapToId = false) {
|
|
338
305
|
if (isAtomicBlock(block)) {
|
|
339
306
|
return getEntityText(entityMap, block.entityRanges[0].key, block.text);
|
|
340
307
|
}
|
|
@@ -345,14 +312,14 @@ function getBlockContentText(cache, block, entityMap, mapToId) {
|
|
|
345
312
|
* Function to check if a block is of type list.
|
|
346
313
|
*/
|
|
347
314
|
export function isList(blockType) {
|
|
348
|
-
return
|
|
315
|
+
return blockType === 'unordered-list-item' || blockType === 'ordered-list-item';
|
|
349
316
|
}
|
|
350
317
|
/**
|
|
351
318
|
* Function will return text for Entity.
|
|
352
319
|
*/
|
|
353
320
|
export function getEntityText(entityMap, entityKey, blockText) {
|
|
354
|
-
|
|
355
|
-
if (entity && entity.type ===
|
|
321
|
+
const entity = entityMap[entityKey];
|
|
322
|
+
if (entity && entity.type === DraftEntityTypes.EUREKA) {
|
|
356
323
|
return blockText;
|
|
357
324
|
}
|
|
358
325
|
return '';
|
|
@@ -370,44 +337,38 @@ export function isAtomicBlock(block) {
|
|
|
370
337
|
* The function returns true if the string passed to it has no content.
|
|
371
338
|
*/
|
|
372
339
|
export function isEmptyString(str) {
|
|
373
|
-
if (str === undefined ||
|
|
374
|
-
str === null ||
|
|
375
|
-
str.length === 0 ||
|
|
376
|
-
str.trim().length === 0) {
|
|
340
|
+
if (str === undefined || str === null || str.length === 0 || str.trim().length === 0) {
|
|
377
341
|
return true;
|
|
378
342
|
}
|
|
379
343
|
return false;
|
|
380
344
|
}
|
|
381
345
|
export function getDepthPadding(depth) {
|
|
382
|
-
|
|
383
|
-
for (
|
|
346
|
+
let padding = '';
|
|
347
|
+
for (let i = 0; i < depth * 4; i += 1) {
|
|
384
348
|
padding += ' ';
|
|
385
349
|
}
|
|
386
350
|
return padding;
|
|
387
351
|
}
|
|
388
|
-
export function formStepToString(step, value, mapToId) {
|
|
389
|
-
if (mapToId === void 0) { mapToId = false; }
|
|
352
|
+
export function formStepToString(step, value, mapToId = false) {
|
|
390
353
|
if (value === undefined || value === null)
|
|
391
354
|
return null;
|
|
392
355
|
switch (step.type) {
|
|
393
356
|
case FormStepTypes.TIMEPICKER: {
|
|
394
|
-
|
|
395
|
-
|
|
357
|
+
const time = value;
|
|
358
|
+
const parts = [];
|
|
396
359
|
if (time.days) {
|
|
397
|
-
parts.push(
|
|
360
|
+
parts.push(`${time.days} día${time.days > 1 ? 's' : ''}`);
|
|
398
361
|
}
|
|
399
362
|
if (time.hours) {
|
|
400
|
-
parts.push(
|
|
363
|
+
parts.push(`${time.hours} hora${time.hours > 1 ? 's' : ''}`);
|
|
401
364
|
}
|
|
402
365
|
if (time.minutes) {
|
|
403
|
-
parts.push(
|
|
366
|
+
parts.push(`${time.minutes} minuto${time.minutes > 1 ? 's' : ''}`);
|
|
404
367
|
}
|
|
405
368
|
if (parts.length === 0)
|
|
406
|
-
return time.working
|
|
407
|
-
? 'horario hábil más cercano'
|
|
408
|
-
: 'inmediatamente';
|
|
369
|
+
return time.working ? 'horario hábil más cercano' : 'inmediatamente';
|
|
409
370
|
if (time.working) {
|
|
410
|
-
|
|
371
|
+
const isMultiple = parts.length > 1 || parts[0].includes('s');
|
|
411
372
|
return parts.join(', ') + (isMultiple ? ' hábiles' : 'hábil');
|
|
412
373
|
}
|
|
413
374
|
return parts.join(', ');
|
|
@@ -436,9 +397,7 @@ export function formStepToString(step, value, mapToId) {
|
|
|
436
397
|
return value[step.labelAttribute];
|
|
437
398
|
return null;
|
|
438
399
|
case FormStepTypes.FILEUPLOAD: {
|
|
439
|
-
return value
|
|
440
|
-
.map(function (file) { var _a; return (_a = file.fileName) !== null && _a !== void 0 ? _a : 'Archivo'; })
|
|
441
|
-
.join(', ');
|
|
400
|
+
return value.map((file) => file.fileName ?? 'Archivo').join(', ');
|
|
442
401
|
}
|
|
443
402
|
case FormStepTypes.RATING:
|
|
444
403
|
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?: (
|
|
15
|
+
export declare const calcSubSteps: (idStep: string, allSteps: Record<string, FormStep | CBRFormStep | AYFFormStep>, idModifier?: (idSubStep: string) => string) => string[];
|
|
@@ -1,12 +1,3 @@
|
|
|
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
|
-
};
|
|
10
1
|
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
11
2
|
import CBRFormStepTypes from '../constants/CBRFormStepTypes';
|
|
12
3
|
import ConditionTypes from '../constants/ConditionTypes';
|
|
@@ -14,38 +5,36 @@ import FormStepTypes, { ClassifierOptionTypes, EntityValueDataTypes, EntityValue
|
|
|
14
5
|
export function calcRecursiveData(element, newSteps, customSteps) {
|
|
15
6
|
if (!newSteps)
|
|
16
7
|
return;
|
|
17
|
-
for (
|
|
18
|
-
var _b = _a[_i], idStep = _b[0], step = _b[1];
|
|
8
|
+
for (const [idStep, step] of Object.entries(newSteps)) {
|
|
19
9
|
step.id = idStep;
|
|
20
10
|
if (step.dependencies) {
|
|
21
|
-
for (
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
for (let i = 0; i < step.dependencies.length; i++) {
|
|
12
|
+
const idDep = step.dependencies[i];
|
|
13
|
+
const newId = element.ids[idDep];
|
|
24
14
|
if (newId) {
|
|
25
15
|
step.dependencies[i] = newId;
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
}
|
|
29
|
-
|
|
30
|
-
if (custom
|
|
19
|
+
const custom = customSteps[step?.type];
|
|
20
|
+
if (custom?.calcRecursiveData) {
|
|
31
21
|
custom.calcRecursiveData(step, element.ids);
|
|
32
22
|
}
|
|
33
23
|
if (step.condition) {
|
|
34
24
|
calcRecursiveCondition(step.condition, element.ids);
|
|
35
25
|
}
|
|
36
|
-
calcSubSteps(step.id, newSteps,
|
|
26
|
+
calcSubSteps(step.id, newSteps, (idStep) => element.ids[idStep] ?? idStep);
|
|
37
27
|
}
|
|
38
28
|
}
|
|
39
|
-
export
|
|
29
|
+
export const calcRecursiveCondition = (condition, ids) => {
|
|
40
30
|
switch (condition.type) {
|
|
41
31
|
case ConditionTypes.EXPRESSION:
|
|
42
|
-
for (
|
|
43
|
-
var subCondition = _a[_i];
|
|
32
|
+
for (const subCondition of condition.conditions) {
|
|
44
33
|
calcRecursiveCondition(subCondition, ids);
|
|
45
34
|
}
|
|
46
35
|
break;
|
|
47
36
|
case ConditionTypes.FORM_STEP: {
|
|
48
|
-
|
|
37
|
+
const newId = ids[condition.idStep];
|
|
49
38
|
if (newId) {
|
|
50
39
|
condition.idStep = newId;
|
|
51
40
|
}
|
|
@@ -61,24 +50,22 @@ export var calcRecursiveCondition = function (condition, ids) {
|
|
|
61
50
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
62
51
|
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
63
52
|
*/
|
|
64
|
-
export
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var subSteps = [];
|
|
53
|
+
export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
54
|
+
const step = allSteps[idStep];
|
|
55
|
+
const subSteps = [];
|
|
68
56
|
if (!step)
|
|
69
57
|
return [];
|
|
70
|
-
|
|
71
|
-
for (
|
|
72
|
-
|
|
58
|
+
const handleSteps = (steps) => {
|
|
59
|
+
for (let i = 0; i < steps.length; i++) {
|
|
60
|
+
const idSubStep = steps[i];
|
|
73
61
|
if (idModifier)
|
|
74
62
|
steps[i] = idModifier(steps[i]);
|
|
75
|
-
subSteps.push
|
|
63
|
+
subSteps.push(idSubStep, ...calcSubSteps(idSubStep, allSteps, idModifier));
|
|
76
64
|
}
|
|
77
65
|
};
|
|
78
66
|
switch (step.type) {
|
|
79
67
|
case FormStepTypes.SELECTOR: {
|
|
80
|
-
for (
|
|
81
|
-
var option = _b[_i];
|
|
68
|
+
for (const option of step.options) {
|
|
82
69
|
if (option.type === OptionTypes.NESTED) {
|
|
83
70
|
handleSteps(option.steps);
|
|
84
71
|
}
|
|
@@ -86,9 +73,8 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
|
86
73
|
break;
|
|
87
74
|
}
|
|
88
75
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
89
|
-
for (
|
|
90
|
-
|
|
91
|
-
var option = step.options[idOption];
|
|
76
|
+
for (const idOption of Object.keys(step.options)) {
|
|
77
|
+
const option = step.options[idOption];
|
|
92
78
|
if (option.type === ClassifierOptionTypes.NESTED) {
|
|
93
79
|
handleSteps(option.steps);
|
|
94
80
|
}
|
|
@@ -96,8 +82,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
|
96
82
|
break;
|
|
97
83
|
case FormStepTypes.RATING:
|
|
98
84
|
if (step.nestedSteps) {
|
|
99
|
-
for (
|
|
100
|
-
var steps = _f[_e];
|
|
85
|
+
for (const steps of step.nestedSteps) {
|
|
101
86
|
handleSteps(steps);
|
|
102
87
|
}
|
|
103
88
|
}
|
|
@@ -115,22 +100,19 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
|
115
100
|
}
|
|
116
101
|
case FormStepTypes.ENTITYVALUEPICKER:
|
|
117
102
|
if (idModifier) {
|
|
118
|
-
for (
|
|
119
|
-
var path = _h[_g];
|
|
103
|
+
for (const path of step.path) {
|
|
120
104
|
if (path.type === EntityValueDataTypes.STEP) {
|
|
121
105
|
path.idStep = idModifier(path.idStep);
|
|
122
106
|
}
|
|
123
107
|
}
|
|
124
|
-
for (
|
|
125
|
-
var filter = _k[_j];
|
|
108
|
+
for (const filter of step.filters) {
|
|
126
109
|
if (filter.type === EntityValueDataTypes.STEP) {
|
|
127
110
|
filter.idStep = idModifier(filter.idStep);
|
|
128
111
|
}
|
|
129
112
|
}
|
|
130
113
|
}
|
|
131
|
-
for (
|
|
132
|
-
|
|
133
|
-
var option = step.options[idOption];
|
|
114
|
+
for (const idOption of Object.keys(step.options ?? {})) {
|
|
115
|
+
const option = step.options[idOption];
|
|
134
116
|
if (option.type === EntityValueOptionTypes.NESTED) {
|
|
135
117
|
handleSteps(option.steps);
|
|
136
118
|
}
|
|
@@ -138,7 +120,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
|
138
120
|
break;
|
|
139
121
|
case CBRFormStepTypes.CBR_LOCATIVAS:
|
|
140
122
|
{
|
|
141
|
-
|
|
123
|
+
const elementStep = step;
|
|
142
124
|
if (elementStep.subStep) {
|
|
143
125
|
if (idModifier)
|
|
144
126
|
elementStep.subStep = idModifier(elementStep.subStep);
|
|
@@ -147,7 +129,7 @@ export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
|
147
129
|
}
|
|
148
130
|
break;
|
|
149
131
|
case AYFFormStepTypes.AYF_ICA_CITY: {
|
|
150
|
-
|
|
132
|
+
const cityStep = step;
|
|
151
133
|
if (cityStep.idNitStep) {
|
|
152
134
|
if (idModifier)
|
|
153
135
|
cityStep.idNitStep = idModifier(cityStep.idNitStep);
|