import _extends from '@babel/runtime/helpers/extends';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _omit from '../../node_modules/lodash-es/omit.js';
import 'core-js/modules/es.symbol.js';
import 'core-js/modules/es.symbol.description.js';
import 'core-js/modules/es.array.concat.js';
import 'core-js/modules/es.array.filter.js';
import 'core-js/modules/es.array.includes.js';
import 'core-js/modules/es.array.map.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.promise.js';
import 'core-js/modules/es.promise.finally.js';
import 'core-js/modules/es.string.includes.js';
import 'core-js/modules/web.dom-collections.for-each.js';
import React__default, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
import PropTypes from 'prop-types';
import warning from 'warning';
import { SvgPropType } from '../../constants/SharedPropTypes.js';
import DashboardHeader from './DashboardHeader.js';
import DashboardGrid, { DashboardGridPropTypes } from './DashboardGrid.js';
import CardRenderer from './CardRenderer.js';

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 propTypes = _objectSpread(_objectSpread({
  title: PropTypes.string,
  description: PropTypes.string,
  /** optional actions that will be rendered in the Dashboard header and used in onDashboardAction */
  actions: PropTypes.arrayOf(PropTypes.shape({
    /** Unique id of the action */
    id: PropTypes.string.isRequired,
    /** icon ultimately gets passed through all the way to <Button>, which has this same copied proptype definition for icon */
    icon: PropTypes.oneOfType([PropTypes.shape({
      width: PropTypes.string,
      height: PropTypes.string,
      viewBox: PropTypes.string.isRequired,
      svgData: SvgPropType.isRequired
    }), PropTypes.string, PropTypes.node]),
    labelText: PropTypes.string
  })),
  cards: PropTypes.arrayOf(PropTypes.shape({
    content: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
    values: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
    /** is the card actively loading, it will override the dashboard loading state if true */
    isLoading: PropTypes.bool,
    /** was there an error loading */
    error: PropTypes.node
  })).isRequired,
  /** Optional filter that should be rendered top right */
  filter: PropTypes.node,
  /** Optional sidebar content that should be rendered left of the dashboard cards */
  sidebar: PropTypes.node,
  /** If the header should render the last updated section */
  hasLastUpdated: PropTypes.bool,
  // Callback functions
  /** Callback called when a card should fetch its data, called with the card props and a boolean that determines whether a card supports timeseries data or not.  Return a promise that returns the updated card object with values.  It will be passed downstream to your card as props to update. */
  onFetchData: PropTypes.func,
  /** Optional Function that is called back if the card has a setup phase before data fetching */
  onSetupCard: PropTypes.func,
  /** Callback called when an action is clicked.  The id of the action is passed to the callback */
  onDashboardAction: PropTypes.func,
  /** Callback called when a card determines what icon render based on a named string in card config
   *    example usage: renderIconByName(name = 'my--checkmark--icon', props = { title: 'A checkmark', etc. })
   */
  renderIconByName: PropTypes.func,
  // Data related properties
  /** If the overall dashboard should be using a timeGrain, we pass it here */
  timeGrain: PropTypes.string,
  /** Property that will trigger all cards to load again */
  isLoading: PropTypes.bool,
  /** once all the cards have finished loading this will be called */
  setIsLoading: PropTypes.func,
  /** All the labels that need translation */
  i18n: PropTypes.shape({
    lastUpdatedLabel: PropTypes.string,
    noDataLabel: PropTypes.string,
    noDataShortLabel: PropTypes.string,
    errorLoadingDataLabel: PropTypes.string,
    errorLoadingDataShortLabel: PropTypes.string,
    // card labels
    rollingPeriodLabel: PropTypes.string,
    last24HoursLabel: PropTypes.string,
    last7DaysLabel: PropTypes.string,
    defaultLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
    lastMonthLabel: PropTypes.string,
    lastQuarterLabel: PropTypes.string,
    lastYearLabel: PropTypes.string,
    periodToDateLabel: PropTypes.string,
    thisWeekLabel: PropTypes.string,
    thisMonthLabel: PropTypes.string,
    thisQuarterLabel: PropTypes.string,
    thisYearLabel: PropTypes.string,
    hourlyLabel: PropTypes.string,
    dailyLabel: PropTypes.string,
    weeklyLabel: PropTypes.string,
    monthlyLabel: PropTypes.string,
    expandLabel: PropTypes.string,
    overflowMenuDescription: PropTypes.string,
    alertDetected: PropTypes.string,
    // card actions
    editCardLabel: PropTypes.string,
    cloneCardLabel: PropTypes.string,
    deleteCardLabel: PropTypes.string,
    selectTimeRangeLabel: PropTypes.string,
    // image card labels:
    zoomIn: PropTypes.string,
    zoomOut: PropTypes.string,
    zoomToFit: PropTypes.string,
    // labels for table card
    criticalLabel: PropTypes.string,
    moderateLabel: PropTypes.string,
    lowLabel: PropTypes.string,
    selectSeverityPlaceholder: PropTypes.string,
    severityLabel: PropTypes.string,
    defaultFilterStringPlaceholdText: PropTypes.string,
    downloadIconDescription: PropTypes.string,
    // table labels
    pageBackwardAria: PropTypes.string,
    pageForwardAria: PropTypes.string,
    pageNumberAria: PropTypes.string,
    itemsPerPage: PropTypes.string,
    currentPage: PropTypes.func,
    itemsRangeWithTotal: PropTypes.func,
    pageRange: PropTypes.func,
    /** table body */
    overflowMenuAria: PropTypes.string,
    clickToExpandAria: PropTypes.string,
    clickToCollapseAria: PropTypes.string,
    selectAllAria: PropTypes.string,
    selectRowAria: PropTypes.string,
    /** toolbar */
    clearAllFilters: PropTypes.string,
    columnSelectionButtonAria: PropTypes.string,
    clearFilterAria: PropTypes.string,
    filterAria: PropTypes.string,
    openMenuAria: PropTypes.string,
    closeMenuAria: PropTypes.string,
    clearSelectionAria: PropTypes.string,
    /** empty state */
    emptyMessage: PropTypes.string,
    emptyMessageWithFilters: PropTypes.string,
    emptyButtonLabelWithFilters: PropTypes.string,
    inProgressText: PropTypes.string,
    actionFailedText: PropTypes.string,
    learnMoreText: PropTypes.string,
    dismissText: PropTypes.string
  })
}, _omit(DashboardGridPropTypes, ['children', 'breakpoint'])), {}, {
  testId: PropTypes.string
});
var defaultProps = {
  title: null,
  description: null,
  onDashboardAction: null,
  i18n: {
    lastUpdatedLabel: 'Last updated: ',
    noDataLabel: 'No data is available for this time range.',
    noDataShortLabel: 'No data',
    errorLoadingDataLabel: 'Error loading data for this card: ',
    errorLoadingDataShortLabel: 'Data error.',
    alertDetected: 'Alert detected: ',
    // card labels
    rollingPeriodLabel: 'Rolling period',
    defaultLabel: 'Default',
    last24HoursLabel: 'Last 24 hrs',
    last7DaysLabel: 'Last 7 days',
    lastMonthLabel: 'Last month',
    lastQuarterLabel: 'Last quarter',
    lastYearLabel: 'Last year',
    periodToDateLabel: 'Period to date',
    thisWeekLabel: 'This week',
    thisMonthLabel: 'This month',
    thisQuarterLabel: 'This quarter',
    thisYearLabel: 'This year',
    hourlyLabel: 'Hourly',
    dailyLabel: 'Daily',
    weeklyLabel: 'Weekly',
    monthlyLabel: 'Monthly',
    expandLabel: 'Expand to fullscreen',
    overflowMenuDescription: 'Open and close list of options',
    // card actions
    editCardLabel: 'Edit card',
    cloneCardLabel: 'Clone card',
    deleteCardLabel: 'Delete card',
    selectTimeRangeLabel: 'Select time range',
    // table card labels
    criticalLabel: 'Critical',
    moderateLabel: 'Moderate',
    lowLabel: 'Low',
    selectSeverityPlaceholder: 'Select a severity',
    severityLabel: 'Severity',
    searchPlaceholder: 'Search',
    filterButtonAria: 'Filters',
    defaultFilterStringPlaceholdText: 'Type and hit enter to apply',
    pageBackwardAria: 'Previous page',
    pageForwardAria: 'Next page',
    pageNumberAria: 'Page Number',
    itemsPerPage: 'Items per page:',
    currentPage: function currentPage(page) {
      return "__page ".concat(page, "__");
    },
    itemsRangeWithTotal: function itemsRangeWithTotal(min, max, total) {
      return "__".concat(min, "\u2013").concat(max, " of ").concat(total, " items__");
    },
    pageRange: function pageRange(current, total) {
      return "__".concat(current, " 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',
    clearFilterAria: 'Clear filter',
    filterAria: 'Filter',
    openMenuAria: 'Open menu',
    closeMenuAria: 'Close menu',
    clearSelectionAria: 'Clear selection',
    /** empty state */
    emptyMessage: 'There are no alerts in this range.',
    emptyMessageWithFilters: 'No results match the current filters',
    emptyButtonLabel: 'Create some data',
    emptyButtonLabelWithFilters: 'Clear all filters',
    inProgressText: 'In Progress',
    actionFailedText: 'Action Failed',
    learnMoreText: 'Learn More',
    dismissText: 'Dismiss',
    downloadIconDescription: 'Download table content'
  },
  filter: null,
  sidebar: null,
  actions: [],
  hasLastUpdated: true,
  onSetupCard: null,
  onFetchData: null,
  renderIconByName: null,
  timeGrain: null,
  isLoading: false,
  setIsLoading: null,
  testId: 'dashboard'
};

/**
 * This component renders one individual dashboard from an array of properties.
 * The passed cards are set into a grid layout based on the individual card sizes and layouts.
 * It keeps track of the current breakpoint and passes it down to the rendered cards.
 * This dashboard only supports a fixed set of card types and uses the CardRenderer to make those determinations
 * If you want to render a custom card type you should compose your own dashboard component with the DashboardHeader,
 * DashboardGrid, and Card components.
 *
 * Data Loading:
 * It keeps track of whether any cards are actively loading data and shows a loading spinner at the top.
 * It listens to all the cards data fetching, and updates it's overall refresh date once all cards have finished fetching data.
 * To enable your cards to fetch data, you must implement the onFetchData callback. The callback is called with the full
 * card prop object, and then a boolean that describes whether to return timeseries data or not.  You should asynchronously
 * return an array of values from your callback to populate your cards with data.
 */
var Dashboard = function Dashboard(_ref) {
  var cards = _ref.cards,
    title = _ref.title,
    description = _ref.description,
    hasLastUpdated = _ref.hasLastUpdated,
    i18n = _ref.i18n,
    lastUpdatedLabel = _ref.i18n.lastUpdatedLabel,
    filter = _ref.filter,
    sidebar = _ref.sidebar,
    layouts = _ref.layouts,
    isEditable = _ref.isEditable,
    onLayoutChange = _ref.onLayoutChange,
    onBreakpointChange = _ref.onBreakpointChange,
    className = _ref.className,
    actions = _ref.actions,
    onDashboardAction = _ref.onDashboardAction,
    isLoading = _ref.isLoading,
    setIsLoading = _ref.setIsLoading,
    onSetRefresh = _ref.onSetRefresh,
    onSetupCard = _ref.onSetupCard,
    lastUpdated = _ref.lastUpdated,
    renderIconByName = _ref.renderIconByName,
    onFetchData = _ref.onFetchData,
    timeGrain = _ref.timeGrain,
    testId = _ref.testId;
  {
    warning(false, 'Dashboard component has been deprecated and will be removed in the next release of `carbon-addons-iot-react`.') ;
  }
  var _useState = useState('lg'),
    _useState2 = _slicedToArray(_useState, 2),
    breakpoint = _useState2[0],
    setBreakpoint = _useState2[1];

  // Keep track of whether any cards are loading or not, (doesn't need to be in state)
  var cardsLoadingRef = useRef();

  // Setup the loading tracker for the cards if the dashboard decides to load
  useEffect(function () {
    if (isLoading) {
      cardsLoadingRef.current = [];
      onSetRefresh(null);
    } else {
      cardsLoadingRef.current = undefined;
    }
  }, [isLoading] // eslint-disable-line react-hooks/exhaustive-deps
  );

  // Listen to the card fetches to determine whether all cards have finished loading
  var handleOnFetchData = useCallback(function (card) {
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return onFetchData.apply(void 0, [card].concat(args)).finally(function () {
      if (cardsLoadingRef.current && !cardsLoadingRef.current.includes(card.id)) {
        cardsLoadingRef.current.push(card.id);
        // If the card array count matches the card count, we call setIsLoading to false, and clear the array
        if (cardsLoadingRef.current.length === cards.filter(function (cardsToLoad) {
          return cardsToLoad.dataSource;
        }).length) {
          setIsLoading(false);
          onSetRefresh(Date.now());
        }
      }
    });
  }, [onFetchData, cards.length] // eslint-disable-line react-hooks/exhaustive-deps
  );
  var cachedOnBreakpointChange = useCallback(function (newBreakpoint) {
    setBreakpoint(newBreakpoint);
    if (onBreakpointChange) {
      onBreakpointChange(newBreakpoint);
    }
  }, [onBreakpointChange]);
  var cachedRenderIconByName = useCallback(renderIconByName, [] // eslint-disable-line react-hooks/exhaustive-deps
  );
  var cachedOnSetupCard = useCallback(onSetupCard, [] // eslint-disable-line react-hooks/exhaustive-deps
  );

  // Uses our shared renderer for each card that knows how to render a fixed set of card types
  var gridContents = useMemo(function () {
    return cards.map(function (card) {
      return /*#__PURE__*/React__default.createElement(CardRenderer, _extends({}, card, {
        key: "renderer-".concat(card.id),
        i18n: _objectSpread(_objectSpread({}, i18n), card.i18n) // let the card level i18n override the dashboard i18n
        ,
        isLoading: isLoading,
        isEditable: isEditable,
        breakpoint: breakpoint,
        onSetupCard: cachedOnSetupCard,
        onFetchData: handleOnFetchData,
        renderIconByName: cachedRenderIconByName,
        timeGrain: timeGrain
      }));
    });
  },
  // eslint-disable-next-line react-hooks/exhaustive-deps
  [breakpoint, i18n, cards, isEditable, isLoading, handleOnFetchData, timeGrain]);
  return /*#__PURE__*/React__default.createElement("div", {
    "data-testid": testId,
    className: className
  }, /*#__PURE__*/React__default.createElement(DashboardHeader, {
    title: title,
    description: description,
    lastUpdatedLabel: !isEditable ? lastUpdatedLabel : null,
    isLoading: isLoading,
    filter: filter,
    hasLastUpdated: hasLastUpdated,
    lastUpdated: lastUpdated,
    actions: actions,
    onDashboardAction: onDashboardAction,
    testId: "".concat(testId, "-header")
  }), /*#__PURE__*/React__default.createElement("div", {
    style: {
      display: 'flex'
    }
  }, sidebar && /*#__PURE__*/React__default.createElement("div", {
    "data-testid": "".concat(testId, "-sidebar"),
    style: {
      flex: 0
    }
  }, sidebar), /*#__PURE__*/React__default.createElement(DashboardGrid, {
    layouts: layouts,
    onLayoutChange: onLayoutChange,
    isEditable: isEditable,
    breakpoint: breakpoint,
    onBreakpointChange: cachedOnBreakpointChange,
    testId: "".concat(testId, "-grid")
  }, gridContents)));
};
Dashboard.propTypes = propTypes;
Dashboard.defaultProps = defaultProps;
Dashboard.__docgenInfo = {
  "description": "This component renders one individual dashboard from an array of properties.\nThe passed cards are set into a grid layout based on the individual card sizes and layouts.\nIt keeps track of the current breakpoint and passes it down to the rendered cards.\nThis dashboard only supports a fixed set of card types and uses the CardRenderer to make those determinations\nIf you want to render a custom card type you should compose your own dashboard component with the DashboardHeader,\nDashboardGrid, and Card components.\n\nData Loading:\nIt keeps track of whether any cards are actively loading data and shows a loading spinner at the top.\nIt listens to all the cards data fetching, and updates it's overall refresh date once all cards have finished fetching data.\nTo enable your cards to fetch data, you must implement the onFetchData callback. The callback is called with the full\ncard prop object, and then a boolean that describes whether to return timeseries data or not.  You should asynchronously\nreturn an array of values from your callback to populate your cards with data.",
  "methods": [],
  "displayName": "Dashboard",
  "props": {
    "title": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "description": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "onDashboardAction": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback called when an action is clicked.  The id of the action is passed to the callback",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "i18n": {
      "defaultValue": {
        "value": "{\n  lastUpdatedLabel: 'Last updated: ',\n  noDataLabel: 'No data is available for this time range.',\n  noDataShortLabel: 'No data',\n  errorLoadingDataLabel: 'Error loading data for this card: ',\n  errorLoadingDataShortLabel: 'Data error.',\n  alertDetected: 'Alert detected: ',\n  // card labels\n  rollingPeriodLabel: 'Rolling period',\n  defaultLabel: 'Default',\n  last24HoursLabel: 'Last 24 hrs',\n  last7DaysLabel: 'Last 7 days',\n  lastMonthLabel: 'Last month',\n  lastQuarterLabel: 'Last quarter',\n  lastYearLabel: 'Last year',\n  periodToDateLabel: 'Period to date',\n  thisWeekLabel: 'This week',\n  thisMonthLabel: 'This month',\n  thisQuarterLabel: 'This quarter',\n  thisYearLabel: 'This year',\n  hourlyLabel: 'Hourly',\n  dailyLabel: 'Daily',\n  weeklyLabel: 'Weekly',\n  monthlyLabel: 'Monthly',\n  expandLabel: 'Expand to fullscreen',\n  overflowMenuDescription: 'Open and close list of options',\n\n  // card actions\n  editCardLabel: 'Edit card',\n  cloneCardLabel: 'Clone card',\n  deleteCardLabel: 'Delete card',\n  selectTimeRangeLabel: 'Select time range',\n  // table card labels\n  criticalLabel: 'Critical',\n  moderateLabel: 'Moderate',\n  lowLabel: 'Low',\n  selectSeverityPlaceholder: 'Select a severity',\n  severityLabel: 'Severity',\n  searchPlaceholder: 'Search',\n  filterButtonAria: 'Filters',\n  defaultFilterStringPlaceholdText: 'Type and hit enter to apply',\n  pageBackwardAria: 'Previous page',\n  pageForwardAria: 'Next page',\n  pageNumberAria: 'Page Number',\n  itemsPerPage: 'Items per page:',\n  currentPage: (page) => `__page ${page}__`,\n  itemsRangeWithTotal: (min, max, total) => `__${min}\u2013${max} of ${total} items__`,\n  pageRange: (current, total) => `__${current} of ${total} pages__`,\n  /** table body */\n  overflowMenuAria: 'More actions',\n  clickToExpandAria: 'Click to expand content',\n  clickToCollapseAria: 'Click to collapse content',\n  selectAllAria: 'Select all items',\n  selectRowAria: 'Select row',\n  /** toolbar */\n  clearAllFilters: 'Clear all filters',\n  columnSelectionButtonAria: 'Column Selection',\n  clearFilterAria: 'Clear filter',\n  filterAria: 'Filter',\n  openMenuAria: 'Open menu',\n  closeMenuAria: 'Close menu',\n  clearSelectionAria: 'Clear selection',\n  /** empty state */\n  emptyMessage: 'There are no alerts in this range.',\n  emptyMessageWithFilters: 'No results match the current filters',\n  emptyButtonLabel: 'Create some data',\n  emptyButtonLabelWithFilters: 'Clear all filters',\n  inProgressText: 'In Progress',\n  actionFailedText: 'Action Failed',\n  learnMoreText: 'Learn More',\n  dismissText: 'Dismiss',\n  downloadIconDescription: 'Download table content',\n}",
        "computed": false
      },
      "description": "All the labels that need translation",
      "type": {
        "name": "shape",
        "value": {
          "lastUpdatedLabel": {
            "name": "string",
            "required": false
          },
          "noDataLabel": {
            "name": "string",
            "required": false
          },
          "noDataShortLabel": {
            "name": "string",
            "required": false
          },
          "errorLoadingDataLabel": {
            "name": "string",
            "required": false
          },
          "errorLoadingDataShortLabel": {
            "name": "string",
            "required": false
          },
          "rollingPeriodLabel": {
            "name": "string",
            "required": false
          },
          "last24HoursLabel": {
            "name": "string",
            "required": false
          },
          "last7DaysLabel": {
            "name": "string",
            "required": false
          },
          "defaultLabel": {
            "name": "union",
            "value": [{
              "name": "string"
            }, {
              "name": "node"
            }],
            "required": false
          },
          "lastMonthLabel": {
            "name": "string",
            "required": false
          },
          "lastQuarterLabel": {
            "name": "string",
            "required": false
          },
          "lastYearLabel": {
            "name": "string",
            "required": false
          },
          "periodToDateLabel": {
            "name": "string",
            "required": false
          },
          "thisWeekLabel": {
            "name": "string",
            "required": false
          },
          "thisMonthLabel": {
            "name": "string",
            "required": false
          },
          "thisQuarterLabel": {
            "name": "string",
            "required": false
          },
          "thisYearLabel": {
            "name": "string",
            "required": false
          },
          "hourlyLabel": {
            "name": "string",
            "required": false
          },
          "dailyLabel": {
            "name": "string",
            "required": false
          },
          "weeklyLabel": {
            "name": "string",
            "required": false
          },
          "monthlyLabel": {
            "name": "string",
            "required": false
          },
          "expandLabel": {
            "name": "string",
            "required": false
          },
          "overflowMenuDescription": {
            "name": "string",
            "required": false
          },
          "alertDetected": {
            "name": "string",
            "required": false
          },
          "editCardLabel": {
            "name": "string",
            "required": false
          },
          "cloneCardLabel": {
            "name": "string",
            "required": false
          },
          "deleteCardLabel": {
            "name": "string",
            "required": false
          },
          "selectTimeRangeLabel": {
            "name": "string",
            "required": false
          },
          "zoomIn": {
            "name": "string",
            "required": false
          },
          "zoomOut": {
            "name": "string",
            "required": false
          },
          "zoomToFit": {
            "name": "string",
            "required": false
          },
          "criticalLabel": {
            "name": "string",
            "required": false
          },
          "moderateLabel": {
            "name": "string",
            "required": false
          },
          "lowLabel": {
            "name": "string",
            "required": false
          },
          "selectSeverityPlaceholder": {
            "name": "string",
            "required": false
          },
          "severityLabel": {
            "name": "string",
            "required": false
          },
          "defaultFilterStringPlaceholdText": {
            "name": "string",
            "required": false
          },
          "downloadIconDescription": {
            "name": "string",
            "required": false
          },
          "pageBackwardAria": {
            "name": "string",
            "required": false
          },
          "pageForwardAria": {
            "name": "string",
            "required": false
          },
          "pageNumberAria": {
            "name": "string",
            "required": false
          },
          "itemsPerPage": {
            "name": "string",
            "required": false
          },
          "currentPage": {
            "name": "func",
            "required": false
          },
          "itemsRangeWithTotal": {
            "name": "func",
            "required": false
          },
          "pageRange": {
            "name": "func",
            "required": false
          },
          "overflowMenuAria": {
            "name": "string",
            "description": "table body",
            "required": false
          },
          "clickToExpandAria": {
            "name": "string",
            "required": false
          },
          "clickToCollapseAria": {
            "name": "string",
            "required": false
          },
          "selectAllAria": {
            "name": "string",
            "required": false
          },
          "selectRowAria": {
            "name": "string",
            "required": false
          },
          "clearAllFilters": {
            "name": "string",
            "description": "toolbar",
            "required": false
          },
          "columnSelectionButtonAria": {
            "name": "string",
            "required": false
          },
          "clearFilterAria": {
            "name": "string",
            "required": false
          },
          "filterAria": {
            "name": "string",
            "required": false
          },
          "openMenuAria": {
            "name": "string",
            "required": false
          },
          "closeMenuAria": {
            "name": "string",
            "required": false
          },
          "clearSelectionAria": {
            "name": "string",
            "required": false
          },
          "emptyMessage": {
            "name": "string",
            "description": "empty state",
            "required": false
          },
          "emptyMessageWithFilters": {
            "name": "string",
            "required": false
          },
          "emptyButtonLabelWithFilters": {
            "name": "string",
            "required": false
          },
          "inProgressText": {
            "name": "string",
            "required": false
          },
          "actionFailedText": {
            "name": "string",
            "required": false
          },
          "learnMoreText": {
            "name": "string",
            "required": false
          },
          "dismissText": {
            "name": "string",
            "required": false
          }
        }
      },
      "required": false
    },
    "filter": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Optional filter that should be rendered top right",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "sidebar": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Optional sidebar content that should be rendered left of the dashboard cards",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "actions": {
      "defaultValue": {
        "value": "[]",
        "computed": false
      },
      "description": "optional actions that will be rendered in the Dashboard header and used in onDashboardAction",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "shape",
          "value": {
            "id": {
              "name": "string",
              "description": "Unique id of the action",
              "required": true
            },
            "icon": {
              "name": "union",
              "value": [{
                "name": "shape",
                "value": {
                  "width": {
                    "name": "string",
                    "required": false
                  },
                  "height": {
                    "name": "string",
                    "required": false
                  },
                  "viewBox": {
                    "name": "string",
                    "required": true
                  },
                  "svgData": {
                    "name": "custom",
                    "raw": "SvgPropType.isRequired",
                    "required": true
                  }
                }
              }, {
                "name": "string"
              }, {
                "name": "node"
              }],
              "description": "icon ultimately gets passed through all the way to <Button>, which has this same copied proptype definition for icon",
              "required": false
            },
            "labelText": {
              "name": "string",
              "required": false
            }
          }
        }
      },
      "required": false
    },
    "hasLastUpdated": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "If the header should render the last updated section",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "onSetupCard": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Optional Function that is called back if the card has a setup phase before data fetching",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "onFetchData": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback called when a card should fetch its data, called with the card props and a boolean that determines whether a card supports timeseries data or not.  Return a promise that returns the updated card object with values.  It will be passed downstream to your card as props to update.",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "renderIconByName": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Callback called when a card determines what icon render based on a named string in card config\n   example usage: renderIconByName(name = 'my--checkmark--icon', props = { title: 'A checkmark', etc. })",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "timeGrain": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "If the overall dashboard should be using a timeGrain, we pass it here",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "isLoading": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "Property that will trigger all cards to load again",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "setIsLoading": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "once all the cards have finished loading this will be called",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "testId": {
      "defaultValue": {
        "value": "'dashboard'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "cards": {
      "description": "",
      "type": {
        "name": "arrayOf",
        "value": {
          "name": "shape",
          "value": {
            "content": {
              "name": "union",
              "value": [{
                "name": "object"
              }, {
                "name": "func"
              }],
              "required": false
            },
            "values": {
              "name": "union",
              "value": [{
                "name": "object"
              }, {
                "name": "array"
              }],
              "required": false
            },
            "isLoading": {
              "name": "bool",
              "description": "is the card actively loading, it will override the dashboard loading state if true",
              "required": false
            },
            "error": {
              "name": "node",
              "description": "was there an error loading",
              "required": false
            }
          }
        }
      },
      "required": true
    }
  },
  "composes": ["lodash-es"]
};
var Dashboard$1 = Dashboard;

export { Dashboard$1 as default };
