JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q33106F
  • License MIT

Form components with a11y and validation

Package Exports

  • scoop-form

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scoop-form) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

scoop-form

A collection of form components and utils for validation and handling basic a11y tasks, such as focussing the first erroneous field or placing the error message inside the label.

This software is hardly bound to our clients needs.

Install

yarn add scoop-form

Basic example

<template>
  <VForm :form="myForm" @submit="onSubmit">
    <VInput name="input1" :required="true" hint="Err msg" placeholder="..." legend="Label xyz" />
  </VForm>
</template>

<script>
import { Form, Input, initFields } from 'scoop-form';

export default {
  name: 'Example',

  components: {
    Form,
    Input,
  },

  data() {
    return {
      myForm: initFields({ name: 'input1' }),
    };
  },

  methods: {
    onSubmit({ values, form, isValid }) {
      // ...
    },
  },
};
</script>

Project setup

yarn install

Compiles and hot-reloads for development

yarn dev

Compiles for npm

yarn run build:npm

Publish on npm

npm publish --access public

Run your tests

yarn run test:e2e

Lints and fixes files

yarn run lint

Customize configuration

See Configuration Reference.