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 5
5
### New Features
6
6
7
7
* [ #79 ] : Add ` showExpandAll ` property to give the user the ability to expand or collapse all nodes in the tree
8
+ * [ #96 ] : Add TypeScript definitions
8
9
* [ #102 ] : Add ` icons ` property to allow specification of icon components
9
10
* [ #103 ] : Add ` title ` node property and ` showNodeTitle ` tree property
10
11
* [ #108 ] : Add ` lang ` property for language customization
Original file line number Diff line number Diff line change 34
34
"@babel/preset-env" : " ^7.0.0" ,
35
35
"@babel/preset-react" : " ^7.0.0" ,
36
36
"@babel/register" : " ^7.0.0" ,
37
+ "@types/react" : " ^16.4.13" ,
37
38
"babel-eslint" : " ^9.0.0" ,
38
39
"babel-loader" : " ^8.0.0" ,
39
40
"browser-sync" : " ^2.18.6" ,
Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+
1
3
declare module "react-checkbox-tree" {
2
4
interface Node {
3
5
label : string ;
@@ -9,6 +11,22 @@ declare module "react-checkbox-tree" {
9
11
showCheckbox ?: boolean ;
10
12
}
11
13
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
+
12
30
interface CheckboxProps {
13
31
nodes : Array < Node > ;
14
32
checked : Array < string > ;
@@ -19,15 +37,19 @@ declare module "react-checkbox-tree" {
19
37
disabled ?: boolean ;
20
38
expandDisabled ?: boolean ;
21
39
expandOnClick ?: boolean ;
40
+ icons ?: Icons ;
41
+ lang ?: Language ;
22
42
name ?: string ;
23
43
nameAsArray ?: boolean ;
24
44
nativeCheckboxes ?: boolean ;
25
45
noCascade ?: boolean ;
26
46
onlyLeafCheckboxes ?: boolean ;
27
47
optimisticToggle ?: boolean ;
48
+ showExpandAll ?: boolean ;
28
49
showNodeIcon ?: boolean ;
50
+ showNodeTitles ?: boolean ;
29
51
onClick ?: ( event : { checked : boolean , value : any } ) => void ;
30
52
}
31
53
32
54
export default class CheckboxTree extends React . Component < CheckboxProps > { }
33
- }
55
+ }
You can’t perform that action at this time.
0 commit comments