3.6.5 • Published 6 years ago

as24-autocomplete v3.6.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 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

6 years ago

3.6.4

6 years ago

3.6.3

6 years ago

3.6.2

6 years ago

3.6.1

7 years ago

3.6.0

7 years ago

3.5.0

7 years ago

3.4.4

7 years ago

3.4.3

7 years ago

3.4.2

7 years ago

3.4.1

7 years ago

3.4.0

7 years ago

3.3.0

7 years ago

3.2.1

7 years ago

3.2.0

7 years ago

3.1.1

7 years ago

3.1.0

7 years ago

3.0.14

7 years ago

3.0.13

7 years ago

3.0.12

7 years ago

3.0.11

7 years ago

3.0.10

7 years ago

3.0.9

7 years ago

3.0.8

7 years ago

3.0.7

7 years ago

3.0.6

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.2.5

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.5

7 years ago

2.1.4

7 years ago

2.1.3

7 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.13.5

7 years ago

0.13.4

7 years ago

0.13.3

7 years ago

0.13.2

7 years ago

0.13.1

7 years ago

0.12.5

7 years ago

0.12.4

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.12.0

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.3.1

7 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.8

8 years ago