How to use the prop-types.object function in prop-types

To help you get started, we’ve selected a few prop-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LLK / scratch-www / src / components / forms / validations.jsx View on Github external
module.exports.validationHOCFactory = defaultValidationErrors => (Component => {
    const ValidatedComponent = props => (
        
    );

    ValidatedComponent.propTypes = {
        validationErrors: PropTypes.object // eslint-disable-line react/forbid-prop-types
    };

    return ValidatedComponent;
});
github jaredLunde / masonic / src / Masonry.js View on Github external
columnWidth: 200,
  columnGutter: 0,
  initialWidth: 1280,
  initialHeight: 720,
  itemHeightEstimate: 300,
  itemKey: defaultGetItemKey,
  overscanBy: 2,
}

if (__DEV__) {
  const PropTypes = require('prop-types')
  SizeObserver.displayName = 'SizeObserver'
  SizeObserver.propTypes = {
    as: PropTypes.oneOfType([PropTypes.func, PropTypes.string]).isRequired,
    role: PropTypes.string,
    style: PropTypes.object,
    resizeObserver: PropTypes.object,
    observerRef: PropTypes.func,
    children: PropTypes.element,
  }
  Masonry.displayName = 'FreeMasonry'
  Masonry.propTypes = {
    columnCount: PropTypes.number,
    columnWidth: PropTypes.number.isRequired,
    columnGutter: PropTypes.number.isRequired,
    width: PropTypes.number.isRequired, // width of the container
    height: PropTypes.number.isRequired, // height of the window
    scrollTop: PropTypes.number.isRequired,
    isScrolling: PropTypes.bool.isRequired,
    containerRef: PropTypes.shape({current: PropTypes.any}).isRequired,
  }
github geosolutions-it / MapStore2 / web / client / components / resources / forms / Thumbnail.jsx View on Github external
static propTypes = {
        glyphiconRemove: PropTypes.string,
        style: PropTypes.object,
        loading: PropTypes.bool,
        resource: PropTypes.object,
        thumbnail: PropTypes.string,
        onError: PropTypes.func,
        onUpdate: PropTypes.func,
        onRemove: PropTypes.func,
        // I18N
        message: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
        suggestion: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
    };

    static contextTypes = {
        messages: PropTypes.object
    };

    static defaultProps = {
        loading: false,
        glyphiconRemove: "remove-circle",
        resource: {},
        // CALLBACKS
        onError: () => {},
        onUpdate: () => {},
        onSaveAll: () => {},
        onRemove: () => {},
        // I18N
        message: ,
        suggestion: 
    };
github geosolutions-it / MapStore2 / web / client / components / resources / ResourceCard.jsx View on Github external
static propTypes = {
        // props
        style: PropTypes.object,
        backgroundOpacityStart: PropTypes.number,
        backgroundOpacityEnd: PropTypes.number,
        resource: PropTypes.object,
        editDataEnabled: PropTypes.bool,
        shareToolEnabled: PropTypes.bool,
        // CALLBACKS
        viewerUrl: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
        onEdit: PropTypes.func,
        onEditData: PropTypes.func,
        onDelete: PropTypes.func,
        onShare: PropTypes.func,
        onUpdateAttribute: PropTypes.func,
        tooltips: PropTypes.object
    };

    static defaultProps = {
        resource: {},
        editDataEnabled: false,
        shareToolEnabled: true,
        style: {
            backgroundImage: 'url(' + thumbUrl + ')',
            backgroundSize: "cover",
            backgroundPosition: "center",
            backgroundRepeat: "repeat-x"
        },
        backgroundOpacityStart: 0.7,
        backgroundOpacityEnd: 0.3,
        tooltips: {
            deleteResource: "resources.resource.deleteResource",
github myxvisual / react-uwp / docs / src / routes / Styles / Colors / index.tsx View on Github external
export interface DataProps {}

export interface ColorsProps extends DataProps, React.HTMLAttributes {}

export interface ColorsState {
  showColorName?: "All" | "System" | "Accent";
}

export default class Colors extends React.Component {
  static defaultProps: ColorsProps = {};

  state: ColorsState = {
    showColorName: "All"
  };

  static contextTypes = { theme: PropTypes.object };
  context: { theme: ReactUWP.ThemeType };
  handleChangeColor = (value: string) => {
    this.setState({
      showColorName: value as any
    });
  }

  render() {
    const {
      className,
      id,
      style
    } = this.props;
    const { showColorName } = this.state;
    const { theme } = this.context;
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / signatures / indicators / EntityIndicators.js View on Github external
entityId={entityId}
          isFrom={false}
          targetEntityTypes={['Indicator']}
          paginationOptions={paginationOptions}
        />
      
    );
  }
}

EntityIndicators.propTypes = {
  entityId: PropTypes.string,
  entityLink: PropTypes.string,
  classes: PropTypes.object,
  t: PropTypes.func,
  history: PropTypes.object,
};

export default compose(inject18n, withStyles(styles))(EntityIndicators);
github OpenCTI-Platform / opencti / opencti-front / src / private / components / user / ProfileOverview.js View on Github external
>
                    {t('Update')}
                  
                
              
            )}
          />
        
      
    );
  }
}

ProfileOverviewComponent.propTypes = {
  classes: PropTypes.object,
  theme: PropTypes.object,
  t: PropTypes.func,
  me: PropTypes.object,
};

const ProfileOverview = createFragmentContainer(ProfileOverviewComponent, {
  me: graphql`
    fragment ProfileOverview_me on User {
      name
      description
      email
      firstname
      lastname
      language
      token
    }
  `,
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / nav / TopMenuIntrusionSet.js View on Github external
}
          classes={{ root: classes.button }}
        >
          {t('Files')}
        
      
    );
  }
}

TopMenuIntrusionSet.propTypes = {
  classes: PropTypes.object,
  location: PropTypes.object,
  match: PropTypes.object,
  t: PropTypes.func,
  history: PropTypes.object,
};

export default compose(
  inject18n,
  withRouter,
  withStyles(styles),
)(TopMenuIntrusionSet);
github OpenCTI-Platform / opencti / opencti-platform / opencti-front / src / private / components / reports / Report.js View on Github external
entityId={report.id}
              entityType="Stix-Domain-Entity"
              relationType="object_refs"
              field="entity_type"
            />
          
        
        
      
    );
  }
}

ReportComponent.propTypes = {
  report: PropTypes.object,
  classes: PropTypes.object,
  t: PropTypes.func,
};

const Report = createFragmentContainer(ReportComponent, {
  report: graphql`
    fragment Report_report on Report {
      id
      ...ReportHeader_report
      ...ReportOverview_report
      ...ReportDetails_report
    }
  `,
});

export default compose(inject18n, withStyles(styles))(Report);
github geosolutions-it / MapStore2 / web / client / components / mapcontrols / annotations / CoordinatesEditor.jsx View on Github external
* @prop {string} mapProjection crs of the map
 * @prop {string} isDraggable tells if the coordinate row is draggable
 *
*/
class CoordinatesEditor extends React.Component {
    static propTypes = {
        components: PropTypes.array,
        measureOptions: PropTypes.object,
        onSetInvalidSelected: PropTypes.func,
        onChange: PropTypes.func,
        onChangeRadius: PropTypes.func,
        onHighlightPoint: PropTypes.func,
        onChangeText: PropTypes.func,
        onChangeFormat: PropTypes.func,
        format: PropTypes.string,
        aeronauticalOptions: PropTypes.object,
        componentsValidation: PropTypes.object,
        transitionProps: PropTypes.object,
        properties: PropTypes.object,
        mapProjection: PropTypes.string,
        type: PropTypes.string,
        isDraggable: PropTypes.bool,
        isMouseEnterEnabled: PropTypes.bool,
        isMouseLeaveEnabled: PropTypes.bool
    };

    static defaultProps = {
        components: [],
        measureOptions: {},
        onChange: () => {},
        onChangeRadius: () => {},
        onHighlightPoint: () => {},