├── .editorconfig ├── .eslintrc ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── release.yaml │ └── test.yaml ├── .gitignore ├── .npmignore ├── .prettierignore ├── .prettierrc.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── CONVENTIONS.md ├── LICENSE.md ├── README.md ├── bower.json ├── dist ├── react-geosuggest.js └── react-geosuggest.min.js ├── example └── src │ ├── app.css │ ├── app.tsx │ ├── index.html │ └── ubilabs.svg ├── package-lock.json ├── package.json ├── rollup.browser.config.mjs ├── rollup.example.config.mjs ├── rollup.module.config.mjs ├── src ├── Geosuggest.tsx ├── defaults.ts ├── filter-input-attributes.ts ├── geosuggest.css ├── index.ts ├── input.tsx ├── suggest-item.tsx ├── suggest-list.tsx └── types │ ├── fixture.ts │ ├── location.ts │ ├── props.ts │ └── suggest.ts ├── test ├── Geosuggest_spec.tsx ├── build.tests.ts ├── fixtures │ └── predictions.ts ├── google_stub.ts └── test_helper.ts ├── tsconfig.json └── tsconfig.module.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = false 9 | insert_final_newline = true 10 | indent_style = space 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "@typescript-eslint/parser", 3 | "parserOptions": { 4 | "ecmaVersion": 2018, 5 | "sourceType": "module", 6 | "ecmaFeatures": { 7 | "jsx": true 8 | } 9 | }, 10 | "plugins": ["codegen"], 11 | "extends": [ 12 | "plugin:react/recommended", 13 | "plugin:@typescript-eslint/recommended", 14 | "prettier" 15 | ], 16 | "rules": { 17 | "@typescript-eslint/explicit-member-accessibility": 0, 18 | "@typescript-eslint/ban-ts-ignore": 0, 19 | "comma-dangle": 2, 20 | "no-cond-assign": [2, "except-parens"], 21 | "no-console": [ 22 | 1, 23 | { 24 | "allow": ["warn", "error"] 25 | } 26 | ], 27 | "no-constant-condition": 2, 28 | "no-control-regex": 2, 29 | "no-debugger": 2, 30 | "no-dupe-keys": 2, 31 | "no-duplicate-case": 2, 32 | "no-empty": 2, 33 | "no-empty-character-class": 2, 34 | "no-ex-assign": 2, 35 | "no-extra-boolean-cast": 2, 36 | "no-extra-parens": 0, 37 | "no-extra-semi": 2, 38 | "no-func-assign": 2, 39 | "no-inner-declarations": 2, 40 | "no-invalid-regexp": 2, 41 | "no-irregular-whitespace": 2, 42 | "no-negated-in-lhs": 2, 43 | "no-obj-calls": 2, 44 | "no-prototype-builtins": 1, 45 | "no-regex-spaces": 1, 46 | "no-sparse-arrays": 2, 47 | "no-unexpected-multiline": 2, 48 | "no-unreachable": 2, 49 | "no-unsafe-finally": 2, 50 | "use-isnan": 2, 51 | "valid-typeof": 2, 52 | "accessor-pairs": 0, 53 | "array-callback-return": 2, 54 | "no-var": 2, 55 | "block-scoped-var": 2, 56 | "complexity": [1, 7], 57 | "consistent-return": 2, 58 | "curly": [2, "all"], 59 | "default-case": 0, 60 | "dot-location": [2, "property"], 61 | "dot-notation": [ 62 | 1, 63 | { 64 | "allowKeywords": true 65 | } 66 | ], 67 | "eqeqeq": [2, "smart"], 68 | "guard-for-in": 1, 69 | "no-alert": 2, 70 | "no-caller": 2, 71 | "no-case-declarations": 2, 72 | "no-div-regex": 1, 73 | "no-else-return": 2, 74 | "no-eq-null": 2, 75 | "no-eval": 2, 76 | "no-extend-native": 2, 77 | "no-extra-bind": 2, 78 | "no-fallthrough": 2, 79 | "no-floating-decimal": 2, 80 | "no-implicit-coercion": [ 81 | 2, 82 | { 83 | "boolean": true, 84 | "number": true, 85 | "string": true 86 | } 87 | ], 88 | "no-implied-eval": 2, 89 | "no-invalid-this": 2, 90 | "no-iterator": 2, 91 | "no-labels": 2, 92 | "no-lone-blocks": 2, 93 | "no-loop-func": 2, 94 | "no-multi-spaces": 2, 95 | "no-multi-str": 2, 96 | "no-native-reassign": 2, 97 | "no-new": 2, 98 | "no-new-func": 2, 99 | "no-new-wrappers": 2, 100 | "no-octal": 2, 101 | "no-octal-escape": 2, 102 | "no-process-env": 0, 103 | "no-proto": 2, 104 | "no-redeclare": 2, 105 | "no-return-assign": 2, 106 | "no-script-url": 2, 107 | "no-self-compare": 2, 108 | "no-sequences": 2, 109 | "no-unused-expressions": 2, 110 | "no-useless-call": 2, 111 | "no-void": 2, 112 | "no-warning-comments": 1, 113 | "no-with": 2, 114 | "radix": 2, 115 | "vars-on-top": 0, 116 | "wrap-iife": [2, "inside"], 117 | "yoda": [2, "never"], 118 | "strict": [0, "never"], 119 | "init-declarations": [1, "always"], 120 | "no-catch-shadow": 2, 121 | "no-delete-var": 2, 122 | "no-label-var": 2, 123 | "no-shadow": 2, 124 | "no-shadow-restricted-names": 2, 125 | "no-undef": 0, 126 | "no-undef-init": 2, 127 | "no-undefined": 2, 128 | "no-unused-vars": [0], 129 | "no-use-before-define": [0], 130 | "@typescript-eslint/no-use-before-define": [2], 131 | "callback-return": 2, 132 | "handle-callback-err": 1, 133 | "no-mixed-requires": 0, 134 | "no-new-require": 2, 135 | "no-path-concat": 2, 136 | "no-process-exit": 1, 137 | "no-restricted-modules": 0, 138 | "no-sync": 0, 139 | "camelcase": 2, 140 | "consistent-this": [2, "none"], 141 | "eol-last": 1, 142 | "func-names": 0, 143 | "func-style": 0, 144 | "id-length": [0], 145 | "id-match": [0], 146 | "max-nested-callbacks": [2, 3], 147 | "new-cap": 2, 148 | "new-parens": 2, 149 | "no-array-constructor": 2, 150 | "no-inline-comments": 0, 151 | "no-lonely-if": 2, 152 | "no-mixed-spaces-and-tabs": 2, 153 | "no-nested-ternary": 2, 154 | "no-new-object": 2, 155 | "no-spaced-func": 2, 156 | "no-ternary": 0, 157 | "no-trailing-spaces": 2, 158 | "no-underscore-dangle": 1, 159 | "one-var": 0, 160 | "one-var-declaration-per-line": [2, "always"], 161 | "operator-assignment": 0, 162 | "sort-vars": 0, 163 | "wrap-regex": 0, 164 | "max-depth": [1, 3], 165 | "max-len": [ 166 | 0, 167 | { 168 | "code": 80, 169 | "ignoreUrls": true, 170 | "ignorePattern": "^import " 171 | }, 172 | 2 173 | ], 174 | "max-params": [2, 4], 175 | "max-statements": [1, 15], 176 | "no-bitwise": 2, 177 | "no-plusplus": 0, 178 | "no-class-assign": 2, 179 | "no-const-assign": 2, 180 | "constructor-super": 2, 181 | "no-confusing-arrow": 1, 182 | "no-dupe-class-members": 2, 183 | "no-duplicate-imports": 1, 184 | "no-new-symbol": 2, 185 | "no-this-before-super": 2, 186 | "no-useless-computed-key": 2, 187 | "no-useless-constructor": 2, 188 | "object-shorthand": 2, 189 | "prefer-arrow-callback": [ 190 | 1, 191 | { 192 | "allowUnboundThis": false 193 | } 194 | ], 195 | "prefer-const": [ 196 | 2, 197 | { 198 | "destructuring": "all" 199 | } 200 | ], 201 | "prefer-reflect": 0, 202 | "prefer-rest-params": 1, 203 | "prefer-spread": 1, 204 | "prefer-template": 1, 205 | "require-yield": 1, 206 | "sort-imports": 0, 207 | "react/jsx-uses-vars": 2, 208 | "react/jsx-uses-react": 2, 209 | "no-empty-function": 0, 210 | "@typescript-eslint/no-empty-function": 1, 211 | "codegen/codegen": "error" 212 | }, 213 | "settings": { 214 | "react": { 215 | "version": "detect" 216 | } 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Short description 2 | 3 | I was trying to do [...] 4 | 5 | ### Expected results 6 | 7 | I expected that by going to the page '...' and pressing the button '...' then '...' would happen. 8 | 9 | ### Actual results 10 | 11 | Instead of '...', what I saw was that '...' happened instead. 12 | 13 | 14 | ### Reproduction steps 15 | 16 | 1. Go to '...' 17 | 2. Click on '....' 18 | 3. Scroll down to '....' 19 | 4. Refresh the page and wait 5 secs 20 | 5. Finally the error will happen 21 | 22 | ### Additional Information 23 | 24 | ``` 25 | Please copy/paste any additional information you would like to supply (error messages, screenshots, ...) 26 | ``` 27 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### Description 4 | 5 | Fixes a bug where '...' happened when '...' 6 | 7 | ### Checklist 8 | 9 | 10 | - [ ] All tests passing 11 | - [ ] Created tests which fail without the change (if possible) 12 | - [ ] Extended the README / documentation, if necessary 13 | - [ ] Commits and PR follow conventions 14 | -------------------------------------------------------------------------------- /.github/workflows/release.yaml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 7 | 8 | jobs: 9 | test: 10 | name: Test 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 8 13 | steps: 14 | - name: Checkout repository from GitHub 15 | uses: actions/checkout@v3 16 | - name: Setup npm 17 | uses: actions/setup-node@v3 18 | with: 19 | node-version: '16' 20 | - name: Install dependencies 21 | run: npm install 22 | - name: Run tests 23 | run: npm run test 24 | 25 | deploy-example: 26 | name: Deploy example to GitHub Pages 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Checkout repository from GitHub 30 | uses: actions/checkout@v3 31 | - name: Setup npm 32 | uses: actions/setup-node@v3 33 | with: 34 | node-version: '16' 35 | - name: Install dependencies 36 | run: npm install 37 | - name: Build example 38 | run: npm run build:example 39 | - name: Deploy to GitHub Pages 40 | run: | 41 | git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/ubilabs/react-geosuggest.git 42 | npm run publish:example -- -u "github-actions-bot " 43 | env: 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 | 46 | create-release: 47 | name: Create Release 48 | runs-on: ubuntu-latest 49 | outputs: 50 | upload_url: ${{ steps.create_release.outputs.upload_url }} 51 | steps: 52 | - name: Create Release 53 | id: create_release 54 | uses: actions/create-release@v1 55 | env: 56 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 57 | with: 58 | tag_name: ${{ github.ref }} 59 | release_name: Release ${{ github.ref }} 60 | draft: false 61 | prerelease: false 62 | 63 | publish-npm-package: 64 | name: Publish to NPM 65 | runs-on: ubuntu-latest 66 | steps: 67 | - name: Checkout repository from GitHub 68 | uses: actions/checkout@v3 69 | - name: Setup npm 70 | uses: actions/setup-node@v3 71 | with: 72 | node-version: '16' 73 | registry-url: 'https://registry.npmjs.org' 74 | # npm cache folder is in ~/, not within the working directory 75 | - name: Cache npm directory 76 | uses: actions/cache@v3 77 | with: 78 | path: ~/.npm 79 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 80 | restore-keys: | 81 | ${{ runner.os }}-node- 82 | - name: Install dependencies 83 | run: npm install 84 | - name: Build module 85 | run: npm run build:module 86 | - name: Run tests 87 | run: npm run test 88 | - name: Publish 89 | run: npm publish --access public 90 | env: 91 | NODE_AUTH_TOKEN: ${{ secrets.NPM_BOT_ACCESS_TOKEN }} 92 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - main 7 | 8 | jobs: 9 | test: 10 | name: Test 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 8 13 | steps: 14 | - name: Checkout repository from GitHub 15 | uses: actions/checkout@v3 16 | - name: Setup npm 17 | uses: actions/setup-node@v3 18 | with: 19 | node-version: '16' 20 | - name: Install dependencies 21 | run: npm install 22 | - name: Run tests 23 | run: npm run test 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Coverage tools 11 | lib-cov 12 | coverage 13 | coverage.html 14 | .cover* 15 | .nyc_output 16 | 17 | # Dependency directory 18 | node_modules 19 | 20 | # Example build directory 21 | example/dist 22 | module 23 | 24 | # Editor and other tmp files 25 | *.swp 26 | *.un~ 27 | *.iml 28 | *.ipr 29 | *.iws 30 | *.sublime-* 31 | .idea/ 32 | *.DS_Store 33 | .rpt2_cache 34 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | .nyc_output 3 | coverage 4 | example 5 | src 6 | test 7 | .editorconfig 8 | .eslintrc 9 | .gitignore 10 | .prettierrc.yml 11 | .prettierignore 12 | rollup.browser.config.js 13 | rollup.example.config.js 14 | rollup.module.config.js 15 | bower.json 16 | CONTRIBUTING.md 17 | CONVENTIONS.md 18 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | coverage 3 | dist 4 | module 5 | rollup.browser.config.js 6 | rollup.example.config.js 7 | rollup.module.config.js 8 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | singleQuote: true 2 | bracketSameLine: true 3 | bracketSpacing: false 4 | trailingComma: none 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.17.1 (2025-03-31) 2 | * fix(geosuggest): Add a key for the returned li in suggest-item by @mikedh in https://github.com/ubilabs/react-geosuggest/pull/522 3 | 4 | ## 2.17.0 (2025-01-08) 5 | 6 | 7 | ### 2.16.2 (2024-01-25) 8 | 9 | 10 | #### Bug Fixes 11 | 12 | * **Geosuggest:** fix input id and label for (#491) ([267b4ac4](https://github.com/ubilabs/react-geosuggest/commit/267b4ac4a200391d7cf295a1a5868d6b58fc9b85)) 13 | 14 | 15 | ### 2.16.1 (2023-10-02) 16 | 17 | 18 | #### Bug Fixes 19 | 20 | * **blur-callback:** call onBlur only if input loses focus (#510) ([8c804649](https://github.com/ubilabs/react-geosuggest/commit/8c804649727e3555a643e1193b0d1ea63142adf4)) 21 | 22 | 23 | ## 2.16.0 (2023-08-08) 24 | 25 | 26 | ### 2.15.1 (2023-08-07) 27 | 28 | 29 | ## 2.15.0 (2023-08-07) 30 | 31 | 32 | #### Bug Fixes 33 | 34 | * **Geosuggest:** fix accessibility (#489) ([b5a32e72](https://github.com/ubilabs/react-geosuggest/commit/b5a32e727e34aca926cee5f5fafa5f8c24c9dd82)) 35 | * **input:** fix autoComplete attribute default to off (#488) ([24ead929](https://github.com/ubilabs/react-geosuggest/commit/24ead929100f6be05e0a4828975932b19b97fbf9)) 36 | 37 | 38 | ### 2.14.1 (2021-01-28) 39 | 40 | 41 | ## 2.14.0 (2020-07-27) 42 | 43 | 44 | #### Bug Fixes 45 | 46 | * geocode in selectSuggest when nothing selected (#470) ([ada1de9f](https://github.com/ubilabs/react-geosuggest/commit/ada1de9fb6c3549639149cc6c627cfdaac1ebe4f)) 47 | 48 | 49 | #### Features 50 | 51 | * add option for search input type (#471) ([58264de2](https://github.com/ubilabs/react-geosuggest/commit/58264de27f11316c0abc7aa927bb3f9be709ea89), closes [#441](https://github.com/ubilabs/react-geosuggest/issues/441)) 52 | 53 | 54 | ### 2.13.1 (2020-06-19) 55 | 56 | 57 | #### Bug Fixes 58 | 59 | * use secure URLs (#465) ([86ec9227](https://github.com/ubilabs/react-geosuggest/commit/86ec922751c841293540e5396ce6f201b6149112)) 60 | * use a not random id for the list (#464) ([68da464e](https://github.com/ubilabs/react-geosuggest/commit/68da464e26db7af24a742973df523b4909a1ef10)) 61 | 62 | 63 | ## 2.13.0 (2020-05-08) 64 | 65 | 66 | #### Bug Fixes 67 | 68 | * catch changing fixtures (#462) ([3df1f8ee](https://github.com/ubilabs/react-geosuggest/commit/3df1f8ee3fea1a0f1a9e1bbbca0277ac833b0ad7), closes [#457](https://github.com/ubilabs/react-geosuggest/issues/457)) 69 | * stop bundling classnames and lodash.debounce (#458) ([6ffbb4be](https://github.com/ubilabs/react-geosuggest/commit/6ffbb4be9732b4ba7ba69b7beb495659fc6fc737)) 70 | 71 | 72 | #### Features 73 | 74 | * allow any data attributes (#460) ([2d11ab9b](https://github.com/ubilabs/react-geosuggest/commit/2d11ab9be31679556220b2a20516690673340d9f)) 75 | 76 | 77 | ### 2.12.1 (2019-10-30) 78 | 79 | 80 | #### Bug Fixes 81 | 82 | * warning for componentWillMount ([d8a661ec](https://github.com/ubilabs/react-geosuggest/commit/d8a661ec51cc2947c8caeb1e48735a19d538a79f)) 83 | * warnings for componentWillReceiveProps ([b24117a1](https://github.com/ubilabs/react-geosuggest/commit/b24117a1673df9cd15af12b43f1300b010571cbb)) 84 | * **geosuggest:** add a11y attributes to make suggestions be readable by screenreaders ([b6b7f3dc](https://github.com/ubilabs/react-geosuggest/commit/b6b7f3dce4f78dddec6cd1c0a74f29c43cfcd171)) 85 | 86 | 87 | ## 2.12.0 (2019-04-08) 88 | 89 | 90 | #### Features 91 | 92 | * use first suggest on selectSuggest when autoActivateFirstSuggest (#431) ([6bc9850a](https://github.com/ubilabs/react-geosuggest/commit/6bc9850a070a9379ab05064cb03635dfd324466a), closes [#423](https://github.com/ubilabs/react-geosuggest/issues/423)) 93 | 94 | 95 | ## 2.11.0 (2019-04-05) 96 | 97 | 98 | #### Features 99 | 100 | * allow custom props for fixtures ([82735c11](https://github.com/ubilabs/react-geosuggest/commit/82735c11644ee99fa31e5885828dd2f49f39bcd1)) 101 | 102 | 103 | ## 2.10.0 (2019-01-18) 104 | 105 | 106 | #### Bug Fixes 107 | 108 | * **build:** fix build on windows (#409) ([15ff2569](https://github.com/ubilabs/react-geosuggest/commit/15ff25696f84a65cb37866e206bac2508be6a5f2)) 109 | * **compatibility:** change react and reactdom to peer dependencies (#410) ([b4a8b40e](https://github.com/ubilabs/react-geosuggest/commit/b4a8b40eda5ee119acc85d6bb8c660098e4dbc9c), closes [#405](https://github.com/ubilabs/react-geosuggest/issues/405)) 110 | 111 | 112 | #### Features 113 | 114 | * **geosuggest:** add optional `placeDetailsField` prop to limit place details fields (#414) ([ea820c4c](https://github.com/ubilabs/react-geosuggest/commit/ea820c4cccc630c0a3ce21de3dc2940ab94aa1b8)) 115 | 116 | 117 | ## 2.9.0 (2018-10-19) 118 | 119 | 120 | #### Features 121 | 122 | * **geosuggest:** 123 | * add Places API sessionToken support (issue #394) ([3738916e](https://github.com/ubilabs/react-geosuggest/commit/3738916e71eb2379c06cc50db49801d6a30f9b6f)) 124 | 125 | 126 | ## 2.8.0 (2018-06-21) 127 | 128 | 129 | #### Bug Fixes 130 | 131 | * **autoComplete prop default value:** Change default value from off (which Chrome and other modern browsers ignore) to ([462bd357](https://github.com/ubilabs/react-geosuggest/commit/462bd357599828a6b7041ca6efb9e68f251d3a3c)) 132 | 133 | 134 | #### Features 135 | 136 | * **ignoreEnter:** add new prop to disable enter key.. Rename current internal varaible named "igno ([225eede4](https://github.com/ubilabs/react-geosuggest/commit/225eede4abab4226e6685c2c7aa7ba2de052e71b), closes [#345](https://github.com/ubilabs/react-geosuggest/issues/345)) 137 | * Passes userInput to the renderSuggest function ([f1eb98f](https://github.com/ubilabs/react-geosuggest/pull/381/commits/f1eb98ffaafacf512af010fff70661091b169273)) 138 | 139 | 140 | ## 2.7.0 (2017-12-11) 141 | 142 | 143 | #### Features 144 | 145 | * **SuggestItem:** Adds hook to get list of suggests on when list changes ([169951d](https://github.com/ubilabs/react-geosuggest/commit/169951d13d7a4100571c1c80820e0aaa3b56444f)) 146 | 147 | 148 | ## 2.6.0 (2017-11-10) 149 | 150 | 151 | #### Bug Fixes 152 | 153 | * **Geosuggest:** 154 | * Remove example code ([4504ef5b](https://github.com/ubilabs/react-geosuggest/commit/4504ef5bb43eeda12dfe81299dac917c91446bd5)) 155 | * clear suggestion on empty input ([4efe3d10](https://github.com/ubilabs/react-geosuggest/commit/4efe3d1007ae34749d84755356d5c64250f2db05)) 156 | * **attributes:** allow title ([c8ce8d5b](https://github.com/ubilabs/react-geosuggest/commit/c8ce8d5b52604f8f76b6e0fc0c135c3bef085c7a)) 157 | * **suggestions:** Fixed erroneous check that hid the suggestions ([5590955](https://github.com/ubilabs/react-geosuggest/commit/5590955520bd489c01683f10dce9b01a0cb0704d)) 158 | 159 | 160 | #### Features 161 | 162 | * upgrade to react 16 ([50042542](https://github.com/ubilabs/react-geosuggest/commit/5004254209a0d28be93c3ebbd7944a99b6fb5a69)) 163 | 164 | 165 | ## 2.5.0 (2017-08-17) 166 | 167 | 168 | #### Features 169 | 170 | * **filters:** Add autoCapitalize and autoCorrect to filters ([ff1153c2](https://github.com/ubilabs/react-geosuggest/commit/ff1153c27b18cd7d7b551e304a26d4ac5ff0d63d)) 171 | 172 | 173 | ## 2.4.0 (2017-08-10) 174 | 175 | #### Features 176 | 177 | * add minLength prop ([b3f2d8a](https://github.com/ubilabs/react-geosuggest/commit/b3f2d8ac5cd8a8eff2ed3fe75d6dabf3ae70288b)) 178 | 179 | 180 | ### 2.3.6 (2017-07-13) 181 | 182 | 183 | #### Bug Fixes 184 | 185 | * Fix highlight label formatting ([e652323](https://github.com/ubilabs/react-geosuggest/commit/e652323ae2bfef1fc823b91ec69609d51dbdc035)) 186 | 187 | 188 | ### 2.3.5 (2017-07-11) 189 | 190 | 191 | #### Bug Fixes 192 | 193 | * Fixed Geocoder not considering options ([b1fd7c7](https://github.com/ubilabs/react-geosuggest/commit/b1fd7c7808629f31b11e14829c3bc0cea119c07b)) 194 | 195 | 196 | ### 2.3.4 (2017-06-26) 197 | 198 | 199 | #### Bug Fixes 200 | 201 | * **suggest-item:** add missing key prop when rendering item ([c88167e7](https://github.com/ubilabs/react-geosuggest/commit/c88167e7dcc9559d987fb81019f134ec2ba2d957)) 202 | 203 | 204 | ### 2.3.3 (2017-06-19) 205 | 206 | 207 | #### Bug Fixes 208 | 209 | * Use filter over find to fix IE11 compatibility ([5dfff643](https://github.com/ubilabs/react-geosuggest/commit/5dfff643a3cefd2f30f4f8a5dfa706960be32831)) 210 | 211 | 212 | ### 2.3.2 (2017-06-19) 213 | 214 | 215 | #### Bug Fixes 216 | 217 | * **builds:** fix build errors on Windows 10 ([ab2cd25e](https://github.com/ubilabs/react-geosuggest/commit/ab2cd25e16843d307b230258dd36f84092d5b64d)) 218 | 219 | 220 | ### 2.3.1 (2017-06-16) 221 | 222 | 223 | #### Bug Fixes 224 | 225 | * **suggest-item:** 226 | * highlight matches in fixtures, too ([698ee71d](https://github.com/ubilabs/react-geosuggest/commit/698ee71d74cd16570df03089c56a6dae6d2fb171)) 227 | * correct highlight of matches not at index 0 ([ac027a1d](https://github.com/ubilabs/react-geosuggest/commit/ac027a1db66830ff4bdafe98f092986f782b3664)) 228 | 229 | 230 | ## 2.3.0 (2017-06-12) 231 | 232 | 233 | #### Bug Fixes 234 | 235 | * check whether the label is an object to use the description value ([1a5c2f78](https://github.com/ubilabs/react-geosuggest/commit/1a5c2f784aeadf52f6a247c7790b4ce37c4d702c)) 236 | * **suggest-item:** add missing key on iterated items ([b9512063](https://github.com/ubilabs/react-geosuggest/commit/b9512063462ee286de6c629518d6645f46d31cfc)) 237 | 238 | #### Features 239 | 240 | * Expose the onKeyDown event from input ([80053d5](https://github.com/ubilabs/react-geosuggest/commit/80053d5b6359a5051285d2f08e690f1af96553b7)) 241 | 242 | 243 | ## 2.2.0 (2017-06-09) 244 | 245 | 246 | #### Bug Fixes 247 | 248 | * check for console before calling console.error ([b6588bce](https://github.com/ubilabs/react-geosuggest/commit/b6588bce9cd4f5b88ad000cc381176cd63579277)) 249 | * allow for shift + arrow key behavior in input box ([ 953d341](https://github.com/ubilabs/react-geosuggest/commit/953d34116856b6575cde635215b17876f52e26d1)) 250 | * **suggest-item**: 251 | * Items are not visible due to scroll when navigating using arrow keys ([f471f96](https://github.com/ubilabs/react-geosuggest/commit/f471f966b8d95ac7849dbd7547e888f2361845e1)) 252 | * add renderSuggestItem prop for custom suggest item ([f0ff0eb](https://github.com/ubilabs/react-geosuggest/commit/f0ff0eb493eb01bec961ccb9dd9b88b3778dcf5e)) 253 | 254 | 255 | #### Features 256 | 257 | * add maxFixtures prop ([f504289](https://github.com/ubilabs/react-geosuggest/commit/f504289b39b6a042da09a013c44816177336974d)) 258 | * add highlight matched text ([1607dd3](https://github.com/ubilabs/react-geosuggest/commit/1607dd30807fa0fba7d2521a97b1b38bef59dd0c)) 259 | * add autoComplete prop ([c97ea31](https://github.com/ubilabs/react-geosuggest/commit/c97ea31da2bd5a21f494b11150272fe6e0902894)) 260 | * allow arrays for country prop ([92391c4](https://github.com/ubilabs/react-geosuggest/commit/92391c41b19f8aa911b48909b78686538cc399e3)) 261 | * use react-addons-shallow-compare ([3dcf209](https://github.com/ubilabs/react-geosuggest/commit/3dcf20980f8126f65d07371ac8770f04ebbe4065)) 262 | * use prop-types ([c76d8a0](https://github.com/ubilabs/react-geosuggest/commit/c76d8a04800951193b612a17d2756e7e1e604031)) 263 | 264 | 265 | ## 2.1.0 (2017-01-11) 266 | 267 | 268 | #### Bug Fixes 269 | 270 | * Do not use setState to save timer instance. ([3709fdb6](https://github.com/ubilabs/react-geosuggest/commit/3709fdb6f8d7d8e7133c153398be87268b445a7a)) 271 | 272 | 273 | #### Features 274 | 275 | * changed to use reacts internal shallowCompare func ([c66051d5](https://github.com/ubilabs/react-geosuggest/commit/c66051d53507d217630ca89d2a677c93ebce7d98)) 276 | * add blur() ([d16c61](https://github.com/ubilabs/react-geosuggest/commit/d16c6105557bcca8dabc160927a448d86f06ffbe)) 277 | * Added ARIA attributes to whitelist ([5cb3f9a6](https://github.com/ubilabs/react-geosuggest/commit/5cb3f9a6560e032bd1188fb7d1893bf7154446ac)) 278 | * **label:** add BEM class to geosuggest label ([fb79f34e](https://github.com/ubilabs/react-geosuggest/commit/fb79f34eceed01eeaeb94e8cfe20a4b0205e908e)) 279 | * **style**: 280 | * allow custom hidden list class and active item class ([57338753](https://github.com/ubilabs/react-geosuggest/commit/57338753de65fffd839e7d3285e690d3fd098505)) 281 | * Allow adding custom classes to the suggest list and suggest item ([ed69df6c](https://github.com/ubilabs/react-geosuggest/commit/ed69df6c090772861e17dcafddd31bb1157b2611)) 282 | 283 | 284 | ## 2.0.1 285 | 286 | #### Bug Fixes 287 | 288 | * **refactor:** changed to use reacts internal shallowCompare 289 | 290 | ## 2.0.0 (2016-10-07) 291 | 292 | 293 | #### Bug Fixes 294 | 295 | * **suggest-item:** bem naming ([1ab465aa](https://github.com/ubilabs/react-geosuggest/commit/1ab465aa1ea2999f01960ee0ef99d1de5621ef83)) 296 | 297 | 298 | #### Features 299 | 300 | * **Geosuggest:** render label if id and label text where supplied ([e2cbfc86](https://github.com/ubilabs/react-geosuggest/commit/e2cbfc862b1706be215c4d29acaa26d988806f89)) 301 | * **prop-types:** add label prop types ([0345d63b](https://github.com/ubilabs/react-geosuggest/commit/0345d63b40e157c3d5c09ad0cf7c7046ffa3095c)) 302 | 303 | 304 | ### 1.25.1 (2016-09-23) 305 | 306 | 307 | #### Bug Fixes 308 | 309 | * **package:** Specify addon as peer dependency ([7be701c1](https://github.com/ubilabs/react-geosuggest/commit/7be701c10d3c7d1cab774f157935784ecbd02312)) 310 | 311 | 312 | #### Breaking Changes 313 | 314 | * react-addons-shallow-compare is now a peer dependency, 315 | meaning users must install it separately from react-geosuggest. 316 | 317 | The peer dependency for react allows one to use either react 0.14 or 318 | 0.15. However, the dependency for react-addons-shallow-compare only 319 | allows 0.15 versions. For anyone using react 0.14 this causes warnings 320 | from npm saying that the peer dependency for react 0.15 (specified by 321 | react-addons-shallow-compare) is missing. This completely breaks 322 | workflows depending on `npm shrinkwrap`. 323 | 324 | ([7be701c1](https://github.com/ubilabs/react-geosuggest/commit/7be701c10d3c7d1cab774f157935784ecbd02312)) 325 | 326 | 327 | ## 1.25.0 (2016-08-19) 328 | 329 | 330 | #### Bug Fixes 331 | 332 | * **Geosuggest:** allow enter key events to propagate if suggestions are hidden ([f993c6bc](https://github.com/ubilabs/react-geosuggest/commit/f993c6bc94cd49b6b3904d6129bc7d6a68288e21), closes [#184](https://github.com/ubilabs/react-geosuggest/issues/184)) 333 | 334 | 335 | #### Features 336 | 337 | * **Geosuggest:** pass on mouse and clipboard events ([7dc64566](https://github.com/ubilabs/react-geosuggest/commit/7dc64566f9149b720ee8f7809cf1d83bfef6bccf), closes [#182](https://github.com/ubilabs/react-geosuggest/issues/182)) 338 | * **Geosuggest:** Add a loading class on suggest loading ([685812b7](https://github.com/ubilabs/react-geosuggest/commit/685812b72caa9b6ce8bbcf74590d78099a366715) 339 | 340 | 341 | ### 1.24.1 (2016-06-21) 342 | 343 | 344 | #### Bug Fixes 345 | 346 | * **Geosuggest:** fix server side rendering ([428dedd8](https://github.com/ubilabs/react-geosuggest/commit/428dedd81687a613085db52e35cae14bf2dd19f4), closes [#172](https://github.com/ubilabs/react-geosuggest/issues/172)) 347 | 348 | 349 | ## 1.24.0 (2016-06-21) 350 | 351 | 352 | #### Bug Fixes 353 | 354 | * **Geosuggest:** 355 | * fix `autoActivateFirstSuggest` prop ([f4409f7e](https://github.com/ubilabs/react-geosuggest/commit/f4409f7ef9b02a097b1ec5679218d5d6f97e2d30)) 356 | * Unset activeSuggest on blur and when not in suggestion list anymore ([08ea143e](https://github.com/ubilabs/react-geosuggest/commit/08ea143e736cea91631f47468c8ff7702127128a)) 357 | * Hide the suggest list when the result set is empty ([6f23dc0e](https://github.com/ubilabs/react-geosuggest/commit/6f23dc0ec6f39124e488b51a690938a730d6cd28)) 358 | * GeoCode fixtures if no location is provided ([67ec4e5b](https://github.com/ubilabs/react-geosuggest/commit/67ec4e5b9676caa6fd623bb4add62b8a564202fd)) 359 | * Set autoComplete='off' and remove autoComplete option ([33763dd9](https://github.com/ubilabs/react-geosuggest/commit/33763dd90d24797b7435d331b0c937f7eb59a896), closes [#136](https://github.com/ubilabs/react-geosuggest/issues/136)) 360 | * initialise Google Maps in componentWillMount instead of componentDidMount ([2f326427](https://github.com/ubilabs/react-geosuggest/commit/2f3264279a1aca5164ced0bb4f5c40e46c608a2c), closes [#130](https://github.com/ubilabs/react-geosuggest/issues/130)) 361 | * **example:** add Google Maps API key ([9c3c6d25](https://github.com/ubilabs/react-geosuggest/commit/9c3c6d2596bdafbe633c9b33f125ac4a313c9534), closes [#107](https://github.com/ubilabs/react-geosuggest/issues/107)) 362 | * **package:** 363 | * add test cases and src/*.js to linter ([61e3d08b](https://github.com/ubilabs/react-geosuggest/commit/61e3d08b756ad784edc9190787d9cd0ff9aaa77e)) 364 | * add src/*.js to light-server watch list ([68432ec1](https://github.com/ubilabs/react-geosuggest/commit/68432ec1af65872f211169a89c042f8130ecfc76)) 365 | 366 | 367 | #### Features 368 | 369 | * **on-blur:** return current user input ([e88eda42](https://github.com/ubilabs/react-geosuggest/commit/e88eda424e57280bac8609b88cf9a30e77fc893a)) 370 | * add support for inline styles ([935fc71c](https://github.com/ubilabs/react-geosuggest/commit/935fc71c35db0cf27943acd34fceafc9dfee8e7a)) 371 | * Input obeys ignoreTab ([5987f05b](https://github.com/ubilabs/react-geosuggest/commit/5987f05b037c0c202bbe9f36e79aff40b082af87)) 372 | * add `queryDelay` parameter ([9daff3ac](https://github.com/ubilabs/react-geosuggest/commit/9daff3ac979ad87febd02c255316ef4fcb6e4d6d)) 373 | * add onSuggestNoResults callback function ([f51cacc0](https://github.com/ubilabs/react-geosuggest/commit/f51cacc04e0b5119f195c783779c9031df72a850)) 374 | 375 | 376 | ## 1.23.0 (2016-05-19) 377 | 378 | 379 | #### Bug Fixes 380 | 381 | * Bug fix for IE 10, 'this' is not defined in the constructor function. We need to access the props directly from the argument. ([2dca2727](https://github.com/ubilabs/react-geosuggest/commit/2dca2727b4c4aee585ce419af2954c49d4208606)) 382 | 383 | #### Features 384 | 385 | * **Geosuggest:** add onActivateSuggest event ([ab2fc049](https://github.com/ubilabs/react-geosuggest/commit/ab2fc049624076fb2d0ab517ebae705a82a987dc)) 386 | 387 | 388 | 389 | ## 1.22.0 (2016-04-26) 390 | 391 | 392 | #### Features 393 | 394 | * **Geosuggest:** 395 | * hardcode maxFixtures to 10 ([c2c3ef0f](https://github.com/ubilabs/react-geosuggest/commit/c2c3ef0f4a56b76720b90971c7b554b175ed0917)) 396 | 397 | 398 | ## 1.21.0 (2016-04-15) 399 | 400 | #### Features 401 | 402 | * Update to React 15 ([ f604019](https://github.com/ubilabs/react-geosuggest/commit/f60401938166d1eaaf7a80c2e83992fe22d35e2b)) 403 | 404 | ### 1.20.1 (2016-04-06) 405 | 406 | 407 | #### Bug Fixes 408 | 409 | * always add wrappers to input and suggests ([91d1f4fb](https://github.com/ubilabs/react-geosuggest/commit/91d1f4fbc480d1043213d62eb8399e3da4789c92)) 410 | 411 | 412 | ## 1.20.0 (2016-04-06) 413 | 414 | 415 | #### Bug Fixes 416 | 417 | * **example:** switch to ES6 imports thanks to Babel bug ([b5a066b8](https://github.com/ubilabs/react-geosuggest/commit/b5a066b81c28cb991a9bee95183af4d23cff4beb), closes [#112](https://github.com/ubilabs/react-geosuggest/issues/112)) 418 | 419 | #### Features 420 | 421 | * Add wrapper options and add them to example and README ([ 4b9f9c7](https://github.com/ubilabs/react-geosuggest/commit/4b9f9c7b5939020d09a9603198a6111333f94fbd)) 422 | 423 | 424 | ## 1.19.0 (2016-03-11) 425 | 426 | 427 | #### Bug Fixes 428 | 429 | * remove isMounted antipattern ([b347e9a3](https://github.com/ubilabs/react-geosuggest/commit/b347e9a3eb935e89ca30797ba253cd299b2a1e57), closes [#71](https://github.com/ubilabs/react-geosuggest/issues/71)) 430 | * Add className option for fixtures ([880fe77](https://github.com/ubilabs/react-geosuggest/commit/880fe7758810a0e259c2442698cdf07309829b41)) 431 | 432 | 433 | #### Features 434 | 435 | * add props validation ([7d68a02f](https://github.com/ubilabs/react-geosuggest/commit/7d68a02f8bbdea86fdc91b87a084e5ee25d98ca4), closes [#33](https://github.com/ubilabs/react-geosuggest/issues/33)) 436 | 437 | 438 | ### 1.18.1 (2016-02-11) 439 | 440 | 441 | #### Bug Fixes 442 | 443 | * **input:** use corrected list of allowed input attributes ([d623c65c](https://github.com/ubilabs/react-geosuggest/commit/d623c65c6eb26ff84d5675e573a4991a93c4c74f)) 444 | * make classnames a real dependency ([1fd93dd](https://github.com/ubilabs/react-geosuggest/commit/1fd93dd842820f87133ae4db48ba24fc064270fd)) 445 | 446 | 447 | ## 1.18.0 (2016-02-10) 448 | 449 | 450 | #### Features 451 | 452 | * deploy dist folder via npm ([e5446a29](https://github.com/ubilabs/react-geosuggest/commit/e5446a298b2d9e0479a65786b908647b46d8bc9b)) 453 | 454 | 455 | ## 1.17.0 (2016-02-10) 456 | 457 | #### Bug Fixes 458 | 459 | * Handle null value for Google suggestions ([cfd84ad](cfd84adeebda41d2b7e27576716fb3a30f63182c)) 460 | 461 | #### Features 462 | 463 | * add focus() to focus on the element ([11c08af5](https://github.com/ubilabs/react-geosuggest/commit/11c08af5808d197254cbdfe3a78f99eafe0840b2)) 464 | 465 | 466 | ### 1.16.1 (2016-02-07) 467 | 468 | #### Bug Fixes 469 | 470 | * Fix module build ([7de677c](7de677c51dcd87b67e371303ae3ee1f2242fa599)) 471 | 472 | ## 1.16.0 (2016-02-05) 473 | 474 | #### Bug Fixes 475 | 476 | * autofocus -> autoFocus ([7f9daa0](7f9daa0b4d1813704448037322787e4004309e49)) 477 | * use ignoreBlur flag to avoid hiding suggests when clicking one ([4fa6bd2](4fa6bd2d5e381bfb55a53db86afbd9519c333958)) 478 | * Escape user input for regex to avoid Exception ([95b01ba](95b01ba1dae31d6780c4ed5fd72b9cfb4b3e10c2)) 479 | 480 | #### Features 481 | 482 | * Use labelId instead of address to get the geocode ([f95d2a3](f95d2a337021b3ce49ef6094f53c388de9aa20d9)) 483 | 484 | ### 1.15.1 (2016-01-18) 485 | 486 | 487 | #### Bug Fixes 488 | 489 | * add missing attribute id ([91f5ceea](https://github.com/ubilabs/react-geosuggest/commit/91f5ceea64c940a3cf26f0b913dfbcf784dfa40f)) 490 | 491 | 492 | ## 1.15.0 (2016-01-18) 493 | 494 | 495 | #### Features 496 | 497 | * allow all standard input type attributes ([a43c388c](https://github.com/ubilabs/react-geosuggest/commit/a43c388cd168a60c90ec0b5d971d9f65316b8275), closes [#80](https://github.com/ubilabs/react-geosuggest/issues/80)) 498 | 499 | 500 | ## 1.14.0 (2016-01-04) 501 | 502 | 503 | #### Bug Fixes 504 | 505 | * check whether component is still mounted after timeout ([67972d08](https://github.com/ubilabs/react-geosuggest/commit/67972d08ee24e77605ead13d23025854683454ef), closes [#71](https://github.com/ubilabs/react-geosuggest/issues/71)) 506 | * "use strict"; no longer throws errors if google cannot be loaded ([d8c97c0](https://github.com/ubilabs/react-geosuggest/commit/d8c97c0e1d023a31c4545fff24ff0a1e7b18c2b6)) 507 | 508 | #### Features 509 | 510 | * Add property for input class name. ([c43b91a](https://github.com/ubilabs/react-geosuggest/commit/c43b91aa597d7d9685be994a431e54529464cabe)) 511 | 512 | ## 1.13.0 (2015-10-29) 513 | 514 | #### Features 515 | 516 | * Remove defaults for search radius and location ([17f0bf0](https://github.com/ubilabs/react-geosuggest/commit/17f0bf053bde609c5f891ba4bb048d1cacc3f0b9)) 517 | 518 | ## 1.12.0 (2015-10-22) 519 | 520 | 521 | #### Bug Fixes 522 | 523 | * doc comments, backward compatible changes ([96cca392](https://github.com/ubilabs/react-geosuggest/commit/96cca392f5b569247523cf784d34f1e1eb8b89d8)) 524 | * add copy css in build module ([bb988a1c](https://github.com/ubilabs/react-geosuggest/commit/bb988a1c5bf3079b170cd24c79bbd21093f49f93)) 525 | * googleMaps object moved out of props and set in componentDidMount ([955812df](https://github.com/ubilabs/react-geosuggest/commit/955812dfb702e8ea6318d89b2ef36d866c5c4354)) 526 | 527 | 528 | ### 1.11.1 (2015-10-12) 529 | 530 | 531 | #### Bug Fixes 532 | 533 | * upgrade code to 0.14, too ([c5f64d47](https://github.com/ubilabs/react-geosuggest/commit/c5f64d47befef21c620bee1db41e86ffc1592194)) 534 | 535 | 536 | ## 1.11.0 (2015-10-12) 537 | 538 | 539 | #### Features 540 | 541 | * bump peer dependency react to 0.14.0 ([dc39828e](https://github.com/ubilabs/react-geosuggest/commit/dc39828ea46552c60ce0a5ae33a52f6eee8c8f10)) 542 | * **input:** auto activate first suggest ([d1429b86](https://github.com/ubilabs/react-geosuggest/commit/d1429b8698c8928d69135fbe948f20f7e9246956)) 543 | 544 | 545 | ## 1.10.0 (2015-09-29) 546 | 547 | 548 | #### Bug Fixes 549 | 550 | * prevent form submit on enter press ([dda86a12](https://github.com/ubilabs/react-geosuggest/commit/dda86a124a68ccf03220afb5f1796e99f183713e), closes [#49](https://github.com/ubilabs/react-geosuggest/issues/49)) 551 | 552 | #### Features 553 | 554 | * add skipSuggest to not show certain suggestions ([6da568d5](https://github.com/ubilabs/react-geosuggest/commit/6da568d5c0736fad7aacf21c864e8278544a544b) 555 | * add getSuggestLabel to define a custom label ([5103598](https://github.com/ubilabs/react-geosuggest/commit/51035989077a0eced308ac01f7e87a646893f767) 556 | * **input:** add disabled prop to disable ([7100d43e](https://github.com/ubilabs/react-geosuggest/commit/7100d43e2e3750e2506c78de32985974b915bb8f) 557 | 558 | ### 1.9.1 (2015-09-25) 559 | 560 | #### Bug Fixes 561 | 562 | * Fix issue if the initialValue changes ([b739b5c9](https://github.com/ubilabs/react-geosuggest/commit/b739b5c9b755f0efc05e28b01eb6b595b3d3cb9d)) 563 | * Build fixes so dist/ works with a global window.React ([9b5e4369](https://github.com/ubilabs/react-geosuggest/commit/9b5e4369f7057e95ae5a36611cf5b7932dae50de)) 564 | 565 | ## 1.9.0 (2015-09-09) 566 | 567 | #### Features 568 | 569 | * **input:** add onChange callbacks ([e6555ad](https://github.com/ubilabs/react-geosuggest/commit/e6555addbe3893b129488dc0623b7198036da35d) 570 | 571 | ## 1.8.0 (2015-09-01) 572 | 573 | #### Features 574 | 575 | * **input:** add method to change the value of the user input ([44d86f5](https://github.com/ubilabs/react-geosuggest/commit/44d86f5842765b72cb3db073feb016f750898e1f) 576 | 577 | 578 | ## 1.7.0 (2015-08-19) 579 | 580 | #### Features 581 | 582 | * **suggests:** add individual fixture classNames ([01b0e8a](https://github.com/ubilabs/react-geosuggest/commit/01b0e8a7a3e555729aeb56292a22bd8a412e4cf9) 583 | 584 | 585 | ## 1.6.0 (2015-08-12) 586 | 587 | 588 | #### Features 589 | 590 | * **input:** add bounds, country and types params ([00a84866](https://github.com/ubilabs/react-geosuggest/commit/00a84866d109ce4e323705558ffe319d56ecd5b1), closes [#20](https://github.com/ubilabs/react-geosuggest/issues/20)) 591 | 592 | 593 | ## 1.5.0 (2015-08-12) 594 | 595 | 596 | #### Features 597 | 598 | * **input:** 599 | * add clear method to geosuggest ([2d38a40](https://github.com/ubilabs/react-geosuggest/commit/2d38a4072b11c900d73b5cc26615a3cc69f286b4) 600 | * add onFocus and onBlur callbacks ([5051bc4](https://github.com/ubilabs/react-geosuggest/commit/5051bc424a4f508fa8dcff6683c690cc1ab9c2dd) 601 | 602 | * **example:** add onFocus and onBlur demo ([88cf7f88](https://github.com/ubilabs/react-geosuggest/commit/88cf7f8873119f667aa514b8065e116d7a3741b2)) 603 | 604 | 605 | ### 1.4.3 (2015-07-29) 606 | 607 | 608 | #### Bug Fixes 609 | 610 | * **example:** remove drop_console option from uglify ([e8e16112](https://github.com/ubilabs/react-geosuggest/commit/e8e16112d2d0f47f7ddc005dd485a25f7d55e4e7)) 611 | 612 | 613 | ### 1.4.2 (2015-07-29) 614 | 615 | 616 | #### Bug Fixes 617 | 618 | * **build:** fix build for npm ([6475372](https://github.com/ubilabs/react-geosuggest/commit/6475372a468f19f075a20af012f8f85404172893)) 619 | 620 | 621 | 622 | ### 1.4.1 (2015-07-21) 623 | 624 | 625 | #### Bug Fixes 626 | 627 | * **import:** add .npmignore ([add06073](https://github.com/ubilabs/react-geosuggest/commit/add06073990bb4c8934b8ad28c6c1bfb201f6945)) 628 | 629 | 630 | ## 1.4.0 (2015-07-20) 631 | 632 | 633 | #### Bug Fixes 634 | 635 | * **input:** allow continuous editing ([62e83cce](https://github.com/ubilabs/react-geosuggest/commit/62e83cce9ac42e23916914691fb83b829d778d7e), closes [#12](https://github.com/ubilabs/react-geosuggest/issues/12)) 636 | 637 | 638 | #### Features 639 | 640 | * **input:** 641 | * add new param className ([c1c990ec](https://github.com/ubilabs/react-geosuggest/commit/c1c990ec80e5210322d7d68b805d44a73196ca4e), closes [#8](https://github.com/ubilabs/react-geosuggest/issues/8)) 642 | * add initial value param ([f97d8eba](https://github.com/ubilabs/react-geosuggest/commit/f97d8eba377ed789c1bbc21cfc4de94e85ef2760), closes [#13](https://github.com/ubilabs/react-geosuggest/issues/13)) 643 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | First off, thanks for contributing to this project :tada: :thumbsup: 4 | Our communications here on GitHub follow certain guidelines. Please observe the points below. 5 | 6 | ## Issue Tracker 7 | 8 | - before submitting a new issue, please: 9 | 10 | - check for existing related issues 11 | 12 | - check the issue tracker for a specific upstream project that may be more appropriate 13 | 14 | - check against supported versions of this project (i.e. the latest) 15 | 16 | - please keep discussions on-topic, and respect the opinions of others 17 | 18 | - please contact us privately to discuss security vulnerabilities 19 | 20 | 21 | ## Pull Requests / Merge Requests 22 | 23 | - **IMPORTANT**: by submitting a patch, you agree to allow the project owners to license your work under this [LICENSE.md](LICENSE.md) 24 | 25 | - please provide test cases for all features and bug fixes 26 | 27 | - provide documentation for all public API methods 28 | 29 | - commit messages should follow the format outlined in [CONVENTIONS.md](CONVENTIONS.md) 30 | 31 | ### Code Style and Code Quality 32 | 33 | - JavaScript 34 | 35 | - [ESLint](https://eslint.org/) configuration files are provided 36 | 37 | - run `npm run lint` to check code style 38 | 39 | - CSS 40 | 41 | - CSS code follows [BEM](http://getbem.com/naming/) style 42 | 43 | - run `npm run test` before submitting a PR to ensure that your code uses correct style and passes all tests 44 | 45 | ### Development 46 | 47 | To build the examples locally, run: 48 | 49 | ``` 50 | npm install 51 | npm start 52 | ``` 53 | 54 | Then open [`localhost:8000`](http://localhost:8000) in a browser. 55 | 56 | ### Deployment 57 | 58 | To release & deploy, run the following: 59 | 60 | ``` 61 | npm run release:patch|minor|major 62 | ``` 63 | -------------------------------------------------------------------------------- /CONVENTIONS.md: -------------------------------------------------------------------------------- 1 | ## Git Commit Guidelines 2 | 3 | These rules are adopted from [the AngularJS commit conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/). 4 | 5 | ### Commit Message Format 6 | 7 | Each commit message starts with a **type**, a **scope**, and a **subject**. 8 | 9 | Below that, the commit message has a **body**. 10 | 11 | - **type**: what type of change this commit contains. 12 | - **scope**: what item of code this commit is changing. 13 | - **subject**: a short description of the changes. 14 | - **body** (optional): a more in-depth description of the changes 15 | 16 | ``` 17 | (): 18 | 19 | 20 | ``` 21 | 22 | Examples: 23 | ``` 24 | feat(ruler): add inches as well as centimeters 25 | ``` 26 | ``` 27 | fix(protractor): fix 90 degrees counting as 91 degrees 28 | ``` 29 | ``` 30 | refactor(pencil): use graphite instead of lead 31 | 32 | Closes #640. 33 | 34 | Graphite is a much more available resource than lead, so we use it to lower the price. 35 | ``` 36 | ``` 37 | fix(pen): use blue ink instead of red ink 38 | 39 | BREAKING CHANGE: Pen now uses blue ink instead of red. 40 | 41 | To migrate, change your code from the following: 42 | 43 | `pen.draw('blue')` 44 | 45 | To: 46 | 47 | `pen.draw('red')` 48 | ``` 49 | 50 | Any line of the commit message should not be longer 100 characters. This allows the message to be easier 51 | to read on github as well as in various git tools. 52 | 53 | ### Type 54 | Is recommended to be one of the below items. Only **feat** and **fix** show up in the changelog, in addition to breaking changes (see breaking changes section at bottom). 55 | 56 | * **feat**: A new feature 57 | * **fix**: A bug fix 58 | * **docs**: Documentation only changes 59 | * **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing 60 | semi-colons, etc) 61 | * **refactor**: A code change that neither fixes a bug or adds a feature 62 | * **test**: Adding missing tests 63 | * **chore**: Changes to the build process or auxiliary tools and libraries such as documentation 64 | generation 65 | 66 | ### Scope 67 | The scope could be anything specifying place of the commit change. For example `$location`, 68 | `$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc... 69 | 70 | ### Subject 71 | The subject contains succinct description of the change: 72 | 73 | * use the imperative, present tense: "change" not "changed" nor "changes" 74 | * don't capitalize first letter 75 | * no dot (.) at the end 76 | 77 | ### Breaking Changes 78 | Put any breaking changes with migration instructions in the commit body. 79 | 80 | If there is a breaking change, put **BREAKING CHANGE:** in your commit body, and it will show up in the changelog. 81 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015 - 2016 Ubilabs 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Geosuggest 2 | 3 | A [React](https://reactjs.org/) autosuggest for the Google Maps Places API. You can also define your own suggests as defaults. Works with [Preact](https://github.com/developit/preact), too. 4 | 5 | ## Demo 6 | 7 | Live demo: [ubilabs.github.io/react-geosuggest](https://ubilabs.github.io/react-geosuggest/) 8 | 9 | ## Installation 10 | 11 | As this component uses the Google Maps Places API to get suggests, you must include the Google Maps Places API in the `` of your HTML: 12 | 13 | ```html 14 | 15 | 16 | 17 | … 18 | 19 | 20 | 21 | … 22 | 23 | 24 | ``` 25 | 26 | You can use [@ubilabs/react-google-maps](https://github.com/visgl/react-google-maps) to initialize the Google Maps API and load the require Google Maps libraries. 27 | 28 | Visit the [Google Developer Console](https://console.developers.google.com) to generate your API key. The API's that you have to enable in your Google API Manager Dashboard are [Google Maps Geocoding API](https://developers.google.com/maps/documentation/geocoding/start), [Google Places API Web Service](https://developers.google.com/places/web-service/) and [Google Maps Javascript API](https://developers.google.com/maps/documentation/javascript/). 29 | 30 | The easiest way to use geosuggest is to install it from NPM and include it in your own React build process (using [Webpack](https://webpack.github.io/), [Parcel](https://parceljs.org/), etc). 31 | 32 | You can also use the standalone build by including `dist/react-geosuggest.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable. 33 | 34 | ```sh 35 | npm install @ubilabs/react-geosuggest --save 36 | ``` 37 | 38 | ## Usage 39 | 40 | The Geosuggest works out of the box by just including it. However, you can customize the behaviour with the properties noted below. 41 | 42 | ### ES6: 43 | 44 | ```js 45 | import Geosuggest from '@ubilabs/react-geosuggest'; 46 | 47 | ; 48 | ``` 49 | 50 | ### ES5: 51 | 52 | ```js 53 | var Geosuggest = require('@ubilabs/react-geosuggest').default; 54 | 55 | ; 56 | ``` 57 | 58 | ### Properties 59 | 60 | #### placeholder 61 | 62 | Type: `String` 63 | Default: `Search places` 64 | 65 | The input field will get this placeholder text. 66 | 67 | #### initialValue 68 | 69 | Type: `String` 70 | Default: `''` 71 | 72 | An initial value for the input, when you want to prefill the suggest. 73 | 74 | #### id 75 | 76 | Type: `String` 77 | Default: `''` 78 | 79 | Define an ID for the geosuggest. Needed when there are multiple instances on a page. 80 | 81 | #### className 82 | 83 | Type: `String` 84 | Default: `''` 85 | 86 | Add an additional class to the geosuggest container. 87 | 88 | #### style 89 | 90 | Type: `Object` 91 | Default: `{ 92 | 'input': {}, 93 | 'suggests': {}, 94 | 'suggestItem': {} 95 | }` 96 | 97 | Add an additional style to `Geosuggest`. 98 | This would support overriding/adding styles to the input suggestList and suggestItem. 99 | 100 | #### inputClassName 101 | 102 | Type: `String` 103 | Default: `''` 104 | 105 | Add an additional class to the input. 106 | 107 | #### disabled 108 | 109 | Type: `Boolean` 110 | Default: `false` 111 | 112 | Defines whether the input is disabled. 113 | 114 | #### location 115 | 116 | Type: [`google.maps.LatLng`](https://developers.google.com/maps/documentation/javascript/reference#LatLng) 117 | Default: `null` 118 | 119 | To get localized suggestions, define a location to bias the suggests. 120 | 121 | #### radius 122 | 123 | Type: `Number` 124 | Default: `0` 125 | 126 | The radius in meters defines the area around the location to use for biasing the suggests. It must be accompanied by a `location` parameter. 127 | 128 | #### bounds 129 | 130 | Type: [`LatLngBounds`](https://developers.google.com/maps/documentation/javascript/reference?csw=1#LatLngBounds) 131 | Default: `null` 132 | 133 | The bounds to use for biasing the suggests. If this is set, `location` and `radius` are ignored. 134 | 135 | #### country 136 | 137 | Type: `String` or `Array` 138 | Default: `null` 139 | 140 | Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). E.g., us, br, au. You can provide a single one, or an array of up to 5 country code strings. 141 | 142 | #### types 143 | 144 | Type: `Array` 145 | Default: `null` 146 | 147 | The types of predictions to be returned. Four types are supported: `establishment` for businesses, `geocode` for addresses, `(regions)` for administrative regions and `(cities)` for localities. If nothing is specified, all types are returned. Consult the Google Docs for [up to date types](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest.types). 148 | 149 | #### fixtures 150 | 151 | Type: `Array` 152 | Default: `[]` 153 | 154 | An array with fixtures (defaults). Each fixture has to be an object with a `label` key in it. Optionally provide a `location`, but the Geosuggest will geocode the label if no location is provided. 155 | 156 | You can also add a `className` key to a fixture. This class will be applied to the fixture item. 157 | 158 | #### maxFixtures 159 | 160 | Type: `Number` 161 | Default: `10` 162 | 163 | Maximum number of fixtures to render. 164 | 165 | #### placeDetailFields 166 | 167 | Type: `Array` 168 | Default: `null` 169 | 170 | By default Google returns all fields when getting place details which can [impact billing](https://developers.google.com/maps/billing/understanding-cost-of-use#data-skus). You can optionally pass an [array of fields to include in place results](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceDetailsRequest.fields) to limit what is returned and potentially reduce billing impact. `geometry` will always be added as we depend on the location for the suggest selection. 171 | 172 | #### googleMaps 173 | 174 | Type: `Object` 175 | Default: `google.maps` 176 | 177 | In case you want to provide your own Google Maps object, pass it in as googleMaps. The default is the global google maps object. 178 | 179 | #### ignoreTab 180 | 181 | Type: `Boolean` 182 | Default: `false` 183 | 184 | When the tab key is pressed, the `onSelect` handler is invoked. Set to true to not invoke `onSelect` on tab press. 185 | 186 | #### ignoreEnter 187 | 188 | Type: `Boolean` 189 | Default: `false` 190 | 191 | When the enter key is pressed, the `onSelect` handler is invoked. Set to true to not invoke `onSelect` on enter press. 192 | 193 | #### queryDelay 194 | 195 | Type: `Number` 196 | Default: `250` 197 | 198 | Sets the delay in milliseconds after typing before a request will be sent to find suggestions. 199 | Specify `0` if you wish to fetch suggestions after every keystroke. 200 | 201 | #### minLength 202 | 203 | Type: `Number` 204 | Default: `1` 205 | 206 | Sets a minimum length of characters before a request will be sent to find suggestions. 207 | 208 | #### highlightMatch 209 | 210 | Type: `Boolean` 211 | Default: `true` 212 | 213 | Highlights matched text. 214 | 215 | #### onFocus 216 | 217 | Type: `Function` 218 | Default: `function() {}` 219 | 220 | Gets triggered when the input field receives focus. 221 | 222 | #### onBlur 223 | 224 | Type: `Function` 225 | Default: `function(value) {}` 226 | 227 | Gets triggered when input field loses focus. 228 | 229 | #### onChange 230 | 231 | Type: `Function` 232 | Default: `function(value) {}` 233 | 234 | Gets triggered when input field changes the value. 235 | 236 | #### onKeyDown 237 | 238 | Type: `Function` 239 | Default: `function(event) {}` 240 | 241 | Gets triggered when input field has a key pressed down. This event is triggered before onKeyPress. 242 | 243 | #### onKeyPress 244 | 245 | Type: `Function` 246 | Default: `function(event) {}` 247 | 248 | Gets triggered when input field gets key press. 249 | 250 | #### onSuggestSelect 251 | 252 | Type: `Function` 253 | Default: `function(suggest) {}` 254 | 255 | Gets triggered when a suggest got selected. Only parameter is an object with data of the selected suggest. This data is available: 256 | 257 | - `label` – Type `String` – The label name 258 | - `placeId` – Type `String` – If it is a preset, equals the `label`. Else it is the Google Maps `placeID` 259 | - `location` – Type `Object` – The location containing `lat` and `lng` 260 | - `gmaps` – Type `Object` – *Optional!* The complete response when there was a Google Maps geocode necessary (e.g. no location provided for presets). [Check the Google Maps Reference](https://developers.google.com/maps/documentation/javascript/reference#GeocoderResult) for more information on it’s structure. 261 | 262 | #### onUpdateSuggests 263 | 264 | Type: `Function` 265 | Default: `function(suggests, activeSuggest) {}` 266 | 267 | Gets triggered when the suggest list changes. Arguments include the suggest list and the current activeSuggest. Useful if you want to render the list of suggests outside of @ubilabs/react-geosuggest. 268 | 269 | #### onActivateSuggest 270 | 271 | Type: `Function` 272 | Default: `function(suggest) {}` 273 | 274 | Gets triggered when a suggest is activated in the list. Only parameter is an object with data of the selected suggest. This data is available: 275 | 276 | - `label` – Type `String` – The label name 277 | - `placeId` – Type `String` – If it is a preset, equals the `label`. Else it is the Google Maps `placeID` 278 | 279 | #### onSuggestNoResults 280 | 281 | Type: `Function` 282 | Default: `function(userInput) {}` 283 | 284 | Gets triggered when there are no suggest results found 285 | 286 | #### getSuggestLabel 287 | 288 | Type: `Function` 289 | Default: `function(suggest) { return suggest.description; }` 290 | 291 | Used to generate a custom label for a suggest. Only parameter is a suggest (google.maps.places.AutocompletePrediction). [Check the Google Maps Reference](https://developers.google.com/maps/documentation/javascript/reference#GeocoderResult) for more information on it’s structure. 292 | 293 | #### renderSuggestItem 294 | 295 | Type: `Function` 296 | Default: `null` 297 | 298 | Used to customize the inner html of SuggestItem and allows for controlling what properties of the suggest object you want to render. Also a convenient way to add additional styling to different rendered elements within SuggestItem. The function is passed both the suggestion and the user input. 299 | 300 | #### skipSuggest 301 | 302 | Type: `Function` 303 | Default: `function(suggest) {}` 304 | 305 | If the function returns true then the suggest will not be included in the displayed results. Only parameter is an object with data of the selected suggest. (See above) 306 | 307 | #### autoActivateFirstSuggest 308 | 309 | Type: `Boolean` 310 | Default: `false` 311 | 312 | Automatically activate the first suggestion as you type. If false, the exact term(s) in the input will be used when searching and may return a result not in the list of suggestions. 313 | 314 | #### label 315 | 316 | Type: `String` 317 | Default: `null` 318 | 319 | If the `label` and a `id` prop (see "Others") were supplied, a `