svelte-tably 1.0.0-next.8 → 1.0.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.
@@ -1,154 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- export interface TableState<T extends Record<PropertyKey, any> = Record<PropertyKey, any>> {
3
- columns: Record<string, TColumn<T, unknown>>;
4
- panels: Record<string, TPanel<T>>;
5
- selected: T[] | null;
6
- sortby?: string;
7
- positions: {
8
- sticky: string[];
9
- scroll: string[];
10
- hidden: string[];
11
- toggle(key: string): void;
12
- };
13
- readonly resizeable: boolean;
14
- readonly data: T[];
15
- /** Rows become anchors */
16
- readonly href?: (item: T) => string;
17
- addColumn(key: string, options: TColumn<T, unknown>): void;
18
- removeColumn(key: string): void;
19
- }
20
- export declare function getTableState<T extends Record<PropertyKey, any> = Record<PropertyKey, any>>(): TableState<T>;
21
- export type HeaderSelectCtx<T = any> = {
22
- isSelected: boolean;
23
- /** The list of selected items */
24
- readonly selected: T[];
25
- /**
26
- * See [MDN :indeterminate](https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate)
27
- */
28
- readonly indeterminate: boolean;
29
- };
30
- export type RowSelectCtx<T = any> = {
31
- readonly item: T;
32
- readonly row: RowCtx<unknown>;
33
- data: T[];
34
- isSelected: boolean;
35
- };
36
- import { type Snippet } from 'svelte';
37
- import Column, { type RowCtx, type Column as TColumn } from './Column.svelte';
38
- import Panel, { type Panel as TPanel } from './Panel.svelte';
39
- declare class __sveltets_Render<T extends Record<PropertyKey, unknown>> {
40
- props(): {
41
- content: Snippet<[context: {
42
- Column: {
43
- (internal: unknown, props: {
44
- header?: Column<T_1, V>["header"];
45
- row: Column<T_1, V>["row"];
46
- statusbar?: Column<T_1, V>["statusbar"];
47
- id: string;
48
- sticky?: boolean;
49
- fixed?: boolean;
50
- sort?: boolean;
51
- show?: boolean;
52
- width?: number;
53
- value?: Column<T_1, V>["options"]["value"];
54
- sorting?: Column<T_1, V>["options"]["sorting"];
55
- resizeable?: boolean;
56
- table?: TableState;
57
- }): {};
58
- new (options: import("svelte").ComponentConstructorOptions<{
59
- header?: Column<T_1, V>["header"];
60
- row: Column<T_1, V>["row"];
61
- statusbar?: Column<T_1, V>["statusbar"];
62
- id: string;
63
- sticky?: boolean;
64
- fixed?: boolean;
65
- sort?: boolean;
66
- show?: boolean;
67
- width?: number;
68
- value?: Column<T_1, V>["options"]["value"];
69
- sorting?: Column<T_1, V>["options"]["sorting"];
70
- resizeable?: boolean;
71
- table?: TableState;
72
- }>): SvelteComponent<{
73
- header?: Column<T_1, V>["header"];
74
- row: Column<T_1, V>["row"];
75
- statusbar?: Column<T_1, V>["statusbar"];
76
- id: string;
77
- sticky?: boolean;
78
- fixed?: boolean;
79
- sort?: boolean;
80
- show?: boolean;
81
- width?: number;
82
- value?: Column<T_1, V>["options"]["value"];
83
- sorting?: Column<T_1, V>["options"]["sorting"];
84
- resizeable?: boolean;
85
- table?: TableState;
86
- }, {}, {}> & {
87
- $$bindings?: ReturnType<() => "">;
88
- };
89
- z_$$bindings?: ReturnType<() => "">;
90
- };
91
- Panel: typeof Panel;
92
- readonly table: TableState<T>;
93
- readonly data: T[];
94
- }]>;
95
- panel?: string;
96
- data?: T[] | undefined;
97
- id?: string;
98
- href?: ((item: T) => string) | undefined;
99
- /**
100
- * Can you change the width of the columns?
101
- * @default true
102
- */
103
- resizeable?: boolean;
104
- selected?: T[] | undefined;
105
- select?: boolean | {
106
- /**
107
- * The style, in which the selection is shown
108
- *
109
- * NOTE: If using `edge` | 'side', "show" will always be `hover`. This is due to
110
- * an inconsistency/limitation of matching the scroll between the selection div and the rows.
111
- *
112
- * @default 'column'
113
- */
114
- style?: "column";
115
- /**
116
- * When to show the row-select, when not selected?
117
- * @default 'hover'
118
- */
119
- show?: "hover" | "always" | "never";
120
- /**
121
- * Custom snippet
122
- */
123
- headerSnippet?: Snippet<[context: HeaderSelectCtx]>;
124
- rowSnippet?: Snippet<[context: RowSelectCtx<T>]> | undefined;
125
- } | undefined;
126
- };
127
- events(): {};
128
- slots(): {};
129
- bindings(): "selected" | "panel";
130
- exports(): {
131
- selected: T[];
132
- positions: TableState<T_1>["positions"];
133
- data: T[];
134
- href: ((item: T) => string) | undefined;
135
- columns: Record<string, TColumn<T, unknown>>;
136
- };
137
- }
138
- interface $$IsomorphicComponent {
139
- new <T extends Record<PropertyKey, unknown>>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
140
- $$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
141
- } & ReturnType<__sveltets_Render<T>['exports']>;
142
- <T extends Record<PropertyKey, unknown>>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
143
- z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
144
- }
145
- /**
146
- * This is a description, \
147
- * on how to use this.
148
- *
149
- * @example
150
- * <Component />
151
- */
152
- declare const Table: $$IsomorphicComponent;
153
- type Table<T extends Record<PropertyKey, unknown>> = InstanceType<typeof Table<T>>;
154
- export default Table;