Skip to content

Commit a904a10

Browse files
authored
release/v2.2.0 (#82)
* Update README prepare release * Add demo for disabling multi selection * Fix select all case when multi selection is disabled
1 parent cc982cb commit a904a10

File tree

6 files changed

+43
-8
lines changed

6 files changed

+43
-8
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
- uses: actions/checkout@v2
1010
- uses: actions/setup-node@v2
1111
with:
12-
node-version: '16.x'
13-
registry-url: 'https://registry.npmjs.org'
12+
node-version: "16.x"
13+
registry-url: "https://registry.npmjs.org"
1414
- run: cp README.md packages/react-arborist/README.md
1515
- run: yarn
1616
- run: yarn workspace react-arborist build

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Testing Locally
2+
3+
1. Clone the repo
4+
2. From the root, run yarn start
5+
3. Visit localhost:3000
6+
7+
# Publishing a Release
8+
9+
### Release Branch
10+
11+
1. Checkout main locally
12+
2. Increment the version number in packages/react-arborist/package.json
13+
3. Create a branch called release/v0.0.0
14+
4. Open a PR to main
15+
5. Test, review, and merge
16+
17+
### Create Github Release
18+
19+
1. Create a release based on main
20+
2. Assign a new tag to be created with v0.0.0
21+
3. Write release notes
22+
4. Publish
23+
24+
The Github actions workflow will publish to npm.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,4 @@ Returns the root _NodeApi_ instance. Its children are the Node representations o
718718

719719
## Author
720720

721-
This library was created by James Kerr while working at Brim Data on the [Zui desktop app](https://www.youtube.com/watch?v=I2y663n8d2A). Work with data? Check us out at [brimdata.io](https://www.brimdata.io)
722-
723-
[Follow me on Twitter](https://twitter.com/specialCaseDev) for react-arborist updates.
721+
[James Kerr](https://twitter.com/specialCaseDev) at [Brim Data](https://brimdata.io) for the [Zui desktop app](https://www.youtube.com/watch?v=I2y663n8d2A).

packages/react-arborist/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "react-arborist",
3-
"version": "2.1.1",
3+
"version": "2.2.0",
44
"license": "MIT",
55
"source": "src/index.ts",
66
"main": "dist/index.js",
77
"module": "dist/module.js",
88
"types": "dist/index.d.ts",
9-
"repository": "https://github.com/brimdata/react-arborist",
9+
"repository": "github:brimdata/react-arborist",
1010
"homepage": "https://react-arborist.netlify.app",
11+
"bugs": "https://github.com/brimdata/react-arborist/issues",
1112
"keywords": [
1213
"react",
1314
"arborist",

packages/react-arborist/src/components/default-container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function DefaultContainer() {
132132
}
133133
return;
134134
}
135-
if (e.key === "a" && e.metaKey) {
135+
if (e.key === "a" && e.metaKey && !tree.props.disableMultiSelection) {
136136
e.preventDefault();
137137
tree.selectAll();
138138
return;

packages/showcase/pages/cities.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default function Cities() {
2020
const [searchTerm, setSearchTerm] = useState("");
2121
const [count, setCount] = useState(0);
2222
const [followsFocus, setFollowsFocus] = useState(false);
23+
const [disableMulti, setDisableMulti] = useState(false);
2324

2425
useEffect(() => {
2526
setCount(tree?.visibleNodes.length ?? 0);
@@ -35,6 +36,7 @@ export default function Cities() {
3536
{...dimens}
3637
initialData={data}
3738
selectionFollowsFocus={followsFocus}
39+
disableMultiSelection={disableMulti}
3840
ref={(t) => setTree(t)}
3941
openByDefault={true}
4042
searchTerm={searchTerm}
@@ -100,6 +102,16 @@ export default function Cities() {
100102
onChange={(e) => setFollowsFocus((v) => !v)}
101103
/>
102104
</section>
105+
<section>
106+
<label>
107+
Demo the <i>disableMultiSelection</i> prop:
108+
</label>
109+
<input
110+
type="checkbox"
111+
checked={disableMulti}
112+
onChange={(e) => setDisableMulti((v) => !v)}
113+
/>
114+
</section>
103115
<section>
104116
<label>
105117
Demo the <i>tree</i> ref:

0 commit comments

Comments
 (0)