1.0.3 • Published 3 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
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.0.20
4 years ago
0.0.18
4 years ago
0.0.19
4 years ago
0.0.17
4 years ago
0.0.16
4 years ago
0.0.15
4 years ago
0.0.14
4 years ago
0.0.13
4 years ago
0.0.12
4 years ago
0.0.11
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago