Installations
npm install react-dadata-suggestions
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.19.0
NPM Version
6.13.4
Score
67.5
Supply Chain
91.9
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (66.46%)
CSS (33.54%)
Developer
Download Statistics
Total Downloads
50,245
Last Day
12
Last Week
76
Last Month
278
Last Year
3,101
GitHub Statistics
10 Stars
192 Commits
5 Forks
4 Watching
6 Branches
4 Contributors
Package Meta Information
Latest Version
2.0.0
Package Id
react-dadata-suggestions@2.0.0
Unpacked Size
81.57 kB
Size
28.68 kB
File Count
33
NPM Version
6.13.4
Node Version
10.19.0
Total Downloads
Cumulative downloads
Total Downloads
50,245
Last day
-47.8%
12
Compared to previous day
Last week
-6.2%
76
Compared to previous week
Last month
19.8%
278
Compared to previous month
Last year
-7%
3,101
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Peer Dependencies
1
Dev Dependencies
23
react-dadata-suggestions
React-компонент для подсказок dadata.
С чего начать
Установка
npm i --save react-dadata-suggestions
Использование
1import React, { Component } from 'react'; 2import DadataSuggestions from 'react-dadata-suggestions'; 3import "react-dadata-suggestions/dist/styles.css"; 4 5const token = 'your_token'; 6 7class App extends Component { 8 render() { 9 return ( 10 <DadataSuggestions 11 token={ token } 12 onSelect={ (suggestion) => console.log(suggestion) } 13 /> 14 ); 15 } 16} 17 18export default App; 19
Настройка
Пропсы
prop | type | description | required | default |
---|---|---|---|---|
token | string | ваш api токен | true | '' |
count | integer | максимальное количество подсказок в списке | false | 10 |
deferRequestBy | integer | задержка перед запросом в мс | false | 300 |
placeholder | string | false | '' | |
hint | string | подсказка для пользователя в выпадающем списке | false | Выберите вариант ниже или продолжите ввод |
minChars | integer | минимальная длина запроса для обращения к api | false | 3 |
geolocation | boolean | Приоритет городу пользователя, только для адресов | false | true |
service | string | Доступные значения: address , bank , fio , email , party | false | address |
highlighting | bool | подсветка совпавших слов в подсказках | false | true |
receivePropsBehaveLikeOnChange | bool | см. ниже | false | false |
value | object | экземпляр подсказки | false | null |
name | string | имя инпута | false | null |
readOnly | отметить инпут как readonly | false | ||
disabled | отметить инпут как disabled | false | ||
suggestionsFormatter (suggestion) | function | кастомный форматтер для подсказок в списке | false | |
selectedSuggestionFormatter (suggestion) | function | кастомный форматтер для выбранной подсказки (результат будет установле в качестве строки запроса) | false | |
specialRequestOptions | object | дополнительные параметры для тела запроса | false | |
onSelect (suggestion) | function | обработчик выбора подсказки | true | |
onChange (query) | function | обработчик изменения запроса | false | |
onError (error) | function | обработчик ошибки обращения к api | false | |
onBlur | function | вызывается когда фокус пропадает с элемента | false | |
onFocus | function | вызывается при установке фокуса на элемент | false |
Структуру
подсказки
можно подсмотреть в официальной документации к api dadata
receivePropsBehaveLikeOnChange
- только для версий < 2.0. Изменяет поведениеcomponentWillReceiveProps
. По умолчанию при обновлении пропсов просто сбрасывается стейт, если же значение установлено вtrue
, то поведениеcomponentWillReceiveProps
совпадает с поведениемonChange
. С версии 2.0 это единственный вариант поведения.
Подсветка совпадений
Для кастомизации подсветки переопределите класс .suggestions-highlighting
.
License
This project is licensed under the MIT License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
- Warn: branch protection not enabled for branch 'ISSUE-55-select-with-additional-query'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Reason
52 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr
- Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-h9rv-jmmf-4pgx
- Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94
- Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
1.3
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-dadata-suggestions
react-dadata
React-компонент для подсказок адресов, организаций и банков с помощью сервиса DaData.ru
react-native-dadata-suggestions
React Native DaData suggestions
react-dadata-suggestions-reactoutsideclick
Just another one react component for dadata suggestions
react-dadata-suggestions-fork-onblur-autocomplete
Just another one react component for dadata suggestions