cerebral-module-ui-driver
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -26,4 +26,3 @@ 'use strict'; | ||
var field = formModule.meta.form && formModule.meta.form.fields && formModule.meta.form.fields[fieldName] || {}; | ||
var formattedValue = noFormatting ? formValue : format(formValue, driverModule.meta.options.formatters[field.type]); | ||
var value = useInputValue ? meta.value : formattedValue; | ||
var value = useInputValue ? meta.value : noFormatting ? formValue : format(formValue, driverModule.meta.options.formatters[field.type]); | ||
@@ -33,3 +32,3 @@ // if the field is not formatted then it should't be cast | ||
return Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, propsMap['value'], value), _defineProperty(_Object$assign, propsMap['isError'], !!meta.error), _defineProperty(_Object$assign, propsMap['isValidating'], !!meta.isValidating), _defineProperty(_Object$assign, propsMap['message'], !meta.error && useInputValue && formattedValue !== value ? formattedValue : meta.error), _defineProperty(_Object$assign, propsMap['onChange'], function (e) { | ||
return Object.assign((_Object$assign = {}, _defineProperty(_Object$assign, propsMap['value'], value), _defineProperty(_Object$assign, propsMap['isError'], !!meta.error), _defineProperty(_Object$assign, propsMap['isValidating'], !!meta.isValidating), _defineProperty(_Object$assign, propsMap['message'], meta.error), _defineProperty(_Object$assign, propsMap['onChange'], function (e) { | ||
driverModule.meta.signals.valueChanged({ | ||
@@ -58,9 +57,3 @@ moduleName: formModule.name, | ||
function format(value, formatter) { | ||
if (typeof formatter === 'function') { | ||
return formatter(value); | ||
} | ||
if (typeof value !== 'string') { | ||
return typeof value !== 'undefined' && value !== null ? '' : '' + value; | ||
} | ||
return value; | ||
return typeof formatter === 'function' ? formatter(value) : value === undefined || value === null ? '' : '' + value; | ||
} |
{ | ||
"name": "cerebral-module-ui-driver", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "A driver for connecting ui components to cerebral", | ||
@@ -5,0 +5,0 @@ "main": "lib/driver.js", |
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
39635
639