Skip to content

Commit 002b9f8

Browse files
authored
Merge pull request #22 from RedHeadphone/issue-20
Issue 20
2 parents 94e0da9 + 66446f8 commit 002b9f8

29 files changed

+6302
-8144
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"]
2+
"presets": ["@babel/preset-typescript", "@babel/preset-env", "@babel/preset-react"]
33
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: NPM Publish to GitHub Packages
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
- run: npm ci
16+
- run: npm test
17+
18+
publish-gpr:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
registry-url: https://npm.pkg.github.com/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 120
3+
}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ The JSONGrid component supports the following props:
9393
| data | object | The JSON object or array to be transformed into a grid table. | undefined |
9494
| defaultExpandDepth | number | The depth to which the grid is expanded by default. | 0 |
9595
| defaultExpandKeyTree | object | Tree-like structure with all keys that needs to be expanded. | undefined |
96-
| onSelect | function | Event to obtain selected item's keyPath | (keyPath)=>{} |
97-
| highlightSelected | boolean | Whether to highlight the selected item or not. | true |
96+
| onSelect | function | Event to obtain selected cell's keyPath | (keyPath)=>{} |
97+
| highlightSelected | boolean | Whether to highlight the selected cell or not. | true |
9898
| searchText | string | The text that needs to be searched in the JSON data. | undefined |
9999
| theme | string | The theme name that needs to be applied. | 'default' |
100100
| customTheme | object | The customTheme object which specify color code of each part of grid. | {} |
@@ -135,18 +135,18 @@ Note: Pass one of above themes as a string in the theme prop. You can contribute
135135
```json
136136
{
137137
"bgColor": "#222",
138-
"tableBorderColor": "#b5b5b5",
139-
"highlightBgColor": "#3b3b3b",
138+
"borderColor": "#b5b5b5",
139+
"selectHighlightBgColor": "#3b3b3b",
140140
"cellBorderColor": "#474747",
141-
"keyNameColor": "#ffffff",
141+
"keyColor": "#ffffff",
142142
"indexColor": "#949494",
143143
"numberColor": "#6c99bb",
144144
"booleanColor": "#6c99bb",
145145
"stringColor": "#a5c261",
146146
"objectColor": "#ffffff",
147147
"tableHeaderBgColor": "#444",
148-
"tableHeaderColor": "#ffffff",
149-
"searchHighlightColor": "#565a36"
148+
"tableIconColor": "#ffffff",
149+
"searchHighlightBgColor": "#565a36"
150150
}
151151
```
152152

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
</head>
2929
<body>
3030
<div id="root"></div>
31-
<script type="module" src="/src/main.jsx"></script>
31+
<script type="module" src="/src/main.tsx"></script>
3232
</body>
3333
</html>

demo/package-lock.json

Lines changed: 41 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
},
1212
"dependencies": {
1313
"react": "^18.2.0",
14-
"react-dom": "^18.2.0"
14+
"react-dom": "^18.2.0",
15+
"typescript": "^5.6.2"
1516
},
1617
"devDependencies": {
17-
"@types/react": "^18.2.15",
18-
"@types/react-dom": "^18.2.7",
18+
"@types/react": "^18.3.11",
19+
"@types/react-dom": "^18.3.0",
1920
"@vitejs/plugin-react": "^4.0.3",
2021
"eslint": "^8.45.0",
2122
"eslint-plugin-react": "^7.32.2",

demo/src/main.jsx

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)