Skip to content
Snippets Groups Projects
Commit c8946ca8 authored by meskio's avatar meskio :tent:
Browse files

Stop using bootstrap-react-table

parent 67355cc6
Branches
No related tags found
No related merge requests found
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
"bootstrap": "^4.5.2", "bootstrap": "^4.5.2",
"react": "^16.13.1", "react": "^16.13.1",
"react-bootstrap": "^1.3.0", "react-bootstrap": "^1.3.0",
"react-bootstrap-table-next": "^4.0.3",
"react-bootstrap-table2-editor": "^1.4.0",
"react-bootstrap-typeahead": "^5.1.1", "react-bootstrap-typeahead": "^5.1.1",
"react-dom": "^16.13.1", "react-dom": "^16.13.1",
"react-icons": "^3.11.0", "react-icons": "^3.11.0",
...@@ -12655,21 +12653,6 @@ ...@@ -12655,21 +12653,6 @@
"warning": "^4.0.3" "warning": "^4.0.3"
} }
}, },
"node_modules/react-bootstrap-table-next": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
"integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
"dependencies": {
"classnames": "^2.2.5",
"react-transition-group": "^4.2.0",
"underscore": "1.9.1"
}
},
"node_modules/react-bootstrap-table2-editor": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/react-bootstrap-table2-editor/-/react-bootstrap-table2-editor-1.4.0.tgz",
"integrity": "sha512-18yDCwsVt3b5Fwy0jidNDAbUA6vC7k9JjQVmykazWSw8G115+mmZnhe9/7RO7jAu8X7lhmobwlNwECzwPu1nDg=="
},
"node_modules/react-bootstrap-typeahead": { "node_modules/react-bootstrap-typeahead": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz", "resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz",
...@@ -15485,11 +15468,6 @@ ...@@ -15485,11 +15468,6 @@
"react-lifecycles-compat": "^3.0.4" "react-lifecycles-compat": "^3.0.4"
} }
}, },
"node_modules/underscore": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
"integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
},
"node_modules/unicode-canonical-property-names-ecmascript": { "node_modules/unicode-canonical-property-names-ecmascript": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
...@@ -27594,21 +27572,6 @@ ...@@ -27594,21 +27572,6 @@
"warning": "^4.0.3" "warning": "^4.0.3"
} }
}, },
"react-bootstrap-table-next": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
"integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
"requires": {
"classnames": "^2.2.5",
"react-transition-group": "^4.2.0",
"underscore": "1.9.1"
}
},
"react-bootstrap-table2-editor": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/react-bootstrap-table2-editor/-/react-bootstrap-table2-editor-1.4.0.tgz",
"integrity": "sha512-18yDCwsVt3b5Fwy0jidNDAbUA6vC7k9JjQVmykazWSw8G115+mmZnhe9/7RO7jAu8X7lhmobwlNwECzwPu1nDg=="
},
"react-bootstrap-typeahead": { "react-bootstrap-typeahead": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz", "resolved": "https://registry.npmjs.org/react-bootstrap-typeahead/-/react-bootstrap-typeahead-5.1.1.tgz",
...@@ -29973,11 +29936,6 @@ ...@@ -29973,11 +29936,6 @@
"react-lifecycles-compat": "^3.0.4" "react-lifecycles-compat": "^3.0.4"
} }
}, },
"underscore": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz",
"integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg=="
},
"unicode-canonical-property-names-ecmascript": { "unicode-canonical-property-names-ecmascript": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz",
...@@ -3,7 +3,6 @@ import ReactDOM from "react-dom"; ...@@ -3,7 +3,6 @@ import ReactDOM from "react-dom";
import App from "./App"; import App from "./App";
import * as serviceWorker from "./serviceWorker"; import * as serviceWorker from "./serviceWorker";
import "bootstrap/dist/css/bootstrap.min.css"; import "bootstrap/dist/css/bootstrap.min.css";
import "react-bootstrap-table-next/dist/react-bootstrap-table2.min.css";
import "react-bootstrap-typeahead/css/Typeahead.css"; import "react-bootstrap-typeahead/css/Typeahead.css";
ReactDOM.render( ReactDOM.render(
......
import React from "react"; import React from "react";
import BootstrapTable from "react-bootstrap-table-next"; import { Table } from "react-bootstrap";
import { printMoney } from "../util"; import { printMoney } from "../util";
const columns = [
{ dataField: "code", text: "Codigo" },
{ dataField: "product.name", text: "Nombre" },
{
dataField: "price",
text: "Precio",
formatter: (cell) => printMoney(cell) + "",
},
{ dataField: "amount", text: "Cantidad" },
];
function ShowPurchase(props) { function ShowPurchase(props) {
const entries = props.purchase.map((p) => {
return (
<tr key={p.code}>
<td>{p.code}</td>
<td>{p.product.name}</td>
<td>{printMoney(p.price) + ""}</td>
<td>{p.amount}</td>
</tr>
);
});
return ( return (
<BootstrapTable keyField="code" data={props.purchase} columns={columns} /> <Table striped bordered hover responsive>
<thead>
<tr>
<th>Codigo</th>
<th>Nombre</th>
<th>Precio</th>
<th>Cantidad</th>
</tr>
</thead>
<tbody>{entries}</tbody>
</Table>
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment