0.4.0 • Published 6 months ago

ngrx-forms-material v0.4.0

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

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

0.4.0

6 months ago

0.3.0

11 months ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.1

1 year ago