import { KbqResizerModule } from '@koobiq/components/resizer';

KbqResizable

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

Directive (container) sets whether the element is resizable.

Example
<div kbqResizable>
    <div [kbqResizer]="[-1, 0]"></div>
</div>
@Directive({ selector: '[kbqResizable]', exportAs: 'kbqResizable' })
class KbqResizable {}

KbqResizer

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

Directive which defines element resizing direction.

@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>();
}
kbqResizerinputrequiredСкопировать ссылку на kbqResizerKbqResizerDirection

Direction of element resizing.

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

Overrides the cursor that is otherwise derived from the resizing direction.

disableSizeUpdateinputСкопировать ссылку на disableSizeUpdateboolean

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.

resizeStartoutputСкопировать ссылку на resizeStartKbqResizerSizeChangeEvent

Emits the element size when a pointer drag begins, after the directive has committed to the resize.

sizeChangeoutputСкопировать ссылку на sizeChangeKbqResizerSizeChangeEvent

Emits the new size of the element after resizing.

KbqResizerDirection

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

Directions for resizing.

Horizontal direction (x):

  • Left: -1
  • None: 0
  • Right: 1

Vertical direction (y):

  • Up: -1
  • None: 0
  • Down: 1
type KbqResizerDirection = [x: -1 | 0 | 1, y: -1 | 0 | 1];

KbqResizerSizeChangeEvent

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

Event emitted when the size of the resizable element changes.

type KbqResizerSizeChangeEvent = {
    width: number;
    height: number;
};
Предложения по улучшению
Если вы нашли ошибку или хотите доработать статью, создайте запрос на GitHub.