@hzab/form-render-mobile 1.2.8 → 1.2.9
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/LICENSE +21 -0
- package/dist/common/array-base-utils.d.ts +9 -0
- package/dist/common/global-props-context.d.ts +8 -0
- package/dist/common/location-utils.d.ts +80 -0
- package/dist/components/ArrayCards/index.d.ts +10 -0
- package/dist/components/ArrayTable/common/utils.d.ts +23 -0
- package/dist/components/ArrayTable/index.d.ts +8 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/common/utils.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +16 -0
- package/dist/components/FormCollapse/index.d.ts +30 -0
- package/dist/components/FormItem/common/useFormItemLayout.d.ts +83 -0
- package/dist/components/FormItem/index.d.ts +9 -0
- package/dist/components/FormLayout/index.d.ts +76 -0
- package/dist/components/FormLayout/style.d.ts +1 -0
- package/dist/components/FormLayout/useResponsiveFormLayout.d.ts +17 -0
- package/dist/components/LocationPicker/Map/AMap/common/loader.d.ts +2 -0
- package/dist/components/LocationPicker/Map/AMap/common/utils.d.ts +74 -0
- package/dist/components/LocationPicker/common/utils.d.ts +24 -0
- package/dist/components/LocationPicker/components/ModalContent/index.d.ts +3 -0
- package/dist/components/LocationPicker/components/Notice/index.d.ts +2 -0
- package/dist/components/LocationPicker/components/PickerInfo/index.d.ts +3 -0
- package/dist/components/LocationPicker/components/ResInfo/index.d.ts +8 -0
- package/dist/components/LocationPicker/index.d.ts +3 -0
- package/dist/components/LocationPicker/servers/index.d.ts +21 -0
- package/dist/components/PickerRightOutline/index.d.ts +3 -0
- package/dist/components/Placeholder/index.d.ts +7 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Text/index.d.ts +9 -0
- package/dist/components/TimePicker/common/utils.d.ts +1 -0
- package/dist/components/TimePicker/index.d.ts +6 -0
- package/dist/components/TreeSelect/SelectList/index.d.ts +3 -0
- package/dist/components/TreeSelect/TreeSearch/index.d.ts +3 -0
- package/dist/components/TreeSelect/common/data-handler.d.ts +70 -0
- package/dist/components/TreeSelect/index.d.ts +3 -0
- package/dist/components/Uploader/common/checkFileType.d.ts +4 -0
- package/dist/components/Uploader/common/img.d.ts +10 -0
- package/dist/components/Uploader/components/Image/index.d.ts +3 -0
- package/dist/components/Uploader/components/ItemList/ItemRender.d.ts +2 -0
- package/dist/components/Uploader/components/ItemList/index.d.ts +2 -0
- package/dist/components/UserSelect/index.d.ts +37 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/globalConfig.d.ts +6 -0
- package/dist/index.cjs +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3178 -0
- package/package.json +65 -76
- package/src/common/array-base-utils.ts +1 -1
- package/src/components/ArrayCards/index.tsx +5 -3
- package/src/components/ArrayTable/common/utils.tsx +2 -2
- package/src/components/ArrayTable/index.tsx +6 -3
- package/src/components/Checkbox/index.tsx +1 -1
- package/src/components/DatePicker/index.tsx +3 -3
- package/src/components/FormCollapse/index.tsx +5 -3
- package/src/components/FormItem/index.tsx +2 -1
- package/src/components/FormLayout/useResponsiveFormLayout.ts +1 -1
- package/src/components/LocationPicker/Map/AMap/common/utils.ts +6 -6
- package/src/components/LocationPicker/common/utils.ts +3 -3
- package/src/components/LocationPicker/components/ModalContent/index.tsx +1 -1
- package/src/components/LocationPicker/index.tsx +1 -1
- package/src/components/Radio/index.tsx +2 -1
- package/src/components/Select/index.tsx +2 -2
- package/src/components/TimePicker/common/utils.ts +1 -1
- package/src/components/TimePicker/index.tsx +2 -2
- package/src/components/Uploader/common/img.ts +4 -4
- package/src/components/UserSelect/index.tsx +1 -1
- package/src/global.d.ts +14 -0
- package/src/index.tsx +1 -1
- package/src/type.d.ts +7 -6
- package/src/vite-env.d.ts +1 -0
- package/README.md +0 -111
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CaiYansong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ISchema } from "@formily/json-schema";
|
|
2
|
+
export declare const isAdditionComponent: (schema: ISchema) => boolean;
|
|
3
|
+
export declare const isIndexComponent: (schema: ISchema) => boolean;
|
|
4
|
+
export declare const isRemoveComponent: (schema: ISchema) => boolean;
|
|
5
|
+
export declare const isCopyComponent: (schema: ISchema) => boolean;
|
|
6
|
+
export declare const isMoveUpComponent: (schema: ISchema) => boolean;
|
|
7
|
+
export declare const isMoveDownComponent: (schema: ISchema) => boolean;
|
|
8
|
+
export declare const renderTitle: (props: any, field: any, index?: number) => any;
|
|
9
|
+
export declare const isOperationComponent: (schema: ISchema) => boolean;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
resolveLocalFileSystemURL?: (url: string, successCallback: (entry: any) => void, errorCallback?: (error: any) => void) => void;
|
|
4
|
+
chooser?: {
|
|
5
|
+
getFile: any;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface Navigator {
|
|
9
|
+
camera?: {
|
|
10
|
+
getPicture: (onSuccess: (imageData: string) => void, onError: (message: string) => void, options?: any) => void;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
interface IGalleryUopload {
|
|
16
|
+
options?: Partial<{
|
|
17
|
+
quality: number;
|
|
18
|
+
destinationType: number;
|
|
19
|
+
sourceType: number;
|
|
20
|
+
encodingType: string;
|
|
21
|
+
mediaType: string;
|
|
22
|
+
allowEdit: boolean;
|
|
23
|
+
correctOrientation: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
onUploadSuccess?: (image: string | File) => void;
|
|
26
|
+
onUploadError?: (fail: any) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function getCurrentPosition(config?: any): Promise<any>;
|
|
29
|
+
/**
|
|
30
|
+
* 通过cordova-plugin-camera插件上传图片
|
|
31
|
+
*/
|
|
32
|
+
export declare function onGalleryUopload(opt?: IGalleryUopload): void;
|
|
33
|
+
interface ChooseUpload {
|
|
34
|
+
quality: number;
|
|
35
|
+
destinationType: number;
|
|
36
|
+
sourceType: number;
|
|
37
|
+
encodingType: string;
|
|
38
|
+
mediaType: string;
|
|
39
|
+
allowEdit: boolean;
|
|
40
|
+
correctOrientation: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface IChooserOptions {
|
|
43
|
+
mimeTypes?: string[];
|
|
44
|
+
}
|
|
45
|
+
export declare enum ErrorCallbackEnum {
|
|
46
|
+
SIZE_EXCEED_ERROR = 1,
|
|
47
|
+
FILE_TYPE_ERROR = 2
|
|
48
|
+
}
|
|
49
|
+
type ExclusiveOptions = ChooseUpload & IChooserOptions;
|
|
50
|
+
interface IUploadOptions {
|
|
51
|
+
additionalParams?: ExclusiveOptions;
|
|
52
|
+
errorCallback?: (type?: ErrorCallbackEnum) => void;
|
|
53
|
+
onSuccess?: (values: {
|
|
54
|
+
blob: Blob;
|
|
55
|
+
fileType: string;
|
|
56
|
+
}) => void;
|
|
57
|
+
onError?: (error: Error) => void;
|
|
58
|
+
}
|
|
59
|
+
interface IUploader {
|
|
60
|
+
upload(options: IUploadOptions): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 基础类
|
|
64
|
+
*/
|
|
65
|
+
export default class UploadManager {
|
|
66
|
+
private uploader;
|
|
67
|
+
defaultAccept: string[];
|
|
68
|
+
constructor(uploader: IUploader);
|
|
69
|
+
addAccept(accepts: string[]): void;
|
|
70
|
+
protected setUploader(uploader: IUploader): void;
|
|
71
|
+
uploadFile(options: IUploadOptions): void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 通过cordova-plugin-chooser上传文件
|
|
75
|
+
* 文档:https://github.com/MaximBelov/cordova-plugin-chooser
|
|
76
|
+
*/
|
|
77
|
+
export declare class ChooserUploader extends UploadManager implements IUploader {
|
|
78
|
+
upload(options: IUploadOptions): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CardProps } from "antd-mobile";
|
|
3
|
+
import type { ArrayBaseMixins, IArrayBaseProps } from "@formily/antd-mobile/esm/array-base";
|
|
4
|
+
type CustomPropsT = {
|
|
5
|
+
titles: Array<string>;
|
|
6
|
+
isOrderTitle: boolean;
|
|
7
|
+
};
|
|
8
|
+
type ComposedArrayCards = React.FC<React.PropsWithChildren<CardProps & IArrayBaseProps & CustomPropsT>> & ArrayBaseMixins;
|
|
9
|
+
export declare const ArrayCards: ComposedArrayCards;
|
|
10
|
+
export default ArrayCards;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { GeneralField, FieldDisplayTypes, ArrayField } from "@formily/core";
|
|
2
|
+
import type { Schema } from "@formily/json-schema";
|
|
3
|
+
interface ObservableColumnSource {
|
|
4
|
+
field: GeneralField;
|
|
5
|
+
columnProps: any;
|
|
6
|
+
schema: Schema;
|
|
7
|
+
display: FieldDisplayTypes;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
interface PaginationAction {
|
|
11
|
+
totalPage?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
showPagination?: boolean;
|
|
14
|
+
changePage?: (page: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const isColumnComponent: (schema: Schema) => boolean;
|
|
17
|
+
export declare const isOperationsComponent: (schema: Schema) => boolean;
|
|
18
|
+
export declare const useArrayTableSources: () => ObservableColumnSource[];
|
|
19
|
+
export declare const useArrayTableColumns: (dataSource: any[], field: ArrayField, sources: ObservableColumnSource[]) => any["columns"];
|
|
20
|
+
export declare const useAddition: () => any;
|
|
21
|
+
export declare const PaginationContext: import("react").Context<PaginationAction>;
|
|
22
|
+
export declare const usePagination: () => PaginationAction;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ArrayBaseMixins, IArrayBaseProps } from "@formily/antd-mobile/esm/array-base";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
type ComposedArrayTable = React.FC<React.PropsWithChildren<any & IArrayBaseProps>> & ArrayBaseMixins & {
|
|
5
|
+
Column?: React.FC<React.PropsWithChildren<any>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const ArrayTable: ComposedArrayTable;
|
|
8
|
+
export default ArrayTable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function handleValue(value: any, format: any, precision: any): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Precision } from "antd-mobile/2x/es/components/date-picker/date-picker-utils";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
type DatePickerPropsT = {
|
|
4
|
+
value: string | number | object;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
format: string;
|
|
9
|
+
picker: string;
|
|
10
|
+
precision: Precision;
|
|
11
|
+
showTime: boolean;
|
|
12
|
+
onChange: (date: string | number) => void;
|
|
13
|
+
onConfirm?: (date: string | number) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const DatePicker: import("react").MemoExoticComponent<import("@formily/react").ReactFC<DatePickerPropsT>>;
|
|
16
|
+
export default DatePicker;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import type { CollapsePanelProps } from "antd-mobile";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
type ActiveKeys = string | Array<string>;
|
|
6
|
+
type ActiveKey = string;
|
|
7
|
+
export interface IFormCollapse {
|
|
8
|
+
activeKeys: ActiveKeys;
|
|
9
|
+
hasActiveKey(key: ActiveKey): boolean;
|
|
10
|
+
setActiveKeys(key: ActiveKeys): void;
|
|
11
|
+
addActiveKey(key: ActiveKey): void;
|
|
12
|
+
removeActiveKey(key: ActiveKey): void;
|
|
13
|
+
toggleActiveKey(key: ActiveKey): void;
|
|
14
|
+
}
|
|
15
|
+
export interface IFormCollapseProps {
|
|
16
|
+
formCollapse?: IFormCollapse;
|
|
17
|
+
defaultActiveKey?: ActiveKeys;
|
|
18
|
+
activeKey?: ActiveKey;
|
|
19
|
+
accordion?: boolean;
|
|
20
|
+
prefixCls?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
extra?: string | ReactNode;
|
|
23
|
+
onChange?: (activeKey: ActiveKey) => void;
|
|
24
|
+
}
|
|
25
|
+
type ComposedFormCollapse = React.FC<React.PropsWithChildren<IFormCollapseProps>> & {
|
|
26
|
+
CollapsePanel?: React.FC<React.PropsWithChildren<CollapsePanelProps>>;
|
|
27
|
+
createFormCollapse?: (defaultActiveKeys?: ActiveKeys) => IFormCollapse;
|
|
28
|
+
};
|
|
29
|
+
export declare const FormCollapse: ComposedFormCollapse;
|
|
30
|
+
export default FormCollapse;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface IFormItemProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
prefixCls?: string;
|
|
6
|
+
colon?: boolean;
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
tooltipIcon?: React.ReactNode;
|
|
9
|
+
layout?: "vertical" | "horizontal" | "inline";
|
|
10
|
+
tooltipLayout?: "icon" | "text";
|
|
11
|
+
labelStyle?: React.CSSProperties;
|
|
12
|
+
labelAlign?: "left" | "right";
|
|
13
|
+
labelFor?: string;
|
|
14
|
+
labelWrap?: boolean;
|
|
15
|
+
labelWidth?: number | string;
|
|
16
|
+
wrapperWidth?: number | string;
|
|
17
|
+
labelCol?: number;
|
|
18
|
+
wrapperCol?: number;
|
|
19
|
+
wrapperAlign?: "left" | "right";
|
|
20
|
+
wrapperWrap?: boolean;
|
|
21
|
+
wrapperStyle?: React.CSSProperties;
|
|
22
|
+
fullness?: boolean;
|
|
23
|
+
addonBefore?: React.ReactNode;
|
|
24
|
+
addonAfter?: React.ReactNode;
|
|
25
|
+
size?: "small" | "default" | "large";
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
extra?: React.ReactNode;
|
|
28
|
+
feedbackText?: React.ReactNode;
|
|
29
|
+
feedbackLayout?: "loose" | "terse" | "popover" | "none" | (string & {});
|
|
30
|
+
feedbackStatus?: "error" | "warning" | "success" | "pending" | (string & {});
|
|
31
|
+
feedbackIcon?: React.ReactNode;
|
|
32
|
+
enableOutlineFeedback?: boolean;
|
|
33
|
+
getPopupContainer?: (node: HTMLElement) => HTMLElement;
|
|
34
|
+
asterisk?: boolean;
|
|
35
|
+
optionalMarkHidden?: boolean;
|
|
36
|
+
gridSpan?: number;
|
|
37
|
+
bordered?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare const useFormItemLayout: (props: IFormItemProps) => {
|
|
40
|
+
layout: "inline" | "horizontal" | "vertical";
|
|
41
|
+
colon: boolean;
|
|
42
|
+
labelAlign: "left" | "right";
|
|
43
|
+
labelWrap: boolean;
|
|
44
|
+
labelWidth: string | number;
|
|
45
|
+
wrapperWidth: string | number;
|
|
46
|
+
labelCol: number;
|
|
47
|
+
wrapperCol: number;
|
|
48
|
+
wrapperAlign: "left" | "right";
|
|
49
|
+
wrapperWrap: boolean;
|
|
50
|
+
fullness: boolean;
|
|
51
|
+
size: "default" | "small" | "large";
|
|
52
|
+
inset: boolean;
|
|
53
|
+
asterisk: boolean;
|
|
54
|
+
requiredMark: boolean | "optional";
|
|
55
|
+
optionalMarkHidden: boolean;
|
|
56
|
+
bordered: boolean;
|
|
57
|
+
feedbackIcon: import("react").ReactNode;
|
|
58
|
+
feedbackLayout: (string & {}) | "none" | "loose" | "terse" | "popover";
|
|
59
|
+
tooltipLayout: "icon" | "text";
|
|
60
|
+
tooltipIcon: import("react").ReactNode;
|
|
61
|
+
className?: string;
|
|
62
|
+
style?: React.CSSProperties;
|
|
63
|
+
label?: React.ReactNode;
|
|
64
|
+
prefixCls?: string;
|
|
65
|
+
tooltip?: React.ReactNode;
|
|
66
|
+
labelStyle?: React.CSSProperties;
|
|
67
|
+
labelFor?: string;
|
|
68
|
+
wrapperStyle?: React.CSSProperties;
|
|
69
|
+
addonBefore?: React.ReactNode;
|
|
70
|
+
addonAfter?: React.ReactNode;
|
|
71
|
+
extra?: React.ReactNode;
|
|
72
|
+
feedbackText?: React.ReactNode;
|
|
73
|
+
feedbackStatus?: "error" | "warning" | "success" | "pending" | (string & {});
|
|
74
|
+
enableOutlineFeedback?: boolean;
|
|
75
|
+
getPopupContainer?: (node: HTMLElement) => HTMLElement;
|
|
76
|
+
gridSpan?: number;
|
|
77
|
+
breakpoints?: number[];
|
|
78
|
+
direction?: "rtl" | "ltr";
|
|
79
|
+
shallow?: boolean;
|
|
80
|
+
spaceGap?: number;
|
|
81
|
+
gridColumnGap?: number;
|
|
82
|
+
gridRowGap?: number;
|
|
83
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IFormItemProps } from "./common/useFormItemLayout";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
type ComposeFormItem = React.FC<React.PropsWithChildren<IFormItemProps>> & {
|
|
5
|
+
BaseItem?: React.FC<React.PropsWithChildren<IFormItemProps>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const BaseItem: React.FC<React.PropsWithChildren<IFormItemProps>>;
|
|
8
|
+
export declare const FormItem: ComposeFormItem;
|
|
9
|
+
export default FormItem;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface IFormLayoutProps {
|
|
3
|
+
prefixCls?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
colon?: boolean;
|
|
7
|
+
requiredMark?: boolean | "optional";
|
|
8
|
+
labelAlign?: "right" | "left" | ("right" | "left")[];
|
|
9
|
+
wrapperAlign?: "right" | "left" | ("right" | "left")[];
|
|
10
|
+
labelWrap?: boolean;
|
|
11
|
+
labelWidth?: number;
|
|
12
|
+
wrapperWidth?: number;
|
|
13
|
+
wrapperWrap?: boolean;
|
|
14
|
+
labelCol?: number | number[];
|
|
15
|
+
wrapperCol?: number | number[];
|
|
16
|
+
fullness?: boolean;
|
|
17
|
+
size?: "small" | "default" | "large";
|
|
18
|
+
layout?: "vertical" | "horizontal" | "inline" | ("vertical" | "horizontal" | "inline")[];
|
|
19
|
+
direction?: "rtl" | "ltr";
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
shallow?: boolean;
|
|
22
|
+
tooltipLayout?: "icon" | "text";
|
|
23
|
+
tooltipIcon?: React.ReactNode;
|
|
24
|
+
feedbackLayout?: "loose" | "terse" | "popover" | "none";
|
|
25
|
+
bordered?: boolean;
|
|
26
|
+
breakpoints?: number[];
|
|
27
|
+
spaceGap?: number;
|
|
28
|
+
gridColumnGap?: number;
|
|
29
|
+
gridRowGap?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface IFormLayoutContext extends Omit<IFormLayoutProps, "labelAlign" | "wrapperAlign" | "layout" | "labelCol" | "wrapperCol"> {
|
|
32
|
+
labelAlign?: "right" | "left";
|
|
33
|
+
wrapperAlign?: "right" | "left";
|
|
34
|
+
layout?: "vertical" | "horizontal" | "inline";
|
|
35
|
+
labelCol?: number;
|
|
36
|
+
wrapperCol?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare const FormLayoutDeepContext: React.Context<IFormLayoutContext>;
|
|
39
|
+
export declare const FormLayoutShallowContext: React.Context<IFormLayoutContext>;
|
|
40
|
+
export declare const useFormDeepLayout: () => IFormLayoutContext;
|
|
41
|
+
export declare const useFormShallowLayout: () => IFormLayoutContext;
|
|
42
|
+
export declare const useFormLayout: () => {
|
|
43
|
+
labelAlign?: "right" | "left";
|
|
44
|
+
wrapperAlign?: "right" | "left";
|
|
45
|
+
layout?: "vertical" | "horizontal" | "inline";
|
|
46
|
+
labelCol?: number;
|
|
47
|
+
wrapperCol?: number;
|
|
48
|
+
className?: string;
|
|
49
|
+
style?: React.CSSProperties;
|
|
50
|
+
size?: "small" | "default" | "large";
|
|
51
|
+
prefixCls?: string;
|
|
52
|
+
breakpoints?: number[];
|
|
53
|
+
colon?: boolean;
|
|
54
|
+
requiredMark?: boolean | "optional";
|
|
55
|
+
labelWrap?: boolean;
|
|
56
|
+
labelWidth?: number;
|
|
57
|
+
wrapperWidth?: number;
|
|
58
|
+
wrapperWrap?: boolean;
|
|
59
|
+
fullness?: boolean;
|
|
60
|
+
direction?: "rtl" | "ltr";
|
|
61
|
+
inset?: boolean;
|
|
62
|
+
shallow?: boolean;
|
|
63
|
+
tooltipLayout?: "icon" | "text";
|
|
64
|
+
tooltipIcon?: React.ReactNode;
|
|
65
|
+
feedbackLayout?: "loose" | "terse" | "popover" | "none";
|
|
66
|
+
bordered?: boolean;
|
|
67
|
+
spaceGap?: number;
|
|
68
|
+
gridColumnGap?: number;
|
|
69
|
+
gridRowGap?: number;
|
|
70
|
+
};
|
|
71
|
+
export declare const FormLayout: React.FC<React.PropsWithChildren<IFormLayoutProps>> & {
|
|
72
|
+
useFormLayout: () => IFormLayoutContext;
|
|
73
|
+
useFormDeepLayout: () => IFormLayoutContext;
|
|
74
|
+
useFormShallowLayout: () => IFormLayoutContext;
|
|
75
|
+
};
|
|
76
|
+
export default FormLayout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "antd-mobile/es/components/list/list.css";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface IProps {
|
|
2
|
+
breakpoints?: number[];
|
|
3
|
+
layout?: "vertical" | "horizontal" | "inline" | ("vertical" | "horizontal" | "inline")[];
|
|
4
|
+
labelCol?: number | number[];
|
|
5
|
+
wrapperCol?: number | number[];
|
|
6
|
+
labelAlign?: "right" | "left" | ("right" | "left")[];
|
|
7
|
+
wrapperAlign?: "right" | "left" | ("right" | "left")[];
|
|
8
|
+
[props: string]: any;
|
|
9
|
+
}
|
|
10
|
+
interface IUseResponsiveFormLayout {
|
|
11
|
+
(props: IProps): {
|
|
12
|
+
ref: React.MutableRefObject<HTMLDivElement>;
|
|
13
|
+
props: any;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare const useResponsiveFormLayout: IUseResponsiveFormLayout;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import AMapLoader from "./loader";
|
|
2
|
+
export declare function setKey(key: any, securityJsCode: any): void;
|
|
3
|
+
export declare function setServerKey(key: any, securityJsCode: any): void;
|
|
4
|
+
export declare function setSecurityJsCode(securityJsCode: any): void;
|
|
5
|
+
export type setMarkerOptT = {
|
|
6
|
+
id?: number | string;
|
|
7
|
+
marker?: object;
|
|
8
|
+
map?: object;
|
|
9
|
+
AMap?: object;
|
|
10
|
+
markerIconConf?: object;
|
|
11
|
+
};
|
|
12
|
+
export type markersT = {
|
|
13
|
+
[k: number | string]: object;
|
|
14
|
+
};
|
|
15
|
+
export declare class MapUtils {
|
|
16
|
+
map: any;
|
|
17
|
+
AMap: any;
|
|
18
|
+
markers: markersT;
|
|
19
|
+
pickerMarker: any;
|
|
20
|
+
markerIconConf: any;
|
|
21
|
+
constructor({ map, AMap, markerIconConf }: {
|
|
22
|
+
map: any;
|
|
23
|
+
AMap: any;
|
|
24
|
+
markerIconConf: any;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* 设置范围
|
|
28
|
+
* @param rangeArr
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
setMapRang({ map, AMap, rangeArr, rangeKey, lonKey, latKey, }: {
|
|
32
|
+
map?: any;
|
|
33
|
+
AMap?: any;
|
|
34
|
+
rangeArr?: any[];
|
|
35
|
+
rangeKey?: string;
|
|
36
|
+
lonKey?: string;
|
|
37
|
+
latKey?: string;
|
|
38
|
+
}): void;
|
|
39
|
+
/**
|
|
40
|
+
* 获取地图中心点
|
|
41
|
+
* @param map
|
|
42
|
+
* @returns { lng: Number, lat: Number }
|
|
43
|
+
*/
|
|
44
|
+
getCenter(map?: any): any;
|
|
45
|
+
/**
|
|
46
|
+
* 设置地图中心点
|
|
47
|
+
* @param lon
|
|
48
|
+
* @param lat
|
|
49
|
+
* @param opt
|
|
50
|
+
*/
|
|
51
|
+
setCenter(lon: any, lat: any, opt?: {
|
|
52
|
+
map: any;
|
|
53
|
+
AMap: any;
|
|
54
|
+
}): void;
|
|
55
|
+
/**
|
|
56
|
+
* 创建或修改 Marker
|
|
57
|
+
* @param lon
|
|
58
|
+
* @param lat
|
|
59
|
+
* @param opt
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
setMarker(lon: any, lat: any, opt?: setMarkerOptT): any;
|
|
63
|
+
/**
|
|
64
|
+
* 创建或修改地图选点的 Marker
|
|
65
|
+
* @param lon
|
|
66
|
+
* @param lat
|
|
67
|
+
* @param opt
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
setPickerMarker(lon: any, lat: any, opt?: any): void;
|
|
71
|
+
on(...args: any[]): any;
|
|
72
|
+
off(...args: any[]): any;
|
|
73
|
+
}
|
|
74
|
+
export { AMapLoader };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取传入的数据,并转为内部数据格式
|
|
3
|
+
* @param value
|
|
4
|
+
* @param form
|
|
5
|
+
* @param opt
|
|
6
|
+
* @returns
|
|
7
|
+
* {
|
|
8
|
+
lon: value[lonKey],
|
|
9
|
+
lat: value[latKey],
|
|
10
|
+
addr: value[addrKey],
|
|
11
|
+
}
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPropsValue(value: {}, opt: any): {
|
|
14
|
+
lon: any;
|
|
15
|
+
lat: any;
|
|
16
|
+
addr: any;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 获取父级的数据对象(包括当前项的对象)
|
|
20
|
+
* { 当详情: xxx, 其他项: lll }
|
|
21
|
+
* @param field
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare function getParentValue(field: any): any;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface addressErrorI extends Error {
|
|
2
|
+
result?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* 根据经纬度获取定义的地址
|
|
6
|
+
* @param lon
|
|
7
|
+
* @param lat
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAddress(lon: any, lat: any): Promise<string>;
|
|
11
|
+
export declare const getAddressByAMap: (lon: any, lat: any) => Promise<string>;
|
|
12
|
+
export declare const getAddressByFetch: (lon: any, lat: any) => Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* 获取搜索提示
|
|
15
|
+
* @param search
|
|
16
|
+
* @param cityCode
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSearchTips(search: any, cityCode?: string): Promise<unknown>;
|
|
20
|
+
export declare function getSearchTipsByAMap(search: any, cityCode?: string): Promise<unknown>;
|
|
21
|
+
export declare function getSearchTipsByFetch(search: any, cityCode?: string): Promise<unknown>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { formItemProps } from "../form-item";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
export declare const Select: import("react").MemoExoticComponent<import("@formily/react").ReactFC<{
|
|
4
|
+
value: number | string;
|
|
5
|
+
onChange: (val: any) => void;
|
|
6
|
+
onConfirm: (val: any) => void;
|
|
7
|
+
} & formItemProps>>;
|
|
8
|
+
export default Select;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const Text: ({ value, mode, content, className, ...props }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
value: any;
|
|
5
|
+
mode: any;
|
|
6
|
+
content: any;
|
|
7
|
+
className: any;
|
|
8
|
+
}) => React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
9
|
+
export default Text;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getTimeColumns(opt?: any): any[][];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { formItemProps } from "../form-item";
|
|
2
|
+
export declare const TimePicker: import("react").MemoExoticComponent<import("@formily/react").ReactFC<{
|
|
3
|
+
use12Hours: boolean;
|
|
4
|
+
onConfirm?: (date: string | number) => void;
|
|
5
|
+
} & formItemProps>>;
|
|
6
|
+
export default TimePicker;
|