1.0.3 • Published 5 years ago
input-generator v1.0.3
Input Generator
Generate dynamic inputs with javascript
Installation
Use the package manager npm to install input-generator.
npm install input-generator
Usage
Basic
import { InputGenerator } from "input-generator";
const userForm = new InputGenerator();
const nameInput: HTMLInputElement = userForm.input({
id: "name-input",
name: "name",
class: "form-control",
defaultValue: "example",
isDisabled: false,
isRequired: true,
type: "text",
placeholder: "Please Enter Name",
});
const citySelect: HTMLSelectElement = userForm.select({
id: "select-input",
name: "select",
class: "form-control",
defaultValue: "35",
isDisabled: false,
isRequired: true,
type: "text",
placeholder: "Please Select City",
multiple: false,
options: [{ text: "İzmir", value: "35" }],
});
Parameters
Common Parameters
Key | Type |
---|---|
id | string |
name | string |
class | string |
placeholder | string |
defaultValue | string |
isDisabled | boolean |
isRequired | boolean |
Input Parameters
Key | Type |
---|---|
type | text, email, password |
placeholder | string |
Select Parameters
Key | Type |
---|---|
multiple | boolean |
options | []{ value: string, text: string: selected?: boolean } |
License
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
0.0.20
5 years ago
0.0.18
5 years ago
0.0.19
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago