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

input-style-one

v1.5.1

Published

React-based input component, espessially created for WExport 2.0 project. πŸš€

Downloads

124

Readme

WExport InputStyleOne

React-based input component, espessially created for WExport 2.0 project. πŸš€

This component include following input types based on other popular npm packages:

Installation

$ npm install input-style-one

Props

  • @required
    • label - set text above the input tag, placeholder if placeholder not set and used in tooltip header. Set showLabel = false if you need to hide text above input.
    • name - name property of input tag
    • handleChange({name, value, label, isValid} => void) - HandleChange event of input.
      • value - value of input tag
      • name - name of input tag. Used on this.setState([name]: value). Not necessary if you use React Hooks
      • label - used only when inputType="select". this value return the select component label. Sometimes it is necessary to store the label of selected value. Example: selectOptions: [{value:1, label: "Option One"}, {value: "2", label: "Options Two"}]
      • isValid - return true if input satisfy all rules.
  • @optional
    • layout? - @deprecated. It means that component always keep structure [label input]. If layout="one", label above input will be hidden, input field will be with icon iconUrl property
    • enableTooltip? - true by default. Enable or dirable left side Popover
    • showLabel? - true by default. Show or hide label text above input.
    • showOptionalLabel? - true by default. Show or hide "optional" text in label no matter required rule is accepted.
    • inputType? - text by default. Available options: select, multi-select, password, textArea, datePicker and numberFormat
    • disabled? - false by default. Set this prop true whenever input should be sidabled
    • autocomplete? - true by default. Set this prop true whenever html autocomplete property should be enabled/disabled
    • placeholder? - equals to label by default.
    • minRows? - minRow prop of text area autosize package. Will be moved to textAreaOptions in the future
    • maxRows? - maxRow prop of text area autosize package. Will be moved to textAreaOptions in the future
    • infoDescription? - pass "Custom information" message to tooltip if needed
    • iconUrl? - use this whenever need to add icon from leftside of input
    • rules - Array of rules where input value should be validated. Available rules:
      • required
      • email
      • card
      • integer
      • float
      • [maxString, <integer>] - max symbols on input value
      • [compare, <any>] - compare input value with definite variable. Example: repeatPassword
      • [minAmountValue, <number>] - specific rule where minimal amount validated
      • [lte, <number>] - check whenever input value less or equal than specific number
      • [gte, <number>] - check whenever input value greater or equal than specific number
      • [custom, <function>] - check whenever custom validation is realized. example:
        const validateUsernameExist = (value) => {
          const existUser = "[email protected]"
          if (value == existUser) {
            return {
              isValid: false,
              description: "This user is already exist in system"
            }
          } else {
            return {
              isValid: true,
              description: "All is Fine"
            }
          }
        }
        
        ...
        rules={['required', 'email', ['custom', validateUsernameExist]]}
        
      • Now we have following rules but they will grow in the future πŸ˜†
    • datePickerOptions - all props related to DayPickerInput packages. All available props see "react-day-picker" package. Example: disabledDays, initialMonth
    • selectOptions - all props related to ReactSelect packages. All available props see "react-select" packages. Example: options, value, isClearable
    • numberFormatOptions - all props related to NumberFormat packages. All available props see "react-number-format" package. Example: suffix, thousandSeparator, format, mask, type, allowNegative, allowZeroStart

The are a little "demo" how to use InputStyleOne component in project. In basic issues, IT'S RECOMMENDED to use functions (handleChange, isValidFields) described in demo. But if you know better approach, you are welcome :) If not, just do Ctrl+A Ctrl+C Ctrl+V πŸ˜†