@arquimedes.co/eureka-forms 3.0.33-test → 3.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/Condition.d.ts +6 -4
- package/dist/@Types/ErkValue.d.ts +16 -0
- package/dist/@Types/Form.d.ts +1 -0
- package/dist/@Types/FormStep.d.ts +12 -8
- package/dist/@Types/GenericFormSteps.d.ts +0 -8
- package/dist/@Types/User.d.ts +13 -0
- package/dist/App/App.d.ts +3 -1
- package/dist/App/App.js +46 -21
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +336 -177
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +252 -146
- package/dist/Contexts/CustomContext.d.ts +1 -0
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +2 -3
- package/dist/Contexts/SectionContext.d.ts +1 -0
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +62 -36
- package/dist/Form/Form.d.ts +2 -1
- package/dist/Form/Form.js +164 -71
- package/dist/Form/Form.module.css +9 -0
- package/dist/Form/FormFunctions.js +112 -63
- package/dist/Form/FormHooks.d.ts +1 -0
- package/dist/Form/FormHooks.js +21 -13
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +105 -32
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +2 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +110 -46
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.js +23 -10
- package/dist/Form/Section/MaterialSection/MaterialSection.module.css +2 -0
- package/dist/Form/Section/Section.d.ts +1 -0
- package/dist/Form/Section/Section.js +15 -4
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -0
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +65 -30
- package/dist/Form/Terms/Term/Term.d.ts +1 -0
- package/dist/Form/Terms/Term/Term.js +13 -2
- package/dist/Form/Terms/Terms.d.ts +1 -0
- package/dist/Form/Terms/Terms.js +27 -11
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +107 -34
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +40 -12
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +77 -56
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +115 -45
- package/dist/FormSteps/AYFStepMapper.d.ts +1 -0
- package/dist/FormSteps/AYFStepMapper.js +137 -60
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +13 -2
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +173 -64
- package/dist/FormSteps/CBRStepMapper.d.ts +1 -0
- package/dist/FormSteps/CBRStepMapper.js +168 -56
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +13 -2
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +37 -19
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +13 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +2 -1
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +81 -44
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +26 -3
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +61 -31
- package/dist/FormSteps/CustomStep.d.ts +1 -0
- package/dist/FormSteps/CustomStep.js +31 -17
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +20 -9
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +13 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +32 -16
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +2 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +302 -106
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +95 -33
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +180 -85
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MapperStep.js +13 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +38 -16
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +31 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +175 -85
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +47 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +115 -70
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +2 -1
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +33 -15
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +1 -0
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +13 -2
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +31 -17
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/RatingStep.js +13 -2
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +61 -31
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/SelectorStep.js +13 -2
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -2
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +13 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +2 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +155 -73
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormSteps/Step.d.ts +1 -0
- package/dist/FormSteps/Step.js +58 -33
- package/dist/FormSteps/StepFunctions.d.ts +6 -4
- package/dist/FormSteps/StepFunctions.js +208 -153
- package/dist/FormSteps/StepHooks.d.ts +14 -68
- package/dist/FormSteps/StepHooks.js +154 -88
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +20 -18
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +74 -36
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +2 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +28 -12
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +14 -3
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +30 -12
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +2 -1
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +26 -9
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +1 -0
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +13 -2
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +54 -21
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/TitleStep.js +13 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +2 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +27 -14
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +3 -2
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +23 -8
- package/dist/Icons/@IconTypes.d.ts +7 -0
- package/dist/Icons/CalendarIcon.d.ts +3 -2
- package/dist/Icons/CalendarIcon.js +14 -4
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +13 -3
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +13 -3
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +13 -3
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +13 -3
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +13 -3
- package/dist/Icons/EmailIcon.d.ts +4 -0
- package/dist/Icons/EmailIcon.js +17 -0
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +13 -3
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +15 -5
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +15 -5
- package/dist/Icons/Entities/SchoolIcon.d.ts +2 -0
- package/dist/Icons/Entities/SchoolIcon.js +17 -0
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +15 -5
- package/dist/Icons/GroupIcon.d.ts +4 -0
- package/dist/Icons/GroupIcon.js +17 -0
- package/dist/Icons/LocationIcon.d.ts +3 -2
- package/dist/Icons/LocationIcon.js +14 -4
- package/dist/Icons/LockedIcon.d.ts +4 -0
- package/dist/Icons/LockedIcon.js +17 -0
- package/dist/Icons/PersonIcon.d.ts +3 -2
- package/dist/Icons/PersonIcon.js +16 -6
- package/dist/Login/Login.module.css +135 -0
- package/dist/Login/LoginLayout.module.css +68 -0
- package/dist/Login/LoginPage.d.ts +11 -0
- package/dist/Login/LoginPage.js +177 -0
- package/dist/Login/LoginTextField.d.ts +15 -0
- package/dist/Login/LoginTextField.js +134 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +72 -22
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +86 -29
- package/dist/Services/FormService.js +56 -11
- package/dist/Services/IntegrationService.d.ts +21 -0
- package/dist/Services/IntegrationService.js +69 -0
- package/dist/Services/OrganizationService.js +62 -11
- package/dist/Services/UserService.d.ts +10 -0
- package/dist/Services/UserService.js +71 -0
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +2 -1
- package/dist/Shared/CustomBtn/CustomBtn.js +88 -24
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +112 -29
- package/dist/Shared/Loader/Loader.d.ts +1 -0
- package/dist/Shared/Loader/Loader.js +18 -6
- package/dist/Shared/Navbar/Navbar.d.ts +3 -1
- package/dist/Shared/Navbar/Navbar.js +96 -3
- package/dist/Shared/Navbar/Navbar.module.css +15 -0
- package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/Shared/Navbar/Navbar.stories.js +2 -2
- package/dist/Shared/Rating/Rating.d.ts +5 -3
- package/dist/Shared/Rating/Rating.js +27 -4
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +19 -13
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/LikeRating.js +33 -19
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +47 -27
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/ScaleRating.js +54 -23
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +30 -0
- package/dist/Shared/RoundedButton/RoundedButton.js +45 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +49 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +351 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +43 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +226 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +68 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.js +214 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +236 -0
- package/dist/Shared/{ErkSmartSelect/ErkSmartSelect.stories.d.ts → RoundedSmartSelect/RoundedSmartSelect.stories.d.ts} +13 -3
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +45 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.js +175 -0
- package/dist/Shared/{ErkTextField/ErkTextField.stories.d.ts → RoundedTextField/RoundedTextField.stories.d.ts} +17 -4
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +224 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +41 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +314 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +22 -8
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +60 -0
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +43 -27
- package/dist/Shared/Toggle/Toggle.d.ts +14 -5
- package/dist/Shared/Toggle/Toggle.js +32 -29
- package/dist/States/GlobalSlice.d.ts +12 -7
- package/dist/States/GlobalSlice.js +22 -6
- package/dist/States/SiteSlice.d.ts +48 -30
- package/dist/States/SiteSlice.js +76 -58
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +9 -8
- package/dist/Utils/AxiosAPI.d.ts +5 -4
- package/dist/Utils/AxiosAPI.js +73 -23
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +30 -29
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +143 -102
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +45 -27
- package/dist/Utils/MaterialProviders.d.ts +1 -21
- package/dist/Utils/MaterialProviders.js +28 -46
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +81 -60
- package/dist/Utils/TestUtils.js +57 -28
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +8 -10
- package/dist/Utils/store.d.ts +17 -9
- package/dist/Utils/store.js +74 -15
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +26 -16
- package/dist/__mocks__/axios.d.ts +2 -0
- package/dist/__mocks__/axios.js +2 -0
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/ErkValueTypes.d.ts +6 -0
- package/dist/constants/ErkValueTypes.js +7 -0
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/FormStepTypes.d.ts +2 -2
- package/dist/constants/FormStepTypes.js +1 -1
- package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
- package/dist/constants/IconTypes.js +18 -0
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
- package/dist/constants/MaterialClassNameSeed.js +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +77 -14
- package/dist/index.js +31 -0
- package/dist/index.lib.d.ts +1 -0
- package/dist/index.lib.js +1 -0
- package/package.json +125 -104
- package/dist/App/AppFunctions.test.js +0 -708
- package/dist/App/AppHooks.test.js +0 -154
- package/dist/Form/FormFunctions.test.js +0 -458
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +0 -10
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +0 -14
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +0 -3
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +0 -34
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
- package/dist/FormSteps/StepFunctions.test.js +0 -702
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +0 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +0 -2
- package/dist/Icons/@ErkIcon.d.ts +0 -14
- package/dist/Icons/@ErkIcon.js +0 -9
- package/dist/Icons/ArrowLeftIcon.d.ts +0 -3
- package/dist/Icons/ArrowLeftIcon.js +0 -7
- package/dist/Icons/ArrowRightIcon.d.ts +0 -3
- package/dist/Icons/ArrowRightIcon.js +0 -7
- package/dist/Icons/CheckCircleIcon.d.ts +0 -3
- package/dist/Icons/CheckCircleIcon.js +0 -7
- package/dist/Icons/CheckboxCheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxCheckedIcon.js +0 -7
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxUncheckedIcon.js +0 -7
- package/dist/Icons/ClockIcon.d.ts +0 -3
- package/dist/Icons/ClockIcon.js +0 -7
- package/dist/Icons/CloseIcon.d.ts +0 -3
- package/dist/Icons/CloseIcon.js +0 -7
- package/dist/Icons/DeleteIcon.d.ts +0 -3
- package/dist/Icons/DeleteIcon.js +0 -7
- package/dist/Icons/Entities/WorkIcon.d.ts +0 -3
- package/dist/Icons/Entities/WorkIcon.js +0 -7
- package/dist/Icons/ErrorIcon.d.ts +0 -3
- package/dist/Icons/ErrorIcon.js +0 -7
- package/dist/Icons/ExpandLessIcon.d.ts +0 -3
- package/dist/Icons/ExpandLessIcon.js +0 -7
- package/dist/Icons/ExpandMoreIcon.d.ts +0 -3
- package/dist/Icons/ExpandMoreIcon.js +0 -7
- package/dist/Icons/FileIcon.d.ts +0 -3
- package/dist/Icons/FileIcon.js +0 -7
- package/dist/Icons/InfoIcon.d.ts +0 -3
- package/dist/Icons/InfoIcon.js +0 -7
- package/dist/Icons/Ratings/DislikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DislikeIcon.js +0 -7
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/LikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/LikeIcon.js +0 -7
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/SatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/StarIcon.d.ts +0 -3
- package/dist/Icons/Ratings/StarIcon.js +0 -7
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +0 -7
- package/dist/Icons/WarningIcon.d.ts +0 -3
- package/dist/Icons/WarningIcon.js +0 -7
- package/dist/Init.d.ts +0 -1
- package/dist/Init.js +0 -2
- package/dist/Shared/ErkButton/ErkButton.d.ts +0 -25
- package/dist/Shared/ErkButton/ErkButton.js +0 -31
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
- package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +0 -19
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +0 -31
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +0 -18
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +0 -266
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +0 -18
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +0 -162
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +0 -36
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +0 -274
- package/dist/Shared/ErkMenuItem.d.ts +0 -4
- package/dist/Shared/ErkMenuItem.js +0 -18
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
- package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
- package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
- package/dist/Utils/LocaleUtils.d.ts +0 -2
- package/dist/Utils/LocaleUtils.js +0 -12
- package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
- package/dist/Utils/MuiClassnameSetup.js +0 -3
- package/dist/constants/ErkIconTypes.js +0 -16
- package/dist/index.css +0 -15
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -25
- /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
- /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
- /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
- /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
- /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
- /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
|
@@ -7,65 +7,27 @@ 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) & {
|
|
10
|
+
export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & import("reselect").OutputSelectorFields<(args_0: ValuesStore, args_1: GBaseStep) => any, {
|
|
11
|
+
clearCache: () => void;
|
|
12
|
+
}> & {
|
|
11
13
|
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;
|
|
30
14
|
};
|
|
31
15
|
export interface StepDependency {
|
|
32
16
|
originalValue: any;
|
|
33
17
|
isDependency: boolean;
|
|
34
|
-
handleStepDep: (value: any) => void;
|
|
18
|
+
handleStepDep: (value: any | undefined) => void;
|
|
35
19
|
}
|
|
36
20
|
export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
|
|
37
|
-
export declare const selectStepDependencies: ((state: RootState,
|
|
21
|
+
export declare const selectStepDependencies: ((state: RootState, step: GBaseStep, form: Form) => {
|
|
22
|
+
invalids: string[];
|
|
23
|
+
emptyDep: boolean;
|
|
24
|
+
}) & import("reselect").OutputSelectorFields<(args_0: DependencyStore, args_1: GBaseStep, args_2: Form) => {
|
|
38
25
|
invalids: string[];
|
|
39
26
|
emptyDep: boolean;
|
|
40
|
-
}
|
|
27
|
+
}, {
|
|
28
|
+
clearCache: () => void;
|
|
29
|
+
}> & {
|
|
41
30
|
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;
|
|
69
31
|
};
|
|
70
32
|
export interface UseFormStepOptions<ValueType> {
|
|
71
33
|
defaultValue: ValueType;
|
|
@@ -83,26 +45,10 @@ export interface FormStepFunctions<ValueType = unknown> {
|
|
|
83
45
|
field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
|
|
84
46
|
}
|
|
85
47
|
export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue }: UseFormStepOptions<ValueType>) => FormStepFunctions<ValueType>;
|
|
86
|
-
export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & {
|
|
48
|
+
export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & import("reselect").OutputSelectorFields<(args_0: DependencyStore, args_1: string[]) => DependencyStore, {
|
|
49
|
+
clearCache: () => void;
|
|
50
|
+
}> & {
|
|
87
51
|
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;
|
|
106
52
|
};
|
|
107
53
|
export declare const useCondition: (condition?: Condition) => boolean;
|
|
108
54
|
export declare const calcStepDeps: (step: FormStep | CBRFormStep) => string[];
|
|
@@ -1,96 +1,137 @@
|
|
|
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
|
+
};
|
|
1
32
|
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
2
33
|
import { useAppSelector, useAppDispatch } from '../hooks';
|
|
3
|
-
import { clearDependency, setStepDependency } from '../States/SiteSlice';
|
|
34
|
+
import { clearDependency, setStepDependency, } from '../States/SiteSlice';
|
|
4
35
|
import { createSelector } from '@reduxjs/toolkit';
|
|
5
36
|
import { calcDefaultValue, evaluateCondition } from './StepFunctions';
|
|
6
|
-
import { useController } from 'react-hook-form';
|
|
37
|
+
import { useController, } from 'react-hook-form';
|
|
38
|
+
import { SizeChangeContext } from './Utils/@StepFiller/StepFiller';
|
|
7
39
|
import ConditionTypes from '../constants/ConditionTypes';
|
|
8
40
|
import FormStepTypes, { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueOptionTypes, } from '../constants/FormStepTypes';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(state)
|
|
12
|
-
|
|
13
|
-
], (dependencies, step) => {
|
|
41
|
+
var selectIsDependency = createSelector([
|
|
42
|
+
function (state) { return state.site.dependencies; },
|
|
43
|
+
function (state, step) { return step; },
|
|
44
|
+
], function (dependencies, step) {
|
|
14
45
|
return dependencies[step.id] !== undefined;
|
|
15
46
|
});
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
47
|
+
export var selectOriginalValue = createSelector([
|
|
48
|
+
function (state) { return state.site.values; },
|
|
49
|
+
function (state, step) { return step; },
|
|
50
|
+
], function (values, step) { var _a; return (_a = values.sections[step.idSection]) === null || _a === void 0 ? void 0 : _a[step.id]; });
|
|
51
|
+
export var useStepDependency = function (step, defaultValue) {
|
|
52
|
+
var _a;
|
|
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 () {
|
|
22
61
|
if (isDependency && !originalValue && defaultValue) {
|
|
23
62
|
dispatch(setStepDependency({
|
|
24
|
-
step,
|
|
63
|
+
step: step,
|
|
25
64
|
value: defaultValue,
|
|
26
65
|
}));
|
|
27
66
|
}
|
|
28
|
-
return ()
|
|
67
|
+
return function () {
|
|
29
68
|
dispatch(clearDependency(step));
|
|
30
69
|
};
|
|
31
70
|
}, [isDependency]);
|
|
32
|
-
|
|
71
|
+
var handleStepDep = useCallback(function (value) {
|
|
33
72
|
if (!isDependency)
|
|
34
73
|
return;
|
|
35
74
|
dispatch(setStepDependency({
|
|
36
|
-
step,
|
|
37
|
-
value: value
|
|
75
|
+
step: step,
|
|
76
|
+
value: value !== null && value !== void 0 ? value : null,
|
|
38
77
|
}));
|
|
39
78
|
}, [step.id, step.type, isDependency]);
|
|
40
79
|
return {
|
|
41
|
-
handleStepDep,
|
|
42
|
-
isDependency,
|
|
43
|
-
originalValue: originalValue
|
|
80
|
+
handleStepDep: handleStepDep,
|
|
81
|
+
isDependency: isDependency,
|
|
82
|
+
originalValue: (_a = originalValue !== null && originalValue !== void 0 ? originalValue : defaultValue) !== null && _a !== void 0 ? _a : calcDefaultValue(step),
|
|
44
83
|
};
|
|
45
84
|
};
|
|
46
|
-
export
|
|
47
|
-
(state)
|
|
48
|
-
(
|
|
49
|
-
(
|
|
50
|
-
], (dependencies, step, form)
|
|
51
|
-
|
|
52
|
-
|
|
85
|
+
export var selectStepDependencies = createSelector([
|
|
86
|
+
function (state) { return state.site.dependencies; },
|
|
87
|
+
function (state, step) { return step; },
|
|
88
|
+
function (state, step, form) { return form; },
|
|
89
|
+
], function (dependencies, step, form) {
|
|
90
|
+
var invalids = [];
|
|
91
|
+
var emptyDep = false;
|
|
53
92
|
/** Show deep error changes even if not in dependencies */
|
|
54
|
-
for (
|
|
55
|
-
|
|
56
|
-
|
|
93
|
+
for (var _i = 0, _a = calcDeepDependencies(step.id, form); _i < _a.length; _i++) {
|
|
94
|
+
var idDep = _a[_i];
|
|
95
|
+
var dependency = dependencies[idDep];
|
|
96
|
+
if ((dependency === null || dependency === void 0 ? void 0 : dependency.value) === null && form.steps[idDep]) {
|
|
57
97
|
invalids.push(idDep);
|
|
58
98
|
}
|
|
59
|
-
if (dependency
|
|
99
|
+
if (dependency === null || dependency === void 0 ? void 0 : dependency.empty)
|
|
60
100
|
emptyDep = true;
|
|
61
101
|
}
|
|
62
|
-
return { invalids, emptyDep };
|
|
102
|
+
return { invalids: invalids, emptyDep: emptyDep };
|
|
63
103
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
104
|
+
var calcDeepDependencies = function (idStep, form, deps) {
|
|
105
|
+
if (deps === void 0) { deps = []; }
|
|
106
|
+
var step = form.steps[idStep];
|
|
107
|
+
if (step === null || step === void 0 ? void 0 : step.dependencies) {
|
|
108
|
+
for (var _i = 0, _a = step.dependencies; _i < _a.length; _i++) {
|
|
109
|
+
var dep = _a[_i];
|
|
68
110
|
if (!deps.includes(dep)) {
|
|
69
|
-
deps.push(
|
|
111
|
+
deps.push.apply(deps, __spreadArray(__spreadArray([], calcDeepDependencies(dep, form, deps), false), [dep], false));
|
|
70
112
|
}
|
|
71
113
|
}
|
|
72
114
|
}
|
|
73
115
|
return deps;
|
|
74
116
|
};
|
|
75
|
-
export
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
117
|
+
export var useFormStep = function (step, _a) {
|
|
118
|
+
var rules = _a.rules, debounce = _a.debounce, sizeChange = _a.sizeChange, defaultValue = _a.defaultValue;
|
|
119
|
+
var _b = useState(), timer = _b[0], setTimer = _b[1];
|
|
120
|
+
var _c = useStepDependency(step, defaultValue), isDependency = _c.isDependency, handleStepDep = _c.handleStepDep, originalValue = _c.originalValue;
|
|
121
|
+
var _d = useController({
|
|
79
122
|
name: step.id,
|
|
80
|
-
rules,
|
|
123
|
+
rules: rules,
|
|
81
124
|
shouldUnregister: true,
|
|
82
125
|
defaultValue: originalValue,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
|
|
126
|
+
}), _e = _d.field, ref = _e.ref, value = _e.value, fieldOnChange = _e.onChange, field = __rest(_e, ["ref", "value", "onChange"]), error = _d.fieldState.error;
|
|
127
|
+
var handleSizeChange = useContext(SizeChangeContext);
|
|
128
|
+
var onChange = useCallback(function (value) {
|
|
86
129
|
if (isDependency) {
|
|
87
130
|
if (debounce) {
|
|
88
|
-
|
|
131
|
+
if (timer) {
|
|
89
132
|
clearTimeout(timer);
|
|
90
|
-
// eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars
|
|
91
133
|
}
|
|
92
|
-
|
|
93
|
-
setTimer(setTimeout(() => {
|
|
134
|
+
setTimer(setTimeout(function () {
|
|
94
135
|
handleStepDep(value);
|
|
95
136
|
setTimer(undefined);
|
|
96
137
|
}, 1000));
|
|
@@ -101,73 +142,96 @@ export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue })
|
|
|
101
142
|
}
|
|
102
143
|
fieldOnChange(value);
|
|
103
144
|
if (sizeChange)
|
|
104
|
-
handleSizeChange
|
|
105
|
-
}, [
|
|
145
|
+
handleSizeChange === null || handleSizeChange === void 0 ? void 0 : handleSizeChange();
|
|
146
|
+
}, [
|
|
147
|
+
handleStepDep,
|
|
148
|
+
isDependency,
|
|
149
|
+
fieldOnChange,
|
|
150
|
+
timer,
|
|
151
|
+
debounce,
|
|
152
|
+
sizeChange,
|
|
153
|
+
handleSizeChange,
|
|
154
|
+
]);
|
|
106
155
|
return {
|
|
107
|
-
ref,
|
|
108
|
-
value,
|
|
109
|
-
onChange,
|
|
110
|
-
error,
|
|
111
|
-
field,
|
|
156
|
+
ref: ref,
|
|
157
|
+
value: value,
|
|
158
|
+
onChange: onChange,
|
|
159
|
+
error: error,
|
|
160
|
+
field: field,
|
|
112
161
|
};
|
|
113
162
|
};
|
|
114
|
-
|
|
115
|
-
export
|
|
116
|
-
(state)
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
163
|
+
var EMPTY_ARRAY = [];
|
|
164
|
+
export var selectDependencies = createSelector([
|
|
165
|
+
function (state) { return state.site.dependencies; },
|
|
166
|
+
function (state, idDeps) {
|
|
167
|
+
return idDeps !== null && idDeps !== void 0 ? idDeps : EMPTY_ARRAY;
|
|
168
|
+
},
|
|
169
|
+
], function (dependencies, idDeps) {
|
|
170
|
+
return idDeps.reduce(function (acc, idDep) {
|
|
171
|
+
var _a;
|
|
172
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[idDep] = dependencies[idDep], _a)));
|
|
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 () {
|
|
126
181
|
return !condition || evaluateCondition(condition, dependencies);
|
|
127
|
-
}, ids.map((id)
|
|
182
|
+
}, ids.map(function (id) { return dependencies[id].value; }));
|
|
128
183
|
};
|
|
129
|
-
export
|
|
130
|
-
|
|
184
|
+
export var calcStepDeps = function (step) {
|
|
185
|
+
var _a;
|
|
186
|
+
var dependencies = __spreadArray([], ((_a = step.dependencies) !== null && _a !== void 0 ? _a : []), true);
|
|
131
187
|
if (step.condition) {
|
|
132
|
-
dependencies.push(
|
|
188
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(step.condition));
|
|
133
189
|
}
|
|
134
190
|
switch (step.type) {
|
|
135
191
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
136
192
|
{
|
|
137
|
-
for (
|
|
138
|
-
|
|
139
|
-
|
|
193
|
+
for (var _i = 0, _b = Object.values(step.options); _i < _b.length; _i++) {
|
|
194
|
+
var option = _b[_i];
|
|
195
|
+
if (option.type !== ClassifierOptionTypes.HIDE &&
|
|
196
|
+
option.condition) {
|
|
197
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
140
198
|
}
|
|
141
199
|
}
|
|
142
200
|
}
|
|
143
201
|
break;
|
|
144
202
|
case FormStepTypes.ENTITYVALUEPICKER:
|
|
145
203
|
{
|
|
146
|
-
for (
|
|
147
|
-
|
|
148
|
-
|
|
204
|
+
for (var _c = 0, _d = Object.values(step.options); _c < _d.length; _c++) {
|
|
205
|
+
var option = _d[_c];
|
|
206
|
+
if (option.type !== EntityValueOptionTypes.HIDE &&
|
|
207
|
+
option.condition) {
|
|
208
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
149
209
|
}
|
|
150
210
|
}
|
|
151
211
|
if (step.dialogs)
|
|
152
|
-
for (
|
|
153
|
-
|
|
212
|
+
for (var _e = 0, _f = Object.values(step.dialogs); _e < _f.length; _e++) {
|
|
213
|
+
var dialog = _f[_e];
|
|
214
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(dialog.condition));
|
|
154
215
|
}
|
|
155
216
|
}
|
|
156
217
|
break;
|
|
157
218
|
case FormStepTypes.API_SELECTOR:
|
|
158
219
|
{
|
|
159
|
-
for (
|
|
160
|
-
|
|
161
|
-
|
|
220
|
+
for (var _g = 0, _h = Object.values(step.options); _g < _h.length; _g++) {
|
|
221
|
+
var option = _h[_g];
|
|
222
|
+
if (option.type !== ApiSelectorOptionTypes.HIDE &&
|
|
223
|
+
option.condition) {
|
|
224
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
162
225
|
}
|
|
163
226
|
}
|
|
164
227
|
}
|
|
165
228
|
break;
|
|
166
229
|
case FormStepTypes.SELECTOR:
|
|
167
230
|
{
|
|
168
|
-
for (
|
|
231
|
+
for (var _j = 0, _k = Object.values(step.options); _j < _k.length; _j++) {
|
|
232
|
+
var option = _k[_j];
|
|
169
233
|
if (option.condition) {
|
|
170
|
-
dependencies.push(
|
|
234
|
+
dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
|
|
171
235
|
}
|
|
172
236
|
}
|
|
173
237
|
}
|
|
@@ -177,12 +241,14 @@ export const calcStepDeps = (step) => {
|
|
|
177
241
|
}
|
|
178
242
|
return dependencies;
|
|
179
243
|
};
|
|
180
|
-
export
|
|
244
|
+
export var recursivelyCalcConditionSteps = function (condition) {
|
|
181
245
|
if (!condition)
|
|
182
246
|
return [];
|
|
183
247
|
switch (condition.type) {
|
|
184
248
|
case ConditionTypes.EXPRESSION: {
|
|
185
|
-
return condition.conditions
|
|
249
|
+
return condition.conditions
|
|
250
|
+
.map(function (condition) { return recursivelyCalcConditionSteps(condition); })
|
|
251
|
+
.flat();
|
|
186
252
|
}
|
|
187
253
|
case ConditionTypes.FORM_STEP: {
|
|
188
254
|
return [condition.idStep];
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
.
|
|
1
|
+
.EF-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
|
+
.EF-DraftContainer .DraftEditor-root {
|
|
9
9
|
height: unset;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
.
|
|
12
|
+
.EF-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
|
+
.EF-DraftContainer .rdw-option-wrapper:active {
|
|
19
19
|
border: 1px solid var(--eureka-primary);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.EF-DraftContainer .rdw-option-wrapper:hover {
|
|
22
22
|
box-shadow: none;
|
|
23
23
|
border: 1px solid var(--eureka-primary);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.EF-DraftContainer .rdw-option-active {
|
|
27
27
|
border: 1px solid var(--eureka-primary);
|
|
28
28
|
box-shadow: none;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.
|
|
31
|
+
.EF-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
|
+
.EF-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
|
+
.EF-DraftContainer .public-DraftStyleDefault-block {
|
|
50
50
|
margin: 0px 0;
|
|
51
51
|
max-width: 100%;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.
|
|
54
|
+
.EF-DraftContainer .rdw-image-imagewrapper {
|
|
55
55
|
max-width: 100%;
|
|
56
56
|
/* cursor: pointer; */
|
|
57
57
|
position: relative;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
60
|
+
.EF-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
|
+
.EF-DraftContainer .rdw-editing-image {
|
|
66
|
+
border: 1px solid var(--secondary);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
.
|
|
69
|
+
.EF-DraftContainer .DraftEditor-root figure {
|
|
70
70
|
margin: 0px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
.
|
|
73
|
+
.EF-DraftContainer .rdw-image-alignment-option {
|
|
74
74
|
font-size: 16px !important;
|
|
75
75
|
width: 20px;
|
|
76
76
|
height: 20px;
|
|
@@ -80,15 +80,17 @@
|
|
|
80
80
|
display: flex;
|
|
81
81
|
align-items: center;
|
|
82
82
|
justify-content: center;
|
|
83
|
-
border: 1px solid var(--
|
|
83
|
+
border: 1px solid var(--light-grey);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
.
|
|
86
|
+
.EF-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
|
-
.
|
|
92
|
+
.EF-DraftContainer
|
|
93
|
+
.RichEditor-hidePlaceholder
|
|
94
|
+
.public-DraftEditorPlaceholder-root {
|
|
93
95
|
display: none;
|
|
94
96
|
}
|