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