Utilities for TypeScript and Svelte
npm install k5kitUtilities for TypeScript and Svelte
Virtual grid + KSelection usage example
Features:
- Renders rows as HTML elements directly instead of using a JS framework (for better scroll performance)
- Rows can be dynamically loaded
- Columns can have fixed and percentage widths
Virtual grid + KSelection usage example
Features:
- Multi-selection
- Full OS-like mouse and keyboard support. Shift selection (with proper anchoring), Cmd/Ctrl selection, arrow keys, Alt/Option+ArrowKeys, Cmd/Ctrl+A, Esc to deselect, etc.
- Stays intact when rows are added or removed
- Easy to integrate with the virtual grid
Automatically snapshot Svelte form values for input, textarea and select elements.
The name attribute is used as the key. If you need to use a different key than the name attribute, you can alternatively specify it with the data-snapsho attribute.
Usage:
``svelte`
`js``
import { check_shortcut, check_modifiers } from 'k5kit'
check_shortcut(e, 'A') // 'A' with no modifiers pressed
check_shortcut(e, 'A', 'shift', 'alt', 'cmdOrCtrl')
check_modifiers(e) // Check that no modifiers are pressed (useful for mouse events)
check_modifiers(e, 'shift', 'alt', 'cmdOrCtrl')