@bigbinary/neeto-form-frontend 1.0.5 → 1.0.6
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/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { Up, Down, MenuHorizontal, Delete, Plus, Email as Email$1, Phone as Phon
|
|
|
21
21
|
import { Editor as Editor$1, EditorContent } from '@bigbinary/neeto-editor';
|
|
22
22
|
import * as yup from 'yup';
|
|
23
23
|
import { object, array, string } from 'yup';
|
|
24
|
-
import { isPresent } from '@bigbinary/neeto-commons-frontend/pure';
|
|
24
|
+
import { isPresent, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
|
|
25
25
|
import dayjs$1 from 'dayjs';
|
|
26
26
|
import require$$4$1 from 'dayjs/plugin/localeData';
|
|
27
27
|
import utc from 'dayjs/plugin/utc';
|
|
@@ -42896,7 +42896,7 @@ const generateFormResponse = (response, questions) => {
|
|
|
42896
42896
|
} else if (kind === QUESTION_KIND.PHONE.value) {
|
|
42897
42897
|
formResponse.push({
|
|
42898
42898
|
question_id: id,
|
|
42899
|
-
value: parsePhoneNumberFromString(responseValue).formatInternational(),
|
|
42899
|
+
value: responseValue ? parsePhoneNumberFromString(responseValue).formatInternational() : "",
|
|
42900
42900
|
kind
|
|
42901
42901
|
});
|
|
42902
42902
|
} else formResponse.push({
|
|
@@ -42917,7 +42917,7 @@ const getSelectMinError = function (min) {
|
|
|
42917
42917
|
};
|
|
42918
42918
|
const getInvalidTypeError = (label, type) => `${label} should be a valid ${type}.`;
|
|
42919
42919
|
|
|
42920
|
-
const validatePhoneNumber = value => parsePhoneNumberFromString(value)?.isValid();
|
|
42920
|
+
const validatePhoneNumber = value => isNotEmpty(value) ? parsePhoneNumberFromString(value)?.isValid() : true;
|
|
42921
42921
|
const validateTextField = _ref => {
|
|
42922
42922
|
let kind = _ref.kind,
|
|
42923
42923
|
label = _ref.label,
|