diff --git a/assets/Excel.png b/assets/Excel.png deleted file mode 100644 index 715479c..0000000 Binary files a/assets/Excel.png and /dev/null differ diff --git a/src/export-button.jsx b/src/export-button.jsx deleted file mode 100644 index fcd177f..0000000 --- a/src/export-button.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { exportXLS } from './excel-export'; - -class ExportButton extends React.PureComponent { - constructor (props) { - super(props); - this.handleExport = this.handleExport.bind(this); - } - - handleExport () { - const { component, excelExport, general } = this.props; - const { title, subtitle, footnote } = general; - if (excelExport) { - exportXLS(component.$element, title, subtitle, footnote); - } - } - - render () { - const { excelExport } = this.props; - return excelExport === true && ( - - ); - } -} - -ExportButton.defaultProps = { - excelExport: false -}; - -ExportButton.propTypes = { - component: PropTypes.shape({}).isRequired, - excelExport: PropTypes.bool, - general: PropTypes.shape({}).isRequired -}; - -export default ExportButton; diff --git a/src/headers-table/export-column-header.jsx b/src/headers-table/dim1-header.jsx similarity index 67% rename from src/headers-table/export-column-header.jsx rename to src/headers-table/dim1-header.jsx index 61775ea..88ec470 100644 --- a/src/headers-table/export-column-header.jsx +++ b/src/headers-table/dim1-header.jsx @@ -1,9 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -import ExportButton from '../export-button.jsx'; import { HEADER_FONT_SIZE } from '../initialize-transformed'; +import Tooltip from '../tooltip/index.jsx'; -const ExportColumnHeader = ({ component, baseCSS, general, title, allowExcelExport, hasSecondDimension, styling }) => { +const Dim1Header = ({ component, baseCSS, title, hasSecondDimension, styling }) => { + const inEditState = component.inEditState(); const rowSpan = hasSecondDimension ? 2 : 1; const isMediumFontSize = styling.headerOptions.fontSizeAdjustment === HEADER_FONT_SIZE.MEDIUM; const style = { @@ -21,21 +22,20 @@ const ExportColumnHeader = ({ component, baseCSS, general, title, allowExcelExpo rowSpan={rowSpan} style={style} > - - {title} + + {title} + ); }; -ExportColumnHeader.propTypes = { - component: PropTypes.shape({}).isRequired, - allowExcelExport: PropTypes.bool.isRequired, +Dim1Header.propTypes = { baseCSS: PropTypes.shape({}).isRequired, - general: PropTypes.shape({}).isRequired, + component: PropTypes.shape({}).isRequired, hasSecondDimension: PropTypes.bool.isRequired, styling: PropTypes.shape({ headerOptions: PropTypes.shape({ @@ -45,4 +45,4 @@ ExportColumnHeader.propTypes = { title: PropTypes.string.isRequired }; -export default ExportColumnHeader; +export default Dim1Header; diff --git a/src/headers-table/index.jsx b/src/headers-table/index.jsx index a9eeab6..1e9fe26 100644 --- a/src/headers-table/index.jsx +++ b/src/headers-table/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import ExportColumnHeader from './export-column-header.jsx'; +import Dim1Header from './dim1-header.jsx'; import ColumnHeader from './column-header.jsx'; import MeasurementColumnHeader from './measurement-column-header.jsx'; import { injectSeparators } from '../utilities'; @@ -12,7 +12,6 @@ class HeadersTable extends React.PureComponent { columnSeparatorWidth, component, data, - general, isKpi, styling } = this.props; @@ -43,11 +42,9 @@ class HeadersTable extends React.PureComponent { {isKpi ? - { + exportXLS( + this.$element, + this.$scope.layout.title, + this.$scope.layout.subtitle, + this.$scope.layout.footnote); + } + }); + return menu; + }, version: 1.0 };