@arquimedes.co/eureka-forms 3.0.5-refactor → 3.0.6-refactor

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,6 @@ import { isEmptyPhoneNumber, isValidPhoneNumber } from '../../../Utils/PhoneFunc
10
10
  function PhoneInputStep({ step, editable, defaultValue = step.defaultValue }) {
11
11
  const currentBreakPoint = useAppSelector(selectBreakPoint);
12
12
  const postview = useAppSelector((state) => state.global.postview);
13
- const defaultCountry = useAppSelector((state) => state.global.countryCode);
14
13
  const form = useContext(FormContext);
15
14
  const { ref, value, onChange, error, field } = useFormStep(step, {
16
15
  defaultValue: defaultValue ?? '',
@@ -29,6 +28,6 @@ function PhoneInputStep({ step, editable, defaultValue = step.defaultValue }) {
29
28
  return (_jsx("div", { className: styles.container, style: {
30
29
  width: currentBreakPoint <= step.size ? '100%' : calcStepWidth(step.size, form.size),
31
30
  minHeight: step.description || (!postview && editable) ? '55px' : '43px',
32
- }, children: _jsx(ErkPhoneInput, { ...field, value: value, inputRef: ref, error: !!error, label: step.label, onChange: onChange, "data-testid": step.id, required: step.required, defaultCountry: defaultCountry, readOnly: !editable || postview, helperText: error?.message ?? step.description }) }));
31
+ }, children: _jsx(ErkPhoneInput, { ...field, value: value, inputRef: ref, error: !!error, label: step.label, onChange: onChange, "data-testid": step.id, required: step.required, readOnly: !editable || postview, helperText: error?.message ?? step.description }) }));
33
32
  }
34
33
  export default PhoneInputStep;
@@ -77,6 +77,10 @@ const StyledDialog = styled(MuiDialog)(({ theme }) => ({
77
77
  borderRadius: '5px',
78
78
  backgroundColor: 'transparent',
79
79
  },
80
+ '& .Erk-MuiPickersLayout-root': {
81
+ display: 'flex',
82
+ flexDirection: 'column',
83
+ },
80
84
  '& .Erk-MuiDialogActions-root': {
81
85
  '& .Erk-MuiButtonBase-root': { fontWeight: 700 },
82
86
  },
@@ -98,7 +102,7 @@ const StyledDay = styled(MuiPickerDay)(({ theme }) => ({
98
102
  }));
99
103
  function CustomDatePicker({ error, required, disabled, readOnly, helperText, size = 'small', pickTime = false, ...others }) {
100
104
  if (pickTime) {
101
- return (_jsx(StyledDateTimePicker, { ampm: true, ...others, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, slotProps: {
105
+ return (_jsx(StyledDateTimePicker, { ampm: true, reduceAnimations: true, ...others, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, slotProps: {
102
106
  actionBar: {
103
107
  actions: ['clear', 'accept'],
104
108
  },
@@ -159,7 +163,7 @@ function CustomDatePicker({ error, required, disabled, readOnly, helperText, siz
159
163
  } }));
160
164
  }
161
165
  else {
162
- return (_jsx(StyledDatePicker, { ...others, readOnly: readOnly, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
166
+ return (_jsx(StyledDatePicker, { ...others, reduceAnimations: true, readOnly: readOnly, disabled: disabled ?? readOnly, defaultValue: required ? new Date() : undefined, showDaysOutsideCurrentMonth: true, views: ['year', 'month', 'day'], slotProps: {
163
167
  actionBar: {
164
168
  actions: ['clear', 'accept'],
165
169
  },
@@ -6,7 +6,6 @@ interface ErkPhoneInputProps {
6
6
  onChange: (value: string) => void;
7
7
  inputRef?: any;
8
8
  readOnly?: boolean;
9
- defaultCountry: string;
10
9
  }
11
10
  /**
12
11
  * Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
@@ -7,6 +7,7 @@ import es from 'i18n-iso-countries/langs/es.json';
7
7
  import { InputAdornment, Select, styled } from '@mui/material';
8
8
  import { MenuItem } from '@mui/material';
9
9
  import { StyledTextField } from '../ErkTextField/ErkTextField';
10
+ import { useAppSelector } from '../../hooks';
10
11
  isoCountries.registerLocale(es);
11
12
  const StyledSelect = styled(Select)(({ theme }) => ({
12
13
  padding: 0,
@@ -29,7 +30,8 @@ const StyledSelect = styled(Select)(({ theme }) => ({
29
30
  borderBottom: 'none',
30
31
  },
31
32
  }));
32
- function CustomPhoneInput({ value, onChange, inputRef, readOnly = false, disabled = false, defaultCountry, ...others }) {
33
+ function CustomPhoneInput({ value, onChange, inputRef, readOnly = false, disabled = false, ...others }) {
34
+ const defaultCountry = useAppSelector((state) => state.global.countryCode);
33
35
  const { inputValue, handlePhoneValueChange, inputRef: phoneRef, country, setCountry, } = usePhoneInput({
34
36
  value: '+' + value,
35
37
  inputRef,
@@ -4,11 +4,3 @@ import * as StepFunctions from './FormSteps/StepFunctions';
4
4
  export type { StepProps, EurekaFormProps };
5
5
  export { EurekaForm, StepFunctions };
6
6
  export default EurekaForm;
7
- export { default as ReactFromModule } from 'react';
8
- import ErkDatePicker from './Shared/ErkDatePicker/ErkDatePicker';
9
- import ErkPhoneInput from './Shared/ErkPhoneInput/EkrPhoneInput';
10
- import ErkTextField from './Shared/ErkTextField/ErkTextField';
11
- import ErkCheckBox from './Shared/ErkCheckbox/ErkCheckBox';
12
- import ErkSelect from './Shared/ErkSelect/ErkSelect';
13
- import ErkTimePicker from './Shared/ErkTimePicker/ErkTimePicker';
14
- export { ErkDatePicker, ErkPhoneInput, ErkTextField, ErkCheckBox, ErkSelect, ErkTimePicker };
package/dist/index.lib.js CHANGED
@@ -2,11 +2,3 @@ import EurekaForm from './App/App';
2
2
  import * as StepFunctions from './FormSteps/StepFunctions';
3
3
  export { EurekaForm, StepFunctions };
4
4
  export default EurekaForm;
5
- export { default as ReactFromModule } from 'react';
6
- import ErkDatePicker from './Shared/ErkDatePicker/ErkDatePicker';
7
- import ErkPhoneInput from './Shared/ErkPhoneInput/EkrPhoneInput';
8
- import ErkTextField from './Shared/ErkTextField/ErkTextField';
9
- import ErkCheckBox from './Shared/ErkCheckbox/ErkCheckBox';
10
- import ErkSelect from './Shared/ErkSelect/ErkSelect';
11
- import ErkTimePicker from './Shared/ErkTimePicker/ErkTimePicker';
12
- export { ErkDatePicker, ErkPhoneInput, ErkTextField, ErkCheckBox, ErkSelect, ErkTimePicker };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version":"3.0.5-refactor",
4
+ "version":"3.0.6-refactor",
5
5
  "scripts": {
6
6
  "watch": "tsc --noEmit --watch --project tsconfig.app.json",
7
7
  "start": "vite",