@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
|
@@ -4,7 +4,7 @@ export type Address = {
|
|
|
4
4
|
addressString: string;
|
|
5
5
|
};
|
|
6
6
|
export type AddressAutocompleteValue<TOptions extends Address = Address> = TOptions;
|
|
7
|
-
export type AddressAutocompleteProps<TOptions extends Address = AddressAutocompleteValue> = Pick<AsyncAutocompleteProps<TOptions, false, false, boolean>, 'className' | 'ref' | 'id' | 'placeholder' | 'onClose' | 'onOpen' | 'open' | 'disablePortal' | 'loadingText' | 'noOptionsText' | 'readOnly' | 'renderOption' | 'autoHighlight' | 'getOptionDisabled' | 'label' | 'helperText' | 'inputRef' | 'size' | 'isDisabled' | 'isLoading' | 'isFullWidth' | 'isError' | 'isSuccess' | 'isRequired' | 'fetchDelayMs' | 'minSymbolsToFetch' | 'fetchOptions' | 'onInputChange' | 'role' | 'defaultValue'> & {
|
|
7
|
+
export type AddressAutocompleteProps<TOptions extends Address = AddressAutocompleteValue> = Pick<AsyncAutocompleteProps<TOptions, false, false, boolean>, 'className' | 'ref' | 'id' | 'placeholder' | 'onClose' | 'onOpen' | 'open' | 'disablePortal' | 'loadingText' | 'noOptionsText' | 'readOnly' | 'renderOption' | 'autoHighlight' | 'getOptionDisabled' | 'label' | 'helperText' | 'inputRef' | 'size' | 'isDisabled' | 'isLoading' | 'isFullWidth' | 'isError' | 'isSuccess' | 'isRequired' | 'fetchDelayMs' | 'minSymbolsToFetch' | 'fetchOptions' | 'onInputChange' | 'role' | 'defaultValue' | 'hideHelperText'> & {
|
|
8
8
|
/**
|
|
9
9
|
* Значение для autocomplete
|
|
10
10
|
*/
|
|
@@ -23,7 +23,7 @@ export type AddressAutocompleteProps<TOptions extends Address = AddressAutocompl
|
|
|
23
23
|
*/
|
|
24
24
|
isHidePersonalData?: boolean;
|
|
25
25
|
};
|
|
26
|
-
export declare const AddressAutocomplete: <TOptions extends Address = Address>(props: Pick<AsyncAutocompleteProps<TOptions, false, false, boolean>, "label" | "size" | "defaultValue" | "className" | "id" | "placeholder" | "role" | "ref" | "open" | "onClose" | "readOnly" | "disablePortal" | "inputRef" | "onOpen" | "loadingText" | "noOptionsText" | "renderOption" | "autoHighlight" | "getOptionDisabled" | "onInputChange" | "helperText" | "isDisabled" | "isError" | "fetchOptions" | "fetchDelayMs" | "minSymbolsToFetch" | "isFullWidth" | "isSuccess" | "isLoading" | "isRequired"> & {
|
|
26
|
+
export declare const AddressAutocomplete: <TOptions extends Address = Address>(props: Pick<AsyncAutocompleteProps<TOptions, false, false, boolean>, "label" | "size" | "defaultValue" | "className" | "id" | "placeholder" | "role" | "ref" | "open" | "onClose" | "readOnly" | "disablePortal" | "inputRef" | "onOpen" | "loadingText" | "noOptionsText" | "renderOption" | "autoHighlight" | "getOptionDisabled" | "onInputChange" | "hideHelperText" | "helperText" | "isDisabled" | "isError" | "fetchOptions" | "fetchDelayMs" | "minSymbolsToFetch" | "isFullWidth" | "isSuccess" | "isLoading" | "isRequired"> & {
|
|
27
27
|
/**
|
|
28
28
|
* Значение для autocomplete
|
|
29
29
|
*/
|
|
@@ -315,6 +315,7 @@ export declare const useLogic: <TOptions, TMultiple extends boolean, TDisableCle
|
|
|
315
315
|
endAdornment?: import("react").ReactNode;
|
|
316
316
|
maxLength?: number | undefined;
|
|
317
317
|
trimmed?: boolean | undefined;
|
|
318
|
+
hideHelperText?: boolean | undefined;
|
|
318
319
|
} & Omit<import("@mui/material").AutocompleteRenderInputParams, "size">) => import("react").ReactNode) | undefined;
|
|
319
320
|
renderOption?: ((props: import("react").HTMLAttributes<HTMLLIElement>, option: TOptions, state: import("@mui/material").AutocompleteRenderOptionState) => import("react").ReactNode) | undefined;
|
|
320
321
|
renderTags?: ((value: TOptions[], getTagProps: import("@mui/material").AutocompleteRenderGetTagProps, ownerState: import("@mui/material").AutocompleteOwnerState<TOptions, TMultiple, TDisableClearable, TFreeSolo, "div">) => import("react").ReactNode) | undefined;
|
|
@@ -339,6 +340,7 @@ export declare const useLogic: <TOptions, TMultiple extends boolean, TDisableCle
|
|
|
339
340
|
onHighlightChange?: ((event: SyntheticEvent<Element, Event>, option: TOptions | null, reason: import("@mui/material").AutocompleteHighlightChangeReason) => void) | undefined;
|
|
340
341
|
openOnFocus?: boolean | undefined;
|
|
341
342
|
selectOnFocus?: boolean | undefined;
|
|
343
|
+
hideHelperText?: boolean | undefined;
|
|
342
344
|
helperText?: import("react").ReactNode;
|
|
343
345
|
loadedDataError?: string | undefined;
|
|
344
346
|
overflowOption?: import("../..").OverflowedElementProps | undefined;
|
|
@@ -43,7 +43,8 @@ export const useLogic = (_a) => {
|
|
|
43
43
|
});
|
|
44
44
|
}, fetchDelayMs), [fetchOptions, fetchDelayMs]);
|
|
45
45
|
const handleInputChange = (event, search, reason) => {
|
|
46
|
-
if (
|
|
46
|
+
if ((minSymbolsToFetch > 0 && !search) ||
|
|
47
|
+
search.length < minSymbolsToFetch) {
|
|
47
48
|
if (debouncedFetchOptions.isPending) {
|
|
48
49
|
debouncedFetchOptions.clear();
|
|
49
50
|
}
|
|
@@ -43,6 +43,10 @@ export type AutocompleteProps<TAutocompleteValueProps, TMultiple extends boolean
|
|
|
43
43
|
* @default Очистить
|
|
44
44
|
*/
|
|
45
45
|
clearText?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Включает/отключает резервирование места под helperText
|
|
48
|
+
*/
|
|
49
|
+
hideHelperText?: boolean;
|
|
46
50
|
};
|
|
47
51
|
export declare const Autocomplete: <TAutocompleteValueProps, TMultiple extends boolean, TDisableClearable extends boolean, TFreeSolo extends boolean>(props: Omit<WithoutEmotionSpecific<MuiAutocompleteProps<TAutocompleteValueProps, TMultiple, TDisableClearable, TFreeSolo, "div">>, "size" | "clearText" | "closeText" | "noOptionsText" | "openText" | "renderInput"> & Pick<TextFieldProps, "label" | "error" | "success" | "placeholder" | "required" | "inputProps" | "inputRef" | "helperText"> & {
|
|
48
52
|
renderInput?: ((props: TextFieldProps & Omit<AutocompleteRenderInputParams, 'size'>) => ReactNode) | undefined;
|
|
@@ -82,4 +86,8 @@ export declare const Autocomplete: <TAutocompleteValueProps, TMultiple extends b
|
|
|
82
86
|
* @default Очистить
|
|
83
87
|
*/
|
|
84
88
|
clearText?: string | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* Включает/отключает резервирование места под helperText
|
|
91
|
+
*/
|
|
92
|
+
hideHelperText?: boolean | undefined;
|
|
85
93
|
} & import("react").RefAttributes<unknown>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
@@ -19,19 +19,22 @@ import { Loader } from '../Loader';
|
|
|
19
19
|
import { OverflowTypography, } from '../OverflowTypography';
|
|
20
20
|
import { Tag } from '../Tag';
|
|
21
21
|
import { TextField } from '../TextField';
|
|
22
|
+
import { classNames } from '../utils';
|
|
22
23
|
import { DEFAULT_AUTOCOMPLETE_ELEMENT_ROWS_COUNT, DEFAULT_PLACEHOLDER, } from './constants';
|
|
23
24
|
import { StyledMenuItem } from './styles';
|
|
24
25
|
import { useLogic } from './useLogic';
|
|
25
26
|
const AutocompleteInner = (props, ref) => {
|
|
26
27
|
const { isValueEmpty, isPopperVisible, autocompleteProps } = useLogic(props);
|
|
27
|
-
const { required, success, error, label, getOptionLabel, helperText, inputRef, multiple, size = 'medium', placeholder = DEFAULT_PLACEHOLDER, overflowOption, closeText = 'Закрыть', openText = 'Открыть', clearText = 'Очистить', loadingText = _jsx(Loader, {}), isLoadedDataError, loadedDataError, noOptionsText, autoHighlight, renderInput: externalRenderInput, renderTags: externalRenderTags, renderOption: externalRenderOption, inputProps } = props, restProps = __rest(props, ["required", "success", "error", "label", "getOptionLabel", "helperText", "inputRef", "multiple", "size", "placeholder", "overflowOption", "closeText", "openText", "clearText", "loadingText", "isLoadedDataError", "loadedDataError", "noOptionsText", "autoHighlight", "renderInput", "renderTags", "renderOption", "inputProps"]);
|
|
28
|
+
const { required, success, error, label, getOptionLabel, helperText, inputRef, multiple, size = 'medium', placeholder = DEFAULT_PLACEHOLDER, overflowOption, closeText = 'Закрыть', openText = 'Открыть', clearText = 'Очистить', loadingText = _jsx(Loader, {}), isLoadedDataError, loadedDataError, noOptionsText, autoHighlight, renderInput: externalRenderInput, renderTags: externalRenderTags, renderOption: externalRenderOption, inputProps, hideHelperText = false } = props, restProps = __rest(props, ["required", "success", "error", "label", "getOptionLabel", "helperText", "inputRef", "multiple", "size", "placeholder", "overflowOption", "closeText", "openText", "clearText", "loadingText", "isLoadedDataError", "loadedDataError", "noOptionsText", "autoHighlight", "renderInput", "renderTags", "renderOption", "inputProps", "hideHelperText"]);
|
|
28
29
|
const renderInput = useCallback((inputParams) => {
|
|
29
|
-
|
|
30
|
+
var _a;
|
|
31
|
+
const generalInputParams = Object.assign(Object.assign({}, inputParams), { inputProps: Object.assign(Object.assign({}, inputParams.inputProps), { className: classNames((_a = inputParams === null || inputParams === void 0 ? void 0 : inputParams.inputProps) === null || _a === void 0 ? void 0 : _a.className, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className) }), inputRef,
|
|
30
32
|
required, placeholder: isValueEmpty ? placeholder : '', label,
|
|
31
33
|
success,
|
|
32
34
|
error,
|
|
33
35
|
helperText,
|
|
34
|
-
size
|
|
36
|
+
size,
|
|
37
|
+
hideHelperText });
|
|
35
38
|
if (externalRenderInput) {
|
|
36
39
|
return externalRenderInput(generalInputParams);
|
|
37
40
|
}
|
|
@@ -47,6 +50,7 @@ const AutocompleteInner = (props, ref) => {
|
|
|
47
50
|
error,
|
|
48
51
|
helperText,
|
|
49
52
|
size,
|
|
53
|
+
hideHelperText,
|
|
50
54
|
]);
|
|
51
55
|
const renderOption = useCallback((optionProps, option, optionState) => {
|
|
52
56
|
if (externalRenderOption) {
|
|
@@ -4,6 +4,7 @@ export declare const StyledFormControlledLabel: import("@emotion/styled").Styled
|
|
|
4
4
|
export declare const StyledFormHelperText: import("@emotion/styled").StyledComponent<import("..").WithoutEmotionSpecific<import("@mui/material").FormHelperTextProps> & {
|
|
5
5
|
success?: boolean | undefined;
|
|
6
6
|
error?: boolean | undefined;
|
|
7
|
+
hideHelperText?: boolean | undefined;
|
|
7
8
|
} & {
|
|
8
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
9
10
|
}, {}, {}>;
|
|
@@ -15,9 +15,9 @@ export const StyledFormControlledLabel = styled(FormControlLabel) `
|
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
17
|
export const StyledFormHelperText = styled(FormHelperText) `
|
|
18
|
-
|
|
18
|
+
padding-left: ${({ theme }) => theme.spacing(7)};
|
|
19
19
|
|
|
20
20
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
-
|
|
21
|
+
padding-left: ${({ theme }) => theme.spacing(9)};
|
|
22
22
|
}
|
|
23
23
|
`;
|
|
@@ -35,6 +35,7 @@ export declare const FieldLabel: import("@emotion/styled").StyledComponent<{
|
|
|
35
35
|
export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("..").WithoutEmotionSpecific<import("@mui/material").FormHelperTextProps> & {
|
|
36
36
|
success?: boolean | undefined;
|
|
37
37
|
error?: boolean | undefined;
|
|
38
|
+
hideHelperText?: boolean | undefined;
|
|
38
39
|
} & {
|
|
39
40
|
theme?: import("@emotion/react").Theme | undefined;
|
|
40
41
|
}, {}, {}>;
|
|
@@ -6,7 +6,7 @@ import { PinButton } from '../PinButton';
|
|
|
6
6
|
import { dashboardLayoutSidebarClassnames } from './constants';
|
|
7
7
|
import { SidebarNav } from './SidebarNav';
|
|
8
8
|
import { SidebarSkeleton } from './SidebarSkeleton';
|
|
9
|
-
import { Footer, SidebarContent, SidebarHeader, SidebarRoot, Wrapper, } from './styles';
|
|
9
|
+
import { Footer, SidebarContent, SidebarHeader, SidebarRoot, StyledPaper, Wrapper, } from './styles';
|
|
10
10
|
import { useLogic } from './useLogic';
|
|
11
11
|
/**
|
|
12
12
|
* Основной sidebar приложения
|
|
@@ -16,5 +16,5 @@ export const Sidebar = forwardRef((props, ref) => {
|
|
|
16
16
|
if (isLoading) {
|
|
17
17
|
return _jsx(SidebarSkeleton, {});
|
|
18
18
|
}
|
|
19
|
-
return (_jsx(Wrapper, { "$isPinned": isPinned, "$alertHeight": alertHeight, children:
|
|
19
|
+
return (_jsx(Wrapper, { "$isPinned": isPinned, "$alertHeight": alertHeight, children: _jsx(SidebarRoot, { ref: ref, "$isPinned": isPinned, "$collapsedIn": collapsedIn, className: classNames(className, dashboardLayoutSidebarClassnames.root), onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, inert: isMobile && !isPinned ? '' : undefined, children: _jsxs(StyledPaper, { variant: "outlined", children: [_jsxs(SidebarContent, { "$collapsedIn": collapsedIn, "$isPinned": isPinned, "$hasHeader": Boolean(header), children: [header && _jsx(SidebarHeader, { children: header }), _jsx(SidebarNav, { menu: _jsx(NavMenu, { collapsedIn: collapsedIn, items: menu.items }) })] }), _jsx(Footer, { children: _jsx(PinButton, { isPinned: isPinned, collapsedIn: collapsedIn, onClick: onTogglePin }) })] }) }) }));
|
|
20
20
|
});
|
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
import { Paper } from '../../Paper';
|
|
1
2
|
import { styled } from '../../styles';
|
|
2
3
|
import { HEADER_HEIGHT_MOBILE } from '../constants';
|
|
3
4
|
import { pinButtonClassnames } from '../PinButton';
|
|
@@ -30,23 +31,30 @@ export const Wrapper = styled('div', {
|
|
|
30
31
|
}};
|
|
31
32
|
}
|
|
32
33
|
`;
|
|
34
|
+
export const StyledPaper = styled(Paper) `
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
|
|
38
|
+
height: 100%;
|
|
39
|
+
|
|
40
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
41
|
+
border: unset;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
33
45
|
export const SidebarRoot = styled('aside', {
|
|
34
46
|
shouldForwardProp: (prop) => !['$isPinned', '$collapsedIn'].includes(prop),
|
|
35
47
|
}) `
|
|
36
48
|
position: ${({ $isPinned }) => ($isPinned ? 'relative' : 'absolute')};
|
|
37
49
|
z-index: ${({ theme }) => theme.zIndex.appBar - 1};
|
|
38
50
|
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
|
|
42
51
|
width: ${({ $collapsedIn, $isPinned }) => $isPinned || (!$isPinned && $collapsedIn) ? '242px' : '58px'};
|
|
43
52
|
height: 100%;
|
|
44
53
|
|
|
45
|
-
background-color: ${({ theme }) => theme.palette.background.default}
|
|
46
|
-
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
54
|
+
background-color: ${({ theme }) => theme.palette.background.default};;
|
|
47
55
|
border-radius: ${({ theme }) => theme.shape.medium};
|
|
48
|
-
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])}
|
|
49
|
-
|
|
56
|
+
box-shadow: ${({ theme, $isPinned, $collapsedIn }) => ($isPinned || !$collapsedIn ? 'unset' : theme.elevation[300])};
|
|
57
|
+
|
|
50
58
|
transition: ${({ theme }) => {
|
|
51
59
|
return theme.transitions.create(['min-width', 'width', 'box-shadow'], {
|
|
52
60
|
duration: theme.transitions.duration.standard,
|
|
@@ -61,7 +69,6 @@ export const SidebarRoot = styled('aside', {
|
|
|
61
69
|
min-width: 100vw;
|
|
62
70
|
|
|
63
71
|
background-color: ${({ theme }) => theme.palette.background.default};
|
|
64
|
-
border: unset;
|
|
65
72
|
border-radius: 0;
|
|
66
73
|
}
|
|
67
74
|
`;
|
|
@@ -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
|
*/
|
|
@@ -9,6 +9,6 @@ import { useLogic } from './useLogic';
|
|
|
9
9
|
import { YearMonthDayPicker } from './YearMonthDayPicker';
|
|
10
10
|
export const DatePicker = forwardRef((props, forwardedRef) => {
|
|
11
11
|
const { ref, pickerProps, handleOpen, onAccept, confirmButtonProps, isMobile, DatePickerInputProps, datePickerProps, } = useLogic(Object.assign(Object.assign({}, props), { forwardedRef }));
|
|
12
|
-
const { className, startAdornment, label, required, helperText, inputProps, mask = DEFAULT_DATE_MASK, size, disabled, inputRef, minDate = DEFAULT_MIN_DATE, maxDate = DEFAULT_MAX_DATE, isMondayFirst, isDoubleNavigationButtonsEnabled, } = props;
|
|
13
|
-
return (_jsxs("div", { ref: ref, className: className, children: [_jsx(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 })), _jsx(DatePickerPopover, Object.assign({ placement: "bottom-start" }, datePickerProps, { children: _jsx(MinMaxDateContextProvider, { minDate: minDate, maxDate: maxDate, children: _jsxs(StyledPaper, { children: [_jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, pickerProps)), isMobile && (_jsx(ButtonWrapper, { children: _jsx(ConfirmButton, Object.assign({}, confirmButtonProps, { size: "large" })) }))] }) }) }))] }));
|
|
12
|
+
const { className, startAdornment, label, required, helperText, inputProps, mask = DEFAULT_DATE_MASK, size, disabled, inputRef, minDate = DEFAULT_MIN_DATE, maxDate = DEFAULT_MAX_DATE, isMondayFirst, isDoubleNavigationButtonsEnabled, hideHelperText = false, } = props;
|
|
13
|
+
return (_jsxs("div", { ref: ref, className: className, children: [_jsx(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 })), _jsx(DatePickerPopover, Object.assign({ placement: "bottom-start" }, datePickerProps, { children: _jsx(MinMaxDateContextProvider, { minDate: minDate, maxDate: maxDate, children: _jsxs(StyledPaper, { children: [_jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, pickerProps)), isMobile && (_jsx(ButtonWrapper, { children: _jsx(ConfirmButton, Object.assign({}, confirmButtonProps, { size: "large" })) }))] }) }) }))] }));
|
|
14
14
|
});
|
|
@@ -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
|
}, {}, {}>;
|
|
@@ -19,11 +19,11 @@ import { useLogic } from './useLogic';
|
|
|
19
19
|
const DEFAULT_SPACING = 1;
|
|
20
20
|
export const DateRangePicker = forwardRef((props, forwardedRef) => {
|
|
21
21
|
const { ref, startDatePickerInputProps, endDatePickerInputProps, popoverHoveredContextProviderProps, datePickerPopoverProps, minMaxDateContextProviderProps, startYearMonthDayPickerProps, endYearMonthDayPickerProps, } = useLogic(props, forwardedRef);
|
|
22
|
-
const { startDateProps = {}, endDateProps = {}, mask = DEFAULT_DATE_MASK, spacing = DEFAULT_SPACING, size, isMondayFirst, isDisabled, isError, helperText, isDoubleNavigationButtonsEnabled, } = props;
|
|
22
|
+
const { startDateProps = {}, endDateProps = {}, mask = DEFAULT_DATE_MASK, spacing = DEFAULT_SPACING, size, isMondayFirst, isDisabled, isError, helperText, isDoubleNavigationButtonsEnabled, hideHelperText = false, } = props;
|
|
23
23
|
const _a = startDateProps || {}, { inputProps: startDateInputProps } = _a, restStartDateProps = __rest(_a, ["inputProps"]);
|
|
24
24
|
const _b = endDateProps || {}, { inputProps: endDateInputProps } = _b, restEndDateProps = __rest(_b, ["inputProps"]);
|
|
25
|
-
return (_jsxs(Grid, { ref: ref, children: [_jsxs(Grid, { container: true, spacing: spacing, direction: "column", children: [_jsx(StyledDatePickerInput, Object.assign({}, startDateInputProps, restStartDateProps, {
|
|
25
|
+
return (_jsxs(Grid, { ref: ref, children: [_jsxs(Grid, { container: true, spacing: spacing, direction: "column", columns: "repeat(2, 1fr)", children: [_jsx(StyledDatePickerInput, Object.assign({}, startDateInputProps, restStartDateProps, {
|
|
26
26
|
// TODO Пропс margin=none пока не работает, поэтому стилизуем компонент
|
|
27
27
|
// https://track.astral.ru/soft/browse/UIKIT-1333
|
|
28
|
-
mask: mask, size: size, disabled: isDisabled, error: isError }, startDatePickerInputProps)), _jsx(StyledDatePickerInput, Object.assign({}, endDateInputProps, restEndDateProps, { size: size, mask: mask, disabled: isDisabled, error: isError }, endDatePickerInputProps))] }), _jsx(FormHelperText, { error: isError, children: helperText && helperText }), _jsx(PopoverHoveredContextProvider, Object.assign({}, popoverHoveredContextProviderProps, { children: _jsx(MinMaxDateContextProvider, Object.assign({}, minMaxDateContextProviderProps, { children: _jsx(DatePickerPopover, Object.assign({}, datePickerPopoverProps, { children: _jsxs(StyledPaper, { children: [_jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, startYearMonthDayPickerProps)), _jsx(PickerSplitter, {}), _jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, endYearMonthDayPickerProps))] }) })) })) }))] }));
|
|
28
|
+
mask: mask, size: size, disabled: isDisabled, error: isError }, startDatePickerInputProps)), _jsx(StyledDatePickerInput, Object.assign({}, endDateInputProps, restEndDateProps, { size: size, mask: mask, disabled: isDisabled, error: isError }, endDatePickerInputProps))] }), _jsx(FormHelperText, { error: isError, hideHelperText: hideHelperText, children: helperText && helperText }), _jsx(PopoverHoveredContextProvider, Object.assign({}, popoverHoveredContextProviderProps, { children: _jsx(MinMaxDateContextProvider, Object.assign({}, minMaxDateContextProviderProps, { children: _jsx(DatePickerPopover, Object.assign({}, datePickerPopoverProps, { children: _jsxs(StyledPaper, { children: [_jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, startYearMonthDayPickerProps)), _jsx(PickerSplitter, {}), _jsx(YearMonthDayPicker, Object.assign({ isMondayFirst: isMondayFirst, isDoubleNavigationButtonsEnabled: isDoubleNavigationButtonsEnabled }, endYearMonthDayPickerProps))] }) })) })) }))] }));
|
|
29
29
|
});
|
|
@@ -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;
|
|
@@ -13,6 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import { FormHelperText as MuiFormHelperText, } from '@mui/material';
|
|
14
14
|
import { FormHelperTextContent } from './FormHelperTextContent';
|
|
15
15
|
export const FormHelperText = (_a) => {
|
|
16
|
-
var { children, success, error } = _a, props = __rest(_a, ["children", "success", "error"]);
|
|
16
|
+
var { children, success, error, hideHelperText = false } = _a, props = __rest(_a, ["children", "success", "error", "hideHelperText"]);
|
|
17
|
+
if (hideHelperText && !children) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
17
20
|
return (_jsx(MuiFormHelperText, Object.assign({}, props, { children: _jsx(FormHelperTextContent, { error: error, success: success, children: children }) })));
|
|
18
21
|
};
|
|
@@ -16,7 +16,7 @@ export const PageSubheader = styled.div `
|
|
|
16
16
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
17
17
|
|
|
18
18
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
19
|
-
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
19
|
+
padding: ${({ theme }) => theme.spacing(0, 4, 4, 4)};
|
|
20
20
|
}
|
|
21
21
|
`;
|
|
22
22
|
export const DesktopTitleWrapper = styled.div `
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { classNames } from '../../utils';
|
|
4
4
|
import { pageLayoutClassnames } from './constants';
|
|
5
|
-
import { Wrapper } from './styles';
|
|
5
|
+
import { StylePaper, Wrapper } from './styles';
|
|
6
6
|
export const PageLayoutContainer = forwardRef(({ children, className }, forwardedRef) => {
|
|
7
|
-
return (_jsx(Wrapper, { className: classNames(className, pageLayoutClassnames.root), ref: forwardedRef, children: children }));
|
|
7
|
+
return (_jsx(StylePaper, { variant: "outlined", children: _jsx(Wrapper, { className: classNames(className, pageLayoutClassnames.root), ref: forwardedRef, children: children }) }));
|
|
8
8
|
});
|
|
@@ -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,3 +1,4 @@
|
|
|
1
|
+
import { Paper } from '../../Paper';
|
|
1
2
|
import { styled } from '../../styles';
|
|
2
3
|
export const Wrapper = styled.div `
|
|
3
4
|
display: grid;
|
|
@@ -11,8 +12,6 @@ export const Wrapper = styled.div `
|
|
|
11
12
|
padding-top: ${({ theme }) => theme.spacing(4)};
|
|
12
13
|
|
|
13
14
|
background-color: ${({ theme }) => theme.palette.common.white};
|
|
14
|
-
border: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
15
|
-
border-radius: ${({ theme }) => theme.shape.medium};
|
|
16
15
|
|
|
17
16
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
18
17
|
scroll-behavior: smooth;
|
|
@@ -29,3 +28,10 @@ export const Wrapper = styled.div `
|
|
|
29
28
|
border: unset;
|
|
30
29
|
}
|
|
31
30
|
`;
|
|
31
|
+
export const StylePaper = styled(Paper) `
|
|
32
|
+
height: 100%;
|
|
33
|
+
|
|
34
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
35
|
+
border: unset;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
@@ -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,5 +1,17 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
export const Paper = (
|
|
4
|
-
|
|
13
|
+
import { StyledPaper } from './styles';
|
|
14
|
+
export const Paper = (_a) => {
|
|
15
|
+
var { shape = 'medium' } = _a, restProps = __rest(_a, ["shape"]);
|
|
16
|
+
return _jsx(StyledPaper, Object.assign({ "$shape": shape }, restProps));
|
|
5
17
|
};
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { Paper } from '@mui/material';
|
|
2
|
+
import { styled } from '../styles';
|
|
3
|
+
export const StyledPaper = styled(Paper, {
|
|
4
|
+
shouldForwardProp: (prop) => !['$shape'].includes(prop),
|
|
5
|
+
}) `
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
border-radius: ${({ theme, $shape }) => theme.shape[$shape]};
|
|
9
|
+
`;
|
|
@@ -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
|
/**
|
|
@@ -49,6 +49,6 @@ const SelectInner = (_a, ref) => {
|
|
|
49
49
|
}
|
|
50
50
|
return findMenuItemsLabel(children, selectedOptions);
|
|
51
51
|
};
|
|
52
|
-
return (_jsxs(FormControl, { error: error, fullWidth: fullWidth, children: [label && (_jsx(InputLabel, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), _jsxs(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: _jsxs(EndAdornmentWrapper, { children: [isShowingClearButton && (_jsx(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), _jsx(IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? _jsx(DownOutlineMd, {}) : _jsx(UpOutlineMd, {}) })] }), children: [_jsx(Placeholder, { value: "", children: placeholder }), loading && (_jsx(StateWrapper, { children: _jsx(Loader, {}) })), !loading && isShowingSelectAll && (_jsxs(MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: SELECT_ALL_VALUE, children: [_jsx(ListItemIcon, { children: _jsx(Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && _jsx(StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] })),
|
|
52
|
+
return (_jsxs(FormControl, { error: error, fullWidth: fullWidth, children: [label && (_jsx(InputLabel, { htmlFor: "grouped-select", required: required, disabled: disabled, children: label })), _jsxs(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: _jsxs(EndAdornmentWrapper, { children: [isShowingClearButton && (_jsx(ClearButton, { disabled: disabled, ref: resetButtonRef, onClick: onClearAll })), _jsx(IconButton, { variant: "text", disabled: disabled, onClick: openSelect, children: !isOpened ? _jsx(DownOutlineMd, {}) : _jsx(UpOutlineMd, {}) })] }), children: [_jsx(Placeholder, { value: "", children: placeholder }), loading && (_jsx(StateWrapper, { children: _jsx(Loader, {}) })), !loading && isShowingSelectAll && (_jsxs(MenuItem, { className: selectAllClassName, selected: isSelectedAll, value: SELECT_ALL_VALUE, children: [_jsx(ListItemIcon, { children: _jsx(Checkbox, { checked: isSelectedAll, indeterminate: isIndeterminate }) }), "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435"] })), !loading && children, !loading && isNoData && _jsx(StateWrapper, { children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445" })] })), _jsx(FormHelperText, { error: error, success: success, hideHelperText: hideHelperText, children: helperText })] }));
|
|
53
53
|
};
|
|
54
54
|
export const Select = forwardRefWithGeneric(SelectInner);
|
|
@@ -23,7 +23,7 @@ export const StyledSelect = styled(Select, {
|
|
|
23
23
|
}) `
|
|
24
24
|
padding-right: ${({ theme }) => theme.spacing(2)};
|
|
25
25
|
|
|
26
|
-
color: ${({ $isShowingPlaceholder, theme }) => $isShowingPlaceholder ? theme.palette.grey[
|
|
26
|
+
color: ${({ $isShowingPlaceholder, theme }) => $isShowingPlaceholder ? theme.palette.grey[500] : 'unset'};
|
|
27
27
|
|
|
28
28
|
.MuiSelect-select.MuiSelect-outlined {
|
|
29
29
|
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>>;
|
|
@@ -10,11 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { TextField as MuiTextField, } from '@mui/material';
|
|
14
13
|
import { forwardRef, useMemo } from 'react';
|
|
15
14
|
import { FormHelperTextContent } from '../FormHelperText';
|
|
15
|
+
import { classNames } from '../utils';
|
|
16
|
+
import { textFieldClassnames } from './constants';
|
|
17
|
+
import { StyledTextField } from './styles';
|
|
16
18
|
export const TextField = forwardRef((_a, ref) => {
|
|
17
|
-
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"]);
|
|
19
|
+
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"]);
|
|
18
20
|
const color = useMemo(() => {
|
|
19
21
|
if (success) {
|
|
20
22
|
return 'success';
|
|
@@ -45,6 +47,9 @@ export const TextField = forwardRef((_a, ref) => {
|
|
|
45
47
|
}
|
|
46
48
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
47
49
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
const classes = useMemo(() => {
|
|
51
|
+
return classNames(className, hideHelperText ? textFieldClassnames.hideHelperText : '');
|
|
52
|
+
}, [className, hideHelperText]);
|
|
53
|
+
return (_jsx(StyledTextField, Object.assign({ ref: ref, variant: "outlined", fullWidth: fullWidth, error: error, color: color, helperText: helperText, InputProps: Object.assign({ startAdornment,
|
|
54
|
+
endAdornment }, InputProps), inputProps: Object.assign({ maxLength }, inputProps), onBlur: handleBlur, className: classes }, props)));
|
|
50
55
|
});
|
|
@@ -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,16 @@
|
|
|
1
|
+
import { formHelperTextClasses, TextField } from '@mui/material';
|
|
2
|
+
import { styled } from '../styles';
|
|
3
|
+
import { textFieldClassnames } from './constants';
|
|
4
|
+
export const StyledTextField = styled(TextField) `
|
|
5
|
+
&.${textFieldClassnames.hideHelperText}{
|
|
6
|
+
|
|
7
|
+
.${formHelperTextClasses.root}.${formHelperTextClasses.contained} {
|
|
8
|
+
min-height: 0;
|
|
9
|
+
margin: 0;
|
|
10
|
+
|
|
11
|
+
&:not(:empty) {
|
|
12
|
+
margin: ${({ theme }) => theme.spacing(1, 0, 0)};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { Button } from '../../Button';
|
|
14
14
|
import { Dialog } from '../../Dialog';
|
|
15
15
|
import { DialogActions } from '../../DialogActions';
|
|
16
|
-
import {
|
|
16
|
+
import { Paper } from '../../Paper';
|
|
17
17
|
import { SearchField } from '../../SearchField';
|
|
18
18
|
import { TreeList } from '../../Tree';
|
|
19
19
|
import { ErrorMessage } from './ErrorMessage';
|
|
@@ -36,5 +36,5 @@ export const OptionsModal = (props) => {
|
|
|
36
36
|
}
|
|
37
37
|
return _jsx(TreeList, Object.assign({}, treeProps, treeListProps));
|
|
38
38
|
};
|
|
39
|
-
return (_jsxs(Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), _jsx(
|
|
39
|
+
return (_jsxs(Dialog, Object.assign({}, externalDialogProps, { disableRestoreFocus: true, open: isOpen }, modalProps, { children: [_jsxs(StyledDialogContent, { children: [_jsx(SearchField, Object.assign({ fullWidth: true }, searchFieldProps)), _jsx(Paper, { variant: "outlined", children: _jsx(TreeListWrapper, { children: renderComponent() }) })] }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ variant: "text" }, cancelButtonProps, { children: "\u041E\u0442\u043C\u0435\u043D\u0430" })), _jsx(Button, Object.assign({}, confirmButtonProps, { children: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C" }))] })] })));
|
|
40
40
|
};
|