react-native-tree-multi-select 1.2.0 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/.editorconfig +15 -0
  2. package/.gitattributes +3 -0
  3. package/.github/FUNDING.yml +13 -0
  4. package/.github/ISSUE_TEMPLATE/bug-report.md +42 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +30 -0
  6. package/.github/actions/setup/action.yml +28 -0
  7. package/.github/assets/Jairaj_Jangle_Google_Pay_UPI_QR_Code.jpg +0 -0
  8. package/.github/assets/paypal_donate.png +0 -0
  9. package/.github/assets/upi.png +0 -0
  10. package/.github/workflows/ci.yml +225 -0
  11. package/.gitignore +73 -0
  12. package/.nvmrc +1 -0
  13. package/.watchmanconfig +1 -0
  14. package/.yarnrc +3 -0
  15. package/CHANGELOG.md +145 -0
  16. package/CODE_OF_CONDUCT.md +133 -0
  17. package/CONTRIBUTING.md +114 -0
  18. package/README.md +12 -3
  19. package/babel.config.js +3 -0
  20. package/example/.bundle/config +2 -0
  21. package/example/.watchmanconfig +1 -0
  22. package/example/Gemfile +6 -0
  23. package/example/README.md +79 -0
  24. package/example/android/app/build.gradle +130 -0
  25. package/example/android/app/debug.keystore +0 -0
  26. package/example/android/app/proguard-rules.pro +10 -0
  27. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  28. package/example/android/app/src/debug/java/com/treemultiselectexample/ReactNativeFlipper.java +75 -0
  29. package/example/android/app/src/main/AndroidManifest.xml +25 -0
  30. package/example/android/app/src/main/java/com/treemultiselectexample/MainActivity.java +32 -0
  31. package/example/android/app/src/main/java/com/treemultiselectexample/MainApplication.java +62 -0
  32. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  33. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  34. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  35. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  36. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  37. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  38. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  39. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  40. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  41. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  42. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  43. package/example/android/app/src/main/res/values/strings.xml +3 -0
  44. package/example/android/app/src/main/res/values/styles.xml +9 -0
  45. package/example/android/app/src/release/java/com/treemultiselectexample/ReactNativeFlipper.java +20 -0
  46. package/example/android/build.gradle +23 -0
  47. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  48. package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  49. package/example/android/gradle.properties +44 -0
  50. package/example/android/gradlew +244 -0
  51. package/example/android/gradlew.bat +92 -0
  52. package/example/android/settings.gradle +4 -0
  53. package/example/app.json +4 -0
  54. package/example/babel.config.js +17 -0
  55. package/example/index.js +5 -0
  56. package/example/ios/.xcode.env +11 -0
  57. package/example/ios/File.swift +6 -0
  58. package/example/ios/Podfile +62 -0
  59. package/example/ios/Podfile.lock +639 -0
  60. package/example/ios/TreeMultiSelectExample/AppDelegate.h +6 -0
  61. package/example/ios/TreeMultiSelectExample/AppDelegate.mm +26 -0
  62. package/example/ios/TreeMultiSelectExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  63. package/example/ios/TreeMultiSelectExample/Images.xcassets/Contents.json +6 -0
  64. package/example/ios/TreeMultiSelectExample/Info.plist +74 -0
  65. package/example/ios/TreeMultiSelectExample/LaunchScreen.storyboard +47 -0
  66. package/example/ios/TreeMultiSelectExample/main.m +10 -0
  67. package/example/ios/TreeMultiSelectExample-Bridging-Header.h +3 -0
  68. package/example/ios/TreeMultiSelectExample.xcodeproj/project.pbxproj +706 -0
  69. package/example/ios/TreeMultiSelectExample.xcodeproj/xcshareddata/xcschemes/TreeMultiSelectExample.xcscheme +88 -0
  70. package/example/ios/TreeMultiSelectExample.xcworkspace/contents.xcworkspacedata +10 -0
  71. package/example/ios/TreeMultiSelectExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  72. package/example/ios/TreeMultiSelectExampleTests/Info.plist +24 -0
  73. package/example/ios/TreeMultiSelectExampleTests/TreeMultiSelectExampleTests.m +66 -0
  74. package/example/metro.config.js +45 -0
  75. package/example/package.json +41 -0
  76. package/example/react-native.config.js +10 -0
  77. package/example/src/App.tsx +70 -0
  78. package/example/src/components/CustomArrow.tsx +71 -0
  79. package/example/src/components/CustomCheckboxView.tsx +119 -0
  80. package/example/src/components/CustomNodeRowView.tsx +124 -0
  81. package/example/src/components/SearchInput.tsx +68 -0
  82. package/example/src/screens/CustomArrowScreen.tsx +99 -0
  83. package/example/src/screens/CustomCheckboxScreen.tsx +99 -0
  84. package/example/src/screens/CustomNodeRowViewScreen.tsx +99 -0
  85. package/example/src/screens/LargeDataScreen.tsx +95 -0
  86. package/example/src/screens/MediumDataScreen.tsx +96 -0
  87. package/example/src/screens/SmallDataScreen.tsx +96 -0
  88. package/example/src/screens/screens.styles.ts +25 -0
  89. package/example/src/utils/sampleDataGenerator.ts +32 -0
  90. package/example/yarn.lock +6368 -0
  91. package/lefthook.yml +17 -0
  92. package/lib/commonjs/TreeView.js +13 -3
  93. package/lib/commonjs/TreeView.js.map +1 -1
  94. package/lib/commonjs/helpers/expandCollapse.helper.js +88 -21
  95. package/lib/commonjs/helpers/expandCollapse.helper.js.map +1 -1
  96. package/lib/commonjs/helpers/toggleCheckbox.helper.js +0 -1
  97. package/lib/commonjs/helpers/toggleCheckbox.helper.js.map +1 -1
  98. package/lib/commonjs/utils/usePreviousState.js +20 -0
  99. package/lib/commonjs/utils/usePreviousState.js.map +1 -0
  100. package/lib/module/TreeView.js +14 -4
  101. package/lib/module/TreeView.js.map +1 -1
  102. package/lib/module/helpers/expandCollapse.helper.js +86 -21
  103. package/lib/module/helpers/expandCollapse.helper.js.map +1 -1
  104. package/lib/module/helpers/toggleCheckbox.helper.js +0 -1
  105. package/lib/module/helpers/toggleCheckbox.helper.js.map +1 -1
  106. package/lib/module/utils/usePreviousState.js +15 -0
  107. package/lib/module/utils/usePreviousState.js.map +1 -0
  108. package/lib/typescript/TreeView.d.ts.map +1 -1
  109. package/lib/typescript/__mocks__/generateTree.mock.d.ts +17 -0
  110. package/lib/typescript/__mocks__/generateTree.mock.d.ts.map +1 -0
  111. package/lib/typescript/__mocks__/zustand.d.ts +3 -0
  112. package/lib/typescript/__mocks__/zustand.d.ts.map +1 -0
  113. package/lib/typescript/__tests__/expandCollapse.helper.test.d.ts +2 -0
  114. package/lib/typescript/__tests__/expandCollapse.helper.test.d.ts.map +1 -0
  115. package/lib/typescript/__tests__/flattenTree.helper.test.d.ts +2 -0
  116. package/lib/typescript/__tests__/flattenTree.helper.test.d.ts.map +1 -0
  117. package/lib/typescript/__tests__/initNodeMap.helper.test.d.ts +2 -0
  118. package/lib/typescript/__tests__/initNodeMap.helper.test.d.ts.map +1 -0
  119. package/lib/typescript/__tests__/search.helper.test.d.ts +2 -0
  120. package/lib/typescript/__tests__/search.helper.test.d.ts.map +1 -0
  121. package/lib/typescript/__tests__/selectAll.helper.test.d.ts +2 -0
  122. package/lib/typescript/__tests__/selectAll.helper.test.d.ts.map +1 -0
  123. package/lib/typescript/__tests__/store.test.d.ts +2 -0
  124. package/lib/typescript/__tests__/store.test.d.ts.map +1 -0
  125. package/lib/typescript/__tests__/toggleCheckbox.helper.test.d.ts +2 -0
  126. package/lib/typescript/__tests__/toggleCheckbox.helper.test.d.ts.map +1 -0
  127. package/lib/typescript/helpers/expandCollapse.helper.d.ts +12 -0
  128. package/lib/typescript/helpers/expandCollapse.helper.d.ts.map +1 -1
  129. package/lib/typescript/types/treeView.types.d.ts +3 -0
  130. package/lib/typescript/types/treeView.types.d.ts.map +1 -1
  131. package/lib/typescript/utils/usePreviousState.d.ts +7 -0
  132. package/lib/typescript/utils/usePreviousState.d.ts.map +1 -0
  133. package/package.json +5 -3
  134. package/scripts/bootstrap.js +29 -0
  135. package/src/TreeView.tsx +25 -4
  136. package/src/__mocks__/generateTree.mock.ts +125 -0
  137. package/src/__mocks__/zustand.ts +24 -0
  138. package/src/__tests__/expandCollapse.helper.test.ts +189 -0
  139. package/src/__tests__/flattenTree.helper.test.ts +78 -0
  140. package/src/__tests__/initNodeMap.helper.test.ts +46 -0
  141. package/src/__tests__/search.helper.test.ts +47 -0
  142. package/src/__tests__/selectAll.helper.test.ts +233 -0
  143. package/src/__tests__/store.test.ts +208 -0
  144. package/src/__tests__/toggleCheckbox.helper.test.ts +124 -0
  145. package/src/helpers/expandCollapse.helper.ts +82 -21
  146. package/src/helpers/toggleCheckbox.helper.ts +1 -1
  147. package/src/types/treeView.types.ts +5 -0
  148. package/src/utils/usePreviousState.ts +16 -0
  149. package/tsconfig.build.json +5 -0
  150. package/tsconfig.json +31 -0
  151. package/turbo.json +34 -0
  152. package/yarn.lock +9953 -0
@@ -0,0 +1,26 @@
1
+ #import "AppDelegate.h"
2
+
3
+ #import <React/RCTBundleURLProvider.h>
4
+
5
+ @implementation AppDelegate
6
+
7
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
8
+ {
9
+ self.moduleName = @"TreeMultiSelectExample";
10
+ // You can add your custom initial props in the dictionary below.
11
+ // They will be passed down to the ViewController used by React Native.
12
+ self.initialProps = @{};
13
+
14
+ return [super application:application didFinishLaunchingWithOptions:launchOptions];
15
+ }
16
+
17
+ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18
+ {
19
+ #if DEBUG
20
+ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
21
+ #else
22
+ return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23
+ #endif
24
+ }
25
+
26
+ @end
@@ -0,0 +1,53 @@
1
+ {
2
+ "images" : [
3
+ {
4
+ "idiom" : "iphone",
5
+ "scale" : "2x",
6
+ "size" : "20x20"
7
+ },
8
+ {
9
+ "idiom" : "iphone",
10
+ "scale" : "3x",
11
+ "size" : "20x20"
12
+ },
13
+ {
14
+ "idiom" : "iphone",
15
+ "scale" : "2x",
16
+ "size" : "29x29"
17
+ },
18
+ {
19
+ "idiom" : "iphone",
20
+ "scale" : "3x",
21
+ "size" : "29x29"
22
+ },
23
+ {
24
+ "idiom" : "iphone",
25
+ "scale" : "2x",
26
+ "size" : "40x40"
27
+ },
28
+ {
29
+ "idiom" : "iphone",
30
+ "scale" : "3x",
31
+ "size" : "40x40"
32
+ },
33
+ {
34
+ "idiom" : "iphone",
35
+ "scale" : "2x",
36
+ "size" : "60x60"
37
+ },
38
+ {
39
+ "idiom" : "iphone",
40
+ "scale" : "3x",
41
+ "size" : "60x60"
42
+ },
43
+ {
44
+ "idiom" : "ios-marketing",
45
+ "scale" : "1x",
46
+ "size" : "1024x1024"
47
+ }
48
+ ],
49
+ "info" : {
50
+ "author" : "xcode",
51
+ "version" : 1
52
+ }
53
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "info" : {
3
+ "version" : 1,
4
+ "author" : "xcode"
5
+ }
6
+ }
@@ -0,0 +1,74 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>TreeMultiSelectExample</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>$(EXECUTABLE_NAME)</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>$(PRODUCT_NAME)</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>$(MARKETING_VERSION)</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>$(CURRENT_PROJECT_VERSION)</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true/>
27
+ <key>NSAppTransportSecurity</key>
28
+ <dict>
29
+ <key>NSExceptionDomains</key>
30
+ <dict>
31
+ <key>localhost</key>
32
+ <dict>
33
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
34
+ <true/>
35
+ </dict>
36
+ </dict>
37
+ </dict>
38
+ <key>NSLocationWhenInUseUsageDescription</key>
39
+ <string></string>
40
+ <key>UILaunchStoryboardName</key>
41
+ <string>LaunchScreen</string>
42
+ <key>UIRequiredDeviceCapabilities</key>
43
+ <array>
44
+ <string>armv7</string>
45
+ </array>
46
+ <key>UISupportedInterfaceOrientations</key>
47
+ <array>
48
+ <string>UIInterfaceOrientationPortrait</string>
49
+ <string>UIInterfaceOrientationLandscapeLeft</string>
50
+ <string>UIInterfaceOrientationLandscapeRight</string>
51
+ </array>
52
+ <key>UIViewControllerBasedStatusBarAppearance</key>
53
+ <false/>
54
+ <key>UIAppFonts</key>
55
+ <array>
56
+ <string>AntDesign.ttf</string>
57
+ <string>Entypo.ttf</string>
58
+ <string>EvilIcons.ttf</string>
59
+ <string>Feather.ttf</string>
60
+ <string>FontAwesome.ttf</string>
61
+ <string>FontAwesome5_Brands.ttf</string>
62
+ <string>FontAwesome5_Regular.ttf</string>
63
+ <string>FontAwesome5_Solid.ttf</string>
64
+ <string>Foundation.ttf</string>
65
+ <string>Ionicons.ttf</string>
66
+ <string>MaterialIcons.ttf</string>
67
+ <string>MaterialCommunityIcons.ttf</string>
68
+ <string>SimpleLineIcons.ttf</string>
69
+ <string>Octicons.ttf</string>
70
+ <string>Zocial.ttf</string>
71
+ <string>Fontisto.ttf</string>
72
+ </array>
73
+ </dict>
74
+ </plist>
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
+ <device id="retina4_7" orientation="portrait" appearance="light"/>
4
+ <dependencies>
5
+ <deployment identifier="iOS"/>
6
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
7
+ <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
+ </dependencies>
10
+ <scenes>
11
+ <!--View Controller-->
12
+ <scene sceneID="EHf-IW-A2E">
13
+ <objects>
14
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
15
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
16
+ <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
17
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18
+ <subviews>
19
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="TreeMultiSelectExample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
20
+ <rect key="frame" x="0.0" y="202" width="375" height="43"/>
21
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
22
+ <nil key="highlightedColor"/>
23
+ </label>
24
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Powered by React Native" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="MN2-I3-ftu">
25
+ <rect key="frame" x="0.0" y="626" width="375" height="21"/>
26
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
27
+ <nil key="highlightedColor"/>
28
+ </label>
29
+ </subviews>
30
+ <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
31
+ <constraints>
32
+ <constraint firstItem="Bcu-3y-fUS" firstAttribute="bottom" secondItem="MN2-I3-ftu" secondAttribute="bottom" constant="20" id="OZV-Vh-mqD"/>
33
+ <constraint firstItem="Bcu-3y-fUS" firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
34
+ <constraint firstItem="MN2-I3-ftu" firstAttribute="centerX" secondItem="Bcu-3y-fUS" secondAttribute="centerX" id="akx-eg-2ui"/>
35
+ <constraint firstItem="MN2-I3-ftu" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" id="i1E-0Y-4RG"/>
36
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
37
+ <constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Bcu-3y-fUS" secondAttribute="leading" symbolic="YES" id="x7j-FC-K8j"/>
38
+ </constraints>
39
+ <viewLayoutGuide key="safeArea" id="Bcu-3y-fUS"/>
40
+ </view>
41
+ </viewController>
42
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
43
+ </objects>
44
+ <point key="canvasLocation" x="52.173913043478265" y="375"/>
45
+ </scene>
46
+ </scenes>
47
+ </document>
@@ -0,0 +1,10 @@
1
+ #import <UIKit/UIKit.h>
2
+
3
+ #import "AppDelegate.h"
4
+
5
+ int main(int argc, char *argv[])
6
+ {
7
+ @autoreleasepool {
8
+ return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //