text: var __assign = (this && this.__assign) || function () {
      __assign = Object.assign || function(t) {
          for (var s, i = 1, n = arguments.length; i < n; i++) {
              s = arguments[i];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                  t[p] = s[p];
          }
          return t;
      };
      return __assign.apply(this, arguments);
  };
  /* eslint-disable no-param-reassign */
  import React from 'react';
  import TableComponent from '../components/TableComponent';
  import Pagination from '../components/Pagination';
  import PivotValueComponent from '../components/PivotValueComponent';
  import TheadComponent from '../components/TheadComponent';
  import TbodyComponent from '../components/TbodyComponent';
  import TfootComponent from '../components/TfootComponent';
  import NoDataComponent from '../components/NoDataComponent';
  import ResizerComponent from '../components/ResizerComponent';
  import ThComponent from '../components/ThComponent';
  import TdComponent from '../components/TdComponent';
  import CellTextComponent from '../components/CellTextComponent';
  import FilterComponent from '../components/FilterComponent';
  import ExpanderComponent from '../components/ExpanderComponent';
  import LoadingComponent from '../components/LoadingComponent';
  import TrGroupComponent from '../components/TrGroupComponent';
  import TrComponent from '../components/TrComponent';
  var emptyObj = function () { return ({}); };
  export var expanderTdDefaultProps = { pad: undefined };
  var defaultTableProps = {};
  var defaultHeaderProps = {
      background: 'brand', border: 'all', align: 'center',
  };
  var defaultBodyProps = {
      animation: { type: 'fadeIn', duration: 2000, size: 'large' },
  };
  var defaultRowOddProps = {};
  var defaultRowEvenProps = {};
  var defaultFooterProps = { background: 'light-1' };
  var defaultPaginationProps = { pad: { vertical: 'medium' } };
  var defaultFilterProps = { border: 'bottom' };
  var defaultFilterInputProps = { size: 'small', placeholder: 'Filter...' };
  export default {
      // General
      data: [],
      loading: false,
      showPagination: true,
      showPaginationTop: false,
      showPaginationBottom: true,
      showPageSizeOptions: true,
      pageSizeOptions: [5, 10, 20, 25, 50, 100],
      defaultPageSize: 20,
      showPageJump: true,
      collapseOnSortingChange: true,
      collapseOnPageChange: true,
      collapseOnDataChange: true,
      freezeWhenExpanded: false,
      sortable: true,
      multiSort: true,
      resizable: true,
      filterable: false,
      defaultSortDesc: false,
      defaultSorted: [],
      defaultFiltered: [],
      defaultResized: [],
      defaultExpanded: {},
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      defaultFilterMethod: function (filter, row, _column) {
          var id = filter.pivotId || filter.id;
          if (row[id] !== undefined && filter.value !== undefined) {
              return String(row[id])
                  .toUpperCase()
                  .startsWith(filter.value.toUpperCase());
          }
          return true;
      },
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
      defaultSortMethod: function (a, b, _desc) {
          // force null and undefined to the bottom
          a = a === null || a === undefined ? '' : a;
          b = b === null || b === undefined ? '' : b;
          // force any string values to lowercase
          a = typeof a === 'string' ? a.toLowerCase() : a;
          b = typeof b === 'string' ? b.toLowerCase() : b;
          // Return either 1 or -1 to indicate a sort priority
          if (a > b) {
              return 1;
          }
          if (a < b) {
              return -1;
          }
          // returning 0, undefined or any falsey value will use subsequent sorts or
          // the index as a tiebreaker
          return 0;
      },
      // Controlled State Props
      // page: undefined,
      // pageSize: undefined,
      // sorted: [],
      // filtered: [],
      // resized: [],
      // expanded: {},
      // Controlled State Callbacks
      onPageChange: undefined,
      onPageSizeChange: undefined,
      onSortedChange: undefined,
      onFilteredChange: undefined,
      onResizedChange: undefined,
      onExpandedChange: undefined,
      // Pivoting
      pivotBy: undefined,
      // Key Constants
      pivotValKey: '_pivotVal',
      pivotIDKey: '_pivotID',
      subRowsKey: '_subRows',
      aggregatedKey: '_aggregated',
      nestingLevelKey: '_nestingLevel',
      originalKey: '_original',
      indexKey: '_index',
      groupedByPivotKey: '_groupedByPivot',
      // Server-side Callbacks
      onFetchData: function () { return null; },
      // Component decorators
      getProps: function (_a) {
          var className = _a.className;
          return ({ className: className });
      },
      getTableProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.table) || defaultTableProps);
      },
      getTheadGroupProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && (decorations.headerGroup || decorations.header)) || {});
      },
      getTheadGroupTrProps: emptyObj,
      getTheadProps: emptyObj,
      getTheadTrProps: emptyObj,
      getTheadThProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.header) || defaultHeaderProps);
      },
      getTheadFilterProps: emptyObj,
      getTheadFilterTrProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.filterRow) || {});
      },
      getFilterInputProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.filterInput) || defaultFilterInputProps);
      },
      getTheadFilterThProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.filter) || defaultFilterProps);
      },
      getTbodyProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.body) || defaultBodyProps);
      },
      getTrGroupProps: emptyObj,
      getTrProps: function (even, _a) {
          var decorations = _a.decorations;
          if (decorations) {
              var props = __assign({}, decorations.row);
              if (even) {
                  props = __assign({}, props, (decorations.rowEven || defaultRowEvenProps));
              }
              else {
                  props = __assign({}, props, (decorations.rowOdd || defaultRowOddProps));
              }
              return props;
          }
          return even ? defaultRowEvenProps : defaultRowOddProps;
      },
      getTdProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.cell) || {});
      },
      getExpanderProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.expander) || {});
      },
      getTfootProps: emptyObj,
      getTfootTrProps: emptyObj,
      getTfootTdProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.footer) || defaultFooterProps);
      },
      getPaginationProps: function (_a) {
          var decorations = _a.decorations;
          return ((decorations && decorations.pagination) || defaultPaginationProps);
      },
      getLoadingProps: emptyObj,
      getNoDataProps: emptyObj,
      getResizerProps: emptyObj,
      // Global Column Defaults
      column: {
          // Renderers
          Cell: undefined,
          Header: undefined,
          Footer: undefined,
          Aggregated: undefined,
          Pivot: undefined,
          PivotValue: undefined,
          Expander: undefined,
          Filter: undefined,
          // All Columns
          sortable: undefined,
          resizable: undefined,
          filterable: undefined,
          show: true,
          minWidth: 100,
          // Cells only
          getProps: function (_state, _rowInfo, column) {
              if (column && column.decorations) {
                  return column.decorations.cell || {};
              }
              return {};
          },
          // Pivot only
          aggregate: undefined,
          // Headers only
          getHeaderProps: function (_state, _rowInfo, column) { return ((column && column.decorations && column.decorations.header) || {}); },
          getFilterProps: function (_state, _rowInfo, column) { return ((column && column.decorations && column.decorations.filter) || {}); },
          // Footers only
          getFooterProps: function (_state, _rowInfo, column) { return ((column && column.decorations && column.decorations.footer) || {}); },
          filterMethod: undefined,
          filterAll: false,
          sortMethod: undefined,
      },
      // Global Expander Column Defaults
      expanderDefaults: {
          sortable: false,
          resizable: false,
          filterable: false,
          width: 46,
      },
      pivotDefaults: {
      // extend the defaults for pivoted columns here
      },
      // Text
      previousText: 'Previous',
      nextText: 'Next',
      loadingText: 'Loading...',
      noDataText: 'No rows found',
      pageText: 'Page',
      ofText: 'of',
      rowsText: 'rows',
      // Components
      TableComponent: TableComponent,
      TheadComponent: TheadComponent,
      TbodyComponent: TbodyComponent,
      TrGroupComponent: TrGroupComponent,
      TrComponent: TrComponent,
      ThComponent: ThComponent,
      TdComponent: TdComponent,
      CellTextComponent: CellTextComponent,
      TfootComponent: TfootComponent,
      FilterComponent: FilterComponent,
      ExpanderComponent: ExpanderComponent,
      PivotValueComponent: PivotValueComponent,
      AggregatedComponent: function (_a) {
          var subRows = _a.subRows, column = _a.column;
          var previewValues = subRows
              .filter(function (d) { return typeof d[column.id] !== 'undefined'; })
              .map(function (row, i) { return (
          // eslint-disable-next-line react/no-array-index-key
          React.createElement("span", { key: i },
              row[column.id],
              i < subRows.length - 1 ? ', ' : '')); });
          return (React.createElement("span", null, previewValues));
      },
      PivotComponent: undefined,
      // the ExpanderComponent and PivotValueComponent at run-time in methods.js
      PaginationComponent: Pagination,
      PreviousComponent: undefined,
      NextComponent: undefined,
      LoadingComponent: LoadingComponent,
      NoDataComponent: NoDataComponent,
      ResizerComponent: ResizerComponent,
      PadRowComponent: function () { return React.createElement("span", null, "\u00A0"); },
  };
  