@astral/ui 4.0.0-alpha.34 → 4.0.0-alpha.35
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/components/AddressAutocomplete/AddressAutocomplete.d.ts +2 -2
- package/components/AsyncAutocomplete/useLogic/useLogic.d.ts +2 -0
- package/components/AsyncAutocomplete/useLogic/useLogic.js +2 -1
- package/components/Autocomplete/Autocomplete.d.ts +8 -0
- package/components/Autocomplete/Autocomplete.js +7 -3
- package/components/CheckboxField/styles.d.ts +1 -0
- package/components/CheckboxField/styles.js +2 -2
- package/components/CodeField/styles.d.ts +1 -0
- package/components/DashboardLayout/Sidebar/Sidebar.js +2 -2
- package/components/DashboardLayout/Sidebar/styles.d.ts +6 -0
- package/components/DashboardLayout/Sidebar/styles.js +15 -8
- package/components/DatePicker/DatePicker.d.ts +8 -0
- package/components/DatePicker/DatePicker.js +2 -2
- package/components/DatePicker/styles.d.ts +1 -0
- package/components/DateRangePicker/DateRangePicker.js +3 -3
- package/components/DateRangePicker/styles.d.ts +1 -0
- package/components/EmailOrPhoneField/useLogic/useLogic.d.ts +1 -0
- package/components/FormHelperText/FormHelperText.d.ts +2 -1
- package/components/FormHelperText/FormHelperText.js +4 -1
- package/components/PageLayout/PageHeader/HeaderContent/styles.js +1 -1
- package/components/PageLayout/PageLayoutContainer/PageLayoutContainer.js +2 -2
- package/components/PageLayout/PageLayoutContainer/styles.d.ts +6 -0
- package/components/PageLayout/PageLayoutContainer/styles.js +8 -2
- package/components/Paper/Paper.d.ts +5 -1
- package/components/Paper/Paper.js +15 -3
- package/components/Paper/styles.d.ts +15 -0
- package/components/Paper/styles.js +9 -0
- package/components/SearchField/useLogic/useLogic.d.ts +1 -0
- package/components/Select/Select.d.ts +2 -2
- package/components/Select/Select.js +1 -1
- package/components/Select/styles.js +1 -1
- package/components/TextField/TextField.d.ts +5 -2
- package/components/TextField/TextField.js +9 -4
- package/components/TextField/constants.d.ts +3 -0
- package/components/TextField/constants.js +4 -0
- package/components/TextField/styles.d.ts +5 -0
- package/components/TextField/styles.js +16 -0
- package/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -2
- package/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +2 -2
- package/components/theme/components/MuiAutocomplete.js +21 -3
- package/components/theme/components/MuiFormHelperText.js +1 -1
- package/hook-form/EditableText/EditingForm/useLogic/useLogic.js +1 -1
- package/hook-form/hooks/useForm/index.d.ts +1 -0
- package/hook-form/hooks/useForm/types.d.ts +23 -0
- package/hook-form/hooks/useForm/types.js +1 -0
- package/hook-form/hooks/useForm/useForm.d.ts +3 -31
- package/hook-form/hooks/useForm/useForm.js +6 -3
- package/hook-form/hooks/useFormFieldErrorProps/useFormFieldErrorProps.d.ts +1 -2
- package/hook-form/hooks/useFormFieldProps/useFormFieldProps.d.ts +9 -13
- package/hook-form/hooks/useFormFieldProps/useFormFieldProps.js +3 -3
- package/hook-form/hooks/useFormInputProps/useFormInputProps.d.ts +1 -1
- package/hook-form/hooks/useFormWizard/useFormWizard.js +1 -4
- package/hook-form/index.d.ts +1 -0
- package/hook-form/index.js +1 -0
- package/hook-form/react-hook-form-resolver/index.d.ts +1 -0
- package/hook-form/react-hook-form-resolver/index.js +1 -0
- package/hook-form/react-hook-form-resolver/resolver/index.d.ts +1 -0
- package/hook-form/react-hook-form-resolver/resolver/index.js +1 -0
- package/hook-form/react-hook-form-resolver/resolver/resolver.d.ts +40 -0
- package/hook-form/react-hook-form-resolver/resolver/resolver.js +69 -0
- package/hook-form/react-hook-form-resolver/utils/index.d.ts +1 -0
- package/hook-form/react-hook-form-resolver/utils/index.js +1 -0
- package/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/index.d.ts +1 -0
- package/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/index.js +1 -0
- package/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/validateFieldsNatively.d.ts +5 -0
- package/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/validateFieldsNatively.js +24 -0
- package/node/components/AddressAutocomplete/AddressAutocomplete.d.ts +2 -2
- package/node/components/AsyncAutocomplete/useLogic/useLogic.d.ts +2 -0
- package/node/components/AsyncAutocomplete/useLogic/useLogic.js +2 -1
- package/node/components/Autocomplete/Autocomplete.d.ts +8 -0
- package/node/components/Autocomplete/Autocomplete.js +7 -3
- package/node/components/CheckboxField/styles.d.ts +1 -0
- package/node/components/CheckboxField/styles.js +2 -2
- package/node/components/CodeField/styles.d.ts +1 -0
- package/node/components/DashboardLayout/Sidebar/Sidebar.js +1 -1
- package/node/components/DashboardLayout/Sidebar/styles.d.ts +6 -0
- package/node/components/DashboardLayout/Sidebar/styles.js +16 -9
- package/node/components/DatePicker/DatePicker.d.ts +8 -0
- package/node/components/DatePicker/DatePicker.js +2 -2
- package/node/components/DatePicker/styles.d.ts +1 -0
- package/node/components/DateRangePicker/DateRangePicker.js +3 -3
- package/node/components/DateRangePicker/styles.d.ts +1 -0
- package/node/components/EmailOrPhoneField/useLogic/useLogic.d.ts +1 -0
- package/node/components/FormHelperText/FormHelperText.d.ts +2 -1
- package/node/components/FormHelperText/FormHelperText.js +4 -1
- package/node/components/PageLayout/PageHeader/HeaderContent/styles.js +1 -1
- package/node/components/PageLayout/PageLayoutContainer/PageLayoutContainer.js +1 -1
- package/node/components/PageLayout/PageLayoutContainer/styles.d.ts +6 -0
- package/node/components/PageLayout/PageLayoutContainer/styles.js +9 -3
- package/node/components/Paper/Paper.d.ts +5 -1
- package/node/components/Paper/Paper.js +15 -3
- package/node/components/Paper/styles.d.ts +15 -0
- package/node/components/Paper/styles.js +12 -0
- package/node/components/SearchField/useLogic/useLogic.d.ts +1 -0
- package/node/components/Select/Select.d.ts +2 -2
- package/node/components/Select/Select.js +1 -1
- package/node/components/Select/styles.js +1 -1
- package/node/components/TextField/TextField.d.ts +5 -2
- package/node/components/TextField/TextField.js +9 -4
- package/node/components/TextField/constants.d.ts +3 -0
- package/node/components/TextField/constants.js +7 -0
- package/node/components/TextField/styles.d.ts +5 -0
- package/node/components/TextField/styles.js +19 -0
- package/node/components/TreeAutocomplete/OptionsModal/OptionsModal.js +2 -2
- package/node/components/TreeLikeAutocomplete/OptionsModal/OptionsModal.js +2 -2
- package/node/components/theme/components/MuiAutocomplete.js +21 -3
- package/node/components/theme/components/MuiFormHelperText.js +1 -1
- package/node/hook-form/EditableText/EditingForm/useLogic/useLogic.js +1 -1
- package/node/hook-form/hooks/useForm/index.d.ts +1 -0
- package/node/hook-form/hooks/useForm/types.d.ts +23 -0
- package/node/hook-form/hooks/useForm/types.js +2 -0
- package/node/hook-form/hooks/useForm/useForm.d.ts +3 -31
- package/node/hook-form/hooks/useForm/useForm.js +5 -2
- package/node/hook-form/hooks/useFormFieldErrorProps/useFormFieldErrorProps.d.ts +1 -2
- package/node/hook-form/hooks/useFormFieldProps/useFormFieldProps.d.ts +9 -13
- package/node/hook-form/hooks/useFormInputProps/useFormInputProps.d.ts +1 -1
- package/node/hook-form/hooks/useFormWizard/useFormWizard.js +1 -4
- package/node/hook-form/index.d.ts +1 -0
- package/node/hook-form/index.js +3 -1
- package/node/hook-form/react-hook-form-resolver/index.d.ts +1 -0
- package/node/hook-form/react-hook-form-resolver/index.js +5 -0
- package/node/hook-form/react-hook-form-resolver/resolver/index.d.ts +1 -0
- package/node/{components/ScrollWrapper → hook-form/react-hook-form-resolver/resolver}/index.js +1 -1
- package/node/hook-form/react-hook-form-resolver/resolver/resolver.d.ts +40 -0
- package/node/hook-form/react-hook-form-resolver/resolver/resolver.js +73 -0
- package/node/hook-form/react-hook-form-resolver/utils/index.d.ts +1 -0
- package/node/hook-form/react-hook-form-resolver/utils/index.js +17 -0
- package/node/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/index.d.ts +1 -0
- package/node/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/index.js +17 -0
- package/node/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/validateFieldsNatively.d.ts +5 -0
- package/node/hook-form/react-hook-form-resolver/utils/validateFieldsNatively/validateFieldsNatively.js +28 -0
- package/package.json +5 -3
- package/components/ScrollWrapper/ScrollWrapper.d.ts +0 -7
- package/components/ScrollWrapper/ScrollWrapper.js +0 -3
- package/components/ScrollWrapper/index.d.ts +0 -1
- package/components/ScrollWrapper/index.js +0 -1
- package/components/ScrollWrapper/styles.d.ts +0 -7
- package/components/ScrollWrapper/styles.js +0 -7
- package/node/components/ScrollWrapper/ScrollWrapper.d.ts +0 -7
- package/node/components/ScrollWrapper/ScrollWrapper.js +0 -7
- package/node/components/ScrollWrapper/index.d.ts +0 -1
- package/node/components/ScrollWrapper/styles.d.ts +0 -7
- package/node/components/ScrollWrapper/styles.js +0 -10
|
@@ -6,6 +6,12 @@ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
$isPinned: boolean;
|
|
7
7
|
$alertHeight: number;
|
|
8
8
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
export declare const StyledPaper: import("@emotion/styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").PaperProps>, "elevation"> & {
|
|
10
|
+
elevation?: 0 | 1 | 2 | undefined;
|
|
11
|
+
shape?: "small" | "medium" | "large" | undefined;
|
|
12
|
+
} & {
|
|
13
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
14
|
+
}, {}, {}>;
|
|
9
15
|
export declare const SidebarRoot: import("@emotion/styled").StyledComponent<{
|
|
10
16
|
theme?: import("@emotion/react").Theme | undefined;
|
|
11
17
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Footer = exports.SidebarContent = exports.SidebarHeader = exports.SidebarRoot = exports.Wrapper = void 0;
|
|
3
|
+
exports.Footer = exports.SidebarContent = exports.SidebarHeader = exports.SidebarRoot = exports.StyledPaper = exports.Wrapper = void 0;
|
|
4
|
+
const Paper_1 = require("../../Paper");
|
|
4
5
|
const styles_1 = require("../../styles");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
const PinButton_1 = require("../PinButton");
|
|
@@ -33,23 +34,30 @@ exports.Wrapper = (0, styles_1.styled)('div', {
|
|
|
33
34
|
}};
|
|
34
35
|
}
|
|
35
36
|
`;
|
|
37
|
+
exports.StyledPaper = (0, styles_1.styled)(Paper_1.Paper) `
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
44
|
+
border: unset;
|
|
45
|
+
border-radius: 0;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
36
48
|
exports.SidebarRoot = (0, styles_1.styled)('aside', {
|
|
37
49
|
shouldForwardProp: (prop) => !['$isPinned', '$collapsedIn'].includes(prop),
|
|
38
50
|
}) `
|
|
39
51
|
position: ${({ $isPinned }) => ($isPinned ? 'relative' : 'absolute')};
|
|
40
52
|
z-index: ${({ theme }) => theme.zIndex.appBar - 1};
|
|
41
53
|
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
|
|
45
54
|
width: ${({ $collapsedIn, $isPinned }) => $isPinned || (!$isPinned && $collapsedIn) ? '242px' : '58px'};
|
|
46
55
|
height: 100%;
|
|
47
56
|
|
|
48
|
-
background-color: ${({ theme }) => theme.palette.background.default}
|
|
49
|
-
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
57
|
+
background-color: ${({ theme }) => theme.palette.background.default};;
|
|
50
58
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
51
|
-
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])}
|
|
52
|
-
|
|
59
|
+
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])};
|
|
60
|
+
|
|
53
61
|
transition: ${({ theme }) => {
|
|
54
62
|
return theme.transitions.create(['min-width', 'width', 'box-shadow'], {
|
|
55
63
|
duration: theme.transitions.duration.standard,
|
|
@@ -64,7 +72,6 @@ exports.SidebarRoot = (0, styles_1.styled)('aside', {
|
|
|
64
72
|
min-width: 100vw;
|
|
65
73
|
|
|
66
74
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
67
|
-
border: unset;
|
|
68
75
|
border-radius: 0;
|
|
69
76
|
}
|
|
70
77
|
`;
|
|
@@ -48,6 +48,10 @@ export type DatePickerProps = MondayFirst & WithDoubleNavigationButtons & Partia
|
|
|
48
48
|
* Вспомогательный текст под полем ввода
|
|
49
49
|
*/
|
|
50
50
|
helperText?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Включает/отключает резервирование места под helperText
|
|
53
|
+
*/
|
|
54
|
+
hideHelperText?: boolean;
|
|
51
55
|
/**
|
|
52
56
|
* Элемент в начале инпута
|
|
53
57
|
*/
|
|
@@ -97,6 +101,10 @@ export declare const DatePicker: import("react").ForwardRefExoticComponent<Monda
|
|
|
97
101
|
* Вспомогательный текст под полем ввода
|
|
98
102
|
*/
|
|
99
103
|
helperText?: ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* Включает/отключает резервирование места под helperText
|
|
106
|
+
*/
|
|
107
|
+
hideHelperText?: boolean | undefined;
|
|
100
108
|
/**
|
|
101
109
|
* Элемент в начале инпута
|
|
102
110
|
*/
|
|
@@ -12,6 +12,6 @@ const useLogic_1 = require("./useLogic");
|
|
|
12
12
|
const YearMonthDayPicker_1 = require("./YearMonthDayPicker");
|
|
13
13
|
exports.DatePicker = (0, react_1.forwardRef)((props, forwardedRef) => {
|
|
14
14
|
const { ref, pickerProps, handleOpen, onAccept, confirmButtonProps, isMobile, DatePickerInputProps, datePickerProps, } = (0, useLogic_1.useLogic)(Object.assign(Object.assign({}, props), { forwardedRef }));
|
|
15
|
-
const { className, startAdornment, label, required, helperText, inputProps, mask = constants_1.DEFAULT_DATE_MASK, size, disabled, inputRef, minDate = MinMaxDateContext_1.DEFAULT_MIN_DATE, maxDate = MinMaxDateContext_1.DEFAULT_MAX_DATE, isMondayFirst, isDoubleNavigationButtonsEnabled, } = props;
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: className, children: [(0, jsx_runtime_1.jsx)(DatePickerInput_1.DatePickerInput, Object.assign({ startAdornment: startAdornment, label: label, required: required, helperText: helperText }, inputProps, DatePickerInputProps, { onAccept: onAccept, mask: mask, size: size, disabled: disabled, ref: inputRef, onClick: handleOpen })), (0, jsx_runtime_1.jsx)(DatePickerPopover_1.DatePickerPopover, Object.assign({ placement: "bottom-start" }, datePickerProps, { children: (0, jsx_runtime_1.jsx)(MinMaxDateContext_1.MinMaxDateContextProvider, { minDate: minDate, maxDate: maxDate, children: (0, jsx_runtime_1.jsxs)(styles_1.StyledPaper, { children: [(0, jsx_runtime_1.jsx)(YearMonthDayPicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, pickerProps)), isMobile && ((0, jsx_runtime_1.jsx)(styles_1.ButtonWrapper, { children: (0, jsx_runtime_1.jsx)(styles_1.ConfirmButton, Object.assign({}, confirmButtonProps, { size: "large" })) }))] }) }) }))] }));
|
|
15
|
+
const { className, startAdornment, label, required, helperText, inputProps, mask = constants_1.DEFAULT_DATE_MASK, size, disabled, inputRef, minDate = MinMaxDateContext_1.DEFAULT_MIN_DATE, maxDate = MinMaxDateContext_1.DEFAULT_MAX_DATE, isMondayFirst, isDoubleNavigationButtonsEnabled, hideHelperText = false, } = props;
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, className: className, children: [(0, jsx_runtime_1.jsx)(DatePickerInput_1.DatePickerInput, Object.assign({ startAdornment: startAdornment, label: label, required: required, helperText: helperText }, inputProps, DatePickerInputProps, { onAccept: onAccept, mask: mask, size: size, disabled: disabled, ref: inputRef, onClick: handleOpen, hideHelperText: hideHelperText })), (0, jsx_runtime_1.jsx)(DatePickerPopover_1.DatePickerPopover, Object.assign({ placement: "bottom-start" }, datePickerProps, { children: (0, jsx_runtime_1.jsx)(MinMaxDateContext_1.MinMaxDateContextProvider, { minDate: minDate, maxDate: maxDate, children: (0, jsx_runtime_1.jsxs)(styles_1.StyledPaper, { children: [(0, jsx_runtime_1.jsx)(YearMonthDayPicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, pickerProps)), isMobile && ((0, jsx_runtime_1.jsx)(styles_1.ButtonWrapper, { children: (0, jsx_runtime_1.jsx)(styles_1.ConfirmButton, Object.assign({}, confirmButtonProps, { size: "large" })) }))] }) }) }))] }));
|
|
17
17
|
});
|
|
@@ -16,6 +16,7 @@ export declare const ButtonWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
16
16
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
17
17
|
export declare const StyledPaper: import("@emotion/styled").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").PaperProps>, "elevation"> & {
|
|
18
18
|
elevation?: 0 | 1 | 2 | undefined;
|
|
19
|
+
shape?: "small" | "medium" | "large" | undefined;
|
|
19
20
|
} & {
|
|
20
21
|
theme?: import("@emotion/react").Theme | undefined;
|
|
21
22
|
}, {}, {}>;
|
|
@@ -22,11 +22,11 @@ const useLogic_1 = require("./useLogic");
|
|
|
22
22
|
const DEFAULT_SPACING = 1;
|
|
23
23
|
exports.DateRangePicker = (0, react_1.forwardRef)((props, forwardedRef) => {
|
|
24
24
|
const { ref, startDatePickerInputProps, endDatePickerInputProps, popoverHoveredContextProviderProps, datePickerPopoverProps, minMaxDateContextProviderProps, startYearMonthDayPickerProps, endYearMonthDayPickerProps, } = (0, useLogic_1.useLogic)(props, forwardedRef);
|
|
25
|
-
const { startDateProps = {}, endDateProps = {}, mask = DatePicker_1.DEFAULT_DATE_MASK, spacing = DEFAULT_SPACING, size, isMondayFirst, isDisabled, isError, helperText, isDoubleNavigationButtonsEnabled, } = props;
|
|
25
|
+
const { startDateProps = {}, endDateProps = {}, mask = DatePicker_1.DEFAULT_DATE_MASK, spacing = DEFAULT_SPACING, size, isMondayFirst, isDisabled, isError, helperText, isDoubleNavigationButtonsEnabled, hideHelperText = false, } = props;
|
|
26
26
|
const _a = startDateProps || {}, { inputProps: startDateInputProps } = _a, restStartDateProps = __rest(_a, ["inputProps"]);
|
|
27
27
|
const _b = endDateProps || {}, { inputProps: endDateInputProps } = _b, restEndDateProps = __rest(_b, ["inputProps"]);
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)(Grid_1.Grid, { ref: ref, children: [(0, jsx_runtime_1.jsxs)(Grid_1.Grid, { container: true, spacing: spacing, direction: "column", children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDatePickerInput, Object.assign({}, startDateInputProps, restStartDateProps, {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(Grid_1.Grid, { ref: ref, children: [(0, jsx_runtime_1.jsxs)(Grid_1.Grid, { container: true, spacing: spacing, direction: "column", columns: "repeat(2, 1fr)", children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDatePickerInput, Object.assign({}, startDateInputProps, restStartDateProps, {
|
|
29
29
|
// TODO Пропс margin=none пока не работает, поэтому стилизуем компонент
|
|
30
30
|
// https://track.astral.ru/soft/browse/UIKIT-1333
|
|
31
|
-
mask: mask, size: size, disabled: isDisabled, error: isError }, startDatePickerInputProps)), (0, jsx_runtime_1.jsx)(styles_1.StyledDatePickerInput, Object.assign({}, endDateInputProps, restEndDateProps, { size: size, mask: mask, disabled: isDisabled, error: isError }, endDatePickerInputProps))] }), (0, jsx_runtime_1.jsx)(FormHelperText_1.FormHelperText, { error: isError, children: helperText && helperText }), (0, jsx_runtime_1.jsx)(DatePicker_1.PopoverHoveredContextProvider, Object.assign({}, popoverHoveredContextProviderProps, { children: (0, jsx_runtime_1.jsx)(DatePicker_1.MinMaxDateContextProvider, Object.assign({}, minMaxDateContextProviderProps, { children: (0, jsx_runtime_1.jsx)(DatePicker_1.DatePickerPopover, Object.assign({}, datePickerPopoverProps, { children: (0, jsx_runtime_1.jsxs)(styles_1.StyledPaper, { children: [(0, jsx_runtime_1.jsx)(DatePicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, startYearMonthDayPickerProps)), (0, jsx_runtime_1.jsx)(styles_1.PickerSplitter, {}), (0, jsx_runtime_1.jsx)(DatePicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, endYearMonthDayPickerProps))] }) })) })) }))] }));
|
|
31
|
+
mask: mask, size: size, disabled: isDisabled, error: isError }, startDatePickerInputProps)), (0, jsx_runtime_1.jsx)(styles_1.StyledDatePickerInput, Object.assign({}, endDateInputProps, restEndDateProps, { size: size, mask: mask, disabled: isDisabled, error: isError }, endDatePickerInputProps))] }), (0, jsx_runtime_1.jsx)(FormHelperText_1.FormHelperText, { error: isError, hideHelperText: hideHelperText, children: helperText && helperText }), (0, jsx_runtime_1.jsx)(DatePicker_1.PopoverHoveredContextProvider, Object.assign({}, popoverHoveredContextProviderProps, { children: (0, jsx_runtime_1.jsx)(DatePicker_1.MinMaxDateContextProvider, Object.assign({}, minMaxDateContextProviderProps, { children: (0, jsx_runtime_1.jsx)(DatePicker_1.DatePickerPopover, Object.assign({}, datePickerPopoverProps, { children: (0, jsx_runtime_1.jsxs)(styles_1.StyledPaper, { children: [(0, jsx_runtime_1.jsx)(DatePicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, startYearMonthDayPickerProps)), (0, jsx_runtime_1.jsx)(styles_1.PickerSplitter, {}), (0, jsx_runtime_1.jsx)(DatePicker_1.YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, endYearMonthDayPickerProps))] }) })) })) }))] }));
|
|
32
32
|
});
|
|
@@ -7,6 +7,7 @@ export declare const StyledDatePickerInput: import("@emotion/styled").StyledComp
|
|
|
7
7
|
}, {}, {}>;
|
|
8
8
|
export declare const StyledPaper: import("@emotion/styled").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").PaperProps>, "elevation"> & {
|
|
9
9
|
elevation?: 0 | 1 | 2 | undefined;
|
|
10
|
+
shape?: "small" | "medium" | "large" | undefined;
|
|
10
11
|
} & {
|
|
11
12
|
theme?: import("@emotion/react").Theme | undefined;
|
|
12
13
|
}, {}, {}>;
|
|
@@ -280,6 +280,7 @@ export declare const useLogic: (props: EmailOrPhoneFieldProps) => {
|
|
|
280
280
|
inputRef?: import("react").Ref<any> | undefined;
|
|
281
281
|
startAdornment?: import("react").ReactNode;
|
|
282
282
|
hiddenLabel?: boolean | undefined;
|
|
283
|
+
hideHelperText?: boolean | undefined;
|
|
283
284
|
InputProps?: Partial<import("@mui/material").OutlinedInputProps> | Partial<import("@mui/material").FilledInputProps> | Partial<import("@mui/material").InputProps> | undefined;
|
|
284
285
|
FormHelperTextProps?: Partial<import("@mui/material").FormHelperTextProps> | undefined;
|
|
285
286
|
helperText?: import("react").ReactNode;
|
|
@@ -4,5 +4,6 @@ import { type WithoutEmotionSpecific } from '../types';
|
|
|
4
4
|
export type FormHelperTextProps = WithoutEmotionSpecific<MuiFormHelperTextProps> & {
|
|
5
5
|
success?: boolean;
|
|
6
6
|
error?: boolean;
|
|
7
|
+
hideHelperText?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const FormHelperText: ({ children, success, error, ...props }: FormHelperTextProps) => JSX.Element;
|
|
9
|
+
export declare const FormHelperText: ({ children, success, error, hideHelperText, ...props }: FormHelperTextProps) => JSX.Element | null;
|
|
@@ -16,7 +16,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
16
16
|
const material_1 = require("@mui/material");
|
|
17
17
|
const FormHelperTextContent_1 = require("./FormHelperTextContent");
|
|
18
18
|
const FormHelperText = (_a) => {
|
|
19
|
-
var { children, success, error } = _a, props = __rest(_a, ["children", "success", "error"]);
|
|
19
|
+
var { children, success, error, hideHelperText = false } = _a, props = __rest(_a, ["children", "success", "error", "hideHelperText"]);
|
|
20
|
+
if (hideHelperText && !children) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
20
23
|
return ((0, jsx_runtime_1.jsx)(material_1.FormHelperText, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)(FormHelperTextContent_1.FormHelperTextContent, { error: error, success: success, children: children }) })));
|
|
21
24
|
};
|
|
22
25
|
exports.FormHelperText = FormHelperText;
|
|
@@ -19,7 +19,7 @@ exports.PageSubheader = styles_1.styled.div `
|
|
|
19
19
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
20
20
|
|
|
21
21
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
22
|
-
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
22
|
+
padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
25
25
|
exports.DesktopTitleWrapper = styles_1.styled.div `
|
|
@@ -7,5 +7,5 @@ const utils_1 = require("../../utils");
|
|
|
7
7
|
const constants_1 = require("./constants");
|
|
8
8
|
const styles_1 = require("./styles");
|
|
9
9
|
exports.PageLayoutContainer = (0, react_1.forwardRef)(({ children, className }, forwardedRef) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: (0, utils_1.classNames)(className, constants_1.pageLayoutClassnames.root), ref: forwardedRef, children: children }));
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StylePaper, { variant: "outlined", children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: (0, utils_1.classNames)(className, constants_1.pageLayoutClassnames.root), ref: forwardedRef, children: children }) }));
|
|
11
11
|
});
|
|
@@ -3,3 +3,9 @@ export declare const Wrapper: import("@emotion/styled").StyledComponent<{
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const StylePaper: import("@emotion/styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").PaperProps>, "elevation"> & {
|
|
7
|
+
elevation?: 0 | 1 | 2 | undefined;
|
|
8
|
+
shape?: "small" | "medium" | "large" | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Wrapper = void 0;
|
|
3
|
+
exports.StylePaper = exports.Wrapper = void 0;
|
|
4
|
+
const Paper_1 = require("../../Paper");
|
|
4
5
|
const styles_1 = require("../../styles");
|
|
5
6
|
exports.Wrapper = styles_1.styled.div `
|
|
6
7
|
display: grid;
|
|
@@ -14,8 +15,6 @@ exports.Wrapper = styles_1.styled.div `
|
|
|
14
15
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
15
16
|
|
|
16
17
|
background-color: ${({ theme }) => theme.palette.common.white};
|
|
17
|
-
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
18
|
-
border-radius: ${({ theme }) => theme.shape.medium};
|
|
19
18
|
|
|
20
19
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
20
|
scroll-behavior: smooth;
|
|
@@ -32,3 +31,10 @@ exports.Wrapper = styles_1.styled.div `
|
|
|
32
31
|
border: unset;
|
|
33
32
|
}
|
|
34
33
|
`;
|
|
34
|
+
exports.StylePaper = (0, styles_1.styled)(Paper_1.Paper) `
|
|
35
|
+
height: 100%;
|
|
36
|
+
|
|
37
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
38
|
+
border: unset;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
@@ -11,5 +11,9 @@ export type PaperProps = Omit<WithoutEmotionSpecific<MuiPaperProps>, 'elevation'
|
|
|
11
11
|
* <Paper elevation={2}> = Тень [300]
|
|
12
12
|
*/
|
|
13
13
|
elevation?: 0 | 1 | 2;
|
|
14
|
+
/**
|
|
15
|
+
* Определяет скругления для компонента в variant='outlined'
|
|
16
|
+
*/
|
|
17
|
+
shape?: 'small' | 'medium' | 'large';
|
|
14
18
|
};
|
|
15
|
-
export declare const Paper: (
|
|
19
|
+
export declare const Paper: ({ shape, ...restProps }: PaperProps) => JSX.Element;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.Paper = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
const Paper = (
|
|
7
|
-
|
|
16
|
+
const styles_1 = require("./styles");
|
|
17
|
+
const Paper = (_a) => {
|
|
18
|
+
var { shape = 'medium' } = _a, restProps = __rest(_a, ["shape"]);
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(styles_1.StyledPaper, Object.assign({ "$shape": shape }, restProps));
|
|
8
20
|
};
|
|
9
21
|
exports.Paper = Paper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledPaper: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
classes?: Partial<import("@mui/material").PaperClasses> | undefined;
|
|
5
|
+
elevation?: number | undefined;
|
|
6
|
+
square?: boolean | undefined;
|
|
7
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
+
variant?: import("@mui/types").OverridableStringUnion<"elevation" | "outlined", import("@mui/material").PaperPropsVariantOverrides> | undefined;
|
|
9
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
+
}, "elevation" | "children" | "sx" | "square" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant"> & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
$shape: 'small' | 'medium' | 'large';
|
|
15
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledPaper = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("../styles");
|
|
6
|
+
exports.StyledPaper = (0, styles_1.styled)(material_1.Paper, {
|
|
7
|
+
shouldForwardProp: (prop) => !['$shape'].includes(prop),
|
|
8
|
+
}) `
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
|
|
11
|
+
border-radius: ${({ theme, $shape }) => theme.shape[$shape]};
|
|
12
|
+
`;
|
|
@@ -278,6 +278,7 @@ export declare const useLogic: ({ onChange: propsOnChange, defaultValue, value,
|
|
|
278
278
|
maxRows?: string | number | undefined;
|
|
279
279
|
minRows?: string | number | undefined;
|
|
280
280
|
hiddenLabel?: boolean | undefined;
|
|
281
|
+
hideHelperText?: boolean | undefined;
|
|
281
282
|
InputProps?: Partial<import("@mui/material").OutlinedInputProps> | Partial<import("@mui/material").FilledInputProps> | Partial<import("@mui/material").InputProps> | undefined;
|
|
282
283
|
FormHelperTextProps?: Partial<import("@mui/material").FormHelperTextProps> | undefined;
|
|
283
284
|
helperText?: import("react").ReactNode;
|
|
@@ -10,7 +10,7 @@ export type SelectProps<TValue> = WithoutEmotionSpecific<Omit<MuiSelectProps<TVa
|
|
|
10
10
|
*/
|
|
11
11
|
helperText?: ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Включает/отключает резервирование места под helperText
|
|
14
14
|
*/
|
|
15
15
|
hideHelperText?: boolean;
|
|
16
16
|
/**
|
|
@@ -48,7 +48,7 @@ export declare const Select: <TValue>(props: WithoutEmotionSpecific<Omit<MuiSele
|
|
|
48
48
|
*/
|
|
49
49
|
helperText?: ReactNode;
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Включает/отключает резервирование места под helperText
|
|
52
52
|
*/
|
|
53
53
|
hideHelperText?: boolean | undefined;
|
|
54
54
|
/**
|
|
@@ -52,6 +52,6 @@ const SelectInner = (_a, ref) => {
|
|
|
52
52
|
}
|
|
53
53
|
return findMenuItemsLabel(children, selectedOptions);
|
|
54
54
|
};
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { error: error, fullWidth: fullWidth, children: [label && ((0, jsx_runtime_1.jsx)(material_1.InputLabel, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), (0, jsx_runtime_1.jsxs)(styles_1.StyledSelect, Object.assign({}, props, { value: value === null ? '' : value, open: isOpened, disabled: disabled, onOpen: openSelect, onClose: closeSelect, renderValue: renderValue, IconComponent: () => null, displayEmpty: true, ref: ref, fullWidth: fullWidth, onChange: handleChangeOption, "$isShowingPlaceholder": isShowingPlaceholder, endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.EndAdornmentWrapper, { children: [isShowingClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? (0, jsx_runtime_1.jsx)(icons_1.DownOutlineMd, {}) : (0, jsx_runtime_1.jsx)(icons_1.UpOutlineMd, {}) })] }), children: [(0, jsx_runtime_1.jsx)(styles_1.Placeholder, { value: "", children: placeholder }), loading && ((0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: (0, jsx_runtime_1.jsx)(Loader_1.Loader, {}) })), !loading && isShowingSelectAll && ((0, jsx_runtime_1.jsxs)(MenuItem_1.MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: constants_1.SELECT_ALL_VALUE, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && (0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] })),
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.FormControl, { error: error, fullWidth: fullWidth, children: [label && ((0, jsx_runtime_1.jsx)(material_1.InputLabel, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), (0, jsx_runtime_1.jsxs)(styles_1.StyledSelect, Object.assign({}, props, { value: value === null ? '' : value, open: isOpened, disabled: disabled, onOpen: openSelect, onClose: closeSelect, renderValue: renderValue, IconComponent: () => null, displayEmpty: true, ref: ref, fullWidth: fullWidth, onChange: handleChangeOption, "$isShowingPlaceholder": isShowingPlaceholder, endAdornment: (0, jsx_runtime_1.jsxs)(styles_1.EndAdornmentWrapper, { children: [isShowingClearButton && ((0, jsx_runtime_1.jsx)(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), (0, jsx_runtime_1.jsx)(IconButton_1.IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? (0, jsx_runtime_1.jsx)(icons_1.DownOutlineMd, {}) : (0, jsx_runtime_1.jsx)(icons_1.UpOutlineMd, {}) })] }), children: [(0, jsx_runtime_1.jsx)(styles_1.Placeholder, { value: "", children: placeholder }), loading && ((0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: (0, jsx_runtime_1.jsx)(Loader_1.Loader, {}) })), !loading && isShowingSelectAll && ((0, jsx_runtime_1.jsxs)(MenuItem_1.MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: constants_1.SELECT_ALL_VALUE, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && (0, jsx_runtime_1.jsx)(styles_1.StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] })), (0, jsx_runtime_1.jsx)(FormHelperText_1.FormHelperText, { error: error, success: success, hideHelperText: hideHelperText, children: helperText })] }));
|
|
56
56
|
};
|
|
57
57
|
exports.Select = (0, forwardRefWithGeneric_1.forwardRefWithGeneric)(SelectInner);
|
|
@@ -26,7 +26,7 @@ exports.StyledSelect = (0, styles_1.styled)(material_1.Select, {
|
|
|
26
26
|
}) `
|
|
27
27
|
padding-right: ${({ theme }) => theme.spacing(2)};
|
|
28
28
|
|
|
29
|
-
color: ${({ $isShowingPlaceholder, theme }) => $isShowingPlaceholder ? theme.palette.grey[
|
|
29
|
+
color: ${({ $isShowingPlaceholder, theme }) => $isShowingPlaceholder ? theme.palette.grey[500] : 'unset'};
|
|
30
30
|
|
|
31
31
|
.MuiSelect-select.MuiSelect-outlined {
|
|
32
32
|
min-height: 20px;
|
|
@@ -19,10 +19,13 @@ export type TextFieldProps = Omit<WithoutEmotionSpecific<MuiTextFieldProps>, 'va
|
|
|
19
19
|
*/
|
|
20
20
|
maxLength?: number;
|
|
21
21
|
/**
|
|
22
|
-
* Параметр для обрезания пробелов в текст филде при вызове onBlur
|
|
23
|
-
* @default true
|
|
22
|
+
* Параметр для обрезания пробелов в текст филде при вызове onBlur
|
|
24
23
|
* @example <TextField trimmed={false} />
|
|
25
24
|
*/
|
|
26
25
|
trimmed?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Включает/отключает резервирование места под helperText
|
|
28
|
+
*/
|
|
29
|
+
hideHelperText?: boolean;
|
|
27
30
|
};
|
|
28
31
|
export declare const TextField: import("react").ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -13,11 +13,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.TextField = void 0;
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
-
const material_1 = require("@mui/material");
|
|
17
16
|
const react_1 = require("react");
|
|
18
17
|
const FormHelperText_1 = require("../FormHelperText");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
const constants_1 = require("./constants");
|
|
20
|
+
const styles_1 = require("./styles");
|
|
19
21
|
exports.TextField = (0, react_1.forwardRef)((_a, ref) => {
|
|
20
|
-
var { success, error, helperText: helperTextProp, fullWidth = false, startAdornment, endAdornment, inputProps, InputProps, maxLength, trimmed = true, onBlur } = _a, props = __rest(_a, ["success", "error", "helperText", "fullWidth", "startAdornment", "endAdornment", "inputProps", "InputProps", "maxLength", "trimmed", "onBlur"]);
|
|
22
|
+
var { success, error, helperText: helperTextProp, fullWidth = false, startAdornment, endAdornment, inputProps, InputProps, maxLength, trimmed = true, onBlur, hideHelperText = false, className } = _a, props = __rest(_a, ["success", "error", "helperText", "fullWidth", "startAdornment", "endAdornment", "inputProps", "InputProps", "maxLength", "trimmed", "onBlur", "hideHelperText", "className"]);
|
|
21
23
|
const color = (0, react_1.useMemo)(() => {
|
|
22
24
|
if (success) {
|
|
23
25
|
return 'success';
|
|
@@ -48,6 +50,9 @@ exports.TextField = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
48
50
|
}
|
|
49
51
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
50
52
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
const classes = (0, react_1.useMemo)(() => {
|
|
54
|
+
return (0, utils_1.classNames)(className, hideHelperText ? constants_1.textFieldClassnames.hideHelperText : '');
|
|
55
|
+
}, [className, hideHelperText]);
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTextField, Object.assign({ ref: ref, variant: "outlined", fullWidth: fullWidth, error: error, color: color, helperText: helperText, InputProps: Object.assign({ startAdornment,
|
|
57
|
+
endAdornment }, InputProps), inputProps: Object.assign({ maxLength }, inputProps), onBlur: handleBlur, className: classes }, props)));
|
|
53
58
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textFieldClassnames = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
exports.textFieldClassnames = {
|
|
6
|
+
hideHelperText: (0, utils_1.createUIKitClassname)('text-field__helper-text_hidden'),
|
|
7
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const StyledTextField: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
3
|
+
} & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant"> & {
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledTextField = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
5
|
+
const styles_1 = require("../styles");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
exports.StyledTextField = (0, styles_1.styled)(material_1.TextField) `
|
|
8
|
+
&.${constants_1.textFieldClassnames.hideHelperText}{
|
|
9
|
+
|
|
10
|
+
.${material_1.formHelperTextClasses.root}.${material_1.formHelperTextClasses.contained} {
|
|
11
|
+
min-height: 0;
|
|
12
|
+
margin: 0;
|
|
13
|
+
|
|
14
|
+
&:not(:empty) {
|
|
15
|
+
margin: ${({ theme }) => theme.spacing(1, 0, 0)};
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -16,7 +16,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
16
16
|
const Button_1 = require("../../Button");
|
|
17
17
|
const Dialog_1 = require("../../Dialog");
|
|
18
18
|
const DialogActions_1 = require("../../DialogActions");
|
|
19
|
-
const
|
|
19
|
+
const Paper_1 = require("../../Paper");
|
|
20
20
|
const SearchField_1 = require("../../SearchField");
|
|
21
21
|
const Tree_1 = require("../../Tree");
|
|
22
22
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
@@ -39,6 +39,6 @@ const OptionsModal = (props) => {
|
|
|
39
39
|
}
|
|
40
40
|
return (0, jsx_runtime_1.jsx)(Tree_1.TreeList, Object.assign({}, treeProps, treeListProps));
|
|
41
41
|
};
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), (0, jsx_runtime_1.jsx)(
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), (0, jsx_runtime_1.jsx)(Paper_1.Paper, { variant: "outlined", children: (0, jsx_runtime_1.jsx)(styles_1.TreeListWrapper, { children: renderComponent() }) })] }), (0, jsx_runtime_1.jsxs)(DialogActions_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: "text" }, cancelButtonProps, { children: "\u041E\u0442\u043C\u0435\u043D\u0430" })), (0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({}, confirmButtonProps, { children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" }))] })] })));
|
|
43
43
|
};
|
|
44
44
|
exports.OptionsModal = OptionsModal;
|
|
@@ -16,7 +16,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
16
16
|
const Button_1 = require("../../Button");
|
|
17
17
|
const Dialog_1 = require("../../Dialog");
|
|
18
18
|
const DialogActions_1 = require("../../DialogActions");
|
|
19
|
-
const
|
|
19
|
+
const Paper_1 = require("../../Paper");
|
|
20
20
|
const SearchField_1 = require("../../SearchField");
|
|
21
21
|
const TreeLikeList_1 = require("../../TreeLikeList");
|
|
22
22
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
@@ -39,6 +39,6 @@ const OptionsModal = (props) => {
|
|
|
39
39
|
}
|
|
40
40
|
return ((0, jsx_runtime_1.jsx)(TreeLikeList_1.TreeLikeList, Object.assign({ isConfirmChildrenSelection: isConfirmChildrenSelection }, treeProps, treeLikeListProps)));
|
|
41
41
|
};
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), (0, jsx_runtime_1.jsx)(
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsx)(SearchField_1.SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), (0, jsx_runtime_1.jsx)(Paper_1.Paper, { variant: "outlined", children: (0, jsx_runtime_1.jsx)(styles_1.TreeListWrapper, { children: renderComponent() }) })] }), (0, jsx_runtime_1.jsxs)(DialogActions_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({ variant: "text" }, cancelButtonProps, { children: "\u041E\u0442\u043C\u0435\u043D\u0430" })), (0, jsx_runtime_1.jsx)(Button_1.Button, Object.assign({}, confirmButtonProps, { children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" }))] })] })));
|
|
43
43
|
};
|
|
44
44
|
exports.OptionsModal = OptionsModal;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MuiAutocomplete = void 0;
|
|
4
|
+
const material_1 = require("@mui/material");
|
|
4
5
|
const enums_1 = require("../../Autocomplete/enums");
|
|
5
6
|
exports.MuiAutocomplete = {
|
|
6
7
|
styleOverrides: {
|
|
8
|
+
root({ theme }) {
|
|
9
|
+
return {
|
|
10
|
+
[`&.${material_1.autocompleteClasses.hasPopupIcon}.${material_1.autocompleteClasses.hasClearIcon}`]: {
|
|
11
|
+
[`.${material_1.autocompleteClasses.inputRoot}`]: {
|
|
12
|
+
paddingRight: `${theme.spacing(14)}`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
},
|
|
7
17
|
inputRoot({ theme, ownerState: { size } }) {
|
|
8
18
|
return {
|
|
9
19
|
paddingTop: `${theme.spacing(1)} !important`,
|
|
10
20
|
paddingBottom: `${theme.spacing(1)} !important`,
|
|
11
|
-
paddingLeft: `${theme.spacing(
|
|
21
|
+
paddingLeft: `${theme.spacing(3)} !important`,
|
|
12
22
|
minHeight: size === enums_1.AutocompleteSizes.small ? '32px' : '40px',
|
|
13
23
|
};
|
|
14
24
|
},
|
|
15
|
-
input(
|
|
25
|
+
input() {
|
|
16
26
|
return {
|
|
17
27
|
padding: '0 !important',
|
|
18
|
-
paddingLeft: `${theme.spacing(1)} !important`,
|
|
19
28
|
};
|
|
20
29
|
},
|
|
21
30
|
popupIndicator({ theme }) {
|
|
@@ -31,6 +40,7 @@ exports.MuiAutocomplete = {
|
|
|
31
40
|
top: 'unset',
|
|
32
41
|
gap: theme.spacing(1),
|
|
33
42
|
color: theme.palette.grey[800],
|
|
43
|
+
marginRight: `${theme.spacing(1)} !important`,
|
|
34
44
|
};
|
|
35
45
|
},
|
|
36
46
|
paper({ theme }) {
|
|
@@ -62,5 +72,13 @@ exports.MuiAutocomplete = {
|
|
|
62
72
|
height: '64px',
|
|
63
73
|
};
|
|
64
74
|
},
|
|
75
|
+
tagSizeMedium({ theme }) {
|
|
76
|
+
return {
|
|
77
|
+
margin: `${theme.microSpacing(0, 1)}`,
|
|
78
|
+
':first-of-type': {
|
|
79
|
+
marginLeft: 0,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
},
|
|
65
83
|
},
|
|
66
84
|
};
|
|
@@ -6,8 +6,8 @@ exports.MuiFormHelperText = {
|
|
|
6
6
|
root({ theme }) {
|
|
7
7
|
return {
|
|
8
8
|
display: 'flex',
|
|
9
|
-
minHeight: theme.typography.caption.lineHeight,
|
|
10
9
|
fontSize: theme.typography.caption.fontSize,
|
|
10
|
+
minHeight: theme.typography.caption.lineHeight,
|
|
11
11
|
margin: theme.spacing(1, 0, 0),
|
|
12
12
|
color: theme.palette.grey[600],
|
|
13
13
|
lineHeight: theme.typography.caption.lineHeight,
|
|
@@ -25,7 +25,7 @@ const useLogic = ({ initialValue, children, validate, onClose, onSubmit, }) => {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
return {
|
|
28
|
-
values:
|
|
28
|
+
values: {},
|
|
29
29
|
errors: {
|
|
30
30
|
[constants_1.FIELD_NAME]: {
|
|
31
31
|
message: validationResult === null || validationResult === void 0 ? void 0 : validationResult.message,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ObjectAsyncGuard, ObjectGuard } from '@astral/validations';
|
|
2
|
+
import type { UseFormProps as UseFormPropsRHForm, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import type { FieldValues } from '../../types';
|
|
4
|
+
export type UseFormProps<TFieldValues extends FieldValues = FieldValues, TContext = any> = UseFormPropsRHForm<TFieldValues, TContext> & {
|
|
5
|
+
/**
|
|
6
|
+
* Схема валидации из @astral/validations
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const validationSchema = object<FormValues>({
|
|
11
|
+
* lastName: string(),
|
|
12
|
+
* name: string(),
|
|
13
|
+
* patronymic: optional(string()),
|
|
14
|
+
* phone: string(mobilePhone()),
|
|
15
|
+
* email: string(email()),
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const form = useForm<FormValues>({ validationSchema });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
validationSchema?: ObjectGuard<TFieldValues> | ObjectAsyncGuard<TFieldValues>;
|
|
22
|
+
};
|
|
23
|
+
export type { UseFormReturn };
|