0.0.33 • Published 10 months ago
modern_spreadsheet v0.0.33
Modern Spreadsheet
Features:
- High performance spreadsheet based on CanvasAPI.
- TypeScript supported
- Native scrolling
- Customizable
- Copy & Paste support
Basic usage
import Spreadsheet from "modern_spreadsheet";
import "modern_spreadsheet/style.css"; // <= this is required
const target = document.getElementById("spreadsheet");
const sheet = new Spreadsheet(target);
//...
Save and load data
function saveData() {
const serialized = sheet.serializeData();
localStorage.setItem("sheet_data", JSON.stringify(serialized));
}
function loadData() {
const data = localStorage.getItem("sheet_data");
const json = JSON.parse(data);
if (!json) return;
sheet.loadData(json);
}
Supported events
- onCellClick
- onSelectionChange
- onCellChange
- onCopy
Using events examples
import Spreadsheet, { SpreadsheetConstructorProperties } from "./main";
const options: SpreadsheetConstructorProperties = {
onCellClick: (event, cell) => {
console.log("Cell click", event, cell);
},
onSelectionChange: (selection) => {
console.log("Changed selection: ", selection);
},
onCellChange = (cell) => {
console.log("Cell changed: ", cell);
},
onCopy: (range, data, dataAsString) => {
console.log("Copy event: ", range, data, dataAsString)
}
};
const sheet = new Spreadsheet("#spreadsheet", options);
Roadmap
Rows number and columns heading renderCustom event functions (ex.: onSelectionChange, onCellEdit...). Full list of supported events will available on this pageCopy & Paste support- Rows and columns resizing
- Toolbar
- Context menu
- Formulas support
- Selected cell depends cells highlight
- Async formulas support
- Mutlisheets (?)
0.0.33
10 months ago
0.0.32
10 months ago
0.0.31
10 months ago
0.0.30
10 months ago
0.0.29
10 months ago
0.0.28
10 months ago
0.0.27
10 months ago
0.0.26
10 months ago
0.0.25
10 months ago
0.0.24
10 months ago
0.0.23
10 months ago
0.0.22
10 months ago
0.0.21
10 months ago
0.0.20
10 months ago
0.0.19
10 months ago
0.0.18
10 months ago
0.0.17
10 months ago
0.0.16
10 months ago
0.0.15
10 months ago
0.0.14
10 months ago
0.0.13
10 months ago
0.0.12
10 months ago
0.0.11
10 months ago
0.0.1
10 months ago