prop-types#instanceOf JavaScript Examples

The following examples show how to use prop-types#instanceOf. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CalendarDay.js    From react-nice-dates with MIT License 6 votes vote down vote up
CalendarDay.propTypes = {
  date: instanceOf(Date).isRequired,
  height: number.isRequired,
  locale: object.isRequired,
  modifiers: objectOf(bool),
  modifiersClassNames: objectOf(string),
  onHover: func,
  onClick: func
}
Example #2
Source File: index.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
TimelineChart.propTypes = {
  timelineIntervals: shape({
    minDate: instanceOf(Date),
    maxDate: instanceOf(Date),
    intervals: arrayOf(shape({
      zScore: number.isRequired,
      items: arrayOf(string).isRequired,
      markedItems: arrayOf(shape({
        subType: string.isRequired,
        marked: arrayOf(string).isRequired,
      }).isRequired).isRequired,
      collectionItems: arrayOf(string).isRequired,
    })).isRequired, // that have records
    intervalLength: number.isRequired,
    maxCount: number.isRequired,
    maxCount1SD: number.isRequired,
    maxCount2SD: number.isRequired,
    recordCount: number.isRequired,
    recordCount1SD: number.isRequired,
    recordCount2SD: number.isRequired,
  }).isRequired,
};
Example #3
Source File: DateRangePicker.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
DateRangePicker.propTypes = {
  timelineProps: shape({
    minimumDate: instanceOf(Date),
    maximumDate: instanceOf(Date),
  }).isRequired,
  dateRangeFilter: shape({
    dateRangeStart: instanceOf(Date),
    dateRangeEnd: instanceOf(Date),
  }).isRequired,
  updateDateRangeFilter: func.isRequired,
};
Example #4
Source File: RecordsSummary.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
RecordsSummary.propTypes = {
  recordsByType: arrayOf(shape({
    type: string.isRequired,
    label: string.isRequired,
    items: arrayOf(shape({
      id: string.isRequired,
      type: string.isRequired,
      subType: string.isRequired,
      timelineDate: instanceOf(Date).isRequired,
    })).isRequired,
  })).isRequired,
};
Example #5
Source File: RecordCount.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
RecordCount.propTypes = {
  emphasizeProviders: bool.isRequired,
  allRecordsSortedByDate: arrayOf(shape({})).isRequired,
  providers: arrayOf(shape({
    name: string.isRequired,
  })).isRequired,
  dateRange: shape({
    minimumDate: instanceOf(Date),
    maximumDate: instanceOf(Date),
  }).isRequired,
};
Example #6
Source File: Data.js    From discovery-mobile-ui with MIT License 6 votes vote down vote up
Data.propTypes = {
  allRecordsSortedByDate: arrayOf(shape({})).isRequired,
  providers: arrayOf(shape({
    name: string.isRequired,
  })).isRequired,
  dateRange: shape({
    minimumDate: instanceOf(Date),
    maximumDate: instanceOf(Date),
  }).isRequired,
};
Example #7
Source File: Poppable.props.js    From webrix with Apache License 2.0 6 votes vote down vote up
propTypes = {
    container: oneOfType([
        func,
        shape({current: oneOfType([instanceOf(Element), instanceOf(_window.constructor)])}),
    ]),
    reference: oneOfType([
        func,
        instanceOf(DOMRect),
        shape({current: instanceOf(Element)}),
    ]),
    placements: func,
    placement: shape({
        top: number,
        left: number,
    }),
    overflow: func,
    onPlacement: func,
    default: number,
    children: node,
}
Example #8
Source File: DateRangePickerCalendar.js    From react-nice-dates with MIT License 6 votes vote down vote up
DateRangePickerCalendar.propTypes = {
  locale: object.isRequired,
  startDate: instanceOf(Date),
  endDate: instanceOf(Date),
  focus: oneOf([START_DATE, END_DATE]),
  month: instanceOf(Date),
  onStartDateChange: func.isRequired,
  onEndDateChange: func.isRequired,
  onFocusChange: func.isRequired,
  onMonthChange: func,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  minimumLength: number,
  maximumLength: number,
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  weekdayFormat: string,
  touchDragEnabled: bool
}
Example #9
Source File: DateRangePicker.js    From react-nice-dates with MIT License 6 votes vote down vote up
DateRangePicker.propTypes = {
  children: func.isRequired,
  locale: object.isRequired,
  startDate: instanceOf(Date),
  endDate: instanceOf(Date),
  onStartDateChange: func,
  onEndDateChange: func,
  format: string,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  minimumLength: number,
  maximumLength: number,
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  weekdayFormat: string,
  touchDragEnabled: bool
}
Example #10
Source File: DatePickerCalendar.js    From react-nice-dates with MIT License 6 votes vote down vote up
DatePickerCalendar.propTypes = {
  locale: object.isRequired,
  date: instanceOf(Date),
  month: instanceOf(Date),
  onDateChange: func,
  onMonthChange: func,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  weekdayFormat: string,
  touchDragEnabled: bool
}
Example #11
Source File: DatePicker.js    From react-nice-dates with MIT License 6 votes vote down vote up
DatePicker.propTypes = {
  children: func.isRequired,
  locale: object.isRequired,
  date: instanceOf(Date),
  onDateChange: func,
  format: string,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  weekdayFormat: string,
  touchDragEnabled: bool
}
Example #12
Source File: CalendarGrid.js    From react-nice-dates with MIT License 6 votes vote down vote up
CalendarGrid.propTypes = {
  locale: object.isRequired,
  month: instanceOf(Date).isRequired,
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  onMonthChange: func.isRequired,
  onDayHover: func,
  onDayClick: func,
  transitionDuration: number.isRequired,
  touchDragEnabled: bool
}
Example #13
Source File: Calendar.js    From react-nice-dates with MIT License 6 votes vote down vote up
Calendar.propTypes = {
  locale: object.isRequired,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  modifiers: objectOf(func),
  modifiersClassNames: objectOf(string),
  month: instanceOf(Date),
  onMonthChange: func,
  onDayHover: func,
  onDayClick: func,
  weekdayFormat: string,
  touchDragEnabled: bool
}
Example #14
Source File: Stackable.props.js    From webrix with Apache License 2.0 5 votes vote down vote up
propTypes = {
    zIndex: number,
    target: instanceOf(Element),
    parent: shape({current: instanceOf(Element)}),
    children: node,
}
Example #15
Source File: CalendarNavigation.js    From react-nice-dates with MIT License 5 votes vote down vote up
CalendarNavigation.propTypes = {
  locale: object.isRequired,
  month: instanceOf(Date).isRequired,
  minimumDate: instanceOf(Date),
  maximumDate: instanceOf(Date),
  onMonthChange: func.isRequired
}
Example #16
Source File: DatePicker.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
DatePicker.propTypes = {
  activeDate: instanceOf(Date).isRequired,
  minimumDate: instanceOf(Date).isRequired,
  maximumDate: instanceOf(Date).isRequired,
  onDateSelect: func.isRequired,
};
Example #17
Source File: XAxis.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
Label.propTypes = {
  date: instanceOf(Date).isRequired,
  x: number.isRequired,
  intervalInDays: number.isRequired,
};
Example #18
Source File: XAxis.js    From discovery-mobile-ui with MIT License 5 votes vote down vote up
XAxis.propTypes = {
  availableWidth: number.isRequired,
  minDate: instanceOf(Date),
  maxDate: instanceOf(Date),
};