<commit_before>import * as React from 'react';
import * as classNames from 'classnames';

import { BaseView, ViewModelProps } from '../../React/BaseView';
import { DataGridView, DataGridProps, DataGridColumn, DataGridTableViewTemplate } from '../DataGrid/DataGridView';
import { CommonPanel, CommonPanelProps } from '../CommonPanel/CommonPanel';
import { ItemListPanelViewModel } from './ItemListPanelViewModel';

import './ItemListPanel.less';

export * from './CountFooterContent';
export * from './ViewAllFooterAction';

export interface ItemListPanelProps extends CommonPanelProps, DataGridProps, ViewModelProps {
  children?: DataGridColumn[];
}

export class ItemListPanelView extends BaseView<ItemListPanelProps, ItemListPanelViewModel<any>> {
  public static displayName = 'ItemListPanelView';

  static defaultProps = {
    fill: true,
  };

  updateOn() {
    return [
      this.state.isLoading.changed,
    ];
  }

  render() {
    const { className, children, rest, props } = this.restProps(x => {
      const { fill, view, search, pager, pagerLimits, loadingContent, selectable, highlightSelected, checkmarkSelected } = x;
      return { fill, view, search, pager, pagerLimits, loadingContent, selectable, highlightSelected, checkmarkSelected };
    });

    const viewType = props.view instanceof DataGridTableViewTemplate ? 'Table' : 'List';

    return (
      <CommonPanel { ...rest } className={ classNames('ItemListPanel', viewType, className) }>
        {
          this.renderConditional(props.search === true && this.state.isLoading() === false, () => (
            <DataGridView.Search grid={ this.state.grid } view={ props.view } fill />
          ), () => (props.search == null || React.isValidElement(props.search)) ? props.search : (<DataGridView.Search { ...props.search } grid={ this.state.grid } view={ props.view } fill />))
        }
        <DataGridView { ...props } viewModel={ this.state.grid } search={ false } pager={ false }>
          { children }
        </DataGridView>
        {
          this.renderConditional(props.pager === true && this.state.isLoading() === false, () => (
            <DataGridView.Pager grid={ this.state.grid } view={ props.view } limits={ props.pagerLimits } fill />
          ), () => (props.pager == null || React.isValidElement(props.pager)) ? props.pager : (<DataGridView.Pager limits={ props.pagerLimits } { ...props.pager } grid={ this.state.grid } view={ props.view } fill />))
        }
      </CommonPanel>
    );
  }
}<commit_msg>misc cleanup on the item list panel (using default props for the fill prop is not very clear)<commit_after>import * as React from 'react';
import * as classNames from 'classnames';

import { BaseView, ViewModelProps } from '../../React/BaseView';
import { DataGridView, DataGridProps, DataGridColumn, DataGridTableViewTemplate } from '../DataGrid/DataGridView';
import { CommonPanel, CommonPanelProps } from '../CommonPanel/CommonPanel';
import { ItemListPanelViewModel } from './ItemListPanelViewModel';

import './ItemListPanel.less';

export * from './CountFooterContent';
export * from './ViewAllFooterAction';

export interface ItemListPanelProps extends CommonPanelProps, DataGridProps, ViewModelProps {
  children?: DataGridColumn[];
}

export class ItemListPanelView extends BaseView<ItemListPanelProps, ItemListPanelViewModel<any>> {
  public static displayName = 'ItemListPanelView';

  static defaultProps = {
  };

  updateOn() {
    return [
      this.state.isLoading.changed,
    ];
  }

  render() {
    const { className, children, rest, props } = this.restProps(x => {
      const { fill, view, search, pager, pagerLimits, loadingContent, selectable, highlightSelected, checkmarkSelected } = x;
      return { fill, view, search, pager, pagerLimits, loadingContent, selectable, highlightSelected, checkmarkSelected };
    });

    const viewType = props.view instanceof DataGridTableViewTemplate ? 'Table' : 'List';

    return (
      <CommonPanel { ...rest } className={ classNames('ItemListPanel', viewType, className) }>
        {
          this.renderConditional(props.search === true && this.state.isLoading() === false, () => (
            <DataGridView.Search grid={ this.state.grid } view={ props.view } fill />
          ), () => (props.search == null || React.isValidElement(props.search)) ? props.search : (<DataGridView.Search { ...props.search } grid={ this.state.grid } view={ props.view } fill />))
        }
        <DataGridView { ...props } viewModel={ this.state.grid } search={ false } pager={ false } fill>
          { children }
        </DataGridView>
        {
          this.renderConditional(props.pager === true && this.state.isLoading() === false, () => (
            <DataGridView.Pager grid={ this.state.grid } view={ props.view } limits={ props.pagerLimits } fill />
          ), () => (props.pager == null || React.isValidElement(props.pager)) ? props.pager : (<DataGridView.Pager limits={ props.pagerLimits } { ...props.pager } grid={ this.state.grid } view={ props.view } fill />))
        }
      </CommonPanel>
    );
  }
}
{'fraction_non_alphanumeric': 0.14428936504816198, 'fraction_numerical': 0.0, 'mean_word_length': 3.5066430469441983, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 33, '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': '6343045', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1410, 'n_words': 344}