UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

50 lines (49 loc) 1.84 kB
import { CanvasElementHandler } from "../../CanvasElementHandler"; import { Viewer } from "../../Viewer"; import { RotatedRectangleF, PointF } from "@aurigma/design-atoms-model/Math"; import { AnyFunction } from "@aurigma/design-atoms-model/Utils/Types"; export declare class FloatingToolbarElementHandler { private _canvasElementHandler; private _viewer; private _cssClass; private _bigButtonCssClass; private _descriptions; private _toolbarElement; private _buttonElements; private _toolbarElementId; private _centerPositionBottomOffset; private _visible; constructor(_canvasElementHandler: CanvasElementHandler, _viewer: Viewer, _cssClass: string, _bigButtonCssClass: string); init(buttonDescriptions: Map<string, IFloatingButtonDescription>): void; changeButtonsVisibility(params: { id: string; visible: boolean; }[]): void; private _changeButtonVisibility; dispose(): void; changeVisibility(value: boolean): boolean; get visible(): boolean; get isElementVisible(): boolean; private _updateVisibility; private get _isAtLeastOneButtonElementIsVisible(); update(): void; hitTest(pt: PointF): boolean; private _createRootElement; updatePosition(rectangle: RotatedRectangleF, mode?: UpdatePositionMode): void; isToolbarLargerThanRectangle(rectangle: RotatedRectangleF): boolean; private _smartUpdatePosition; private _findBetter; private _updatePositionOnCenter; private _stopPropagationFnc; private _createButtonFromDescription; } export interface IFloatingButtonDescription { cssClass: string; defaultText: string; handler: AnyFunction; visible: boolean; } export declare enum UpdatePositionMode { Smart = 0, Center = 1 }