@humanspeak/svelte-headless-table 5.0.3 → 5.1.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.
- package/dist/bodyCells.d.ts +1 -1
- package/dist/bodyRows.d.ts +5 -1
- package/dist/columns.d.ts +1 -2
- package/dist/createTable.d.ts +1 -1
- package/dist/createTable.js +1 -1
- package/dist/headerCells.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/plugins/addColumnFilters.d.ts +2 -2
- package/dist/plugins/addColumnOrder.d.ts +1 -1
- package/dist/plugins/addDataExport.d.ts +1 -1
- package/dist/plugins/addDataExport.js +1 -3
- package/dist/plugins/addExpandedRows.d.ts +1 -1
- package/dist/plugins/addExpandedRows.js +1 -1
- package/dist/plugins/addFlatten.d.ts +2 -2
- package/dist/plugins/addGroupBy.js +1 -2
- package/dist/plugins/addHiddenColumns.d.ts +1 -1
- package/dist/plugins/addPagination.d.ts +2 -2
- package/dist/plugins/addResizedColumns.d.ts +1 -1
- package/dist/plugins/addResizedColumns.js +1 -1
- package/dist/plugins/addSelectedRows.d.ts +1 -1
- package/dist/plugins/addSelectedRows.js +1 -1
- package/dist/plugins/addSortBy.d.ts +2 -2
- package/dist/plugins/addSortBy.js +1 -1
- package/dist/plugins/addSubRows.js +1 -1
- package/dist/plugins/addTableFilter.d.ts +2 -2
- package/dist/plugins/addTableFilter.js +1 -1
- package/dist/tableComponent.d.ts +1 -1
- package/dist/tableComponent.js +1 -1
- package/dist/types/Label.d.ts +1 -1
- package/dist/types/TablePlugin.d.ts +2 -2
- package/package.json +43 -30
package/dist/bodyCells.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
1
2
|
import { type Readable } from 'svelte/store';
|
|
2
3
|
import type { BodyRow } from './bodyRows.js';
|
|
3
4
|
import type { DataColumn, DisplayColumn, FlatColumn } from './columns.js';
|
|
4
5
|
import { TableComponent } from './tableComponent.js';
|
|
5
6
|
import type { DataLabel, DisplayLabel } from './types/Label.js';
|
|
6
7
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
7
|
-
import type { RenderConfig } from '@humanspeak/svelte-subscribe';
|
|
8
8
|
export type BodyCellInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
|
|
9
9
|
id: string;
|
|
10
10
|
row: BodyRow<Item, Plugins>;
|
package/dist/bodyRows.d.ts
CHANGED
|
@@ -60,7 +60,11 @@ export interface BodyRowsOptions<Item> {
|
|
|
60
60
|
* @param flatColumns The column structure.
|
|
61
61
|
* @returns An array of `BodyRow`s representing the table structure.
|
|
62
62
|
*/
|
|
63
|
-
export declare const getBodyRows: <Item, Plugins extends AnyPlugins = AnyPlugins>(data: Item[],
|
|
63
|
+
export declare const getBodyRows: <Item, Plugins extends AnyPlugins = AnyPlugins>(data: Item[],
|
|
64
|
+
/**
|
|
65
|
+
* Flat columns before column transformations.
|
|
66
|
+
*/
|
|
67
|
+
flatColumns: FlatColumn<Item, Plugins>[], { rowDataId }?: BodyRowsOptions<Item>) => BodyRow<Item, Plugins>[];
|
|
64
68
|
/**
|
|
65
69
|
* Arranges and hides columns in an array of `BodyRow`s based on
|
|
66
70
|
* `columnIdOrder` by transforming the `cells` property of each row.
|
package/dist/columns.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { DisplayBodyCell } from './bodyCells.js';
|
|
2
2
|
import type { TableState } from './createViewModel.js';
|
|
3
|
-
import type { DisplayLabel, HeaderLabel } from './types/Label.js';
|
|
4
|
-
import type { DataLabel } from './types/Label.js';
|
|
3
|
+
import type { DataLabel, DisplayLabel, HeaderLabel } from './types/Label.js';
|
|
5
4
|
import type { AnyPlugins, PluginColumnConfigs } from './types/TablePlugin.js';
|
|
6
5
|
export interface ColumnInit<Item, Plugins extends AnyPlugins = AnyPlugins> {
|
|
7
6
|
header: HeaderLabel<Item, Plugins>;
|
package/dist/createTable.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataColumn, DisplayColumn, GroupColumn, type Column, type DataColumnInitBase, type DataColumnInitFnAndId, type DataColumnInitIdAndKey, type DataColumnInitKey, type DisplayColumnInit, type GroupColumnInit } from './columns.js';
|
|
2
|
+
import { type CreateViewModelOptions, type TableViewModel } from './createViewModel.js';
|
|
2
3
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
3
4
|
import type { ReadOrWritable } from './utils/store.js';
|
|
4
|
-
import { type CreateViewModelOptions, type TableViewModel } from './createViewModel.js';
|
|
5
5
|
export declare class Table<Item, Plugins extends AnyPlugins = AnyPlugins> {
|
|
6
6
|
data: ReadOrWritable<Item[]>;
|
|
7
7
|
plugins: Plugins;
|
package/dist/createTable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataColumn, DisplayColumn, getFlatColumnIds, GroupColumn } from './columns.js';
|
|
2
|
-
import { getDuplicates } from './utils/array.js';
|
|
3
2
|
import { createViewModel } from './createViewModel.js';
|
|
3
|
+
import { getDuplicates } from './utils/array.js';
|
|
4
4
|
export class Table {
|
|
5
5
|
data;
|
|
6
6
|
plugins;
|
package/dist/headerCells.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
1
2
|
import { TableComponent } from './tableComponent.js';
|
|
2
3
|
import type { HeaderLabel } from './types/Label.js';
|
|
3
4
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
4
|
-
import type { RenderConfig } from '@humanspeak/svelte-subscribe';
|
|
5
5
|
export type HeaderCellInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
|
|
6
6
|
id: string;
|
|
7
7
|
label: HeaderLabel<Item, Plugins>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * from '@humanspeak/svelte-render';
|
|
2
2
|
export { Subscribe } from '@humanspeak/svelte-subscribe';
|
|
3
3
|
export { createTable } from './createTable.js';
|
|
4
|
-
export { Table } from './createTable.js';
|
|
5
|
-
export { HeaderRow } from './headerRows.js';
|
|
6
|
-
export { HeaderCell, FlatHeaderCell, DataHeaderCell, FlatDisplayHeaderCell, GroupHeaderCell, GroupDisplayHeaderCell } from './headerCells.js';
|
|
7
|
-
export * from './bodyRows.js';
|
|
8
4
|
export * from './bodyCells.js';
|
|
5
|
+
export * from './bodyRows.js';
|
|
9
6
|
export * from './columns.js';
|
|
7
|
+
export { Table } from './createTable.js';
|
|
10
8
|
export type * from './createViewModel.js';
|
|
9
|
+
export { DataHeaderCell, FlatDisplayHeaderCell, FlatHeaderCell, GroupDisplayHeaderCell, GroupHeaderCell, HeaderCell } from './headerCells.js';
|
|
10
|
+
export { HeaderRow } from './headerRows.js';
|
|
11
11
|
export type * from './types/Label.js';
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ export { Subscribe } from '@humanspeak/svelte-subscribe';
|
|
|
4
4
|
// table core
|
|
5
5
|
export { createTable } from './createTable.js';
|
|
6
6
|
// models
|
|
7
|
-
export { Table } from './createTable.js';
|
|
8
|
-
export { HeaderRow } from './headerRows.js';
|
|
9
|
-
export { HeaderCell, FlatHeaderCell, DataHeaderCell, FlatDisplayHeaderCell, GroupHeaderCell, GroupDisplayHeaderCell } from './headerCells.js';
|
|
10
|
-
export * from './bodyRows.js';
|
|
11
7
|
export * from './bodyCells.js';
|
|
8
|
+
export * from './bodyRows.js';
|
|
12
9
|
export * from './columns.js';
|
|
10
|
+
export { Table } from './createTable.js';
|
|
11
|
+
export { DataHeaderCell, FlatDisplayHeaderCell, FlatHeaderCell, GroupDisplayHeaderCell, GroupHeaderCell, HeaderCell } from './headerCells.js';
|
|
12
|
+
export { HeaderRow } from './headerRows.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
2
|
-
import type { BodyRow } from '../bodyRows.js';
|
|
3
|
-
import type { TablePlugin, NewTablePropSet } from '../types/TablePlugin.js';
|
|
4
2
|
import { type Readable, type Writable } from 'svelte/store';
|
|
3
|
+
import type { BodyRow } from '../bodyRows.js';
|
|
5
4
|
import type { PluginInitTableState } from '../createViewModel.js';
|
|
5
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
6
6
|
export interface ColumnFiltersConfig {
|
|
7
7
|
serverSide?: boolean;
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
2
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
3
|
export interface ColumnOrderConfig {
|
|
4
4
|
initialColumnIdOrder?: string[];
|
|
5
5
|
hideUnspecifiedColumns?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TablePlugin } from '../types/TablePlugin.js';
|
|
2
1
|
import { type Readable } from 'svelte/store';
|
|
2
|
+
import type { TablePlugin } from '../types/TablePlugin.js';
|
|
3
3
|
export type DataExportFormat = 'object' | 'json' | 'csv';
|
|
4
4
|
type ExportForFormat = {
|
|
5
5
|
object: Record<string, unknown>[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isReadable } from '../utils/store.js';
|
|
2
1
|
import { derived, get } from 'svelte/store';
|
|
2
|
+
import { isReadable } from '../utils/store.js';
|
|
3
3
|
const getObjectsFromRows = (rows, ids, childrenKey) => {
|
|
4
4
|
return rows.map((row) => {
|
|
5
5
|
const dataObject = Object.fromEntries(ids.map((id) => {
|
|
@@ -8,7 +8,6 @@ const getObjectsFromRows = (rows, ids, childrenKey) => {
|
|
|
8
8
|
return [id, cell.value];
|
|
9
9
|
}
|
|
10
10
|
if (cell.isDisplay() && cell.column.data !== undefined) {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
11
|
let data = cell.column.data(cell, row.state);
|
|
13
12
|
if (isReadable(data)) {
|
|
14
13
|
data = get(data);
|
|
@@ -31,7 +30,6 @@ const getCsvFromRows = (rows, ids) => {
|
|
|
31
30
|
return cell.value;
|
|
32
31
|
}
|
|
33
32
|
if (cell.isDisplay() && cell.column.data !== undefined) {
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
33
|
let data = cell.column.data(cell, row.state);
|
|
36
34
|
if (isReadable(data)) {
|
|
37
35
|
data = get(data);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type Readable, type Writable } from 'svelte/store';
|
|
1
2
|
import type { BodyRow } from '../bodyRows.js';
|
|
2
3
|
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
4
|
import { type RecordSetStore } from '../utils/store.js';
|
|
4
|
-
import { type Readable, type Writable } from 'svelte/store';
|
|
5
5
|
export interface ExpandedRowsConfig<Item> {
|
|
6
6
|
initialExpandedIds?: Record<string, boolean>;
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { recordSetStore } from '../utils/store.js';
|
|
2
1
|
import { keyed } from '@humanspeak/svelte-keyed';
|
|
3
2
|
import { derived, readable } from 'svelte/store';
|
|
3
|
+
import { recordSetStore } from '../utils/store.js';
|
|
4
4
|
const withExpandedRows = (row, expandedIds) => {
|
|
5
5
|
if (row.subRows === undefined) {
|
|
6
6
|
return [row];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { type Writable } from 'svelte/store';
|
|
1
2
|
import type { BodyRow } from '../bodyRows.js';
|
|
2
3
|
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
|
-
import { type Writable } from 'svelte/store';
|
|
4
4
|
export interface FlattenConfig {
|
|
5
5
|
initialDepth?: number;
|
|
6
6
|
}
|
|
7
7
|
export interface FlattenState {
|
|
8
8
|
depth: Writable<number>;
|
|
9
9
|
}
|
|
10
|
-
export interface FlattenColumnOptions<Item> {
|
|
10
|
+
export interface FlattenColumnOptions<Item> extends Record<string, never> {
|
|
11
11
|
}
|
|
12
12
|
export type FlattenPropSet = NewTablePropSet<{
|
|
13
13
|
'tbody.tr.td': {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { derived, writable } from 'svelte/store';
|
|
1
2
|
import { DataBodyCell } from '../bodyCells.js';
|
|
2
3
|
import { BodyRow, DisplayBodyRow } from '../bodyRows.js';
|
|
3
4
|
import { isShiftClick } from '../utils/event.js';
|
|
4
5
|
import { nonUndefined } from '../utils/filter.js';
|
|
5
6
|
import { arraySetStore } from '../utils/store.js';
|
|
6
|
-
import { derived, writable } from 'svelte/store';
|
|
7
7
|
const getIdPrefix = (id) => {
|
|
8
8
|
const prefixTokens = id.split('>').slice(0, -1);
|
|
9
9
|
if (prefixTokens.length === 0) {
|
|
@@ -21,7 +21,6 @@ const deepenIdAndDepth = (row, parentId) => {
|
|
|
21
21
|
row.depth = row.depth + 1;
|
|
22
22
|
row.subRows?.forEach((subRow) => deepenIdAndDepth(subRow, parentId));
|
|
23
23
|
};
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
24
|
export const getGroupedRows = (rows, groupByIds, columnOptions, { repeatCellIds, aggregateCellIds, groupCellIds, allGroupByIds }) => {
|
|
26
25
|
if (groupByIds.length === 0) {
|
|
27
26
|
return rows;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
2
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
3
|
export interface HiddenColumnsConfig {
|
|
4
4
|
initialHiddenColumnIds?: string[];
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
2
1
|
import { type Readable, type Updater, type Writable } from 'svelte/store';
|
|
2
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
3
|
export type PaginationConfig = {
|
|
4
4
|
initialPageIndex?: number;
|
|
5
5
|
initialPageSize?: number;
|
|
@@ -19,7 +19,7 @@ export interface PaginationState {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const createPageStore: ({ items, initialPageSize, initialPageIndex, serverSide, serverItemCount }: PageStoreConfig) => {
|
|
21
21
|
pageSize: {
|
|
22
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<number>, invalidate?:
|
|
22
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<number>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
23
23
|
update: (fn: Updater<number>) => void;
|
|
24
24
|
set: (newPageSize: number) => void;
|
|
25
25
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NewTableAttributeSet, NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
2
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
+
import type { NewTableAttributeSet, NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
3
|
export interface AddResizedColumnsConfig {
|
|
4
4
|
onResizeEnd?: (ev: Event) => void;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { sum } from '../utils/math.js';
|
|
2
1
|
import { keyed } from '@humanspeak/svelte-keyed';
|
|
3
2
|
import { derived, writable } from 'svelte/store';
|
|
3
|
+
import { sum } from '../utils/math.js';
|
|
4
4
|
const getDragXPos = (event) => {
|
|
5
5
|
if (event instanceof MouseEvent)
|
|
6
6
|
return event.clientX;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type Readable, type Writable } from 'svelte/store';
|
|
1
2
|
import type { BodyRow } from '../bodyRows.js';
|
|
2
3
|
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
3
4
|
import { type RecordSetStore } from '../utils/store.js';
|
|
4
|
-
import { type Readable, type Writable } from 'svelte/store';
|
|
5
5
|
export interface SelectedRowsConfig<Item> {
|
|
6
6
|
initialSelectedDataIds?: Record<string, boolean>;
|
|
7
7
|
linkDataSubRows?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { derived, get } from 'svelte/store';
|
|
1
2
|
import { nonNull } from '../utils/filter.js';
|
|
2
3
|
import { recordSetStore } from '../utils/store.js';
|
|
3
|
-
import { derived, get } from 'svelte/store';
|
|
4
4
|
const isAllSubRowsSelectedForRow = (row, $selectedDataIds, linkDataSubRows) => {
|
|
5
5
|
if (row.isData()) {
|
|
6
6
|
if (!linkDataSubRows || row.subRows === undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BodyRow } from '../bodyRows.js';
|
|
2
|
-
import type { TablePlugin, NewTablePropSet } from '../types/TablePlugin.js';
|
|
3
1
|
import { type Readable, type Writable } from 'svelte/store';
|
|
2
|
+
import type { BodyRow } from '../bodyRows.js';
|
|
3
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
4
4
|
export interface SortByConfig {
|
|
5
5
|
initialSortKeys?: SortKey[];
|
|
6
6
|
disableMultiSort?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { derived, writable } from 'svelte/store';
|
|
1
2
|
import { compare } from '../utils/compare.js';
|
|
2
3
|
import { isShiftClick } from '../utils/event.js';
|
|
3
|
-
import { derived, writable } from 'svelte/store';
|
|
4
4
|
const DEFAULT_TOGGLE_ORDER = ['asc', 'desc', undefined];
|
|
5
5
|
export const createSortKeysStore = (initKeys) => {
|
|
6
6
|
const { subscribe, update, set } = writable(initKeys);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataBodyRow, getSubRows } from '../bodyRows.js';
|
|
2
1
|
import { derived } from 'svelte/store';
|
|
2
|
+
import { DataBodyRow, getSubRows } from '../bodyRows.js';
|
|
3
3
|
const withSubRows = (row, getChildren) => {
|
|
4
4
|
const subItems = getChildren(row.original);
|
|
5
5
|
if (subItems === undefined) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BodyRow } from '../bodyRows.js';
|
|
2
|
-
import type { TablePlugin, NewTablePropSet } from '../types/TablePlugin.js';
|
|
3
1
|
import { type Readable, type Writable } from 'svelte/store';
|
|
2
|
+
import type { BodyRow } from '../bodyRows.js';
|
|
3
|
+
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js';
|
|
4
4
|
export interface TableFilterConfig {
|
|
5
5
|
fn?: TableFilterFn;
|
|
6
6
|
initialFilterValue?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { recordSetStore } from '../utils/store.js';
|
|
2
1
|
import { derived, writable } from 'svelte/store';
|
|
2
|
+
import { recordSetStore } from '../utils/store.js';
|
|
3
3
|
import { textPrefixFilter } from './addColumnFilters.js';
|
|
4
4
|
const getFilteredRows = (rows, filterValue, columnOptions, { tableCellMatches, fn, includeHiddenColumns }) => {
|
|
5
5
|
const $filteredRows = rows
|
package/dist/tableComponent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Readable } from 'svelte/store';
|
|
2
|
-
import type { AnyPlugins, ComponentKeys, ElementHook, PluginTablePropSet } from './types/TablePlugin.js';
|
|
3
2
|
import type { TableState } from './createViewModel.js';
|
|
3
|
+
import type { AnyPlugins, ComponentKeys, ElementHook, PluginTablePropSet } from './types/TablePlugin.js';
|
|
4
4
|
import type { Clonable } from './utils/clone.js';
|
|
5
5
|
export interface TableComponentInit {
|
|
6
6
|
id: string;
|
package/dist/tableComponent.js
CHANGED
package/dist/types/Label.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RenderConfig } from '@humanspeak/svelte-
|
|
1
|
+
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
2
2
|
import type { DataBodyCell, DisplayBodyCell } from '../bodyCells.js';
|
|
3
3
|
import type { TableState } from '../createViewModel.js';
|
|
4
4
|
import type { HeaderCell } from '../headerCells.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { Readable } from 'svelte/store';
|
|
1
2
|
import type { BodyCell, BodyCellAttributes } from '../bodyCells.js';
|
|
2
3
|
import type { BodyRow, BodyRowAttributes } from '../bodyRows.js';
|
|
3
4
|
import type { DataColumn, FlatColumn } from '../columns.js';
|
|
5
|
+
import type { PluginInitTableState, TableAttributes, TableBodyAttributes, TableHeadAttributes } from '../createViewModel.js';
|
|
4
6
|
import type { HeaderCell, HeaderCellAttributes } from '../headerCells.js';
|
|
5
7
|
import type { HeaderRow, HeaderRowAttributes } from '../headerRows.js';
|
|
6
|
-
import type { PluginInitTableState, TableAttributes, TableBodyAttributes, TableHeadAttributes } from '../createViewModel.js';
|
|
7
|
-
import type { Readable } from 'svelte/store';
|
|
8
8
|
export type TablePlugin<Item, PluginState, ColumnOptions, TablePropSet extends AnyTablePropSet = AnyTablePropSet, TableAttributeSet extends AnyTableAttributeSet = AnyTableAttributeSet> = (init: TablePluginInit<Item, ColumnOptions>) => TablePluginInstance<Item, PluginState, ColumnOptions, TablePropSet, TableAttributeSet>;
|
|
9
9
|
export type TablePluginInit<Item, ColumnOptions> = {
|
|
10
10
|
pluginName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humanspeak/svelte-headless-table",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "A powerful, headless table library for Svelte that provides complete control over table UI while handling complex data operations like sorting, filtering, pagination, grouping, and row expansion. Build custom, accessible data tables with zero styling opinions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"customizable",
|
|
28
28
|
"accessible"
|
|
29
29
|
],
|
|
30
|
-
"homepage": "https://
|
|
30
|
+
"homepage": "https://table.svelte.page",
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/humanspeak/svelte-headless-table/issues"
|
|
33
33
|
},
|
|
@@ -75,42 +75,55 @@
|
|
|
75
75
|
"test:e2e:report": "playwright show-report",
|
|
76
76
|
"test:e2e:ui": "playwright test --ui",
|
|
77
77
|
"test:only": "vitest run",
|
|
78
|
+
"test:unit": "vitest",
|
|
79
|
+
"test:unit:ui": "vitest --ui",
|
|
78
80
|
"test:watch": "vitest"
|
|
79
81
|
},
|
|
80
82
|
"dependencies": {
|
|
81
83
|
"@humanspeak/svelte-keyed": "^5.0.1",
|
|
82
|
-
"@humanspeak/svelte-render": "^5.
|
|
84
|
+
"@humanspeak/svelte-render": "^5.1.1",
|
|
83
85
|
"@humanspeak/svelte-subscribe": "^5.0.0"
|
|
84
86
|
},
|
|
85
87
|
"devDependencies": {
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@sveltejs/
|
|
91
|
-
"@sveltejs/
|
|
92
|
-
"@
|
|
93
|
-
"@
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
97
|
-
"@
|
|
98
|
-
"@
|
|
99
|
-
"eslint": "^8.
|
|
100
|
-
"
|
|
101
|
-
"eslint
|
|
102
|
-
"prettier": "^
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
88
|
+
"@eslint/compat": "^1.2.7",
|
|
89
|
+
"@eslint/js": "^9.22.0",
|
|
90
|
+
"@faker-js/faker": "^9.6.0",
|
|
91
|
+
"@playwright/test": "^1.51.0",
|
|
92
|
+
"@sveltejs/adapter-auto": "^4.0.0",
|
|
93
|
+
"@sveltejs/kit": "^2.19.0",
|
|
94
|
+
"@sveltejs/package": "^2.3.10",
|
|
95
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
96
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
97
|
+
"@testing-library/svelte": "^5.2.7",
|
|
98
|
+
"@types/eslint": "9.6.1",
|
|
99
|
+
"@types/node": "^22.13.9",
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^8.26.0",
|
|
101
|
+
"@typescript-eslint/parser": "^8.26.0",
|
|
102
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
103
|
+
"eslint": "^9.22.0",
|
|
104
|
+
"eslint-config-prettier": "^10.1.1",
|
|
105
|
+
"eslint-plugin-import": "^2.31.0",
|
|
106
|
+
"eslint-plugin-svelte": "^3.0.3",
|
|
107
|
+
"eslint-plugin-unused-imports": "^4.1.4",
|
|
108
|
+
"globals": "^16.0.0",
|
|
109
|
+
"prettier": "^3.5.3",
|
|
110
|
+
"prettier-plugin-organize-imports": "^4.1.0",
|
|
111
|
+
"prettier-plugin-svelte": "^3.3.3",
|
|
112
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
113
|
+
"publint": "^0.3.8",
|
|
114
|
+
"svelte": "^5.22.6",
|
|
115
|
+
"svelte-check": "^4.1.5",
|
|
116
|
+
"tslib": "^2.8.1",
|
|
117
|
+
"type-fest": "^4.37.0",
|
|
118
|
+
"typescript": "^5.8.2",
|
|
119
|
+
"typescript-eslint": "^8.26.0",
|
|
120
|
+
"vite": "^6.2.1",
|
|
121
|
+
"vitest": "^3.0.8"
|
|
122
|
+
},
|
|
123
|
+
"peerDependencies": {
|
|
124
|
+
"svelte": "^5.0.0"
|
|
112
125
|
},
|
|
113
126
|
"volta": {
|
|
114
|
-
"node": "22.
|
|
127
|
+
"node": "22.14.0"
|
|
115
128
|
}
|
|
116
129
|
}
|