@@ -6,31 +6,31 @@ import AccordionStore, {
6
6
InjectedHeadingAttributes ,
7
7
InjectedPanelAttributes ,
8
8
} from '../helpers/AccordionStore' ;
9
- import { UUID } from './ItemContext' ;
9
+ import { ID } from './ItemContext' ;
10
10
11
11
export interface ProviderProps {
12
- preExpanded ?: UUID [ ] ;
12
+ preExpanded ?: ID [ ] ;
13
13
allowMultipleExpanded ?: boolean ;
14
14
allowZeroExpanded ?: boolean ;
15
15
children ?: React . ReactNode ;
16
- onChange ?( args : UUID [ ] ) : void ;
16
+ onChange ?( args : ID [ ] ) : void ;
17
17
}
18
18
19
19
type ProviderState = AccordionStore ;
20
20
21
21
export interface AccordionContext {
22
22
allowMultipleExpanded : boolean ;
23
23
allowZeroExpanded : boolean ;
24
- toggleExpanded ( uuid : UUID ) : void ;
25
- isItemDisabled ( uuid : UUID ) : boolean ;
26
- isItemExpanded ( uuid : UUID ) : boolean ;
24
+ toggleExpanded ( uuid : ID ) : void ;
25
+ isItemDisabled ( uuid : ID ) : boolean ;
26
+ isItemExpanded ( uuid : ID ) : boolean ;
27
27
getPanelAttributes (
28
- uuid : UUID ,
28
+ uuid : ID ,
29
29
dangerouslySetExpanded ?: boolean ,
30
30
) : InjectedPanelAttributes ;
31
- getHeadingAttributes ( uuid : UUID ) : InjectedHeadingAttributes ;
31
+ getHeadingAttributes ( uuid : ID ) : InjectedHeadingAttributes ;
32
32
getButtonAttributes (
33
- uuid : UUID ,
33
+ uuid : ID ,
34
34
dangerouslySetExpanded ?: boolean ,
35
35
) : InjectedButtonAttributes ;
36
36
}
@@ -52,7 +52,7 @@ export class Provider extends React.PureComponent<
52
52
allowZeroExpanded : this . props . allowZeroExpanded ,
53
53
} ) ;
54
54
55
- toggleExpanded = ( key : UUID ) : void => {
55
+ toggleExpanded = ( key : ID ) : void => {
56
56
this . setState (
57
57
( state : Readonly < ProviderState > ) => state . toggleExpanded ( key ) ,
58
58
( ) => {
@@ -63,16 +63,16 @@ export class Provider extends React.PureComponent<
63
63
) ;
64
64
} ;
65
65
66
- isItemDisabled = ( key : UUID ) : boolean => {
66
+ isItemDisabled = ( key : ID ) : boolean => {
67
67
return this . state . isItemDisabled ( key ) ;
68
68
} ;
69
69
70
- isItemExpanded = ( key : UUID ) : boolean => {
70
+ isItemExpanded = ( key : ID ) : boolean => {
71
71
return this . state . isItemExpanded ( key ) ;
72
72
} ;
73
73
74
74
getPanelAttributes = (
75
- key : UUID ,
75
+ key : ID ,
76
76
dangerouslySetExpanded ?: boolean ,
77
77
) : InjectedPanelAttributes => {
78
78
return this . state . getPanelAttributes ( key , dangerouslySetExpanded ) ;
@@ -84,7 +84,7 @@ export class Provider extends React.PureComponent<
84
84
} ;
85
85
86
86
getButtonAttributes = (
87
- key : UUID ,
87
+ key : ID ,
88
88
dangerouslySetExpanded ?: boolean ,
89
89
) : InjectedButtonAttributes => {
90
90
return this . state . getButtonAttributes ( key , dangerouslySetExpanded ) ;
0 commit comments