@oneblink/sdk-core
Advanced tools
Comparing version 0.2.3 to 0.2.4-beta.2
@@ -14,3 +14,4 @@ "use strict"; | ||
return predicate.optionIds.some((optionId) => { | ||
const option = predicateElement.options.find((o) => o.id === optionId); | ||
var _a; | ||
const option = (_a = predicateElement.options) === null || _a === void 0 ? void 0 : _a.find((o) => o.id === optionId); | ||
if (option) { | ||
@@ -17,0 +18,0 @@ const value = submission[predicateElement.name]; |
@@ -49,2 +49,3 @@ "use strict"; | ||
function getElementSubmissionValue({ propertyName, submission, form, formatDate, formatTime, formatNumber, formatCurrency, }) { | ||
var _a, _b; | ||
const formElement = (0, formElementsService_1.findFormElement)(form.elements, (element) => element.type !== 'page' && | ||
@@ -69,8 +70,9 @@ element.type !== 'section' && | ||
case 'autocomplete': { | ||
const option = formElement.options.find((opt) => opt.value === value); | ||
return (option === null || option === void 0 ? void 0 : option.label) || ''; | ||
const option = (_a = formElement.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === value); | ||
return (option === null || option === void 0 ? void 0 : option.label) || value; | ||
} | ||
case 'checkboxes': { | ||
const selectedOptionLabels = value.reduce((labels, selectedOption) => { | ||
const foundOption = formElement.options.find((o) => o.value === selectedOption); | ||
var _a; | ||
const foundOption = (_a = formElement.options) === null || _a === void 0 ? void 0 : _a.find((o) => o.value === selectedOption); | ||
if (foundOption) | ||
@@ -92,3 +94,4 @@ labels.push(foundOption.label); | ||
const selectedOptionLabels = value.reduce((labels, selectedOption) => { | ||
const foundOption = formElement.options.find((o) => o.value === selectedOption); | ||
var _a; | ||
const foundOption = (_a = formElement.options) === null || _a === void 0 ? void 0 : _a.find((o) => o.value === selectedOption); | ||
if (foundOption) | ||
@@ -101,3 +104,3 @@ labels.push(foundOption.label); | ||
else { | ||
const option = formElement.options.find((opt) => opt.value === value); | ||
const option = (_b = formElement.options) === null || _b === void 0 ? void 0 : _b.find((opt) => opt.value === value); | ||
return (option === null || option === void 0 ? void 0 : option.label) || ''; | ||
@@ -104,0 +107,0 @@ } |
{ | ||
"name": "@oneblink/sdk-core", | ||
"description": "OneBlink SDK for JavaScript (works in Browsers and NodeJS)", | ||
"version": "0.2.3", | ||
"version": "0.2.4-beta.2", | ||
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)", | ||
@@ -9,3 +9,2 @@ "bugs": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -32,3 +31,3 @@ "@oneblink/release-cli": "^1.0.0", | ||
"node": ">=12", | ||
"npm": ">=6" | ||
"npm": ">=8" | ||
}, | ||
@@ -60,4 +59,5 @@ "files": [ | ||
"test": "jest", | ||
"types": "npm install --save-dev github:oneblink/types", | ||
"typescript": "tsc --noEmit" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
721
104717
21