@scbt-ecom/ui 0.24.1 → 0.26.0

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.
@@ -1,3 +1,4 @@
1
+ export type { TextareaControlProps } from './textarea';
1
2
  export declare const Controlled: {
2
3
  InputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, defaultValue, disabled, rules, shouldUnregister, helperText, classes, size, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('..').InputBaseProps, "classes"> & {
3
4
  control: import('react-hook-form').Control<TFieldValues>;
@@ -50,6 +51,7 @@ export declare const Controlled: {
50
51
  inputValue?: string;
51
52
  attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
52
53
  filterDisabled?: boolean;
54
+ externalHandlers?: import('../uncontrolled/select/Select').ExternalHandlers;
53
55
  } & {
54
56
  control: import('react-hook-form').Control<TFieldValues>;
55
57
  classes?: {
@@ -106,4 +108,5 @@ export declare const Controlled: {
106
108
  dadataBaseUrl: string;
107
109
  formatter?: (item: import('./dadata/types').IDadataOrganizationOption) => import('..').SelectItemOption;
108
110
  }) => import("react/jsx-runtime").JSX.Element;
111
+ TextareaControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, control, name, rules, disabled, defaultValue, shouldUnregister, helperText, size, ...props }: import('./textarea').TextareaControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
109
112
  };
@@ -0,0 +1,27 @@
1
+ import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
2
+ import { TextareaBaseProps } from '../../..';
3
+ import { TFieldContainerConfig } from '../../ui';
4
+ type TextareaControlClasses = TextareaBaseProps['classes'] & {
5
+ message?: string;
6
+ };
7
+ export type TextareaControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<TextareaBaseProps, 'classes'> & {
8
+ /**
9
+ * Контрол объект для управления полем
10
+ */
11
+ control: Control<TFieldValues>;
12
+ /**
13
+ * Дополнительные стили компонента
14
+ */
15
+ classes?: TextareaControlClasses;
16
+ /**
17
+ * Дополнительный текст
18
+ */
19
+ helperText?: string;
20
+ /**
21
+ * Размер контейнера для поля
22
+ */
23
+ size?: TFieldContainerConfig['size'];
24
+ };
25
+ declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, control, name, rules, disabled, defaultValue, shouldUnregister, helperText, size, ...props }: TextareaControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const TextareaControl: typeof InnerComponent;
27
+ export {};
@@ -0,0 +1 @@
1
+ export { TextareaControl, type TextareaControlProps } from './TextareaControl';
@@ -5,6 +5,7 @@ export type { CheckboxBaseProps, CheckedState } from './checkbox';
5
5
  export type { SwitchBaseProps } from './switch';
6
6
  export type { AutocompleteBaseProps } from './autocomplete';
7
7
  export type { RadioGroupBaseProps, RadioOption } from './radio';
8
+ export type { TextareaBaseProps } from './textarea';
8
9
  export declare const Uncontrolled: {
9
10
  InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
10
11
  classes?: {
@@ -17,7 +18,6 @@ export declare const Uncontrolled: {
17
18
  attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
18
19
  renderValues?: () => React.JSX.Element | null;
19
20
  } & import('react').RefAttributes<HTMLInputElement>>;
20
- AutocompleteBase: <TData>({ formatter, query, value, returnValue, onChange, ...props }: import('./autocomplete').AutocompleteBaseProps<TData>) => import("react/jsx-runtime").JSX.Element;
21
21
  MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "placeholder"> & {
22
22
  classes?: {
23
23
  container?: string;
@@ -45,6 +45,7 @@ export declare const Uncontrolled: {
45
45
  inputValue?: string;
46
46
  attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
47
47
  filterDisabled?: boolean;
48
+ externalHandlers?: import('./select/Select').ExternalHandlers;
48
49
  } & import('react').RefAttributes<HTMLElement>>;
49
50
  CheckboxBase: import('react').ForwardRefExoticComponent<import('@radix-ui/react-checkbox').CheckboxProps & {
50
51
  classes?: {
@@ -58,6 +59,7 @@ export declare const Uncontrolled: {
58
59
  value?: string;
59
60
  onChange?: (value: string) => void;
60
61
  } & import('react').RefAttributes<HTMLInputElement>>;
62
+ AutocompleteBase: <TData>({ formatter, query, value, returnValue, onChange, ...props }: import('./autocomplete').AutocompleteBaseProps<TData>) => import("react/jsx-runtime").JSX.Element;
61
63
  SwitchBase: import('react').ForwardRefExoticComponent<import('@radix-ui/react-switch').SwitchProps & {
62
64
  classes?: {
63
65
  root?: string;
@@ -78,4 +80,14 @@ export declare const Uncontrolled: {
78
80
  };
79
81
  invalid?: boolean;
80
82
  } & import('react').RefAttributes<HTMLDivElement>>;
83
+ TextareaBase: import('react').ForwardRefExoticComponent<Omit<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "className"> & {
84
+ classes?: {
85
+ container?: string;
86
+ textarea?: string;
87
+ label?: string;
88
+ };
89
+ label: string;
90
+ invalid?: boolean;
91
+ attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
92
+ } & import('react').RefAttributes<HTMLTextAreaElement>>;
81
93
  };
@@ -8,6 +8,13 @@ export type SelectClasses = SelectItemProps['classes'] & {
8
8
  root?: string;
9
9
  list?: string;
10
10
  };
11
+ export type ExternalHandlers = {
12
+ onChange?: (value?: SelectItemOption | SelectItemOption[]) => void;
13
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
14
+ onBlur?: (event: React.FocusEvent<HTMLElement>) => void;
15
+ onFocus?: (event: React.FocusEvent<HTMLElement>) => void;
16
+ onInputChange?: (value: string) => void;
17
+ };
11
18
  export type SelectBaseProps<Multi extends boolean> = Omit<ComboboxProps<SelectItemOption, Multi, 'li'>, 'multiple' | 'onChange' | 'by' | 'virtual' | 'className'> & {
12
19
  /**
13
20
  * Отображаемый лейбл
@@ -57,6 +64,10 @@ export type SelectBaseProps<Multi extends boolean> = Omit<ComboboxProps<SelectIt
57
64
  * Свойство для выключении фильтрации по поиску
58
65
  */
59
66
  filterDisabled?: boolean;
67
+ /**
68
+ * Внешние handlers которые можно прокинуть из вне
69
+ */
70
+ externalHandlers?: ExternalHandlers;
60
71
  };
61
72
  export declare const SelectBase: import('react').ForwardRefExoticComponent<Omit<ComboboxProps<SelectItemOption, boolean, "li">, "onChange" | "className" | "multiple" | "by" | "virtual"> & {
62
73
  /**
@@ -107,5 +118,9 @@ export declare const SelectBase: import('react').ForwardRefExoticComponent<Omit<
107
118
  * Свойство для выключении фильтрации по поиску
108
119
  */
109
120
  filterDisabled?: boolean;
121
+ /**
122
+ * Внешние handlers которые можно прокинуть из вне
123
+ */
124
+ externalHandlers?: ExternalHandlers;
110
125
  } & import('react').RefAttributes<HTMLElement>>;
111
126
  export {};
@@ -1,4 +1,5 @@
1
1
  import { SelectItemOption } from '../model';
2
+ import { ExternalHandlers } from '../Select';
2
3
  type UseSelectControllerProps = {
3
4
  options: SelectItemOption[];
4
5
  isMulti?: boolean;
@@ -8,8 +9,9 @@ type UseSelectControllerProps = {
8
9
  filterDisabled: boolean;
9
10
  externalInputValue?: string;
10
11
  externalOnInputChange?: (value: string) => void;
12
+ externalHandlers?: ExternalHandlers;
11
13
  };
12
- export declare const useSelectController: ({ options: initialOptions, displayValue, isSearchable, onChange, filterDisabled, externalInputValue, externalOnInputChange }: UseSelectControllerProps) => {
14
+ export declare const useSelectController: ({ options: initialOptions, displayValue, isSearchable, onChange, filterDisabled, externalInputValue, externalOnInputChange, externalHandlers }: UseSelectControllerProps) => {
13
15
  options: SelectItemOption[];
14
16
  inputValue: string;
15
17
  onInputValueChange: import('react').ChangeEventHandler<HTMLInputElement>;
@@ -0,0 +1,45 @@
1
+ import { FieldAttachment } from '../../ui';
2
+ import { DeepPartial } from '../../../../types';
3
+ type TextareaBaseClasses = {
4
+ container?: string;
5
+ textarea?: string;
6
+ label?: string;
7
+ };
8
+ type FieldAttachmentProps = React.ComponentPropsWithoutRef<typeof FieldAttachment>;
9
+ export type TextareaBaseProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size' | 'className'> & {
10
+ /**
11
+ * Дополнительные стили внутренних компонентов
12
+ */
13
+ classes?: TextareaBaseClasses;
14
+ /**
15
+ * Отображаемый placeholder
16
+ */
17
+ label: string;
18
+ /**
19
+ * Отображение не валидного поля
20
+ */
21
+ invalid?: boolean;
22
+ /**
23
+ * Свойства дополнительной иконки
24
+ */
25
+ attachmentProps?: DeepPartial<FieldAttachmentProps>;
26
+ };
27
+ export declare const TextareaBase: import('react').ForwardRefExoticComponent<Omit<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "className"> & {
28
+ /**
29
+ * Дополнительные стили внутренних компонентов
30
+ */
31
+ classes?: TextareaBaseClasses;
32
+ /**
33
+ * Отображаемый placeholder
34
+ */
35
+ label: string;
36
+ /**
37
+ * Отображение не валидного поля
38
+ */
39
+ invalid?: boolean;
40
+ /**
41
+ * Свойства дополнительной иконки
42
+ */
43
+ attachmentProps?: DeepPartial<FieldAttachmentProps>;
44
+ } & import('react').RefAttributes<HTMLTextAreaElement>>;
45
+ export {};
@@ -0,0 +1 @@
1
+ export { TextareaBase, type TextareaBaseProps } from './Textarea';