all files / addon/components/polaris-form-layout/ group.js

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
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                                                                                             
import Component from '@ember/component';
import layout from '../../templates/components/polaris-form-layout/group';
 
export default Component.extend({
  classNameBindings: ['condensed:Polaris-FormLayout--condensed'],
  attributeBindings: ['role'],
 
  layout,
 
  /*
   * Public attributes.
   */
  /**
   * Elements to display inside group item
   *
   * @property text
   * @type {string}
   * @default null
   */
  text: null,
 
  /**
   * Condensed field group
   *
   * @property condensed
   * @type {boolean}
   * @default false
   */
  condensed: false,
 
  /*
   * Internal properties.
   */
   role: 'group',
 
   /**
    * Lifecycle hooks.
    */
   didRender() {
     this._super(...arguments);
 
     // Wrap each element that isn't already an item.
     this.$('div.Polaris-FormLayout__Items').children()
       .not('div.Polaris-FormLayout__Item')
       .wrap('<div class="Polaris-FormLayout__Item"></div>');
   },
});