Skip to content

Commit b273f4b

Browse files
committed
modal buttton props
1 parent 67e22b5 commit b273f4b

File tree

9 files changed

+28
-10
lines changed

9 files changed

+28
-10
lines changed

dist/components/Modal/ModalProps.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,21 @@ export interface ModalSubscribeOnChangeOptions {
1919
interface ModalConfig extends AntModalProps {
2020
type?: 'save' | 'select' | 'view';
2121
/** Запрос для автоматического сохранения формы */
22-
requestSaveForm?: Request;
22+
requestSaveForm?: Request | any;
2323
/** HTTP Метод, передаваемый в запрос сохранения */
2424
methodSaveForm?: string;
2525
/** Пропсы формы.
2626
* Если верстка через конфиги, то пропс body обязателен */
2727
form?: FormProps;
2828
}
29+
interface ModalButtonProps extends ButtonProps {
30+
label?: string;
31+
}
2932
export interface ModalProps extends Omit<StoreProps, 'subscribe'> {
3033
/** Свойства [Button](https://ant.design/components/button/) из Ant Design
3134
*
3235
* Добавлено свойство `label` с типом `ReactNode` или `string` для формирования контента кнопки*/
33-
buttonProps?: ButtonProps;
36+
buttonProps?: ModalButtonProps;
3437
/** Объект модального окна. Стандартная конфигурация. */
3538
modalConfig?: ModalConfig;
3639
/** Данные для модального окна */

dist/components/core/interfaces.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ReactNode } from "react";
22
export declare type RequestOptions = {
33
params: any;
44
data: any;
5+
method?: any;
56
};
67
export declare type Request = (options: RequestOptions) => Promise<any>;
78
export declare type OptionItem = {

dist/components/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { SelectProps } from "./Select";
3030
import { TreeSelectProps } from "./TreeSelect";
3131
import { TimePickerProps } from "./DatePicker/DatePicker";
3232
import { UploadFileProps } from "./UploadFile";
33+
import { DrawerProps } from "antd/lib/drawer";
3334
import { CollapseProps, CollapsePanelProps } from "antd/lib/collapse";
3435
import { ListProps } from "antd/lib/list";
3536
import { PopoverProps } from "antd/lib/popover";
@@ -73,6 +74,7 @@ export declare const Select: FunctionComponent<SelectProps>;
7374
export declare const TreeSelect: FunctionComponent<TreeSelectProps>;
7475
export declare const TimePicker: FunctionComponent<TimePickerProps & StoreProps>;
7576
export declare const UploadFile: FunctionComponent<UploadFileProps>;
77+
export declare const Drawer: FunctionComponent<DrawerProps>;
7678
export declare const Collapse: FunctionComponent<CollapseProps & StoreProps>;
7779
export declare const CollapsePanel: FunctionComponent<CollapsePanelProps & StoreProps>;
7880
export declare const List: FunctionComponent<ListProps<any>>;
@@ -87,4 +89,4 @@ export declare const Modal: FunctionComponent<ModalProps>;
8789
export declare const Custom: FunctionComponent<CustomProps>;
8890
export declare const Switcher: FunctionComponent<SwitcherProps>;
8991
export declare const Dashboard: FunctionComponent<DashboardProps>;
90-
export type { LabelProps, StoreProps, CustomProps, SwitcherProps, SubscribeOnChangeOptions, ModalSubscribeOnChangeOptions, TablesSubscribeOnChangeOptions, sortBy, ButtonProps, TitleProps, TextProps, DatePickerProps, DividerProps, RowProps, ColProps, LayoutProps, SpaceProps, CheckboxProps, FormProps, FormHeaderProps, FormBodyProps, FormFooterProps, FormListProps, InputNumberProps, InputProps, SearchProps, TextAreaProps, PasswordProps, RadioProps, RadioGroupProps, SwitchProps, SliderSingleProps, SliderRangeProps, SelectProps, TreeSelectProps, TimePickerProps, UploadFileProps, CollapseProps, CollapsePanelProps, ListProps, PopoverProps, TooltipProps, TabsProps, TabPaneProps, TableProps, ModalProps };
92+
export type { LabelProps, StoreProps, CustomProps, SwitcherProps, SubscribeOnChangeOptions, ModalSubscribeOnChangeOptions, TablesSubscribeOnChangeOptions, sortBy, ButtonProps, TitleProps, TextProps, DatePickerProps, DividerProps, RowProps, ColProps, LayoutProps, SpaceProps, CheckboxProps, FormProps, FormHeaderProps, FormBodyProps, FormFooterProps, FormListProps, InputNumberProps, InputProps, SearchProps, TextAreaProps, PasswordProps, RadioProps, RadioGroupProps, SwitchProps, SliderSingleProps, SliderRangeProps, SelectProps, TreeSelectProps, TimePickerProps, UploadFileProps, DrawerProps, CollapseProps, CollapsePanelProps, ListProps, PopoverProps, TooltipProps, TabsProps, TabPaneProps, TableProps, ModalProps };

dist/index.es.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Modal/ModalProps.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { StoreProps } from "../core/wrappers";
22
import { ButtonProps, ModalProps as AntModalProps } from "antd";
3-
import { Request } from "../core/interfaces";
3+
import { Request, RequestOptions } from "../core/interfaces";
44
import { FormProps } from "../Form/FormProps";
55

66
export interface ModalSubscribeOnChangeOptions {
@@ -22,7 +22,7 @@ interface ModalConfig extends AntModalProps{
2222
type?: 'save' | 'select' | 'view';
2323

2424
/** Запрос для автоматического сохранения формы */
25-
requestSaveForm?: Request;
25+
requestSaveForm?: Request | any;
2626

2727
/** HTTP Метод, передаваемый в запрос сохранения */
2828
methodSaveForm?: string;
@@ -32,11 +32,15 @@ interface ModalConfig extends AntModalProps{
3232
form?: FormProps
3333
}
3434

35+
interface ModalButtonProps extends ButtonProps{
36+
label?: string
37+
}
38+
3539
export interface ModalProps extends Omit<StoreProps, 'subscribe'> {
3640
/** Свойства [Button](https://ant.design/components/button/) из Ant Design
3741
*
3842
* Добавлено свойство `label` с типом `ReactNode` или `string` для формирования контента кнопки*/
39-
buttonProps?: ButtonProps;
43+
buttonProps?: ModalButtonProps;
4044

4145
/** Объект модального окна. Стандартная конфигурация. */
4246
modalConfig?: ModalConfig,

src/components/core/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ReactNode } from "react";
22

3-
export type RequestOptions = { params: any; data: any; }
3+
export type RequestOptions = { params: any; data: any; method?:any}
44

55
export type Request = (options: RequestOptions) => Promise<any>;
66

0 commit comments

Comments
 (0)