Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Commit

Permalink
v4.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed May 3, 2017
1 parent f99d3d7 commit 5cae556
Show file tree
Hide file tree
Showing 22 changed files with 2,417 additions and 710 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The simple, easy-to-implement plugin to export HTML tables to xlsx, xls, csv, an

[TableExport](https://www.travismclarke.com/tableexport/) demo **--** [TableExport + RequireJS](https://github.com/clarketm/tableexport_requirejs_app) skeleton **--** [TableExport + Flask](https://github.com/clarketm/tableexport_flask_app) skeleton.

> **Notice:** In May 2017, [v3.0.0](https://github.com/clarketm/TableExport/releases/tag/v3.3.9) will be superceded by [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.5). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible.
> **Notice:** In May 2017, [v3.0.0](https://github.com/clarketm/TableExport/releases/tag/v3.3.9) will be superceded by [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-rc.1). Althought this is a major version bump, fear not, because all changes will be 100% backwards-compatible.
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-alpha.5) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project.
> **So why the major version bump you ask?** Well, the rationale for a major version bump is that due to a change in `TableExport`'s dependencies, in [v4.0.0](https://github.com/clarketm/TableExport/releases/tag/v4.0.0-rc.1) forth, JQuery will no longer be a **required** dependency, instead it will be purely **optional**. So existing implementations *with* jQuery will continue to work unimpeded, now with the added benefit that new projets no longer need to rely on the overhead of such large library, unless of course you prefer jQuery or it is already part of your project.
## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tableexport.js",
"version": "4.0.0-alpha.5",
"version": "4.0.0-rc.1",
"authors": [
"clarketm <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* TableExport.js 4.0.0-alpha.5 (https://www.travismclarke.com)
* TableExport.js 4.0.0-rc.1 (https://www.travismclarke.com)
* Copyright 2017 Travis Clarke
* Licensed under the MIT license
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/tableexport.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

872 changes: 523 additions & 349 deletions dist/js/tableexport.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/tableexport.min.js

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions examples/bootstrap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="../assets/css/Bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="../assets/css/Bootstrap/bootstrap-theme.min.css" rel="stylesheet">
<link href="../src/stable/css/tableexport.min.css" rel="stylesheet">
</head>
<body>

<iframe src="./default.html" frameborder="0" width="100%" scrolling="no" onload="this.height=screen.height/3;"></iframe>

<div class="container-fluid">
<h1>Bootstrap
<small><code>bootstrap: true</code></small>
</h1>
<div class="table-responsive">
<table id="bootstrap-table" class="table table-bordered">
<thead>
<tr>
<td>Name</td>
<td>Position</td>
<td>Age</td>
<td>Salary</td>
</tr>
</thead>
<tbody>
<tr>
<td>Thor Walton</td>
<td>Regional Director</td>
<td>45</td>
<td>$98,540</td>
</tr>
<tr>
<td>Travis Clarke</td>
<td>Software Engineer</td>
<td>30</td>
<td>$275,000</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Office Manager</td>
<td>22</td>
<td>$67,670</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
<th>$441,210</th>
</tr>
</tfoot>
</table>
</div>
</div>

<script type="text/javascript" src="../bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="../bower_components/xlsx-js/xlsx.core.min.js"></script>
<script type="text/javascript" src="../bower_components/blobjs/Blob.min.js"></script>
<script type="text/javascript" src="../bower_components/file-saverjs/FileSaver.min.js"></script>
<script type="text/javascript" src="../src/stable/js/tableexport.min.js"></script>
<script>

// Bootstrap configuration classes ["base", "theme", "container"].
TableExport.prototype.bootstrap = ["btn", "btn-default", "btn-toolbar"];
// **** jQuery **************************
// $.fn.tableExport.bootstrap = ["btn", "btn-link", "btn-toolbar"];
// **************************************

var BootstrapTable = document.getElementById('bootstrap-table');
new TableExport(BootstrapTable, {
bootstrap: true
});
// **** jQuery **************************
// $(BootstrapTable).tableExport({
// bootstrap: true
// });
// **************************************

</script>

</body>
</html>
115 changes: 115 additions & 0 deletions examples/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Defaults</title>
<link href="../src/stable/css/tableexport.min.css" rel="stylesheet">
<link href="./examples.css" rel="stylesheet">
</head>
<body id="default">

<h1>Defaults</h1>

<main>
<article>
<pre>
headers: true,
footers: true,
formats: ['xls', 'csv', 'txt'],
filename: 'id',
bootstrap: false,
position: 'bottom',
ignoreRows: null,
ignoreCols: null,
trimWhitespace: true
</pre>
</article>

<article>
<table id="default-table" width="50%">
<thead>
<tr>
<th>

Name

</th>
<th>Position</th>
<th>Age</th>
<th>Salary</th>
</tr>
</thead>
<tbody>
<tr>
<td>Thor Walton</td>
<td>Regional Director</td>
<td>45</td>
<td>$98,540</td>
</tr>
<tr>
<td>Travis Clarke</td>
<td>Software Engineer</td>
<td>30</td>
<td>$275,000</td>
</tr>
<tr>
<td>Suki Burks</td>
<td>Office Manager</td>
<td>22</td>
<td>$67,670</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
<th>$441,210</th>
</tr>
</tfoot>
</table>
</article>
</main>

<hr>

<script type="text/javascript" src="../bower_components/xlsx-js/xlsx.core.min.js"></script>
<script type="text/javascript" src="../bower_components/blobjs/Blob.min.js"></script>
<script type="text/javascript" src="../bower_components/file-saverjs/FileSaver.min.js"></script>
<script type="text/javascript" src="../src/stable/js/tableexport.js"></script>
<script>

var DefaultTable = document.getElementById('default-table');
new TableExport(DefaultTable, {
headers: true, // (Boolean), display table headers (th or td elements) in the <thead>, (default: true)
footers: true, // (Boolean), display table footers (th or td elements) in the <tfoot>, (default: false)
formats: ['xls', 'csv', 'txt'], // (String[]), filetype(s) for the export, (default: ['xls', 'csv', 'txt'])
filename: 'id', // (id, String), filename for the downloaded file, (default: 'id')
bootstrap: false, // (Boolean), style buttons using bootstrap, (default: false)
position: 'bottom', // (top, bottom), position of the caption element relative to table, (default: 'bottom')
ignoreRows: null, // (Number, Number[]), row indices to exclude from the exported file(s) (default: null)
ignoreCols: null, // (Number, Number[]), column indices to exclude from the exported file(s) (default: null)
ignoreCSS: '.tableexport-ignore', // (selector, selector[]), selector(s) to exclude cells from the exported file(s) (default: '.tableexport-ignore')
emptyCSS: '.tableexport-empty', // (selector, selector[]), selector(s) to replace cells with an empty string in the exported file(s) (default: '.tableexport-empty')
trimWhitespace: true // (Boolean), remove all leading/trailing newlines, spaces, and tabs from cell text in the exported file(s) (default: true)
});
// **** jQuery **************************
// $(DefaultTable).tableExport({
// headers: true,
// footers: true,
// formats: ['xls', 'csv', 'txt'],
// filename: 'id',
// bootstrap: true,
// position: 'bottom',
// ignoreRows: null,
// ignoreCols: null,
// ignoreCSS: '.tableexport-ignore',
// emptyCSS: '.tableexport-empty',
// trimWhitespace: false
// });
// **************************************

</script>

</body>
</html>
100 changes: 100 additions & 0 deletions examples/examples.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
body {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
table,
th,
td {
border: 1px solid black;
}
table {
width: 50%;
}
#default table {
width: 100%;
}
#default article {
width: 45%;
display: inline-block;
}
hr {
margin-top: 22px;
border: 0;
border-top: 4px solid #eee;
}
h1 {
font-size: 35px;
font-family: Helvetica Neue, serif;
font-weight: 500;
line-height: 1.1;
color: inherit;
margin-top: 22px;
margin-bottom: 11px;
}
code {
font-family: Consolas, Menlo, Monaco, "Courier New", monospace;
padding: 2px 4px;
font-size: 80%;
color: #c7254e;
background-color: #f9f2f4;
border-radius: 4px;
}
.small {
font-size: 50%;
}
.info {
background: rgba(85, 102, 156, 0.2);
padding: 10px;
border: 2px solid rgba(85, 102, 156, 0.8);
width: 50%;
line-height: 1.4;
}
.half {
width: 50%;
}
.info.code {
font-size: 80%;
}
.target {
background: yellow;
font-weight: bold;
}
.top {
background: yellow;
font-weight: bold;
}
#formats .bottom {
background: yellow;
font-weight: bold;
}
span.target {
display: inline-block;
padding: 0 4px;
border-radius: 4px;
}
.disabled {
background: rgba(146, 146, 146, 0.2);
}
.note {
color: #b4b7b7;
font-size: 90%;
}
span.note {
font-size: 40%;
}
.ignore,
.tableexport-ignore {
background: lightsalmon;
font-weight: bold;
}
.empty,
.tableexport-empty {
background: lightgreen;
font-weight: bold;
}
#customXLSButton {
background: lightgreen;
font-size: 200%;
}
Loading

0 comments on commit 5cae556

Please sign in to comment.