Skip to content

Releases: bryanmylee/svelte-headless-table

v0.17.2 Nit server-side pagination variable name

24 Jan 02:31
bc2e096
Compare
Choose a tag to compare

What's Changed

  • make itemCount singular for consistency by @blerrgh in #100

Full Changelog: v0.17.1...v0.17.2

v0.17.1 Fix sorting server-side check

18 Jan 12:13
75f9ee0
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.17.0...v0.17.1

v0.17 Server-side support

11 Jan 08:38
1b51ade
Compare
Choose a tag to compare

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

04 Jan 04:48
d941454
Compare
Choose a tag to compare

What's Changed

  • fix for undefined addResizedColumns config by @blerrgh in #94

New Contributors

Full Changelog: v0.16.1...v0.16.2

v0.16.1 Expose `onResizeEnd` event for `addResizedColumns`

22 Dec 13:50
Compare
Choose a tag to compare

v0.16.0 Allow slot content with `createRender`

22 Dec 12:10
Compare
Choose a tag to compare

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

25 Oct 09:51
5c73bf6
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.15.2...v0.15.3

v0.15.2 Fix addSelectedRows plugin state behavior

25 Oct 08:48
ee4dffa
Compare
Choose a tag to compare

What's Changed

  • Include necessary imports in documentaiton by @thomas725 in #76
  • Fix allPageRowsSelected behavior when setting to false by @bryanmylee in #81

New Contributors

Full Changelog: v0.15.1...v0.15.2

v0.15.1 Fix package types

29 Sep 06:09
Compare
Choose a tag to compare

Svelte package is behaving weirdly with Svelte Headless Table.

This should fix the weird typing export issues.

v0.15.0 Render event system

28 Sep 14:19
2b1544b
Compare
Choose a tag to compare

What's Changed

Extracted createRender and Render into a separate package, and extended functionality to provide event handling for custom rendered components.

Full Changelog: v0.14.4...v0.15.0