mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
feat: do not nest lists with a single column of data
This commit is contained in:
parent
77a4f7109e
commit
5ae775b6b5
1 changed files with 4 additions and 3 deletions
|
|
@ -51,11 +51,12 @@ export class ListRenderer implements RendererConfig {
|
|||
})
|
||||
|
||||
data.forEach((d: any) => {
|
||||
const row = list.createEl("li", { cls: ['sqlseal-list-element'] }).createEl('ul')
|
||||
const singleCol = columns.length == 1; // Only one column, do not nest lists
|
||||
const row = singleCol ? list : list.createEl("li", { cls: ['sqlseal-list-element'] }).createEl('ul')
|
||||
columns.forEach((c: any) => {
|
||||
const el = row.createEl("li", {
|
||||
text: createEl('span', { text: c, cls: 'sqlseal-column-name' }) as any, // FIXME: this should be properly typed
|
||||
cls: ['sqlseal-list-element-single']
|
||||
cls: singleCol ? ['sqlseal-list-element', 'sqlseal-list-element-single'] : ['sqlseal-list-element-single']
|
||||
})
|
||||
const val = this.cellParser.render(d[c])
|
||||
el.append(val)
|
||||
|
|
@ -68,4 +69,4 @@ export class ListRenderer implements RendererConfig {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue