tablefilter 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/starter.html +2 -2
- package/dist/tablefilter/tablefilter.js +1 -1
- package/dist/tablefilter/tf-1-2aa33b10e0e549020c12.js +1 -0
- package/dist/tablefilter/tf-1-bc5a8b07e0d66035b05b.js +1 -0
- package/dist/tablefilter/{tf-2-3a936d22b849361acff5.js → tf-2-025e1e774794d5827df8.js} +2 -2
- package/dist/tablefilter.cjs.js +17614 -4
- package/dist/tablefilter.esm.js +15736 -5397
- package/dist/tablefilter.umd.js +17620 -4
- package/index.js +16 -1
- package/package.json +10 -1
- package/src/components/attributes.js +59 -0
- package/src/components/table-filter.js +193 -45
- package/src/components/tf-rows-counter.js +3 -6
- package/src/components/tf-status.js +6 -11
- package/src/extensions/sort/sort.js +8 -1
- package/src/tablefilter.js +39 -6
- package/.editorconfig +0 -15
- package/.esdoc.json +0 -14
- package/.eslintrc +0 -37
- package/.gitattributes +0 -16
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -36
- package/.github/ISSUE_TEMPLATE/support.md +0 -17
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/build-deploy.yml +0 -141
- package/.github/workflows/opencode-review.yml +0 -104
- package/.github/workflows/opencode.yml +0 -34
- package/AGENTS.md +0 -36
- package/CONTRIBUTING.md +0 -128
- package/Gruntfile.js +0 -252
- package/PULL_REQUEST_TEMPLATE.md +0 -24
- package/ROADMAP/README.md +0 -34
- package/ROADMAP/content-projection-parity.md +0 -162
- package/ROADMAP/hybrid-migration-strategy.md +0 -275
- package/ROADMAP/key-decisions-review.md +0 -215
- package/ROADMAP/preliminary-and-milestone-0.8.0-plan.md +0 -307
- package/ROADMAP/v1-webcomponents-investigation.md +0 -521
- package/dist/tablefilter/tablefilter.vite.js +0 -4
- package/dist/tablefilter/tf-1-a5c3a73bd559e47dd5a2.js +0 -1
- package/playwright.config.js +0 -25
- package/scripts/check-css-tokens.js +0 -65
- package/static/demos-assets/img_best-price.png +0 -0
- package/static/demos-assets/img_great-deal.png +0 -0
- package/static/demos-assets/img_maintenance.jpg +0 -0
- package/static/demos-assets/img_new-edition.png +0 -0
- package/static/demos-assets/img_sold-out.png +0 -0
- package/static/partials/books-table-with-images.html +0 -328
- package/static/partials/books.html +0 -273
- package/static/partials/countries-by-continent.html +0 -2592
- package/static/partials/countries-table-tiny.html +0 -436
- package/static/partials/countries-table.html +0 -12954
- package/static/partials/dummy-table-with-totals-footer.html +0 -353
- package/static/partials/dummy-table.html +0 -503
- package/static/partials/pre-inline-script.html +0 -17
- package/static/partials/pre.html +0 -1
- package/static/partials/style.html +0 -23
- package/static/partials/table-with-grouped-headers.html +0 -9258
- package/static/partials/tablefilter-script.html +0 -1
- package/static/style/active-header.styl +0 -10
- package/static/style/alternating-rows.styl +0 -8
- package/static/style/config.styl +0 -44
- package/static/style/custom-properties.styl +0 -43
- package/static/style/extensions/colsVisibility.styl +0 -71
- package/static/style/extensions/filtersVisibility.styl +0 -18
- package/static/style/ezedittable.styl +0 -93
- package/static/style/filter-checklist.styl +0 -52
- package/static/style/filters.styl +0 -111
- package/static/style/grid-layout.styl +0 -130
- package/static/style/help.styl +0 -57
- package/static/style/keyword.styl +0 -8
- package/static/style/loader.styl +0 -16
- package/static/style/mixins/arrow.styl +0 -63
- package/static/style/mixins/box-shadow.styl +0 -8
- package/static/style/mixins/empty-content.styl +0 -7
- package/static/style/noresults.styl +0 -14
- package/static/style/paging.styl +0 -73
- package/static/style/reset-button.styl +0 -21
- package/static/style/rows-counter.styl +0 -17
- package/static/style/sort.styl +0 -20
- package/static/style/status-bar.styl +0 -13
- package/static/style/table.styl +0 -44
- package/static/style/tablefilter.styl +0 -19
- package/static/style/themes/blank.png +0 -0
- package/static/style/themes/btn_clear_filters.png +0 -0
- package/static/style/themes/btn_filter.png +0 -0
- package/static/style/themes/btn_first_page.gif +0 -0
- package/static/style/themes/btn_last_page.gif +0 -0
- package/static/style/themes/btn_next_page.gif +0 -0
- package/static/style/themes/btn_previous_page.gif +0 -0
- package/static/style/themes/default/default.styl +0 -137
- package/static/style/themes/default/images/bg_infDiv.jpg +0 -0
- package/static/style/themes/default/images/bg_th.jpg +0 -0
- package/static/style/themes/default/images/btn_eraser.gif +0 -0
- package/static/style/themes/default/images/btn_first_page.gif +0 -0
- package/static/style/themes/default/images/btn_last_page.gif +0 -0
- package/static/style/themes/default/images/btn_next_page.gif +0 -0
- package/static/style/themes/default/images/btn_over_eraser.gif +0 -0
- package/static/style/themes/default/images/btn_over_first_page.gif +0 -0
- package/static/style/themes/default/images/btn_over_last_page.gif +0 -0
- package/static/style/themes/default/images/btn_over_next_page.gif +0 -0
- package/static/style/themes/default/images/btn_over_previous_page.gif +0 -0
- package/static/style/themes/default/images/btn_previous_page.gif +0 -0
- package/static/style/themes/default/images/img_loading.gif +0 -0
- package/static/style/themes/downsimple.png +0 -0
- package/static/style/themes/icn_clp.png +0 -0
- package/static/style/themes/icn_exp.png +0 -0
- package/static/style/themes/icn_filter.gif +0 -0
- package/static/style/themes/icn_filterActive.gif +0 -0
- package/static/style/themes/mytheme/images/bg_headers.jpg +0 -0
- package/static/style/themes/mytheme/images/bg_infDiv.jpg +0 -0
- package/static/style/themes/mytheme/images/btn_filter.png +0 -0
- package/static/style/themes/mytheme/images/btn_first_page.gif +0 -0
- package/static/style/themes/mytheme/images/btn_last_page.gif +0 -0
- package/static/style/themes/mytheme/images/btn_next_page.gif +0 -0
- package/static/style/themes/mytheme/images/btn_previous_page.gif +0 -0
- package/static/style/themes/mytheme/images/img_loading.gif +0 -0
- package/static/style/themes/mytheme/mytheme.styl +0 -152
- package/static/style/themes/skyblue/images/bg_skyblue.gif +0 -0
- package/static/style/themes/skyblue/images/btn_first_page.gif +0 -0
- package/static/style/themes/skyblue/images/btn_last_page.gif +0 -0
- package/static/style/themes/skyblue/images/btn_next_page.gif +0 -0
- package/static/style/themes/skyblue/images/btn_prev_page.gif +0 -0
- package/static/style/themes/skyblue/images/icn_clear_filters.png +0 -0
- package/static/style/themes/skyblue/images/img_loading.gif +0 -0
- package/static/style/themes/skyblue/skyblue.styl +0 -195
- package/static/style/themes/transparent/images/btn_first_page.gif +0 -0
- package/static/style/themes/transparent/images/btn_last_page.gif +0 -0
- package/static/style/themes/transparent/images/btn_next_page.gif +0 -0
- package/static/style/themes/transparent/images/btn_prev_page.gif +0 -0
- package/static/style/themes/transparent/images/icn_clear_filters.png +0 -0
- package/static/style/themes/transparent/images/img_loading.gif +0 -0
- package/static/style/themes/transparent/transparent.styl +0 -205
- package/static/style/themes/upsimple.png +0 -0
- package/static/style/toolbar.styl +0 -58
- package/static/templates/advanced-grid-editable.html +0 -140
- package/static/templates/advanced-grid-selection.html +0 -93
- package/static/templates/auto-filter.html +0 -46
- package/static/templates/columns-visibility.html +0 -67
- package/static/templates/data-types.html +0 -123
- package/static/templates/demo.html +0 -62
- package/static/templates/external-filters-visibility-commad.html +0 -49
- package/static/templates/external-filters.html +0 -125
- package/static/templates/filter-images.html +0 -91
- package/static/templates/filters-visibility.html +0 -45
- package/static/templates/grid-layout.html +0 -51
- package/static/templates/grouped-headers.html +0 -78
- package/static/templates/linked-filters-disabled.html +0 -56
- package/static/templates/linked-filters.html +0 -45
- package/static/templates/load-filters-on-demand.html +0 -42
- package/static/templates/pagination.html +0 -78
- package/static/templates/requirejs.html +0 -53
- package/static/templates/starter.html +0 -61
- package/static/templates/table-filter.html +0 -40
- package/static/templates/theme-roller.html +0 -106
- package/test/libs/polyfill.js +0 -359
- package/test/libs/qunit/qunit.css +0 -237
- package/test/libs/qunit/qunit.js +0 -2495
- package/test/playwright/axe.baseline.spec.js +0 -34
- package/test/playwright/axe.statusbar.spec.js +0 -35
- package/test/playwright/axeScan.js +0 -42
- package/test/playwright/ce-bridge.spec.js +0 -167
- package/test/playwright/qunit.all.spec.js +0 -10
- package/test/playwright/qunit.single.spec.js +0 -14
- package/test/playwright/qunitSuite.js +0 -56
- package/test/playwright/table-filter.config.spec.js +0 -265
- package/test/playwright/table-filter.demo.spec.js +0 -60
- package/test/playwright/table-filter.element.spec.js +0 -477
- package/test/playwright/tf-clear-button.spec.js +0 -135
- package/test/playwright/tf-rows-counter.spec.js +0 -172
- package/test/playwright/tf-status.spec.js +0 -258
- package/test/test-active-columns.html +0 -80
- package/test/test-active-columns.js +0 -318
- package/test/test-alternate-rows.html +0 -80
- package/test/test-alternate-rows.js +0 -335
- package/test/test-api.html +0 -141
- package/test/test-api.js +0 -795
- package/test/test-auto-filter.html +0 -80
- package/test/test-auto-filter.js +0 -43
- package/test/test-callbacks.html +0 -78
- package/test/test-callbacks.js +0 -58
- package/test/test-case-sensitive-query.html +0 -78
- package/test/test-case-sensitive-query.js +0 -39
- package/test/test-cell-parser.html +0 -109
- package/test/test-cell-parser.js +0 -80
- package/test/test-checklist.html +0 -78
- package/test/test-checklist.js +0 -267
- package/test/test-clear-button.html +0 -79
- package/test/test-clear-button.js +0 -183
- package/test/test-col-ops-grid-layout.html +0 -129
- package/test/test-col-ops-grid-layout.js +0 -134
- package/test/test-col-ops-paging.html +0 -129
- package/test/test-col-ops-paging.js +0 -154
- package/test/test-col-ops.html +0 -129
- package/test/test-col-ops.js +0 -337
- package/test/test-col-widths.html +0 -80
- package/test/test-col-widths.js +0 -40
- package/test/test-cols-visibility-grid-layout.html +0 -80
- package/test/test-cols-visibility-grid-layout.js +0 -165
- package/test/test-cols-visibility.html +0 -80
- package/test/test-cols-visibility.js +0 -121
- package/test/test-custom-options.html +0 -80
- package/test/test-custom-options.js +0 -139
- package/test/test-data-types.html +0 -377
- package/test/test-data-types.js +0 -392
- package/test/test-date-type.html +0 -356
- package/test/test-date-type.js +0 -159
- package/test/test-disable-enter-key.html +0 -78
- package/test/test-disable-enter-key.js +0 -29
- package/test/test-disable-filter-onchange.html +0 -78
- package/test/test-disable-filter-onchange.js +0 -40
- package/test/test-dom-changes.html +0 -78
- package/test/test-dom-changes.js +0 -166
- package/test/test-dropdown.html +0 -78
- package/test/test-dropdown.js +0 -246
- package/test/test-emitter.html +0 -78
- package/test/test-emitter.js +0 -57
- package/test/test-empty-cells-filtering.html +0 -8696
- package/test/test-empty-cells-filtering.js +0 -45
- package/test/test-exact-query-match.html +0 -78
- package/test/test-exact-query-match.js +0 -56
- package/test/test-excluded-rows.html +0 -92
- package/test/test-excluded-rows.js +0 -129
- package/test/test-external-filters.html +0 -100
- package/test/test-external-filters.js +0 -219
- package/test/test-filter-html-elements.html +0 -88
- package/test/test-filter-html-elements.js +0 -63
- package/test/test-filter-operators.html +0 -80
- package/test/test-filter-operators.js +0 -264
- package/test/test-filtering.html +0 -53
- package/test/test-filtering.js +0 -293
- package/test/test-filters-visibility-grid-layout.html +0 -80
- package/test/test-filters-visibility-grid-layout.js +0 -50
- package/test/test-filters-visibility-with-button.html +0 -80
- package/test/test-filters-visibility-with-button.js +0 -48
- package/test/test-filters-visibility.html +0 -80
- package/test/test-filters-visibility.js +0 -48
- package/test/test-grid-layout.html +0 -7736
- package/test/test-grid-layout.js +0 -39
- package/test/test-grouped-headers.html +0 -154
- package/test/test-grouped-headers.js +0 -107
- package/test/test-hash.html +0 -78
- package/test/test-hash.js +0 -88
- package/test/test-help-responsive.html +0 -79
- package/test/test-help-responsive.js +0 -70
- package/test/test-help.html +0 -78
- package/test/test-help.js +0 -217
- package/test/test-highlight-keywords.html +0 -78
- package/test/test-highlight-keywords.js +0 -94
- package/test/test-ignore-diacritics.html +0 -67
- package/test/test-ignore-diacritics.js +0 -117
- package/test/test-integration-paging-sort.html +0 -80
- package/test/test-integration-paging-sort.js +0 -60
- package/test/test-linked-filters-disabled-options-grid-layout.html +0 -80
- package/test/test-linked-filters-disabled-options-grid-layout.js +0 -73
- package/test/test-linked-filters-grid-layout.html +0 -80
- package/test/test-linked-filters-grid-layout.js +0 -72
- package/test/test-linked-filters-load-filters-on-demand.html +0 -80
- package/test/test-linked-filters-load-filters-on-demand.js +0 -99
- package/test/test-linked-filters-paging.html +0 -80
- package/test/test-linked-filters-paging.js +0 -99
- package/test/test-linked-filters.html +0 -80
- package/test/test-linked-filters.js +0 -138
- package/test/test-load-filters-on-demand.html +0 -78
- package/test/test-load-filters-on-demand.js +0 -124
- package/test/test-loader.html +0 -79
- package/test/test-loader.js +0 -159
- package/test/test-no-config.html +0 -80
- package/test/test-no-config.js +0 -63
- package/test/test-no-filters.html +0 -80
- package/test/test-no-filters.js +0 -172
- package/test/test-no-headers.html +0 -71
- package/test/test-no-headers.js +0 -99
- package/test/test-no-results-message.html +0 -262
- package/test/test-no-results-message.js +0 -222
- package/test/test-no-rows.html +0 -19
- package/test/test-no-rows.js +0 -10
- package/test/test-one-row.html +0 -29
- package/test/test-one-row.js +0 -18
- package/test/test-paging.html +0 -78
- package/test/test-paging.js +0 -273
- package/test/test-popup-filter-one-row.html +0 -38
- package/test/test-popup-filter-one-row.js +0 -138
- package/test/test-popup-filter.html +0 -78
- package/test/test-popup-filter.js +0 -384
- package/test/test-popup-filters-grouped-headers.html +0 -104
- package/test/test-popup-filters-grouped-headers.js +0 -206
- package/test/test-rows-counter.html +0 -78
- package/test/test-rows-counter.js +0 -114
- package/test/test-single-filter.html +0 -79
- package/test/test-single-filter.js +0 -138
- package/test/test-sort-custom-sorter.html +0 -244
- package/test/test-sort-custom-sorter.js +0 -74
- package/test/test-sort-grid-layout.html +0 -143
- package/test/test-sort-grid-layout.js +0 -86
- package/test/test-sort-key.html +0 -244
- package/test/test-sort-key.js +0 -67
- package/test/test-sort.html +0 -143
- package/test/test-sort.js +0 -126
- package/test/test-state.html +0 -78
- package/test/test-state.js +0 -369
- package/test/test-status-bar.html +0 -79
- package/test/test-status-bar.js +0 -149
- package/test/test-storage-cookie.html +0 -78
- package/test/test-storage-cookie.js +0 -82
- package/test/test-storage-local.html +0 -78
- package/test/test-storage-local.js +0 -82
- package/test/test-tfoot.html +0 -96
- package/test/test-tfoot.js +0 -123
- package/test/test-thead.html +0 -80
- package/test/test-thead.js +0 -69
- package/test/test-toolbar.html +0 -81
- package/test/test-toolbar.js +0 -218
- package/test/test-uneven-rows.html +0 -95
- package/test/test-uneven-rows.js +0 -61
- package/test/test-watermark.html +0 -80
- package/test/test-watermark.js +0 -103
- package/test/test.html +0 -141
- package/test/test.js +0 -162
- package/vite.config.js +0 -71
- package/webpack.config.js +0 -99
- package/webpack.dev.config.js +0 -25
- package/webpack.test.config.js +0 -44
package/test/test-no-headers.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
var tf = new TableFilter('demo', 0, {
|
|
3
|
-
base_path: '../dist/tablefilter/'
|
|
4
|
-
});
|
|
5
|
-
tf.init();
|
|
6
|
-
|
|
7
|
-
module('Sanity checks');
|
|
8
|
-
test('No headers', function() {
|
|
9
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
|
10
|
-
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
|
11
|
-
deepEqual(tf.refRow, 1, 'Reference row index');
|
|
12
|
-
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
test('Can perform a search', function() {
|
|
16
|
-
tf.setFilterValue(1, 'Ade');
|
|
17
|
-
tf.filter();
|
|
18
|
-
|
|
19
|
-
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
test('Paging with no headers', function() {
|
|
23
|
-
tf.clearFilters();
|
|
24
|
-
tf.destroy();
|
|
25
|
-
tf = new TableFilter('demo', 0, {
|
|
26
|
-
base_path: '../dist/tablefilter/',
|
|
27
|
-
paging: true,
|
|
28
|
-
paging_length: 3
|
|
29
|
-
});
|
|
30
|
-
tf.init();
|
|
31
|
-
|
|
32
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
|
33
|
-
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
|
34
|
-
deepEqual(tf.refRow, 1, 'Reference row index');
|
|
35
|
-
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test('Can perform a search', function() {
|
|
39
|
-
tf.setFilterValue(1, 'Ade');
|
|
40
|
-
tf.filter();
|
|
41
|
-
|
|
42
|
-
deepEqual(tf.getValidRows(), [1], 'Filtered row');
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// Grid layout currently does not handle a table with no headers...
|
|
46
|
-
// Raised in issue 110 (https://github.com/koalyptus/TableFilter/issues/110)
|
|
47
|
-
test('Grid layout with no header', function() {
|
|
48
|
-
tf.clearFilters();
|
|
49
|
-
tf.destroy();
|
|
50
|
-
tf = new TableFilter('demo', {
|
|
51
|
-
base_path: '../dist/tablefilter/',
|
|
52
|
-
grid_layout: {
|
|
53
|
-
no_headers: true
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
tf.init();
|
|
57
|
-
|
|
58
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
|
59
|
-
deepEqual(tf.getFiltersRowIndex(), 1, 'Filters row index');
|
|
60
|
-
deepEqual(tf.refRow, 0, 'Reference row index');
|
|
61
|
-
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
|
62
|
-
deepEqual(tf.getRowsNb(), 7, 'Filterable rows number');
|
|
63
|
-
});
|
|
64
|
-
test('Can perform a search', function() {
|
|
65
|
-
tf.setFilterValue(2, '<900');
|
|
66
|
-
tf.filter();
|
|
67
|
-
|
|
68
|
-
deepEqual(tf.getValidRows(), [2,3], 'Filtered row');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// With no toolbar cannot clear filters :)
|
|
72
|
-
test('Popup filters with no header', function() {
|
|
73
|
-
tf.clearFilters();
|
|
74
|
-
tf.destroy();
|
|
75
|
-
tf = new TableFilter('demo', 0, {
|
|
76
|
-
base_path: '../dist/tablefilter/',
|
|
77
|
-
popup_filters: true
|
|
78
|
-
});
|
|
79
|
-
tf.init();
|
|
80
|
-
|
|
81
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
|
82
|
-
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
|
83
|
-
deepEqual(tf.refRow, 1, 'Reference row index');
|
|
84
|
-
notEqual(tf.getFilterElement(0), null, 'Filter element for column 0');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
test('Can perform a search', function() {
|
|
88
|
-
tf.setFilterValue(1, 'Melbourne');
|
|
89
|
-
tf.filter();
|
|
90
|
-
|
|
91
|
-
deepEqual(tf.getValidRows(), [4], 'Filtered row');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
module('Tear-down');
|
|
95
|
-
test('TableFilter removed', function() {
|
|
96
|
-
tf.clearFilters();
|
|
97
|
-
tf.destroy();
|
|
98
|
-
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
|
99
|
-
});
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>TableFilter no results message</title>
|
|
6
|
-
<link rel="stylesheet" href="libs/qunit/qunit.css">
|
|
7
|
-
<script src="libs/qunit/qunit.js"></script>
|
|
8
|
-
<script src="libs/polyfill.js"></script>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="ext-cont"></div>
|
|
12
|
-
<table id="demo0" cellpadding="0" cellspacing="0">
|
|
13
|
-
<tbody>
|
|
14
|
-
<tr>
|
|
15
|
-
<th>From</th>
|
|
16
|
-
<th>Destination</th>
|
|
17
|
-
<th>Road Distance (km)</th>
|
|
18
|
-
<th>By Air (hrs)</th>
|
|
19
|
-
<th>By Rail (hrs)</th>
|
|
20
|
-
</tr>
|
|
21
|
-
<tr>
|
|
22
|
-
<td><strong>Sydney</strong></td>
|
|
23
|
-
<td>Adelaide</td>
|
|
24
|
-
<td>1412</td>
|
|
25
|
-
<td>1.4</td>
|
|
26
|
-
<td>25.3</td>
|
|
27
|
-
</tr>
|
|
28
|
-
<tr>
|
|
29
|
-
<td><strong>Sydney</strong></td>
|
|
30
|
-
<td>Brisbane</td>
|
|
31
|
-
<td>982</td>
|
|
32
|
-
<td>1.5</td>
|
|
33
|
-
<td>16</td>
|
|
34
|
-
</tr>
|
|
35
|
-
<tr>
|
|
36
|
-
<td><strong>Sydney</strong></td>
|
|
37
|
-
<td>Canberra</td>
|
|
38
|
-
<td>286</td>
|
|
39
|
-
<td>.6</td>
|
|
40
|
-
<td>4.3</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<tr>
|
|
43
|
-
<td><strong>Sydney</strong></td>
|
|
44
|
-
<td>Melbourne</td>
|
|
45
|
-
<td>872</td>
|
|
46
|
-
<td>1.1</td>
|
|
47
|
-
<td>10.5</td>
|
|
48
|
-
</tr>
|
|
49
|
-
<tr>
|
|
50
|
-
<td><strong>Adelaide</strong></td>
|
|
51
|
-
<td>Perth</td>
|
|
52
|
-
<td>2781</td>
|
|
53
|
-
<td>3.1</td>
|
|
54
|
-
<td>38</td>
|
|
55
|
-
</tr>
|
|
56
|
-
<tr>
|
|
57
|
-
<td><strong>Adelaide</strong></td>
|
|
58
|
-
<td>Alice Springs</td>
|
|
59
|
-
<td>1533</td>
|
|
60
|
-
<td>2</td>
|
|
61
|
-
<td>20.25</td>
|
|
62
|
-
</tr>
|
|
63
|
-
<tr>
|
|
64
|
-
<td><strong>Adelaide</strong></td>
|
|
65
|
-
<td>Brisbane</td>
|
|
66
|
-
<td>2045</td>
|
|
67
|
-
<td>2.15</td>
|
|
68
|
-
<td>40</td>
|
|
69
|
-
</tr>
|
|
70
|
-
</tbody>
|
|
71
|
-
</table>
|
|
72
|
-
|
|
73
|
-
<table id="demo1" cellpadding="0" cellspacing="0">
|
|
74
|
-
<tbody>
|
|
75
|
-
<tr>
|
|
76
|
-
<th>From</th>
|
|
77
|
-
<th>Destination</th>
|
|
78
|
-
<th>Road Distance (km)</th>
|
|
79
|
-
<th>By Air (hrs)</th>
|
|
80
|
-
<th>By Rail (hrs)</th>
|
|
81
|
-
</tr>
|
|
82
|
-
<tr>
|
|
83
|
-
<td><strong>Sydney</strong></td>
|
|
84
|
-
<td>Adelaide</td>
|
|
85
|
-
<td>1412</td>
|
|
86
|
-
<td>1.4</td>
|
|
87
|
-
<td>25.3</td>
|
|
88
|
-
</tr>
|
|
89
|
-
<tr>
|
|
90
|
-
<td><strong>Sydney</strong></td>
|
|
91
|
-
<td>Brisbane</td>
|
|
92
|
-
<td>982</td>
|
|
93
|
-
<td>1.5</td>
|
|
94
|
-
<td>16</td>
|
|
95
|
-
</tr>
|
|
96
|
-
<tr>
|
|
97
|
-
<td><strong>Sydney</strong></td>
|
|
98
|
-
<td>Canberra</td>
|
|
99
|
-
<td>286</td>
|
|
100
|
-
<td>.6</td>
|
|
101
|
-
<td>4.3</td>
|
|
102
|
-
</tr>
|
|
103
|
-
<tr>
|
|
104
|
-
<td><strong>Sydney</strong></td>
|
|
105
|
-
<td>Melbourne</td>
|
|
106
|
-
<td>872</td>
|
|
107
|
-
<td>1.1</td>
|
|
108
|
-
<td>10.5</td>
|
|
109
|
-
</tr>
|
|
110
|
-
<tr>
|
|
111
|
-
<td><strong>Adelaide</strong></td>
|
|
112
|
-
<td>Perth</td>
|
|
113
|
-
<td>2781</td>
|
|
114
|
-
<td>3.1</td>
|
|
115
|
-
<td>38</td>
|
|
116
|
-
</tr>
|
|
117
|
-
<tr>
|
|
118
|
-
<td><strong>Adelaide</strong></td>
|
|
119
|
-
<td>Alice Springs</td>
|
|
120
|
-
<td>1533</td>
|
|
121
|
-
<td>2</td>
|
|
122
|
-
<td>20.25</td>
|
|
123
|
-
</tr>
|
|
124
|
-
<tr>
|
|
125
|
-
<td><strong>Adelaide</strong></td>
|
|
126
|
-
<td>Brisbane</td>
|
|
127
|
-
<td>2045</td>
|
|
128
|
-
<td>2.15</td>
|
|
129
|
-
<td>40</td>
|
|
130
|
-
</tr>
|
|
131
|
-
</tbody>
|
|
132
|
-
</table>
|
|
133
|
-
|
|
134
|
-
<table id="demo2" cellpadding="0" cellspacing="0">
|
|
135
|
-
<tbody>
|
|
136
|
-
<tr>
|
|
137
|
-
<th>From</th>
|
|
138
|
-
<th>Destination</th>
|
|
139
|
-
<th>Road Distance (km)</th>
|
|
140
|
-
<th>By Air (hrs)</th>
|
|
141
|
-
<th>By Rail (hrs)</th>
|
|
142
|
-
</tr>
|
|
143
|
-
<tr>
|
|
144
|
-
<td><strong>Sydney</strong></td>
|
|
145
|
-
<td>Adelaide</td>
|
|
146
|
-
<td>1412</td>
|
|
147
|
-
<td>1.4</td>
|
|
148
|
-
<td>25.3</td>
|
|
149
|
-
</tr>
|
|
150
|
-
<tr>
|
|
151
|
-
<td><strong>Sydney</strong></td>
|
|
152
|
-
<td>Brisbane</td>
|
|
153
|
-
<td>982</td>
|
|
154
|
-
<td>1.5</td>
|
|
155
|
-
<td>16</td>
|
|
156
|
-
</tr>
|
|
157
|
-
<tr>
|
|
158
|
-
<td><strong>Sydney</strong></td>
|
|
159
|
-
<td>Canberra</td>
|
|
160
|
-
<td>286</td>
|
|
161
|
-
<td>.6</td>
|
|
162
|
-
<td>4.3</td>
|
|
163
|
-
</tr>
|
|
164
|
-
<tr>
|
|
165
|
-
<td><strong>Sydney</strong></td>
|
|
166
|
-
<td>Melbourne</td>
|
|
167
|
-
<td>872</td>
|
|
168
|
-
<td>1.1</td>
|
|
169
|
-
<td>10.5</td>
|
|
170
|
-
</tr>
|
|
171
|
-
<tr>
|
|
172
|
-
<td><strong>Adelaide</strong></td>
|
|
173
|
-
<td>Perth</td>
|
|
174
|
-
<td>2781</td>
|
|
175
|
-
<td>3.1</td>
|
|
176
|
-
<td>38</td>
|
|
177
|
-
</tr>
|
|
178
|
-
<tr>
|
|
179
|
-
<td><strong>Adelaide</strong></td>
|
|
180
|
-
<td>Alice Springs</td>
|
|
181
|
-
<td>1533</td>
|
|
182
|
-
<td>2</td>
|
|
183
|
-
<td>20.25</td>
|
|
184
|
-
</tr>
|
|
185
|
-
<tr>
|
|
186
|
-
<td><strong>Adelaide</strong></td>
|
|
187
|
-
<td>Brisbane</td>
|
|
188
|
-
<td>2045</td>
|
|
189
|
-
<td>2.15</td>
|
|
190
|
-
<td>40</td>
|
|
191
|
-
</tr>
|
|
192
|
-
</tbody>
|
|
193
|
-
</table>
|
|
194
|
-
|
|
195
|
-
<table id="demo3" cellpadding="0" cellspacing="0">
|
|
196
|
-
<tbody>
|
|
197
|
-
<tr>
|
|
198
|
-
<th>From</th>
|
|
199
|
-
<th>Destination</th>
|
|
200
|
-
<th>Road Distance (km)</th>
|
|
201
|
-
<th>By Air (hrs)</th>
|
|
202
|
-
<th>By Rail (hrs)</th>
|
|
203
|
-
</tr>
|
|
204
|
-
<tr>
|
|
205
|
-
<td><strong>Sydney</strong></td>
|
|
206
|
-
<td>Adelaide</td>
|
|
207
|
-
<td>1412</td>
|
|
208
|
-
<td>1.4</td>
|
|
209
|
-
<td>25.3</td>
|
|
210
|
-
</tr>
|
|
211
|
-
<tr>
|
|
212
|
-
<td><strong>Sydney</strong></td>
|
|
213
|
-
<td>Brisbane</td>
|
|
214
|
-
<td>982</td>
|
|
215
|
-
<td>1.5</td>
|
|
216
|
-
<td>16</td>
|
|
217
|
-
</tr>
|
|
218
|
-
<tr>
|
|
219
|
-
<td><strong>Sydney</strong></td>
|
|
220
|
-
<td>Canberra</td>
|
|
221
|
-
<td>286</td>
|
|
222
|
-
<td>.6</td>
|
|
223
|
-
<td>4.3</td>
|
|
224
|
-
</tr>
|
|
225
|
-
<tr>
|
|
226
|
-
<td><strong>Sydney</strong></td>
|
|
227
|
-
<td>Melbourne</td>
|
|
228
|
-
<td>872</td>
|
|
229
|
-
<td>1.1</td>
|
|
230
|
-
<td>10.5</td>
|
|
231
|
-
</tr>
|
|
232
|
-
<tr>
|
|
233
|
-
<td><strong>Adelaide</strong></td>
|
|
234
|
-
<td>Perth</td>
|
|
235
|
-
<td>2781</td>
|
|
236
|
-
<td>3.1</td>
|
|
237
|
-
<td>38</td>
|
|
238
|
-
</tr>
|
|
239
|
-
<tr>
|
|
240
|
-
<td><strong>Adelaide</strong></td>
|
|
241
|
-
<td>Alice Springs</td>
|
|
242
|
-
<td>1533</td>
|
|
243
|
-
<td>2</td>
|
|
244
|
-
<td>20.25</td>
|
|
245
|
-
</tr>
|
|
246
|
-
<tr>
|
|
247
|
-
<td><strong>Adelaide</strong></td>
|
|
248
|
-
<td>Brisbane</td>
|
|
249
|
-
<td>2045</td>
|
|
250
|
-
<td>2.15</td>
|
|
251
|
-
<td>40</td>
|
|
252
|
-
</tr>
|
|
253
|
-
</tbody>
|
|
254
|
-
</table>
|
|
255
|
-
|
|
256
|
-
<script src="../dist/tablefilter/tablefilter.js"></script>
|
|
257
|
-
<script src="test-no-results-message.js"></script>
|
|
258
|
-
|
|
259
|
-
<div id="qunit"></div>
|
|
260
|
-
<div id="qunit-fixture"></div>
|
|
261
|
-
</body>
|
|
262
|
-
</html>
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module('Sanity checks');
|
|
3
|
-
test('No Results Feature', function() {
|
|
4
|
-
var tf = new TableFilter('demo0', {
|
|
5
|
-
base_path: '../dist/tablefilter/',
|
|
6
|
-
no_results_message: true
|
|
7
|
-
});
|
|
8
|
-
tf.init();
|
|
9
|
-
var noResults = tf.feature('noResults');
|
|
10
|
-
|
|
11
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instantiated');
|
|
12
|
-
notEqual(noResults, null, 'noResults instantiated');
|
|
13
|
-
deepEqual(tf.noResults, true, 'noResults property');
|
|
14
|
-
|
|
15
|
-
module('Feature interface');
|
|
16
|
-
test('Properties', function() {
|
|
17
|
-
deepEqual(noResults.tf instanceof TableFilter, true,
|
|
18
|
-
'TableFilter instance');
|
|
19
|
-
deepEqual(noResults.feature, 'noResults', 'Feature name');
|
|
20
|
-
deepEqual(noResults.enabled, true, 'Feature enabled');
|
|
21
|
-
deepEqual(noResults.initialized, true, 'Feature initialized');
|
|
22
|
-
deepEqual(typeof noResults.emitter, 'object',
|
|
23
|
-
'Feature has emitter instance');
|
|
24
|
-
deepEqual(typeof noResults.config, 'object', 'TF configuration object');
|
|
25
|
-
deepEqual(typeof noResults.init, 'function', 'Feature init method');
|
|
26
|
-
deepEqual(typeof noResults.destroy, 'function',
|
|
27
|
-
'Feature destroy method');
|
|
28
|
-
deepEqual(typeof noResults.reset, 'function', 'Feature reset method');
|
|
29
|
-
deepEqual(typeof noResults.enable, 'function', 'Feature enable method');
|
|
30
|
-
deepEqual(typeof noResults.disable, 'function',
|
|
31
|
-
'Feature enable method');
|
|
32
|
-
deepEqual(typeof noResults.isEnabled, 'function',
|
|
33
|
-
'Feature enable method');
|
|
34
|
-
});
|
|
35
|
-
test('Can destroy', function() {
|
|
36
|
-
noResults.destroy();
|
|
37
|
-
deepEqual(noResults.initialized, false, 'not initialised');
|
|
38
|
-
});
|
|
39
|
-
test('Can reset', function() {
|
|
40
|
-
noResults.reset();
|
|
41
|
-
deepEqual(noResults.enabled, true, 'enabled');
|
|
42
|
-
});
|
|
43
|
-
test('Can disable', function() {
|
|
44
|
-
noResults.disable();
|
|
45
|
-
deepEqual(noResults.enabled, false, 'disabled');
|
|
46
|
-
});
|
|
47
|
-
test('Can enable', function() {
|
|
48
|
-
noResults.enable();
|
|
49
|
-
deepEqual(noResults.enabled, true, 'enabled');
|
|
50
|
-
});
|
|
51
|
-
test('Can init', function() {
|
|
52
|
-
noResults.destroy();
|
|
53
|
-
noResults.enable();
|
|
54
|
-
noResults.init();
|
|
55
|
-
deepEqual(noResults.enabled, true, 'enabled');
|
|
56
|
-
});
|
|
57
|
-
test('Can check is enabled', function() {
|
|
58
|
-
noResults.isEnabled();
|
|
59
|
-
deepEqual(noResults.enabled, true, 'enabled');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
module('Behaviour');
|
|
63
|
-
test('Can display no results message', function() {
|
|
64
|
-
tf.setFilterValue(0, 'sadasd');
|
|
65
|
-
tf.filter();
|
|
66
|
-
deepEqual(tf.getValidRows().length, 0, 'Filtered rows number');
|
|
67
|
-
deepEqual(noResults.cont.innerHTML, 'No results', 'No results message');
|
|
68
|
-
deepEqual(noResults.cont.style.display, 'block',
|
|
69
|
-
'No results message displayed');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
test('Can hide no results message', function() {
|
|
73
|
-
tf.clearFilters();
|
|
74
|
-
deepEqual(tf.getValidRows().length, 7, 'Filtered rows number');
|
|
75
|
-
deepEqual(noResults.cont.innerHTML, 'No results', 'No results message');
|
|
76
|
-
deepEqual(noResults.cont.style.display, 'none', 'Message hidden');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test('can destroy TableFilter DOM elements', function() {
|
|
80
|
-
tf.destroy();
|
|
81
|
-
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
|
82
|
-
tf = null;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
module('Customisation');
|
|
87
|
-
test('External container sanity checks', function() {
|
|
88
|
-
var tfCustom = new TableFilter('demo1', {
|
|
89
|
-
base_path: '../dist/tablefilter/',
|
|
90
|
-
no_results_message: {
|
|
91
|
-
custom_container: document.querySelector('#ext-cont'),
|
|
92
|
-
content: '<h3>No results found</h3>',
|
|
93
|
-
css_class: 'test'
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
tfCustom.init();
|
|
97
|
-
var noResultsCustom = tfCustom.feature('noResults');
|
|
98
|
-
|
|
99
|
-
deepEqual(tfCustom instanceof TableFilter, true,
|
|
100
|
-
'TableFilter instanciated');
|
|
101
|
-
notEqual(noResultsCustom, null, 'noResults instantiated');
|
|
102
|
-
deepEqual(tfCustom.noResults, true, 'noResults property');
|
|
103
|
-
deepEqual(noResultsCustom.cont.nodeName, 'DIV',
|
|
104
|
-
'external container element');
|
|
105
|
-
deepEqual(noResultsCustom.cont.className, 'test',
|
|
106
|
-
'external container element CSS class');
|
|
107
|
-
|
|
108
|
-
test('Can display external no results message', function() {
|
|
109
|
-
tfCustom.setFilterValue(0, 'sadasd');
|
|
110
|
-
tfCustom.filter();
|
|
111
|
-
deepEqual(noResultsCustom.cont.innerHTML, '<h3>No results found</h3>',
|
|
112
|
-
'No results message markup');
|
|
113
|
-
deepEqual(noResultsCustom.cont.style.display, 'block',
|
|
114
|
-
'No results message displayed');
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test('Can hide external no results message', function() {
|
|
118
|
-
tfCustom.clearFilters();
|
|
119
|
-
deepEqual(tfCustom.getValidRows().length, 7, 'Filtered rows number');
|
|
120
|
-
deepEqual(noResultsCustom.cont.style.display, 'none', 'Message hidden');
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('can destroy TableFilter DOM elements', function() {
|
|
124
|
-
tfCustom.destroy();
|
|
125
|
-
deepEqual(tfCustom.isInitialized(), false, 'Filters removed');
|
|
126
|
-
tfCustom = null;
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
module('Integration with grid layout');
|
|
131
|
-
test('Sanity checks', function() {
|
|
132
|
-
var tfGl = new TableFilter('demo2', {
|
|
133
|
-
base_path: '../dist/tablefilter/',
|
|
134
|
-
grid_layout: true,
|
|
135
|
-
no_results_message: true
|
|
136
|
-
});
|
|
137
|
-
tfGl.init();
|
|
138
|
-
var noResultsGl = tfGl.feature('noResults');
|
|
139
|
-
var gridLayout = tfGl.feature('gridLayout');
|
|
140
|
-
|
|
141
|
-
deepEqual(tfGl instanceof TableFilter, true, 'TableFilter instanciated');
|
|
142
|
-
notEqual(noResultsGl, null, 'noResults instantiated');
|
|
143
|
-
deepEqual(tfGl.noResults, true, 'noResults property');
|
|
144
|
-
deepEqual(noResultsGl.cont.nodeName, 'DIV', 'Container element');
|
|
145
|
-
deepEqual(noResultsGl.cont.className, 'no-results',
|
|
146
|
-
'Container element default CSS class');
|
|
147
|
-
|
|
148
|
-
test('Can display no results message in grid layout', function() {
|
|
149
|
-
tfGl.setFilterValue(0, 'sadasd');
|
|
150
|
-
tfGl.filter();
|
|
151
|
-
deepEqual(noResultsGl.cont.innerHTML, 'No results',
|
|
152
|
-
'No results message');
|
|
153
|
-
deepEqual(noResultsGl.cont.style.display, 'block',
|
|
154
|
-
'No results message displayed');
|
|
155
|
-
deepEqual(
|
|
156
|
-
parseInt(noResultsGl.cont.style.width, 10),
|
|
157
|
-
gridLayout.headTbl.clientWidth,
|
|
158
|
-
'Container element width'
|
|
159
|
-
);
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
test('Can hide no results message', function() {
|
|
163
|
-
tfGl.clearFilters();
|
|
164
|
-
deepEqual(noResultsGl.cont.style.display, 'none', 'Message hidden');
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
test('can destroy TableFilter DOM elements', function() {
|
|
168
|
-
tfGl.destroy();
|
|
169
|
-
deepEqual(tfGl.isInitialized(), false, 'Filters removed');
|
|
170
|
-
tfGl = null;
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
module('Callbacks');
|
|
175
|
-
test('External container sanity checks', function() {
|
|
176
|
-
var tfCall = new TableFilter('demo3', {
|
|
177
|
-
base_path: '../dist/tablefilter/',
|
|
178
|
-
no_results_message: {
|
|
179
|
-
on_before_show_msg: function(tfCall, noResultsCall) {
|
|
180
|
-
callback(tfCall, noResultsCall, 'onBeforeShowMessage');
|
|
181
|
-
},
|
|
182
|
-
on_after_show_msg: function(tfCall, noResultsCall) {
|
|
183
|
-
callback(tfCall, noResultsCall, 'onAfterShowMessage');
|
|
184
|
-
},
|
|
185
|
-
on_before_hide_msg: function(tfCall, noResultsCall) {
|
|
186
|
-
callback(tfCall, noResultsCall, 'onBeforeHideMessage');
|
|
187
|
-
},
|
|
188
|
-
on_after_hide_msg: function(tfCall, noResultsCall) {
|
|
189
|
-
callback(tfCall, noResultsCall, 'onAfterHideMessage');
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
tfCall.init();
|
|
194
|
-
var noResultsCall = tfCall.feature('noResults');
|
|
195
|
-
|
|
196
|
-
deepEqual(tfCall instanceof TableFilter, true, 'TableFilter instanciated');
|
|
197
|
-
notEqual(noResultsCall, null, 'noResults instantiated');
|
|
198
|
-
deepEqual(tfCall.noResults, true, 'noResults property');
|
|
199
|
-
deepEqual(noResultsCall.cont.nodeName, 'DIV', 'container element');
|
|
200
|
-
|
|
201
|
-
tfCall.setFilterValue(0, 'sadasd');
|
|
202
|
-
tfCall.filter();
|
|
203
|
-
|
|
204
|
-
tfCall.setFilterValue(0, 'Sydney');
|
|
205
|
-
tfCall.filter();
|
|
206
|
-
|
|
207
|
-
function callback(tfCall, noResultsCall, type) {
|
|
208
|
-
module('Callbacks');
|
|
209
|
-
test(type, function() {
|
|
210
|
-
deepEqual(tfCall instanceof TableFilter, true,
|
|
211
|
-
'First argument type');
|
|
212
|
-
deepEqual(typeof noResultsCall.onBeforeShow, 'function',
|
|
213
|
-
'Second argument type');
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
test('can destroy TableFilter DOM elements', function() {
|
|
218
|
-
tfCall.destroy();
|
|
219
|
-
deepEqual(tfCall.isInitialized(), false, 'Filters removed');
|
|
220
|
-
tfCall = null;
|
|
221
|
-
});
|
|
222
|
-
});
|
package/test/test-no-rows.html
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>TableFilter no rows tests</title>
|
|
6
|
-
<link rel="stylesheet" href="libs/qunit/qunit.css">
|
|
7
|
-
<script src="libs/qunit/qunit.js"></script>
|
|
8
|
-
<script src="libs/polyfill.js"></script>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<table id="demo"></table>
|
|
12
|
-
|
|
13
|
-
<script src="../dist/tablefilter/tablefilter.js"></script>
|
|
14
|
-
<script src="test-no-rows.js"></script>
|
|
15
|
-
|
|
16
|
-
<div id="qunit"></div>
|
|
17
|
-
<div id="qunit-fixture"></div>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
package/test/test-no-rows.js
DELETED
package/test/test-one-row.html
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>TableFilter one row tests</title>
|
|
6
|
-
<link rel="stylesheet" href="libs/qunit/qunit.css">
|
|
7
|
-
<script src="libs/qunit/qunit.js"></script>
|
|
8
|
-
<script src="libs/polyfill.js"></script>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<table id="demo">
|
|
12
|
-
<thead>
|
|
13
|
-
<tr>
|
|
14
|
-
<th>From</th>
|
|
15
|
-
<th>Destination</th>
|
|
16
|
-
<th>Road Distance (km)</th>
|
|
17
|
-
<th>By Air (hrs)</th>
|
|
18
|
-
<th>By Rail (hrs)</th>
|
|
19
|
-
</tr>
|
|
20
|
-
</thead>
|
|
21
|
-
</table>
|
|
22
|
-
|
|
23
|
-
<script src="../dist/tablefilter/tablefilter.js"></script>
|
|
24
|
-
<script src="test-one-row.js"></script>
|
|
25
|
-
|
|
26
|
-
<div id="qunit"></div>
|
|
27
|
-
<div id="qunit-fixture"></div>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
package/test/test-one-row.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var tf = new TableFilter('demo', {
|
|
2
|
-
base_path: '../dist/tablefilter/'
|
|
3
|
-
});
|
|
4
|
-
tf.init();
|
|
5
|
-
|
|
6
|
-
module('Sanity checks');
|
|
7
|
-
test('Only headers with no rows', function() {
|
|
8
|
-
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
|
9
|
-
deepEqual(tf.refRow, 2, 'Reference row index');
|
|
10
|
-
deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index');
|
|
11
|
-
deepEqual(tf.getWorkingRows().length, 0, 'No working rows');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
module('Tear-down');
|
|
15
|
-
test('TableFilter removed', function() {
|
|
16
|
-
tf.destroy();
|
|
17
|
-
deepEqual(tf.isInitialized(), false, 'Filters removed');
|
|
18
|
-
});
|