Coder Social home page Coder Social logo

paladio / select-madu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pavish/select-madu

0.0 1.0 0.0 239 KB

SelectMadu is a replacement for the select menu with support for searching, multiple selections, async data loading and more.

Home Page: https://www.pavishkrg.com/select-madu

License: MIT License

JavaScript 89.01% Svelte 8.34% TypeScript 0.04% SCSS 2.61%

select-madu's Introduction

SelectMadu

npm version license build status

SelectMadu is a replacement for the select menu, with support for searching, multiple selections, async data loading and more.

To get started, checkout documentation and examples at https://pavishkrg.com/select-madu

Features

  • Searching select options.
  • Multi-select interface with tags.
  • Async data load as a function returing promise, for AJAX or for any async opertion.
  • Dynamic changing of data.
  • Multi-level nesting of options as groups.

Installation

Manual

Download or source the javascript file and css file from any of the following links

You can also download it directly from the releases listed in select-madu repository

<head>
  <script type="text/javascript" src="selectmadu.min.js"></script>
  <link rel="stylesheet" href="selectmadu.css">
</head>

NPM

You can install SelectMadu from npm using the following command.

npm install select-madu --save

and then import it in your javascript file

import SelectMadu from 'select-madu';

Note: CSS file has to be included separately

Svelte

Optionally, if you are using Svelte you can import SelectMadu as a component.

import SelectMadu from 'select-madu';

<SelectMadu/>

Note: CSS file has to be included separately

Basic usage

  import SelectMadu from 'select-madu';

  //To create
  let instance = new SelectMadu({
    //SelectMadu dom elements will be rendered within the specified parent element in target.
    target: document.querySelector("#parentElement"),

    //Properties for initializing SelectMadu. Refer Properties info below.
    props: {
      datasource: [
        { text: "Ferrai" }, 
        { text: "Lamborghini" },
        { text: "Aston Martin" }
      ]
    }
  });

  //To destroy and remove
  instance.$destroy();

Check out Select madu home page for usage documentation and examples.

API and Documentation

Check out SelectMadu home page for detailed documentation with properties information and API methods.

Contribute

Pull requests are encouraged and always welcome. Help make SelectMadu better!

To work on SelectMadu

git clone https://github.com/pavish/select-madu.git
cd select-madu
npm install

The component is written in Svelte. It's an awesome library, you should check it out!

SCSS is used for styling. It is separate from the component and is within styles folder.

To build, run

npm run build

Build generates the build folder, which contains the iife variant, with and without minimization It also generates the nodesrc folder which contains the es and umd variants for importing the component within your svelte app.

You can also contribute by writing additional tests, adding issues that you encounter, or by helping with the documentation.

License

MIT

select-madu's People

Contributors

pavish avatar

Watchers

 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.