svelte-tably 1.0.0-next.11 → 1.0.0-next.12
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/README.md +2 -2
- package/dist/column/Column.svelte +24 -0
- package/dist/column/Column.svelte.d.ts +24 -0
- package/dist/column/column.svelte.js +60 -0
- package/dist/conditional.svelte.d.ts +10 -0
- package/dist/conditional.svelte.js +26 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/panel/Panel.svelte +47 -0
- package/dist/{Panel.svelte.d.ts → panel/Panel.svelte.d.ts} +1 -19
- package/dist/panel/panel.svelte.js +19 -0
- package/dist/table/Table.svelte +746 -0
- package/dist/table/Table.svelte.d.ts +24 -0
- package/dist/table/data.svelte.d.ts +14 -0
- package/dist/table/data.svelte.js +81 -0
- package/dist/table/table.svelte.js +74 -0
- package/dist/table/virtualization.svelte.d.ts +14 -0
- package/dist/table/virtualization.svelte.js +86 -0
- package/dist/utility.svelte.d.ts +16 -0
- package/dist/utility.svelte.js +68 -0
- package/package.json +2 -2
- package/dist/Column.svelte +0 -174
- package/dist/Column.svelte.d.ts +0 -121
- package/dist/Panel.svelte +0 -74
- package/dist/Table.svelte +0 -977
- package/dist/Table.svelte.d.ts +0 -107
package/dist/Panel.svelte
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<!-- @component
|
|
2
|
-
|
|
3
|
-
This is a description, \
|
|
4
|
-
on how to use this.
|
|
5
|
-
|
|
6
|
-
@example
|
|
7
|
-
<Component />
|
|
8
|
-
|
|
9
|
-
-->
|
|
10
|
-
|
|
11
|
-
<script module lang='ts'>
|
|
12
|
-
|
|
13
|
-
export interface Panel<T extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>> {
|
|
14
|
-
/** A darkened backdrop? */
|
|
15
|
-
backdrop: boolean
|
|
16
|
-
content: Snippet<[context: { readonly table: TableState<T>, readonly data: T[] }]>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export class PanelTween {
|
|
20
|
-
#tween = new Tween(0, { duration: 300, easing: sineInOut })
|
|
21
|
-
current = $derived(this.#tween.current)
|
|
22
|
-
transitioning = $state(false)
|
|
23
|
-
|
|
24
|
-
/** bind:clientWidth */
|
|
25
|
-
width = $state(0)
|
|
26
|
-
|
|
27
|
-
set target(value: number) {
|
|
28
|
-
this.transitioning = true
|
|
29
|
-
this.#tween.set(value).then(() => this.transitioning = false)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
constructor(cb: () => string | undefined, added = 0) {
|
|
33
|
-
$effect.pre(() => {
|
|
34
|
-
this.target = cb() ? this.width + added : 0
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<script lang='ts' generics='T extends Record<PropertyKey, unknown>'>
|
|
42
|
-
|
|
43
|
-
import { onDestroy, type Snippet } from 'svelte'
|
|
44
|
-
import Table, { getTableState, type TableState } from './Table.svelte'
|
|
45
|
-
import { Tween } from 'svelte/motion'
|
|
46
|
-
import { sineInOut } from 'svelte/easing'
|
|
47
|
-
|
|
48
|
-
interface Props {
|
|
49
|
-
id: string
|
|
50
|
-
|
|
51
|
-
/** A darkened backdrop? */
|
|
52
|
-
backdrop?: boolean
|
|
53
|
-
children: Snippet<[context: { readonly table: TableState<T>, readonly data: T[] }]>
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
let {
|
|
57
|
-
backdrop = true,
|
|
58
|
-
children,
|
|
59
|
-
id
|
|
60
|
-
}: Props = $props()
|
|
61
|
-
|
|
62
|
-
const panel: Panel<T> = $state({
|
|
63
|
-
backdrop,
|
|
64
|
-
content: children
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
const table = getTableState()
|
|
68
|
-
table.panels[id] = panel
|
|
69
|
-
|
|
70
|
-
onDestroy(() => {
|
|
71
|
-
delete table.panels[id]
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
</script>
|