@humanspeak/svelte-headless-table 6.0.0 → 6.0.2
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 +2 -2
- package/dist/bodyCells.js +1 -1
- package/dist/bodyRows.d.ts +1 -1
- package/dist/bodyRows.js +1 -1
- package/dist/columns.js +2 -1
- package/dist/createViewModel.d.ts +1 -1
- package/dist/createViewModel.js +1 -1
- package/dist/headerCells.d.ts +1 -1
- package/dist/headerCells.js +2 -2
- package/dist/headerRows.js +1 -1
- package/dist/plugins/addExpandedRows.d.ts +2 -0
- package/dist/plugins/addExpandedRows.js +24 -2
- package/dist/plugins/addSelectedRows.d.ts +2 -0
- package/dist/plugins/addSelectedRows.js +25 -2
- package/dist/plugins/cacheConfig.d.ts +7 -0
- package/dist/plugins/cacheConfig.js +11 -0
- package/dist/plugins/index.d.ts +15 -15
- package/dist/plugins/index.js +15 -15
- package/dist/tableComponent.d.ts +1 -1
- package/dist/tableComponent.js +1 -1
- package/package.json +132 -127
package/dist/bodyCells.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
2
|
-
import { type Readable } from 'svelte/store';
|
|
3
1
|
import type { BodyRow } from './bodyRows.js';
|
|
4
2
|
import type { DataColumn, DisplayColumn, FlatColumn } from './columns.js';
|
|
5
3
|
import { TableComponent } from './tableComponent.js';
|
|
6
4
|
import type { DataLabel, DisplayLabel } from './types/Label.js';
|
|
7
5
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
6
|
+
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
7
|
+
import { type Readable } from 'svelte/store';
|
|
8
8
|
export type BodyCellInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
|
|
9
9
|
id: string;
|
|
10
10
|
row: BodyRow<Item, Plugins>;
|
package/dist/bodyCells.js
CHANGED
package/dist/bodyRows.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Readable } from 'svelte/store';
|
|
2
1
|
import { BodyCell } from './bodyCells.js';
|
|
3
2
|
import type { FlatColumn } from './columns.js';
|
|
4
3
|
import { TableComponent } from './tableComponent.js';
|
|
5
4
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
5
|
+
import { type Readable } from 'svelte/store';
|
|
6
6
|
export type BodyRowInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
|
|
7
7
|
id: string;
|
|
8
8
|
cells: BodyCell<Item, Plugins>[];
|
package/dist/bodyRows.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { derived } from 'svelte/store';
|
|
2
1
|
import { BodyCell, DataBodyCell, DisplayBodyCell } from './bodyCells.js';
|
|
3
2
|
import { TableComponent } from './tableComponent.js';
|
|
4
3
|
import { nonUndefined } from './utils/filter.js';
|
|
4
|
+
import { derived } from 'svelte/store';
|
|
5
5
|
export class BodyRow extends TableComponent {
|
|
6
6
|
cells;
|
|
7
7
|
/**
|
package/dist/columns.js
CHANGED
|
@@ -40,6 +40,7 @@ export class DataColumn extends FlatColumn {
|
|
|
40
40
|
__data = true;
|
|
41
41
|
cell;
|
|
42
42
|
accessorKey;
|
|
43
|
+
/* trunk-ignore(eslint/no-unused-vars) */
|
|
43
44
|
accessorFn;
|
|
44
45
|
constructor({ header, footer, plugins, cell, accessor, id }) {
|
|
45
46
|
super({ header, footer, plugins, id: 'Initialization not complete' });
|
|
@@ -56,7 +57,7 @@ export class DataColumn extends FlatColumn {
|
|
|
56
57
|
const accessorKeyId = typeof this.accessorKey === 'string' ? this.accessorKey : null;
|
|
57
58
|
this.id = (id ?? accessorKeyId ?? String(header));
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
/* trunk-ignore(eslint/@typescript-eslint/no-explicit-any) */
|
|
60
61
|
getValue(item) {
|
|
61
62
|
if (this.accessorFn !== undefined) {
|
|
62
63
|
return this.accessorFn(item);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type Readable, type Writable } from 'svelte/store';
|
|
2
1
|
import { BodyRow, DataBodyRow } from './bodyRows.js';
|
|
3
2
|
import { FlatColumn, type Column } from './columns.js';
|
|
4
3
|
import type { Table } from './createTable.js';
|
|
5
4
|
import { HeaderRow } from './headerRows.js';
|
|
6
5
|
import type { AnyPlugins, PluginStates } from './types/TablePlugin.js';
|
|
6
|
+
import { type Readable, type Writable } from 'svelte/store';
|
|
7
7
|
export type TableAttributes<Item, Plugins extends AnyPlugins = AnyPlugins> = Record<string, unknown> & {
|
|
8
8
|
role: 'table';
|
|
9
9
|
};
|
package/dist/createViewModel.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { derived, readable, writable } from 'svelte/store';
|
|
2
1
|
import { BodyRow, DataBodyRow, getBodyRows, getColumnedBodyRows } from './bodyRows.js';
|
|
3
2
|
import { FlatColumn, getFlatColumns } from './columns.js';
|
|
4
3
|
import { getHeaderRows, HeaderRow } from './headerRows.js';
|
|
5
4
|
import { finalizeAttributes } from './utils/attributes.js';
|
|
6
5
|
import { nonUndefined } from './utils/filter.js';
|
|
6
|
+
import { derived, readable, writable } from 'svelte/store';
|
|
7
7
|
export const createViewModel = (table, columns, { rowDataId } = {}) => {
|
|
8
8
|
const { data, plugins } = table;
|
|
9
9
|
const $flatColumns = getFlatColumns(columns);
|
package/dist/headerCells.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
2
1
|
import { TableComponent } from './tableComponent.js';
|
|
3
2
|
import type { HeaderLabel } from './types/Label.js';
|
|
4
3
|
import type { AnyPlugins } from './types/TablePlugin.js';
|
|
4
|
+
import type { RenderConfig } from '@humanspeak/svelte-render';
|
|
5
5
|
export type HeaderCellInit<Item, Plugins extends AnyPlugins = AnyPlugins> = {
|
|
6
6
|
id: string;
|
|
7
7
|
label: HeaderLabel<Item, Plugins>;
|
package/dist/headerCells.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { derived } from 'svelte/store';
|
|
2
1
|
import { NBSP } from './constants.js';
|
|
3
2
|
import { TableComponent } from './tableComponent.js';
|
|
3
|
+
import { derived } from 'svelte/store';
|
|
4
4
|
export class HeaderCell extends TableComponent {
|
|
5
5
|
label;
|
|
6
6
|
colspan;
|
|
@@ -16,7 +16,6 @@ export class HeaderCell extends TableComponent {
|
|
|
16
16
|
if (this.state === undefined) {
|
|
17
17
|
throw new Error('Missing `state` reference');
|
|
18
18
|
}
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
19
|
return this.label(this, this.state);
|
|
21
20
|
}
|
|
22
21
|
return this.label;
|
|
@@ -69,6 +68,7 @@ export class DataHeaderCell extends FlatHeaderCell {
|
|
|
69
68
|
// TODO Workaround for https://github.com/vitejs/vite/issues/9528
|
|
70
69
|
__data = true;
|
|
71
70
|
accessorKey;
|
|
71
|
+
/* trunk-ignore(eslint/no-unused-vars) */
|
|
72
72
|
accessorFn;
|
|
73
73
|
constructor({ id, label, accessorKey, accessorFn, colstart }) {
|
|
74
74
|
super({ id, label, colstart });
|
package/dist/headerRows.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { derived } from 'svelte/store';
|
|
2
1
|
import { DataHeaderCell, FlatDisplayHeaderCell, GroupDisplayHeaderCell, GroupHeaderCell } from './headerCells.js';
|
|
3
2
|
import { TableComponent } from './tableComponent.js';
|
|
4
3
|
import { sum } from './utils/math.js';
|
|
5
4
|
import { getNullMatrix, getTransposed } from './utils/matrix.js';
|
|
5
|
+
import { derived } from 'svelte/store';
|
|
6
6
|
export class HeaderRow extends TableComponent {
|
|
7
7
|
cells;
|
|
8
8
|
constructor({ id, cells }) {
|
|
@@ -8,6 +8,8 @@ export interface ExpandedRowsConfig<Item> {
|
|
|
8
8
|
export interface ExpandedRowsState<Item> {
|
|
9
9
|
expandedIds: RecordSetStore<string>;
|
|
10
10
|
getRowState: (row: BodyRow<Item>) => ExpandedRowsRowState;
|
|
11
|
+
/** Cleans up internal subscriptions and clears the row state cache. Call when destroying the table. */
|
|
12
|
+
invalidate: () => void;
|
|
11
13
|
}
|
|
12
14
|
export interface ExpandedRowsRowState {
|
|
13
15
|
isExpanded: Writable<boolean>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { MemoryCache } from '@humanspeak/memory-cache';
|
|
1
2
|
import { keyed } from '@humanspeak/svelte-keyed';
|
|
2
3
|
import { derived, readable } from 'svelte/store';
|
|
3
4
|
import { recordSetStore } from '../utils/store.js';
|
|
5
|
+
import { DEFAULT_ROW_STATE_CACHE_CONFIG } from './cacheConfig.js';
|
|
4
6
|
const withExpandedRows = (row, expandedIds) => {
|
|
5
7
|
if (row.subRows === undefined) {
|
|
6
8
|
return [row];
|
|
@@ -13,7 +15,14 @@ const withExpandedRows = (row, expandedIds) => {
|
|
|
13
15
|
};
|
|
14
16
|
export const addExpandedRows = ({ initialExpandedIds = {} } = {}) => () => {
|
|
15
17
|
const expandedIds = recordSetStore(initialExpandedIds);
|
|
18
|
+
// LRU cache for memoized row state with automatic eviction.
|
|
19
|
+
// Prevents unbounded memory growth when row identities change.
|
|
20
|
+
const rowStateCache = new MemoryCache(DEFAULT_ROW_STATE_CACHE_CONFIG);
|
|
16
21
|
const getRowState = (row) => {
|
|
22
|
+
const cached = rowStateCache.get(row.id);
|
|
23
|
+
if (cached !== undefined) {
|
|
24
|
+
return cached;
|
|
25
|
+
}
|
|
17
26
|
const isExpanded = keyed(expandedIds, row.id);
|
|
18
27
|
const canExpand = readable((row.subRows?.length ?? 0) > 0);
|
|
19
28
|
const subRowExpandedIds = derived(expandedIds, ($expandedIds) => {
|
|
@@ -30,13 +39,26 @@ export const addExpandedRows = ({ initialExpandedIds = {} } = {}) => () => {
|
|
|
30
39
|
const expandableSubRows = row.subRows.filter((subRow) => subRow.subRows !== undefined);
|
|
31
40
|
return $subRowExpandedIds.length === expandableSubRows.length;
|
|
32
41
|
});
|
|
33
|
-
|
|
42
|
+
const state = {
|
|
34
43
|
isExpanded,
|
|
35
44
|
canExpand,
|
|
36
45
|
isAllSubRowsExpanded
|
|
37
46
|
};
|
|
47
|
+
rowStateCache.set(row.id, state);
|
|
48
|
+
return state;
|
|
38
49
|
};
|
|
39
|
-
|
|
50
|
+
// Clear cache when expandedIds store is cleared (data reset scenario)
|
|
51
|
+
const unsubscribeExpandedIds = expandedIds.subscribe(($expandedIds) => {
|
|
52
|
+
if (Object.keys($expandedIds).length === 0) {
|
|
53
|
+
rowStateCache.clear();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
// Cleanup function to prevent subscription leaks when table is destroyed
|
|
57
|
+
const invalidate = () => {
|
|
58
|
+
unsubscribeExpandedIds();
|
|
59
|
+
rowStateCache.clear();
|
|
60
|
+
};
|
|
61
|
+
const pluginState = { expandedIds, getRowState, invalidate };
|
|
40
62
|
const deriveRows = (rows) => {
|
|
41
63
|
return derived([rows, expandedIds], ([$rows, $expandedIds]) => {
|
|
42
64
|
return $rows.flatMap((row) => {
|
|
@@ -13,6 +13,8 @@ export interface SelectedRowsState<Item> {
|
|
|
13
13
|
allPageRowsSelected: Writable<boolean>;
|
|
14
14
|
somePageRowsSelected: Readable<boolean>;
|
|
15
15
|
getRowState: (row: BodyRow<Item>) => SelectedRowsRowState;
|
|
16
|
+
/** Cleans up internal subscriptions and clears the row state cache. Call when destroying the table. */
|
|
17
|
+
invalidate: () => void;
|
|
16
18
|
}
|
|
17
19
|
export interface SelectedRowsRowState {
|
|
18
20
|
isSelected: Writable<boolean>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { MemoryCache } from '@humanspeak/memory-cache';
|
|
1
2
|
import { derived, get } from 'svelte/store';
|
|
2
3
|
import { nonNull } from '../utils/filter.js';
|
|
3
4
|
import { recordSetStore } from '../utils/store.js';
|
|
5
|
+
import { DEFAULT_ROW_STATE_CACHE_CONFIG } from './cacheConfig.js';
|
|
4
6
|
const isAllSubRowsSelectedForRow = (row, $selectedDataIds, linkDataSubRows) => {
|
|
5
7
|
if (row.isData()) {
|
|
6
8
|
if (!linkDataSubRows || row.subRows === undefined) {
|
|
@@ -69,7 +71,14 @@ const getRowIsSelectedStore = (row, selectedDataIds, linkDataSubRows) => {
|
|
|
69
71
|
};
|
|
70
72
|
export const addSelectedRows = ({ initialSelectedDataIds = {}, linkDataSubRows = true } = {}) => ({ tableState }) => {
|
|
71
73
|
const selectedDataIds = recordSetStore(initialSelectedDataIds);
|
|
74
|
+
// LRU cache for memoized row state with automatic eviction.
|
|
75
|
+
// Prevents unbounded memory growth when row identities change.
|
|
76
|
+
const rowStateCache = new MemoryCache(DEFAULT_ROW_STATE_CACHE_CONFIG);
|
|
72
77
|
const getRowState = (row) => {
|
|
78
|
+
const cached = rowStateCache.get(row.id);
|
|
79
|
+
if (cached !== undefined) {
|
|
80
|
+
return cached;
|
|
81
|
+
}
|
|
73
82
|
const isSelected = getRowIsSelectedStore(row, selectedDataIds, linkDataSubRows);
|
|
74
83
|
const isSomeSubRowsSelected = derived([isSelected, selectedDataIds], ([$isSelected, $selectedDataIds]) => {
|
|
75
84
|
if ($isSelected)
|
|
@@ -79,11 +88,24 @@ export const addSelectedRows = ({ initialSelectedDataIds = {}, linkDataSubRows =
|
|
|
79
88
|
const isAllSubRowsSelected = derived(selectedDataIds, ($selectedDataIds) => {
|
|
80
89
|
return isAllSubRowsSelectedForRow(row, $selectedDataIds, linkDataSubRows);
|
|
81
90
|
});
|
|
82
|
-
|
|
91
|
+
const state = {
|
|
83
92
|
isSelected,
|
|
84
93
|
isSomeSubRowsSelected,
|
|
85
94
|
isAllSubRowsSelected
|
|
86
95
|
};
|
|
96
|
+
rowStateCache.set(row.id, state);
|
|
97
|
+
return state;
|
|
98
|
+
};
|
|
99
|
+
// Clear cache when selectedDataIds store is cleared (data reset scenario)
|
|
100
|
+
const unsubscribeSelectedDataIds = selectedDataIds.subscribe(($selectedDataIds) => {
|
|
101
|
+
if (Object.keys($selectedDataIds).length === 0) {
|
|
102
|
+
rowStateCache.clear();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// Cleanup function to prevent subscription leaks when table is destroyed
|
|
106
|
+
const invalidate = () => {
|
|
107
|
+
unsubscribeSelectedDataIds();
|
|
108
|
+
rowStateCache.clear();
|
|
87
109
|
};
|
|
88
110
|
// all rows
|
|
89
111
|
const _allRowsSelected = derived([tableState.rows, selectedDataIds], ([$rows, $selectedDataIds]) => {
|
|
@@ -165,7 +187,8 @@ export const addSelectedRows = ({ initialSelectedDataIds = {}, linkDataSubRows =
|
|
|
165
187
|
allRowsSelected,
|
|
166
188
|
someRowsSelected,
|
|
167
189
|
allPageRowsSelected,
|
|
168
|
-
somePageRowsSelected
|
|
190
|
+
somePageRowsSelected,
|
|
191
|
+
invalidate
|
|
169
192
|
};
|
|
170
193
|
return {
|
|
171
194
|
pluginState,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CacheOptions } from '@humanspeak/memory-cache';
|
|
2
|
+
/**
|
|
3
|
+
* Default configuration for row state LRU caches used by plugins.
|
|
4
|
+
* Provides automatic eviction to prevent unbounded memory growth
|
|
5
|
+
* when row identities change.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_ROW_STATE_CACHE_CONFIG: CacheOptions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default configuration for row state LRU caches used by plugins.
|
|
3
|
+
* Provides automatic eviction to prevent unbounded memory growth
|
|
4
|
+
* when row identities change.
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_ROW_STATE_CACHE_CONFIG = {
|
|
7
|
+
/** Maximum number of row state entries before LRU eviction */
|
|
8
|
+
maxSize: 1000,
|
|
9
|
+
/** Time-to-live in milliseconds (5 minutes) */
|
|
10
|
+
ttl: 5 * 60 * 1000
|
|
11
|
+
};
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './addColumnFilters
|
|
2
|
-
export * from './addColumnOrder
|
|
3
|
-
export * from './addDataExport
|
|
4
|
-
export * from './addExpandedRows
|
|
5
|
-
export * from './addFlatten
|
|
6
|
-
export * from './addGridLayout
|
|
7
|
-
export * from './addGroupBy
|
|
8
|
-
export * from './addHiddenColumns
|
|
9
|
-
export * from './addPagination
|
|
10
|
-
export * from './addResizedColumns
|
|
11
|
-
export * from './addSelectedRows
|
|
12
|
-
export * from './addSortBy
|
|
13
|
-
export * from './addSubRows
|
|
14
|
-
export * from './addTableFilter
|
|
15
|
-
export * from '../types/TablePlugin
|
|
1
|
+
export * from './addColumnFilters';
|
|
2
|
+
export * from './addColumnOrder';
|
|
3
|
+
export * from './addDataExport';
|
|
4
|
+
export * from './addExpandedRows';
|
|
5
|
+
export * from './addFlatten';
|
|
6
|
+
export * from './addGridLayout';
|
|
7
|
+
export * from './addGroupBy';
|
|
8
|
+
export * from './addHiddenColumns';
|
|
9
|
+
export * from './addPagination';
|
|
10
|
+
export * from './addResizedColumns';
|
|
11
|
+
export * from './addSelectedRows';
|
|
12
|
+
export * from './addSortBy';
|
|
13
|
+
export * from './addSubRows';
|
|
14
|
+
export * from './addTableFilter';
|
|
15
|
+
export * from '../types/TablePlugin';
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export * from './addColumnFilters
|
|
2
|
-
export * from './addColumnOrder
|
|
3
|
-
export * from './addDataExport
|
|
4
|
-
export * from './addExpandedRows
|
|
5
|
-
export * from './addFlatten
|
|
6
|
-
export * from './addGridLayout
|
|
7
|
-
export * from './addGroupBy
|
|
8
|
-
export * from './addHiddenColumns
|
|
9
|
-
export * from './addPagination
|
|
10
|
-
export * from './addResizedColumns
|
|
11
|
-
export * from './addSelectedRows
|
|
12
|
-
export * from './addSortBy
|
|
13
|
-
export * from './addSubRows
|
|
14
|
-
export * from './addTableFilter
|
|
1
|
+
export * from './addColumnFilters';
|
|
2
|
+
export * from './addColumnOrder';
|
|
3
|
+
export * from './addDataExport';
|
|
4
|
+
export * from './addExpandedRows';
|
|
5
|
+
export * from './addFlatten';
|
|
6
|
+
export * from './addGridLayout';
|
|
7
|
+
export * from './addGroupBy';
|
|
8
|
+
export * from './addHiddenColumns';
|
|
9
|
+
export * from './addPagination';
|
|
10
|
+
export * from './addResizedColumns';
|
|
11
|
+
export * from './addSelectedRows';
|
|
12
|
+
export * from './addSortBy';
|
|
13
|
+
export * from './addSubRows';
|
|
14
|
+
export * from './addTableFilter';
|
|
15
15
|
// plugin helper types
|
|
16
|
-
export * from '../types/TablePlugin
|
|
16
|
+
export * from '../types/TablePlugin';
|
package/dist/tableComponent.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Readable } from 'svelte/store';
|
|
2
1
|
import type { TableState } from './createViewModel.js';
|
|
3
2
|
import type { AnyPlugins, ComponentKeys, ElementHook, PluginTablePropSet } from './types/TablePlugin.js';
|
|
4
3
|
import type { Clonable } from './utils/clone.js';
|
|
4
|
+
import { type Readable } from 'svelte/store';
|
|
5
5
|
export interface TableComponentInit {
|
|
6
6
|
id: string;
|
|
7
7
|
}
|
package/dist/tableComponent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { finalizeAttributes, mergeAttributes } from './utils/attributes.js';
|
|
1
2
|
import { derivedKeys } from '@humanspeak/svelte-subscribe';
|
|
2
3
|
import { derived } from 'svelte/store';
|
|
3
|
-
import { finalizeAttributes, mergeAttributes } from './utils/attributes.js';
|
|
4
4
|
export class TableComponent {
|
|
5
5
|
id;
|
|
6
6
|
constructor({ id }) {
|
package/package.json
CHANGED
|
@@ -1,130 +1,135 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
2
|
+
"name": "@humanspeak/svelte-headless-table",
|
|
3
|
+
"version": "6.0.2",
|
|
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
|
+
"keywords": [
|
|
6
|
+
"svelte",
|
|
7
|
+
"table",
|
|
8
|
+
"datagrid",
|
|
9
|
+
"datatable",
|
|
10
|
+
"headless",
|
|
11
|
+
"plugin",
|
|
12
|
+
"sorting",
|
|
13
|
+
"filtering",
|
|
14
|
+
"ordering",
|
|
15
|
+
"hiding",
|
|
16
|
+
"grouping",
|
|
17
|
+
"selecting",
|
|
18
|
+
"expanding",
|
|
19
|
+
"data-table",
|
|
20
|
+
"data-grid",
|
|
21
|
+
"table-component",
|
|
22
|
+
"pagination",
|
|
23
|
+
"column-sorting",
|
|
24
|
+
"row-selection",
|
|
25
|
+
"typescript",
|
|
26
|
+
"sveltekit",
|
|
27
|
+
"customizable",
|
|
28
|
+
"accessible"
|
|
29
|
+
],
|
|
30
|
+
"homepage": "https://table.svelte.page",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/humanspeak/svelte-headless-table/issues"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+ssh://git@github.com/humanspeak/svelte-headless-table.git"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"author": "Humanspeak, Inc.",
|
|
40
|
+
"type": "module",
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"svelte": "./dist/index.js",
|
|
45
|
+
"default": "./dist/index.js"
|
|
33
46
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"author": "Humanspeak, Inc.",
|
|
40
|
-
"type": "module",
|
|
41
|
-
"exports": {
|
|
42
|
-
".": {
|
|
43
|
-
"types": "./dist/index.d.ts",
|
|
44
|
-
"svelte": "./dist/index.js",
|
|
45
|
-
"default": "./dist/index.js"
|
|
46
|
-
},
|
|
47
|
-
"./plugins": {
|
|
48
|
-
"types": "./dist/plugins/index.d.ts",
|
|
49
|
-
"svelte": "./dist/plugins/index.js",
|
|
50
|
-
"default": "./dist/plugins/index.js"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"svelte": "./dist/index.js",
|
|
54
|
-
"types": "./dist/index.d.ts",
|
|
55
|
-
"files": [
|
|
56
|
-
"dist",
|
|
57
|
-
"!dist/**/*.test.*",
|
|
58
|
-
"!dist/**/*.spec.*"
|
|
59
|
-
],
|
|
60
|
-
"scripts": {
|
|
61
|
-
"build": "vite build && npm run package",
|
|
62
|
-
"changeset": "npx @changesets/cli",
|
|
63
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
64
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
65
|
-
"dev": "vite dev",
|
|
66
|
-
"format": "prettier --write .",
|
|
67
|
-
"lint": "prettier --check . && eslint .",
|
|
68
|
-
"lint:fix": "npm run format && eslint . --fix",
|
|
69
|
-
"package": "svelte-kit sync && svelte-package && publint",
|
|
70
|
-
"prepublishOnly": "npm run package",
|
|
71
|
-
"preview": "vite preview",
|
|
72
|
-
"test": "vitest run --coverage",
|
|
73
|
-
"test:all": "npm run test && npm run test:e2e",
|
|
74
|
-
"test:e2e": "playwright test",
|
|
75
|
-
"test:e2e:debug": "playwright test --debug",
|
|
76
|
-
"test:e2e:report": "playwright show-report",
|
|
77
|
-
"test:e2e:ui": "playwright test --ui",
|
|
78
|
-
"test:only": "vitest run",
|
|
79
|
-
"test:unit": "vitest",
|
|
80
|
-
"test:unit:ui": "vitest --ui",
|
|
81
|
-
"test:watch": "vitest"
|
|
82
|
-
},
|
|
83
|
-
"dependencies": {
|
|
84
|
-
"@humanspeak/svelte-keyed": "^5.0.1",
|
|
85
|
-
"@humanspeak/svelte-render": "^5.1.1",
|
|
86
|
-
"@humanspeak/svelte-subscribe": "^5.0.0"
|
|
87
|
-
},
|
|
88
|
-
"devDependencies": {
|
|
89
|
-
"@eslint/compat": "^1.2.9",
|
|
90
|
-
"@eslint/js": "^9.27.0",
|
|
91
|
-
"@faker-js/faker": "^9.8.0",
|
|
92
|
-
"@playwright/test": "^1.52.0",
|
|
93
|
-
"@sveltejs/adapter-auto": "^6.0.1",
|
|
94
|
-
"@sveltejs/kit": "^2.21.0",
|
|
95
|
-
"@sveltejs/package": "^2.3.11",
|
|
96
|
-
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
97
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
98
|
-
"@testing-library/svelte": "^5.2.7",
|
|
99
|
-
"@types/eslint": "9.6.1",
|
|
100
|
-
"@types/node": "^22.15.18",
|
|
101
|
-
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
102
|
-
"@typescript-eslint/parser": "^8.32.1",
|
|
103
|
-
"@vitest/coverage-v8": "^3.1.3",
|
|
104
|
-
"eslint": "^9.27.0",
|
|
105
|
-
"eslint-config-prettier": "^10.1.5",
|
|
106
|
-
"eslint-plugin-import": "^2.31.0",
|
|
107
|
-
"eslint-plugin-svelte": "^3.8.1",
|
|
108
|
-
"eslint-plugin-unused-imports": "^4.1.4",
|
|
109
|
-
"globals": "^16.1.0",
|
|
110
|
-
"prettier": "^3.5.3",
|
|
111
|
-
"prettier-plugin-organize-imports": "^4.1.0",
|
|
112
|
-
"prettier-plugin-svelte": "^3.4.0",
|
|
113
|
-
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
114
|
-
"publint": "^0.3.12",
|
|
115
|
-
"svelte": "^5.30.2",
|
|
116
|
-
"svelte-check": "^4.2.1",
|
|
117
|
-
"tslib": "^2.8.1",
|
|
118
|
-
"type-fest": "^4.41.0",
|
|
119
|
-
"typescript": "^5.8.3",
|
|
120
|
-
"typescript-eslint": "^8.32.1",
|
|
121
|
-
"vite": "^6.3.5",
|
|
122
|
-
"vitest": "^3.1.3"
|
|
123
|
-
},
|
|
124
|
-
"peerDependencies": {
|
|
125
|
-
"svelte": "^5.30.0"
|
|
126
|
-
},
|
|
127
|
-
"volta": {
|
|
128
|
-
"node": "22.15.1"
|
|
47
|
+
"./plugins": {
|
|
48
|
+
"types": "./dist/plugins/index.d.ts",
|
|
49
|
+
"svelte": "./dist/plugins/index.js",
|
|
50
|
+
"default": "./dist/plugins/index.js"
|
|
129
51
|
}
|
|
130
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"svelte": "./dist/index.js",
|
|
54
|
+
"types": "./dist/index.d.ts",
|
|
55
|
+
"files": [
|
|
56
|
+
"dist",
|
|
57
|
+
"!dist/**/*.test.*",
|
|
58
|
+
"!dist/**/*.spec.*"
|
|
59
|
+
],
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@humanspeak/memory-cache": "^1.0.1",
|
|
62
|
+
"@humanspeak/svelte-keyed": "^5.0.1",
|
|
63
|
+
"@humanspeak/svelte-render": "^5.1.1",
|
|
64
|
+
"@humanspeak/svelte-subscribe": "^5.0.0"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@eslint/compat": "^2.0.0",
|
|
68
|
+
"@eslint/js": "^9.39.2",
|
|
69
|
+
"@faker-js/faker": "^10.1.0",
|
|
70
|
+
"@playwright/test": "^1.57.0",
|
|
71
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
72
|
+
"@sveltejs/kit": "^2.49.2",
|
|
73
|
+
"@sveltejs/package": "^2.5.7",
|
|
74
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
75
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
76
|
+
"@testing-library/svelte": "^5.3.1",
|
|
77
|
+
"@types/eslint": "9.6.1",
|
|
78
|
+
"@types/node": "^25.0.3",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
80
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
81
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
82
|
+
"concurrently": "^9.2.1",
|
|
83
|
+
"eslint": "^9.39.2",
|
|
84
|
+
"eslint-config-prettier": "10.1.8",
|
|
85
|
+
"eslint-plugin-import": "2.32.0",
|
|
86
|
+
"eslint-plugin-svelte": "3.13.1",
|
|
87
|
+
"eslint-plugin-unused-imports": "4.3.0",
|
|
88
|
+
"globals": "^16.5.0",
|
|
89
|
+
"husky": "^9.1.7",
|
|
90
|
+
"prettier": "^3.7.4",
|
|
91
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
92
|
+
"prettier-plugin-sort-json": "^4.1.1",
|
|
93
|
+
"prettier-plugin-svelte": "^3.4.1",
|
|
94
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
95
|
+
"publint": "^0.3.16",
|
|
96
|
+
"svelte": "^5.46.1",
|
|
97
|
+
"svelte-check": "^4.3.5",
|
|
98
|
+
"tslib": "^2.8.1",
|
|
99
|
+
"type-fest": "^5.3.1",
|
|
100
|
+
"typescript": "^5.9.3",
|
|
101
|
+
"typescript-eslint": "^8.51.0",
|
|
102
|
+
"vite": "^7.3.0",
|
|
103
|
+
"vitest": "^4.0.16"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"svelte": "^5.30.0"
|
|
107
|
+
},
|
|
108
|
+
"volta": {
|
|
109
|
+
"node": "22.21.1"
|
|
110
|
+
},
|
|
111
|
+
"scripts": {
|
|
112
|
+
"build": "vite build && npm run package",
|
|
113
|
+
"changeset": "npx @changesets/cli",
|
|
114
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
115
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
116
|
+
"dev": "vite dev",
|
|
117
|
+
"dev:all": "concurrently -k -n pkg,docs,sitemap -c green,cyan,magenta \"pnpm -w -r --filter @humanspeak/svelte-headless-table run dev:pkg\" \"pnpm --filter docs run dev\" \"pnpm --filter docs run sitemap:watch\"",
|
|
118
|
+
"dev:pkg": "svelte-kit sync && svelte-package --watch",
|
|
119
|
+
"format": "prettier --write .",
|
|
120
|
+
"lint": "prettier --check . && eslint .",
|
|
121
|
+
"lint:fix": "npm run format && eslint . --fix",
|
|
122
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
123
|
+
"preview": "vite preview",
|
|
124
|
+
"test": "vitest run --coverage",
|
|
125
|
+
"test:all": "npm run test && npm run test:e2e",
|
|
126
|
+
"test:e2e": "playwright test",
|
|
127
|
+
"test:e2e:debug": "playwright test --debug",
|
|
128
|
+
"test:e2e:report": "playwright show-report",
|
|
129
|
+
"test:e2e:ui": "playwright test --ui",
|
|
130
|
+
"test:only": "vitest run",
|
|
131
|
+
"test:unit": "vitest",
|
|
132
|
+
"test:unit:ui": "vitest --ui",
|
|
133
|
+
"test:watch": "vitest"
|
|
134
|
+
}
|
|
135
|
+
}
|