mirror of
https://github.com/h-sphere/sql-seal.git
synced 2026-07-22 10:10:28 +00:00
Merge pull request #141 from satkowski/fix-missing-number-handling
Fix: fixed the missing handling of numbers for renderer
This commit is contained in:
commit
7ed7934993
3 changed files with 6 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ export interface Result {
|
|||
onRunCallback?: OnRunCallback
|
||||
}
|
||||
|
||||
export type CellParserResult = Result | string | HTMLElement
|
||||
export type CellParserResult = Result | string | HTMLElement | number
|
||||
|
||||
export class ModernCellParser {
|
||||
|
||||
|
|
@ -84,6 +84,8 @@ export class ModernCellParser {
|
|||
const res = this.prepare(content)
|
||||
if (typeof res === 'string' || !res) {
|
||||
return res
|
||||
} else if (typeof res === 'number') {
|
||||
return res.toString()
|
||||
} else if (res instanceof HTMLElement) {
|
||||
return res
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class RenderContext {
|
|||
|
||||
render(context: string) {
|
||||
const res = this.cellParser.prepare(context)
|
||||
if (typeof res === 'string') {
|
||||
if (typeof res === 'string' || typeof res === 'number') {
|
||||
return res
|
||||
}
|
||||
if (res instanceof HTMLElement) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ export class ParseResults {
|
|||
}
|
||||
} else if (typeof data === 'string') {
|
||||
res[col] = data
|
||||
} else if (typeof data === 'number') {
|
||||
res[col] = data.toString()
|
||||
} else if (!data) {
|
||||
res[col] = ''
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue