import _extends from '@babel/runtime/helpers/extends';
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import uniqueId from '../../node_modules/lodash-es/uniqueId.js';
import _pick from '../../node_modules/lodash-es/pick.js';
import _merge from '../../node_modules/lodash-es/merge.js';
import 'core-js/modules/es.symbol.js';
import 'core-js/modules/es.array.concat.js';
import 'core-js/modules/es.array.filter.js';
import 'core-js/modules/es.array.find.js';
import 'core-js/modules/es.array.includes.js';
import 'core-js/modules/es.array.iterator.js';
import 'core-js/modules/es.array.map.js';
import 'core-js/modules/es.array.slice.js';
import 'core-js/modules/es.array.sort.js';
import 'core-js/modules/es.number.is-finite.js';
import 'core-js/modules/es.number.is-integer.js';
import 'core-js/modules/es.object.get-own-property-descriptor.js';
import 'core-js/modules/es.object.get-own-property-descriptors.js';
import 'core-js/modules/es.object.keys.js';
import 'core-js/modules/es.object.to-string.js';
import 'core-js/modules/es.regexp.exec.js';
import 'core-js/modules/es.regexp.to-string.js';
import 'core-js/modules/es.set.js';
import 'core-js/modules/es.string.includes.js';
import 'core-js/modules/es.string.iterator.js';
import 'core-js/modules/es.string.search.js';
import 'core-js/modules/web.dom-collections.for-each.js';
import 'core-js/modules/web.dom-collections.iterator.js';
import React__default, { useRef, useState, useMemo, useCallback, useEffect } from 'react';
import PropTypes from 'prop-types';
import useDeepCompareEffect from 'use-deep-compare-effect';
import { TableContainer, Tag, Table as Table$2 } from '@carbon/react';
import classnames from 'classnames';
import warning from 'warning';
import { useLangDirection } from '../../utils/useLangDirection.js';
import { defaultFunction } from '../../utils/componentUtilityFunctions.js';
import { settings } from '../../constants/Settings.js';
import { WrapCellTextPropTypes } from '../../constants/SharedPropTypes.js';
import FilterTags from '../FilterTags/FilterTags.js';
import { RuleGroupPropType } from '../RuleBuilder/RuleBuilderPropTypes.js';
import deprecate$1 from '../../internal/experimental.js';
import deprecate from '../../internal/deprecate.js';
import { TableColumnsPropTypes, TableColumnGroupPropType, TableRowsPropTypes, ExpandedRowsPropTypes, PinColumnPropTypes, TableFiltersPropType, ActiveTableToolbarPropType, TableSearchPropTypes, TableToolbarActionsPropType, TableSortPropType, TableOrderingPropType, RowActionsStatePropTypes, EmptyStatePropTypes, I18NPropTypes } from './TablePropTypes.js';
import TableHead from './TableHead/TableHead.js';
import TableToolbar from './TableToolbar/TableToolbar.js';
import EmptyTable from './EmptyTable/EmptyTable.js';
import TableSkeletonWithHeaders from './TableSkeletonWithHeaders/TableSkeletonWithHeaders.js';
import TableBody from './TableBody/TableBody.js';
import Pagination from './Pagination.js';
import TableFoot from './TableFoot/TableFoot.js';
import TableMultiSortModal from './TableMultiSortModal/TableMultiSortModal.js';
import { useShowExpanderColumn } from './expanderColumnHook.js';
import ErrorTable from './ErrorTable/ErrorTable.js';
import { PIN_COLUMN } from './tableUtilities.js';
import { FilterEdit } from '@carbon/icons-react';

var _excluded = ["id", "columns", "enablePercentageColumnWidth", "columnGroups", "data", "expandedData", "locale", "view", "actions", "actions", "options", "lightweight", "className", "style", "i18n", "secondaryTitle", "tooltip", "error", "testId", "size", "zIndex", "emptyStateIcon", "deletedAttribute"],
  _excluded2 = ["renderIcon"],
  _excluded3 = ["error"],
  _excluded4 = ["maxPages"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var iotPrefix = settings.iotPrefix;
var propTypes = {
  /** DOM ID for component */
  id: PropTypes.string,
  /** Displays smaller title in header */
  secondaryTitle: PropTypes.string,
  tooltip: PropTypes.node,
  /** render zebra stripes or not */
  useZebraStyles: PropTypes.bool,
  /**  lighter styling where regular table too visually heavy. Deprecated. */
  lightweight: deprecate(PropTypes.bool, "The 'lightweight' prop has been deprecated and will be removed in the next major version."),
  /** Specify the properties of each column in the table */
  columns: TableColumnsPropTypes.isRequired,
  /** Specify the properties of each column group in the table. Defaults to empty array. */
  columnGroups: TableColumnGroupPropType,
  /** Row value data for the body of the table */
  data: TableRowsPropTypes.isRequired,
  /** Expanded data for the table details */
  expandedData: ExpandedRowsPropTypes,
  /**
   * Optional base z-index for the table. Used with drag and drop to ensure the drag image is "over"
   * other elements on the page. This is generally only needed if the table is in a modal dialog
   * with z-index of its own. In that case, set this z-index to be higher than the modal to be sure
   * any drags are seen above the modal.
   */
  zIndex: PropTypes.number,
  /** Experimental: Turns on the carbon sticky-header feature. */
  stickyHeader: deprecate$1('stickyHeader'),
  /** Optional properties to customize how the table should be rendered */
  options: PropTypes.shape({
    /** If true allows the table to aggregate values of columns in a special row */
    hasAggregations: PropTypes.bool,
    /** If true, search is applied as typed. If false, only after 'Enter' is pressed */
    hasFastSearch: PropTypes.bool,
    hasPagination: PropTypes.bool,
    hasRowSelection: PropTypes.oneOf(['multi', 'single', false]),
    /** @TODO: Remove in major release and just show action bar when no actions are defined */
    /* option to hide batch action toolbar */
    hasBatchActionToolbar: PropTypes.bool,
    /** True if the rows should be expandable */
    hasRowExpansion: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
      /** True if any previously expanded rows should be collapsed when a new row is expanded */
      expandRowsExclusively: PropTypes.bool
    })]),
    hasRowNesting: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
      /** If the hierarchy only has 1 nested level of children */
      hasSingleNestedHierarchy: PropTypes.bool
    })]),
    hasMultiSort: PropTypes.bool,
    hasRowActions: PropTypes.bool,
    hasFilter: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['onKeyPress', 'onEnterAndBlur'])]),
    /* Turns on the Advanced Rule Builder Filtering. Is a boolean value */
    // eslint-disable-next-line consistent-return
    hasAdvancedFilter: function hasAdvancedFilter(props, propName, componentName) {
      {
        if (props !== null && props !== void 0 && props.hasFilter && props !== null && props !== void 0 && props.hasAdvancedFilter) {
          return new Error("Only one of props 'options.hasFilter' or 'options.hasAdvancedFilter' can be specified in '".concat(componentName, "'."));
        }
        if (![true, false, undefined].includes(props === null || props === void 0 ? void 0 : props.hasAdvancedFilter)) {
          return new Error("'options.hasAdvancedFilter' should be a boolean or undefined.");
        }
      }
    },
    /** if true, the data prop will be assumed to only represent the currently visible page */
    hasOnlyPageData: PropTypes.bool,
    /** has simple search capability */
    hasSearch: PropTypes.bool,
    hasColumnSelection: PropTypes.bool,
    hasColumnSelectionConfig: PropTypes.bool,
    shouldLazyRender: PropTypes.bool,
    hasRowCountInHeader: PropTypes.bool,
    /** If true enables the row edit toolbar button and functionality */
    hasRowEdit: PropTypes.bool,
    hasResize: PropTypes.bool,
    hasSingleRowEdit: PropTypes.bool,
    hasUserViewManagement: PropTypes.bool,
    /** Preserves the widths of existing columns when one or more columns are added, removed, hidden, shown or resized. */
    preserveColumnWidths: PropTypes.bool,
    /* If true, fire the onRowExpanded callback with the rowId when a row is clicked */
    shouldExpandOnRowClick: PropTypes.bool,
    /** If true removes the "table-layout: fixed" for resizable tables  */
    useAutoTableLayoutForResize: PropTypes.bool,
    /**
     * auto - Wrap for tables with dynamic columns widths and truncate for tables with fixed or resizable columns
     * always - Wrap if needed for all table column configurations
     * never - Tables with dynamic columns widths grow larger and tables with fixed or resizable columns truncate.
     * alwaysTruncate - Always truncate if needed for all table column configurations
     * expand - Expand to fit text width (by horizontal scrollbar) for table with fixed columns
     */
    wrapCellText: WrapCellTextPropTypes,
    /** use white-space: pre; css when true */
    preserveCellWhiteSpace: PropTypes.bool,
    /** display icon button in filter row */
    hasFilterRowIcon: PropTypes.bool,
    /** column to pin in the table */
    pinColumn: PinColumnPropTypes,
    /**
     * If rows can be dragged and dropped on top of each other. When this is true there will always
     * be space reserved for a drag handle at the start of the row. Each rows data must indicate if
     * that row can be dragged by setting `isDraggable: true` on their row data. The table also needs
     * `actions.table.onDrag` and `actions.table.onDrop` callback props.
     */
    hasDragAndDrop: PropTypes.bool,
    /** Making this true in addition to hasDragAndDrop will consider breadcrumb nodes as drop targets */
    hasBreadcrumbDrop: PropTypes.bool,
    /** Freezes table header and footer */
    pinHeaderAndFooter: PropTypes.bool,
    /** display icon while Table data is empty */
    emptyStateIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOf(['error', 'error404', 'empty', 'not-authorized', 'no-result', 'success', ''])])
  }),
  /** Size prop from Carbon to shrink row height (and header height in some instances) */
  size: function checkProps(props, propName, componentName) {
    if (['compact', 'short', 'normal', 'tall'].includes(props[propName])) {
      warning(false, "The value `".concat(props[propName], "` has been deprecated for the ") + "`".concat(propName, "` prop on the ").concat(componentName, " component. It will be removed in the next major ") + "release. Please use 'xs', 'sm', 'md', 'lg', or 'xl' instead.") ;
    }
  },
  /** Initial state of the table, should be updated via a local state wrapper component implementation or via a central store/redux see StatefulTable component for an example */
  view: PropTypes.shape({
    aggregations: PropTypes.shape({
      label: PropTypes.string,
      columns: PropTypes.arrayOf(PropTypes.shape({
        /** id of the column that should have its values aggregated */
        id: PropTypes.string.isRequired,
        /** the primitive value or function that will receive an array of values and returns an aggregated value */
        value: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
        /** allow aligning the results the same as the column */
        align: PropTypes.oneOf(['start', 'center', 'end']),
        /** allows the aggregation to align with sortable columns extra padding */
        isSortable: PropTypes.bool
      })),
      /** hide the aggregation row without removing the aggregations object */
      isHidden: PropTypes.bool
    }),
    pagination: PropTypes.shape({
      pageSize: PropTypes.number,
      pageSizes: PropTypes.arrayOf(PropTypes.number),
      page: PropTypes.number,
      totalItems: PropTypes.number,
      /** Number of pages rendered in pagination */
      maxPages: function maxPages(props, propName, componentName) {
        {
          if (typeof props[propName] !== 'number') {
            return new Error("Invalid type of `".concat(propName, "` supplied to `").concat(componentName, "`. `").concat(propName, "` must be a positive integer."));
          }
          if (props[propName] < 0 || !Number.isInteger(props[propName])) {
            var roundedStr = "".concat(props[propName], " will be rounded to ").concat(Math.ceil(props[propName]));
            return new Error("Invalid prop `".concat(propName, "` supplied to `").concat(componentName, "`. `").concat(propName, "` must be a positive integer. ").concat(roundedStr, "."));
          }
        }
        return '';
      },
      isItemPerPageHidden: PropTypes.bool,
      /**
       * Specify the size of the Pagination buttons. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
       */
      size: PropTypes.oneOf(['sm', 'md', 'lg'])
    }),
    filters: TableFiltersPropType,
    /** a stripped down version of the RuleBuilderFilterPropType */
    advancedFilters: PropTypes.arrayOf(PropTypes.shape({
      /** Unique id for particular filter */
      filterId: PropTypes.string.isRequired,
      /** Text for main title of page */
      filterTitleText: PropTypes.string.isRequired,
      filterRules: RuleGroupPropType.isRequired
    })),
    selectedAdvancedFilterIds: PropTypes.arrayOf(PropTypes.string),
    toolbar: PropTypes.shape({
      /** Specify which header row to display, will display default header row if null */
      activeBar: ActiveTableToolbarPropType,
      /** optional content to render inside the toolbar  */
      customToolbarContent: PropTypes.node,
      /** Specify which batch actions to render in the batch action bar. If empty, no batch action toolbar will display */
      batchActions: PropTypes.arrayOf(PropTypes.shape({
        id: PropTypes.string.isRequired,
        labelText: PropTypes.string.isRequired,
        icon: PropTypes.element,
        iconDescription: PropTypes.string
      })),
      /** Simple search state */
      search: TableSearchPropTypes,
      /** is the toolbar currently disabled */
      isDisabled: PropTypes.bool,
      /** buttons to be shown with when activeBar is 'rowEdit' */
      rowEditBarButtons: PropTypes.node,
      /** extra actions that can appear in an overflow menu in the toolbar (same menu as toggle aggregations) */
      toolbarActions: TableToolbarActionsPropType,
      /** force hide Clear all filters button in toolbar */
      hideClearAllFiltersButton: PropTypes.bool
    }),
    table: PropTypes.shape({
      isSelectAllSelected: PropTypes.bool,
      isSelectAllIndeterminate: PropTypes.bool,
      selectedIds: PropTypes.arrayOf(PropTypes.string),
      sort: PropTypes.oneOfType([TableSortPropType, PropTypes.arrayOf(TableSortPropType)]),
      /** Specify the order, visibility and group belonging of the table columns */
      ordering: TableOrderingPropType,
      /** what is the current state of the row actions */
      rowActions: RowActionsStatePropTypes,
      singleRowEditButtons: PropTypes.element,
      expandedIds: PropTypes.arrayOf(PropTypes.string),
      emptyState: EmptyStatePropTypes,
      /** use custom error state or use error message directly */
      errorState: PropTypes.element,
      loadingState: PropTypes.shape({
        isLoading: PropTypes.bool,
        rowCount: PropTypes.number,
        columnCount: PropTypes.number
      }),
      /* show the modal for selecting multi-sort columns */
      showMultiSortModal: PropTypes.bool,
      multiSortModal: PropTypes.shape({
        /**
         * The anticipatedColumn is used to add the most recently click columnId to the UI of the
         * MultiSort modal. This gives the user a better experience by preemptively adding the column
         * they clicked multi-sort on to the multisort modal without changing state. They still have to
         * click "Sort" to save it, or can click 'Cancel' or the 'X' to clear it.
         */
        anticipatedColumn: PropTypes.shape({
          columnId: PropTypes.string,
          direction: PropTypes.oneOf(['ASC', 'DESC'])
        })
      }),
      /** Array with rowIds that are with loading active */
      loadingMoreIds: PropTypes.arrayOf(PropTypes.string),
      /** icon element for filter row icon */
      filterRowIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
    })
  }),
  /** Callbacks for actions of the table, can be used to update state in wrapper component to update `view` props */
  actions: PropTypes.shape({
    pagination: PropTypes.shape({
      /** Specify a callback for when the current page or page size is changed.
       * This callback is passed an object parameter containing the current page and the current page size */
      onChangePage: PropTypes.func
    }),
    toolbar: PropTypes.shape({
      onApplyFilter: PropTypes.func,
      onToggleFilter: PropTypes.func,
      onShowRowEdit: PropTypes.func,
      onToggleColumnSelection: PropTypes.func,
      /** Specify a callback for when the user clicks toolbar button to clear all filters.
       * Receives a parameter of the current filter values for each column */
      onClearAllFilters: PropTypes.func,
      /** Callback for when the automatcally generated Cancel action in the batch actions bar is clicked */
      onCancelBatchAction: PropTypes.func,
      /** Callback for all the batch actions except the cancel. Is called with the id of the clicked action.
       *  For the StatefulTable the current selections are received as second parameter  */
      onApplyBatchAction: PropTypes.func,
      /** Apply a search criteria to the table */
      onApplySearch: PropTypes.func,
      /** Download the table contents */
      onDownloadCSV: PropTypes.func,
      /** When advanced filters are applied */
      onApplyAdvancedFilter: PropTypes.func,
      /** Toggles the advanced filter flyout open */
      onToggleAdvancedFilter: PropTypes.func,
      /** Remove the selected advancedFilter from the table */
      onRemoveAdvancedFilter: PropTypes.func,
      /** Fired the 'create new advanced filter' button is clicked. */
      onCreateAdvancedFilter: PropTypes.func,
      /** Fired when then 'Cancel' button is clicked in the advanced filter flyout menu */
      onCancelAdvancedFilter: PropTypes.func,
      /** Fired when an advanced filter is selected or removed. */
      onChangeAdvancedFilter: PropTypes.func,
      /** fired when 'Toggle aggregations' is clicked in the overflow menu */
      onToggleAggregations: PropTypes.func,
      /** fired when clicking a 'toolbarAction' in the table toolbar */
      onApplyToolbarAction: PropTypes.func,
      /** fired when focus/blur on search bar in the table toolbar */
      onSearchExpand: PropTypes.func
    }),
    /** table wide actions */
    table: PropTypes.shape({
      onRowSelected: PropTypes.func,
      onRowClicked: PropTypes.func,
      onRowExpanded: PropTypes.func,
      onSelectAll: PropTypes.func,
      onChangeSort: PropTypes.func,
      /** callback if a row action is clicked called with the id of the action then the id of the row if you
       * return a promise from apply row action the stateful table will assume you're asynchronous and give a spinner */
      onApplyRowAction: PropTypes.func,
      onClearRowError: PropTypes.func,
      onEmptyStateAction: PropTypes.func,
      onChangeOrdering: PropTypes.func,
      onColumnSelectionConfig: PropTypes.func,
      onColumnResize: PropTypes.func,
      onOverflowItemClicked: PropTypes.func,
      /* (multiSortedColumns) => {} */
      onSaveMultiSortColumns: PropTypes.func,
      /* () => {} */
      onCancelMultiSortColumns: PropTypes.func,
      /* () => {} */
      onClearMultiSortColumns: PropTypes.func,
      /* (index) => {} */
      onAddMultiSortColumn: PropTypes.func,
      /* (index) => {} */
      onRemoveMultiSortColumn: PropTypes.func,
      onTableErrorStateAction: PropTypes.func,
      /** call back function for when load more row is clicked  (rowId) => {} */
      onRowLoadMore: PropTypes.func,
      /** call back function for when icon button in filter row is clicked  (evt) => {} */
      onFilterRowIconClick: PropTypes.func,
      /**
       * Required callback to support drag and drop. This gets the rows values being dragged. It
       * must return an object of the row IDs that can be dropped on, and a node use as the preview
       * of what's being dragged (typically the name of the row, possibly with an icon).
       *
       * @type {(rows: object[]) => {dropIds: string[], preview: React.Node}}
       */
      onDrag: PropTypes.func,
      /**
       * Required callback to support drag and drop. This is called after a successful drop and is
       * passed the ID of the row that was dragged and the ID of the row that was dropped on. It's
       * up to the caller to decide what to do with that--the table does not update itself.
       *
       * @type {(dragRowIds: string[], dropRowId) => void}
       */
      onDrop: PropTypes.func
    }).isRequired,
    /** callback for actions relevant for view management */
    onUserViewModified: PropTypes.func
  }),
  /** what locale should we use to format table values if left empty no locale formatting happens */
  locale: PropTypes.string,
  i18n: I18NPropTypes,
  /** Specify the error message that need to be displayed by default.
   * Incase we use view.table.errorState property then the error state will be displayed instead of error message */
  error: PropTypes.string,
  testId: PropTypes.string,
  /** Attribute name to identify deleted rows */
  deletedAttribute: PropTypes.string
};
var defaultProps = function defaultProps(baseProps) {
  return {
    columnGroups: [],
    id: null,
    useZebraStyles: false,
    lightweight: undefined,
    title: null,
    tooltip: null,
    secondaryTitle: null,
    zIndex: 0,
    options: {
      hasAggregations: false,
      hasPagination: false,
      hasRowSelection: false,
      hasRowExpansion: false,
      hasBatchActionToolbar: true,
      hasRowActions: false,
      hasRowNesting: false,
      hasRowEdit: false,
      hasFilter: false,
      hasAdvancedFilter: false,
      hasOnlyPageData: false,
      hasFastSearch: true,
      hasSearch: false,
      hasColumnSelection: false,
      hasColumnSelectionConfig: false,
      hasResize: false,
      hasSingleRowEdit: false,
      hasUserViewManagement: false,
      preserveColumnWidths: false,
      useAutoTableLayoutForResize: false,
      shouldLazyRender: false,
      shouldExpandOnRowClick: false,
      wrapCellText: 'always',
      preserveCellWhiteSpace: false,
      hasFilterRowIcon: false,
      pinColumn: PIN_COLUMN.NONE,
      hasDragAndDrop: false,
      hasBreadcrumbDrop: false,
      pinHeaderAndFooter: false
    },
    size: undefined,
    view: {
      aggregations: {
        columns: []
      },
      pagination: {
        pageSize: 10,
        pageSizes: [10, 20, 30],
        page: 1,
        totalItems: baseProps.data && baseProps.data.length,
        maxPages: 100,
        isItemPerPageHidden: false,
        size: 'lg'
      },
      filters: [],
      advancedFilters: [],
      selectedAdvancedFilterIds: [],
      toolbar: {
        advancedFilterFlyoutOpen: false,
        batchActions: [],
        search: {},
        hideClearAllFiltersButton: false
      },
      table: {
        expandedIds: [],
        isSelectAllSelected: undefined,
        selectedIds: [],
        rowActions: [],
        sort: {},
        ordering: baseProps.columns && baseProps.columns.map(function (i) {
          return {
            columnId: i.id
          };
        }),
        loadingState: {
          rowCount: 5,
          columnCount: 5
        },
        singleRowEditButtons: null,
        loadingMoreIds: [],
        showMultiSortModal: false,
        multiSortModal: undefined,
        filterRowIcon: FilterEdit
      }
    },
    actions: {
      pagination: {
        onChangePage: defaultFunction('actions.pagination.onChangePage')
      },
      toolbar: {
        onToggleFilter: defaultFunction('actions.toolbar.onToggleFilter'),
        onShowRowEdit: defaultFunction('actions.toolbar.onShowRowEdit'),
        onToggleColumnSelection: defaultFunction('actions.toolbar.onToggleColumnSelection'),
        onApplyBatchAction: defaultFunction('actions.toolbar.onApplyBatchAction'),
        onCancelBatchAction: defaultFunction('actions.toolbar.onCancelBatchAction'),
        onApplyToolbarAction: defaultFunction('actions.toolbar.onApplyToolbarAction'),
        onRemoveAdvancedFilter: defaultFunction('actions.toolbar.onRemoveAdvancedFilter'),
        onCancelAdvancedFilter: defaultFunction('actions.toolbar.onCancelFilter'),
        onCreateAdvancedFilter: defaultFunction('actions.toolbar.onCreateAdvancedFilter'),
        onApplyAdvancedFilter: defaultFunction('actions.toolbar.onApplyAdvancedFilter'),
        onChangeAdvancedFilter: defaultFunction('actions.toolbar.onChangeAdvancedFilter'),
        onToggleAdvancedFilter: defaultFunction('actions.toolbar.onToggleAdvancedFilter')

        // TODO: removed to mimic the current state of consumers in the wild
        // since they won't be adding this prop to any of their components
        // can be readded in V3.
        // onToggleAggregations: defaultFunction('actions.toolbar.onToggleAggregations'),
      },
      table: {
        onChangeSort: defaultFunction('actions.table.onChangeSort'),
        onRowExpanded: defaultFunction('actions.table.onRowExpanded'),
        onRowClicked: defaultFunction('actions.table.onRowClicked'),
        onApplyRowAction: defaultFunction('actions.table.onApplyRowAction'),
        onEmptyStateAction: null,
        onErrorStateAction: null,
        onChangeOrdering: defaultFunction('actions.table.onChangeOrdering'),
        onColumnSelectionConfig: defaultFunction('actions.table.onColumnSelectionConfig'),
        onColumnResize: defaultFunction('actions.table.onColumnResize'),
        onOverflowItemClicked: defaultFunction('actions.table.onOverflowItemClicked'),
        onSaveMultiSortColumns: defaultFunction('actions.table.onSaveMultiSortColumns'),
        onCancelMultiSortColumns: defaultFunction('actions.table.onCancelMultiSortColumns'),
        onAddMultiSortColumn: defaultFunction('actions.table.onAddMultiSortColumn'),
        onRemoveMultiSortColumn: defaultFunction('actions.table.onRemoveMultiSortColumn'),
        onFilterRowIconClick: defaultFunction('actions.table.onFilterRowIconClick')
      },
      onUserViewModified: null
    },
    locale: null,
    i18n: {
      /** pagination */
      pageBackwardAria: 'Previous page',
      pageForwardAria: 'Next page',
      pageNumberAria: 'Page Number',
      itemsPerPage: 'Items per page:',
      itemsRangeWithTotal: function itemsRangeWithTotal(min, max, total) {
        return "".concat(min, "\u2013").concat(max, " of ").concat(total, " items");
      },
      pageRange: function pageRange(current, total) {
        return "of ".concat(total, " pages");
      },
      /** table body */
      overflowMenuAria: 'More actions',
      clickToExpandAria: 'Click to expand content',
      clickToCollapseAria: 'Click to collapse content',
      selectAllAria: 'Select all items',
      selectRowAria: 'Select row',
      /** toolbar */
      clearAllFilters: 'Clear all filters',
      columnSelectionButtonAria: 'Column Selection',
      columnSelectionConfig: 'Manage Columns',
      filterButtonAria: 'Filters',
      editButtonAria: 'Edit rows',
      searchLabel: 'Search',
      searchPlaceholder: 'Search',
      clearFilterAria: 'Clear filter',
      filterAria: 'Filter',
      openMenuAria: 'Open menu',
      closeMenuAria: 'Close menu',
      clearSelectionAria: 'Clear selection',
      batchCancel: 'Clear selections',
      itemsSelected: function itemsSelected(selectedCount) {
        return "".concat(selectedCount, " items selected");
      },
      itemSelected: function itemSelected(selectedCount) {
        return "".concat(selectedCount, " item selected");
      },
      rowCountInHeader: function rowCountInHeader(totalRowCount) {
        return "Results: ".concat(totalRowCount);
      },
      toggleAggregations: 'Toggle aggregations',
      toolbarLabelAria: undefined,
      /** empty state */
      emptyMessage: 'There is no data',
      emptyMessageBody: '',
      emptyMessageWithFilters: 'No results match the current filters',
      emptyMessageWithFiltersBody: 'Try another search or use column filter criteria',
      emptyButtonLabel: 'Create some data',
      downloadIconDescription: 'Download table content',
      filterNone: 'Unsort rows by this header',
      filterAscending: 'Sort rows by this header in ascending order',
      filterDescending: 'Sort rows by this header in descending order',
      multiSortModalTitle: 'Select columns to sort',
      multiSortModalPrimaryLabel: 'Sort',
      multiSortModalSecondaryLabel: 'Cancel',
      multiSortModalClearLabel: 'Clear sorting',
      multiSortSelectColumnLabel: 'Select a column',
      multiSortSelectColumnSortByTitle: 'Sort by',
      multiSortSelectColumnThenByTitle: 'Then by',
      multiSortDirectionLabel: 'Select a direction',
      multiSortDirectionTitle: 'Sort order',
      multiSortAddColumn: 'Add column',
      multiSortRemoveColumn: 'Remove column',
      multiSortAscending: 'Ascending',
      multiSortDescending: 'Descending',
      multiSortOverflowItem: 'Multi-sort',
      multiSortDragHandle: 'Drag handle',
      dragHandleTooltip: 'Click and drag to new location',
      // table error state
      tableErrorStateTitle: 'Unable to load the page',
      buttonLabelOnTableError: 'Refresh the page',
      /* table load more */
      loadMoreText: 'Load more...',
      learnMoreText: 'Learn more',
      inProgressText: 'In progress',
      dismissText: 'Dismiss',
      actionFailedText: 'Action failed',
      toolbarTooltipLabel: 'Toolbar tooltip',
      filterRowIconDescription: 'Edit filters',
      batchActionsOverflowMenuText: '',
      filterTagsOverflowMenuText: '+{n}',
      toolbarSearchIconDescription: 'Search'
    },
    error: null,
    // TODO: set default in v3. Leaving null for backwards compat. to match 'id' which was
    // previously used as testId.
    testId: null,
    enablePercentageColumnWidth: false,
    emptyStateIcon: '',
    deletedAttribute: undefined
  };
};
var Table = function Table(props) {
  var _view$toolbar, _view$toolbar$search$, _view$toolbar2, _view$toolbar$search$2, _view$toolbar3;
  var _merge2 = _merge({}, defaultProps(props), props),
    id = _merge2.id,
    columns = _merge2.columns,
    enablePercentageColumnWidth = _merge2.enablePercentageColumnWidth,
    columnGroups = _merge2.columnGroups,
    data = _merge2.data,
    expandedData = _merge2.expandedData,
    locale = _merge2.locale,
    view = _merge2.view,
    onUserViewModified = _merge2.actions.onUserViewModified,
    actions = _merge2.actions,
    options = _merge2.options,
    lightweight = _merge2.lightweight,
    className = _merge2.className,
    style = _merge2.style,
    i18n = _merge2.i18n,
    secondaryTitle = _merge2.secondaryTitle,
    tooltip = _merge2.tooltip,
    error = _merge2.error,
    testId = _merge2.testId,
    size = _merge2.size,
    zIndex = _merge2.zIndex,
    emptyStateIcon = _merge2.emptyStateIcon,
    deletedAttribute = _merge2.deletedAttribute,
    others = _objectWithoutProperties(_merge2, _excluded);

  // There is no way to access the current search value in the Table
  // so we need to track that for the save view functionality.
  var searchValue = useRef(view === null || view === void 0 || (_view$toolbar = view.toolbar) === null || _view$toolbar === void 0 || (_view$toolbar = _view$toolbar.search) === null || _view$toolbar === void 0 ? void 0 : _view$toolbar.defaultValue);
  var initialRendering = useRef(true);

  // The save/load view functionality needs access to the latest view configuration
  // and also needs to know when the configuration has changed for the StatefulTable.
  // This effect satisfies both those needs.
  useDeepCompareEffect(function () {
    if (options.hasUserViewManagement && onUserViewModified) {
      if (!initialRendering.current) {
        onUserViewModified({
          view: view,
          columns: columns,
          state: {
            currentSearchValue: searchValue.current === undefined ? '' : searchValue.current
          }
        });
      } else {
        initialRendering.current = false;
      }
    }
  }, [
  // Props of type React.Element or React.Node must not be included in
  // useDeepCompareEffect dependency arrays, their object signature is
  // massive and will throw out of memory errors if compared.
  // https://github.com/kentcdodds/use-deep-compare-effect/issues/7
  // https://twitter.com/dan_abramov/status/1104415855612432384
  view.pagination, view.filters, view.toolbar.activeBar,
  // Remove the icon as it's a React.Element which can not be compared
  view.toolbar.batchActions.map(function (action) {
    action.renderIcon;
      var nonElements = _objectWithoutProperties(action, _excluded2);
    return nonElements;
  }), view.toolbar.initialDefaultSearch, view.toolbar.search, view.toolbar.isDisabled, view.table.isSelectAllSelected, view.table.isSelectAllIndeterminate, view.table.selectedIds, view.table.loadingMoreIds, view.table.sort, view.table.ordering,
  // Remove the error as it's a React.Element/Node which can not be compared
  view.table.rowActions.map(function (action) {
    action.error;
      var nonElements = _objectWithoutProperties(action, _excluded3);
    return nonElements;
  }), view.table.expandedIds, view.table.loadingState, view.table.filteredData, columns, searchValue === null || searchValue === void 0 ? void 0 : searchValue.current]);
  var _view$pagination = view.pagination,
    maxPages = _view$pagination.maxPages,
    paginationProps = _objectWithoutProperties(_view$pagination, _excluded4);
  var langDir = useLangDirection();
  var hasMultiSelect = options.hasRowSelection === 'multi';
  var hasSingleSelect = options.hasRowSelection === 'single';
  var _useState = useState(function () {
      return uniqueId('table-');
    }),
    _useState2 = _slicedToArray(_useState, 1),
    tableId = _useState2[0];
  var _useState3 = useState(0),
    _useState4 = _slicedToArray(_useState3, 2),
    forceUpdateCellTextWidth = _useState4[1];
  var useCellTextTruncate = useMemo(function () {
    return options ? options.wrapCellText === 'alwaysTruncate' || options.wrapCellText !== 'always' && options.wrapCellText !== 'expand' && (options.hasResize && !options.useAutoTableLayoutForResize || columns.some(function (col) {
      return col.hasOwnProperty('width');
    })) : undefined;
  }, [options, columns]);
  var handleClearFilters = function handleClearFilters() {
    if (actions.toolbar && actions.toolbar.onClearAllFilters) {
      actions.toolbar.onClearAllFilters();
    }
    if (actions.toolbar && actions.toolbar.onApplySearch) {
      actions.toolbar.onApplySearch('');
    }
    if (searchValue.current) {
      searchValue.current = '';
    }
  };
  var handleOnColumnResize = function handleOnColumnResize(resizedCols) {
    if (actions.table && actions.table.onColumnResize) {
      actions.table.onColumnResize(resizedCols);
    }
    forceUpdateCellTextWidth(function (n) {
      return !n;
    });
  };
  var minItemInView = options.hasPagination && !options.hasOnlyPageData && view.pagination ? (view.pagination.page - 1) * view.pagination.pageSize : 0;
  var maxItemInView = options.hasPagination && !options.hasOnlyPageData && view.pagination ? view.pagination.page * view.pagination.pageSize : data.length;
  var visibleData = data.slice(minItemInView, maxItemInView);
  var visibleColumns = columns.filter(function (c) {
    return !(view.table.ordering.find(function (o) {
      return o.columnId === c.id;
    }) || {
      isHidden: false
    }).isHidden;
  });
  var aggregationsProp = view.aggregations;
  var getColumnNumbers = function getColumnNumbers(tableData, columnId) {
    return tableData.map(function (row) {
      return row.values[columnId];
    }).filter(function (value) {
      return Number.isFinite(value);
    });
  };

  /**
   * All of this was written incorrectly the first time, and needs to be removed in v3. However,
   * to maintain backwards compatibility for a minor release the state management is left in
   * the Table here, and a useEffect is added. If the onToggleAggregations callback is not supplied
   * by the consumer we manage the aggregations state here in the table, but if it is provided,
   * we push the management of the aggregations.isHidden prop to the consumer to manage. Once
   * we move to v3. The useState, useCallback, and useEffects can all be removed and just call
   * the onToggleAggregations from the actions.toolbar prop.
   */
  var _useState5 = useState(!options.hasAggregations),
    _useState6 = _slicedToArray(_useState5, 2),
    hideAggregations = _useState6[0],
    setHideAggregations = _useState6[1];
  var statefulOnToggleAggregations = useCallback(function () {
    return setHideAggregations(function (prev) {
      return !prev;
    });
  }, [setHideAggregations]);
  useEffect(function () {
    if (!actions.toolbar.onToggleAggregations) {
      setHideAggregations(!options.hasAggregations);
    }
  }, [actions.toolbar.onToggleAggregations, options.hasAggregations]);
  var onToggleAggregations = actions.toolbar.onToggleAggregations ? actions.toolbar.onToggleAggregations : statefulOnToggleAggregations;
  var aggregationsAreHidden = (aggregationsProp === null || aggregationsProp === void 0 ? void 0 : aggregationsProp.isHidden) !== undefined ? aggregationsProp.isHidden : hideAggregations;
  var aggregations = useMemo(function () {
    return options.hasAggregations && aggregationsProp.columns ? {
      label: aggregationsProp.label,
      columns: aggregationsProp.columns.map(function (col) {
        var aggregatedValue;
        var isFunction = typeof col.value === 'function';
        var calculateValue = isFunction || col.value === undefined;
        if (calculateValue) {
          var numbers = getColumnNumbers(data, col.id);
          aggregatedValue = isFunction ? col.value(numbers) : numbers.reduce(function (total, num) {
            return total + num;
          }, 0);
        }
        return calculateValue ? _objectSpread(_objectSpread({}, col), {}, {
          value: aggregatedValue.toString()
        }) : col;
      }),
      isHidden: aggregationsAreHidden
    } : undefined;
  }, [options.hasAggregations, aggregationsProp.columns, aggregationsProp.label, aggregationsAreHidden, data]);
  var showExpanderColumn = useShowExpanderColumn({
    hasResize: options.hasResize,
    useAutoTableLayoutForResize: options.useAutoTableLayoutForResize,
    ordering: view.table.ordering,
    columns: columns
  });

  // Checks if any selected rows are not draggable. If not, disables drag and drop, which hides all
  // the drag handles. This is so we don't try to drag a selection that include an undraggable row.
  var hideDragHandles = useMemo(function () {
    if (!options.hasDragAndDrop) return true;
    if (view.table.selectedIds.length === 0) return false;
    var selectedSet = new Set(view.table.selectedIds);
    var areAnySelectedUndraggable = data.some(function (row) {
      return selectedSet.has(row.id) && !row.isDraggable;
    });
    return areAnySelectedUndraggable;
  }, [options.hasDragAndDrop, view.table.selectedIds, data]);
  var totalColumns = visibleColumns.length + (hasMultiSelect ? 1 : 0) + (hasSingleSelect ? 1 : 0) + (options.hasRowExpansion || options.hasRowNesting ? 1 : 0) + (options.hasRowActions ? 1 : 0) + (showExpanderColumn ? 1 : 0) + (options.hasDragAndDrop ? 1 : 0);
  var isFiltered = view.filters.length > 0 || view.selectedAdvancedFilterIds.length || ((_view$toolbar$search$ = view === null || view === void 0 || (_view$toolbar2 = view.toolbar) === null || _view$toolbar2 === void 0 || (_view$toolbar2 = _view$toolbar2.search) === null || _view$toolbar2 === void 0 ? void 0 : _view$toolbar2.value) !== null && _view$toolbar$search$ !== void 0 ? _view$toolbar$search$ : '') !== '' || ((_view$toolbar$search$2 = view === null || view === void 0 || (_view$toolbar3 = view.toolbar) === null || _view$toolbar3 === void 0 || (_view$toolbar3 = _view$toolbar3.search) === null || _view$toolbar3 === void 0 ? void 0 : _view$toolbar3.defaultValue) !== null && _view$toolbar$search$2 !== void 0 ? _view$toolbar$search$2 : '') !== '';
  var rowEditMode = view.toolbar.activeBar === 'rowEdit';
  var singleRowEditMode = !!view.table.rowActions.find(function (action) {
    return action.isEditMode;
  });
  var allRowsAreSelected = view.table.selectedIds.length === visibleData.length;
  var someRowsAreSelected = view.table.selectedIds.length > 0 && !allRowsAreSelected;
  var noSelectAllProp = view.table.isSelectAllSelected === undefined;
  var isSelectAllSelected = noSelectAllProp ? allRowsAreSelected : view.table.isSelectAllSelected;
  var noIndeterminateProp = view.table.isSelectAllIndeterminate === undefined;
  var isSelectAllIndeterminate = noIndeterminateProp && noSelectAllProp ? someRowsAreSelected : view.table.isSelectAllIndeterminate;
  var minHeaderSizeIsLarge = visibleColumns.some(function (col) {
    return col.isSortable;
  });
  if (columnGroups.length && options.hasColumnSelection) {
    warning(false, 'Column grouping (columnGroups) cannot be combined with the option hasColumnSelection:true') ;
  }
  var multiSortColumns = useMemo(function () {
    var _view$table$multiSort;
    var arrayifiedSort = Array.isArray(view.table.sort) ? view.table.sort : view.table.sort !== undefined ? [view.table.sort] : [];
    var anticipatedColumn = (_view$table$multiSort = view.table.multiSortModal) === null || _view$table$multiSort === void 0 ? void 0 : _view$table$multiSort.anticipatedColumn;
    if (anticipatedColumn) {
      var columnNotSortedYet = arrayifiedSort.every(function (sort) {
        return sort.columnId !== anticipatedColumn.columnId;
      });
      if (columnNotSortedYet) {
        return [].concat(_toConsumableArray(arrayifiedSort), [anticipatedColumn]);
      }
    }
    return arrayifiedSort;
  }, [view.table.multiSortModal, view.table.sort]);
  return /*#__PURE__*/React__default.createElement(TableContainer, {
    style: style,
    "data-testid": "".concat(id || testId, "-table-container"),
    className: classnames(className, "".concat(iotPrefix, "--table-container"), _defineProperty({}, "".concat(iotPrefix, "--table-container--pin-header-and-footer"), options.pinHeaderAndFooter))
  }, /* If there is no items being rendered in the toolbar, don't render the toolbar */
  options.hasAggregations || options.hasFilter || options.hasAdvancedFilter || options.hasSearch || hasMultiSelect && view.table.selectedIds.length > 0 || options.hasRowCountInHeader || options.hasColumnSelection || options.hasRowEdit || actions.toolbar.onDownloadCSV || secondaryTitle || view.toolbar.customToolbarContent || tooltip ? /*#__PURE__*/React__default.createElement(TableToolbar, {
    tableId: id || tableId,
    secondaryTitle: secondaryTitle,
    tooltip: tooltip,
    i18n: {
      clearAllFilters: i18n.clearAllFilters,
      columnSelectionButtonAria: i18n.columnSelectionButtonAria,
      filterButtonAria: i18n.filterButtonAria,
      editButtonAria: i18n.editButtonAria,
      searchLabel: i18n.searchLabel,
      searchPlaceholder: i18n.searchPlaceholder,
      batchCancel: i18n.batchCancel,
      itemsSelected: i18n.itemsSelected,
      itemSelected: i18n.itemSelected,
      filterNone: i18n.filterNone,
      filterAscending: i18n.filterAscending,
      filterDescending: i18n.filterDescending,
      downloadIconDescription: i18n.downloadIconDescription,
      rowCountInHeader: i18n.rowCountInHeader,
      toggleAggregations: i18n.toggleAggregations,
      toolbarLabelAria: i18n.toolbarLabelAria,
      toolbarTooltipLabel: i18n.toolbarTooltipLabel,
      batchActionsOverflowMenuText: i18n.batchActionsOverflowMenuText,
      toolbarSearchIconDescription: i18n.toolbarSearchIconDescription
    },
    actions: _objectSpread(_objectSpread({}, _pick(actions.toolbar, 'onCancelBatchAction', 'onApplyBatchAction', 'onClearAllFilters', 'onToggleColumnSelection', 'onToggleFilter', 'onShowRowEdit', 'onDownloadCSV', 'onApplyFilter', 'onApplyAdvancedFilter', 'onCancelAdvancedFilter', 'onCreateAdvancedFilter', 'onChangeAdvancedFilter', 'onRemoveAdvancedFilter', 'onToggleAdvancedFilter', 'onApplyToolbarAction', 'onSearchExpand')), {}, {
      onToggleAggregations: onToggleAggregations,
      onApplySearch: function onApplySearch(value) {
        var _actions$toolbar;
        searchValue.current = value;
        if ((_actions$toolbar = actions.toolbar) !== null && _actions$toolbar !== void 0 && _actions$toolbar.onApplySearch) {
          actions.toolbar.onApplySearch(value);
        }
      }
    }),
    options: _objectSpread(_objectSpread({}, _pick(options, 'hasAggregations', 'hasColumnSelection', 'hasFastSearch', 'hasSearch', 'hasRowSelection', 'hasRowCountInHeader', 'hasRowEdit', 'hasUserViewManagement', 'hasBatchActionToolbar')), {}, {
      hasFilter: Boolean(options === null || options === void 0 ? void 0 : options.hasFilter),
      hasAdvancedFilter: Boolean(options === null || options === void 0 ? void 0 : options.hasAdvancedFilter)
    }),
    tableState: _objectSpread(_objectSpread(_objectSpread({
      totalSelected: view.table.selectedIds.length,
      totalFilters: (view.filters ? view.filters.length : 0) + (view.selectedAdvancedFilterIds.length ? view.selectedAdvancedFilterIds.length : 0),
      totalItemsCount: view.pagination.totalItems,
      isDisabled: singleRowEditMode || view.toolbar.isDisabled,
      ordering: view.table.ordering,
      columns: columns
    }, _pick(view, 'filters', 'advancedFilters', 'selectedAdvancedFilterIds')), _pick(view.toolbar, 'batchActions', 'search', 'activeBar', 'customToolbarContent', 'rowEditBarButtons', 'advancedFilterFlyoutOpen', 'toolbarActions')), {}, {
      hideClearAllFiltersButton: view.toolbar.hideClearAllFiltersButton
    }),
    data: data
    // TODO: remove id in V3.
    ,
    testId: "".concat(id || testId, "-table-toolbar")
  }) : null, view.selectedAdvancedFilterIds.length ? /*#__PURE__*/React__default.createElement("section", {
    className: "".concat(iotPrefix, "--table__advanced-filters-container")
  }, /*#__PURE__*/React__default.createElement(FilterTags
  // TODO: remove id in V3.
  , {
    testId: "".concat(id || testId, "-filter-tags"),
    i18n: {
      filterTagsOverflowMenuText: i18n.filterTagsOverflowMenuText
    }
  }, view.advancedFilters.filter(function (advFilter) {
    return view.selectedAdvancedFilterIds.includes(advFilter.filterId);
  }).map(function (advancedFilter) {
    return /*#__PURE__*/React__default.createElement(Tag, {
      key: advancedFilter.filterId,
      filter: true,
      title: i18n.clearFilterAria,
      onClose: function onClose(e) {
        var _actions$toolbar2;
        if (typeof (actions === null || actions === void 0 || (_actions$toolbar2 = actions.toolbar) === null || _actions$toolbar2 === void 0 ? void 0 : _actions$toolbar2.onRemoveAdvancedFilter) === 'function') {
          actions.toolbar.onRemoveAdvancedFilter(e, advancedFilter.filterId);
        }
      }
      // TODO: remove id in V3.
      ,
      "data-testid": "".concat(id || testId, "-filter-tag-").concat(advancedFilter.filterId),
      type: "blue"
    }, advancedFilter.filterTitleText);
  }))) : null, /*#__PURE__*/React__default.createElement("div", {
    className: classnames('addons-iot-table-container', _defineProperty({}, "".concat(iotPrefix, "-table-container--dropdown-height-fix"), options.hasFilter))
  }, /*#__PURE__*/React__default.createElement(Table$2, _extends({
    id: id
    // TODO: remove id in v3
    ,
    "data-testid": id || testId,
    className: classnames(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(iotPrefix, "--data-table--column-groups"), columnGroups.length), "".concat(iotPrefix, "--data-table--column-groups--min-size-large"), columnGroups.length && minHeaderSizeIsLarge), "".concat(iotPrefix, "--data-table--resize"), options.hasResize), "".concat(iotPrefix, "--data-table--fixed"), options.hasResize && !options.useAutoTableLayoutForResize), "".concat(iotPrefix, "--data-table--row-actions"), options.hasRowActions)),
    size: size
  }, others), columns.length ? /*#__PURE__*/React__default.createElement(TableHead, _extends({
    size: size
  }, others, {
    i18n: i18n,
    lightweight: lightweight,
    options: _objectSpread(_objectSpread({}, _pick(options, 'hasAggregations', 'hasColumnSelectionConfig', 'hasResize', 'hasRowActions', 'hasRowNesting', 'hasSingleRowEdit', 'hasRowSelection', 'useRadioButtonSingleSelect', 'useAutoTableLayoutForResize', 'hasMultiSort', 'preserveColumnWidths', 'hasFilterRowIcon', 'pinColumn', 'hasDragAndDrop', 'pinHeaderAndFooter')), {}, {
      hasRowExpansion: !!options.hasRowExpansion,
      wrapCellText: options.wrapCellText,
      truncateCellText: useCellTextTruncate
    }),
    columns: columns,
    enablePercentageColumnWidth: enablePercentageColumnWidth,
    columnGroups: columnGroups,
    filters: view.filters,
    actions: _objectSpread(_objectSpread(_objectSpread({}, _pick(actions.toolbar, 'onApplyFilter')), _pick(actions.table, 'onSelectAll', 'onChangeSort', 'onChangeOrdering', 'onColumnSelectionConfig', 'onOverflowItemClicked', 'onFilterRowIconClick')), {}, {
      onColumnResize: handleOnColumnResize
    }),
    selectAllText: i18n.selectAllAria,
    clearFilterText: i18n.clearFilterAria,
    filterText: i18n.filterAria,
    clearSelectionText: i18n.clearSelectionAria,
    openMenuText: i18n.openMenuAria,
    closeMenuText: i18n.closeMenuAria,
    tableId: id || tableId,
    tableState: _objectSpread(_objectSpread({
      isDisabled: rowEditMode || singleRowEditMode,
      activeBar: view.toolbar.activeBar,
      filters: view.filters
    }, view.table), {}, {
      selection: {
        isSelectAllSelected: isSelectAllSelected,
        isSelectAllIndeterminate: isSelectAllIndeterminate
      }
    }),
    hasFastFilter: (options === null || options === void 0 ? void 0 : options.hasFilter) === 'onKeyPress'
    // TODO: remove id in v3
    ,
    testId: "".concat(id || testId, "-table-head"),
    showExpanderColumn: showExpanderColumn,
    filterRowIcon: view.table.filterRowIcon,
    filterRowIconDescription: i18n.filterRowIconDescription
  })) : null,
  // Table contents
  view.table.loadingState.isLoading ? /*#__PURE__*/React__default.createElement(TableSkeletonWithHeaders, _extends({
    columns: visibleColumns
  }, _pick(options, 'hasRowSelection', 'hasRowActions'), {
    hasRowExpansion: !!options.hasRowExpansion,
    hasRowNesting: !!options.hasRowNesting,
    hasDragAndDrop: !!options.hasDragAndDrop,
    rowCount: view.table.loadingState.rowCount,
    columnCount: view.table.loadingState.columnCount
    // TODO: remove 'id' in v3.
    ,
    testId: "".concat(id || testId, "-table-skeleton"),
    showExpanderColumn: showExpanderColumn
  })) : error ? /*#__PURE__*/React__default.createElement(ErrorTable, {
    id: id,
    testId: "".concat(id || testId, "-table-error-body"),
    i18n: i18n,
    totalColumns: totalColumns,
    error: error,
    errorState: view.table.errorState,
    onErrorStateAction: actions.table.onErrorStateAction
  }) : visibleData && visibleData.length ? /*#__PURE__*/React__default.createElement(TableBody, _extends({
    langDir: langDir,
    tableId: id || tableId,
    rows: visibleData,
    locale: locale,
    rowActionsState: view.table.rowActions,
    singleRowEditButtons: view.table.singleRowEditButtons,
    expandedRows: expandedData,
    columns: visibleColumns,
    expandedIds: view.table.expandedIds,
    selectedIds: view.table.selectedIds,
    loadingMoreIds: view.table.loadingMoreIds,
    zIndex: zIndex
  }, _pick(i18n, 'overflowMenuAria', 'clickToExpandAria', 'clickToCollapseAria', 'inProgressText', 'actionFailedText', 'learnMoreText', 'dismissText', 'selectRowAria', 'loadMoreText', 'dragHandleTooltip'), {
    totalColumns: totalColumns
  }, _pick(options, 'hasRowSelection', 'hasRowActions', 'hasRowNesting', 'shouldExpandOnRowClick', 'shouldLazyRender', 'preserveCellWhiteSpace', 'useRadioButtonSingleSelect', 'hasDragAndDrop', 'hasBreadcrumbDrop'), {
    hideDragHandles: hideDragHandles,
    hasRowExpansion: !!options.hasRowExpansion,
    wrapCellText: options.wrapCellText,
    truncateCellText: useCellTextTruncate,
    ordering: view.table.ordering,
    rowEditMode: rowEditMode,
    actions: _pick(actions.table, 'onRowSelected', 'onApplyRowAction', 'onClearRowError', 'onRowExpanded', 'onRowClicked', 'onRowLoadMore', 'onDrag', 'onDrop')
    // TODO: remove 'id' in v3.
    ,
    testId: "".concat(id || testId, "-table-body"),
    showExpanderColumn: showExpanderColumn,
    size: size,
    pinColumn: options.pinColumn,
    deletedAttribute: deletedAttribute
  })) : /*#__PURE__*/React__default.createElement(EmptyTable, {
    id: id,
    totalColumns: totalColumns,
    isFiltered: isFiltered,
    emptyStateIcon: emptyStateIcon,
    emptyState:
    // only show emptyState if no filters or search is applied
    view.table.emptyState && !isFiltered ? view.table.emptyState : {
      message: i18n.emptyMessage,
      messageBody: i18n.emptyMessageBody,
      messageWithFilters: i18n.emptyMessageWithFilters,
      messageWithFiltersBody: i18n.emptyMessageWithFiltersBody,
      buttonLabel: i18n.emptyButtonLabel,
      buttonLabelWithFilters: i18n.emptyButtonLabelWithFilters
    },
    onEmptyStateAction: isFiltered && i18n.emptyButtonLabelWithFilters ? handleClearFilters // show clear filters
    : !isFiltered && actions.table.onEmptyStateAction ? actions.table.onEmptyStateAction : undefined // if not filtered then show normal empty state
    // TODO: remove 'id' in v3.
    ,
    testId: "".concat(id || testId, "-table-empty")
  }), options.hasAggregations && !aggregationsAreHidden ? /*#__PURE__*/React__default.createElement(TableFoot, {
    options: _objectSpread(_objectSpread({}, _pick(options, 'hasRowSelection', 'hasRowActions', 'hasRowNesting')), {}, {
      hasRowExpansion: !!options.hasRowExpansion
    }),
    tableState: {
      aggregations: aggregations,
      ordering: view.table.ordering
    },
    testId: "".concat(id || testId, "-table-foot"),
    showExpanderColumn: showExpanderColumn
  }) : null)), options.hasPagination && !view.table.loadingState.isLoading && visibleData !== null && visibleData !== void 0 && visibleData.length ?
  /*#__PURE__*/
  // don't show pagination row while loading
  // paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize) ? (
  //   <SimplePagination
  //     prevPageText={i18n.pageBackwardAria}
  //     nextPageText={i18n.pageForwardAria}
  //     totalItems={paginationProps.totalItems}
  //     page={paginationProps.page}
  //     maxPage={Math.ceil(paginationProps.totalItems / paginationProps.pageSize)}
  //     onPage={(page) =>
  //       actions.pagination.onChangePage({ page, pageSize: paginationProps.pageSize })
  //     }
  //     testId={`${id || testId}-table-pagination`}
  //     size={size}
  //   />
  // ) :
  React__default.createElement(Pagination, {
    pageSize: paginationProps.pageSize,
    pageSizes: paginationProps.pageSizes,
    page: paginationProps.page,
    isItemPerPageHidden: paginationProps.isItemPerPageHidden,
    totalItems: paginationProps.totalItems < Math.ceil(maxPages * paginationProps.pageSize) ? paginationProps.totalItems : Math.ceil(maxPages * paginationProps.pageSize),
    onChange: actions.pagination.onChangePage,
    backwardText: i18n.pageBackwardAria,
    forwardText: i18n.pageForwardAria,
    pageNumberText: i18n.pageNumberAria,
    itemsPerPageText: i18n.itemsPerPage,
    itemRangeText: i18n.itemsRangeWithTotal,
    pageRangeText: i18n.pageRange,
    preventInteraction: rowEditMode || singleRowEditMode,
    testId: "".concat(id || testId, "-table-pagination"),
    size: paginationProps.size,
    maxPagesConditionalStyle: paginationProps.totalItems > Math.ceil(maxPages * paginationProps.pageSize)
  }) : null, options.hasMultiSort && /*#__PURE__*/React__default.createElement(TableMultiSortModal, {
    testId: "".concat(id, "-multi-sort-modal"),
    columns: columns,
    ordering: view.table.ordering,
    sort: multiSortColumns,
    actions: _objectSpread({}, _pick(actions.table, 'onSaveMultiSortColumns', 'onCancelMultiSortColumns', 'onAddMultiSortColumn', 'onRemoveMultiSortColumn', 'onClearMultiSortColumns')),
    showMultiSortModal: view.table.showMultiSortModal,
    i18n: i18n
  }));
};
Table.propTypes = propTypes;
Table.defaultProps = defaultProps({});
Table.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "Table",
  "props": {
    "id": {
      "description": "DOM ID for component",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "secondaryTitle": {
      "description": "Displays smaller title in header",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltip": {
      "description": "",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "useZebraStyles": {
      "description": "render zebra stripes or not",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "lightweight": {
      "description": "lighter styling where regular table too visually heavy. Deprecated.",
      "type": {
        "name": "custom",
        "raw": "deprecate(\n  PropTypes.bool,\n  `The 'lightweight' prop has been deprecated and will be removed in the next major version.`\n)"
      },
      "required": false
    },
    "columns": {
      "description": "Specify the properties of each column in the table",
      "type": {
        "name": "custom",
        "raw": "TableColumnsPropTypes.isRequired"
      },
      "required": false
    },
    "columnGroups": {
      "description": "Specify the properties of each column group in the table. Defaults to empty array.",
      "type": {
        "name": "custom",
        "raw": "TableColumnGroupPropType"
      },
      "required": false
    },
    "data": {
      "description": "Row value data for the body of the table",
      "type": {
        "name": "custom",
        "raw": "TableRowsPropTypes.isRequired"
      },
      "required": false
    },
    "expandedData": {
      "description": "Expanded data for the table details",
      "type": {
        "name": "custom",
        "raw": "ExpandedRowsPropTypes"
      },
      "required": false
    },
    "zIndex": {
      "description": "Optional base z-index for the table. Used with drag and drop to ensure the drag image is \"over\"\nother elements on the page. This is generally only needed if the table is in a modal dialog\nwith z-index of its own. In that case, set this z-index to be higher than the modal to be sure\nany drags are seen above the modal.",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "stickyHeader": {
      "description": "Experimental: Turns on the carbon sticky-header feature.",
      "type": {
        "name": "custom",
        "raw": "experimental('stickyHeader')"
      },
      "required": false
    },
    "options": {
      "description": "Optional properties to customize how the table should be rendered",
      "type": {
        "name": "shape",
        "value": {
          "hasAggregations": {
            "name": "bool",
            "description": "If true allows the table to aggregate values of columns in a special row",
            "required": false
          },
          "hasFastSearch": {
            "name": "bool",
            "description": "If true, search is applied as typed. If false, only after 'Enter' is pressed",
            "required": false
          },
          "hasPagination": {
            "name": "bool",
            "required": false
          },
          "hasRowSelection": {
            "name": "enum",
            "value": [{
              "value": "'multi'",
              "computed": false
            }, {
              "value": "'single'",
              "computed": false
            }, {
              "value": "false",
              "computed": false
            }],
            "required": false
          },
          "hasBatchActionToolbar": {
            "name": "bool",
            "description": "@TODO: Remove in major release and just show action bar when no actions are defined",
            "required": false
          },
          "hasRowExpansion": {
            "name": "union",
            "value": [{
              "name": "bool"
            }, {
              "name": "shape",
              "value": {
                "expandRowsExclusively": {
                  "name": "bool",
                  "description": "True if any previously expanded rows should be collapsed when a new row is expanded",
                  "required": false
                }
              }
            }],
            "description": "True if the rows should be expandable",
            "required": false
          },
          "hasRowNesting": {
            "name": "union",
            "value": [{
              "name": "bool"
            }, {
              "name": "shape",
              "value": {
                "hasSingleNestedHierarchy": {
                  "name": "bool",
                  "description": "If the hierarchy only has 1 nested level of children",
                  "required": false
                }
              }
            }],
            "required": false
          },
          "hasMultiSort": {
            "name": "bool",
            "required": false
          },
          "hasRowActions": {
            "name": "bool",
            "required": false
          },
          "hasFilter": {
            "name": "union",
            "value": [{
              "name": "bool"
            }, {
              "name": "enum",
              "value": [{
                "value": "'onKeyPress'",
                "computed": false
              }, {
                "value": "'onEnterAndBlur'",
                "computed": false
              }]
            }],
            "required": false
          },
          "hasAdvancedFilter": {
            "name": "custom",
            "raw": "(props, propName, componentName) => {\n  if (__DEV__) {\n    if (props?.hasFilter && props?.hasAdvancedFilter) {\n      return new Error(\n        `Only one of props 'options.hasFilter' or 'options.hasAdvancedFilter' can be specified in '${componentName}'.`\n      );\n    }\n\n    if (![true, false, undefined].includes(props?.hasAdvancedFilter)) {\n      return new Error(`'options.hasAdvancedFilter' should be a boolean or undefined.`);\n    }\n  }\n}",
            "required": false
          },
          "hasOnlyPageData": {
            "name": "bool",
            "description": "if true, the data prop will be assumed to only represent the currently visible page",
            "required": false
          },
          "hasSearch": {
            "name": "bool",
            "description": "has simple search capability",
            "required": false
          },
          "hasColumnSelection": {
            "name": "bool",
            "required": false
          },
          "hasColumnSelectionConfig": {
            "name": "bool",
            "required": false
          },
          "shouldLazyRender": {
            "name": "bool",
            "required": false
          },
          "hasRowCountInHeader": {
            "name": "bool",
            "required": false
          },
          "hasRowEdit": {
            "name": "bool",
            "description": "If true enables the row edit toolbar button and functionality",
            "required": false
          },
          "hasResize": {
            "name": "bool",
            "required": false
          },
          "hasSingleRowEdit": {
            "name": "bool",
            "required": false
          },
          "hasUserViewManagement": {
            "name": "bool",
            "required": false
          },
          "preserveColumnWidths": {
            "name": "bool",
            "description": "Preserves the widths of existing columns when one or more columns are added, removed, hidden, shown or resized.",
            "required": false
          },
          "shouldExpandOnRowClick": {
            "name": "bool",
            "required": false
          },
          "useAutoTableLayoutForResize": {
            "name": "bool",
            "description": "If true removes the \"table-layout: fixed\" for resizable tables",
            "required": false
          },
          "wrapCellText": {
            "name": "custom",
            "raw": "WrapCellTextPropTypes",
            "description": "auto - Wrap for tables with dynamic columns widths and truncate for tables with fixed or resizable columns\nalways - Wrap if needed for all table column configurations\nnever - Tables with dynamic columns widths grow larger and tables with fixed or resizable columns truncate.\nalwaysTruncate - Always truncate if needed for all table column configurations\nexpand - Expand to fit text width (by horizontal scrollbar) for table with fixed columns",
            "required": false
          },
          "preserveCellWhiteSpace": {
            "name": "bool",
            "description": "use white-space: pre; css when true",
            "required": false
          },
          "hasFilterRowIcon": {
            "name": "bool",
            "description": "display icon button in filter row",
            "required": false
          },
          "pinColumn": {
            "name": "custom",
            "raw": "PinColumnPropTypes",
            "description": "column to pin in the table",
            "required": false
          },
          "hasDragAndDrop": {
            "name": "bool",
            "description": "If rows can be dragged and dropped on top of each other. When this is true there will always\nbe space reserved for a drag handle at the start of the row. Each rows data must indicate if\nthat row can be dragged by setting `isDraggable: true` on their row data. The table also needs\n`actions.table.onDrag` and `actions.table.onDrop` callback props.",
            "required": false
          },
          "hasBreadcrumbDrop": {
            "name": "bool",
            "description": "Making this true in addition to hasDragAndDrop will consider breadcrumb nodes as drop targets",
            "required": false
          },
          "pinHeaderAndFooter": {
            "name": "bool",
            "description": "Freezes table header and footer",
            "required": false
          },
          "emptyStateIcon": {
            "name": "union",
            "value": [{
              "name": "func"
            }, {
              "name": "enum",
              "value": [{
                "value": "'error'",
                "computed": false
              }, {
                "value": "'error404'",
                "computed": false
              }, {
                "value": "'empty'",
                "computed": false
              }, {
                "value": "'not-authorized'",
                "computed": false
              }, {
                "value": "'no-result'",
                "computed": false
              }, {
                "value": "'success'",
                "computed": false
              }, {
                "value": "''",
                "computed": false
              }]
            }],
            "description": "display icon while Table data is empty",
            "required": false
          }
        }
      },
      "required": false
    },
    "size": {
      "description": "Size prop from Carbon to shrink row height (and header height in some instances)",
      "type": {
        "name": "custom",
        "raw": "function checkProps(props, propName, componentName) {\n  if (['compact', 'short', 'normal', 'tall'].includes(props[propName])) {\n    warning(\n      false,\n      `The value \\`${props[propName]}\\` has been deprecated for the ` +\n        `\\`${propName}\\` prop on the ${componentName} component. It will be removed in the next major ` +\n        `release. Please use 'xs', 'sm', 'md', 'lg', or 'xl' instead.`\n    );\n  }\n}"
      },
      "required": false
    },
    "view": {
      "description": "Initial state of the table, should be updated via a local state wrapper component implementation or via a central store/redux see StatefulTable component for an example",
      "type": {
        "name": "shape",
        "value": {
          "aggregations": {
            "name": "shape",
            "value": {
              "label": {
                "name": "string",
                "required": false
              },
              "columns": {
                "name": "arrayOf",
                "value": {
                  "name": "shape",
                  "value": {
                    "id": {
                      "name": "string",
                      "description": "id of the column that should have its values aggregated",
                      "required": true
                    },
                    "value": {
                      "name": "union",
                      "value": [{
                        "name": "func"
                      }, {
                        "name": "string"
                      }],
                      "description": "the primitive value or function that will receive an array of values and returns an aggregated value",
                      "required": false
                    },
                    "align": {
                      "name": "enum",
                      "value": [{
                        "value": "'start'",
                        "computed": false
                      }, {
                        "value": "'center'",
                        "computed": false
                      }, {
                        "value": "'end'",
                        "computed": false
                      }],
                      "description": "allow aligning the results the same as the column",
                      "required": false
                    },
                    "isSortable": {
                      "name": "bool",
                      "description": "allows the aggregation to align with sortable columns extra padding",
                      "required": false
                    }
                  }
                },
                "required": false
              },
              "isHidden": {
                "name": "bool",
                "description": "hide the aggregation row without removing the aggregations object",
                "required": false
              }
            },
            "required": false
          },
          "pagination": {
            "name": "shape",
            "value": {
              "pageSize": {
                "name": "number",
                "required": false
              },
              "pageSizes": {
                "name": "arrayOf",
                "value": {
                  "name": "number"
                },
                "required": false
              },
              "page": {
                "name": "number",
                "required": false
              },
              "totalItems": {
                "name": "number",
                "required": false
              },
              "maxPages": {
                "name": "custom",
                "raw": "(props, propName, componentName) => {\n  if (__DEV__) {\n    if (typeof props[propName] !== 'number') {\n      return new Error(\n        `Invalid type of \\`${propName}\\` supplied to \\`${componentName}\\`. \\`${propName}\\` must be a positive integer.`\n      );\n    }\n    if (props[propName] < 0 || !Number.isInteger(props[propName])) {\n      const roundedStr = `${props[propName]} will be rounded to ${Math.ceil(\n        props[propName]\n      )}`;\n      return new Error(\n        `Invalid prop \\`${propName}\\` supplied to \\`${componentName}\\`. \\`${propName}\\` must be a positive integer. ${roundedStr}.`\n      );\n    }\n  }\n\n  return '';\n}",
                "description": "Number of pages rendered in pagination",
                "required": false
              },
              "isItemPerPageHidden": {
                "name": "bool",
                "required": false
              },
              "size": {
                "name": "enum",
                "value": [{
                  "value": "'sm'",
                  "computed": false
                }, {
                  "value": "'md'",
                  "computed": false
                }, {
                  "value": "'lg'",
                  "computed": false
                }],
                "description": "Specify the size of the Pagination buttons. Currently supports either `sm`, 'md' (default) or 'lg` as an option.",
                "required": false
              }
            },
            "required": false
          },
          "filters": {
            "name": "custom",
            "raw": "TableFiltersPropType",
            "required": false
          },
          "advancedFilters": {
            "name": "arrayOf",
            "value": {
              "name": "shape",
              "value": {
                "filterId": {
                  "name": "string",
                  "description": "Unique id for particular filter",
                  "required": true
                },
                "filterTitleText": {
                  "name": "string",
                  "description": "Text for main title of page",
                  "required": true
                },
                "filterRules": {
                  "name": "custom",
                  "raw": "RuleGroupPropType.isRequired",
                  "required": true
                }
              }
            },
            "description": "a stripped down version of the RuleBuilderFilterPropType",
            "required": false
          },
          "selectedAdvancedFilterIds": {
            "name": "arrayOf",
            "value": {
              "name": "string"
            },
            "required": false
          },
          "toolbar": {
            "name": "shape",
            "value": {
              "activeBar": {
                "name": "custom",
                "raw": "ActiveTableToolbarPropType",
                "description": "Specify which header row to display, will display default header row if null",
                "required": false
              },
              "customToolbarContent": {
                "name": "node",
                "description": "optional content to render inside the toolbar",
                "required": false
              },
              "batchActions": {
                "name": "arrayOf",
                "value": {
                  "name": "shape",
                  "value": {
                    "id": {
                      "name": "string",
                      "required": true
                    },
                    "labelText": {
                      "name": "string",
                      "required": true
                    },
                    "icon": {
                      "name": "element",
                      "required": false
                    },
                    "iconDescription": {
                      "name": "string",
                      "required": false
                    }
                  }
                },
                "description": "Specify which batch actions to render in the batch action bar. If empty, no batch action toolbar will display",
                "required": false
              },
              "search": {
                "name": "custom",
                "raw": "TableSearchPropTypes",
                "description": "Simple search state",
                "required": false
              },
              "isDisabled": {
                "name": "bool",
                "description": "is the toolbar currently disabled",
                "required": false
              },
              "rowEditBarButtons": {
                "name": "node",
                "description": "buttons to be shown with when activeBar is 'rowEdit'",
                "required": false
              },
              "toolbarActions": {
                "name": "custom",
                "raw": "TableToolbarActionsPropType",
                "description": "extra actions that can appear in an overflow menu in the toolbar (same menu as toggle aggregations)",
                "required": false
              },
              "hideClearAllFiltersButton": {
                "name": "bool",
                "description": "force hide Clear all filters button in toolbar",
                "required": false
              }
            },
            "required": false
          },
          "table": {
            "name": "shape",
            "value": {
              "isSelectAllSelected": {
                "name": "bool",
                "required": false
              },
              "isSelectAllIndeterminate": {
                "name": "bool",
                "required": false
              },
              "selectedIds": {
                "name": "arrayOf",
                "value": {
                  "name": "string"
                },
                "required": false
              },
              "sort": {
                "name": "union",
                "value": [{
                  "name": "custom",
                  "raw": "TableSortPropType"
                }, {
                  "name": "arrayOf",
                  "value": {
                    "name": "custom",
                    "raw": "TableSortPropType"
                  }
                }],
                "required": false
              },
              "ordering": {
                "name": "custom",
                "raw": "TableOrderingPropType",
                "description": "Specify the order, visibility and group belonging of the table columns",
                "required": false
              },
              "rowActions": {
                "name": "custom",
                "raw": "RowActionsStatePropTypes",
                "description": "what is the current state of the row actions",
                "required": false
              },
              "singleRowEditButtons": {
                "name": "element",
                "required": false
              },
              "expandedIds": {
                "name": "arrayOf",
                "value": {
                  "name": "string"
                },
                "required": false
              },
              "emptyState": {
                "name": "custom",
                "raw": "EmptyStatePropTypes",
                "required": false
              },
              "errorState": {
                "name": "element",
                "description": "use custom error state or use error message directly",
                "required": false
              },
              "loadingState": {
                "name": "shape",
                "value": {
                  "isLoading": {
                    "name": "bool",
                    "required": false
                  },
                  "rowCount": {
                    "name": "number",
                    "required": false
                  },
                  "columnCount": {
                    "name": "number",
                    "required": false
                  }
                },
                "required": false
              },
              "showMultiSortModal": {
                "name": "bool",
                "required": false
              },
              "multiSortModal": {
                "name": "shape",
                "value": {
                  "anticipatedColumn": {
                    "name": "shape",
                    "value": {
                      "columnId": {
                        "name": "string",
                        "required": false
                      },
                      "direction": {
                        "name": "enum",
                        "value": [{
                          "value": "'ASC'",
                          "computed": false
                        }, {
                          "value": "'DESC'",
                          "computed": false
                        }],
                        "required": false
                      }
                    },
                    "description": "The anticipatedColumn is used to add the most recently click columnId to the UI of the\nMultiSort modal. This gives the user a better experience by preemptively adding the column\nthey clicked multi-sort on to the multisort modal without changing state. They still have to\nclick \"Sort\" to save it, or can click 'Cancel' or the 'X' to clear it.",
                    "required": false
                  }
                },
                "required": false
              },
              "loadingMoreIds": {
                "name": "arrayOf",
                "value": {
                  "name": "string"
                },
                "description": "Array with rowIds that are with loading active",
                "required": false
              },
              "filterRowIcon": {
                "name": "union",
                "value": [{
                  "name": "func"
                }, {
                  "name": "object"
                }],
                "description": "icon element for filter row icon",
                "required": false
              }
            },
            "required": false
          }
        }
      },
      "required": false
    },
    "actions": {
      "description": "Callbacks for actions of the table, can be used to update state in wrapper component to update `view` props",
      "type": {
        "name": "shape",
        "value": {
          "pagination": {
            "name": "shape",
            "value": {
              "onChangePage": {
                "name": "func",
                "description": "Specify a callback for when the current page or page size is changed.\nThis callback is passed an object parameter containing the current page and the current page size",
                "required": false
              }
            },
            "required": false
          },
          "toolbar": {
            "name": "shape",
            "value": {
              "onApplyFilter": {
                "name": "func",
                "required": false
              },
              "onToggleFilter": {
                "name": "func",
                "required": false
              },
              "onShowRowEdit": {
                "name": "func",
                "required": false
              },
              "onToggleColumnSelection": {
                "name": "func",
                "required": false
              },
              "onClearAllFilters": {
                "name": "func",
                "description": "Specify a callback for when the user clicks toolbar button to clear all filters.\nReceives a parameter of the current filter values for each column",
                "required": false
              },
              "onCancelBatchAction": {
                "name": "func",
                "description": "Callback for when the automatcally generated Cancel action in the batch actions bar is clicked",
                "required": false
              },
              "onApplyBatchAction": {
                "name": "func",
                "description": "Callback for all the batch actions except the cancel. Is called with the id of the clicked action.\n For the StatefulTable the current selections are received as second parameter",
                "required": false
              },
              "onApplySearch": {
                "name": "func",
                "description": "Apply a search criteria to the table",
                "required": false
              },
              "onDownloadCSV": {
                "name": "func",
                "description": "Download the table contents",
                "required": false
              },
              "onApplyAdvancedFilter": {
                "name": "func",
                "description": "When advanced filters are applied",
                "required": false
              },
              "onToggleAdvancedFilter": {
                "name": "func",
                "description": "Toggles the advanced filter flyout open",
                "required": false
              },
              "onRemoveAdvancedFilter": {
                "name": "func",
                "description": "Remove the selected advancedFilter from the table",
                "required": false
              },
              "onCreateAdvancedFilter": {
                "name": "func",
                "description": "Fired the 'create new advanced filter' button is clicked.",
                "required": false
              },
              "onCancelAdvancedFilter": {
                "name": "func",
                "description": "Fired when then 'Cancel' button is clicked in the advanced filter flyout menu",
                "required": false
              },
              "onChangeAdvancedFilter": {
                "name": "func",
                "description": "Fired when an advanced filter is selected or removed.",
                "required": false
              },
              "onToggleAggregations": {
                "name": "func",
                "description": "fired when 'Toggle aggregations' is clicked in the overflow menu",
                "required": false
              },
              "onApplyToolbarAction": {
                "name": "func",
                "description": "fired when clicking a 'toolbarAction' in the table toolbar",
                "required": false
              },
              "onSearchExpand": {
                "name": "func",
                "description": "fired when focus/blur on search bar in the table toolbar",
                "required": false
              }
            },
            "required": false
          },
          "table": {
            "name": "shape",
            "value": {
              "onRowSelected": {
                "name": "func",
                "required": false
              },
              "onRowClicked": {
                "name": "func",
                "required": false
              },
              "onRowExpanded": {
                "name": "func",
                "required": false
              },
              "onSelectAll": {
                "name": "func",
                "required": false
              },
              "onChangeSort": {
                "name": "func",
                "required": false
              },
              "onApplyRowAction": {
                "name": "func",
                "description": "callback if a row action is clicked called with the id of the action then the id of the row if you\nreturn a promise from apply row action the stateful table will assume you're asynchronous and give a spinner",
                "required": false
              },
              "onClearRowError": {
                "name": "func",
                "required": false
              },
              "onEmptyStateAction": {
                "name": "func",
                "required": false
              },
              "onChangeOrdering": {
                "name": "func",
                "required": false
              },
              "onColumnSelectionConfig": {
                "name": "func",
                "required": false
              },
              "onColumnResize": {
                "name": "func",
                "required": false
              },
              "onOverflowItemClicked": {
                "name": "func",
                "required": false
              },
              "onSaveMultiSortColumns": {
                "name": "func",
                "required": false
              },
              "onCancelMultiSortColumns": {
                "name": "func",
                "required": false
              },
              "onClearMultiSortColumns": {
                "name": "func",
                "required": false
              },
              "onAddMultiSortColumn": {
                "name": "func",
                "required": false
              },
              "onRemoveMultiSortColumn": {
                "name": "func",
                "required": false
              },
              "onTableErrorStateAction": {
                "name": "func",
                "required": false
              },
              "onRowLoadMore": {
                "name": "func",
                "description": "call back function for when load more row is clicked  (rowId) => {}",
                "required": false
              },
              "onFilterRowIconClick": {
                "name": "func",
                "description": "call back function for when icon button in filter row is clicked  (evt) => {}",
                "required": false
              },
              "onDrag": {
                "name": "func",
                "description": "Required callback to support drag and drop. This gets the rows values being dragged. It\nmust return an object of the row IDs that can be dropped on, and a node use as the preview\nof what's being dragged (typically the name of the row, possibly with an icon).\n\n@type {(rows: object[]) => {dropIds: string[], preview: React.Node}}",
                "required": false
              },
              "onDrop": {
                "name": "func",
                "description": "Required callback to support drag and drop. This is called after a successful drop and is\npassed the ID of the row that was dragged and the ID of the row that was dropped on. It's\nup to the caller to decide what to do with that--the table does not update itself.\n\n@type {(dragRowIds: string[], dropRowId) => void}",
                "required": false
              }
            },
            "description": "table wide actions",
            "required": true
          },
          "onUserViewModified": {
            "name": "func",
            "description": "callback for actions relevant for view management",
            "required": false
          }
        }
      },
      "required": false
    },
    "locale": {
      "description": "what locale should we use to format table values if left empty no locale formatting happens",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "i18n": {
      "description": "",
      "type": {
        "name": "custom",
        "raw": "I18NPropTypes"
      },
      "required": false
    },
    "error": {
      "description": "Specify the error message that need to be displayed by default.\nIncase we use view.table.errorState property then the error state will be displayed instead of error message",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "testId": {
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "deletedAttribute": {
      "description": "Attribute name to identify deleted rows",
      "type": {
        "name": "string"
      },
      "required": false
    }
  }
};
var Table$1 = Table;

export { Table$1 as default, defaultProps };
