2.5.3 • Published 8 months ago

mss-engine-forms v2.5.3

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

MssForms

This library, developed by MSS development team, provides a set of components and services for building dynamic forms in Angular applications. With this library, you can create complex forms that change dynamically based on user input or other external factors. The library provides a flexible and extensible framework for building forms that meet the needs of your application.

Installation

To use this library in your Angular project, you can install it via NPM:

npm i mss-engine-forms

Usage

To use the components and services provided by this library, you need to import the MssFormsModule module into your Angular module:

import { MssFormsModule } from 'mss-engine-forms';

@NgModule({
  declarations: [/* Your app's declarations */],
  imports: [
    BrowserModule,
    MssFormsModule,
    /* Other modules */
  ],
  providers: [/* Your app's providers */],
  bootstrap: [/* Your app's bootstrap component */]
})
export class AppModule { }

Once the MssFormsModule module is imported, you can use the components and services provided by this library in your templates and components. Here is an example of using the MssFormsComponent component in a template:

<lib-mss-forms [model]="model" [isLoading]="isLoading" (onSubmit)="onSubmit($event)"></lib-mss-forms>

In this example, the MssFormsComponent is used to render a dynamic form based on an array of field definitions (fields). When the form is submitted, the submit event is emitted, and the onSubmit method is called.

Components

This library provides the following components for building dynamic forms:

  • MssFormsComponent: Renders a dynamic form based on an array of field definitions.

Field Definitions

To create a dynamic form using this library, you need to define an Object of field definitions. Each field definition is an object that describes a single form field, including its type, label, validation rules, and other properties.

Here is an example of a field definition for a text input field:

  {
    email: {
      type: DynamicFormTypes.EMAIL,
      value: "",
      label: "Email",
      rules: {
        required: true,
        email: true
      },
      breakpoint: {
        lg: 6,
        md: 6,
        sm: 12,
        xs: 12
      }
    },
    password: {
      type: DynamicFormTypes.PASSWORD,
      value: "",
      label: "Password",
      rules: {
        required: true,
        minLength: 8
      },
      breakpoint: {
        lg: 6,
        md: 6,
        sm: 12,
        xs: 12
      }
    },
    description: {
      type: DynamicFormTypes.TEXTAREA,
      value: "",
      label: "Description",
      rules: {
        required: true
      },
      breakpoint: {
        lg: 6,
        md: 6,
        sm: 12,
        xs: 12
      }
    }
  }

Submit & Cancel Actions

// Submit

 submitBtnOptions: any = {
    content: 'Recharger',
    breakpoint: {
      lg: 2,
      md: 12,
    },
  };

// Cancel

 cancelBtnOptions: any = {
    content: 'Annuler',
    breakpoint: {
      lg: 2,
      md: 12,
    },
    submit:this.cancel.bind(this)
  };

Contributing

Contributions to this library are welcome. If you find a bug or have a feature request, please open an issue on the GitHub repository. If you want to contribute code, please fork the repository and create a pull request. Before creating a pull request, please make sure to run the tests and ensure that your code follows the project's coding guidelines.

2.5.2

8 months ago

2.5.1

8 months ago

2.5.3

8 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.4.1

10 months ago

2.2.3

11 months ago

2.4.0

10 months ago

2.2.2

11 months ago

2.4.3

10 months ago

2.2.5

11 months ago

2.4.2

10 months ago

2.2.4

11 months ago

2.4.5

10 months ago

2.2.7

10 months ago

2.4.4

10 months ago

2.2.6

10 months ago

2.3.8

10 months ago

2.3.7

10 months ago

2.3.9

10 months ago

2.3.0

10 months ago

2.5.0

9 months ago

2.3.2

10 months ago

2.3.1

10 months ago

2.3.4

10 months ago

2.3.3

10 months ago

2.3.6

10 months ago

2.3.5

10 months ago

2.4.7

9 months ago

2.2.9

10 months ago

2.4.6

10 months ago

2.2.8

10 months ago

2.4.8

9 months ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.4

1 year ago

2.1.3

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago