@scbt-ecom/ui 0.24.1 → 0.25.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.
@@ -50,6 +50,7 @@ export declare const Controlled: {
50
50
  inputValue?: string;
51
51
  attachmentProps?: import('../../../types').DeepPartial<import('../ui').IFieldAttachmentProps>;
52
52
  filterDisabled?: boolean;
53
+ externalHandlers?: import('../uncontrolled/select/Select').ExternalHandlers;
53
54
  } & {
54
55
  control: import('react-hook-form').Control<TFieldValues>;
55
56
  classes?: {
@@ -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?: {
@@ -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>;