ldx-widgets
Advanced tools
Comparing version 1.1.15 to 1.1.16
@@ -114,5 +114,6 @@ (function() { | ||
render: function() { | ||
var className, disabled, id, index, input, inputClass, isValid, item, loading, onBlur, onFocus, onKeyDown, onKeyPress, optionEls, options, outerClass, ref2, tabIndex, validation, value, wrapperClass, wrapperLabel; | ||
var className, disabled, errors, id, index, input, inputClass, isValid, item, loading, onBlur, onFocus, onKeyDown, onKeyPress, optionEls, options, outerClass, ref2, tabIndex, validation, value, wrapperClass, wrapperLabel; | ||
ref2 = this.props, value = ref2.value, options = ref2.options, tabIndex = ref2.tabIndex, className = ref2.className, loading = ref2.loading, onKeyDown = ref2.onKeyDown, onKeyPress = ref2.onKeyPress, onBlur = ref2.onBlur, onFocus = ref2.onFocus, wrapperClass = ref2.wrapperClass, wrapperLabel = ref2.wrapperLabel, id = ref2.id, disabled = ref2.disabled, validation = ref2.validation; | ||
isValid = this.isValid(value); | ||
errors = this.getStore('validation').errors; | ||
isValid = errors[this.inputId] == null; | ||
outerClass = 'field-wrap'; | ||
@@ -119,0 +120,0 @@ if (wrapperClass != null) { |
@@ -138,5 +138,6 @@ (function() { | ||
render: function() { | ||
var autoComplete, className, disabled, errorButtonClass, focusOnMount, id, input, inputClass, isValid, loading, maxLength, onBlur, onFocus, onKeyDown, onKeyPress, outerClass, placeholder, ref1, showClear, spellCheck, style, tabIndex, type, validation, value, wrapperClass, wrapperLabel; | ||
var autoComplete, className, disabled, errorButtonClass, errors, focusOnMount, id, input, inputClass, isValid, loading, maxLength, onBlur, onFocus, onKeyDown, onKeyPress, outerClass, placeholder, ref1, showClear, spellCheck, style, tabIndex, type, validation, value, wrapperClass, wrapperLabel; | ||
ref1 = this.props, value = ref1.value, placeholder = ref1.placeholder, tabIndex = ref1.tabIndex, className = ref1.className, maxLength = ref1.maxLength, loading = ref1.loading, type = ref1.type, showClear = ref1.showClear, onKeyDown = ref1.onKeyDown, onKeyPress = ref1.onKeyPress, onBlur = ref1.onBlur, onFocus = ref1.onFocus, wrapperClass = ref1.wrapperClass, wrapperLabel = ref1.wrapperLabel, id = ref1.id, disabled = ref1.disabled, validation = ref1.validation, autoComplete = ref1.autoComplete, spellCheck = ref1.spellCheck, style = ref1.style, focusOnMount = ref1.focusOnMount; | ||
isValid = this.isValid(value); | ||
errors = this.getStore('validation').errors; | ||
isValid = errors[this.inputId] == null; | ||
outerClass = 'field-wrap'; | ||
@@ -143,0 +144,0 @@ if (wrapperClass != null) { |
(function() { | ||
var Flux, Global, _, actionModule, dispatcher, i, len, processActions, ref; | ||
var Flux, Global, Validation, _, actionModule, dispatcher, i, len, processActions, ref; | ||
@@ -10,2 +10,4 @@ Flux = require('delorean').Flux; | ||
Validation = require('./flux/validation_store'); | ||
dispatcher = { | ||
@@ -15,3 +17,4 @@ viewTriggers: {}, | ||
return { | ||
global: Global | ||
global: Global, | ||
validation: Validation | ||
}; | ||
@@ -51,3 +54,3 @@ } | ||
ref = []; | ||
ref = [require('./flux/validation_actions')]; | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
@@ -54,0 +57,0 @@ actionModule = ref[i]; |
@@ -25,9 +25,8 @@ (function() { | ||
if (focusOnMount) { | ||
this.focus(); | ||
return this.focus(); | ||
} | ||
return this.validate(value); | ||
}, | ||
componentWillReceiveProps: function(nextProps) { | ||
if (nextProps.value !== this.props.value) { | ||
return this.validate(nextProps.value); | ||
componentDidUpdate: function(prevProps) { | ||
if (prevProps.value !== this.props.value) { | ||
return this.validate(this.props.value); | ||
} | ||
@@ -48,3 +47,2 @@ }, | ||
} | ||
this.validate(value); | ||
return this.fireDelayedAction(); | ||
@@ -86,14 +84,2 @@ }, | ||
}, | ||
isValid: function(value) { | ||
var validation; | ||
validation = this.props.validation; | ||
if (validation === false) { | ||
return true; | ||
} | ||
if (typeof validation === 'function') { | ||
return validation(value) === null; | ||
} else { | ||
return validation === null; | ||
} | ||
}, | ||
handleKeyUp: function(e) { | ||
@@ -100,0 +86,0 @@ var onEnterKey, onKeyUp, ref; |
@@ -12,3 +12,2 @@ React = require('react'); | ||
DeleteButton: require('./dist/components/delete_button'), | ||
Dialogue: require('./dist/components/dialogue'), | ||
Draggable: require('./dist/components/draggable'), | ||
@@ -41,3 +40,2 @@ FormAlertItem: require('./dist/components/form_alert_item'), | ||
animationMixin: require('./dist/mixins/animation_mixin'), | ||
dialogueMixin: require('./dist/mixins/dialogue_mixin'), | ||
filterTextMixin: require('./dist/mixins/filter_text'), | ||
@@ -44,0 +42,0 @@ formValidationMixin: require('./dist/mixins/form_validation'), |
{ | ||
"name": "ldx-widgets", | ||
"version": "1.1.15", | ||
"version": "1.1.16", | ||
"description": "widgets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
381608
126
5224