feat: excel布局处理

This commit is contained in:
leijun 2023-08-18 18:27:21 +08:00
parent 4c0f5d96bc
commit 2c3dd57786
2 changed files with 1071 additions and 1067 deletions

View file

@ -22,18 +22,23 @@ export class ExcelView extends TextFileView {
setViewData(data: string, clear: boolean): void {
this.data = data;
this.containerEl.empty();
this.containerEl.createDiv({
this.contentEl.empty();
this.contentEl.createDiv({
attr: {
id: "x-spreadsheet"
// class: "sheet-box"
id: "x-spreadsheet",
class: "sheet-box",
},
});
console.log(this.ownerWindow, this.data);
console.log(this.ownerWindow.document.documentElement.clientWidth);
const jsonData = JSON.parse(this.data || "{}") || {}
//@ts-ignore
this.sheet = new Spreadsheet("#x-spreadsheet")
this.sheet = new Spreadsheet("#x-spreadsheet", {
view: {
height: () => this.contentEl.clientHeight,
width: () => this.contentEl.clientWidth,
},
})
.loadData(jsonData) // load data
.change(data => {
// save data to db

2121
styles.css

File diff suppressed because one or more lines are too long