Moveable
    Preparing search index...

    Interface RoundableProps

    interface RoundableProps {
        isDisplayShadowRoundControls?: boolean | "horizontal";
        maxRoundControls?: number[];
        minRoundControls?: number[];
        onRound?: (e: OnRound) => any;
        onRoundEnd?: (e: OnRoundEnd) => any;
        onRoundGroup?: (e: OnRoundGroup) => any;
        onRoundGroupEnd?: (e: OnRoundGroupEnd) => any;
        onRoundGroupStart?: (e: OnRoundGroupStart) => any;
        onRoundStart?: (e: OnRoundStart) => any;
        roundable?: boolean;
        roundClickable?: boolean | "control" | "line";
        roundPadding?: number;
        roundRelative?: boolean;
    }

    Hierarchy (View Summary)

    Index
    isDisplayShadowRoundControls?: boolean | "horizontal"

    Whether to show a round control that does not actually exist as a shadow

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    isDisplayShadowRoundControls: false,
    });
    moveable.isDisplayShadowRoundControls = true;
    maxRoundControls?: number[]

    Maximum number of round controls. It moves in proportion by control. [horizontal, vertical]

    [4, 4]
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    maxRoundControls: [4, 4],
    });
    moveable.maxRoundControls = [1, 0];
    minRoundControls?: number[]

    Minimum number of round controls. It moves in proportion by control. [horizontal, vertical]

    [0, 0]
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    minRoundControls: [0, 0],
    });
    moveable.minRoundControls = [1, 0];
    onRound?: (e: OnRound) => any

    When drag or double click the border area or controls, the round event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    onRoundEnd?: (e: OnRoundEnd) => any

    When drag end the border area or controls, the roundEnd event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    onRoundGroup?: (e: OnRoundGroup) => any

    When drag or double click the border area or controls, the roundGroup event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    targets: [target1, target2, target3],
    roundable: true,
    });
    moveable.on("roundGroupStart", e => {
    console.log(e.targets);
    }).on("roundGroup", e => {
    e.events.forEach(ev => {
    ev.target.style.cssText += ev.cssText;
    });
    }).on("roundGroupEnd", e => {
    console.log(e);
    });
    onRoundGroupEnd?: (e: OnRoundGroupEnd) => any

    When drag end the border area or controls, the roundGroupEnd event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    targets: [target1, target2, target3],
    roundable: true,
    });
    moveable.on("roundGroupStart", e => {
    console.log(e.targets);
    }).on("roundGroup", e => {
    e.events.forEach(ev => {
    ev.target.style.cssText += ev.cssText;
    });
    }).on("roundGroupEnd", e => {
    console.log(e);
    });
    onRoundGroupStart?: (e: OnRoundGroupStart) => any

    When drag start the clip area or controls, the roundGroupStart event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    targets: [target1, target2, target3],
    roundable: true,
    });
    moveable.on("roundGroupStart", e => {
    console.log(e.targets);
    }).on("roundGroup", e => {
    e.events.forEach(ev => {
    ev.target.style.cssText += ev.cssText;
    });
    }).on("roundGroupEnd", e => {
    console.log(e);
    });
    onRoundStart?: (e: OnRoundStart) => any

    When drag start the clip area or controls, the roundStart event is called.

    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    roundable?: boolean

    Whether to show and drag or double click border-radius.

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });
    roundClickable?: boolean | "control" | "line"

    Whether you can add/delete round controls by double-clicking a line or control.

    true
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    roundClickable: true,
    });
    moveable.roundClickable = false;
    roundPadding?: number

    The padding value of the position of the round control

    0
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundPadding: 0,
    });
    moveable.roundPadding = 15;
    roundRelative?: boolean

    % Can be used instead of the absolute px

    false
    
    import Moveable from "@moveable-next/vanilla";

    const moveable = new Moveable(document.body, {
    roundable: true,
    roundRelative: false,
    });
    moveable.on("roundStart", e => {
    console.log(e);
    }).on("round", e => {
    e.target.style.borderRadius = e.borderRadius;
    }).on("roundEnd", e => {
    console.log(e);
    });