import { KbqButtonModule } from '@koobiq/components/button';

KbqButton

componentСкопировать ссылку на KbqButton
@Component({ selector: '[kbq-button]' })
class KbqButton extends KbqColorDirective<KbqButtonColor> implements KbqTitleTextRef {
    kbqStyle = input<KbqButtonStyleInput | null | undefined>();
    disabled = input<boolean | undefined>();
    readonly color = input<T | null | undefined>();
    hasFocus: boolean;
    get textElement(): ElementRef<HTMLElement>;
    get parentTextElement(): ElementRef<HTMLElement>;
    haltDisabledEvents: (event: Event) => void;
    get colorClassName(): string;
    onFocus(): void;
    onBlur(): void;
    getHostElement(): HTMLElement;
    focus(): void;
    focusViaKeyboard(): void;
    projectContentChanged(): void;
    setDefaultColor(color: T): void;
}
kbqStyleinputСкопировать ссылку на kbqStyleKbqButtonStyleInput | null | undefined

Visual style of the button. Setting it to a value marks that value as owned by the button, so a surrounding KbqButtonGroupRoot no longer overrides it.

Reads back as the resulting host class rather than the value that was set, because the host [class] binding is what consumes it.

disabledinputСкопировать ссылку на disabledboolean | undefined

Whether the button is disabled. A surrounding KbqButtonGroupRoot can disable the button in addition to this input, but never re-enables a button disabled through it.

colorinputСкопировать ссылку на colorT | null | undefined

Color of the component. A value set in code holds until the input changes, and the default color is used while both are unset or falsy.

textElementСкопировать ссылку на textElementElementRef<HTMLElement>

The text box of the button, measured by kbq-title. Always rendered by the template.

parentTextElementСкопировать ссылку на parentTextElementElementRef<HTMLElement>

The flex row that lays out the icons and text, used as the overflow width constraint.

colorClassNameСкопировать ссылку на colorClassNamestring

current class name of color

setDefaultColor()Скопировать ссылку на setDefaultColor()void

this color will be used as a default value. For example [color]="'' | false | undefined | null".

KbqButtonGroup

componentСкопировать ссылку на KbqButtonGroup

Groups and styling related KbqButtons into a single visual unit.

@Component({ selector: 'kbq-button-group, [kbq-button-group]' })
class KbqButtonGroup {
    readonly orientation = input<KbqOrientation>('horizontal');
}
orientationinputСкопировать ссылку на orientationKbqOrientation

Layout direction: 'horizontal' or 'vertical'. Defaults to 'horizontal'.

KbqButtonCssStyler

directiveСкопировать ссылку на KbqButtonCssStyler

Applies the kbq-button/kbq-button-icon host class and the left/right icon modifier classes.

A button is treated as an icon button when its projected content consists only of KbqIcons and there are at most 2 of them. When icons are mixed with other content, only the outermost icons receive the left/right classes.

Must be used together with KbqButton (both match [kbq-button]): icon detection relies on the .kbq-button-wrapper element rendered by the component's template.

@Directive({ selector: '[kbq-button]' })
class KbqButtonCssStyler {
    readonly icons: Signal<readonly KbqIcon[]>;
    readonly nativeElement: HTMLElement;
    get isIconButton(): boolean;
    get hasNoLabel(): boolean;
    updateClassModifierForIcons(): void;
}
isIconButtonСкопировать ссылку на isIconButtonboolean

Whether the button contains only icons (at most 2).

hasNoLabelСкопировать ссылку на hasNoLabelboolean

Whether the projected label holds no text at all, e.g. an icon-only button.

KbqButtonDropdownTrigger

directiveСкопировать ссылку на KbqButtonDropdownTrigger

This directive enhances kbq-button elements acting as dropdown triggers, visually indicating the active state with the kbq-active class, following Koobiq Design System.

The directive relies on a separate KbqDropdownTrigger directive to get dropdown's state.

@Directive({ selector: '[kbq-button][kbqDropdownTriggerFor]' })
class KbqButtonDropdownTrigger {
    dropdownTrigger: KbqDropdownTrigger;
}

KbqButtonGroupRoot

directiveСкопировать ссылку на KbqButtonGroupRoot

Root directive that groups related buttons, propagating a shared style, color, and disabled state to every nested button

@Directive({ selector: '[kbqButtonGroupRoot]' })
class KbqButtonGroupRoot extends KbqColorDirective<KbqButtonColor> {
    kbqStyle = input<KbqButtonStyleInput | null | undefined>();
    disabled = input<boolean | undefined>();
    readonly color = input<T | null | undefined>();
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
kbqStyleinputСкопировать ссылку на kbqStyleKbqButtonStyleInput | null | undefined

Style applied to the group and propagated to every nested button. A button that sets its own kbqStyle keeps it.

disabledinputСкопировать ссылку на disabledboolean | undefined

Whether the root is disabled. Disabling the group disables every nested button; re-enabling it leaves buttons that are disabled through their own input untouched.

Stays undefined while the input is unbound so that nested buttons are not force-enabled.

colorinputСкопировать ссылку на colorT | null | undefined

Color of the component. A value set in code holds until the input changes, and the default color is used while both are unset or falsy.

colorClassNameСкопировать ссылку на colorClassNamestring

current class name of color

setDefaultColor()Скопировать ссылку на setDefaultColor()void

this color will be used as a default value. For example [color]="'' | false | undefined | null".

KbqButtonPrefix

directiveСкопировать ссылку на KbqButtonPrefix

Marks content to be projected into the prefix (leading) slot of a button.

@Directive({ selector: '[kbqButtonPrefix]' })
class KbqButtonPrefix {}

KbqButtonSuffix

directiveСкопировать ссылку на KbqButtonSuffix

Marks content to be projected into the suffix (trailing) slot of a button.

@Directive({ selector: '[kbqButtonSuffix]' })
class KbqButtonSuffix {}

KbqButtonColor

typeСкопировать ссылку на KbqButtonColor

Colors a button can be rendered in, as an enum member or its plain string form.

A narrower set than KbqComponentColors: the design system pairs each color with a subset of the styles (filled with contrast/contrast-fade, outline with theme-fade/contrast-fade, transparent with theme/contrast), and defines no button appearance for the status colors. A pair the design system does not define falls back to the style's default color rather than leaving the button unstyled.

type KbqButtonColor = KbqEnumValues<
    | KbqComponentColors.Theme
    | KbqComponentColors.ThemeFade
    | KbqComponentColors.Contrast
    | KbqComponentColors.ContrastFade
>;

KbqButtonStyle

typeСкопировать ссылку на KbqButtonStyle

Visual style of a button, as an enum member or its plain string form.

type KbqButtonStyle = KbqEnumValues<KbqButtonStyles>;

KbqButtonStyleInput

typeСкопировать ссылку на KbqButtonStyleInput

Value accepted by the kbqStyle input: one of the built-in styles, or a custom string that is applied verbatim as the kbq-button_<value> host class and themed by whoever sets it — kbq-filter-bar defines its changed-filter style that way. A custom style is not covered by kbq-button-theme() and takes the filled default color.

type KbqButtonStyleInput = KbqButtonStyle | (string & {});

KbqButtonStyles

enumСкопировать ссылку на KbqButtonStyles

Visual style of a button.

enum KbqButtonStyles {
    Filled = 'filled',
    Outline = 'outline',
    Transparent = 'transparent'
}

buttonLeftIconClassName

constСкопировать ссылку на buttonLeftIconClassName

Class set on a button host whose first visible child is an icon.

Public CSS hook: consumed by dropdown.scss to detect an icon-only dropdown trigger.

const buttonLeftIconClassName: string;

buttonRightIconClassName

constСкопировать ссылку на buttonRightIconClassName

Class set on a button host whose last visible child is an icon.

Public CSS hook: consumed by dropdown.scss to detect an icon-only dropdown trigger.

const buttonRightIconClassName: string;
Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.