{"name":"react-fuzzy","version":"0.5.0","license":"MIT","_id":"react-fuzzy@0.5.0","homepage":"https://github.com/ritz078/react-fuzzy-search#readme","bugs":{"url":"https://github.com/ritz078/react-fuzzy-search/issues"},"dist":{"shasum":"b7ee192fc1d65091ae5c506408aaf7b9fcbe0fce","tarball":"http://registry-npm.ywwl.com/react-fuzzy/download/react-fuzzy-0.5.0.tgz","integrity":"sha512-m1e5eFJeG9LuoKsC7TgI98bdtq1PgZjCKQMgkkusXLHu4vqgON+tn7gdvoIKGhI1Q8DPl3D/gpE9q4G5GzRkxQ==","signatures":[{"sig":"MEQCIActH2jpvtYwQhbBPc9+Iv/riQx6WNEp8l+eFelaT0leAiAmOh4Ns8bV09zSEJBnbluzfVQW98A/n4msQN0AhLu2ag==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":59028,"noattachment":false,"key":"/react-fuzzy/-/react-fuzzy-0.5.0.tgz"},"main":"dist/index.js","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"gitHead":"549c2ba6db529c3546962583391b97ffbd2d3fba","scripts":{"lint":"eslint src","test":"npm run lint && npm run testonly","lintfix":"eslint src --fix","testonly":"mocha --require .scripts/mocha_runner src/**/tests/**/*.js","storybook":"start-storybook -p 9010","prepublish":". ./.scripts/prepublish.sh","test-watch":"npm run testonly -- --watch --watch-extensions js","publish-storybook":"bash .scripts/publish_storybook.sh"},"_npmUser":{"name":"ritz078","email":"rkritesh078@gmail.com"},"repository":{"url":"git+https://github.com/ritz078/react-fuzzy-search.git","type":"git"},"_npmVersion":"5.5.1","description":"React Fuzzy Component","directories":{},"_nodeVersion":"8.7.0","dependencies":{"fuse.js":"^3.0.1","classnames":"^2.2.5","prop-types":"^15.5.9","babel-runtime":"^6.23.0"},"devDependencies":{"chai":"^3.5.0","jsdom":"^10.1.0","mocha":"^3.3.0","react":"^15.5.4","sinon":"^2.2.0","enzyme":"^2.8.2","eslint":"^3.19.0","prettier":"^1.3.1","babel-cli":"^6.24.1","react-dom":"^15.5.4","babel-core":"^6.24.1","commitizen":"^2.9.6","raw-loader":"^0.5.1","babel-eslint":"^7.2.3","babel-loader":"^7.0.0","style-loader":"^0.17.0","git-url-parse":"^6.2.2","babel-polyfill":"^6.23.0","stack-source-map":"^1.0.6","@kadira/storybook":"^2.35.3","babel-preset-react":"^6.24.1","eslint-plugin-jest":"^20.0.0","babel-preset-es2015":"^6.24.1","eslint-plugin-react":"^7.0.0","babel-preset-stage-2":"^6.24.1","eslint-plugin-import":"^2.2.0","eslint-config-prettier":"^2.0.0","eslint-plugin-jsx-a11y":"^5.0.1","eslint-plugin-prettier":"^2.0.1","webpack-hot-middleware":"^2.18.0","react-addons-test-utils":"^15.5.1","cz-conventional-changelog":"^2.0.0","babel-plugin-transform-runtime":"^6.23.0","@ndelangen/eslint-config-airbnb":"14.1.0"},"peerDependencies":{"react":"^0.14.7 || ^15.0.0 || ^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-fuzzy-0.5.0.tgz_1508702800659_0.9689094664063305","host":"s3://npm-registry-packages"},"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":1508702801766,"maintainers":[{"name":"ritz078","email":"rkritesh078@gmail.com"},{"name":"patrickdesign","email":"patrickwees@gmail.com"}],"_cnpm_publish_time":1508702801766,"dist-tags":{"latest":"1.3.1"}}