Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RemainingCharsCountDirective

Remaining Characters directive for showing a characters remaining count and triggering warning and error behavior when passing specified thresholds. When the charsRemainingWarning threshold is passed, the chars-warn-remaining-pf css class is applied to the charsRemainingElement, which by default, turns the remaining count number red. By default, characters may be entered into the text field after the charsMaxLimit limit has been reached, the remaining count number will become a negative value. Setting the blockInputAtMaxLimit to true, will block additional input into the text field after the max has been reached; additionally a right-click 'paste' will only paste characters until the maximum character limit is reached.

Usage:

// Individual module import
import { RemainingCharsCountModule } from 'patternfly-ng/remainingCharsCount';
// Or
import { RemainingCharsCountModule } from 'patternfly-ng';

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

Hierarchy

  • RemainingCharsCountDirective

Implements

  • OnInit

Index

Constructors

constructor

Properties

blockInputAtMaxLimit

blockInputAtMaxLimit: boolean

If true, no more characters can be entered into the text field

charsMaxLimit

charsMaxLimit: number = 100

Number representing the maximum number of characters allowed. Default is 100

charsRemainingElement

charsRemainingElement: any

The ElementRef used to display the characters remaining count

charsRemainingWarning

charsRemainingWarning: number = 5

Number of remaining characters to warn upon. Default is 5

onOverCharsMaxLimit

onOverCharsMaxLimit: EventEmitter<Object> = new EventEmitter()

The event emitted when a remaining characters is over max limit

onUnderCharsMaxLimit

onUnderCharsMaxLimit: EventEmitter<Object> = new EventEmitter()

The event emitted when a remaining characters is under max limit

Methods

ngOnInit

  • ngOnInit(): void

Generated using TypeDoc