slate-editable-table
🖊 An editable table plugin for Slate.js
Table of Contents
Screenshot
Live Demo
Storybook
Install
- use npm
npm i -S slate-editable-table
- use yarn
yarn add slate-editable-table
Usage
;;;;;;;
Please see also https://github.com/bokuweb/slate-editable-table/blob/master/example/index.tsx
Commands
Command | Description |
---|---|
insertTable |
create and insert new table |
removeTable |
remove table |
insertLeft |
insert new column to left of current anchor cell |
insertRight |
insert new column to right of current anchor cell |
insertAbove |
insert new row to above of current anchor cell |
insertBelow |
insert new row to below of current anchor cell |
removeColumn |
remove selected column |
removeRow |
remove selected row |
mergeSelection |
merge current selection |
splitCell |
split current cell |
enableResizing |
enable cell resizing |
enableResizing |
disable cell resizing |
Query
Query | Description |
---|---|
isSelectionInTable |
If selection is in current table, return true |
canSelectedCellsMerge |
If selection is able to merge, return true |
findCurrentTable |
find current table block |
Test
npm t
TODO
- support mobile
- vertical resizing
- custom renderer
Contribute
If you have a feature request, please add it as an issue or make a pull request.
Changelog
v0.1.0
- Initial release
License
The MIT License (MIT)
Copyright (c) 2019 bokuweb
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.