<commit_before>import Ember from 'ember';

/**
 * @module components
 * @class  sl-grid-header-settings
 */
export default Ember.Component.extend({

    // -------------------------------------------------------------------------
    // Dependencies

    // -------------------------------------------------------------------------
    // Attributes

    /**
     * HTML tag name for the root element
     *
     * @property {Ember.String} tagName
     * @default  "div"
     */
    tagName: 'div',

    /**
     * Class names for the root element
     *
     * @property {Ember.Array} classNames
     */
    classNames: [ 'sl-grid-header-settings' ],

    // -------------------------------------------------------------------------
    // Actions

    /**
     * Component actions hash
     *
     * @property {Ember.Object} actions
     */
    actions: {

        /**
         * Action to fire when header is clicked
         *
         * @function actions.click
         * @param    {string}  action - Name of action to trigger
         * @param    {integer} key    - Key of context to pass to triggered action
         * @returns  {void}
         */
        click: function( action, key ) {
            this.triggerAction({
                action        : action,
                actionContext : [ key ]
            });
        }
    },

    // -------------------------------------------------------------------------
    // Events

    /**
     * Method triggered when header is clicked
     *
     * @function click
     * @param    {event} event - The click event
     * @returns  {false|void}
     */
    click: function( event ){
        if ( Ember.$( event.target ).closest( '.stay-open' ).length ) {
            return false;
        }
    },

    /**
     * close the menu on mouseLeave if its open
     * @param  {Event} event
     * @return {void}
     */
    mouseLeave: function( event ){
        var toggleEl = Ember.$(event.target).closest( '.dropdown-toggle');

        if( ! toggleEl.length ){
            toggleEl = Ember.$(event.target).closest( '.dropdown-menu').siblings( '.dropdown-toggle');
        }

        if ( toggleEl.length && $(toggleEl).parents('.sl-grid-header-settings').hasClass('open') ){
            toggleEl.dropdown( 'toggle' );
        }
    },

    // -------------------------------------------------------------------------
    // Properties

    /**
     * alias to the translation keys on the settings object
     * @type {alias}
     */
    translationKeys: Ember.computed.alias( 'settings.translationKeys' ),

    /**
     * Whether to show actions
     *
     * @property {boolean} showActions
     */
    showActions: Ember.computed.bool( 'settings.actions' ),

    /**
     * Whether to show columns
     *
     * @property {boolean} showColumns
     */
    showColumns: Ember.computed.bool( 'settings.hideableColumns' ),

    /**<commit_msg>Change syntax to resolve JSHint error<commit_after>import Ember from 'ember';

/**
 * @module components
 * @class  sl-grid-header-settings
 */
export default Ember.Component.extend({

    // -------------------------------------------------------------------------
    // Dependencies

    // -------------------------------------------------------------------------
    // Attributes

    /**
     * HTML tag name for the root element
     *
     * @property {Ember.String} tagName
     * @default  "div"
     */
    tagName: 'div',

    /**
     * Class names for the root element
     *
     * @property {Ember.Array} classNames
     */
    classNames: [ 'sl-grid-header-settings' ],

    // -------------------------------------------------------------------------
    // Actions

    /**
     * Component actions hash
     *
     * @property {Ember.Object} actions
     */
    actions: {

        /**
         * Action to fire when header is clicked
         *
         * @function actions.click
         * @param    {string}  action - Name of action to trigger
         * @param    {integer} key    - Key of context to pass to triggered action
         * @returns  {void}
         */
        click: function( action, key ) {
            this.triggerAction({
                action        : action,
                actionContext : [ key ]
            });
        }
    },

    // -------------------------------------------------------------------------
    // Events

    /**
     * Method triggered when header is clicked
     *
     * @function click
     * @param    {event} event - The click event
     * @returns  {false|void}
     */
    click: function( event ){
        if ( Ember.$( event.target ).closest( '.stay-open' ).length ) {
            return false;
        }
    },

    /**
     * close the menu on mouseLeave if its open
     * @param  {Event} event
     * @return {void}
     */
    mouseLeave: function( event ){
        var toggleEl = Ember.$(event.target).closest( '.dropdown-toggle');

        if( ! toggleEl.length ){
            toggleEl = Ember.$(event.target).closest( '.dropdown-menu').siblings( '.dropdown-toggle');
        }

        if ( toggleEl.length && this.$(toggleEl).parents('.sl-grid-header-settings').hasClass('open') ){
            toggleEl.dropdown( 'toggle' );
        }
    },

    // -------------------------------------------------------------------------
    // Properties

    /**
     * alias to the translation keys on the settings object
     * @type {alias}
     */
    translationKeys: Ember.computed.alias( 'settings.translationKeys' ),

    /**
     * Whether to show actions
     *
     * @property {boolean} showActions
     */
    showActions: Ember.computed.bool( 'settings.actions' ),

    /**
     * Whether to show columns
     *
     * @property {boolean} showColumns
     */
    showColumns: Ember.computed.bool( 'settings.hideableColumns' ),

    /**
{'fraction_non_alphanumeric': 0.24094109565516056, 'fraction_numerical': 0.0, 'mean_word_length': 1.210246679316888, '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': '2128989', 'n_tokens_mistral': 1496, 'n_tokens_neox': 1451, 'n_words': 363}