Coder Social home page Coder Social logo

vnphanquang / svelte-action-movable Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 335 KB

Action to move node on mousedown & mousemove

Home Page: https://github.com/vnphanquang/svelte-action-movable

License: MIT License

JavaScript 34.14% HTML 1.10% Svelte 15.09% TypeScript 49.67%
action draggable modal mousedown movable move svelte

svelte-action-movable's Introduction

Svelte Action - use:movable

This package has been moved to the @svelte-put monorepo. You can still use this package as is but a reinstallation is recommended.

# remove svelte-movable from your package.json

npm install -D @svelte-put/movable
yarn add -D @svelte-put/movable
pnpm add -D @svelte-put/movable

npm.badge bundlephobia.badge semantic-release.badge MIT

github.actions.release.badge github.release.badge

demo

Table of Contents

Show / hide

Installation

npm install -D svelte-movable
yarn add -D svelte-movable
pnpm add -D svelte-movable

Usage

See example for typical usage here.

Documentation

Typescript support

app.d.ts: show / hide
/// <reference types="@sveltejs/kit" />
/// <reference types="svelte" />

// Typescript support in svelte-kit, see
// https://github.com/sveltejs/language-tools/blob/master/docs/preprocessors/typescript.md#im-using-an-attributeevent-on-a-dom-element-and-it-throws-a-type-error

declare namespace svelte.JSX {
  interface HTMLAttributes<T> {
    // on:movablestart
    onmovablestart?: (event: CustomEvent<import('svelte-movable').MovableEventDetails>) => void;
    // on:movableend
    onmovableend?: (event: CustomEvent<import('svelte-movable').MovableEventDetails>) => void;
  }
}

For detailed documentation, see the extracted API.

Quick access to the parameter interface accepted by the action: MovableParameters.

Note: MovableParameters has properties that are all optional. By default you don't need to provide any parameter to the action.

Contributing

Read Contribution Guide

Todos

  • separate helper methods & implement unit tests

  • add field test for svelte kit (integration)

  • CI workflow (github action)

buy vnphanquang a coffee

svelte-action-movable's People

Contributors

semantic-release-bot avatar vnphanquang avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.