Button toggle
import { KbqButtonToggleModule } from '@koobiq/components/button-toggle';

Exclusive selection button toggle group that behaves like a radio-button group.

Selector: kbq-button-toggle-group

Exported as: kbqButtonToggleGroup
Properties
Name Description
@Input()
disabled: boolean
Whether multiple button toggle group is disabled.
@Input()
multiple: boolean
Whether multiple button toggles can be selected.
@Input()
value: any
Value of the toggle group.
@Input()
vertical: boolean
Whether the toggle group is vertical.
@Output('change')
change: EventEmitter
Event emitted when the group's value changes.
buttonToggles: QueryList Child button toggle buttons.
controlValueAccessorChangeFn: (value: any) => void The method to be called in order to update ngModel. Now `ngModel` binding is not supported in multiple selection mode.
onTouched: () => any onTouch function registered via registerOnTouch (ControlValueAccessor).
selected: any Selected button toggles in the group.
Methods
emitChangeEvent
Dispatch change event with current selection and group value.
isPrechecked
Determines whether a button toggle should be checked on init.
isSelected
Checks whether a button toggle is selected.
syncButtonToggle
Syncs a button toggle's selected state with the model value.

Single button inside of a toggle group.

Selector: kbq-button-toggle

Exported as: kbqButtonToggle
Properties
Name Description
@Input()
checked: boolean
Whether the button is checked.
@Input()
disabled: boolean
@Input()
value: any
KbqButtonToggleGroup reads this to assign its own value.
@Output('change')
change: EventEmitter
Event emitted when the group value changes.
buttonToggleGroup: KbqButtonToggleGroup
iconType: string
icons: QueryList
mcButton: KbqButton
type: ToggleType
Methods
focus
Focuses the button.
markForCheck
Marks the button toggle as needing checking for change detection. This method is exposed because the parent button toggle group will directly update bound properties of the radio button.
onToggleClick
Checks the button toggle due to an interaction with the underlying native button.

Change event object emitted by MсButtonToggle.

Properties
Name Description
source: KbqButtonToggle The MсButtonToggle that emits the event.
value: any The value assigned to the MсButtonToggle.

Acceptable types for a button toggle.

type ToggleType = 'checkbox' | 'radio';
Вопросы и предложения по документации
Если у вас есть вопросы или вы хотите внести свой вклад в написание документации, пожалуйста, создайте issue в нашем репозитории на GitHub.