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

execution-input

v2.9.8

Published

"render types inputs "

Downloads

25

Readme

execution-input

"render types inputs "

NPM JavaScript Style Guide

Install

import React, { useState } from "react";

import ExecutionInput from "execution-input";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import {faEdit, faCheck, faTrafficLight} from "@fortawesome/free-solid-svg-icons";
import Truncate from "react-truncate";

// need install react-dates, moment and bootstrap
const options2 = [
  {
    id: 4,
    value: "esta es una nota larga para el campo ",
    note: "esta seria la nota que quieras poner en el radio",
    state: "",
    data: {
      name: "test 1",
      value: "Yes this is note 1this is note 1this is note 1this is note 1",
      id: 1
    }
  },
  {
    id: 5,
    value: "test note 2 ",
    note: "this is note 2 ",
    state: "",
    data: { name: "test 2", value: "test note 2", id: 3 }
  },
  {
    id: 6,
    value: "test note 3",
    note: "No route",
    state: "",
    data: { name: "test 1", value: "test note 3", id: 3 }
  }
];

const options = [
  {
    id: 1,
    value: "test note 1 ",
    label: (
      <Truncate lines={4} ellipsis="...">
        {
          "In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content."
        }
      </Truncate>
    ),
    note: (
      <small className="text-danger text-left">
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos itaque
        iusto maxime non omnis quaerat, quam quasi voluptas. Enim, saepe,
        voluptates? Blanditiis esse eum ex iste nulla quibusdam rem veniam!
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus
        alias aperiam blanditiis consequatur cum fugit illo ipsum labore magnam
        molestias, nemo neque nihil non quae quas reprehenderit tenetur
        voluptates voluptatibus.
      </small>
    ),
    state: "green",
    icon: (
      <div>
        <FontAwesomeIcon icon={faEdit} /> <FontAwesomeIcon icon={faEdit} />{" "}
        <FontAwesomeIcon icon={faEdit} />
      </div>
    ),
    data: {
      name: "test 1",
      value: "Yes this is note 1this is note 1this is note 1this is note 1",
      id: 1
    }
  },
  {
    id: 2,
    value: "test note 2 ",
    note: "",
    label: (
      <div className="m-auto">
        <p className="m-0">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi earum
          obcaecati optio perferendis quidem repellat repellendus, veritatis.
          Animi corporis cumque, dolorem impedit inventore itaque, molestiae
          perferendis quae quod ratione ullam? Lorem ipsum dolor sit amet,
          consectetur adipisicing elit. Accusantium alias
        </p>
      </div>
    ),
    state: "yellow",
    icon: <FontAwesomeIcon icon={faEdit} />,
    data: { name: "test 2", value: "test note 2", id: 3 }
  },
  {
    id: 3,
    value: "test note 3",
    note: "No route",
    state: "red",
    label: "test note 3",
    icon: <FontAwesomeIcon icon={faEdit} />,
    data: {
      name: "test 1",
      value: "test note 3",
      id: 3,
      description: (
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi aut
          cumque distinctio ducimus ea eaque esse explicabo, facere facilis
          fugiat natus neque officia provident quia reprehenderit repudiandae
          sunt suscipit veniam.
        </p>
      )
    }
  }
];

const App = () => {
  const [valueSmallText, setValueSmallText] = useState("");
  const [valueLargeText, setValueLargeText] = useState("");
  const [valueTimeText, setValueTimeText] = useState("");
  const [valueNumberText, setValueNumberText] = useState("");
  const [valueRadio, setValueRadio] = useState({});
  const [valueRadio2, setValueRadio2] = useState({});
  const [valueCheckbox, setValueCheckbox] = useState({});
  const [valueSelect, setValueSelect] = useState(null);
  const [valueSelectMulti, setValueSelectMulti] = useState(null);
  const [date, setDate] = useState(null);
  const [dateRange, setDateRange] = useState({
    from: new Date(),
    to: new Date()
  });

  return (
    <div className="mt-5">
      <form
        className="col-lg-8 col-md-10 col-12 mx-auto"
        onSubmit={event => event.preventDefault()}
      >
        <ExecutionInput type={"BUTTON"} options={options}/>
        <ExecutionInput type="RADIO_BUTTON_DESCRIPTION"
                        value={valueRadio.value}
                        required
                        onChange={e => setValueRadio(e)}
                        label="label radio"
                        radioAction={a => {
                          console.log(a)
                        }}
                        options={options}/>
        <ExecutionInput value={date} type="SCHEDULE" required onChange={e => setDate(e)}/>
        <ExecutionInput type="LINK"
                        label={<div className="text-center"><b><a href={"http://engine-dev.mrreset.com/#/flow"}>contact us</a></b></div>}/>
        <ExecutionInput type="LABEL" placeholder="hola" label="hola 1" id="12222" name="name-1"/>
        <ExecutionInput type="SMALL_TEXT"
                        value={valueSmallText}
                        onChange={e => setValueSmallText(e)}
                        label="label small text"
                        placeholder="small text"/>
        <ExecutionInput type="SMALL_TEXT"
                        childType="PHONE"
                        value={valueSmallText}
                        onChange={e => setValueSmallText(e)}
                        label="label small texT phone"
                        placeholder="small text phone"/>
        <ExecutionInput type="SMALL_TEXT"
                        childType="EMAIL"
                        value={valueSmallText}
                        onChange={e => setValueSmallText(e)}
                        label="label small texT email"
                        placeholder="small text email"/>
        <ExecutionInput type="SMALL_TEXT"
                        childType="SSN"
                        value={valueSmallText}
                        onChange={e => setValueSmallText(e)}
                        label="label small texT ssn"
                        placeholder="small text ssn"/>
        <ExecutionInput type="LARGE_TEXT"
                        value={valueLargeText}
                        onChange={e => setValueLargeText(e)}
                        label="label large text"
                        placeholder="large text"/>
        <ExecutionInput type="TIME"
                        value={valueTimeText}
                        onChange={e => setValueTimeText(e)}
                        label="label time text"/>
        <ExecutionInput type="NUMBER"
                        value={valueNumberText}
                        onChange={e => setValueNumberText(e)}
                        label="label number"
                        placeholder="number text"/>
        <ExecutionInput type="RADIO_BUTTON"
                        value={valueRadio.value}
                        onChange={e => setValueRadio(e)}
                        label="label radio"
                        options={options}
                        radioIcon={<FontAwesomeIcon icon={faTrafficLight}/>}
                        singleValue/>
        <ExecutionInput
          type="RADIO_BUTTON"
          value={valueRadio2.value}
          onChange={e => setValueRadio2(e)}
          label="label radio"
          options={options2}
          customChecked={
            <FontAwesomeIcon style={{ fontSize: "13px" }} icon={faCheck} />
          }
          className="container-radio"
          alignText="left"
          singleValue
        />

        <ExecutionInput
          type="RADIO_BUTTON"
          value={valueCheckbox}
          required
          className="container-checkbox"
          customChecked={
            <FontAwesomeIcon style={{ fontSize: "13px" }} icon={faCheck} />
          }
          onChange={e => setValueCheckbox(e)}
          label="label checkbox"
          alignText="center"
          options={options}
        />
        <ExecutionInput type="SELECT"
                        value={valueSelectMulti}
                        onChange={e => setValueSelectMulti(e)}
                        label="label select"
                        placeholder="select text"
                        options={options}/>
        <ExecutionInput type="SELECT"
                        value={valueSelect}
                        onChange={e => setValueSelect(e)}
                        label="label select"
                        singleValue
                        placeholder="select text"
                        options={options}/>
        <ExecutionInput
          type="DATE"
          label="label date"
          value={date}
          required
          onChange={e => setDate(e)}
        />
        <ExecutionInput type="DATE_RANGE"
                        label="label date range"
                        value={dateRange}
                        onChange={(e) => setDateRange(e)}/>
        <button className="btn btn-block btn-success btn-sm">test</button>
      </form>
    </div>
  );
};

export default App;

License

MIT © sbx