Last active
September 26, 2017 16:17
-
-
Save manufitoussi/bc94703629c2600921b1e1a5820684a1 to your computer and use it in GitHub Desktop.
form field simple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
field1: { | |
label: 'mon texte', | |
value: 'Coucou!', | |
isDirty: true | |
}, | |
field2: { | |
label: 'mon number', | |
value: 22, | |
isDirty: false | |
}, | |
field3: { | |
label: 'ma date', | |
value: '2016-12-23', | |
isDirty: false | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['bellow'] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName:'label' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
step: 1 | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['side'] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNameBindings: [':form-field', 'isDirty:dirty:'], | |
isDirty: Ember.computed.reads('field.isDirty'), | |
label: Ember.computed.reads('field.label'), | |
fieldType: 'form-field-text', | |
fieldTypeComponent: Ember.computed('fieldType', { | |
get() { | |
return 'form-field-' + this.get('fieldType'); | |
} | |
}), | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.form-field { | |
position: relative; | |
border: 1px solid #eee; | |
padding: 4px; | |
margin: 4px; | |
} | |
.form-field.dirty { | |
background-color: lightBlue; | |
} | |
.form-field:after { | |
display: block; | |
clear: both; | |
content: ''; | |
} | |
label { | |
font-weight: bold; | |
float: left; | |
width: 19% | |
} | |
.bellow { | |
float: left; | |
width: 100%; | |
} | |
.form-field-content { | |
width: 80%; | |
float: right; | |
} | |
.side { | |
float: right; | |
width: 19%; | |
} | |
.form-field-content input { | |
width: 100%; | |
} | |
.form-field-content .inner.with-side > .form-field-value { | |
float: left; | |
width: 80%; | |
} | |
.form-field-content .inner:after { | |
display: block; | |
clear: both; | |
content: ''; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.3.0", | |
"ember-template-compiler": "2.3.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment