Comparing version 0.1.2 to 0.1.3
@@ -30,3 +30,7 @@ import Ember from 'ember'; | ||
model: oneWay('form.model'), | ||
wrapped: oneWay('form.wrapped'), | ||
model: oneWay('wrapped.model'), | ||
errorText: oneWay('errors.firstObject'), | ||
shouldShowValidationErrors: oneWay('wrapped.shouldShowValidationErrors'), | ||
modelName: computed({ | ||
@@ -37,4 +41,2 @@ get() { | ||
}).readOnly(), | ||
shouldShowValidationErrors: oneWay('form.shouldShowValidationErrors'), | ||
errorText: oneWay('errors.firstObject'), | ||
@@ -68,3 +70,3 @@ inputId: computed('model', 'field-name', { | ||
return model ? set(model, fieldName, newValue) : null; | ||
return model ? set(model, fieldName, newValue) : newValue; | ||
} | ||
@@ -128,9 +130,9 @@ }), | ||
const fieldName = get(this, 'attrs.field-name'); | ||
let errorKey = `form.errors.model.${fieldName}`; | ||
let errorKey = `wrapped.errors.model.${fieldName}`; | ||
if (modelName) { | ||
errorKey = `form.errors.${modelName}.${fieldName}`; | ||
errorKey = `wrapped.errors.${modelName}.${fieldName}`; | ||
} | ||
defineProperty(this, 'errors', computed(errorKey, `form.model.${fieldName}`, 'field-name', { | ||
defineProperty(this, 'errors', computed(errorKey, `wrapped.model.${fieldName}`, 'field-name', { | ||
get() { | ||
@@ -137,0 +139,0 @@ return get(this, errorKey); |
{ | ||
"name": "ya-input", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "The default blueprint for ember-cli addons.", | ||
@@ -42,3 +42,3 @@ "directories": { | ||
"dependencies": { | ||
"ya-form": "0.1.0", | ||
"ya-form": "0.1.1", | ||
"ember-cli-htmlbars": "0.7.9", | ||
@@ -45,0 +45,0 @@ "ember-cli-babel": "^5.1.3" |
@@ -6,3 +6,3 @@ # Ya-input | ||
```hbs | ||
{{#ya-form model as |form|}} | ||
{{#ya-form this as |form|}} | ||
<h2>Test Form</h2> | ||
@@ -15,8 +15,13 @@ | ||
{{! viewName property allows you to link inputs to labels via the assigned id }} | ||
<label for={{nameField.elementId}}>Name</label> | ||
<label for={{yaInput.inputId}}>Name</label> | ||
{{! Bind your input's value to the value property on yaInput }} | ||
{{! You can bind the valid class to your input as well }} | ||
{{input value=yaInput.value classBinding=":blah yaInput.validClass"}} | ||
{{input | ||
id=yaInput.inputId | ||
name=yaInput.name | ||
type=yaInput.type | ||
value=yaInput.value | ||
classBinding=":blah yaInput.validClass" | ||
}} | ||
@@ -30,3 +35,2 @@ {{! yaInput has a property that tells you whether or not to show errors for that field }} | ||
{{/ya-input}} | ||
{{/ya-form}} | ||
@@ -33,0 +37,0 @@ ``` |
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
9481
184
57
+ Addedya-form@0.1.1(transitive)
- Removedya-form@0.1.0(transitive)
Updatedya-form@0.1.1