Please check my demo here: https://sonic16x.github.io/e-test-task/?width=10&height=15
Your task is to develop a table component with cells merge funtional
Please check our demo: https://mergetable.web.app/?width=10&height=15
- Have to render table with size passed to query params
- Cells Have to be selected with mouse
- After selection cells can be merged or separated
- Table have to have size from
width
andheight
passed in query params - Selection have to be handled by
mousedown
,mousemove
andmouseup
events - Selection have to always select 'square' zone and stretch by merged cells
- After merge or separate cells selection have to stay on previous place:
- Every cell have to have
colspan
androwspan
attributes (with value 1 or more) - Every cell have to have data attributes
data-col-index
- positive int. Merging or separating another cells in grid doesn't change index for current cell. For example: if previous cell in row have index0
andcolspan = 2
(cells with indexes0
and1
were merged), current cell have to have index2
data-row-index
- positive int. As index for columns but for rowsdata-selected
- boolean
- Table have to be rendered by react components
Before send your solution run our e2e tests written in cypress.
To run tests type npm run cy:run
in your terminal.
All tests should be succeeded.
Tests simulate mouse selection by
mousedown
on first cell andmousemove
andmouseup
on last cells
Buttons should have
data-separate-button
anddata-merge-button
attributes.
- Clone this repo
- Install modules
npm i
- Run project
npm start
- Write your code
- Pass tests
- Push your solution in your repo and send link back
- You can change any code under
src
folder - You can change build process (project should be available on
localhost:3000
for tests) - You can install or update any libraries except libraries for tables like
React tables
- Change any styles
- Change any code under
cypress
folder - Change cypress version
- Change any scripts in
package.json
- Amend or change any commits. You have to keep my initial commit.
✨ Good luck! ✨