global-input-react
Advanced tools
Comparing version 3.1.18 to 3.1.19
@@ -61,3 +61,4 @@ "use strict"; | ||
fields, | ||
values | ||
values, | ||
setters | ||
} = action; | ||
@@ -76,3 +77,4 @@ | ||
fields, | ||
values | ||
values, | ||
setters | ||
}; | ||
@@ -99,3 +101,4 @@ } else { | ||
fields, | ||
values | ||
values, | ||
setters | ||
}; | ||
@@ -227,3 +230,7 @@ }; | ||
fields[index].value = value; | ||
mobile.sendInputMessage(value, index); | ||
if (mobile) { | ||
mobile.sendInputMessage(value, index); | ||
} | ||
return { ...state | ||
@@ -345,3 +352,4 @@ }; | ||
fields, | ||
values | ||
values, | ||
setters | ||
} = buildFieldsAndValuesFromInitData({ | ||
@@ -356,3 +364,4 @@ dispatch, | ||
fields, | ||
values | ||
values, | ||
setters | ||
}); | ||
@@ -367,27 +376,2 @@ }; | ||
}, []); | ||
(0, _react.useEffect)(() => { | ||
const setters = []; | ||
if (fields && fields.length) { | ||
fields.forEach((f, index) => { | ||
const s = value => { | ||
if (mobile) { | ||
dispatch({ | ||
type: ACTION_TYPES.SEND_INPUT_STREAM, | ||
value, | ||
index | ||
}); | ||
} | ||
}; | ||
setters.push(s); | ||
}); | ||
} | ||
; | ||
dispatch({ | ||
type: ACTION_TYPES.SET_SETTERS, | ||
setters | ||
}); | ||
}, [mobile, fields]); | ||
const connectionMessage = (0, _react.useMemo)(() => { | ||
@@ -530,2 +514,3 @@ let qrCodeSize = window.innerWidth - 10; | ||
let values = []; | ||
let setters = []; | ||
@@ -535,3 +520,4 @@ if (!initData || !initData.form || !initData.form.fields || !initData.form.fields.length) { | ||
fields, | ||
values | ||
values, | ||
setters | ||
}; | ||
@@ -542,4 +528,6 @@ } | ||
initData.form.fields.forEach((f, index) => { | ||
const field = { ...f, | ||
operations: null | ||
const field = { | ||
id: f.id, | ||
label: f.label, | ||
value: f.value | ||
}; | ||
@@ -549,2 +537,12 @@ fields.push(field); | ||
const s = value => { | ||
dispatch({ | ||
type: ACTION_TYPES.SEND_INPUT_STREAM, | ||
value, | ||
index | ||
}); | ||
}; | ||
setters.push(s); | ||
if (f.operations && f.operations.onInput) { | ||
@@ -572,3 +570,4 @@ return; | ||
fields, | ||
values | ||
values, | ||
setters | ||
}; | ||
@@ -575,0 +574,0 @@ }; |
{ | ||
"name": "global-input-react", | ||
"version": "3.1.18", | ||
"version": "3.1.19", | ||
"description": "global input react component", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93405
2223