Merge branch 'master' into issue-319-todos
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
||||||
demos
|
demos
|
||||||
docs
|
docs
|
||||||
node_modules
|
node_modules
|
||||||
|
report
|
||||||
.grunt
|
.grunt
|
||||||
|
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- '4.4.5'
|
- '6.3.0'
|
||||||
before_script:
|
before_script:
|
||||||
- npm install grunt-cli -g
|
- npm install grunt-cli -g
|
||||||
|
- npm install codecov -g
|
||||||
script:
|
script:
|
||||||
- grunt test deploy
|
- npm test
|
||||||
|
- npm run codecov
|
||||||
|
- npm run deploy
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
130
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,130 @@
|
||||||
|
# Contributing to TableFilter
|
||||||
|
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
||||||
|
|
||||||
|
## Reporting bugs
|
||||||
|
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/).
|
||||||
|
Create an issue and provide the following information.
|
||||||
|
|
||||||
|
Explain the problem and include additional details to help maintainers reproduce
|
||||||
|
the problem:
|
||||||
|
|
||||||
|
* **Use a clear, concise and descriptive title** for the issue to identify the
|
||||||
|
problem.
|
||||||
|
* **Describe the exact steps which reproduce the problem** in as many details
|
||||||
|
as possible.
|
||||||
|
* **Provide specific examples to demonstrate the steps**. Include links to
|
||||||
|
files or GitHub projects, or copy/pasteable snippets, which you use in those
|
||||||
|
examples. If you're providing snippets in the issue, use
|
||||||
|
[Markdown code blocks](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown).
|
||||||
|
Do not paste large snippets completely unrelated to the issue.
|
||||||
|
* **Describe the behavior you observed after following the steps** and point
|
||||||
|
out what exactly is the problem with that behavior.
|
||||||
|
* **Explain which behavior you expected to see instead and why.**
|
||||||
|
* Do not hesitate to **include screenshots and animated GIFs** which show you
|
||||||
|
following the described steps and clearly demonstrate the problem.
|
||||||
|
You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on macOS
|
||||||
|
and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or
|
||||||
|
[this tool](https://github.com/GNOME/byzanz) on Linux.
|
||||||
|
|
||||||
|
### Template for submitting bug reports
|
||||||
|
|
||||||
|
[Short description of problem here]
|
||||||
|
|
||||||
|
**Reproduction steps:**
|
||||||
|
|
||||||
|
1. [First Step]
|
||||||
|
2. [Second Step]
|
||||||
|
3. [Other Steps...]
|
||||||
|
|
||||||
|
**Expected behavior:**
|
||||||
|
|
||||||
|
[Describe expected behavior here]
|
||||||
|
|
||||||
|
**Observed behavior:**
|
||||||
|
|
||||||
|
[Describe observed behavior here]
|
||||||
|
|
||||||
|
**Screenshots and GIFs**
|
||||||
|
|
||||||
|
![Screenshots and GIFs which follow reproduction steps to demonstrate the
|
||||||
|
problem](url)
|
||||||
|
|
||||||
|
**TableFilter version:** [Enter TableFilter version here]
|
||||||
|
**Browser and version:** [Enter Browser name and version here]
|
||||||
|
**OS and version:** [Enter OS name and version here]
|
||||||
|
|
||||||
|
**Additional information:**
|
||||||
|
|
||||||
|
* Problem started happening recently, didn't happen in an older version of
|
||||||
|
TableFilter: [Yes/No]
|
||||||
|
* Problem can be reliably reproduced, doesn't happen randomly: [Yes/No]
|
||||||
|
|
||||||
|
## Suggesting enhancements and features
|
||||||
|
Enhancement and feature suggestions are tracked as
|
||||||
|
[GitHub issues](https://guides.github.com/features/issues/).
|
||||||
|
Create an issue and provide the following information:
|
||||||
|
|
||||||
|
* **Use a clear and descriptive title** for the issue to identify the
|
||||||
|
suggestion.
|
||||||
|
* **Provide a step-by-step description of the suggested enhancement/feature**
|
||||||
|
in as many details as possible.
|
||||||
|
* When applicable **describe the current behavior** and
|
||||||
|
**explain which behavior you expected to see instead** and why.
|
||||||
|
* **Include screenshots and animated GIFs** which help you demonstrate the
|
||||||
|
steps or point out the part of TableFilter which the suggestion is related to.
|
||||||
|
You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on macOS
|
||||||
|
and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or
|
||||||
|
[this tool](https://github.com/GNOME/byzanz) on Linux.
|
||||||
|
* **Explain why this enhancement would be useful** to most TableFilter users.
|
||||||
|
|
||||||
|
### Template for submitting enhancement and feature suggestions
|
||||||
|
|
||||||
|
[Short description of suggestion]
|
||||||
|
|
||||||
|
**Steps which explain the enhancement/feature**
|
||||||
|
|
||||||
|
1. [First Step]
|
||||||
|
2. [Second Step]
|
||||||
|
3. [Other Steps...]
|
||||||
|
|
||||||
|
**Current and suggested behavior**
|
||||||
|
|
||||||
|
[Describe current and suggested behavior here]
|
||||||
|
|
||||||
|
**Why would the enhancement be useful to most users**
|
||||||
|
|
||||||
|
[Explain why the enhancement would be useful to most users]
|
||||||
|
|
||||||
|
**Screenshots and GIFs**
|
||||||
|
|
||||||
|
![Screenshots and GIFs which demonstrate the steps or part of TableFilter
|
||||||
|
the enhancement suggestion is related to](url)
|
||||||
|
|
||||||
|
**TableFilter Version:** [Enter TableFilter version here]
|
||||||
|
**Browser and version:** [Enter Browser name and version here]
|
||||||
|
**OS and version:** [Enter OS name and version here]
|
||||||
|
|
||||||
|
## Code contribution
|
||||||
|
TableFilter welcomes contributions from anyone and everyone. If you want to get
|
||||||
|
your hands dirty:
|
||||||
|
|
||||||
|
### Pull requests
|
||||||
|
In general, we follow the "fork-and-pull" Git workflow.
|
||||||
|
|
||||||
|
1. **Fork** the repo on GitHub
|
||||||
|
2. **Clone** the project to your own machine
|
||||||
|
3. **Commit** changes to your own branch
|
||||||
|
- 3.1. **Add** unit tests covering your change in the `test` folder
|
||||||
|
- 3.2. **Run** the tests with the `npm run eslint test` command
|
||||||
|
- 3.3. **Ensure** build is working with `npm run build-all` command
|
||||||
|
4. **Push** your work back up to your fork
|
||||||
|
5. Submit a **Pull request** so that we can review your changes
|
||||||
|
|
||||||
|
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
|
||||||
|
|
||||||
|
## Donations
|
||||||
|
To support this project simply locate the `Donate` button in the [project's
|
||||||
|
website](http://koalyptus.github.io/TableFilter/)
|
||||||
|
which points to PayPal.
|
||||||
|
Thanks to all those who supported this project in the past and to those who will
|
||||||
|
in the future!
|
48
Gruntfile.js
|
@ -2,12 +2,14 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var webpackConfig = require('./webpack.config.js');
|
var webpackConfig = require('./webpack.config.js');
|
||||||
|
var webpackTestConfig = require('./webpack.test.config.js');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var testDir = 'test';
|
var testDir = 'test';
|
||||||
var testHost = 'http://localhost:8000/';
|
var testHost = 'http://localhost:8000/';
|
||||||
var pkg = grunt.file.readJSON('package.json');
|
var pkg = grunt.file.readJSON('package.json');
|
||||||
var repo = 'github.com/koalyptus/TableFilter';
|
var repo = 'github.com/koalyptus/TableFilter';
|
||||||
|
var styleDirDist = 'dist/tablefilter/style/';
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
|
||||||
|
@ -24,6 +26,19 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
|
|
||||||
qunit: {
|
qunit: {
|
||||||
|
options: {
|
||||||
|
'--web-security': 'no',
|
||||||
|
coverage: {
|
||||||
|
disposeCollector: true,
|
||||||
|
src: ['dist/tablefilter/*.js'],
|
||||||
|
instrumentedFiles: 'temp/',
|
||||||
|
htmlReport: 'report/coverage',
|
||||||
|
coberturaReport: 'report/',
|
||||||
|
lcovReport: 'report/',
|
||||||
|
jsonReport: 'report',
|
||||||
|
linesThresholdPct: 80
|
||||||
|
}
|
||||||
|
},
|
||||||
all: {
|
all: {
|
||||||
options: {
|
options: {
|
||||||
urls: getTestFiles(testDir, testHost)
|
urls: getTestFiles(testDir, testHost)
|
||||||
|
@ -127,7 +142,8 @@ module.exports = function (grunt) {
|
||||||
webpack: {
|
webpack: {
|
||||||
options: webpackConfig,
|
options: webpackConfig,
|
||||||
build: webpackConfig.build,
|
build: webpackConfig.build,
|
||||||
dev: webpackConfig.dev
|
dev: webpackConfig.dev,
|
||||||
|
test: webpackTestConfig
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -187,25 +203,26 @@ module.exports = function (grunt) {
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
src: ['static/style/*.styl'],
|
src: ['static/style/*.styl'],
|
||||||
dest: 'dist/tablefilter/style/tablefilter.css'
|
dest: styleDirDist + 'tablefilter.css'
|
||||||
}, {
|
}, {
|
||||||
src: ['static/style/extensions/colsVisibility.styl'],
|
src: ['static/style/extensions/colsVisibility.styl'],
|
||||||
dest: 'dist/tablefilter/style/colsVisibility.css'
|
dest: styleDirDist + 'colsVisibility.css'
|
||||||
}, {
|
}, {
|
||||||
src: ['static/style/extensions/filtersVisibility.styl'],
|
src: ['static/style/extensions/filtersVisibility.styl'],
|
||||||
dest: 'dist/tablefilter/style/filtersVisibility.css'
|
dest: styleDirDist + 'filtersVisibility.css'
|
||||||
}, {
|
}, {
|
||||||
src: ['static/style/themes/default/*.styl'],
|
src: ['static/style/themes/default/*.styl'],
|
||||||
dest:
|
dest: styleDirDist + 'themes/default/default.css'
|
||||||
'dist/tablefilter/style/themes/default/default.css'
|
|
||||||
}, {
|
}, {
|
||||||
src: ['static/style/themes/mytheme/*.styl'],
|
src: ['static/style/themes/mytheme/*.styl'],
|
||||||
dest:
|
dest: styleDirDist + 'themes/mytheme/mytheme.css'
|
||||||
'dist/tablefilter/style/themes/mytheme/mytheme.css'
|
|
||||||
}, {
|
}, {
|
||||||
src: ['static/style/themes/skyblue/*.styl'],
|
src: ['static/style/themes/skyblue/*.styl'],
|
||||||
|
dest: styleDirDist + 'themes/skyblue/skyblue.css'
|
||||||
|
}, {
|
||||||
|
src: ['static/style/themes/transparent/*.styl'],
|
||||||
dest:
|
dest:
|
||||||
'dist/tablefilter/style/themes/skyblue/skyblue.css'
|
styleDirDist + 'themes/transparent/transparent.css'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -284,7 +301,6 @@ module.exports = function (grunt) {
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-eslint');
|
grunt.loadNpmTasks('grunt-eslint');
|
||||||
grunt.loadNpmTasks('grunt-contrib-qunit');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
|
@ -293,10 +309,11 @@ module.exports = function (grunt) {
|
||||||
grunt.loadNpmTasks('grunt-webpack');
|
grunt.loadNpmTasks('grunt-webpack');
|
||||||
grunt.loadNpmTasks('grunt-babel');
|
grunt.loadNpmTasks('grunt-babel');
|
||||||
grunt.loadNpmTasks('grunt-esdoc');
|
grunt.loadNpmTasks('grunt-esdoc');
|
||||||
|
grunt.loadNpmTasks('grunt-qunit-istanbul');
|
||||||
grunt.loadNpmTasks('grunt-contrib-stylus');
|
grunt.loadNpmTasks('grunt-contrib-stylus');
|
||||||
grunt.loadNpmTasks('grunt-gh-pages');
|
grunt.loadNpmTasks('grunt-gh-pages');
|
||||||
|
|
||||||
grunt.registerTask('default', ['build', 'test', 'build-demos']);
|
grunt.registerTask('default', ['test', 'build', 'build-demos']);
|
||||||
|
|
||||||
// Development server
|
// Development server
|
||||||
grunt.registerTask('server', ['webpack-dev-server:start']);
|
grunt.registerTask('server', ['webpack-dev-server:start']);
|
||||||
|
@ -314,11 +331,15 @@ module.exports = function (grunt) {
|
||||||
grunt.registerTask('build-demos', ['copy:templates', 'copy:assets',
|
grunt.registerTask('build-demos', ['copy:templates', 'copy:assets',
|
||||||
'string-replace:demos', 'copy:starter', 'clean']);
|
'string-replace:demos', 'copy:starter', 'clean']);
|
||||||
|
|
||||||
|
// Build tests
|
||||||
|
grunt.registerTask('build-test',
|
||||||
|
['eslint', 'webpack:test', 'copy:dist', 'stylus:compile']);
|
||||||
|
|
||||||
// Transpile with Babel
|
// Transpile with Babel
|
||||||
grunt.registerTask('dev-modules', ['babel', 'copy:dist']);
|
grunt.registerTask('dev-modules', ['babel', 'copy:dist']);
|
||||||
|
|
||||||
// Tests
|
// Tests with coverage
|
||||||
grunt.registerTask('test', ['eslint', 'connect', 'qunit:all']);
|
grunt.registerTask('test', ['build-test', 'connect', 'qunit:all']);
|
||||||
|
|
||||||
// Publish to gh-pages
|
// Publish to gh-pages
|
||||||
grunt.registerTask('publish', 'Publish from CLI', [
|
grunt.registerTask('publish', 'Publish from CLI', [
|
||||||
|
@ -374,7 +395,6 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
// Returns the list of test files from the test folder for qunit task
|
// Returns the list of test files from the test folder for qunit task
|
||||||
function getTestFiles(testDir, host) {
|
function getTestFiles(testDir, host) {
|
||||||
|
|
||||||
var getFiles = function (dir, host) {
|
var getFiles = function (dir, host) {
|
||||||
var res = [];
|
var res = [];
|
||||||
var items = fs.readdirSync(dir);
|
var items = fs.readdirSync(dir);
|
||||||
|
|
63
README.md
|
@ -1,5 +1,6 @@
|
||||||
[![Build Status](https://api.travis-ci.org/koalyptus/TableFilter.svg?branch=master)](https://travis-ci.org/koalyptus/TableFilter)
|
[![Build Status](https://api.travis-ci.org/koalyptus/TableFilter.svg?branch=master)](https://travis-ci.org/koalyptus/TableFilter)
|
||||||
[![Document](http://koalyptus.github.io/TableFilter/docs/badge.svg)](https://koalyptus.github.io/TableFilter/docs/source)
|
[![Document](http://koalyptus.github.io/TableFilter/docs/badge.svg)](https://koalyptus.github.io/TableFilter/docs/source)
|
||||||
|
[![codecov](https://codecov.io/gh/koalyptus/TableFilter/branch/master/graph/badge.svg)](https://codecov.io/gh/koalyptus/TableFilter)
|
||||||
|
|
||||||
# TableFilter
|
# TableFilter
|
||||||
|
|
||||||
|
@ -12,7 +13,7 @@ users to filter and limit the data displayed within a long table. By default, th
|
||||||
## Features
|
## Features
|
||||||
* Convert a regular HTML table into an advanced grid component providing:
|
* Convert a regular HTML table into an advanced grid component providing:
|
||||||
* Advanced columns filtering model
|
* Advanced columns filtering model
|
||||||
* Sorting and pagination facilities
|
* Sorting and pagination capabilities
|
||||||
* Complete selection model ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
* Complete selection model ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
||||||
* Extended keyboard navigation ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
* Extended keyboard navigation ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
||||||
* Inline cell or row editing ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
* Inline cell or row editing ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
||||||
|
@ -26,7 +27,7 @@ solution
|
||||||
## Getting started
|
## Getting started
|
||||||
* Clone the repo using Git:
|
* Clone the repo using Git:
|
||||||
```shell
|
```shell
|
||||||
git clone --bare https://github.com/koalyptus/TableFilter.git
|
git clone https://github.com/koalyptus/TableFilter.git
|
||||||
```
|
```
|
||||||
|
|
||||||
* You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository.
|
* You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository.
|
||||||
|
@ -76,46 +77,52 @@ Start by installing any dependencies.
|
||||||
```shell
|
```shell
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
Use the Grunt ``dev`` task to launch a build / watch cycle and start the local
|
Use
|
||||||
sever on port ``8080``:
|
```shell
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
command to launch a build / watch cycle and start the local
|
||||||
|
sever on port ``8080``.
|
||||||
|
|
||||||
|
Use
|
||||||
|
```shell
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
command to generate a production build.
|
||||||
|
|
||||||
|
The
|
||||||
|
```shell
|
||||||
|
npm run build-all
|
||||||
|
```
|
||||||
|
command will create a production build, run the tests and finally generate
|
||||||
|
the demos:
|
||||||
|
|
||||||
|
To run all the tests and generate the coverage report:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
grunt dev
|
npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the ``build`` task to generate a production build:
|
or to run specific test(s):
|
||||||
|
|
||||||
```shell
|
|
||||||
grunt build
|
|
||||||
```
|
|
||||||
|
|
||||||
The ``default`` Grunt task will create a production build, run the tests and finally generate the demos:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
grunt
|
|
||||||
```
|
|
||||||
|
|
||||||
To run all the tests:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
grunt test
|
|
||||||
```
|
|
||||||
|
|
||||||
and to run specific test(s):
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
grunt test-only:test.html
|
grunt test-only:test.html
|
||||||
grunt test-only:test.html,test-sort.html
|
grunt test-only:test.html,test-sort.html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
to view the coverage report(s), open the `index.html` under the
|
||||||
|
`report/coverage` folder or
|
||||||
|
[online](https://codecov.io/gh/koalyptus/TableFilter).
|
||||||
|
|
||||||
## Demos
|
## Demos
|
||||||
Check out the online [examples](http://koalyptus.github.io/TableFilter/examples) or generate the demos locally:
|
Check out the online [examples](http://koalyptus.github.io/TableFilter/examples)
|
||||||
|
or generate the demos locally:
|
||||||
```shell
|
```shell
|
||||||
grunt build-demos
|
npm run build-demos
|
||||||
```
|
```
|
||||||
then run the local webserver:
|
then run the local webserver:
|
||||||
```shell
|
```shell
|
||||||
grunt server
|
npm start
|
||||||
```
|
```
|
||||||
then pick a demo from:
|
then pick a demo from:
|
||||||
```shell
|
```shell
|
||||||
|
@ -132,7 +139,7 @@ options you are using are still supported: [Obsolete](https://github.com/koalypt
|
||||||
|
|
||||||
Run this task to generate the documentation in the ``docs/docs`` directory:
|
Run this task to generate the documentation in the ``docs/docs`` directory:
|
||||||
```shell
|
```shell
|
||||||
grunt esdoc
|
npm run esdoc
|
||||||
```
|
```
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
4
dist/starter.html
vendored
|
@ -1,10 +1,10 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>tablefilter v0.4.10 - Starter</title>
|
<title>tablefilter v0.4.21 - Starter</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>tablefilter v0.4.10</h1>
|
<h1>tablefilter v0.4.21</h1>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
4
dist/tablefilter/style/colsVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
span.colVisSpan{text-align:left;}span.colVisSpan a.colVis{display:inline-block;padding:7px 5px 0;font-size:inherit;font-weight:inherit;vertical-align:top}div.colVisCont{position:relative;background:#fff;-webkit-box-shadow:3px 3px 2px #888;-moz-box-shadow:3px 3px 2px #888;box-shadow:3px 3px 2px #888;position:absolute;display:none;border:1px solid #ccc;height:auto;width:250px;background-color:#fff;margin:35px 0 0 -100px;z-index:10000;padding:10px 10px 10px 10px;text-align:left;font-size:12px;}div.colVisCont:after,div.colVisCont:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.colVisCont:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:10px;margin-left:-10px}div.colVisCont:before{border-color:rgba(255,255,255,0);border-bottom-color:#ccc;border-width:12px;margin-left:-12px}div.colVisCont p{margin:6px auto 6px auto}div.colVisCont a.colVis{display:initial;font-weight:inherit}ul.cols_checklist{padding:0;margin:0;list-style:none;}ul.cols_checklist label{display:block}ul.cols_checklist input{vertical-align:middle;margin:2px 5px 2px 1px}li.cols_checklist_item{padding:4px;margin:0;}li.cols_checklist_item:hover{background-color:#335ea8;color:#fff}.cols_checklist_slc_item{background-color:#335ea8;color:#fff}
|
span.colVisSpan{text-align:left;}span.colVisSpan a.colVis{display:inline-block;padding:7px 5px 0;font-size:inherit;font-weight:inherit;vertical-align:top}div.colVisCont{position:relative;background:#fff;-webkit-box-shadow:3px 3px 2px #888;-moz-box-shadow:3px 3px 2px #888;box-shadow:3px 3px 2px #888;position:absolute;display:none;border:1px solid #ccc;height:auto;width:250px;background-color:#fff;margin:35px 0 0 -100px;z-index:10000;padding:10px 10px 10px 10px;text-align:left;font-size:12px;}div.colVisCont:after,div.colVisCont:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.colVisCont:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:10px;margin-left:-10px}div.colVisCont:before{border-color:rgba(255,255,255,0);border-bottom-color:#ccc;border-width:12px;margin-left:-12px}div.colVisCont p{margin:6px auto 6px auto}div.colVisCont a.colVis{display:initial;font-weight:inherit}ul.cols_checklist{padding:0;margin:0;list-style:none;}ul.cols_checklist label{display:block}ul.cols_checklist input{vertical-align:middle;margin:2px 5px 2px 1px}li.cols_checklist_item{padding:4px;margin:0;}li.cols_checklist_item:hover{background-color:#335ea8;color:#fff}.cols_checklist_slc_item{background-color:#335ea8;color:#fff}
|
4
dist/tablefilter/style/filtersVisibility.css
vendored
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
span.expClpFlt a.btnExpClpFlt{width:35px;height:35px;display:inline-block;}span.expClpFlt a.btnExpClpFlt:hover{background-color:#f4f4f4}span.expClpFlt img{padding:8px 11px 11px 11px}
|
span.expClpFlt a.btnExpClpFlt{width:35px;height:35px;display:inline-block;}span.expClpFlt a.btnExpClpFlt:hover{background-color:#f4f4f4}span.expClpFlt img{padding:8px 11px 11px 11px}
|
4
dist/tablefilter/style/tablefilter.css
vendored
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
.activeHeader{background-color:#66afe9 !important;color:#fff !important}
|
.activeHeader{background-color:#66afe9 !important;color:#fff !important}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important}
|
table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important}
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important}
|
table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important}
|
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
* tablefilter v0.4.10 by Max Guglielmi
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
* build date: 2016-11-15T10:07:54.981Z
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
* MIT License
|
* MIT License
|
||||||
*/
|
*/
|
||||||
table.TF{padding:0;color:#000;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-left:1px solid #a4bed4;border-bottom:0;}table.TF th{margin:0;color:inherit;background:#d1e5fe url("images/bg_skyblue.gif") 0 0 repeat-x;border-color:#fdfdfd #a4bed4 #a4bed4 #fdfdfd;border-width:1px;border-style:solid}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid #a4bed4;border-left:0;border-top:0;border-right:0}.fltrow{background-color:#d1e5fe !important;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4 !important}input.flt{width:99% !important}.inf{background-color:#e3efff !important;border:1px solid #a4bed4;height:$min-height;color:#004a6f}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#ffe4ab url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#ffe4ab url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#ffe4ab url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#ffe4ab url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.activeHeader{background:#ffe4ab !important;border:1px solid #ffb552 !important;color:inherit !important}div.grd_Cont{background-color:#d9eaed !important;border:1px solid #9cc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#e3efff}div.grd_headTblCont{background-color:#d9eaed !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#d9eaed url("images/bg_skyblue.gif") left top repeat-x;border-bottom:1px solid #a4bed4;border-right:1px solid #a4bed4 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #a4bed4 !important;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:#cce2fe;color:#004a6f;border-top:1px solid #9cc !important;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#2d8eef;border:1px solid #cce2fe;border-radius:5px}.even{background-color:#fff}.odd{background-color:#e3efff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ffdc61 !important;color:inherit}.ezSelectedRow{background-color:#ffe4ab !important;color:inherit}.ezActiveCell{background-color:#fff !important;color:#000 !important;font-weight:bold}.ezETSelectedCell{background-color:#fff !important;font-weight:bold;color:#000 !important}
|
table.TF{padding:0;color:#000;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-left:1px solid #a4bed4;border-bottom:0;}table.TF th{margin:0;color:inherit;background:#d1e5fe url("images/bg_skyblue.gif") 0 0 repeat-x;border-color:#fdfdfd #a4bed4 #a4bed4 #fdfdfd;border-width:1px;border-style:solid}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid #a4bed4;border-left:0;border-top:0;border-right:0}.fltrow{background-color:#d1e5fe !important;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4 !important}input.flt{width:99% !important}.inf{background-color:#e3efff !important;border:1px solid #a4bed4;height:$min-height;color:#004a6f}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#ffe4ab url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#ffe4ab url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#ffe4ab url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#ffe4ab url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.activeHeader{background:#ffe4ab !important;border:1px solid #ffb552 !important;color:inherit !important}div.grd_Cont{background-color:#d9eaed !important;border:1px solid #9cc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#e3efff}div.grd_headTblCont{background-color:#d9eaed !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#d9eaed url("images/bg_skyblue.gif") left top repeat-x;border-bottom:1px solid #a4bed4;border-right:1px solid #a4bed4 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #a4bed4 !important;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:#cce2fe;color:#004a6f;border-top:1px solid #9cc !important;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#2d8eef;border:1px solid #cce2fe;border-radius:5px}.even{background-color:#fff}.odd{background-color:#e3efff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ffdc61 !important;color:inherit}.ezSelectedRow{background-color:#ffe4ab !important;color:inherit}.ezActiveCell{background-color:#fff !important;color:#000 !important;font-weight:bold}.ezETSelectedCell{background-color:#fff !important;font-weight:bold;color:#000 !important}
|
BIN
dist/tablefilter/style/themes/transparent/images/btn_first_page.gif
vendored
Normal file
After Width: | Height: | Size: 63 B |
BIN
dist/tablefilter/style/themes/transparent/images/btn_last_page.gif
vendored
Normal file
After Width: | Height: | Size: 61 B |
BIN
dist/tablefilter/style/themes/transparent/images/btn_next_page.gif
vendored
Normal file
After Width: | Height: | Size: 59 B |
BIN
dist/tablefilter/style/themes/transparent/images/btn_prev_page.gif
vendored
Normal file
After Width: | Height: | Size: 58 B |
BIN
dist/tablefilter/style/themes/transparent/images/icn_clear_filters.png
vendored
Normal file
After Width: | Height: | Size: 601 B |
BIN
dist/tablefilter/style/themes/transparent/images/img_loading.gif
vendored
Normal file
After Width: | Height: | Size: 847 B |
6
dist/tablefilter/style/themes/transparent/transparent.css
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
/**
|
||||||
|
* tablefilter v0.4.21 by Max Guglielmi
|
||||||
|
* build date: 2016-12-09T12:28:56.305Z
|
||||||
|
* MIT License
|
||||||
|
*/
|
||||||
|
table.TF{padding:0;color:inherit;border-right:1px solid transparent;border-top:1px solid transparent;border-left:1px solid transparent;border-bottom:0;}table.TF th{margin:0;color:inherit;background-color:transparent;border-color:transparent;border-width:1px;border-style:solid;}table.TF th:last-child{border-right:1px solid transparent}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid transparent;border-left:0;border-top:0;border-right:0}.fltrow{background-color:transparent;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px;border-bottom:1px solid transparent !important;}.fltrow th:last-child,.fltrow td:last-child{border-right:1px solid transparent}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4}input.flt{width:99% !important}.inf{background-color:transparent;border:1px solid transparent;height:$min-height;color:inherit}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#f7f7f7 url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#f7f7f7 url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#f7f7f7 url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#f7f7f7 url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #f7f7f7 !important}.activeHeader{background:#f7f7f7 !important;border:1px solid transparent;color:inherit !important}div.grd_Cont{-webkit-box-shadow:0 0 0 0 rgba(50,50,50,0.75);-moz-box-shadow:0 0 0 0 rgba(50,50,50,0.75);box-shadow:0 0 0 0 rgba(50,50,50,0.75);background-color:transparent;border:1px solid transparent;padding:0 !important;}div.grd_Cont .even{background-color:transparent}div.grd_Cont .odd{background-color:#f7f7f7}div.grd_headTblCont{background-color:transparent;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:transparent;border-bottom:1px solid transparent;border-right:1px solid transparent !important;border-left:1px solid transparent;border-top:1px solid transparent}div.grd_tblCont table td{border-bottom:1px solid transparent;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:transparent;color:inherit;border-top:1px solid transparent;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#f7f7f7;border:1px solid #f7f7f7;border-radius:5px;color:#000;text-shadow:none}.even{background-color:transparent}.odd{background-color:#f7f7f7}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ccc !important;color:inherit}.ezSelectedRow{background-color:#ccc !important;color:inherit}.ezActiveCell{background-color:transparent;color:inherit;font-weight:bold}.ezETSelectedCell{background-color:transparent;font-weight:bold;color:inherit}
|
18
dist/tablefilter/tablefilter.js
vendored
6
dist/tablefilter/tf-1.js
vendored
22
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "tablefilter",
|
"name": "tablefilter",
|
||||||
"version": "0.4.10",
|
"version": "0.4.21",
|
||||||
"description": "A Javascript library making HTML tables filterable and a bit more",
|
"description": "A Javascript library making HTML tables filterable and a bit more",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": {
|
"author": {
|
||||||
|
@ -28,37 +28,43 @@
|
||||||
"server": "grunt server",
|
"server": "grunt server",
|
||||||
"eslint": "grunt eslint",
|
"eslint": "grunt eslint",
|
||||||
"test": "grunt test",
|
"test": "grunt test",
|
||||||
|
"codecov": "./node_modules/.bin/codecov",
|
||||||
"esdoc": "grunt esdoc",
|
"esdoc": "grunt esdoc",
|
||||||
"all": "grunt"
|
"build-all": "grunt",
|
||||||
|
"deploy": "grunt deploy",
|
||||||
|
"start": "npm run server"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"tag": "next"
|
"tag": "next"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.18.2",
|
"babel-core": "^6.20.0",
|
||||||
"babel-eslint": "7.1.0",
|
"babel-eslint": "7.1.1",
|
||||||
"babel-loader": "^6.2.6",
|
"babel-loader": "^6.2.9",
|
||||||
"babel-plugin-transform-es2015-classes": "^6.18.0",
|
"babel-plugin-transform-es2015-classes": "^6.18.0",
|
||||||
"babel-preset-es2015": "^6.18.0",
|
"babel-preset-es2015": "^6.18.0",
|
||||||
"clean-webpack-plugin": "^0.1.14",
|
"clean-webpack-plugin": "^0.1.14",
|
||||||
|
"codecov": "1.0.1",
|
||||||
"diacritics": "1.2.3",
|
"diacritics": "1.2.3",
|
||||||
"grunt": "^1.0.1",
|
"grunt": "^1.0.1",
|
||||||
"grunt-babel": "^6.0.0",
|
"grunt-babel": "^6.0.0",
|
||||||
|
"grunt-cli": "1.2.0",
|
||||||
"grunt-contrib-clean": "^1.0.0",
|
"grunt-contrib-clean": "^1.0.0",
|
||||||
"grunt-contrib-connect": "^1.0.2",
|
"grunt-contrib-connect": "^1.0.2",
|
||||||
"grunt-contrib-copy": "^1.0.0",
|
"grunt-contrib-copy": "^1.0.0",
|
||||||
"grunt-contrib-qunit": "^1.1.0",
|
|
||||||
"grunt-contrib-stylus": "^1.2.0",
|
"grunt-contrib-stylus": "^1.2.0",
|
||||||
"grunt-contrib-watch": "^1.0.0",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"grunt-esdoc": "^0.0.4",
|
"grunt-esdoc": "^0.0.4",
|
||||||
"grunt-eslint": "19.0.0",
|
"grunt-eslint": "19.0.0",
|
||||||
"grunt-gh-pages": "^2.0.0",
|
"grunt-gh-pages": "^2.0.0",
|
||||||
|
"grunt-qunit-istanbul": "1.0.0",
|
||||||
"grunt-string-replace": "^1.3.1",
|
"grunt-string-replace": "^1.3.1",
|
||||||
"grunt-webpack": "^1.0.18",
|
"grunt-webpack": "^1.0.18",
|
||||||
|
"isparta-loader": "2.0.0",
|
||||||
"script-loader": "^0.7.0",
|
"script-loader": "^0.7.0",
|
||||||
"string-replace-webpack-plugin": "^0.0.4",
|
"string-replace-webpack-plugin": "^0.0.4",
|
||||||
"sugar-date": "2.0.2",
|
"sugar-date": "2.0.4",
|
||||||
"webpack": "^1.13.3",
|
"webpack": "^1.14.0",
|
||||||
"webpack-dev-server": "^1.16.2"
|
"webpack-dev-server": "^1.16.2"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const addEvt = (obj, type, func, capture) => {
|
||||||
* @param {Boolean} capture Specifiy whether the event should be executed in
|
* @param {Boolean} capture Specifiy whether the event should be executed in
|
||||||
* the capturing or in the bubbling phase
|
* the capturing or in the bubbling phase
|
||||||
*/
|
*/
|
||||||
export const removeEvt = (obj, type, func, capture) =>{
|
export const removeEvt = (obj, type, func, capture) => {
|
||||||
if (obj.detachEvent) {
|
if (obj.detachEvent) {
|
||||||
obj.detachEvent('on' + type, func);
|
obj.detachEvent('on' + type, func);
|
||||||
}
|
}
|
||||||
|
|
|
@ -470,7 +470,9 @@ export default class AdapterSortableTable extends Feature {
|
||||||
let colType = `${DATE}-${locale}`;
|
let colType = `${DATE}-${locale}`;
|
||||||
|
|
||||||
this.addSortType(colType, (value) => {
|
this.addSortType(colType, (value) => {
|
||||||
return dateType.parse(value, locale);
|
let parsedDate = dateType.parse(value, locale);
|
||||||
|
// Invalid date defaults to Wed Feb 04 -768 11:00:00
|
||||||
|
return isNaN(+parsedDate) ? new Date(-86400000000000) : parsedDate;
|
||||||
});
|
});
|
||||||
return colType;
|
return colType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,7 @@ export class AlternateRows extends Feature {
|
||||||
this.processRow(rowIndex, arrIndex, isValid));
|
this.processRow(rowIndex, arrIndex, isValid));
|
||||||
this.emitter.on(['column-sorted'], () => this.processAll());
|
this.emitter.on(['column-sorted'], () => this.processAll());
|
||||||
|
|
||||||
/**
|
/** @inherited */
|
||||||
* @inherited
|
|
||||||
*/
|
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,8 @@ export class CheckList extends Feature {
|
||||||
let tf = this.tf;
|
let tf = this.tf;
|
||||||
let chkCt = 1;
|
let chkCt = 1;
|
||||||
let fltId = tf.fltIds[colIndex];
|
let fltId = tf.fltIds[colIndex];
|
||||||
let li0 = createCheckItem(`${fltId}_0`, '', tf.displayAllText);
|
let li0 = createCheckItem(`${fltId}_0`, '',
|
||||||
|
tf.getClearFilterText(colIndex));
|
||||||
li0.className = this.itemCssClass;
|
li0.className = this.itemCssClass;
|
||||||
ul.appendChild(li0);
|
ul.appendChild(li0);
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ export class Dropdown extends Feature {
|
||||||
this.build(colIndex);
|
this.build(colIndex);
|
||||||
} else {
|
} else {
|
||||||
//1st option is created here since build isn't invoked
|
//1st option is created here since build isn't invoked
|
||||||
let opt0 = createOpt(tf.displayAllText, '');
|
let opt0 = createOpt(tf.getClearFilterText(colIndex), '');
|
||||||
slc.appendChild(opt0);
|
slc.appendChild(opt0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,9 +342,9 @@ export class Dropdown extends Feature {
|
||||||
*/
|
*/
|
||||||
addFirstOption(slc) {
|
addFirstOption(slc) {
|
||||||
let tf = this.tf;
|
let tf = this.tf;
|
||||||
|
let colIdx = tf.getColumnIndexFromFilterId(slc.id);
|
||||||
let opt0 = createOpt(
|
let opt0 = createOpt((!this.enableSlcResetFilter ?
|
||||||
(!this.enableSlcResetFilter ? '' : tf.displayAllText), '');
|
'' : tf.getClearFilterText(colIdx)), '');
|
||||||
if (!this.enableSlcResetFilter) {
|
if (!this.enableSlcResetFilter) {
|
||||||
opt0.style.display = NONE;
|
opt0.style.display = NONE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import {Feature} from '../feature';
|
import {Feature} from '../feature';
|
||||||
import {isFn} from '../types';
|
import {isFn, isUndef} from '../types';
|
||||||
import {createElm, removeElm} from '../dom';
|
import {createElm, removeElm} from '../dom';
|
||||||
import {addEvt, cancelEvt, stopEvt, targetEvt} from '../event';
|
import {addEvt, cancelEvt, stopEvt, targetEvt, removeEvt} from '../event';
|
||||||
import {INPUT, NONE} from '../const';
|
import {INPUT, NONE, CHECKLIST, MULTIPLE} from '../const';
|
||||||
|
import {root} from '../root';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop-up filter component
|
* Pop-up filter component
|
||||||
|
@ -26,6 +27,13 @@ export class PopupFilter extends Feature {
|
||||||
tf.isExternalFlt = true;
|
tf.isExternalFlt = true;
|
||||||
tf.externalFltTgtIds = [];
|
tf.externalFltTgtIds = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close active popup filter upon filtering, enabled by default
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
|
this.closeOnFiltering = f.popup_filters_close_on_filtering === false ?
|
||||||
|
false : true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter icon path
|
* Filter icon path
|
||||||
* @type {String}
|
* @type {String}
|
||||||
|
@ -53,6 +61,14 @@ export class PopupFilter extends Feature {
|
||||||
*/
|
*/
|
||||||
this.containerCssClass = f.popup_div_css_class || 'popUpFilter';
|
this.containerCssClass = f.popup_div_css_class || 'popUpFilter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure filter's container element width matches column width, enabled
|
||||||
|
* by default
|
||||||
|
* @type {Boolean}
|
||||||
|
*/
|
||||||
|
this.adjustToContainer =
|
||||||
|
f.popup_filters_adjust_to_container === false ? false : true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback fired before a popup filter is opened
|
* Callback fired before a popup filter is opened
|
||||||
* @type {Function}
|
* @type {Function}
|
||||||
|
@ -109,18 +125,19 @@ export class PopupFilter extends Feature {
|
||||||
*/
|
*/
|
||||||
this.fltElms = this.filtersCache || [];
|
this.fltElms = this.filtersCache || [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensure filter's container element width matches column width
|
|
||||||
* @type {Boolean}
|
|
||||||
*/
|
|
||||||
this.adjustToContainer = true;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prefix for pop-up filter container ID
|
* Prefix for pop-up filter container ID
|
||||||
* @type {String}
|
* @type {String}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.prfxDiv = 'popup_';
|
this.prfxDiv = 'popup_';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Column index of popup filter currently active
|
||||||
|
* @type {Number}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
this.activeFilterIdx = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,22 +145,49 @@ export class PopupFilter extends Feature {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
onClick(evt) {
|
onClick(evt) {
|
||||||
let elm = targetEvt(evt).parentNode,
|
let elm = targetEvt(evt).parentNode;
|
||||||
colIndex = parseInt(elm.getAttribute('ci'), 10);
|
let colIndex = parseInt(elm.getAttribute('ci'), 10);
|
||||||
|
|
||||||
this.closeAll(colIndex);
|
this.closeAll(colIndex);
|
||||||
this.toggle(colIndex);
|
this.toggle(colIndex);
|
||||||
|
|
||||||
if (this.adjustToContainer) {
|
if (this.adjustToContainer) {
|
||||||
let popUpDiv = this.fltElms[colIndex],
|
let cont = this.fltElms[colIndex],
|
||||||
header = this.tf.getHeaderElement(colIndex),
|
header = this.tf.getHeaderElement(colIndex),
|
||||||
headerWidth = header.clientWidth * 0.95;
|
headerWidth = header.clientWidth * 0.95;
|
||||||
popUpDiv.style.width = parseInt(headerWidth, 10) + 'px';
|
cont.style.width = parseInt(headerWidth, 10) + 'px';
|
||||||
}
|
}
|
||||||
cancelEvt(evt);
|
cancelEvt(evt);
|
||||||
stopEvt(evt);
|
stopEvt(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mouse-up event handler handling popup filter auto-close behaviour
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
onMouseup(evt) {
|
||||||
|
if (this.activeFilterIdx === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let targetElm = targetEvt(evt);
|
||||||
|
let activeFlt = this.fltElms[this.activeFilterIdx];
|
||||||
|
let icon = this.fltIcons[this.activeFilterIdx];
|
||||||
|
|
||||||
|
if (icon === targetElm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (targetElm && targetElm !== activeFlt) {
|
||||||
|
targetElm = targetElm.parentNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetElm !== activeFlt) {
|
||||||
|
this.close(this.activeFilterIdx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize DOM elements
|
* Initialize DOM elements
|
||||||
*/
|
*/
|
||||||
|
@ -178,9 +222,7 @@ export class PopupFilter extends Feature {
|
||||||
this.emitter.on(['before-filter-init'],
|
this.emitter.on(['before-filter-init'],
|
||||||
(tf, colIndex) => this.build(colIndex));
|
(tf, colIndex) => this.build(colIndex));
|
||||||
|
|
||||||
/**
|
/** @inherited */
|
||||||
* @inherited
|
|
||||||
*/
|
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,6 +232,7 @@ export class PopupFilter extends Feature {
|
||||||
reset() {
|
reset() {
|
||||||
this.enable();
|
this.enable();
|
||||||
this.init();
|
this.init();
|
||||||
|
this.buildIcons();
|
||||||
this.buildAll();
|
this.buildAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,13 +250,13 @@ export class PopupFilter extends Feature {
|
||||||
if (tf.getFilterType(i) === NONE) {
|
if (tf.getFilterType(i) === NONE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let popUpSpan = createElm('span', ['ci', i]);
|
let icon = createElm('span', ['ci', i]);
|
||||||
popUpSpan.innerHTML = this.iconHtml;
|
icon.innerHTML = this.iconHtml;
|
||||||
let header = tf.getHeaderElement(i);
|
let header = tf.getHeaderElement(i);
|
||||||
header.appendChild(popUpSpan);
|
header.appendChild(icon);
|
||||||
addEvt(popUpSpan, 'click', (evt) => this.onClick(evt));
|
addEvt(icon, 'click', (evt) => this.onClick(evt));
|
||||||
this.fltSpans[i] = popUpSpan;
|
this.fltSpans[i] = icon;
|
||||||
this.fltIcons[i] = popUpSpan.firstChild;
|
this.fltIcons[i] = icon.firstChild;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,31 +277,43 @@ export class PopupFilter extends Feature {
|
||||||
build(colIndex, div) {
|
build(colIndex, div) {
|
||||||
let tf = this.tf;
|
let tf = this.tf;
|
||||||
let contId = `${this.prfxDiv}${tf.id}_${colIndex}`;
|
let contId = `${this.prfxDiv}${tf.id}_${colIndex}`;
|
||||||
let popUpDiv = div || createElm('div', ['id', contId]);
|
let cont = div || createElm('div', ['id', contId]);
|
||||||
popUpDiv.className = this.containerCssClass;
|
cont.className = this.containerCssClass;
|
||||||
tf.externalFltTgtIds.push(popUpDiv.id);
|
tf.externalFltTgtIds.push(cont.id);
|
||||||
|
|
||||||
let header = tf.getHeaderElement(colIndex);
|
let header = tf.getHeaderElement(colIndex);
|
||||||
header.insertBefore(popUpDiv, header.firstChild);
|
header.insertBefore(cont, header.firstChild);
|
||||||
addEvt(popUpDiv, 'click', (evt) => stopEvt(evt));
|
addEvt(cont, 'click', (evt) => stopEvt(evt));
|
||||||
this.fltElms[colIndex] = popUpDiv;
|
this.fltElms[colIndex] = cont;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toogle visibility of specified filter
|
* Toggle visibility of specified filter
|
||||||
* @param {Number} colIndex Column index
|
* @param {Number} colIndex Column index
|
||||||
*/
|
*/
|
||||||
toggle(colIndex) {
|
toggle(colIndex) {
|
||||||
let tf = this.tf,
|
if (!this.isOpen(colIndex)) {
|
||||||
popUpFltElm = this.fltElms[colIndex];
|
this.open(colIndex);
|
||||||
|
} else {
|
||||||
if (popUpFltElm.style.display === NONE ||
|
this.close(colIndex);
|
||||||
popUpFltElm.style.display === '') {
|
|
||||||
if (this.onBeforeOpen) {
|
|
||||||
this.onBeforeOpen.call(
|
|
||||||
null, this, this.fltElms[colIndex], colIndex);
|
|
||||||
}
|
}
|
||||||
popUpFltElm.style.display = 'block';
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open popup filter of specified column
|
||||||
|
* @param {Number} colIndex Column index
|
||||||
|
*/
|
||||||
|
open(colIndex) {
|
||||||
|
let tf = this.tf,
|
||||||
|
container = this.fltElms[colIndex];
|
||||||
|
|
||||||
|
if (this.onBeforeOpen) {
|
||||||
|
this.onBeforeOpen.call(null, this, container, colIndex);
|
||||||
|
}
|
||||||
|
container.style.display = 'block';
|
||||||
|
this.activeFilterIdx = colIndex;
|
||||||
|
addEvt(root, 'mouseup', (evt) => this.onMouseup(evt));
|
||||||
|
|
||||||
if (tf.getFilterType(colIndex) === INPUT) {
|
if (tf.getFilterType(colIndex) === INPUT) {
|
||||||
let flt = tf.getFilterElement(colIndex);
|
let flt = tf.getFilterElement(colIndex);
|
||||||
if (flt) {
|
if (flt) {
|
||||||
|
@ -266,20 +321,36 @@ export class PopupFilter extends Feature {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.onAfterOpen) {
|
if (this.onAfterOpen) {
|
||||||
this.onAfterOpen.call(
|
this.onAfterOpen.call(null, this, container, colIndex);
|
||||||
null, this, this.fltElms[colIndex], colIndex);
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close popup filter of specified column
|
||||||
|
* @param {Number} colIndex Column index
|
||||||
|
*/
|
||||||
|
close(colIndex) {
|
||||||
|
let container = this.fltElms[colIndex];
|
||||||
if (this.onBeforeClose) {
|
if (this.onBeforeClose) {
|
||||||
this.onBeforeClose.call(
|
this.onBeforeClose.call(null, this, container, colIndex);
|
||||||
null, this, this.fltElms[colIndex], colIndex);
|
|
||||||
}
|
}
|
||||||
popUpFltElm.style.display = NONE;
|
container.style.display = NONE;
|
||||||
|
if (this.activeFilterIdx === colIndex) {
|
||||||
|
this.activeFilterIdx = -1;
|
||||||
|
}
|
||||||
|
removeEvt(root, 'mouseup', (evt) => this.onMouseup(evt));
|
||||||
if (this.onAfterClose) {
|
if (this.onAfterClose) {
|
||||||
this.onAfterClose.call(
|
this.onAfterClose.call(null, this, container, colIndex);
|
||||||
null, this, this.fltElms[colIndex], colIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if popup filter for specified column is open
|
||||||
|
* @param {Number} colIndex Column index
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
isOpen(colIndex) {
|
||||||
|
return this.fltElms[colIndex].style.display === 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -287,13 +358,23 @@ export class PopupFilter extends Feature {
|
||||||
* @param {Number} exceptIdx Column index of the filter to not close
|
* @param {Number} exceptIdx Column index of the filter to not close
|
||||||
*/
|
*/
|
||||||
closeAll(exceptIdx) {
|
closeAll(exceptIdx) {
|
||||||
|
// Do not close filters only if argument is undefined and close on
|
||||||
|
// filtering option is disabled
|
||||||
|
if (isUndef(exceptIdx) && !this.closeOnFiltering) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (let i = 0; i < this.fltElms.length; i++) {
|
for (let i = 0; i < this.fltElms.length; i++) {
|
||||||
if (i === exceptIdx) {
|
if (i === exceptIdx) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let popUpFltElm = this.fltElms[i];
|
let fltType = tf.getFilterType(i);
|
||||||
if (popUpFltElm) {
|
let isMultipleFilter =
|
||||||
popUpFltElm.style.display = NONE;
|
(fltType === CHECKLIST || fltType === MULTIPLE);
|
||||||
|
|
||||||
|
// Always hide all single selection filter types but hide multiple
|
||||||
|
// selection filter types only if index set
|
||||||
|
if (!isMultipleFilter || !isUndef(exceptIdx)) {
|
||||||
|
this.close(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,9 +394,9 @@ export class PopupFilter extends Feature {
|
||||||
* @param {Boolean} active Apply active state
|
* @param {Boolean} active Apply active state
|
||||||
*/
|
*/
|
||||||
changeState(colIndex, active) {
|
changeState(colIndex, active) {
|
||||||
if (this.fltIcons[colIndex]) {
|
let icon = this.fltIcons[colIndex];
|
||||||
this.fltIcons[colIndex].src = active ?
|
if (icon) {
|
||||||
this.activeIconPath : this.iconPath;
|
icon.src = active ? this.activeIconPath : this.iconPath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,27 +410,30 @@ export class PopupFilter extends Feature {
|
||||||
|
|
||||||
this.filtersCache = [];
|
this.filtersCache = [];
|
||||||
for (let i = 0; i < this.fltElms.length; i++) {
|
for (let i = 0; i < this.fltElms.length; i++) {
|
||||||
let popUpFltElm = this.fltElms[i],
|
let container = this.fltElms[i],
|
||||||
popUpFltSpan = this.fltSpans[i],
|
icon = this.fltSpans[i],
|
||||||
popUpFltImg = this.fltIcons[i];
|
iconImg = this.fltIcons[i];
|
||||||
if (popUpFltElm) {
|
if (container) {
|
||||||
removeElm(popUpFltElm);
|
removeElm(container);
|
||||||
this.filtersCache[i] = popUpFltElm;
|
this.filtersCache[i] = container;
|
||||||
}
|
}
|
||||||
popUpFltElm = null;
|
container = null;
|
||||||
if (popUpFltSpan) {
|
if (icon) {
|
||||||
removeElm(popUpFltSpan);
|
removeElm(icon);
|
||||||
}
|
}
|
||||||
popUpFltSpan = null;
|
icon = null;
|
||||||
if (popUpFltImg) {
|
if (iconImg) {
|
||||||
removeElm(popUpFltImg);
|
removeElm(iconImg);
|
||||||
}
|
}
|
||||||
popUpFltImg = null;
|
iconImg = null;
|
||||||
}
|
}
|
||||||
this.fltElms = [];
|
this.fltElms = [];
|
||||||
this.fltSpans = [];
|
this.fltSpans = [];
|
||||||
this.fltIcons = [];
|
this.fltIcons = [];
|
||||||
|
|
||||||
|
// TODO: expose an API to handle external filter IDs
|
||||||
|
tf.externalFltTgtIds = [];
|
||||||
|
|
||||||
// unsubscribe to events
|
// unsubscribe to events
|
||||||
this.emitter.off(['before-filtering'], () => this.setIconsState());
|
this.emitter.off(['before-filtering'], () => this.setIconsState());
|
||||||
this.emitter.off(['after-filtering'], () => this.closeAll());
|
this.emitter.off(['after-filtering'], () => this.closeAll());
|
||||||
|
|
|
@ -148,8 +148,7 @@ export class TableFilter {
|
||||||
|
|
||||||
//Start row et cols nb
|
//Start row et cols nb
|
||||||
this.refRow = isUndef(startRow) ? 2 : (startRow + 1);
|
this.refRow = isUndef(startRow) ? 2 : (startRow + 1);
|
||||||
try { this.nbCells = this.getCellsNb(this.refRow); }
|
this.nbCells = this.getCellsNb(this.refRow);
|
||||||
catch (e) { this.nbCells = this.getCellsNb(0); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base path for static assets
|
* Base path for static assets
|
||||||
|
@ -529,9 +528,9 @@ export class TableFilter {
|
||||||
/*** select filter's customisation and behaviours ***/
|
/*** select filter's customisation and behaviours ***/
|
||||||
/**
|
/**
|
||||||
* Text for clear option in drop-down filter types (1st option)
|
* Text for clear option in drop-down filter types (1st option)
|
||||||
* @type {String}
|
* @type {String|Array}
|
||||||
*/
|
*/
|
||||||
this.displayAllText = f.display_all_text || 'Clear';
|
this.clearFilterText = f.clear_filter_text || 'Clear';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate whether empty option is enabled in drop-down filter types
|
* Indicate whether empty option is enabled in drop-down filter types
|
||||||
|
@ -1021,37 +1020,27 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instanciate sugar date wrapper
|
// Instanciate sugar date wrapper
|
||||||
if (!Mod.dateType) {
|
Mod.dateType = Mod.dateType || new DateType(this);
|
||||||
Mod.dateType = new DateType(this);
|
|
||||||
}
|
|
||||||
Mod.dateType.init();
|
Mod.dateType.init();
|
||||||
|
|
||||||
// Instantiate help feature and initialise only if set true
|
// Instantiate help feature and initialise only if set true
|
||||||
if (!Mod.help) {
|
Mod.help = Mod.help || new Help(this);
|
||||||
Mod.help = new Help(this);
|
|
||||||
}
|
|
||||||
if (this.help) {
|
if (this.help) {
|
||||||
Mod.help.init();
|
Mod.help.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state) {
|
if (this.state) {
|
||||||
if (!Mod.state) {
|
Mod.state = Mod.state || new State(this);
|
||||||
Mod.state = new State(this);
|
|
||||||
}
|
|
||||||
Mod.state.init();
|
Mod.state.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.gridLayout) {
|
if (this.gridLayout) {
|
||||||
if (!Mod.gridLayout) {
|
Mod.gridLayout = Mod.gridLayout || new GridLayout(this);
|
||||||
Mod.gridLayout = new GridLayout(this);
|
|
||||||
}
|
|
||||||
Mod.gridLayout.init();
|
Mod.gridLayout.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.loader) {
|
if (this.loader) {
|
||||||
if (!Mod.loader) {
|
Mod.loader = Mod.loader || new Loader(this);
|
||||||
Mod.loader = new Loader(this);
|
|
||||||
}
|
|
||||||
Mod.loader.init();
|
Mod.loader.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,9 +1050,7 @@ export class TableFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.popupFilters) {
|
if (this.popupFilters) {
|
||||||
if (!Mod.popupFilter) {
|
Mod.popupFilter = Mod.popupFilter || new PopupFilter(this);
|
||||||
Mod.popupFilter = new PopupFilter(this);
|
|
||||||
}
|
|
||||||
Mod.popupFilter.init();
|
Mod.popupFilter.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1162,9 +1149,7 @@ export class TableFilter {
|
||||||
Mod.alternateRows.init();
|
Mod.alternateRows.init();
|
||||||
}
|
}
|
||||||
if (this.noResults) {
|
if (this.noResults) {
|
||||||
if (!Mod.noResults) {
|
Mod.noResults = Mod.noResults || new NoResults(this);
|
||||||
Mod.noResults = new NoResults(this);
|
|
||||||
}
|
|
||||||
Mod.noResults.init();
|
Mod.noResults.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2270,7 +2255,7 @@ export class TableFilter {
|
||||||
* @return {Number} Number of cells
|
* @return {Number} Number of cells
|
||||||
*/
|
*/
|
||||||
getCellsNb(rowIndex = 0) {
|
getCellsNb(rowIndex = 0) {
|
||||||
let tr = this.tbl.rows[rowIndex];
|
let tr = this.tbl.rows[rowIndex >= 0 ? rowIndex : 0];
|
||||||
return tr.cells.length;
|
return tr.cells.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2683,34 +2668,35 @@ export class TableFilter {
|
||||||
let activeIdx = this.getColumnIndexFromFilterId(this.activeFilterId);
|
let activeIdx = this.getColumnIndexFromFilterId(this.activeFilterId);
|
||||||
|
|
||||||
for (let i = 0, len = slcIndex.length; i < len; i++) {
|
for (let i = 0, len = slcIndex.length; i < len; i++) {
|
||||||
let curSlc = elm(this.fltIds[slcIndex[i]]);
|
let colIdx = slcIndex[i];
|
||||||
let slcSelectedValue = this.getFilterValue(slcIndex[i]);
|
let curSlc = elm(this.fltIds[colIdx]);
|
||||||
|
let slcSelectedValue = this.getFilterValue(colIdx);
|
||||||
|
|
||||||
// Welcome to cyclomatic complexity hell :)
|
// Welcome to cyclomatic complexity hell :)
|
||||||
// TODO: simplify/refactor if statement
|
// TODO: simplify/refactor if statement
|
||||||
if (activeIdx !== slcIndex[i] ||
|
if (activeIdx !== colIdx ||
|
||||||
(this.paging && slcA1.indexOf(slcIndex[i]) !== -1 &&
|
(this.paging && slcA1.indexOf(colIdx) !== -1 &&
|
||||||
activeIdx === slcIndex[i]) ||
|
activeIdx === colIdx) ||
|
||||||
(!this.paging && (slcA3.indexOf(slcIndex[i]) !== -1 ||
|
(!this.paging && (slcA3.indexOf(colIdx) !== -1 ||
|
||||||
slcA2.indexOf(slcIndex[i]) !== -1)) ||
|
slcA2.indexOf(colIdx) !== -1)) ||
|
||||||
slcSelectedValue === this.displayAllText) {
|
slcSelectedValue === this.getClearFilterText(colIdx)) {
|
||||||
|
|
||||||
//1st option needs to be inserted
|
//1st option needs to be inserted
|
||||||
if (this.loadFltOnDemand) {
|
if (this.loadFltOnDemand) {
|
||||||
let opt0 = createOpt(this.displayAllText, '');
|
let opt0 = createOpt(this.getClearFilterText(colIdx), '');
|
||||||
curSlc.innerHTML = '';
|
curSlc.innerHTML = '';
|
||||||
curSlc.appendChild(opt0);
|
curSlc.appendChild(opt0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slcA3.indexOf(slcIndex[i]) !== -1) {
|
if (slcA3.indexOf(colIdx) !== -1) {
|
||||||
this.emitter.emit('build-checklist-filter', this,
|
this.emitter.emit('build-checklist-filter', this, colIdx,
|
||||||
slcIndex[i], true);
|
true);
|
||||||
} else {
|
} else {
|
||||||
this.emitter.emit('build-select-filter', this, slcIndex[i],
|
this.emitter.emit('build-select-filter', this,colIdx,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setFilterValue(slcIndex[i], slcSelectedValue);
|
this.setFilterValue(colIdx, slcSelectedValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2748,7 +2734,7 @@ export class TableFilter {
|
||||||
/**
|
/**
|
||||||
* Checks if specified column filter ignores diacritics.
|
* Checks if specified column filter ignores diacritics.
|
||||||
* Note this is only valid for input filter types.
|
* Note this is only valid for input filter types.
|
||||||
* @param {any} colIndex Column index
|
* @param {Number} colIndex Column index
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
ignoresDiacritics(colIndex) {
|
ignoresDiacritics(colIndex) {
|
||||||
|
@ -2759,6 +2745,19 @@ export class TableFilter {
|
||||||
return Boolean(ignoreDiac);
|
return Boolean(ignoreDiac);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns clear all text for specified filter column
|
||||||
|
* @param {Number} colIndex Column index
|
||||||
|
* @returns {String}
|
||||||
|
*/
|
||||||
|
getClearFilterText(colIndex) {
|
||||||
|
let clearText = this.clearFilterText;
|
||||||
|
if (isArray(clearText)) {
|
||||||
|
return clearText[colIndex];
|
||||||
|
}
|
||||||
|
return clearText;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if passed script or stylesheet is already imported
|
* Check if passed script or stylesheet is already imported
|
||||||
* @param {String} filePath Ressource path
|
* @param {String} filePath Ressource path
|
||||||
|
|
BIN
static/style/themes/transparent/images/btn_first_page.gif
Normal file
After Width: | Height: | Size: 63 B |
BIN
static/style/themes/transparent/images/btn_last_page.gif
Normal file
After Width: | Height: | Size: 61 B |
BIN
static/style/themes/transparent/images/btn_next_page.gif
Normal file
After Width: | Height: | Size: 59 B |
BIN
static/style/themes/transparent/images/btn_prev_page.gif
Normal file
After Width: | Height: | Size: 58 B |
BIN
static/style/themes/transparent/images/icn_clear_filters.png
Normal file
After Width: | Height: | Size: 601 B |
BIN
static/style/themes/transparent/images/img_loading.gif
Normal file
After Width: | Height: | Size: 847 B |
205
static/style/themes/transparent/transparent.styl
Normal file
|
@ -0,0 +1,205 @@
|
||||||
|
/**
|
||||||
|
* transparent theme overrides
|
||||||
|
*/
|
||||||
|
|
||||||
|
@import '../../mixins/box-shadow'
|
||||||
|
|
||||||
|
// table
|
||||||
|
table.TF
|
||||||
|
padding 0
|
||||||
|
color inherit
|
||||||
|
border-right 1px solid transparent
|
||||||
|
border-top 1px solid transparent
|
||||||
|
border-left 1px solid transparent
|
||||||
|
border-bottom 0
|
||||||
|
|
||||||
|
th
|
||||||
|
margin 0
|
||||||
|
color inherit
|
||||||
|
background-color transparent
|
||||||
|
border-color transparent
|
||||||
|
border-width 1px
|
||||||
|
border-style solid
|
||||||
|
&:last-child
|
||||||
|
border-right 1px solid transparent
|
||||||
|
|
||||||
|
td
|
||||||
|
margin 0
|
||||||
|
padding 5px
|
||||||
|
color inherit
|
||||||
|
border-bottom 1px solid transparent
|
||||||
|
border-left 0
|
||||||
|
border-top 0
|
||||||
|
border-right 0
|
||||||
|
|
||||||
|
// filters
|
||||||
|
.fltrow
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
|
th, td
|
||||||
|
padding 1px 3px 1px 3px
|
||||||
|
border-bottom 1px solid transparent !important
|
||||||
|
&:last-child
|
||||||
|
border-right 1px solid transparent
|
||||||
|
|
||||||
|
.flt,
|
||||||
|
select.flt,
|
||||||
|
select.flt_multi,
|
||||||
|
.flt_s,
|
||||||
|
.single_flt,
|
||||||
|
.div_checklist
|
||||||
|
border 1px solid #A4BED4
|
||||||
|
|
||||||
|
input.flt
|
||||||
|
width 99% !important
|
||||||
|
|
||||||
|
// toolbar
|
||||||
|
.inf
|
||||||
|
background-color transparent
|
||||||
|
border 1px solid transparent
|
||||||
|
height $min-height
|
||||||
|
color inherit
|
||||||
|
|
||||||
|
div.tot,
|
||||||
|
div.status
|
||||||
|
border-right 0 !important
|
||||||
|
|
||||||
|
// help
|
||||||
|
.helpBtn
|
||||||
|
&:hover
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
|
// reset button
|
||||||
|
input.reset
|
||||||
|
background transparent url(images/icn_clear_filters.png) center center no-repeat !important
|
||||||
|
|
||||||
|
.nextPage
|
||||||
|
background transparent url(images/btn_next_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid transparent !important
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background #F7F7F7 url(images/btn_next_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid #F7F7F7 !important
|
||||||
|
|
||||||
|
.previousPage
|
||||||
|
background transparent url(images/btn_prev_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid transparent !important
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background #F7F7F7 url(images/btn_prev_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid #F7F7F7 !important
|
||||||
|
|
||||||
|
.firstPage
|
||||||
|
background transparent url(images/btn_first_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid transparent !important
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background #F7F7F7 url(images/btn_first_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid #F7F7F7 !important
|
||||||
|
|
||||||
|
.lastPage
|
||||||
|
background transparent url(images/btn_last_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid transparent !important
|
||||||
|
|
||||||
|
&:hover
|
||||||
|
background #F7F7F7 url(images/btn_last_page.gif) center center no-repeat !important
|
||||||
|
border 1px solid #F7F7F7 !important
|
||||||
|
|
||||||
|
// active header
|
||||||
|
.activeHeader
|
||||||
|
background #F7F7F7 !important
|
||||||
|
border 1px solid transparent
|
||||||
|
color inherit !important
|
||||||
|
|
||||||
|
// grid-layout
|
||||||
|
|
||||||
|
// main container
|
||||||
|
div.grd_Cont
|
||||||
|
box-shadow(0 0 0 0 rgba(50, 50, 50, 0.75))
|
||||||
|
background-color transparent
|
||||||
|
border 1px solid transparent
|
||||||
|
padding 0 !important
|
||||||
|
|
||||||
|
// alternating background colors
|
||||||
|
.even
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
|
.odd
|
||||||
|
background-color #F7F7F7
|
||||||
|
|
||||||
|
// headers' table container
|
||||||
|
div.grd_headTblCont
|
||||||
|
background-color transparent
|
||||||
|
border-bottom none !important
|
||||||
|
|
||||||
|
|
||||||
|
div.grd_tblCont table
|
||||||
|
border-right none !important
|
||||||
|
|
||||||
|
// headers
|
||||||
|
div.grd_tblCont table th,
|
||||||
|
div.grd_headTblCont table th,
|
||||||
|
div.grd_headTblCont table td
|
||||||
|
background transparent
|
||||||
|
border-bottom 1px solid transparent
|
||||||
|
border-right 1px solid transparent !important
|
||||||
|
border-left 1px solid transparent
|
||||||
|
border-top 1px solid transparent
|
||||||
|
|
||||||
|
div.grd_tblCont table td
|
||||||
|
border-bottom 1px solid transparent
|
||||||
|
border-right 0 !important
|
||||||
|
border-left 0 !important
|
||||||
|
border-top 0 !important
|
||||||
|
|
||||||
|
// toolbar containing left, middle and right divs
|
||||||
|
.grd_inf
|
||||||
|
background-color transparent
|
||||||
|
color inherit
|
||||||
|
border-top 1px solid transparent
|
||||||
|
|
||||||
|
a
|
||||||
|
text-decoration none
|
||||||
|
font-weight bold
|
||||||
|
|
||||||
|
// loader
|
||||||
|
.loader
|
||||||
|
background-color #F7F7F7
|
||||||
|
border 1px solid #F7F7F7
|
||||||
|
border-radius 5px
|
||||||
|
color #000000
|
||||||
|
text-shadow none
|
||||||
|
|
||||||
|
// alternating background colors
|
||||||
|
.even
|
||||||
|
background-color transparent
|
||||||
|
|
||||||
|
.odd
|
||||||
|
background-color #F7F7F7
|
||||||
|
|
||||||
|
// filters visibility
|
||||||
|
span.expClpFlt
|
||||||
|
a.btnExpClpFlt
|
||||||
|
&:hover
|
||||||
|
background-color transparent !important
|
||||||
|
|
||||||
|
// ezedittable
|
||||||
|
|
||||||
|
// selection
|
||||||
|
.ezActiveRow
|
||||||
|
background-color #CCCCCC !important
|
||||||
|
color inherit
|
||||||
|
|
||||||
|
.ezSelectedRow
|
||||||
|
background-color #CCCCCC !important
|
||||||
|
color inherit
|
||||||
|
|
||||||
|
.ezActiveCell
|
||||||
|
background-color transparent
|
||||||
|
color inherit
|
||||||
|
font-weight bold
|
||||||
|
|
||||||
|
.ezETSelectedCell
|
||||||
|
background-color transparent
|
||||||
|
font-weight bold
|
||||||
|
color inherit
|
|
@ -93,7 +93,11 @@ var tfConfig = {
|
||||||
'number', 'number', 'number',
|
'number', 'number', 'number',
|
||||||
'number', 'number', 'number'
|
'number', 'number', 'number'
|
||||||
],
|
],
|
||||||
display_all_text: " [ Show all ] ",
|
clear_filter_text: [
|
||||||
|
' [ Show all ] ',
|
||||||
|
'<Clear>',
|
||||||
|
'Clear:'
|
||||||
|
],
|
||||||
col_0: "multiple",
|
col_0: "multiple",
|
||||||
col_1: "select",
|
col_1: "select",
|
||||||
col_2: "checklist",
|
col_2: "checklist",
|
||||||
|
|
|
@ -29,21 +29,21 @@ var filtersConfig = {
|
||||||
disable_excluded_options: true,
|
disable_excluded_options: true,
|
||||||
col_1: 'multiple',
|
col_1: 'multiple',
|
||||||
col_2: 'checklist',
|
col_2: 'checklist',
|
||||||
|
col_types: [
|
||||||
|
'number', 'string', 'string',
|
||||||
|
'formatted-number', 'none', 'string'
|
||||||
|
],
|
||||||
col_widths: [
|
col_widths: [
|
||||||
'60px', '160px', '160px',
|
'60px', '160px', '160px',
|
||||||
'85px', '70px', '270px'
|
'85px', '70px', '270px'
|
||||||
],
|
],
|
||||||
btn_reset: true,
|
btn_reset: true,
|
||||||
display_all_text: '< Clear >',
|
clear_filter_text: '< Clear >',
|
||||||
alternate_rows: true,
|
alternate_rows: true,
|
||||||
rows_counter: true,
|
rows_counter: true,
|
||||||
enable_default_theme: true,
|
enable_default_theme: true,
|
||||||
extensions:[{
|
extensions:[{
|
||||||
name: 'sort',
|
name: 'sort'
|
||||||
types: [
|
|
||||||
'number', 'string', 'string',
|
|
||||||
'US', 'none', 'string'
|
|
||||||
]
|
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ var filtersConfig = {
|
||||||
col_1: 'multiple',
|
col_1: 'multiple',
|
||||||
col_2: 'checklist',
|
col_2: 'checklist',
|
||||||
btn_reset: true,
|
btn_reset: true,
|
||||||
display_all_text: '< Clear >',
|
clear_filter_text: '< Clear >',
|
||||||
alternate_rows: true,
|
alternate_rows: true,
|
||||||
rows_counter: true,
|
rows_counter: true,
|
||||||
enable_default_theme: true,
|
enable_default_theme: true,
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
<option value="default" selected="selected">default</option>
|
<option value="default" selected="selected">default</option>
|
||||||
<option value="mytheme">mytheme</option>
|
<option value="mytheme">mytheme</option>
|
||||||
<option value="skyblue">skyblue</option>
|
<option value="skyblue">skyblue</option>
|
||||||
|
<option value="transparent">transparent</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- @import partials/books.html -->
|
<!-- @import partials/books.html -->
|
||||||
|
@ -85,7 +86,8 @@ tf.init();
|
||||||
var THEMES = {
|
var THEMES = {
|
||||||
'default': tf.themesPath + 'default/default.css',
|
'default': tf.themesPath + 'default/default.css',
|
||||||
'mytheme': tf.themesPath + 'mytheme/mytheme.css',
|
'mytheme': tf.themesPath + 'mytheme/mytheme.css',
|
||||||
'skyblue': tf.themesPath + 'skyblue/skyblue.css'
|
'skyblue': tf.themesPath + 'skyblue/skyblue.css',
|
||||||
|
'transparent': tf.themesPath + 'transparent/transparent.css'
|
||||||
};
|
};
|
||||||
|
|
||||||
function changeTheme(name){
|
function changeTheme(name){
|
||||||
|
|
|
@ -86,8 +86,91 @@ test('Remove background on a row', function() {
|
||||||
0, 'Bg set on expected row');
|
0, 'Bg set on expected row');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Remove alternating rows', function() {
|
test('Cannot init if initialised', function() {
|
||||||
|
// setup
|
||||||
|
var processAll = altRows.processAll;
|
||||||
|
var hit = 0;
|
||||||
|
altRows.processAll = function() { hit++ };
|
||||||
|
altRows.initialized = true;
|
||||||
|
|
||||||
|
// act
|
||||||
|
altRows.init();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(hit, 0, 'processAll not called');
|
||||||
|
|
||||||
|
altRows.processAll = processAll;
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Cannot processAll if not enabled', function() {
|
||||||
|
// setup
|
||||||
|
var setRowBg = altRows.setRowBg;
|
||||||
|
var hit = 0;
|
||||||
|
altRows.setRowBg = function() { hit++ };
|
||||||
|
altRows.enabled = false;
|
||||||
|
|
||||||
|
// act
|
||||||
|
altRows.processAll();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(hit, 0, 'setRowBg not called');
|
||||||
|
|
||||||
|
altRows.setRowBg = setRowBg;
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Cannot setRowBg if not enabled', function() {
|
||||||
|
// setup
|
||||||
|
var removeRowBg = altRows.removeRowBg;
|
||||||
|
var hit = 0;
|
||||||
|
altRows.removeRowBg = function() { hit++ };
|
||||||
|
altRows.enabled = false;
|
||||||
|
|
||||||
|
// act
|
||||||
|
altRows.setRowBg(3, 5);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(hit, 0, 'removeRowBg not called');
|
||||||
|
|
||||||
|
altRows.removeRowBg = removeRowBg;
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Cannot removeRowBg if row index is NaN', function() {
|
||||||
|
// setup
|
||||||
|
tf.clearFilters();
|
||||||
|
tf.filter();
|
||||||
|
|
||||||
|
// act
|
||||||
|
altRows.removeRowBg('hello');
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(tbl.querySelectorAll('tr.odd').length, 3, 'Expected odd bgs');
|
||||||
|
deepEqual(tbl.querySelectorAll('tr.even').length, 3, 'Expected even bg');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Cannot destroy if not initialised', function() {
|
||||||
|
// setup
|
||||||
|
var getRowsNb = altRows.tf.getRowsNb;
|
||||||
|
var hit = 0;
|
||||||
|
altRows.tf.getRowsNb = function() { hit++ };
|
||||||
|
altRows.initialized = false;
|
||||||
|
|
||||||
|
// act
|
||||||
altRows.destroy();
|
altRows.destroy();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(hit, 0, 'tf.getRowsNb not called');
|
||||||
|
|
||||||
|
altRows.tf.getRowsNb = getRowsNb;
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Remove alternating rows', function() {
|
||||||
|
// setup
|
||||||
|
altRows.initialized = true;
|
||||||
|
|
||||||
|
// act
|
||||||
|
altRows.destroy();
|
||||||
|
|
||||||
|
// assert
|
||||||
deepEqual(tbl.querySelectorAll('tr.odd').length, 0, 'Odd bgs removed');
|
deepEqual(tbl.querySelectorAll('tr.odd').length, 0, 'Odd bgs removed');
|
||||||
deepEqual(tbl.querySelectorAll('tr.even').length, 0, 'Even bg removed');
|
deepEqual(tbl.querySelectorAll('tr.even').length, 0, 'Even bg removed');
|
||||||
});
|
});
|
||||||
|
|
|
@ -127,6 +127,12 @@ test('Clear filters', function() {
|
||||||
deepEqual(tf.getFiltersValue(), ['', '', '', '', '']);
|
deepEqual(tf.getFiltersValue(), ['', '', '', '', '']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Can get feature', function() {
|
||||||
|
var feature = tf.feature('help');
|
||||||
|
deepEqual(typeof feature, 'object', 'Feature instance');
|
||||||
|
deepEqual(feature.feature, 'help', 'Feature name');
|
||||||
|
});
|
||||||
|
|
||||||
test('Get table data', function() {
|
test('Get table data', function() {
|
||||||
deepEqual(tf.getColValues(0),
|
deepEqual(tf.getColValues(0),
|
||||||
[
|
[
|
||||||
|
|
|
@ -108,6 +108,18 @@
|
||||||
deepEqual(tf.getValidRows(), [6], 'Expected rows');
|
deepEqual(tf.getValidRows(), [6], 'Expected rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Can filter a number', function() {
|
||||||
|
// setup
|
||||||
|
tf.clearFilters();
|
||||||
|
|
||||||
|
// act
|
||||||
|
tf.setFilterValue(4, 1836.09);
|
||||||
|
tf.filter();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(tf.getValidRows(), [6], 'Expected rows');
|
||||||
|
});
|
||||||
|
|
||||||
test('Can filter a formatted number column with a number', function() {
|
test('Can filter a formatted number column with a number', function() {
|
||||||
// setup
|
// setup
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
|
|
|
@ -74,6 +74,7 @@ test('Can parse date', function() {
|
||||||
var date3 = dateType.parse('14-Jul-2005', 'fr');
|
var date3 = dateType.parse('14-Jul-2005', 'fr');
|
||||||
var date4 = dateType.parse(null);
|
var date4 = dateType.parse(null);
|
||||||
var date5 = dateType.parse(undefined);
|
var date5 = dateType.parse(undefined);
|
||||||
|
var date6 = dateType.parse('');
|
||||||
|
|
||||||
deepEqual(date0, new Date(2017, 9, 25, 0, 0, 0, 0), 'en-US date');
|
deepEqual(date0, new Date(2017, 9, 25, 0, 0, 0, 0), 'en-US date');
|
||||||
deepEqual(date1, new Date(2017, 9, 25, 0, 0, 0, 0), 'en-GB date');
|
deepEqual(date1, new Date(2017, 9, 25, 0, 0, 0, 0), 'en-GB date');
|
||||||
|
@ -81,6 +82,7 @@ test('Can parse date', function() {
|
||||||
deepEqual(date3, new Date(2005, 6, 14, 0, 0, 0, 0), 'fr date');
|
deepEqual(date3, new Date(2005, 6, 14, 0, 0, 0, 0), 'fr date');
|
||||||
deepEqual(date4.toISOString(), '1970-01-01T00:00:00.000Z', 'null date');
|
deepEqual(date4.toISOString(), '1970-01-01T00:00:00.000Z', 'null date');
|
||||||
deepEqual(date5 instanceof Date, true, 'undefined date');
|
deepEqual(date5 instanceof Date, true, 'undefined date');
|
||||||
|
deepEqual(isNaN(date6), true, 'Invalid date');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can validate date', function() {
|
test('Can validate date', function() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
(function(win, TableFilter){
|
|
||||||
var id = function (id){ return document.getElementById(id); };
|
|
||||||
|
|
||||||
var tf = new TableFilter('demo', {
|
var id = function (id){ return document.getElementById(id); };
|
||||||
|
|
||||||
|
var tf = new TableFilter('demo', {
|
||||||
base_path: '../dist/tablefilter/',
|
base_path: '../dist/tablefilter/',
|
||||||
col_2: 'select',
|
col_2: 'select',
|
||||||
col_3: 'multiple',
|
col_3: 'multiple',
|
||||||
|
@ -15,11 +15,11 @@
|
||||||
'extAirDistance',
|
'extAirDistance',
|
||||||
'extRailDistance'
|
'extRailDistance'
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
tf.init();
|
tf.init();
|
||||||
|
|
||||||
module('Sanity checks');
|
module('Sanity checks');
|
||||||
test('External filters', function() {
|
test('External filters', function() {
|
||||||
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
||||||
deepEqual(tf.isExternalFlt, true, 'Has external filters');
|
deepEqual(tf.isExternalFlt, true, 'Has external filters');
|
||||||
deepEqual(tf.externalFltTgtIds.length, 5,
|
deepEqual(tf.externalFltTgtIds.length, 5,
|
||||||
|
@ -37,43 +37,43 @@
|
||||||
'Col3 filter is external');
|
'Col3 filter is external');
|
||||||
deepEqual(id('extRailDistance').childNodes.length>0, true,
|
deepEqual(id('extRailDistance').childNodes.length>0, true,
|
||||||
'Col4 filter is external');
|
'Col4 filter is external');
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Filter columns');
|
module('Filter columns');
|
||||||
test('Can filter column 0', function() {
|
test('Can filter column 0', function() {
|
||||||
tf.setFilterValue(0, 'Syd');
|
tf.setFilterValue(0, 'Syd');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
||||||
});
|
});
|
||||||
test('Can filter column 1', function() {
|
test('Can filter column 1', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [2], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [2], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 2', function() {
|
test('Can filter column 2', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(2, '1533');
|
tf.setFilterValue(2, '1533');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 3', function() {
|
test('Can filter column 3', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 4', function() {
|
test('Can filter column 4', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(4, ['16', '40']);
|
tf.setFilterValue(4, ['16', '40']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Filters in grid-layout mode are already considered as `external` as
|
// Filters in grid-layout mode are already considered as `external` as
|
||||||
// generated in headers container
|
// generated in headers container
|
||||||
module('Grid-layout');
|
module('Grid-layout');
|
||||||
test('Sanity checks', function() {
|
test('Sanity checks', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', {
|
tf = new TableFilter('demo', {
|
||||||
|
@ -111,41 +111,41 @@
|
||||||
'Col3 filter is external');
|
'Col3 filter is external');
|
||||||
deepEqual(id('extRailDistance').childNodes.length, 0,
|
deepEqual(id('extRailDistance').childNodes.length, 0,
|
||||||
'Col4 filter is external');
|
'Col4 filter is external');
|
||||||
});
|
});
|
||||||
test('Can filter column 0', function() {
|
test('Can filter column 0', function() {
|
||||||
tf.setFilterValue(0, 'Syd');
|
tf.setFilterValue(0, 'Syd');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
||||||
});
|
});
|
||||||
test('Can filter column 1', function() {
|
test('Can filter column 1', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [0], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [0], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 2', function() {
|
test('Can filter column 2', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(2, '1533');
|
tf.setFilterValue(2, '1533');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [5], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [5], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 3', function() {
|
test('Can filter column 3', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 4', function() {
|
test('Can filter column 4', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(4, ['16', '40']);
|
tf.setFilterValue(4, ['16', '40']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
// In popup filters mode are already considered as `external` as
|
// In popup filters mode are already considered as `external` as
|
||||||
// generated in headers container
|
// generated in headers container
|
||||||
module('Pop-up filters');
|
module('Pop-up filters');
|
||||||
test('Sanity checks', function() {
|
test('Sanity checks', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', {
|
tf = new TableFilter('demo', {
|
||||||
|
@ -183,42 +183,40 @@
|
||||||
'Col3 filter is external');
|
'Col3 filter is external');
|
||||||
deepEqual(id('extRailDistance').childNodes.length, 0,
|
deepEqual(id('extRailDistance').childNodes.length, 0,
|
||||||
'Col4 filter is external');
|
'Col4 filter is external');
|
||||||
});
|
});
|
||||||
test('Can filter column 0', function() {
|
test('Can filter column 0', function() {
|
||||||
tf.setFilterValue(0, 'Syd');
|
tf.setFilterValue(0, 'Syd');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
deepEqual(tf.getValidRows().length, 4, 'Filtered rows length');
|
||||||
});
|
});
|
||||||
test('Can filter column 1', function() {
|
test('Can filter column 1', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [2], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [2], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 2', function() {
|
test('Can filter column 2', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(2, '1533');
|
tf.setFilterValue(2, '1533');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 3', function() {
|
test('Can filter column 3', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
tf.setFilterValue(3, ['2', '3.1', '1.5']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 3, 'Filtered rows');
|
||||||
});
|
});
|
||||||
test('Can filter column 4', function() {
|
test('Can filter column 4', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.setFilterValue(4, ['16', '40']);
|
tf.setFilterValue(4, ['16', '40']);
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
deepEqual(tf.getValidRows().length, 2, 'Filtered rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Tear-down');
|
module('Tear-down');
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
||||||
});
|
});
|
||||||
|
|
||||||
})(window, TableFilter);
|
|
||||||
|
|
|
@ -1,28 +1,27 @@
|
||||||
(function(win, TableFilter){
|
|
||||||
|
|
||||||
var tf = new TableFilter('demo', 3, {
|
var tf = new TableFilter('demo', 3, {
|
||||||
base_path: '../dist/tablefilter/',
|
base_path: '../dist/tablefilter/',
|
||||||
filters_row_index: 3,
|
filters_row_index: 3,
|
||||||
headers_row_index: 2
|
headers_row_index: 2
|
||||||
});
|
});
|
||||||
tf.init();
|
tf.init();
|
||||||
|
|
||||||
module('Sanity checks');
|
module('Sanity checks');
|
||||||
test('Grouped headers', function() {
|
test('Grouped headers', function() {
|
||||||
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
||||||
deepEqual(tf.getFiltersRowIndex(), 3, 'Filters row index');
|
deepEqual(tf.getFiltersRowIndex(), 3, 'Filters row index');
|
||||||
deepEqual(tf.getHeadersRowIndex(), 2, 'Headers row index');
|
deepEqual(tf.getHeadersRowIndex(), 2, 'Headers row index');
|
||||||
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
deepEqual(tf.getValidRows(), [4], 'Filtered row');
|
deepEqual(tf.getValidRows(), [4], 'Filtered row');
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Paging');
|
module('Paging');
|
||||||
test('Sanity checks', function() {
|
test('Sanity checks', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', 3, {
|
tf = new TableFilter('demo', 3, {
|
||||||
|
@ -38,9 +37,9 @@
|
||||||
deepEqual(tf.getFiltersRowIndex(), 3, 'Filters row index');
|
deepEqual(tf.getFiltersRowIndex(), 3, 'Filters row index');
|
||||||
deepEqual(tf.getHeadersRowIndex(), 2, 'Headers row index');
|
deepEqual(tf.getHeadersRowIndex(), 2, 'Headers row index');
|
||||||
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(2, '>100');
|
tf.setFilterValue(2, '>100');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
|
@ -50,10 +49,10 @@
|
||||||
3,
|
3,
|
||||||
'Number of pages for filtered rows'
|
'Number of pages for filtered rows'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Pop-up filters');
|
module('Pop-up filters');
|
||||||
test('Sanity checks', function() {
|
test('Sanity checks', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.feature('paging').destroy();
|
tf.feature('paging').destroy();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
|
@ -67,17 +66,17 @@
|
||||||
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
||||||
deepEqual(tf.getHeadersRowIndex(), 3, 'Headers row index');
|
deepEqual(tf.getHeadersRowIndex(), 3, 'Headers row index');
|
||||||
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
deepEqual(tf.getStartRowIndex(), 4, 'Reference row index');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(1, 'Melb');
|
tf.setFilterValue(1, 'Melb');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
deepEqual(tf.getValidRows(), [7], 'Filtered rows');
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Pop-up filters, issue #295');
|
module('Pop-up filters, issue #295');
|
||||||
test('Sanity checks', function() {
|
test('Sanity checks', function() {
|
||||||
var tf2 = new TableFilter('demo2', 2, {
|
var tf2 = new TableFilter('demo2', 2, {
|
||||||
base_path: '../dist/tablefilter/',
|
base_path: '../dist/tablefilter/',
|
||||||
headers_row_index: 1,
|
headers_row_index: 1,
|
||||||
|
@ -95,15 +94,13 @@
|
||||||
tf2.clearFilters();
|
tf2.clearFilters();
|
||||||
tf2.destroy();
|
tf2.destroy();
|
||||||
deepEqual(tf2.isInitialized(), false, 'Filters removed');
|
deepEqual(tf2.isInitialized(), false, 'Filters removed');
|
||||||
});
|
});
|
||||||
|
|
||||||
//Grid-layout currently does not support grouped headers
|
//Grid-layout currently does not support grouped headers
|
||||||
|
|
||||||
module('Tear-down');
|
module('Tear-down');
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
||||||
});
|
});
|
||||||
|
|
||||||
})(window, TableFilter);
|
|
||||||
|
|
|
@ -1,26 +1,25 @@
|
||||||
(function(win, TableFilter){
|
|
||||||
|
|
||||||
var tf = new TableFilter('demo', 0, {
|
var tf = new TableFilter('demo', 0, {
|
||||||
base_path: '../dist/tablefilter/'
|
base_path: '../dist/tablefilter/'
|
||||||
});
|
});
|
||||||
tf.init();
|
tf.init();
|
||||||
|
|
||||||
module('Sanity checks');
|
module('Sanity checks');
|
||||||
test('No headers', function() {
|
test('No headers', function() {
|
||||||
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
||||||
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
||||||
deepEqual(tf.refRow, 1, 'Reference row index');
|
deepEqual(tf.refRow, 1, 'Reference row index');
|
||||||
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Paging with no headers', function() {
|
test('Paging with no headers', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', 0, {
|
tf = new TableFilter('demo', 0, {
|
||||||
|
@ -34,18 +33,18 @@
|
||||||
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
||||||
deepEqual(tf.refRow, 1, 'Reference row index');
|
deepEqual(tf.refRow, 1, 'Reference row index');
|
||||||
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(1, 'Ade');
|
tf.setFilterValue(1, 'Ade');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Grid layout currently does not handle a table with no headers...
|
// Grid layout currently does not handle a table with no headers...
|
||||||
// Raised in issue 110 (https://github.com/koalyptus/TableFilter/issues/110)
|
// Raised in issue 110 (https://github.com/koalyptus/TableFilter/issues/110)
|
||||||
test('Grid layout with no header', function() {
|
test('Grid layout with no header', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', {
|
tf = new TableFilter('demo', {
|
||||||
|
@ -60,16 +59,16 @@
|
||||||
deepEqual(tf.refRow, 0, 'Reference row index');
|
deepEqual(tf.refRow, 0, 'Reference row index');
|
||||||
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
||||||
deepEqual(tf.getRowsNb(), 7, 'Filterable rows number');
|
deepEqual(tf.getRowsNb(), 7, 'Filterable rows number');
|
||||||
});
|
});
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(2, '<900');
|
tf.setFilterValue(2, '<900');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
deepEqual(tf.getValidRows(), [2,3], 'Filtered row');
|
deepEqual(tf.getValidRows(), [2,3], 'Filtered row');
|
||||||
});
|
});
|
||||||
|
|
||||||
// With no toolbar cannot clear filters :)
|
// With no toolbar cannot clear filters :)
|
||||||
test('Popup filters with no header', function() {
|
test('Popup filters with no header', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
tf = new TableFilter('demo', 0, {
|
tf = new TableFilter('demo', 0, {
|
||||||
|
@ -82,20 +81,18 @@
|
||||||
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
||||||
deepEqual(tf.refRow, 1, 'Reference row index');
|
deepEqual(tf.refRow, 1, 'Reference row index');
|
||||||
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Can perform a search', function() {
|
test('Can perform a search', function() {
|
||||||
tf.setFilterValue(1, 'Melbourne');
|
tf.setFilterValue(1, 'Melbourne');
|
||||||
tf.filter();
|
tf.filter();
|
||||||
|
|
||||||
deepEqual(tf.getValidRows(), [4], 'Filtered row');
|
deepEqual(tf.getValidRows(), [4], 'Filtered row');
|
||||||
});
|
});
|
||||||
|
|
||||||
module('Tear-down');
|
module('Tear-down');
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.clearFilters();
|
tf.clearFilters();
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
||||||
});
|
});
|
||||||
|
|
||||||
})(window, TableFilter);
|
|
||||||
|
|
|
@ -16,6 +16,11 @@ test('Pop-up filter component', function() {
|
||||||
notEqual(popupFilter, null, 'PopupFilter instanciated');
|
notEqual(popupFilter, null, 'PopupFilter instanciated');
|
||||||
deepEqual(popupFilter.fltElms instanceof Array,
|
deepEqual(popupFilter.fltElms instanceof Array,
|
||||||
true, 'Type of fltElms property');
|
true, 'Type of fltElms property');
|
||||||
|
deepEqual(
|
||||||
|
popupFilter.adjustToContainer,
|
||||||
|
true,
|
||||||
|
'Popup filter width adjusts to container'
|
||||||
|
);
|
||||||
deepEqual(tf.headersRow, 1, 'Headers row index');
|
deepEqual(tf.headersRow, 1, 'Headers row index');
|
||||||
// issue 99: getHeadersText for pick-list filter types
|
// issue 99: getHeadersText for pick-list filter types
|
||||||
deepEqual(
|
deepEqual(
|
||||||
|
@ -72,6 +77,106 @@ test('Pop-up filter state after clearing', function(){
|
||||||
true, 'Icon state');
|
true, 'Icon state');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Can open pop-up filter', function(){
|
||||||
|
// act
|
||||||
|
popupFilter.open(1);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.fltElms[1].style.display, 'block',
|
||||||
|
'Popup filter is open');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can close pop-up filter', function(){
|
||||||
|
// act
|
||||||
|
popupFilter.close(1);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.fltElms[1].style.display, 'none',
|
||||||
|
'Popup filter is open');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can toggle pop-up filter (initially closed)', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.close(2);
|
||||||
|
|
||||||
|
// act
|
||||||
|
popupFilter.toggle(2);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.fltElms[2].style.display, 'block',
|
||||||
|
'Popup filter is toggled');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can toggle pop-up filter (initially opened)', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.open(2);
|
||||||
|
|
||||||
|
// act
|
||||||
|
popupFilter.toggle(2);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.fltElms[2].style.display, 'none',
|
||||||
|
'Popup filter is toggled');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Multiple selection pop-up filter remains open upon filtering', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.open(2);
|
||||||
|
|
||||||
|
// act
|
||||||
|
tf.setFilterValue(2, ['1412', '982']);
|
||||||
|
tf.filter();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(
|
||||||
|
popupFilter.isOpen(2),
|
||||||
|
true,
|
||||||
|
'Multiple selection pop-up filter still open after filtering'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Pop-up filter closes upon filtering', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.open(1);
|
||||||
|
|
||||||
|
// act
|
||||||
|
tf.setFilterValue(1, 'Adelaide');
|
||||||
|
tf.filter();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.isOpen(1), false,
|
||||||
|
'Pop-up filter closed after filtering'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Pop-up filter auto-closes when user clicks away', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.open(0);
|
||||||
|
|
||||||
|
// act
|
||||||
|
var evObj = document.createEvent('HTMLEvents');
|
||||||
|
evObj.initEvent('mouseup', true, true);
|
||||||
|
tf.tbl.rows[4].cells[2].dispatchEvent(evObj);
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.isOpen(0), false,
|
||||||
|
'Pop-up filter closed after user clicks away'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Can destroy and reset', function(){
|
||||||
|
// setup
|
||||||
|
popupFilter.destroy();
|
||||||
|
|
||||||
|
// act
|
||||||
|
popupFilter.reset();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(popupFilter.fltElms.length, 5, 'Filters are generated');
|
||||||
|
deepEqual(popupFilter.fltIcons.length, 4, 'Icons are generated');
|
||||||
|
deepEqual(popupFilter.fltSpans.length, 4, 'Icon containers are generated');
|
||||||
|
});
|
||||||
|
|
||||||
test('TableFilter removed', function() {
|
test('TableFilter removed', function() {
|
||||||
tf.destroy();
|
tf.destroy();
|
||||||
var fltIcn1 = popupFilter.fltIcons[3];
|
var fltIcn1 = popupFilter.fltIcons[3];
|
||||||
|
|
38
test/test.js
|
@ -70,4 +70,42 @@
|
||||||
deepEqual(tf1.getValidRows().length, 2, 'Filter button event result');
|
deepEqual(tf1.getValidRows().length, 2, 'Filter button event result');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Cannot init if initialised', function() {
|
||||||
|
// setup
|
||||||
|
var importFile = tf1.import;
|
||||||
|
var hit = 0;
|
||||||
|
tf1.import = function() { hit++ };
|
||||||
|
tf1.initialized = true;
|
||||||
|
|
||||||
|
// act
|
||||||
|
tf1.init();
|
||||||
|
|
||||||
|
// assert
|
||||||
|
deepEqual(hit, 0, 'import not called');
|
||||||
|
|
||||||
|
tf1.import = importFile;
|
||||||
|
});
|
||||||
|
|
||||||
|
module('Tear-down');
|
||||||
|
test('can destroy TableFilter DOM elements', function() {
|
||||||
|
tf.destroy();
|
||||||
|
tf1.destroy();
|
||||||
|
|
||||||
|
deepEqual(tf.isInitialized(), false, 'Instance no longer initialised');
|
||||||
|
deepEqual(tf1.getFilterElement(0), null, 'Filter 0 removed');
|
||||||
|
});
|
||||||
|
|
||||||
|
module('Edge cases');
|
||||||
|
test('throws when no working DOM element', function() {
|
||||||
|
throws(
|
||||||
|
function() { new TableFilter('xyz'); },
|
||||||
|
Error,
|
||||||
|
'Throws Error when no DOM table'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
test('Can instantiate with wrong refRow', function() {
|
||||||
|
var tf2 = new TableFilter('demo', -9);
|
||||||
|
deepEqual(tf2.nbCells, 5, 'Expected number of columns');
|
||||||
|
});
|
||||||
|
|
||||||
})(window, TableFilter);
|
})(window, TableFilter);
|
||||||
|
|
51
webpack.test.config.js
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
var webpackConfig = require('./webpack.config.js');
|
||||||
|
var path = require('path');
|
||||||
|
var Clean = require('clean-webpack-plugin');
|
||||||
|
var StringReplacePlugin = require('string-replace-webpack-plugin');
|
||||||
|
var fs = require('fs');
|
||||||
|
var pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
cache: true,
|
||||||
|
entry: webpackConfig.entry,
|
||||||
|
output: webpackConfig.output,
|
||||||
|
resolve: webpackConfig.resolve,
|
||||||
|
isparta: {
|
||||||
|
embedSource: true,
|
||||||
|
noAutoWrap: true,
|
||||||
|
babel: {
|
||||||
|
compact: false,
|
||||||
|
presets: ['es2015'],
|
||||||
|
plugins: [['transform-es2015-classes', {loose: true}]]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
include: path.join(__dirname, 'src'),
|
||||||
|
exclude: /tablefilter\/node_modules/,
|
||||||
|
loader: 'isparta'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: path.join(__dirname, 'src'),
|
||||||
|
loader: StringReplacePlugin.replace({
|
||||||
|
replacements: [{
|
||||||
|
pattern: /{VERSION}/ig,
|
||||||
|
replacement: function () {
|
||||||
|
return pkg.version;
|
||||||
|
}
|
||||||
|
},{
|
||||||
|
pattern: /{AUTHOR}/ig,
|
||||||
|
replacement: function () {
|
||||||
|
return pkg.author.name;
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
devtool: 'sourcemap',
|
||||||
|
debug: true,
|
||||||
|
plugins: [new Clean(['dist'])].concat(webpackConfig.dev.plugins)
|
||||||
|
};
|