<commit_before>
import { Ajax } from './bunny.ajax';
import { Template } from './bunny.template';
import { Pagination } from './Pagination';
import { BunnyURL } from './url';
import { ready, addEventOnce } from './utils/DOM';
import { pushCallbackToElement, callElementCallbacks, initObjectExtensions } from './utils/core';

export const DataTableConfig = {
  tagName: 'datatable',
  attrUrl: 'url',
  attrTemplate: 'template',

  tagNamePagination: 'pagination',
  tagNameStats: 'stats',

  perPage: 15,
  paginationLimit: 7,

  loadingImg: '/img/loading.svg',

  ajaxHeaders: []
};

export const DataTableUI = {

  Config: DataTableConfig,
  Template: Template,

  getSearchInput(datatable, name = 'search') {
    return datatable.querySelector('[name="' + name + '"]') || false;
  },

  getTable(datatable) {
    return datatable.getElementsByTagName('table')[0];
  },

  getPagination(datatable) {
    return datatable.getElementsByTagName(this.Config.tagNamePagination)[0];
  },

  getStats(datatable) {
    return datatable.getElementsByTagName(this.Config.tagNameStats)[0];
  },

  removeRows(datatable) {
    const table = this.getTable(datatable);
    const rowCount = table.rows.length;
    for (let i = rowCount - 1; i > 0; i--) {
      table.deleteRow(i);
    }
  },

  insertRows(datatable, rowsData, templateId) {
    this.Template.insertAll(templateId, rowsData, this.getTable(datatable));
  },

};

export const DataTable = {
<commit_msg>feat(Datatable) make search input configurable to avoid conflicts<commit_after>
import { Ajax } from './bunny.ajax';
import { Template } from './bunny.template';
import { Pagination } from './Pagination';
import { BunnyURL } from './url';
import { ready, addEventOnce } from './utils/DOM';
import { pushCallbackToElement, callElementCallbacks, initObjectExtensions } from './utils/core';

export const DataTableConfig = {
  tagName: 'datatable',
  attrUrl: 'url',
  attrTemplate: 'template',

  tagNamePagination: 'pagination',
  tagNameStats: 'stats',

  perPage: 15,
  paginationLimit: 7,

  loadingImg: '/img/loading.svg',

  searchInputName: 'search',

  ajaxHeaders: []
};

export const DataTableUI = {

  Config: DataTableConfig,
  Template: Template,

  getSearchInput(datatable, name = DataTableConfig.searchInputName) {
    return datatable.querySelector('[name="' + name + '"]') || false;
  },

  getTable(datatable) {
    return datatable.getElementsByTagName('table')[0];
  },

  getPagination(datatable) {
    return datatable.getElementsByTagName(this.Config.tagNamePagination)[0];
  },

  getStats(datatable) {
    return datatable.getElementsByTagName(this.Config.tagNameStats)[0];
  },

  removeRows(datatable) {
    const table = this.getTable(datatable);
    const rowCount = table.rows.length;
    for (let i = rowCount - 1; i > 0; i--) {
      table.deleteRow(i);
    }
  },

  insertRows(datatable, rowsData, templateId) {
    this.Template.insertAll(templateId, rowsData, this.getTable(datatable));
  },

};

export const DataTable = {

{'fraction_non_alphanumeric': 0.1417192167275141, 'fraction_numerical': 0.005310321938267508, 'mean_word_length': 4.232638888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '717266', 'n_tokens_mistral': 996, 'n_tokens_neox': 962, 'n_words': 201}