<commit_before>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.u2.layout',
  name: 'Grid',
  extends: 'foam.u2.Element',
  documentation: `
    A grid of responsive elements
  `,

  imports: [
    'displayWidth?'
  ],

  requires: [
    'foam.u2.layout.GUnit'
  ],

  css: `
    ^ {
      display: grid;
      grid-column-gap: 16px;
      grid-row-gap: 32px;
    }
  `,

  listeners: [
    {
      name: 'resizeChildren',
      isFramed: true,
      code: function() {
        this.shown = false;
        var currentWidth = 0;
        this.childNodes.forEach(ret => {
          var width = this.GUnit.isInstance(ret) && ret.columns &&
            ret.columns[`${this.displayWidth.name.toLowerCase()}Columns`] ||
            this.displayWidth.cols;

          var startCol = currentWidth + 1;
          currentWidth += width;

          if ( currentWidth > this.displayWidth.cols ) {<commit_msg>Remove the default gaps on Grid. Let anything rendering it deal with that.<commit_after>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.u2.layout',
  name: 'Grid',
  extends: 'foam.u2.Element',
  documentation: `
    A grid of responsive elements
  `,

  imports: [
    'displayWidth?'
  ],

  requires: [
    'foam.u2.layout.GUnit'
  ],

  css: `
    ^ {
      display: grid;
    }
  `,

  listeners: [
    {
      name: 'resizeChildren',
      isFramed: true,
      code: function() {
        this.shown = false;
        var currentWidth = 0;
        this.childNodes.forEach(ret => {
          var width = this.GUnit.isInstance(ret) && ret.columns &&
            ret.columns[`${this.displayWidth.name.toLowerCase()}Columns`] ||
            this.displayWidth.cols;

          var startCol = currentWidth + 1;
          currentWidth += width;

          if ( currentWidth > this.displayWidth.cols ) {
{'fraction_non_alphanumeric': 0.13958125623130607, 'fraction_numerical': 0.01296111665004985, 'mean_word_length': 2.200956937799043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4523412', 'n_tokens_mistral': 672, 'n_tokens_neox': 647, 'n_words': 134}