all files / addon/components/polaris-button-group/ item.js

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55                                                                                                         
import Component from '@ember/component';
import layout from '../../templates/components/polaris-button-group/item';
 
export default Component.extend({
  classNames: ['Polaris-ButtonGroup__Item'],
  classNameBindings: [
    'plain:Polaris-ButtonGroup__Item--plain',
    'focused:Polaris-ButtonGroup__Item--focused'
  ],
 
  layout,
 
  /**
   * Elements to display inside group item
   *
   * @property text
   * @public
   * @type {string}
   * @default null
   */
  text: null,
 
  /**
   * Use a plain style for the group item
   *
   * @property plain
   * @public
   * @type {boolean}
   * @default false
   */
  plain: false,
 
  /**
   * Whether the group item is focused
   *
   * @property focused
   * @private
   * @type {boolean}
   * @default false
   */
  focused: false,
 
  /**
   * Events.
   */
  focusIn() {
    this.set('focused', true);
  },
 
  focusOut() {
    this.set('focused', false);
  },
});