{"id":16532250,"url":"https://github.com/shahabganji/aurelia-fusejs","last_synced_at":"2025-03-03T10:43:59.182Z","repository":{"id":57186842,"uuid":"105510799","full_name":"shahabganji/aurelia-fusejs","owner":"shahabganji","description":"This is an Aurelia plugin in which there is two value converters in order to use fusejs.","archived":false,"fork":false,"pushed_at":"2017-10-02T08:01:05.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T06:50:31.251Z","etag":null,"topics":["aurelia","fusejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shahabganji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-02T08:00:44.000Z","updated_at":"2022-04-21T11:23:13.000Z","dependencies_parsed_at":"2022-08-28T10:51:38.089Z","dependency_job_id":null,"html_url":"https://github.com/shahabganji/aurelia-fusejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahabganji%2Faurelia-fusejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahabganji%2Faurelia-fusejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahabganji%2Faurelia-fusejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shahabganji%2Faurelia-fusejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shahabganji","download_url":"https://codeload.github.com/shahabganji/aurelia-fusejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241652944,"owners_count":19997575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aurelia","fusejs"],"created_at":"2024-10-11T18:12:05.714Z","updated_at":"2025-03-03T10:43:59.144Z","avatar_url":"https://github.com/shahabganji.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# aurelia-fusejs\n\n This is an [Aurelia](http://aurelia.io/) plugin in which there is two value converters in order to use [fusejs](http://fusejs.io/).\n\n\n###    1. Installation\n* ```npm install aurelia-fusejs --save``` or ```yarn add aurelia-fusejs```\n* add the following line in your aurelia startup file\n\n    ```javascript\n    .plugin('aurelia-fusejs');\n    ``` \n    if you use ```webpack``` use\n    ```javascript\n     .plugin(PLATFORM.moduleName('aurelia-fusejs'));\n    ```\n\n###    2. Usage\n\nThere are two value converters in this plugin for fusejs\n\n* ### ```fuse```\n\n    Should be applied on an **```array```** of objects and should be provided two parameters as input for it: your fuzzy search options which must be of type **```FuseOptions```** and the **```criteria```** that is your searching string.\n    \n    ```html\n    \u003cul\u003e\n        \u003cli repeat.for=\"book of books | fuse:options:criteria\"\u003e\n            \u003cspan\u003e${book.title}\u003c/span\u003e\n        \u003c/li\u003e\n    \u003cul\u003e\n    ```\n    \n* ### ```fuseHighlight```\n\n    Had you provided **```includeMatches: true```** in your fusejs options, you can use the ```fuseHighlight``` value converter to get highlighted values based on the ```css``` class you pass to it as an input. Having done this way, you will get an extra property on your **item** property of fusejs resuls named *highlighted* which includes keys for the search result, the usage is like following:\n    \n    ```javascript\n        this.options = {\n            //Omitted code\n            includeMatches: true,\n            keys: [{\n                    name: 'title',\n                    weight: 0.3\n                }, {\n                    name: 'author.lastName',\n                    weight: 0.7\n                }]\n            //Omitted code\n        };\n    ```\n    \n    ```css\n    \u003cstyle\u003e\n        .my-highlight{\n            color:'#753B85';\n        }\n    \u003c/style\u003e\n    ```\n\n    ```html\n    \u003cul\u003e\n        \u003cli repeat.for=\"book of books | fuse:options:criteria | fuseHighlight:'my-highlight'\"\u003e\n            \u003cspan innerhtml.bind=\"book.item.highlighted.title || book.item.title\"\u003e\u003c/span\u003e\n            \u003cspan\u003e-\u003e\u003c/span\u003e\n            \u003cspan\u003e${book.item.author.firstName}\u003c/span\u003e \n            \u003cspan innerhtml.bind=\"book.item.highlighted.author.lastName || book.item.author.lastName\"\u003c/span\u003e\n        \u003c/li\u003e\n    \u003c/ul\u003e\n    ```\n    \n* Bear  in mind that if the key of an item does not match the criteria the ```highlighted.property``` name will be null, thus you should handle it with coalesce operator in your code\n    ```html\n    \u003c!-- omitted snippet --\u003e\n    \u003cspan innerhtml.bind=\"book.item.highlighted.author.lastName || book.item.author.lastName\"\u003c/span\u003e\n    \u003c!-- omitted snippet --\u003e\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahabganji%2Faurelia-fusejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshahabganji%2Faurelia-fusejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshahabganji%2Faurelia-fusejs/lists"}