Interface StandaloneWorkbookProps

interface StandaloneWorkbookProps {
    autoFocus?: boolean;
    autoFocusDisabled?: boolean;
    commands?: CommandMap;
    contextMenuProps?: WorkbookContextMenuProps;
    createWorkbookOptions?: IWorkbookModelOptions;
    errorPanel?: ComponentType<ErrorPanelProps>;
    forceLightImages?: boolean;
    formulaBarProps?: FormulaBarProps;
    gridTheme?: Theme;
    importExportDisabled?: boolean;
    loadingPanelProps?: LoadingPanelProps;
    logo?: ReactNode;
    model?: IWorkbookModel | Promise<IWorkbookModel>;
    notifier?: Notifier;
    onCommandsChange?: ((commands) => void);
    onElementLoad?: ((event) => void);
    onError?: ((error) => void);
    onModelChange?: ((model) => void);
    onRepeatCommandChange?: ((command) => void);
    onTitleChange?: ((title) => void);
    renderContextMenu?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderFormulaBar?: ((props, ref) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderLoadingPanel?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderSheet?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderStatusBar?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderTabs?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    renderToolbar?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>);
    sheetProps?: SheetProps;
    showFormulaBar?: boolean;
    showHorizontalScrollbar?: boolean;
    showStatusBar?: boolean;
    showTabs?: boolean;
    showVerticalScrollbar?: boolean;
    statusBarProps?: StatusBarProps;
    sx?: SxProps<Theme>;
    tabsProps?: WorkbookStripProps;
    themeOptions?: ThemeOptions;
    title?: string;
    titleProps?: WorkbookTitleProps;
    toolbarProps?: WorkbookToolbarsProps;
    undoManager?: UndoManager;
}

Hierarchy

Properties

autoFocus?: boolean

Will autofocus to the sheet.

Default Value

false
autoFocusDisabled?: boolean

Autofocus on load. If loading multiple workbooks or using an a secondary component this should be set to false.

Remarks

Default Value

false
commands?: CommandMap

Additional commands provided by application

contextMenuProps?: WorkbookContextMenuProps

Allow for customizations on context menu

createWorkbookOptions?: IWorkbookModelOptions

Options to use when a new WorkbookModel is created.

Remarks

This is ignored if the model is provided externally. The default behavior is to use the options from the current workbook if provided.

errorPanel?: ComponentType<ErrorPanelProps>

Allow for a custom error panel to be used for errors

Default Value

ErrorPanel
forceLightImages?: boolean

If dark theme then the images will invert unless true.

Default Value

false
formulaBarProps?: FormulaBarProps

Allow for customizations on FormulaBar

gridTheme?: Theme

Allow you to specify a specific material ui theme for the grid

Remarks

This is useful if you want to decorate the application with a single theme (such as dark mode). But render the main grid using a different theme (for example light mode).

Default Value

the current Theme
importExportDisabled?: boolean
loadingPanelProps?: LoadingPanelProps

Allow for customizations on loading panel

logo?: ReactNode
model?: IWorkbookModel | Promise<IWorkbookModel>
notifier?: Notifier

Configure the notifier to use for alerts

onCommandsChange?: ((commands) => void)

Notify that there is a new map of commands

Type declaration

    • (commands): void
    • Parameters

      Returns void

onElementLoad?: ((event) => void)

Callback for when the workbook is loaded. Useful for hiding/showing loading panels

Type declaration

onError?: ((error) => void)

Called if the workbook model is a promise that fails to load

Type declaration

    • (error): void
    • Parameters

      • error: any

      Returns void

onModelChange?: ((model) => void)

Called if the model changes

Type declaration

Returns

onRepeatCommandChange?: ((command) => void)

Notify that there is a new repeatable command

Type declaration

    • (command): void
    • Parameters

      Returns void

onTitleChange?: ((title) => void)

Call if the title changes

Type declaration

    • (title): void
    • Parameters

      • title: string

      Returns void

Returns

renderContextMenu?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Render custom context menu

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderFormulaBar?: ((props, ref) => ReactElement<any, string | JSXElementConstructor<any>>)

Render FormulaBar

Type declaration

    • (props, ref): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderLoadingPanel?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Render custom loading panel

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderSheet?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Render Sheet

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderStatusBar?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Pass in a custom toolbar

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderTabs?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Render custom tabs

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

renderToolbar?: ((props) => ReactElement<any, string | JSXElementConstructor<any>>)

Pass in a custom toolbar

Type declaration

    • (props): ReactElement<any, string | JSXElementConstructor<any>>
    • Parameters

      • props: WorkbookToolbarsProps

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Returns

sheetProps?: SheetProps

Allow for customizations on loading panel

showFormulaBar?: boolean

Default Value

'workbook model but can be overridden'
showHorizontalScrollbar?: boolean

Show the horizontal scrollbar

showStatusBar?: boolean

Shows the statusbar

Default Value

'workbook model but can be overridden'
showTabs?: boolean

This doesn't influence # of tabs just the visibility of the widget.

Default Value

'workbook model but can be overridden'
showVerticalScrollbar?: boolean

Show the vertical scrollbar

statusBarProps?: StatusBarProps

Customizations for the status bar

sx?: SxProps<Theme>

MUI SX props

tabsProps?: WorkbookStripProps

Allow for customizations on tabs

themeOptions?: ThemeOptions

Standalone workbook will inherit the theme unless this is explicitly set.

Remarks

If this is set then there are two additional options that can be provided onForceModeChange(mode: ThemeMode); onForceLightGridChange(force: boolean); onForceLightImagesChange(force: boolean);

title?: string

Title to display.

Remarks

If title is null then it is hidden but if it is '' then it is shown with placeholder

Default Value

none
titleProps?: WorkbookTitleProps

Additional WorkbookTitle properties

Remarks

If onTitleChange or title is provided then the prop versions are ignored

toolbarProps?: WorkbookToolbarsProps

Props for the toolbar.

undoManager?: UndoManager

Allow for a custom undo manager

Default Value

a new undo manager for each standaloneWorkbook