@arquimedes.co/eureka-forms 3.0.36 → 3.0.37-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/Condition.d.ts +4 -6
- package/dist/@Types/Form.d.ts +0 -1
- package/dist/@Types/FormStep.d.ts +8 -12
- package/dist/@Types/GenericFormSteps.d.ts +8 -0
- package/dist/App/App.d.ts +1 -3
- package/dist/App/App.js +21 -46
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +177 -336
- package/dist/App/AppFunctions.test.js +708 -0
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +149 -252
- package/dist/App/AppHooks.test.js +154 -0
- package/dist/Contexts/CustomContext.d.ts +0 -1
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +3 -2
- package/dist/Contexts/SectionContext.d.ts +0 -1
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +1 -2
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +36 -62
- package/dist/Form/Form.d.ts +2 -3
- package/dist/Form/Form.js +74 -164
- package/dist/Form/Form.module.css +0 -9
- package/dist/Form/FormFunctions.js +63 -112
- package/dist/Form/FormFunctions.test.js +458 -0
- package/dist/Form/FormHooks.d.ts +1 -2
- 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 +17 -29
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +34 -107
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +66 -93
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.d.ts +2 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/addRecursiveElementStep.js +22 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +45 -115
- package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
- package/dist/FormSteps/AYFStepMapper.js +60 -137
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +66 -172
- package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
- package/dist/FormSteps/CBRStepMapper.js +56 -168
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +49 -81
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +35 -66
- package/dist/FormSteps/CustomStep.d.ts +0 -1
- package/dist/FormSteps/CustomStep.js +17 -31
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +10 -0
- package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +14 -0
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +3 -0
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +34 -0
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +1 -2
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +9 -20
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +107 -302
- 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 +91 -184
- 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 +22 -33
- 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 +78 -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 +37 -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 +80 -155
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
- package/dist/FormSteps/Step.d.ts +0 -1
- package/dist/FormSteps/Step.js +33 -58
- package/dist/FormSteps/StepFunctions.d.ts +4 -6
- package/dist/FormSteps/StepFunctions.js +153 -208
- package/dist/FormSteps/StepFunctions.test.js +702 -0
- package/dist/FormSteps/StepHooks.d.ts +68 -14
- package/dist/FormSteps/StepHooks.js +96 -155
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +18 -20
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +39 -75
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
- package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +21 -54
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
- package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +15 -27
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +1 -0
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +2 -0
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +2 -3
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +8 -23
- package/dist/Icons/@ErkIcon.d.ts +14 -0
- package/dist/Icons/@ErkIcon.js +9 -0
- package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
- package/dist/Icons/ArrowLeftIcon.js +7 -0
- package/dist/Icons/ArrowRightIcon.d.ts +3 -0
- package/dist/Icons/ArrowRightIcon.js +7 -0
- package/dist/Icons/CalendarIcon.d.ts +2 -3
- package/dist/Icons/CalendarIcon.js +4 -14
- package/dist/Icons/CheckCircleIcon.d.ts +3 -0
- package/dist/Icons/CheckCircleIcon.js +7 -0
- package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
- package/dist/Icons/CheckboxCheckedIcon.js +7 -0
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
- package/dist/Icons/CheckboxUncheckedIcon.js +7 -0
- package/dist/Icons/ClockIcon.d.ts +3 -0
- package/dist/Icons/ClockIcon.js +7 -0
- package/dist/Icons/CloseIcon.d.ts +3 -0
- package/dist/Icons/CloseIcon.js +7 -0
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +3 -13
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +3 -13
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +3 -13
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +3 -13
- package/dist/Icons/DeleteIcon.d.ts +3 -0
- package/dist/Icons/DeleteIcon.js +7 -0
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +3 -13
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +3 -13
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +5 -15
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +5 -15
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +5 -15
- package/dist/Icons/Entities/WorkIcon.d.ts +3 -0
- package/dist/Icons/Entities/WorkIcon.js +7 -0
- package/dist/Icons/ErrorIcon.d.ts +3 -0
- package/dist/Icons/ErrorIcon.js +7 -0
- package/dist/Icons/ExpandLessIcon.d.ts +3 -0
- package/dist/Icons/ExpandLessIcon.js +7 -0
- package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
- package/dist/Icons/ExpandMoreIcon.js +7 -0
- package/dist/Icons/FileIcon.d.ts +3 -0
- package/dist/Icons/FileIcon.js +7 -0
- package/dist/Icons/InfoIcon.d.ts +3 -0
- package/dist/Icons/InfoIcon.js +7 -0
- package/dist/Icons/LocationIcon.d.ts +2 -3
- package/dist/Icons/LocationIcon.js +4 -14
- package/dist/Icons/PersonIcon.d.ts +2 -3
- package/dist/Icons/PersonIcon.js +6 -16
- package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DislikeIcon.js +7 -0
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/DissatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
- package/dist/Icons/Ratings/LikeIcon.js +7 -0
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/SatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
- package/dist/Icons/Ratings/StarIcon.js +7 -0
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +7 -0
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +7 -0
- package/dist/Icons/WarningIcon.d.ts +3 -0
- package/dist/Icons/WarningIcon.js +7 -0
- package/dist/Init.d.ts +1 -0
- package/dist/Init.js +2 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +22 -72
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +29 -86
- package/dist/Services/FormService.js +11 -56
- package/dist/Services/OrganizationService.js +11 -62
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
- package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
- package/dist/Shared/ErkButton/ErkButton.d.ts +25 -0
- package/dist/Shared/ErkButton/ErkButton.js +31 -0
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +16 -0
- package/dist/Shared/ErkButton/ErkButton.stories.js +28 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +31 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +13 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +34 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +18 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +277 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +98 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +18 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +180 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.d.ts +36 -0
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.js +274 -0
- package/dist/Shared/ErkMenuItem.d.ts +2 -0
- package/dist/Shared/ErkMenuItem.js +18 -0
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +17 -0
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +96 -0
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +48 -0
- package/dist/Shared/ErkSelect/ErkSelect.js +142 -0
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +21 -0
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +87 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +54 -0
- package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +3 -13
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +159 -0
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +34 -0
- package/dist/Shared/ErkTextField/ErkTextField.js +149 -0
- package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +4 -17
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +99 -0
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +32 -0
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +107 -0
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +29 -112
- package/dist/Shared/Loader/Loader.d.ts +0 -1
- package/dist/Shared/Loader/Loader.js +6 -18
- package/dist/Shared/Navbar/Navbar.d.ts +1 -3
- package/dist/Shared/Navbar/Navbar.js +3 -96
- package/dist/Shared/Navbar/Navbar.module.css +0 -15
- package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/Shared/Navbar/Navbar.stories.js +2 -2
- package/dist/Shared/Rating/Rating.d.ts +3 -5
- package/dist/Shared/Rating/Rating.js +4 -27
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +13 -19
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
- package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +1 -0
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +2 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +1 -2
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +8 -22
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +1 -2
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +27 -43
- package/dist/Shared/Toggle/Toggle.d.ts +5 -14
- package/dist/Shared/Toggle/Toggle.js +29 -32
- package/dist/States/GlobalSlice.d.ts +7 -12
- package/dist/States/GlobalSlice.js +6 -22
- package/dist/States/SiteSlice.d.ts +30 -48
- package/dist/States/SiteSlice.js +58 -76
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +8 -9
- package/dist/Utils/AxiosAPI.d.ts +4 -5
- package/dist/Utils/AxiosAPI.js +23 -73
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +29 -30
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +102 -143
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +27 -45
- package/dist/Utils/LocaleUtils.d.ts +2 -0
- package/dist/Utils/LocaleUtils.js +12 -0
- package/dist/Utils/MaterialProviders.d.ts +21 -1
- package/dist/Utils/MaterialProviders.js +46 -28
- package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
- package/dist/Utils/MuiClassnameSetup.js +3 -0
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +60 -81
- package/dist/Utils/TestUtils.js +28 -57
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +10 -8
- package/dist/Utils/store.d.ts +9 -17
- package/dist/Utils/store.js +15 -74
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +17 -27
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/{IconTypes.d.ts → ErkIconTypes.d.ts} +2 -4
- package/dist/constants/ErkIconTypes.js +16 -0
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/FormStepTypes.d.ts +2 -2
- package/dist/constants/FormStepTypes.js +1 -1
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/hooks.d.ts +0 -3
- package/dist/hooks.js +14 -77
- package/dist/index.css +15 -0
- package/dist/index.lib.d.ts +0 -1
- package/dist/index.lib.js +0 -1
- package/dist/main.d.ts +3 -0
- package/dist/main.js +25 -0
- package/package.json +111 -125
- package/dist/@Types/ErkValue.d.ts +0 -16
- package/dist/@Types/User.d.ts +0 -13
- package/dist/Icons/@IconTypes.d.ts +0 -7
- package/dist/Icons/EmailIcon.d.ts +0 -4
- package/dist/Icons/EmailIcon.js +0 -17
- package/dist/Icons/Entities/SchoolIcon.d.ts +0 -2
- package/dist/Icons/Entities/SchoolIcon.js +0 -17
- package/dist/Icons/GroupIcon.d.ts +0 -4
- package/dist/Icons/GroupIcon.js +0 -17
- package/dist/Icons/LockedIcon.d.ts +0 -4
- package/dist/Icons/LockedIcon.js +0 -17
- package/dist/Login/Login.module.css +0 -135
- package/dist/Login/LoginLayout.module.css +0 -68
- package/dist/Login/LoginPage.d.ts +0 -11
- package/dist/Login/LoginPage.js +0 -177
- package/dist/Login/LoginTextField.d.ts +0 -15
- package/dist/Login/LoginTextField.js +0 -134
- package/dist/Services/ApiSelectorService.d.ts +0 -39
- package/dist/Services/ApiSelectorService.js +0 -244
- package/dist/Services/IntegrationService.d.ts +0 -21
- package/dist/Services/IntegrationService.js +0 -69
- package/dist/Services/UserService.d.ts +0 -10
- package/dist/Services/UserService.js +0 -71
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +0 -30
- package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +0 -23
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +0 -36
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +0 -21
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +0 -36
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
- package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +0 -28
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
- package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +0 -41
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +0 -14
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +0 -60
- package/dist/__mocks__/axios.d.ts +0 -2
- package/dist/__mocks__/axios.js +0 -2
- package/dist/constants/ErkValueTypes.d.ts +0 -6
- package/dist/constants/ErkValueTypes.js +0 -7
- package/dist/constants/IconTypes.js +0 -18
- package/dist/constants/MaterialClassNameSeed.d.ts +0 -1
- package/dist/constants/MaterialClassNameSeed.js +0 -1
- package/dist/index.js +0 -31
- /package/dist/{@Types/ErkValue.js → App/AppFunctions.test.d.ts} +0 -0
- /package/dist/{@Types/User.js → App/AppHooks.test.d.ts} +0 -0
- /package/dist/{Icons/@IconTypes.js → Form/FormFunctions.test.d.ts} +0 -0
- /package/dist/{index.d.ts → FormSteps/StepFunctions.test.d.ts} +0 -0
- /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
- /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
- /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import ErkDateRangePicker from './ErkDateRangePicker';
|
|
3
|
+
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
const meta = {
|
|
6
|
+
component: ErkDateRangePicker,
|
|
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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { ...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(ErkDateRangePicker, { label: "Fecha de Inicio del Proyecto", value: range1, onChange: setRange1, helperText: "Seleccione el per\u00EDodo del proyecto" }), _jsx(ErkDateRangePicker, { label: "Per\u00EDodo de Pruebas", value: range2, onChange: setRange2, helperText: "Enero 2025" }), _jsx(ErkDateRangePicker, { 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
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const Styled: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "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>, {}, {}>;
|
|
2
|
+
export default Styled;
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
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;
|
|
@@ -0,0 +1,96 @@
|
|
|
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;
|
|
@@ -0,0 +1,48 @@
|
|
|
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<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
9
|
+
component?: React.ElementType;
|
|
10
|
+
} & {
|
|
11
|
+
open: boolean;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "required" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
14
|
+
component?: React.ElementType;
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export type ErkSelectValue<Type extends string | number, Multiple, Clearable> = Multiple extends true ? Type[] : Clearable extends true ? Type | undefined : Type;
|
|
17
|
+
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 {
|
|
18
|
+
/** if selecting multiple values */
|
|
19
|
+
multiple?: Multiple;
|
|
20
|
+
/** If the usar can clear the value */
|
|
21
|
+
clearable?: Clearable;
|
|
22
|
+
/** If the input is loading */
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
/** children to display in the options */
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/** Currently selected value */
|
|
27
|
+
value?: ErkSelectValue<Type, Multiple, Clearable>;
|
|
28
|
+
onChange?: (value: ErkSelectValue<Type, Multiple, Clearable>) => void;
|
|
29
|
+
/** String to place in the label */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** The helper Text to display */
|
|
32
|
+
helperText?: string;
|
|
33
|
+
/** Label to display on clearable */
|
|
34
|
+
clearLabel?: string;
|
|
35
|
+
/** labelMargin */
|
|
36
|
+
labelMargin?: number;
|
|
37
|
+
}
|
|
38
|
+
export type CustomErkSelectOnChangeType<ChangeType, Multiple extends boolean | undefined, Clearable extends boolean | undefined> = Multiple extends true ? ChangeType[] : Clearable extends true ? ChangeType | undefined : ChangeType;
|
|
39
|
+
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'> {
|
|
40
|
+
onChange?: (value: CustomErkSelectOnChangeType<ChangeType, Multiple, Clearable>) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
|
|
44
|
+
*/
|
|
45
|
+
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>> {
|
|
46
|
+
render(): JSX.Element;
|
|
47
|
+
}
|
|
48
|
+
export default ErkSelect;
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
pointerEvents: 'none',
|
|
43
|
+
},
|
|
44
|
+
'&.Erk-MuiInputBase-root.Mui-focused': {
|
|
45
|
+
'& .Erk-MuiOutlinedInput-notchedOutline': {
|
|
46
|
+
borderColor: theme.palette.primary.main,
|
|
47
|
+
borderWidth: 2,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'& .Erk-MuiInputAdornment-root': {
|
|
51
|
+
marginLeft: 0,
|
|
52
|
+
marginRight: size === 'medium' ? 2 : 0,
|
|
53
|
+
color: theme.palette.text.primary + 'a0',
|
|
54
|
+
fill: theme.palette.text.primary + 'a0',
|
|
55
|
+
cursor: props.disabled || props.readOnly ? 'default' : 'pointer',
|
|
56
|
+
},
|
|
57
|
+
'& .Erk-MuiSelect-iconOpen': {
|
|
58
|
+
transform: props.IconComponent ? 'none' : undefined,
|
|
59
|
+
},
|
|
60
|
+
'& .Erk-MuiInputBase-input:has(.ErkIcon) ': {
|
|
61
|
+
paddingLeft: 40,
|
|
62
|
+
'& .ErkIcon': {
|
|
63
|
+
left: 12,
|
|
64
|
+
top: '50%',
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
transform: 'translateY(-50%)',
|
|
67
|
+
fill: theme.palette.primary.main,
|
|
68
|
+
width: '20px',
|
|
69
|
+
height: '20px',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
}));
|
|
73
|
+
export const StyledInputLabel = styled(MuiInputLabel)(({ theme, size = 'small', ...props }) => ({
|
|
74
|
+
color: theme.palette.text.primary + '8a',
|
|
75
|
+
'&.Erk-MuiInputLabel-root.Mui-focused': {
|
|
76
|
+
color: theme.palette.primary.main,
|
|
77
|
+
},
|
|
78
|
+
'&.Erk-MuiFormLabel-root:not(.Erk-MuiInputLabel-shrink)': {
|
|
79
|
+
transform: `translate(12px, ${size === 'small' ? 5 : 9}px) scale(1)`,
|
|
80
|
+
maxWidth: 'calc(100% - 40px)',
|
|
81
|
+
},
|
|
82
|
+
'&.Mui-error': {
|
|
83
|
+
color: theme.palette.error.main,
|
|
84
|
+
},
|
|
85
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
86
|
+
}));
|
|
87
|
+
export const StyledHelperText = styled(MuiFormHelperText)(({ theme, ...props }) => ({
|
|
88
|
+
color: theme.palette.helperText.primary,
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
textOverflow: 'ellipsis',
|
|
91
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
92
|
+
'&.Mui-error': {
|
|
93
|
+
color: theme.palette.error.main,
|
|
94
|
+
},
|
|
95
|
+
}));
|
|
96
|
+
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 }) {
|
|
97
|
+
const [open, setOpen] = useState(false);
|
|
98
|
+
const handleChange = useCallback((event) => onChange?.(event.target.value), [onChange]);
|
|
99
|
+
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) => {
|
|
100
|
+
e.stopPropagation();
|
|
101
|
+
if (!readOnly && !disabled) {
|
|
102
|
+
if (others.open !== undefined) {
|
|
103
|
+
if (others.open)
|
|
104
|
+
others.onClose?.(e);
|
|
105
|
+
else
|
|
106
|
+
others.onOpen?.(e);
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
setOpen((open) => !open);
|
|
110
|
+
}
|
|
111
|
+
}, children: _jsx(IconComponent, { size: size === 'small' ? 22 : 26 }) })) : undefined, onFocus: (e) => {
|
|
112
|
+
if (!e.relatedTarget?.closest('.Erk-MuiPaper-root')) {
|
|
113
|
+
setOpen(true);
|
|
114
|
+
}
|
|
115
|
+
others.onFocus?.(e);
|
|
116
|
+
}, MenuProps: {
|
|
117
|
+
disablePortal: true,
|
|
118
|
+
sx: (theme) => ({
|
|
119
|
+
'& .Erk-MuiMenuItem-root:has(.ErkIcon) ': {
|
|
120
|
+
gap: '10px',
|
|
121
|
+
padding: '6px 12px',
|
|
122
|
+
display: 'flex',
|
|
123
|
+
maxWidth: '100%',
|
|
124
|
+
alignItems: 'center',
|
|
125
|
+
'& .ErkIcon': {
|
|
126
|
+
width: '20px',
|
|
127
|
+
fill: theme.palette.primary.main,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
...MenuProps,
|
|
132
|
+
}, 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 })] }));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
|
|
136
|
+
*/
|
|
137
|
+
class ErkSelect extends React.Component {
|
|
138
|
+
render() {
|
|
139
|
+
return _jsx(CustomSelect, { ...this.props });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export default ErkSelect;
|
|
@@ -0,0 +1,21 @@
|
|
|
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;
|