Skip to content

Commit

Permalink
Update Listbox.d.ts and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Dec 9, 2020
1 parent 61228ba commit 6a76deb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/listbox/ListBox.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface ListBoxProps {
metaKeySelection?: boolean;
filter?: boolean;
filterBy?: string;
filterValue?: string;
filterMatchMode?: string;
filterPlaceholder?: string;
filterLocale?: string;
Expand All @@ -26,6 +27,7 @@ interface ListBoxProps {
ariaLabelledBy?: string,
itemTemplate?(item: any): JSX.Element | undefined;
onChange?(e: {originalEvent: Event, value: any, target: {name: string, id: string, value: any}}): void;
onFilterValueChange?(e: {originalEvent: Event, value: string}): void;
}

export class ListBox extends React.Component<ListBoxProps,any> {}
16 changes: 15 additions & 1 deletion src/showcase/listbox/ListBoxDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ itemTemplate(option) {
<h5>Filtering</h5>
<p>Options can be filtered using an input field in the overlay by enabling the <i>filter</i> property. By default filtering is done against
label of the items and <i>filterBy</i> property is available to choose one or more properties of the options. In addition <i>filterMatchMode</i> can be utilized
to define the filtering algorithm, valid options are "contains" (default), "startsWith", "endsWith", "equals" and "notEquals".</p>
to define the filtering algorithm, valid options are "contains" (default), "startsWith", "endsWith", "equals" and "notEquals".
Also, the <i>filterValue</i> and <i>onFilterValueChange</i> properties can be used to control the filter value.</p>

<CodeHighlight>
{`
Expand Down Expand Up @@ -441,6 +442,12 @@ itemTemplate(option) {
<td>label</td>
<td>When filtering is enabled, filterBy decides which field or fields (comma separated) to search against.</td>
</tr>
<tr>
<td>filterValue</td>
<td>string</td>
<td>null</td>
<td>When specified, filter displays with this value.</td>
</tr>
<tr>
<td>filterMatchMode</td>
<td>string</td>
Expand Down Expand Up @@ -499,6 +506,13 @@ itemTemplate(option) {
</td>
<td>Callback to invoke when value of listbox changes.</td>
</tr>
<tr>
<td>onFilterValueChange</td>
<td>event.originalEvent: Browser event <br/>
event.value: the filtered value <br/>
</td>
<td>Callback to invoke when filter value changes.</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 6a76deb

Please sign in to comment.