Forked from alias-mac/components.checkbox-component.js
Created
April 23, 2019 16:47
-
-
Save rwjblue/b54b452dd12ea98a7f0952d2ab9014bb to your computer and use it in GitHub Desktop.
Revisions
-
rwjblue revised this gist
Apr 23, 2019 . 2 changed files with 9 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import Ember from 'ember'; export function eq(params/*, hash*/) { return params; } export default Ember.Helper.helper(eq); 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ <select onchange={{action onChange}}> {{#each options as |opt|}} <option value={{opt.key}} selected={{eq opt.key value}}>{{opt.label}}</option> {{/each}} </select> -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ <select value={{value}} onchange={{action onChange}}> {{#each options as |opt|}} <option value={{opt.key}}>{{opt.label}}</option> {{/each}} </select> Value: {{value}} -
alias-mac revised this gist
Apr 16, 2019 . No changes.There are no files selected for viewing
-
alias-mac revised this gist
Apr 16, 2019 . No changes.There are no files selected for viewing
-
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ <input type="checkbox" name="state" id={{label}} checked={{checked}} onchange={{action changeState}} /> <label for="active">{{checked}}</label>
-
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ checked={{checked}} onchange={{action changeState}} /> <label for="active">Label for {{checked}}</label>
-
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ <h1>Welcome to {{appName}}</h1> <br> <h3>Checkbox value should be in sync</h3> {{#each data key="checked" as |state|}} {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} <h3>Select value should be in sync</h3> {{select-component value=selected options=options onChange=(action "changeSelectValue")}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,6 @@ {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} <h2>Select doesn't keep value</h2> {{select-component value=selected options=options onChange=(action "changeSelectValue")}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Value: {{value}} <select value={{value}} onchange={{action onChange}}> {{#each options as |opt|}} <option value={{opt.key}}>{{opt.label}}</option> {{/each}} </select> -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,5 @@ {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} {{selected}} {{select-component value=selected options=options onChange=(action "changeSelectValue")}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Value: {{value}} <select value={{value}} onchange={{action onChange}}> {{#each options as |opt|}} <option key={{opt.key}}>{{opt.label}}</option> -
alias-mac revised this gist
Apr 16, 2019 . No changes.There are no files selected for viewing
-
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ {{value}} <select value={{value}} onchange={{action onChange}}> {{#each options as |opt|}} <option key={{opt.key}}>{{opt.label}}</option> -
alias-mac revised this gist
Apr 16, 2019 . No changes.There are no files selected for viewing
-
alias-mac revised this gist
Apr 16, 2019 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export default Ember.Controller.extend({ this.set('data', newData); }, changeSelectValue() { this.set('selected', 'option3'); } 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 charactersOriginal file line number Diff line number Diff line change @@ -6,4 +6,4 @@ {{/each}} {{select-component value=selected options=options onChange=(action "changeSelectValue")}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ <select value={{value}} onchange={{action onChange}}> {{#each options as |opt|}} <option key={{opt.key}}>{{opt.label}}</option> {{/each}} </select> -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -39,6 +39,11 @@ export default Ember.Controller.extend({ }); this.set('data', newData); }, changeCheckbox() { this.set('selected', 'option3'); } } }); -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,10 @@ export default Ember.Controller.extend({ label: 'Option 2', key: 'option2', }, { label: 'Option 3', key: 'option3', }, ], actions: { -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ <select value={{value}}> {{#each options as |opt|}} <option key={{opt.key}}>{{opt.label}}</option> {{/each}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,8 +25,6 @@ export default Ember.Controller.extend({ }, ], actions: { changeState() { const newData = this.get('data').map((d) => { -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ <select> {{#each options as |opt|}} <option key={{opt.key}}>{{opt.label}}</option> {{/each}} </select> -
alias-mac revised this gist
Apr 16, 2019 . 3 changed files with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,8 @@ export default Ember.Controller.extend({ }, ], selected: 'option1', actions: { changeState() { const newData = this.get('data').map((d) => { 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 charactersOriginal file line number Diff line number Diff line change @@ -6,3 +6,4 @@ {{/each}} {{select-component value=selected options=options}} 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ <select> {{#each options as |option|}} <option key={{option.key}}>{{option.label}}</option> {{/each}} -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,4 @@ {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} -
alias-mac revised this gist
Apr 16, 2019 . 3 changed files with 17 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,17 @@ export default Ember.Controller.extend({ } ], options: [ { label: 'Option 1', key: 'option1', }, { label: 'Option 2', key: 'option2', }, ], actions: { changeState() { const newData = this.get('data').map((d) => { 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 charactersOriginal file line number Diff line number Diff line change @@ -5,5 +5,4 @@ {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} {{select-component value=selected options=options}} 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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,5 @@ <select value={{value}}> {{#each options as |option|}} <option key={{option.key}}>{{option.label}}</option> {{/each}} </select> -
alias-mac revised this gist
Apr 16, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,3 +4,6 @@ {{#each data key="checked" as |state|}} {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} {{select-component value=selected options=options}} -
alias-mac revised this gist
Apr 16, 2019 . No changes.There are no files selected for viewing
-
alias-mac revised this gist
Apr 16, 2019 . 2 changed files with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ {{yield}} -
godserahul1986 created this gist
Apr 8, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ import Ember from 'ember'; export default Ember.Controller.extend({ appName: 'Ember Twiddle', data: [ { checked: true, label: 'active' }, { checked: false, label: 'archived' } ], actions: { changeState() { const newData = this.get('data').map((d) => { return { ...d, checked: true } }); this.set('data', newData); } } }); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{#each data key="checked" as |state|}} {{checkbox-component label=state.label checked=state.checked changeState=(action "changeState")}} {{/each}} 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ {{checked}} <input type="checkbox" name="state" id={{label}} checked={{checked}} onchange={{action changeState}} /> <label for="active">Active</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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ { "version": "0.15.1", "EmberENV": { "FEATURES": {} }, "options": { "use_pods": false, "enable-testing": false }, "dependencies": { "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", "ember": "3.4.3", "ember-template-compiler": "3.4.3", "ember-testing": "3.4.3" }, "addons": { "ember-data": "3.4.2" } }