Skip to content

Commit e27eb38

Browse files
Merge pull request #15 from iron-tech-space/changesByMarsel
Add few changes
2 parents 0203aaf + 1f8ac81 commit e27eb38

File tree

17 files changed

+89
-53
lines changed

17 files changed

+89
-53
lines changed

dist/components/Modal/ModalProps.d.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@ export interface ModalSubscribeOnChangeOptions {
1616
/** Функция закрытия модалки */
1717
closeModal: () => void;
1818
}
19+
interface ModalConfig extends AntModalProps {
20+
type?: 'save' | 'select' | 'view';
21+
/** Запрос для автоматического сохранения формы */
22+
requestSaveForm?: Request | any;
23+
/** HTTP Метод, передаваемый в запрос сохранения */
24+
methodSaveForm?: string;
25+
/** Пропсы формы.
26+
* Если верстка через конфиги, то пропс body обязателен */
27+
form?: FormProps;
28+
}
29+
interface ModalButtonProps extends ButtonProps {
30+
label?: string;
31+
}
1932
export interface ModalProps extends Omit<StoreProps, 'subscribe'> {
2033
/** Свойства [Button](https://ant.design/components/button/) из Ant Design
2134
*
2235
* Добавлено свойство `label` с типом `ReactNode` или `string` для формирования контента кнопки*/
23-
buttonProps?: ButtonProps;
36+
buttonProps?: ModalButtonProps;
2437
/** Объект модального окна. Стандартная конфигурация. */
25-
modalConfig?: {
26-
/** Тип модального окна */
27-
type?: 'save' | 'select' | 'view';
28-
/** Запрос для автоматического сохранения формы */
29-
requestSaveForm?: Request;
30-
/** HTTP Метод, передаваемый в запрос сохранения */
31-
methodSaveForm?: string;
32-
/** Пропсы формы.
33-
* Если верстка через конфиги, то пропс body обязателен */
34-
form?: FormProps;
35-
};
38+
modalConfig?: ModalConfig;
3639
/** Данные для модального окна */
3740
modalData?: AntModalProps;
3841
/** Объект для подписки на изменения в STORE.
@@ -57,3 +60,4 @@ export interface ModalProps extends Omit<StoreProps, 'subscribe'> {
5760
onChange: (params: ModalSubscribeOnChangeOptions) => void;
5861
}[];
5962
}
63+
export {};

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.

dist/index.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import '~react-base-table/styles.css';
2-
@import '../node_modules/react-grid-layout/css/styles.css';
3-
@import '../node_modules/react-resizable/css/styles.css';
2+
@import '~react-grid-layout/css/styles.css';
3+
@import '~react-resizable/css/styles.css';
44
//@import '~antd/dist/antd';
55

66
@import '../lib/components/utils/variables';

lib/components/Dashboard/Dashboard.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,13 @@ var Dashboard = function Dashboard(props) {
7676
var id = props.id,
7777
requestLoadConfig = props.requestLoadConfig;
7878

79-
var _useState = useState({
80-
title: '',
81-
panels: []
82-
}),
79+
var _useState = useState(props.dashboard),
8380
_useState2 = _slicedToArray(_useState, 2),
8481
dashboard = _useState2[0],
8582
setDashboard = _useState2[1];
8683

8784
useEffect(function () {
88-
requestLoadConfig({
85+
requestLoadConfig && requestLoadConfig({
8986
data: { id: id },
9087
params: {}
9188
}).then(function (res) {

lib/components/Dashboard/DashboardProps.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface DashboardProps {
1818
// panels: DashboardPanelProps[] | undefined;
1919
id: string;
2020
requestLoadConfig: Request;
21+
dashboard: any,
2122
}
2223

2324
export interface LogsPanelProps {

0 commit comments

Comments
 (0)