{"name":"@storybook/react-fuzzy","version":"0.4.0","description":"React Fuzzy Component","repository":{"type":"git","url":"git+https://github.com/storybooks/react-fuzzy-search.git"},"bugs":{"url":"https://github.com/storybooks/react-fuzzy-search/issues"},"homepage":"https://github.com/storybooks/react-fuzzy-search","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","babel-cli":"^6.24.1","babel-core":"^6.24.1","babel-eslint":"^7.2.3","babel-loader":"^7.0.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":"^2.9.6","cz-conventional-changelog":"^2.0.0","enzyme":"^2.8.2","eslint":"^3.19.0","@ndelangen/eslint-config-airbnb":"14.1.0","eslint-config-prettier":"^2.0.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^5.0.1","eslint-plugin-prettier":"^2.0.1","eslint-plugin-react":"^7.0.0","eslint-plugin-jest":"^20.0.0","git-url-parse":"^6.2.2","jsdom":"^10.1.0","mocha":"^3.3.0","prettier":"^1.3.1","raw-loader":"^0.5.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":"^0.17.0","webpack-hot-middleware":"^2.18.0"},"peerDependencies":{"react":"^0.14.7 || ^15.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"}},"gitHead":"638f7a3adc593d2c5e47a6d2e83b4b4e7783b087","_id":"@storybook/react-fuzzy@0.4.0","_shasum":"2961e8a1f6c1afcce97e9e9a14d1dfe9d9061087","_from":".","_npmVersion":"4.5.0","_nodeVersion":"6.10.0","_npmUser":{"name":"ndelangen","email":"ndelangen@me.com"},"dist":{"shasum":"2961e8a1f6c1afcce97e9e9a14d1dfe9d9061087","tarball":"http://registry-npm.ywwl.com/@storybook/react-fuzzy/download/@storybook/react-fuzzy-0.4.0.tgz","integrity":"sha512-ZOXZlu3RNcR7vWzauDmRxRU6nSOIznWaR0+GjrGpOYli3YvmvH3jG05ToEXtcNewmS++Ne9QYiGCru74WBh8hg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMnnkHeSXc2KyfH6j/M988tFieXsFo84tK8X+YL+oqJwIhAMpNoLI/oayAzvQGt5jyjy4OcUHYtsfnz0sICgNLvVwH"}],"size":5621,"noattachment":false,"key":"/@storybook/react-fuzzy/-/@storybook/react-fuzzy-0.4.0.tgz"},"maintainers":[{"name":"ndelangen","email":"ndelangen@me.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/react-fuzzy-0.4.0.tgz_1494445222897_0.35092489677481353"},"directories":{},"readme":"# react-fuzzy\nfuzzy search in React\n\n## Installation\n\n```shell\nnpm install --save @storybook/react-fuzzy\n```\n\n## Basic Usage\n\n```js\nconst list = [{\n  id: 1,\n  title: 'The Great Gatsby',\n  author: 'F. Scott Fitzgerald'\n}, {\n  id: 2,\n  title: 'The DaVinci Code',\n  author: 'Dan Brown'\n}, {\n  id: 3,\n  title: 'Angels & Demons',\n  author: 'Dan Brown'\n}];\n\n<FuzzySearch\n      list={list}\n      keys={['author', 'title']}\n      width={430}\n      onSelect={action('selected')}\n    />\n```\n\n## Custom Result Template\n```js\n<FuzzySearch\n  list={list}\n  keys={['author', 'title']}\n  width={430}\n  onSelect={action('selected')}\n  resultsTemplate={(props, state, styles, clickHandler) => {\n    return state.results.map((val, i) => {\n      const style = state.selectedIndex === i ? styles.selectedResultStyle : styles.resultsStyle;\n      return (\n        <div\n          key={i}\n          style={style}\n          onClick={() => clickHandler(i)}\n        >\n          {val.title}\n          <span style={{ float: 'right', opacity: 0.5 }}>by {val.author}</span>\n        </div>\n      );\n    });\n  }}\n/>\n```\n\n## Options\n\nattribute|default|description\n---------|-------|-----------\ncaseSensitive|false|Indicates whether comparisons should be case sensitive.\nclassName|null|give a custom class name to the root element\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.\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.\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' ] }`\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.\nonSelect| noop | Function to be executed on selection of any result.\nwidth|430|width of the fuzzy searchbox\nkeys|all[Array]|List of properties that will be searched. This also supports nested properties.\nlist|null|Array of properties to be filtered.\nplaceholder|'Search'|Placeholder of the searchbox\nresultsTemplate| Func | Template of the dropdown divs\nshouldSort| true | Whether to sort the result list, by score.\nsortFn|`Array.prototype.sort`|The function that is used for sorting the result list.\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.\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.\nverbose|false|Will print to the console. Useful for debugging.\n\n## License\nMIT @ Ritesh Kumar\n","publish_time":1494445224928,"_cnpm_publish_time":1494445224928,"dist-tags":{"latest":"0.4.3"}}