Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
button: customPropTypes.itemShorthand,
defaultOpen: PropTypes.bool,
menu: PropTypes.oneOfType([
customPropTypes.itemShorthand,
PropTypes.arrayOf(customPropTypes.itemShorthandWithoutJSX),
]),
onMainButtonClick: PropTypes.func,
onMenuItemClick: PropTypes.func,
onOpenChange: PropTypes.func,
open: PropTypes.bool,
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
toggleButton: customPropTypes.itemShorthand,
}
static defaultProps = {
accessibility: splitButtonBehavior,
as: 'span',
toggleButton: {},
}
static autoControlledProps = ['open']
getInitialAutoControlledState(): SplitButtonState {
return {
isFromKeyboard: false,
open: false,
animated: false,
as: false,
content: false,
}),
align: PropTypes.oneOf(ALIGNMENTS),
defaultOpen: PropTypes.bool,
inline: PropTypes.bool,
mountNode: customPropTypes.domNode,
mouseLeaveDelay: PropTypes.number,
offset: PropTypes.string,
open: PropTypes.bool,
onOpenChange: PropTypes.func,
pointing: PropTypes.bool,
position: PropTypes.oneOf(POSITIONS),
target: customPropTypes.domNode,
trigger: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.element]),
content: customPropTypes.shorthandAllowingChildren,
}
static defaultProps: TooltipProps = {
align: 'center',
position: 'above',
mouseLeaveDelay: 10,
pointing: true,
accessibility: tooltipAsLabelBehavior,
}
static autoControlledProps = ['open']
static create: ShorthandFactory
pointerTargetRef = React.createRef()
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
activeIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
defaultActiveIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
fluid: PropTypes.bool,
iconOnly: PropTypes.bool,
items: customPropTypes.collectionShorthandWithKindProp(['divider', 'item']),
onItemClick: PropTypes.func,
pills: PropTypes.bool,
pointing: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['start', 'end'])]),
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
underlined: PropTypes.bool,
vertical: PropTypes.bool,
submenu: PropTypes.bool,
indicator: customPropTypes.itemShorthandWithoutJSX,
}
static defaultProps = {
as: 'ul',
accessibility: menuBehavior as Accessibility,
}
static autoControlledProps = ['activeIndex']
static Item = MenuItem
static Divider = MenuDivider
class CarouselNavigationItem extends UIComponent> {
static displayName = 'CarouselNavigationItem'
static className = 'ui-carousel__navigationitem'
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon(),
active: PropTypes.bool,
icon: customPropTypes.itemShorthandWithoutJSX,
iconOnly: PropTypes.bool,
index: PropTypes.number,
onClick: PropTypes.func,
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
vertical: PropTypes.bool,
}
static defaultProps = {
accessibility: tabBehavior as Accessibility,
as: 'li',
icon: { name: 'icon-circle', size: 'smallest' as SizeValue },
}
renderComponent({ ElementType, classes, accessibility, styles, variables, unhandledProps }) {
const { children, content, icon } = this.props
return childrenExist(children) ? (
children
) : (
static displayName = 'List'
static className = 'ui-list'
static slotClassNames: ListSlotClassNames = {
item: `${List.className}__item`,
}
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
debug: PropTypes.bool,
items: customPropTypes.collectionShorthand,
selectable: customPropTypes.every([customPropTypes.disallow(['navigable']), PropTypes.bool]),
navigable: customPropTypes.every([customPropTypes.disallow(['selectable']), PropTypes.bool]),
truncateContent: PropTypes.bool,
truncateHeader: PropTypes.bool,
selectedIndex: PropTypes.number,
defaultSelectedIndex: PropTypes.number,
onSelectedIndexChange: PropTypes.func,
horizontal: PropTypes.bool,
}
static defaultProps = {
as: 'ul',
accessibility: listBehavior as Accessibility,
}
static autoControlledProps = ['selectedIndex']
getInitialAutoControlledState() {
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
activeIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
defaultActiveIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
fluid: PropTypes.bool,
iconOnly: PropTypes.bool,
items: customPropTypes.collectionShorthandWithKindProp(['divider', 'item']),
onItemClick: PropTypes.func,
pills: PropTypes.bool,
pointing: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['start', 'end'])]),
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
underlined: PropTypes.bool,
vertical: PropTypes.bool,
submenu: PropTypes.bool,
indicator: customPropTypes.itemShorthandWithoutJSX,
}
static defaultProps = {
as: 'ul',
accessibility: menuBehavior as Accessibility,
}
static autoControlledProps = ['activeIndex']
static Item = MenuItem
static Divider = MenuDivider
static displayName = 'CarouselNavigation'
static className = 'ui-carousel__navigation'
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
activeIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
iconOnly: PropTypes.bool,
items: customPropTypes.collectionShorthand,
onItemClick: PropTypes.func,
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
vertical: PropTypes.bool,
}
static defaultProps = {
accessibility: tabListBehavior,
as: 'ul',
}
handleItemOverrides = variables => predefinedProps => ({
onClick: (e, itemProps) => {
_.invoke(this.props, 'onItemClick', e, itemProps)
_.invoke(predefinedProps, 'onClick', e, itemProps)
},
variables: mergeComponentVariables(variables, predefinedProps.variables),
})