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.
Files changed (322) hide show
  1. package/dist/starter.html +2 -2
  2. package/dist/tablefilter/tablefilter.js +1 -1
  3. package/dist/tablefilter/tf-1-2aa33b10e0e549020c12.js +1 -0
  4. package/dist/tablefilter/tf-1-bc5a8b07e0d66035b05b.js +1 -0
  5. package/dist/tablefilter/{tf-2-3a936d22b849361acff5.js → tf-2-025e1e774794d5827df8.js} +2 -2
  6. package/dist/tablefilter.cjs.js +17614 -4
  7. package/dist/tablefilter.esm.js +15736 -5397
  8. package/dist/tablefilter.umd.js +17620 -4
  9. package/index.js +16 -1
  10. package/package.json +10 -1
  11. package/src/components/attributes.js +59 -0
  12. package/src/components/table-filter.js +193 -45
  13. package/src/components/tf-rows-counter.js +3 -6
  14. package/src/components/tf-status.js +6 -11
  15. package/src/extensions/sort/sort.js +8 -1
  16. package/src/tablefilter.js +39 -6
  17. package/.editorconfig +0 -15
  18. package/.esdoc.json +0 -14
  19. package/.eslintrc +0 -37
  20. package/.gitattributes +0 -16
  21. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  22. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -36
  23. package/.github/ISSUE_TEMPLATE/support.md +0 -17
  24. package/.github/dependabot.yml +0 -10
  25. package/.github/workflows/build-deploy.yml +0 -141
  26. package/.github/workflows/opencode-review.yml +0 -104
  27. package/.github/workflows/opencode.yml +0 -34
  28. package/AGENTS.md +0 -36
  29. package/CONTRIBUTING.md +0 -128
  30. package/Gruntfile.js +0 -252
  31. package/PULL_REQUEST_TEMPLATE.md +0 -24
  32. package/ROADMAP/README.md +0 -34
  33. package/ROADMAP/content-projection-parity.md +0 -162
  34. package/ROADMAP/hybrid-migration-strategy.md +0 -275
  35. package/ROADMAP/key-decisions-review.md +0 -215
  36. package/ROADMAP/preliminary-and-milestone-0.8.0-plan.md +0 -307
  37. package/ROADMAP/v1-webcomponents-investigation.md +0 -521
  38. package/dist/tablefilter/tablefilter.vite.js +0 -4
  39. package/dist/tablefilter/tf-1-a5c3a73bd559e47dd5a2.js +0 -1
  40. package/playwright.config.js +0 -25
  41. package/scripts/check-css-tokens.js +0 -65
  42. package/static/demos-assets/img_best-price.png +0 -0
  43. package/static/demos-assets/img_great-deal.png +0 -0
  44. package/static/demos-assets/img_maintenance.jpg +0 -0
  45. package/static/demos-assets/img_new-edition.png +0 -0
  46. package/static/demos-assets/img_sold-out.png +0 -0
  47. package/static/partials/books-table-with-images.html +0 -328
  48. package/static/partials/books.html +0 -273
  49. package/static/partials/countries-by-continent.html +0 -2592
  50. package/static/partials/countries-table-tiny.html +0 -436
  51. package/static/partials/countries-table.html +0 -12954
  52. package/static/partials/dummy-table-with-totals-footer.html +0 -353
  53. package/static/partials/dummy-table.html +0 -503
  54. package/static/partials/pre-inline-script.html +0 -17
  55. package/static/partials/pre.html +0 -1
  56. package/static/partials/style.html +0 -23
  57. package/static/partials/table-with-grouped-headers.html +0 -9258
  58. package/static/partials/tablefilter-script.html +0 -1
  59. package/static/style/active-header.styl +0 -10
  60. package/static/style/alternating-rows.styl +0 -8
  61. package/static/style/config.styl +0 -44
  62. package/static/style/custom-properties.styl +0 -43
  63. package/static/style/extensions/colsVisibility.styl +0 -71
  64. package/static/style/extensions/filtersVisibility.styl +0 -18
  65. package/static/style/ezedittable.styl +0 -93
  66. package/static/style/filter-checklist.styl +0 -52
  67. package/static/style/filters.styl +0 -111
  68. package/static/style/grid-layout.styl +0 -130
  69. package/static/style/help.styl +0 -57
  70. package/static/style/keyword.styl +0 -8
  71. package/static/style/loader.styl +0 -16
  72. package/static/style/mixins/arrow.styl +0 -63
  73. package/static/style/mixins/box-shadow.styl +0 -8
  74. package/static/style/mixins/empty-content.styl +0 -7
  75. package/static/style/noresults.styl +0 -14
  76. package/static/style/paging.styl +0 -73
  77. package/static/style/reset-button.styl +0 -21
  78. package/static/style/rows-counter.styl +0 -17
  79. package/static/style/sort.styl +0 -20
  80. package/static/style/status-bar.styl +0 -13
  81. package/static/style/table.styl +0 -44
  82. package/static/style/tablefilter.styl +0 -19
  83. package/static/style/themes/blank.png +0 -0
  84. package/static/style/themes/btn_clear_filters.png +0 -0
  85. package/static/style/themes/btn_filter.png +0 -0
  86. package/static/style/themes/btn_first_page.gif +0 -0
  87. package/static/style/themes/btn_last_page.gif +0 -0
  88. package/static/style/themes/btn_next_page.gif +0 -0
  89. package/static/style/themes/btn_previous_page.gif +0 -0
  90. package/static/style/themes/default/default.styl +0 -137
  91. package/static/style/themes/default/images/bg_infDiv.jpg +0 -0
  92. package/static/style/themes/default/images/bg_th.jpg +0 -0
  93. package/static/style/themes/default/images/btn_eraser.gif +0 -0
  94. package/static/style/themes/default/images/btn_first_page.gif +0 -0
  95. package/static/style/themes/default/images/btn_last_page.gif +0 -0
  96. package/static/style/themes/default/images/btn_next_page.gif +0 -0
  97. package/static/style/themes/default/images/btn_over_eraser.gif +0 -0
  98. package/static/style/themes/default/images/btn_over_first_page.gif +0 -0
  99. package/static/style/themes/default/images/btn_over_last_page.gif +0 -0
  100. package/static/style/themes/default/images/btn_over_next_page.gif +0 -0
  101. package/static/style/themes/default/images/btn_over_previous_page.gif +0 -0
  102. package/static/style/themes/default/images/btn_previous_page.gif +0 -0
  103. package/static/style/themes/default/images/img_loading.gif +0 -0
  104. package/static/style/themes/downsimple.png +0 -0
  105. package/static/style/themes/icn_clp.png +0 -0
  106. package/static/style/themes/icn_exp.png +0 -0
  107. package/static/style/themes/icn_filter.gif +0 -0
  108. package/static/style/themes/icn_filterActive.gif +0 -0
  109. package/static/style/themes/mytheme/images/bg_headers.jpg +0 -0
  110. package/static/style/themes/mytheme/images/bg_infDiv.jpg +0 -0
  111. package/static/style/themes/mytheme/images/btn_filter.png +0 -0
  112. package/static/style/themes/mytheme/images/btn_first_page.gif +0 -0
  113. package/static/style/themes/mytheme/images/btn_last_page.gif +0 -0
  114. package/static/style/themes/mytheme/images/btn_next_page.gif +0 -0
  115. package/static/style/themes/mytheme/images/btn_previous_page.gif +0 -0
  116. package/static/style/themes/mytheme/images/img_loading.gif +0 -0
  117. package/static/style/themes/mytheme/mytheme.styl +0 -152
  118. package/static/style/themes/skyblue/images/bg_skyblue.gif +0 -0
  119. package/static/style/themes/skyblue/images/btn_first_page.gif +0 -0
  120. package/static/style/themes/skyblue/images/btn_last_page.gif +0 -0
  121. package/static/style/themes/skyblue/images/btn_next_page.gif +0 -0
  122. package/static/style/themes/skyblue/images/btn_prev_page.gif +0 -0
  123. package/static/style/themes/skyblue/images/icn_clear_filters.png +0 -0
  124. package/static/style/themes/skyblue/images/img_loading.gif +0 -0
  125. package/static/style/themes/skyblue/skyblue.styl +0 -195
  126. package/static/style/themes/transparent/images/btn_first_page.gif +0 -0
  127. package/static/style/themes/transparent/images/btn_last_page.gif +0 -0
  128. package/static/style/themes/transparent/images/btn_next_page.gif +0 -0
  129. package/static/style/themes/transparent/images/btn_prev_page.gif +0 -0
  130. package/static/style/themes/transparent/images/icn_clear_filters.png +0 -0
  131. package/static/style/themes/transparent/images/img_loading.gif +0 -0
  132. package/static/style/themes/transparent/transparent.styl +0 -205
  133. package/static/style/themes/upsimple.png +0 -0
  134. package/static/style/toolbar.styl +0 -58
  135. package/static/templates/advanced-grid-editable.html +0 -140
  136. package/static/templates/advanced-grid-selection.html +0 -93
  137. package/static/templates/auto-filter.html +0 -46
  138. package/static/templates/columns-visibility.html +0 -67
  139. package/static/templates/data-types.html +0 -123
  140. package/static/templates/demo.html +0 -62
  141. package/static/templates/external-filters-visibility-commad.html +0 -49
  142. package/static/templates/external-filters.html +0 -125
  143. package/static/templates/filter-images.html +0 -91
  144. package/static/templates/filters-visibility.html +0 -45
  145. package/static/templates/grid-layout.html +0 -51
  146. package/static/templates/grouped-headers.html +0 -78
  147. package/static/templates/linked-filters-disabled.html +0 -56
  148. package/static/templates/linked-filters.html +0 -45
  149. package/static/templates/load-filters-on-demand.html +0 -42
  150. package/static/templates/pagination.html +0 -78
  151. package/static/templates/requirejs.html +0 -53
  152. package/static/templates/starter.html +0 -61
  153. package/static/templates/table-filter.html +0 -40
  154. package/static/templates/theme-roller.html +0 -106
  155. package/test/libs/polyfill.js +0 -359
  156. package/test/libs/qunit/qunit.css +0 -237
  157. package/test/libs/qunit/qunit.js +0 -2495
  158. package/test/playwright/axe.baseline.spec.js +0 -34
  159. package/test/playwright/axe.statusbar.spec.js +0 -35
  160. package/test/playwright/axeScan.js +0 -42
  161. package/test/playwright/ce-bridge.spec.js +0 -167
  162. package/test/playwright/qunit.all.spec.js +0 -10
  163. package/test/playwright/qunit.single.spec.js +0 -14
  164. package/test/playwright/qunitSuite.js +0 -56
  165. package/test/playwright/table-filter.config.spec.js +0 -265
  166. package/test/playwright/table-filter.demo.spec.js +0 -60
  167. package/test/playwright/table-filter.element.spec.js +0 -477
  168. package/test/playwright/tf-clear-button.spec.js +0 -135
  169. package/test/playwright/tf-rows-counter.spec.js +0 -172
  170. package/test/playwright/tf-status.spec.js +0 -258
  171. package/test/test-active-columns.html +0 -80
  172. package/test/test-active-columns.js +0 -318
  173. package/test/test-alternate-rows.html +0 -80
  174. package/test/test-alternate-rows.js +0 -335
  175. package/test/test-api.html +0 -141
  176. package/test/test-api.js +0 -795
  177. package/test/test-auto-filter.html +0 -80
  178. package/test/test-auto-filter.js +0 -43
  179. package/test/test-callbacks.html +0 -78
  180. package/test/test-callbacks.js +0 -58
  181. package/test/test-case-sensitive-query.html +0 -78
  182. package/test/test-case-sensitive-query.js +0 -39
  183. package/test/test-cell-parser.html +0 -109
  184. package/test/test-cell-parser.js +0 -80
  185. package/test/test-checklist.html +0 -78
  186. package/test/test-checklist.js +0 -267
  187. package/test/test-clear-button.html +0 -79
  188. package/test/test-clear-button.js +0 -183
  189. package/test/test-col-ops-grid-layout.html +0 -129
  190. package/test/test-col-ops-grid-layout.js +0 -134
  191. package/test/test-col-ops-paging.html +0 -129
  192. package/test/test-col-ops-paging.js +0 -154
  193. package/test/test-col-ops.html +0 -129
  194. package/test/test-col-ops.js +0 -337
  195. package/test/test-col-widths.html +0 -80
  196. package/test/test-col-widths.js +0 -40
  197. package/test/test-cols-visibility-grid-layout.html +0 -80
  198. package/test/test-cols-visibility-grid-layout.js +0 -165
  199. package/test/test-cols-visibility.html +0 -80
  200. package/test/test-cols-visibility.js +0 -121
  201. package/test/test-custom-options.html +0 -80
  202. package/test/test-custom-options.js +0 -139
  203. package/test/test-data-types.html +0 -377
  204. package/test/test-data-types.js +0 -392
  205. package/test/test-date-type.html +0 -356
  206. package/test/test-date-type.js +0 -159
  207. package/test/test-disable-enter-key.html +0 -78
  208. package/test/test-disable-enter-key.js +0 -29
  209. package/test/test-disable-filter-onchange.html +0 -78
  210. package/test/test-disable-filter-onchange.js +0 -40
  211. package/test/test-dom-changes.html +0 -78
  212. package/test/test-dom-changes.js +0 -166
  213. package/test/test-dropdown.html +0 -78
  214. package/test/test-dropdown.js +0 -246
  215. package/test/test-emitter.html +0 -78
  216. package/test/test-emitter.js +0 -57
  217. package/test/test-empty-cells-filtering.html +0 -8696
  218. package/test/test-empty-cells-filtering.js +0 -45
  219. package/test/test-exact-query-match.html +0 -78
  220. package/test/test-exact-query-match.js +0 -56
  221. package/test/test-excluded-rows.html +0 -92
  222. package/test/test-excluded-rows.js +0 -129
  223. package/test/test-external-filters.html +0 -100
  224. package/test/test-external-filters.js +0 -219
  225. package/test/test-filter-html-elements.html +0 -88
  226. package/test/test-filter-html-elements.js +0 -63
  227. package/test/test-filter-operators.html +0 -80
  228. package/test/test-filter-operators.js +0 -264
  229. package/test/test-filtering.html +0 -53
  230. package/test/test-filtering.js +0 -293
  231. package/test/test-filters-visibility-grid-layout.html +0 -80
  232. package/test/test-filters-visibility-grid-layout.js +0 -50
  233. package/test/test-filters-visibility-with-button.html +0 -80
  234. package/test/test-filters-visibility-with-button.js +0 -48
  235. package/test/test-filters-visibility.html +0 -80
  236. package/test/test-filters-visibility.js +0 -48
  237. package/test/test-grid-layout.html +0 -7736
  238. package/test/test-grid-layout.js +0 -39
  239. package/test/test-grouped-headers.html +0 -154
  240. package/test/test-grouped-headers.js +0 -107
  241. package/test/test-hash.html +0 -78
  242. package/test/test-hash.js +0 -88
  243. package/test/test-help-responsive.html +0 -79
  244. package/test/test-help-responsive.js +0 -70
  245. package/test/test-help.html +0 -78
  246. package/test/test-help.js +0 -217
  247. package/test/test-highlight-keywords.html +0 -78
  248. package/test/test-highlight-keywords.js +0 -94
  249. package/test/test-ignore-diacritics.html +0 -67
  250. package/test/test-ignore-diacritics.js +0 -117
  251. package/test/test-integration-paging-sort.html +0 -80
  252. package/test/test-integration-paging-sort.js +0 -60
  253. package/test/test-linked-filters-disabled-options-grid-layout.html +0 -80
  254. package/test/test-linked-filters-disabled-options-grid-layout.js +0 -73
  255. package/test/test-linked-filters-grid-layout.html +0 -80
  256. package/test/test-linked-filters-grid-layout.js +0 -72
  257. package/test/test-linked-filters-load-filters-on-demand.html +0 -80
  258. package/test/test-linked-filters-load-filters-on-demand.js +0 -99
  259. package/test/test-linked-filters-paging.html +0 -80
  260. package/test/test-linked-filters-paging.js +0 -99
  261. package/test/test-linked-filters.html +0 -80
  262. package/test/test-linked-filters.js +0 -138
  263. package/test/test-load-filters-on-demand.html +0 -78
  264. package/test/test-load-filters-on-demand.js +0 -124
  265. package/test/test-loader.html +0 -79
  266. package/test/test-loader.js +0 -159
  267. package/test/test-no-config.html +0 -80
  268. package/test/test-no-config.js +0 -63
  269. package/test/test-no-filters.html +0 -80
  270. package/test/test-no-filters.js +0 -172
  271. package/test/test-no-headers.html +0 -71
  272. package/test/test-no-headers.js +0 -99
  273. package/test/test-no-results-message.html +0 -262
  274. package/test/test-no-results-message.js +0 -222
  275. package/test/test-no-rows.html +0 -19
  276. package/test/test-no-rows.js +0 -10
  277. package/test/test-one-row.html +0 -29
  278. package/test/test-one-row.js +0 -18
  279. package/test/test-paging.html +0 -78
  280. package/test/test-paging.js +0 -273
  281. package/test/test-popup-filter-one-row.html +0 -38
  282. package/test/test-popup-filter-one-row.js +0 -138
  283. package/test/test-popup-filter.html +0 -78
  284. package/test/test-popup-filter.js +0 -384
  285. package/test/test-popup-filters-grouped-headers.html +0 -104
  286. package/test/test-popup-filters-grouped-headers.js +0 -206
  287. package/test/test-rows-counter.html +0 -78
  288. package/test/test-rows-counter.js +0 -114
  289. package/test/test-single-filter.html +0 -79
  290. package/test/test-single-filter.js +0 -138
  291. package/test/test-sort-custom-sorter.html +0 -244
  292. package/test/test-sort-custom-sorter.js +0 -74
  293. package/test/test-sort-grid-layout.html +0 -143
  294. package/test/test-sort-grid-layout.js +0 -86
  295. package/test/test-sort-key.html +0 -244
  296. package/test/test-sort-key.js +0 -67
  297. package/test/test-sort.html +0 -143
  298. package/test/test-sort.js +0 -126
  299. package/test/test-state.html +0 -78
  300. package/test/test-state.js +0 -369
  301. package/test/test-status-bar.html +0 -79
  302. package/test/test-status-bar.js +0 -149
  303. package/test/test-storage-cookie.html +0 -78
  304. package/test/test-storage-cookie.js +0 -82
  305. package/test/test-storage-local.html +0 -78
  306. package/test/test-storage-local.js +0 -82
  307. package/test/test-tfoot.html +0 -96
  308. package/test/test-tfoot.js +0 -123
  309. package/test/test-thead.html +0 -80
  310. package/test/test-thead.js +0 -69
  311. package/test/test-toolbar.html +0 -81
  312. package/test/test-toolbar.js +0 -218
  313. package/test/test-uneven-rows.html +0 -95
  314. package/test/test-uneven-rows.js +0 -61
  315. package/test/test-watermark.html +0 -80
  316. package/test/test-watermark.js +0 -103
  317. package/test/test.html +0 -141
  318. package/test/test.js +0 -162
  319. package/vite.config.js +0 -71
  320. package/webpack.config.js +0 -99
  321. package/webpack.dev.config.js +0 -25
  322. package/webpack.test.config.js +0 -44
@@ -1,521 +0,0 @@
1
- # TableFilter v1.0.0 Architecture & Migration Investigation
2
- ## Transition to Native Web Components, Universal Accessibility (WCAG 2.2), and Complete Contract Compatibility
3
-
4
- ---
5
-
6
- ## Executive Summary
7
-
8
- **TableFilter** (currently at `v0.7.3`) is a mature, battle-tested JavaScript library that transforms standard HTML tables into rich, interactive data tables with column filtering, sorting, pagination, and calculations. It is backed by extensive documentation (Wiki, ESDoc, demos) and a 74-file test suite comprising 739 test cases that define an exacting operational contract.
9
-
10
- Transitioning TableFilter to **Version 1.0.0** represents a milestone evolution:
11
- 1. **Native Web Components**: Adopting W3C Standard Custom Elements (`<table-filter>`) with Shadow DOM encapsulation and slot projection, eliminating framework lock-in and script tag fragility.
12
- 2. **Universal Accessibility (WCAG 2.2 AA/AAA & WAI-ARIA APG)**: Resolving critical accessibility shortcomings in legacy versions (unlabeled inputs, inaccessible sort triggers, custom checklists without ARIA widget semantics, silent state transitions) to make every filter, modal, and data view completely operable by screen readers and keyboard users.
13
- 3. **100% Contract Preservation**: Fulfilling the entire configuration schema, imperative API (`new TableFilter(...)`), event emitter lifecycle, and extension ecosystem documented across the project specifications.
14
-
15
- ---
16
-
17
- ## 1. Contract Analysis: The Baseline Specification
18
-
19
- The TableFilter specification consists of three core layers documented in the wiki, codebase, and tests:
20
-
21
- ```
22
- +-----------------------------------------------------------------------+
23
- | CONSUMER INTERFACE |
24
- | Declarative: <table-filter> | Imperative: new TableFilter(...) |
25
- +-----------------------------------+-----------------------------------+
26
- | PUBLIC API |
27
- | Methods (init, filter, clear) | Events (before-filtering, etc.) |
28
- +-----------------------------------+-----------------------------------+
29
- | CONFIGURATION CONTRACT |
30
- | Main Options (col_types, etc.) | Feature Blocks (paging, etc.) |
31
- +-----------------------------------+-----------------------------------+
32
- | EXTENSIONS ECOSYSTEM |
33
- | sort | colsVisibility | filtersVisibility | colOps | advGrid |
34
- +-----------------------------------------------------------------------+
35
- | DATA & FILTERING ENGINE |
36
- | Operators (<, >, =, rgx:) | Type Formats (date, num, regex) |
37
- +-----------------------------------------------------------------------+
38
- ```
39
-
40
- ### 1.1 Constructor & Instantiation Contract
41
- - **Signatures**:
42
- - `new TableFilter(tableElement: HTMLTableElement, [refRow: number], [config: object])`
43
- - `new TableFilter(tableId: string, [refRow: number], [config: object])`
44
- - **Behavior**:
45
- - Validates table presence; extracts or generates instance ID (`tf.id`).
46
- - Sets up `refRow` (default index `0` or `1` depending on headers and filters row placement).
47
- - Normalizes legacy/shorthand configurations into normalized internal structures.
48
- - Registers modules/features in the feature registry.
49
- - Registers extensions in the extension registry.
50
-
51
- ### 1.2 Configuration Schema Contract
52
- The library contract defines over 100 configuration properties across 20 distinct modules:
53
-
54
- | Functional Area | Primary Configuration Properties | Expected Behavior |
55
- | :--- | :--- | :--- |
56
- | **Grid & Filters Row** | `grid`, `filters_row_index`, `col_{n}`, `col_types`, `auto_filter`, `enter_key` | Controls filter type per column (`input`, `select`, `multiple`, `checklist`, `none`), row index (0=above headers, 1=below), debounce delay. |
57
- | **Data Matching** | `exact_match`, `columns_exact_match`, `case_sensitive`, `ignore_diacritics`, `empty_operator`, `nonempty_operator` | Controls string normalization, regex parsing, empty/non-empty matching tokens. |
58
- | **Data Types & Locales** | `col_types`, `locale`, `thousands_separator`, `decimal_separator` | Formatted numbers (`1.234,56` vs `1,234.56`), ISO & localized dates (`{dd}.{MM}.{yyyy}`). |
59
- | **Dropdown & Checklist** | `enable_slc_reset_filter`, `load_filters_on_demand`, `sort_filter_options_asc`, `custom_options` | Populates unique values from column cells; handles linked/cascading filter state. |
60
- | **Pagination** | `paging`, `paging_length`, `results_per_page`, `page_selector_type`, `has_nb_pages` | Chunks visible rows into pages, renders navigation buttons and jump selectors. |
61
- | **Toolbar & Containers** | `toolbar`, `rows_counter`, `status_bar`, `btn_reset`, `loader`, `help_instructions` | Creates multi-zone toolbar (`left`, `center`, `right`) with live counters, reset button, and status text. |
62
- | **State Persistence** | `state.types` (`'local_storage'`, `'cookie'`, `'hash'`), `state.filters`, `state.page_nb` | Serializes and restores filter strings, page indices, and column visibility. |
63
- | **Extensions** | `extensions: [{ name: 'sort' }, { name: 'colsVisibility' }, ...]` | Asynchronously loads/initializes extension packages. |
64
-
65
- ### 1.3 Public API & Event Emitter Contract
66
- - **Essential Methods**:
67
- - Filtering: `filter()`, `clearFilters()`, `setFilterValue(colIndex, value)`, `getFilterValue(colIndex)`, `getFiltersValue()`.
68
- - Introspection: `getFilteredData()`, `getTableData()`, `getValidRows()`, `getValidRowsNb()`, `getFilterableRowsNb()`, `getCellValue(cell)`, `getCellData(cell)`.
69
- - DOM References: `dom()`, `getFilterElement(colIndex)`, `getHeaderElement(colIndex)`, `getFiltersRowIndex()`, `getHeadersRowIndex()`.
70
- - Lifecycle: `init()`, `destroy()`, `isInitialized()`, `feature(name)`, `extension(name)`, `registerExtension(inst, name)`.
71
- - **Event Lifecycle**:
72
- - Sequential event bus firing:
73
- `before-filter-init` &rarr; `filters-row-inserted` &rarr; `after-filter-init` &rarr; `initialized` &rarr; `before-filtering` &rarr; `cell-processed` &rarr; `row-processed` &rarr; `row-validated` &rarr; `after-filtering` &rarr; `before-clearing-filters` &rarr; `after-clearing-filters` &rarr; `destroy`.
74
-
75
- ### 1.4 Operator & Query Parsing Contract
76
- - Standard comparison operators: `<`, `<=`, `=`, `>=`, `>`.
77
- - Logical & matching operators: `*` (contains/wildcard), `!` (negation), `{` (starts with), `}` (ends with), `||` (OR), `&&` (AND), `rgx:` (regular expression).
78
- - Null state operators: `[empty]`, `[nonempty]`.
79
-
80
- ---
81
-
82
- ## 2. Native Web Components Architecture for v1.0.0
83
-
84
- ### 2.1 Autonomous Custom Elements vs. Customized Built-in Elements
85
- In the HTML Web Components specification, two approaches exist:
86
- 1. **Customized built-in element**: `<table is="table-filter">`.
87
- - *Limitation*: Apple/WebKit has refused to implement customized built-in elements (`is=""`) in Safari. Polyfills are brittle and do not conform to native standards.
88
- 2. **Autonomous custom element**: `<table-filter>`.
89
- - *Advantage*: Supported universally across all modern browsers (Chrome, Edge, Firefox, Safari, iOS, Android).
90
- - *Structure*: Wraps or references the native `<table>` element using slots.
91
-
92
- ```html
93
- <!-- Declarative Pattern 1: Table Slotted Inside Custom Element (Recommended) -->
94
- <table-filter paging auto-filter theme="default">
95
- <table id="my-table">
96
- <thead>
97
- <tr><th>From</th><th>Destination</th><th>Distance</th></tr>
98
- </thead>
99
- <tbody>
100
- <tr><td>Sydney</td><td>Melbourne</td><td>877</td></tr>
101
- </tbody>
102
- </table>
103
- </table-filter>
104
-
105
- <!-- Declarative Pattern 2: External Reference via 'for' Attribute -->
106
- <table-filter for="my-table" paging></table-filter>
107
- <table id="my-table">...</table>
108
- ```
109
-
110
- ### 2.2 Shadow DOM vs. Light DOM: Accessibility & Semantics
111
- HTML `<table>` semantics are strictly parsed by browser layout and accessibility engines:
112
- - `<table>` elements **must not** contain custom elements as direct children between `<table>`, `<tbody>`, and `<tr>`.
113
- - Placing the table in the Light DOM (projected via `<slot>` into `<table-filter>`) ensures:
114
- 1. Accessibility tree integrity: Screen readers parse the native table header-to-cell relationships without shadow boundary clipping.
115
- 2. Consumer CSS styling: Global application stylesheets (Bootstrap, Tailwind, custom design systems) continue to style table rows and cells naturally.
116
- 3. Progressive enhancement: If JavaScript is disabled or fails to load, the raw HTML table remains fully rendered and legible.
117
-
118
- ```
119
- +-------------------------------------------------------------+
120
- | <table-filter> (Host Custom Element) |
121
- | |
122
- | [ Shadow DOM ] |
123
- | +---------------------------------------------------------+ |
124
- | | <tf-toolbar part="toolbar-top"> | |
125
- | | <slot name="top-toolbar"> | |
126
- | | <tf-status part="status" role="status"></tf-status> | |
127
- | | <tf-rows-counter part="counter"></tf-rows-counter> | |
128
- | | <tf-clear-button part="clear-btn"></tf-clear-button>| |
129
- | | </slot> | |
130
- | | </tf-toolbar> | |
131
- | +---------------------------------------------------------+ |
132
- | | <div class="table-container" part="table-container"> | |
133
- | | <slot></slot> <------------------------------------+ | |
134
- | | </div> | | |
135
- | +-------------------------------------------------------|-+ |
136
- | | <tf-toolbar part="toolbar-bottom"> | | |
137
- | | <slot name="bottom-toolbar"> | | |
138
- | | <tf-pager part="pager"></tf-pager> | | |
139
- | | </slot> | | |
140
- | | </tf-toolbar> | | |
141
- | +-------------------------------------------------------|-+ |
142
- | | |
143
- | [ Light DOM (Slotted Content) ] | |
144
- | +-------------------------------------------------------|-+ |
145
- | | <table id="my-table"> <-------------------------------+ | |
146
- | | <thead> | |
147
- | | <tr class="tf-headers-row">...</tr> | |
148
- | | <tr class="tf-filters-row"> | |
149
- | | <th><tf-filter-input col="0"></tf-filter-input></th>|
150
- | | <th><tf-checklist col="1"></tf-checklist></th> | |
151
- | | <th><tf-dropdown col="2"></tf-dropdown></th> | |
152
- | | </tr> | |
153
- | | </thead> | |
154
- | | <tbody>...</tbody> | |
155
- | | </table> | |
156
- | +---------------------------------------------------------+ |
157
- +-------------------------------------------------------------+
158
- ```
159
-
160
- ### 2.3 Modular Component Suite
161
- v1.0.0 decomposes the monolithic script into focused custom elements:
162
-
163
- 1. `<table-filter>`: Root orchestrator, state manager, and public API provider.
164
- 2. `<tf-toolbar>`: Multi-section flex container (`left`, `center`, `right`) managing UI controls.
165
- 3. `<tf-filter-input>`: Accessible search input with integrated debounce, clear button, and operator help popover.
166
- 4. `<tf-dropdown>`: Accessible native `<select>` wrapper with dynamic option collection.
167
- 5. `<tf-checklist>`: Accessible ARIA Combobox/Listbox multi-select popup with search, select-all, and keyboard navigation.
168
- 6. `<tf-pager>`: Accessible pagination component with WAI-ARIA buttons, page indicator, and results-per-page selector.
169
- 7. `<tf-status>`: Accessible live status announcements (`role="status"`, `aria-live="polite"`).
170
- 8. `<tf-rows-counter>`: Live region counter displaying total and filtered row counts.
171
- 9. `<tf-clear-button>`: Accessible reset button dispatching filter reset actions.
172
- 10. `<tf-dialog>`: Accessible modal/popover container for help instructions, column visibility manager, and popup filters.
173
-
174
- ### 2.4 Dual API Architecture (Declarative + Imperative Backward Compatibility)
175
- To guarantee 100% backward compatibility for existing codebases:
176
-
177
- ```javascript
178
- // Legacy Imperative Instantiation remains fully supported:
179
- const tf = new TableFilter(document.querySelector('#my-table'), {
180
- base_path: 'dist/tablefilter/',
181
- paging: true,
182
- col_types: ['string', 'number', 'date']
183
- });
184
- tf.init();
185
-
186
- // Under the hood:
187
- // 1. TableFilter class wraps or mounts the <table-filter> custom element.
188
- // 2. All legacy methods (filter, clearFilters, getFilteredData, etc.) proxy directly
189
- // to the underlying web component controller.
190
- // 3. Emitter events and DOM CustomEvents are synchronized bidirectionally.
191
- ```
192
-
193
- ---
194
-
195
- ## 3. Comprehensive Accessibility (A11y) Strategy
196
-
197
- ### 3.1 Standards & Conformance Targets
198
- - **Conformance Target**: WCAG 2.2 Level AA (Level AAA where feasible).
199
- - **ARIA Specifications**: WAI-ARIA 1.2 / 1.3 & WAI-ARIA Authoring Practices Guide (APG) Table and Data Grid patterns.
200
- - **Section 508 & EN 301 549**: Fully aligned.
201
-
202
- ### 3.2 Component-by-Component Accessibility Implementation
203
-
204
- #### 1. Sortable Column Headers
205
- *Legacy Problem*: `<th>` click listeners with cursor pointer; no keyboard access, no state announcement for screen readers.
206
- *v1.0.0 Implementation*:
207
- - Interactive trigger inside `<th>`:
208
- ```html
209
- <th scope="col" aria-sort="ascending">
210
- <button type="button" class="tf-sort-btn" id="sort-col-0">
211
- <span>Destination</span>
212
- <svg class="tf-sort-icon" aria-hidden="true" focusable="false">...</svg>
213
- </button>
214
- </th>
215
- ```
216
- - Attributes: `aria-sort="none"`, `aria-sort="ascending"`, or `aria-sort="descending"`.
217
- - Keyboard: `Enter` or `Space` toggles sort direction.
218
- - Screen Reader Output: *"Destination, sortable column, sorted ascending. Activate to sort descending."*
219
-
220
- #### 2. Filter Inputs
221
- *Legacy Problem*: Plain `<input type="text">` without label, `aria-label`, or relationship to column headers.
222
- *v1.0.0 Implementation*:
223
- ```html
224
- <th scope="col">
225
- <div class="tf-filter-wrap">
226
- <label for="flt-0-input" class="sr-only">Filter Destination</label>
227
- <input
228
- type="search"
229
- id="flt-0-input"
230
- class="tf-filter-input"
231
- aria-label="Filter Destination"
232
- aria-describedby="flt-0-desc"
233
- placeholder="Filter..."
234
- autocomplete="off"
235
- spellcheck="false"
236
- />
237
- <span id="flt-0-desc" class="sr-only">Supports operators like >, <, =, and wildcard *</span>
238
- <button type="button" class="tf-clear-filter-btn" aria-label="Clear Destination filter">
239
- <svg aria-hidden="true">...</svg>
240
- </button>
241
- </div>
242
- </th>
243
- ```
244
-
245
- #### 3. Checklist Multi-Select Filter
246
- *Legacy Problem*: Plain `<div>` with `<ul>`/`<li>` and checkboxes, unnavigable via arrow keys, not adhering to combobox pattern.
247
- *v1.0.0 Implementation (WAI-ARIA Combobox / Listbox Pattern)*:
248
- - Trigger Button:
249
- ```html
250
- <button
251
- type="button"
252
- id="btn-chk-1"
253
- class="tf-checklist-trigger"
254
- aria-haspopup="listbox"
255
- aria-expanded="false"
256
- aria-controls="listbox-chk-1"
257
- aria-label="Filter Category, 2 items selected"
258
- >
259
- <span>Category (2)</span>
260
- <svg aria-hidden="true">...</svg>
261
- </button>
262
- ```
263
- - Dropdown Popover:
264
- ```html
265
- <div
266
- id="listbox-chk-1"
267
- role="listbox"
268
- aria-multiselectable="true"
269
- aria-label="Filter Category options"
270
- tabindex="-1"
271
- >
272
- <div role="option" id="opt-1-0" aria-selected="false" tabindex="0">
273
- <input type="checkbox" id="chk-opt-1-0" aria-hidden="true" tabindex="-1" />
274
- <label for="chk-opt-1-0">All</label>
275
- </div>
276
- <div role="option" id="opt-1-1" aria-selected="true" tabindex="-1">
277
- <input type="checkbox" id="chk-opt-1-1" checked aria-hidden="true" tabindex="-1" />
278
- <label for="chk-opt-1-1">Electronics</label>
279
- </div>
280
- </div>
281
- ```
282
- - Keyboard Navigation:
283
- - `Down Arrow` / `Up Arrow`: Moves active descendant focus through options.
284
- - `Space`: Toggles `aria-selected` and checkbox state.
285
- - `Enter`: Closes dropdown and executes filter.
286
- - `Escape`: Cancels/closes dropdown and returns focus to trigger button.
287
- - `Home` / `End`: Moves focus to first/last option.
288
-
289
- #### 4. Pagination Controls
290
- *Legacy Problem*: `<span>` elements with click handlers or unlabeled buttons.
291
- *v1.0.0 Implementation*:
292
- ```html
293
- <nav class="tf-pagination" aria-label="Table Pagination">
294
- <button type="button" aria-label="First page" disabled>
295
- <svg aria-hidden="true">...</svg>
296
- </button>
297
- <button type="button" aria-label="Previous page" disabled>
298
- <svg aria-hidden="true">...</svg>
299
- </button>
300
-
301
- <span class="tf-pager-status" aria-current="page">
302
- Page <input type="number" min="1" max="10" value="1" aria-label="Current page" /> of 10
303
- </span>
304
-
305
- <button type="button" aria-label="Next page">
306
- <svg aria-hidden="true">...</svg>
307
- </button>
308
- <button type="button" aria-label="Last page">
309
- <svg aria-hidden="true">...</svg>
310
- </button>
311
-
312
- <label for="page-size-slc">Rows per page</label>
313
- <select id="page-size-slc" aria-label="Rows per page">
314
- <option value="10" selected>10</option>
315
- <option value="25">25</option>
316
- <option value="50">50</option>
317
- </select>
318
- </nav>
319
- ```
320
-
321
- #### 5. Live Regions & Dynamic Announcements (WCAG 4.1.3)
322
- *Legacy Problem*: Filtering and sorting execute silently without notifying assistive technologies.
323
- *v1.0.0 Implementation*:
324
- - Dedicated Live Announcer inside `<table-filter>` Shadow DOM:
325
- ```html
326
- <div class="sr-only" role="status" aria-live="polite" aria-atomic="true" id="live-announcer"></div>
327
- ```
328
- - Dynamic Announcements:
329
- - On Filter Completed: `"Filtering complete. 14 rows matching out of 150."`
330
- - On Zero Results: `"No matching rows found."`
331
- - On Clear Filters: `"All filters cleared. 150 rows displayed."`
332
- - On Sort: `"Table sorted by Destination ascending."`
333
- - On Page Change: `"Showing page 2 of 15 (rows 11 to 20)."`
334
-
335
- #### 6. High Contrast & Visual Accessibility
336
- - **Visible Focus Indicator (WCAG 2.4.11 / 2.4.13)**:
337
- `outline: 2px solid var(--tf-focus-ring, #0969da); outline-offset: 2px;` with minimum 3:1 contrast against adjacent colors.
338
- - **Forced Colors Mode (`@media (forced-colors: active)`)**:
339
- Replace raster image icons with inline SVGs utilizing `currentColor` and `CanvasText` system colors.
340
- - **Color Contrast (WCAG 1.4.3 / 1.4.11)**:
341
- - All text contrast &ge; 4.5:1.
342
- - Active filter indicators & borders &ge; 3:1.
343
- - Filter state never conveyed by color alone; active filters display an explicit icon and tooltip.
344
-
345
- ---
346
-
347
- ## 4. Technical Debt Liquidation & Modern Tooling
348
-
349
- To ensure a solid v1.0.0 release, the build system and dependencies require comprehensive modernization:
350
-
351
- | Area | Current Legacy State (`v0.7.3`) | Modernized Target State (`v1.0.0`) | Rationale |
352
- | :--- | :--- | :--- | :--- |
353
- | **Build Tooling** | Webpack 4 + Grunt + Babel 7.10 | Vite / Rollup + esbuild | Fast ESM builds, tree-shaking, standard module output (ESM, CJS, UMD). |
354
- | **Node.js Target** | Node 8 / 10 | Node 18 / 20 / 22 / 24+ LTS | Eliminates deprecated build dependencies and vulnerability alerts. |
355
- | **CSS Preprocessing**| Stylus (`.styl`) | CSS Custom Properties + PostCSS / Vanilla CSS | Native CSS features (nesting, variables, `:has()`, `:focus-visible`). |
356
- | **Language & Typings**| ES2015 with ESDoc comments | Modern Standard JS (ESM) with JSDoc | Stays pure JavaScript; no TypeScript migration overhead, zero compilation friction. |
357
- | **Icons & Media** | Raster GIF / PNG images (`btn_first_page.gif`, etc.) | Scalable Vector Graphics (SVG) + CSS | High-DPI crispness, theming via `currentColor`, WCAG contrast compliance. |
358
- | **Testing Engine** | Grunt QUnit + PhantomJS / connect | Vitest / Playwright + Web Test Runner | Real browser testing across Chromium, WebKit, and Firefox engines. |
359
- | **Automated A11y** | None | `@axe-core/playwright` / `axe-core` | Continuous integration checks against WCAG 2.2 rules on every commit. |
360
- | **Third-Party Helpers**| `sugar-date`, `diacritics`, `format-number` | Native `Intl`, `String.normalize('NFD')`, lightweight date parser | Reduces bundle size by ~45KB; leverages native browser platform APIs. |
361
-
362
- ---
363
-
364
- ## 5. Step-by-Step Implementation Roadmap to v1.0.0
365
-
366
- ```mermaid
367
- flowchart TD
368
- subgraph Phase1["Phase 1: Build & Testing Foundation"]
369
- P1_1["Setup Modern Monorepo / Tooling (Vite/Rollup)"] --> P1_2["Port QUnit 739 Test Suite to Vitest/Playwright"]
370
- P1_2 --> P1_3["Integrate Axe-Core Automated A11y Suite"]
371
- end
372
-
373
- subgraph Phase2["Phase 2: Decoupled Core Data Engine"]
374
- P2_1["Extract Headless Table Engine (Filtering, Sorting, Paging)"] --> P2_2["Modernize Types, Operators & Internationalization (Intl)"]
375
- P2_2 --> P2_3["Verify 100% Contract Equivalence against Existing Suite"]
376
- end
377
-
378
- subgraph Phase3["Phase 3: Web Components Suite Implementation"]
379
- P3_1["Develop Root Custom Element <table-filter>"] --> P3_2["Develop Slotted Sub-elements (Toolbar, Filter, Pager)"]
380
- P3_3["Implement Imperative Backward-Compatibility Bridge"] --> P3_2
381
- end
382
-
383
- subgraph Phase4["Phase 4: Complete Accessibility Overhaul"]
384
- P4_1["ARIA Patterns (Combobox, Dialog, Table Headers)"] --> P4_2["Live Regions & Polite Announcements Engine"]
385
- P4_2 --> P4_3["Keyboard Navigation, Focus Traps & Roving Tabindex"]
386
- end
387
-
388
- subgraph Phase5["Phase 5: Design System & Theming"]
389
- P5_1["Replace Stylus with CSS Custom Properties"] --> P5_2["Replace Raster Images with Themeable SVGs"]
390
- P5_2 --> P5_3["Support Dark Mode & Forced-Colors (High Contrast)"]
391
- end
392
-
393
- subgraph Phase6["Phase 6: Extensions Porting & Verification"]
394
- P6_1["Refactor Extensions (sort, colsVisibility, colOps, advGrid)"] --> P6_2["End-to-End Regression & A11y Verification"]
395
- P6_2 --> P6_3["Modernized Documentation & Migration Guides"]
396
- end
397
-
398
- Phase1 --> Phase2
399
- Phase2 --> Phase3
400
- Phase3 --> Phase4
401
- Phase4 --> Phase5
402
- Phase5 --> Phase6
403
- Phase6 --> Milestone1["TableFilter 1.0.0 Stable Release"]
404
- ```
405
-
406
- ### Phase 1: Tooling Modernization & Dual-Test Harness
407
- 1. **Initialize Modern Build System**:
408
- - Replace Grunt and Webpack 4 with Vite / Rollup.
409
- - Configure output targets:
410
- - `dist/tablefilter.esm.js` (Modern ESM with Web Components).
411
- - `dist/tablefilter.cjs.js` (CommonJS module).
412
- - `dist/tablefilter.js` (UMD / IIFE bundle for legacy `<script>` tag consumers).
413
- 2. **Harness Existing QUnit Test Suite**:
414
- - Run all 74 test files and 739 test assertions in a headless modern browser environment to create the regression baseline.
415
- - Setup `@axe-core/playwright` to test each fixture for WCAG 2.2 violations.
416
-
417
- ### Phase 2: Decoupled Headless Core Engine
418
- 1. **Separate Data Logic from DOM Manipulation**:
419
- - Abstract data filtering, query parsing (`<`, `>`, `||`, `&&`, regex), type conversions, and pagination into a pure, headless engine.
420
- - Eliminate obsolete polyfills (`supportsClassList`, IE8 checks).
421
- 2. **Modernize Platform Utilities**:
422
- - Replace external `diacritics` package with native `String.prototype.normalize('NFD').replace(/[\u0300-\u036f]/g, '')`.
423
- - Implement localized number parsing using native `Intl.NumberFormat`.
424
- - Maintain Sugar Date format compatibility for custom legacy date strings.
425
- 3. **Contract Regression Gate**:
426
- - Validate that 100% of headless engine tests pass identical assertions.
427
-
428
- ### Phase 3: Web Components Suite & Imperative Adapter
429
- 1. **Implement Root `<table-filter>`**:
430
- - Register custom element `customElements.define('table-filter', TableFilterElement)`.
431
- - Implement Shadow DOM with default slots:
432
- - `<slot name="top-toolbar"></slot>`
433
- - `<slot></slot>` (default slot for light DOM `<table>`)
434
- - `<slot name="bottom-toolbar"></slot>`
435
- - Attach `MutationObserver` on the slotted table to reactively observe row additions, deletions, or cell changes (`rows-changed`).
436
- 2. **Implement Sub-Components**:
437
- - Build `<tf-toolbar>`, `<tf-filter-input>`, `<tf-dropdown>`, `<tf-checklist>`, `<tf-pager>`, `<tf-status>`, `<tf-rows-counter>`, `<tf-clear-button>`, `<tf-dialog>`.
438
- 3. **Implement Imperative `TableFilter` Class Adapter**:
439
- - Preserve exact constructor signature: `new TableFilter(table, refRow, config)`.
440
- - Proxy calls (`tf.filter()`, `tf.clearFilters()`, etc.) directly to the Web Component controller.
441
- - Preserve `tf.emitter` with all existing event names while also emitting standard DOM `CustomEvent` instances.
442
-
443
- ### Phase 4: Universal Accessibility (WCAG 2.2 AA/AAA)
444
- 1. **ARIA Structure & Header Sorting**:
445
- - Wrap column headers in `<button type="button" class="tf-sort-btn">`.
446
- - Set `aria-sort="none|ascending|descending"` dynamically.
447
- 2. **Form Controls & Inputs**:
448
- - Ensure every `<input>` has an explicitly associated `<label>` (visually hidden via `.sr-only` where design requires) and `aria-label`.
449
- - Add clear buttons with accessible labels for every filter input.
450
- 3. **Combobox / Checklist Widget**:
451
- - Implement WAI-ARIA APG Combobox with Multi-Select Listbox.
452
- - Full keyboard navigation (Arrows, Space, Enter, Escape, Home, End).
453
- 4. **Live Announcer**:
454
- - Centralize live region announcements via `aria-live="polite"` for filter matches, clearing, page changes, and sorting actions.
455
- 5. **Dialog & Popovers**:
456
- - Implement `<dialog>` or `role="dialog"` for help popovers, column visibility dropdowns, and popup filters with focus trapping and `Esc` dismissal.
457
-
458
- ### Phase 5: Modern Theming & Design System
459
-
460
- > **Sequencing:** items 1–3 below (token API + docs, Stylus→CSS, SVG icons, dark mode / forced-colors) are **deferred to the "Styling modernization (post-1.0)" milestone** (after the v1.0.0 parity launch). Only item 4 — preserving the legacy styling configuration — stays on the parity path.
461
-
462
- 1. **CSS Custom Properties**:
463
- - Define token system:
464
- ```css
465
- :host, table-filter {
466
- --tf-primary: #0969da;
467
- --tf-primary-hover: #085fc4;
468
- --tf-bg: #ffffff;
469
- --tf-text: #24292f;
470
- --tf-border: #d0d7de;
471
- --tf-focus-ring: #0969da;
472
- --tf-row-alt: #f6f8fa;
473
- --tf-active-col: #ddf4ff;
474
- }
475
- ```
476
- 2. **CSS Shadow Parts**:
477
- - Expose `::part(toolbar)`, `::part(filter-input)`, `::part(pager)`, `::part(status)` for custom styling. The configurable legacy class (`status_bar.css_class` and friends) stays on the host, so `.status::part(message)` keeps consumer/theme styling working across the shadow boundary.
478
- 3. **Theme Ports**:
479
- - Port legacy themes (`default`, `mytheme`, `skyblue`, `transparent`) to clean CSS files setting the custom properties.
480
- - Replace raster `.gif`/`.png` icons with crisp, theme-aware inline SVGs.
481
- 4. **Preserve the legacy styling configuration (additive, not a rewrite)**:
482
- - Keep every configurable class name and the core stylesheet/theme **loader** (`base_path`, `style_path`, `stylesheet`, `themes`, `themes_path`, `enable_default_theme`) plus the core class options (`flts_row_css_class`, `flt_css_class`, `flt_multi_css_class`, `flt_small_css_class`, `single_filter.css_class`, `btn_css_class`). Tokens and `::part()` extend this surface; they do not replace it. Porting it into `<table-filter>` is tracked by **#993**.
483
-
484
- ### Phase 6: Extensions Porting & Backward Compatibility Verification
485
- 1. **Extension Modernization**:
486
- - `sort`: Seamlessly integrate with native `aria-sort` column headers.
487
- - `colsVisibility`: Accessible popover modal with checkboxes and `aria-controls`.
488
- - `filtersVisibility`: Accessible toggle button with `aria-expanded`.
489
- - `colOps`: Native calculation updates with `aria-live="polite"`.
490
- - `advancedGrid`: Accessible APG Data Grid mode (`role="grid"`).
491
- 2. **Automated Verification**:
492
- - Execute the complete 739 QUnit test suite against both the imperative API and declarative Web Components.
493
- - Execute Axe-core automated tests across all 50+ demo fixtures with zero accessibility violations.
494
- 3. **Documentation & Release Preparation**:
495
- - Update documentation site with Web Component examples and migration guide.
496
- - Maintain existing comprehensive JSDoc comments across all modules.
497
-
498
- ---
499
-
500
- ## 6. Migration Guide & Deprecation Strategy
501
-
502
- ### Non-Breaking Changes (Zero Code Changes Required)
503
- - Existing HTML with `<script src="tablefilter.js"></script>` and `new TableFilter('#myTable', config)` continues to function identically.
504
- - All configuration options (e.g. `col_types`, `paging`, `auto_filter`, `state`, etc.) are recognized and supported.
505
- - All public methods (`tf.filter()`, `tf.getFilteredData()`) return identical data structures.
506
-
507
- ### Backward Compatibility: `grid_layout` and `sticky_headers`
508
- - **Both `grid_layout` and `sticky_headers` are fully supported**: `grid_layout` is an established, widely used feature providing synchronized scrolling headers, fixed column widths, and scroll positions. For complete backward compatibility, `grid_layout` will **not** be ditched or deprecated; its full contract and functionality are preserved alongside `sticky_headers`.
509
-
510
- ### Deprecated Features & Recommended Upgrades
511
- | Deprecated Feature | Modern Alternative in v1.0.0 | Migration Action |
512
- | :--- | :--- | :--- |
513
- | `base_path` script loading | Native ES module imports or bundled Web Component | Optional: `base_path` remains supported for asset resolution, but modern bundlers/CDNs can import ESM directly. |
514
- | External raster GIFs (`btn_first_page.gif`) | Built-in accessible SVGs | Automatic; custom image paths remain supported via props. |
515
- | Non-semantic `<span>` paging buttons | Semantic `<button>` elements with ARIA | Automatic upgrade; custom HTML templates supported. |
516
-
517
- ---
518
-
519
- ## 7. Conclusion & Next Steps
520
-
521
- Achieving **Version 1.0.0** for TableFilter as an accessible Native Web Component is an achievable, high-impact project. Because the existing documentation and test suite provide a crystal-clear contract, the migration can proceed with confidence, eliminating historical technical debt while delivering a modern, accessible, zero-dependency component library ready for the next decade of the web.