<commit_before>###
Copyright (c) 2013, <NAME> <<EMAIL>>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###

_ = require "lodash"
assert = require "assert"

{Archetype} = require "../nucleus/arche"
{remote, cc} = require "../membrane/remote"
{Formular} = require "./formular"

# This is a formular implementation that provides standard controls
# shipped within the Semantic UI framework. It contains most of the
# shipped controls (field and inputs) cobered in the Semantic manual.
# Plese refer to the implementation for the usage information. Also,
# see the methods to get the idea of what is available and what not.
module.exports.BoxFormular = cc -> class BoxFormular extends Formular

    # Group the two previously created fields (passed by either as
    # direct object or the selectors) into a one horizontal field
    # that is going to equally share the space between two fields.
    # This method is going to internally insert the grouper right
    # before the first field and them move both fields to grouper.
    groupTwoFields: (fieldOne, fieldTwo) ->
        selectorOne = fieldOne and _.isString fieldOne
        selectorTwo = fieldTwo and _.isString fieldTwo
        fieldOne = ".field.#{fieldOne}" if selectorOne
        fieldTwo = ".field.#{fieldTwo}" if selectorTwo
        fieldOne = @element.find fieldOne if selectorOne
        fieldTwo = @element.find fieldTwo if selectorTwo
        assert fieldOne.length > 0, "invalid object A given"
        assert fieldTwo.length > 0, "invalid object B given"
        assert union = try $ "<div>", class: "two fields"
        union.insertBefore fieldOne # place before A field
        fieldOne.appendTo union; fieldTwo.appendTo union

    # Create a field that is typically would be used to enter the
    # password or similar information that should not be displayed<commit_msg>add up a little doc<commit_after>###
Copyright (c) 2013, <NAME> <<EMAIL>>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
###

_ = require "lodash"
assert = require "assert"

{Archetype} = require "../nucleus/arche"
{remote, cc} = require "../membrane/remote"
{Formular} = require "./formular"

# This is a formular implementation that provides standard controls
# shipped within the Semantic UI framework. It contains most of the
# shipped controls (field and inputs) cobered in the Semantic manual.
# Plese refer to the implementation for the usage information. Also,
# see the methods to get the idea of what is available and what not.
# Reference the `Formular` abstraction for the internal information.
module.exports.BoxFormular = cc -> class BoxFormular extends Formular

    # Group the two previously created fields (passed by either as
    # direct object or the selectors) into a one horizontal field
    # that is going to equally share the space between two fields.
    # This method is going to internally insert the grouper right
    # before the first field and them move both fields to grouper.
    groupTwoFields: (fieldOne, fieldTwo) ->
        selectorOne = fieldOne and _.isString fieldOne
        selectorTwo = fieldTwo and _.isString fieldTwo
        fieldOne = ".field.#{fieldOne}" if selectorOne
        fieldTwo = ".field.#{fieldTwo}" if selectorTwo
        fieldOne = @element.find fieldOne if selectorOne
        fieldTwo = @element.find fieldTwo if selectorTwo
        assert fieldOne.length > 0, "invalid object A given"
        assert fieldTwo.length > 0, "invalid object B given"
        assert union = try $ "<div>", class: "two fields"
        union.insertBefore fieldOne # place before A field
        fieldOne.appendTo union; fieldTwo.appendTo union

    # Create a field that is typically would be used to enter the
    # password or similar information that should not be displayed
{'fraction_non_alphanumeric': 0.05615620461513636, 'fraction_numerical': 0.0025818944650637405, 'mean_word_length': 3.9863234111021724, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '797111', 'n_tokens_mistral': 1597, 'n_tokens_neox': 1472, 'n_words': 819}