npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

infomaxim6-form-engine

v1.1.24

Published

Form Rendering Engine using Angular 14+ and Bootstrap 5

Downloads

30

Readme

Infomaxim Form Engine (netAmbition)

Easy Angular Reactive Form rendering from a JSON definition using the Bootstrap 5 design framework.

Wide range of form controls. Multiple columns. Multiple sections.

Rendering

Added ^Angular 14.0.0 dependency

Input

JSON object defining columns, section and fields.

Field Types

text, email, password, number, dropdown, radio, checkbox, checkboxgroup, switch, range, date, time, datetime & file

Special Fields

content, heading, image/file

Rendering

Wide array of form components. Validation management; help and error messages. Defaults to vanilla Bootstrap 5 CSS markup.

Methods

submit() Check form validation; if valid the form values are emitted. See HTML form example below.

Output

Returns JSON from form submit ready for posting or further processing.

Dependencies

^Angular 14 Bootstrap 5

Coming soon

Integration of Quill editor More layout controls

Installation

Install npm package into your Angular application

$ npm install infomaxim6-form-engine --save

Once installed you need to import the main module


import { InfomaximFormBuilderModule } from 'infomaxim-form-engine';

@NgModule({
    imports: [
        InfomaximFormBuilderModule
    ]
})
export class AppModule {

Dependencies

Usage

Create your data model object

public formConfig: any = {
    title: "Sample Form",                             //  Optional form title to display. Adds a form wrapper.
    showControls: false,                              //  Show or hide form controls                        
    controls: {
      saveButton: 'Save',                             //  Save button name
      saveButtonClass: 'btn btn-primary',             //  Save button atle
      resetButton: 'Reset',                           //  Reset button name
      resetButtonClass: 'btn btn-outline-warning'     //  Reset button style
    },
    columns: [
          {
            class: 'col-12 col-lg-6 pb-4 pb-lg-0',
            sections: [
              {
                class: 'mr-1',
                fields: [    

                  {
                    type: 'text',                                 // Field type (text, email, password, number, dropdown, radio, checkbox, switch, range, date, time, datetime & file)
                    name: 'fullName',                             // Unique field name
                    label: 'Full Name',                           // Field label
                    value: '',                                    // Field value
                    required: true,                               // Necessary field or not
                    minLength: 5,                                 // Minimum length of field (Note: only for required field)
                    maxLength: 10,                                // Maximum length of field (Note: only for required field)
                    pattern: '^\\d{1,4}$',                        // Specify Regex Pattern for the field (Note: only for required field)
                    validationMessage: 'Full Name is required.',  // Validation error message
                    multiline: false,                             // Multiline field or not
                    lines: 5,                                     // Number of rows for field (Note: only for multiline input field)
                    placeholder: 'Full Name',                     // Placeholder to show inside field
                    options: [                                    // Options to populate the field (Note: only for radio, dropdown, checkbox & switch)
                      { key: 'male', label: 'Male' },
                      { key: 'female', label: 'Female' },
                      { key: 'other', label: 'Other' }
                    ],
                    min: '0',                                     // Minimum field value (Note: only for date & range)
                    max: '100',                                   // Maximum field value (Note: only for date & range)
                    step: 5,                                      // Step field value (Note: only for range)
                    sliderLabel: '$',                             // Slider label for field (Note: only for range)
                    multiple: true,                               // Multiple file upload support for field (Note: only for file)
                    onUpload: this.onUpload.bind(this),           // Function to call on file upload (Note: only for file)
                    style: 'row',                                 // Layout type (row & column) (Note: only for checkbox, switch & radio)
                  }
                ]
              }
            ]
          }
    ]
}

onUpload(event: any) {                                // Upload function called when any file is selected
  let files: any;
  if (event?.target?.files) {
    files = event.target.files;
  } else {
    files = event
  }
  console.log(files);
}

receiveData(data: any) {                              // Received function called when user press save button
    console.log(data);
}

HTML Form

Example component inclusion:-

<infomaxim-form-engine [formConfig]="formConfig" (formData)="receiveData($event)"></infomaxim-form-engine>