Skip to content

Commit f477aeb

Browse files
committed
created develop branch
0 parents  commit f477aeb

File tree

104 files changed

+24684
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+24684
-0
lines changed

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
/lib
8+
9+
10+
# testing
11+
/coverage
12+
13+
# production
14+
/dist
15+
/build
16+
# public
17+
.cache
18+
19+
# misc
20+
.DS_Store
21+
.env.local
22+
.env.development.local
23+
.env.test.local
24+
.env.production.local
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
30+
/cypress/screenshots
31+
/cypress/snapshots

.npmignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.circleci
2+
node_modules
3+
build
4+
cypress
5+
cypress.json
6+
public
7+
src
8+
tsconfig.*json
9+
package.*json
10+
azure-pipelines-upgrade-rc-version.yml
11+
snapshots.js
12+
.gitignore

README.md

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
## 1. Install ReactGrid from npm repository
2+
3+
```shell
4+
npm i @silevis/reactgrid
5+
```
6+
7+
## 2. Import ReactGrid component
8+
9+
```tsx
10+
import { ReactGrid } from "@silevis/reactgrid";
11+
```
12+
13+
## 3. Import css styles
14+
15+
Import file from `node_modules` directory. This file is necessary to correctly displaying.
16+
17+
```tsx
18+
import "@silevis/reactgrid/dist/lib/assets/core.css";
19+
```
20+
21+
## 4. Create a cell matrix
22+
23+
Time to define our data. It will be stored in [React Hook](https://reactjs.org/docs/hooks-intro.html).
24+
`useState` hook will be initialized with object that contains two keys - `columns` and `rows`.
25+
Both of them must be valid ReactGrid objects: `Columns` `Rows`.
26+
27+
```tsx
28+
import React, { useState } from "react";
29+
import ReactDOM from "react-dom";
30+
import { ReactGrid } from "@silevis/reactgrid";
31+
import "@silevis/reactgrid/dist/lib/assets/core.css";
32+
33+
function App() {
34+
const [state, setState] = useState(() => ({
35+
columns: [
36+
{ columnId: "Name", width: 100 },
37+
{ columnId: "Surname", width: 100 }
38+
],
39+
rows: [
40+
{
41+
rowId: 0,
42+
cells: [
43+
{ type: "header", text: "Name" },
44+
{ type: "header", text: "Surname" }
45+
]
46+
},
47+
{
48+
rowId: 1,
49+
cells: [
50+
{ type: "text", text: "Thomas" },
51+
{ type: "text", text: "Goldman" }
52+
]
53+
},
54+
{
55+
rowId: 2,
56+
cells: [
57+
{ type: "text", text: "Susie" },
58+
{ type: "text", text: "Spencer" }
59+
]
60+
},
61+
{
62+
rowId: 2,
63+
cells: [{ type: "text", text: "" }, { type: "text", text: "" }]
64+
}
65+
]
66+
}));
67+
68+
return (
69+
<ReactGrid
70+
rows={state.rows}
71+
columns={state.columns}
72+
/>
73+
);
74+
}
75+
```
76+
77+
## 4. Render your component
78+
79+
```tsx
80+
const rootElement = document.getElementById("root");
81+
ReactDOM.render(<App />, rootElement);
82+
```
83+
84+
Open example on [codesandbox.io](https://codesandbox.io/s/reactgrid-getting-started-0754c)
85+
86+
## Docs
87+
88+
Browse docs: [click](http://reactgrid.com/)
89+
90+
## Licensing
91+
92+
ReactGrid is distributed under [MIT](link) license.
93+
94+
(c) 2020 Silevis Software
95+
96+
## Author
97+
98+
[Silevis Software](https://www.silevis.com/)
99+
100+
<p align="center">
101+
<a href="https://www.silevis.com/">
102+
<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" />
103+
</a>
104+
</p>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
trigger:
2+
- develop
3+
4+
pool:
5+
vmImage: 'ubuntu-latest'
6+
7+
stages:
8+
- stage: upgrade_rc_version
9+
displayName: 'Upgrade RC version'
10+
jobs:
11+
- job: upgrade_rc_version
12+
steps:
13+
- task: NodeTool@0
14+
inputs:
15+
versionSpec: '10.x'
16+
displayName: 'Install Node.js'
17+
- checkout: self
18+
persistCredentials: true
19+
- script:
20+
git checkout $(DEVELOP_BRANCH_NAME)
21+
displayName: 'Git Checkout'
22+
- script:
23+
git config --global user.email "$(GIT_USER_MAIL)" && git config --global user.name "$(GIT_USER_NAME)"
24+
- script:
25+
npm version prerelease --preid=rc -m "upgrade version [ci skip]"
26+
displayName: 'Upgrade version'
27+
- script:
28+
git push
29+
displayName: 'Push upgraded version'

cypress.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"video": false,
3+
"baseUrl": "http://localhost:3000",
4+
"viewportWidth": 1200
5+
}

cypress/fixtures/example.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
class Constants {
2+
keyCodes = {
3+
A: 65,
4+
ArrowUp: 38,
5+
ArrowDown: 40,
6+
ArrowLeft: 37,
7+
ArrowRight: 39,
8+
Tab: 9,
9+
Shift: 16,
10+
Backspace: 8,
11+
Delete: 46,
12+
Control: 17,
13+
Enter: 13,
14+
Home: 36,
15+
Space: 32,
16+
End: 35,
17+
PageUp: 33,
18+
PageDown: 34,
19+
Esc: 27,
20+
Copy: 67,
21+
Cut: 88,
22+
Paste: 86,
23+
};
24+
}
25+
26+
var constants = new Constants();
27+
module.exports = constants;

0 commit comments

Comments
 (0)