@arquimedes.co/eureka-forms 3.0.4-refactor → 3.0.5-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,6 +10,7 @@ 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);
|
|
13
14
|
const form = useContext(FormContext);
|
|
14
15
|
const { ref, value, onChange, error, field } = useFormStep(step, {
|
|
15
16
|
defaultValue: defaultValue ?? '',
|
|
@@ -28,6 +29,6 @@ function PhoneInputStep({ step, editable, defaultValue = step.defaultValue }) {
|
|
|
28
29
|
return (_jsx("div", { className: styles.container, style: {
|
|
29
30
|
width: currentBreakPoint <= step.size ? '100%' : calcStepWidth(step.size, form.size),
|
|
30
31
|
minHeight: step.description || (!postview && editable) ? '55px' : '43px',
|
|
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 }) }));
|
|
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 }) }));
|
|
32
33
|
}
|
|
33
34
|
export default PhoneInputStep;
|
|
@@ -6,7 +6,7 @@ interface ErkPhoneInputProps {
|
|
|
6
6
|
onChange: (value: string) => void;
|
|
7
7
|
inputRef?: any;
|
|
8
8
|
readOnly?: boolean;
|
|
9
|
-
defaultCountry
|
|
9
|
+
defaultCountry: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
|
package/dist/index.lib.d.ts
CHANGED
|
@@ -5,3 +5,10 @@ export type { StepProps, EurekaFormProps };
|
|
|
5
5
|
export { EurekaForm, StepFunctions };
|
|
6
6
|
export default EurekaForm;
|
|
7
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
|
@@ -3,3 +3,10 @@ import * as StepFunctions from './FormSteps/StepFunctions';
|
|
|
3
3
|
export { EurekaForm, StepFunctions };
|
|
4
4
|
export default EurekaForm;
|
|
5
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