Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable */
"use strict";
const PropTypes = require('prop-types');
const React = require("react");
class TabContainer extends React.Component {
static propTypes = {
labels: PropTypes.arrayOf(PropTypes.node).isRequired,
hashes: PropTypes.arrayOf(PropTypes.string).isRequired, // must start with #
tabs: PropTypes.arrayOf(PropTypes.node).isRequired,
initialActiveTabHash: PropTypes.string,
onTabHashChange: PropTypes.func, // takes a hash parameter
};
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({activeTabHash: this.sanitizeHash(nextProps.initialActiveTabHash, nextProps.hashes)});
}
sanitizeHash = (hash, hashArr) => {
hashArr = hashArr || this.props.hashes;
if (hashArr.indexOf(hash) >= 0) {
return hash;
}
} as const;
// TODO: Move to <button> component
const ColorGroup = {
GREEN: "green",
} as const;
const propTypes = {
animate: PropTypes.bool,
additionalButtons: PropTypes.array,
colorGroup: PropTypes.oneOf(Object.values(ColorGroup)),
className: PropTypes.string,
closeLabel: PropTypes.node,
label: PropTypes.node,
onClick: PropTypes.func,
offsetX: PropTypes.string,
offsetY: PropTypes.string,
positionX: PropTypes.oneOf(Object.values(PositionX)),
positionY: PropTypes.oneOf(Object.values(PositionY)),
size: PropTypes.oneOf(Object.values(Button.Size)),
};
const defaultProps = {
animate: true,
label: "+",
offsetX: "2",
offsetY: "2",
positionX: PositionX.RIGHT,</button>
);
};
Dialog.Dialog = DialogDialog;
Dialog.Header = DialogHeader;
Dialog.Content = DialogContent;
Dialog.Footer = DialogFooter;
Dialog.Title = DialogTitle;
Dialog.Close = DialogClose;
Dialog.Icon = DialogIcon;
export const dialogPropTypes = {
actionButtonsProps: PropTypes.shape(actionButtonsPropTypes),
a11yDescriptionId: PropTypes.string,
a11yTitleId: PropTypes.string,
children: PropTypes.node.isRequired,
className: PropTypes.string,
closeButtonProps: PropTypes.shape(_omit(buttonPropTypes, 'children')),
footer: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
hasScroll: PropTypes.bool,
onClickClose: PropTypes.func,
showActionButtons: PropTypes.bool,
showCloseButton: PropTypes.bool,
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
type: PropTypes.string,
...dialogDialogPropTypes
};
Dialog.propTypes = dialogPropTypes;
export const dialogDefaultProps = {
...dialogDialogDefaultProps,
actionButtonsProps: {},
'use strict';
const PropTypes = require('prop-types');
const React = require('react');
const createReactClass = require('create-react-class');
const Legend = require('../Legend');
const d3 = require('d3');
module.exports = createReactClass({
displayName: 'LegendChart',
propTypes: {
children: PropTypes.node,
createClass: PropTypes.string,
colors: PropTypes.func,
colorAccessor: PropTypes.func,
data: PropTypes.array,
height: PropTypes.node,
legend: PropTypes.bool,
legendPosition: PropTypes.string,
margins: PropTypes.object,
sideOffset: PropTypes.number,
svgClassName: PropTypes.string,
title: PropTypes.node,
titleClassName: PropTypes.string,
viewBox: PropTypes.string,
width: PropTypes.node,
},
exports.__esModule = true;
exports.selectFieldTypes = exports.selectionsPresenterTypes = exports.floatingLabelTypes = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _propTypes = require('prop-types');
var _utils = require('../utils');
var floatingLabelTypes = exports.floatingLabelTypes = {
shrink: _propTypes.bool
};
var selectionsPresenterTypes = exports.selectionsPresenterTypes = {
dropDownIcon: _propTypes.node,
errorStyle: _propTypes.object,
errorText: _propTypes.string,
hintText: _propTypes.string,
selectionsRenderer: _propTypes.func,
underlineErrorStyle: _propTypes.object
};
var selectFieldTypes = exports.selectFieldTypes = {
anchorOrigin: (0, _propTypes.shape)({
vertical: (0, _propTypes.oneOf)(['top', 'bottom']),
horizontal: (0, _propTypes.oneOf)(['left', 'right'])
}),
style: _propTypes.object,
menuStyle: _propTypes.object,
menuGroupStyle: _propTypes.object,
checkPosition: (0, _propTypes.oneOf)(['', 'left', 'right']),
disabled: PropTypes.bool,
icon: customPropTypes.itemShorthandWithoutJSX,
iconOnly: PropTypes.bool,
index: PropTypes.number,
itemPosition: PropTypes.number,
itemsCount: PropTypes.number,
onClick: PropTypes.func,
onFocus: PropTypes.func,
onBlur: 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,
wrapper: PropTypes.oneOfType([PropTypes.node, PropTypes.object]),
menu: PropTypes.oneOfType([customPropTypes.itemShorthand, customPropTypes.collectionShorthand]),
menuOpen: PropTypes.bool,
defaultMenuOpen: PropTypes.bool,
onActiveChanged: PropTypes.func,
inSubmenu: PropTypes.bool,
indicator: customPropTypes.itemShorthandWithoutJSX,
onMenuOpenChange: PropTypes.func,
}
static defaultProps = {
as: 'a',
accessibility: menuItemBehavior as Accessibility,
wrapper: { as: 'li' },
}
static autoControlledProps = ['menuOpen']
return (
children(withProps) || <div>Could not render children from function</div>
);
}
return (
React.Children.map(children, child => {
return React.cloneElement(child, withProps);
}) || <div>Could not clone children</div>
);
}
export const FunctionOrMapChildrenType = PropTypes.oneOfType([
PropTypes.func,
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]);
"'.\n Validation failed."
)
}
}
}
}),
]),
disabled: _propTypes.bool,
elementHeight: (0, _propTypes.oneOfType)([_propTypes.number, (0, _propTypes.arrayOf)(_propTypes.number)]),
floatingLabel: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.node]),
hintText: _propTypes.string,
hintTextAutocomplete: _propTypes.string,
hoverColor: _propTypes.string,
innerDivStyle: _propTypes.object,
keepSearchOnSelect: _propTypes.bool,
menuCloseButton: _propTypes.node,
menuFooterStyle: _propTypes.object,
menuGroupStyle: _propTypes.object,
menuStyle: _propTypes.object,
multiple: _propTypes.bool,
name: _propTypes.string,
nb2show: _propTypes.number,
noMatchFound: _propTypes.string,
noMatchFoundStyle: _propTypes.object,
onAutoCompleteTyping: _propTypes.func,
onChange: _propTypes.func,
onMenuOpen: _propTypes.func,
onSelect: _propTypes.func,
openImmediately: _propTypes.bool,
popoverClassName: _propTypes.string,
selectedMenuItemStyle: _propTypes.object,
selectionsRenderer: _propTypes.func,
import './style';
export default class extends Component {
constructor(props) {
super(props);
}
static propTypes = {
...COMMON_PROPS_TYPE,
label: PropTypes.node,
id: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
type: PropTypes.string,
placeholder: PropTypes.node,
helper: PropTypes.node,
name: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
multiple: PropTypes.bool,
options: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
label: PropTypes.node,
isChecked: PropTypes.bool,
...COMMON_PROPS_TYPE,
})),
inputStyle: PropTypes.oneOf(['pill', 'square', 'normal']),