Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
placeholder: PropTypes.node.description(
'Placeholder to use when no value is provided.',
),
plain: PropTypes.bool.description(
`Whether this is a plain input with no border or padding.
Only use this when the containing context provides sufficient affordance`,
),
size: PropTypes.oneOfType([
PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']),
PropTypes.string,
]).description('The size of the TextInput.'),
suggestions: PropTypes.arrayOf(
PropTypes.oneOfType([
PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any,
}),
PropTypes.string,
]),
).description(
`Suggestions to show. It is recommended to avoid showing too many
suggestions and instead rely on the user to type more.`,
),
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]).description('What text to put in the input.'),
};
return DocumentedTextInput;
};
PropTypes.string,
PropTypes.node,
]).description('Placeholder to use when no value is provided.'),
plain: PropTypes.bool.description(
`Whether this is a plain input with no border or padding.
Only use this when the containing context provides sufficient affordance`,
),
size: PropTypes.oneOfType([
PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']),
PropTypes.string,
]).description('The size of the TextInput.'),
suggestions: PropTypes.arrayOf(
PropTypes.oneOfType([
PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any,
}),
PropTypes.string,
]),
).description(
`Suggestions to show. It is recommended to avoid showing too many
suggestions and instead rely on the user to type more.`,
),
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
]).description('What text to put in the input.'),
};
return DocumentedTextInput;
};
export default (function (InfiniteScroll) {
var DocumentedInfiniteScroll = describe(InfiniteScroll).availableAt(getAvailableAtBadge('InfiniteScroll')).description('A container that lazily renders items.').usage('import { InfiniteScroll } from \'grommet\';\n');
DocumentedInfiniteScroll.propTypes = {
children: PropTypes.func.description('Function that will be called when each item is rendered.'),
items: PropTypes.arrayOf(PropTypes.any).description('The children callback will be called to render each item.'),
onMore: PropTypes.func.description('Use this to indicate that \'items\' doesn\'t contain all that it could.\n It will be called when the entire list of items has been rendered.\n This might be used when the total number of items that could be retrieved\n is more than you\'d want to load into the browser. \'onMore\' allows you\n to lazily fetch more from the server only when needed.'),
renderMarker: PropTypes.func.description('Function that will be called to render the marker element that\n is inserted into the DOM to track when scrolling nears the end of the\n rendered items. It will be called with a single element that should\n be wrapped appropriately. This is needed when the default\n element, a <span>, isn\'t sufficient, such as a row of a table body.'),
scrollableAncestor: PropTypes.oneOfType([PropTypes.node, PropTypes.oneOf(['window'])]).description('A custom ancestor to determine if the marker is visible in it.\n This is useful in cases where you do not want the immediate\n scrollable ancestor to be the container. For example, when your\n marker is in a div that has overflow auto but you are detecting\n visibility based on the window.\n This should typically be a reference to a DOM node, but it will\n also work to pass it the string "window" if you are using server\n rendering.'),
show: PropTypes.number.description('Ensure that the item at this index is visible initially.'),
step: PropTypes.number.description('How many items to render at a time.').defaultValue(50)
};
return DocumentedInfiniteScroll;
});</span>
enterSelect: '(Press Enter to Select)',
suggestionsCount: 'suggestions available',
suggestionsExist: 'This input has suggestions use arrow keys to navigate',
suggestionIsOpen: 'Suggestions drop is open, continue to use arrow keys to navigate'
}),
name: PropTypes.string.description('The name attribute of the input.'),
onChange: PropTypes.func.description('Function that will be called when the user types in the input.'),
onSelect: PropTypes.func.description("Function that will be called when the user selects a suggestion.\nThe suggestion contains the object chosen from the supplied suggestions."),
onSuggestionsOpen: PropTypes.func.description('Function that will be called when the suggestions drop is opened.'),
onSuggestionsClose: PropTypes.func.description('Function that will be called when the suggestions drop is closed.'),
placeholder: PropTypes.node.description('Placeholder to use when no value is provided.'),
plain: PropTypes.bool.description("Whether this is a plain input with no border or padding.\nOnly use this when the containing context provides sufficient affordance"),
size: PropTypes.oneOfType([PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']), PropTypes.string]).description('The size of the TextInput.'),
suggestions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any
}), PropTypes.string])).description("Suggestions to show. It is recommended to avoid showing too many\nsuggestions and instead rely on the user to type more."),
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('What text to put in the input.')
};
return DocumentedTextInput;
};
export var themeDoc = _extends({
export const doc = InfiniteScroll => {
const DocumentedInfiniteScroll = describe(InfiniteScroll)
.availableAt(getAvailableAtBadge('InfiniteScroll'))
.description('A container that lazily renders items.')
.usage(
`import { InfiniteScroll } from 'grommet';
`,
);
DocumentedInfiniteScroll.propTypes = {
children: PropTypes.func.description(
'Function that will be called when each item is rendered.',
),
items: PropTypes.arrayOf(PropTypes.any).description(
'The children callback will be called to render each item.',
),
onMore: PropTypes.func.description(
`Use this to indicate that 'items' doesn't contain all that it could.
It will be called when the entire list of items has been rendered.
This might be used when the total number of items that could be retrieved
is more than you'd want to load into the browser. 'onMore' allows you
to lazily fetch more from the server only when needed.`,
),
renderMarker: PropTypes.func.description(
`Function that will be called to render the marker element that
is inserted into the DOM to track when scrolling nears the end of the
rendered items. It will be called with a single element that should
be wrapped appropriately. This is needed when the default
element, a <span>, isn't sufficient, such as a row of a table body.`,
),</span>
suggestionIsOpen: PropTypes.string
}).description('Custom messages for TextInput. Used for accessibility by screen readers.').defaultValue({
enterSelect: '(Press Enter to Select)',
suggestionsCount: 'suggestions available',
suggestionsExist: 'This input has suggestions use arrow keys to navigate',
suggestionIsOpen: 'Suggestions drop is open, continue to use arrow keys to navigate'
}),
name: PropTypes.string.description('The name attribute of the input.'),
onInput: PropTypes.func.description('Function that will be called when the user types in the input.'),
onSelect: PropTypes.func.description('Function that will be called when the user selects a suggestion.\nThe suggestion contains the object chosen from the supplied suggestions.'),
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).description('Placeholder to use when no value is provided.'),
plain: PropTypes.bool.description('Whether this is a plain input with no border or padding.\nOnly use this when the containing context provides sufficient affordance'),
size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']).description('The size of the TextInput.'),
suggestions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any
}), PropTypes.string])).description('Suggestions to show. It is recommended to avoid showing too many\nsuggestions and instead rely on the user to type more.'),
value: PropTypes.string.description('What text to put in the input.')
};
return DocumentedTextInput;
});