@arquimedes.co/eureka-forms 3.0.31 → 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 +12 -8
- package/dist/@Types/GenericFormSteps.d.ts +0 -6
- 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 -33
- package/dist/FormSteps/StepFunctions.d.ts +6 -4
- package/dist/FormSteps/StepFunctions.js +208 -153
- package/dist/FormSteps/StepHooks.d.ts +14 -68
- package/dist/FormSteps/StepHooks.js +154 -88
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +20 -18
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +74 -36
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +2 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +28 -12
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +14 -3
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +30 -12
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +2 -1
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +26 -9
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +1 -0
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +13 -2
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +54 -21
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/TitleStep.js +13 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +2 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +27 -14
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +3 -2
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +23 -8
- package/dist/Icons/@IconTypes.d.ts +7 -0
- package/dist/Icons/CalendarIcon.d.ts +3 -2
- package/dist/Icons/CalendarIcon.js +14 -4
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +13 -3
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +13 -3
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +13 -3
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +13 -3
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +13 -3
- package/dist/Icons/EmailIcon.d.ts +4 -0
- package/dist/Icons/EmailIcon.js +17 -0
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +13 -3
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +15 -5
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +15 -5
- package/dist/Icons/Entities/SchoolIcon.d.ts +2 -0
- package/dist/Icons/Entities/SchoolIcon.js +17 -0
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +15 -5
- package/dist/Icons/GroupIcon.d.ts +4 -0
- package/dist/Icons/GroupIcon.js +17 -0
- package/dist/Icons/LocationIcon.d.ts +3 -2
- package/dist/Icons/LocationIcon.js +14 -4
- package/dist/Icons/LockedIcon.d.ts +4 -0
- package/dist/Icons/LockedIcon.js +17 -0
- package/dist/Icons/PersonIcon.d.ts +3 -2
- package/dist/Icons/PersonIcon.js +16 -6
- package/dist/Login/Login.module.css +135 -0
- package/dist/Login/LoginLayout.module.css +68 -0
- package/dist/Login/LoginPage.d.ts +11 -0
- package/dist/Login/LoginPage.js +177 -0
- package/dist/Login/LoginTextField.d.ts +15 -0
- package/dist/Login/LoginTextField.js +134 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +72 -22
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +86 -29
- package/dist/Services/FormService.js +56 -11
- package/dist/Services/IntegrationService.d.ts +21 -0
- package/dist/Services/IntegrationService.js +69 -0
- package/dist/Services/OrganizationService.js +62 -11
- package/dist/Services/UserService.d.ts +10 -0
- package/dist/Services/UserService.js +71 -0
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +2 -1
- package/dist/Shared/CustomBtn/CustomBtn.js +88 -24
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +112 -29
- package/dist/Shared/Loader/Loader.d.ts +1 -0
- package/dist/Shared/Loader/Loader.js +18 -6
- package/dist/Shared/Navbar/Navbar.d.ts +3 -1
- package/dist/Shared/Navbar/Navbar.js +96 -3
- package/dist/Shared/Navbar/Navbar.module.css +15 -0
- package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/Shared/Navbar/Navbar.stories.js +2 -2
- package/dist/Shared/Rating/Rating.d.ts +5 -3
- package/dist/Shared/Rating/Rating.js +27 -4
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +19 -13
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/LikeRating.js +33 -19
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +47 -27
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/ScaleRating.js +54 -23
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +30 -0
- package/dist/Shared/RoundedButton/RoundedButton.js +45 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +49 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +351 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +43 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +226 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +68 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.js +214 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +236 -0
- package/dist/Shared/{ErkSmartSelect/ErkSmartSelect.stories.d.ts → RoundedSmartSelect/RoundedSmartSelect.stories.d.ts} +13 -3
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +45 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.js +175 -0
- package/dist/Shared/{ErkTextField/ErkTextField.stories.d.ts → RoundedTextField/RoundedTextField.stories.d.ts} +17 -4
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +224 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +41 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +314 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +22 -8
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +60 -0
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +43 -27
- package/dist/Shared/Toggle/Toggle.d.ts +14 -5
- package/dist/Shared/Toggle/Toggle.js +32 -29
- package/dist/States/GlobalSlice.d.ts +12 -7
- package/dist/States/GlobalSlice.js +22 -6
- package/dist/States/SiteSlice.d.ts +48 -30
- package/dist/States/SiteSlice.js +76 -58
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +9 -8
- package/dist/Utils/AxiosAPI.d.ts +5 -4
- package/dist/Utils/AxiosAPI.js +73 -23
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +30 -29
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +143 -102
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +45 -27
- package/dist/Utils/MaterialProviders.d.ts +1 -21
- package/dist/Utils/MaterialProviders.js +28 -46
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +81 -60
- package/dist/Utils/TestUtils.js +57 -28
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +8 -10
- package/dist/Utils/store.d.ts +17 -9
- package/dist/Utils/store.js +74 -15
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +26 -16
- package/dist/__mocks__/axios.d.ts +2 -0
- package/dist/__mocks__/axios.js +2 -0
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/ErkValueTypes.d.ts +6 -0
- package/dist/constants/ErkValueTypes.js +7 -0
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/FormStepTypes.d.ts +2 -2
- package/dist/constants/FormStepTypes.js +1 -1
- package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
- package/dist/constants/IconTypes.js +18 -0
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
- package/dist/constants/MaterialClassNameSeed.js +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +77 -14
- package/dist/index.js +31 -0
- package/dist/index.lib.d.ts +1 -0
- package/dist/index.lib.js +1 -0
- package/package.json +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/DatePickerRangeStep/DatePickerRangeStep.d.ts +0 -10
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +0 -14
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +0 -3
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +0 -27
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
- package/dist/FormSteps/StepFunctions.test.js +0 -702
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +0 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +0 -2
- package/dist/Icons/@ErkIcon.d.ts +0 -14
- package/dist/Icons/@ErkIcon.js +0 -9
- package/dist/Icons/ArrowLeftIcon.d.ts +0 -3
- package/dist/Icons/ArrowLeftIcon.js +0 -7
- package/dist/Icons/ArrowRightIcon.d.ts +0 -3
- package/dist/Icons/ArrowRightIcon.js +0 -7
- package/dist/Icons/CheckCircleIcon.d.ts +0 -3
- package/dist/Icons/CheckCircleIcon.js +0 -7
- package/dist/Icons/CheckboxCheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxCheckedIcon.js +0 -7
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxUncheckedIcon.js +0 -7
- package/dist/Icons/ClockIcon.d.ts +0 -3
- package/dist/Icons/ClockIcon.js +0 -7
- package/dist/Icons/CloseIcon.d.ts +0 -3
- package/dist/Icons/CloseIcon.js +0 -7
- package/dist/Icons/DeleteIcon.d.ts +0 -3
- package/dist/Icons/DeleteIcon.js +0 -7
- package/dist/Icons/Entities/WorkIcon.d.ts +0 -3
- package/dist/Icons/Entities/WorkIcon.js +0 -7
- package/dist/Icons/ErrorIcon.d.ts +0 -3
- package/dist/Icons/ErrorIcon.js +0 -7
- package/dist/Icons/ExpandLessIcon.d.ts +0 -3
- package/dist/Icons/ExpandLessIcon.js +0 -7
- package/dist/Icons/ExpandMoreIcon.d.ts +0 -3
- package/dist/Icons/ExpandMoreIcon.js +0 -7
- package/dist/Icons/FileIcon.d.ts +0 -3
- package/dist/Icons/FileIcon.js +0 -7
- package/dist/Icons/InfoIcon.d.ts +0 -3
- package/dist/Icons/InfoIcon.js +0 -7
- package/dist/Icons/Ratings/DislikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DislikeIcon.js +0 -7
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/LikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/LikeIcon.js +0 -7
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/SatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/StarIcon.d.ts +0 -3
- package/dist/Icons/Ratings/StarIcon.js +0 -7
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +0 -7
- package/dist/Icons/WarningIcon.d.ts +0 -3
- package/dist/Icons/WarningIcon.js +0 -7
- package/dist/Init.d.ts +0 -1
- package/dist/Init.js +0 -2
- package/dist/Shared/ErkButton/ErkButton.d.ts +0 -25
- package/dist/Shared/ErkButton/ErkButton.js +0 -31
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
- package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +0 -19
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +0 -31
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +0 -18
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +0 -266
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +0 -18
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +0 -160
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +0 -36
- package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +0 -274
- package/dist/Shared/ErkMenuItem.d.ts +0 -4
- package/dist/Shared/ErkMenuItem.js +0 -18
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
- package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
- package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
- package/dist/Utils/LocaleUtils.d.ts +0 -2
- package/dist/Utils/LocaleUtils.js +0 -12
- package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
- package/dist/Utils/MuiClassnameSetup.js +0 -3
- package/dist/constants/ErkIconTypes.js +0 -16
- package/dist/index.css +0 -15
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -25
- /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
- /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
- /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
- /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
- /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
- /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import ErkDatePickerRange from './ErkDatePickerRange';
|
|
3
|
-
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
const meta = {
|
|
6
|
-
component: ErkDatePickerRange,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
readOnly: false,
|
|
10
|
-
},
|
|
11
|
-
parameters: {
|
|
12
|
-
dateRange: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
export const Empty = {
|
|
17
|
-
args: {
|
|
18
|
-
label: 'Seleccionar Rango',
|
|
19
|
-
value: [null, null],
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const Default = {
|
|
23
|
-
args: {
|
|
24
|
-
label: 'Rango de Fechas',
|
|
25
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
26
|
-
},
|
|
27
|
-
render: function Component(args) {
|
|
28
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
29
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const Interactive = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Rango Interactivo',
|
|
35
|
-
value: [null, null],
|
|
36
|
-
helperText: 'Seleccione un rango de fechas',
|
|
37
|
-
},
|
|
38
|
-
render: function Component(args) {
|
|
39
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
40
|
-
const handleChange = (newValue) => {
|
|
41
|
-
setValue(newValue);
|
|
42
|
-
args.onChange?.(newValue);
|
|
43
|
-
};
|
|
44
|
-
return (_jsxs("div", { children: [_jsx(ErkDatePickerRange, { ...args, value: value, onChange: handleChange }), _jsxs("div", { style: { marginTop: '20px', fontSize: '14px' }, children: [_jsx("strong", { children: "Valor seleccionado:" }), _jsxs("div", { children: ["Inicio: ", value[0]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] }), _jsxs("div", { children: ["Fin: ", value[1]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] })] })] }));
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
export const ValueAndLabel = {
|
|
48
|
-
args: {
|
|
49
|
-
label: 'Rango de Fechas',
|
|
50
|
-
value: [null, null],
|
|
51
|
-
},
|
|
52
|
-
render: function Component(args) {
|
|
53
|
-
const [, setArgs] = useArgs();
|
|
54
|
-
const onValueChange = (value) => {
|
|
55
|
-
args.onChange?.(value);
|
|
56
|
-
setArgs({ value });
|
|
57
|
-
};
|
|
58
|
-
return _jsx(ErkDatePickerRange, { ...args, onChange: onValueChange });
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
export const Full = {
|
|
62
|
-
args: {
|
|
63
|
-
label: 'Rango de Fechas',
|
|
64
|
-
value: [null, null],
|
|
65
|
-
helperText: 'Seleccione un rango de fechas',
|
|
66
|
-
},
|
|
67
|
-
render: function Component(args) {
|
|
68
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
69
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
export const Error = {
|
|
73
|
-
args: {
|
|
74
|
-
label: 'Rango de Fechas',
|
|
75
|
-
value: [null, null],
|
|
76
|
-
helperText: 'Error: Rango de fechas inválido',
|
|
77
|
-
error: true,
|
|
78
|
-
},
|
|
79
|
-
render: function Component(args) {
|
|
80
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
81
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
export const Menu = {
|
|
85
|
-
args: {
|
|
86
|
-
label: 'Rango de Fechas',
|
|
87
|
-
value: [null, null],
|
|
88
|
-
},
|
|
89
|
-
render: function Component(args) {
|
|
90
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
91
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
92
|
-
},
|
|
93
|
-
play: async ({ canvas, userEvent }) => {
|
|
94
|
-
const selector = canvas.getByTestId('date-picker');
|
|
95
|
-
await userEvent.click(selector);
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
export const WithSelectedRange = {
|
|
99
|
-
args: {
|
|
100
|
-
label: 'Vacaciones',
|
|
101
|
-
value: [new Date('2024-12-20'), new Date('2025-01-05')],
|
|
102
|
-
helperText: 'Período de vacaciones',
|
|
103
|
-
},
|
|
104
|
-
render: function Component(args) {
|
|
105
|
-
const [, setArgs] = useArgs();
|
|
106
|
-
const onValueChange = (value) => {
|
|
107
|
-
args.onChange?.(value);
|
|
108
|
-
setArgs({ value });
|
|
109
|
-
};
|
|
110
|
-
return _jsx(ErkDatePickerRange, { ...args, onChange: onValueChange });
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
export const Disabled = {
|
|
114
|
-
args: {
|
|
115
|
-
label: 'Rango de Fechas',
|
|
116
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
117
|
-
disabled: true,
|
|
118
|
-
helperText: 'Campo deshabilitado',
|
|
119
|
-
},
|
|
120
|
-
render: function Component(args) {
|
|
121
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
122
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
export const ReadOnly = {
|
|
126
|
-
args: {
|
|
127
|
-
label: 'Rango de Fechas',
|
|
128
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
129
|
-
readOnly: true,
|
|
130
|
-
helperText: 'Campo de solo lectura',
|
|
131
|
-
},
|
|
132
|
-
render: function Component(args) {
|
|
133
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
134
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
export const WithError = {
|
|
138
|
-
args: {
|
|
139
|
-
label: 'Rango de Fechas',
|
|
140
|
-
value: [new Date('2021-07-21'), new Date('2021-07-01')],
|
|
141
|
-
helperText: 'La fecha de inicio debe ser anterior a la fecha de fin',
|
|
142
|
-
error: true,
|
|
143
|
-
},
|
|
144
|
-
render: function Component(args) {
|
|
145
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
146
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
export const Required = {
|
|
150
|
-
args: {
|
|
151
|
-
label: 'Rango de Fechas',
|
|
152
|
-
value: [null, null],
|
|
153
|
-
helperText: 'Este campo es obligatorio',
|
|
154
|
-
required: true,
|
|
155
|
-
},
|
|
156
|
-
render: function Component(args) {
|
|
157
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
158
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
export const SmallSize = {
|
|
162
|
-
args: {
|
|
163
|
-
label: 'Rango Pequeño',
|
|
164
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
165
|
-
size: 'small',
|
|
166
|
-
helperText: 'Tamaño pequeño',
|
|
167
|
-
},
|
|
168
|
-
render: function Component(args) {
|
|
169
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
170
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
export const MediumSize = {
|
|
174
|
-
args: {
|
|
175
|
-
label: 'Rango Mediano',
|
|
176
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
177
|
-
size: 'medium',
|
|
178
|
-
helperText: 'Tamaño mediano',
|
|
179
|
-
},
|
|
180
|
-
render: function Component(args) {
|
|
181
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
182
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
export const CurrentMonth = {
|
|
186
|
-
args: {
|
|
187
|
-
label: 'Mes Actual',
|
|
188
|
-
value: [new Date(2025, 10, 1), new Date(2025, 10, 30)],
|
|
189
|
-
helperText: 'Noviembre 2025',
|
|
190
|
-
},
|
|
191
|
-
render: function Component(args) {
|
|
192
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
193
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
export const LastWeek = {
|
|
197
|
-
args: {
|
|
198
|
-
label: 'Última Semana',
|
|
199
|
-
value: [new Date(new Date().setDate(new Date().getDate() - 7)), new Date()],
|
|
200
|
-
helperText: 'Últimos 7 días',
|
|
201
|
-
},
|
|
202
|
-
render: function Component(args) {
|
|
203
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
204
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
export const NextMonth = {
|
|
208
|
-
args: {
|
|
209
|
-
label: 'Próximo Mes',
|
|
210
|
-
value: [
|
|
211
|
-
new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1),
|
|
212
|
-
new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0),
|
|
213
|
-
],
|
|
214
|
-
helperText: 'Planificación del próximo mes',
|
|
215
|
-
},
|
|
216
|
-
render: function Component(args) {
|
|
217
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
218
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
export const WithMinMaxDates = {
|
|
222
|
-
args: {
|
|
223
|
-
label: 'Reserva de Hotel',
|
|
224
|
-
value: [null, null],
|
|
225
|
-
helperText: 'Seleccione fechas entre hoy y 3 meses',
|
|
226
|
-
minDate: new Date(),
|
|
227
|
-
maxDate: new Date(new Date().setMonth(new Date().getMonth() + 3)),
|
|
228
|
-
},
|
|
229
|
-
render: function Component(args) {
|
|
230
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
231
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
|
-
export const YearRange = {
|
|
235
|
-
args: {
|
|
236
|
-
label: 'Período Fiscal',
|
|
237
|
-
value: [new Date('2025-01-01'), new Date('2025-12-31')],
|
|
238
|
-
helperText: 'Año fiscal 2025',
|
|
239
|
-
},
|
|
240
|
-
render: function Component(args) {
|
|
241
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
242
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
export const QuarterRange = {
|
|
246
|
-
args: {
|
|
247
|
-
label: 'Trimestre Q1 2025',
|
|
248
|
-
value: [new Date('2025-01-01'), new Date('2025-03-31')],
|
|
249
|
-
helperText: 'Primer trimestre del año',
|
|
250
|
-
},
|
|
251
|
-
render: function Component(args) {
|
|
252
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
253
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
export const EventDuration = {
|
|
257
|
-
args: {
|
|
258
|
-
label: 'Duración del Evento',
|
|
259
|
-
value: [new Date('2025-06-15'), new Date('2025-06-18')],
|
|
260
|
-
helperText: 'Conferencia anual (4 días)',
|
|
261
|
-
},
|
|
262
|
-
render: function Component(args) {
|
|
263
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
264
|
-
return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
export const MultipleStates = {
|
|
268
|
-
render: function Component() {
|
|
269
|
-
const [range1, setRange1] = useState([null, null]);
|
|
270
|
-
const [range2, setRange2] = useState([new Date('2025-01-01'), new Date('2025-01-31')]);
|
|
271
|
-
const [range3, setRange3] = useState([null, null]);
|
|
272
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx(ErkDatePickerRange, { label: "Fecha de Inicio del Proyecto", value: range1, onChange: setRange1, helperText: "Seleccione el per\u00EDodo del proyecto" }), _jsx(ErkDatePickerRange, { label: "Per\u00EDodo de Pruebas", value: range2, onChange: setRange2, helperText: "Enero 2025" }), _jsx(ErkDatePickerRange, { label: "Fecha de Entrega", value: range3, onChange: setRange3, error: range3[0] === null, helperText: range3[0] === null ? 'Este campo es obligatorio' : 'Fecha confirmada', required: true })] }));
|
|
273
|
-
},
|
|
274
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
declare const Styled: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
2
|
-
ref?: ((instance: HTMLLIElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
3
|
-
}, "children" | "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "dense" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
|
-
export default Styled;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { MenuItem, styled } from '@mui/material';
|
|
2
|
-
const Styled = styled(MenuItem)(({ theme }) => ({
|
|
3
|
-
padding: '6px 12px',
|
|
4
|
-
whiteSpace: 'normal',
|
|
5
|
-
'& .Erk-MuiMenuItem-root:has(.ErkIcon) ': {
|
|
6
|
-
paddingLeft: '40px',
|
|
7
|
-
'& .ErkIcon': {
|
|
8
|
-
left: 12,
|
|
9
|
-
top: '50%',
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
transform: 'translateY(-50%)',
|
|
12
|
-
fill: theme.palette.primary.main,
|
|
13
|
-
width: '20px',
|
|
14
|
-
height: '20px',
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
}));
|
|
18
|
-
export default Styled;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
3
|
-
import { ErkTextFieldProps } from '../ErkTextField/ErkTextField';
|
|
4
|
-
export interface ErkPhoneInputProps extends Omit<ErkTextFieldProps, 'onChange' | 'ref'> {
|
|
5
|
-
/** The value of the phoneinput */
|
|
6
|
-
value?: string;
|
|
7
|
-
onChange?: (value: string) => void;
|
|
8
|
-
inputRef?: any;
|
|
9
|
-
readOnly?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
|
|
13
|
-
*/
|
|
14
|
-
declare class ErkPhoneInput extends React.Component<ErkPhoneInputProps & Omit<MuiTextFieldProps, 'onChange'>> {
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
export default ErkPhoneInput;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import parse from 'libphonenumber-js/max';
|
|
4
|
-
import { defaultCountries, FlagImage, parseCountry, usePhoneInput } from 'react-international-phone';
|
|
5
|
-
import isoCountries from 'i18n-iso-countries';
|
|
6
|
-
import es from 'i18n-iso-countries/langs/es.json';
|
|
7
|
-
import { InputAdornment, Select, styled } from '@mui/material';
|
|
8
|
-
import { MenuItem } from '@mui/material';
|
|
9
|
-
import { StyledTextField } from '../ErkTextField/ErkTextField';
|
|
10
|
-
import { useAppSelector } from '../../hooks';
|
|
11
|
-
isoCountries.registerLocale(es);
|
|
12
|
-
const StyledSelect = styled(Select)(() => ({
|
|
13
|
-
padding: 0,
|
|
14
|
-
input: {
|
|
15
|
-
padding: 0,
|
|
16
|
-
},
|
|
17
|
-
'& .Erk-MuiSelect-select': {
|
|
18
|
-
height: '20px',
|
|
19
|
-
},
|
|
20
|
-
'& .Erk-MuiSelect-select.Erk-MuiInputBase-inputSizeSmall': {
|
|
21
|
-
paddingBottom: 0,
|
|
22
|
-
borderBottom: 'none',
|
|
23
|
-
},
|
|
24
|
-
backgroundColor: 'transparent',
|
|
25
|
-
'& input': {
|
|
26
|
-
padding: 0,
|
|
27
|
-
margin: 0,
|
|
28
|
-
},
|
|
29
|
-
'&.Erk-MuiInputBase-root::before': {
|
|
30
|
-
borderBottom: 'none !important',
|
|
31
|
-
},
|
|
32
|
-
'&.Erk-MuiInput-underline::after': {
|
|
33
|
-
borderBottom: 'none',
|
|
34
|
-
},
|
|
35
|
-
'&.Mui-readOnly': {
|
|
36
|
-
'& .Erk-MuiSelect-select': {
|
|
37
|
-
paddingRight: 5,
|
|
38
|
-
},
|
|
39
|
-
'& .Erk-MuiSelect-icon': {
|
|
40
|
-
display: 'none',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}));
|
|
44
|
-
function CustomPhoneInput({ value, onChange, inputRef, IconComponent, size = 'small', readOnly = false, disabled = false, ...others }) {
|
|
45
|
-
const defaultCountry = useAppSelector((state) => state.global.countryCode);
|
|
46
|
-
const { inputValue, handlePhoneValueChange, inputRef: phoneRef, country, setCountry, } = usePhoneInput({
|
|
47
|
-
value: '+' + value,
|
|
48
|
-
inputRef,
|
|
49
|
-
defaultCountry: (defaultCountry ?? 'CO').toLowerCase(),
|
|
50
|
-
disableDialCodePrefill: true,
|
|
51
|
-
disableDialCodeAndPrefix: true,
|
|
52
|
-
onChange: (data) => onChange?.(data.phone.replace('+', '')),
|
|
53
|
-
});
|
|
54
|
-
const countries = useMemo(() => defaultCountries
|
|
55
|
-
.map((c) => {
|
|
56
|
-
const country = parseCountry(c);
|
|
57
|
-
return {
|
|
58
|
-
country,
|
|
59
|
-
name: isoCountries.getName(country.iso2.toUpperCase(), 'es') ?? country.name,
|
|
60
|
-
};
|
|
61
|
-
})
|
|
62
|
-
.sort((a, b) => a.name.localeCompare(b.name)), []);
|
|
63
|
-
return (_jsx("div", { style: { position: 'relative', width: '100%', maxWidth: '100%' }, children: _jsx(StyledTextField, { ...others, value: inputValue, readOnly: readOnly, disabled: disabled, fullWidth: true, size: size, variant: "outlined", onChange: handlePhoneValueChange, type: "tel", padding: "6px 12px 6px 6px", autoComplete: "tel", inputRef: phoneRef, onPaste: (e) => {
|
|
64
|
-
const value = e.clipboardData.getData('Text');
|
|
65
|
-
if (!value.startsWith('+')) {
|
|
66
|
-
const phone = parse('+' + value);
|
|
67
|
-
if (phone?.isValid()) {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
if (phone.country)
|
|
70
|
-
setCountry(phone.country.toLowerCase());
|
|
71
|
-
onChange?.(phone.number);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}, slotProps: {
|
|
75
|
-
input: {
|
|
76
|
-
readOnly,
|
|
77
|
-
disabled: readOnly || disabled,
|
|
78
|
-
startAdornment: (_jsx(InputAdornment, { position: "start", children: _jsx(StyledSelect, { size: 'small', variant: "standard", readOnly: readOnly, value: country.iso2, inputProps: { readOnly, disabled: readOnly || disabled }, onChange: (e) => setCountry(e.target.value), renderValue: (value) => (_jsx(FlagImage, { iso2: value, style: { display: 'flex' }, width: 20 })), children: countries.map(({ country, name }) => {
|
|
79
|
-
return (_jsxs(MenuItem, { value: country.iso2, children: [_jsx(FlagImage, { iso2: country.iso2, size: 20 }), _jsx("span", { style: {
|
|
80
|
-
marginLeft: '8px',
|
|
81
|
-
marginRight: '8px',
|
|
82
|
-
}, children: name }), _jsxs("span", { style: { color: 'grey' }, children: ["+", country.dialCode] })] }, country.iso2));
|
|
83
|
-
}) }) })),
|
|
84
|
-
endAdornment: IconComponent,
|
|
85
|
-
},
|
|
86
|
-
} }) }));
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
|
|
90
|
-
*/
|
|
91
|
-
class ErkPhoneInput extends React.Component {
|
|
92
|
-
render() {
|
|
93
|
-
return _jsx(CustomPhoneInput, { ...this.props });
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
export default ErkPhoneInput;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SelectProps as MuiSelectProps } from '@mui/material';
|
|
3
|
-
export interface SelectorStyleProps {
|
|
4
|
-
/** If input is readOnly */
|
|
5
|
-
readOnly?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const StyledSelect: import("@emotion/styled").StyledComponent<(import("@mui/material").FilledSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").StandardSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").OutlinedSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>), {}, {}>;
|
|
8
|
-
export declare const StyledInputLabel: import("@emotion/styled").StyledComponent<import("@mui/material").InputLabelOwnProps & Pick<import("@mui/material").FormLabelOwnProps, "color" | "filled"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
|
9
|
-
ref?: ((instance: HTMLLabelElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLLabelElement> | null | undefined;
|
|
10
|
-
}, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
11
|
-
component?: React.ElementType;
|
|
12
|
-
} & {
|
|
13
|
-
open: boolean;
|
|
14
|
-
}, {}, {}>;
|
|
15
|
-
export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
16
|
-
ref?: ((instance: HTMLParagraphElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLParagraphElement> | null | undefined;
|
|
17
|
-
}, "required" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
18
|
-
component?: React.ElementType;
|
|
19
|
-
}, {}, {}>;
|
|
20
|
-
export type ErkSelectValue<Type extends string | number, Multiple, Clearable> = Multiple extends true ? Type[] : Clearable extends true ? Type | undefined : Type;
|
|
21
|
-
export interface ErkSelectProps<Type extends string | number = string, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends Omit<MuiSelectProps, 'color' | 'onChange' | 'ref'>, SelectorStyleProps {
|
|
22
|
-
/** if selecting multiple values */
|
|
23
|
-
multiple?: Multiple;
|
|
24
|
-
/** If the usar can clear the value */
|
|
25
|
-
clearable?: Clearable;
|
|
26
|
-
/** If the input is loading */
|
|
27
|
-
loading?: boolean;
|
|
28
|
-
/** children to display in the options */
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
/** Currently selected value */
|
|
31
|
-
value?: ErkSelectValue<Type, Multiple, Clearable>;
|
|
32
|
-
onChange?: (value: ErkSelectValue<Type, Multiple, Clearable>) => void;
|
|
33
|
-
/** String to place in the label */
|
|
34
|
-
label?: string;
|
|
35
|
-
/** The helper Text to display */
|
|
36
|
-
helperText?: string;
|
|
37
|
-
/** Label to display on clearable */
|
|
38
|
-
clearLabel?: string;
|
|
39
|
-
/** labelMargin */
|
|
40
|
-
labelMargin?: number;
|
|
41
|
-
}
|
|
42
|
-
export type CustomErkSelectOnChangeType<ChangeType, Multiple extends boolean | undefined, Clearable extends boolean | undefined> = Multiple extends true ? ChangeType[] : Clearable extends true ? ChangeType | undefined : ChangeType;
|
|
43
|
-
export interface CustomErkSelectProps<ValueType extends string | number = string, ChangeType = any, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends Omit<ErkSelectProps<ValueType, Multiple, Clearable>, 'onChange'> {
|
|
44
|
-
onChange?: (value: CustomErkSelectOnChangeType<ChangeType, Multiple, Clearable>) => void;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
|
|
48
|
-
*/
|
|
49
|
-
declare class ErkSelect<Type extends string | number = string, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends React.Component<ErkSelectProps<Type, Multiple, Clearable>> {
|
|
50
|
-
render(): JSX.Element;
|
|
51
|
-
}
|
|
52
|
-
export default ErkSelect;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useState } from 'react';
|
|
3
|
-
import { FormControl, FormHelperText as MuiFormHelperText, InputLabel as MuiInputLabel, Select as MuiSelect, styled, InputAdornment, } from '@mui/material';
|
|
4
|
-
import ErkMenuItem from '../ErkMenuItem';
|
|
5
|
-
export const StyledSelect = styled(MuiSelect)(({ theme, size, ...props }) => ({
|
|
6
|
-
borderRadius: 10,
|
|
7
|
-
opacity: props.disabled ? 0.5 : 1,
|
|
8
|
-
backgroundColor: theme.palette.stepBackgroundColor.default,
|
|
9
|
-
minHeight: size === 'small' ? 31 : size === 'medium' ? 40 : undefined,
|
|
10
|
-
'&.Erk-MuiInputBase-adornedEnd': {
|
|
11
|
-
paddingRight: 7,
|
|
12
|
-
},
|
|
13
|
-
'& .Erk-MuiSelect-select': {
|
|
14
|
-
fontSize: '1rem',
|
|
15
|
-
padding: '6px 12px',
|
|
16
|
-
lineHeight: size === 'small' ? '1.188em' : size === 'medium' ? '1.75em' : undefined,
|
|
17
|
-
height: size === 'small' ? '1.188em' : size === 'medium' ? '1.75em' : undefined,
|
|
18
|
-
'&.Erk-MuiInputBase-inputAdornedEnd': {
|
|
19
|
-
paddingRight: '0px !important',
|
|
20
|
-
},
|
|
21
|
-
whiteSpace: 'nowrap',
|
|
22
|
-
overflow: 'hidden',
|
|
23
|
-
textOverflow: 'ellipsis',
|
|
24
|
-
},
|
|
25
|
-
'& .Erk-MuiOutlinedInput-notchedOutline': {
|
|
26
|
-
borderColor: theme.palette.outline.main,
|
|
27
|
-
},
|
|
28
|
-
'&:hover:not(.Mui-readOnly) .Erk-MuiOutlinedInput-notchedOutline': {
|
|
29
|
-
borderColor: props.disabled || props.readOnly ? theme.palette.outline.main : theme.palette.primary.main,
|
|
30
|
-
},
|
|
31
|
-
'&.Mui-readOnly': {
|
|
32
|
-
'& .Erk-MuiSelect-select': {
|
|
33
|
-
color: theme.palette.text.primary,
|
|
34
|
-
WebkitTextFillColor: theme.palette.text.primary,
|
|
35
|
-
},
|
|
36
|
-
'& .Erk-MuiSelect-icon': {
|
|
37
|
-
color: theme.palette.text.primary + 'a0',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
'& .Mui-disabled, &.Mui-readOnly': {
|
|
41
|
-
cursor: 'default',
|
|
42
|
-
},
|
|
43
|
-
'&.Erk-MuiInputBase-root.Mui-focused': {
|
|
44
|
-
'& .Erk-MuiOutlinedInput-notchedOutline': {
|
|
45
|
-
borderColor: theme.palette.primary.main,
|
|
46
|
-
borderWidth: 2,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
'& .Erk-MuiInputAdornment-root': {
|
|
50
|
-
marginLeft: 0,
|
|
51
|
-
marginRight: size === 'medium' ? 2 : 0,
|
|
52
|
-
color: theme.palette.text.primary + 'a0',
|
|
53
|
-
fill: theme.palette.text.primary + 'a0',
|
|
54
|
-
cursor: props.disabled || props.readOnly ? 'default' : 'pointer',
|
|
55
|
-
},
|
|
56
|
-
'& .Erk-MuiSelect-iconOpen': {
|
|
57
|
-
transform: props.IconComponent ? 'none' : undefined,
|
|
58
|
-
},
|
|
59
|
-
'& .Erk-MuiInputBase-input:has(.ErkIcon) ': {
|
|
60
|
-
paddingLeft: 40,
|
|
61
|
-
'& .ErkIcon': {
|
|
62
|
-
left: 12,
|
|
63
|
-
top: '50%',
|
|
64
|
-
position: 'absolute',
|
|
65
|
-
transform: 'translateY(-50%)',
|
|
66
|
-
fill: theme.palette.primary.main,
|
|
67
|
-
width: '20px',
|
|
68
|
-
height: '20px',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
}));
|
|
72
|
-
export const StyledInputLabel = styled(MuiInputLabel)(({ theme, size = 'small', ...props }) => ({
|
|
73
|
-
color: theme.palette.text.primary + '8a',
|
|
74
|
-
'&.Erk-MuiInputLabel-root.Mui-focused': {
|
|
75
|
-
color: theme.palette.primary.main,
|
|
76
|
-
},
|
|
77
|
-
'&.Erk-MuiFormLabel-root:not(.Erk-MuiInputLabel-shrink)': {
|
|
78
|
-
transform: `translate(12px, ${size === 'small' ? 5 : 9}px) scale(1)`,
|
|
79
|
-
maxWidth: 'calc(100% - 40px)',
|
|
80
|
-
},
|
|
81
|
-
'&.Mui-error': {
|
|
82
|
-
color: theme.palette.error.main,
|
|
83
|
-
},
|
|
84
|
-
opacity: props.disabled ? 0.5 : 1,
|
|
85
|
-
}));
|
|
86
|
-
export const StyledHelperText = styled(MuiFormHelperText)(({ theme, ...props }) => ({
|
|
87
|
-
color: theme.palette.helperText.primary,
|
|
88
|
-
overflow: 'hidden',
|
|
89
|
-
textOverflow: 'ellipsis',
|
|
90
|
-
opacity: props.disabled ? 0.5 : 1,
|
|
91
|
-
'&.Mui-error': {
|
|
92
|
-
color: theme.palette.error.main,
|
|
93
|
-
},
|
|
94
|
-
}));
|
|
95
|
-
function CustomSelect({ label, error, value, loading, onChange, children, required, inputRef, MenuProps, helperText, IconComponent, size = 'small', labelMargin = 5, multiple = false, readOnly = false, disabled = false, clearable = true, fullWidth = true, clearLabel = 'Sin Seleccionar', ...others }) {
|
|
96
|
-
const [open, setOpen] = useState(false);
|
|
97
|
-
const handleChange = useCallback((event) => onChange?.(event.target.value), [onChange]);
|
|
98
|
-
return (_jsxs(FormControl, { size: size, error: error, variant: "outlined", required: required, fullWidth: fullWidth, style: { marginTop: label ? labelMargin : undefined, maxWidth: '100%' }, children: [label && (_jsx(StyledInputLabel, { disabled: disabled, open: open, size: size === 'small' ? 'small' : undefined, children: label })), _jsxs(StyledSelect, { ...others, size: size, autoWidth: false, open: others.open ?? open, label: label, inputRef: inputRef, readOnly: readOnly, disabled: disabled, multiple: multiple, onChange: handleChange, value: value ?? (multiple ? [] : ''), IconComponent: IconComponent ? () => _jsx(_Fragment, {}) : undefined, endAdornment: IconComponent ? (_jsx(InputAdornment, { position: "end", onClick: (e) => {
|
|
99
|
-
e.stopPropagation();
|
|
100
|
-
if (!readOnly && !disabled) {
|
|
101
|
-
if (others.open !== undefined) {
|
|
102
|
-
if (others.open)
|
|
103
|
-
others.onClose?.(e);
|
|
104
|
-
else
|
|
105
|
-
others.onOpen?.(e);
|
|
106
|
-
}
|
|
107
|
-
else
|
|
108
|
-
setOpen((open) => !open);
|
|
109
|
-
}
|
|
110
|
-
}, children: _jsx(IconComponent, { size: size === 'small' ? 22 : 26 }) })) : undefined, onFocus: (e) => {
|
|
111
|
-
if (!e.relatedTarget?.closest('.Erk-MuiPaper-root')) {
|
|
112
|
-
setOpen(true);
|
|
113
|
-
}
|
|
114
|
-
others.onFocus?.(e);
|
|
115
|
-
}, MenuProps: {
|
|
116
|
-
disablePortal: true,
|
|
117
|
-
sx: (theme) => ({
|
|
118
|
-
'& .Erk-MuiMenuItem-root:has(.ErkIcon) ': {
|
|
119
|
-
gap: '10px',
|
|
120
|
-
padding: '6px 12px',
|
|
121
|
-
display: 'flex',
|
|
122
|
-
maxWidth: '100%',
|
|
123
|
-
alignItems: 'center',
|
|
124
|
-
'& .ErkIcon': {
|
|
125
|
-
width: '20px',
|
|
126
|
-
fill: theme.palette.primary.main,
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
}),
|
|
130
|
-
...MenuProps,
|
|
131
|
-
}, onOpen: others.onOpen ?? (() => setOpen(true)), onClose: others.onClose ?? (() => setOpen(false)), inputProps: { disabled: readOnly || disabled }, children: [((clearable && !multiple) || loading) && (_jsx(ErkMenuItem, { value: '', "data-testid": 'smart-select-empty', style: { whiteSpace: 'normal' }, children: _jsx("em", { children: loading ? 'Cargando...' : clearLabel }) }, 'EMPTY')), children] }), helperText && _jsx(StyledHelperText, { disabled: disabled, children: helperText })] }));
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
|
|
135
|
-
*/
|
|
136
|
-
class ErkSelect extends React.Component {
|
|
137
|
-
render() {
|
|
138
|
-
return _jsx(CustomSelect, { ...this.props });
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
export default ErkSelect;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkSelect from './ErkSelect';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkSelect;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
readOnly: false;
|
|
8
|
-
MenuProps: {
|
|
9
|
-
disablePortal: false;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
export declare const Default: Story;
|
|
16
|
-
export declare const Empty: Story;
|
|
17
|
-
export declare const ValueAndLabel: Story;
|
|
18
|
-
export declare const Full: Story;
|
|
19
|
-
export declare const Error: Story;
|
|
20
|
-
export declare const ErrorColor: Story;
|
|
21
|
-
export declare const DifferentColors: Story;
|