Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"resolutions": {
"iron-ajax": "^2.1.3",
"paper-button": "^2.1.0",
"webcomponentsjs": "^v1.0.19"
}
}
4 changes: 3 additions & 1 deletion editable-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="import" href="editable-table-settings-menu.html">
<link rel="import" href="editable-table-rowcol-menu.html">
<link rel="import" href="editable-table-cell.html">
<link rel="import" href="tablesaw-js.html">
<!--
`editable-table`
A LRN element
Expand Down Expand Up @@ -87,7 +88,8 @@
url="[[dataSrc]]"
handle-as="json"
last-response="{{data}}"></iron-ajax>
<table id="table" summary="editable table" bordered$="{{bordered}}" condensed$="{{condensed}}" striped$="{{striped}}">

<table id="table" class="tablesaw tablesaw-stack" data-tablesaw-mode="stack" summary="editable table" bordered$="{{bordered}}" condensed$="{{condensed}}" striped$="{{striped}}">
<caption>
<p class="flex">
<label for="caption" class="flex-padding">Table Caption: </label>
Expand Down
Binary file added js/.DS_Store
Binary file not shown.
Binary file added js/tablesaw/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions js/tablesaw/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
.grunt
demo/webpack/bundle.js
3 changes: 3 additions & 0 deletions js/tablesaw/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src/tables.intro.jquery.js
src/tables.intro.shoestring.js
src/tables.outro.js
11 changes: 11 additions & 0 deletions js/tablesaw/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
node_js:
- 6
before_script:
- npm install -g grunt-cli
- npm install
script: grunt -v
branches:
except:
- gh-pages
sudo: false
31 changes: 31 additions & 0 deletions js/tablesaw/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing

## Important notes
Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory!

### Code style
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**

### PhantomJS
While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers.

## Modifying the code
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.

Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started).

1. Fork and clone the repo.
1. Run `npm install` to install all dependencies (including Grunt).
1. Run `grunt` to grunt this project.

Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.

## Submitting pull requests

1. Create a new branch, please don't work in your `master` branch directly.
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
1. Fix stuff.
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
1. Open `test/*.html` unit test file(s) in non-headless web browsers to ensure tests pass everywhere.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.
224 changes: 224 additions & 0 deletions js/tablesaw/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
'use strict';

module.exports = function(grunt) {

var jsFiles = [
'src/tables.js',
'src/tables.stack.js',
'src/tables.btnmarkup.js',
'src/tables.columntoggle.js',
'src/tables.sortable.js',
'src/tables.swipetoggle.js',
'src/tables.minimap.js',
'src/tables.modeswitch.js',
'src/tables.checkall.js',
'src/tables.outro.js'
];

var jsStackOnlyFiles = [
'src/tables.js',
'src/tables.stack.js',
'src/tables.outro.js'
];

// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.company %>;' +
' Licensed <%= pkg.license %> */\n',
// Task configuration.
clean: {
dependencies: ['dist/dependencies/'],
post: ['dist/tmp/', 'dist/**/*.min.*']
},
copy: {
jquery: {
src: 'node_modules/jquery/dist/jquery.js',
dest: 'dist/dependencies/jquery.js'
},
naturalsort: {
src: 'node_modules/javascript-natural-sort/naturalSort.js',
dest: 'dist/dependencies/naturalsort.js'
},
qunit: {
files: [{
expand: true,
flatten: true,
src: [ 'node_modules/qunitjs/qunit/*' ],
dest: 'dist/dependencies/',
filter: 'isFile'
}]
}
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: true
},
jsautoinit: {
src: ['src/tables-init.js'],
dest: 'dist/<%= pkg.name %>-init.js'
},
jsall: {
src: [
'src/lib/shoestring-custom.js',
'src/tables.intro.shoestring.js'
].concat( jsFiles ),
dest: 'dist/<%= pkg.name %>.js'
},
jsjquery: {
src: [
'src/tables.intro.jquery.js'
].concat( jsFiles ),
dest: 'dist/<%= pkg.name %>.jquery.js'
},
jsstack: {
src: [
'src/lib/shoestring-custom.js',
'src/tables.intro.shoestring.js'
].concat( jsStackOnlyFiles ),
dest: 'dist/stackonly/<%= pkg.name %>.stackonly.js'
},
jsstackjquery: {
src: [
'src/tables.intro.jquery.js'
].concat( jsStackOnlyFiles ),
dest: 'dist/stackonly/<%= pkg.name %>.stackonly.jquery.js'
},
cssall: {
src: [
'src/tables.css',
'src/tables.toolbar.css',
'src/tables.skin.css',
'src/tables.stack.css',
'src/tables.stack-default-breakpoint.css',
'src/tables.swipetoggle.css',
'src/tables.columntoggle.css',
'src/tables.sortable.css',
'src/tables.minimap.css'
],
dest: 'dist/tmp/<%= pkg.name %>.myth.css'
},
cssstack: {
src: [
'src/tables.css',
'src/tables.stack.css',
'src/tables.stack-default-breakpoint.css'
],
dest: 'dist/tmp/<%= pkg.name %>.stackonly.myth.css'
},
cssstackmixinpre: {
src: [
'src/tables.css',
'src/tables.stack.css'
],
dest: 'dist/tmp/<%= pkg.name %>.stackonly.myth.scss'
},
cssstackmixinpost: {
src: [
'dist/tmp/<%= pkg.name %>.stackonly-sans-mixin.scss',
'src/tables.stack-mixin.scss'
],
dest: 'dist/stackonly/<%= pkg.name %>.stackonly.scss'
}
},
qunit: {
files: ['test-qunit/**/*.html']
},
run: {
ava: {
exec: "./node_modules/.bin/ava"
}
},
watch: {
src: {
files: [
'<%= concat.jsall.src %>',
'<%= concat.jsautoinit.src %>',
'<%= concat.cssall.src %>'
],
tasks: ['src']
},
test: {
files: ['dist/<%= pkg.name %>.js'],
tasks: ['test']
}
},
uglify: {
js: {
files: {
'dist/<%= pkg.name %>.min.js': [ 'dist/<%= pkg.name %>.js' ],
'dist/<%= pkg.name %>.jquery.min.js': [ 'dist/<%= pkg.name %>.jquery.js' ],
'dist/stackonly/<%= pkg.name %>.stackonly.min.js': [ 'dist/stackonly/<%= pkg.name %>.stackonly.js' ],
'dist/stackonly/<%= pkg.name %>.stackonly.jquery.min.js': [ 'dist/stackonly/<%= pkg.name %>.stackonly.jquery.js' ]
}
}
},
cssmin: {
css: {
files: {
'dist/<%= pkg.name %>.min.css': [ 'dist/<%= pkg.name %>.css' ],
'dist/stackonly/<%= pkg.name %>.stackonly.min.css': [ 'dist/stackonly/<%= pkg.name %>.stackonly.css' ]
}
}
},
bytesize: {
dist: {
src: [
'dist/<%= pkg.name %>.min.css',
'dist/<%= pkg.name %>.min.js',
'dist/<%= pkg.name %>.jquery.min.js',
'dist/stackonly/<%= pkg.name %>.stackonly.min.css',
'dist/stackonly/<%= pkg.name %>.stackonly.min.js',
'dist/stackonly/<%= pkg.name %>.stackonly.jquery.min.js'
]
}
},
'gh-pages': {
options: {},
src: ['dist/**/*', 'demo/**/*', 'test/**/*']
},
myth: {
dist: {
files: {
'dist/<%= pkg.name %>.css': '<%= concat.cssall.dest %>',
'dist/stackonly/<%= pkg.name %>.stackonly.css': '<%= concat.cssstack.dest %>',
'dist/tmp/<%= pkg.name %>.stackonly-sans-mixin.scss': '<%= concat.cssstackmixinpre.dest %>'
}
}
},
compress: {
main: {
options: {
archive: 'dist/tablesaw-<%= pkg.version %>.zip',
mode: 'zip',
pretty: true
},
files: [
{expand: true, cwd: 'dist/', src: ['*'], dest: 'tablesaw/'},
{expand: true, cwd: 'dist/', src: ['dependencies/*'], dest: 'tablesaw/'},
{expand: true, cwd: 'dist/', src: ['stackonly/*'], dest: 'tablesaw/'}
]
}
}
});

require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);

// Default task.
grunt.registerTask('test', ['qunit', 'run:ava']);
grunt.registerTask('concat-pre', ['concat:jsautoinit', 'concat:jsall', 'concat:jsjquery', 'concat:jsstack', 'concat:jsstackjquery', 'concat:cssall', 'concat:cssstack', 'concat:cssstackmixinpre']);
grunt.registerTask('concat-post', ['concat:cssstackmixinpost']);
grunt.registerTask('src', ['concat-pre', 'myth', 'concat-post', 'clean:dependencies', 'copy', 'clean:post']);
grunt.registerTask('filesize', ['uglify', 'cssmin', 'bytesize', 'clean:post']);

grunt.registerTask('default', ['src', 'test', 'filesize']);

// Deploy
grunt.registerTask('deploy', ['default', 'gh-pages']);

};
22 changes: 22 additions & 0 deletions js/tablesaw/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2013 Filament Group

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Loading