src/components/sq-selector/sq-selector.component.ts
Represents a selector input component for checkboxes or radio buttons.
Look the link about the component in original framework and the appearance
See https://css.squidit.com.br/forms/selectors
OnChanges
selector | sq-selector |
styleUrls | ./sq-selector.component.scss |
templateUrl | ./sq-selector.component.html |
Properties |
Methods |
|
Inputs |
Outputs |
constructor(translate: TranslateService)
|
||||||||
Constructs a new SqSelectorComponent.
Parameters :
|
block | |
Type : boolean
|
|
Default value : false
|
|
Block (width: 100%) the selector input. |
checked | |
Type : boolean
|
|
Default value : false
|
|
Indicates whether the selector input is checked. |
colorBackground | |
Type : string
|
|
Default value : 'green'
|
|
Background color for the selector input when checked. |
colorText | |
Type : string
|
|
Default value : ''
|
|
Text color for the selector input. |
disabled | |
Type : boolean
|
|
Indicates whether the selector input is disabled. |
errorSpan | |
Type : boolean
|
|
Default value : true
|
|
Indicates whether to display an error span. |
externalError | |
Type : string
|
|
Default value : ''
|
|
External error message for the selector input. |
hideInput | |
Type : boolean
|
|
Default value : false
|
|
Indicates whether to hide the actual input element. |
id | |
Type : string
|
|
The id attribute for the selector input. |
indeterminate | |
Type : boolean
|
|
Default value : false
|
|
Indicates whether the selector input is in an indeterminate state. |
label | |
Type : string
|
|
Default value : ''
|
|
The label for the selector input. |
name | |
Type : string
|
|
Default value : ''
|
|
The name attribute for the selector input. |
readonly | |
Type : boolean
|
|
Indicates whether the selector input is readonly. |
required | |
Type : boolean
|
|
Indicates whether the selector input is required. |
toggle | |
Type : boolean
|
|
Default value : false
|
|
Indicates whether the selector input supports toggle behavior. |
type | |
Type : "checkbox" | "radio"
|
|
Default value : 'checkbox'
|
|
The type of selector: 'checkbox' or 'radio'. |
useFormErrors | |
Type : boolean
|
|
Default value : true
|
|
Indicates whether to use form errors for validation. |
value | |
Type : any
|
|
Default value : ''
|
|
The selected value of the selector input. |
valid | |
Type : EventEmitter<boolean>
|
|
Event emitted when the selector input becomes valid or invalid. |
valueChange | |
Type : EventEmitter<literal type>
|
|
Event emitted when the value of the selector input changes. |
change | ||||||||
change(event: any)
|
||||||||
Handles the change event of the selector input.
Parameters :
Returns :
void
|
Async ngOnChanges | ||||||||
ngOnChanges(changes: SimpleChanges)
|
||||||||
Lifecycle hook called when any input properties change.
Parameters :
Returns :
any
|
Async setError | ||||||||
setError(key: string)
|
||||||||
Sets an error message.
Parameters :
Returns :
any
|
Async validate |
validate()
|
Validates the selector input and sets the error state.
Returns :
any
|
context |
Type : any
|
Default value : {
checked: this.thisChecked,
indeterminate: !this.thisChecked ? this.thisIndeterminate : false,
value: this.value
}
|
Context object containing selector properties. |
error |
Type : string
|
Default value : ''
|
Error message associated with the selector input. |
labelTemplate |
Type : TemplateRef<HTMLElement> | null
|
Default value : null
|
Decorators :
@ContentChild('labelTemplate')
|
Reference to a right-aligned label template. |
leftLabel |
Type : TemplateRef<HTMLElement> | null
|
Default value : null
|
Decorators :
@ContentChild('leftLabel')
|
Content child for the left label template. |
rightLabel |
Type : TemplateRef<HTMLElement> | null
|
Default value : null
|
Decorators :
@ContentChild('rightLabel')
|
Content child for the right label template. |
thisChecked |
Default value : false
|
Indicates whether the selector input is currently checked. |
thisIndeterminate |
Default value : false
|
Indicates whether the selector input is in an indeterminate state. |
Public translate |
Type : TranslateService
|
Decorators :
@Optional()
|
- The optional TranslateService for internationalization.
|
./sq-selector.component.scss