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.
Files changed (319) hide show
  1. package/.editorconfig +15 -15
  2. package/.esdoc.json +14 -14
  3. package/.eslintrc +37 -37
  4. package/.gitattributes +16 -0
  5. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -38
  6. package/.github/ISSUE_TEMPLATE/feature_request.md +36 -36
  7. package/.github/ISSUE_TEMPLATE/support.md +17 -17
  8. package/.github/dependabot.yml +10 -0
  9. package/.github/workflows/build-deploy.yml +141 -0
  10. package/.github/workflows/opencode-review.yml +104 -0
  11. package/.github/workflows/opencode.yml +34 -0
  12. package/AGENTS.md +36 -0
  13. package/CONTRIBUTING.md +128 -128
  14. package/Gruntfile.js +252 -252
  15. package/LICENSE +21 -21
  16. package/PULL_REQUEST_TEMPLATE.md +24 -24
  17. package/README.md +166 -174
  18. package/ROADMAP/README.md +34 -0
  19. package/ROADMAP/content-projection-parity.md +162 -0
  20. package/ROADMAP/hybrid-migration-strategy.md +275 -0
  21. package/ROADMAP/key-decisions-review.md +215 -0
  22. package/ROADMAP/preliminary-and-milestone-0.8.0-plan.md +307 -0
  23. package/ROADMAP/v1-webcomponents-investigation.md +521 -0
  24. package/dist/starter.html +514 -514
  25. package/dist/tablefilter/style/colsVisibility.css +1 -1
  26. package/dist/tablefilter/style/filtersVisibility.css +1 -1
  27. package/dist/tablefilter/style/tablefilter.css +1 -1
  28. package/dist/tablefilter/style/themes/default/default.css +1 -1
  29. package/dist/tablefilter/style/themes/mytheme/mytheme.css +1 -1
  30. package/dist/tablefilter/style/themes/skyblue/skyblue.css +1 -1
  31. package/dist/tablefilter/style/themes/transparent/transparent.css +1 -1
  32. package/dist/tablefilter/tablefilter.js +1 -1
  33. package/dist/tablefilter/tablefilter.vite.js +4 -0
  34. package/dist/tablefilter/tf-1-a5c3a73bd559e47dd5a2.js +1 -0
  35. package/dist/tablefilter/tf-2-3a936d22b849361acff5.js +6 -0
  36. package/dist/tablefilter.cjs.js +4 -0
  37. package/dist/tablefilter.esm.js +7278 -0
  38. package/dist/tablefilter.umd.js +4 -0
  39. package/index.js +3 -3
  40. package/libs/sortabletable.js +438 -438
  41. package/package.json +12 -5
  42. package/playwright.config.js +25 -0
  43. package/scripts/check-css-tokens.js +65 -0
  44. package/src/array.js +22 -22
  45. package/src/components/table-filter.js +243 -0
  46. package/src/components/tf-clear-button.js +95 -0
  47. package/src/components/tf-rows-counter.js +82 -0
  48. package/src/components/tf-status.js +106 -0
  49. package/src/const.js +118 -118
  50. package/src/cookie.js +57 -57
  51. package/src/dom.js +192 -192
  52. package/src/emitter.js +53 -53
  53. package/src/event.js +124 -124
  54. package/src/extensions/advancedGrid/adapterEzEditTable.js +509 -509
  55. package/src/extensions/advancedGrid/advancedGrid.js +2 -2
  56. package/src/extensions/colOps/colOps.js +474 -480
  57. package/src/extensions/colsVisibility/colsVisibility.js +725 -725
  58. package/src/extensions/filtersVisibility/filtersVisibility.js +316 -316
  59. package/src/extensions/sort/adapterSortabletable.js +537 -537
  60. package/src/extensions/sort/sort.js +8 -8
  61. package/src/feature.js +102 -102
  62. package/src/modules/alternateRows.js +145 -145
  63. package/src/modules/baseDropdown.js +160 -160
  64. package/src/modules/checkList.js +519 -519
  65. package/src/modules/clearButton.js +196 -142
  66. package/src/modules/dateType.js +157 -157
  67. package/src/modules/dropdown.js +376 -376
  68. package/src/modules/gridLayout.js +483 -483
  69. package/src/modules/hash.js +126 -126
  70. package/src/modules/help.js +264 -264
  71. package/src/modules/highlightKeywords.js +180 -180
  72. package/src/modules/loader.js +183 -183
  73. package/src/modules/markActiveColumns.js +146 -146
  74. package/src/modules/noResults.js +193 -193
  75. package/src/modules/paging.js +916 -916
  76. package/src/modules/popupFilter.js +461 -461
  77. package/src/modules/rowsCounter.js +230 -207
  78. package/src/modules/state.js +545 -545
  79. package/src/modules/statusBar.js +340 -308
  80. package/src/modules/storage.js +161 -161
  81. package/src/modules/toolbar.js +224 -224
  82. package/src/number.js +96 -32
  83. package/src/root.js +6 -6
  84. package/src/sanitize.js +25 -0
  85. package/src/settings.js +53 -53
  86. package/src/sort.js +82 -82
  87. package/src/string.js +112 -112
  88. package/src/tablefilter.js +3053 -3053
  89. package/src/types.js +81 -81
  90. package/static/partials/books-table-with-images.html +327 -327
  91. package/static/partials/books.html +272 -272
  92. package/static/partials/countries-by-continent.html +2592 -2592
  93. package/static/partials/countries-table-tiny.html +436 -436
  94. package/static/partials/countries-table.html +12954 -12954
  95. package/static/partials/dummy-table-with-totals-footer.html +353 -353
  96. package/static/partials/dummy-table.html +502 -502
  97. package/static/partials/pre-inline-script.html +17 -17
  98. package/static/partials/pre.html +1 -1
  99. package/static/partials/style.html +22 -22
  100. package/static/partials/table-with-grouped-headers.html +9258 -9258
  101. package/static/style/active-header.styl +10 -10
  102. package/static/style/alternating-rows.styl +8 -8
  103. package/static/style/config.styl +44 -44
  104. package/static/style/custom-properties.styl +43 -0
  105. package/static/style/extensions/colsVisibility.styl +71 -71
  106. package/static/style/extensions/filtersVisibility.styl +18 -18
  107. package/static/style/ezedittable.styl +93 -93
  108. package/static/style/filter-checklist.styl +52 -52
  109. package/static/style/filters.styl +111 -111
  110. package/static/style/grid-layout.styl +130 -130
  111. package/static/style/help.styl +57 -57
  112. package/static/style/keyword.styl +8 -8
  113. package/static/style/loader.styl +16 -16
  114. package/static/style/mixins/arrow.styl +63 -63
  115. package/static/style/mixins/box-shadow.styl +8 -8
  116. package/static/style/mixins/empty-content.styl +7 -7
  117. package/static/style/noresults.styl +14 -14
  118. package/static/style/paging.styl +73 -73
  119. package/static/style/reset-button.styl +21 -21
  120. package/static/style/rows-counter.styl +17 -17
  121. package/static/style/sort.styl +20 -20
  122. package/static/style/status-bar.styl +13 -16
  123. package/static/style/table.styl +44 -44
  124. package/static/style/tablefilter.styl +19 -18
  125. package/static/style/themes/default/default.styl +137 -137
  126. package/static/style/themes/mytheme/mytheme.styl +152 -152
  127. package/static/style/themes/skyblue/skyblue.styl +195 -195
  128. package/static/style/themes/transparent/transparent.styl +205 -205
  129. package/static/style/toolbar.styl +58 -58
  130. package/static/templates/advanced-grid-editable.html +140 -140
  131. package/static/templates/advanced-grid-selection.html +93 -93
  132. package/static/templates/auto-filter.html +46 -46
  133. package/static/templates/columns-visibility.html +67 -67
  134. package/static/templates/data-types.html +123 -123
  135. package/static/templates/demo.html +62 -62
  136. package/static/templates/external-filters-visibility-commad.html +49 -49
  137. package/static/templates/external-filters.html +125 -125
  138. package/static/templates/filter-images.html +91 -91
  139. package/static/templates/filters-visibility.html +45 -45
  140. package/static/templates/grid-layout.html +51 -51
  141. package/static/templates/grouped-headers.html +78 -78
  142. package/static/templates/linked-filters-disabled.html +56 -56
  143. package/static/templates/linked-filters.html +45 -45
  144. package/static/templates/load-filters-on-demand.html +42 -42
  145. package/static/templates/pagination.html +78 -78
  146. package/static/templates/requirejs.html +53 -53
  147. package/static/templates/starter.html +61 -61
  148. package/static/templates/table-filter.html +40 -0
  149. package/static/templates/theme-roller.html +106 -106
  150. package/test/libs/polyfill.js +359 -359
  151. package/test/libs/qunit/qunit.css +237 -237
  152. package/test/libs/qunit/qunit.js +2495 -2495
  153. package/test/playwright/axe.baseline.spec.js +34 -0
  154. package/test/playwright/axe.statusbar.spec.js +35 -0
  155. package/test/playwright/axeScan.js +42 -0
  156. package/test/playwright/ce-bridge.spec.js +167 -0
  157. package/test/playwright/qunit.all.spec.js +10 -0
  158. package/test/playwright/qunit.single.spec.js +14 -0
  159. package/test/playwright/qunitSuite.js +56 -0
  160. package/test/playwright/table-filter.config.spec.js +265 -0
  161. package/test/playwright/table-filter.demo.spec.js +60 -0
  162. package/test/playwright/table-filter.element.spec.js +477 -0
  163. package/test/playwright/tf-clear-button.spec.js +135 -0
  164. package/test/playwright/tf-rows-counter.spec.js +172 -0
  165. package/test/playwright/tf-status.spec.js +258 -0
  166. package/test/test-active-columns.html +80 -80
  167. package/test/test-active-columns.js +318 -318
  168. package/test/test-alternate-rows.html +80 -80
  169. package/test/test-alternate-rows.js +335 -335
  170. package/test/test-api.html +141 -141
  171. package/test/test-api.js +795 -795
  172. package/test/test-auto-filter.html +80 -80
  173. package/test/test-auto-filter.js +43 -43
  174. package/test/test-callbacks.html +77 -77
  175. package/test/test-callbacks.js +58 -58
  176. package/test/test-case-sensitive-query.html +77 -77
  177. package/test/test-case-sensitive-query.js +39 -39
  178. package/test/test-cell-parser.html +109 -109
  179. package/test/test-cell-parser.js +80 -80
  180. package/test/test-checklist.html +77 -77
  181. package/test/test-checklist.js +267 -267
  182. package/test/test-clear-button.html +79 -79
  183. package/test/test-clear-button.js +183 -182
  184. package/test/test-col-ops-grid-layout.html +129 -129
  185. package/test/test-col-ops-grid-layout.js +134 -134
  186. package/test/test-col-ops-paging.html +129 -129
  187. package/test/test-col-ops-paging.js +154 -154
  188. package/test/test-col-ops.html +129 -129
  189. package/test/test-col-ops.js +337 -202
  190. package/test/test-col-widths.html +80 -80
  191. package/test/test-col-widths.js +40 -40
  192. package/test/test-cols-visibility-grid-layout.html +80 -80
  193. package/test/test-cols-visibility-grid-layout.js +165 -165
  194. package/test/test-cols-visibility.html +80 -80
  195. package/test/test-cols-visibility.js +121 -121
  196. package/test/test-custom-options.html +80 -80
  197. package/test/test-custom-options.js +139 -139
  198. package/test/test-data-types.html +377 -377
  199. package/test/test-data-types.js +392 -392
  200. package/test/test-date-type.html +356 -356
  201. package/test/test-date-type.js +159 -159
  202. package/test/test-disable-enter-key.html +77 -77
  203. package/test/test-disable-enter-key.js +29 -29
  204. package/test/test-disable-filter-onchange.html +77 -77
  205. package/test/test-disable-filter-onchange.js +40 -40
  206. package/test/test-dom-changes.html +77 -77
  207. package/test/test-dom-changes.js +166 -166
  208. package/test/test-dropdown.html +77 -77
  209. package/test/test-dropdown.js +246 -246
  210. package/test/test-emitter.html +77 -77
  211. package/test/test-emitter.js +57 -57
  212. package/test/test-empty-cells-filtering.html +8696 -8696
  213. package/test/test-empty-cells-filtering.js +45 -45
  214. package/test/test-exact-query-match.html +77 -77
  215. package/test/test-exact-query-match.js +56 -56
  216. package/test/test-excluded-rows.html +92 -92
  217. package/test/test-excluded-rows.js +129 -129
  218. package/test/test-external-filters.html +100 -100
  219. package/test/test-external-filters.js +219 -219
  220. package/test/test-filter-html-elements.html +88 -88
  221. package/test/test-filter-html-elements.js +63 -63
  222. package/test/test-filter-operators.html +80 -80
  223. package/test/test-filter-operators.js +264 -264
  224. package/test/test-filtering.html +53 -53
  225. package/test/test-filtering.js +293 -293
  226. package/test/test-filters-visibility-grid-layout.html +80 -80
  227. package/test/test-filters-visibility-grid-layout.js +50 -50
  228. package/test/test-filters-visibility-with-button.html +80 -80
  229. package/test/test-filters-visibility-with-button.js +48 -48
  230. package/test/test-filters-visibility.html +80 -80
  231. package/test/test-filters-visibility.js +48 -48
  232. package/test/test-grid-layout.html +7735 -7735
  233. package/test/test-grid-layout.js +39 -39
  234. package/test/test-grouped-headers.html +154 -154
  235. package/test/test-grouped-headers.js +107 -107
  236. package/test/test-hash.html +78 -78
  237. package/test/test-hash.js +88 -88
  238. package/test/test-help-responsive.html +78 -78
  239. package/test/test-help-responsive.js +70 -70
  240. package/test/test-help.html +77 -77
  241. package/test/test-help.js +217 -217
  242. package/test/test-highlight-keywords.html +77 -77
  243. package/test/test-highlight-keywords.js +94 -94
  244. package/test/test-ignore-diacritics.html +67 -57
  245. package/test/test-ignore-diacritics.js +117 -90
  246. package/test/test-integration-paging-sort.html +79 -79
  247. package/test/test-integration-paging-sort.js +60 -60
  248. package/test/test-linked-filters-disabled-options-grid-layout.html +80 -80
  249. package/test/test-linked-filters-disabled-options-grid-layout.js +73 -73
  250. package/test/test-linked-filters-grid-layout.html +80 -80
  251. package/test/test-linked-filters-grid-layout.js +72 -72
  252. package/test/test-linked-filters-load-filters-on-demand.html +80 -80
  253. package/test/test-linked-filters-load-filters-on-demand.js +99 -99
  254. package/test/test-linked-filters-paging.html +80 -80
  255. package/test/test-linked-filters-paging.js +99 -99
  256. package/test/test-linked-filters.html +80 -80
  257. package/test/test-linked-filters.js +138 -138
  258. package/test/test-load-filters-on-demand.html +77 -77
  259. package/test/test-load-filters-on-demand.js +124 -124
  260. package/test/test-loader.html +79 -79
  261. package/test/test-loader.js +159 -159
  262. package/test/test-no-config.html +80 -80
  263. package/test/test-no-config.js +63 -63
  264. package/test/test-no-filters.html +80 -80
  265. package/test/test-no-filters.js +172 -172
  266. package/test/test-no-headers.html +71 -71
  267. package/test/test-no-headers.js +99 -99
  268. package/test/test-no-results-message.html +262 -262
  269. package/test/test-no-results-message.js +222 -222
  270. package/test/test-no-rows.html +19 -19
  271. package/test/test-no-rows.js +10 -10
  272. package/test/test-one-row.html +29 -29
  273. package/test/test-one-row.js +18 -18
  274. package/test/test-paging.html +78 -78
  275. package/test/test-paging.js +273 -273
  276. package/test/test-popup-filter-one-row.html +38 -38
  277. package/test/test-popup-filter-one-row.js +138 -138
  278. package/test/test-popup-filter.html +78 -78
  279. package/test/test-popup-filter.js +384 -384
  280. package/test/test-popup-filters-grouped-headers.html +104 -104
  281. package/test/test-popup-filters-grouped-headers.js +206 -206
  282. package/test/test-rows-counter.html +77 -77
  283. package/test/test-rows-counter.js +114 -112
  284. package/test/test-single-filter.html +78 -78
  285. package/test/test-single-filter.js +138 -138
  286. package/test/test-sort-custom-sorter.html +243 -243
  287. package/test/test-sort-custom-sorter.js +74 -74
  288. package/test/test-sort-grid-layout.html +142 -142
  289. package/test/test-sort-grid-layout.js +86 -86
  290. package/test/test-sort-key.html +243 -243
  291. package/test/test-sort-key.js +67 -67
  292. package/test/test-sort.html +142 -142
  293. package/test/test-sort.js +126 -126
  294. package/test/test-state.html +78 -78
  295. package/test/test-state.js +369 -369
  296. package/test/test-status-bar.html +79 -79
  297. package/test/test-status-bar.js +149 -146
  298. package/test/test-storage-cookie.html +78 -78
  299. package/test/test-storage-cookie.js +82 -82
  300. package/test/test-storage-local.html +78 -78
  301. package/test/test-storage-local.js +82 -82
  302. package/test/test-tfoot.html +96 -96
  303. package/test/test-tfoot.js +123 -123
  304. package/test/test-thead.html +80 -80
  305. package/test/test-thead.js +69 -69
  306. package/test/test-toolbar.html +81 -81
  307. package/test/test-toolbar.js +218 -218
  308. package/test/test-uneven-rows.html +95 -95
  309. package/test/test-uneven-rows.js +61 -61
  310. package/test/test-watermark.html +80 -80
  311. package/test/test-watermark.js +103 -103
  312. package/test/test.html +141 -141
  313. package/test/test.js +162 -162
  314. package/vite.config.js +71 -0
  315. package/webpack.config.js +99 -87
  316. package/webpack.dev.config.js +25 -25
  317. package/webpack.test.config.js +44 -44
  318. package/.travis.yml +0 -53
  319. package/dist/tablefilter/tf-1-2aa33b10e0e549020c12.js +0 -1
package/README.md CHANGED
@@ -1,174 +1,166 @@
1
- [![Build Status](https://api.travis-ci.org/koalyptus/TableFilter.svg?branch=master)](https://travis-ci.org/koalyptus/TableFilter)
2
- [![Document](https://www.tablefilter.com/docs/badge.svg)](https://www.tablefilter.com/docs/source.html)
3
- [![codecov](https://codecov.io/gh/koalyptus/TableFilter/branch/master/graph/badge.svg)](https://codecov.io/gh/koalyptus/TableFilter)
4
- [![Greenkeeper badge](https://badges.greenkeeper.io/koalyptus/TableFilter.svg)](https://greenkeeper.io/)
5
- [![Donate](https://img.shields.io/badge/donate-%24-green.svg)](https://www.tablefilter.com/donate.html)
6
-
7
- # TableFilter
8
-
9
- > A Javascript library making HTML tables filterable
10
-
11
- TableFilter is a modernised version of the [HTML Table Filter generator](http://tablefilter.free.fr) javascript plugin.
12
- This library adds to any html table a "filter by column" feature that enables
13
- 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.
14
-
15
- ## Features
16
- * Convert a regular HTML table into an advanced grid component providing:
17
- * Advanced columns filtering model
18
- * Sorting and pagination capabilities
19
- * Complete selection model ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
20
- * Extended keyboard navigation ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
21
- * Inline cell or row editing ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
22
- * Row insertion or deleting ([ezEditTable](http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus) extension)
23
- * And even more features...
24
- * Attach to an existing HTML table
25
- * Integration with any server-side technology as this is a pure client-side
26
- solution
27
- * Exhaustive documentation and powerful API
28
-
29
- ## Getting started
30
- * Clone the repo using Git:
31
- ```shell
32
- git clone https://github.com/koalyptus/TableFilter.git
33
- ```
34
-
35
- * You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository.
36
-
37
- * TableFilter is available on [npm repository](https://www.npmjs.com/package/tablefilter), you can install it from the command line using the following command:
38
- ```shell
39
- npm install tablefilter --save-dev
40
- ```
41
- * or get the future features from the ``next`` release channel:
42
- ```shell
43
- npm install tablefilter@next --save-dev
44
- ```
45
- * Alternatively you can also [access these files from unpkg CDN](https://unpkg.com/tablefilter/), download them or point your package manager to them.
46
-
47
- ## Setup
48
- ### Using modules
49
- Require `TableFilter`:
50
- ```javascript
51
- // ES2015 modules
52
- import TableFilter from 'tablefilter';
53
-
54
- // CommonJS or AMD modules
55
- var TableFilter = require('tablefilter');
56
- ```
57
-
58
- ### Using distribution scripts
59
- If you are not using a module system, you can reference the distribution scripts directly in your html pages:
60
- ```html
61
- <script src="path_to/node_modules/tablefilter/dist/tablefilter/tablefilter.js"></script>
62
- ```
63
-
64
- ### Placing manually the distribution scripts in your project
65
- Copy the ``tablefilter`` directory under ``dist`` and place it at desired location in your project. Then include the main js file in your page:
66
- ```shell
67
- <script src="path/to/my/scripts/tablefilter/tablefilter.js"></script>
68
- ```
69
-
70
- ### Usage
71
- 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
72
- ```shell
73
- <script>
74
- var tf = new TableFilter(document.querySelector('.my-table'), {
75
- base_path: 'path/to/my/scripts/tablefilter/'
76
- });
77
- tf.init();
78
- </script>
79
- ```
80
- If the ``base_path`` property is not specified, it will default to ``/tablefilter`` directory:
81
- ```shell
82
- your-page.html
83
- |— tablefilter
84
- ```
85
-
86
- ## Development
87
- This project requires node.js and Grunt to be installed:
88
- - install [node.js](https://nodejs.org/) v8.9.4 or higher
89
- - install [Grunt](http://gruntjs.com/getting-started) from the command line using npm (comes with node.js):
90
- ```shell
91
- npm install -g grunt-cli
92
- ```
93
- Once ``Grunt`` is sorted out you can follow the instructions below.
94
- Start by installing any dependencies.
95
-
96
- ```shell
97
- npm install
98
- ```
99
- Use
100
- ```shell
101
- npm run dev
102
- ```
103
- command to launch a build / watch cycle and start the local
104
- sever on port ``8080``.
105
-
106
- Use
107
- ```shell
108
- npm run build
109
- ```
110
- command to generate a production build.
111
-
112
- The
113
- ```shell
114
- npm run dist
115
- ```
116
- command will create a production build, run the tests and finally generate
117
- the demos:
118
-
119
- To run all the tests and generate the coverage report:
120
-
121
- ```shell
122
- npm test
123
- ```
124
-
125
- or to run specific test(s):
126
-
127
- ```shell
128
- grunt test-only:test.html
129
- grunt test-only:test.html,test-sort.html
130
- ```
131
-
132
- to view the coverage report(s), open the `index.html` under the
133
- `report/coverage` folder or
134
- [online](https://codecov.io/gh/koalyptus/TableFilter).
135
-
136
- ## Demos
137
- Check out the online [examples](http://www.tablefilter.com/examples.html)
138
- or generate the demos locally:
139
- ```shell
140
- npm run build:demos
141
- ```
142
- then run the local webserver:
143
- ```shell
144
- npm start
145
- ```
146
- then pick a demo from:
147
- ```shell
148
- http://localhost:8080/demos/
149
- ```
150
-
151
- ## Documentation
152
- Find exhaustive documentation on the configuration options in the [WIKI](https://github.com/koalyptus/TableFilter/wiki) section.
153
-
154
- Autogenerated documentation of the ES6 modules is available on the website: [docs](http://www.tablefilter.com/docs)
155
-
156
- If you previously used the HTML Table Filter Generator plugin, verify the configuration
157
- options you are using are still supported: [Obsolete](https://github.com/koalyptus/TableFilter/wiki/Obsolete)
158
-
159
- Run this task to generate the documentation in the ``docs/docs`` directory:
160
- ```shell
161
- npm run esdoc
162
- ```
163
-
164
- ## Support
165
- * 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).
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` &rarr; `v0.9.0` &rarr; `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&#9660;'`), `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&#9660;'`; 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.