Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 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,
}
mountDocument: PropTypes.object,
mountNode: customPropTypes.domNode,
mouseLeaveDelay: PropTypes.number,
offset: PropTypes.string,
on: PropTypes.oneOfType([
PropTypes.oneOf(['hover', 'click', 'focus', 'context']),
PropTypes.arrayOf(PropTypes.oneOf(['click', 'focus', 'context'])),
PropTypes.arrayOf(PropTypes.oneOf(['hover', 'focus', 'context'])),
]),
open: PropTypes.bool,
onOpenChange: PropTypes.func,
pointing: PropTypes.bool,
position: PropTypes.oneOf(POSITIONS),
renderContent: PropTypes.func,
target: PropTypes.any,
trigger: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.any]),
tabbableTrigger: PropTypes.bool,
unstable_pinned: PropTypes.bool,
content: customPropTypes.shorthandAllowingChildren,
contentRef: customPropTypes.ref,
trapFocus: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
autoFocus: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
}
static defaultProps: PopupProps = {
accessibility: popupBehavior,
align: 'start',
position: 'above',
on: 'click',
mouseLeaveDelay: 500,
tabbableTrigger: true,
}
static slotClassNames: AccordionSlotClassNames = {
content: `${Accordion.className}__content`,
title: `${Accordion.className}__title`,
}
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
activeIndex: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
]),
defaultActiveIndex: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number]),
]),
exclusive: PropTypes.bool,
expanded: PropTypes.bool,
onTitleClick: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.func]),
panels: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.arrayOf(
PropTypes.shape({
content: customPropTypes.itemShorthand,
title: customPropTypes.itemShorthand,
}),
),
]),
renderPanelTitle: PropTypes.func,
...commonPropTypes.createCommon({
children: false,
content: false,
}),
active: PropTypes.bool,
defaultActive: PropTypes.bool,
control: customPropTypes.itemShorthand,
iframe: customPropTypes.every([
customPropTypes.disallow(['video']),
customPropTypes.itemShorthand,
]),
onActiveChanged: PropTypes.func,
onClick: PropTypes.func,
placeholder: PropTypes.string,
video: customPropTypes.every([
customPropTypes.disallow(['iframe']),
customPropTypes.itemShorthand,
]),
}
static defaultProps = {
as: 'span',
accessibility: embedBehavior as Accessibility,
control: {},
}
static autoControlledProps = ['active']
static slotClassNames: EmbedSlotClassNames = {
control: `${Embed.className}__control`,
}
...commonPropTypes.createCommon({
content: 'shorthand',
}),
circular: PropTypes.bool,
disabled: PropTypes.bool,
fluid: PropTypes.bool,
icon: customPropTypes.itemShorthandWithoutJSX,
iconOnly: PropTypes.bool,
iconPosition: PropTypes.oneOf(['before', 'after']),
loader: customPropTypes.itemShorthandWithoutJSX,
loading: PropTypes.bool,
onClick: PropTypes.func,
onFocus: PropTypes.func,
primary: customPropTypes.every([customPropTypes.disallow(['secondary']), PropTypes.bool]),
text: PropTypes.bool,
secondary: customPropTypes.every([customPropTypes.disallow(['primary']), PropTypes.bool]),
size: customPropTypes.size,
}
static defaultProps = {
as: 'button',
accessibility: buttonBehavior as Accessibility,
size: 'medium',
}
static Group = ButtonGroup
actionHandlers = {
performClick: event => {
event.preventDefault()
this.handleClick(event)
},
class List extends AutoControlledComponent, ListState> {
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']
defaultOpen: PropTypes.bool,
mountDocument: PropTypes.object,
mountNode: customPropTypes.domNode,
mouseLeaveDelay: PropTypes.number,
offset: PropTypes.string,
on: PropTypes.oneOfType([
PropTypes.oneOf(['hover', 'click', 'focus', 'context']),
PropTypes.arrayOf(PropTypes.oneOf(['click', 'focus', 'context'])),
PropTypes.arrayOf(PropTypes.oneOf(['hover', 'focus', 'context'])),
]),
open: PropTypes.bool,
onMenuItemClick: PropTypes.func,
onOpenChange: PropTypes.func,
position: PropTypes.oneOf(POSITIONS),
target: PropTypes.any,
trigger: customPropTypes.every([customPropTypes.disallow(['children']), PropTypes.any]),
tabbableTrigger: PropTypes.bool,
unstable_pinned: PropTypes.bool,
menu: PropTypes.oneOfType([
customPropTypes.itemShorthandWithoutJSX,
PropTypes.arrayOf(customPropTypes.itemShorthandWithoutJSX),
]),
contextMenu: PropTypes.bool,
}
static defaultProps: MenuButtonProps = {
accessibility: menuButtonBehavior,
align: 'start',
position: 'below',
}
static autoControlledProps = ['open']
class CarouselNavigation extends UIComponent> {
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),
})
/**
* Component represents a single row in a tabular structure
*/
class TableRow extends UIComponent, any> {
static displayName = 'TableRow'
static className = 'ui-table__row'
static create: ShorthandFactory
static propTypes = {
...commonPropTypes.createCommon({
content: false,
}),
content: customPropTypes.every([
customPropTypes.disallow(['children']),
PropTypes.oneOfType([
PropTypes.arrayOf(customPropTypes.nodeContent),
customPropTypes.nodeContent,
]),
]),
items: customPropTypes.collectionShorthand,
header: PropTypes.bool,
compact: PropTypes.bool,
}
static defaultProps = {
as: 'div',
accessibility: tableRowBehavior as Accessibility,
}
renderCells(variables: ComponentVariablesObject) {