5.1.1 • Published 9 months ago

@asoftwareworld/form-builder v5.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Documentation

ASW Form Builder helps you with rapid development and designed web forms which includes several controls. The key feature of Form Builder is to make your content attractive and effective. We can customize our control at run time and preview the same before final submission.

Form Builder is compatible with the latest version of Angular and Angular Material. Only a few clicks can create an attractive web form and provide a JSON Schema to render all controls.

Installation

Below are some prerequisites before install Form Builder.

Step 1: Install Angular Material

Install Angular Material by running the following command:

ng add @angular/material

Step 2: Install Bootstrap

Install Bootstrap source Sass files by running the following command:

npm install bootstrap

Step 3: Install ASW Form Builder

Install Form Builder to set up in the project by running the following command:

npm install @asoftwareworld/form-builder

Step 4: Import the component modules

Import the NgModule for each component you want to use:

import { AswFormBuilderModule } from '@asoftwareworld/form-builder/form-builder';
import { AswPreviewTemplateModule } from '@asoftwareworld/form-builder/preview-template';
// ...

@NgModule({
    imports: [
        // shown passing global defaults (optional)
        AswFormBuilderModule,
        AswPreviewTemplateModule
        ...
    ]
    // ...
})
export class AppModule {}

Step 5: Include a theme

Including a theme is required to apply the form builder and controls design.

You can include this theme in component SCSS or CSS files to not use this globally in your application.

@import '~@asoftwareworld/form-builder/theme/asw-theme.min.css';

If you're using the Angular CLI, and you want to use themes globally in your application. Then you can add this to your styles.css or angular.json:

styles.css or styles.scss:

@import '~@asoftwareworld/form-builder/theme/asw-theme.min.css';

or

angular.json:

"styles": [
  "./node_modules/@asoftwareworld/form-builder/theme/asw-theme.min.css"
],

If you are not using the Angular CLI, you can include a theme via a <link> element in your index.html.

Add a selector to HTML

In your template, use the component selector:

<asw-form-builder [uploadData]="jsonData1"
    [isShowPreviewButton]="isShowPreviewButton"
    [isShowJsonDataButton]="isShowJsonDataButton"
    [isShowPublishButton]="isShowPublishButton"
    (publishClick)="saveJsonData($event)" 
    (previewClick)="previewTemplate($event)"
    (buttonClick)="buttonClick($event)"
    (aswModelChange)="onSelectionChange($event)">
</asw-form-builder>

Preview Template, use the component selector in your HTML page:

<asw-preview-template [formContainer]="jsonData" 
    (buttonClick)="buttonClick($event)"
    (aswModelChange)="onSelectionChange($event)">
</asw-preview-template>

Define in your component to get published event :

export class AppComponent {
    title = 'ASW Form Builder Demo';
    jsonData: any[] = [];
    jsonData1: any[] = [];
    isShowPreviewButton = false;
    isShowJsonDataButton = true;
    isShowPublishButton = false;
    
    // Publish Template
    saveJsonData(data: any){
        //.... 
        console.log(data);
        // do something
    }
    
    //Preview Template
    previewTemplate(data: any){
        this.jsonData = data;
    }

    buttonClick(data: any): void {
        console.log(data);
    }

    onSelectionChange(control: any): void {
        console.log(control);
    }
}

Theme

Angular Material more information and Bootstrap more information

List of Controls available

controlsdescription
HeaderHeadings are defined with the <h1> to <h6> tags. Used as a title of the post, template and resume, etc.
Image UploadUpload image with crop, zoom in, zoom out, reset, rotate, swap etc. features.
AutocompleteThe autocomplete is a normal text input enhanced by a panel of suggested relevant options as the user types.
Text fieldEnable native inputs to be used within a form field. The styles such as the underline, floating label.
Text areaEnable native inputs to be used within a form field. The styles such as the underline, floating label.
DatepickerThe datepicker allows users to enter a date either through text input, or by choosing a date from the calendar.
SelectAllows the user to select only one option using dropdown.
Multi selectAllows the user to select one or more options using dropdown.
Radio buttonAllows the user to select only one option from a group.
Checkbox buttonUse multi select check box or single checkbox and captures boolean input with an optional indeterminate mode.
ButtonAngular Material interactive button with a range of presentation options.
ParagraphParagraphs are the building blocks of papers.
DividerCreate a horizontal or vertical line styled with a Angular Material theme
Slide toggleIs an on/off control that can be toggled via clicking and draggable switch.
GridConfigure bootstrap’s grid system uses a series of containers, rows, and columns to layout and align content.
GPSAdd google map key in index.html file to use GPS feature.
QR CodeASW QR Code library for generating QR Code for Angular projects. Readme file to use feature.
SignatureThis control allow for digital signature and display the result. (Uses canvas & fabric.js).
Image DrawingThis control allow to draw on Image and display the result. (Uses canvas & fabric.js).

Browser Support

ChromeFirefoxSafariOperaEdge
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔

Report a bug

We use GitHub Issues as the official bug tracker for the ASW Form Builder. Here are some advices for our users that want to report an issue:

  1. Make sure that you are using the latest version of the ASW Form Builder.
  2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
  3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help.

Technical Support or Questions

If you have questions or need help please email asoftwareworld@gmail.com

License

MIT

Social Media

Twitter: https://twitter.com/asoftwareworld

LinkedIn: https://in.linkedin.com/company/asoftwareworld

Facebook: https://www.facebook.com/asoftwaresworld

(https://github.com/asoftwareworld/ASW-Form-Builder)

Love ASW Form Builder? Give our repo a star :star: :arrow_up:.

Donate


If this project help you reduce time to develop, you can give me a cup of coffee :)

5.1.1

9 months ago

5.1.0

1 year ago

5.0.8

1 year ago

5.0.6

1 year ago

5.0.5

1 year ago

5.0.4

1 year ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.7

1 year ago

5.0.1

2 years ago

5.0.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.1

2 years ago

4.0.2

2 years ago

4.0.0

2 years ago

3.0.0

3 years ago

2.0.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.11

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago