<commit_before>/**
 * @file PaggingSize component
 * @author liangxiaojun(<EMAIL>)
 */

import React, {Component} from 'react';
import PropTypes from 'prop-types';

import DropdownSelect from '../DropdownSelect';

export default class PaggingSize extends Component {

    static propTypes = {

        className: PropTypes.string,
        style: PropTypes.object,

        pageSize: PropTypes.number,
        pageSizes: PropTypes.array,

        onPageSizeChange: PropTypes.func

    };
    static defaultProps = {

        className: '',
        style: null,

        pageSize: 10,
        pageSizes: [5, 10, 15, 20]

    };

    constructor(props, ...restArgs) {

        super(props, ...restArgs);

        this.pageSizeChangeHandle = ::this.pageSizeChangeHandle;

    }

    pageSizeChangeHandle(newPageSize) {
        const {pageSize, onPageSizeChange} = this.props;
        pageSize != newPageSize && onPageSizeChange && onPageSizeChange(newPageSize);
    }

    render() {

        const {className, style, pageSize, pageSizes} = this.props;

        let temp = pageSizes.find(item => item && item.value === pageSize),
            value = temp ? temp : pageSize;

        return (
            <div className={`pagging-size ${className}`}
                 style={style}>

                <label>Show Rows:</label>

                <DropdownSelect className="pagging-size-select"
                                value={value}
                                data={pageSizes}
                                autoClose={true}
                                onChange={this.pageSizeChangeHandle}/>

            </div>
        );

    }
};<commit_msg>update PaggingSize<commit_after>/**
 * @file PaggingSize component
 * @author liangxiaojun(<EMAIL>)
 */

import React, {Component} from 'react';
import PropTypes from 'prop-types';

import DropdownSelect from '../DropdownSelect';

class PaggingSize extends Component {

    constructor(props, ...restArgs) {

        super(props, ...restArgs);

        this.pageSizeChangeHandle = ::this.pageSizeChangeHandle;

    }

    pageSizeChangeHandle(newPageSize) {
        const {pageSize, onPageSizeChange} = this.props;
        pageSize != newPageSize && onPageSizeChange && onPageSizeChange(newPageSize);
    }

    render() {

        const {className, style, pageSize, pageSizes} = this.props;

        let temp = pageSizes.find(item => item && item.value === pageSize),
            value = temp ? temp : pageSize;

        return (
            <div className={`pagging-size ${className}`}
                 style={style}>

                <label>Show Rows:</label>

                <DropdownSelect className="pagging-size-select"
                                value={value}
                                data={pageSizes}
                                autoClose={true}
                                onChange={this.pageSizeChangeHandle}/>

            </div>
        );

    }
};

PaggingSize.propTypes = {

    className: PropTypes.string,
    style: PropTypes.object,

    pageSize: PropTypes.number,
    pageSizes: PropTypes.array,

    onPageSizeChange: PropTypes.func

};

PaggingSize.defaultProps = {

    className: '',
    style: null,

    pageSize: 10,
    pageSizes: [5, 10, 15, 20]

};

export default PaggingSize;
{'fraction_non_alphanumeric': 0.11486898232784887, 'fraction_numerical': 0.005484460694698354, 'mean_word_length': 1.9872611464968153, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, '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': '4530902', 'n_tokens_mistral': 941, 'n_tokens_neox': 889, 'n_words': 190}