-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Реорганизация внутренней структуры (#175)
* fix(party_kz): fixes typo * refactor(#174): reorganizes folder structure and types
- Loading branch information
1 parent
d1e7686
commit 2304838
Showing
31 changed files
with
501 additions
and
478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { ElementType, HTMLProps, ReactNode } from 'react'; | ||
import type { HttpCache } from './http-cache'; | ||
|
||
export type Nullable<T> = T | null; | ||
|
||
export interface DaDataSuggestion<T> { | ||
value: string; | ||
unrestricted_value: string; | ||
data: T; | ||
} | ||
|
||
/** | ||
* Общие пропсы для всех видов компонента подсказов | ||
*/ | ||
export interface CommonProps<SuggestionType> { | ||
token: string; | ||
value?: DaDataSuggestion<SuggestionType>; | ||
url?: string; | ||
defaultQuery?: string; | ||
autoload?: boolean; | ||
delay?: number; | ||
count?: number; | ||
onChange?: (suggestion?: DaDataSuggestion<SuggestionType>) => void; | ||
inputProps?: HTMLProps<HTMLInputElement>; | ||
hintText?: ReactNode; | ||
renderOption?: (suggestion: DaDataSuggestion<SuggestionType>, inputValue: string) => ReactNode; | ||
renderNoSuggestions?: () => ReactNode; | ||
containerClassName?: string; | ||
suggestionsClassName?: string; | ||
suggestionClassName?: string; | ||
currentSuggestionClassName?: string; | ||
hintClassName?: string; | ||
highlightClassName?: string; | ||
minChars?: number; | ||
customInput?: ElementType; | ||
selectOnBlur?: boolean; | ||
uid?: string; | ||
/** | ||
* Необходимо ли кешировать HTTP-запросы? | ||
* Возможно передать собственный кеш наследующий {@link HttpCache}. | ||
*/ | ||
httpCache?: boolean | HttpCache; | ||
/** | ||
* Время жизни кеша в миллисекундах. | ||
* Игнорируется если был передан собственный {@link HttpCache}. | ||
*/ | ||
httpCacheTtl?: number; | ||
children?: ReactNode | undefined; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,65 @@ | ||
import { AddressSuggestions } from './AddressSuggestions'; | ||
import { BankSuggestions } from './BankSuggestions'; | ||
import { EmailSuggestions } from './EmailSuggestions'; | ||
import { FioSuggestions } from './FioSuggestions'; | ||
import { PartySuggestions } from './PartySuggestions'; | ||
import type { | ||
DaDataAddress, | ||
DaDataAddressBounds, | ||
DaDataBank, | ||
DaDataBankStatus, | ||
DaDataBankType, | ||
DaDataEmail, | ||
DaDataFio, | ||
DaDataGender, | ||
DaDataParty, | ||
DaDataPartyBelarus, | ||
DaDataPartyBelarusStatus, | ||
DaDataPartyBranchType, | ||
/** | ||
* Общие типы | ||
*/ | ||
export type { DaDataSuggestion } from './core-types'; | ||
export { HttpCache } from './http-cache'; | ||
|
||
/** | ||
* Адреса | ||
*/ | ||
export type { DaDataAddress, DaDataAddressBounds, DaDataAddressSuggestion } from './variants/address/address-types'; | ||
export { AddressSuggestions } from './variants/address/address-suggestions'; | ||
|
||
/** | ||
* Организации в России 🇷🇺 | ||
*/ | ||
export type { | ||
DaDataPartyRussia, | ||
DaDataPartyRussiaStatus, | ||
DaDataPartyStatus, | ||
DaDataPartyType, | ||
DaDataSuggestion, | ||
} from './types'; | ||
import { PartyBelarusSuggestions } from './variants/party_belarus/party-belarus'; | ||
import { PartyKazakhstanSuggestions } from './variants/party_kazakhstan/party-kazakhstan'; | ||
import type { | ||
DaDataPartyStatus, | ||
DaDataPartyBranchType, | ||
DaDataPartyRussiaFio, | ||
DaDataPartyRussiaSuggestion, | ||
DaDataPartySuggestion, | ||
} from './variants/party_russia/party-russia-types'; | ||
export { PartySuggestions } from './variants/party_russia/party-russia-suggestions'; | ||
|
||
/** | ||
* Организации в Беларуси 🇧🇾 | ||
*/ | ||
export type { | ||
DaDataPartyBelarus, | ||
DaDataPartyBelarusType, | ||
DaDataPartyBelarusStatus, | ||
DaDataPartyBelarusSuggestion, | ||
} from './variants/party_belarus/party-belarus-types'; | ||
export { PartyBelarusSuggestions } from './variants/party_belarus/party-belarus-suggestions'; | ||
|
||
/** | ||
* Организации в Казахстане 🇰🇿 | ||
*/ | ||
export type { | ||
DaDataPartyKazakhstan, | ||
DaDataPartyKazakhstanStatus, | ||
DaDataPartyKazakhstanSuggestion, | ||
DaDataPartyKazakhstanType, | ||
DaDataPartyKazakhstanStatus, | ||
} from './variants/party_kazakhstan/party-kazakhstan-types'; | ||
export { PartyKazakhstanSuggestions } from './variants/party_kazakhstan/party-kazakhstan-suggestions'; | ||
|
||
type DaDataAddressSuggestion = DaDataSuggestion<DaDataAddress>; | ||
type DaDataPartySuggestion = DaDataSuggestion<DaDataParty>; | ||
type DaDataPartyRussiaSuggestion = DaDataSuggestion<DaDataPartyRussia>; | ||
type DaDataPartyBelarusSuggestion = DaDataSuggestion<DaDataPartyBelarus>; | ||
type DaDataPartyKazakhstanSuggestion = DaDataSuggestion<DaDataPartyKazakhstan>; | ||
type DaDataBankSuggestion = DaDataSuggestion<DaDataBank>; | ||
type DaDataFioSuggestion = DaDataSuggestion<DaDataFio>; | ||
type DaDataEmailSuggestion = DaDataSuggestion<DaDataEmail>; | ||
/** | ||
* Банки | ||
*/ | ||
export type { DaDataBank, DaDataBankStatus, DaDataBankType, DaDataBankSuggestion } from './variants/bank/bank-types'; | ||
export { BankSuggestions } from './variants/bank/bank-suggestions'; | ||
|
||
export { | ||
type DaDataSuggestion, | ||
AddressSuggestions, | ||
PartySuggestions, | ||
PartyBelarusSuggestions, | ||
PartyKazakhstanSuggestions, | ||
BankSuggestions, | ||
FioSuggestions, | ||
EmailSuggestions, | ||
type DaDataAddress, | ||
type DaDataAddressSuggestion, | ||
type DaDataParty, | ||
type DaDataPartySuggestion, | ||
type DaDataPartyRussiaSuggestion, | ||
type DaDataPartyBelarusSuggestion, | ||
type DaDataPartyKazakhstanSuggestion, | ||
type DaDataAddressBounds, | ||
type DaDataPartyType, | ||
type DaDataPartyRussia, | ||
type DaDataPartyRussiaStatus, | ||
type DaDataPartyBranchType, | ||
type DaDataPartyStatus, | ||
type DaDataPartyBelarus, | ||
type DaDataPartyBelarusStatus, | ||
type DaDataPartyKazakhstan, | ||
type DaDataPartyKazakhstanStatus, | ||
type DaDataPartyKazakhstanType, | ||
type DaDataBank, | ||
type DaDataBankStatus, | ||
type DaDataBankType, | ||
type DaDataBankSuggestion, | ||
type DaDataFio, | ||
type DaDataFioSuggestion, | ||
type DaDataGender, | ||
type DaDataEmail, | ||
type DaDataEmailSuggestion, | ||
}; | ||
export { HttpCache } from './http-cache'; | ||
/** | ||
* ФИО | ||
*/ | ||
export type { DaDataFio, DaDataFioSuggestion } from './variants/fio/fio-types'; | ||
export { FioSuggestions } from './variants/fio/fio-suggestions'; | ||
|
||
/** | ||
*/ | ||
export type { DaDataEmail, DaDataEmailSuggestion } from './variants/email/email-types'; | ||
export { EmailSuggestions } from './variants/email/email-suggestions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.