npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bo-shared-components

v0.0.7

Published

bo main components library

Downloads

3

Readme

SHARED-COMPONENTS (2.6.0)

##Info This project should be used by all Back Office applications for most of their components

  • Install: npm install bocomponents
  • Package location : https://www.npmjs.com/package/bocomponents

Basic components :

Advanced components

Form:

  • Available inputs in Form:
    • text
    • number
    • email
    • checkbox
    • select
    • radio-group
    • checkbox
    • range
  • Form usage example:
import { FormTemplate } from "bocomponents";

const Form = props => {
    const { classes, reset, history } = props;

    const showResults = () => {
        history.push("/results");
    };

    return (
        <div className={classes.container}>
            <FormTemplate
                config={config}
                onSubmit={showResults}
                reset={reset}
            />
        </div>
    );
};

export default withRouter(
    reduxForm({
        form: "SearchForm",
        destroyOnUnmount: false
    })(withStyles(styles)(Form))
);
  • Config usage example:
const config = {
    name: "searchUsers",
    title: "Search Diamonds",
    formInputs: [
        {
            name: "shape", // name=value will be submitted in query_string
            type: "select", //from available inputs above
            label: "Shape",
            options: shapes, // for select box only
            multiple: false, // for select box only
            grid: { //[optional]default grid is xs:12 , sm:12 (the whole grid row always)
                field: {
                    xs: 12, //amount of grid in small screen view
                    sm: 6 //amount of grid in normal view
                }
            },
            validate: [minValue(0), maxValue(1000000)] // [optional] client side validation,
            rangeProps: { // for range slider only
                defaultValue: [1, 1000000],
                marks: { 1: "1", 1000000: "1000000" },
                pushable: true,
                allowCross: false,
                min: 1,
                max: 1000000,
                step: 50
            }

        }...
  • Validation:

Usage:

import { TextField } from "bocomponents/inputs/";

Available validation methods(self explanatory):

  • required
  • minLength
  • maxLength
  • minValue
  • maxValue
  • email number

Table

Table usage example:

const Table = BuildDefaultTable(config);

const Results = props => {
    const { classes, history, searchForm } = props;

    const onRowClick = id => {
        history.push("/info/" + id);
    };

    config.query = (searchForm && searchForm.values) || "";
    config.onRowClick = onRowClick;

    return (
        <div>
            <Table />
        </div>
    );
};

const mapStateToProps = state => ({
    searchForm: state.form.SearchForm
});

export default withRouter(
    connect(mapStateToProps)(withStyles(styles)(Results))
);

Config usage example

const config = {
    domain: "http://localhost:8083",
    endPoint: "/gems",
    onRowClick: "",
    title: "Diamonds Search Results",
    resultsHeader: [
        {
            value: "id", //value from service response
            name: "ID",  //column name in table's header
            sortable: true,
            filterable: true
        }...

MUI components (from dashboard)

Usage:

import { GridContainer, ItemGrid, RegularCard, NavPills } from "bocomponents";

Docs: https://material-ui.com/


config examples: sliderRange

  {
            name: "price#sliderRange",
            type: "sliderWithInputs",
            label: "Price USD",
            grid: {
                field: {
                    xs: 12,
                    sm: 6
                }
            },
            rangeProps: {
                defaultValue: [1, 1000000],
                pushable: true,
                allowCross: false,
                min: 1,
                max: 1000000
            }
        },

stepRange Please Note: in order to add you stepRange, you must include your data in bocomponents/src/components/inputs/data/index.js

so the marks here are colors, this color object should be imported from bocomponents/src/components/inputs/data/index.js

     {
            name: "color#stepRange",
            type: "range",
            label: "Color",
            grid: {
                field: {
                    xs: 12,
                    sm: 6
                }
            },
            rangeProps: {
                defaultValue: [0, 10],
                marks: color,
                pushable: true,
                allowCross: false,
                min: 0,
                max: 10,
                step: 1
            }
        },

multiSelect

     {
            name: "shape#multiSelect",
            type: "select",
            label: "Shape",
            options: shapes,
            multiple: true,
            grid: {
                field: {
                    xs: 12,
                    sm: 6
                }
            }
        },