mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
fix: fixing renaming and deleting columns
This commit is contained in:
parent
54e89ccf3b
commit
a95a1bd6f9
3 changed files with 1285 additions and 1171 deletions
38
package.json
38
package.json
|
|
@ -26,36 +26,36 @@
|
|||
"@types/esprima": "^4.0.6",
|
||||
"@types/estraverse": "^5.1.7",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/lodash": "^4.17.13",
|
||||
"@types/node": "^22.9.3",
|
||||
"@types/lodash": "^4.17.16",
|
||||
"@types/node": "^22.15.12",
|
||||
"@types/papaparse": "^5.3.15",
|
||||
"@types/sql.js": "^1.4.9",
|
||||
"@typescript-eslint/eslint-plugin": "8.15.0",
|
||||
"@typescript-eslint/parser": "8.15.0",
|
||||
"builtin-modules": "4.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.32.0",
|
||||
"@typescript-eslint/parser": "8.32.0",
|
||||
"builtin-modules": "5.0.0",
|
||||
"electron-rebuild": "^3.2.9",
|
||||
"esbuild": "0.24.0",
|
||||
"esbuild": "0.25.4",
|
||||
"esbuild-plugin-replace": "^1.4.0",
|
||||
"jest": "^29.7.0",
|
||||
"obsidian": "^1.7.2",
|
||||
"prettier": "3.3.3",
|
||||
"ts-jest": "^29.2.5",
|
||||
"obsidian": "^1.8.7",
|
||||
"prettier": "3.5.3",
|
||||
"ts-jest": "^29.3.2",
|
||||
"tslib": "2.8.1",
|
||||
"typescript": "5.7.2",
|
||||
"vitepress": "^1.5.0",
|
||||
"typescript": "5.8.3",
|
||||
"vitepress": "^1.6.3",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ag-grid-community/theming": "^32.3.3",
|
||||
"@codemirror/language": "^6.10.8",
|
||||
"@codemirror/state": "^6.5.1",
|
||||
"@codemirror/view": "^6.36.2",
|
||||
"@ag-grid-community/theming": "^32.3.5",
|
||||
"@codemirror/language": "^6.11.0",
|
||||
"@codemirror/state": "^6.5.2",
|
||||
"@codemirror/view": "^6.36.7",
|
||||
"@hypersphere/omnibus": "^0.1.6",
|
||||
"@jlongster/sql.js": "^1.6.7",
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@vanakat/plugin-api": "^0.2.1",
|
||||
"absurd-sql": "^0.0.54",
|
||||
"ag-grid-community": "^32.3.3",
|
||||
"ag-grid-community": "^33.2.4",
|
||||
"comlink": "^4.4.2",
|
||||
"esbuild-plugin-polyfill-node": "^0.3.0",
|
||||
"esprima": "^4.0.1",
|
||||
|
|
@ -66,10 +66,10 @@
|
|||
"lodash": "^4.17.21",
|
||||
"markdown-table-ts": "^1.0.3",
|
||||
"ohm-js": "^17.1.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"sql-parser-cst": "^0.32.0",
|
||||
"papaparse": "^5.5.2",
|
||||
"sql-parser-cst": "^0.33.1",
|
||||
"unidecode": "^1.1.0",
|
||||
"util": "^0.12.5",
|
||||
"uuid": "^11.0.4"
|
||||
"uuid": "^11.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2403
pnpm-lock.yaml
2403
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -135,6 +135,7 @@ export class CSVView extends TextFileView {
|
|||
api: any = null;
|
||||
|
||||
loadDataIntoGrid() {
|
||||
console.log('Load data into grid')
|
||||
setTimeout(() => {
|
||||
|
||||
const result = parse(this.content, {
|
||||
|
|
@ -145,6 +146,7 @@ export class CSVView extends TextFileView {
|
|||
...d,
|
||||
__index: i.toString()
|
||||
}))
|
||||
console.log('DATA', data)
|
||||
this.result = {
|
||||
data: data,
|
||||
fields: result.meta.fields
|
||||
|
|
@ -219,7 +221,10 @@ export class CSVView extends TextFileView {
|
|||
item.setTitle('Rename Column')
|
||||
item.onClick(() => {
|
||||
const modal = new RenameColumnModal(csvView.app, (res) => {
|
||||
csvView.renameColumn(this.column.colId, res)
|
||||
console.log('RENAME', this.column, res)
|
||||
console.log('fff', csvView.result.fields)
|
||||
csvView.renameColumn(
|
||||
this.column.userProvidedColDef.headerName, res)
|
||||
})
|
||||
modal.open()
|
||||
})
|
||||
|
|
@ -228,9 +233,9 @@ export class CSVView extends TextFileView {
|
|||
menu.addItem(item => {
|
||||
item.setTitle('Delete Column')
|
||||
item.onClick(() => {
|
||||
this.column.colId
|
||||
const modal = new DeleteConfirmationModal(csvView.app, `column ${this.column.colId}`, () => {
|
||||
csvView.deleteColumn(this.column.colId)
|
||||
const colName = this.column.userProvidedColDef.headerName
|
||||
const modal = new DeleteConfirmationModal(csvView.app, `column ${colName}`, () => {
|
||||
csvView.deleteColumn(colName)
|
||||
})
|
||||
modal.open()
|
||||
})
|
||||
|
|
@ -254,7 +259,7 @@ export class CSVView extends TextFileView {
|
|||
if (!columnName) {
|
||||
return
|
||||
}
|
||||
csvView.moveColumn(columnName?.field!, e.toIndex!)
|
||||
csvView.moveColumn(columnName?.headerName!, e.toIndex!)
|
||||
},
|
||||
domLayout: 'normal',
|
||||
getRowId: (p) => p.data.__index,
|
||||
|
|
|
|||
Loading…
Reference in a new issue