1.0.4 • Published 5 years ago

@creanet/vue-forms v1.0.4

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
5 years ago

Vue Forms

Description

This package includes several Vue.js components for creating forms.

Installation

To install this package run:

$ npm install @creanet/vue-forms

To import components use:

import { SimpleInput, SimpleForm } from '@creanet/vue-forms';

To import styles use:

import "/assets/css/style.css" from "@creanet/vue-forms";

Simple Input

Used for simple text or number input. Includes methods for validation.

Properties of this component are:

Properties

NameDescriptionDefault value
valueThe value of the <input> element""
typeThe native type of the <input> element"text"
themeThe design of the input. Only applied if styles were imported"default"
placeholderThe placeholder for the <input> element""
hidePlaceholderOnFocusTrue if placeholder should be hidden when <input> is focusedtrue
minLengthMinimal length of the valuenull
maxLengthMaximal length of the valuenull
minMinimal numeric value (valid only if type is number)null
maxMaximal numeric value (valid only if type if number)null
patternPatter to test the value againstnull
expectedValueExact value to test the value againstnull
requiredWhether some value is requirednull
stepNumeric step (valid only if type is number)1
errorMessagesObject containing custom error messages{}
hideErrorsTrue if messages should be hiddenfalse
readonlyTrue if <input> should be readonlyfalse
preventSubmitTrue if <form> should not be submitted when pressing ENTERfalse

Validation

NameMatching propertyError message
valueMissingrequiredThis field is required
typeMismatchtypeThe value is in wrong format
tooLongminLengthThe value is too long
tooShortmaxLengthThe value is too short
tooLowminThe value is too low
tooHighmaxThe value is too high
stepMismatchstepThe value is not divisible by step
patternMismatchpatternThe value is in wrong format
valueMismatchexpectedValueThe value is not correct
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago