1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
import{_ as a,c as r,a0 as o,o as t}from"./chunks/framework.P9qPzDnn.js";const f=JSON.parse('{"title":"Interface: Draggable<T>","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/game/boards/board/interfaces/Draggable.md","filePath":"api/game/boards/board/interfaces/Draggable.md","lastUpdated":null}'),n={name:"api/game/boards/board/interfaces/Draggable.md"};function i(d,e,s,l,c,h){return t(),r("div",null,e[0]||(e[0]=[o('<p><a href="./../../../../">Profectus</a> / <a href="./../">game/boards/board</a> / Draggable</p><h1 id="interface-draggable-t" tabindex="-1">Interface: Draggable<T> <a class="header-anchor" href="#interface-draggable-t" aria-label="Permalink to "Interface: Draggable\\<T\\>""></a></h1><p>Contains all the data tied to making a vue feature draggable</p><h2 id="extends" tabindex="-1">Extends <a class="header-anchor" href="#extends" aria-label="Permalink to "Extends""></a></h2><ul><li><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a><<code>T</code>></li></ul><h2 id="type-parameters" tabindex="-1">Type Parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type Parameters""></a></h2><p>• <strong>T</strong></p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to "Properties""></a></h2><h3 id="computedposition" tabindex="-1">computedPosition <a class="header-anchor" href="#computedposition" aria-label="Permalink to "computedPosition""></a></h3><blockquote><p><strong>computedPosition</strong>: <a href="https://vuejs.org/guide/typescript/composition-api.html#typing-computed" target="_blank" rel="noreferrer"><code>ComputedRef</code></a><<a href="./../type-aliases/NodePosition"><code>NodePosition</code></a>></p></blockquote><p>The current position, plus the current offset from being dragged.</p><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L263" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:263</a></p><hr><h3 id="dragdelta" tabindex="-1">dragDelta <a class="header-anchor" href="#dragdelta" aria-label="Permalink to "dragDelta""></a></h3><blockquote><p><strong>dragDelta</strong>: <a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a><<a href="./../type-aliases/NodePosition"><code>NodePosition</code></a>, <a href="./../type-aliases/NodePosition"><code>NodePosition</code></a>></p></blockquote><p>A reference to how far the node being dragged is from its initial position. Typically from <a href="./../functions/setupDraggableNode">setupDraggableNode</a>.</p><h4 id="inherited-from" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#dragdelta"><code>dragDelta</code></a></p><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L245" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:245</a></p><hr><h3 id="enddrag" tabindex="-1">endDrag <a class="header-anchor" href="#enddrag" aria-label="Permalink to "endDrag""></a></h3><blockquote><p><strong>endDrag</strong>: <code>VoidFunction</code></p></blockquote><p>A function to call when a drag is supposed to end. Typically from <a href="./../functions/setupDraggableNode">setupDraggableNode</a>.</p><h4 id="inherited-from-1" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-1" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#enddrag"><code>endDrag</code></a></p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L249" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:249</a></p><hr><h3 id="hasdragged" tabindex="-1">hasDragged <a class="header-anchor" href="#hasdragged" aria-label="Permalink to "hasDragged""></a></h3><blockquote><p><strong>hasDragged</strong>: <a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a><<code>boolean</code>, <code>boolean</code>></p></blockquote><p>A reference to whether or not the node being dragged has been moved away from its initial position. Typically from <a href="./../functions/setupDraggableNode">setupDraggableNode</a>.</p><h4 id="inherited-from-2" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-2" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#hasdragged"><code>hasDragged</code></a></p><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L243" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:243</a></p><hr><h3 id="id" tabindex="-1">id <a class="header-anchor" href="#id" aria-label="Permalink to "id""></a></h3><blockquote><p><strong>id</strong>: <code>T</code></p></blockquote><p>The node ID to use for the vue feature.</p><h4 id="inherited-from-3" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-3" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#id"><code>id</code></a></p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L239" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:239</a></p><hr><h3 id="initialposition" tabindex="-1">initialPosition? <a class="header-anchor" href="#initialposition" aria-label="Permalink to "initialPosition?""></a></h3><blockquote><p><code>optional</code> <strong>initialPosition</strong>: <a href="./../type-aliases/NodePosition"><code>NodePosition</code></a></p></blockquote><p>The initial position of the node on the board. Defaults to (0, 0).</p><h4 id="inherited-from-4" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-4" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#initialposition"><code>initialPosition</code></a></p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L255" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:255</a></p><hr><h3 id="nodebeingdragged" tabindex="-1">nodeBeingDragged <a class="header-anchor" href="#nodebeingdragged" aria-label="Permalink to "nodeBeingDragged""></a></h3><blockquote><p><strong>nodeBeingDragged</strong>: <a href="https://vuejs.org/guide/typescript/composition-api.html#typing-ref" target="_blank" rel="noreferrer"><code>Ref</code></a><<code>undefined</code> | <code>T</code>, <code>undefined</code> | <code>T</code>></p></blockquote><p>A reference to the current node being dragged, typically from <a href="./../functions/setupDraggableNode">setupDraggableNode</a>.</p><h4 id="inherited-from-5" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-5" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#nodebeingdragged"><code>nodeBeingDragged</code></a></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L241" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:241</a></p><hr><h3 id="onmousedown" tabindex="-1">onMouseDown()? <a class="header-anchor" href="#onmousedown" aria-label="Permalink to "onMouseDown()?""></a></h3><blockquote><p><code>optional</code> <strong>onMouseDown</strong>: (<code>e</code>) => <code>boolean</code> | <code>void</code></p></blockquote><p>A callback that's called when the element is pressed down. Fires before drag starts, and returning <code>false</code> will prevent the drag from happening.</p><h4 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h4><h5 id="e" tabindex="-1">e <a class="header-anchor" href="#e" aria-label="Permalink to "e""></a></h5><p><a href="https://developer.mozilla.org/docs/Web/API/MouseEvent" target="_blank" rel="noreferrer"><code>MouseEvent</code></a> | <a href="https://developer.mozilla.org/docs/Web/API/TouchEvent" target="_blank" rel="noreferrer"><code>TouchEvent</code></a></p><h4 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h4><p><code>boolean</code> | <code>void</code></p><h4 id="inherited-from-6" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-6" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#onmousedown"><code>onMouseDown</code></a></p><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L251" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:251</a></p><hr><h3 id="onmouseup" tabindex="-1">onMouseUp()? <a class="header-anchor" href="#onmouseup" aria-label="Permalink to "onMouseUp()?""></a></h3><blockquote><p><code>optional</code> <strong>onMouseUp</strong>: (<code>e</code>) => <code>boolean</code> | <code>void</code></p></blockquote><p>A callback that's called when the mouse is lifted off the element.</p><h4 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h4><h5 id="e-1" tabindex="-1">e <a class="header-anchor" href="#e-1" aria-label="Permalink to "e""></a></h5><p><a href="https://developer.mozilla.org/docs/Web/API/MouseEvent" target="_blank" rel="noreferrer"><code>MouseEvent</code></a> | <a href="https://developer.mozilla.org/docs/Web/API/TouchEvent" target="_blank" rel="noreferrer"><code>TouchEvent</code></a></p><h4 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h4><p><code>boolean</code> | <code>void</code></p><h4 id="inherited-from-7" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-7" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#onmouseup"><code>onMouseUp</code></a></p><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L253" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:253</a></p><hr><h3 id="position" tabindex="-1">position <a class="header-anchor" href="#position" aria-label="Permalink to "position""></a></h3><blockquote><p><strong>position</strong>: <a href="./../../../persistence/type-aliases/Persistent"><code>Persistent</code></a><<a href="./../type-aliases/NodePosition"><code>NodePosition</code></a>></p></blockquote><p>The current position of the node on the board.</p><h4 id="defined-in-9" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-9" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L261" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:261</a></p><hr><h3 id="startdrag" tabindex="-1">startDrag() <a class="header-anchor" href="#startdrag" aria-label="Permalink to "startDrag()""></a></h3><blockquote><p><strong>startDrag</strong>: (<code>e</code>, <code>id</code>) => <code>void</code></p></blockquote><p>A function to call when a drag is supposed to start. Typically from <a href="./../functions/setupDraggableNode">setupDraggableNode</a>.</p><h4 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h4><h5 id="e-2" tabindex="-1">e <a class="header-anchor" href="#e-2" aria-label="Permalink to "e""></a></h5><p><a href="https://developer.mozilla.org/docs/Web/API/MouseEvent" target="_blank" rel="noreferrer"><code>MouseEvent</code></a> | <a href="https://developer.mozilla.org/docs/Web/API/TouchEvent" target="_blank" rel="noreferrer"><code>TouchEvent</code></a></p><h5 id="id-1" tabindex="-1">id <a class="header-anchor" href="#id-1" aria-label="Permalink to "id""></a></h5><p><code>T</code></p><h4 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h4><p><code>void</code></p><h4 id="inherited-from-8" tabindex="-1">Inherited from <a class="header-anchor" href="#inherited-from-8" aria-label="Permalink to "Inherited from""></a></h4><p><a href="./MakeDraggableOptions"><code>MakeDraggableOptions</code></a>.<a href="./MakeDraggableOptions#startdrag"><code>startDrag</code></a></p><h4 id="defined-in-10" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-10" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://code.incremental.social/profectus/Profectus/src/branch/main/src/game/boards/board.tsx#L247" target="_blank" rel="noreferrer">profectus/src/game/boards/board.tsx:247</a></p>',108)]))}const g=a(n,[["render",i]]);export{f as __pageData,g as default};
|