├── .github
└── workflows
│ └── codeql-analysis.yml
├── LICENSE
├── README.md
├── alpinejs-multiselect.gif
├── alpinejs-multiselect.js
└── docs
├── _config.yml
├── index.html
└── index.md
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ main ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ main ]
20 | schedule:
21 | - cron: '16 10 * * 0'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'javascript' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support
38 |
39 | steps:
40 | - name: Checkout repository
41 | uses: actions/checkout@v3
42 |
43 | # Initializes the CodeQL tools for scanning.
44 | - name: Initialize CodeQL
45 | uses: github/codeql-action/init@v2
46 | with:
47 | languages: ${{ matrix.language }}
48 | # If you wish to specify custom queries, you can do so here or in a config file.
49 | # By default, queries listed here will override any specified in a config file.
50 | # Prefix the list here with "+" to use these queries and those in the config file.
51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
52 |
53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54 | # If this step fails, then you should remove it and run the build manually (see below)
55 | - name: Autobuild
56 | uses: github/codeql-action/autobuild@v2
57 |
58 | # ℹ️ Command-line programs to run using the OS shell.
59 | # 📚 https://git.io/JvXDl
60 |
61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62 | # and modify them (or add more) to build your code if your project
63 | # uses a compiled language
64 |
65 | #- run: |
66 | # make bootstrap
67 | # make release
68 |
69 | - name: Perform CodeQL Analysis
70 | uses: github/codeql-action/analyze@v2
71 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Alexander Pechkarev
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # alpinejs-multiselect
2 | Alpine.js MultiSelect component
3 |
4 | ## Features
5 | - Configurable pre-selected option
6 | - Fast search
7 | - Configurable searching values
8 | - Custom template
9 |
10 | ## Dependency
11 | - [Apline.js](https://alpinejs.dev/essentials/installation)
12 |
13 | ### [Demo](https://alexpechkarev.github.io/alpinejs-multiselect/)
14 |
15 |
16 | 
17 |
18 | ## Installation
19 |
20 | Install [Alpine.js](https://alpinejs.dev/essentials/installation).
21 |
22 | The example uses [Alpine's Focus plugin](https://alpinejs.dev/plugins/focus), this is optional.
23 |
24 | Specify your select element, `data-search` attribute value used to match against the search string, ignoring upper/lower case differences.
25 |
26 | ```html
27 |
33 | ```
34 |
35 | Initiate the Apline.js component, pre-selected options can be defined by initializing `selected` property with an array of values. `elementId` references the select element `id` defined above.
36 |
37 | ```html
38 |
192 |
312 |
313 |
314 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | ## Welcome to GitHub Pages
2 |
3 | You can use the [editor on GitHub](https://github.com/alexpechkarev/alpinejs-multiselect/edit/main/docs/index.md) to maintain and preview the content for your website in Markdown files.
4 |
5 | Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
6 |
7 | ### Markdown
8 |
9 | Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
10 |
11 | ```markdown
12 | Syntax highlighted code block
13 |
14 | # Header 1
15 | ## Header 2
16 | ### Header 3
17 |
18 | - Bulleted
19 | - List
20 |
21 | 1. Numbered
22 | 2. List
23 |
24 | **Bold** and _Italic_ and `Code` text
25 |
26 | [Link](url) and 
27 | ```
28 |
29 | For more details see [Basic writing and formatting syntax](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax).
30 |
31 | ### Jekyll Themes
32 |
33 | Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/alexpechkarev/alpinejs-multiselect/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
34 |
35 | ### Support or Contact
36 |
37 | Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.
38 |
--------------------------------------------------------------------------------