@jiaozhiye/qm-design-react 1.0.0-beta.3 → 1.0.0-beta.32
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/lib/_utils/dom.d.ts +8 -1
- package/lib/_utils/util.d.ts +1 -1
- package/lib/anchor/src/anchor-item.d.ts +1 -1
- package/lib/anchor/src/anchor-nav.d.ts +1 -1
- package/lib/anchor/src/anchor.d.ts +5 -3
- package/lib/antd/dayjs.d.ts +1 -0
- package/lib/antd/index.d.ts +1 -0
- package/lib/button/src/button.d.ts +2 -2
- package/lib/config-provider/context.d.ts +3 -2
- package/lib/config-provider/src/config-provider.d.ts +1 -0
- package/lib/countup/src/countup.d.ts +2 -2
- package/lib/cropper/src/cropper.d.ts +1 -1
- package/lib/divider/src/divider.d.ts +2 -2
- package/lib/download/src/download.d.ts +8 -5
- package/lib/drawer/src/drawer.d.ts +13 -5
- package/lib/drawer/style/index.less +3 -2
- package/lib/empty/src/empty.d.ts +2 -2
- package/lib/form/src/fields-filter.d.ts +1 -1
- package/lib/form/src/form-cascader.d.ts +1 -1
- package/lib/form/src/form-input-number.d.ts +1 -0
- package/lib/form/src/form-input.d.ts +12 -0
- package/lib/form/src/form-multiple-search-helper.d.ts +10 -0
- package/lib/form/src/form.d.ts +8 -3
- package/lib/form/src/types.d.ts +17 -12
- package/lib/form/src/utils.d.ts +4 -0
- package/lib/form/style/index.less +37 -12
- package/lib/index.d.ts +3 -0
- package/lib/index.esm.js +30513 -16
- package/lib/index.full.js +1 -1
- package/lib/index.js +30828 -16
- package/lib/modal/src/modal.d.ts +7 -3
- package/lib/print/index.d.ts +3 -0
- package/lib/print/src/LodopFuncs.d.ts +1 -0
- package/lib/print/src/config.d.ts +6 -0
- package/lib/print/src/container.d.ts +14 -0
- package/lib/print/src/context.d.ts +6 -0
- package/lib/print/src/preview.d.ts +61 -0
- package/lib/print/src/print.d.ts +37 -0
- package/lib/print/src/setting.d.ts +49 -0
- package/lib/print/src/utils.d.ts +5 -0
- package/lib/print/style/index.less +175 -0
- package/lib/search-helper/src/search-helper.d.ts +1 -0
- package/lib/space/src/space.d.ts +2 -2
- package/lib/split/src/split-pane.d.ts +2 -1
- package/lib/split/src/split.d.ts +2 -0
- package/lib/style/index.css +1 -1
- package/lib/style/index.less +2 -1
- package/lib/table/src/config/index.d.ts +1 -1
- package/lib/table/src/context/index.d.ts +3 -0
- package/lib/table/src/expandable/index.d.ts +1 -0
- package/lib/table/src/hooks/useTableCore.d.ts +1 -0
- package/lib/table/src/hooks/useTableLayout.d.ts +1 -1
- package/lib/table/src/table/props.d.ts +8 -6
- package/lib/table/src/table/types.d.ts +7 -8
- package/lib/table/style/body.less +22 -3
- package/lib/table/style/export.less +1 -1
- package/lib/table/style/toper.less +6 -3
- package/lib/tabs/src/tabs.d.ts +1 -1
- package/lib/tinymce/src/index.d.ts +2 -2
- package/lib/upload-file/src/upload-file.d.ts +10 -2
- package/lib/upload-img/src/cropper-preview.d.ts +3 -1
- package/lib/upload-img/src/upload-img.d.ts +2 -0
- package/package.json +8 -7
- package/lib/form/src/china-data.d.ts +0 -4577
package/lib/_utils/dom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, Nullable } from './types';
|
|
1
|
+
import type { CSSProperties, Nullable } from './types';
|
|
2
2
|
export declare const on: (element: Element | HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject) => void;
|
|
3
3
|
export declare const off: (element: Element | HTMLElement | Document | Window, event: string, handler: EventListenerOrEventListenerObject) => void;
|
|
4
4
|
export declare const once: (el: HTMLElement, event: string, fn: EventListener) => void;
|
|
@@ -66,3 +66,10 @@ export declare const getParentNode: (el: HTMLElement, selector: string) => Nulla
|
|
|
66
66
|
* @returns boolean
|
|
67
67
|
*/
|
|
68
68
|
export declare const contains: (el: HTMLElement, container: HTMLElement) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @description 滚动到指定位置,动画效果
|
|
71
|
+
* @param {HTMLNode} el 带滚动条元素
|
|
72
|
+
* @param {number} t 滚动条上边距
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
export declare const scrollToY: (el: HTMLElement, t: number) => void;
|
package/lib/_utils/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isNumber, isString, isUndefined, isFunction, isArray, isPlainObject as isObject, debounce, throttle, get } from 'lodash-es';
|
|
3
|
-
import { AnyFunction, AnyObject } from './types';
|
|
3
|
+
import type { AnyFunction, AnyObject } from './types';
|
|
4
4
|
export { isNumber, isString, isArray, isUndefined, isFunction, isObject, debounce, throttle, get };
|
|
5
5
|
export declare const isIE: () => boolean;
|
|
6
6
|
export declare const isEdge: () => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ComponentSize, CSSProperties } from '../../_utils/types';
|
|
3
|
+
import type { ComponentSize, CSSProperties } from '../../_utils/types';
|
|
4
4
|
declare type ILabelItem = {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
@@ -34,8 +34,9 @@ declare class QmAnchor extends Component<IProps, IState> {
|
|
|
34
34
|
static defaultProps: {
|
|
35
35
|
labelWidth: number;
|
|
36
36
|
};
|
|
37
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
37
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
38
38
|
private currentState;
|
|
39
|
+
private itemsTotal;
|
|
39
40
|
private timer;
|
|
40
41
|
private scrollEvent;
|
|
41
42
|
private scrollRef;
|
|
@@ -46,7 +47,8 @@ declare class QmAnchor extends Component<IProps, IState> {
|
|
|
46
47
|
createDistances(): number[];
|
|
47
48
|
findCurrentIndex(t: number): number;
|
|
48
49
|
onScrollHandle: (ev: MouseEvent) => void;
|
|
49
|
-
onTabClickHandle: (index: number
|
|
50
|
+
onTabClickHandle: (index: number) => void;
|
|
51
|
+
SCROLL_TO_ITEM: (index: number) => void;
|
|
50
52
|
render(): React.ReactElement;
|
|
51
53
|
}
|
|
52
54
|
export default QmAnchor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/antd/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import type { ButtonProps } from '../../antd';
|
|
4
4
|
declare type IProps = ButtonProps & {
|
|
5
|
-
click?: () => Promise<void
|
|
5
|
+
click?: () => Promise<void> | void;
|
|
6
6
|
confirm?: {
|
|
7
7
|
title?: string;
|
|
8
8
|
onConfirm?: () => void;
|
|
@@ -22,7 +22,7 @@ declare class QmButton extends Component<IProps, IState> {
|
|
|
22
22
|
onCancel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
23
23
|
}>>;
|
|
24
24
|
};
|
|
25
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
25
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
26
26
|
state: IState;
|
|
27
27
|
clickHandle: () => Promise<void>;
|
|
28
28
|
render(): React.ReactElement;
|
|
@@ -3,7 +3,8 @@ import { Locale, ComponentSize } from '../_utils/types';
|
|
|
3
3
|
export declare type IConfig = {
|
|
4
4
|
locale: Locale;
|
|
5
5
|
size: ComponentSize;
|
|
6
|
-
|
|
6
|
+
theme?: string;
|
|
7
|
+
global?: Record<string, any>;
|
|
7
8
|
};
|
|
8
|
-
declare const ConfigContext: import("react").Context<IConfig
|
|
9
|
+
declare const ConfigContext: import("react").Context<IConfig>;
|
|
9
10
|
export default ConfigContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { CountUpProps } from 'react-countup/build/CountUp';
|
|
3
|
-
import { ComponentSize, CSSProperties } from '../../_utils/types';
|
|
3
|
+
import type { ComponentSize, CSSProperties } from '../../_utils/types';
|
|
4
4
|
declare type IProps = CountUpProps & {
|
|
5
5
|
size?: ComponentSize;
|
|
6
6
|
className?: string;
|
|
@@ -11,7 +11,7 @@ declare class QmCountup extends Component<IProps> {
|
|
|
11
11
|
static defaultProps: {
|
|
12
12
|
duration: number;
|
|
13
13
|
};
|
|
14
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
14
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
15
15
|
render(): React.ReactElement;
|
|
16
16
|
}
|
|
17
17
|
export default QmCountup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ComponentSize, CSSProperties, JSXElement } from '../../_utils/types';
|
|
3
|
+
import type { ComponentSize, CSSProperties, JSXElement } from '../../_utils/types';
|
|
4
4
|
declare type IProps = {
|
|
5
5
|
label: string;
|
|
6
6
|
size?: ComponentSize;
|
|
@@ -18,7 +18,7 @@ declare class QmDivider extends Component<IProps> {
|
|
|
18
18
|
extra: PropTypes.Requireable<string | PropTypes.ReactElementLike>;
|
|
19
19
|
collapse: PropTypes.Requireable<boolean>;
|
|
20
20
|
};
|
|
21
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
21
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
22
22
|
clickHandle: () => void;
|
|
23
23
|
render(): React.ReactElement;
|
|
24
24
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
import type { AnyObject, AjaxResponse, ComponentSize } from '../../_utils/types';
|
|
3
4
|
import type { ButtonProps } from '../../antd';
|
|
4
|
-
import { AnyFunction, AnyObject } from '../../_utils/types';
|
|
5
5
|
declare type HttpRequestHeader = {
|
|
6
6
|
[key: string]: string;
|
|
7
7
|
};
|
|
8
8
|
declare type ActionConfig = {
|
|
9
|
-
api:
|
|
9
|
+
api: (params?: Record<string, unknown>) => Promise<AjaxResponse>;
|
|
10
10
|
params?: AnyObject<unknown>;
|
|
11
11
|
};
|
|
12
12
|
declare type IProps = Omit<ButtonProps, 'prefixCls' | 'ghost' | 'danger' | 'block'> & {
|
|
13
13
|
action: string | ActionConfig;
|
|
14
14
|
fileName?: string;
|
|
15
|
+
size?: ComponentSize;
|
|
15
16
|
headers?: HttpRequestHeader;
|
|
16
17
|
withCredentials?: boolean;
|
|
17
18
|
params?: AnyObject<unknown>;
|
|
18
|
-
beforeDownload?:
|
|
19
|
-
onSuccess
|
|
20
|
-
onError:
|
|
19
|
+
beforeDownload?: (action: string) => boolean;
|
|
20
|
+
onSuccess?: () => void;
|
|
21
|
+
onError?: (error: AnyObject<unknown>) => void;
|
|
21
22
|
};
|
|
22
23
|
declare type IState = {
|
|
23
24
|
loading: boolean;
|
|
@@ -29,6 +30,7 @@ declare class QmDownload extends Component<IProps, IState> {
|
|
|
29
30
|
api: PropTypes.Validator<(...args: any[]) => any>;
|
|
30
31
|
params: PropTypes.Requireable<object>;
|
|
31
32
|
}>>;
|
|
33
|
+
size: (props: any, propName: any, componentName: any) => void;
|
|
32
34
|
fileName: PropTypes.Requireable<string>;
|
|
33
35
|
headers: PropTypes.Requireable<object>;
|
|
34
36
|
withCredentials: PropTypes.Requireable<boolean>;
|
|
@@ -42,6 +44,7 @@ declare class QmDownload extends Component<IProps, IState> {
|
|
|
42
44
|
children: string;
|
|
43
45
|
withCredentials: boolean;
|
|
44
46
|
};
|
|
47
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
45
48
|
state: IState;
|
|
46
49
|
getActionUrl(): Promise<string>;
|
|
47
50
|
downloadFile(url: string): Promise<void>;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ComponentSize } from '../../_utils/types';
|
|
3
|
+
import type { ComponentSize, Nullable } from '../../_utils/types';
|
|
4
4
|
import type { DrawerProps } from '../../antd';
|
|
5
|
+
declare type EventType = React.MouseEvent<HTMLElement>;
|
|
5
6
|
declare type IProps = DrawerProps & {
|
|
6
7
|
size?: ComponentSize;
|
|
7
8
|
loading?: boolean;
|
|
9
|
+
onClose?: (e: EventType) => void;
|
|
10
|
+
onClosed?: () => void;
|
|
8
11
|
};
|
|
9
12
|
declare type IState = {
|
|
10
13
|
fullscreen: boolean;
|
|
11
14
|
spinning: boolean;
|
|
15
|
+
sloading: boolean;
|
|
12
16
|
};
|
|
13
17
|
export declare type QmDrawerProps = IProps;
|
|
14
18
|
declare class QmDrawer extends Component<IProps, IState> {
|
|
15
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
19
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
16
20
|
static propTypes: {
|
|
17
21
|
size: (props: any, propName: any, componentName: any) => void;
|
|
18
22
|
spinning: PropTypes.Requireable<boolean>;
|
|
@@ -20,14 +24,18 @@ declare class QmDrawer extends Component<IProps, IState> {
|
|
|
20
24
|
static defaultProps: {
|
|
21
25
|
width: string;
|
|
22
26
|
destroyOnClose: boolean;
|
|
23
|
-
maskClosable: boolean;
|
|
24
27
|
};
|
|
28
|
+
titleRef: React.RefObject<HTMLSpanElement>;
|
|
29
|
+
$drawer: Nullable<HTMLElement>;
|
|
25
30
|
state: IState;
|
|
26
31
|
private opened;
|
|
27
|
-
|
|
32
|
+
componentWillUnmount(): void;
|
|
33
|
+
componentDidUpdate(prevProps: IProps, prevState: IState): void;
|
|
28
34
|
afterVisibleChange: (visible: boolean) => void;
|
|
29
|
-
toggleHandle: (
|
|
35
|
+
toggleHandle: () => void;
|
|
30
36
|
renderTitle(): JSX.Element;
|
|
37
|
+
START_LOADING: () => void;
|
|
38
|
+
STOP_LOADING: () => void;
|
|
31
39
|
render(): React.ReactElement;
|
|
32
40
|
}
|
|
33
41
|
export default QmDrawer;
|
package/lib/empty/src/empty.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
|
-
import { ComponentSize } from '../../_utils/types';
|
|
2
|
+
import type { ComponentSize } from '../../_utils/types';
|
|
3
3
|
import type { EmptyProps } from '../../antd';
|
|
4
4
|
declare type IProps = EmptyProps & {
|
|
5
5
|
size?: ComponentSize;
|
|
6
6
|
};
|
|
7
7
|
export declare type QmEmptyProps = IProps;
|
|
8
8
|
declare class QmEmpty extends Component<IProps> {
|
|
9
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
9
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
10
10
|
static propTypes: {
|
|
11
11
|
size: (props: any, propName: any, componentName: any) => void;
|
|
12
12
|
};
|
|
@@ -9,7 +9,7 @@ declare type IState = {
|
|
|
9
9
|
visible: boolean;
|
|
10
10
|
};
|
|
11
11
|
declare class FieldsFilter extends Component<IProps, IState> {
|
|
12
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
12
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
13
13
|
private linkRef;
|
|
14
14
|
state: IState;
|
|
15
15
|
get formUniqueKey(): string;
|
|
@@ -14,7 +14,7 @@ declare class FormCascader extends Component<IProps, IState> {
|
|
|
14
14
|
state: IState;
|
|
15
15
|
componentDidMount(): void;
|
|
16
16
|
componentDidUpdate(prevProps: IProps): void;
|
|
17
|
-
createViewText(val: string |
|
|
17
|
+
createViewText(val: string | string[], items: IDict[]): string;
|
|
18
18
|
getItemList(): Promise<void>;
|
|
19
19
|
render(): React.ReactElement;
|
|
20
20
|
}
|
|
@@ -3,8 +3,20 @@ import type { IFormItem } from './types';
|
|
|
3
3
|
declare type IProps = {
|
|
4
4
|
option: IFormItem;
|
|
5
5
|
};
|
|
6
|
+
declare type IInputProps<T = string> = IProps & {
|
|
7
|
+
value?: T;
|
|
8
|
+
onChange?: (value: T) => void;
|
|
9
|
+
onValuesChange: (value: T) => void;
|
|
10
|
+
};
|
|
11
|
+
declare class VInput extends Component<IInputProps> {
|
|
12
|
+
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
13
|
+
triggerChange: (value: string) => void;
|
|
14
|
+
render(): JSX.Element;
|
|
15
|
+
}
|
|
6
16
|
declare class FormInput extends Component<IProps> {
|
|
7
17
|
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
18
|
+
inputRef: React.RefObject<VInput>;
|
|
19
|
+
focus: () => void;
|
|
8
20
|
render(): React.ReactElement;
|
|
9
21
|
}
|
|
10
22
|
export default FormInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import type { IFormItem } from './types';
|
|
3
|
+
declare type IProps = {
|
|
4
|
+
option: IFormItem;
|
|
5
|
+
};
|
|
6
|
+
declare class FormMultipleSearchHelper extends Component<IProps> {
|
|
7
|
+
static contextType: React.Context<import("./context").IFormContext | undefined>;
|
|
8
|
+
render(): React.ReactElement;
|
|
9
|
+
}
|
|
10
|
+
export default FormMultipleSearchHelper;
|
package/lib/form/src/form.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import { IFieldData } from './types';
|
|
4
4
|
import type { IFormProps, IFormData, IFormItem, IExtraData, IViewData, IExpandData } from './types';
|
|
5
|
-
import { JSXElement, ValueOf } from '../../_utils/types';
|
|
5
|
+
import type { JSXElement, ValueOf } from '../../_utils/types';
|
|
6
6
|
import type { FormProps } from '../../antd';
|
|
7
7
|
declare type IProps = FormProps & IFormProps;
|
|
8
8
|
declare type IState = {
|
|
@@ -16,7 +16,7 @@ declare type IState = {
|
|
|
16
16
|
};
|
|
17
17
|
export declare type QmFormProps = IProps;
|
|
18
18
|
declare class QmForm extends Component<IProps, IState> {
|
|
19
|
-
static contextType: React.Context<import("../../config-provider/context").IConfig
|
|
19
|
+
static contextType: React.Context<import("../../config-provider/context").IConfig>;
|
|
20
20
|
static propTypes: {
|
|
21
21
|
items: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
22
22
|
type: import("prop-types").Validator<string>;
|
|
@@ -26,6 +26,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
26
26
|
initialExtras: import("prop-types").Requireable<object>;
|
|
27
27
|
size: (props: any, propName: any, componentName: any) => void;
|
|
28
28
|
cols: import("prop-types").Requireable<number>;
|
|
29
|
+
customClass: import("prop-types").Requireable<string>;
|
|
29
30
|
labelWidth: import("prop-types").Requireable<string | number>;
|
|
30
31
|
labelAlign: import("prop-types").Requireable<string>;
|
|
31
32
|
formType: import("prop-types").Requireable<string>;
|
|
@@ -59,7 +60,6 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
59
60
|
defaultRows: number;
|
|
60
61
|
isAutoFocus: boolean;
|
|
61
62
|
isCollapse: boolean;
|
|
62
|
-
isFieldsDefine: boolean;
|
|
63
63
|
isSearchBtn: boolean;
|
|
64
64
|
onValuesChange: () => void;
|
|
65
65
|
onFieldsChange: () => void;
|
|
@@ -111,11 +111,14 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
111
111
|
type: any;
|
|
112
112
|
fieldName: any;
|
|
113
113
|
}): boolean;
|
|
114
|
+
formatFormValue: (values: IFormData) => IFormData;
|
|
115
|
+
getFormAuth(): Promise<void>;
|
|
114
116
|
INPUT(option: IFormItem): JSXElement;
|
|
115
117
|
RANGE_INPUT(option: IFormItem): JSXElement;
|
|
116
118
|
INPUT_NUMBER(option: IFormItem): JSXElement;
|
|
117
119
|
RANGE_INPUT_NUMBER(option: IFormItem): JSXElement;
|
|
118
120
|
SEARCH_HELPER(option: IFormItem): JSXElement;
|
|
121
|
+
MULTIPLE_SEARCH_HELPER(option: IFormItem): JSXElement;
|
|
119
122
|
CHECKBOX(option: IFormItem): JSXElement;
|
|
120
123
|
MULTIPLE_CHECKBOX(option: IFormItem): JSXElement;
|
|
121
124
|
RADIO(option: IFormItem): JSXElement;
|
|
@@ -132,6 +135,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
132
135
|
TREE_SELECT(option: IFormItem): JSXElement;
|
|
133
136
|
MULTIPLE_TREE_SELECT(option: IFormItem): JSXElement;
|
|
134
137
|
CASCADER(option: IFormItem): JSXElement;
|
|
138
|
+
MULTIPLE_CASCADER(option: IFormItem): JSXElement;
|
|
135
139
|
CITY_SELECT(option: IFormItem): JSXElement;
|
|
136
140
|
REGION_SELECT(option: IFormItem): JSXElement;
|
|
137
141
|
UPLOAD_FILE(option: IFormItem): JSXElement;
|
|
@@ -146,6 +150,7 @@ declare class QmForm extends Component<IProps, IState> {
|
|
|
146
150
|
createFormLayout(): (JSX.Element | null)[];
|
|
147
151
|
createSearchButtonLayout(lastCols?: number): JSX.Element | null;
|
|
148
152
|
createFormButtonLayout(): JSX.Element | null;
|
|
153
|
+
createFieldsDefine: () => JSX.Element;
|
|
149
154
|
setExpandHandle: (collapse: boolean) => void;
|
|
150
155
|
valuesChangeHandle: (changedValues: IFormData, allValues: IFormData) => void;
|
|
151
156
|
fieldsChangeHandle: (changedFields: IFieldData[], allFields: IFieldData[]) => void;
|
package/lib/form/src/types.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ export declare const DEFAULT_TRUE_VALUE = "1";
|
|
|
11
11
|
export declare const DEFAULT_FALSE_VALUE = "0";
|
|
12
12
|
export declare type ILabelAlign = 'left' | 'right';
|
|
13
13
|
export declare type IFormType = 'default' | 'search' | 'onlyShow';
|
|
14
|
-
export declare type IFormItemType = 'DIVIDER' | 'INPUT' | 'TEXT_AREA' | 'RANGE_INPUT' | 'INPUT_NUMBER' | 'RANGE_INPUT_NUMBER' | 'CHECKBOX' | 'MULTIPLE_CHECKBOX' | 'RADIO' | 'SWITCH' | 'DATE' | 'RANGE_DATE' | 'TIME' | 'RANGE_TIME' | 'SELECT' | 'MULTIPLE_SELECT' | 'IMMEDIATE' | 'SEARCH_HELPER' | 'TREE_SELECT' | 'MULTIPLE_TREE_SELECT' | 'CASCADER' | 'CITY_SELECT' | 'REGION_SELECT' | 'UPLOAD_FILE' | 'UPLOAD_IMG' | 'TINYMCE';
|
|
14
|
+
export declare type IFormItemType = 'DIVIDER' | 'INPUT' | 'TEXT_AREA' | 'RANGE_INPUT' | 'INPUT_NUMBER' | 'RANGE_INPUT_NUMBER' | 'CHECKBOX' | 'MULTIPLE_CHECKBOX' | 'RADIO' | 'SWITCH' | 'DATE' | 'RANGE_DATE' | 'TIME' | 'RANGE_TIME' | 'SELECT' | 'MULTIPLE_SELECT' | 'IMMEDIATE' | 'SEARCH_HELPER' | 'MULTIPLE_SEARCH_HELPER' | 'TREE_SELECT' | 'MULTIPLE_TREE_SELECT' | 'CASCADER' | 'MULTIPLE_CASCADER' | 'CITY_SELECT' | 'REGION_SELECT' | 'UPLOAD_FILE' | 'UPLOAD_IMG' | 'TINYMCE';
|
|
15
15
|
export declare const ARRAY_TYPE: IFormItemType[];
|
|
16
16
|
export declare const BUILT_IN_PLACEMENTS: BuildInPlacements;
|
|
17
|
+
export declare type ISecretType = 'name' | 'phone' | 'IDnumber' | 'bankCard';
|
|
17
18
|
export declare type IDateType = 'date' | 'datetime' | 'exactdate' | 'week' | 'month' | 'quarter' | 'year';
|
|
18
19
|
export declare enum EDateType {
|
|
19
20
|
'date' = "date",
|
|
@@ -33,11 +34,7 @@ export declare enum EDateFormat {
|
|
|
33
34
|
'quarter' = "YYYY-[Q]Q",
|
|
34
35
|
'year' = "YYYY"
|
|
35
36
|
}
|
|
36
|
-
export declare
|
|
37
|
-
'hour' = "hour",
|
|
38
|
-
'hour-minute' = "hour-minute",
|
|
39
|
-
'hour-minute-second' = "hour-minute-second"
|
|
40
|
-
}
|
|
37
|
+
export declare type ITimeType = 'hour' | 'hour-minute' | 'hour-minute-second';
|
|
41
38
|
export declare enum ETimeFormat {
|
|
42
39
|
'hour' = "HH",
|
|
43
40
|
'hour-minute' = "HH:mm",
|
|
@@ -61,9 +58,7 @@ export declare type IAuthConfig = {
|
|
|
61
58
|
fetch: {
|
|
62
59
|
api: IFetchFn;
|
|
63
60
|
params?: IFetchParams;
|
|
64
|
-
|
|
65
|
-
exportDataKey?: string;
|
|
66
|
-
printDataKey?: string;
|
|
61
|
+
dataKey?: string;
|
|
67
62
|
};
|
|
68
63
|
};
|
|
69
64
|
export declare type IFormItem = {
|
|
@@ -91,9 +86,12 @@ export declare type IFormItem = {
|
|
|
91
86
|
prefix?: React.ReactNode;
|
|
92
87
|
suffix?: React.ReactNode;
|
|
93
88
|
maxLength?: number;
|
|
89
|
+
toUpper?: boolean;
|
|
90
|
+
secretType?: ISecretType;
|
|
94
91
|
step?: number;
|
|
95
92
|
min?: number;
|
|
96
93
|
max?: number;
|
|
94
|
+
controls?: boolean;
|
|
97
95
|
precision?: number;
|
|
98
96
|
formatter?: (value: number | string) => string;
|
|
99
97
|
parser?: (value: string) => string | number;
|
|
@@ -108,23 +106,27 @@ export declare type IFormItem = {
|
|
|
108
106
|
minDateTime?: string;
|
|
109
107
|
maxDateTime?: string;
|
|
110
108
|
disableds?: [boolean, boolean];
|
|
111
|
-
timeType?:
|
|
109
|
+
timeType?: ITimeType;
|
|
112
110
|
hourStep?: number;
|
|
113
111
|
minuteStep?: number;
|
|
114
112
|
secondStep?: number;
|
|
115
113
|
filterable?: boolean;
|
|
116
114
|
collapseTags?: boolean;
|
|
115
|
+
maxTagTextLength?: number;
|
|
117
116
|
openPyt?: boolean;
|
|
117
|
+
hideHeader?: boolean;
|
|
118
118
|
onlySelect?: boolean;
|
|
119
119
|
columns?: IColumn[];
|
|
120
120
|
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
121
121
|
extraAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
122
122
|
multiple?: boolean;
|
|
123
123
|
maxCount?: number;
|
|
124
|
+
fileTypes?: string[];
|
|
125
|
+
fileSize?: number;
|
|
124
126
|
onRemove?: (file: any) => void;
|
|
125
127
|
fixedSize?: [number, number] | undefined;
|
|
126
128
|
quality?: number;
|
|
127
|
-
|
|
129
|
+
tinymceHeight?: number | string;
|
|
128
130
|
};
|
|
129
131
|
searchHelper?: {
|
|
130
132
|
filters?: IFormItem[];
|
|
@@ -134,6 +136,7 @@ export declare type IFormItem = {
|
|
|
134
136
|
rowKey?: ((row: IRecord, index: number) => IRowKey) | IRowKey;
|
|
135
137
|
webPagination?: boolean;
|
|
136
138
|
};
|
|
139
|
+
width?: number | string;
|
|
137
140
|
initialValue?: IFormData;
|
|
138
141
|
closeRemoteMatch?: boolean;
|
|
139
142
|
fieldAliasMap?: (() => Record<string, string>) | Record<string, string>;
|
|
@@ -168,6 +171,7 @@ export declare type IFormItem = {
|
|
|
168
171
|
fieldName: string;
|
|
169
172
|
showLabel?: boolean;
|
|
170
173
|
}>;
|
|
174
|
+
onCollapse?: (collapse: boolean) => void;
|
|
171
175
|
};
|
|
172
176
|
render?: (options: IFormItem, instance: any) => JSXElement;
|
|
173
177
|
onChange?: (value: ValueOf<IFormData> | boolean, others?: string | Nullable<IFormData>) => void;
|
|
@@ -180,6 +184,7 @@ export declare type IFormProps = {
|
|
|
180
184
|
initialExtras?: IExtraData;
|
|
181
185
|
size?: ComponentSize;
|
|
182
186
|
cols?: number;
|
|
187
|
+
customClass?: string;
|
|
183
188
|
labelWidth?: number | string;
|
|
184
189
|
labelAlign?: ILabelAlign;
|
|
185
190
|
formType?: IFormType;
|
|
@@ -207,6 +212,7 @@ export declare const propTypes: {
|
|
|
207
212
|
initialExtras: PropTypes.Requireable<object>;
|
|
208
213
|
size: (props: any, propName: any, componentName: any) => void;
|
|
209
214
|
cols: PropTypes.Requireable<number>;
|
|
215
|
+
customClass: PropTypes.Requireable<string>;
|
|
210
216
|
labelWidth: PropTypes.Requireable<string | number>;
|
|
211
217
|
labelAlign: PropTypes.Requireable<string>;
|
|
212
218
|
formType: PropTypes.Requireable<string>;
|
|
@@ -240,7 +246,6 @@ export declare const defaultProps: {
|
|
|
240
246
|
defaultRows: number;
|
|
241
247
|
isAutoFocus: boolean;
|
|
242
248
|
isCollapse: boolean;
|
|
243
|
-
isFieldsDefine: boolean;
|
|
244
249
|
isSearchBtn: boolean;
|
|
245
250
|
onValuesChange: () => void;
|
|
246
251
|
onFieldsChange: () => void;
|
package/lib/form/src/utils.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import dayjs, { Dayjs } from 'dayjs';
|
|
2
2
|
export declare const getDate: (dateString: string | undefined, format: string) => dayjs.Dayjs | null;
|
|
3
3
|
export declare const formatDate: (date: Dayjs | null, format: string) => string;
|
|
4
|
+
export declare const isEmptyValue: (value: unknown) => boolean;
|
|
4
5
|
export declare const deepMapList: (list: any[], valueKey: string, textKey: string) => any[];
|
|
5
6
|
export declare const deepFind: (arr: any[], mark: string) => any;
|
|
6
7
|
export declare const deepFindValues: <T>(arr: T[], str: string, depth?: number) => T[];
|
|
7
8
|
export declare const deepGetPath: (arr: any[], value: string) => string[] | undefined;
|
|
9
|
+
export declare const formatNumber: (value: string | number) => string;
|
|
10
|
+
export declare const parserNumber: (value: string) => string;
|
|
11
|
+
export declare const secretFormat: (value: string | undefined, type: string) => string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: 焦质晔
|
|
3
3
|
* @Date: 2021-07-23 19:05:57
|
|
4
4
|
* @Last Modified by: 焦质晔
|
|
5
|
-
* @Last Modified time: 2022-
|
|
5
|
+
* @Last Modified time: 2022-02-28 13:36:58
|
|
6
6
|
*/
|
|
7
7
|
@import '../../style/common';
|
|
8
8
|
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
&.ant-form-item-with-help {
|
|
15
15
|
margin-bottom: 0;
|
|
16
16
|
}
|
|
17
|
-
// label
|
|
18
|
-
.ant-form-item-label {
|
|
19
|
-
label[title=''] {
|
|
20
|
-
width: 100%;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
17
|
// valigator
|
|
24
18
|
.ant-form-item-explain {
|
|
25
19
|
.text-overflow-cut();
|
|
@@ -30,6 +24,10 @@
|
|
|
30
24
|
font-size: @--font-size-sm;
|
|
31
25
|
line-height: 1;
|
|
32
26
|
}
|
|
27
|
+
// search
|
|
28
|
+
.ant-input-search > .ant-input-group > .ant-input-group-addon {
|
|
29
|
+
line-height: 1;
|
|
30
|
+
}
|
|
33
31
|
// textarea
|
|
34
32
|
.ant-input-textarea-show-count {
|
|
35
33
|
position: relative;
|
|
@@ -47,15 +45,14 @@
|
|
|
47
45
|
transform: scale(1.2);
|
|
48
46
|
}
|
|
49
47
|
.extra-text {
|
|
50
|
-
|
|
48
|
+
height: 100%;
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
51
|
}
|
|
52
52
|
.extra-overflow-cut {
|
|
53
53
|
.text-overflow-cut();
|
|
54
54
|
}
|
|
55
55
|
// range input
|
|
56
|
-
.site-input-split {
|
|
57
|
-
// background-color: @--body-background;
|
|
58
|
-
}
|
|
59
56
|
.site-input-left {
|
|
60
57
|
border-right-width: 0;
|
|
61
58
|
z-index: 1;
|
|
@@ -71,12 +68,33 @@
|
|
|
71
68
|
.site-input-right:focus {
|
|
72
69
|
border-left-width: 1px;
|
|
73
70
|
}
|
|
71
|
+
// search-helper-multiple
|
|
72
|
+
.search-helper-multiple {
|
|
73
|
+
.ant-input-group > .ant-select:first-child {
|
|
74
|
+
z-index: 1;
|
|
75
|
+
.ant-select-selector {
|
|
76
|
+
border-top-right-radius: 0;
|
|
77
|
+
border-bottom-right-radius: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
&__only-show {
|
|
83
|
+
.ant-form-item > .ant-form-item-control {
|
|
84
|
+
* {
|
|
85
|
+
pointer-events: none !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
74
88
|
}
|
|
75
89
|
// ------ size ------
|
|
76
90
|
// 40 32 24
|
|
77
91
|
&--lg {
|
|
78
92
|
}
|
|
79
93
|
&--sm {
|
|
94
|
+
.ant-form-item-label > label,
|
|
95
|
+
.ant-form-item-label .ant-form-item-tooltip {
|
|
96
|
+
font-size: @--font-size-sm;
|
|
97
|
+
}
|
|
80
98
|
}
|
|
81
99
|
}
|
|
82
100
|
|
|
@@ -234,10 +252,17 @@
|
|
|
234
252
|
line-height: 1.75;
|
|
235
253
|
.text-overflow-cut();
|
|
236
254
|
.handle {
|
|
237
|
-
|
|
255
|
+
padding: 2px;
|
|
256
|
+
color: @--text-color-secondary;
|
|
238
257
|
cursor: s-resize;
|
|
258
|
+
transform: scale(0.9);
|
|
239
259
|
}
|
|
240
260
|
}
|
|
241
261
|
}
|
|
242
262
|
}
|
|
263
|
+
&--lg {
|
|
264
|
+
}
|
|
265
|
+
&--sm {
|
|
266
|
+
font-size: @--font-size-sm;
|
|
267
|
+
}
|
|
243
268
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -38,5 +38,8 @@ export type { QmTableProps, QmTableColumn } from './table';
|
|
|
38
38
|
export { default as QmTable } from './table';
|
|
39
39
|
export type { QmSearchHelperProps } from './search-helper';
|
|
40
40
|
export { default as QmSearchHelper } from './search-helper';
|
|
41
|
+
export type { QmPrintProps } from './print';
|
|
42
|
+
export { default as QmPrint } from './print';
|
|
43
|
+
export { default as pinyin } from './pinyin';
|
|
41
44
|
export { default as version } from './version';
|
|
42
45
|
export * from './antd';
|