Skip to content

Commit

Permalink
Fix EuiSearchBar's proptype docs around FieldValueToggleGroupFilter (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall authored Feb 11, 2019
1 parent b41986b commit 7b7b626
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
25 changes: 24 additions & 1 deletion src-docs/src/views/search_bar/props_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export const propsInfo = {
items: {
description: 'A list of field value filters that are part of this group',
required: true,
type: { name: '#FieldValueToggleGroupItem[]' }
type: { name: '#FieldValueToggleGroupFilterItemType[]' }
},
available: {
description: 'Called to check whether this filter is currently available. If not, it will not be shown',
Expand All @@ -329,6 +329,29 @@ export const propsInfo = {
}
},

FieldValueToggleGroupFilterItemType: {
__docgenInfo: {
_euiObjectType: 'type',
props: {
value: {
description: 'Value of the filter item',
required: true,
type: { name: 'string | number | boolean' }
},
name: {
description: 'Name rendered on the filter button',
required: true,
type: { name: 'string' }
},
negatedName: {
description: 'Name rendered on the filter button when its value is negated in the query',
required: false,
type: { name: 'string' }
},
}
}
},

ExecuteQueryOptions: {
__docgenInfo: {
_euiObjectType: 'type',
Expand Down
14 changes: 6 additions & 8 deletions src-docs/src/views/search_bar/search_bar_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,21 @@ export const SearchBarExample = {
<EuiCode>created:&apos;2019-01-01&apos;</EuiCode>,&nbsp;
<EuiCode>created&gt;=&apos;3rd January 2017&apos;</EuiCode>
</p>
<p>
<div>
Formats understood by the parser
<ul>
<li>
<p>relative</p>
relative
<ul>
<li><EuiCode>yesterday</EuiCode></li>
<li><EuiCode>today</EuiCode></li>
<li><EuiCode>tomorrow</EuiCode></li>
</ul>
</li>
<li>
<p>
absolute (parsed by Moment.js&apos;s&nbsp;
<EuiLink href="https://momentjs.com/docs/#/parsing/utc/" target="_blank">`utc` method</EuiLink>
)
</p>
absolute (parsed by Moment.js&apos;s&nbsp;
<EuiLink href="https://momentjs.com/docs/#/parsing/utc/" target="_blank">`utc` method</EuiLink>
)
<ul>
<li><EuiCode>ddd</EuiCode></li>
<li><EuiCode>dddd</EuiCode></li>
Expand All @@ -145,7 +143,7 @@ export const SearchBarExample = {
</ul>
</li>
</ul>
</p>
</div>
</div>
),
props: propsInfo,
Expand Down

0 comments on commit 7b7b626

Please sign in to comment.