forked from silevis/reactgrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f477aeb
Showing
104 changed files
with
24,684 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
/lib | ||
|
||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/dist | ||
/build | ||
# public | ||
.cache | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
/cypress/screenshots | ||
/cypress/snapshots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.circleci | ||
node_modules | ||
build | ||
cypress | ||
cypress.json | ||
public | ||
src | ||
tsconfig.*json | ||
package.*json | ||
azure-pipelines-upgrade-rc-version.yml | ||
snapshots.js | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
## 1. Install ReactGrid from npm repository | ||
|
||
```shell | ||
npm i @silevis/reactgrid | ||
``` | ||
|
||
## 2. Import ReactGrid component | ||
|
||
```tsx | ||
import { ReactGrid } from "@silevis/reactgrid"; | ||
``` | ||
|
||
## 3. Import css styles | ||
|
||
Import file from `node_modules` directory. This file is necessary to correctly displaying. | ||
|
||
```tsx | ||
import "@silevis/reactgrid/dist/lib/assets/core.css"; | ||
``` | ||
|
||
## 4. Create a cell matrix | ||
|
||
Time to define our data. It will be stored in [React Hook](https://reactjs.org/docs/hooks-intro.html). | ||
`useState` hook will be initialized with object that contains two keys - `columns` and `rows`. | ||
Both of them must be valid ReactGrid objects: `Columns` `Rows`. | ||
|
||
```tsx | ||
import React, { useState } from "react"; | ||
import ReactDOM from "react-dom"; | ||
import { ReactGrid } from "@silevis/reactgrid"; | ||
import "@silevis/reactgrid/dist/lib/assets/core.css"; | ||
|
||
function App() { | ||
const [state, setState] = useState(() => ({ | ||
columns: [ | ||
{ columnId: "Name", width: 100 }, | ||
{ columnId: "Surname", width: 100 } | ||
], | ||
rows: [ | ||
{ | ||
rowId: 0, | ||
cells: [ | ||
{ type: "header", text: "Name" }, | ||
{ type: "header", text: "Surname" } | ||
] | ||
}, | ||
{ | ||
rowId: 1, | ||
cells: [ | ||
{ type: "text", text: "Thomas" }, | ||
{ type: "text", text: "Goldman" } | ||
] | ||
}, | ||
{ | ||
rowId: 2, | ||
cells: [ | ||
{ type: "text", text: "Susie" }, | ||
{ type: "text", text: "Spencer" } | ||
] | ||
}, | ||
{ | ||
rowId: 2, | ||
cells: [{ type: "text", text: "" }, { type: "text", text: "" }] | ||
} | ||
] | ||
})); | ||
|
||
return ( | ||
<ReactGrid | ||
rows={state.rows} | ||
columns={state.columns} | ||
/> | ||
); | ||
} | ||
``` | ||
|
||
## 4. Render your component | ||
|
||
```tsx | ||
const rootElement = document.getElementById("root"); | ||
ReactDOM.render(<App />, rootElement); | ||
``` | ||
|
||
Open example on [codesandbox.io](https://codesandbox.io/s/reactgrid-getting-started-0754c) | ||
|
||
## Docs | ||
|
||
Browse docs: [click](http://reactgrid.com/) | ||
|
||
## Licensing | ||
|
||
ReactGrid is distributed under [MIT](link) license. | ||
|
||
(c) 2020 Silevis Software | ||
|
||
## Author | ||
|
||
[Silevis Software](https://www.silevis.com/) | ||
|
||
<p align="center"> | ||
<a href="https://www.silevis.com/"> | ||
<img alt="Silevis" src="https://media.licdn.com/dms/image/C4D0BAQGgkonm5f80mA/company-logo_200_200/0?e=2159024400&v=beta&t=l5Nw-CF55OIxVORSAXOw79DlgSiDakhnYLlkBOMj7s8" width="200" /> | ||
</a> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
trigger: | ||
- develop | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
stages: | ||
- stage: upgrade_rc_version | ||
displayName: 'Upgrade RC version' | ||
jobs: | ||
- job: upgrade_rc_version | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '10.x' | ||
displayName: 'Install Node.js' | ||
- checkout: self | ||
persistCredentials: true | ||
- script: | ||
git checkout $(DEVELOP_BRANCH_NAME) | ||
displayName: 'Git Checkout' | ||
- script: | ||
git config --global user.email "$(GIT_USER_MAIL)" && git config --global user.name "$(GIT_USER_NAME)" | ||
- script: | ||
npm version prerelease --preid=rc -m "upgrade version [ci skip]" | ||
displayName: 'Upgrade version' | ||
- script: | ||
git push | ||
displayName: 'Push upgraded version' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"video": false, | ||
"baseUrl": "http://localhost:3000", | ||
"viewportWidth": 1200 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Constants { | ||
keyCodes = { | ||
A: 65, | ||
ArrowUp: 38, | ||
ArrowDown: 40, | ||
ArrowLeft: 37, | ||
ArrowRight: 39, | ||
Tab: 9, | ||
Shift: 16, | ||
Backspace: 8, | ||
Delete: 46, | ||
Control: 17, | ||
Enter: 13, | ||
Home: 36, | ||
Space: 32, | ||
End: 35, | ||
PageUp: 33, | ||
PageDown: 34, | ||
Esc: 27, | ||
Copy: 67, | ||
Cut: 88, | ||
Paste: 86, | ||
}; | ||
} | ||
|
||
var constants = new Constants(); | ||
module.exports = constants; |
Oops, something went wrong.