4.9.4 • Published 6 months ago

@yoopta/table v4.9.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Table

Overview

The Table Plugin is a powerful extension for Yoopta-Editor, designed to bring seamless table creation and editing capabilities into your workflow

Installation

yarn add @yoopta/table

Elements

table

  • props
  • headerRow
  • headerColumn
  • children elements
  • table-row

table-row

  • props
  • children elements
  • table-data-cell

table-data-cell

  • props
  • asHeader
  • width

Commands

export type TableCommands = {
  buildTableElements: (editor: YooEditor, options?: InsertOptions) => TableElement,
  insertTable: (editor: YooEditor, options?: InsertOptions) => void,
  deleteTable: (editor: YooEditor, blockId: string) => void,
  insertTableRow: (editor: YooEditor, blockId: string, options?: Options) => void,
  deleteTableRow: (editor: YooEditor, blockId: string, options?: DeleteOptions) => void,
  moveTableRow: (editor: YooEditor, blockId: string, options: MoveTableOptions) => void,
  moveTableColumn: (editor: YooEditor, blockId: string, options: MoveTableOptions) => void,
  insertTableColumn: (editor: YooEditor, blockId: string, options?: Options) => void,
  deleteTableColumn: (editor: YooEditor, blockId: string, options?: DeleteOptions) => void,
  updateColumnWidth: (editor: YooEditor, blockId: string, columnIndex: number, width: number) => void,
  toggleHeaderRow: (editor: YooEditor, blockId: string) => void,
  toggleHeaderColumn: (editor: YooEditor, blockId: string) => void,
};

buildTableElements

buildTableElements: (editor: YooEditor, options?: InsertOptions) => TableElement;

Define elements structure for slate value in your block

insertTable

editor.methods.insertTable(blockId: string, options?: InsertOptions) => void

Insert table block in specific path with options

Options:

  • rows: number
  • columns: number
  • columnWidth?: number
  • headerColumn?: boolean
  • headerRow?: boolean

deleteTable

deleteTable: (editor: YooEditor, blockId: string) => void;

Delete table block

insertTableRow

insertTableRow: (editor: YooEditor, blockId: string, options?: Options) => void;

Insert table row in specific location

Options:

  • path?: Location & Span
  • select?: boolean
  • insertMode?: 'before' | 'after';

Hotkeys

OperationHotkey
Insert row aftershift+enter
Insert row beforecmd+shift+enter
Delete rowcmd+shift+delete
Insert column to rightcmd+shift+→
Insert column to leftcmd+shift+←
Delete columncmd+alt+delete
Toggle header for first rowcmd+shift+H
Toggle header for first columncmd+shift+V
cmd+a

Styling

ClassnameElement
yoopta-table-blockRoot of table
yoopta-tableTable element
yoopta-table-selectingWhen table is under selection
yoopta-table-data-cellTable data cell
yoopta-table-data-cell-headTable data head cell
yoopta-table-data-cell-contentContent of data cell
4.9.4

6 months ago

4.9.4-rc.1

6 months ago

4.9.4-rc.0

6 months ago

4.9.3

7 months ago

4.9.3-alpha.0

7 months ago

4.9.2

8 months ago

4.9.2-rc.0

8 months ago

4.9.2-rc.2

8 months ago

4.9.2-rc.1

8 months ago

4.9.0

9 months ago

4.8.5-rc.9

9 months ago

4.9.1

8 months ago

4.8.5-rc.10

9 months ago

4.8.5-rc.11

9 months ago

4.8.5-rc.7

9 months ago

4.8.5-rc.8

9 months ago

4.8.5-rc.6

9 months ago

4.8.5-rc.5

9 months ago

4.8.5-rc.4

9 months ago

4.8.4-rc.0

9 months ago

4.8.4

9 months ago

4.8.3

10 months ago

4.8.3-rc.0

10 months ago

4.8.2

10 months ago

4.8.1

10 months ago

4.8.0

10 months ago

4.7.1-rc.8

10 months ago

4.7.1-rc.7

10 months ago

4.7.1-rc.6

10 months ago

4.7.1-rc.4

10 months ago

4.7.1-rc.3

10 months ago

4.7.1-rc.1

10 months ago

4.7.1-rc.0

10 months ago