File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 55### New Features
66
77* [ #79 ] : Add ` showExpandAll ` property to give the user the ability to expand or collapse all nodes in the tree
8+ * [ #96 ] : Add TypeScript definitions
89* [ #102 ] : Add ` icons ` property to allow specification of icon components
910* [ #103 ] : Add ` title ` node property and ` showNodeTitle ` tree property
1011* [ #108 ] : Add ` lang ` property for language customization
Original file line number Diff line number Diff line change 3434 "@babel/preset-env" : " ^7.0.0" ,
3535 "@babel/preset-react" : " ^7.0.0" ,
3636 "@babel/register" : " ^7.0.0" ,
37+ "@types/react" : " ^16.4.13" ,
3738 "babel-eslint" : " ^9.0.0" ,
3839 "babel-loader" : " ^8.0.0" ,
3940 "browser-sync" : " ^2.18.6" ,
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
13declare module "react-checkbox-tree" {
24 interface Node {
35 label : string ;
@@ -9,6 +11,22 @@ declare module "react-checkbox-tree" {
911 showCheckbox ?: boolean ;
1012 }
1113
14+ interface Icons {
15+ check ?: JSX . Element ;
16+ uncheck ?: JSX . Element ;
17+ halfCheck ?: JSX . Element ;
18+ expandClose ?: JSX . Element ;
19+ parentClose ?: JSX . Element ;
20+ parentOpen ?: JSX . Element ;
21+ leaf ?: JSX . Element ;
22+ }
23+
24+ interface Language {
25+ collapseAll : string ;
26+ expandAll : string ;
27+ toggle : string ;
28+ }
29+
1230 interface CheckboxProps {
1331 nodes : Array < Node > ;
1432 checked : Array < string > ;
@@ -19,15 +37,19 @@ declare module "react-checkbox-tree" {
1937 disabled ?: boolean ;
2038 expandDisabled ?: boolean ;
2139 expandOnClick ?: boolean ;
40+ icons ?: Icons ;
41+ lang ?: Language ;
2242 name ?: string ;
2343 nameAsArray ?: boolean ;
2444 nativeCheckboxes ?: boolean ;
2545 noCascade ?: boolean ;
2646 onlyLeafCheckboxes ?: boolean ;
2747 optimisticToggle ?: boolean ;
48+ showExpandAll ?: boolean ;
2849 showNodeIcon ?: boolean ;
50+ showNodeTitles ?: boolean ;
2951 onClick ?: ( event : { checked : boolean , value : any } ) => void ;
3052 }
3153
3254 export default class CheckboxTree extends React . Component < CheckboxProps > { }
33- }
55+ }
You can’t perform that action at this time.
0 commit comments