prop-types#object JavaScript Examples

The following examples show how to use prop-types#object. 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: 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 #2
Source File: ControlledMenu.js    From react-menu with MIT License 6 votes vote down vote up
process.env.NODE_ENV !== "production" ? ControlledMenu.propTypes = /*#__PURE__*/_extends({}, rootMenuPropTypes, {
  state: /*#__PURE__*/oneOf( /*#__PURE__*/values(MenuStateMap)),
  anchorPoint: /*#__PURE__*/exact({
    x: number,
    y: number
  }),
  anchorRef: object,
  skipOpen: object,
  captureFocus: bool,
  menuItemFocus: /*#__PURE__*/exact({
    position: /*#__PURE__*/oneOfType([string, number]),
    alwaysUpdate: bool
  }),
  onClose: func
}) : void 0;
Example #3
Source File: propTypes.js    From react-menu with MIT License 6 votes vote down vote up
menuPropTypes = /*#__PURE__*/_extends({
  className: string
}, /*#__PURE__*/stylePropTypes('menu'), /*#__PURE__*/stylePropTypes('arrow'), {
  menuStyle: object,
  arrowStyle: object,
  arrow: bool,
  setDownOverflow: bool,
  offsetX: number,
  offsetY: number,
  align: /*#__PURE__*/oneOf(['start', 'center', 'end']),
  direction: /*#__PURE__*/oneOf(['left', 'right', 'top', 'bottom']),
  position: /*#__PURE__*/oneOf(['auto', 'anchor', 'initial']),
  overflow: /*#__PURE__*/oneOf(['auto', 'visible', 'hidden'])
})
Example #4
Source File: propTypes.js    From react-menu with MIT License 6 votes vote down vote up
rootMenuPropTypes = /*#__PURE__*/_extends({}, menuPropTypes, {
  containerProps: object,
  initialMounted: bool,
  unmountOnClose: bool,
  transition: /*#__PURE__*/oneOfType([bool, /*#__PURE__*/exact({
    open: bool,
    close: bool,
    item: bool
  })]),
  transitionTimeout: number,
  boundingBoxRef: object,
  boundingBoxPadding: string,
  reposition: /*#__PURE__*/oneOf(['auto', 'initial']),
  repositionFlag: /*#__PURE__*/oneOfType([string, number]),
  viewScroll: /*#__PURE__*/oneOf(['auto', 'close', 'initial']),
  submenuOpenDelay: number,
  submenuCloseDelay: number,
  portal: /*#__PURE__*/oneOfType([bool, /*#__PURE__*/exact({
    target: object,
    stablePosition: bool
  })]),
  theming: string,
  onItemClick: func
})
Example #5
Source File: ControlledMenu.js    From react-menu with MIT License 6 votes vote down vote up
ControlledMenu.propTypes /* remove-proptypes */ = {
  ...rootMenuPropTypes,
  state: oneOf(values(MenuStateMap)),
  anchorPoint: exact({
    x: number,
    y: number
  }),
  anchorRef: object,
  skipOpen: object,
  captureFocus: bool,
  menuItemFocus: exact({
    position: oneOfType([string, number]),
    alwaysUpdate: bool
  }),
  onClose: func
};
Example #6
Source File: types.js    From supportal-frontend with MIT License 6 votes vote down vote up
AuthContextType = shape({
  answerCustomChallenge: func.isRequired,
  checkAuthentication: func.isRequired,
  getPublicChallengeParameters: func.isRequired,
  hasInitialized: bool.isRequired,
  isAuthenticated: bool.isRequired,
  profile: UserProfileType,
  signIn: func.isRequired,
  signOut: func.isRequired,
  user: object,
})
Example #7
Source File: propTypes.js    From react-menu with MIT License 6 votes vote down vote up
menuPropTypes = {
  className: string,
  ...stylePropTypes('menu'),
  ...stylePropTypes('arrow'),
  menuStyle: object,
  arrowStyle: object,
  arrow: bool,
  setDownOverflow: bool,
  offsetX: number,
  offsetY: number,
  align: oneOf(['start', 'center', 'end']),
  direction: oneOf(['left', 'right', 'top', 'bottom']),
  position: oneOf(['auto', 'anchor', 'initial']),
  overflow: oneOf(['auto', 'visible', 'hidden'])
}
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: propTypes.js    From react-menu with MIT License 6 votes vote down vote up
rootMenuPropTypes = {
  ...menuPropTypes,
  containerProps: object,
  initialMounted: bool,
  unmountOnClose: bool,
  transition: oneOfType([
    bool,
    exact({
      open: bool,
      close: bool,
      item: bool
    })
  ]),
  transitionTimeout: number,
  boundingBoxRef: object,
  boundingBoxPadding: string,
  reposition: oneOf(['auto', 'initial']),
  repositionFlag: oneOfType([string, number]),
  viewScroll: oneOf(['auto', 'close', 'initial']),
  submenuOpenDelay: number,
  submenuCloseDelay: number,
  portal: oneOfType([
    bool,
    exact({
      target: object,
      stablePosition: bool
    })
  ]),
  theming: string,
  onItemClick: func
}
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: 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 #14
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 #15
Source File: SingleComponentStacked.js    From wix-style-react with MIT License 6 votes vote down vote up
SingleComponentStacked.propTypes = {
  /** storybook name */
  name: oneOfType([string, object]),
  /** names of the used components */
  componentsNames: array,
  /** any node to render inside */
  children: node,
  /** size of the children column. Can be one of "singleComponentSizes" constant */
  size: number,
};
Example #16
Source File: FillPreview.js    From wix-style-react with MIT License 6 votes vote down vote up
FillPreview.propTypes = {
  /** render as some other component or DOM tag */
  as: oneOfType([func, object, string]),

  /** control focusability */
  tabIndex: number,

  /** Color, gradient, image url or svg to be rendered as a preview content */
  fill: oneOfType([string, node]),

  /** Outlines the border when set to true */
  selected: bool,

  /** Pass your handler for click event */
  onClick: func,

  /** Puts the component into a disabled state */
  disabled: bool,

  /** Control elements aspect ratio value:  */
  aspectRatio: oneOfType([string, number]),
};
Example #17
Source File: Button.js    From littlelink-server with MIT License 6 votes vote down vote up
Button.propType = {
  src: string.isRequired,
  alt: string.isRequired,
  displayName: string.isRequired,
  href: string.isRequired,
  name: string.isRequired,
  order: number.isRequired,
  logo: string,
  icon: string,
  styles: object,
};
Example #18
Source File: profile.js    From gatsby-theme-intro with MIT License 6 votes vote down vote up
ProfileType = {
  about: string.isRequired,
  budget: shape({
    currency: string.isRequired,
    default: number.isRequired,
    max: number.isRequired,
    min: number.isRequired,
  }).isRequired,
  company: string.isRequired,
  focus: string.isRequired,
  focus_url: string,
  for_hire: bool.isRequired,
  image: shape({
    childImageSharp: object.isRequired,
    publicURL: string.isRequired,
  }),
  initials: string.isRequired,
  location: string.isRequired,
  name: string.isRequired,
  profession: string.isRequired,
  relocation: bool.isRequired,
  skills: arrayOf(string).isRequired,
  tools: arrayOf(string).isRequired,
}
Example #19
Source File: project.js    From gatsby-theme-intro with MIT License 6 votes vote down vote up
ProjectType = {
  description: string,
  icon: oneOf(["github", "website"]),
  image: shape({
    childImageSharp: object.isRequired,
  }),
  name: string.isRequired,
  status: string,
  tags: arrayOf(string),
  url: string,
}
Example #20
Source File: index.js    From thekusuma with MIT License 5 votes vote down vote up
WelcomeSection.propTypes = {
  guestName: string.isRequired,
  isInvitation: bool.isRequired,
  isAnonymGuest: bool.isRequired,
  location: object.isRequired,
  codeLink: string,
  onClickDetail: func.isRequired,
};
Example #21
Source File: propTypes.js    From react-menu with MIT License 5 votes vote down vote up
uncontrolledMenuPropTypes = {
  instanceRef: oneOfType([object, func]),
  onMenuChange: func
}
Example #22
Source File: propTypes.js    From react-menu with MIT License 5 votes vote down vote up
uncontrolledMenuPropTypes = {
  instanceRef: /*#__PURE__*/oneOfType([object, func]),
  onMenuChange: func
}
Example #23
Source File: index.js    From covid19japan with MIT License 5 votes vote down vote up
KpiContainer.propTypes = {
  data: object,
  type: string,
};
Example #24
Source File: proptypes-shapes.js    From what-front with MIT License 5 votes vote down vote up
studentGroupsStateShape = {
  error: string.isRequired,
  isLoading: bool.isRequired,
  isLoaded: bool.isRequired,
  studentGroups: oneOfType([arrayOf(shape(studentGroupShape)), arrayOf(undefined)]).isRequired,
  studentGroupById: oneOfType([shape(studentGroupShape), object]).isRequired,
}
Example #25
Source File: proptypes-shapes.js    From what-front with MIT License 5 votes vote down vote up
studentGroupByIdStateShape = {
  error: string.isRequired,
  isLoading: bool.isRequired,
  isLoaded: bool.isRequired,
  data: oneOfType([shape(studentGroupShape), object]).isRequired,
}
Example #26
Source File: index.js    From thekusuma with MIT License 5 votes vote down vote up
Home.propTypes = {
  location: object.isRequired,
};
Example #27
Source File: index.js    From thekusuma with MIT License 5 votes vote down vote up
TicketData.propTypes = {
  guest: object,
  configData: object,
};
Example #28
Source File: CalendarWeekHeader.js    From react-nice-dates with MIT License 5 votes vote down vote up
CalendarWeekHeader.propTypes = {
  locale: object.isRequired,
  weekdayFormat: string
}
Example #29
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
}