3.6.5 • Published 8 years ago

as24-autocomplete v3.6.5

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

as24-autocomplete

Build your autocomplete from the building blocks. Put input, data source and suggestions list inside the as24-autocomplete and you get it. For the moment we have these:

  • Input (as24-autocomplete-input)
  • Suggestions lists (more info)
    • Plain list (as24-plain-suggestions-list)
    • Grouped list (as24-grouped-suggestions-list)
  • Data sources (more info)
    • Plain data source (as24-plain-data-source)
    • Grouped data source (as24-grouped-suggestions-list)

Please, check the demo out.

Getting Started

Run the demo

npm install
gulp dev

Goto: http://localhost:3000

How to include in your project

npm install --save-dev as24-autocomplete

Include the scripts into your build process:

All at once:

require('as24-autocomplete');

... or just what is needed:

const input = require('as24-autocomplete/src/as24-autocomplete-input');
const dataSource = require('as24-autocomplete/src/data-sources/plain-data-source');
const list = require('as24-autocomplete/src/suggestions-lists/plain-suggestions-list');
const dispatcher = require('as24-autocomplete/src/as24-autocomplete-dispatcher');

input();
dataSource();
list();
dispatcher();

Using the second approach can save you a few KBs. But... it's up to you.

Include the styles into your project. You can use SASS module importer (this one for example)

@import 'as24-autocomplete'

Or just @import it from node_modules:

@import 'node_modules/as24-autocomplete/src/as24-autocomplete.sass'

Example

This is how you add the autocomplete itself:

<as24-autocomplete empty-list-message="No items satisfying your request">
  <input data-role="value" type="hidden" name="makeId">
  <as24-autocomplete-input class="as24-autocomplete__input-wrapper">
    <input type="text" data-role="user-query" class="as24-autocomplete__input" placeholder="Optional placeholder">
    <div class="as24-autocomplete__icon-wrapper">
      <div class="as24-autocomplete__icon-dropdown">
        <svg class="as24-autocomplete__icon-dropdown__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 7" height="16px" width="16px">
          <path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7L0 .5.5 0l6 6 5.9-6 .6.5"></path>
        </svg>
      </div>
      <div class="as24-autocomplete__icon-cross">
        <svg class="as24-autocomplete__icon-cross__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" height="16px" width="16px">
          <rect x="-2" y="6.8" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -3.2215 7.7782)" width="20" height="1"/>
          <rect x="-3" y="6.8" transform="matrix(0.7071 0.7071 -0.7071 0.7071 7.7786 -3.2215)" width="20" height="1"/>
        </svg>
      </div>
    </div>
  </as24-autocomplete-input>
  <!-- <ul class="as24-autocomplete__list"></ul> -->
  <as24-plain-suggestions-list data-role="list" class="as24-autocomplete__list"></as24-plain-suggestions-list>
  <as24-plain-data-source role="data-source">
    <item key="1" value="qwer"></item>
    <!-- ... -->
  </as24-plain-data-source>
</as24-autocomplete>

Migrations

Migration to 2.x

The new components has been introduced so that you can configure your autocomplete. These are:

  • as24-plain-suggestions-list
  • as24-grouped-suggestions-list
  • as24-plain-data-source
  • as24-grouped-items-data-source

When you use as24-grouped-items-data-source you should place the items within group element.

Please, check the demo out

Migration to 1.x

Please, pay attention to data-role="user-query" and data-role="value" attributes for the inputs.

The End

Happy autocompleting :)

3.6.5

8 years ago

3.6.4

9 years ago

3.6.3

9 years ago

3.6.2

9 years ago

3.6.1

9 years ago

3.6.0

9 years ago

3.5.0

9 years ago

3.4.4

9 years ago

3.4.3

9 years ago

3.4.2

9 years ago

3.4.1

9 years ago

3.4.0

9 years ago

3.3.0

9 years ago

3.2.1

9 years ago

3.2.0

9 years ago

3.1.1

9 years ago

3.1.0

9 years ago

3.0.14

9 years ago

3.0.13

9 years ago

3.0.12

9 years ago

3.0.11

9 years ago

3.0.10

9 years ago

3.0.9

9 years ago

3.0.8

9 years ago

3.0.7

9 years ago

3.0.6

9 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.2.5

9 years ago

2.2.3

9 years ago

2.2.2

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.5

9 years ago

2.1.4

9 years ago

2.1.3

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.13.5

9 years ago

0.13.4

9 years ago

0.13.3

9 years ago

0.13.2

9 years ago

0.13.1

9 years ago

0.12.5

9 years ago

0.12.4

9 years ago

0.12.3

9 years ago

0.12.2

9 years ago

0.12.1

9 years ago

0.12.0

9 years ago

0.11.3

9 years ago

0.11.2

9 years ago

0.11.1

9 years ago

0.11.0

9 years ago

0.10.3

9 years ago

0.10.2

9 years ago

0.10.1

9 years ago

0.10.0

9 years ago

0.9.0

9 years ago

0.8.0

9 years ago

0.7.2

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

10 years ago

0.3.1

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.8

10 years ago