mirror of
https://github.com/ljcoder2015/obsidian-excel.git
synced 2026-07-22 08:30:28 +00:00
Compare commits
22 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9df140382 | ||
|
|
04dc273d80 | ||
|
|
5e149efaa7 | ||
|
|
583c46a828 | ||
|
|
5397aade29 | ||
|
|
82a6a7d1f9 | ||
|
|
56ca68dde1 | ||
|
|
5380c7a6e9 | ||
|
|
b018f956a7 | ||
|
|
ff08a53c06 | ||
|
|
05ea79123b | ||
|
|
2135848b38 | ||
|
|
8d2a44df50 | ||
|
|
34f35f9822 | ||
|
|
42cbe19ad0 | ||
|
|
6dc364519b | ||
|
|
9898398afc | ||
|
|
ae4426b24f | ||
|
|
0346ab7ca3 | ||
|
|
63c041ba05 | ||
|
|
a1c620d4e2 | ||
|
|
578a3388c6 |
13 changed files with 2345 additions and 498 deletions
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
|
|
@ -19,6 +19,7 @@ jobs:
|
|||
|
||||
- name: Build plugin
|
||||
run: |
|
||||
npm config set strict-ssl false
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
> ### The Obsidian-Excel plugin will no longer be maintained or updated. To download Obsidian-Sheet-Plus, please visit [https://github.com/ljcoder2015/obsidian-sheet-plus](https://github.com/ljcoder2015/obsidian-sheet-plus)
|
||||
> ### Obsidian-Excel插件不再更新维护,旧功能不满足可以尝试使用新插件Obsidian-Sheet-Plus。下载地址 [https://github.com/ljcoder2015/obsidian-sheet-plus](https://github.com/ljcoder2015/obsidian-sheet-plus)
|
||||
|
||||
# Obsidian Excel Plugin
|
||||
|
||||
## Excel
|
||||
|
|
@ -49,4 +52,7 @@ embed link rule:
|
|||
|
||||
- ljcoder@163.com
|
||||
|
||||
### buy a Coffee
|
||||
|
||||
[https://ko-fi.com/ljcoder](https://ko-fi.com/ljcoder)
|
||||
|
||||
|
|
|
|||
2
main.css
2
main.css
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,11 @@
|
|||
{
|
||||
"id": "excel",
|
||||
"name": "Excel",
|
||||
"version": "1.3.19",
|
||||
"version": "1.3.24",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Create spreadsheets and easily embed them in Markdown",
|
||||
"author": "ljcoder",
|
||||
"authorUrl": "https://github.com/ljcoder2015",
|
||||
"fundingUrl": "https://ko-fi.com/ljcoder",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
|
|
|
|||
2771
package-lock.json
generated
2771
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -28,7 +28,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"monkey-around": "^2.3.0",
|
||||
"x-data-spreadsheet": "git+ssh://git@github.com:ljcoder2015/x-spreadsheet.git#1.1.3",
|
||||
"x-data-spreadsheet": "git+ssh://git@github.com:ljcoder2015/x-spreadsheet.git#1.1.4",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.0/xlsx-0.20.0.tgz"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,32 @@ export class ExcelSettingTab extends PluginSettingTab {
|
|||
})
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName(t("DEFAULT_ROWS_LEN"))
|
||||
.setDesc(t("DEFAULT_ROWS_LEN_DESC"))
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("100")
|
||||
.setValue(this.plugin.settings.defaultRowsLen)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.defaultRowsLen = value
|
||||
this.plugin.saveSettings()
|
||||
})
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName(t("DEFAULT_COLS_LEN"))
|
||||
.setDesc(t("DEFAULT_COLS_LEN_DESC"))
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("26")
|
||||
.setValue(this.plugin.settings.defaultColsLen)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.defaultColsLen = value
|
||||
this.plugin.saveSettings()
|
||||
})
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName(t("SHOW_SHEET_BUTTON"))
|
||||
.setDesc(t("SHOW_SHEET_BUTTON_DESC"))
|
||||
|
|
|
|||
|
|
@ -102,8 +102,16 @@ export class ExcelView extends TextFileView {
|
|||
process_wb(wb: XLSX.WorkBook) {
|
||||
const sheetData = stox(wb);
|
||||
if (sheetData) {
|
||||
this.sheet.loadData(sheetData)
|
||||
sheetData.forEach((sheet) => {
|
||||
var sheetAny = sheet as any
|
||||
if (sheetAny.rows) {
|
||||
const last = Object.keys(sheetAny.rows).last() || "100"
|
||||
const max = parseInt(this.plugin.settings.defaultRowsLen)
|
||||
sheetAny.rows.len = Math.max(max, parseInt(last) + 20)
|
||||
}
|
||||
})
|
||||
this.saveData(JSON.stringify(sheetData))
|
||||
this.refresh()
|
||||
} else {
|
||||
new Notice(t("DATA_PARSING_ERROR"));
|
||||
}
|
||||
|
|
@ -241,11 +249,11 @@ export class ExcelView extends TextFileView {
|
|||
width: () => this.contentEl.clientWidth - 32,
|
||||
},
|
||||
row: {
|
||||
len: 100,
|
||||
len: parseInt(this.plugin.settings.defaultRowsLen),
|
||||
height: parseInt(this.plugin.settings.rowHeight),
|
||||
},
|
||||
col: {
|
||||
len: 26,
|
||||
len: parseInt(this.plugin.settings.defaultColsLen),
|
||||
width: parseInt(this.plugin.settings.colWidth),
|
||||
indexWidth: 60,
|
||||
minWidth: 60,
|
||||
|
|
|
|||
|
|
@ -375,11 +375,11 @@ const createSheetEl = (
|
|||
width: () => width - 10,
|
||||
},
|
||||
row: {
|
||||
len: 100,
|
||||
len: parseInt(plugin.settings.defaultRowsLen),
|
||||
height: parseInt(plugin.settings.rowHeight),
|
||||
},
|
||||
col: {
|
||||
len: 26,
|
||||
len: parseInt(plugin.settings.defaultColsLen),
|
||||
width: parseInt(plugin.settings.colWidth),
|
||||
indexWidth: 60,
|
||||
minWidth: 60,
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ export default {
|
|||
ROW_HEIGHT_DESC: "Default row height",
|
||||
COLUMN_WIDTH: "Column Width",
|
||||
COLUMN_WIDTH_DESC: "Default column width",
|
||||
DEFAULT_ROWS_LEN: 'Default render rows',
|
||||
DEFAULT_ROWS_LEN_DESC: 'Default number of render rows',
|
||||
DEFAULT_COLS_LEN: 'Default render columns',
|
||||
DEFAULT_COLS_LEN_DESC: 'Default number of rendered columns',
|
||||
SHOW_SHEET_BUTTON: "Show Sheet Button",
|
||||
SHOW_SHEET_BUTTON_DESC: "Show Sheet Button",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ export default {
|
|||
ROW_HEIGHT_DESC: "设置表格的默认行高",
|
||||
COLUMN_WIDTH: "列宽",
|
||||
COLUMN_WIDTH_DESC: "设置表格的默认列宽",
|
||||
DEFAULT_ROWS_LEN: '默认渲染行数',
|
||||
DEFAULT_ROWS_LEN_DESC: '创建表格时默认渲染最大行数',
|
||||
DEFAULT_COLS_LEN: '默认渲染列数',
|
||||
DEFAULT_COLS_LEN_DESC: '创建表格时默认渲染最大列数',
|
||||
SHOW_SHEET_BUTTON: "显示标题按钮",
|
||||
SHOW_SHEET_BUTTON_DESC: "是否显示标题按钮",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ export interface ExcelSettings {
|
|||
colWidth: string,
|
||||
theme: string,
|
||||
showSheetButton: string,
|
||||
defaultRowsLen: string,
|
||||
defaultColsLen: string,
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: ExcelSettings = {
|
||||
|
|
@ -18,4 +20,6 @@ export const DEFAULT_SETTINGS: ExcelSettings = {
|
|||
colWidth: "100",
|
||||
theme: "light",
|
||||
showSheetButton: "true",
|
||||
defaultRowsLen: "100",
|
||||
defaultColsLen: "26",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
bottom: 0;
|
||||
z-index: 100;
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* Markdown 文档引入样式设置*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue