Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rgglez/yii-svelte-simpleautocomplete
Extension for Yii 1.1 integrating the SimpleAutocomplete Svelte component
https://github.com/rgglez/yii-svelte-simpleautocomplete
autocomplete component gui svelte yii
Last synced: 26 days ago
JSON representation
Extension for Yii 1.1 integrating the SimpleAutocomplete Svelte component
- Host: GitHub
- URL: https://github.com/rgglez/yii-svelte-simpleautocomplete
- Owner: rgglez
- License: mit
- Created: 2024-02-10T22:58:08.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-12T04:44:39.000Z (9 months ago)
- Last Synced: 2024-09-30T22:10:37.825Z (about 1 month ago)
- Topics: autocomplete, component, gui, svelte, yii
- Language: PHP
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yii-svelte-simpleautocomplete
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![GitHub issues](https://img.shields.io/github/issues/rgglez/yii-svelte-simpleautocomplete)
![GitHub commit activity](https://img.shields.io/github/commit-activity/y/rgglez/yii-svelte-simpleautocomplete)Extension for integrating the [SimpleAutocomplete](https://github.com/pstanoev/simple-svelte-autocomplete) Svelte component into a [Yii 1.1](https://www.yiiframework.com/) view.
## Installation
Just place the code in a subdirectory of your extensions directory. A pre-compiled *[main.js](assets/main.js)* file is already in the assets directory, and this will be copied to Yii's assets file.
## Compilation
In case that you need to recompile the Svelte code, you can find it in the *src* directory. The included *[package.json](src/package.json)* provides commands for **[pnpm](https://pnpm.io)**:
1. Install the dependencies:
```
pnpm install
```
2. Compile the Svelte code:
```
pnpm run build:rollup
```This will generate a new *main.js* file in the assets directory. Remember to delete the *main.js* file from your Yii assets directory, in case that your assets manager does not replaces it automatically.
## Usage
* To learn how to use the extension, see the [sample view](examples/index.php) in the examples directory.
* To learn which options can be passed to the Svelte component,
see [this](https://github.com/pstanoev/simple-svelte-autocomplete) and [this](http://simple-svelte-autocomplete.surge.sh/) pages.## Notes
Notice that the SimpleAutocomplete component documentation says that you can use the bind sintax as in *bind:selectedItem*. However, it seems that there is no way to do it from the Yii view. See the example view for details.
## License
MIT License. Please read the [LICENSE](LICENSE) file.
Copyright (c) 2024 Rodolfo González González.