<commit_before>/*
 * Copyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
({

    buildBody : function(component) {
        var innerBody = component.get("v.body");
        var labelAttribute = component.get("v.label");
        if (!$A.util.isEmpty(labelAttribute)) {
            //create label
            var domId = component.get("v.domId");
            if (!domId) {
                domId = component.getConcreteComponent().getGlobalId();
            }
            var labelComponent = $A.newCmp({
                    componentDef: {descriptor: 'markup://ui:label'},
                    localId: 'inputLabel',
                    attributes: {values: {
                        'label': labelAttribute,
                        'class': component.get("v.labelClass") + " uiLabel-" + component.get("v.labelPosition"),
                        'for': domId,
                        'labelDisplay': component.get("v.labelPosition") != "hidden",
                        'title': component.get("v.labelTitle"),
                        'requiredIndicator': component.get("v.required") ? component.get("v.requiredIndicator") : null}}},
                    component );
            var labelPositionAttribute = component.get("v.labelPosition");
            if (labelPositionAttribute == 'left' || labelPositionAttribute == 'top') {
                innerBody.unshift(labelComponent);
            } else if (labelPositionAttribute == 'right' || labelPositionAttribute == 'bottom' || labelPositionAttribute == 'hidden') {
                innerBody.push(labelComponent);
            }
            var divComponent = $A.newCmp({
                    componentDef: {descriptor: 'markup://aura:html'},
                    attributes: {values: {
                        body: innerBody,
                        tag: 'div'}}}
            );
            var body = [];
            body.push(divComponent);
            component.set("v.body", body);
        }
    },

	/**
	 * @Override
	 */
	addDomHandler : function(component, event) {
        var el = this.getInputElement(component);
        $A.util.on(el, event, this.lib.interactive.domEventHandler);
	},
<commit_msg>fix for displaying required indicator when the label is hidden @bug W-2517463@ @markfixed@ @rev mkohanfars@<commit_after>/*
 * Copyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
({

    buildBody : function(component) {
        var innerBody = component.get("v.body");
        var labelAttribute = component.get("v.label");
        if (!$A.util.isEmpty(labelAttribute)) {
            //create label
            var domId = component.get("v.domId");
            if (!domId) {
                domId = component.getConcreteComponent().getGlobalId();
            }
            var labelClass = component.get("v.labelClass") + " uiLabel-" + component.get("v.labelPosition");
            var labelDisplay = component.get("v.labelPosition") != "hidden";
            var requiredIndicator = labelDisplay && component.get("v.required") ? component.get("v.requiredIndicator") : null;
            var labelComponent = $A.newCmp({
                    componentDef: {descriptor: 'markup://ui:label'},
                    localId: 'inputLabel',
                    attributes: {values: {
                        label: labelAttribute,
                        class: labelClass,
                        for: domId,
                        labelDisplay: labelDisplay,
                        title: component.get("v.labelTitle"),
                        requiredIndicator: requiredIndicator}}},
                    component );
            var labelPositionAttribute = component.get("v.labelPosition");
            if (labelPositionAttribute == 'left' || labelPositionAttribute == 'top') {
                innerBody.unshift(labelComponent);
            } else if (labelPositionAttribute == 'right' || labelPositionAttribute == 'bottom' || labelPositionAttribute == 'hidden') {
                innerBody.push(labelComponent);
            }
            var divComponent = $A.newCmp({
                    componentDef: {descriptor: 'markup://aura:html'},
                    attributes: {values: {
                        body: innerBody,
                        tag: 'div'}}}
            );
            var body = [];
            body.push(divComponent);
            component.set("v.body", body);
        }
    },

	/**
	 * @Override
	 */
	addDomHandler : function(component, event) {
        var el = this.getInputElement(component);
        $A.util.on(el, event, this.lib.interactive.domEventHandler);
	},

{'fraction_non_alphanumeric': 0.11799044754997347, 'fraction_numerical': 0.004068636122412878, 'mean_word_length': 1.9883720930232558, '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': '4041703', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1366, 'n_words': 376}