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

mobi-dynamic-form

v0.1.17

Published

**MobiDynamicForm** is an Angular library designed to facilitate the creation of dynamic, step-based forms with a variety of field types. This library allows developers to easily configure form steps and fields, handle validation, and manage form navigati

Downloads

581

Readme

MobiDynamicForm

MobiDynamicForm is an Angular library designed to facilitate the creation of dynamic, step-based forms with a variety of field types. This library allows developers to easily configure form steps and fields, handle validation, and manage form navigation.

Table of Contents

Installation

To install and use MobiDynamicForm in your Angular project, you can include it by following the standard npm installation and Angular module setup procedures.

Usage

Code Scaffolding

Run the following command to generate a new component within the MobiDynamicForm project:

ng generate component component-name --project MobiDynamicForm

You can also generate other Angular elements like directives, pipes, services, etc., using:

ng generate directive|pipe|service|class|guard|interface|enum|module --project MobiDynamicForm

Note: Ensure to add the --project MobiDynamicForm flag; otherwise, the new elements will be added to the default project in your angular.json file.

Build

To build the project, run:

ng build MobiDynamicForm

The build artifacts will be stored in the dist/ directory.

Publishing

After building the library, navigate to the dist/mobi-dynamic-form directory and run:

npm publish

Running Unit Tests

Execute the unit tests via Karma with the following command:

ng test MobiDynamicForm

Input Configuration

The MobiDynamicForm uses the Int_StepConfig interface to configure each step of the form. Below is the structure of this interface:

export interface Int_StepConfig {
  buttonActionText: string;
  fieldType:
    | 'datePicker'
    | 'timePicker'
    | 'inputField'
    | 'textArea'
    | 'checkBox'
    | 'radioList'
    | 'dropDown'
    | 'summary';
  field: {
    isRequired: boolean;
    label: string;
    value: string;
    placeholder: string;
    multiple?: boolean;
    itemList?: Partial<Int_itemList>[];
  };
  label: string;
  inputType?: 'text' | 'number'; // Optional input type
  order: number;
  minLength?: number;
  maxLength?: number;
  export?: (value: any) => any;  // Optional export function
  customValidation?: (value: any) => boolean; // Optional custom validation function
}

Example Configuration

@Input() stepList: Int_StepConfig[] = [
  {
    buttonActionText: "Next",
    fieldType: "datePicker",
    field: {
      isRequired: true,
      label: "Date",
      value: "",
      placeholder: "",
    },
    label: "Date",
    order: 0,
  },
  {
    buttonActionText: "Next",
    fieldType: "timePicker",
    field: {
      isRequired: true,
      label: "Time",
      value: "",
      placeholder: "",
    },
    label: "Time",
    order: 1,
  },
  // Additional step configurations
];

Output Emitters

The following output emitters are provided for handling form actions:

  • submitEmitter: Triggered when the form is submitted.
  • nextEmitter: Triggered when the user proceeds to the next step.
  • prevEmitter: Triggered when the user returns to the previous step.
  • errorEmitter: Triggered when there is a validation or process error.
@Output() submitEmitter = new EventEmitter();
@Output() nextEmitter = new EventEmitter();
@Output() prevEmitter = new EventEmitter();
@Output() errorEmitter = new EventEmitter();

These emitters allow you to capture and handle various form events, enabling a seamless user experience.

Further Help

For more help with the Angular CLI, use ng help or visit the Angular CLI Overview and Command Reference page.


This README provides a quick start guide and configuration details for working with the MobiDynamicForm library. For detailed documentation and more advanced usage, refer to the official Angular and TypeScript documentation.