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

@halo-lab/vue-form-getform-io

v0.1.1

Published

Vue custom form integration with the getform.io service

Downloads

7

Readme

@halo-lab/vue-form-getform-io

This template should help get you started developing with Vue 3 in Vite.

Customize configuration

See Vite Configuration Reference.

Project Setup

yarn
or
npm

Compile and Hot-Reload for Development

yarn dev
or
npm run dev

Compile and Minify for Production

yarn build
or
npm run build

Lint with ESLint

yarn lint
or
npm run lint

To install the package

yarn add @halo-lab/vue-form-getform-io
or
npm install @halo-lab/vue-form-getform-io

To use the form in the component

  • import all components
import {
  Form,
  Label,
  Input,
  TextArea,
  Button
} from '@halo-lab/vue-form-getform-io'
  • import styles
<style>
@import "@halo-lab/vue-form-getform-io/styles";
</style>
  • Form is the container for all inputs. It accepts next parameters:

    • :formId (required parameter, string) - the id of your form on getform). If submitHandler is provided, the parameter becomes optional
    • submitHandler (optional parameter, function) - your custom submit handler (will be responsible for submitting the form on your platform and should receive values of the form). If not provided, :formId is required
    • className (optional parameter, string) - class name for custom styling
  • Inputs for the form:

    • Input and TextareaComponent accept parameters:

      • placeholder (required parameter, string) - the placeholder in an input field
      • type (required parameter, string) - the type of an input, may be text, email or number
      • name (required parameter, string) - the name of an input field
      • label (required parameter , string) - the label of an input field
      • validator (optional parameter) - the array of objects in form of [name: <validatorKey>, message<optional>: <validatorMessage>, parameter<required for max, min, maxLength, minLength, regexp>: <validatorValue>. Validator's names may be:
        • required,
        • email,
        • number,
        • maxLength (must be provided the <validatorValue>),
        • minLength (must be provided the <validatorValue>),
        • max (must be provided the <validatorValue>),
        • min (must be provided the <validatorValue>),
        • regexp (must be provided the <validatorValue>),
        • func (must be provided the <validatorValue>) - the validation function, which returns a truthy value if an error is detected, and a message for an error. For example: [{name: "required"}, {name: "email", message: "Please, enter a valid email"}, {name: "max", message: "should be a number!", value: 6}, {name: regexp, value: /^[0-9]*$/}].
      • defaultValue (optional parameter, string) - the default value of an input
      • fieldClassName (optional parameter, string) - the class name for custom input container styling
      • labelClassName (optional parameter, string) - the class name for custom label styling
      • inputClassName (optional parameter, string) - the class name for custom input styling
      • errorClassName (optional parameter, string) - the class name for custom error state styling
      • isDisabled (optional parameter, boolean) - the flag to make an input field disabled
    • Select accepts parameters:

      • name (required parameter, string) - the name of an input field
      • label (required parameter , string) - the label of an input field
      • options (required parameter) - the array of objects in form of {label: <display value>, value: <option value>}
      • validator (optional parameter) - the array of objects in the form of {name: <validatorKey>, message<optional>: <validatorMessage>, parameter<required for max, min, maxLength, minLength, regexp>: <validatorValue>}. The validator's name may be:
        • required, For example: [{name: "required", message: "Please, select a city"}.
      • search (optional parameter, boolean) - the flag if using searchable select
      • defaultValue (optional parameter, string) - the default value of the input
      • fieldClassName (optional parameter, string) - the class name for custom input container styling
      • labelClassName (optional parameter, string) - the class name for custom label styling
      • inputClassName (optional parameter, string) - the class name for custom input styling
      • errorClassName (optional parameter, string) - the class name for custom error state styling
      • isDisabled (optional parameter, boolean) - the flag to make an input field disabled
    • RadioGroup - accepts parameters:

      • name (required parameter, string) - the name of an input field
      • label (required parameter , string) - the label of an input field
      • fields (required parameter) - the array of objects in form of {value: <input value>, label: <input label>, <checked>: <boolean flag if the input should be checked default>}
      • fieldClassName (optional parameter, string) - the class name for custom input container styling
      • labelClassName (optional parameter, string) - the class name for custom label styling
      • inputClassName (optional parameter, string) - the class name for custom input styling
      • inputLabelClassName (optional parameter, string) - the class name for custom label styling
      • isDisabled (optional parameter, boolean) - the flag to make an input field disabled
    • CheckBoxGroup - accepts parameters:

      • name (required parameter, string) - the name of an input field
      • label (required parameter , string) - the label of an input field
      • fields (required parameter) - the array of objects in form of {value: <input value>, label: <input label>}
      • fieldClassName (optional parameter, string) - the class name for custom input container styling
      • labelClassName (optional parameter, string) - the class name for custom label styling
      • inputClassName (optional parameter, string) - the class name for custom input styling
      • inputLabelClassName (optional parameter, string) - the class name for custom label styling
      • isDisabled (optional parameter, boolean) - the flag to make an input field disabled
    • FileInput - accepts parameters:

      • name (required parameter, string) - the name of an input field
      • validTypes (optional parameter) - the array of strings with valid file extensions
      • isMultiple (optional parameter, boolean) - the flag to accept multiple files
      • fieldClassName (optional parameter, string) - the class name for custom input container styling
      • titleClassName (optional parameter, string) - the class name for the custom label for the entire styling
      • textClassName (optional parameter, string) - the class name for custom text styling
    • Button accepts parameters:

      • label (required parameter, string) - the text for the button's label
      • type (optional parameter, string) - the type of the button
      • className (optional parameter, string) - the class name for custom button styling

Example

    <Form :formId="apiKey">
      <Input 
        fieldClassName="myField" 
        inputClassName="inputMy" 
        errorClassName="error" 
        labelClassName="myLabel" 
        type="text"
        placeholder="Your Name" 
        name="name" 
        :validator="[
          { name: 'required' },
          { name: 'letters' }
        ]" 
        label="Your Name" 
      />
      <Input 
        placeholder="Email Address" 
        type="email" name="email" 
        :validator="[{ name: 'required' }, { name: 'email' }]"
        label="Email Address" 
      />
      <TextArea 
        label="Message" 
        placeholder="Message" 
        name="message" 
        :validator="[{ name: 'required' }]" 
      />
      <Select 
        label="Your City" 
        name="city" 
        search
        :validator="[{ name: 'required' }]"
        :options="[
          { label: 'New York', value: 'New York' }, 
          { label: 'Paris', value: 'Paris' }, 
          { label: 'Kyiv', value: 'Kyiv' }
          ]" 
      />
      <RadioGroup 
        label="Your Gender" 
        name="gender"
        :fields="[
          {value: 'male', label: 'Male'}, 
          {value: 'female', label: 'Female', checked: true}
          ]" 
        />
      <CheckBoxGroup 
        label="Your Favorite food" 
        name="food"
        :fields="[
          { value: 'chocolate', label: 'Chocolate' }, 
          { value: 'ice-cream', label: 'Ice-cream' }, 
          { value: 'coffee', label: 'Coffee' }
        ]" 
      />
      <FileInput 
        name="images" 
        isMultiple 
        :validTypes="['jpg', 'png', 'jpeg', 'gif', 'pdf', 'doc', 'docx']" 
      />
      <Button label="Send form" type="submit" className="button-filledMy" />
    </Form>

Word from the author

Have fun ✌️