@arquimedes.co/eureka-forms 3.0.32 → 3.0.34-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 +146 -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 +1 -2
- package/dist/Form/Form.js +71 -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 +0 -1
- package/dist/Form/FormHooks.js +13 -21
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +32 -105
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +46 -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 +11 -27
- 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 +56 -77
- 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 +64 -173
- 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 +44 -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 +31 -61
- 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 +106 -300
- 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 +85 -180
- 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 +20 -31
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +85 -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 +70 -115
- 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 +31 -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 +73 -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 +88 -154
- 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 +36 -74
- 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 +14 -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 +24 -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 +266 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +98 -0
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +18 -0
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +173 -0
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +36 -0
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +274 -0
- package/dist/Shared/ErkMenuItem.d.ts +4 -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 +52 -0
- package/dist/Shared/ErkSelect/ErkSelect.js +141 -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 +146 -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 +16 -26
- 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 +72 -93
- 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/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
|
@@ -7,27 +7,65 @@ import { FormStep } from '../@Types/FormStep';
|
|
|
7
7
|
import { FieldError, RefCallBack, UseControllerProps, useController } from 'react-hook-form';
|
|
8
8
|
import { Condition } from '../@Types/Condition';
|
|
9
9
|
import { CBRFormStep } from '../@Types/CBRFormStep';
|
|
10
|
-
export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) &
|
|
11
|
-
clearCache: () => void;
|
|
12
|
-
}> & {
|
|
10
|
+
export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & {
|
|
13
11
|
clearCache: () => void;
|
|
12
|
+
resultsCount: () => number;
|
|
13
|
+
resetResultsCount: () => void;
|
|
14
|
+
} & {
|
|
15
|
+
resultFunc: (resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any;
|
|
16
|
+
memoizedResultFunc: ((resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any) & {
|
|
17
|
+
clearCache: () => void;
|
|
18
|
+
resultsCount: () => number;
|
|
19
|
+
resetResultsCount: () => void;
|
|
20
|
+
};
|
|
21
|
+
lastResult: () => any;
|
|
22
|
+
dependencies: [(state: RootState) => ValuesStore, (_state: RootState, step: GBaseStep) => GBaseStep];
|
|
23
|
+
recomputations: () => number;
|
|
24
|
+
resetRecomputations: () => void;
|
|
25
|
+
dependencyRecomputations: () => number;
|
|
26
|
+
resetDependencyRecomputations: () => void;
|
|
27
|
+
} & {
|
|
28
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
29
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
14
30
|
};
|
|
15
31
|
export interface StepDependency {
|
|
16
32
|
originalValue: any;
|
|
17
33
|
isDependency: boolean;
|
|
18
|
-
handleStepDep: (value: any
|
|
34
|
+
handleStepDep: (value: any) => void;
|
|
19
35
|
}
|
|
20
36
|
export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
|
|
21
|
-
export declare const selectStepDependencies: ((state: RootState,
|
|
22
|
-
invalids: string[];
|
|
23
|
-
emptyDep: boolean;
|
|
24
|
-
}) & import("reselect").OutputSelectorFields<(args_0: DependencyStore, args_1: GBaseStep, args_2: Form) => {
|
|
37
|
+
export declare const selectStepDependencies: ((state: RootState, _step: GBaseStep, form: Form) => {
|
|
25
38
|
invalids: string[];
|
|
26
39
|
emptyDep: boolean;
|
|
27
|
-
}
|
|
28
|
-
clearCache: () => void;
|
|
29
|
-
}> & {
|
|
40
|
+
}) & {
|
|
30
41
|
clearCache: () => void;
|
|
42
|
+
resultsCount: () => number;
|
|
43
|
+
resetResultsCount: () => void;
|
|
44
|
+
} & {
|
|
45
|
+
resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
|
|
46
|
+
invalids: string[];
|
|
47
|
+
emptyDep: boolean;
|
|
48
|
+
};
|
|
49
|
+
memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
|
|
50
|
+
invalids: string[];
|
|
51
|
+
emptyDep: boolean;
|
|
52
|
+
}) & {
|
|
53
|
+
clearCache: () => void;
|
|
54
|
+
resultsCount: () => number;
|
|
55
|
+
resetResultsCount: () => void;
|
|
56
|
+
};
|
|
57
|
+
lastResult: () => {
|
|
58
|
+
invalids: string[];
|
|
59
|
+
emptyDep: boolean;
|
|
60
|
+
};
|
|
61
|
+
dependencies: [(state: RootState) => DependencyStore, (_state: RootState, step: GBaseStep) => GBaseStep, (_state: RootState, _step: GBaseStep, form: Form) => Form];
|
|
62
|
+
recomputations: () => number;
|
|
63
|
+
resetRecomputations: () => void;
|
|
64
|
+
dependencyRecomputations: () => number;
|
|
65
|
+
resetDependencyRecomputations: () => void;
|
|
66
|
+
} & {
|
|
67
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
68
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
31
69
|
};
|
|
32
70
|
export interface UseFormStepOptions<ValueType> {
|
|
33
71
|
defaultValue: ValueType;
|
|
@@ -45,10 +83,26 @@ export interface FormStepFunctions<ValueType = unknown> {
|
|
|
45
83
|
field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
|
|
46
84
|
}
|
|
47
85
|
export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue }: UseFormStepOptions<ValueType>) => FormStepFunctions<ValueType>;
|
|
48
|
-
export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) &
|
|
49
|
-
clearCache: () => void;
|
|
50
|
-
}> & {
|
|
86
|
+
export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & {
|
|
51
87
|
clearCache: () => void;
|
|
88
|
+
resultsCount: () => number;
|
|
89
|
+
resetResultsCount: () => void;
|
|
90
|
+
} & {
|
|
91
|
+
resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore;
|
|
92
|
+
memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore) & {
|
|
93
|
+
clearCache: () => void;
|
|
94
|
+
resultsCount: () => number;
|
|
95
|
+
resetResultsCount: () => void;
|
|
96
|
+
};
|
|
97
|
+
lastResult: () => DependencyStore;
|
|
98
|
+
dependencies: [(state: RootState) => DependencyStore, (_state: RootState, idDeps: string[] | undefined) => string[]];
|
|
99
|
+
recomputations: () => number;
|
|
100
|
+
resetRecomputations: () => void;
|
|
101
|
+
dependencyRecomputations: () => number;
|
|
102
|
+
resetDependencyRecomputations: () => void;
|
|
103
|
+
} & {
|
|
104
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
105
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
52
106
|
};
|
|
53
107
|
export declare const useCondition: (condition?: Condition) => boolean;
|
|
54
108
|
export declare const calcStepDeps: (step: FormStep | CBRFormStep) => string[];
|
|
@@ -1,137 +1,96 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
-
if (ar || !(i in from)) {
|
|
26
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
-
ar[i] = from[i];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
-
};
|
|
32
1
|
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
33
2
|
import { useAppSelector, useAppDispatch } from '../hooks';
|
|
34
|
-
import { clearDependency, setStepDependency
|
|
3
|
+
import { clearDependency, setStepDependency } from '../States/SiteSlice';
|
|
35
4
|
import { createSelector } from '@reduxjs/toolkit';
|
|
36
5
|
import { calcDefaultValue, evaluateCondition } from './StepFunctions';
|
|
37
|
-
import { useController
|
|
38
|
-
import { SizeChangeContext } from './Utils/@StepFiller/StepFiller';
|
|
6
|
+
import { useController } from 'react-hook-form';
|
|
39
7
|
import ConditionTypes from '../constants/ConditionTypes';
|
|
40
8
|
import FormStepTypes, { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueOptionTypes, } from '../constants/FormStepTypes';
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
import { SizeChangeContext } from './Utils/@StepFiller/StepFillerContext';
|
|
10
|
+
const selectIsDependency = createSelector([
|
|
11
|
+
(state) => state.site.dependencies,
|
|
12
|
+
(_state, step) => step,
|
|
13
|
+
], (dependencies, step) => {
|
|
45
14
|
return dependencies[step.id] !== undefined;
|
|
46
15
|
});
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var isDependency = useAppSelector(function (state) {
|
|
54
|
-
return selectIsDependency(state, step);
|
|
55
|
-
});
|
|
56
|
-
var originalValue = useAppSelector(function (state) {
|
|
57
|
-
return selectOriginalValue(state, step);
|
|
58
|
-
});
|
|
59
|
-
var dispatch = useAppDispatch();
|
|
60
|
-
useEffect(function () {
|
|
16
|
+
export const selectOriginalValue = createSelector([(state) => state.site.values, (_state, step) => step], (values, step) => values.sections[step?.idSection]?.[step?.id]);
|
|
17
|
+
export const useStepDependency = (step, defaultValue) => {
|
|
18
|
+
const isDependency = useAppSelector((state) => selectIsDependency(state, step));
|
|
19
|
+
const originalValue = useAppSelector((state) => selectOriginalValue(state, step));
|
|
20
|
+
const dispatch = useAppDispatch();
|
|
21
|
+
useEffect(() => {
|
|
61
22
|
if (isDependency && !originalValue && defaultValue) {
|
|
62
23
|
dispatch(setStepDependency({
|
|
63
|
-
step
|
|
24
|
+
step,
|
|
64
25
|
value: defaultValue,
|
|
65
26
|
}));
|
|
66
27
|
}
|
|
67
|
-
return
|
|
28
|
+
return () => {
|
|
68
29
|
dispatch(clearDependency(step));
|
|
69
30
|
};
|
|
70
31
|
}, [isDependency]);
|
|
71
|
-
|
|
32
|
+
const handleStepDep = useCallback((value) => {
|
|
72
33
|
if (!isDependency)
|
|
73
34
|
return;
|
|
74
35
|
dispatch(setStepDependency({
|
|
75
|
-
step
|
|
76
|
-
value: value
|
|
36
|
+
step,
|
|
37
|
+
value: value ?? null,
|
|
77
38
|
}));
|
|
78
39
|
}, [step.id, step.type, isDependency]);
|
|
79
40
|
return {
|
|
80
|
-
handleStepDep
|
|
81
|
-
isDependency
|
|
82
|
-
originalValue:
|
|
41
|
+
handleStepDep,
|
|
42
|
+
isDependency,
|
|
43
|
+
originalValue: originalValue ?? defaultValue ?? calcDefaultValue(step),
|
|
83
44
|
};
|
|
84
45
|
};
|
|
85
|
-
export
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
],
|
|
90
|
-
|
|
91
|
-
|
|
46
|
+
export const selectStepDependencies = createSelector([
|
|
47
|
+
(state) => state.site.dependencies,
|
|
48
|
+
(_state, step) => step,
|
|
49
|
+
(_state, _step, form) => form,
|
|
50
|
+
], (dependencies, step, form) => {
|
|
51
|
+
const invalids = [];
|
|
52
|
+
let emptyDep = false;
|
|
92
53
|
/** Show deep error changes even if not in dependencies */
|
|
93
|
-
for (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if ((dependency === null || dependency === void 0 ? void 0 : dependency.value) === null && form.steps[idDep]) {
|
|
54
|
+
for (const idDep of calcDeepDependencies(step.id, form)) {
|
|
55
|
+
const dependency = dependencies[idDep];
|
|
56
|
+
if (dependency?.value === null && form.steps[idDep]) {
|
|
97
57
|
invalids.push(idDep);
|
|
98
58
|
}
|
|
99
|
-
if (dependency
|
|
59
|
+
if (dependency?.empty)
|
|
100
60
|
emptyDep = true;
|
|
101
61
|
}
|
|
102
|
-
return { invalids
|
|
62
|
+
return { invalids, emptyDep };
|
|
103
63
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
for (var _i = 0, _a = step.dependencies; _i < _a.length; _i++) {
|
|
109
|
-
var dep = _a[_i];
|
|
64
|
+
const calcDeepDependencies = (idStep, form, deps = []) => {
|
|
65
|
+
const step = form.steps[idStep];
|
|
66
|
+
if (step?.dependencies) {
|
|
67
|
+
for (const dep of step.dependencies) {
|
|
110
68
|
if (!deps.includes(dep)) {
|
|
111
|
-
deps.push
|
|
69
|
+
deps.push(...calcDeepDependencies(dep, form, deps), dep);
|
|
112
70
|
}
|
|
113
71
|
}
|
|
114
72
|
}
|
|
115
73
|
return deps;
|
|
116
74
|
};
|
|
117
|
-
export
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var _d = useController({
|
|
75
|
+
export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue }) => {
|
|
76
|
+
const [timer, setTimer] = useState();
|
|
77
|
+
const { isDependency, handleStepDep, originalValue } = useStepDependency(step, defaultValue);
|
|
78
|
+
const { field: { ref, value, onChange: fieldOnChange, ...field }, fieldState: { error }, } = useController({
|
|
122
79
|
name: step.id,
|
|
123
|
-
rules
|
|
80
|
+
rules,
|
|
124
81
|
shouldUnregister: true,
|
|
125
82
|
defaultValue: originalValue,
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
83
|
+
});
|
|
84
|
+
const handleSizeChange = useContext(SizeChangeContext);
|
|
85
|
+
const onChange = useCallback((value) => {
|
|
129
86
|
if (isDependency) {
|
|
130
87
|
if (debounce) {
|
|
131
|
-
|
|
88
|
+
try {
|
|
132
89
|
clearTimeout(timer);
|
|
90
|
+
// eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars
|
|
133
91
|
}
|
|
134
|
-
|
|
92
|
+
catch (e) { }
|
|
93
|
+
setTimer(setTimeout(() => {
|
|
135
94
|
handleStepDep(value);
|
|
136
95
|
setTimer(undefined);
|
|
137
96
|
}, 1000));
|
|
@@ -142,96 +101,73 @@ export var useFormStep = function (step, _a) {
|
|
|
142
101
|
}
|
|
143
102
|
fieldOnChange(value);
|
|
144
103
|
if (sizeChange)
|
|
145
|
-
handleSizeChange
|
|
146
|
-
}, [
|
|
147
|
-
handleStepDep,
|
|
148
|
-
isDependency,
|
|
149
|
-
fieldOnChange,
|
|
150
|
-
timer,
|
|
151
|
-
debounce,
|
|
152
|
-
sizeChange,
|
|
153
|
-
handleSizeChange,
|
|
154
|
-
]);
|
|
104
|
+
handleSizeChange?.();
|
|
105
|
+
}, [handleStepDep, isDependency, fieldOnChange]);
|
|
155
106
|
return {
|
|
156
|
-
ref
|
|
157
|
-
value
|
|
158
|
-
onChange
|
|
159
|
-
error
|
|
160
|
-
field
|
|
107
|
+
ref,
|
|
108
|
+
value,
|
|
109
|
+
onChange,
|
|
110
|
+
error,
|
|
111
|
+
field,
|
|
161
112
|
};
|
|
162
113
|
};
|
|
163
|
-
|
|
164
|
-
export
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
]
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
export var useCondition = function (condition) {
|
|
176
|
-
var ids = useMemo(function () { return recursivelyCalcConditionSteps(condition); }, []);
|
|
177
|
-
var dependencies = useAppSelector(function (state) {
|
|
178
|
-
return selectDependencies(state, ids);
|
|
179
|
-
});
|
|
180
|
-
return useMemo(function () {
|
|
114
|
+
const EMPTY_ARRAY = [];
|
|
115
|
+
export const selectDependencies = createSelector([
|
|
116
|
+
(state) => state.site.dependencies,
|
|
117
|
+
(_state, idDeps) => idDeps ?? EMPTY_ARRAY,
|
|
118
|
+
], (dependencies, idDeps) => idDeps.reduce((acc, idDep) => ({
|
|
119
|
+
...acc,
|
|
120
|
+
[idDep]: dependencies[idDep],
|
|
121
|
+
}), {}));
|
|
122
|
+
export const useCondition = (condition) => {
|
|
123
|
+
const ids = useMemo(() => recursivelyCalcConditionSteps(condition), []);
|
|
124
|
+
const dependencies = useAppSelector((state) => selectDependencies(state, ids));
|
|
125
|
+
return useMemo(() => {
|
|
181
126
|
return !condition || evaluateCondition(condition, dependencies);
|
|
182
|
-
}, ids.map(
|
|
127
|
+
}, ids.map((id) => dependencies[id].value));
|
|
183
128
|
};
|
|
184
|
-
export
|
|
185
|
-
|
|
186
|
-
var dependencies = __spreadArray([], ((_a = step.dependencies) !== null && _a !== void 0 ? _a : []), true);
|
|
129
|
+
export const calcStepDeps = (step) => {
|
|
130
|
+
const dependencies = [...(step.dependencies ?? [])];
|
|
187
131
|
if (step.condition) {
|
|
188
|
-
dependencies.push
|
|
132
|
+
dependencies.push(...recursivelyCalcConditionSteps(step.condition));
|
|
189
133
|
}
|
|
190
134
|
switch (step.type) {
|
|
191
135
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
192
136
|
{
|
|
193
|
-
for (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
option.condition) {
|
|
197
|
-
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
137
|
+
for (const option of Object.values(step.options)) {
|
|
138
|
+
if (option.type !== ClassifierOptionTypes.HIDE && option.condition) {
|
|
139
|
+
dependencies.push(...recursivelyCalcConditionSteps(option.condition));
|
|
198
140
|
}
|
|
199
141
|
}
|
|
200
142
|
}
|
|
201
143
|
break;
|
|
202
144
|
case FormStepTypes.ENTITYVALUEPICKER:
|
|
203
145
|
{
|
|
204
|
-
for (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
option.condition) {
|
|
208
|
-
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
146
|
+
for (const option of Object.values(step.options)) {
|
|
147
|
+
if (option.type !== EntityValueOptionTypes.HIDE && option.condition) {
|
|
148
|
+
dependencies.push(...recursivelyCalcConditionSteps(option.condition));
|
|
209
149
|
}
|
|
210
150
|
}
|
|
211
151
|
if (step.dialogs)
|
|
212
|
-
for (
|
|
213
|
-
|
|
214
|
-
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(dialog.condition));
|
|
152
|
+
for (const dialog of Object.values(step.dialogs)) {
|
|
153
|
+
dependencies.push(...recursivelyCalcConditionSteps(dialog.condition));
|
|
215
154
|
}
|
|
216
155
|
}
|
|
217
156
|
break;
|
|
218
157
|
case FormStepTypes.API_SELECTOR:
|
|
219
158
|
{
|
|
220
|
-
for (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
option.condition) {
|
|
224
|
-
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
159
|
+
for (const option of Object.values(step.options)) {
|
|
160
|
+
if (option.type !== ApiSelectorOptionTypes.HIDE && option.condition) {
|
|
161
|
+
dependencies.push(...recursivelyCalcConditionSteps(option.condition));
|
|
225
162
|
}
|
|
226
163
|
}
|
|
227
164
|
}
|
|
228
165
|
break;
|
|
229
166
|
case FormStepTypes.SELECTOR:
|
|
230
167
|
{
|
|
231
|
-
for (
|
|
232
|
-
var option = _k[_j];
|
|
168
|
+
for (const option of Object.values(step.options)) {
|
|
233
169
|
if (option.condition) {
|
|
234
|
-
dependencies.push
|
|
170
|
+
dependencies.push(...recursivelyCalcConditionSteps(option.condition));
|
|
235
171
|
}
|
|
236
172
|
}
|
|
237
173
|
}
|
|
@@ -241,14 +177,12 @@ export var calcStepDeps = function (step) {
|
|
|
241
177
|
}
|
|
242
178
|
return dependencies;
|
|
243
179
|
};
|
|
244
|
-
export
|
|
180
|
+
export const recursivelyCalcConditionSteps = (condition) => {
|
|
245
181
|
if (!condition)
|
|
246
182
|
return [];
|
|
247
183
|
switch (condition.type) {
|
|
248
184
|
case ConditionTypes.EXPRESSION: {
|
|
249
|
-
return condition.conditions
|
|
250
|
-
.map(function (condition) { return recursivelyCalcConditionSteps(condition); })
|
|
251
|
-
.flat();
|
|
185
|
+
return condition.conditions.map((condition) => recursivelyCalcConditionSteps(condition)).flat();
|
|
252
186
|
}
|
|
253
187
|
case ConditionTypes.FORM_STEP: {
|
|
254
188
|
return [condition.idStep];
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
.
|
|
1
|
+
.Erk-DraftContainer {
|
|
2
2
|
font: inherit;
|
|
3
3
|
font-size: 1rem;
|
|
4
4
|
}
|
|
5
5
|
.postview-editor {
|
|
6
6
|
cursor: default !important;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
.Erk-DraftContainer .DraftEditor-root {
|
|
9
9
|
height: unset;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.
|
|
12
|
+
.Erk-DraftContainer .rdw-option-wrapper {
|
|
13
13
|
border-radius: 7px;
|
|
14
14
|
border: 1px solid var(--eureka-outline);
|
|
15
15
|
background-color: transparent;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.
|
|
18
|
+
.Erk-DraftContainer .rdw-option-wrapper:active {
|
|
19
19
|
border: 1px solid var(--eureka-primary);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.Erk-DraftContainer .rdw-option-wrapper:hover {
|
|
22
22
|
box-shadow: none;
|
|
23
23
|
border: 1px solid var(--eureka-primary);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.Erk-DraftContainer .rdw-option-active {
|
|
27
27
|
border: 1px solid var(--eureka-primary);
|
|
28
28
|
box-shadow: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
31
|
+
.Erk-DraftContainer .rdw-editor-toolbar {
|
|
32
32
|
border-radius: 15px 15px 0 0;
|
|
33
33
|
border: none;
|
|
34
34
|
border-bottom: 1px solid var(--eureka-outline);
|
|
@@ -39,38 +39,38 @@
|
|
|
39
39
|
pointer-events: none;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.
|
|
42
|
+
.Erk-DraftContainer .rdw-editor-main {
|
|
43
43
|
cursor: text;
|
|
44
44
|
padding-top: 12px;
|
|
45
45
|
padding-bottom: 40px;
|
|
46
46
|
margin-right: 0px;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.
|
|
49
|
+
.Erk-DraftContainer .public-DraftStyleDefault-block {
|
|
50
50
|
margin: 0px 0;
|
|
51
51
|
max-width: 100%;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.
|
|
54
|
+
.Erk-DraftContainer .rdw-image-imagewrapper {
|
|
55
55
|
max-width: 100%;
|
|
56
56
|
/* cursor: pointer; */
|
|
57
57
|
position: relative;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
60
|
+
.Erk-DraftContainer .rdw-image-alignment-editor {
|
|
61
61
|
padding-right: 10px;
|
|
62
62
|
padding-left: 5px;
|
|
63
63
|
margin-left: -5px;
|
|
64
64
|
}
|
|
65
|
-
.
|
|
66
|
-
border: 1px solid var(--
|
|
65
|
+
.Erk-DraftContainer .rdw-editing-image {
|
|
66
|
+
border: 1px solid var(--eureka-primary);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.
|
|
69
|
+
.Erk-DraftContainer .DraftEditor-root figure {
|
|
70
70
|
margin: 0px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.
|
|
73
|
+
.Erk-DraftContainer .rdw-image-alignment-option {
|
|
74
74
|
font-size: 16px !important;
|
|
75
75
|
width: 20px;
|
|
76
76
|
height: 20px;
|
|
@@ -80,17 +80,15 @@
|
|
|
80
80
|
display: flex;
|
|
81
81
|
align-items: center;
|
|
82
82
|
justify-content: center;
|
|
83
|
-
border: 1px solid var(--
|
|
83
|
+
border: 1px solid var(--eureka-outline);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
86
|
+
.Erk-DraftContainer .rdw-image-alignment-options-popup {
|
|
87
87
|
width: fit-content;
|
|
88
88
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/* Hides empty placeholder */
|
|
92
|
-
.
|
|
93
|
-
.RichEditor-hidePlaceholder
|
|
94
|
-
.public-DraftEditorPlaceholder-root {
|
|
92
|
+
.Erk-DraftContainer .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root {
|
|
95
93
|
display: none;
|
|
96
94
|
}
|