@scbt-ecom/ui 0.19.3 → 0.20.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.
- package/dist/{CustomLink-fkoWqN7e.js → CustomLink-BZ2X3A56.js} +2 -2
- package/dist/{CustomLink-fkoWqN7e.js.map → CustomLink-BZ2X3A56.js.map} +1 -1
- package/dist/shared/ui/formElements/SwitchControl.d.ts +3 -0
- package/dist/shared/ui/formElements/controlled/index.d.ts +1 -0
- package/dist/shared/ui/formElements/controlled/switch/SwitchControl.d.ts +36 -0
- package/dist/shared/ui/formElements/controlled/switch/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uncontrolled/switch/Switch.d.ts +12 -0
- package/dist/shared/ui/formElements/uncontrolled/switch/index.d.ts +1 -0
- package/dist/ui.js +5080 -4967
- package/dist/ui.js.map +1 -1
- package/dist/widget.js +1 -1
- package/package.json +1 -1
|
@@ -12,5 +12,8 @@ export interface ISwitchControlProps<T extends FieldValues> extends TCommonField
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
classes?: TSwitchControlClasses;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated For better performance use `Controlled.SwitchControl` instead.
|
|
17
|
+
*/
|
|
15
18
|
export declare const SwitchControl: <T extends FieldValues>({ disabled, classes, control, helperText, label, ...props }: ISwitchControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export {};
|
|
@@ -60,4 +60,5 @@ export declare const Controlled: {
|
|
|
60
60
|
};
|
|
61
61
|
textHint?: string;
|
|
62
62
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
SwitchControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, textHint, tooltip, popoverProps, ...props }: import('./switch/SwitchControl').SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
63
64
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { Popover, SwitchBaseProps } from '../../..';
|
|
3
|
+
type SwitchControlClasses = SwitchBaseProps['classes'] & {
|
|
4
|
+
container?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
type PopoverProps = React.ComponentPropsWithoutRef<typeof Popover>;
|
|
8
|
+
export type SwitchControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<SwitchBaseProps, 'classes'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Контрол объект для управления полем
|
|
11
|
+
*/
|
|
12
|
+
control: Control<TFieldValues>;
|
|
13
|
+
/**
|
|
14
|
+
* Отображаемый лейбл
|
|
15
|
+
*/
|
|
16
|
+
children: React.ReactElement | string;
|
|
17
|
+
/**
|
|
18
|
+
* Дополнительные стили компонента
|
|
19
|
+
*/
|
|
20
|
+
classes?: SwitchControlClasses;
|
|
21
|
+
/**
|
|
22
|
+
* Дополнительный текст
|
|
23
|
+
*/
|
|
24
|
+
textHint?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Текст всплывающей подсказки
|
|
27
|
+
*/
|
|
28
|
+
tooltip?: React.ReactElement | string;
|
|
29
|
+
/**
|
|
30
|
+
* Свойства `Popover` компонента
|
|
31
|
+
*/
|
|
32
|
+
popoverProps?: PopoverProps;
|
|
33
|
+
};
|
|
34
|
+
declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ classes, className, control, name, rules, defaultValue, disabled, shouldUnregister, children, textHint, tooltip, popoverProps, ...props }: SwitchControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const SwitchControl: typeof InnerComponent;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwitchControl } from './SwitchControl';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SwitchProps } from '@radix-ui/react-switch';
|
|
2
|
+
type SwitchBaseClasses = {
|
|
3
|
+
root?: string;
|
|
4
|
+
thumb?: string;
|
|
5
|
+
};
|
|
6
|
+
export type SwitchBaseProps = SwitchProps & {
|
|
7
|
+
classes?: SwitchBaseClasses;
|
|
8
|
+
};
|
|
9
|
+
export declare const SwitchBase: import('react').ForwardRefExoticComponent<SwitchProps & {
|
|
10
|
+
classes?: SwitchBaseClasses;
|
|
11
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwitchBase, type SwitchBaseProps } from './Switch';
|