{"name":"react-fuzzy","version":"0.1.0","license":"MIT","_id":"react-fuzzy@0.1.0","homepage":"https://github.com/you/repo#readme","bugs":{"url":"https://github.com/you/repo/issues"},"dist":{"shasum":"236079de71dd748e2127f561a29438279d1f8e39","tarball":"http://registry-npm.ywwl.com/react-fuzzy/download/react-fuzzy-0.1.0.tgz","integrity":"sha512-UB5zxwLbAyRw6J8ORcwdrJWQERx0H6xJjWXlzkug3uQinmaaFgsmbza3e5VWJNmvlbHdWc1Rg4L1ujs/j9xasw==","signatures":[{"sig":"MEYCIQCn2GMylcNOUf+5Ol0+bgjZiGqzilta0ciIlxvDP0K7qAIhAKMhE3VC0nEmm7IJnoG+CSPOgM9sh6xyay+iFCHyl1W2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":12766,"noattachment":false,"key":"/react-fuzzy/-/react-fuzzy-0.1.0.tgz"},"main":"dist/index.js","_from":".","config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"}},"_shasum":"236079de71dd748e2127f561a29438279d1f8e39","engines":{"npm":"^3.0.0"},"gitHead":"d3defcfd554052ad7284acc1432f4545cdabd8d7","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/you/repo.git","type":"git"},"_npmVersion":"2.14.12","description":"React Fuzzy Component","directories":{},"_nodeVersion":"4.2.4","dependencies":{"babel-runtime":"^6.5.0"},"devDependencies":{"chai":"^3.5.0","jsdom":"^8.3.1","mocha":"^2.4.5","react":"^15.0.0","sinon":"^1.17.3","enzyme":"^2.2.0","eslint":"^2.7.0","fuse.js":"^2.2.0","babel-cli":"^6.5.0","react-dom":"^15.0.0","babel-core":"^6.5.0","classnames":"^2.2.3","commitizen":"^2.7.6","raw-loader":"^0.5.1","babel-eslint":"^6.0.2","babel-loader":"^6.2.4","style-loader":"^0.13.1","git-url-parse":"^6.0.1","babel-polyfill":"^6.5.0","stack-source-map":"^1.0.5","@kadira/storybook":"^1.23.0","babel-preset-react":"^6.5.0","babel-preset-es2015":"^6.5.0","eslint-plugin-babel":"^3.2.0","eslint-plugin-react":"^4.3.0","babel-preset-stage-2":"^6.5.0","eslint-config-airbnb":"^7.0.0","eslint-plugin-jsx-a11y":"^0.6.2","webpack-hot-middleware":"^2.10.0","react-addons-test-utils":"^15.0.0","cz-conventional-changelog":"^1.1.5","babel-plugin-transform-runtime":"^6.5.0"},"peerDependencies":{"react":"^0.14.7 || ^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-fuzzy-0.1.0.tgz_1466781078454_0.6385998332407326","host":"packages-12-west.internal.npmjs.com"},"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":1466781079055,"maintainers":[{"name":"ritz078","email":"rkritesh078@gmail.com"},{"name":"patrickdesign","email":"patrickwees@gmail.com"}],"_cnpm_publish_time":1466781079055,"dist-tags":{"latest":"1.3.1"}}