feat: implement vue-use integration of Fuse.js for fuzzy search

- Introduce a new FuzzySearch component for Vue 3, leveraging Fuse.js
for intelligent search capabilities.
- Implement a useFuzzySearch composable for flexible search
functionality, allowing configuration of search options.
- Create demo and README files to showcase usage and features of the
fuzzy search implementation.
- Update package.json and package-lock.json to include
@vueuse/integrations version 13.6.0 for enhanced performance.

- Introduce async-validator version 4.2.5 to package.json and
package-lock.json for enhanced validation capabilities.
- Update tmp package from version 0.2.3 to 0.2.4 in package-lock.json to
ensure compatibility and security improvements.
This commit is contained in:
padreug 2025-08-08 14:40:27 +02:00
parent 3d1bc94183
commit 74ae2538cb
3 changed files with 14 additions and 6 deletions

13
package-lock.json generated
View file

@ -14,6 +14,7 @@
"@vueuse/core": "^12.8.2", "@vueuse/core": "^12.8.2",
"@vueuse/head": "^2.0.0", "@vueuse/head": "^2.0.0",
"@vueuse/integrations": "^13.6.0", "@vueuse/integrations": "^13.6.0",
"async-validator": "^4.2.5",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
@ -5875,6 +5876,12 @@
"node": ">= 0.4" "node": ">= 0.4"
} }
}, },
"node_modules/async-validator": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/async-validator/-/async-validator-4.2.5.tgz",
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==",
"license": "MIT"
},
"node_modules/at-least-node": { "node_modules/at-least-node": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@ -13517,9 +13524,9 @@
} }
}, },
"node_modules/tmp": { "node_modules/tmp": {
"version": "0.2.3", "version": "0.2.4",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz",
"integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "integrity": "sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,

View file

@ -23,6 +23,7 @@
"@vueuse/core": "^12.8.2", "@vueuse/core": "^12.8.2",
"@vueuse/head": "^2.0.0", "@vueuse/head": "^2.0.0",
"@vueuse/integrations": "^13.6.0", "@vueuse/integrations": "^13.6.0",
"async-validator": "^4.2.5",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",

View file

@ -1,12 +1,12 @@
import { ref, computed, type Ref, type ComputedRef } from 'vue' import { ref, computed, type Ref, type ComputedRef } from 'vue'
import { useFuse, type UseFuseOptions, type FuseOptions } from '@vueuse/integrations' import { useFuse } from '@vueuse/integrations/useFuse'
import type { FuseResult } from 'fuse.js' import type { IFuseOptions, FuseResult } from 'fuse.js'
export interface FuzzySearchOptions<T = any> { export interface FuzzySearchOptions<T = any> {
/** /**
* Fuse.js options for configuring the search behavior * Fuse.js options for configuring the search behavior
*/ */
fuseOptions?: FuseOptions<T> fuseOptions?: IFuseOptions<T>
/** /**
* Maximum number of results to return * Maximum number of results to return
*/ */