@topthink/components 1.0.57 → 1.0.59
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/es/editor-widget-CQ3zv-Xu.js +355 -0
- package/es/{image-zoom-912e2b3b.js → image-zoom-OrIPGqh0.js} +0 -1
- package/es/index-PGfJO0Bp.js +39 -0
- package/es/index-PvFKqXZL.js +1 -0
- package/es/{index-6ae8237d.js → index-XkUorbN_.js} +13 -14
- package/es/index.js +1 -2
- package/es/{steps-afba29a7.js → steps-b_BcYIwk.js} +1 -2
- package/package.json +20 -18
- package/types/components/button.d.ts +9 -9
- package/types/components/card.d.ts +7 -7
- package/types/components/dimmer.d.ts +7 -7
- package/types/components/error.d.ts +5 -5
- package/types/components/form.d.ts +4 -4
- package/types/components/image-zoom.d.ts +4 -4
- package/types/components/lazy/{form.d.ts → form/index.d.ts} +19 -19
- package/types/components/lazy/form/widgets/editor-widget.d.ts +6 -0
- package/types/components/lazy/image-zoom.d.ts +3 -3
- package/types/components/lazy/steps.d.ts +9 -9
- package/types/components/lazy/table/context.d.ts +2 -2
- package/types/components/lazy/table/index.d.ts +45 -45
- package/types/components/lazy/table/search.d.ts +23 -23
- package/types/components/lazy/table/use-selection.d.ts +3 -3
- package/types/components/loader.d.ts +9 -9
- package/types/components/loading-button.d.ts +7 -7
- package/types/components/modal/confirm.d.ts +8 -8
- package/types/components/modal/index.d.ts +32 -32
- package/types/components/modal/message.d.ts +26 -26
- package/types/components/modal/show.d.ts +3 -3
- package/types/components/modal-button.d.ts +17 -17
- package/types/components/modal-form.d.ts +10 -10
- package/types/components/number-format.d.ts +10 -10
- package/types/components/pagination.d.ts +11 -11
- package/types/components/request-button.d.ts +13 -13
- package/types/components/result.d.ts +15 -15
- package/types/components/space.d.ts +9 -9
- package/types/components/statistic.d.ts +7 -7
- package/types/components/steps.d.ts +10 -10
- package/types/components/table.d.ts +4 -4
- package/types/components/tooltip.d.ts +9 -9
- package/types/hooks/use-callback-ref.d.ts +2 -2
- package/types/hooks/use-controllable-state.d.ts +8 -8
- package/types/hooks/use-debounce.d.ts +2 -2
- package/types/hooks/use-overlay-state.d.ts +16 -16
- package/types/hooks/use-request.d.ts +21 -21
- package/types/hooks/use-safe-state.d.ts +4 -4
- package/types/hooks/use-state-with-callback.d.ts +2 -2
- package/types/hooks/use-unmounted-ref.d.ts +3 -3
- package/types/index.d.ts +33 -33
- package/types/request.d.ts +32 -32
- package/types/utils/is-record.d.ts +1 -1
- package/types/utils/message.d.ts +11 -11
- package/types/utils/toast.d.ts +11 -11
- package/types/utils/types.d.ts +7 -7
- package/types/utils/wait-pay-complete.d.ts +11 -11
- package/es/form-01bf45e9.js +0 -233
- package/es/form-01bf45e9.js.map +0 -1
- package/es/form-0a372a24.js +0 -2
- package/es/form-0a372a24.js.map +0 -1
- package/es/form-1791ea39.js +0 -236
- package/es/form-1791ea39.js.map +0 -1
- package/es/form-74ef0417.js +0 -2
- package/es/form-74ef0417.js.map +0 -1
- package/es/form-8925a750.js +0 -231
- package/es/form-8925a750.js.map +0 -1
- package/es/form-95db7eac.js +0 -2
- package/es/form-95db7eac.js.map +0 -1
- package/es/form-9c0e638a.js +0 -231
- package/es/form-9c0e638a.js.map +0 -1
- package/es/image-zoom-912e2b3b.js.map +0 -1
- package/es/index-1930b692.js +0 -67
- package/es/index-1930b692.js.map +0 -1
- package/es/index-1d379f3a.js +0 -562
- package/es/index-1d379f3a.js.map +0 -1
- package/es/index-303e1845.js +0 -560
- package/es/index-303e1845.js.map +0 -1
- package/es/index-4f51cece.js +0 -1352
- package/es/index-4f51cece.js.map +0 -1
- package/es/index-5142110c.js +0 -67
- package/es/index-5142110c.js.map +0 -1
- package/es/index-6ae8237d.js.map +0 -1
- package/es/index-7a7c06a9.js +0 -40
- package/es/index-7a7c06a9.js.map +0 -1
- package/es/index-9869b1c6.js +0 -1350
- package/es/index-9869b1c6.js.map +0 -1
- package/es/index-a48179db.js +0 -1382
- package/es/index-a48179db.js.map +0 -1
- package/es/index-b34ecf90.js +0 -40
- package/es/index-b34ecf90.js.map +0 -1
- package/es/index-d964165a.js +0 -560
- package/es/index-d964165a.js.map +0 -1
- package/es/index-e17dc6f0.js +0 -40
- package/es/index-e17dc6f0.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/steps-afba29a7.js.map +0 -1
- package/es/steps-c27a3885.js +0 -34
- package/es/steps-c27a3885.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { CardProps as BsCardProps } from 'react-bootstrap';
|
|
3
|
-
interface CardProps extends BsCardProps {
|
|
4
|
-
title?: string;
|
|
5
|
-
}
|
|
6
|
-
export default function Card({ children, title, className, ...props }: PropsWithChildren<CardProps>): JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { CardProps as BsCardProps } from 'react-bootstrap';
|
|
3
|
+
interface CardProps extends BsCardProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
}
|
|
6
|
+
export default function Card({ children, title, className, ...props }: PropsWithChildren<CardProps>): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const Dimmable: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
interface DimmerProps {
|
|
3
|
-
active?: boolean;
|
|
4
|
-
inverted?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const Dimmer: import("styled-components").StyledComponent<"div", any, DimmerProps, never>;
|
|
7
|
-
export default Dimmer;
|
|
1
|
+
export declare const Dimmable: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
interface DimmerProps {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
inverted?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const Dimmer: import("styled-components").StyledComponent<"div", any, DimmerProps, never>;
|
|
7
|
+
export default Dimmer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Errors } from '../request';
|
|
3
|
-
export default function Error({ errors }: {
|
|
4
|
-
errors?: Errors;
|
|
5
|
-
}): JSX.Element | null;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Errors } from '../request';
|
|
3
|
+
export default function Error({ errors }: {
|
|
4
|
+
errors?: Errors;
|
|
5
|
+
}): JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomFormType } from './lazy/form';
|
|
2
|
-
declare const Form: CustomFormType;
|
|
3
|
-
export default Form;
|
|
4
|
-
export type { FormProps, FormType } from './lazy/form';
|
|
1
|
+
import type { CustomFormType } from './lazy/form';
|
|
2
|
+
declare const Form: CustomFormType;
|
|
3
|
+
export default Form;
|
|
4
|
+
export type { FormProps, FormType } from './lazy/form';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
2
|
-
declare const LazyImageZoom: import("react").LazyExoticComponent<typeof import("react-medium-image-zoom").default>;
|
|
3
|
-
export default function ImageZoom(props: ComponentProps<typeof LazyImageZoom>): JSX.Element;
|
|
4
|
-
export {};
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
declare const LazyImageZoom: import("react").LazyExoticComponent<typeof import("react-medium-image-zoom").default>;
|
|
3
|
+
export default function ImageZoom(props: ComponentProps<typeof LazyImageZoom>): JSX.Element;
|
|
4
|
+
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { JsonFormProps, JsonFormType } from '@topthink/json-form';
|
|
2
|
-
import { ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
3
|
-
import { Method } from 'axios';
|
|
4
|
-
export interface FormProps<T = any> extends JsonFormProps<T> {
|
|
5
|
-
onSuccess?: (data: any) => void;
|
|
6
|
-
method?: Method;
|
|
7
|
-
children?: ReactNode | ((props: {
|
|
8
|
-
submit: ReactNode;
|
|
9
|
-
loading: boolean;
|
|
10
|
-
}) => ReactNode);
|
|
11
|
-
submitText?: string;
|
|
12
|
-
onSubmitting?: (submitting: boolean) => void;
|
|
13
|
-
transformData?: (data: T) => T;
|
|
14
|
-
}
|
|
15
|
-
export interface FormType extends JsonFormType {
|
|
16
|
-
}
|
|
17
|
-
export type CustomFormType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<FormProps<T>> & RefAttributes<FormType>>;
|
|
18
|
-
declare const Form: CustomFormType;
|
|
19
|
-
export default Form;
|
|
1
|
+
import { JsonFormProps, JsonFormType } from '@topthink/json-form';
|
|
2
|
+
import { ForwardRefExoticComponent, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
3
|
+
import { Method } from 'axios';
|
|
4
|
+
export interface FormProps<T = any> extends JsonFormProps<T> {
|
|
5
|
+
onSuccess?: (data: any) => void;
|
|
6
|
+
method?: Method;
|
|
7
|
+
children?: ReactNode | ((props: {
|
|
8
|
+
submit: ReactNode;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
}) => ReactNode);
|
|
11
|
+
submitText?: string;
|
|
12
|
+
onSubmitting?: (submitting: boolean) => void;
|
|
13
|
+
transformData?: (data: T) => T;
|
|
14
|
+
}
|
|
15
|
+
export interface FormType extends JsonFormType {
|
|
16
|
+
}
|
|
17
|
+
export type CustomFormType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<FormProps<T>> & RefAttributes<FormType>>;
|
|
18
|
+
declare const Form: CustomFormType;
|
|
19
|
+
export default Form;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="@topthink/json-form/types/json-form" />
|
|
3
|
+
import { WidgetProps } from '@rjsf/core';
|
|
4
|
+
import '@toast-ui/editor/dist/toastui-editor-only.css';
|
|
5
|
+
import '@toast-ui/editor/dist/i18n/zh-cn';
|
|
6
|
+
export default function EditorWidget(props: WidgetProps): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import ImageZoom from 'react-medium-image-zoom';
|
|
2
|
-
import 'react-medium-image-zoom/dist/styles.css';
|
|
3
|
-
export default ImageZoom;
|
|
1
|
+
import ImageZoom from 'react-medium-image-zoom';
|
|
2
|
+
import 'react-medium-image-zoom/dist/styles.css';
|
|
3
|
+
export default ImageZoom;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import RcSteps, { Step } from 'rc-steps';
|
|
2
|
-
import 'rc-steps/assets/index.css';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
|
-
declare function Steps(props: ComponentProps<typeof RcSteps>): JSX.Element;
|
|
5
|
-
declare namespace Steps {
|
|
6
|
-
var Step: typeof import("rc-steps").Step;
|
|
7
|
-
}
|
|
8
|
-
export default Steps;
|
|
9
|
-
export { Step };
|
|
1
|
+
import RcSteps, { Step } from 'rc-steps';
|
|
2
|
+
import 'rc-steps/assets/index.css';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
declare function Steps(props: ComponentProps<typeof RcSteps>): JSX.Element;
|
|
5
|
+
declare namespace Steps {
|
|
6
|
+
var Step: typeof import("rc-steps").Step;
|
|
7
|
+
}
|
|
8
|
+
export default Steps;
|
|
9
|
+
export { Step };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const TableContext: import("react").Context<boolean>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TableContext: import("react").Context<boolean>;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { TableProps as RcTableProps } from 'rc-table';
|
|
2
|
-
import { ColumnType as BsColumnType, RenderedCell } from 'rc-table/es/interface';
|
|
3
|
-
import { ForwardRefExoticComponent, Key, PropsWithChildren, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
4
|
-
import { SearchOptions } from './search';
|
|
5
|
-
export interface TableType {
|
|
6
|
-
reload: () => void;
|
|
7
|
-
}
|
|
8
|
-
interface ColumnType<RecordType> extends BsColumnType<RecordType> {
|
|
9
|
-
render?: (data: {
|
|
10
|
-
value: any;
|
|
11
|
-
record: RecordType;
|
|
12
|
-
index: number;
|
|
13
|
-
action: TableType;
|
|
14
|
-
}) => ReactNode | RenderedCell<RecordType>;
|
|
15
|
-
valueType?: 'currency';
|
|
16
|
-
valueEnum?: Record<number | string, {
|
|
17
|
-
text: ReactNode;
|
|
18
|
-
status?: string;
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
21
|
-
export type Columns<RecordType = any> = ColumnType<RecordType>[];
|
|
22
|
-
export interface TableRowSelection<RecordType = any> {
|
|
23
|
-
selectedRowKeys?: Key[];
|
|
24
|
-
onChange?: (selectedRowKeys: Key[], selectedRows: RecordType[]) => void;
|
|
25
|
-
}
|
|
26
|
-
export interface TableProps<RecordType = any> extends Omit<RcTableProps<RecordType>, 'children' | 'columns'> {
|
|
27
|
-
source: string | ((params: Params) => Promise<RecordType>);
|
|
28
|
-
paginate?: boolean;
|
|
29
|
-
columns: Columns<RecordType>;
|
|
30
|
-
toolBarRender?: ((action: TableType) => ReactNode) | false;
|
|
31
|
-
search?: boolean | SearchOptions;
|
|
32
|
-
rowSelection?: TableRowSelection<RecordType>;
|
|
33
|
-
card?: boolean;
|
|
34
|
-
sync?: boolean;
|
|
35
|
-
}
|
|
36
|
-
type Params = {
|
|
37
|
-
page?: number;
|
|
38
|
-
sortField?: string;
|
|
39
|
-
sortOrder?: number;
|
|
40
|
-
q?: string;
|
|
41
|
-
[key: string]: any;
|
|
42
|
-
};
|
|
43
|
-
export type CustomTableType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<TableProps<T>>> & RefAttributes<TableType>>;
|
|
44
|
-
declare const _default: CustomTableType<any>;
|
|
45
|
-
export default _default;
|
|
1
|
+
import { TableProps as RcTableProps } from 'rc-table';
|
|
2
|
+
import { ColumnType as BsColumnType, RenderedCell } from 'rc-table/es/interface';
|
|
3
|
+
import { ForwardRefExoticComponent, Key, PropsWithChildren, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
4
|
+
import { SearchOptions } from './search';
|
|
5
|
+
export interface TableType {
|
|
6
|
+
reload: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface ColumnType<RecordType> extends BsColumnType<RecordType> {
|
|
9
|
+
render?: (data: {
|
|
10
|
+
value: any;
|
|
11
|
+
record: RecordType;
|
|
12
|
+
index: number;
|
|
13
|
+
action: TableType;
|
|
14
|
+
}) => ReactNode | RenderedCell<RecordType>;
|
|
15
|
+
valueType?: 'currency';
|
|
16
|
+
valueEnum?: Record<number | string, {
|
|
17
|
+
text: ReactNode;
|
|
18
|
+
status?: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export type Columns<RecordType = any> = ColumnType<RecordType>[];
|
|
22
|
+
export interface TableRowSelection<RecordType = any> {
|
|
23
|
+
selectedRowKeys?: Key[];
|
|
24
|
+
onChange?: (selectedRowKeys: Key[], selectedRows: RecordType[]) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface TableProps<RecordType = any> extends Omit<RcTableProps<RecordType>, 'children' | 'columns'> {
|
|
27
|
+
source: string | ((params: Params) => Promise<RecordType>);
|
|
28
|
+
paginate?: boolean;
|
|
29
|
+
columns: Columns<RecordType>;
|
|
30
|
+
toolBarRender?: ((action: TableType) => ReactNode) | false;
|
|
31
|
+
search?: boolean | SearchOptions;
|
|
32
|
+
rowSelection?: TableRowSelection<RecordType>;
|
|
33
|
+
card?: boolean;
|
|
34
|
+
sync?: boolean;
|
|
35
|
+
}
|
|
36
|
+
type Params = {
|
|
37
|
+
page?: number;
|
|
38
|
+
sortField?: string;
|
|
39
|
+
sortOrder?: number;
|
|
40
|
+
q?: string;
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
};
|
|
43
|
+
export type CustomTableType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<TableProps<T>>> & RefAttributes<TableType>>;
|
|
44
|
+
declare const _default: CustomTableType<any>;
|
|
45
|
+
export default _default;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/// <reference types="@rjsf/core" />
|
|
2
|
-
/// <reference types="react" />
|
|
3
|
-
import type { Columns } from './index';
|
|
4
|
-
import { UiSchema } from '@topthink/json-form';
|
|
5
|
-
export type SearchOptions = {
|
|
6
|
-
fields: string[];
|
|
7
|
-
extraFields?: Record<string, string>;
|
|
8
|
-
ui?: Record<string, UiSchema>;
|
|
9
|
-
order?: string[];
|
|
10
|
-
};
|
|
11
|
-
interface SearchProps {
|
|
12
|
-
data: Record<string, string>;
|
|
13
|
-
options: SearchOptions;
|
|
14
|
-
columns: Columns;
|
|
15
|
-
onSearch: (params: Record<string, any>) => void;
|
|
16
|
-
}
|
|
17
|
-
export default function Search({ data, options, columns, onSearch }: SearchProps): JSX.Element;
|
|
18
|
-
interface Props {
|
|
19
|
-
keyword: string;
|
|
20
|
-
onKeywordChange: (value: string) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare function LightSearch({ keyword, onKeywordChange }: Props): JSX.Element;
|
|
23
|
-
export {};
|
|
1
|
+
/// <reference types="@rjsf/core" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import type { Columns } from './index';
|
|
4
|
+
import { UiSchema } from '@topthink/json-form';
|
|
5
|
+
export type SearchOptions = {
|
|
6
|
+
fields: string[];
|
|
7
|
+
extraFields?: Record<string, string>;
|
|
8
|
+
ui?: Record<string, UiSchema>;
|
|
9
|
+
order?: string[];
|
|
10
|
+
};
|
|
11
|
+
interface SearchProps {
|
|
12
|
+
data: Record<string, string>;
|
|
13
|
+
options: SearchOptions;
|
|
14
|
+
columns: Columns;
|
|
15
|
+
onSearch: (params: Record<string, any>) => void;
|
|
16
|
+
}
|
|
17
|
+
export default function Search({ data, options, columns, onSearch }: SearchProps): JSX.Element;
|
|
18
|
+
interface Props {
|
|
19
|
+
keyword: string;
|
|
20
|
+
onKeywordChange: (value: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function LightSearch({ keyword, onKeywordChange }: Props): JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Columns, TableProps, TableRowSelection } from './index';
|
|
2
|
-
import { Key } from 'react';
|
|
3
|
-
export default function useSelection<T = any>(rowSelection: TableRowSelection<T> | undefined, rowKey: Required<TableProps<T>>['rowKey'], data: T[]): [(columns: Columns<T>) => Columns<T>, (keys: Key[]) => void];
|
|
1
|
+
import { Columns, TableProps, TableRowSelection } from './index';
|
|
2
|
+
import { Key } from 'react';
|
|
3
|
+
export default function useSelection<T = any>(rowSelection: TableRowSelection<T> | undefined, rowKey: Required<TableProps<T>>['rowKey'], data: T[]): [(columns: Columns<T>) => Columns<T>, (keys: Key[]) => void];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { SpinnerProps } from 'react-bootstrap';
|
|
3
|
-
interface LoaderProps {
|
|
4
|
-
loading?: boolean;
|
|
5
|
-
animation?: SpinnerProps['animation'];
|
|
6
|
-
wrap?: boolean | number;
|
|
7
|
-
}
|
|
8
|
-
export default function Loader({ loading, children, variant, animation, wrap, ...props }: PropsWithChildren<LoaderProps & Omit<SpinnerProps, 'animation'>>): JSX.Element | null;
|
|
9
|
-
export {};
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { SpinnerProps } from 'react-bootstrap';
|
|
3
|
+
interface LoaderProps {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
animation?: SpinnerProps['animation'];
|
|
6
|
+
wrap?: boolean | number;
|
|
7
|
+
}
|
|
8
|
+
export default function Loader({ loading, children, variant, animation, wrap, ...props }: PropsWithChildren<LoaderProps & Omit<SpinnerProps, 'animation'>>): JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ButtonProps } from 'react-bootstrap';
|
|
3
|
-
interface CustomButtonProps extends ButtonProps {
|
|
4
|
-
loading: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default function LoadingButton({ loading, disabled, children, ...props }: CustomButtonProps): JSX.Element;
|
|
7
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from 'react-bootstrap';
|
|
3
|
+
interface CustomButtonProps extends ButtonProps {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function LoadingButton({ loading, disabled, children, ...props }: CustomButtonProps): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface ConfirmOptions {
|
|
2
|
-
title?: string;
|
|
3
|
-
message: string;
|
|
4
|
-
okText?: string;
|
|
5
|
-
cancelText?: string;
|
|
6
|
-
}
|
|
7
|
-
export default function confirm(options: ConfirmOptions): Promise<true | void>;
|
|
8
|
-
export {};
|
|
1
|
+
interface ConfirmOptions {
|
|
2
|
+
title?: string;
|
|
3
|
+
message: string;
|
|
4
|
+
okText?: string;
|
|
5
|
+
cancelText?: string;
|
|
6
|
+
}
|
|
7
|
+
export default function confirm(options: ConfirmOptions): Promise<true | void>;
|
|
8
|
+
export {};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { ModalProps as ReactModalProps } from 'react-bootstrap';
|
|
2
|
-
import { ElementType, MouseEvent, ReactNode } from 'react';
|
|
3
|
-
import { ButtonProps } from '../button';
|
|
4
|
-
import show from './show';
|
|
5
|
-
import confirm from './confirm';
|
|
6
|
-
import Message, { MessageProps } from './message';
|
|
7
|
-
export interface ModalProps extends Pick<ReactModalProps, 'style' | 'container' | 'backdrop' | 'centered' | 'size' | 'scrollable' | 'fullscreen' | 'onHide' | 'onShow' | 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited'> {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
header?: ReactNode;
|
|
10
|
-
footer?: ReactNode | ((args: {
|
|
11
|
-
okButton: ReactNode;
|
|
12
|
-
cancelButton: ReactNode;
|
|
13
|
-
}) => ReactNode);
|
|
14
|
-
okText?: string;
|
|
15
|
-
cancelText?: string;
|
|
16
|
-
closable?: boolean;
|
|
17
|
-
show?: boolean;
|
|
18
|
-
onOk?: (e: MouseEvent) => void;
|
|
19
|
-
onCancel?: (e: MouseEvent) => void;
|
|
20
|
-
okButtonProps?: ButtonProps;
|
|
21
|
-
bodyAs?: ElementType;
|
|
22
|
-
headerAs?: ElementType;
|
|
23
|
-
confirmLoading?: boolean;
|
|
24
|
-
}
|
|
25
|
-
declare const Modal: {
|
|
26
|
-
({ header, children, footer, closable, show, cancelText, okText, onOk, onCancel, onHide, okButtonProps, bodyAs, headerAs, confirmLoading, ...rest }: ModalProps): JSX.Element;
|
|
27
|
-
Message: typeof Message;
|
|
28
|
-
confirm: typeof confirm;
|
|
29
|
-
show: typeof show;
|
|
30
|
-
};
|
|
31
|
-
export default Modal;
|
|
32
|
-
export { MessageProps };
|
|
1
|
+
import { ModalProps as ReactModalProps } from 'react-bootstrap';
|
|
2
|
+
import { ElementType, MouseEvent, ReactNode } from 'react';
|
|
3
|
+
import { ButtonProps } from '../button';
|
|
4
|
+
import show from './show';
|
|
5
|
+
import confirm from './confirm';
|
|
6
|
+
import Message, { MessageProps } from './message';
|
|
7
|
+
export interface ModalProps extends Pick<ReactModalProps, 'style' | 'container' | 'backdrop' | 'centered' | 'size' | 'scrollable' | 'fullscreen' | 'onHide' | 'onShow' | 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited'> {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
header?: ReactNode;
|
|
10
|
+
footer?: ReactNode | ((args: {
|
|
11
|
+
okButton: ReactNode;
|
|
12
|
+
cancelButton: ReactNode;
|
|
13
|
+
}) => ReactNode);
|
|
14
|
+
okText?: string;
|
|
15
|
+
cancelText?: string;
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
show?: boolean;
|
|
18
|
+
onOk?: (e: MouseEvent) => void;
|
|
19
|
+
onCancel?: (e: MouseEvent) => void;
|
|
20
|
+
okButtonProps?: ButtonProps;
|
|
21
|
+
bodyAs?: ElementType;
|
|
22
|
+
headerAs?: ElementType;
|
|
23
|
+
confirmLoading?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare const Modal: {
|
|
26
|
+
({ header, children, footer, closable, show, cancelText, okText, onOk, onCancel, onHide, okButtonProps, bodyAs, headerAs, confirmLoading, ...rest }: ModalProps): JSX.Element;
|
|
27
|
+
Message: typeof Message;
|
|
28
|
+
confirm: typeof confirm;
|
|
29
|
+
show: typeof show;
|
|
30
|
+
};
|
|
31
|
+
export default Modal;
|
|
32
|
+
export { MessageProps };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import { ModalProps } from 'react-bootstrap';
|
|
3
|
-
interface MessageContextType {
|
|
4
|
-
container?: ModalProps['container'];
|
|
5
|
-
}
|
|
6
|
-
type MessageWrapProps<T, P = void> = {
|
|
7
|
-
resolve: (value: P | void) => void;
|
|
8
|
-
destroy: () => void;
|
|
9
|
-
message: T;
|
|
10
|
-
};
|
|
11
|
-
export type MessageProps<T, P = void> = {
|
|
12
|
-
resolve: (value: P | void) => void;
|
|
13
|
-
message: T;
|
|
14
|
-
state: {
|
|
15
|
-
show: boolean;
|
|
16
|
-
onHide: () => void;
|
|
17
|
-
onExited: () => void;
|
|
18
|
-
container?: ModalProps['container'];
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare function wrapMessage<T = {}, P = any>(Component: ComponentType<MessageProps<T, P>>): ComponentType<MessageWrapProps<T, P>>;
|
|
22
|
-
export declare function createMessage<T = {}, P = any>(Component: ComponentType<MessageWrapProps<T, P>>): (message: T) => Promise<P | void>;
|
|
23
|
-
export declare const show: (modal: ReactNode) => void;
|
|
24
|
-
export declare const hide: (modal: ReactNode) => void;
|
|
25
|
-
export default function Message(props: MessageContextType): JSX.Element;
|
|
26
|
-
export {};
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { ModalProps } from 'react-bootstrap';
|
|
3
|
+
interface MessageContextType {
|
|
4
|
+
container?: ModalProps['container'];
|
|
5
|
+
}
|
|
6
|
+
type MessageWrapProps<T, P = void> = {
|
|
7
|
+
resolve: (value: P | void) => void;
|
|
8
|
+
destroy: () => void;
|
|
9
|
+
message: T;
|
|
10
|
+
};
|
|
11
|
+
export type MessageProps<T, P = void> = {
|
|
12
|
+
resolve: (value: P | void) => void;
|
|
13
|
+
message: T;
|
|
14
|
+
state: {
|
|
15
|
+
show: boolean;
|
|
16
|
+
onHide: () => void;
|
|
17
|
+
onExited: () => void;
|
|
18
|
+
container?: ModalProps['container'];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function wrapMessage<T = {}, P = any>(Component: ComponentType<MessageProps<T, P>>): ComponentType<MessageWrapProps<T, P>>;
|
|
22
|
+
export declare function createMessage<T = {}, P = any>(Component: ComponentType<MessageWrapProps<T, P>>): (message: T) => Promise<P | void>;
|
|
23
|
+
export declare const show: (modal: ReactNode) => void;
|
|
24
|
+
export declare const hide: (modal: ReactNode) => void;
|
|
25
|
+
export default function Message(props: MessageContextType): JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MessageProps } from './message';
|
|
2
|
-
import { ComponentType } from 'react';
|
|
3
|
-
export default function show<T, P = any>(Component: ComponentType<MessageProps<any, T>>, options?: P): Promise<void | T>;
|
|
1
|
+
import { MessageProps } from './message';
|
|
2
|
+
import { ComponentType } from 'react';
|
|
3
|
+
export default function show<T, P = any>(Component: ComponentType<MessageProps<any, T>>, options?: P): Promise<void | T>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ElementType, ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
2
|
-
import { ModalProps } from './modal';
|
|
3
|
-
import { ButtonProps } from 'react-bootstrap';
|
|
4
|
-
export interface ModalButtonProps extends Omit<ButtonProps, 'as'> {
|
|
5
|
-
text: ReactNode;
|
|
6
|
-
modalProps?: Omit<ModalProps, 'children' | 'confirmLoading' | 'onOk'>;
|
|
7
|
-
onOk?: () => any;
|
|
8
|
-
onShow?: () => void;
|
|
9
|
-
confirmLoading?: boolean;
|
|
10
|
-
as?: ElementType | ButtonProps['as'];
|
|
11
|
-
}
|
|
12
|
-
export interface ModalType {
|
|
13
|
-
close: () => void;
|
|
14
|
-
}
|
|
15
|
-
type ModalButtonType = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<ModalButtonProps>> & RefAttributes<ModalType>>;
|
|
16
|
-
declare const ModalButton: ModalButtonType;
|
|
17
|
-
export default ModalButton;
|
|
1
|
+
import { ElementType, ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, ReactNode, RefAttributes } from 'react';
|
|
2
|
+
import { ModalProps } from './modal';
|
|
3
|
+
import { ButtonProps } from 'react-bootstrap';
|
|
4
|
+
export interface ModalButtonProps extends Omit<ButtonProps, 'as'> {
|
|
5
|
+
text: ReactNode;
|
|
6
|
+
modalProps?: Omit<ModalProps, 'children' | 'confirmLoading' | 'onOk'>;
|
|
7
|
+
onOk?: () => any;
|
|
8
|
+
onShow?: () => void;
|
|
9
|
+
confirmLoading?: boolean;
|
|
10
|
+
as?: ElementType | ButtonProps['as'];
|
|
11
|
+
}
|
|
12
|
+
export interface ModalType {
|
|
13
|
+
close: () => void;
|
|
14
|
+
}
|
|
15
|
+
type ModalButtonType = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<ModalButtonProps>> & RefAttributes<ModalType>>;
|
|
16
|
+
declare const ModalButton: ModalButtonType;
|
|
17
|
+
export default ModalButton;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ModalButtonProps } from './modal-button';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { FormProps } from './form';
|
|
4
|
-
export interface ModalFormProps<T = any> extends FormProps<T> {
|
|
5
|
-
text: ReactNode;
|
|
6
|
-
buttonProps?: Omit<ModalButtonProps, 'text' | 'modalProps' | 'confirmLoading' | 'onOk'>;
|
|
7
|
-
modalProps?: ModalButtonProps['modalProps'];
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export default function ModalForm<T = any>({ text, onSuccess, buttonProps, modalProps, children, ...props }: ModalFormProps<T>): JSX.Element;
|
|
1
|
+
import { ModalButtonProps } from './modal-button';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { FormProps } from './form';
|
|
4
|
+
export interface ModalFormProps<T = any> extends FormProps<T> {
|
|
5
|
+
text: ReactNode;
|
|
6
|
+
buttonProps?: Omit<ModalButtonProps, 'text' | 'modalProps' | 'confirmLoading' | 'onOk'>;
|
|
7
|
+
modalProps?: ModalButtonProps['modalProps'];
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export default function ModalForm<T = any>({ text, onSuccess, buttonProps, modalProps, children, ...props }: ModalFormProps<T>): JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface Props {
|
|
3
|
-
value: number;
|
|
4
|
-
currency?: boolean;
|
|
5
|
-
locale?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
options?: Intl.NumberFormatOptions;
|
|
8
|
-
}
|
|
9
|
-
export default function NumberFormat({ className, value, locale, currency, options }: Props): JSX.Element;
|
|
10
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Props {
|
|
3
|
+
value: number;
|
|
4
|
+
currency?: boolean;
|
|
5
|
+
locale?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
options?: Intl.NumberFormatOptions;
|
|
8
|
+
}
|
|
9
|
+
export default function NumberFormat({ className, value, locale, currency, options }: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface PaginationProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
total: number;
|
|
5
|
-
current?: number;
|
|
6
|
-
defaultCurrent?: number;
|
|
7
|
-
pageSize?: number;
|
|
8
|
-
defaultPageSize?: number;
|
|
9
|
-
onChange?: (current: number, pageSize: number) => void;
|
|
10
|
-
}
|
|
11
|
-
export default function Pagination({ total, onChange, defaultCurrent, defaultPageSize, className, ...props }: PaginationProps): JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PaginationProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
total: number;
|
|
5
|
+
current?: number;
|
|
6
|
+
defaultCurrent?: number;
|
|
7
|
+
pageSize?: number;
|
|
8
|
+
defaultPageSize?: number;
|
|
9
|
+
onChange?: (current: number, pageSize: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function Pagination({ total, onChange, defaultCurrent, defaultPageSize, className, ...props }: PaginationProps): JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { RequestConfig } from '../request';
|
|
2
|
-
import { ElementType } from 'react';
|
|
3
|
-
import { AxiosRequestConfig } from 'axios';
|
|
4
|
-
import { ButtonProps } from './button';
|
|
5
|
-
interface Props extends Omit<ButtonProps, 'as'> {
|
|
6
|
-
url: RequestConfig;
|
|
7
|
-
method?: AxiosRequestConfig['method'];
|
|
8
|
-
confirm?: string;
|
|
9
|
-
onSuccess?: (result: any) => void;
|
|
10
|
-
as?: ElementType | ButtonProps['as'];
|
|
11
|
-
}
|
|
12
|
-
export default function RequestButton({ url, method, confirm, onSuccess, children, disabled, as, ...props }: Props): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
13
|
-
export {};
|
|
1
|
+
import { RequestConfig } from '../request';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
import { ButtonProps } from './button';
|
|
5
|
+
interface Props extends Omit<ButtonProps, 'as'> {
|
|
6
|
+
url: RequestConfig;
|
|
7
|
+
method?: AxiosRequestConfig['method'];
|
|
8
|
+
confirm?: string;
|
|
9
|
+
onSuccess?: (result: any) => void;
|
|
10
|
+
as?: ElementType | ButtonProps['as'];
|
|
11
|
+
}
|
|
12
|
+
export default function RequestButton({ url, method, confirm, onSuccess, children, disabled, as, ...props }: Props): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
13
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
declare const IconMap: {
|
|
3
|
-
success: JSX.Element;
|
|
4
|
-
error: JSX.Element;
|
|
5
|
-
info: JSX.Element;
|
|
6
|
-
warning: JSX.Element;
|
|
7
|
-
};
|
|
8
|
-
interface ResultProps {
|
|
9
|
-
status?: keyof typeof IconMap;
|
|
10
|
-
icon?: ReactNode;
|
|
11
|
-
title?: string;
|
|
12
|
-
extra?: ReactNode;
|
|
13
|
-
}
|
|
14
|
-
export default function Result({ status, title, icon, extra }: ResultProps): JSX.Element;
|
|
15
|
-
export {};
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
declare const IconMap: {
|
|
3
|
+
success: JSX.Element;
|
|
4
|
+
error: JSX.Element;
|
|
5
|
+
info: JSX.Element;
|
|
6
|
+
warning: JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
interface ResultProps {
|
|
9
|
+
status?: keyof typeof IconMap;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
title?: string;
|
|
12
|
+
extra?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export default function Result({ status, title, icon, extra }: ResultProps): JSX.Element;
|
|
15
|
+
export {};
|