jairajjangle / react-native-tree-multi-select Goto Github PK
View Code? Open in Web Editor NEWSuper-fast tree view with multi-selection capabilities, using checkboxes and search filtering.
License: MIT License
Super-fast tree view with multi-selection capabilities, using checkboxes and search filtering.
License: MIT License
const handleSelectionChange = _checkedIds => {
// const slug = _checkedIds;
console.log('slug:', _checkedIds);
};
how to get data _checkedIds, i can't using setState for set value _checkedId, i need list value using to call api
It is really useful and most update.
I have very small enhancement request. If you accept name and children from props. It could be easy for us to pass any kind of data in our own structure.
it will reduce conversion to name and children.
Is your feature request related to a problem? Please describe.
I'd like to be able to create a reorderable tree view. Moving items with drag-and-drop gestures is more intuitive for the end user than, say, using a context menu
Describe the solution you'd like
new props that can be passed to the TreeView component:
canDragNodes: boolean
onDragFinished: (oldIndex: number, newIndex: number, draggedItem: TreeNode) => void
Describe alternatives you've considered
N/A
Screenshots or screen records
N/A
Additional context
There is an implementation of a draggable flashlist here that i think could be integrated
Would you like to work on this feature?
If you wouldn't mind adding another dependency, then sure :)
Is your feature request related to a problem? Please describe.
First of all, thanks for this truly amazing library!
My problem is that I need to use two trees in one view with different data sets, and since the library is using Zustand with a global store, both trees were showing the same set of values. I was able to overcome it with a dirty hack, but it would be great if there was the ability to use multiple trees in one view.
Describe the solution you'd like
The best solution would be to be able to have any amount of TreeViewes hosted on the same page with no data duplication. Something like:
<TreeView data={data1} />
<TreeView data={data2} />
showing different data.
Describe alternatives you've considered
I ended up duplicating the store and duplicating the TreeView component (to have "TreeView2") for now, but it's a very dirty solution, it would be great if the library supported it.
Screenshots or screen records
NA
Additional context
NA
Would you like to work on this feature?
Unfortunately, I'm not good enough with React to be able to work on it
Is your feature request related to a problem? Please describe.
I was getting weird behavior, checking sort-of working but unable to un-check, when there were empty arrays of children, if I recursively delete any empty arrays of "children" attributes it works as intended, the library should gracefully handle an empty array.
Describe the solution you'd like
The library should handle no "children" attribute just as well / the same as an empty array children.
Describe alternatives you've considered
I had to add this to my function:
// Step 3: Remove empty children arrays
function removeEmptyChildren(rmArr: any[]) {
rmArr.forEach(rm => {
if (rm.children.length === 0) {
delete rm.children;
} else {
removeEmptyChildren(rm.children);
}
});
}
removeEmptyChildren(tree);
Screenshots or screen records
NA
Additional context
NA
Would you like to work on this feature?
Potentially, havn't really dug into the code yet.
Hey!
Thanks for this incredible library!
Is there an approach for getting the count of checked subNodes under a node?
For example
└── Cars (2 out of 3)/
├── [x] Hyundai
├── [x] Benz
└── [ ] Tesla
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These problems occurred while renovating this repository. View logs.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
com.facebook.flipper:flipper-network-plugin
, com.facebook.flipper:flipper
)@commitlint/config-conventional
, commitlint
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
react-native
, @types/react-native
)example/Gemfile
ruby >= 2.6.10
cocoapods '~> 1.12'
example/ios/Podfile
.github/actions/setup/action.yml
actions/setup-node v4
actions/cache v4
.github/workflows/ci.yml
actions/checkout v4
actions/checkout v4
actions/checkout v4
actions/checkout v4
actions/cache v4
actions/setup-java v4
actions/cache v4
actions/checkout v4
actions/cache v4
actions/cache v4
actions/upload-artifact v4
actions/checkout v4
actions/setup-node v4
example/android/gradle.properties
com.facebook.flipper:flipper 0.182.0
com.facebook.flipper:flipper-network-plugin 0.182.0
com.facebook.flipper:flipper-fresco-plugin 0.182.0
example/android/settings.gradle
example/android/build.gradle
example/android/app/build.gradle
org.jetbrains.kotlin:kotlin-bom 1.8.0
example/android/gradle/wrapper/gradle-wrapper.properties
gradle 7.6.4
example/package.json
@gorhom/showcase-template ^2.1.0
@react-navigation/native ^6.1.7
@react-navigation/native-stack ^6.9.15
@react-navigation/stack ^6.3.17
@shopify/flash-list ^1.4.3
lodash ^4.17.21
react 18.3.1
react-native 0.72.1
react-native-gesture-handler ^2.12.0
react-native-paper ^5.9.1
react-native-safe-area-context ^4.7.1
react-native-screens ^3.22.1
react-native-vector-icons ^9.2.0
@babel/core ^7.20.0
@babel/preset-env ^7.20.0
@babel/runtime ^7.20.0
@react-native/eslint-config ^0.74.0
@react-native/metro-config ^0.74.0
@types/lodash ^4.14.195
@types/metro-config ^0.76.3
babel-plugin-module-resolver ^5.0.0
metro-react-native-babel-preset 0.77.0
node >=16
package.json
zustand ^4.3.9
@commitlint/config-conventional ^17.0.2
@evilmartians/lefthook ^1.2.2
@react-native-community/eslint-config ^3.0.2
@release-it/conventional-changelog ^5.0.0
@semantic-release/changelog ^6.0.3
@semantic-release/git ^10.0.1
@semantic-release/github ^10.0.3
@semantic-release/npm ^12.0.0
@shopify/flash-list 1.x.x
@testing-library/jest-native ^5.4.2
@testing-library/react-native ^12.1.2
@types/color ^3.0.3
@types/jest ^29.5.3
@types/react ~17.0.21
@types/react-native 0.70.0
@types/react-native-vector-icons ^6.4.13
@types/react-test-renderer 18.3.0
commitlint ^17.0.2
del-cli ^5.0.0
eslint ^8.4.1
eslint-config-prettier ^8.5.0
eslint-plugin-prettier ^4.0.0
jest ^29.6.1
pod-install ^0.1.0
prettier ^2.0.5
react 18.3.1
react-native 0.72.1
react-native-builder-bob ^0.20.0
react-native-paper 5.x.x
react-test-renderer 18.3.1
release-it ^15.0.0
semantic-release ^23.0.8
ts-jest ^29.1.1
turbo ^1.10.7
typescript ^5.0.2
@shopify/flash-list 1.x.x
react *
react-native *
react-native-paper 5.x.x
react-native-vector-icons *
node >= 16.0.0
@types/react 17.0.80
yarn 1.22.22
.nvmrc
node 20.14.0
Is your feature request related to a problem? Please describe.
I tried changing an existing data type in my project to extend TreeNode
. However, since the ID is assumed to be a string, typescript complains.
Describe the solution you'd like
Change the TreeNode interface to be generic
export interface TreeNode<T> {
id: T,
// ...
}
Describe alternatives you've considered
N/A
Screenshots or screen records
N/A
Additional context
N/A
Would you like to work on this feature?
Absolutely!
Hi,
well done! Your control looks great, but is it possible to adapt your solution to single node selection? I need something exactly like this, but instead of checkboxes, for example, a radiobutton, where you can select only one node.
Thanks in advance for your answer!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.