@hzab/form-render 1.7.17 → 1.7.19
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/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/dist/common/date-utils.d.ts +1 -0
- package/dist/common/event.d.ts +5 -0
- package/dist/common/formily-utils.d.ts +54 -0
- package/dist/common/global-props-context.d.ts +8 -0
- package/dist/common/location-utils.d.ts +6 -0
- package/dist/common/schema-handler.d.ts +90 -0
- package/dist/common/schema-merge.d.ts +12 -0
- package/dist/components/ArrayBase/index.d.ts +75 -0
- package/dist/components/ArrayBase/style.d.ts +2 -0
- package/dist/components/ArrayCards/index.d.ts +13 -0
- package/dist/components/ArrayCards/style.d.ts +4 -0
- package/dist/components/ArrayTable/index.d.ts +51 -0
- package/dist/components/ArrayTable/style.d.ts +7 -0
- package/dist/components/CheckboxWithTip/index.d.ts +15 -0
- package/dist/components/DatePicker/index.d.ts +5 -0
- package/dist/components/LocationListPicker/components/AddrList/index.d.ts +3 -0
- package/dist/components/LocationListPicker/components/Popup/index.d.ts +15 -0
- package/dist/components/LocationListPicker/index.d.ts +3 -0
- package/dist/components/LocationPicker/Map/AMap/common/loader.d.ts +2 -0
- package/dist/components/LocationPicker/Map/AMap/common/utils.d.ts +130 -0
- package/dist/components/LocationPicker/common/utils.d.ts +19 -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/PersonnelSelect/index.d.ts +6 -0
- package/dist/components/PersonnelSelect/type.d.ts +88 -0
- package/dist/components/RadioGroupWithTip/index.d.ts +14 -0
- package/dist/components/RichEditor/components/handleMobileRem/index.d.ts +3 -0
- package/dist/components/RichEditor/components/handleMobileVw/index.d.ts +3 -0
- package/dist/components/RichEditor/index.d.ts +32 -0
- package/dist/components/Text/index.d.ts +9 -0
- package/dist/components/TreeCheckbox/common/utils.d.ts +74 -0
- package/dist/components/TreeCheckbox/components/CheckboxTable/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/components/Render/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/components/TabsRender/index.d.ts +2 -0
- package/dist/components/TreeCheckbox/index.d.ts +3 -0
- package/dist/components/Upload/common/OfflineUpload.d.ts +3 -0
- package/dist/components/Upload/common/checkFileType.d.ts +3 -0
- package/dist/components/Upload/common/customRequest.d.ts +32 -0
- package/dist/components/Upload/common/fileName.d.ts +3 -0
- package/dist/components/Upload/common/handleIOFileList.d.ts +133 -0
- package/dist/components/Upload/common/nanoid.d.ts +2 -0
- package/dist/components/Upload/components/Image/index.d.ts +3 -0
- package/dist/components/Upload/components/ItemList/ItemRender.d.ts +2 -0
- package/dist/components/Upload/components/ItemList/index.d.ts +2 -0
- package/dist/components/Upload/components/PreviewModal/index.d.ts +5 -0
- package/dist/components/Upload/components/PreviewModal/previewRender.d.ts +12 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/components/UserSelect/index.d.ts +29 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/globalConfig.d.ts +6 -0
- package/dist/index.cjs +9 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3227 -0
- package/package.json +79 -63
- package/src/common/schema-handler.ts +2 -2
- package/src/components/ArrayBase/index.tsx +7 -5
- package/src/components/ArrayCards/index.tsx +5 -4
- package/src/components/ArrayTable/index.tsx +9 -7
- package/src/components/DatePicker/index.tsx +1 -1
- package/src/components/LocationListPicker/components/Popup/index.tsx +1 -1
- package/src/components/LocationListPicker/index.tsx +4 -4
- package/src/components/LocationPicker/Map/AMap/common/loader.ts +2 -3
- package/src/components/LocationPicker/Map/AMap/common/utils.ts +9 -9
- package/src/components/LocationPicker/common/utils.ts +5 -5
- package/src/components/LocationPicker/components/ModalContent/index.tsx +5 -5
- package/src/components/PersonnelSelect/type.ts +1 -1
- package/src/components/RichEditor/components/handleMobileRem/index.tsx +2 -2
- package/src/components/RichEditor/components/handleMobileVw/index.tsx +1 -1
- package/src/components/RichEditor/index.tsx +1 -1
- package/src/components/TreeCheckbox/common/utils.ts +1 -1
- package/src/components/Upload/common/handleIOFileList.ts +2 -2
- package/src/components/Upload/uploader-input.jsx +2 -3
- package/src/components/Upload/uploader.jsx +8 -1
- package/src/components/UserSelect/index.tsx +1 -1
- package/src/global.d.ts +12 -0
- package/src/index.tsx +2 -2
- package/src/vite-env.d.ts +1 -0
- package/README.md +0 -271
- package/src/components/LocationPicker/README.md +0 -44
- package/src/components/RichEditor/README.md +0 -82
- package/src/components/TreeCheckbox/README.md +0 -11
- package/src/components/Upload/README.md +0 -77
package/CHANGELOG.md
CHANGED
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 @@
|
|
|
1
|
+
export declare const dateable: (value: any, format?: string) => any;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface ISetTargetLevelValOpt {
|
|
2
|
+
/**
|
|
3
|
+
* 相对当前的层级数
|
|
4
|
+
*/
|
|
5
|
+
level?: number;
|
|
6
|
+
/**
|
|
7
|
+
* 目标数据为数组是否使用 push
|
|
8
|
+
*/
|
|
9
|
+
isArrPush?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 获取父级的数据(包括当前项的对象)
|
|
13
|
+
* @param field formily field 对象 const field: any = useField();
|
|
14
|
+
* @returns
|
|
15
|
+
*/
|
|
16
|
+
export declare function getParentValue(field: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* 设置当前 field 同层级数据值。
|
|
19
|
+
* @param field formily field 对象 const field: any = useField();
|
|
20
|
+
* @param key 目标 key
|
|
21
|
+
* @param val 目标值
|
|
22
|
+
* @example
|
|
23
|
+
* 如当前的 field name 为 test, 设置同层级 testA
|
|
24
|
+
* // 初始值:
|
|
25
|
+
* {
|
|
26
|
+
* test: 1
|
|
27
|
+
* }
|
|
28
|
+
* // 设置同层级 key 为 testA 的值为 222
|
|
29
|
+
* setParentValue(field, 'testA', 222);
|
|
30
|
+
* // 设置结果
|
|
31
|
+
* {
|
|
32
|
+
* test: 1,
|
|
33
|
+
* testA: 222
|
|
34
|
+
* }
|
|
35
|
+
*/
|
|
36
|
+
export declare function setParentValue(field: any, key: any, val: any): void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取相对当前层级的数据对象(包括当前项的对象)
|
|
39
|
+
* @param field formily field 对象 const field: any = useField();
|
|
40
|
+
* @param key 目标 key
|
|
41
|
+
* @param val 目标 value
|
|
42
|
+
* @param level 相对的层级 负数
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
export declare function getTargetLevelVal(field: any, level: any): any;
|
|
46
|
+
/**
|
|
47
|
+
* 设置相对当前层级的数据对象(包括当前项的对象)
|
|
48
|
+
* @param field formily field 对象 const field: any = useField();
|
|
49
|
+
* @param key 目标 key
|
|
50
|
+
* @param val 目标 value
|
|
51
|
+
* @param level 相对的层级
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
export declare function setTargetLevelVal(field: any, key: any, val: any, opt?: ISetTargetLevelValOpt): void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 指定 nanoid 字符集合
|
|
3
|
+
*/
|
|
4
|
+
export declare const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
5
|
+
export declare const nanoid: (size?: number) => string;
|
|
6
|
+
/**
|
|
7
|
+
* You can use the built-in context variables
|
|
8
|
+
*
|
|
9
|
+
* 1. `$self` is the current Field Model
|
|
10
|
+
*
|
|
11
|
+
* 2. `$form` is the current Form Model
|
|
12
|
+
*
|
|
13
|
+
* 3. `$deps` is the dependencies value 仅在 run 中存在
|
|
14
|
+
*
|
|
15
|
+
* 4. `$observable` function is used to create an persistent observable state object
|
|
16
|
+
*
|
|
17
|
+
* 5. `$memo` function is is used to create a persistent data
|
|
18
|
+
*
|
|
19
|
+
* 6. `$effect` function is used to handle side-effect logic
|
|
20
|
+
*
|
|
21
|
+
* 7. `$props` function is used to set component props to current field
|
|
22
|
+
*
|
|
23
|
+
* Document Links
|
|
24
|
+
*
|
|
25
|
+
* https://react.formilyjs.org/api/shared/schema#%E5%86%85%E7%BD%AE%E8%A1%A8%E8%BE%BE%E5%BC%8F%E4%BD%9C%E7%94%A8%E5%9F%9F
|
|
26
|
+
**/
|
|
27
|
+
/** formily 执行函数作用域相关参数 */
|
|
28
|
+
export declare const formilyDataKeys: string[];
|
|
29
|
+
/** 自增容器 */
|
|
30
|
+
export declare const arrayList: string[];
|
|
31
|
+
/** 不需要绑定事件的目标 */
|
|
32
|
+
export declare const skipBindList: string[];
|
|
33
|
+
/** change 回调返回 parent 数据的组件 */
|
|
34
|
+
export declare const returnParentValue: string[];
|
|
35
|
+
/**
|
|
36
|
+
* schema 每项添加 onChange,解决无全局 onChange 问题
|
|
37
|
+
* @param schema
|
|
38
|
+
* @param onChange
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
export declare const bindOnChange: (schema: any, opt: any) => any;
|
|
42
|
+
/**
|
|
43
|
+
* 添加回调函数
|
|
44
|
+
* @param target
|
|
45
|
+
* @param name
|
|
46
|
+
* @param formOnChange
|
|
47
|
+
*/
|
|
48
|
+
export declare const bindCallback: (opt: any) => void;
|
|
49
|
+
/**
|
|
50
|
+
* 从 onChange 事件中获取数据
|
|
51
|
+
* @param args
|
|
52
|
+
*/
|
|
53
|
+
export declare const handleChangeValue: (opt: any) => {
|
|
54
|
+
key: any;
|
|
55
|
+
actionName: any;
|
|
56
|
+
formRender: any;
|
|
57
|
+
formValues: any;
|
|
58
|
+
sourceArgs: any;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 是否是可执行字符串,为 {{}} 包裹的字符串
|
|
62
|
+
* @param params
|
|
63
|
+
*/
|
|
64
|
+
export declare const isRunStr: (strKey: any) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 获取可执行字符串,返回 {{}} 包裹的字符串
|
|
67
|
+
* @param params
|
|
68
|
+
*/
|
|
69
|
+
export declare const getRunStr: (strKey: any) => any;
|
|
70
|
+
/**
|
|
71
|
+
* 处理 schema 字符串值
|
|
72
|
+
* 1.可执行字符串({{}}包裹的字符串):schema scope 取出对应的值,否则转为可执行函数
|
|
73
|
+
* 2.其他情况直接返回对应数据
|
|
74
|
+
* @param strKey
|
|
75
|
+
* @param schemaScope
|
|
76
|
+
* @returns
|
|
77
|
+
*/
|
|
78
|
+
export declare const handleSchemaStrVal: (strKey: any, schemaScope: any) => any;
|
|
79
|
+
/**
|
|
80
|
+
* 是否是 schema scope key
|
|
81
|
+
* @param strKey
|
|
82
|
+
* @returns
|
|
83
|
+
*/
|
|
84
|
+
export declare const isScopeKey: (strKey: any, schemaScope: any) => any;
|
|
85
|
+
/**
|
|
86
|
+
* 获取 schema scope key
|
|
87
|
+
* @param strKey
|
|
88
|
+
* @returns
|
|
89
|
+
*/
|
|
90
|
+
export declare const getScopeKeyVal: (strKey: any, schemaScope: any) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function mergeSchema(BaseSchema: any, InsideSchema: any, title?: string): {
|
|
2
|
+
form: any;
|
|
3
|
+
schema: any;
|
|
4
|
+
};
|
|
5
|
+
export declare function mergeSchemas(schemas: any): {
|
|
6
|
+
form: any;
|
|
7
|
+
schema: {
|
|
8
|
+
type: string;
|
|
9
|
+
properties: {};
|
|
10
|
+
"x-designable-id": string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ArrayField } from "@formily/core";
|
|
2
|
+
import type { JSXComponent, Schema } from "@formily/react";
|
|
3
|
+
import type { ButtonProps } from "antd/lib/button";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
import React from "react";
|
|
6
|
+
export interface IArrayBaseAdditionProps extends ButtonProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
method?: "push" | "unshift";
|
|
9
|
+
defaultValue?: any;
|
|
10
|
+
}
|
|
11
|
+
export interface IArrayBaseOperationProps extends ButtonProps {
|
|
12
|
+
title?: string;
|
|
13
|
+
index?: number;
|
|
14
|
+
ref?: React.Ref<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface IArrayBaseContext {
|
|
17
|
+
props: IArrayBaseProps;
|
|
18
|
+
field: ArrayField;
|
|
19
|
+
schema: Schema;
|
|
20
|
+
}
|
|
21
|
+
export interface IArrayBaseItemProps {
|
|
22
|
+
index: number;
|
|
23
|
+
record: ((index: number) => Record<string, any>) | Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
export type ArrayBaseMixins = {
|
|
26
|
+
Addition?: React.FC<React.PropsWithChildren<IArrayBaseAdditionProps>>;
|
|
27
|
+
Copy?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & {
|
|
28
|
+
index?: number;
|
|
29
|
+
}>>;
|
|
30
|
+
Remove?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & {
|
|
31
|
+
index?: number;
|
|
32
|
+
}>>;
|
|
33
|
+
MoveUp?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & {
|
|
34
|
+
index?: number;
|
|
35
|
+
}>>;
|
|
36
|
+
MoveDown?: React.ForwardedRef<React.PropsWithChildren<IArrayBaseOperationProps & {
|
|
37
|
+
index?: number;
|
|
38
|
+
}>>;
|
|
39
|
+
SortHandle?: React.FC<React.PropsWithChildren<IArrayBaseOperationProps & {
|
|
40
|
+
index?: number;
|
|
41
|
+
}>>;
|
|
42
|
+
Index?: React.FC;
|
|
43
|
+
useArray?: () => IArrayBaseContext;
|
|
44
|
+
useIndex?: (index?: number) => number;
|
|
45
|
+
useRecord?: (record?: number) => any;
|
|
46
|
+
deletePopconfirmTitle?: ReactNode;
|
|
47
|
+
deletePopconfirm?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export interface IArrayBaseProps {
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
onAdd?: (index: number) => void;
|
|
52
|
+
onCopy?: (index: number) => void;
|
|
53
|
+
onRemove?: (index: number) => void;
|
|
54
|
+
onMoveDown?: (index: number) => void;
|
|
55
|
+
onMoveUp?: (index: number) => void;
|
|
56
|
+
onSortStart?: (e: any) => void;
|
|
57
|
+
onSortEnd?: (e: any) => void;
|
|
58
|
+
deletePopconfirmTitle?: () => ReactNode;
|
|
59
|
+
deletePopconfirm?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export type ComposedArrayBase = React.FC<React.PropsWithChildren<IArrayBaseProps>> & ArrayBaseMixins & {
|
|
62
|
+
Item?: React.FC<React.PropsWithChildren<IArrayBaseItemProps>>;
|
|
63
|
+
mixin?: <T extends JSXComponent>(target: T) => T & ArrayBaseMixins;
|
|
64
|
+
};
|
|
65
|
+
export declare const ArrayBaseContext: React.Context<IArrayBaseContext>;
|
|
66
|
+
export declare const ItemContext: React.Context<IArrayBaseItemProps>;
|
|
67
|
+
export declare const takeRecord: (val: any, index?: number) => any;
|
|
68
|
+
export declare const useArray: () => IArrayBaseContext;
|
|
69
|
+
export declare const useIndex: (index?: number) => number;
|
|
70
|
+
export declare const useRecord: (record?: number) => any;
|
|
71
|
+
export declare const getSchemaDefaultValue: (schema: Schema) => any;
|
|
72
|
+
export declare const getDefaultValue: (defaultValue: any, schema: Schema) => any;
|
|
73
|
+
export declare const ArrayBase: ComposedArrayBase;
|
|
74
|
+
export declare const SortHandle: any;
|
|
75
|
+
export default ArrayBase;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CardProps } from "antd/lib/card";
|
|
3
|
+
import type { ISchema } from "@formily/json-schema";
|
|
4
|
+
import type { ArrayBaseMixins, IArrayBaseProps } from "../ArrayBase";
|
|
5
|
+
export type ComposedArrayCards = React.FC<React.PropsWithChildren<CardProps & IArrayBaseProps>> & ArrayBaseMixins;
|
|
6
|
+
export declare const isIndexComponent: (schema: ISchema) => boolean;
|
|
7
|
+
export declare const isRemoveComponent: (schema: ISchema) => boolean;
|
|
8
|
+
export declare const isCopyComponent: (schema: ISchema) => boolean;
|
|
9
|
+
export declare const isMoveUpComponent: (schema: ISchema) => boolean;
|
|
10
|
+
export declare const isMoveDownComponent: (schema: ISchema) => boolean;
|
|
11
|
+
export declare const isOperationComponent: (schema: ISchema) => boolean;
|
|
12
|
+
export declare const ArrayCards: ComposedArrayCards;
|
|
13
|
+
export default ArrayCards;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PaginationProps } from "antd/lib/pagination";
|
|
3
|
+
import type { TableProps, ColumnProps } from "antd/lib/table";
|
|
4
|
+
import type { SelectProps } from "antd/lib/select";
|
|
5
|
+
import type { GeneralField, FieldDisplayTypes, ArrayField } from "@formily/core";
|
|
6
|
+
import type { ReactFC } from "@formily/react";
|
|
7
|
+
import type { Schema } from "@formily/json-schema";
|
|
8
|
+
import type { ArrayBaseMixins, IArrayBaseProps } from "../ArrayBase";
|
|
9
|
+
export interface ObservableColumnSource {
|
|
10
|
+
field: GeneralField;
|
|
11
|
+
columnProps: ColumnProps<any>;
|
|
12
|
+
schema: Schema;
|
|
13
|
+
display: FieldDisplayTypes;
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IArrayTablePaginationProps extends PaginationProps {
|
|
17
|
+
dataSource?: any[];
|
|
18
|
+
showPagination?: boolean;
|
|
19
|
+
children?: (dataSource: any[], pagination: React.ReactNode, options: {
|
|
20
|
+
startIndex: number;
|
|
21
|
+
}) => React.ReactElement;
|
|
22
|
+
}
|
|
23
|
+
export interface IStatusSelectProps extends SelectProps<any> {
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
}
|
|
26
|
+
export type ComposedArrayTable = React.FC<React.PropsWithChildren<TableProps<any> & IArrayBaseProps>> & ArrayBaseMixins & {
|
|
27
|
+
Column?: React.FC<React.PropsWithChildren<ColumnProps<any>>>;
|
|
28
|
+
};
|
|
29
|
+
export interface PaginationAction {
|
|
30
|
+
totalPage?: number;
|
|
31
|
+
pageSize?: number;
|
|
32
|
+
showPagination?: boolean;
|
|
33
|
+
changePage?: (page: number) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const SortableRow: ReactFC<any>;
|
|
36
|
+
export declare const SortableBody: ReactFC<any>;
|
|
37
|
+
export declare const isColumnComponent: (schema: Schema) => boolean;
|
|
38
|
+
export declare const isOperationsComponent: (schema: Schema) => boolean;
|
|
39
|
+
export declare const isAdditionComponent: (schema: Schema) => boolean;
|
|
40
|
+
export declare const useArrayTableSources: () => ObservableColumnSource[];
|
|
41
|
+
export declare const useArrayTableColumns: (dataSource: any[], field: ArrayField, sources: ObservableColumnSource[]) => TableProps<any>["columns"];
|
|
42
|
+
export declare const useAddition: () => any;
|
|
43
|
+
export declare const schedulerRequest: {
|
|
44
|
+
request: any;
|
|
45
|
+
};
|
|
46
|
+
export declare const StatusSelect: ReactFC<IStatusSelectProps>;
|
|
47
|
+
export declare const PaginationContext: React.Context<PaginationAction>;
|
|
48
|
+
export declare const usePagination: () => PaginationAction;
|
|
49
|
+
export declare const ArrayTable: ComposedArrayTable;
|
|
50
|
+
export declare const Addition: ArrayBaseMixins["Addition"];
|
|
51
|
+
export default ArrayTable;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
export interface CheckboxDescItem {
|
|
4
|
+
value: string | number;
|
|
5
|
+
label: string;
|
|
6
|
+
desc: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface CheckboxWithDescProps {
|
|
10
|
+
value?: (string | number)[];
|
|
11
|
+
onChange?: (val: any[]) => void;
|
|
12
|
+
dataSource: CheckboxDescItem[];
|
|
13
|
+
}
|
|
14
|
+
declare const CheckboxWithTip: React.FC<CheckboxWithDescProps>;
|
|
15
|
+
export { CheckboxWithTip };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./index.less";
|
|
2
|
+
export interface IPopupProps {
|
|
3
|
+
formProps?: {
|
|
4
|
+
schema: any;
|
|
5
|
+
initialValues?: object;
|
|
6
|
+
};
|
|
7
|
+
mountElement?: HTMLElement;
|
|
8
|
+
}
|
|
9
|
+
export interface IData {
|
|
10
|
+
top: number;
|
|
11
|
+
left: number;
|
|
12
|
+
address: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Popup: import("react").ForwardRefExoticComponent<IPopupProps & import("react").RefAttributes<unknown>>;
|
|
15
|
+
export default Popup;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as turf from "@turf/turf";
|
|
2
|
+
import AMapLoader from "./loader";
|
|
3
|
+
export declare function setKey(key: any, securityJsCode: any): void;
|
|
4
|
+
export declare function setServerKey(key: any, securityJsCode: any): void;
|
|
5
|
+
export declare function setSecurityJsCode(securityJsCode: any): void;
|
|
6
|
+
export interface IMarker {
|
|
7
|
+
setIcon: Function;
|
|
8
|
+
setSize: Function;
|
|
9
|
+
setOffset: Function;
|
|
10
|
+
getPosition: Function;
|
|
11
|
+
}
|
|
12
|
+
export type setMarkerOptT = {
|
|
13
|
+
id?: number | string;
|
|
14
|
+
marker?: IMarker;
|
|
15
|
+
map?: object;
|
|
16
|
+
AMap?: object;
|
|
17
|
+
markerIconConf?: object;
|
|
18
|
+
markerConf?: object;
|
|
19
|
+
onClick?: Function;
|
|
20
|
+
data?: object;
|
|
21
|
+
};
|
|
22
|
+
export type markersT = {
|
|
23
|
+
[k: number | string]: IMarker;
|
|
24
|
+
};
|
|
25
|
+
export declare class MapUtils {
|
|
26
|
+
map: any;
|
|
27
|
+
AMap: any;
|
|
28
|
+
markers: markersT;
|
|
29
|
+
circles: {};
|
|
30
|
+
pickerMarker: any;
|
|
31
|
+
markerIconConf: any;
|
|
32
|
+
markerConf: any;
|
|
33
|
+
polyEditor: {
|
|
34
|
+
PolygonEditor: any;
|
|
35
|
+
PolylineEditor: any;
|
|
36
|
+
};
|
|
37
|
+
polygonEnum: {};
|
|
38
|
+
polygonConf: any;
|
|
39
|
+
mapDomRef: any;
|
|
40
|
+
constructor({ map, AMap, mapDomRef, markerIconConf, markerConf, polygonConf }: {
|
|
41
|
+
map: any;
|
|
42
|
+
AMap: any;
|
|
43
|
+
mapDomRef: any;
|
|
44
|
+
markerIconConf: any;
|
|
45
|
+
markerConf: any;
|
|
46
|
+
polygonConf: any;
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* 获取地图中心点
|
|
50
|
+
* @param map
|
|
51
|
+
* @returns { lng: Number, lat: Number }
|
|
52
|
+
*/
|
|
53
|
+
getCenter(map?: any): any;
|
|
54
|
+
/**
|
|
55
|
+
* 设置地图中心点
|
|
56
|
+
* @param lon
|
|
57
|
+
* @param lat
|
|
58
|
+
* @param opt
|
|
59
|
+
*/
|
|
60
|
+
setCenter(lon: any, lat: any, opt?: {
|
|
61
|
+
immediately: any;
|
|
62
|
+
duration: any;
|
|
63
|
+
map: any;
|
|
64
|
+
AMap: any;
|
|
65
|
+
}): void;
|
|
66
|
+
setFitView(): void;
|
|
67
|
+
/**
|
|
68
|
+
* 创建或修改 Marker
|
|
69
|
+
* @param lon
|
|
70
|
+
* @param lat
|
|
71
|
+
* @param opt
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
setMarker(lon: any, lat: any, opt?: setMarkerOptT): any;
|
|
75
|
+
/**
|
|
76
|
+
* 创建绘制实例
|
|
77
|
+
*/
|
|
78
|
+
createPoly(element: any): any;
|
|
79
|
+
/**
|
|
80
|
+
* 按points绘制元素实例
|
|
81
|
+
*/
|
|
82
|
+
setPolygon(opt: any): void;
|
|
83
|
+
/**
|
|
84
|
+
* 创建手动绘制实例
|
|
85
|
+
*/
|
|
86
|
+
startPolygon(opt: any): void;
|
|
87
|
+
/**
|
|
88
|
+
* 手动开始绘制函数
|
|
89
|
+
*/
|
|
90
|
+
setDrawPolygon({ map, AMap, element }: {
|
|
91
|
+
map?: any;
|
|
92
|
+
AMap?: any;
|
|
93
|
+
element?: string;
|
|
94
|
+
}): void;
|
|
95
|
+
/**
|
|
96
|
+
* 编辑态
|
|
97
|
+
* @param item
|
|
98
|
+
*/
|
|
99
|
+
setEditPolygon({ id, element }: {
|
|
100
|
+
id: any;
|
|
101
|
+
element?: string;
|
|
102
|
+
}): void;
|
|
103
|
+
setMarkerIcon(id: any, opt?: {
|
|
104
|
+
size: any;
|
|
105
|
+
image: any;
|
|
106
|
+
offset: any;
|
|
107
|
+
}): void;
|
|
108
|
+
rmPolygon(id: any, element?: string): void;
|
|
109
|
+
/**
|
|
110
|
+
* 删除指定 marker
|
|
111
|
+
* @param id
|
|
112
|
+
*/
|
|
113
|
+
rmMarker(id: any): void;
|
|
114
|
+
setCircle(lon: any, lat: any, radius: any, opt?: any): any;
|
|
115
|
+
rmCircle(id: any): void;
|
|
116
|
+
isContains(e: any, callBack: any): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* 创建或修改地图选点的 Marker
|
|
119
|
+
* 在当前 utils 中唯一
|
|
120
|
+
* @param lon
|
|
121
|
+
* @param lat
|
|
122
|
+
* @param opt
|
|
123
|
+
* @returns
|
|
124
|
+
*/
|
|
125
|
+
setPickerMarker(lon: any, lat: any, opt?: any): void;
|
|
126
|
+
getPolygonCenter(coordinate: any): turf.helpers.Position;
|
|
127
|
+
on(...args: any[]): any;
|
|
128
|
+
off(...args: any[]): any;
|
|
129
|
+
}
|
|
130
|
+
export { AMapLoader };
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
points: any;
|
|
18
|
+
range: any;
|
|
19
|
+
};
|
|
@@ -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,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { RemoteSelectProps } from "./type";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
declare const RemoteSelect: React.FC<RemoteSelectProps>;
|
|
5
|
+
declare const PersonnelSelect: React.ForwardRefExoticComponent<Partial<React.PropsWithChildren<RemoteSelectProps>> & React.RefAttributes<unknown>>;
|
|
6
|
+
export { RemoteSelect, PersonnelSelect };
|