All notable changes to this project will be documented in this file.
0.6.2 (2025-02-16)
- reexport
DefaultContent
andNullableContent
0.6.1 (2025-02-16)
- Add optional
value
prop toAccessorContent
,ArrayContent
,ObjectContent
0.6.0 (2025-02-16)
Package Restructure
- Rewrote
@ctablex/core
and moved core table concepts to@ctablex/table
.
Context Changes
- All data now flows through
ContentContext
(replacesDataContext
,RowContext
, and other removed contexts). - The
TableComponentsProvider
is replaced withTableElementsProvider
const elements: TableElements = {
table: <table data-testid="ctx-table" />,
thead: <thead data-testid="ctx-thead" />,
tbody: <tbody data-testid="ctx-tbody" />,
tfoot: <tfoot data-testid="ctx-tfoot" />,
tr: <tr data-testid="ctx-tr" />,
th: <th data-testid="ctx-th" />,
td: <td data-testid="ctx-td" />,
};
<TableElementsProvider value={elements}>
Prop Cleanup
- Removed all deprecated
*Props
props (tdProps
,thProps
, etc.). - Consolidated
*El
props into theel
prop (e.g.,tdEl
→el
).
Exception:<Column />
retainsthEl
for header customization:Element Prop Behavior<Column el={<td />} thEl={<th />} />
el
now automatically injectschildren
. For empty content, passnull
explicitly:(Ariakit-style composition)<Column el={<td>{null}</td>} /> // Explicit empty content
Accessor Default Change
- Default
accessor
is no longernull
. To replicate old behavior:Omitting// Old: <Column /> // (accessor=null) // New: <Column accessor={null} />
accessor
now passes content down without change.
Type-Safe Accessors
-
Accessor paths are now validated with TypeScript. Typos trigger immediate feedback:
type Data = { name: { first: string; last: string } }; <Column<Data> accessor="name.first" /> // ✅ Valid <Column<Data> accessor="name.las" /> // ❌ Error: "Did you mean 'name.last'?"
0.5.1 (2024-07-12)
- add repository to package.json (9350975)
0.5.0 (2024-07-12)
0.4.0 (2022-10-16)
Now components can be customized with xEl prop instead of xProps. It helps for a better type check.
return <Row TrProps={{ className: "zebra" }} />;
// vs
return (
<Row
trEl={
<tr className="zebra">
<Children />
</tr>
}
/>
);
// or
const MyTr = withDefaultChildren("tr");
return <Row trEl={<MyTr className="zebra" />} />;
- add and use table elements context (0441555)
- add children context (f39f6ca)
- row: add and use CurrentRowDataProvider component (5ad330b)
0.3.0 (2020-12-20)
- add default children to table/table-body/table-header/row/rows components (7091f5f)
- columns: add part props in columns usage (1de25ca)
- accept and pass props to underlying components (d672f4d)
- complex-content: add complex content example (7553c57)
- update readme and use new api (494dab0)
0.2.1 (2020-07-19)
- columns: support multi part tables (be0152a)
- content-value: support missing value (66ee464)
0.2.0 (2020-07-14)
- rename context types and providers
- basic: add basic example (ecbf8cb)
- basic-example: improve readme (fa29cb8)
- rename context types and providers (a28ddc9)
0.1.0 (2020-07-04)
- add table components (f4d0d9a)
- add the example section to the readme file (cc62e78)
- init project (25f72c9)