# API of `@koobiq/components/content-panel`

Documented on [Content panel](https://koobiq.io/en/components/content-panel.md). NgModule: `KbqContentPanelModule`.

## Components

### KbqContentPanel (component)

```ts
@Component({ selector: 'kbq-content-panel' })
class KbqContentPanel {}
```

### KbqContentPanelAside (component)

```ts
@Component({
    selector: 'kbq-content-panel-aside',
    exportAs: 'kbqContentPanelAside'
})
class KbqContentPanelAside {}
```

### KbqContentPanelBody (component)

```ts
@Component({
    selector: 'kbq-content-panel-body',
    exportAs: 'kbqContentPanelBody'
})
class KbqContentPanelBody {}
```

### KbqContentPanelContainer (component)

```ts
@Component({
    selector: 'kbq-content-panel-container',
    exportAs: 'kbqContentPanelContainer'
})
class KbqContentPanelContainer {
    readonly openedInput = input<boolean | undefined>(undefined, {
        alias: 'opened'
    });
    readonly disableClose = input<boolean>(false);
    readonly disableCloseByEscape = input<boolean>(this.disableClose());
    readonly disableResizer = input<boolean>(false);
    readonly minWidth = input<number>(480);
    readonly width = input<number>(640);
    readonly maxWidth = input<number>(800);
    readonly openedChange = output<boolean>();
    readonly isOpened: Signal<boolean>;
    get hasSavedState(): boolean;
    saveState(): void;
    clearSavedState(): void;
    toggle(): void;
    open(): void;
    close(): void;
}
```

- `[opened]`: `boolean | undefined` — Whether the content panel is opened. Defaults to `undefined`.

  Bound through the `opened` attribute. Unset it is `undefined` rather than `false`, which is how the
  container tells an application that drives the panel from one that leaves it to remember its own
  state. Read `isOpened` for the state itself.
- `[disableClose]`: `boolean` — Whether the content panel can not be closed by clicking on the close button or pressing the ESCAPE key.
  Defaults to `false`.
- `[disableCloseByEscape]`: `boolean` — Whether the content panel can not be closed by pressing the ESCAPE key.
- `[disableResizer]`: `boolean` — Whether the content panel resizer is disabled.
- `[minWidth]`: `number` — Minimum width of the `KbqContentPanel`. Defaults to `480`.
- `[width]`: `number` — Width of the `KbqContentPanel`. Defaults to `640`.
- `[maxWidth]`: `number` — Max width of the `KbqContentPanel`. Defaults to `800`.
- `[useStateSaving]`: `boolean` — Whether the component remembers its state across reloads and restores it on the next render.
  Defaults to `true`, or to whatever `KBQ_STATE_SAVING_ENABLED` is provided as.
- `[stateSavingKey]`: `string` — The key the state is persisted under. While it is empty the key is derived from where the
  component sits in the document, which moves when the surrounding markup is restructured — an `id`
  on the component or any ancestor pins it just as well as this input does.
- `(openedChange)`: `boolean` — Emits event when the content panel opened state is changed.
- `isOpened`: `Signal<boolean>` — Whether the content panel is opened.
- `hasSavedState`: `boolean` — Whether state is currently persisted for this panel — restored on init, or written since.
  Always `false` while `useStateSaving` is unset, and `false` again after `clearSavedState()`.
- `saveState()`: `void` — Persists whether the panel is open and how wide it is.

  Called whenever the panel is opened, closed or resized.
- `clearSavedState()`: `void` — Removes the state persisted for this panel.

  Persistence itself stays on — the next change is written again. Unset `useStateSaving` to stop it.
- `toggle()`: `void` — Toggles the content panel opened state.
- `open()`: `void` — Opens the content panel.
- `close()`: `void` — Closes the content panel.

### KbqContentPanelFooter (component)

```ts
@Component({ selector: 'kbq-content-panel-footer' })
class KbqContentPanelFooter {}
```

### KbqContentPanelHeader (component)

```ts
@Component({ selector: 'kbq-content-panel-header' })
class KbqContentPanelHeader {}
```

- `[localeOverrides]`: `KbqPartialLocaleData | undefined` — Localized strings for this element and its subtree, keyed by locale section. Every key is optional at
  every depth.

## Directives

### KbqContentPanelHeaderActions (directive)

```ts
@Directive({
    selector: '[kbqContentPanelHeaderActions]',
    exportAs: 'kbqContentPanelHeaderActions'
})
class KbqContentPanelHeaderActions {}
```

### KbqContentPanelHeaderTitle (directive)

```ts
@Directive({
    selector: '[kbqContentPanelHeaderTitle]',
    exportAs: 'kbqContentPanelHeaderTitle'
})
class KbqContentPanelHeaderTitle {}
```

## Types

### KbqContentPanelState (interface)

The persisted state of a content panel — whether it was open, and how wide it was dragged.

```ts
interface KbqContentPanelState {
    opened: boolean;
    width: number;
}
```
