Gathering detailed insights and metrics for react-dadata-suggestions
Gathering detailed insights and metrics for react-dadata-suggestions
Gathering detailed insights and metrics for react-dadata-suggestions
Gathering detailed insights and metrics for 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
npm install react-dadata-suggestions
Typescript
Module System
Node Version
NPM Version
67.5
Supply Chain
91.9
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (66.46%)
CSS (33.54%)
Total Downloads
50,245
Last Day
12
Last Week
76
Last Month
278
Last Year
3,101
10 Stars
192 Commits
5 Forks
4 Watching
6 Branches
4 Contributors
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
Cumulative downloads
Total Downloads
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
1
1
23
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
.
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
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
52 existing vulnerabilities detected
Details
Score
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 More