Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// consolidating the label and aria-valuetext to put in aria-label because
// NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
// But leaving aria-valuetext because JAWS ignores aria-label
const labelAndValueText = `${label} ${valueText}`
const value = (typeof formatDisplayedValue === 'function') && formatDisplayedValue(valueNow, valueMax)
const style = this.state.animateOnMount ? null : {
strokeDashoffset: `${this.dashOffset()}em`
}
const radius = this.radius()
const passthroughProps = View.omitViewProps(
omitProps(this.props, ProgressCircle.propTypes, ['animateOnMount']),
ProgressCircle
)
return (
render () {
const ElementType = getElementType(Dialog, this.props)
return this.props.open ? (
{this.props.children}
) : null
}
}
elementRef,
focused,
href,
margin,
onClick,
role,
shape,
className, // eslint-disable-line react/prop-types
to, // eslint-disable-line react/prop-types
width,
tabIndex,
...props
} = this.props
const passthroughProps = View.omitViewProps(
omitProps(props, FocusableView.propTypes),
FocusableView
)
return (
if (process.env.NODE_ENV !== 'production') {
// show warning if icon is added as a child
if (this.hasVisibleChildren) {
React.Children.forEach(children, (child) => {
const icon = child && child.type && typeof child.type.glyphName !== 'undefined'
warn(
!icon,
`[Button] Icons as children is deprecated. Please use the 'icon' prop instead.`
)
})
}
}
// warn for unallowed view props
const passthroughProps = View.omitViewProps(
omitProps(this.props, Button.propTypes),
Button
)
return (
const { allowMultiple, disabled, readOnly, interaction } = this.props
const id = this.props.id || this.defaultId
// make readonly input functionally disabled
const functionallyDisabled = disabled || readOnly ||
interaction === 'disabled' || interaction === 'readonly'
const classes = {
[styles.label]: true,
[styles.functionallyDisabled]: functionallyDisabled,
[styles.visuallyDisabled]: interaction === 'disabled' || disabled,
[styles.dragRejected]: this.state.isDragRejected || this.invalid,
[styles.dragAccepted]: this.state.isDragAccepted,
[styles.focused]: this.state.isFocused
}
const props = omitProps(this.props, FileDrop.propTypes)
return (
<div>
<label>
<span>
<span>
{this.renderLabel()}
</span>
</span></label></div>
render () {
const { children, textAlign, isStacked, header } = this.props
return (
)
}
}
render () {
const { children, isStacked } = this.props
return isStacked
? this.renderSelect()
: (
{Children.map(children, (child) => matchComponentTypes(child, [Row])
? child
: null)}
)
}
}
renderTrigger () {
const { children, as } = this.props
const { hasFocus } = this.state
const triggerProps = {
'aria-describedby': this._id
}
if (as) {
const Trigger = getElementType(Tooltip, this.props)
const props = omitProps(this.props, Tooltip.propTypes)
return (
{children}
)
} else if (typeof children === 'function') {
return children(
{
focused: hasFocus,
getTriggerProps: (props) => {
return {
...triggerProps,
...props
}
}
}
render () {
const { onRequestSort, width, textAlign, children, sortDirection } = this.props
return (
{onRequestSort && (
render () {
return (
{ this._field = el }}
inputRef={this.handleInputRef}
editable={this.props.editable}
options={this.state.filteredOptions}
size={this.props.size}
disabled={this.props.disabled}
readOnly={this.props.readOnly}
onSelect={this.handleSelect}
onStaticClick={this.focus}
onClose={this.handleClose}
onInputChange={this.handleInputChange}
onKeyDown={this.handleKeyDown}
optionsMaxWidth={this.props.optionsMaxWidth}
closeOnSelect={this.props.closeOnSelect}
>
{this.renderTags()}