$ show laichuangwen/e-virt-table
e-virt-table is a high-performance, canvas-based virtual data table library designed for building spreadsheet-like grids in web applications. It renders tens of thousands of rows and columns using a custom canvas drawing engine with virtual scrolling, fixed columns, cell editing, selection, autofill, copy/paste, sorting, filtering, tree data, cell merging, and undo/redo. The library is framework-agnostic (usable in plain JS, Vue 2/3, and React) and is distributed as an npm package with UMD/ESM/CJS formats. Its architecture follows a modular event-driven pattern: a central Context class manages state and communication between subsystems (Selector, Editor, Database, Scroller, History, Validator, FinderBar, etc.), while a Paint module abstracts canvas drawing operations. The configuration surface is extensive (~100 options via CSS variables and a Config object), enabling deep customization of appearance and behavior. The repository also includes a bilingual VitePress documentation site with hundreds of interactive examples, as well as a dev playground and a suite of system-level tests for border rendering and scrollbar modes.
The LLM identified 6 files worth highlighting for reuse:
A generic publish-subscribe event system providing type-safe event emission and listener management. It is self-contained and could be extracted for any JavaScript/TypeScript project requiring decoupled communication.
Canvas drawing abstraction that wraps text layout, rectangle drawing, shadow rendering, and icon placement with caching for performance. Separates rendering logic from data logic and is reusable for any canvas-based UI.
Lightweight internationalization module with fallback support and parameter interpolation. Provides a `useLocale()` method to switch languages at runtime and can be adopted directly in other projects needing i18n.
A collection of pure functions for tree data manipulation: finding descendants, moving nodes, building indices, and handling lazy loading. Decoupled from the table rendering, it can be reused in any tree-based component.
Rule-based validation engine that supports synchronous and asynchronous validators, per-column rules, and error message formatting. It is separated from UI concerns and could be reused as a general validation library.
Determines scrollbar visibility and behavior based on container and content sizes. A pure function module that can be tested and reused independently for any custom scrollbar implementation.