Data View Package
📊 What is Data View?
Introduction
The data view package provides a basic way for creating your generic table view with some opinionated features. The library consists of store and component libraries. Each can be used independently.
Store
This provides factory functions for creating writable store filters that are common with data views. It automatically writes to the url query/searchParams in order to persist between pages.
NOTE! This does sync bi-directionally with the url. If the URL search parameters is changed manually or programatically, it will NOT update the store values.
Basic Usage
A convinience function has been provided for quick
intialization.
When using this, make sure to initialize them as high up the component tree as possible, the +page.ts
is a good place to use these. This is because it automatically sets the context via the setContext
svelte api.
Somewhere down the component tree
Data View
This component renders your basic table. Here are the configurable property definitions.
Columns
Note that the base columns extends @tanstack/svelte-table
column def, so you may specify the columns as such.
Data view
These relate to the props you can pass to the data view component
Basic Usage
On version 1 onwards, the states have been lifted up to an object that is passed to the DataView
components.
This provides you access and abitlity to control the states within your component.