@scbt-ecom/ui 0.7.22 → 0.7.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,14 @@
1
+ import { FieldValues } from 'react-hook-form';
2
+ import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TInputCommonProps } from '../model';
3
+ import { TDadataType } from './model/types';
4
+ type TDadataClasses = Partial<TAdditionalInputClassesWithAttachment> & {
5
+ options?: string;
6
+ indentMargin?: string;
7
+ };
8
+ export interface IAutocompleteDadataProps<T extends FieldValues> extends TControlledInputProps<T>, TInputCommonProps {
9
+ classes?: TDadataClasses;
10
+ dadataType: TDadataType;
11
+ dadataBaseUrl: string;
12
+ }
13
+ export declare const AutocompleteDadata: <T extends FieldValues>({ control, helperText, classes, size, label, disabled, dadataType, dadataBaseUrl, badge, icon, swapPosition, onClickIcon, onKeyDownIcon, ...props }: IAutocompleteDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TDadataType } from './types';
2
+ export declare const fetchSuggestions: (searchText: string, dadataType: TDadataType, dadataBaseUrl: string) => Promise<import('./types').IDadataCountryOption[] | import('./types').IDadataAutoOption[] | import('./types').IDadataCacheOption<unknown>[]>;
@@ -0,0 +1,6 @@
1
+ import { IDadataAutoOption, IDadataCacheOption, IDadataCountryOption, TDadataReturn, TDadataSuggestionType, TDadataType } from './types';
2
+ export declare const getDataByDadataType: <T>(dadataType: TDadataType, data: TDadataReturn<T>) => IDadataCountryOption[] | IDadataAutoOption[] | IDadataCacheOption<T>[];
3
+ export declare const getOptionsByDadataType: <T>(dadataType: TDadataType, suggestions: TDadataSuggestionType<T>) => {
4
+ value: string;
5
+ label: string;
6
+ }[];
@@ -0,0 +1,42 @@
1
+ export type TDadataType = 'address' | 'fio' | 'country' | 'auto' | 'party';
2
+ export type TDadataBaseUrl = 'cache' | 'constants';
3
+ export type TDadataOption = {
4
+ value: string;
5
+ additionalText?: string;
6
+ isDisabled?: boolean;
7
+ };
8
+ export interface IDadataCountryOption {
9
+ id: number;
10
+ country_name: string;
11
+ }
12
+ export interface IDadataConstantsCountrySuggestion {
13
+ matches: IDadataCountryOption[];
14
+ }
15
+ export interface IDadataAutoOption {
16
+ id: number;
17
+ mark: string;
18
+ model: string;
19
+ model_mark: string;
20
+ year_max: string;
21
+ year_min: string;
22
+ }
23
+ export interface IDadataConstantsAutoSuggestion {
24
+ matches: IDadataAutoOption[];
25
+ }
26
+ export interface IDadataCacheOption<T> {
27
+ value: string;
28
+ unrestricted_value: string;
29
+ data: T;
30
+ }
31
+ export interface IDadataCacheSuggestion<T> {
32
+ suggestions: IDadataCacheOption<T>[];
33
+ }
34
+ export interface IDadataOrganizationOption {
35
+ value: string;
36
+ unrestricted_value: string;
37
+ data: {
38
+ inn: 'string';
39
+ };
40
+ }
41
+ export type TDadataReturn<T> = IDadataConstantsCountrySuggestion | IDadataCacheSuggestion<T> | IDadataConstantsAutoSuggestion;
42
+ export type TDadataSuggestionType<T> = IDadataCountryOption[] | IDadataCacheOption<T>[] | IDadataAutoOption[];
@@ -0,0 +1,7 @@
1
+ import { TDadataOption, TDadataType } from './types';
2
+ import * as React from 'react';
3
+ export declare const useDadata: (dadataType: TDadataType, dadataBaseUrl: string) => {
4
+ setQuery: React.Dispatch<React.SetStateAction<string>>;
5
+ suggestionsOptions: TDadataOption[] | null;
6
+ debounceQuery: string;
7
+ };
@@ -0,0 +1,6 @@
1
+ import { TDadataOption } from '../model/types';
2
+ interface IComboboxOptionsProps {
3
+ suggestionsOptions: TDadataOption[] | null;
4
+ }
5
+ export declare const ComboboxOptionsCustom: ({ suggestionsOptions }: IComboboxOptionsProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,16 @@
1
+ import { FieldValues } from 'react-hook-form';
2
+ import { TAdditionalInputClassesWithAttachment, TControlledInputProps, TInputCommonProps } from '../model';
3
+ type TDadataClasses = Partial<TAdditionalInputClassesWithAttachment> & {
4
+ options?: string;
5
+ indentMargin?: string;
6
+ };
7
+ export interface IDadataProps<T extends FieldValues> extends TControlledInputProps<T>, TInputCommonProps {
8
+ classes?: TDadataClasses;
9
+ baseUrl: string;
10
+ }
11
+ export declare const DadataFio: <T extends FieldValues>({ control, name, label, baseUrl }: IDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const DadataAddress: <T extends FieldValues>({ control, name, label, baseUrl }: IDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const DadataOrganization: <T extends FieldValues>({ control, name, label, baseUrl }: IDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const DadataCountry: <T extends FieldValues>({ control, name, label, baseUrl }: IDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const DadataAuto: <T extends FieldValues>({ control, name, label, baseUrl }: IDadataProps<T>) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1 @@
1
+ export * from './DadataControl';
@@ -12,3 +12,4 @@ export { InputControlUploader, type IInputControlUploaderProps } from './inputCo
12
12
  export { ComboboxControl, type IComboboxControlProps } from './comboboxControl';
13
13
  export { InputCurrencyControl, type InputCurrencyControlProps } from './inputCurrencyControl';
14
14
  export { EditorControl, type IEditorControlProps } from './editorControl';
15
+ export * from './dadataControl';
@@ -22,4 +22,4 @@ export { Breadcrumbs, type IBreadcrumbsProps } from './Breadcrumbs';
22
22
  export { CustomLink, type ICustomLinkProps } from './CustomLink';
23
23
  export { Document, type IDocumentProps } from './Document';
24
24
  export { type IKeyboardShortcutsProps, KeyboardShortcuts } from './KeyboardShortcuts';
25
- export { InputControl, type InputControlProps, InputControlMask, type InputControlMaskProps, InputSliderControl, type InputSliderControlProps, FormControl, DadataInputControl, type IDadataInputControlProps, CheckboxControl, type ICheckboxControlProps, RadioControl, type IRadioControlProps, type IRadioGroupOption, SwitchControl, type ISwitchControlProps, TextareaControl, type ITextareaControlProps, type IInputControlUploaderProps, InputControlUploader, type ICalendarControlProps, CalendarControl, InputCurrencyControl, type InputCurrencyControlProps, ComboboxControl, type IComboboxControlProps, EditorControl, type IEditorControlProps } from './formControlElements';
25
+ export * from './formControlElements';
@@ -1,6 +1,2 @@
1
1
  import { z } from 'zod';
2
- export declare const zodDadataFioValidate: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, {
3
- surname: string;
4
- name: string;
5
- patronymic: string | undefined;
6
- }, string>;
2
+ export declare const zodDadataFioValidate: z.ZodEffects<z.ZodString, string, string>;