@vtx/components 4.0.0-beta.8 → 4.0.0-beta.81
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/README.md +19 -19
- package/es/index.js +3 -0
- package/es/utils/components/LabelIconTip/index.js +7 -7
- package/es/utils/conversionMomentValue/index.js +25 -25
- package/es/utils/filterSpecialCharacters.js +53 -52
- package/es/utils/genCopyable/index.js +6 -6
- package/es/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/es/utils/hooks/useDebounceFn/index.js +4 -4
- package/es/utils/hooks/useDebounceValue/index.js +6 -6
- package/es/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/es/utils/hooks/useLatest/index.js +2 -2
- package/es/utils/hooks/useRefCallback/index.js +5 -5
- package/es/utils/index.js +1 -2
- package/es/utils/isBrowser/index.js +7 -7
- package/es/utils/isUrl/index.js +4 -4
- package/es/utils/merge/index.js +4 -4
- package/es/utils/nanoid/index.js +4 -4
- package/es/utils/omitBoolean/index.js +4 -4
- package/es/utils/parseValueToMoment/index.js +4 -4
- package/es/utils/proFieldParsingText/index.js +10 -10
- package/es/utils/transformKeySubmitValue/index.js +57 -57
- package/es/utils/useEditableArray/index.js +46 -46
- package/es/utils/useEditableMap/index.js +22 -22
- package/es/utils/useMediaQuery/index.js +5 -5
- package/es/vtx-combogrid/Combogrid.js +5 -4
- package/es/vtx-combogrid/index.js +7 -4
- package/es/vtx-datagrid/Store/Provide.js +106 -137
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/es/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/es/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/es/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/es/vtx-datagrid/columnState.js +91 -0
- package/es/vtx-datagrid/index.js +124 -32
- package/es/vtx-datagrid/mergeComponents.js +15 -0
- package/es/vtx-datagrid/renderColumnButtons.js +30 -11
- package/es/vtx-datagrid/style/index.js +102 -20
- package/es/vtx-datagrid/style/index.less +242 -242
- package/es/vtx-date-picker/QdatePicker.js +1 -1
- package/es/vtx-date-picker/style/index.less +39 -39
- package/es/vtx-descriptions/Descriptions.js +29 -0
- package/es/vtx-descriptions/index.js +3 -0
- package/es/vtx-descriptions/style/index.js +19 -0
- package/es/vtx-ellipsis-text/index.js +7 -2
- package/es/vtx-ellipsis-text/style/index.js +3 -1
- package/es/vtx-export/index.js +33 -33
- package/es/vtx-export-async/History.js +15 -7
- package/es/vtx-export-async/index.js +45 -15
- package/es/vtx-export-async/util.js +16 -5
- package/es/vtx-form-layout/Card.js +10 -10
- package/es/vtx-form-layout/Divider.js +1 -1
- package/es/vtx-form-layout/FormItem.js +16 -16
- package/es/vtx-form-layout/Pane.js +23 -12
- package/es/vtx-icon/index.js +54 -45
- package/es/vtx-icon/index.js1 +90 -0
- package/es/vtx-image/Preview.js +11 -6
- package/es/vtx-image/style/index.js +0 -1
- package/es/vtx-import/index.js +211 -70
- package/es/vtx-import/result.js +28 -26
- package/es/vtx-import/style/index.js +16 -1
- package/es/vtx-import2/Content.js +2 -1
- package/es/vtx-import2/index.js +30 -19
- package/es/vtx-import2/style/index.js +60 -9
- package/es/vtx-modal/index.js +11 -6
- package/es/vtx-page-layout/Basic.js +2 -2
- package/es/vtx-page-layout/TabLayout.js +6 -6
- package/es/vtx-page-layout/TableLayout.js +10 -10
- package/es/vtx-page-layout/TreeLayout.js +6 -6
- package/es/vtx-page-layout/container.js +2 -2
- package/es/vtx-page-layout/style/index.js +4 -2
- package/es/vtx-provider/index.js +37 -33
- package/es/vtx-provider/intl.js +9 -9
- package/es/vtx-provider/locale/en_US.js +57 -3
- package/es/vtx-provider/locale/zh_CN.js +57 -3
- package/es/vtx-provider/useStyle/index.js +17 -17
- package/es/vtx-search/index.js +13 -9
- package/es/vtx-search/style/index.js +2 -1
- package/es/vtx-select/index.js +102 -36
- package/es/vtx-select/style/index.js +11 -56
- package/es/vtx-signature/index.js +5 -4
- package/es/vtx-signature/style/index.js +1 -1
- package/es/vtx-split-pane/Resizer.js +0 -1
- package/es/vtx-split-pane/SplitPane.js +42 -34
- package/es/vtx-split-pane/style/index.js +8 -112
- package/es/vtx-time-picker/index.js +27 -1
- package/es/vtx-transfer/Transfer.js +29 -0
- package/es/vtx-transfer/index.js +3 -0
- package/es/vtx-transfer/style/index.js +19 -0
- package/es/vtx-transfer-select/TransferSelect.js +143 -0
- package/es/vtx-transfer-select/index.js +3 -0
- package/es/vtx-transfer-select/style/index.js +19 -0
- package/es/vtx-tree/index.js +98 -35
- package/es/vtx-tree-select/index.js +71 -105
- package/es/vtx-tree-select/style/index.js +9 -3
- package/es/vtx-upload/FilePreview.js +2 -1
- package/es/vtx-wang-editor/index.js +93 -39
- package/es/vtx-wang-editor/style/index.less +12 -12
- package/es/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/lib/index.js +36 -0
- package/lib/utils/components/LabelIconTip/index.js +7 -7
- package/lib/utils/conversionMomentValue/index.js +25 -25
- package/lib/utils/filterSpecialCharacters.js +54 -52
- package/lib/utils/genCopyable/index.js +6 -6
- package/lib/utils/getFieldPropsOrFormItemProps/index.js +7 -7
- package/lib/utils/hooks/useDebounceFn/index.js +4 -4
- package/lib/utils/hooks/useDebounceValue/index.js +6 -6
- package/lib/utils/hooks/useDeepCompareMemo/index.js +7 -7
- package/lib/utils/hooks/useLatest/index.js +2 -2
- package/lib/utils/hooks/useRefCallback/index.js +5 -5
- package/lib/utils/index.js +0 -7
- package/lib/utils/isBrowser/index.js +7 -7
- package/lib/utils/isUrl/index.js +4 -4
- package/lib/utils/merge/index.js +4 -4
- package/lib/utils/nanoid/index.js +4 -4
- package/lib/utils/omitBoolean/index.js +4 -4
- package/lib/utils/parseValueToMoment/index.js +4 -4
- package/lib/utils/proFieldParsingText/index.js +10 -10
- package/lib/utils/transformKeySubmitValue/index.js +57 -57
- package/lib/utils/useEditableArray/index.js +46 -46
- package/lib/utils/useEditableMap/index.js +22 -22
- package/lib/utils/useMediaQuery/index.js +5 -5
- package/lib/vtx-combogrid/Combogrid.js +5 -4
- package/lib/vtx-combogrid/index.js +7 -4
- package/lib/vtx-datagrid/Store/Provide.js +113 -143
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/index.js +11 -7
- package/lib/vtx-datagrid/ToolBar/components/ColumnSetting/style.js +5 -2
- package/lib/vtx-datagrid/ToolBar/components/Density/index.js +3 -0
- package/lib/vtx-datagrid/ToolBar/components/TableStyle/index.js +3 -0
- package/lib/vtx-datagrid/columnState.js +100 -0
- package/lib/vtx-datagrid/index.js +124 -32
- package/lib/vtx-datagrid/mergeComponents.js +21 -0
- package/lib/vtx-datagrid/renderColumnButtons.js +30 -11
- package/lib/vtx-datagrid/style/index.js +102 -20
- package/lib/vtx-datagrid/style/index.less +242 -242
- package/lib/vtx-date-picker/QdatePicker.js +1 -1
- package/lib/vtx-date-picker/style/index.less +39 -39
- package/lib/vtx-descriptions/Descriptions.js +38 -0
- package/lib/vtx-descriptions/index.js +15 -0
- package/lib/vtx-descriptions/style/index.js +25 -0
- package/lib/vtx-ellipsis-text/index.js +7 -2
- package/lib/vtx-ellipsis-text/style/index.js +3 -1
- package/lib/vtx-export/index.js +34 -34
- package/lib/vtx-export-async/History.js +14 -8
- package/lib/vtx-export-async/index.js +43 -13
- package/lib/vtx-export-async/util.js +16 -5
- package/lib/vtx-form-layout/Card.js +9 -9
- package/lib/vtx-form-layout/Divider.js +1 -1
- package/lib/vtx-form-layout/FormItem.js +16 -16
- package/lib/vtx-form-layout/Pane.js +22 -11
- package/lib/vtx-icon/index.js +54 -52
- package/lib/vtx-icon/index.js1 +90 -0
- package/lib/vtx-image/Preview.js +11 -6
- package/lib/vtx-image/style/index.js +0 -1
- package/lib/vtx-import/index.js +209 -71
- package/lib/vtx-import/result.js +29 -27
- package/lib/vtx-import/style/index.js +16 -1
- package/lib/vtx-import2/Content.js +2 -1
- package/lib/vtx-import2/index.js +29 -18
- package/lib/vtx-import2/style/index.js +60 -9
- package/lib/vtx-modal/index.js +11 -6
- package/lib/vtx-page-layout/Basic.js +2 -2
- package/lib/vtx-page-layout/TabLayout.js +6 -6
- package/lib/vtx-page-layout/TableLayout.js +10 -10
- package/lib/vtx-page-layout/TreeLayout.js +6 -6
- package/lib/vtx-page-layout/container.js +2 -2
- package/lib/vtx-page-layout/style/index.js +4 -2
- package/lib/vtx-provider/index.js +37 -33
- package/lib/vtx-provider/intl.js +9 -9
- package/lib/vtx-provider/locale/en_US.js +57 -3
- package/lib/vtx-provider/locale/zh_CN.js +57 -3
- package/lib/vtx-provider/useStyle/index.js +17 -17
- package/lib/vtx-search/index.js +13 -9
- package/lib/vtx-search/style/index.js +2 -1
- package/lib/vtx-select/index.js +104 -38
- package/lib/vtx-select/style/index.js +11 -56
- package/lib/vtx-signature/index.js +4 -3
- package/lib/vtx-signature/style/index.js +1 -1
- package/lib/vtx-split-pane/Resizer.js +0 -1
- package/lib/vtx-split-pane/SplitPane.js +40 -31
- package/lib/vtx-split-pane/style/index.js +8 -112
- package/lib/vtx-time-picker/index.js +27 -1
- package/lib/vtx-transfer/Transfer.js +38 -0
- package/lib/vtx-transfer/index.js +15 -0
- package/lib/vtx-transfer/style/index.js +25 -0
- package/lib/vtx-transfer-select/TransferSelect.js +151 -0
- package/lib/vtx-transfer-select/index.js +15 -0
- package/lib/vtx-transfer-select/style/index.js +25 -0
- package/lib/vtx-tree/index.js +96 -33
- package/lib/vtx-tree-select/index.js +71 -105
- package/lib/vtx-tree-select/style/index.js +9 -3
- package/lib/vtx-upload/FilePreview.js +2 -1
- package/lib/vtx-wang-editor/index.js +91 -37
- package/lib/vtx-wang-editor/style/index.less +12 -12
- package/lib/vtx-wang-editor/wangEditorUtil.js +4 -0
- package/package.json +240 -225
- package/es/utils/hooks/useFetchData/index.js +0 -82
- package/lib/utils/hooks/useFetchData/index.js +0 -89
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# @vtx/components
|
|
2
|
-
|
|
3
|
-
> 公司 PC 端基础组件库
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```shell
|
|
8
|
-
$ pnpm add @vtx/components -S
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 使用
|
|
12
|
-
|
|
13
|
-
```js
|
|
14
|
-
import { VtxDatePicker } from '@vtx/components';
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Doc
|
|
18
|
-
|
|
19
|
-
[在线示例文档](http://front-end.pages.cloudhw.cn:8000/react-components/)
|
|
1
|
+
# @vtx/components
|
|
2
|
+
|
|
3
|
+
> 公司 PC 端基础组件库
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
$ pnpm add @vtx/components -S
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
import { VtxDatePicker } from '@vtx/components';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Doc
|
|
18
|
+
|
|
19
|
+
[在线示例文档](http://front-end.pages.cloudhw.cn:8000/react-components/)
|
package/es/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./vtx-time-picker";
|
|
|
22
22
|
export * from "./vtx-upload";
|
|
23
23
|
export * from "./vtx-tree-select";
|
|
24
24
|
export * from "./vtx-signature";
|
|
25
|
+
export * from "./vtx-transfer-select";
|
|
25
26
|
|
|
26
27
|
// data display
|
|
27
28
|
export * from "./vtx-datagrid";
|
|
@@ -30,8 +31,10 @@ export * from "./vtx-image";
|
|
|
30
31
|
export * from "./vtx-rps-frame";
|
|
31
32
|
export * from "./vtx-statistics-column";
|
|
32
33
|
export * from "./vtx-tree";
|
|
34
|
+
export * from "./vtx-transfer";
|
|
33
35
|
export * from "./vtx-split-pane";
|
|
34
36
|
export * from "./vtx-icon";
|
|
37
|
+
export * from "./vtx-descriptions";
|
|
35
38
|
|
|
36
39
|
// feedback
|
|
37
40
|
export * from "./vtx-modal";
|
|
@@ -10,13 +10,13 @@ import classnames from 'classnames';
|
|
|
10
10
|
import React, { useContext } from 'react';
|
|
11
11
|
import { useStyle } from "./style";
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
15
|
-
* @param {Object} props
|
|
16
|
-
* @param {React.ReactNode} props.label
|
|
17
|
-
* @param {React.ReactNode} [props.subTitle]
|
|
18
|
-
* @param {string|Object} [props.tooltip]
|
|
19
|
-
* @param {boolean|Object} [props.ellipsis]
|
|
13
|
+
/**
|
|
14
|
+
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
15
|
+
* @param {Object} props
|
|
16
|
+
* @param {React.ReactNode} props.label
|
|
17
|
+
* @param {React.ReactNode} [props.subTitle]
|
|
18
|
+
* @param {string|Object} [props.tooltip]
|
|
19
|
+
* @param {boolean|Object} [props.ellipsis]
|
|
20
20
|
*/
|
|
21
21
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,19 +17,19 @@ var dateFormatterMap = {
|
|
|
17
17
|
dateTimeRange: 'YYYY-MM-DD HH:mm:ss'
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* 判断是不是一个 object
|
|
22
|
-
* @param {any} o
|
|
23
|
-
* @returns boolean
|
|
20
|
+
/**
|
|
21
|
+
* 判断是不是一个 object
|
|
22
|
+
* @param {any} o
|
|
23
|
+
* @returns boolean
|
|
24
24
|
*/
|
|
25
25
|
function isObject(o) {
|
|
26
26
|
return Object.prototype.toString.call(o) === '[object Object]';
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* 判断是否是一个的简单的 object
|
|
31
|
-
* @param {{constructor:any}} o
|
|
32
|
-
* @returns boolean
|
|
29
|
+
/**
|
|
30
|
+
* 判断是否是一个的简单的 object
|
|
31
|
+
* @param {{constructor:any}} o
|
|
32
|
+
* @returns boolean
|
|
33
33
|
*/
|
|
34
34
|
export function isPlainObject(o) {
|
|
35
35
|
if (isObject(o) === false) return false;
|
|
@@ -51,20 +51,20 @@ export function isPlainObject(o) {
|
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* 一个比较hack的moment判断工具
|
|
56
|
-
* @param {any} value
|
|
57
|
-
* @returns boolean
|
|
54
|
+
/**
|
|
55
|
+
* 一个比较hack的moment判断工具
|
|
56
|
+
* @param {any} value
|
|
57
|
+
* @returns boolean
|
|
58
58
|
*/
|
|
59
59
|
var isMoment = function isMoment(value) {
|
|
60
60
|
return !!(value !== null && value !== void 0 && value._isAMomentObject);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* 根据不同的格式转化 dayjs
|
|
65
|
-
* @param {dayjs.Dayjs} value
|
|
66
|
-
* @param {string|((value:dayjs.Dayjs} dateFormatter
|
|
67
|
-
* @param {string} valueType
|
|
63
|
+
/**
|
|
64
|
+
* 根据不同的格式转化 dayjs
|
|
65
|
+
* @param {dayjs.Dayjs} value
|
|
66
|
+
* @param {string|((value:dayjs.Dayjs} dateFormatter
|
|
67
|
+
* @param {string} valueType
|
|
68
68
|
*/
|
|
69
69
|
export var convertMoment = function convertMoment(value, dateFormatter, valueType) {
|
|
70
70
|
if (!dateFormatter) {
|
|
@@ -87,14 +87,14 @@ export var convertMoment = function convertMoment(value, dateFormatter, valueTyp
|
|
|
87
87
|
return value;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
/**
|
|
91
|
-
* 这里主要是来转化一下数据 将 dayjs 转化为 string 将 all 默认删除
|
|
92
|
-
* @param {T} value
|
|
93
|
-
* @param {DateFormatter} dateFormatter
|
|
94
|
-
* @param {Record<string} valueTypeMap
|
|
95
|
-
* @param {ProFieldValueType;dateFormat:string;}|any>} |{valueType
|
|
96
|
-
* @param {boolean} omitNil?
|
|
97
|
-
* @param {NamePath} parentKey?
|
|
90
|
+
/**
|
|
91
|
+
* 这里主要是来转化一下数据 将 dayjs 转化为 string 将 all 默认删除
|
|
92
|
+
* @param {T} value
|
|
93
|
+
* @param {DateFormatter} dateFormatter
|
|
94
|
+
* @param {Record<string} valueTypeMap
|
|
95
|
+
* @param {ProFieldValueType;dateFormat:string;}|any>} |{valueType
|
|
96
|
+
* @param {boolean} omitNil?
|
|
97
|
+
* @param {NamePath} parentKey?
|
|
98
98
|
*/
|
|
99
99
|
export var conversionMomentValue = function conversionMomentValue(value, dateFormatter, valueTypeMap, omitNil, parentKey) {
|
|
100
100
|
var tmpValue = {};
|
|
@@ -9,12 +9,58 @@ function isNotEmpty(value) {
|
|
|
9
9
|
return Array.isArray(value) && value.length > 0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
// 特殊符号,- _ 排除
|
|
13
|
+
export var SpecialCharacters = [
|
|
14
|
+
// 小括号
|
|
15
|
+
'(', ')', '(', ')',
|
|
16
|
+
// 中括号
|
|
17
|
+
'\\[', '\\]', '[', ']',
|
|
18
|
+
// 大括号
|
|
19
|
+
'{', '}', '{', '}',
|
|
20
|
+
// 方头括号
|
|
21
|
+
'【', '】',
|
|
22
|
+
// 尖括号
|
|
23
|
+
'<', '>',
|
|
24
|
+
// 书名号
|
|
25
|
+
'《', '》',
|
|
26
|
+
// 斜杠
|
|
27
|
+
'/',
|
|
28
|
+
// 反斜杠
|
|
29
|
+
'\\\\',
|
|
30
|
+
// 逗号
|
|
31
|
+
',', ',',
|
|
32
|
+
// 句号
|
|
33
|
+
'.', '。',
|
|
34
|
+
// 冒号
|
|
35
|
+
':', ':',
|
|
36
|
+
// 分号
|
|
37
|
+
';', ';',
|
|
38
|
+
// 顿号
|
|
39
|
+
'、',
|
|
40
|
+
// 破折号
|
|
41
|
+
'——',
|
|
42
|
+
// 感叹号
|
|
43
|
+
'!', '!',
|
|
44
|
+
// 问号
|
|
45
|
+
'?', '?',
|
|
46
|
+
// 加减等于
|
|
47
|
+
'+', '=',
|
|
48
|
+
// 单引号
|
|
49
|
+
"'", '‘', '’',
|
|
50
|
+
// 双引号
|
|
51
|
+
'"', '“', '”',
|
|
52
|
+
// 金钱
|
|
53
|
+
'$', '¥',
|
|
54
|
+
// 百分号
|
|
55
|
+
'%', '%',
|
|
56
|
+
// 其它
|
|
57
|
+
'@', '#', '`', '~', '*', '^', '……', '|', '&'];
|
|
58
|
+
/**
|
|
59
|
+
* 过滤特殊字符
|
|
60
|
+
* @param {String} value 值
|
|
61
|
+
* @param {Object} option
|
|
62
|
+
* @param {Array} [option.include] 新增
|
|
63
|
+
* @param {Array} [option.exclude] 排除
|
|
18
64
|
*/
|
|
19
65
|
export default function filterSpecialCharacters(value) {
|
|
20
66
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -22,52 +68,7 @@ export default function filterSpecialCharacters(value) {
|
|
|
22
68
|
include = _ref$include === void 0 ? [] : _ref$include,
|
|
23
69
|
_ref$exclude = _ref.exclude,
|
|
24
70
|
exclude = _ref$exclude === void 0 ? [] : _ref$exclude;
|
|
25
|
-
|
|
26
|
-
var specialCharacter = [
|
|
27
|
-
// 小括号
|
|
28
|
-
'(', ')', '(', ')',
|
|
29
|
-
// 中括号
|
|
30
|
-
'\\[', '\\]', '[', ']',
|
|
31
|
-
// 大括号
|
|
32
|
-
'{', '}', '{', '}',
|
|
33
|
-
// 方头括号
|
|
34
|
-
'【', '】',
|
|
35
|
-
// 尖括号
|
|
36
|
-
'<', '>',
|
|
37
|
-
// 书名号
|
|
38
|
-
'《', '》',
|
|
39
|
-
// 斜杠
|
|
40
|
-
'/',
|
|
41
|
-
// 反斜杠
|
|
42
|
-
'\\\\',
|
|
43
|
-
// 逗号
|
|
44
|
-
',', ',',
|
|
45
|
-
// 句号
|
|
46
|
-
'.', '。',
|
|
47
|
-
// 冒号
|
|
48
|
-
':', ':',
|
|
49
|
-
// 分号
|
|
50
|
-
';', ';',
|
|
51
|
-
// 顿号
|
|
52
|
-
'、',
|
|
53
|
-
// 破折号
|
|
54
|
-
'——',
|
|
55
|
-
// 感叹号
|
|
56
|
-
'!', '!',
|
|
57
|
-
// 问号
|
|
58
|
-
'?', '?',
|
|
59
|
-
// 加减等于
|
|
60
|
-
'+', '=',
|
|
61
|
-
// 单引号
|
|
62
|
-
"'", '‘', '’',
|
|
63
|
-
// 双引号
|
|
64
|
-
'"', '“', '”',
|
|
65
|
-
// 金钱
|
|
66
|
-
'$', '¥',
|
|
67
|
-
// 百分号
|
|
68
|
-
'%', '%',
|
|
69
|
-
// 其它
|
|
70
|
-
'@', '#', '`', '~', '*', '^', '……', '|', '&'];
|
|
71
|
+
var specialCharacter = JSON.parse(JSON.stringify(SpecialCharacters));
|
|
71
72
|
|
|
72
73
|
// 新增
|
|
73
74
|
if (isNotEmpty(include)) {
|
|
@@ -19,12 +19,12 @@ var getEllipsis = function getEllipsis(item) {
|
|
|
19
19
|
return item.ellipsis;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* 生成 Copyable 或 Ellipsis 的 dom
|
|
24
|
-
*
|
|
25
|
-
* @param dom
|
|
26
|
-
* @param item
|
|
27
|
-
* @param text
|
|
22
|
+
/**
|
|
23
|
+
* 生成 Copyable 或 Ellipsis 的 dom
|
|
24
|
+
*
|
|
25
|
+
* @param dom
|
|
26
|
+
* @param item
|
|
27
|
+
* @param text
|
|
28
28
|
*/
|
|
29
29
|
export var genCopyable = function genCopyable(dom, item, text) {
|
|
30
30
|
if (item.copyable || item.ellipsis) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { runFunction } from "../runFunction";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* 因为 fieldProps 支持了 function 所以新增了这个方法
|
|
5
|
-
*
|
|
6
|
-
* @param {any} fieldProps
|
|
7
|
-
* @param {any} [form]
|
|
8
|
-
* @param {any} [extraProps]
|
|
9
|
-
* @returns {Record<string, any> & { onChange: any, colSize: number }}
|
|
3
|
+
/**
|
|
4
|
+
* 因为 fieldProps 支持了 function 所以新增了这个方法
|
|
5
|
+
*
|
|
6
|
+
* @param {any} fieldProps
|
|
7
|
+
* @param {any} [form]
|
|
8
|
+
* @param {any} [extraProps]
|
|
9
|
+
* @returns {Record<string, any> & { onChange: any, colSize: number }}
|
|
10
10
|
*/
|
|
11
11
|
export var getFieldPropsOrFormItemProps = function getFieldPropsOrFormItemProps(fieldProps, form, extraProps) {
|
|
12
12
|
if (form === undefined) {
|
|
@@ -4,10 +4,10 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import { useCallback, useEffect, useRef } from 'react';
|
|
6
6
|
import { useRefFunction } from "../useRefFunction";
|
|
7
|
-
/**
|
|
8
|
-
* 一个去抖的 hook,传入一个 function,返回一个去抖后的 function
|
|
9
|
-
* @param {(...args:T) => Promise<any>} fn
|
|
10
|
-
* @param {number} wait?
|
|
7
|
+
/**
|
|
8
|
+
* 一个去抖的 hook,传入一个 function,返回一个去抖后的 function
|
|
9
|
+
* @param {(...args:T) => Promise<any>} fn
|
|
10
|
+
* @param {number} wait?
|
|
11
11
|
*/
|
|
12
12
|
export function useDebounceFn(fn, wait) {
|
|
13
13
|
var callback = useRefFunction(fn);
|
|
@@ -11,12 +11,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
11
11
|
import { useEffect, useState } from 'react';
|
|
12
12
|
import { useLatest } from "../useLatest";
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* 一个去抖的setState,减少更新的频率
|
|
16
|
-
* @param {any} value
|
|
17
|
-
* @param {number} [delay=100]
|
|
18
|
-
* @param {any[]} deps
|
|
19
|
-
* @returns {any}
|
|
14
|
+
/**
|
|
15
|
+
* 一个去抖的setState,减少更新的频率
|
|
16
|
+
* @param {any} value
|
|
17
|
+
* @param {number} [delay=100]
|
|
18
|
+
* @param {any[]} deps
|
|
19
|
+
* @returns {any}
|
|
20
20
|
*/
|
|
21
21
|
export function useDebounceValue(value) {
|
|
22
22
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useDeepCompareMemoize } from "../useDeepCompareEffect";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* `useDeepCompareMemo` will only recompute the memoized value when one of the
|
|
6
|
-
* `deps` has changed.
|
|
7
|
-
*
|
|
8
|
-
* Usage note: only use this if `deps` are objects or arrays that contain
|
|
9
|
-
* objects. Otherwise you should just use React.useMemo.
|
|
10
|
-
*
|
|
4
|
+
/**
|
|
5
|
+
* `useDeepCompareMemo` will only recompute the memoized value when one of the
|
|
6
|
+
* `deps` has changed.
|
|
7
|
+
*
|
|
8
|
+
* Usage note: only use this if `deps` are objects or arrays that contain
|
|
9
|
+
* objects. Otherwise you should just use React.useMemo.
|
|
10
|
+
*
|
|
11
11
|
*/
|
|
12
12
|
function useDeepCompareMemo(factory, dependencies) {
|
|
13
13
|
return React.useMemo(factory, useDeepCompareMemoize(dependencies));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @see https://github.com/streamich/react-use/blob/master/docs/useLatest.md
|
|
3
|
+
/**
|
|
4
|
+
* @see https://github.com/streamich/react-use/blob/master/docs/useLatest.md
|
|
5
5
|
*/
|
|
6
6
|
export var useLatest = function useLatest(value) {
|
|
7
7
|
var ref = useRef(value);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* useRefCallback
|
|
5
|
-
* @param {Function} callback ref.current 变化时触发
|
|
6
|
-
* @param {any} [initialValue] 初始值
|
|
7
|
-
* @returns {Object} 代理后的 ref 对象
|
|
3
|
+
/**
|
|
4
|
+
* useRefCallback
|
|
5
|
+
* @param {Function} callback ref.current 变化时触发
|
|
6
|
+
* @param {any} [initialValue] 初始值
|
|
7
|
+
* @returns {Object} 代理后的 ref 对象
|
|
8
8
|
*/
|
|
9
9
|
export function useRefCallback(callback, initialValue) {
|
|
10
10
|
var ref = useMemo(function () {
|
package/es/utils/index.js
CHANGED
|
@@ -15,7 +15,6 @@ import { useDebounceValue } from "./hooks/useDebounceValue";
|
|
|
15
15
|
import { useDeepCompareEffect, useDeepCompareEffectDebounce } from "./hooks/useDeepCompareEffect";
|
|
16
16
|
import useDeepCompareMemo from "./hooks/useDeepCompareMemo";
|
|
17
17
|
import { useDocumentTitle } from "./hooks/useDocumentTitle";
|
|
18
|
-
import { useFetchData } from "./hooks/useFetchData";
|
|
19
18
|
import { useLatest } from "./hooks/useLatest";
|
|
20
19
|
import { usePrevious } from "./hooks/usePrevious";
|
|
21
20
|
import { useReactiveRef } from "./hooks/useReactiveRef";
|
|
@@ -56,7 +55,7 @@ export { conversionMomentValue, conversionMomentValue as conversionSubmitValue,
|
|
|
56
55
|
// function
|
|
57
56
|
transformKeySubmitValue, useBreakpoint, useDebounceFn, useDebounceValue, useDeepCompareEffect, useDeepCompareEffectDebounce, useDeepCompareMemo, useDocumentTitle,
|
|
58
57
|
// hooks
|
|
59
|
-
useEditableArray, useEditableMap,
|
|
58
|
+
useEditableArray, useEditableMap, useLatest, useMountMergeState, usePrevious, useReactiveRef, useRefCallback, useRefFunction, useStyle, genColumnKey, getPlaceholder };
|
|
60
59
|
|
|
61
60
|
// 注意:以下类型导出在JavaScript中不可用,已移除
|
|
62
61
|
// export type {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* 用于判断当前是否在浏览器环境中。
|
|
5
|
-
* 首先会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
6
|
-
* 如果是,则返回 true。否则,会进一步判断是否存在 window 对象、document 对象以及 matchMedia 方法
|
|
7
|
-
* 同时通过 !isNode 判断当前不是在服务器(Node.js)环境下执行,
|
|
8
|
-
* 如果都符合,则返回 true 表示当前处于浏览器环境中。
|
|
9
|
-
* @returns boolean
|
|
3
|
+
/**
|
|
4
|
+
* 用于判断当前是否在浏览器环境中。
|
|
5
|
+
* 首先会判断当前是否处于测试环境中(通过 process.env.NODE_ENV === 'TEST' 判断),
|
|
6
|
+
* 如果是,则返回 true。否则,会进一步判断是否存在 window 对象、document 对象以及 matchMedia 方法
|
|
7
|
+
* 同时通过 !isNode 判断当前不是在服务器(Node.js)环境下执行,
|
|
8
|
+
* 如果都符合,则返回 true 表示当前处于浏览器环境中。
|
|
9
|
+
* @returns boolean
|
|
10
10
|
*/
|
|
11
11
|
export var isBrowser = function isBrowser() {
|
|
12
12
|
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'TEST') {
|
package/es/utils/isUrl/index.js
CHANGED
package/es/utils/merge/index.js
CHANGED
|
@@ -6,10 +6,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
6
6
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
7
7
|
/* eslint-disable prefer-rest-params */
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* 用于合并 n 个对象
|
|
11
|
-
* @param {any[]} ...rest
|
|
12
|
-
* @returns T
|
|
9
|
+
/**
|
|
10
|
+
* 用于合并 n 个对象
|
|
11
|
+
* @param {any[]} ...rest
|
|
12
|
+
* @returns T
|
|
13
13
|
*/
|
|
14
14
|
var merge = function merge() {
|
|
15
15
|
var obj = {};
|
package/es/utils/nanoid/index.js
CHANGED
|
@@ -15,10 +15,10 @@ var genNanoid = function genNanoid() {
|
|
|
15
15
|
return e;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
/**
|
|
19
|
-
* 生成uuid,如果不支持 randomUUID,就用 genNanoid
|
|
20
|
-
*
|
|
21
|
-
* @returns string
|
|
18
|
+
/**
|
|
19
|
+
* 生成uuid,如果不支持 randomUUID,就用 genNanoid
|
|
20
|
+
*
|
|
21
|
+
* @returns string
|
|
22
22
|
*/
|
|
23
23
|
export var nanoid = function nanoid() {
|
|
24
24
|
if (typeof window === 'undefined') return genNanoid();
|
|
@@ -3,10 +3,10 @@ import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
|
3
3
|
import { isNil } from "../isNil";
|
|
4
4
|
dayjs.extend(customParseFormat);
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* 一个比较hack的moment判断工具
|
|
8
|
-
* @param value
|
|
9
|
-
* @returns
|
|
6
|
+
/**
|
|
7
|
+
* 一个比较hack的moment判断工具
|
|
8
|
+
* @param value
|
|
9
|
+
* @returns
|
|
10
10
|
*/
|
|
11
11
|
var isMoment = function isMoment(value) {
|
|
12
12
|
return !!(value !== null && value !== void 0 && value._isAMomentObject);
|
|
@@ -2,10 +2,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import { Badge, Space } from 'antd';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* 获取类型的 type
|
|
7
|
-
*
|
|
8
|
-
* @param obj
|
|
5
|
+
/**
|
|
6
|
+
* 获取类型的 type
|
|
7
|
+
*
|
|
8
|
+
* @param obj
|
|
9
9
|
*/
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
function getType(obj) {
|
|
@@ -103,12 +103,12 @@ var TableStatus = {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
/**
|
|
107
|
-
* 转化 text 和 valueEnum 通过 type 来添加 Status
|
|
108
|
-
*
|
|
109
|
-
* @param text
|
|
110
|
-
* @param valueEnum
|
|
111
|
-
* @param pure 纯净模式,不增加 status
|
|
106
|
+
/**
|
|
107
|
+
* 转化 text 和 valueEnum 通过 type 来添加 Status
|
|
108
|
+
*
|
|
109
|
+
* @param text
|
|
110
|
+
* @param valueEnum
|
|
111
|
+
* @param pure 纯净模式,不增加 status
|
|
112
112
|
*/
|
|
113
113
|
export var proFieldParsingText = function proFieldParsingText(text, valueEnumParams, key) {
|
|
114
114
|
if (Array.isArray(text)) {
|