Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import momentPropTypes from 'react-moment-proptypes';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import moment from 'moment';
import cx from 'classnames';
import { themr } from 'react-css-themr';
import { CalendarDayPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
import getPhrase from '../utils/getPhrase';
import { BLOCKED_MODIFIER, DAY_SIZE } from '../constants';
import { DATEPICKER } from './../../ThemeIdentifiers';
import * as baseTheme from './../style/style.scss';
const propTypes = forbidExtraProps({
day: momentPropTypes.momentObj,
daySize: nonNegativeInteger,
isOutsideDay: PropTypes.bool,
modifiers: PropTypes.instanceOf(Set),
isFocused: PropTypes.bool,
tabIndex: PropTypes.oneOf([0, -1]),
onDayClick: PropTypes.func,
onDayMouseEnter: PropTypes.func,
onDayMouseLeave: PropTypes.func,
renderDay: PropTypes.func,
// internationalization
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)),
theme: PropTypes.any,
});
import React from 'react';
import PropTypes from 'prop-types';
import momentPropTypes from 'react-moment-proptypes';
import { forbidExtraProps, nonNegativeInteger } from 'airbnb-prop-types';
import { withStyles, withStylesPropTypes } from 'react-with-styles';
import moment from 'moment';
import raf from 'raf';
import { CalendarDayPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
import getCalendarDaySettings from '../utils/getCalendarDaySettings';
import ModifiersShape from '../shapes/ModifiersShape';
import { DAY_SIZE } from '../constants';
const propTypes = forbidExtraProps({
...withStylesPropTypes,
day: momentPropTypes.momentObj,
daySize: nonNegativeInteger,
isOutsideDay: PropTypes.bool,
modifiers: ModifiersShape,
isFocused: PropTypes.bool,
tabIndex: PropTypes.oneOf([0, -1]),
onDayClick: PropTypes.func,
onDayMouseEnter: PropTypes.func,
onDayMouseLeave: PropTypes.func,
renderDayContents: PropTypes.func,
ariaLabelFormat: PropTypes.string,
// internationalization
phrases: PropTypes.shape(getPhrasePropTypes(CalendarDayPhrases)),
});
import { withStyles, withStylesPropTypes } from 'react-with-styles';
import { SingleDatePickerInputPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
import noflip from '../utils/noflip';
import DateInput from './DateInput';
import IconPositionShape from '../shapes/IconPositionShape';
import CloseButton from './CloseButton';
import CalendarIcon from './CalendarIcon';
import openDirectionShape from '../shapes/OpenDirectionShape';
import { ICON_BEFORE_POSITION, ICON_AFTER_POSITION, OPEN_DOWN } from '../constants';
const propTypes = forbidExtraProps({
...withStylesPropTypes,
id: PropTypes.string.isRequired,
children: PropTypes.node,
placeholder: PropTypes.string,
ariaLabel: PropTypes.string,
displayValue: PropTypes.string,
screenReaderMessage: PropTypes.string,
focused: PropTypes.bool,
isFocused: PropTypes.bool, // describes actual DOM focus
disabled: PropTypes.bool,
required: PropTypes.bool,
readOnly: PropTypes.bool,
openDirection: openDirectionShape,
showCaret: PropTypes.bool,
showClearDate: PropTypes.bool,
customCloseIcon: PropTypes.node,
import LeftArrow from '../svg/arrow-left.svg';
import RightArrow from '../svg/arrow-right.svg';
import ChevronUp from '../svg/chevron-up.svg';
import ChevronDown from '../svg/chevron-down.svg';
import ScrollableOrientationShape from '../shapes/ScrollableOrientationShape';
import { DATEPICKER } from './../../ThemeIdentifiers';
import * as baseTheme from './../style/style.scss';
import {
HORIZONTAL_ORIENTATION,
VERTICAL_SCROLLABLE,
} from '../constants';
const propTypes = forbidExtraProps({
navPrev: PropTypes.node,
navNext: PropTypes.node,
orientation: ScrollableOrientationShape,
onPrevMonthClick: PropTypes.func,
onNextMonthClick: PropTypes.func,
// internationalization
phrases: PropTypes.shape(getPhrasePropTypes(DayPickerNavigationPhrases)),
isRTL: PropTypes.bool,
theme: PropTypes.any,
});
const defaultProps = {
import T from 'prop-types'
import { forbidExtraProps } from 'airbnb-prop-types'
import React from 'react'
import { DragSource } from 'react-dnd'
import { PROP } from 'constantz'
import ReactTooltip from 'react-tooltip'
import { declParamPropTypes } from 'model-prop-types'
import { Prop } from '../components'
const PropContainer = props =>
/*
propTypes
*/
PropContainer.propTypes = forbidExtraProps({
declarationId: T.number.isRequired,
prop: T.shape(declParamPropTypes).isRequired,
skipFinalComma: T.bool.isRequired,
connectDragSource: T.func.isRequired,
})
/*
dnd
*/
const propSource = {
beginDrag({ prop: { id, nameId, name, payload, invokeCount, altIds }, declarationId }) {
ReactTooltip.hide() // disable tooltips
return {
declarationId,
paramId: id,
name,
}
const collect = (connect, monitor) => ({
connectDropTarget: connect.dropTarget(),
isOver: monitor.isOver(),
})
/* compose export */
export default compose(
connect(null, mapDispatchToProps),
DropTarget(DraggableTypes.PROP, dropzoneTarget, collect)
)(NewWithPropDropzone)
/* propTypes */
NewWithPropDropzone.propTypes = forbidExtraProps({
// passed by parent
targetInvocationId: T.number.isRequired,
targetPosition: T.number.isRequired,
children: T.node.isRequired,
// mapDispatchToProps
addNewComponentToInvocationWithAttribute: T.func.isRequired,
// Injected by React DnD:
connectDropTarget: T.func.isRequired,
isOver: T.bool.isRequired,
})
import LeftArrow from './LeftArrow';
import RightArrow from './RightArrow';
import ChevronUp from './ChevronUp';
import ChevronDown from './ChevronDown';
import NavPositionShape from '../shapes/NavPositionShape';
import ScrollableOrientationShape from '../shapes/ScrollableOrientationShape';
import {
HORIZONTAL_ORIENTATION,
NAV_POSITION_BOTTOM,
NAV_POSITION_TOP,
VERTICAL_SCROLLABLE,
} from '../constants';
const propTypes = forbidExtraProps({
...withStylesPropTypes,
disablePrev: PropTypes.bool,
disableNext: PropTypes.bool,
inlineStyles: PropTypes.object,
isRTL: PropTypes.bool,
navPosition: NavPositionShape,
navPrev: PropTypes.node,
navNext: PropTypes.node,
orientation: ScrollableOrientationShape,
onPrevMonthClick: PropTypes.func,
onNextMonthClick: PropTypes.func,
// internationalization
phrases: PropTypes.shape(getPhrasePropTypes(DayPickerNavigationPhrases)),
<pre>{dataTip}</pre>}
/>
)
}
}
/*
propTypes
*/
AperitifPost.propTypes = forbidExtraProps({
projectIsInitalized: T.bool.isRequired,
submit: T.func.isRequired,
populate: T.func.isRequired,
input: T.shape({
onChange: T.func.isRequired,
value: T.string.isRequired,
}).isRequired,
meta: T.shape({
error: T.string,
}).isRequired,
})
/*
Components
*/
import React from 'react';
import PropTypes from 'prop-types';
import { forbidExtraProps, range } from 'airbnb-prop-types';
import classnames from 'classnames';
const propTypes = forbidExtraProps({
children: PropTypes.node.isRequired,
level: range(1, 7),
});
const defaultProps = {
level: 2,
};
const Title = ({
children,
level,
}) => {
const Level = `h${level}`;
return (
import { DateRangePickerInputPhrases } from '../defaultPhrases';
import getPhrasePropTypes from '../utils/getPhrasePropTypes';
import { themr } from 'react-css-themr';
import DateInput from './DateInput';
import RightArrow from '../svg/arrow-right.svg';
import LeftArrow from '../svg/arrow-left.svg';
import CloseButton from '../svg/close.svg';
import CalendarIcon from '../svg/calendar.svg';
import { START_DATE, END_DATE } from '../constants';
import { DATEPICKER } from './../../ThemeIdentifiers';
import * as baseTheme from './../style/style.scss';
const propTypes = forbidExtraProps({
startDateId: PropTypes.string,
startDatePlaceholderText: PropTypes.string,
screenReaderMessage: PropTypes.string,
endDateId: PropTypes.string,
endDatePlaceholderText: PropTypes.string,
onStartDateFocus: PropTypes.func,
onEndDateFocus: PropTypes.func,
onStartDateChange: PropTypes.func,
onEndDateChange: PropTypes.func,
onStartDateShiftTab: PropTypes.func,
onEndDateTab: PropTypes.func,
onClearDates: PropTypes.func,
onArrowDown: PropTypes.func,
onQuestionMark: PropTypes.func,