@arquimedes.co/eureka-forms 3.0.31-test → 3.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/Condition.d.ts +6 -4
- package/dist/@Types/ErkValue.d.ts +16 -0
- package/dist/@Types/Form.d.ts +1 -0
- package/dist/@Types/FormStep.d.ts +11 -4
- package/dist/@Types/User.d.ts +13 -0
- package/dist/App/App.d.ts +3 -1
- package/dist/App/App.js +46 -21
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +336 -177
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +252 -146
- package/dist/Contexts/CustomContext.d.ts +1 -0
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +2 -3
- package/dist/Contexts/SectionContext.d.ts +1 -0
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +62 -36
- package/dist/Form/Form.d.ts +2 -1
- package/dist/Form/Form.js +164 -71
- package/dist/Form/Form.module.css +9 -0
- package/dist/Form/FormFunctions.js +112 -63
- package/dist/Form/FormHooks.d.ts +1 -0
- package/dist/Form/FormHooks.js +21 -13
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +105 -32
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +2 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +110 -46
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.js +23 -10
- package/dist/Form/Section/MaterialSection/MaterialSection.module.css +2 -0
- package/dist/Form/Section/Section.d.ts +1 -0
- package/dist/Form/Section/Section.js +15 -4
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -0
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +65 -30
- package/dist/Form/Terms/Term/Term.d.ts +1 -0
- package/dist/Form/Terms/Term/Term.js +13 -2
- package/dist/Form/Terms/Terms.d.ts +1 -0
- package/dist/Form/Terms/Terms.js +27 -11
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +107 -34
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +40 -12
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +77 -56
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +115 -45
- package/dist/FormSteps/AYFStepMapper.d.ts +1 -0
- package/dist/FormSteps/AYFStepMapper.js +137 -60
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +13 -2
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +173 -64
- package/dist/FormSteps/CBRStepMapper.d.ts +1 -0
- package/dist/FormSteps/CBRStepMapper.js +168 -56
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +13 -2
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +37 -19
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +13 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +2 -1
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +81 -44
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +26 -3
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +61 -31
- package/dist/FormSteps/CustomStep.d.ts +1 -0
- package/dist/FormSteps/CustomStep.js +31 -17
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +20 -9
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +13 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +32 -16
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +2 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +300 -106
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +95 -33
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +180 -85
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MapperStep.js +13 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +38 -16
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +31 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +175 -85
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +47 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +115 -70
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +2 -1
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +33 -15
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +1 -0
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +13 -2
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +31 -17
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/RatingStep.js +13 -2
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +61 -31
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/SelectorStep.js +13 -2
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -2
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +13 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +2 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +155 -73
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormSteps/Step.d.ts +1 -0
- package/dist/FormSteps/Step.js +58 -29
- package/dist/FormSteps/StepFunctions.d.ts +6 -4
- package/dist/FormSteps/StepFunctions.js +208 -152
- 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 +1 -0
- 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 -1
- package/dist/constants/FormStepTypes.js +1 -0
- package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
- package/dist/constants/IconTypes.js +18 -0
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
- package/dist/constants/MaterialClassNameSeed.js +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +77 -14
- package/dist/index.js +31 -0
- package/dist/index.lib.d.ts +1 -0
- package/dist/index.lib.js +1 -0
- package/package.json +93 -72
- package/dist/App/AppFunctions.test.js +0 -708
- package/dist/App/AppHooks.test.js +0 -154
- package/dist/Form/FormFunctions.test.js +0 -458
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
- package/dist/FormSteps/StepFunctions.test.js +0 -695
- 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/ErkMenuItem.d.ts +0 -4
- package/dist/Shared/ErkMenuItem.js +0 -18
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
- package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
- package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
- package/dist/Utils/LocaleUtils.d.ts +0 -2
- package/dist/Utils/LocaleUtils.js +0 -12
- package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
- package/dist/Utils/MuiClassnameSetup.js +0 -3
- package/dist/constants/ErkIconTypes.js +0 -16
- package/dist/index.css +0 -15
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -25
- /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
- /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
- /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
- /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
- /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
- /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
|
@@ -1,32 +1,43 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import FormStepTypes, { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueDataTypes, EntityValueOptionTypes, OptionTypes, } from '../constants/FormStepTypes';
|
|
2
11
|
import CBRFormStepTypes from '../constants/CBRFormStepTypes';
|
|
3
12
|
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
4
13
|
import { getRawText } from '../Utils/DraftFunctions';
|
|
5
|
-
import ConditionTypes, { ExpressionTypes, OperatorTypes } from '../constants/ConditionTypes';
|
|
14
|
+
import ConditionTypes, { ExpressionTypes, OperatorTypes, } from '../constants/ConditionTypes';
|
|
6
15
|
import EntityPropertyTypes from '../constants/EntityPropertyTypes';
|
|
7
16
|
export function calcFillerSize(step, steps, values, size) {
|
|
8
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
var maxSize = (_a = step.maxSize) !== null && _a !== void 0 ? _a : size.blockNum;
|
|
9
19
|
if (maxSize < size.blockNum) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return size.blockSize * stepSize + size.spacingSize * (stepSize - 1) + 20;
|
|
20
|
+
var tsize = recursivelyCheckOpenSize(step.id, steps, values);
|
|
21
|
+
var stepSize = maxSize - tsize;
|
|
22
|
+
return (size.blockSize * stepSize + size.spacingSize * (stepSize - 1) + 20);
|
|
13
23
|
}
|
|
14
24
|
else {
|
|
15
25
|
return 0;
|
|
16
26
|
}
|
|
17
27
|
}
|
|
18
28
|
function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
var step = steps[idStep];
|
|
30
|
+
var value = values[idStep];
|
|
21
31
|
switch (step.type) {
|
|
22
32
|
case FormStepTypes.SELECTOR: {
|
|
23
|
-
|
|
33
|
+
var size = step.size;
|
|
24
34
|
if (value) {
|
|
25
|
-
|
|
26
|
-
if (currentOption
|
|
27
|
-
|
|
28
|
-
for (
|
|
29
|
-
|
|
35
|
+
var currentOption = step.options.find(function (option) { return option.value === value.value; });
|
|
36
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === OptionTypes.NESTED) {
|
|
37
|
+
var optionSize = 0;
|
|
38
|
+
for (var _i = 0, _a = currentOption.steps; _i < _a.length; _i++) {
|
|
39
|
+
var pStepId = _a[_i];
|
|
40
|
+
var temp = recursivelyCheckOpenSize(pStepId, steps, values);
|
|
30
41
|
optionSize += temp;
|
|
31
42
|
}
|
|
32
43
|
size += optionSize;
|
|
@@ -35,12 +46,13 @@ function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
35
46
|
return size;
|
|
36
47
|
}
|
|
37
48
|
case FormStepTypes.CLASSIFIER_SELECTOR: {
|
|
38
|
-
|
|
49
|
+
var size = step.size;
|
|
39
50
|
if (value) {
|
|
40
|
-
|
|
41
|
-
if (currentOption
|
|
42
|
-
|
|
43
|
-
for (
|
|
51
|
+
var currentOption = step.options[value];
|
|
52
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ClassifierOptionTypes.NESTED) {
|
|
53
|
+
var optionSize = 0;
|
|
54
|
+
for (var _b = 0, _c = currentOption.steps; _b < _c.length; _b++) {
|
|
55
|
+
var pStepId = _c[_b];
|
|
44
56
|
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
45
57
|
}
|
|
46
58
|
size += optionSize;
|
|
@@ -49,12 +61,13 @@ function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
49
61
|
return size;
|
|
50
62
|
}
|
|
51
63
|
case FormStepTypes.ENTITYVALUEPICKER: {
|
|
52
|
-
|
|
64
|
+
var size = step.size;
|
|
53
65
|
if (value) {
|
|
54
|
-
|
|
55
|
-
if (currentOption
|
|
56
|
-
|
|
57
|
-
for (
|
|
66
|
+
var currentOption = step.options[value];
|
|
67
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === EntityValueOptionTypes.NESTED) {
|
|
68
|
+
var optionSize = 0;
|
|
69
|
+
for (var _d = 0, _e = currentOption.steps; _d < _e.length; _d++) {
|
|
70
|
+
var pStepId = _e[_d];
|
|
58
71
|
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
59
72
|
}
|
|
60
73
|
size += optionSize;
|
|
@@ -63,12 +76,13 @@ function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
63
76
|
return size;
|
|
64
77
|
}
|
|
65
78
|
case FormStepTypes.API_SELECTOR: {
|
|
66
|
-
|
|
79
|
+
var size = step.size;
|
|
67
80
|
if (value) {
|
|
68
|
-
|
|
69
|
-
if (currentOption
|
|
70
|
-
|
|
71
|
-
for (
|
|
81
|
+
var currentOption = step.options[value];
|
|
82
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ApiSelectorOptionTypes.NESTED) {
|
|
83
|
+
var optionSize = 0;
|
|
84
|
+
for (var _f = 0, _g = currentOption.steps; _f < _g.length; _f++) {
|
|
85
|
+
var pStepId = _g[_f];
|
|
72
86
|
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
73
87
|
}
|
|
74
88
|
size += optionSize;
|
|
@@ -77,10 +91,11 @@ function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
77
91
|
return size;
|
|
78
92
|
}
|
|
79
93
|
case FormStepTypes.CHECKBOX: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
for (
|
|
94
|
+
var size = step.size;
|
|
95
|
+
var stepSteps = value ? step.steps : step.uncheckedSteps;
|
|
96
|
+
var optionSize = 0;
|
|
97
|
+
for (var _h = 0, _j = stepSteps !== null && stepSteps !== void 0 ? stepSteps : []; _h < _j.length; _h++) {
|
|
98
|
+
var pStepId = _j[_h];
|
|
84
99
|
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
85
100
|
}
|
|
86
101
|
size += optionSize;
|
|
@@ -94,20 +109,21 @@ function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
|
94
109
|
return 4;
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
|
-
export
|
|
112
|
+
export var calcStepWidth = function (stepSize, size) {
|
|
98
113
|
return size.blockSize * stepSize + size.spacingSize * (stepSize - 1);
|
|
99
114
|
};
|
|
100
|
-
export
|
|
115
|
+
export var calcDefaultValue = function (step) {
|
|
116
|
+
var _a, _b;
|
|
101
117
|
switch (step.type) {
|
|
102
118
|
case FormStepTypes.CHECKBOX:
|
|
103
|
-
return step.defaultValue
|
|
119
|
+
return (_a = step.defaultValue) !== null && _a !== void 0 ? _a : false;
|
|
104
120
|
case FormStepTypes.TITLE:
|
|
105
121
|
return undefined;
|
|
106
122
|
case FormStepTypes.TIMEPICKER:
|
|
107
123
|
return step.defaultValue;
|
|
108
124
|
case FormStepTypes.SELECTOR:
|
|
109
125
|
if (step.defaultValue)
|
|
110
|
-
return step.options.find((option)
|
|
126
|
+
return ((_b = step.options.find(function (option) { return option.value === step.defaultValue; })) !== null && _b !== void 0 ? _b : '');
|
|
111
127
|
return '';
|
|
112
128
|
case FormStepTypes.TEXTINPUT:
|
|
113
129
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
@@ -134,24 +150,26 @@ export const calcDefaultValue = (step) => {
|
|
|
134
150
|
return undefined;
|
|
135
151
|
}
|
|
136
152
|
};
|
|
137
|
-
export
|
|
138
|
-
|
|
153
|
+
export var iterateNestedSteps = function (idStep, steps, iteration, path) {
|
|
154
|
+
if (path === void 0) { path = []; }
|
|
155
|
+
var step = steps[idStep];
|
|
139
156
|
if (!step) {
|
|
140
157
|
console.error('Missing Step:', idStep);
|
|
141
158
|
return;
|
|
142
159
|
}
|
|
143
160
|
iteration(step, path);
|
|
144
161
|
if (step.type === FormStepTypes.MAPPER) {
|
|
145
|
-
for (
|
|
146
|
-
|
|
147
|
-
|
|
162
|
+
for (var _i = 0, _a = step.rootSteps; _i < _a.length; _i++) {
|
|
163
|
+
var idStep_1 = _a[_i];
|
|
164
|
+
iterateNestedSteps(idStep_1, step.steps, iteration, __spreadArray(__spreadArray([], path, true), [
|
|
148
165
|
step.id,
|
|
149
|
-
]);
|
|
166
|
+
], false));
|
|
150
167
|
}
|
|
151
168
|
}
|
|
152
169
|
else {
|
|
153
|
-
for (
|
|
154
|
-
|
|
170
|
+
for (var _b = 0, _c = calcSubSteps(step.id, steps); _b < _c.length; _b++) {
|
|
171
|
+
var idSubStep = _c[_b];
|
|
172
|
+
iterateNestedSteps(idSubStep, steps, iteration, path);
|
|
155
173
|
}
|
|
156
174
|
}
|
|
157
175
|
};
|
|
@@ -161,22 +179,24 @@ export const iterateNestedSteps = (idStep, steps, iteration, path = [idStep]) =>
|
|
|
161
179
|
* @param idModifier optional modifier for the ids of the substeps and all other properties
|
|
162
180
|
* @returns list of the ids of the substeps of the step, if modifier returns modified steps
|
|
163
181
|
*/
|
|
164
|
-
export
|
|
165
|
-
|
|
166
|
-
|
|
182
|
+
export var calcSubSteps = function (idStep, allSteps, idModifier) {
|
|
183
|
+
var _a;
|
|
184
|
+
var step = allSteps[idStep];
|
|
185
|
+
var subSteps = [];
|
|
167
186
|
if (!step)
|
|
168
187
|
return [];
|
|
169
|
-
|
|
170
|
-
for (
|
|
171
|
-
|
|
188
|
+
var handleSteps = function (steps) {
|
|
189
|
+
for (var i = 0; i < steps.length; i++) {
|
|
190
|
+
var idSubStep = steps[i];
|
|
172
191
|
if (idModifier)
|
|
173
192
|
steps[i] = idModifier(steps[i]);
|
|
174
|
-
subSteps.push(idSubStep,
|
|
193
|
+
subSteps.push.apply(subSteps, __spreadArray([idSubStep], calcSubSteps(idSubStep, allSteps, idModifier), false));
|
|
175
194
|
}
|
|
176
195
|
};
|
|
177
196
|
switch (step.type) {
|
|
178
197
|
case FormStepTypes.SELECTOR: {
|
|
179
|
-
for (
|
|
198
|
+
for (var _i = 0, _b = step.options; _i < _b.length; _i++) {
|
|
199
|
+
var option = _b[_i];
|
|
180
200
|
if (option.type === OptionTypes.NESTED) {
|
|
181
201
|
handleSteps(option.steps);
|
|
182
202
|
}
|
|
@@ -184,8 +204,9 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
184
204
|
break;
|
|
185
205
|
}
|
|
186
206
|
case FormStepTypes.CLASSIFIER_SELECTOR:
|
|
187
|
-
for (
|
|
188
|
-
|
|
207
|
+
for (var _c = 0, _d = Object.keys(step.options); _c < _d.length; _c++) {
|
|
208
|
+
var idOption = _d[_c];
|
|
209
|
+
var option = step.options[idOption];
|
|
189
210
|
if (option.type === ClassifierOptionTypes.NESTED) {
|
|
190
211
|
handleSteps(option.steps);
|
|
191
212
|
}
|
|
@@ -193,7 +214,8 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
193
214
|
break;
|
|
194
215
|
case FormStepTypes.RATING:
|
|
195
216
|
if (step.nestedSteps) {
|
|
196
|
-
for (
|
|
217
|
+
for (var _e = 0, _f = step.nestedSteps; _e < _f.length; _e++) {
|
|
218
|
+
var steps = _f[_e];
|
|
197
219
|
handleSteps(steps);
|
|
198
220
|
}
|
|
199
221
|
}
|
|
@@ -211,19 +233,22 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
211
233
|
}
|
|
212
234
|
case FormStepTypes.ENTITYVALUEPICKER:
|
|
213
235
|
if (idModifier) {
|
|
214
|
-
for (
|
|
236
|
+
for (var _g = 0, _h = step.path; _g < _h.length; _g++) {
|
|
237
|
+
var path = _h[_g];
|
|
215
238
|
if (path.type === EntityValueDataTypes.STEP) {
|
|
216
239
|
path.idStep = idModifier(path.idStep);
|
|
217
240
|
}
|
|
218
241
|
}
|
|
219
|
-
for (
|
|
242
|
+
for (var _j = 0, _k = step.filters; _j < _k.length; _j++) {
|
|
243
|
+
var filter = _k[_j];
|
|
220
244
|
if (filter.type === EntityValueDataTypes.STEP) {
|
|
221
245
|
filter.idStep = idModifier(filter.idStep);
|
|
222
246
|
}
|
|
223
247
|
}
|
|
224
248
|
}
|
|
225
|
-
for (
|
|
226
|
-
|
|
249
|
+
for (var _l = 0, _m = Object.keys((_a = step.options) !== null && _a !== void 0 ? _a : {}); _l < _m.length; _l++) {
|
|
250
|
+
var idOption = _m[_l];
|
|
251
|
+
var option = step.options[idOption];
|
|
227
252
|
if (option.type === EntityValueOptionTypes.NESTED) {
|
|
228
253
|
handleSteps(option.steps);
|
|
229
254
|
}
|
|
@@ -231,7 +256,7 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
231
256
|
break;
|
|
232
257
|
case CBRFormStepTypes.CBR_LOCATIVAS:
|
|
233
258
|
{
|
|
234
|
-
|
|
259
|
+
var elementStep = step;
|
|
235
260
|
if (elementStep.subStep) {
|
|
236
261
|
if (idModifier)
|
|
237
262
|
elementStep.subStep = idModifier(elementStep.subStep);
|
|
@@ -240,7 +265,7 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
240
265
|
}
|
|
241
266
|
break;
|
|
242
267
|
case AYFFormStepTypes.AYF_ICA_CITY: {
|
|
243
|
-
|
|
268
|
+
var cityStep = step;
|
|
244
269
|
if (cityStep.idNitStep) {
|
|
245
270
|
if (idModifier)
|
|
246
271
|
cityStep.idNitStep = idModifier(cityStep.idNitStep);
|
|
@@ -253,18 +278,21 @@ export const calcSubSteps = (idStep, allSteps, idModifier) => {
|
|
|
253
278
|
}
|
|
254
279
|
return subSteps;
|
|
255
280
|
};
|
|
256
|
-
export
|
|
281
|
+
export var evaluateCondition = function (condition, dependencies, entityValue) {
|
|
282
|
+
var _a, _b, _c;
|
|
257
283
|
switch (condition.type) {
|
|
258
284
|
case ConditionTypes.EXPRESSION: {
|
|
259
285
|
if (condition.expression === ExpressionTypes.OR) {
|
|
260
|
-
for (
|
|
286
|
+
for (var _i = 0, _d = condition.conditions; _i < _d.length; _i++) {
|
|
287
|
+
var subCondition = _d[_i];
|
|
261
288
|
if (evaluateCondition(subCondition, dependencies))
|
|
262
289
|
return true;
|
|
263
290
|
}
|
|
264
291
|
return false;
|
|
265
292
|
}
|
|
266
293
|
else {
|
|
267
|
-
for (
|
|
294
|
+
for (var _e = 0, _f = condition.conditions; _e < _f.length; _e++) {
|
|
295
|
+
var subCondition = _f[_e];
|
|
268
296
|
if (!evaluateCondition(subCondition, dependencies))
|
|
269
297
|
return false;
|
|
270
298
|
}
|
|
@@ -273,14 +301,14 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
273
301
|
}
|
|
274
302
|
case ConditionTypes.FORM_STEP: {
|
|
275
303
|
if (isFormStepExistance(condition)) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if (
|
|
304
|
+
var boolFactor = condition.operator === OperatorTypes.EXISTS;
|
|
305
|
+
var value_1 = dependencies[condition.idStep].value;
|
|
306
|
+
if (value_1)
|
|
279
307
|
return boolFactor;
|
|
280
308
|
return !boolFactor;
|
|
281
309
|
}
|
|
282
|
-
|
|
283
|
-
|
|
310
|
+
var dependency = dependencies[condition.idStep];
|
|
311
|
+
var value_2 = dependencies[condition.idStep].value;
|
|
284
312
|
switch (condition.stepType) {
|
|
285
313
|
// case FormStepTypes.AGENTPICKER:
|
|
286
314
|
// return await evaluateAgentCondition(
|
|
@@ -288,24 +316,25 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
288
316
|
// value as string[]
|
|
289
317
|
// );
|
|
290
318
|
case FormStepTypes.CHECKBOX: {
|
|
291
|
-
|
|
292
|
-
return
|
|
319
|
+
var boolFactor = condition.operator === OperatorTypes.EQUAL;
|
|
320
|
+
return value_2 === condition.value ? boolFactor : !boolFactor;
|
|
293
321
|
}
|
|
294
322
|
case FormStepTypes.TIMEPICKER: {
|
|
295
|
-
|
|
296
|
-
if (!
|
|
323
|
+
var boolFactor = condition.operator === OperatorTypes.INCLUDES;
|
|
324
|
+
if (!value_2)
|
|
297
325
|
return !boolFactor;
|
|
298
|
-
|
|
299
|
-
|
|
326
|
+
var evaluateCondition_1 = function (condition) {
|
|
327
|
+
var property = condition.property;
|
|
300
328
|
if (property === 'working') {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
329
|
+
var boolFactor_1 = condition.propertyOperator ===
|
|
330
|
+
OperatorTypes.EQUAL;
|
|
331
|
+
if (value_2.working === condition.value) {
|
|
332
|
+
return boolFactor_1;
|
|
304
333
|
}
|
|
305
|
-
return !
|
|
334
|
+
return !boolFactor_1;
|
|
306
335
|
}
|
|
307
336
|
else {
|
|
308
|
-
|
|
337
|
+
var time = value_2;
|
|
309
338
|
switch (condition.propertyOperator) {
|
|
310
339
|
case OperatorTypes.EQUAL: {
|
|
311
340
|
return time[property] === condition.value;
|
|
@@ -314,13 +343,13 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
314
343
|
return time[property] !== condition.value;
|
|
315
344
|
}
|
|
316
345
|
case OperatorTypes.LESS: {
|
|
317
|
-
|
|
346
|
+
var propValue = time[property];
|
|
318
347
|
if (!propValue)
|
|
319
348
|
return false;
|
|
320
349
|
return propValue < condition.value;
|
|
321
350
|
}
|
|
322
351
|
case OperatorTypes.MORE: {
|
|
323
|
-
|
|
352
|
+
var propValue = time[property];
|
|
324
353
|
if (!propValue)
|
|
325
354
|
return false;
|
|
326
355
|
return propValue > condition.value;
|
|
@@ -331,28 +360,34 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
331
360
|
}
|
|
332
361
|
}
|
|
333
362
|
};
|
|
334
|
-
return
|
|
363
|
+
return evaluateCondition_1(condition)
|
|
364
|
+
? boolFactor
|
|
365
|
+
: !boolFactor;
|
|
335
366
|
}
|
|
336
367
|
case FormStepTypes.DATEPICKER: {
|
|
337
|
-
if (!(
|
|
368
|
+
if (!(value_2 instanceof Date) || isNaN(value_2.getTime())) {
|
|
338
369
|
return condition.operator === OperatorTypes.NOTEQUAL;
|
|
339
370
|
}
|
|
340
|
-
|
|
371
|
+
var propertyDate = new Date(condition.value);
|
|
341
372
|
switch (condition.operator) {
|
|
342
373
|
case OperatorTypes.EQUAL:
|
|
343
|
-
return
|
|
374
|
+
return (value_2.toUTCString().split('T')[0] ===
|
|
375
|
+
propertyDate.toUTCString().split('T')[0]);
|
|
344
376
|
case OperatorTypes.NOTEQUAL:
|
|
345
|
-
return
|
|
377
|
+
return (value_2.toUTCString().split('T')[0] !==
|
|
378
|
+
propertyDate.toUTCString().split('T')[0]);
|
|
346
379
|
case OperatorTypes.LESS:
|
|
347
|
-
return
|
|
380
|
+
return value_2.getTime() < propertyDate.getTime();
|
|
348
381
|
case OperatorTypes.MORE:
|
|
349
|
-
return
|
|
382
|
+
return value_2.getTime() > propertyDate.getTime();
|
|
350
383
|
default:
|
|
351
384
|
return false;
|
|
352
385
|
}
|
|
353
386
|
}
|
|
354
387
|
case FormStepTypes.SELECTOR: {
|
|
355
|
-
|
|
388
|
+
var val = dependency.type === 'ORIGINAL'
|
|
389
|
+
? value_2
|
|
390
|
+
: (_a = value_2 === null || value_2 === void 0 ? void 0 : value_2.value) !== null && _a !== void 0 ? _a : null;
|
|
356
391
|
if (condition.operator === OperatorTypes.EQUAL) {
|
|
357
392
|
return condition.value === val;
|
|
358
393
|
}
|
|
@@ -362,58 +397,61 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
362
397
|
}
|
|
363
398
|
case FormStepTypes.TEXTINPUT: {
|
|
364
399
|
if (condition.operator === OperatorTypes.INCLUDES) {
|
|
365
|
-
return
|
|
400
|
+
return (_b = value_2 === null || value_2 === void 0 ? void 0 : value_2.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(condition.value.toLowerCase());
|
|
366
401
|
}
|
|
367
402
|
else if (condition.operator === OperatorTypes.NOTINCLUDES) {
|
|
368
|
-
return !
|
|
403
|
+
return !((_c = value_2 === null || value_2 === void 0 ? void 0 : value_2.toLowerCase()) === null || _c === void 0 ? void 0 : _c.includes(condition.value.toLowerCase()));
|
|
369
404
|
}
|
|
370
405
|
else if (condition.operator === OperatorTypes.EQUAL) {
|
|
371
|
-
return condition.value.toLowerCase() ===
|
|
406
|
+
return (condition.value.toLowerCase() ===
|
|
407
|
+
(value_2 === null || value_2 === void 0 ? void 0 : value_2.toLowerCase()));
|
|
372
408
|
}
|
|
373
409
|
else if (condition.operator === OperatorTypes.NOTEQUAL) {
|
|
374
|
-
return !(condition.value.toLowerCase() ===
|
|
410
|
+
return !(condition.value.toLowerCase() ===
|
|
411
|
+
(value_2 === null || value_2 === void 0 ? void 0 : value_2.toLowerCase()));
|
|
375
412
|
}
|
|
376
413
|
else {
|
|
377
414
|
return false;
|
|
378
415
|
}
|
|
379
416
|
}
|
|
380
417
|
case FormStepTypes.TEXTAREA: {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
for (
|
|
384
|
-
regx +=
|
|
418
|
+
var words = condition.values;
|
|
419
|
+
var regx = "\\b(".concat(words[0].toLowerCase());
|
|
420
|
+
for (var i = 1; i < words.length; i++) {
|
|
421
|
+
regx += "|".concat(words[i].toLowerCase());
|
|
385
422
|
}
|
|
386
423
|
regx += ')\\b';
|
|
387
424
|
if (condition.operator === OperatorTypes.INCLUDES) {
|
|
388
|
-
return
|
|
425
|
+
return (value_2 && new RegExp(regx).test(value_2.toLowerCase()));
|
|
389
426
|
}
|
|
390
427
|
else {
|
|
391
|
-
return !
|
|
428
|
+
return (!value_2 ||
|
|
429
|
+
!new RegExp(regx).test(value_2.toLowerCase()));
|
|
392
430
|
}
|
|
393
431
|
}
|
|
394
432
|
case FormStepTypes.RATING: {
|
|
395
|
-
if (!
|
|
433
|
+
if (!value_2 || isNaN(value_2)) {
|
|
396
434
|
return condition.operator === OperatorTypes.NOTEQUAL;
|
|
397
435
|
}
|
|
398
436
|
switch (condition.operator) {
|
|
399
437
|
case OperatorTypes.EQUAL:
|
|
400
438
|
case OperatorTypes.NOTEQUAL: {
|
|
401
|
-
|
|
402
|
-
if (
|
|
439
|
+
var boolFactor = condition.operator === OperatorTypes.EQUAL;
|
|
440
|
+
if (value_2 === condition.value)
|
|
403
441
|
return boolFactor;
|
|
404
442
|
return !boolFactor;
|
|
405
443
|
}
|
|
406
444
|
case OperatorTypes.LESS:
|
|
407
|
-
return
|
|
445
|
+
return value_2 < condition.value;
|
|
408
446
|
case OperatorTypes.MORE:
|
|
409
|
-
return
|
|
447
|
+
return value_2 > condition.value;
|
|
410
448
|
default:
|
|
411
449
|
return false;
|
|
412
450
|
}
|
|
413
451
|
}
|
|
414
452
|
case FormStepTypes.CLASSIFIER_SELECTOR: {
|
|
415
|
-
|
|
416
|
-
if (value
|
|
453
|
+
var boolFactor = condition.operator === OperatorTypes.EQUAL;
|
|
454
|
+
if ((value_2 === null || value_2 === void 0 ? void 0 : value_2.value) === condition.idValue) {
|
|
417
455
|
//Si op es EQUALS (boolfactor true) evaluará a true
|
|
418
456
|
//Si op es NOTEQUALS (boolfactor false) evaluará a false
|
|
419
457
|
return boolFactor;
|
|
@@ -423,9 +461,10 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
423
461
|
return !boolFactor;
|
|
424
462
|
}
|
|
425
463
|
case FormStepTypes.ENTITYVALUEPICKER: {
|
|
426
|
-
|
|
427
|
-
for (
|
|
428
|
-
|
|
464
|
+
var boolFactor = condition.operator === OperatorTypes.EQUAL;
|
|
465
|
+
for (var _g = 0, _h = condition.values; _g < _h.length; _g++) {
|
|
466
|
+
var idEntityValue = _h[_g];
|
|
467
|
+
if ((value_2 === null || value_2 === void 0 ? void 0 : value_2._id) === idEntityValue) {
|
|
429
468
|
return boolFactor;
|
|
430
469
|
}
|
|
431
470
|
}
|
|
@@ -437,7 +476,7 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
437
476
|
break;
|
|
438
477
|
}
|
|
439
478
|
case ConditionTypes.ENTITYVALUE: {
|
|
440
|
-
if (!entityValue
|
|
479
|
+
if (!entityValue || !entityValue.entity)
|
|
441
480
|
return false;
|
|
442
481
|
return evaluateEntityValueCondition(condition, entityValue.entity, entityValue.entityValue);
|
|
443
482
|
}
|
|
@@ -447,14 +486,16 @@ export const evaluateCondition = (condition, dependencies, entityValue) => {
|
|
|
447
486
|
return false;
|
|
448
487
|
};
|
|
449
488
|
function isFormStepExistance(condition) {
|
|
450
|
-
return condition.operator === OperatorTypes.EXISTS ||
|
|
489
|
+
return (condition.operator === OperatorTypes.EXISTS ||
|
|
490
|
+
condition.operator === OperatorTypes.NOTEXISTS);
|
|
451
491
|
}
|
|
452
|
-
|
|
492
|
+
var evaluateEntityValueCondition = function (condition, entity, entityValue) {
|
|
453
493
|
switch (condition.operator) {
|
|
454
494
|
case OperatorTypes.EQUAL:
|
|
455
495
|
case OperatorTypes.NOTEQUAL: {
|
|
456
|
-
|
|
457
|
-
for (
|
|
496
|
+
var boolFactor = condition.operator === OperatorTypes.EQUAL;
|
|
497
|
+
for (var _i = 0, _a = condition.values; _i < _a.length; _i++) {
|
|
498
|
+
var value = _a[_i];
|
|
458
499
|
if (value === entityValue._id) {
|
|
459
500
|
return boolFactor;
|
|
460
501
|
}
|
|
@@ -472,80 +513,87 @@ const evaluateEntityValueCondition = (condition, entity, entityValue) => {
|
|
|
472
513
|
}
|
|
473
514
|
return false;
|
|
474
515
|
};
|
|
475
|
-
|
|
516
|
+
var evaluateEntityPropertyCondition = function (condition, entity, entityValue) {
|
|
517
|
+
var _a, _b, _c;
|
|
476
518
|
if (isEntityPropertyExistance(condition)) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
if (
|
|
519
|
+
var boolFactor = condition.propertyOperator === OperatorTypes.EXISTS;
|
|
520
|
+
var value_3 = entityValue[condition.idProperty];
|
|
521
|
+
if (value_3 !== undefined) {
|
|
480
522
|
return boolFactor;
|
|
481
523
|
}
|
|
482
524
|
return !boolFactor;
|
|
483
525
|
}
|
|
484
|
-
|
|
526
|
+
var property = entity.steps[condition.idProperty];
|
|
485
527
|
if (!property || property.type !== condition.propertyType) {
|
|
486
528
|
return false;
|
|
487
529
|
}
|
|
488
|
-
|
|
530
|
+
var value = entityValue[condition.idProperty];
|
|
489
531
|
if (value === undefined)
|
|
490
532
|
return false;
|
|
491
533
|
switch (condition.propertyType) {
|
|
492
534
|
case EntityPropertyTypes.CHECKBOX: {
|
|
493
|
-
|
|
535
|
+
var boolFactor = condition.propertyOperator === OperatorTypes.EQUAL;
|
|
494
536
|
if (value === condition.propertyValue) {
|
|
495
537
|
return boolFactor;
|
|
496
538
|
}
|
|
497
539
|
return !boolFactor;
|
|
498
540
|
}
|
|
499
541
|
case EntityPropertyTypes.DATEPICKER: {
|
|
500
|
-
|
|
542
|
+
var date = new Date(value);
|
|
501
543
|
if (!(date instanceof Date) || isNaN(date.getTime())) {
|
|
502
544
|
return condition.propertyOperator === OperatorTypes.NOTEQUAL;
|
|
503
545
|
}
|
|
504
546
|
switch (condition.propertyOperator) {
|
|
505
547
|
case OperatorTypes.EQUAL: {
|
|
506
|
-
|
|
548
|
+
var propertyDate = new Date(condition.propertyValue);
|
|
507
549
|
return date.getTime() === propertyDate.getTime();
|
|
508
550
|
}
|
|
509
551
|
case OperatorTypes.NOTEQUAL: {
|
|
510
|
-
|
|
552
|
+
var propertyDate = new Date(condition.propertyValue);
|
|
511
553
|
return date.getTime() !== propertyDate.getTime();
|
|
512
554
|
}
|
|
513
555
|
case OperatorTypes.LESS: {
|
|
514
|
-
|
|
556
|
+
var propertyDate = new Date(condition.propertyValue);
|
|
515
557
|
return date.getTime() < propertyDate.getTime();
|
|
516
558
|
}
|
|
517
559
|
case OperatorTypes.MORE: {
|
|
518
|
-
|
|
560
|
+
var propertyDate = new Date(condition.propertyValue);
|
|
519
561
|
return date.getTime() > propertyDate.getTime();
|
|
520
562
|
}
|
|
521
563
|
case OperatorTypes.PAST_RELATIVE_LESS:
|
|
522
564
|
case OperatorTypes.PAST_RELATIVE_MORE:
|
|
523
565
|
case OperatorTypes.FUTURE_RELATIVE_LESS:
|
|
524
566
|
case OperatorTypes.FUTURE_RELATIVE_MORE: {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
567
|
+
var date_1 = getRelativeDate((_a = condition.value) === null || _a === void 0 ? void 0 : _a.days, (_b = condition.value) === null || _b === void 0 ? void 0 : _b.hours, (_c = condition.value) === null || _c === void 0 ? void 0 : _c.minutes, condition.propertyOperator ===
|
|
568
|
+
OperatorTypes.PAST_RELATIVE_LESS ||
|
|
569
|
+
condition.propertyOperator ===
|
|
570
|
+
OperatorTypes.PAST_RELATIVE_MORE);
|
|
571
|
+
if (condition.propertyOperator ===
|
|
572
|
+
OperatorTypes.PAST_RELATIVE_LESS ||
|
|
573
|
+
condition.propertyOperator ===
|
|
574
|
+
OperatorTypes.FUTURE_RELATIVE_LESS)
|
|
575
|
+
return new Date(value).getTime() < date_1.getTime();
|
|
530
576
|
else
|
|
531
|
-
return new Date().getTime()
|
|
577
|
+
return new Date(value).getTime() > date_1.getTime();
|
|
532
578
|
}
|
|
579
|
+
default:
|
|
580
|
+
false;
|
|
533
581
|
}
|
|
534
582
|
return false;
|
|
535
583
|
}
|
|
536
584
|
case EntityPropertyTypes.TIMEPICKER: {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
585
|
+
var boolFactor = condition.propertyOperator === OperatorTypes.INCLUDES;
|
|
586
|
+
var evaluateCondition_2 = function (condition) {
|
|
587
|
+
var timeProperty = condition.property;
|
|
540
588
|
if (timeProperty === 'working') {
|
|
541
|
-
|
|
589
|
+
var boolFactor_2 = condition.timePropertyOperator === OperatorTypes.EQUAL;
|
|
542
590
|
if (value.working === condition.value) {
|
|
543
|
-
return
|
|
591
|
+
return boolFactor_2;
|
|
544
592
|
}
|
|
545
|
-
return !
|
|
593
|
+
return !boolFactor_2;
|
|
546
594
|
}
|
|
547
595
|
else {
|
|
548
|
-
|
|
596
|
+
var time = value;
|
|
549
597
|
switch (condition.timePropertyOperator) {
|
|
550
598
|
case OperatorTypes.EQUAL: {
|
|
551
599
|
return time[timeProperty] === condition.value;
|
|
@@ -554,13 +602,13 @@ const evaluateEntityPropertyCondition = (condition, entity, entityValue) => {
|
|
|
554
602
|
return time[timeProperty] !== condition.value;
|
|
555
603
|
}
|
|
556
604
|
case OperatorTypes.LESS: {
|
|
557
|
-
|
|
605
|
+
var propValue = time[timeProperty];
|
|
558
606
|
if (!propValue)
|
|
559
607
|
return false;
|
|
560
608
|
return propValue < condition.value;
|
|
561
609
|
}
|
|
562
610
|
case OperatorTypes.MORE: {
|
|
563
|
-
|
|
611
|
+
var propValue = time[timeProperty];
|
|
564
612
|
if (!propValue)
|
|
565
613
|
return false;
|
|
566
614
|
return propValue > condition.value;
|
|
@@ -571,17 +619,17 @@ const evaluateEntityPropertyCondition = (condition, entity, entityValue) => {
|
|
|
571
619
|
}
|
|
572
620
|
}
|
|
573
621
|
};
|
|
574
|
-
return
|
|
622
|
+
return evaluateCondition_2(condition) ? boolFactor : !boolFactor;
|
|
575
623
|
}
|
|
576
624
|
case EntityPropertyTypes.SELECTOR:
|
|
577
625
|
case EntityPropertyTypes.TEXTAREA:
|
|
578
626
|
case EntityPropertyTypes.TEXTINPUT: {
|
|
579
627
|
if (condition.propertyOperator === OperatorTypes.INCLUDES ||
|
|
580
628
|
condition.propertyOperator === OperatorTypes.NOTINCLUDES) {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
for (
|
|
584
|
-
regx +=
|
|
629
|
+
var words = condition.propertyValues;
|
|
630
|
+
var regx = "\\b(".concat(words[0].toLowerCase());
|
|
631
|
+
for (var i = 1; i < words.length; i++) {
|
|
632
|
+
regx += "|".concat(words[i].toLowerCase());
|
|
585
633
|
}
|
|
586
634
|
regx += ')\\b';
|
|
587
635
|
if (condition.propertyOperator === OperatorTypes.INCLUDES) {
|
|
@@ -593,10 +641,12 @@ const evaluateEntityPropertyCondition = (condition, entity, entityValue) => {
|
|
|
593
641
|
/** For Inputs and Selectors */
|
|
594
642
|
}
|
|
595
643
|
else if (condition.propertyOperator === OperatorTypes.EQUAL) {
|
|
596
|
-
return condition.propertyValue.toLowerCase() ===
|
|
644
|
+
return (condition.propertyValue.toLowerCase() ===
|
|
645
|
+
value.toLowerCase());
|
|
597
646
|
}
|
|
598
647
|
else if (condition.propertyOperator === OperatorTypes.NOTEQUAL) {
|
|
599
|
-
return !(condition.propertyValue.toLowerCase() ===
|
|
648
|
+
return !(condition.propertyValue.toLowerCase() ===
|
|
649
|
+
value.toLowerCase());
|
|
600
650
|
}
|
|
601
651
|
return false;
|
|
602
652
|
}
|
|
@@ -606,9 +656,15 @@ const evaluateEntityPropertyCondition = (condition, entity, entityValue) => {
|
|
|
606
656
|
return false;
|
|
607
657
|
};
|
|
608
658
|
function isEntityPropertyExistance(condition) {
|
|
609
|
-
return (condition.propertyOperator === OperatorTypes.EXISTS ||
|
|
659
|
+
return (condition.propertyOperator === OperatorTypes.EXISTS ||
|
|
660
|
+
condition.propertyOperator === OperatorTypes.NOTEXISTS);
|
|
610
661
|
}
|
|
611
|
-
export function getRelativeDate(nDays
|
|
612
|
-
|
|
662
|
+
export function getRelativeDate(nDays, nHours, nMinutes, subtract, date) {
|
|
663
|
+
if (nDays === void 0) { nDays = 0; }
|
|
664
|
+
if (nHours === void 0) { nHours = 0; }
|
|
665
|
+
if (nMinutes === void 0) { nMinutes = 0; }
|
|
666
|
+
if (subtract === void 0) { subtract = false; }
|
|
667
|
+
if (date === void 0) { date = new Date(); }
|
|
668
|
+
var millis = nDays * 86400000 + nHours * 3600000 + nMinutes * 60000;
|
|
613
669
|
return new Date(date.getTime() + (subtract ? -millis : millis));
|
|
614
670
|
}
|