@jielga/tmdatagrid 0.3.0 → 1.0.0-beta.0

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 (70) hide show
  1. package/README.md +25 -2
  2. package/dist/index.d.ts +1789 -64
  3. package/dist/index.js +4432 -1561
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +1 -1
  6. package/dist/styles.layer.css +1 -0
  7. package/package.json +13 -3
  8. package/skills/columns/SKILL.md +1 -1
  9. package/skills/features/SKILL.md +61 -11
  10. package/skills/getting-started/SKILL.md +1 -1
  11. package/skills/options/SKILL.md +12 -2
  12. package/skills/server-side/SKILL.md +1 -1
  13. package/skills/testing/SKILL.md +198 -0
  14. package/src/tmdatagrid/TMDataGridContext.ts +26 -0
  15. package/src/tmdatagrid/components/TMDataGrid.module.css +21 -0
  16. package/src/tmdatagrid/components/TMDataGrid.tsx +57 -1
  17. package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +256 -0
  18. package/src/tmdatagrid/components/TMDataGridColumnsPanel.tsx +38 -15
  19. package/src/tmdatagrid/components/TMDataGridDetailsColumn.module.css +33 -0
  20. package/src/tmdatagrid/components/TMDataGridDetailsColumn.tsx +163 -0
  21. package/src/tmdatagrid/components/TMDataGridEditActions.tsx +62 -0
  22. package/src/tmdatagrid/components/TMDataGridEditColumn.tsx +237 -0
  23. package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +164 -0
  24. package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +131 -38
  25. package/src/tmdatagrid/components/TMDataGridFilterPills.tsx +11 -4
  26. package/src/tmdatagrid/components/TMDataGridFooter.tsx +21 -22
  27. package/src/tmdatagrid/components/TMDataGridGroupColumn.tsx +25 -11
  28. package/src/tmdatagrid/components/TMDataGridHeaderCell.module.css +15 -3
  29. package/src/tmdatagrid/components/TMDataGridHeaderCell.tsx +191 -53
  30. package/src/tmdatagrid/components/TMDataGridRowNumberColumn.tsx +44 -0
  31. package/src/tmdatagrid/components/TMDataGridSearch.tsx +124 -0
  32. package/src/tmdatagrid/components/TMDataGridSelectColumn.tsx +26 -13
  33. package/src/tmdatagrid/components/TMDataGridTable.module.css +333 -6
  34. package/src/tmdatagrid/components/TMDataGridTable.tsx +1819 -62
  35. package/src/tmdatagrid/components/TMDataGridToolbar.tsx +41 -13
  36. package/src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx +29 -0
  37. package/src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx +57 -0
  38. package/src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx +45 -0
  39. package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +38 -0
  40. package/src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx +53 -0
  41. package/src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx +31 -0
  42. package/src/tmdatagrid/components/editors/editorShared.ts +48 -0
  43. package/src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx +46 -0
  44. package/src/tmdatagrid/components/filters/DgDateRangeFilter.tsx +43 -0
  45. package/src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx +52 -0
  46. package/src/tmdatagrid/components/filters/DgTriStateFilter.tsx +38 -0
  47. package/src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx +122 -0
  48. package/src/tmdatagrid/components/icons.ts +5 -0
  49. package/src/tmdatagrid/components/sticky.module.css +77 -16
  50. package/src/tmdatagrid/core/autosize.ts +125 -0
  51. package/src/tmdatagrid/core/capabilities.ts +77 -0
  52. package/src/tmdatagrid/core/cellExport.ts +321 -0
  53. package/src/tmdatagrid/core/cellNavigation.ts +144 -0
  54. package/src/tmdatagrid/core/cellRange.ts +118 -0
  55. package/src/tmdatagrid/core/columnOptions.ts +123 -0
  56. package/src/tmdatagrid/core/columnUtils.ts +44 -1
  57. package/src/tmdatagrid/core/editEngine.ts +857 -0
  58. package/src/tmdatagrid/core/expanding.ts +93 -0
  59. package/src/tmdatagrid/core/filterControls.ts +45 -0
  60. package/src/tmdatagrid/core/filterOperators.ts +243 -14
  61. package/src/tmdatagrid/core/labels.ts +278 -0
  62. package/src/tmdatagrid/core/labelsSv.ts +131 -0
  63. package/src/tmdatagrid/core/matchHighlight.ts +96 -0
  64. package/src/tmdatagrid/core/persistence.ts +97 -3
  65. package/src/tmdatagrid/core/quickSearch.ts +144 -0
  66. package/src/tmdatagrid/core/rowPinning.ts +37 -0
  67. package/src/tmdatagrid/core/rowSelection.ts +10 -1
  68. package/src/tmdatagrid/core/summary.ts +35 -0
  69. package/src/tmdatagrid/index.ts +121 -0
  70. package/src/tmdatagrid/useTMDataGrid.tsx +782 -25
package/README.md CHANGED
@@ -95,7 +95,9 @@ demo site:
95
95
  | [Components](src/docs/components.md) | Props for every component |
96
96
  | [Columns](src/docs/columns.md) | Definitions, sizing and filters |
97
97
  | [Features](src/docs/features.md) | Enabling and disabling behaviour |
98
+ | [Editing](src/docs/editing.md) | Modes, editors and validation |
98
99
  | [Server-side](src/docs/server-side.md) | Manual pagination and filtering |
100
+ | [Testing](src/docs/testing.md) | Part hooks, roles and Playwright |
99
101
 
100
102
  ## Development
101
103
 
@@ -109,9 +111,26 @@ is the demo site that documents it.
109
111
  | `core/` | Headless logic: filtering, ordering, persistence, capabilities |
110
112
  | `components/` | The React chrome and its co-located CSS modules |
111
113
 
114
+ ### Examples
115
+
116
+ The demo site's examples live in [`src/examples/`](src/examples):
117
+
118
+ | Path | Contents |
119
+ | ----------------- | -------------------------------------------------------------- |
120
+ | `examplePages.ts` | The tree — categories, topics, and the prose for every demo |
121
+ | `demos/` | One file per demo: one idea, no headings, no explanation |
122
+ | `data/` | Shared datasets, and the column set for demos about other things |
123
+ | `playground/` | The kitchen sink, every feature at once behind switches |
124
+
125
+ Adding a demo is adding a file under `demos/` and naming it from a topic in
126
+ `examplePages.ts` — the registry pairs each module with its own source through
127
+ `import.meta.glob`, so the code on screen cannot drift from the code running.
128
+ [`demos.test.tsx`](src/examples/demos.test.tsx) mounts every registered demo,
129
+ so a demo that stops working fails the suite whether or not it still compiles.
130
+
112
131
  ```sh
113
132
  npm install
114
- npm run dev # demo site with the grid example and docs
133
+ npm run dev # demo site: examples, playground and docs
115
134
  npm run lint # oxlint
116
135
  npm run test # vitest, once
117
136
  npm run test:watch
@@ -119,6 +138,10 @@ npm run test:watch
119
138
 
120
139
  ## Testing
121
140
 
141
+ For testing an application that *uses* the grid — the test ids, roles and ARIA
142
+ attributes it publishes, and how to drive it from Playwright — see
143
+ [Testing](src/docs/testing.md). What follows is about this repo's own suite.
144
+
122
145
  Vitest with React Testing Library, in jsdom. Tests sit next to the code they
123
146
  cover as `*.test.ts(x)` and are excluded from both the package and the
124
147
  declaration build; shared fixtures live in [`src/test/`](src/test) so they stay
@@ -184,7 +207,7 @@ The package build runs from `prepublishOnly` rather than as a workflow step, so
184
207
  `metadata.library_version` in every `skills/*/SKILL.md` to the new version.
185
208
 
186
209
  Intent reports a skill as stale when its `library_version` trails the package
187
- version, so without that step every release would leave all five skills stale.
210
+ version, so without that step every release would leave every skill stale.
188
211
  Because it runs inside the version command, the bump and the skill sync land in
189
212
  the same PR and are reviewed together.
190
213