@scbt-ecom/ui 0.13.3 → 0.14.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/client.js +24058 -16384
- package/dist/client.js.map +1 -1
- package/dist/hybrid.js +433 -2549
- package/dist/hybrid.js.map +1 -1
- package/dist/index-BJGvyDqg.js +11371 -0
- package/dist/index-BJGvyDqg.js.map +1 -0
- package/dist/shared/types/index.d.ts +1 -0
- package/dist/shared/types/utils.d.ts +3 -0
- package/dist/shared/ui/calendar/Calendar.d.ts +11 -0
- package/dist/shared/ui/calendar/index.d.ts +2 -0
- package/dist/shared/ui/calendar/model/index.d.ts +1 -0
- package/dist/shared/ui/calendar/model/utils.d.ts +34 -0
- package/dist/shared/ui/calendar/ui/Day.d.ts +9 -0
- package/dist/shared/ui/calendar/ui/DayButton.d.ts +8 -0
- package/dist/shared/ui/calendar/ui/Footer.d.ts +6 -0
- package/dist/shared/ui/calendar/ui/MonthCaption.d.ts +10 -0
- package/dist/shared/ui/calendar/ui/Navigation.d.ts +4 -0
- package/dist/shared/ui/calendar/ui/Weekday.d.ts +4 -0
- package/dist/shared/ui/calendar/ui/index.d.ts +7 -0
- package/dist/shared/ui/calendar/ui/model/index.d.ts +2 -0
- package/dist/shared/ui/calendar/ui/model/types.d.ts +9 -0
- package/dist/shared/ui/calendar/ui/model/utils.d.ts +13 -0
- package/dist/shared/ui/calendar/ui/selectDate/SelectDate.d.ts +13 -0
- package/dist/shared/ui/calendar/ui/selectDate/index.d.ts +1 -0
- package/dist/shared/ui/calendar/ui/selectDate/ui/SelectList.d.ts +10 -0
- package/dist/shared/ui/calendar/ui/selectDate/ui/Trigger.d.ts +9 -0
- package/dist/shared/ui/calendar/ui/selectDate/ui/index.d.ts +2 -0
- package/dist/shared/ui/checkbox/Checkbox.d.ts +14 -0
- package/dist/shared/ui/checkbox/index.d.ts +1 -0
- package/dist/shared/ui/formElements/controlled/checkbox/CheckboxControl.d.ts +15 -0
- package/dist/shared/ui/formElements/controlled/checkbox/index.d.ts +1 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/dayPickerControl.d.ts +15 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/index.d.ts +1 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/model/constants.d.ts +4 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/model/index.d.ts +2 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/model/utils.d.ts +25 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/range.d.ts +17 -0
- package/dist/shared/ui/formElements/controlled/dayPickerControl/single.d.ts +13 -0
- package/dist/shared/ui/formElements/controlled/index.d.ts +63 -0
- package/dist/shared/ui/formElements/controlled/input/InputControl.d.ts +13 -0
- package/dist/shared/ui/formElements/controlled/input/MaskInputControl.d.ts +13 -0
- package/dist/shared/ui/formElements/controlled/input/index.d.ts +2 -0
- package/dist/shared/ui/formElements/controlled/select/SelectControl.d.ts +13 -0
- package/dist/shared/ui/formElements/controlled/select/index.d.ts +1 -0
- package/dist/shared/ui/formElements/index.d.ts +1 -0
- package/dist/shared/ui/formElements/uploaderControl/model/hooks/useUploader.d.ts +1 -1
- package/dist/shared/ui/index.d.ts +4 -0
- package/dist/shared/ui/input/Input.d.ts +23 -0
- package/dist/shared/ui/input/MaskInput.d.ts +49 -0
- package/dist/shared/ui/input/index.d.ts +2 -0
- package/dist/shared/ui/input/model/mask/index.d.ts +1 -0
- package/dist/shared/ui/input/model/mask/utils.d.ts +2 -0
- package/dist/shared/ui/select/Select.d.ts +30 -0
- package/dist/shared/ui/select/index.d.ts +2 -0
- package/dist/shared/ui/select/ui/SelectItem.d.ts +24 -0
- package/dist/shared/ui/select/ui/SelectList.d.ts +10 -0
- package/dist/shared/ui/select/ui/control/Control.d.ts +13 -0
- package/dist/shared/ui/select/ui/control/hooks/index.d.ts +1 -0
- package/dist/shared/ui/select/ui/control/hooks/useSelectController.d.ts +20 -0
- package/dist/shared/ui/select/ui/control/index.d.ts +1 -0
- package/dist/shared/ui/select/ui/control/ui/Chip.d.ts +12 -0
- package/dist/shared/ui/select/ui/control/ui/ChipList.d.ts +11 -0
- package/dist/shared/ui/select/ui/control/ui/index.d.ts +1 -0
- package/dist/shared/ui/select/ui/index.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/utils-tailwind.css +4 -0
- package/package.json +5 -4
- package/dist/index-CC-TDkSs.js +0 -9172
- package/dist/index-CC-TDkSs.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './utils';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, JSX } from 'react';
|
|
2
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
3
|
+
import { SelectOptions } from './ui';
|
|
4
|
+
type CalendarProps = DayPickerProps & {
|
|
5
|
+
navigation?: boolean;
|
|
6
|
+
renderFooter?: (props: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => JSX.Element | string;
|
|
7
|
+
selectOptions?: SelectOptions;
|
|
8
|
+
disabledAfterToday?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const Calendar: ({ classNames, showOutsideDays, navigation, renderFooter, selectOptions, className, disabledAfterToday, ...props }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const DATE_VISIBLE_PATTERN = "dd.MM.yyyy";
|
|
2
|
+
/**
|
|
3
|
+
* Форматирование объекта даты в читаемую строку
|
|
4
|
+
* @example
|
|
5
|
+
* new Date() -> '10.10.2024'
|
|
6
|
+
* @param {Date} date
|
|
7
|
+
* @param {string} locale
|
|
8
|
+
* @returns Форматированная строка
|
|
9
|
+
*/
|
|
10
|
+
export declare const formatDateToLocaleString: (date: Date, locale?: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Форматирование объекта даты в читаемую строку года
|
|
13
|
+
* @example
|
|
14
|
+
* new Date() -> '2024'
|
|
15
|
+
* @param {Date} date
|
|
16
|
+
* @param {string} locale
|
|
17
|
+
* @returns Форматированная строка
|
|
18
|
+
*/
|
|
19
|
+
export declare const formatDateToYearString: (date: Date, locale?: string) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Форматирование объекта даты в читаемую строку месяца
|
|
22
|
+
* @example
|
|
23
|
+
* new Date() -> 'декабрь'
|
|
24
|
+
* @param date
|
|
25
|
+
* @param locale
|
|
26
|
+
*/
|
|
27
|
+
export declare const formatDateToMonthString: (date: Date, locale?: string) => string;
|
|
28
|
+
export declare const defaultClassNames: {
|
|
29
|
+
today: string;
|
|
30
|
+
outside: string;
|
|
31
|
+
selected: string;
|
|
32
|
+
range_outer: string;
|
|
33
|
+
range_middle: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ClassAttributes, TdHTMLAttributes } from 'react';
|
|
2
|
+
import { CalendarDay, Modifiers } from 'react-day-picker';
|
|
3
|
+
type DayProps = ClassAttributes<HTMLTableCellElement> & TdHTMLAttributes<HTMLTableCellElement> & {
|
|
4
|
+
day: CalendarDay;
|
|
5
|
+
modifiers: Modifiers;
|
|
6
|
+
disabledAfterToday?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const Day: ({ className, day, children, disabledAfterToday, ...props }: DayProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ClassAttributes } from 'react';
|
|
2
|
+
import { CalendarDay, Modifiers } from 'react-day-picker';
|
|
3
|
+
type DayButtonProps = ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
day: CalendarDay;
|
|
5
|
+
modifiers: Modifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const DayButton: ({ className, ...props }: DayButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, JSX } from 'react';
|
|
2
|
+
type FooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
render: (props: DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => JSX.Element | string;
|
|
4
|
+
};
|
|
5
|
+
export declare const Footer: ({ render, ...props }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClassAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
import { CalendarMonth } from 'react-day-picker';
|
|
3
|
+
import { SelectOptions } from './model';
|
|
4
|
+
type MonthCaptionProps = ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
calendarMonth: CalendarMonth;
|
|
6
|
+
displayIndex: number;
|
|
7
|
+
selectOptions?: SelectOptions | false;
|
|
8
|
+
};
|
|
9
|
+
export declare const MonthCaption: ({ calendarMonth, displayIndex, className, selectOptions, ...props }: MonthCaptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DetailedHTMLProps, ThHTMLAttributes } from 'react';
|
|
2
|
+
type WeekdayProps = DetailedHTMLProps<ThHTMLAttributes<HTMLTableCellElement>, HTMLTableCellElement>;
|
|
3
|
+
export declare const Weekday: ({ className, children, ...props }: WeekdayProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DayButton } from './DayButton';
|
|
2
|
+
export { Weekday } from './Weekday';
|
|
3
|
+
export { Day } from './Day';
|
|
4
|
+
export { Footer } from './Footer';
|
|
5
|
+
export { Navigation } from './Navigation';
|
|
6
|
+
export { MonthCaption } from './MonthCaption';
|
|
7
|
+
export type { SelectOptions } from './model';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SelectOptions } from '..';
|
|
2
|
+
export declare const weekdays: {
|
|
3
|
+
пн: boolean;
|
|
4
|
+
вт: boolean;
|
|
5
|
+
ср: boolean;
|
|
6
|
+
чт: boolean;
|
|
7
|
+
пт: boolean;
|
|
8
|
+
сб: boolean;
|
|
9
|
+
вс: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const getYearsFrom: (startFrom?: number, order?: string) => number[];
|
|
12
|
+
export declare const getMonthsFrom: (startFrom?: number, order?: string) => number[];
|
|
13
|
+
export declare const defaultSelectOptions: SelectOptions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { CalendarMonth } from 'react-day-picker';
|
|
3
|
+
type SelectDateProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
dates: number[];
|
|
5
|
+
currentMonth: CalendarMonth;
|
|
6
|
+
onMonthChange: (month: Date) => void;
|
|
7
|
+
mode: 'month' | 'year';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const SelectDate: ({ dates, currentMonth, onMonthChange, className, open, onOpenChange, mode, disabled, ...props }: SelectDateProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectDate } from './SelectDate';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
type SelectListProps = Omit<ComponentPropsWithoutRef<typeof motion.ul>, 'onSelect'> & {
|
|
4
|
+
dates: number[];
|
|
5
|
+
selected: Date;
|
|
6
|
+
onSelect: (date: Date) => void;
|
|
7
|
+
mode: 'month' | 'year';
|
|
8
|
+
};
|
|
9
|
+
export declare const SelectList: ({ dates, selected, onSelect, className, mode, ...props }: SelectListProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
type TriggerProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
3
|
+
currentDate: Date;
|
|
4
|
+
mode: 'year' | 'month';
|
|
5
|
+
open: boolean;
|
|
6
|
+
onOpenChange: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const Trigger: ({ currentDate, mode, className, open, onOpenChange, ...props }: TriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CheckboxProps as CheckboxPrimitiveProps } from '@radix-ui/react-checkbox';
|
|
2
|
+
type CheckboxBaseClasses = {
|
|
3
|
+
root?: string;
|
|
4
|
+
indicator?: string;
|
|
5
|
+
};
|
|
6
|
+
export type CheckboxBaseProps = CheckboxPrimitiveProps & {
|
|
7
|
+
classes?: CheckboxBaseClasses;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const CheckboxBase: import('react').ForwardRefExoticComponent<CheckboxPrimitiveProps & {
|
|
11
|
+
classes?: CheckboxBaseClasses;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckboxBase, type CheckboxBaseProps } from './Checkbox';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { CheckboxBaseProps } from '../../..';
|
|
3
|
+
type CheckboxControlClasses = CheckboxBaseProps['classes'] & {
|
|
4
|
+
container?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
type CheckboxControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<CheckboxBaseProps, 'classes'> & {
|
|
9
|
+
control: Control<TFieldValues>;
|
|
10
|
+
children: React.ReactElement | string;
|
|
11
|
+
classes?: CheckboxControlClasses;
|
|
12
|
+
};
|
|
13
|
+
declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, ...props }: CheckboxControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const CheckboxControl: typeof InnerComponent;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckboxControl } from './CheckboxControl';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { Calendar, MaskInputProps } from '../../..';
|
|
3
|
+
type CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>;
|
|
4
|
+
type DayPickerControlClasses = MaskInputProps['classes'] & {
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DayPickerControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<CalendarProps, 'selected' | 'onSelect' | 'mode'> & {
|
|
8
|
+
control: Control<TFieldValues>;
|
|
9
|
+
inputProps: Omit<MaskInputProps, 'mask'>;
|
|
10
|
+
textHint?: string;
|
|
11
|
+
classes?: DayPickerControlClasses;
|
|
12
|
+
};
|
|
13
|
+
declare const InnerComponent: <T extends FieldValues = FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, textHint, classes, ...props }: DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const DayPickerControl: typeof InnerComponent;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DayPickerControl } from './dayPickerControl';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DateRange } from 'react-day-picker';
|
|
2
|
+
type IsoDateRange = {
|
|
3
|
+
from?: string;
|
|
4
|
+
to?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Функция для получения инит состояния поля ввода
|
|
8
|
+
* @param mode режим календаря (single | range)
|
|
9
|
+
* @param value текущее состояние поля
|
|
10
|
+
*/
|
|
11
|
+
export declare function getInitialValue(mode: 'single', value?: string): string;
|
|
12
|
+
export declare function getInitialValue(mode: 'range', value?: IsoDateRange): string;
|
|
13
|
+
export declare function getInitialValue(mode: 'multiple', value?: IsoDateRange): string;
|
|
14
|
+
/**
|
|
15
|
+
* Функция для получения объекта даты по текущему состоянию
|
|
16
|
+
* @param mode режим календаря (single | range)
|
|
17
|
+
* @param value текущее состояние поля
|
|
18
|
+
*
|
|
19
|
+
* @returns Date если mode 'single'
|
|
20
|
+
* @returns DateRange если mode 'range'
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCurrentDate(mode: 'single', value?: string): Date;
|
|
23
|
+
export declare function getCurrentDate(mode: 'range', value?: IsoDateRange): DateRange;
|
|
24
|
+
export declare function getCurrentDate(mode: 'multiple', value?: IsoDateRange): Date;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Calendar, MaskInputProps } from '../../..';
|
|
2
|
+
type CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>;
|
|
3
|
+
type RangeDayPickerClasses = MaskInputProps['classes'] & {
|
|
4
|
+
calendar?: string;
|
|
5
|
+
};
|
|
6
|
+
type IsoDateRange = {
|
|
7
|
+
from?: string;
|
|
8
|
+
to?: string;
|
|
9
|
+
};
|
|
10
|
+
type RangeDayPickerProps = Omit<CalendarProps, 'mode'> & {
|
|
11
|
+
inputProps: Omit<MaskInputProps, 'mask'>;
|
|
12
|
+
classes?: RangeDayPickerClasses;
|
|
13
|
+
value: IsoDateRange;
|
|
14
|
+
onChange: (value: IsoDateRange) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const RangeDayPicker: ({ inputProps, classes, value, onChange, ...props }: RangeDayPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Calendar, MaskInputProps } from '../../..';
|
|
2
|
+
type CalendarProps = React.ComponentPropsWithoutRef<typeof Calendar>;
|
|
3
|
+
type SingleDayPickerClasses = MaskInputProps['classes'] & {
|
|
4
|
+
calendar?: string;
|
|
5
|
+
};
|
|
6
|
+
type SingleDayPickerProps = Omit<CalendarProps, 'mode'> & {
|
|
7
|
+
inputProps: Omit<MaskInputProps, 'mask'>;
|
|
8
|
+
classes?: SingleDayPickerClasses;
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const SingleDayPicker: ({ inputProps, classes, value, onChange, ...props }: SingleDayPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const Controlled: {
|
|
2
|
+
InputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, textHint, classes, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('../..').InputBaseProps, "classes"> & {
|
|
3
|
+
control: import('react-hook-form').Control<TFieldValues>;
|
|
4
|
+
textHint?: string;
|
|
5
|
+
classes?: {
|
|
6
|
+
container?: string;
|
|
7
|
+
input?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
} & {
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
MaskInputControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, classes, textHint, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('../..').MaskInputProps, "classes"> & {
|
|
14
|
+
control: import('react-hook-form').Control<TFieldValues>;
|
|
15
|
+
classes?: {
|
|
16
|
+
container?: string;
|
|
17
|
+
input?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
} & {
|
|
20
|
+
message?: string;
|
|
21
|
+
};
|
|
22
|
+
textHint?: string;
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
DayPickerControl: <T extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, name, disabled, rules, shouldUnregister, defaultValue, inputProps, textHint, classes, ...props }: import('./dayPickerControl/dayPickerControl').DayPickerControlProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
CheckboxControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, className, name, rules, shouldUnregister, defaultValue, disabled, children, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('../..').CheckboxBaseProps, "classes"> & {
|
|
26
|
+
control: import('react-hook-form').Control<TFieldValues>;
|
|
27
|
+
children: React.ReactElement | string;
|
|
28
|
+
classes?: {
|
|
29
|
+
root?: string;
|
|
30
|
+
indicator?: string;
|
|
31
|
+
} & {
|
|
32
|
+
container?: string;
|
|
33
|
+
message?: string;
|
|
34
|
+
label?: string;
|
|
35
|
+
};
|
|
36
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
SelectControl: <TFieldValues extends import('react-hook-form').FieldValues = import('react-hook-form').FieldValues>({ control, classes, className, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, ...props }: import('react-hook-form').UseControllerProps<TFieldValues, import('react-hook-form').Path<TFieldValues>> & Omit<import('react-select').Props<import('../..').SelectItemOption, boolean>, "defaultValue" | "options" | "placeholder"> & Pick<import('../..').InputBaseProps, "attachmentProps"> & {
|
|
38
|
+
label: string;
|
|
39
|
+
invalid?: boolean;
|
|
40
|
+
isSearchable?: boolean;
|
|
41
|
+
returnValue?: (option: import('../..').SelectItemOption) => string;
|
|
42
|
+
displayValue?: (option: import('../..').SelectItemOption) => string;
|
|
43
|
+
classes?: {
|
|
44
|
+
container?: string;
|
|
45
|
+
control?: import('../../select/ui').ControlClasses;
|
|
46
|
+
option?: import('../../select/ui').SelectItemClasses;
|
|
47
|
+
list?: import('../../select/ui').SelectListClasses;
|
|
48
|
+
};
|
|
49
|
+
options: import('../..').SelectItemOption[];
|
|
50
|
+
filterOptionDisabled?: boolean;
|
|
51
|
+
} & {
|
|
52
|
+
control: import('react-hook-form').Control<TFieldValues>;
|
|
53
|
+
classes?: {
|
|
54
|
+
container?: string;
|
|
55
|
+
control?: import('../../select/ui').ControlClasses;
|
|
56
|
+
option?: import('../../select/ui').SelectItemClasses;
|
|
57
|
+
list?: import('../../select/ui').SelectListClasses;
|
|
58
|
+
} & {
|
|
59
|
+
container?: string;
|
|
60
|
+
message?: string;
|
|
61
|
+
};
|
|
62
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control, FieldValues, Path, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { InputBaseProps } from '../../../input';
|
|
3
|
+
type InputControlClasses = InputBaseProps['classes'] & {
|
|
4
|
+
message?: string;
|
|
5
|
+
};
|
|
6
|
+
type InputControlProps<TFieldValues extends FieldValues = FieldValues, TName extends Path<TFieldValues> = Path<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<InputBaseProps, 'classes'> & {
|
|
7
|
+
control: Control<TFieldValues>;
|
|
8
|
+
textHint?: string;
|
|
9
|
+
classes?: InputControlClasses;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, textHint, classes, ...props }: InputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const InputControl: typeof InnerComponent;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { MaskInputProps } from '../../../input';
|
|
3
|
+
type MaskInputClasses = MaskInputProps['classes'] & {
|
|
4
|
+
message?: string;
|
|
5
|
+
};
|
|
6
|
+
type MaskInputControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & Omit<MaskInputProps, 'classes'> & {
|
|
7
|
+
control: Control<TFieldValues>;
|
|
8
|
+
classes?: MaskInputClasses;
|
|
9
|
+
textHint?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ className, control, name, defaultValue, disabled, rules, shouldUnregister, classes, textHint, ...props }: MaskInputControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const MaskInputControl: typeof InnerComponent;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control, FieldPath, FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import { SelectBaseProps } from '../../..';
|
|
3
|
+
type SelectControlClasses = SelectBaseProps['classes'] & {
|
|
4
|
+
container?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
type SelectControlProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = UseControllerProps<TFieldValues, TName> & SelectBaseProps & {
|
|
8
|
+
control: Control<TFieldValues>;
|
|
9
|
+
classes?: SelectControlClasses;
|
|
10
|
+
};
|
|
11
|
+
declare const InnerComponent: <TFieldValues extends FieldValues = FieldValues>({ control, classes, className, name, rules, shouldUnregister, disabled, defaultValue, returnValue, options, ...props }: SelectControlProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const SelectControl: typeof InnerComponent;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SelectControl } from './SelectControl';
|
|
@@ -5,7 +5,7 @@ export type TUseUploader = {
|
|
|
5
5
|
onValueChange: (f: File[]) => void;
|
|
6
6
|
};
|
|
7
7
|
export declare const useUploader: ({ dropzoneOptions, controlledFiles, onValueChange }: TUseUploader) => {
|
|
8
|
-
filesStatus: Record<string, "error" | "
|
|
8
|
+
filesStatus: Record<string, "error" | "loading" | "success">;
|
|
9
9
|
removeFile: (index: number) => void;
|
|
10
10
|
dropzoneState: import('react-dropzone').DropzoneState;
|
|
11
11
|
};
|
|
@@ -6,6 +6,10 @@ export * from './PhoneView';
|
|
|
6
6
|
export { Badge, type IBadgeProps } from './Badge';
|
|
7
7
|
export { Loader, type ILoaderProps } from './Loader';
|
|
8
8
|
export { Skeleton, type ISkeletonProps } from './Skeleton';
|
|
9
|
+
export * from './calendar';
|
|
10
|
+
export * from './input';
|
|
11
|
+
export * from './select';
|
|
12
|
+
export * from './checkbox';
|
|
9
13
|
export * from './FloatButton';
|
|
10
14
|
export { Accordion, type IAccordionProps } from './accordion';
|
|
11
15
|
export { Hint, type IHintProps } from './Hint';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FieldAttachment } from '../formElements/ui';
|
|
2
|
+
import { DeepPartial } from '../../types';
|
|
3
|
+
type InputBaseClasses = {
|
|
4
|
+
container?: string;
|
|
5
|
+
input?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
type FieldAttachmentProps = React.ComponentPropsWithoutRef<typeof FieldAttachment>;
|
|
9
|
+
export type InputBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'placeholder'> & {
|
|
10
|
+
classes?: InputBaseClasses;
|
|
11
|
+
label: string;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
attachmentProps?: DeepPartial<FieldAttachmentProps>;
|
|
14
|
+
renderValues?: () => React.JSX.Element | null;
|
|
15
|
+
};
|
|
16
|
+
export declare const InputBase: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
|
|
17
|
+
classes?: InputBaseClasses;
|
|
18
|
+
label: string;
|
|
19
|
+
invalid?: boolean;
|
|
20
|
+
attachmentProps?: DeepPartial<FieldAttachmentProps>;
|
|
21
|
+
renderValues?: () => React.JSX.Element | null;
|
|
22
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useInputMask } from 'use-mask-input';
|
|
2
|
+
import { InputBaseProps } from './Input';
|
|
3
|
+
type Validator = (char: string) => boolean;
|
|
4
|
+
type Casing = 'upper' | 'lower' | 'title';
|
|
5
|
+
export type Definition = {
|
|
6
|
+
validator: string | Validator;
|
|
7
|
+
casing?: Casing;
|
|
8
|
+
cardinality?: number;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
definitionSymbol?: string;
|
|
11
|
+
};
|
|
12
|
+
export type MaskInputProps = InputBaseProps & {
|
|
13
|
+
/**
|
|
14
|
+
* маска, по которой будет определяться валидация символов
|
|
15
|
+
*/
|
|
16
|
+
mask: Parameters<typeof useInputMask>[0]['mask'];
|
|
17
|
+
/**
|
|
18
|
+
* дополнительные валидаторы спец символов в маске
|
|
19
|
+
*/
|
|
20
|
+
externalMaskDefinitions?: Record<string, Definition>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Компонент маски очень умный, умеет обрабатывать специальные символы
|
|
24
|
+
* в том порядке, который определён маской
|
|
25
|
+
* @typeParam '\#' позволяет вводить только числа (regexp: /\d/g)
|
|
26
|
+
* @typeParam 'A' позволяет вводить любые буквы русского и английского алфавита (regexp: /[A-Za-zА-Яа-я]/g)
|
|
27
|
+
* @typeParam 'C' позволяет вводить любые буквы, которые определены для использования в гос номерах автомобилей (regexp: /([АВЕКМНОРСТУХавекмнорстух])/)
|
|
28
|
+
*/
|
|
29
|
+
export declare const MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
|
|
30
|
+
classes?: {
|
|
31
|
+
container?: string;
|
|
32
|
+
input?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
};
|
|
35
|
+
label: string;
|
|
36
|
+
invalid?: boolean;
|
|
37
|
+
attachmentProps?: import('../../types').DeepPartial<import('../formElements/ui').IFieldAttachmentProps>;
|
|
38
|
+
renderValues?: () => React.JSX.Element | null;
|
|
39
|
+
} & {
|
|
40
|
+
/**
|
|
41
|
+
* маска, по которой будет определяться валидация символов
|
|
42
|
+
*/
|
|
43
|
+
mask: Parameters<typeof useInputMask>[0]["mask"];
|
|
44
|
+
/**
|
|
45
|
+
* дополнительные валидаторы спец символов в маске
|
|
46
|
+
*/
|
|
47
|
+
externalMaskDefinitions?: Record<string, Definition>;
|
|
48
|
+
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defaultDefinitions } from './utils';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Props } from 'react-select';
|
|
2
|
+
import { ControlClasses, SelectItemClasses, SelectItemOption, SelectListClasses } from './ui';
|
|
3
|
+
import { InputBaseProps } from '..';
|
|
4
|
+
type SelectClasses = {
|
|
5
|
+
container?: string;
|
|
6
|
+
control?: ControlClasses;
|
|
7
|
+
option?: SelectItemClasses;
|
|
8
|
+
list?: SelectListClasses;
|
|
9
|
+
};
|
|
10
|
+
export type SelectBaseProps<IsMulti extends boolean = boolean> = Omit<Props<SelectItemOption, IsMulti>, 'placeholder' | 'options' | 'defaultValue'> & Pick<InputBaseProps, 'attachmentProps'> & {
|
|
11
|
+
label: string;
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
isSearchable?: boolean;
|
|
14
|
+
returnValue?: (option: SelectItemOption) => string;
|
|
15
|
+
displayValue?: (option: SelectItemOption) => string;
|
|
16
|
+
classes?: SelectClasses;
|
|
17
|
+
options: SelectItemOption[];
|
|
18
|
+
filterOptionDisabled?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const SelectBase: import('react').ForwardRefExoticComponent<Omit<Props<SelectItemOption, boolean>, "defaultValue" | "options" | "placeholder"> & Pick<InputBaseProps, "attachmentProps"> & {
|
|
21
|
+
label: string;
|
|
22
|
+
invalid?: boolean;
|
|
23
|
+
isSearchable?: boolean;
|
|
24
|
+
returnValue?: (option: SelectItemOption) => string;
|
|
25
|
+
displayValue?: (option: SelectItemOption) => string;
|
|
26
|
+
classes?: SelectClasses;
|
|
27
|
+
options: SelectItemOption[];
|
|
28
|
+
filterOptionDisabled?: boolean;
|
|
29
|
+
} & import('react').RefAttributes<import('node_modules/react-select/dist/declarations/src/Select').default<SelectItemOption, boolean, import('react-select').GroupBase<SelectItemOption>>>>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OptionProps } from 'react-select';
|
|
2
|
+
import { DeepPartial } from '../../../types';
|
|
3
|
+
import { FieldAttachment } from '../../formElements/ui';
|
|
4
|
+
type FieldAttachmentProps = React.ComponentPropsWithoutRef<typeof FieldAttachment>;
|
|
5
|
+
export type SelectItemOption = {
|
|
6
|
+
id: string | number;
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
additionalText?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
attachment?: {
|
|
12
|
+
left?: DeepPartial<FieldAttachmentProps>;
|
|
13
|
+
right?: DeepPartial<FieldAttachmentProps>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type SelectItemClasses = {
|
|
17
|
+
container?: string;
|
|
18
|
+
additionalText?: string;
|
|
19
|
+
};
|
|
20
|
+
type SelectItemProps = OptionProps<SelectItemOption> & {
|
|
21
|
+
classes?: SelectItemClasses;
|
|
22
|
+
};
|
|
23
|
+
export declare const SelectItem: ({ isSelected, label, data, innerProps, innerRef, selectProps, isFocused, classes, isMulti, ...props }: SelectItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|