WorkbookEditorElement
The
Extends
Section titled “Extends”HTMLElement
Properties
Section titled “Properties”| 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 |
- |
Methods
Section titled “Methods”addEventListener()
Section titled “addEventListener()”Call Signature
Section titled “Call Signature”addEventListener<K>( type, listener, options?): void;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends keyof WorkbookEditorEventMap |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type |
K |
listener |
(this, ev) => unknown |
options? |
boolean | AddEventListenerOptions |
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”HTMLElement.addEventListenerCall Signature
Section titled “Call Signature”addEventListener( type, listener, options?): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type |
string |
listener |
EventListenerOrEventListenerObject |
options? |
boolean | AddEventListenerOptions |
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”HTMLElement.addEventListenerdownloadCopy()
Section titled “downloadCopy()”downloadCopy(): Promise<void>;Downloads a copy as .xlsx without saving it to the host.
Returns
Section titled “Returns”Promise<void>
downloadCsv()
Section titled “downloadCsv()”downloadCsv(options?): Promise<void>;Downloads the sheet shown as a CSV file, with values that would run as formulas escaped unless escapeFormulas is false.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CsvOptions |
Returns
Section titled “Returns”Promise<void>
getCsv()
Section titled “getCsv()”getCsv(options?): Promise<string | undefined>;The sheet shown as CSV text; undefined when it isn’t a worksheet.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
CsvOptions |
Returns
Section titled “Returns”Promise<string | undefined>
getWorkbook()
Section titled “getWorkbook()”getWorkbook(): Promise< | SavedWorkbook| undefined>;The workbook as it is now, as a save would hand it over, without the save checks.
Returns
Section titled “Returns”Promise<
| SavedWorkbook
| undefined>
goTo()
Section titled “goTo()”goTo(ref): void;Selects a cell or range, such as “B4” or “Prices!A1:C3”, and shows it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
ref |
string |
Returns
Section titled “Returns”void
open()
Section titled “open()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bytes |
ArrayBuffer | Uint8Array<ArrayBufferLike> |
fileName |
string |
Returns
Section titled “Returns”Promise<boolean>
registerSchema()
Section titled “registerSchema()”registerSchema(schema): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
schema |
WorkbookSchema |
Returns
Section titled “Returns”void
removeEventListener()
Section titled “removeEventListener()”Call Signature
Section titled “Call Signature”removeEventListener<K>( type, listener, options?): void;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
K extends keyof WorkbookEditorEventMap |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type |
K |
listener |
(this, ev) => unknown |
options? |
boolean | EventListenerOptions |
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”HTMLElement.removeEventListenerCall Signature
Section titled “Call Signature”removeEventListener( type, listener, options?): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
type |
string |
listener |
EventListenerOrEventListenerObject |
options? |
boolean | EventListenerOptions |
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”HTMLElement.removeEventListenerremoveSchema()
Section titled “removeSchema()”removeSchema(id): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
Returns
Section titled “Returns”void
save()
Section titled “save()”save(): Promise<SaveResult>;Runs the save flow (schema checks, then the save event or a download), resolving with what happened.
Returns
Section titled “Returns”Promise<SaveResult>
setCustomLists()
Section titled “setCustomLists()”setCustomLists(lists): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
lists |
string[][] | undefined |
Returns
Section titled “Returns”void
setLanguage()
Section titled “setLanguage()”setLanguage(language): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
language |
string |
Returns
Section titled “Returns”void
setTheme()
Section titled “setTheme()”setTheme(theme): void;Parameters
Section titled “Parameters”| 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 |
Returns
Section titled “Returns”void
setUser()
Section titled “setUser()”setUser(user): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
user |
string | undefined |
Returns
Section titled “Returns”void