1.3.7-0 • Published 1 month ago

quill1.3.7-table-module v1.3.7-0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

QuillJS table

A table module used in QuillJS@1.3.7

Demo

Install

npm install quill1.3.7-table-module

Usage

import Quill from 'quill';
import TableHandler, { rewirteFormats } from 'quill1.3.7-table-module';
import 'quill1.3.7-table-module/dist/index.css';
Quill.register({ [`modules/${TableHandler.moduleName}`]: TableHandler }, true);
rewirteFormats();

new Quill('#editor', {
    theme: 'snow',
    modules: {
        toolbar: [TableHandler.toolName],
        [`${TableHandler.moduleName}`]: {
            fullWidth: true,
        },
    },
});

rewirteFormats

To handle exceptions, it is necessary to rewrite some native formats. you can skip this function. but the relevant format may be displayed incorrectly in the table

rewrite formats

formatdescription
ListItemRewrite method replaceWith. Make ul/ol to display correctly within cells

Options

attributedescriptiontypedefault
fullWidthAlways 100% widthbooleanfalse
customSelectCustom picker element. The returned element needs to trigger an event to create a table() => HTMLElement
tableToolTipTable tool tip configurationToolTip
operationMenuOTable contextmenu configurationperationMenu
selectionTable cell selection configurationTableCellSelection

fullWidth

If the value is true. the width of the table is always 100%

customSelect

The element returned by the customSelect method will be inserted into the toolbar, and the element needs to trigger a custom event TableModule.createEventName and carry data { row: number, col: number } in the detail

ToolTip

attributedescriptiontypedefault
tipHeightSlider heightnumber12px
disableToolNamesDisabled tools name within the tablestring[]

OperationMenu

attributedescriptiontypedefault
itemsContextmenu itemRecord<string, OpertationMenuItem>{ insertColumnLeft, insertColumnRight, insertRowTop, insertRowBottom, removeRow, removeCol, removeTable, mergeCell }
replaceItemsReplace contextmenu itemBoolean

OpertationMenuItem

attributetypedescription
textstring / () => HTMLElementItem text
iconSrcHTMLStringPre icon
handler() => voidClick event
subTitlestringSubtitle
groupEndbooleanGroup underline. Do not display underline for the last item

TableCellSelection

attributedescriptiontypedefault
primaryColorBorder colorstring#0589f3
1.3.7

1 month ago

1.3.7-0

1 month ago

1.3.6

2 months ago

1.3.5

2 months ago

1.3.4

2 months ago

1.3.3

2 months ago

1.3.3-dev

2 months ago

1.3.3-dev-1

2 months ago

1.3.2

2 months ago

1.3.1

2 months ago

1.3.0

2 months ago

1.2.4-dev-1

2 months ago

1.2.4-dev

2 months ago

1.2.4

3 months ago

1.2.3

3 months ago

1.2.3-dev-3

3 months ago

1.2.3-dev

3 months ago

1.2.3-dev-1

3 months ago

1.2.2

3 months ago

1.2.0

3 months ago

1.1.1

3 months ago

1.1.0

4 months ago

1.1.0-0

4 months ago

1.0.9

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago