import { KbqActionsPanelModule } from '@koobiq/components/actions-panel';

KbqActionsPanel

serviceСкопировать ссылку на KbqActionsPanel

Service for opening actions panel.

@Injectable({ providedIn: 'root' })
class KbqActionsPanel {
    open<T, D = unknown, R = unknown>(
        component: ComponentType<T>,
        config?: KbqActionsPanelConfig<D>
    ): KbqActionsPanelRef<T, R>;
    open<T, D = unknown, R = unknown>(
        template: TemplateRef<T>,
        config?: KbqActionsPanelConfig<D>
    ): KbqActionsPanelRef<T, R>;
    close<R>(result?: R): void;
}
open()Скопировать ссылку на open()KbqActionsPanelRef<T, R>

Opens actions panel.

Parameters
config?KbqActionsPanelConfig<D>

Additional configuration options for the actions panel.

Returns
KbqActionsPanelRef<T, R>

A reference to the opened actions panel.

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

Closes the currently opened actions panel.

KbqActionsPanelConfig

classСкопировать ссылку на KbqActionsPanelConfig

Configuration for opened actions panel. Based on cdk DialogConfig.

class KbqActionsPanelConfig<D = unknown> {
    injector?: Injector;
    data?: D | null;
    containerClass?: string | string[];
    closeOnNavigation?: boolean;
    overlayContainer?: ElementRef<HTMLElement>;
    overlayPanelClass?: string | string[];
    width?: string;
    minWidth?: number | string;
    maxWidth?: number | string;
    direction?: Direction;
    scrollStrategy?: (overlay: Overlay) => ScrollStrategy;
    disableClose?: boolean;
}
injectoroptionalСкопировать ссылку на injectorInjector

Injector used for the instantiation of the component to be attached.

dataoptionalСкопировать ссылку на dataD | null

Data being injected into the child component with KBQ_ACTIONS_PANEL_DATA.

containerClassoptionalСкопировать ссылку на containerClassstring | string[]

Extra CSS classes to be added to the actions panel container.

closeOnNavigationoptionalСкопировать ссылку на closeOnNavigationboolean

Whether the actions panel should be closed of when the user goes backwards/forwards in history. Defaults to true. NOTE! This does not apply to router navigation.

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

Element the actions panel overlay is rendered into, instead of the application-wide overlay container. The panel is pinned to the bottom center of that element and resizes with it. An element that sets overflow: hidden clips it; at the default overflow: visible the entrance animation renders it below the element.

The element is mutated for as long as the panel is open: it gains one child node holding the overlay, and a static element is promoted to position: relative, since the overlay is positioned against it.

NOTE: the panel bypasses a globally provided OverlayContainer while this is set.

overlayPanelClassoptionalСкопировать ссылку на overlayPanelClassstring | string[]

Extra CSS classes to be added to the overlay panel.

widthoptionalСкопировать ссылку на widthstring

Width of the actions panel.

minWidthoptionalСкопировать ссылку на minWidthnumber | string

Min-width of the actions panel. If a number is provided, assumes pixel units.

maxWidthoptionalСкопировать ссылку на maxWidthnumber | string

Max-width of the actions panel. If a number is provided, assumes pixel units.

When omitted, the panel is capped by the width of the overlay container it is rendered into.

directionoptionalСкопировать ссылку на directionDirection

Direction of the text in the actions panel. Defaults to 'ltr'.

scrollStrategyoptionalСкопировать ссылку на scrollStrategy(overlay: Overlay) => ScrollStrategy

Scroll strategy to be used for the actions panel. Defaults to RepositionScrollStrategy.

disableCloseoptionalСкопировать ссылку на disableCloseboolean

Whether the user can use ESC or click on close button to close the actions panel. Defaults to false.

KbqActionsPanelRef

classСкопировать ссылку на KbqActionsPanelRef

Reference to actions panel opened by KbqActionsPanel service.

class KbqActionsPanelRef<I = unknown, R = unknown> {
    readonly keydownEvents: Observable<KeyboardEvent>;
    readonly beforeOpened: Observable<void>;
    readonly afterOpened: Observable<void>;
    readonly beforeClosed: Observable<R | undefined>;
    readonly afterClosed: Observable<R | undefined>;
    constructor(
        dialogRef: DialogRef<R, I>,
        containerInstance: KbqActionsPanelContainer
    );
    close(result?: R): void;
}
keydownEventsСкопировать ссылку на keydownEventsObservable<KeyboardEvent>

Emits when keydown events are targeted on the overlay.

beforeOpenedСкопировать ссылку на beforeOpenedObservable<void>

Emits when the actions panel starts opening, before its entrance animation plays.

afterOpenedСкопировать ссылку на afterOpenedObservable<void>

Emits when the actions panel has opened and appeared, or once closing cuts its entrance short.

beforeClosedСкопировать ссылку на beforeClosedObservable<R | undefined>

Emits when the actions panel starts closing, before its exit animation plays.

afterClosedСкопировать ссылку на afterClosedObservable<R | undefined>

Emits when the actions panel is finished closing.

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

Closes the actions panel.

KbqActionsPanelTemplateContext

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

Context for actions panel template.

type KbqActionsPanelTemplateContext<T = unknown, D = unknown, R = unknown> = {
    $implicit?: D | null;
    data?: D | null;
    actionsPanelRef: KbqActionsPanelRef<T, R>;
};
$implicitoptionalСкопировать ссылку на $implicitD | null

Data passed to actions panel.

Example:

<ng-template #actionsPanel let-data>{{ data.KEY }}</ng-template>
dataoptionalСкопировать ссылку на dataD | null

Data passed to actions panel.

Example:

<ng-template #actionsPanel let-data="data">{{ data.KEY }}</ng-template>
actionsPanelRefСкопировать ссылку на actionsPanelRefKbqActionsPanelRef<T, R>

Opened actions panel reference.

Example:

<ng-template #actionsPanel let-actionsPanelRef="actionsPanelRef">
  <button (click)="actionsPanelRef.close()">close</button>
</ng-template>

KBQ_ACTIONS_PANEL_DATA

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

Injection token that can be used to access the data that was passed in to actions panel.

const KBQ_ACTIONS_PANEL_DATA: InjectionToken<unknown>;

KBQ_ACTIONS_PANEL_DEFAULT_CONFIG

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

Injection token that can be used to specify default actions panel config.

const KBQ_ACTIONS_PANEL_DEFAULT_CONFIG: InjectionToken<KbqActionsPanelConfig>;

KBQ_ACTIONS_PANEL_LOCALE_CONFIGURATION

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

Localization configuration provider.

const KBQ_ACTIONS_PANEL_LOCALE_CONFIGURATION: InjectionToken<KbqActionsPanelLocaleConfiguration>;

kbqActionsPanelDefaultConfigProvider

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

Utility for providing default actions panel config through KBQ_ACTIONS_PANEL_DEFAULT_CONFIG.

const kbqActionsPanelDefaultConfigProvider: <D>(
    config: KbqActionsPanelConfig<D>
) => Provider;

kbqActionsPanelLocaleConfigurationProvider

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

Utility provider for KBQ_ACTIONS_PANEL_LOCALE_CONFIGURATION. Only the strings you pass are overridden; the rest keep following the active locale.

const kbqActionsPanelLocaleConfigurationProvider: (
    configuration: KbqDeepPartial<KbqActionsPanelLocaleConfiguration>
) => Provider;
Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.