tablefilter 0.7.3 → 0.7.5
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/.editorconfig +15 -15
- package/.esdoc.json +14 -14
- package/.eslintrc +37 -37
- package/.gitattributes +16 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +36 -36
- package/.github/ISSUE_TEMPLATE/support.md +17 -17
- package/.github/dependabot.yml +10 -0
- package/.github/workflows/build-deploy.yml +141 -0
- package/.github/workflows/opencode-review.yml +104 -0
- package/.github/workflows/opencode.yml +34 -0
- package/AGENTS.md +36 -0
- package/CONTRIBUTING.md +128 -128
- package/Gruntfile.js +252 -252
- package/LICENSE +21 -21
- package/PULL_REQUEST_TEMPLATE.md +24 -24
- package/README.md +166 -174
- package/ROADMAP/README.md +34 -0
- package/ROADMAP/content-projection-parity.md +162 -0
- package/ROADMAP/hybrid-migration-strategy.md +275 -0
- package/ROADMAP/key-decisions-review.md +215 -0
- package/ROADMAP/preliminary-and-milestone-0.8.0-plan.md +307 -0
- package/ROADMAP/v1-webcomponents-investigation.md +521 -0
- package/dist/starter.html +514 -514
- package/dist/tablefilter/style/colsVisibility.css +1 -1
- package/dist/tablefilter/style/filtersVisibility.css +1 -1
- package/dist/tablefilter/style/tablefilter.css +1 -1
- package/dist/tablefilter/style/themes/default/default.css +1 -1
- package/dist/tablefilter/style/themes/mytheme/mytheme.css +1 -1
- package/dist/tablefilter/style/themes/skyblue/skyblue.css +1 -1
- package/dist/tablefilter/style/themes/transparent/transparent.css +1 -1
- package/dist/tablefilter/tablefilter.js +1 -1
- package/dist/tablefilter/tablefilter.vite.js +4 -0
- package/dist/tablefilter/tf-1-a5c3a73bd559e47dd5a2.js +1 -0
- package/dist/tablefilter/tf-2-3a936d22b849361acff5.js +6 -0
- package/dist/tablefilter.cjs.js +4 -0
- package/dist/tablefilter.esm.js +7278 -0
- package/dist/tablefilter.umd.js +4 -0
- package/index.js +3 -3
- package/libs/sortabletable.js +438 -438
- package/package.json +12 -5
- package/playwright.config.js +25 -0
- package/scripts/check-css-tokens.js +65 -0
- package/src/array.js +22 -22
- package/src/components/table-filter.js +243 -0
- package/src/components/tf-clear-button.js +95 -0
- package/src/components/tf-rows-counter.js +82 -0
- package/src/components/tf-status.js +106 -0
- package/src/const.js +118 -118
- package/src/cookie.js +57 -57
- package/src/dom.js +192 -192
- package/src/emitter.js +53 -53
- package/src/event.js +124 -124
- package/src/extensions/advancedGrid/adapterEzEditTable.js +509 -509
- package/src/extensions/advancedGrid/advancedGrid.js +2 -2
- package/src/extensions/colOps/colOps.js +474 -480
- package/src/extensions/colsVisibility/colsVisibility.js +725 -725
- package/src/extensions/filtersVisibility/filtersVisibility.js +316 -316
- package/src/extensions/sort/adapterSortabletable.js +537 -537
- package/src/extensions/sort/sort.js +8 -8
- package/src/feature.js +102 -102
- package/src/modules/alternateRows.js +145 -145
- package/src/modules/baseDropdown.js +160 -160
- package/src/modules/checkList.js +519 -519
- package/src/modules/clearButton.js +196 -142
- package/src/modules/dateType.js +157 -157
- package/src/modules/dropdown.js +376 -376
- package/src/modules/gridLayout.js +483 -483
- package/src/modules/hash.js +126 -126
- package/src/modules/help.js +264 -264
- package/src/modules/highlightKeywords.js +180 -180
- package/src/modules/loader.js +183 -183
- package/src/modules/markActiveColumns.js +146 -146
- package/src/modules/noResults.js +193 -193
- package/src/modules/paging.js +916 -916
- package/src/modules/popupFilter.js +461 -461
- package/src/modules/rowsCounter.js +230 -207
- package/src/modules/state.js +545 -545
- package/src/modules/statusBar.js +340 -308
- package/src/modules/storage.js +161 -161
- package/src/modules/toolbar.js +224 -224
- package/src/number.js +96 -32
- package/src/root.js +6 -6
- package/src/sanitize.js +25 -0
- package/src/settings.js +53 -53
- package/src/sort.js +82 -82
- package/src/string.js +112 -112
- package/src/tablefilter.js +3053 -3053
- package/src/types.js +81 -81
- package/static/partials/books-table-with-images.html +327 -327
- package/static/partials/books.html +272 -272
- package/static/partials/countries-by-continent.html +2592 -2592
- package/static/partials/countries-table-tiny.html +436 -436
- package/static/partials/countries-table.html +12954 -12954
- package/static/partials/dummy-table-with-totals-footer.html +353 -353
- package/static/partials/dummy-table.html +502 -502
- package/static/partials/pre-inline-script.html +17 -17
- package/static/partials/pre.html +1 -1
- package/static/partials/style.html +22 -22
- package/static/partials/table-with-grouped-headers.html +9258 -9258
- package/static/style/active-header.styl +10 -10
- package/static/style/alternating-rows.styl +8 -8
- package/static/style/config.styl +44 -44
- package/static/style/custom-properties.styl +43 -0
- package/static/style/extensions/colsVisibility.styl +71 -71
- package/static/style/extensions/filtersVisibility.styl +18 -18
- package/static/style/ezedittable.styl +93 -93
- package/static/style/filter-checklist.styl +52 -52
- package/static/style/filters.styl +111 -111
- package/static/style/grid-layout.styl +130 -130
- package/static/style/help.styl +57 -57
- package/static/style/keyword.styl +8 -8
- package/static/style/loader.styl +16 -16
- package/static/style/mixins/arrow.styl +63 -63
- package/static/style/mixins/box-shadow.styl +8 -8
- package/static/style/mixins/empty-content.styl +7 -7
- package/static/style/noresults.styl +14 -14
- package/static/style/paging.styl +73 -73
- package/static/style/reset-button.styl +21 -21
- package/static/style/rows-counter.styl +17 -17
- package/static/style/sort.styl +20 -20
- package/static/style/status-bar.styl +13 -16
- package/static/style/table.styl +44 -44
- package/static/style/tablefilter.styl +19 -18
- package/static/style/themes/default/default.styl +137 -137
- package/static/style/themes/mytheme/mytheme.styl +152 -152
- package/static/style/themes/skyblue/skyblue.styl +195 -195
- package/static/style/themes/transparent/transparent.styl +205 -205
- package/static/style/toolbar.styl +58 -58
- package/static/templates/advanced-grid-editable.html +140 -140
- package/static/templates/advanced-grid-selection.html +93 -93
- package/static/templates/auto-filter.html +46 -46
- package/static/templates/columns-visibility.html +67 -67
- package/static/templates/data-types.html +123 -123
- package/static/templates/demo.html +62 -62
- package/static/templates/external-filters-visibility-commad.html +49 -49
- package/static/templates/external-filters.html +125 -125
- package/static/templates/filter-images.html +91 -91
- package/static/templates/filters-visibility.html +45 -45
- package/static/templates/grid-layout.html +51 -51
- package/static/templates/grouped-headers.html +78 -78
- package/static/templates/linked-filters-disabled.html +56 -56
- package/static/templates/linked-filters.html +45 -45
- package/static/templates/load-filters-on-demand.html +42 -42
- package/static/templates/pagination.html +78 -78
- package/static/templates/requirejs.html +53 -53
- package/static/templates/starter.html +61 -61
- package/static/templates/table-filter.html +40 -0
- package/static/templates/theme-roller.html +106 -106
- package/test/libs/polyfill.js +359 -359
- package/test/libs/qunit/qunit.css +237 -237
- package/test/libs/qunit/qunit.js +2495 -2495
- package/test/playwright/axe.baseline.spec.js +34 -0
- package/test/playwright/axe.statusbar.spec.js +35 -0
- package/test/playwright/axeScan.js +42 -0
- package/test/playwright/ce-bridge.spec.js +167 -0
- package/test/playwright/qunit.all.spec.js +10 -0
- package/test/playwright/qunit.single.spec.js +14 -0
- package/test/playwright/qunitSuite.js +56 -0
- package/test/playwright/table-filter.config.spec.js +265 -0
- package/test/playwright/table-filter.demo.spec.js +60 -0
- package/test/playwright/table-filter.element.spec.js +477 -0
- package/test/playwright/tf-clear-button.spec.js +135 -0
- package/test/playwright/tf-rows-counter.spec.js +172 -0
- package/test/playwright/tf-status.spec.js +258 -0
- package/test/test-active-columns.html +80 -80
- package/test/test-active-columns.js +318 -318
- package/test/test-alternate-rows.html +80 -80
- package/test/test-alternate-rows.js +335 -335
- package/test/test-api.html +141 -141
- package/test/test-api.js +795 -795
- package/test/test-auto-filter.html +80 -80
- package/test/test-auto-filter.js +43 -43
- package/test/test-callbacks.html +77 -77
- package/test/test-callbacks.js +58 -58
- package/test/test-case-sensitive-query.html +77 -77
- package/test/test-case-sensitive-query.js +39 -39
- package/test/test-cell-parser.html +109 -109
- package/test/test-cell-parser.js +80 -80
- package/test/test-checklist.html +77 -77
- package/test/test-checklist.js +267 -267
- package/test/test-clear-button.html +79 -79
- package/test/test-clear-button.js +183 -182
- package/test/test-col-ops-grid-layout.html +129 -129
- package/test/test-col-ops-grid-layout.js +134 -134
- package/test/test-col-ops-paging.html +129 -129
- package/test/test-col-ops-paging.js +154 -154
- package/test/test-col-ops.html +129 -129
- package/test/test-col-ops.js +337 -202
- package/test/test-col-widths.html +80 -80
- package/test/test-col-widths.js +40 -40
- package/test/test-cols-visibility-grid-layout.html +80 -80
- package/test/test-cols-visibility-grid-layout.js +165 -165
- package/test/test-cols-visibility.html +80 -80
- package/test/test-cols-visibility.js +121 -121
- package/test/test-custom-options.html +80 -80
- package/test/test-custom-options.js +139 -139
- package/test/test-data-types.html +377 -377
- package/test/test-data-types.js +392 -392
- package/test/test-date-type.html +356 -356
- package/test/test-date-type.js +159 -159
- package/test/test-disable-enter-key.html +77 -77
- package/test/test-disable-enter-key.js +29 -29
- package/test/test-disable-filter-onchange.html +77 -77
- package/test/test-disable-filter-onchange.js +40 -40
- package/test/test-dom-changes.html +77 -77
- package/test/test-dom-changes.js +166 -166
- package/test/test-dropdown.html +77 -77
- package/test/test-dropdown.js +246 -246
- package/test/test-emitter.html +77 -77
- package/test/test-emitter.js +57 -57
- package/test/test-empty-cells-filtering.html +8696 -8696
- package/test/test-empty-cells-filtering.js +45 -45
- package/test/test-exact-query-match.html +77 -77
- package/test/test-exact-query-match.js +56 -56
- package/test/test-excluded-rows.html +92 -92
- package/test/test-excluded-rows.js +129 -129
- package/test/test-external-filters.html +100 -100
- package/test/test-external-filters.js +219 -219
- package/test/test-filter-html-elements.html +88 -88
- package/test/test-filter-html-elements.js +63 -63
- package/test/test-filter-operators.html +80 -80
- package/test/test-filter-operators.js +264 -264
- package/test/test-filtering.html +53 -53
- package/test/test-filtering.js +293 -293
- package/test/test-filters-visibility-grid-layout.html +80 -80
- package/test/test-filters-visibility-grid-layout.js +50 -50
- package/test/test-filters-visibility-with-button.html +80 -80
- package/test/test-filters-visibility-with-button.js +48 -48
- package/test/test-filters-visibility.html +80 -80
- package/test/test-filters-visibility.js +48 -48
- package/test/test-grid-layout.html +7735 -7735
- package/test/test-grid-layout.js +39 -39
- package/test/test-grouped-headers.html +154 -154
- package/test/test-grouped-headers.js +107 -107
- package/test/test-hash.html +78 -78
- package/test/test-hash.js +88 -88
- package/test/test-help-responsive.html +78 -78
- package/test/test-help-responsive.js +70 -70
- package/test/test-help.html +77 -77
- package/test/test-help.js +217 -217
- package/test/test-highlight-keywords.html +77 -77
- package/test/test-highlight-keywords.js +94 -94
- package/test/test-ignore-diacritics.html +67 -57
- package/test/test-ignore-diacritics.js +117 -90
- package/test/test-integration-paging-sort.html +79 -79
- package/test/test-integration-paging-sort.js +60 -60
- package/test/test-linked-filters-disabled-options-grid-layout.html +80 -80
- package/test/test-linked-filters-disabled-options-grid-layout.js +73 -73
- package/test/test-linked-filters-grid-layout.html +80 -80
- package/test/test-linked-filters-grid-layout.js +72 -72
- package/test/test-linked-filters-load-filters-on-demand.html +80 -80
- package/test/test-linked-filters-load-filters-on-demand.js +99 -99
- package/test/test-linked-filters-paging.html +80 -80
- package/test/test-linked-filters-paging.js +99 -99
- package/test/test-linked-filters.html +80 -80
- package/test/test-linked-filters.js +138 -138
- package/test/test-load-filters-on-demand.html +77 -77
- package/test/test-load-filters-on-demand.js +124 -124
- package/test/test-loader.html +79 -79
- package/test/test-loader.js +159 -159
- package/test/test-no-config.html +80 -80
- package/test/test-no-config.js +63 -63
- package/test/test-no-filters.html +80 -80
- package/test/test-no-filters.js +172 -172
- package/test/test-no-headers.html +71 -71
- package/test/test-no-headers.js +99 -99
- package/test/test-no-results-message.html +262 -262
- package/test/test-no-results-message.js +222 -222
- package/test/test-no-rows.html +19 -19
- package/test/test-no-rows.js +10 -10
- package/test/test-one-row.html +29 -29
- package/test/test-one-row.js +18 -18
- package/test/test-paging.html +78 -78
- package/test/test-paging.js +273 -273
- package/test/test-popup-filter-one-row.html +38 -38
- package/test/test-popup-filter-one-row.js +138 -138
- package/test/test-popup-filter.html +78 -78
- package/test/test-popup-filter.js +384 -384
- package/test/test-popup-filters-grouped-headers.html +104 -104
- package/test/test-popup-filters-grouped-headers.js +206 -206
- package/test/test-rows-counter.html +77 -77
- package/test/test-rows-counter.js +114 -112
- package/test/test-single-filter.html +78 -78
- package/test/test-single-filter.js +138 -138
- package/test/test-sort-custom-sorter.html +243 -243
- package/test/test-sort-custom-sorter.js +74 -74
- package/test/test-sort-grid-layout.html +142 -142
- package/test/test-sort-grid-layout.js +86 -86
- package/test/test-sort-key.html +243 -243
- package/test/test-sort-key.js +67 -67
- package/test/test-sort.html +142 -142
- package/test/test-sort.js +126 -126
- package/test/test-state.html +78 -78
- package/test/test-state.js +369 -369
- package/test/test-status-bar.html +79 -79
- package/test/test-status-bar.js +149 -146
- package/test/test-storage-cookie.html +78 -78
- package/test/test-storage-cookie.js +82 -82
- package/test/test-storage-local.html +78 -78
- package/test/test-storage-local.js +82 -82
- package/test/test-tfoot.html +96 -96
- package/test/test-tfoot.js +123 -123
- package/test/test-thead.html +80 -80
- package/test/test-thead.js +69 -69
- package/test/test-toolbar.html +81 -81
- package/test/test-toolbar.js +218 -218
- package/test/test-uneven-rows.html +95 -95
- package/test/test-uneven-rows.js +61 -61
- package/test/test-watermark.html +80 -80
- package/test/test-watermark.js +103 -103
- package/test/test.html +141 -141
- package/test/test.js +162 -162
- package/vite.config.js +71 -0
- package/webpack.config.js +99 -87
- package/webpack.dev.config.js +25 -25
- package/webpack.test.config.js +44 -44
- package/.travis.yml +0 -53
- package/dist/tablefilter/tf-1-2aa33b10e0e549020c12.js +0 -1
package/README.md
CHANGED
|
@@ -1,174 +1,166 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
<script src="
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
###
|
|
65
|
-
|
|
66
|
-
```shell
|
|
67
|
-
<script
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```shell
|
|
91
|
-
npm install
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
```shell
|
|
108
|
-
npm run
|
|
109
|
-
```
|
|
110
|
-
command
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```shell
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
http://
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
## License
|
|
168
|
-
[MIT](LICENSE)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
1
|
+
# TableFilter
|
|
2
|
+
|
|
3
|
+
> A Javascript library making HTML tables filterable
|
|
4
|
+
|
|
5
|
+
TableFilter is a modernised version of the [HTML Table Filter generator](http://tablefilter.free.fr) javascript plugin.
|
|
6
|
+
This library adds to any html table a "filter by column" feature that enables
|
|
7
|
+
users to filter and limit the data displayed within a long table. By default, the script automatically adds a filter grid bar at the top of the desired table.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
* Convert a regular HTML table into an advanced grid component providing:
|
|
11
|
+
* Advanced columns filtering model
|
|
12
|
+
* Sorting and pagination capabilities
|
|
13
|
+
* Complete selection model ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
|
14
|
+
* Extended keyboard navigation ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
|
15
|
+
* Inline cell or row editing ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
|
16
|
+
* Row insertion or deleting ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
|
|
17
|
+
* And even more features...
|
|
18
|
+
* Attach to an existing HTML table
|
|
19
|
+
* Integration with any server-side technology as this is a pure client-side
|
|
20
|
+
solution
|
|
21
|
+
* Exhaustive documentation and powerful API
|
|
22
|
+
|
|
23
|
+
## Getting started
|
|
24
|
+
* Clone the repo using Git:
|
|
25
|
+
```shell
|
|
26
|
+
git clone https://github.com/koalyptus/TableFilter.git
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
* You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository.
|
|
30
|
+
|
|
31
|
+
* TableFilter is available on [npm repository](https://www.npmjs.com/package/tablefilter), you can install it from the command line using the following command:
|
|
32
|
+
```shell
|
|
33
|
+
npm install tablefilter --save-dev
|
|
34
|
+
```
|
|
35
|
+
* or get the future features from the ``next`` release channel:
|
|
36
|
+
```shell
|
|
37
|
+
npm install tablefilter@next --save-dev
|
|
38
|
+
```
|
|
39
|
+
* Alternatively you can also [access these files from unpkg CDN](https://unpkg.com/tablefilter/), download them or point your package manager to them.
|
|
40
|
+
|
|
41
|
+
## Setup
|
|
42
|
+
### Using modules
|
|
43
|
+
Require `TableFilter`:
|
|
44
|
+
```javascript
|
|
45
|
+
// ES2015 modules
|
|
46
|
+
import TableFilter from 'tablefilter';
|
|
47
|
+
|
|
48
|
+
// CommonJS or AMD modules
|
|
49
|
+
var TableFilter = require('tablefilter');
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Using distribution scripts
|
|
53
|
+
If you are not using a module system, you can reference the distribution scripts directly in your html pages:
|
|
54
|
+
```html
|
|
55
|
+
<script src="path_to/node_modules/tablefilter/dist/tablefilter/tablefilter.js"></script>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Placing manually the distribution scripts in your project
|
|
59
|
+
Copy the ``tablefilter`` directory under ``dist`` and place it at desired location in your project. Then include the main js file in your page:
|
|
60
|
+
```shell
|
|
61
|
+
<script src="path/to/my/scripts/tablefilter/tablefilter.js"></script>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Usage
|
|
65
|
+
Place the following snippet just under the HTML table and always define a ``base_path`` property in the configuration object to reflect the path to the script
|
|
66
|
+
```shell
|
|
67
|
+
<script>
|
|
68
|
+
var tf = new TableFilter(document.querySelector('.my-table'), {
|
|
69
|
+
base_path: 'path/to/my/scripts/tablefilter/'
|
|
70
|
+
});
|
|
71
|
+
tf.init();
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
If the ``base_path`` property is not specified, it will default to ``/tablefilter`` directory:
|
|
75
|
+
```shell
|
|
76
|
+
your-page.html
|
|
77
|
+
|— tablefilter
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
This project requires node.js and Grunt to be installed:
|
|
82
|
+
- install [node.js](https://nodejs.org/) v8.9.4 or higher
|
|
83
|
+
- install [Grunt](http://gruntjs.com/getting-started) from the command line using npm (comes with node.js):
|
|
84
|
+
```shell
|
|
85
|
+
npm install -g grunt-cli
|
|
86
|
+
```
|
|
87
|
+
Once ``Grunt`` is sorted out you can follow the instructions below.
|
|
88
|
+
Start by installing any dependencies.
|
|
89
|
+
|
|
90
|
+
```shell
|
|
91
|
+
npm install
|
|
92
|
+
```
|
|
93
|
+
Use
|
|
94
|
+
```shell
|
|
95
|
+
npm run dev
|
|
96
|
+
```
|
|
97
|
+
command to launch a build / watch cycle and start the local
|
|
98
|
+
sever on port ``8080``.
|
|
99
|
+
|
|
100
|
+
Use
|
|
101
|
+
```shell
|
|
102
|
+
npm run build
|
|
103
|
+
```
|
|
104
|
+
command to generate a production build.
|
|
105
|
+
|
|
106
|
+
The
|
|
107
|
+
```shell
|
|
108
|
+
npm run dist
|
|
109
|
+
```
|
|
110
|
+
command will create a production build, run the tests and finally generate
|
|
111
|
+
the demos:
|
|
112
|
+
|
|
113
|
+
To run all the tests and generate the coverage report:
|
|
114
|
+
|
|
115
|
+
```shell
|
|
116
|
+
npm test
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
or to run specific test(s):
|
|
120
|
+
|
|
121
|
+
```shell
|
|
122
|
+
grunt test-only:test.html
|
|
123
|
+
grunt test-only:test.html,test-sort.html
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
to view the coverage report(s), open the `index.html` under the
|
|
127
|
+
`report/coverage` folder or
|
|
128
|
+
[online](https://codecov.io/gh/koalyptus/TableFilter).
|
|
129
|
+
|
|
130
|
+
## Demos
|
|
131
|
+
Check out the online [examples](http://www.tablefilter.com/examples.html)
|
|
132
|
+
or generate the demos locally:
|
|
133
|
+
```shell
|
|
134
|
+
npm run build:demos
|
|
135
|
+
```
|
|
136
|
+
then run the local webserver:
|
|
137
|
+
```shell
|
|
138
|
+
npm start
|
|
139
|
+
```
|
|
140
|
+
then pick a demo from:
|
|
141
|
+
```shell
|
|
142
|
+
http://localhost:8080/demos/
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Documentation
|
|
146
|
+
Find exhaustive documentation on the configuration options in the [WIKI](https://github.com/koalyptus/TableFilter/wiki) section.
|
|
147
|
+
|
|
148
|
+
Autogenerated documentation of the ES6 modules is available on the website: [docs](http://www.tablefilter.com/docs)
|
|
149
|
+
|
|
150
|
+
If you previously used the HTML Table Filter Generator plugin, verify the configuration
|
|
151
|
+
options you are using are still supported: [Obsolete](https://github.com/koalyptus/TableFilter/wiki/Obsolete)
|
|
152
|
+
|
|
153
|
+
Run this task to generate the documentation in the ``docs/docs`` directory:
|
|
154
|
+
```shell
|
|
155
|
+
npm run esdoc
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Support
|
|
159
|
+
* GitHub for [reporting bugs](https://github.com/koalyptus/TableFilter/blob/master/CONTRIBUTING.md#reporting-bugs) and [feature requests](https://github.com/koalyptus/TableFilter/blob/master/CONTRIBUTING.md#suggesting-enhancements-and-features).
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
[MIT](LICENSE)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# TableFilter v1.0.0 Roadmap & Modernization Architecture
|
|
2
|
+
|
|
3
|
+
This directory contains the complete technical specification, architectural investigations, and phased execution plans to modernize **TableFilter** into a fully accessible (WCAG 2.2 AA), native Web Components library while preserving 100% of its established configuration and API contracts.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Roadmap Documentation Index
|
|
8
|
+
|
|
9
|
+
1. [**v1.0.0 Architecture & Migration Investigation**](./v1-webcomponents-investigation.md)
|
|
10
|
+
- Baseline contract analysis (Configuration, Public Methods, EventEmitter lifecycle, Operators).
|
|
11
|
+
- Native Web Components architecture (Autonomous Custom Elements, slotted Light DOM `<table>`, Shadow DOM encapsulation).
|
|
12
|
+
- Comprehensive Accessibility Strategy (WCAG 2.2 Level AA/AAA, WAI-ARIA APG Data Grid / Combobox patterns, polite live regions).
|
|
13
|
+
- Technical debt liquidation and end-to-end modernization roadmap.
|
|
14
|
+
|
|
15
|
+
2. [**Incremental Hybrid Migration Strategy**](./hybrid-migration-strategy.md)
|
|
16
|
+
- Dual-vector coexistence model: Outside-In (`<table-filter>` shell) and Inside-Out (`<tf-status>`, `<tf-rows-counter>`).
|
|
17
|
+
- The Bridge Pattern: How custom elements and the legacy `Feature` base class communicate seamlessly.
|
|
18
|
+
- Module migration risk matrix and phased delivery timeline (`v0.8.0` → `v0.9.0` → `v1.0.0`).
|
|
19
|
+
|
|
20
|
+
3. [**Key Architectural Decisions Review**](./key-decisions-review.md)
|
|
21
|
+
- In-depth evaluation of the three preliminary decisions:
|
|
22
|
+
- **Build Tooling Migration**: Vite multi-bundle output (ESM, CJS, UMD) and CSS Custom Properties. Keeps every class name and the core stylesheet/theme loader + class options (tracked by [#993](https://github.com/koalyptus/TableFilter/issues/993)); tokens and `::part()` are additive. Token/theme *modernization* is deferred to the "Styling modernization (post-1.0)" milestone, after the v1.0.0 launch.
|
|
23
|
+
- **Dependency Rationalization**: Native browser replacements for `diacritics` and `format-number`.
|
|
24
|
+
- **Test Runner Modernization**: Playwright headless execution of all 74 QUnit test suites with integrated Axe-Core audits.
|
|
25
|
+
|
|
26
|
+
4. [**Preliminary Workstreams & Milestone 0.8.0 Blueprint**](./preliminary-and-milestone-0.8.0-plan.md)
|
|
27
|
+
- Step-by-step technical blueprints for preliminary tooling and dependency rationalization.
|
|
28
|
+
- Implementation specification for Milestone 0.8.0 components (`<table-filter>` and `<tf-status>`).
|
|
29
|
+
- Concrete execution task checklist with verification gates.
|
|
30
|
+
|
|
31
|
+
5. [**Content Projection Parity (custom HTML / slotted content)**](./content-projection-parity.md)
|
|
32
|
+
- Inventory of every legacy `innerHTML` config option (`btn_reset.html`, `loader.html`, `help_instructions.*`, `no_results_message.content`, pager button HTML, extension button HTML, colOps `write_method`).
|
|
33
|
+
- One mechanism for all: default `<slot>` + `part`s, with per-option mapping rules.
|
|
34
|
+
- Per-milestone execution plan and the `<tf-status>` HTML-message regression. Owned by [#1012](https://github.com/koalyptus/TableFilter/issues/1012).
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Content Projection Parity (custom HTML / slotted content)
|
|
2
|
+
|
|
3
|
+
**Status:** proposed — owned by [#1012](https://github.com/koalyptus/TableFilter/issues/1012).
|
|
4
|
+
**Scope:** every feature that lets a consumer inject markup through config.
|
|
5
|
+
|
|
6
|
+
## 1. Why this exists
|
|
7
|
+
|
|
8
|
+
Legacy TableFilter lets consumers inject markup through many config options,
|
|
9
|
+
which are written to the DOM with `innerHTML`. The v1.0.0 migration promises
|
|
10
|
+
100% configuration/API parity
|
|
11
|
+
([v1-webcomponents-investigation.md](./v1-webcomponents-investigation.md) §2.4,
|
|
12
|
+
[hybrid-migration-strategy.md](./hybrid-migration-strategy.md)), so every one of
|
|
13
|
+
these options must keep working — or the change must be an explicit, documented
|
|
14
|
+
migration note ([#947](https://github.com/koalyptus/TableFilter/issues/947)).
|
|
15
|
+
|
|
16
|
+
Left ad hoc, each bridge would invent its own escape hatch. This document fixes
|
|
17
|
+
one mechanism and one set of rules for all of them.
|
|
18
|
+
|
|
19
|
+
## 2. Inventory (legacy `innerHTML` injection)
|
|
20
|
+
|
|
21
|
+
| # | Feature | Config key(s) | Property | Injected at | Target element | Milestone |
|
|
22
|
+
|---|---------|---------------|----------|-------------|----------------|-----------|
|
|
23
|
+
| 1 | ClearButton | `btn_reset.html` (default `<input class="reset">`) | `this.html` | `clearButton.js:113` | `<tf-clear-button>` | 0.8.0 |
|
|
24
|
+
| 2 | StatusBar | `status_bar.text`, `msg_*` | `this.text`, `this.msg*` | `statusBar.js:278` | `<tf-status>` | 0.8.0 |
|
|
25
|
+
| 3 | RowsCounter | generated count text | `this.label` | `rowsCounter.js:193` | `<tf-rows-counter>` | 0.8.0 |
|
|
26
|
+
| 4 | Loader | `loader.html` | `this.html` | `loader.js:125` | `<tf-loader>` | 0.8.x |
|
|
27
|
+
| 5 | Help | `help_instructions.html`, `.text`, `.btn_html`, `.btn_text` | `this.instrHtml`, `this.instrText`, `this.btnHtml`, `this.btnText` | `help.js:181,188,194,199` | `<tf-help>` | 0.8.x |
|
|
28
|
+
| 6 | NoResults | `no_results_message.content` ("accepts HTML") | `this.content` | `noResults.js:102` | `<tf-no-results>` | 0.8.x |
|
|
29
|
+
| 7 | PopupFilter | `popup_filters.image_html` | `this.iconHtml` | `popupFilter.js:256` | `<tf-popup-filter>` | 0.8.x |
|
|
30
|
+
| 8 | Paging | `btn_{next,prev,first,last}_page_html` | `this.btn*PageHtml` | `paging.js:400,414,428,442` | `<tf-pager>` | 0.9.0 |
|
|
31
|
+
| 9 | filtersVisibility | `btn_text`, `btn_html` (+ computed collapse/expand) | `this.btn*Html`, `this.btnText` | `filtersVisibility.js:234,237` | extension | post-1.0 |
|
|
32
|
+
| 10 | colsVisibility | `btn_text` (`'Columns▼'`), `btn_html`, `btn_close_text`, `btn_close_html`, `text` | `this.btn*Html`, `this.btn*Text`, `this.text` | `colsVisibility.js:429,437,465,524,528` | extension | post-1.0 |
|
|
33
|
+
| 11 | colOps | `write_method: 'innerHTML'` | `this.outputTypes` | `colOps.js:425` | light-DOM cells | n/a |
|
|
34
|
+
|
|
35
|
+
Two properties of this table drive the plan:
|
|
36
|
+
|
|
37
|
+
- Some **`*_text`** defaults already carry markup or entities
|
|
38
|
+
(`colsVisibility.btn_text = 'Columns▼'`; the **default
|
|
39
|
+
`help_instructions.text` is a block of HTML**). "Text" was never really text.
|
|
40
|
+
- Some **`*_html`** defaults are themselves *interactive controls*
|
|
41
|
+
(`<input class="reset">` for ClearButton; `<input>` pager buttons).
|
|
42
|
+
|
|
43
|
+
## 3. Decision
|
|
44
|
+
|
|
45
|
+
**Custom content is DOM projected into a slot — not policy-free HTML string
|
|
46
|
+
props.** Every migrated component exposes:
|
|
47
|
+
|
|
48
|
+
- a **default `<slot>`** for consumer-supplied content, and
|
|
49
|
+
- **`part`** hooks for nodes the component generates itself.
|
|
50
|
+
|
|
51
|
+
The bridge maps legacy options onto that surface with these rules.
|
|
52
|
+
|
|
53
|
+
| Rule | Applies to | Behaviour |
|
|
54
|
+
|------|-----------|-----------|
|
|
55
|
+
| **P1 Slot-first** | all components | One mechanism: default slot + `part`s. No bespoke `innerHTML` API per component. |
|
|
56
|
+
| **P2 `*_html` → light DOM** | `btn_reset.html`, `loader.html`, `help_instructions.html`, `btn_html`, `image_html`, `btn_*_page_html` | Bridge sets `host.innerHTML = cfg` (sanitised per P7); the slot renders it. Keeps integrator CSS classes working (content stays in light DOM). |
|
|
57
|
+
| **P3 `*_text` → text** | `*_text`, `text`, `content`, `msg_*` | Rendered with `textContent`. Legacy defaults that embed markup/entities are split into plain text + a `*_html` path (fix the default, not the consumer). |
|
|
58
|
+
| **P4 No wrapper (route 2)** | button components (ClearButton, Help widget, Paging, filtersVisibility, colsVisibility) | The element renders the bare `<slot>`; a slotted control is the control; the host adds button semantics only for element-rendered content. No nested controls. |
|
|
59
|
+
| **P5 Messages preserve HTML** | StatusBar, NoResults | The message node renders configured values as HTML (`innerHTML`), matching legacy `statusBar` (`msgContainer.innerHTML = t`). The label/`text` stays text (legacy used a text node). No silent escaping. |
|
|
60
|
+
| **P6 Extensions off-shadow** | colOps, gridLayout | Content written into the light-DOM table is unaffected by Shadow DOM; keep as-is. |
|
|
61
|
+
| **P7 Sanitised boundary** | all | Config HTML is integrator-authored but always passed through `sanitizeHtml()` (DOMPurify) before `innerHTML`: ordinary markup is preserved, scripts / event handlers / `javascript:` URLs are stripped. The one shared helper is the trust boundary. |
|
|
62
|
+
|
|
63
|
+
### P4 in practice — route 2 (no wrapper)
|
|
64
|
+
|
|
65
|
+
The element template is `<button part="button"><slot></slot></button>`, so a
|
|
66
|
+
slotted `btn_reset.html` becomes a control inside a control
|
|
67
|
+
(`<button><input type="button" class="reset"></button>` — invalid, two
|
|
68
|
+
activatable elements). Legacy had no wrapper: the `<input class="reset">` /
|
|
69
|
+
`<a class="reset">` was the control.
|
|
70
|
+
|
|
71
|
+
**Chosen route: 2 (no wrapper).** The element renders the bare `<slot>` and
|
|
72
|
+
never wraps consumer content in a `<button>`. The contract:
|
|
73
|
+
|
|
74
|
+
- **Consumer content** (`*_html`, or declarative light DOM) is projected
|
|
75
|
+
verbatim and owns its semantics. For `btn_reset.html` the `<input
|
|
76
|
+
class="reset">` / `<a class="reset">` stays the control. The host adds **no**
|
|
77
|
+
`role="button"`/`tabindex` (no double control) but still listens for the
|
|
78
|
+
bubbling `click` to fire the feature action.
|
|
79
|
+
- **No consumer content**: the element renders its own control *and only then*
|
|
80
|
+
exposes button semantics (`role="button"`, `tabindex="0"`, Enter/Space),
|
|
81
|
+
themed via `::part(button)`.
|
|
82
|
+
|
|
83
|
+
Consequences:
|
|
84
|
+
|
|
85
|
+
- `btn_reset.html` works verbatim, including the default `<input class="reset">`
|
|
86
|
+
icon, so the theme's `input.reset` (`static/style/reset-button.styl`) keeps
|
|
87
|
+
painting it. The interim `!this.html` icon-mode fallback to the legacy path
|
|
88
|
+
can then be dropped.
|
|
89
|
+
- `<tf-clear-button>` must change: remove the wrapper `<button>` and stop
|
|
90
|
+
`_update()` setting `button.textContent` (today that deletes the `<slot>`, so
|
|
91
|
+
slotted content is never projected).
|
|
92
|
+
- Pager / filtersVisibility / colsVisibility / Help widget adopt the same
|
|
93
|
+
shape: bare slot; host semantics only for element-rendered content.
|
|
94
|
+
|
|
95
|
+
Trade-off accepted: for consumer-supplied controls the element is a wrapper,
|
|
96
|
+
not a single `<button>`.
|
|
97
|
+
|
|
98
|
+
## 4. Resolved regression: `<tf-status>` HTML messages
|
|
99
|
+
|
|
100
|
+
The merged `<tf-status>` bridge renders messages with `textContent`
|
|
101
|
+
(`src/components/tf-status.js`), while legacy `statusBar` used `innerHTML`
|
|
102
|
+
(`statusBar.js:278`). Consumers who put markup in `status_bar.text` / `msg_*`
|
|
103
|
+
now see escaped text.
|
|
104
|
+
|
|
105
|
+
**Decision (parity wins): fix.** Render the `message` part with `innerHTML`
|
|
106
|
+
from the `message` attribute, i.e. `this._msgEl.innerHTML = ...`, with the
|
|
107
|
+
markup passed through `sanitizeHtml()` first (P7). The `label` part stays
|
|
108
|
+
`textContent` — legacy also used a text node for `text`
|
|
109
|
+
(`statusBar.js` `labelSpan.appendChild(createText(this.text))`), so it is
|
|
110
|
+
already correct. Implemented in
|
|
111
|
+
[#1014](https://github.com/koalyptus/TableFilter/issues/1014), with
|
|
112
|
+
HTML-message and sanitiser tests.
|
|
113
|
+
|
|
114
|
+
## 5. Per-milestone execution
|
|
115
|
+
|
|
116
|
+
### 0.8.0 (parity of the shipped leaf components)
|
|
117
|
+
- [x] `<tf-status>`: render the message part as sanitised HTML (§4, decided); keep the label as text ([#1014](https://github.com/koalyptus/TableFilter/issues/1014)).
|
|
118
|
+
- [ ] `<tf-clear-button>`: rework to route 2 (§3) — remove the wrapper
|
|
119
|
+
`<button>`, keep the `<slot>`, stop `_update()` deleting it, and add host
|
|
120
|
+
semantics only for element-rendered content. Then drop the `!this.html`
|
|
121
|
+
icon-mode fallback.
|
|
122
|
+
- [ ] `<tf-rows-counter>`: no consumer markup; confirm label is text-only.
|
|
123
|
+
|
|
124
|
+
### 0.8.x
|
|
125
|
+
- [ ] Route every `*_html` injection below through `sanitizeHtml()` (P7).
|
|
126
|
+
- [ ] `<tf-loader>`: `loader.html` → slot (P2); text fallback (P3).
|
|
127
|
+
- [ ] `<tf-help>`: instructions (`html`/`text`) + button (`btn_html`/`btn_text`) → slot(s); fix the HTML default (inventory row 5).
|
|
128
|
+
- [ ] `<tf-no-results>`: `content` → slot or part; decide text vs HTML for the default message.
|
|
129
|
+
- [ ] `<tf-popup-filter>`: `image_html` → slotted icon (P2); the icon element owns its semantics (P4 route 2).
|
|
130
|
+
|
|
131
|
+
### 0.9.0
|
|
132
|
+
- [ ] `<tf-pager>`: `btn_*_page_html` → slotted button content (P2/P4 route 2); `btn_*_page_text` → text (P3).
|
|
133
|
+
|
|
134
|
+
### post-1.0 (extensions)
|
|
135
|
+
- [ ] filtersVisibility / colsVisibility: `*_html` → slots, `*_text` → text; fix entity defaults.
|
|
136
|
+
- [ ] colOps: unaffected (P6).
|
|
137
|
+
|
|
138
|
+
## 6. Alternatives considered
|
|
139
|
+
|
|
140
|
+
- **Keep `innerHTML` string props on every component.** Rejected: duplicates the
|
|
141
|
+
legacy problem, no declarative story, and breaks the "structure/hooks only"
|
|
142
|
+
rule the components already follow.
|
|
143
|
+
- **Render everything as `textContent`.** Rejected: silently breaks documented
|
|
144
|
+
HTML config (Help default text, Loader, NoResults, Pager buttons).
|
|
145
|
+
- **No sanitiser.** Rejected (review on
|
|
146
|
+
[#1014](https://github.com/koalyptus/TableFilter/issues/1014)): raw
|
|
147
|
+
`innerHTML` of config
|
|
148
|
+
markup is an XSS sink waiting for one accidental untrusted value. Instead
|
|
149
|
+
every injection goes through `sanitizeHtml()` (`src/sanitize.js`,
|
|
150
|
+
**DOMPurify**), the project's first runtime dependency — an accepted
|
|
151
|
+
trade-off, since a small, audited sanitiser beats a bespoke one. It is a
|
|
152
|
+
boundary, not a behaviour change for benign config.
|
|
153
|
+
|
|
154
|
+
## 7. Verification
|
|
155
|
+
|
|
156
|
+
Each component bridge that handles a `*_html`/`*_text` option adds a Playwright
|
|
157
|
+
test asserting (a) the configured content renders through the slot/part,
|
|
158
|
+
(b) it is not dropped, and (c) for `*_html`, dangerous markup is stripped by
|
|
159
|
+
`sanitizeHtml()` (see the `tf-status` sanitiser test in
|
|
160
|
+
[#1014](https://github.com/koalyptus/TableFilter/issues/1014)). The icon-mode
|
|
161
|
+
case in the bridge suite `test/playwright/ce-bridge.spec.js`
|
|
162
|
+
([#1011](https://github.com/koalyptus/TableFilter/issues/1011)) is the template.
|