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

foam.CLASS({
  package: 'foam.layout',
  name: 'Section',

  requires: [
    'foam.core.Action',
    'foam.core.Property'
  ],

  properties: [
    {
      name: 'title'
    },
    {
      name: 'subTitle'
    },
    {
      class: 'String',
      name: 'help'
    },
    {
      class: 'FObjectArray',
      of: 'foam.core.Property',
      name: 'properties'
    },
    {
      class: 'FObjectArray',
      of: 'foam.core.Action',
      name: 'actions'
    },
    {
      name: 'gridColumns'
    },
    {
      class: 'Function',
      name: 'createIsAvailableFor',
      value: function(data$) {
        return foam.core.ConstantSlot.create({value: true});
      }
    },
    {
      class: 'String',<commit_msg>Added additional documentation to sections<commit_after>/**
 * @license
 * Copyright 2019 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.layout',
  name: 'Section',

  documentation: `
    Provides model data sectioned viewing when using the Section Views.
    Iterates over models sections and displays each section and it's associated properties.

    Example:
    foam.CLASS({
      name: 'myModel',
      sections: [
        {
          name: 'mainSection'
          title: function(myProp) {
            return myProp ? 'Set this title if myProp true' : 'Set this title if myProp false';
          }
          isAvailable: function(myProp) {
            return ! myProp;
          }
        }
      ],
      properties: [
        {
          class: 'Boolean',
          name: 'myProp',
          section: 'mainSection'
        }
      ]
    });

    Displaying this model in foam.u2.detail.SectionView will section properties and display
    the sections title and subtitles. Sections are capable of being available based on instance data
    and support dynamic titles and subtitles.

    In the example above the mainSection section and it's properties will not be displayed if myProp is false.
    Title will change based on the value of myProp.

  `,

  requires: [
    'foam.core.Action',
    'foam.core.Property'
  ],

  properties: [
    {
      // Accepts function and string
      name: 'title'
    },
    {
      // Accepts function and string
      name: 'subTitle'
    },
    {
      class: 'String',
      name: 'help'
    },
    {
      class: 'FObjectArray',
      of: 'foam.core.Property',
      name: 'properties'
    },
    {
      class: 'FObjectArray',
      of: 'foam.core.Action',
      name: 'actions'
    },
    {
      name: 'gridColumns'
    },
    {
      class: 'Function',
      name: 'createIsAvailableFor',
      value: function(data$) {
        return foam.core.ConstantSlot.create({value: true});
      }
    },
    {
      class: 'String',
{'fraction_non_alphanumeric': 0.12258953168044077, 'fraction_numerical': 0.004476584022038568, 'mean_word_length': 1.9979360165118678, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3798677', 'n_tokens_mistral': 895, 'n_tokens_neox': 873, 'n_words': 232}