Skip to content

Commit c25e643

Browse files
Specify exact versions of new packages, add missing return type on FilterBar components, format linked doc file
1 parent ecec61a commit c25e643

File tree

7 files changed

+18
-19
lines changed

7 files changed

+18
-19
lines changed

docs/documentation/docs/controls/FilterBar.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ The `FilterBar` control can be configured with the following properties:
7979
| onRemoveFilter | (label: string, value: string) => void | no | Callback function called after clicking a singular filter pill | |
8080

8181
## IFilterBarItem
82-
| Property | Type | Required | Description | Default |
83-
| ---- | ---- | ---- | ---- | ---- |
84-
| label | string | yes | Filter label | |
85-
| value | string | yes | Filter value | |
8682

83+
| Property | Type | Required | Description | Default |
84+
| -------- | ------ | -------- | ------------ | ------- |
85+
| label | string | yes | Filter label | |
86+
| value | string | yes | Filter value | |
8787

8888
![](https://telemetry.sharepointpnp.com/sp-dev-fx-controls-react/wiki/controls/FilterBar)

package-lock.json

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@fluentui/styles": "0.66.5",
3737
"@fluentui/theme": "^2.6.6",
3838
"@iconify/react": "^4.1.1",
39-
"@juggle/resize-observer": "^3.4.0",
39+
"@juggle/resize-observer": "3.4.0",
4040
"@microsoft/decorators": "1.20.0",
4141
"@microsoft/mgt-react": "3.1.3",
4242
"@microsoft/mgt-spfx": "3.1.3",
@@ -55,7 +55,7 @@
5555
"@microsoft/sp-property-pane": "1.20.0",
5656
"@microsoft/sp-webpart-base": "1.20.0",
5757
"@monaco-editor/loader": "^1.3.1",
58-
"@nuvemerudita/react-controls": "^1.0.0",
58+
"@nuvemerudita/react-controls": "1.0.0",
5959
"@pnp/common": "2.5.0",
6060
"@pnp/odata": "2.5.0",
6161
"@pnp/sp": "2.5.0",

src/controls/filterBar/FilterlBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface IFilterPillBarProps {
3131

3232
export const FilterBar: React.FunctionComponent<IFilterPillBarProps> = (props: IFilterPillBarProps) => {
3333

34-
const orderedArray = (arr: IFilterBarItem[]) => {
34+
const orderedArray = (arr: IFilterBarItem[]): IFilterBarItem[] => {
3535
const ret: IFilterBarItem[] = [];
3636
arr.map(i => {
3737
const index = findLastIndex(ret, r => r.label === i.label);
@@ -65,14 +65,14 @@ export const FilterBar: React.FunctionComponent<IFilterPillBarProps> = (props: I
6565
return acc;
6666
}, []);
6767

68-
const clearAll = () => {
68+
const clearAll = (): void => {
6969

7070
if (props.onClearFilters) {
7171
props.onClearFilters();
7272
}
7373
}
7474

75-
const pillClick = (label?: string, value?: string) => {
75+
const pillClick = (label?: string, value?: string): void => {
7676
console.log(label, value);
7777
if (props.onRemoveFilter) {
7878
props.onRemoveFilter(label as string, value as string);

src/controls/filterBar/OverflowPill.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export interface IOverflowPillProps {
1212
items: IFilterBarItemGroup[];
1313
}
1414

15-
export const OverflowPill = (props: IOverflowPillProps) => {
15+
export const OverflowPill = (props: IOverflowPillProps): JSX.Element => {
1616
const [overlayVisible, {toggle: toggleOverlayVisible}] = useBoolean(false);
1717
const divId = useId('callout-div');
1818

1919
const onClick: React.MouseEventHandler<HTMLDivElement> = (event) => {
2020
toggleOverlayVisible();
2121
}
2222

23-
const pillClick = (label, value) => {
23+
const pillClick = (label, value): void => {
2424
if (props.onClick)
2525
{
2626
props.onClick(label, value);

src/controls/filterBar/Pill.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ export interface IPillProps {
1010
value?: string;
1111
field?: string;
1212
}
13-
export const Pill = (props: IPillProps) => {
13+
export const Pill = (props: IPillProps): JSX.Element => {
1414

15-
const onClick = (event) => {
15+
const onClick = (event): void => {
1616
if (props.onClick)
1717
{
1818
props.onClick(props.field, props.value);
1919
}
2020
}
2121

22+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2223
const buttonProps: any = {
2324
title: props.clearAll ? strings.ClearAllFiltersTitle: strings.ClearFilterTitle,
2425
className: `${styles.pill} ${props.clearAll ? `${styles.pill} ${styles.clearAll}` : ""}`,

src/controls/filterBar/PillGroup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface IPillGroupProps {
1010

1111
export const PillGroup: React.FunctionComponent<IPillGroupProps> = (props) => {
1212

13-
const onClick = (label, value) => {
13+
const onClick = (label, value): void => {
1414
if (props.onRemoveFilter)
1515
{
1616
props.onRemoveFilter(label, value);

0 commit comments

Comments
 (0)