Skip to content

Commit

Permalink
New: Integrate new excel viewer into preview (box#2)
Browse files Browse the repository at this point in the history
* New: Add fake excel viewer and add it to docLoader

* New: Finish the dummy-viewer

* New: Can parse using sheetjs on the client

* New: SheetJS prototype

* New: Parse xlsx in the viewer

* Fix: Eslint

* New: Remove XLSX package

* Fix: Remove lodash and fix following issues

* Fix: Grids text overlap

* Fix: install modules from public instead of jfrog

* Fix: use meaningful filename
  • Loading branch information
mxiao6 authored and Mingze Xiao committed Jul 10, 2018
1 parent 103a037 commit f27195e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function updateConfig(conf, language, index) {
annotations: ['box-annotations'],
preview: [`${lib}/Preview.js`],
csv: [`${lib}/viewers/text/BoxCSV.js`],
excel: [`${lib}/viewers/doc/BoxExcel.js`]
excel: [`${lib}/viewers/doc/BoxExcel`]
},
output: {
path: path.resolve('dist', version, language),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import DataGrids from './BoxExcel/dataGrids';
import Workbook from './workbook';

class BoxExcel {
/**
Expand Down Expand Up @@ -36,7 +36,7 @@ class BoxExcel {
* @private
*/
renderExcel() {
this.gridComponent = render(<DataGrids workbook={this.data} />, this.excelEl);
this.gridComponent = render(<Workbook workbook={this.data} />, this.excelEl);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const styles = {
focusedDiv: {}
};

class VirtualGrid extends Component {
class Sheet extends Component {
/* eslint-disable */
static propTypes = {
sheet: PropTypes.object.isRequired,
Expand Down Expand Up @@ -528,4 +528,4 @@ class VirtualGrid extends Component {
}
}

export default VirtualGrid;
export default Sheet;
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { PureComponent } from 'react';
import Tab from 'box-react-ui/lib/components/tab-view/Tab';
import TabView from 'box-react-ui/lib/components/tab-view/TabView';
import PropTypes from 'prop-types';
import VirtualGrid from './virtualGrid';
import Sheet from './sheet';

class DataGrids extends PureComponent {
class Workbook extends PureComponent {
static propTypes = {
// eslint-disable-next-line
workbook: PropTypes.object.isRequired
Expand All @@ -24,7 +24,7 @@ class DataGrids extends PureComponent {
{nonHiddenSheetsNames.map((name) => {
return (
<Tab key={name} title={name}>
<VirtualGrid sheet={workbook.Sheets[name]} views={wbSettings.Views} theme={colorScheme} />
<Sheet sheet={workbook.Sheets[name]} views={wbSettings.Views} theme={colorScheme} />
</Tab>
);
})}
Expand All @@ -33,4 +33,4 @@ class DataGrids extends PureComponent {
}
}

export default DataGrids;
export default Workbook;

0 comments on commit f27195e

Please sign in to comment.