Releases: bryanmylee/svelte-headless-table
v0.17.2 Nit server-side pagination variable name
What's Changed
Full Changelog: v0.17.1...v0.17.2
v0.17.1 Fix sorting server-side check
What's Changed
- Fix
addSortBy
interaction withserverSide
by @bryanmylee in #97
Full Changelog: v0.17.0...v0.17.1
v0.17 Server-side support
Server-side support
Thanks to the amazing @blerrgh for his work on server-side support for core plugins such as addSortBy
, addColumnFilters
, addTableFilter
, and addPagination
!
Server-side support allows you to handle data manipulation on your server instead of on the browser. When enabled on a plugin, it will not have any effect on the table rows. Instead, it will treat the existing data as though it has already been modified on the server but continue to update its own state. This lets you use Svelte Headless Table as a state manager for your server.
Usage
Simply pass serverSide: true
when instantiating a plugin to enable server-side data manipulation.
const data = writable([...]);
const table = createTable(data, {
sort: addSortBy({ serverSide: true }),
filter: addTableFilter({ serverSide: true }),
page: addPagination({ serverSide: true }),
});
const columns = table.createColumns(...);
const {rows, pluginStates} = table.createViewModel(columns);
const {sortKeys} = pluginStates.sort;
const {filterValue} = pluginStates.filter;
const {pageSize, pageIndex} = pluginStates.filter;
async function updateQuery() {
const q = new URLSearchParams();
q.set('order_by', $sortKeys[0].id);
q.set('order_dir', $sortKeys[0].order);
q.set('filter', $filterValue);
q.set('limit', String($pageSize));
q.set('skip', String($pageSize * $pageIndex));
$data = await fetch(`/api_endpoint?${q});
}
// ...
What's Changed
Full Changelog: v0.16.2...v0.17.0
v0.16.2 Fix resize plugin optional config
v0.16.1 Expose `onResizeEnd` event for `addResizedColumns`
v0.16.0 Allow slot content with `createRender`
svelte-render
has been updated to allow slot contents in createRender
with v1.6.0
.
Now you can define components like:
const columns = table.createColumns([
table.column({
header: 'Name',
accessor: 'name',
cell: ({value}) => createRender(Label).slot(value),
}),
]);
to produce
<Label>{value}</Label>
Full Changelog: v0.15.3...v0.16.0
v0.15.3 Allow customization of sort toggling order
v0.15.2 Fix addSelectedRows plugin state behavior
What's Changed
- Include necessary imports in documentaiton by @thomas725 in #76
- Fix
allPageRowsSelected
behavior when setting tofalse
by @bryanmylee in #81
New Contributors
- @thomas725 made their first contribution in #76
Full Changelog: v0.15.1...v0.15.2
v0.15.1 Fix package types
Svelte package is behaving weirdly with Svelte Headless Table.
This should fix the weird typing export issues.
v0.15.0 Render event system
What's Changed
Extracted createRender
and Render
into a separate package, and extended functionality to provide event handling for custom rendered components.
- Migrate
Render
tosvelte-render
by @bryanmylee in #59
Full Changelog: v0.14.4...v0.15.0