mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
chore: typecheck update
This commit is contained in:
parent
759099e4d0
commit
b6c9f6a513
4 changed files with 4 additions and 6 deletions
|
|
@ -57,7 +57,7 @@ export class ListRenderer implements RendererConfig {
|
|||
text: createEl('span', { text: c, cls: 'sqlseal-column-name' }) as any, // FIXME: this should be properly typed
|
||||
cls: singleCol ? ['sqlseal-list-element', 'sqlseal-list-element-single'] : ['sqlseal-list-element-single']
|
||||
})
|
||||
const val: any = cellParser.render(d[c])
|
||||
const val: any = cellParser!.render(d[c])
|
||||
el.append(val)
|
||||
el.dataset.sqlsealColumn = c
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { RendererConfig, RendererContext } from "../renderer/rendererRegistry";
|
|||
import { displayError } from "../utils/ui";
|
||||
import { ViewDefinition } from "../grammar/parser";
|
||||
import { ParseResults } from "../cellParser/parseResults";
|
||||
import { ModernCellParser } from "../cellParser/ModernCellParser";
|
||||
|
||||
const mapDataFromHeaders = (columns: string[], data: Record<string, any>[]) => {
|
||||
return data.map(d => columns.map(c => String(d[c])))
|
||||
|
|
@ -31,7 +30,7 @@ export class MarkdownRenderer implements RendererConfig {
|
|||
}
|
||||
|
||||
render(config: ReturnType<typeof this.validateConfig>, el: HTMLElement, { cellParser } : RendererContext) {
|
||||
const parseResult = new ParseResults(cellParser)
|
||||
const parseResult = new ParseResults(cellParser!)
|
||||
return {
|
||||
render: ({ columns, data }: any) => {
|
||||
const tab = getMarkdownTable({
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { App } from "obsidian";
|
|||
import { RendererConfig, RendererContext } from "../renderer/rendererRegistry";
|
||||
import { displayError } from "../utils/ui";
|
||||
import { ViewDefinition } from "../grammar/parser";
|
||||
import { ModernCellParser } from "../cellParser/ModernCellParser";
|
||||
|
||||
interface HTMLRendererConfig {
|
||||
classNames: string[]
|
||||
|
|
@ -73,7 +72,7 @@ export class TableRenderer implements RendererConfig {
|
|||
data.forEach((d: any) => {
|
||||
const row = body.createEl("tr")
|
||||
columns.forEach((c: any) => {
|
||||
const parsed = cellParser.render(d[c]) as string
|
||||
const parsed = cellParser!.render(d[c]) as string
|
||||
if (adjustLayout) {
|
||||
const td = row.createEl("td")
|
||||
td.createSpan({ text: parsed })
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export class TemplateRenderer implements RendererConfig {
|
|||
render: ({ columns, data, frontmatter }: any) => {
|
||||
el.empty()
|
||||
|
||||
const parser = new ParseResults(cellParser, (el) => new Handlebars.SafeString(el.outerHTML))
|
||||
const parser = new ParseResults(cellParser!, (el) => new Handlebars.SafeString(el.outerHTML))
|
||||
|
||||
// Seems to be the only way to render handlebars into DOM. Don't like it but what can we do.
|
||||
el.innerHTML = config.template({
|
||||
|
|
|
|||
Loading…
Reference in a new issue