@arquimedes.co/eureka-forms 3.0.31-test → 3.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@Types/Condition.d.ts +6 -4
- package/dist/@Types/ErkValue.d.ts +16 -0
- package/dist/@Types/Form.d.ts +1 -0
- package/dist/@Types/FormStep.d.ts +11 -4
- package/dist/@Types/User.d.ts +13 -0
- package/dist/App/App.d.ts +3 -1
- package/dist/App/App.js +46 -21
- package/dist/App/AppFunctions.d.ts +1 -1
- package/dist/App/AppFunctions.js +336 -177
- package/dist/App/AppHooks.d.ts +2 -2
- package/dist/App/AppHooks.js +252 -146
- package/dist/Contexts/CustomContext.d.ts +1 -0
- package/dist/Contexts/CustomContext.js +1 -1
- package/dist/Contexts/FormContext.d.ts +1 -1
- package/dist/Contexts/FormContext.js +2 -3
- package/dist/Contexts/SectionContext.d.ts +1 -0
- package/dist/Contexts/SectionContext.js +1 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -1
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +62 -36
- package/dist/Form/Form.d.ts +2 -1
- package/dist/Form/Form.js +164 -71
- package/dist/Form/Form.module.css +9 -0
- package/dist/Form/FormFunctions.js +112 -63
- package/dist/Form/FormHooks.d.ts +1 -0
- package/dist/Form/FormHooks.js +21 -13
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -0
- package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +105 -32
- package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +2 -1
- package/dist/Form/FormTypes/StepperForm/StepperForm.js +110 -46
- package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -0
- package/dist/Form/Section/MaterialSection/MaterialSection.js +23 -10
- package/dist/Form/Section/MaterialSection/MaterialSection.module.css +2 -0
- package/dist/Form/Section/Section.d.ts +1 -0
- package/dist/Form/Section/Section.js +15 -4
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -0
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +65 -30
- package/dist/Form/Terms/Term/Term.d.ts +1 -0
- package/dist/Form/Terms/Term/Term.js +13 -2
- package/dist/Form/Terms/Terms.d.ts +1 -0
- package/dist/Form/Terms/Terms.js +27 -11
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +107 -34
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +40 -12
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +77 -56
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +1 -0
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +115 -45
- package/dist/FormSteps/AYFStepMapper.d.ts +1 -0
- package/dist/FormSteps/AYFStepMapper.js +137 -60
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +13 -2
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +173 -64
- package/dist/FormSteps/CBRStepMapper.d.ts +1 -0
- package/dist/FormSteps/CBRStepMapper.js +168 -56
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +13 -2
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -0
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +37 -19
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -0
- package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +13 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +2 -1
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +81 -44
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +26 -3
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +1 -0
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +61 -31
- package/dist/FormSteps/CustomStep.d.ts +1 -0
- package/dist/FormSteps/CustomStep.js +31 -17
- package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/DatePickerStep.js +13 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +2 -1
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +20 -9
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +13 -2
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +1 -0
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +32 -16
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +2 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +300 -106
- package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/FileUploadStep.js +13 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +95 -33
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -0
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +180 -85
- package/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MapperStep.js +13 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +38 -16
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +31 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +175 -85
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +47 -20
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -0
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +115 -70
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +2 -1
- package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +33 -15
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +1 -0
- package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +13 -2
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +31 -17
- package/dist/FormSteps/RatingStep/RatingStep.d.ts +1 -0
- package/dist/FormSteps/RatingStep/RatingStep.js +13 -2
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +61 -31
- package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -0
- package/dist/FormSteps/SelectorStep/SelectorStep.js +13 -2
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -2
- package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -0
- package/dist/FormSteps/SeparatorStep/SeparatorStep.js +13 -2
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +2 -1
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +155 -73
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
- package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +13 -2
- package/dist/FormSteps/Step.d.ts +1 -0
- package/dist/FormSteps/Step.js +58 -29
- package/dist/FormSteps/StepFunctions.d.ts +6 -4
- package/dist/FormSteps/StepFunctions.js +208 -152
- package/dist/FormSteps/StepHooks.d.ts +14 -68
- package/dist/FormSteps/StepHooks.js +154 -88
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +20 -18
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +74 -36
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +2 -1
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +28 -12
- package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +1 -0
- package/dist/FormSteps/TextAreaStep/TextAreaStep.js +14 -3
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +30 -12
- package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +2 -1
- package/dist/FormSteps/TextInputStep/TextInputStep.js +13 -2
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +2 -1
- package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +26 -9
- package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +1 -0
- package/dist/FormSteps/TimePickerStep/TimePickerStep.js +13 -2
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +54 -21
- package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -0
- package/dist/FormSteps/TitleStep/TitleStep.js +13 -2
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +2 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +27 -14
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +1 -0
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +23 -8
- package/dist/Icons/@IconTypes.d.ts +7 -0
- package/dist/Icons/CalendarIcon.d.ts +3 -2
- package/dist/Icons/CalendarIcon.js +14 -4
- package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
- package/dist/Icons/Construction/LeakIcon.js +13 -3
- package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
- package/dist/Icons/Construction/ProjectIcon.js +13 -3
- package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
- package/dist/Icons/Construction/PropertyIcon.js +13 -3
- package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
- package/dist/Icons/Construction/SpaceIcon.js +13 -3
- package/dist/Icons/DocumentIcon.d.ts +2 -2
- package/dist/Icons/DocumentIcon.js +13 -3
- package/dist/Icons/EmailIcon.d.ts +4 -0
- package/dist/Icons/EmailIcon.js +17 -0
- package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
- package/dist/Icons/Entities/CheckListIcon.js +13 -3
- package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
- package/dist/Icons/Entities/GenericEntityIcon.js +15 -5
- package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
- package/dist/Icons/Entities/HandshakeIcon.js +15 -5
- package/dist/Icons/Entities/SchoolIcon.d.ts +2 -0
- package/dist/Icons/Entities/SchoolIcon.js +17 -0
- package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
- package/dist/Icons/Entities/SupplierIcon.js +15 -5
- package/dist/Icons/GroupIcon.d.ts +4 -0
- package/dist/Icons/GroupIcon.js +17 -0
- package/dist/Icons/LocationIcon.d.ts +3 -2
- package/dist/Icons/LocationIcon.js +14 -4
- package/dist/Icons/LockedIcon.d.ts +4 -0
- package/dist/Icons/LockedIcon.js +17 -0
- package/dist/Icons/PersonIcon.d.ts +3 -2
- package/dist/Icons/PersonIcon.js +16 -6
- package/dist/Login/Login.module.css +135 -0
- package/dist/Login/LoginLayout.module.css +68 -0
- package/dist/Login/LoginPage.d.ts +11 -0
- package/dist/Login/LoginPage.js +177 -0
- package/dist/Login/LoginTextField.d.ts +15 -0
- package/dist/Login/LoginTextField.js +134 -0
- package/dist/Services/DraftService.d.ts +14 -14
- package/dist/Services/DraftService.js +72 -22
- package/dist/Services/FileService.d.ts +1 -1
- package/dist/Services/FileService.js +86 -29
- package/dist/Services/FormService.js +56 -11
- package/dist/Services/IntegrationService.d.ts +21 -0
- package/dist/Services/IntegrationService.js +69 -0
- package/dist/Services/OrganizationService.js +62 -11
- package/dist/Services/UserService.d.ts +10 -0
- package/dist/Services/UserService.js +71 -0
- package/dist/Shared/CustomBtn/CustomBtn.d.ts +2 -1
- package/dist/Shared/CustomBtn/CustomBtn.js +88 -24
- package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
- package/dist/Shared/InputIcon/InputIcon.js +112 -29
- package/dist/Shared/Loader/Loader.d.ts +1 -0
- package/dist/Shared/Loader/Loader.js +18 -6
- package/dist/Shared/Navbar/Navbar.d.ts +3 -1
- package/dist/Shared/Navbar/Navbar.js +96 -3
- package/dist/Shared/Navbar/Navbar.module.css +15 -0
- package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/Shared/Navbar/Navbar.stories.js +2 -2
- package/dist/Shared/Rating/Rating.d.ts +5 -3
- package/dist/Shared/Rating/Rating.js +27 -4
- package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
- package/dist/Shared/Rating/Rating.stories.js +19 -13
- package/dist/Shared/Rating/Ratings/LikeRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/LikeRating.js +33 -19
- package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/SatisfactionRating.js +47 -27
- package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +2 -1
- package/dist/Shared/Rating/Ratings/ScaleRating.js +54 -23
- package/dist/Shared/RoundedButton/RoundedButton.d.ts +30 -0
- package/dist/Shared/RoundedButton/RoundedButton.js +45 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
- package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +49 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +351 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
- package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +43 -0
- package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +226 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +68 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.js +214 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
- package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +236 -0
- package/dist/Shared/{ErkSmartSelect/ErkSmartSelect.stories.d.ts → RoundedSmartSelect/RoundedSmartSelect.stories.d.ts} +13 -3
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +45 -0
- package/dist/Shared/RoundedTextField/RoundedTextField.js +175 -0
- package/dist/Shared/{ErkTextField/ErkTextField.stories.d.ts → RoundedTextField/RoundedTextField.stories.d.ts} +17 -4
- package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +224 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +41 -0
- package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +314 -0
- package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/FormDecorator.js +22 -8
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
- package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +60 -0
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +2 -1
- package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +43 -27
- package/dist/Shared/Toggle/Toggle.d.ts +14 -5
- package/dist/Shared/Toggle/Toggle.js +32 -29
- package/dist/States/GlobalSlice.d.ts +12 -7
- package/dist/States/GlobalSlice.js +22 -6
- package/dist/States/SiteSlice.d.ts +48 -30
- package/dist/States/SiteSlice.js +76 -58
- package/dist/States/WidthStatsSlice.d.ts +2 -2
- package/dist/States/WidthStatsSlice.js +9 -8
- package/dist/Utils/AxiosAPI.d.ts +5 -4
- package/dist/Utils/AxiosAPI.js +73 -23
- package/dist/Utils/AxiosWidget.js +4 -4
- package/dist/Utils/CBRFunctions.js +30 -29
- package/dist/Utils/DraftFunctions.d.ts +3 -3
- package/dist/Utils/DraftFunctions.js +143 -102
- package/dist/Utils/FormStepFunctions.d.ts +1 -1
- package/dist/Utils/FormStepFunctions.js +45 -27
- package/dist/Utils/MaterialProviders.d.ts +1 -21
- package/dist/Utils/MaterialProviders.js +28 -46
- package/dist/Utils/PhoneFunctions.js +5 -5
- package/dist/Utils/StoreContext.js +1 -1
- package/dist/Utils/TestUtils.d.ts +81 -60
- package/dist/Utils/TestUtils.js +57 -28
- package/dist/Utils/_api.d.ts +7 -7
- package/dist/Utils/_api.js +8 -10
- package/dist/Utils/store.d.ts +17 -9
- package/dist/Utils/store.js +74 -15
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +26 -16
- package/dist/__mocks__/axios.d.ts +2 -0
- package/dist/__mocks__/axios.js +2 -0
- package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
- package/dist/constants/ErkValueTypes.d.ts +6 -0
- package/dist/constants/ErkValueTypes.js +7 -0
- package/dist/constants/Files/FileExtensions.js +3 -3
- package/dist/constants/Files/FileMaxSize.js +1 -1
- package/dist/constants/FormStepTypes.d.ts +2 -1
- package/dist/constants/FormStepTypes.js +1 -0
- package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
- package/dist/constants/IconTypes.js +18 -0
- package/dist/constants/InternalFormStyle.js +1 -1
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
- package/dist/constants/MaterialClassNameSeed.js +1 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +77 -14
- package/dist/index.js +31 -0
- package/dist/index.lib.d.ts +1 -0
- package/dist/index.lib.js +1 -0
- package/package.json +93 -72
- package/dist/App/AppFunctions.test.js +0 -708
- package/dist/App/AppHooks.test.js +0 -154
- package/dist/Form/FormFunctions.test.js +0 -458
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
- package/dist/FormSteps/StepFunctions.test.js +0 -695
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +0 -1
- package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +0 -2
- package/dist/Icons/@ErkIcon.d.ts +0 -14
- package/dist/Icons/@ErkIcon.js +0 -9
- package/dist/Icons/ArrowLeftIcon.d.ts +0 -3
- package/dist/Icons/ArrowLeftIcon.js +0 -7
- package/dist/Icons/ArrowRightIcon.d.ts +0 -3
- package/dist/Icons/ArrowRightIcon.js +0 -7
- package/dist/Icons/CheckCircleIcon.d.ts +0 -3
- package/dist/Icons/CheckCircleIcon.js +0 -7
- package/dist/Icons/CheckboxCheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxCheckedIcon.js +0 -7
- package/dist/Icons/CheckboxUncheckedIcon.d.ts +0 -3
- package/dist/Icons/CheckboxUncheckedIcon.js +0 -7
- package/dist/Icons/ClockIcon.d.ts +0 -3
- package/dist/Icons/ClockIcon.js +0 -7
- package/dist/Icons/CloseIcon.d.ts +0 -3
- package/dist/Icons/CloseIcon.js +0 -7
- package/dist/Icons/DeleteIcon.d.ts +0 -3
- package/dist/Icons/DeleteIcon.js +0 -7
- package/dist/Icons/Entities/WorkIcon.d.ts +0 -3
- package/dist/Icons/Entities/WorkIcon.js +0 -7
- package/dist/Icons/ErrorIcon.d.ts +0 -3
- package/dist/Icons/ErrorIcon.js +0 -7
- package/dist/Icons/ExpandLessIcon.d.ts +0 -3
- package/dist/Icons/ExpandLessIcon.js +0 -7
- package/dist/Icons/ExpandMoreIcon.d.ts +0 -3
- package/dist/Icons/ExpandMoreIcon.js +0 -7
- package/dist/Icons/FileIcon.d.ts +0 -3
- package/dist/Icons/FileIcon.js +0 -7
- package/dist/Icons/InfoIcon.d.ts +0 -3
- package/dist/Icons/InfoIcon.js +0 -7
- package/dist/Icons/Ratings/DislikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DislikeIcon.js +0 -7
- package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/DissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/LikeIcon.d.ts +0 -3
- package/dist/Icons/Ratings/LikeIcon.js +0 -7
- package/dist/Icons/Ratings/SatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/SatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/StarIcon.d.ts +0 -3
- package/dist/Icons/Ratings/StarIcon.js +0 -7
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +0 -7
- package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +0 -3
- package/dist/Icons/Ratings/VerySatisfiedIcon.js +0 -7
- package/dist/Icons/WarningIcon.d.ts +0 -3
- package/dist/Icons/WarningIcon.js +0 -7
- package/dist/Init.d.ts +0 -1
- package/dist/Init.js +0 -2
- package/dist/Shared/ErkButton/ErkButton.d.ts +0 -25
- package/dist/Shared/ErkButton/ErkButton.js +0 -31
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
- package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +0 -19
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +0 -31
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
- package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +0 -18
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +0 -266
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
- package/dist/Shared/ErkMenuItem.d.ts +0 -4
- package/dist/Shared/ErkMenuItem.js +0 -18
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
- package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
- package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
- package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
- package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
- package/dist/Utils/LocaleUtils.d.ts +0 -2
- package/dist/Utils/LocaleUtils.js +0 -12
- package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
- package/dist/Utils/MuiClassnameSetup.js +0 -3
- package/dist/constants/ErkIconTypes.js +0 -16
- package/dist/index.css +0 -15
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -25
- /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
- /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
- /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
- /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
- /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
- /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import { styled, Dialog as MuiDialog } from '@mui/material';
|
|
4
|
-
import { MobileDatePicker as MuiDatePicker, MobileDateTimePicker as MuiDateTimePicker, DatePickerToolbar as MuiDatePickerToolbar, DateTimePickerToolbar as MuiDateTimePickerToolbar, PickersDay as MuiPickerDay, usePickerContext, } from '@mui/x-date-pickers';
|
|
5
|
-
import { StyledTextField } from '../ErkTextField/ErkTextField';
|
|
6
|
-
import CalendarIcon from '../../Icons/CalendarIcon';
|
|
7
|
-
import { renderTimeViewClock } from '@mui/x-date-pickers/timeViewRenderers';
|
|
8
|
-
const StyledDateTimePicker = styled(MuiDateTimePicker, {
|
|
9
|
-
shouldForwardProp: (propName) => propName !== 'size',
|
|
10
|
-
})(({ disabled, size }) => ({
|
|
11
|
-
'& .Erk-MuiInputBase-root': {
|
|
12
|
-
cursor: disabled ? 'default' : 'pointer',
|
|
13
|
-
'& input': {
|
|
14
|
-
cursor: disabled ? 'default' : 'pointer',
|
|
15
|
-
paddingRight: '0px',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
'& .Erk-MuiInputBase-adornedEnd': {
|
|
19
|
-
paddingRight: '7px',
|
|
20
|
-
},
|
|
21
|
-
'& .Erk-MuiInputAdornment-root': {
|
|
22
|
-
minWidth: size === 'small' ? 24 : 26,
|
|
23
|
-
'& .Erk-MuiButtonBase-root': {
|
|
24
|
-
margin: '-2px',
|
|
25
|
-
padding: 3,
|
|
26
|
-
width: size === 'small' ? 28 : 26,
|
|
27
|
-
height: size === 'small' ? 28 : 26,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
'& .Erk-MuiClock-root': {
|
|
31
|
-
marginBottom: '16px',
|
|
32
|
-
},
|
|
33
|
-
}));
|
|
34
|
-
const StyledDatePicker = styled(MuiDatePicker, {
|
|
35
|
-
shouldForwardProp: (propName) => propName !== 'size',
|
|
36
|
-
})(({ disabled, size }) => ({
|
|
37
|
-
'& .Erk-MuiInputBase-root': {
|
|
38
|
-
cursor: disabled ? 'default' : 'pointer',
|
|
39
|
-
'& input': {
|
|
40
|
-
cursor: disabled ? 'default' : 'pointer',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
'& .Erk-MuiInputBase-adornedEnd': {
|
|
44
|
-
paddingRight: '7px',
|
|
45
|
-
},
|
|
46
|
-
'& .Erk-MuiInputAdornment-root': {
|
|
47
|
-
minWidth: size === 'small' ? 24 : 26,
|
|
48
|
-
'& .Erk-MuiButtonBase-root': {
|
|
49
|
-
margin: '-2px',
|
|
50
|
-
padding: 3,
|
|
51
|
-
width: size === 'small' ? 28 : 26,
|
|
52
|
-
height: size === 'small' ? 28 : 26,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
}));
|
|
56
|
-
const StyledDateTimeToolBar = styled(MuiDateTimePickerToolbar)(({ theme }) => ({
|
|
57
|
-
'&.Erk-MuiPickersToolbar-root': {
|
|
58
|
-
backgroundColor: theme.palette.primary.main,
|
|
59
|
-
color: theme.palette.primary.contrastText,
|
|
60
|
-
'& span': {
|
|
61
|
-
fontSize: '1rem',
|
|
62
|
-
textTransform: 'none',
|
|
63
|
-
color: theme.palette.primary.contrastText,
|
|
64
|
-
},
|
|
65
|
-
'& .Erk-MuiDateTimePickerToolbar-dateContainer': {
|
|
66
|
-
'& span': {
|
|
67
|
-
fontSize: '1.1rem',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
'& .Erk-MuiDateTimePickerToolbar-timeDigitsContainer': {
|
|
71
|
-
'& span': {
|
|
72
|
-
fontSize: '2.3rem',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
'& .Erk-MuiDateTimePickerToolbar-ampmSelection': {
|
|
76
|
-
'& span': {
|
|
77
|
-
color: theme.palette.primary.contrastText + '8b',
|
|
78
|
-
'&.Mui-selected': {
|
|
79
|
-
color: theme.palette.primary.contrastText,
|
|
80
|
-
fontWeight: 600,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
cursor: 'default',
|
|
86
|
-
'& .Erk-MuiTypography-root': {
|
|
87
|
-
textTransform: 'capitalize',
|
|
88
|
-
color: theme.palette.primary.contrastText,
|
|
89
|
-
},
|
|
90
|
-
}));
|
|
91
|
-
const StyledDateToolBar = styled(MuiDatePickerToolbar)(({ theme }) => ({
|
|
92
|
-
'&.Erk-MuiPickersToolbar-root': {
|
|
93
|
-
backgroundColor: theme.palette.primary.main,
|
|
94
|
-
color: theme.palette.primary.contrastText,
|
|
95
|
-
'& span': {
|
|
96
|
-
fontSize: '1rem',
|
|
97
|
-
textTransform: 'capitalize',
|
|
98
|
-
color: theme.palette.primary.contrastText,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
cursor: 'default',
|
|
102
|
-
'& .Erk-MuiTypography-root': {
|
|
103
|
-
textTransform: 'capitalize',
|
|
104
|
-
color: theme.palette.primary.contrastText,
|
|
105
|
-
},
|
|
106
|
-
}));
|
|
107
|
-
const StyledDialog = styled(MuiDialog)(({ theme }) => ({
|
|
108
|
-
'& .Erk-MuiDialog-paper': {
|
|
109
|
-
borderRadius: '5px',
|
|
110
|
-
backgroundColor: 'transparent',
|
|
111
|
-
},
|
|
112
|
-
'& .Erk-MuiPickersLayout-root': {
|
|
113
|
-
display: 'flex',
|
|
114
|
-
flexDirection: 'column',
|
|
115
|
-
},
|
|
116
|
-
'& .Erk-MuiDialogActions-root': {
|
|
117
|
-
'& .Erk-MuiButtonBase-root': { fontWeight: 700 },
|
|
118
|
-
},
|
|
119
|
-
'& .Erk-MuiDialogContent-root': {
|
|
120
|
-
scrollbarColor: theme.palette.primary.main + ' white',
|
|
121
|
-
},
|
|
122
|
-
}));
|
|
123
|
-
const StyledDay = styled(MuiPickerDay)(({ theme }) => ({
|
|
124
|
-
fontWeight: 500,
|
|
125
|
-
fontSize: '0.9rem',
|
|
126
|
-
lineHeight: 'normal',
|
|
127
|
-
'&.Erk-MuiPickersDay-today': {
|
|
128
|
-
backgroundColor: theme.palette.primary.main + '33',
|
|
129
|
-
},
|
|
130
|
-
'&.Erk-MuiPickersDay-dayOutsideMonth': {
|
|
131
|
-
color: 'rgb(0,0,0,0.4)',
|
|
132
|
-
'&.Mui-selected': {
|
|
133
|
-
color: theme.palette.primary.contrastText,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
}));
|
|
137
|
-
// eslint-disable-next-line react/display-name
|
|
138
|
-
const CustomTextField = forwardRef((props, ref) => {
|
|
139
|
-
const pickerContext = usePickerContext();
|
|
140
|
-
return _jsx(StyledTextField, { ...props, inputRef: ref, onClick: () => pickerContext.setOpen((prev) => !prev) });
|
|
141
|
-
});
|
|
142
|
-
function CustomDatePicker({ error, required, disabled, readOnly, helperText, size = 'small', labelMargin = 5, pickTime = false, ...others }) {
|
|
143
|
-
if (pickTime) {
|
|
144
|
-
return (_jsx(StyledDateTimePicker, { ampm: true, size: size, reduceAnimations: true, ...others, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, slotProps: {
|
|
145
|
-
actionBar: {
|
|
146
|
-
actions: ['clear', 'accept'],
|
|
147
|
-
},
|
|
148
|
-
layout: {
|
|
149
|
-
sx: {
|
|
150
|
-
//Pasar esto al componente de layout?
|
|
151
|
-
backgroundColor: '#ffffff',
|
|
152
|
-
textTransform: 'capitalize',
|
|
153
|
-
'& .Erk-MuiDayCalendar-weekDayLabel': {
|
|
154
|
-
gridColumn: 1,
|
|
155
|
-
gridRow: 2,
|
|
156
|
-
},
|
|
157
|
-
'& .Erk-MuiPickersCalendarHeader-root': {
|
|
158
|
-
marginTop: '5px',
|
|
159
|
-
},
|
|
160
|
-
'& .Erk-MuiDateCalendar-root': {
|
|
161
|
-
height: 'fit-content',
|
|
162
|
-
},
|
|
163
|
-
'& .Erk-MuiClock-root': {
|
|
164
|
-
fontSize: 16,
|
|
165
|
-
marginTop: '34px',
|
|
166
|
-
marginBottom: '30px',
|
|
167
|
-
},
|
|
168
|
-
'& .Erk-MuiTimeClock-arrowSwitcher': {
|
|
169
|
-
top: 5,
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
monthButton: {
|
|
174
|
-
sx: {
|
|
175
|
-
textTransform: 'capitalize',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
toolbar: {
|
|
179
|
-
toolbarFormat: 'eee, d MMM',
|
|
180
|
-
hidden: false,
|
|
181
|
-
toolbarPlaceholder: '– –',
|
|
182
|
-
},
|
|
183
|
-
textField: {
|
|
184
|
-
error,
|
|
185
|
-
size,
|
|
186
|
-
disabled,
|
|
187
|
-
helperText,
|
|
188
|
-
labelMargin,
|
|
189
|
-
placeholder: '',
|
|
190
|
-
fullWidth: true,
|
|
191
|
-
InputProps: {
|
|
192
|
-
disabled: disabled ?? readOnly,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
}, viewRenderers: {
|
|
196
|
-
hours: renderTimeViewClock,
|
|
197
|
-
minutes: renderTimeViewClock,
|
|
198
|
-
seconds: renderTimeViewClock,
|
|
199
|
-
}, slots: {
|
|
200
|
-
day: StyledDay,
|
|
201
|
-
dialog: StyledDialog,
|
|
202
|
-
toolbar: StyledDateTimeToolBar,
|
|
203
|
-
textField: CustomTextField,
|
|
204
|
-
openPickerIcon: CalendarIcon,
|
|
205
|
-
}, enableAccessibleFieldDOMStructure: false }));
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
return (_jsx(StyledDatePicker, { ...others, size: size, reduceAnimations: true, readOnly: readOnly, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
|
|
209
|
-
actionBar: {
|
|
210
|
-
actions: ['clear', 'accept'],
|
|
211
|
-
},
|
|
212
|
-
layout: {
|
|
213
|
-
sx: {
|
|
214
|
-
backgroundColor: '#ffffff',
|
|
215
|
-
textTransform: 'capitalize',
|
|
216
|
-
'& .Erk-MuiDayCalendar-weekDayLabel': {
|
|
217
|
-
cursor: 'default',
|
|
218
|
-
},
|
|
219
|
-
'& .Erk-MuiPickersCalendarHeader-root': {
|
|
220
|
-
marginTop: '5px',
|
|
221
|
-
},
|
|
222
|
-
'& .Erk-MuiDateCalendar-root': {
|
|
223
|
-
height: 'fit-content',
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
monthButton: {
|
|
228
|
-
sx: {
|
|
229
|
-
textTransform: 'capitalize',
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
toolbar: {
|
|
233
|
-
toolbarFormat: 'eee, d MMM',
|
|
234
|
-
hidden: false,
|
|
235
|
-
toolbarPlaceholder: '– –',
|
|
236
|
-
},
|
|
237
|
-
textField: {
|
|
238
|
-
size,
|
|
239
|
-
error,
|
|
240
|
-
disabled,
|
|
241
|
-
helperText,
|
|
242
|
-
labelMargin,
|
|
243
|
-
fullWidth: true,
|
|
244
|
-
placeholder: '',
|
|
245
|
-
InputProps: {
|
|
246
|
-
disabled: disabled ?? readOnly,
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
}, slots: {
|
|
250
|
-
day: StyledDay,
|
|
251
|
-
dialog: StyledDialog,
|
|
252
|
-
toolbar: StyledDateToolBar,
|
|
253
|
-
textField: CustomTextField,
|
|
254
|
-
openPickerIcon: CalendarIcon,
|
|
255
|
-
}, enableAccessibleFieldDOMStructure: false }));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Generic datepicker with apps designs. Is class due to the use in the react-hook-forms library
|
|
260
|
-
*/
|
|
261
|
-
class ErkDatePicker extends React.Component {
|
|
262
|
-
render() {
|
|
263
|
-
return _jsx(CustomDatePicker, { ...this.props });
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
export default ErkDatePicker;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkDatePicker from './ErkDatePicker';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkDatePicker;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
readOnly: false;
|
|
8
|
-
};
|
|
9
|
-
parameters: {
|
|
10
|
-
date: Date;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
export declare const Empty: Story;
|
|
16
|
-
export declare const Default: Story;
|
|
17
|
-
export declare const ValueAndLabel: Story;
|
|
18
|
-
export declare const Full: Story;
|
|
19
|
-
export declare const FullDateTime: Story;
|
|
20
|
-
export declare const Error: Story;
|
|
21
|
-
export declare const Menu: Story;
|
|
22
|
-
export declare const DateTimeDateMenu: Story;
|
|
23
|
-
export declare const DateTimeTimeMenu: Story;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import ErkDatePicker from './ErkDatePicker';
|
|
3
|
-
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
|
-
const meta = {
|
|
5
|
-
component: ErkDatePicker,
|
|
6
|
-
tags: ['autodocs'],
|
|
7
|
-
args: {
|
|
8
|
-
readOnly: false,
|
|
9
|
-
},
|
|
10
|
-
parameters: {
|
|
11
|
-
date: new Date('07-21-2021'),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
export default meta;
|
|
15
|
-
export const Empty = {
|
|
16
|
-
args: {
|
|
17
|
-
value: null,
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
export const Default = {
|
|
21
|
-
args: {
|
|
22
|
-
label: 'Label',
|
|
23
|
-
value: new Date('07-21-2021'),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export const ValueAndLabel = {
|
|
27
|
-
args: {
|
|
28
|
-
label: 'Label',
|
|
29
|
-
value: null,
|
|
30
|
-
},
|
|
31
|
-
render: function Component(args) {
|
|
32
|
-
const [, setArgs] = useArgs();
|
|
33
|
-
const onValueChange = (value) => {
|
|
34
|
-
args.onChange?.(value);
|
|
35
|
-
setArgs({ value });
|
|
36
|
-
};
|
|
37
|
-
return _jsx(ErkDatePicker, { ...args, onChange: onValueChange });
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
export const Full = {
|
|
41
|
-
args: {
|
|
42
|
-
label: 'Label',
|
|
43
|
-
value: null,
|
|
44
|
-
helperText: 'Helper text',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
export const FullDateTime = {
|
|
48
|
-
args: {
|
|
49
|
-
label: 'Label',
|
|
50
|
-
value: null,
|
|
51
|
-
helperText: 'Helper text',
|
|
52
|
-
pickTime: true,
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
export const Error = {
|
|
56
|
-
args: {
|
|
57
|
-
label: 'Label',
|
|
58
|
-
value: null,
|
|
59
|
-
helperText: 'Helper text',
|
|
60
|
-
error: true,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
export const Menu = {
|
|
64
|
-
args: {
|
|
65
|
-
label: 'Label',
|
|
66
|
-
value: null,
|
|
67
|
-
},
|
|
68
|
-
play: async ({ canvas, userEvent }) => {
|
|
69
|
-
const selector = canvas.getByTestId('date-picker');
|
|
70
|
-
await userEvent.click(selector);
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
export const DateTimeDateMenu = {
|
|
74
|
-
args: {
|
|
75
|
-
label: 'Label',
|
|
76
|
-
value: null,
|
|
77
|
-
pickTime: true,
|
|
78
|
-
},
|
|
79
|
-
play: async ({ canvas, userEvent }) => {
|
|
80
|
-
const selector = canvas.getByTestId('date-picker');
|
|
81
|
-
await userEvent.click(selector);
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
export const DateTimeTimeMenu = {
|
|
85
|
-
args: {
|
|
86
|
-
label: 'Label',
|
|
87
|
-
value: null,
|
|
88
|
-
pickTime: true,
|
|
89
|
-
},
|
|
90
|
-
play: async ({ canvas, userEvent }) => {
|
|
91
|
-
const selector = canvas.getByTestId('date-picker');
|
|
92
|
-
await userEvent.click(selector);
|
|
93
|
-
const time = canvas.getByText('12', {
|
|
94
|
-
selector: 'h3',
|
|
95
|
-
});
|
|
96
|
-
await userEvent.click(time);
|
|
97
|
-
},
|
|
98
|
-
};
|
|
@@ -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;
|