# API of `@koobiq/components/resizer`

Documented on [Resizer](https://koobiq.io/en/components/resizer.md). NgModule: `KbqResizerModule`.

## Directives

### KbqResizable (directive)

Directive (container) sets whether the element is resizable.

```html
<div kbqResizable>
    <div [kbqResizer]="[-1, 0]"></div>
</div>
```

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

### KbqResizer (directive)

Directive which defines element resizing direction.

```ts
@Directive({ selector: '[kbqResizer]', exportAs: 'kbqResizer' })
class KbqResizer {
    readonly direction = input.required<KbqResizerDirection>({
        alias: 'kbqResizer'
    });
    readonly cursor = input<string | null>(null);
    readonly disableSizeUpdate = input<boolean>(false);
    readonly resizeStart = output<KbqResizerSizeChangeEvent>();
    readonly sizeChange = output<KbqResizerSizeChangeEvent>();
}
```

- `[kbqResizer]`: `KbqResizerDirection` — Direction of element resizing.
- `[cursor]`: `string | null` — Overrides the cursor that is otherwise derived from the resizing direction.
- `[disableSizeUpdate]`: `boolean` — Stops the directive from writing the new size onto the resizable element, leaving the host in
  control: `resizeStart` and `sizeChange` still report the size the drag asks for, and the
  host decides what to apply. Use it when the element's size is owned by a layout the directive must
  not fight — `KbqSplitter` sizes its panels through a grid template on their common parent.

  The reported size stays measured from where the drag started rather than from the element, so a host
  that clamps or ignores a move does not accumulate drift over the rest of the drag.
- `(resizeStart)`: `KbqResizerSizeChangeEvent` — Emits the element size when a pointer drag begins, after the directive has committed to the resize.
- `(sizeChange)`: `KbqResizerSizeChangeEvent` — Emits the new size of the element after resizing.

## Types

### KbqResizerDirection (type)

Directions for resizing.

Horizontal direction (x):
- Left: -1
- None: 0
- Right: 1

Vertical direction (y):
- Up: -1
- None: 0
- Down: 1

```ts
type KbqResizerDirection = [x: -1 | 0 | 1, y: -1 | 0 | 1];
```

### KbqResizerSizeChangeEvent (type)

Event emitted when the size of the resizable element changes.

```ts
type KbqResizerSizeChangeEvent = {
    width: number;
    height: number;
};
```
