ngrx-forms-material
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

Ngrx Forms Material

This project enhances compatibility between Angular Material elements and the Ngrx Forms library.

Installation

  npm i ngrx-forms-material

Usage

  • Import NgrxFormsMaterialModule in your app
  • Put "allowSyntheticDefaultImports": true in your tsconfig.json for moment.js import
  • Refer to the following section for features
  • Refer to the demo app in the projects folder for implementation details.

Features

The project aims to provide the following improvements:

  • mat-datepicker:

    • Compatibility for elements with selector: input[ngrxFormControlState][matDatepicker]
    • Minimum and maximum date management with min and max inputs
    • ISO8601 date conversion with NgrxDateToISO8601 for use with ngrxValueConverter directive
    • ISO8601 UTC date conversion with NgrxDateToISO8601UTC for use with ngrxValueConverter directive
  • mat-datetimepicker:

    • Compatibility for elements with selector: input[ngrxFormControlState][matDatetimepicker]
    • ISO8601 datetime with timezone conversion with NgrxDateTimeZoneToISO8601 for use with ngrxValueConverter directive
  • mat-select :

    • Compatibility for elements with selector: mat-select[ngrxFormControlState]
    • Support for multiple selectors
  • mat-autocomplete :

    • Compatibility for elements with selector: input[ngrxFormControlState][matAutocomplete]
    • Management of minimum characters for autocomplete activation with autocompleteMinChars input
    • autocompleteValue validator for use with updateGroup to validate the field
    • requiredAutocompleteValue validator for use with updateGroup to validate required fields
    • Autocomplete field conversion with NgrxAutocompleteConverter for use with ngrxValueConverter directive
  • mat-error :

    • Compatibility for elements with selector: [ngrxFormControlState]

Anyway, it gives to you some usefull store tools :

  • createNgrxFormAdapter : Adapter for Ngrx Forms with form ID and initial data
  • getInitialFormState : Retrieve initial form state
  • createInitialStateFactory : Create the initial form state
  • createSelectorsFactory : Create selectors to retrieve form information such as selectFormGroup, selectFormControls, selectFormGroupData, selectLastFocusedAutocompleteField, and selectLastFocusedAutocompleteData

Licence

MIT

Package Sidebar

Install

npm i ngrx-forms-material

Weekly Downloads

3

Version

0.5.1

License

MIT

Unpacked Size

145 kB

Total Files

36

Last publish

Collaborators

  • dotmobo