Skip to content

WorkbookEditorElement

The element: what hosts can set, call and listen to.

  • HTMLElement
Property Modifier Type Description
editedCount readonly number -
fileName readonly string -
options public EditorOptions Editor options. Changing the theme, language, user or schemas of a connected element applies them as it is; changing anything else re-creates the editor, closing the workbook.
status readonly "error" | "empty" | "loading" | "ready" -
unsaved readonly boolean -
addEventListener<K>(
type,
listener,
options?
): void;
Type Parameter
K extends keyof WorkbookEditorEventMap
Parameter Type
type K
listener (this, ev) => unknown
options? boolean | AddEventListenerOptions

void

HTMLElement.addEventListener
addEventListener(
type,
listener,
options?
): void;
Parameter Type
type string
listener EventListenerOrEventListenerObject
options? boolean | AddEventListenerOptions

void

HTMLElement.addEventListener

downloadCopy(): Promise<void>;

Downloads a copy as .xlsx without saving it to the host.

Promise<void>


downloadCsv(options?): Promise<void>;

Downloads the sheet shown as a CSV file, with values that would run as formulas escaped unless escapeFormulas is false.

Parameter Type
options? CsvOptions

Promise<void>


getCsv(options?): Promise<string | undefined>;

The sheet shown as CSV text; undefined when it isn’t a worksheet.

Parameter Type
options? CsvOptions

Promise<string | undefined>


getWorkbook(): Promise<
| SavedWorkbook
| undefined>;

The workbook as it is now, as a save would hand it over, without the save checks.

Promise< | SavedWorkbook | undefined>


goTo(ref): void;

Selects a cell or range, such as “B4” or “Prices!A1:C3”, and shows it.

Parameter Type
ref string

void


open(bytes, fileName): Promise<boolean>;

Opens a workbook or CSV file: true once open, false when the user kept the one already open; rejects saying why it can’t.

Parameter Type
bytes ArrayBuffer | Uint8Array<ArrayBufferLike>
fileName string

Promise<boolean>


registerSchema(schema): void;
Parameter Type
schema WorkbookSchema

void


removeEventListener<K>(
type,
listener,
options?
): void;
Type Parameter
K extends keyof WorkbookEditorEventMap
Parameter Type
type K
listener (this, ev) => unknown
options? boolean | EventListenerOptions

void

HTMLElement.removeEventListener
removeEventListener(
type,
listener,
options?
): void;
Parameter Type
type string
listener EventListenerOrEventListenerObject
options? boolean | EventListenerOptions

void

HTMLElement.removeEventListener

removeSchema(id): void;
Parameter Type
id string

void


save(): Promise<SaveResult>;

Runs the save flow (schema checks, then the save event or a download), resolving with what happened.

Promise<SaveResult>


setCustomLists(lists): void;
Parameter Type
lists string[][] | undefined

void


setLanguage(language): void;
Parameter Type
language string

void


setTheme(theme): void;
Parameter Type
theme | Partial<Record< | "warning" | "text" | "colorScheme" | "accent" | "accentStrong" | "accentSoft" | "accentBorder" | "accentTint" | "onAccent" | "surface" | "surfaceAlt" | "surfaceSunken" | "backdrop" | "focusRing" | "textMuted" | "textSubtle" | "border" | "borderStrong" | "neutral" | "success" | "successSoft" | "successBorder" | "successText" | "warningSoft" | "warningBorder" | "warningText" | "warningAccent" | "danger" | "dangerSoft" | "dangerBorder" | "onDanger" | "infoSoft" | "infoText" | "infoAccent" | "infoBannerBg" | "infoBannerBorder" | "infoBannerText" | "fieldSoft" | "fieldText" | "noteSoft" | "noteText" | "noteBorder" | "noteTipBg" | "noteTipBorder" | "placeholderBg" | "placeholderBorder" | "placeholderText" | "placeholderTextMuted" | "dropzoneBorder" | "dropzoneHoverBg" | "gridBg" | "gridText" | "gridTextOnFill" | "gridLine" | "gridBorderAuto" | "gridFreezeLine" | "gridHeaderBg" | "gridHeaderText" | "gridHeaderLine" | "gridHeaderHoverBg" | "gridHeaderSelectedBg" | "gridHeaderSelectedText" | "gridRowHeaderText" | "gridTextMuted" | "gridTextLight" | "gridBgAlt" | "gridCutFill" | "gridSelection" | "gridSelectionFill" | "gridEditedFill" | "gridEditedMark" | "gridLockedFill" | "gridLabelFill" | "gridErrorMark" | "gridWarningMark" | "gridPendingMark" | "gridNoteMark" | "gridStaleMark" | "gridUnsupportedMark" | "gridSpillLine" | "gridDropdownArrow" | "gridLink" | "gridFont" | "gridHeaderFont" | "gridHeaderFontSize" | "gridHeaderFontWeight" | "formulaRef1" | "formulaRef2" | "formulaRef3" | "formulaRef4" | "formulaRef5" | "formulaRef6" | "formulaRef7" | "chartColors" | "font" | "fontMono" | "fontSize" | "fontSizeXs" | "fontSizeSm" | "fontSizeMd" | "fontSizeLg" | "fontSizeXl" | "iconStrokeWidth" | "radius" | "radiusSm" | "radiusLg" | "shadow" | "shadowSm", string>> | undefined

void


setUser(user): void;
Parameter Type
user string | undefined

void