@astral/ui 4.94.0 → 4.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hook-form/FormPageLayout/FormPageFooter/FormPageFooter.d.ts +5 -0
- package/hook-form/FormPageLayout/FormPageFooter/FormPageFooter.js +2 -2
- package/hook-form/FormPageLayout/FormPageLayout.d.ts +1 -25
- package/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/hook-form/FormPageLayout/index.d.ts +1 -0
- package/hook-form/FormPageLayout/public.d.ts +1 -0
- package/hook-form/FormPageLayout/types.d.ts +31 -0
- package/hook-form/FormPageLayout/types.js +1 -0
- package/node/hook-form/FormPageLayout/FormPageFooter/FormPageFooter.d.ts +5 -0
- package/node/hook-form/FormPageLayout/FormPageFooter/FormPageFooter.js +2 -2
- package/node/hook-form/FormPageLayout/FormPageLayout.d.ts +1 -25
- package/node/hook-form/FormPageLayout/FormPageLayout.js +2 -2
- package/node/hook-form/FormPageLayout/index.d.ts +1 -0
- package/node/hook-form/FormPageLayout/public.d.ts +1 -0
- package/node/hook-form/FormPageLayout/types.d.ts +31 -0
- package/node/hook-form/FormPageLayout/types.js +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SecondaryAction } from '../../FormPageLayoutBase';
|
|
2
|
+
import { type FormPageLayoutSubmitButtonProps } from '../types';
|
|
2
3
|
export type FormFooterProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Если true, кнопки будут недоступны для взаимодействия
|
|
@@ -13,5 +14,9 @@ export type FormFooterProps = {
|
|
|
13
14
|
* @default 'Отправить'
|
|
14
15
|
*/
|
|
15
16
|
submitButtonText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Параметры для кнопки отправки формы
|
|
19
|
+
*/
|
|
20
|
+
submitButtonProps?: FormPageLayoutSubmitButtonProps;
|
|
16
21
|
};
|
|
17
22
|
export declare const FormPageFooter: (props: FormFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,9 +4,9 @@ import { useFormFooter } from './hooks';
|
|
|
4
4
|
import { SecondaryActions } from './SecondaryActions';
|
|
5
5
|
import { ActionsWrapper, ShowMoreButton, StyledFormSubmitButton, } from './styles';
|
|
6
6
|
export const FormPageFooter = (props) => {
|
|
7
|
-
const { isDisabled, submitButtonText = 'Отправить', secondaryActions, } = props;
|
|
7
|
+
const { isDisabled, submitButtonText = 'Отправить', secondaryActions, submitButtonProps, } = props;
|
|
8
8
|
const { isActive, handleToggle, isShowMoreButton } = useFormFooter({
|
|
9
9
|
secondaryActions,
|
|
10
10
|
});
|
|
11
|
-
return (_jsxs(FormPageFooterContainer, { children: [_jsxs(ActionsWrapper, { "$isShowMoreButton": isShowMoreButton, children: [_jsx(StyledFormSubmitButton, { size: "large", disabled: isDisabled, children: submitButtonText }), secondaryActions && (_jsx(SecondaryActions, { isDisabled: isDisabled, actions: secondaryActions, isActive: isActive }))] }), isShowMoreButton && (_jsxs(ShowMoreButton, { disabled: isDisabled, variant: "text", onClick: handleToggle, "$isActive": isActive, children: [isActive ? 'Скрыть' : 'Показать', " \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F"] }))] }));
|
|
11
|
+
return (_jsxs(FormPageFooterContainer, { children: [_jsxs(ActionsWrapper, { "$isShowMoreButton": isShowMoreButton, children: [_jsx(StyledFormSubmitButton, { size: "large", disabled: isDisabled, ...submitButtonProps, children: submitButtonText }), secondaryActions && (_jsx(SecondaryActions, { isDisabled: isDisabled, actions: secondaryActions, isActive: isActive }))] }), isShowMoreButton && (_jsxs(ShowMoreButton, { disabled: isDisabled, variant: "text", onClick: handleToggle, "$isActive": isActive, children: [isActive ? 'Скрыть' : 'Показать', " \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F"] }))] }));
|
|
12
12
|
};
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type PageLayoutProps } from '../../components/PageLayout';
|
|
3
|
-
import { type FormProps } from '../Form';
|
|
4
|
-
import type { SecondaryAction } from '../FormPageLayoutBase';
|
|
5
|
-
type FormPageProps<TFormValues extends Record<string, unknown>> = Omit<FormProps<TFormValues>, 'children'> & {
|
|
6
|
-
/**
|
|
7
|
-
* Текст для кнопки отправки формы
|
|
8
|
-
*/
|
|
9
|
-
submitButtonText?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Дополнительные кнопки формы
|
|
12
|
-
*/
|
|
13
|
-
secondaryActions?: SecondaryAction[];
|
|
14
|
-
};
|
|
15
|
-
export type FormPageLayoutProps<TFormValues extends Record<string, unknown>> = Omit<PageLayoutProps, 'content'> & {
|
|
16
|
-
/**
|
|
17
|
-
* Содержимое формы
|
|
18
|
-
*/
|
|
19
|
-
children: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* Параметры страницы формы
|
|
22
|
-
*/
|
|
23
|
-
form: FormPageProps<TFormValues>;
|
|
24
|
-
};
|
|
1
|
+
import { type FormPageLayoutProps } from './types';
|
|
25
2
|
/**
|
|
26
3
|
* FormPageLayout предназначен для построения страниц с формами.
|
|
27
4
|
*/
|
|
28
5
|
export declare const FormPageLayout: <TFormValues extends Record<string, unknown>>(props: FormPageLayoutProps<TFormValues>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export {};
|
|
@@ -9,8 +9,8 @@ import { FormContent } from './styles';
|
|
|
9
9
|
*/
|
|
10
10
|
export const FormPageLayout = (props) => {
|
|
11
11
|
const { form, children, ...restProps } = props;
|
|
12
|
-
const { secondaryActions, submitButtonText, ...restFormProps } = form;
|
|
12
|
+
const { secondaryActions, submitButtonText, submitButtonProps, ...restFormProps } = form;
|
|
13
13
|
return (_jsx(FormPageLayoutBase, { ...restProps, formProps: { ...form, secondaryActions }, contentClassname: cn({
|
|
14
14
|
[formPageContentClassnames.formPageContentSecondaryActions]: Boolean(secondaryActions),
|
|
15
|
-
}), children: ({ isDisabled }) => (_jsxs(Form, { ...restFormProps, isDisabled: isDisabled, children: [_jsx(FormContent, { children: children }), _jsx(FormPageFooter, { isDisabled: isDisabled, submitButtonText: submitButtonText, secondaryActions: secondaryActions })] })) }));
|
|
15
|
+
}), children: ({ isDisabled }) => (_jsxs(Form, { ...restFormProps, isDisabled: isDisabled, children: [_jsx(FormContent, { children: children }), _jsx(FormPageFooter, { isDisabled: isDisabled, submitButtonText: submitButtonText, secondaryActions: secondaryActions, submitButtonProps: submitButtonProps })] })) }));
|
|
16
16
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type PageLayoutProps } from '../../components/PageLayout';
|
|
3
|
+
import { type FormProps } from '../Form';
|
|
4
|
+
import { type SecondaryAction } from '../FormPageLayoutBase';
|
|
5
|
+
import { type FormSubmitButtonProps } from '../FormSubmitButton';
|
|
6
|
+
export type FormPageLayoutSubmitButtonProps = Pick<FormSubmitButtonProps, 'color' | 'startIcon' | 'endIcon'>;
|
|
7
|
+
type FormPageProps<TFormValues extends Record<string, unknown>> = Omit<FormProps<TFormValues>, 'children'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Параметры для кнопки отправки формы
|
|
10
|
+
*/
|
|
11
|
+
submitButtonProps?: FormPageLayoutSubmitButtonProps;
|
|
12
|
+
/**
|
|
13
|
+
* Текст для кнопки отправки формы
|
|
14
|
+
*/
|
|
15
|
+
submitButtonText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Дополнительные кнопки формы
|
|
18
|
+
*/
|
|
19
|
+
secondaryActions?: SecondaryAction[];
|
|
20
|
+
};
|
|
21
|
+
export type FormPageLayoutProps<TFormValues extends Record<string, unknown>> = Omit<PageLayoutProps, 'content'> & {
|
|
22
|
+
/**
|
|
23
|
+
* Содержимое формы
|
|
24
|
+
*/
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Параметры страницы формы
|
|
28
|
+
*/
|
|
29
|
+
form: FormPageProps<TFormValues>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SecondaryAction } from '../../FormPageLayoutBase';
|
|
2
|
+
import { type FormPageLayoutSubmitButtonProps } from '../types';
|
|
2
3
|
export type FormFooterProps = {
|
|
3
4
|
/**
|
|
4
5
|
* Если true, кнопки будут недоступны для взаимодействия
|
|
@@ -13,5 +14,9 @@ export type FormFooterProps = {
|
|
|
13
14
|
* @default 'Отправить'
|
|
14
15
|
*/
|
|
15
16
|
submitButtonText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Параметры для кнопки отправки формы
|
|
19
|
+
*/
|
|
20
|
+
submitButtonProps?: FormPageLayoutSubmitButtonProps;
|
|
16
21
|
};
|
|
17
22
|
export declare const FormPageFooter: (props: FormFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,10 +7,10 @@ const hooks_1 = require("./hooks");
|
|
|
7
7
|
const SecondaryActions_1 = require("./SecondaryActions");
|
|
8
8
|
const styles_1 = require("./styles");
|
|
9
9
|
const FormPageFooter = (props) => {
|
|
10
|
-
const { isDisabled, submitButtonText = 'Отправить', secondaryActions, } = props;
|
|
10
|
+
const { isDisabled, submitButtonText = 'Отправить', secondaryActions, submitButtonProps, } = props;
|
|
11
11
|
const { isActive, handleToggle, isShowMoreButton } = (0, hooks_1.useFormFooter)({
|
|
12
12
|
secondaryActions,
|
|
13
13
|
});
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)(FormPageFooterContainer_1.FormPageFooterContainer, { children: [(0, jsx_runtime_1.jsxs)(styles_1.ActionsWrapper, { "$isShowMoreButton": isShowMoreButton, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledFormSubmitButton, { size: "large", disabled: isDisabled, children: submitButtonText }), secondaryActions && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: isDisabled, actions: secondaryActions, isActive: isActive }))] }), isShowMoreButton && ((0, jsx_runtime_1.jsxs)(styles_1.ShowMoreButton, { disabled: isDisabled, variant: "text", onClick: handleToggle, "$isActive": isActive, children: [isActive ? 'Скрыть' : 'Показать', " \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F"] }))] }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)(FormPageFooterContainer_1.FormPageFooterContainer, { children: [(0, jsx_runtime_1.jsxs)(styles_1.ActionsWrapper, { "$isShowMoreButton": isShowMoreButton, children: [(0, jsx_runtime_1.jsx)(styles_1.StyledFormSubmitButton, { size: "large", disabled: isDisabled, ...submitButtonProps, children: submitButtonText }), secondaryActions && ((0, jsx_runtime_1.jsx)(SecondaryActions_1.SecondaryActions, { isDisabled: isDisabled, actions: secondaryActions, isActive: isActive }))] }), isShowMoreButton && ((0, jsx_runtime_1.jsxs)(styles_1.ShowMoreButton, { disabled: isDisabled, variant: "text", onClick: handleToggle, "$isActive": isActive, children: [isActive ? 'Скрыть' : 'Показать', " \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F"] }))] }));
|
|
15
15
|
};
|
|
16
16
|
exports.FormPageFooter = FormPageFooter;
|
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type PageLayoutProps } from '../../components/PageLayout';
|
|
3
|
-
import { type FormProps } from '../Form';
|
|
4
|
-
import type { SecondaryAction } from '../FormPageLayoutBase';
|
|
5
|
-
type FormPageProps<TFormValues extends Record<string, unknown>> = Omit<FormProps<TFormValues>, 'children'> & {
|
|
6
|
-
/**
|
|
7
|
-
* Текст для кнопки отправки формы
|
|
8
|
-
*/
|
|
9
|
-
submitButtonText?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Дополнительные кнопки формы
|
|
12
|
-
*/
|
|
13
|
-
secondaryActions?: SecondaryAction[];
|
|
14
|
-
};
|
|
15
|
-
export type FormPageLayoutProps<TFormValues extends Record<string, unknown>> = Omit<PageLayoutProps, 'content'> & {
|
|
16
|
-
/**
|
|
17
|
-
* Содержимое формы
|
|
18
|
-
*/
|
|
19
|
-
children: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* Параметры страницы формы
|
|
22
|
-
*/
|
|
23
|
-
form: FormPageProps<TFormValues>;
|
|
24
|
-
};
|
|
1
|
+
import { type FormPageLayoutProps } from './types';
|
|
25
2
|
/**
|
|
26
3
|
* FormPageLayout предназначен для построения страниц с формами.
|
|
27
4
|
*/
|
|
28
5
|
export declare const FormPageLayout: <TFormValues extends Record<string, unknown>>(props: FormPageLayoutProps<TFormValues>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export {};
|
|
@@ -12,9 +12,9 @@ const styles_1 = require("./styles");
|
|
|
12
12
|
*/
|
|
13
13
|
const FormPageLayout = (props) => {
|
|
14
14
|
const { form, children, ...restProps } = props;
|
|
15
|
-
const { secondaryActions, submitButtonText, ...restFormProps } = form;
|
|
15
|
+
const { secondaryActions, submitButtonText, submitButtonProps, ...restFormProps } = form;
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)(FormPageLayoutBase_1.FormPageLayoutBase, { ...restProps, formProps: { ...form, secondaryActions }, contentClassname: (0, cn_1.cn)({
|
|
17
17
|
[FormPageLayoutBase_1.formPageContentClassnames.formPageContentSecondaryActions]: Boolean(secondaryActions),
|
|
18
|
-
}), children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(Form_1.Form, { ...restFormProps, isDisabled: isDisabled, children: [(0, jsx_runtime_1.jsx)(styles_1.FormContent, { children: children }), (0, jsx_runtime_1.jsx)(FormPageFooter_1.FormPageFooter, { isDisabled: isDisabled, submitButtonText: submitButtonText, secondaryActions: secondaryActions })] })) }));
|
|
18
|
+
}), children: ({ isDisabled }) => ((0, jsx_runtime_1.jsxs)(Form_1.Form, { ...restFormProps, isDisabled: isDisabled, children: [(0, jsx_runtime_1.jsx)(styles_1.FormContent, { children: children }), (0, jsx_runtime_1.jsx)(FormPageFooter_1.FormPageFooter, { isDisabled: isDisabled, submitButtonText: submitButtonText, secondaryActions: secondaryActions, submitButtonProps: submitButtonProps })] })) }));
|
|
19
19
|
};
|
|
20
20
|
exports.FormPageLayout = FormPageLayout;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type PageLayoutProps } from '../../components/PageLayout';
|
|
3
|
+
import { type FormProps } from '../Form';
|
|
4
|
+
import { type SecondaryAction } from '../FormPageLayoutBase';
|
|
5
|
+
import { type FormSubmitButtonProps } from '../FormSubmitButton';
|
|
6
|
+
export type FormPageLayoutSubmitButtonProps = Pick<FormSubmitButtonProps, 'color' | 'startIcon' | 'endIcon'>;
|
|
7
|
+
type FormPageProps<TFormValues extends Record<string, unknown>> = Omit<FormProps<TFormValues>, 'children'> & {
|
|
8
|
+
/**
|
|
9
|
+
* Параметры для кнопки отправки формы
|
|
10
|
+
*/
|
|
11
|
+
submitButtonProps?: FormPageLayoutSubmitButtonProps;
|
|
12
|
+
/**
|
|
13
|
+
* Текст для кнопки отправки формы
|
|
14
|
+
*/
|
|
15
|
+
submitButtonText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Дополнительные кнопки формы
|
|
18
|
+
*/
|
|
19
|
+
secondaryActions?: SecondaryAction[];
|
|
20
|
+
};
|
|
21
|
+
export type FormPageLayoutProps<TFormValues extends Record<string, unknown>> = Omit<PageLayoutProps, 'content'> & {
|
|
22
|
+
/**
|
|
23
|
+
* Содержимое формы
|
|
24
|
+
*/
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* Параметры страницы формы
|
|
28
|
+
*/
|
|
29
|
+
form: FormPageProps<TFormValues>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|