File tree Expand file tree Collapse file tree 7 files changed +18
-19
lines changed
docs/documentation/docs/controls Expand file tree Collapse file tree 7 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,10 @@ The `FilterBar` control can be configured with the following properties:
79
79
| onRemoveFilter | (label: string, value: string) => void | no | Callback function called after clicking a singular filter pill | |
80
80
81
81
## IFilterBarItem
82
- | Property | Type | Required | Description | Default |
83
- | ---- | ---- | ---- | ---- | ---- |
84
- | label | string | yes | Filter label | |
85
- | value | string | yes | Filter value | |
86
82
83
+ | Property | Type | Required | Description | Default |
84
+ | -------- | ------ | -------- | ------------ | ------- |
85
+ | label | string | yes | Filter label | |
86
+ | value | string | yes | Filter value | |
87
87
88
88
![ ] ( https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/FilterBar )
Original file line number Diff line number Diff line change 36
36
"@fluentui/styles" : " 0.66.5" ,
37
37
"@fluentui/theme" : " ^2.6.6" ,
38
38
"@iconify/react" : " ^4.1.1" ,
39
- "@juggle/resize-observer" : " ^ 3.4.0" ,
39
+ "@juggle/resize-observer" : " 3.4.0" ,
40
40
"@microsoft/decorators" : " 1.20.0" ,
41
41
"@microsoft/mgt-react" : " 3.1.3" ,
42
42
"@microsoft/mgt-spfx" : " 3.1.3" ,
55
55
"@microsoft/sp-property-pane" : " 1.20.0" ,
56
56
"@microsoft/sp-webpart-base" : " 1.20.0" ,
57
57
"@monaco-editor/loader" : " ^1.3.1" ,
58
- "@nuvemerudita/react-controls" : " ^ 1.0.0" ,
58
+ "@nuvemerudita/react-controls" : " 1.0.0" ,
59
59
"@pnp/common" : " 2.5.0" ,
60
60
"@pnp/odata" : " 2.5.0" ,
61
61
"@pnp/sp" : " 2.5.0" ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export interface IFilterPillBarProps {
31
31
32
32
export const FilterBar : React . FunctionComponent < IFilterPillBarProps > = ( props : IFilterPillBarProps ) => {
33
33
34
- const orderedArray = ( arr : IFilterBarItem [ ] ) => {
34
+ const orderedArray = ( arr : IFilterBarItem [ ] ) : IFilterBarItem [ ] => {
35
35
const ret : IFilterBarItem [ ] = [ ] ;
36
36
arr . map ( i => {
37
37
const index = findLastIndex ( ret , r => r . label === i . label ) ;
@@ -65,14 +65,14 @@ export const FilterBar: React.FunctionComponent<IFilterPillBarProps> = (props: I
65
65
return acc ;
66
66
} , [ ] ) ;
67
67
68
- const clearAll = ( ) => {
68
+ const clearAll = ( ) : void => {
69
69
70
70
if ( props . onClearFilters ) {
71
71
props . onClearFilters ( ) ;
72
72
}
73
73
}
74
74
75
- const pillClick = ( label ?: string , value ?: string ) => {
75
+ const pillClick = ( label ?: string , value ?: string ) : void => {
76
76
console . log ( label , value ) ;
77
77
if ( props . onRemoveFilter ) {
78
78
props . onRemoveFilter ( label as string , value as string ) ;
Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ export interface IOverflowPillProps {
12
12
items : IFilterBarItemGroup [ ] ;
13
13
}
14
14
15
- export const OverflowPill = ( props : IOverflowPillProps ) => {
15
+ export const OverflowPill = ( props : IOverflowPillProps ) : JSX . Element => {
16
16
const [ overlayVisible , { toggle : toggleOverlayVisible } ] = useBoolean ( false ) ;
17
17
const divId = useId ( 'callout-div' ) ;
18
18
19
19
const onClick : React . MouseEventHandler < HTMLDivElement > = ( event ) => {
20
20
toggleOverlayVisible ( ) ;
21
21
}
22
22
23
- const pillClick = ( label , value ) => {
23
+ const pillClick = ( label , value ) : void => {
24
24
if ( props . onClick )
25
25
{
26
26
props . onClick ( label , value ) ;
Original file line number Diff line number Diff line change @@ -10,15 +10,16 @@ export interface IPillProps {
10
10
value ?: string ;
11
11
field ?: string ;
12
12
}
13
- export const Pill = ( props : IPillProps ) => {
13
+ export const Pill = ( props : IPillProps ) : JSX . Element => {
14
14
15
- const onClick = ( event ) => {
15
+ const onClick = ( event ) : void => {
16
16
if ( props . onClick )
17
17
{
18
18
props . onClick ( props . field , props . value ) ;
19
19
}
20
20
}
21
21
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
23
const buttonProps : any = {
23
24
title : props . clearAll ? strings . ClearAllFiltersTitle : strings . ClearFilterTitle ,
24
25
className : `${ styles . pill } ${ props . clearAll ? `${ styles . pill } ${ styles . clearAll } ` : "" } ` ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export interface IPillGroupProps {
10
10
11
11
export const PillGroup : React . FunctionComponent < IPillGroupProps > = ( props ) => {
12
12
13
- const onClick = ( label , value ) => {
13
+ const onClick = ( label , value ) : void => {
14
14
if ( props . onRemoveFilter )
15
15
{
16
16
props . onRemoveFilter ( label , value ) ;
You can’t perform that action at this time.
0 commit comments