addon/components/ui-radio-group.js

  1. import Component from '@ember/component';
  2. import UiCheckboxGroupBase from '../mixins/ui-checkbox-group-base';
  3. import layout from '../templates/components/ui-radio-group';
  4.  
  5.  
  6. /**
  7.  
  8. ui-radio-group component see {{#crossLink "mixins.UiCheckboxGroupBase"}}{{/crossLink}}
  9.  
  10. @module components
  11. @class UiRadioGroup
  12. @namespace components
  13. @constructor
  14. */
  15. export default Component.extend(UiCheckboxGroupBase, {
  16. layout: layout,
  17. isOptionChecked(optionValue){
  18. return String(this.value) === optionValue;
  19. },
  20. actions: {
  21. childChange(checked, value){
  22. if(checked){
  23. this.set('value', value);
  24. }
  25. }
  26. }
  27. });