{"name":"react-fuzzy","version":"1.3.1","description":"React Fuzzy Component","repository":{"type":"git","url":"git+https://github.com/ritz078/react-fuzzy-search.git"},"license":"MIT","scripts":{"prepublish":". ./.scripts/prepublish.sh","lint":"eslint src","lintfix":"eslint src --fix","testonly":"mocha --require .scripts/mocha_runner src/**/tests/**/*.js","test":"npm run lint && npm run testonly","test-watch":"npm run testonly -- --watch --watch-extensions js","storybook":"start-storybook -p 9010","publish-storybook":"bash .scripts/publish_storybook.sh"},"devDependencies":{"@kadira/storybook":"^2.35.3","@ndelangen/eslint-config-airbnb":"14.1.0","babel-cli":"^6.24.1","babel-core":"^6.24.1","babel-eslint":"^10.1.0","babel-loader":"^8.1.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-2":"^6.24.1","chai":"^3.5.0","commitizen":"^4.2.1","cz-conventional-changelog":"^3.3.0","enzyme":"^2.8.2","eslint":"^7.10.0","eslint-config-prettier":"^6.12.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jest":"^24.1.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react":"^7.0.0","git-url-parse":"^11.3.0","jsdom":"^16.4.0","mocha":"^3.3.0","prettier":"^2.1.2","raw-loader":"^4.0.1","react":"^15.5.4","react-addons-test-utils":"^15.5.1","react-dom":"^15.5.4","sinon":"^2.2.0","stack-source-map":"^1.0.6","style-loader":"^1.3.0","webpack-hot-middleware":"^2.18.0"},"peerDependencies":{"react":"^0.14.7 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"},"dependencies":{"prop-types":"^15.5.9","babel-runtime":"^6.23.0","classnames":"^2.2.5","fuse.js":"^3.0.1"},"main":"dist/index.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"_id":"react-fuzzy@1.3.1","gitHead":"1f5fc2569ff36a53191ab9c6b11a3308628f8bfb","bugs":{"url":"https://github.com/ritz078/react-fuzzy-search/issues"},"homepage":"https://github.com/ritz078/react-fuzzy-search#readme","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-STqhUhtZjXO6KDyJxsLx4lYAXuZTC9wzDFTU5f9EHBKvAZ0Gu9rYv7y/0aTYwt5kPFh3EFIFC3iHssRIi5050g==","shasum":"94b3656760bdd29c615d4ba4a82f9276f488d0b1","tarball":"http://registry-npm.ywwl.com/react-fuzzy/download/react-fuzzy-1.3.1.tgz","fileCount":15,"unpackedSize":13747,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEl5IcaVqix+mxZRI8uICG8nfJLZK6K4qLfi6en5mxajAiA+AZq+qzm/TBMjkvQTYkCbjlc7+kxBASWgdx0VoeOMCA=="}],"size":6121,"noattachment":false,"key":"/react-fuzzy/-/react-fuzzy-1.3.1.tgz"},"_npmUser":{"name":"patrickdesign","email":"patrickwees@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-fuzzy_1.3.1_1722968090142_0.9889637544580794"},"_hasShrinkwrap":false,"readme":"# react-fuzzy\r\nfuzzy search in React\r\n\r\n## Installation\r\n\r\n```shell\r\nnpm install --save react-fuzzy\r\n```\r\n\r\n## Basic Usage\r\n\r\n```js\r\nconst list = [{\r\n  id: 1,\r\n  title: 'The Great Gatsby',\r\n  author: 'F. Scott Fitzgerald'\r\n}, {\r\n  id: 2,\r\n  title: 'The DaVinci Code',\r\n  author: 'Dan Brown'\r\n}, {\r\n  id: 3,\r\n  title: 'Angels & Demons',\r\n  author: 'Dan Brown'\r\n}];\r\n\r\n<FuzzySearch\r\n      list={list}\r\n      keys={['author', 'title']}\r\n      width={430}\r\n      onSelect={(newSelectedItem) => {\r\n        // Local state setter defined elsewhere\r\n        setSelectedItem(newSelectedItem)\r\n      }}\r\n    />\r\n```\r\n\r\n## Custom Result Template\r\n```js\r\n<FuzzySearch\r\n  list={list}\r\n  keys={['author', 'title']}\r\n  width={430}\r\n  onSelect={(newSelectedItem) => {\r\n    // Local state setter defined elsewhere\r\n    setSelectedItem(newSelectedItem)\r\n  }}\r\n  resultsTemplate={(props, state, styles, clickHandler) => {\r\n    return state.results.map((val, i) => {\r\n      const style = state.selectedIndex === i ? styles.selectedResultStyle : styles.resultsStyle;\r\n      return (\r\n        <div\r\n          key={i}\r\n          style={style}\r\n          onClick={() => clickHandler(i)}\r\n        >\r\n          {val.title}\r\n          <span style={{ float: 'right', opacity: 0.5 }}>by {val.author}</span>\r\n        </div>\r\n      );\r\n    });\r\n  }}\r\n/>\r\n```\r\n\r\n## Options\r\n\r\nattribute|default|description\r\n---------|-------|-----------\r\ncaseSensitive|false|Indicates whether comparisons should be case sensitive.\r\nclassName|null|give a custom class name to the root element\r\ninputProps|{}|Props passed directly to the input element. i.e. `defaultValue`, `onChange`, etc.\r\ninputStyle|{}|Styles passed directly to the `input` element.\r\ninputWrapperStyle|{}|Styles passed directly to the `input` wrapper `div`.\r\nisDropdown|false|Hide the result list on blur.\r\nlistItemStyle|{}|Styles passed to each item in the dropdown list.\r\nlistWrapperStyle|{}|Styles passed directly to the dropdown wrapper.\r\nselectedListItemStyle|{}|Styles passed directly to current 'active' item.\r\nwidth|430|width of the fuzzy searchbox\r\ndistance|100|Determines how close the match must be to the fuzzy location (specified by location). An exact letter match which is distance characters away from the fuzzy location would score as a complete mismatch. A distance of 0 requires the match be at the exact location specified, a distance of 1000 would require a perfect match to be within 800 characters of the location to be found using a threshold of 0.8.\r\nid|null|The name of the identifier property. If specified, the returned result will be a list of the items' identifiers, otherwise it will be a list of the items.\r\ninclude|[]|An array of values that should be included from the searcher's output. When this array contains elements, each result in the list will be of the form `{ item: ..., include1: ..., include2: ... }`. Values you can include are score, matches. Eg: `{ include: ['score', 'matches' ] }`\r\nmaxPatternLength|32|The maximum length of the pattern. The longer the pattern, the more intensive the search operation will be. Whenever the pattern exceeds the maxPatternLength, an error will be thrown.\r\nonSelect| noop | Function to be executed on selection of any result.\r\nkeyForDisplayName|title|The key which should be used for list item text.\r\nkeys|all[Array]|List of properties that will be searched. This also supports nested properties.\r\nlist|null|Array of properties to be filtered.\r\nmaxResults|10|Max number of results to show at once.\r\nplaceholder|'Search'|Placeholder of the searchbox\r\nresultsTemplate| Func | Template of the dropdown divs\r\nshouldShowDropdownAtStart|false|Allow the searchbox to act as a `filter` dropdown with initial values. Yields all results when the search value is blank.\r\nshouldSort| true | Whether to sort the result list, by score.\r\nsortFn|`Array.prototype.sort`|The function that is used for sorting the result list.\r\nthreshold|0.6|At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything.\r\ntokenize|false|When true, the search algorithm will search individual words and the full string, computing the final score as a function of both. Note that when tokenize is true, the `threshold`, `distance`, and `location` are inconsequential for individual tokens.\r\nverbose|false|Will print to the console. Useful for debugging.\r\n\r\n## License\r\nMIT @ Ritesh Kumar\r\n\r\n","publish_time":1722968090275,"maintainers":[{"name":"ritz078","email":"rkritesh078@gmail.com"},{"name":"patrickdesign","email":"patrickwees@gmail.com"}],"_cnpm_publish_time":1722968090275,"dist-tags":{"latest":"1.3.1"}}