<commit_before>import { Class } from '../../core/Core.js';
import { create as el } from '../../dom/Element.js';
import { loc } from '../../localisation/i18n.js';
import { when } from '../collections/SwitchView.js';
import { Activatable } from './Activatable.js';
import { ClearSearchButtonView } from './ClearSearchButtonView.js';
import { TextInputView } from './TextInputView.js';

const SearchInputView = Class({
    Name: 'SearchInputView',

    Extends: TextInputView,

    Mixin: [Activatable],

    icon: null,

    inputAttributes: {
        autocapitalize: 'off',
        autocomplete: 'off',
        autocorrect: 'off',
        spellcheck: 'false',
    },

    // Helps password managers know this is not a username input!
    name: 'search',

    baseClassName: 'v-SearchInput',

    className: function () {
        const type = this.get('type');
        return (
            this.get('baseClassName') +
            (this.get('isDisabled') ? ' is-disabled' : '') +
            (this.get('isFocused') ? ' is-focused' : '') +
            (type ? ' ' + type : '')
        );
    }.property('type', 'isDisabled', 'isFocused'),

    drawControl() {
        return (this._domControl = el('input', {
            id: this.get('id') + '-input',
            className: this.get('baseClassName') + '-input',
            name: this.get('name'),
            disabled: this.get('isDisabled'),
            placeholder: this.get('placeholder'),
            value: this.get('value'),
        }));
    },

    draw(layer) {
        const control = this.drawControl();

        this.redrawInputAttributes(layer);
        this.redrawTabIndex(layer);

        return [
            control,<commit_msg>Remove redundant SearchInputView#drawControl<commit_after>import { Class } from '../../core/Core.js';
import { loc } from '../../localisation/i18n.js';
import { when } from '../collections/SwitchView.js';
import { Activatable } from './Activatable.js';
import { ClearSearchButtonView } from './ClearSearchButtonView.js';
import { TextInputView } from './TextInputView.js';

const SearchInputView = Class({
    Name: 'SearchInputView',

    Extends: TextInputView,

    Mixin: [Activatable],

    icon: null,

    inputAttributes: {
        autocapitalize: 'off',
        autocomplete: 'off',
        autocorrect: 'off',
        spellcheck: 'false',
    },

    // Helps password managers know this is not a username input!
    name: 'search',

    baseClassName: 'v-SearchInput',

    className: function () {
        const type = this.get('type');
        return (
            this.get('baseClassName') +
            (this.get('isDisabled') ? ' is-disabled' : '') +
            (this.get('isFocused') ? ' is-focused' : '') +
            (type ? ' ' + type : '')
        );
    }.property('type', 'isDisabled', 'isFocused'),

    draw(layer) {
        const control = this.drawControl();

        this.redrawInputAttributes(layer);
        this.redrawTabIndex(layer);

        return [
            control,
{'fraction_non_alphanumeric': 0.16044029352901934, 'fraction_numerical': 0.00133422281521014, 'mean_word_length': 2.354586129753915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '810434', 'n_tokens_mistral': 878, 'n_tokens_neox': 856, 'n_words': 189}