3.1.2 • Published 1 year ago

@ng-dl/numeric-input v3.1.2

Weekly downloads
25
License
MIT
Repository
github
Last release
1 year ago

Numeric Input Directive

Sync browsers' behavior and localization on numeric inputs.

Demo

StackBlitz

Edit numeric-input-demo

Installation

Install with NPM:

npm version

npm i @ng-dl/numeric-input

Usage

import { NumericInputModule } from '@ng-dl/numeric-input';

@NgModule({
  ...,
  imports: [..., NumericInputModule]
})
export class AppModule { }

Override default browser locale with any supported locale.

import { NumericInputModule, NUMERIC_INPUT_LOCALE } from '@ng-dl/numeric-input';

@NgModule({
  ...,
  imports: [..., NumericInputModule],
  providers: [..., 
               { 
                provide: NUMERIC_INPUT_LOCALE, 
                useValue: 'my-locale' | ['array-of-locales']
               }
             ]
})
export class AppModule { }

NOTICE:

NUMERIC_INPUT_LOCALE accepts an array of locales to support multiple decimal separators - to enable comma and a dot, for example, we can provide 'nl-nl', 'en-us'.

For formatting the first locale will be used.

Apply the directive:

<input dlNumericInput/>

Properties:

NameDescriptionExample
@Input() min: numberThe minumum valid value1
@Input() max: numberThe maximum valid value100
@Output() localized: EventEmitter<string>Localized number as a string'١٢٣٫٤٥'

Contributing

Pull requests are welcome. Suggestions are welcome.

For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

3.1.2

1 year ago

3.1.1

1 year ago

3.1.0

1 year ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

2.0.1

3 years ago

3.0.0

3 years ago

1.3.0

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago