You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add a prop to disable selection on specific levels
* feat: move logic to 'disabled' property of a node
* fix: @mrchief review
* feat: node now inherits disabled status of parents if one has been setted on ancestor level
* fix: code climate
* refactor: Move initial state checks to its own file
Helps to group and run tests in parallel
(cherry picked from commit f6e1eed)
* test: Add failing tests
(cherry picked from commit 1fd22b5)
* fix: Remove cognitive complexity
- Also avoids walking up the tree for each node
- Fixes failing tests where state props are defined but are set to false
(cherry picked from commit d0fd2e9)
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,6 +188,7 @@ Data for rendering the tree select items. The object requires the following stru
188
188
value, // required: Checkbox value
189
189
children, // optional: Array of child objects
190
190
checked, // optional: Initial state of checkbox. if true, checkbox is selected and corresponding pill is rendered.
191
+
disabled, // optional: Selectable state of checkbox. if true, the checkbox is disabled and the node is not selectable.
191
192
expanded, // optional: If true, the node is expanded (children of children nodes are not expanded by default unless children nodes also have expanded: true).
192
193
className, // optional: Additional css class for the node. This is helpful to style the nodes your way
193
194
tagClassName, // optional: Css class for the corresponding tag. Use this to add custom style the pill corresponding to the node.
Copy file name to clipboardExpand all lines: docs/demo-data.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[{"label":"VP Accounting","tagClassName":"special","children":[{"label":"iWay","children":[{"label":"Universidad de Especialidades del Espíritu Santo"},{"label":"Marmara University"},{"label":"Baghdad College of Pharmacy"}]},{"label":"KDB","children":[{"label":"Latvian University of Agriculture"},{"label":"Dublin Institute of Technology"}]},{"label":"Justice","children":[{"label":"Baylor University"},{"label":"Massachusetts College of Art"},{"label":"Universidad Técnica Latinoamericana"},{"label":"Saint Louis College"},{"label":"Scott Christian University"}]},{"label":"Utilization Review","children":[{"label":"University of Minnesota - Twin Cities Campus"},{"label":"Moldova State Agricultural University"},{"label":"Andrews University"},{"label":"Usmanu Danfodiyo University Sokoto"}]},{"label":"Norton Utilities","children":[{"label":"Universidad Autónoma del Caribe"},{"label":"National University of Uzbekistan"},{"label":"Ladoke Akintola University of Technology"},{"label":"Kohat University of Science and Technology (KUST)"},{"label":"Hvanneyri Agricultural University"}]}]},
2
-
{"label":"Database Administrator III","children":[{"label":"TFS","children":[{"label":"University of Jazeera"},{"label":"Technical University of Crete"},{"label":"Ecole Nationale Supérieure d'Agronomie et des Industries Alimentaires"},{"label":"Ho Chi Minh City University of Natural Sciences"}]},{"label":"Overhaul","children":[{"label":"Technological University (Taunggyi)"},{"label":"Universidad de Las Palmas de Gran Canaria"},{"label":"Olympia College"},{"label":"Franklin and Marshall College"},{"label":"State University of New York College of Environmental Science and Forestry"}]},{"label":"GTK","children":[{"label":"Salisbury State University"},{"label":"Evangelische Fachhochschule für Religionspädagogik, und Gemeindediakonie Moritzburg"},{"label":"Kilimanjaro Christian Medical College"}]},{"label":"SRP","children":[{"label":"Toyo Gakuen University"},{"label":"Riyadh College of Dentistry and Pharmacy"},{"label":"Aichi Gakusen University"}]}]},
2
+
{"label":"Database Administrator III","disabled": true,"children":[{"label":"TFS","children":[{"label":"University of Jazeera"},{"label":"Technical University of Crete"},{"label":"Ecole Nationale Supérieure d'Agronomie et des Industries Alimentaires"},{"label":"Ho Chi Minh City University of Natural Sciences"}]},{"label":"Overhaul","children":[{"label":"Technological University (Taunggyi)"},{"label":"Universidad de Las Palmas de Gran Canaria"},{"label":"Olympia College"},{"label":"Franklin and Marshall College"},{"label":"State University of New York College of Environmental Science and Forestry"}]},{"label":"GTK","children":[{"label":"Salisbury State University"},{"label":"Evangelische Fachhochschule für Religionspädagogik, und Gemeindediakonie Moritzburg"},{"label":"Kilimanjaro Christian Medical College"}]},{"label":"SRP","children":[{"label":"Toyo Gakuen University"},{"label":"Riyadh College of Dentistry and Pharmacy"},{"label":"Aichi Gakusen University"}]}]},
3
3
{"label":"Assistant Manager","children":[{"label":"Risk Analysis","children":[{"label":"Seijo University"},{"label":"University of Economics Varna"},{"label":"College of Technology at Riyadh"}]},{"label":"UV Mapping","children":[{"label":"Universidad de La Sabana"},{"label":"Pamukkale University"}]}]},
4
4
{"label":"Quality Engineer","children":[{"label":"Enzyme Kinetics","children":[{"label":"Universidad del Valle de Guatemala"},{"label":"Ecole Nationale Supérieure d'Electronique, d'Electrotechnique, d'Informatique et d'Hydraulique de Toulouse"},{"label":"Kota Bharu Polytechnic"},{"label":"College of Technology at Kharj"}]},{"label":"Gastroenterology","children":[{"label":"Balochistan University of Engineering and Technology Khuzdar"},{"label":"Université de Cergy-Pontoise"},{"label":"Frederick University"}]},{"label":"ADP Payroll","children":[{"label":"National University"},{"label":"Ecole de l'Air"},{"label":"Vietnam National University of Agriculture"},{"label":"St. Petersburg State University of Aerospace Instrumentation"}]}]},
5
5
{"label":"Senior Sales Associate","children":[{"label":"RSVP","children":[{"label":"Islamic Azad University, Ahar"},{"label":"Okinawa International University"},{"label":"Karlshochschule International University"}]},{"label":"IxChariot","children":[{"label":"Cambodia University of Specialties"},{"label":"Ecole Supérieure des Techniques Industrielles et des Textiles"}]}]},
@@ -17,4 +17,4 @@
17
17
{"label":"Account Coordinator","children":[{"label":"Biostatistics","children":[{"label":"Al-Bukhari International University"},{"label":"Technical University of Denmark"},{"label":"Postgraduate lnstitute of Medical Education and Research"}]},{"label":"FM","children":[{"label":"University of Oxford"},{"label":"Lawrence University"},{"label":"Okayama University"}]},{"label":"Microsoft Certified Professional","children":[{"label":"Universidade Católica de Brasília"},{"label":"Georgia Institute of Technology"},{"label":"University of Petrosani"}]}]},
18
18
{"label":"Payment Adjustment Coordinator","children":[{"label":"Federal Grants Management","children":[{"label":"Christ University"},{"label":"Janos Selye University"},{"label":"Zagazig University"},{"label":"Constantin Brancoveanu University Pitesti"},{"label":"Southwest University of Political Science and Law"}]},{"label":"Company Set-up","children":[{"label":"Ball State University"},{"label":"Mustafa Kemal University"},{"label":"Transylvania University"}]},{"label":"CDMA","children":[{"label":"College of Telecommunication & Information "},{"label":"Nagasaki Prefectural University"},{"label":"Gustav-Siewerth-Akademie"}]},{"label":"Overhead Cranes","children":[{"label":"Universidad de Pamplona"},{"label":"Bindura University of Science Education"},{"label":"Daiichi University of Economics"},{"label":"Wirtschaftsuniversität Wien"}]},{"label":"CDO","children":[{"label":"Design Institute of San Diego"},{"label":"Wellspring University"},{"label":"Franciscan School of Theology"}]}]},
19
19
{"label":"Assistant Manager","children":[{"label":"SQL Server Management Studio","children":[{"label":"University of Sudbury"},{"label":"Evangelische Fachhochschule Berlin, Fachhochschule für Sozialarbeit und Sozialpädagogik"},{"label":"Vitebsk State University"},{"label":"San Jose Christian College"},{"label":"Ivanovo State University"}]},{"label":"Abstracting","children":[{"label":"Adeyemi College of Education"},{"label":"Université de Sherbrooke"},{"label":"University College of Applied Sciences"},{"label":"Johns Hopkins University, SAIS Bologna Center"}]},{"label":"WTL","children":[{"label":"Universidad de Córdoba"},{"label":"Institut National Polytechnique de Grenoble"},{"label":"Kyonggi University"}]}]},
20
-
{"label":"Professor","children":[{"label":"People Skills","children":[{"label":"University of Calcutta"},{"label":"Universidad del Valle del Cauca"},{"label":"FAST - National University of Computer and Emerging Sciences (NUCES)"}]},{"label":"Workforce Development","children":[{"label":"Shandong Medical University"},{"label":"Al Khawarizmi International College"},{"label":"Nippon Dental University"},{"label":"Komsomolsk-on-Amur State Technical University"},{"label":"Lingnan University"}]},{"label":"Digital Journalism","children":[{"label":"The College of St. Scholastica"},{"label":"Universidad Autónoma de la Ciudad de México"},{"label":"University of Information Technology and Management in Rzeszow"},{"label":"Liaquat University of Medical & Health Sciences Jamshoro"}]},{"label":"Short Films","children":[{"label":"Universidad Católica de Valencia"},{"label":"Columbia International University"},{"label":"Framingham State College"},{"label":"Gurukul University"},{"label":"NTI University"}]},{"label":"XML Programming","children":[{"label":"Victoria University"},{"label":"Andrews University"},{"label":"Centre Universitaire d'Oum El Bouaghi"},{"label":"Dilla University"}]}]}]
20
+
{"label":"Professor","children":[{"label":"People Skills","children":[{"label":"University of Calcutta"},{"label":"Universidad del Valle del Cauca"},{"label":"FAST - National University of Computer and Emerging Sciences (NUCES)"}]},{"label":"Workforce Development","children":[{"label":"Shandong Medical University"},{"label":"Al Khawarizmi International College"},{"label":"Nippon Dental University"},{"label":"Komsomolsk-on-Amur State Technical University"},{"label":"Lingnan University"}]},{"label":"Digital Journalism","children":[{"label":"The College of St. Scholastica"},{"label":"Universidad Autónoma de la Ciudad de México"},{"label":"University of Information Technology and Management in Rzeszow"},{"label":"Liaquat University of Medical & Health Sciences Jamshoro"}]},{"label":"Short Films","children":[{"label":"Universidad Católica de Valencia"},{"label":"Columbia International University"},{"label":"Framingham State College"},{"label":"Gurukul University"},{"label":"NTI University"}]},{"label":"XML Programming","children":[{"label":"Victoria University"},{"label":"Andrews University"},{"label":"Centre Universitaire d'Oum El Bouaghi"},{"label":"Dilla University"}]}]}]
0 commit comments