all files / addon/components/ polaris-form-layout.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                                                                         
import Component from '@ember/component';
import layout from '../templates/components/polaris-form-layout';
 
/**
 * Polaris form layout component.
 * See https://polaris.shopify.com/components/forms/form-layout
 */
export default Component.extend({
 classNames: ['Polaris-FormLayout'],
 
 layout,
 
 /*
  * Public attributes.
  */
 /**
  * The content to display inside the layout
  *
  * @property text
  * @type {string}
  * @default null
  */
 text: null,
 
 /**
  * Lifecycle hooks.
  */
 didRender() {
   this._super(...arguments);
 
   // Wrap each child element that isn't already a group or an item.
   this.$().children()
     .not('div[role="group"]')
     .not('div.Polaris-FormLayout__Item')
     .wrap('<div class="Polaris-FormLayout__Item"></div>');
 },
});