feffery_antd_components 0.2.10-rc15 → 0.2.10-rc17
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/DESCRIPTION +1 -1
- package/Project.toml +1 -1
- package/build/lib/feffery_antd_components/__init__.py +1 -1
- package/build/lib/feffery_antd_components/async-antd_table.js +1 -1
- package/build/lib/feffery_antd_components/async-antd_upload.js +1 -1
- package/build/lib/feffery_antd_components/async-data_entry.js +1 -0
- package/build/lib/feffery_antd_components/feffery_antd_components.min.js +1 -1
- package/build/lib/feffery_antd_components/package-info.json +1 -1
- package/feffery_antd_components/AntdMenu.py +6 -4
- package/feffery_antd_components/__init__.py +1 -1
- package/feffery_antd_components/async-antd_table.js +1 -1
- package/feffery_antd_components/async-antd_upload.js +1 -1
- package/feffery_antd_components/async-data_entry.js +1 -0
- package/feffery_antd_components/feffery_antd_components.min.js +1 -1
- package/feffery_antd_components/metadata.json +10 -0
- package/feffery_antd_components/package-info.json +1 -1
- package/package.json +1 -1
- package/src/jl/'feffery'_antdmenu.jl +2 -1
- package/src/lib/components/dataEntry/AntdCascader.react.js +9 -147
- package/src/lib/components/dataEntry/AntdCheckbox.react.js +9 -74
- package/src/lib/components/dataEntry/AntdCheckboxGroup.react.js +9 -71
- package/src/lib/components/dataEntry/AntdDatePicker.react.js +10 -425
- package/src/lib/components/dataEntry/AntdDateRangePicker.react.js +9 -446
- package/src/lib/components/dataEntry/AntdInput.react.js +11 -325
- package/src/lib/components/dataEntry/AntdInputNumber.react.js +9 -134
- package/src/lib/components/dataEntry/AntdMentions.react.js +9 -113
- package/src/lib/components/dataEntry/AntdRadioGroup.react.js +9 -135
- package/src/lib/components/dataEntry/AntdRate.react.js +9 -76
- package/src/lib/components/dataEntry/AntdSegmentedColoring.react.js +9 -206
- package/src/lib/components/dataEntry/AntdSelect.react.js +10 -288
- package/src/lib/components/dataEntry/AntdSlider.react.js +9 -123
- package/src/lib/components/dataEntry/AntdSwitch.react.js +9 -84
- package/src/lib/components/dataEntry/AntdTimePicker.react.js +9 -125
- package/src/lib/components/dataEntry/AntdTimeRangePicker.react.js +9 -141
- package/src/lib/components/dataEntry/AntdTransfer.react.js +9 -132
- package/src/lib/components/dataEntry/AntdTreeSelect.react.js +11 -207
- package/src/lib/components/dataEntry/check-card/AntdCheckCard.react.js +10 -66
- package/src/lib/components/dataEntry/check-card/AntdCheckCardGroup.react.js +10 -79
- package/src/lib/components/dataEntry/form/AntdForm.react.js +9 -42
- package/src/lib/components/dataEntry/form/AntdFormItem.react.js +9 -54
- package/src/lib/components/navigation/AntdMenu.react.js +14 -10
- package/src/lib/fragments/AntdTable.react.js +29 -12
- package/src/lib/fragments/dataEntry/AntdCascader.react.js +157 -0
- package/src/lib/fragments/dataEntry/AntdCheckbox.react.js +85 -0
- package/src/lib/fragments/dataEntry/AntdCheckboxGroup.react.js +82 -0
- package/src/lib/fragments/dataEntry/AntdDatePicker.react.js +436 -0
- package/src/lib/fragments/dataEntry/AntdDateRangePicker.react.js +458 -0
- package/src/lib/fragments/dataEntry/AntdInput.react.js +333 -0
- package/src/lib/fragments/dataEntry/AntdInputNumber.react.js +145 -0
- package/src/lib/fragments/dataEntry/AntdMentions.react.js +124 -0
- package/src/lib/fragments/dataEntry/AntdRadioGroup.react.js +146 -0
- package/src/lib/fragments/dataEntry/AntdRate.react.js +87 -0
- package/src/lib/fragments/dataEntry/AntdSegmentedColoring.react.js +219 -0
- package/src/lib/fragments/dataEntry/AntdSelect.react.js +298 -0
- package/src/lib/fragments/dataEntry/AntdSlider.react.js +134 -0
- package/src/lib/fragments/dataEntry/AntdSwitch.react.js +95 -0
- package/src/lib/fragments/dataEntry/AntdTimePicker.react.js +136 -0
- package/src/lib/fragments/dataEntry/AntdTimeRangePicker.react.js +152 -0
- package/src/lib/fragments/dataEntry/AntdTransfer.react.js +143 -0
- package/src/lib/fragments/dataEntry/AntdTreeSelect.react.js +216 -0
- package/src/lib/fragments/dataEntry/check-card/AntdCheckCard.react.js +77 -0
- package/src/lib/fragments/dataEntry/check-card/AntdCheckCardGroup.react.js +89 -0
- package/src/lib/fragments/dataEntry/form/AntdForm.react.js +53 -0
- package/src/lib/fragments/dataEntry/form/AntdFormItem.react.js +65 -0
- package/usage.py +45 -56
|
@@ -1,72 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { CheckCard } from '@ant-design/pro-card';
|
|
4
|
-
import { isUndefined, isString } from 'lodash';
|
|
5
|
-
import useCss from '../../../hooks/useCss';
|
|
6
|
-
import PropsContext from '../../../contexts/PropsContext';
|
|
7
3
|
|
|
8
|
-
|
|
9
|
-
const AntdCheckCard = (props) => {
|
|
10
|
-
// 取得必要属性或参数
|
|
11
|
-
let {
|
|
12
|
-
id,
|
|
13
|
-
children,
|
|
14
|
-
className,
|
|
15
|
-
style,
|
|
16
|
-
key,
|
|
17
|
-
checked,
|
|
18
|
-
bordered,
|
|
19
|
-
value,
|
|
20
|
-
defaultChecked,
|
|
21
|
-
disabled,
|
|
22
|
-
size,
|
|
23
|
-
readOnly,
|
|
24
|
-
setProps,
|
|
25
|
-
loading_state,
|
|
26
|
-
persistence,
|
|
27
|
-
persisted_props,
|
|
28
|
-
persistence_type
|
|
29
|
-
} = props;
|
|
30
|
-
|
|
31
|
-
const context = useContext(PropsContext)
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!isUndefined(defaultChecked) && isUndefined(checked)) {
|
|
35
|
-
setProps({ checked: defaultChecked })
|
|
36
|
-
}
|
|
37
|
-
}, [])
|
|
4
|
+
const LazyAntdCheckCard = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../../fragments/dataEntry/check-card/AntdCheckCard.react'));
|
|
38
5
|
|
|
6
|
+
const AntdCheckCard = (props) => {
|
|
39
7
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
className :
|
|
44
|
-
(className ? useCss(className) : undefined)
|
|
45
|
-
}
|
|
46
|
-
style={style}
|
|
47
|
-
key={key}
|
|
48
|
-
description={children}
|
|
49
|
-
checked={checked}
|
|
50
|
-
bordered={bordered}
|
|
51
|
-
value={value}
|
|
52
|
-
defaultChecked={defaultChecked}
|
|
53
|
-
disabled={
|
|
54
|
-
context && !isUndefined(context.componentDisabled) ?
|
|
55
|
-
context.componentDisabled :
|
|
56
|
-
disabled
|
|
57
|
-
}
|
|
58
|
-
size={size}
|
|
59
|
-
onChange={e => {
|
|
60
|
-
if (!readOnly) {
|
|
61
|
-
setProps({ checked: e })
|
|
62
|
-
}
|
|
63
|
-
}}
|
|
64
|
-
persistence={persistence}
|
|
65
|
-
persisted_props={persisted_props}
|
|
66
|
-
persistence_type={persistence_type}
|
|
67
|
-
data-dash-is-loading={
|
|
68
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
69
|
-
} />
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdCheckCard {...props} />
|
|
10
|
+
</Suspense>
|
|
70
11
|
);
|
|
71
12
|
}
|
|
72
13
|
|
|
@@ -175,4 +116,7 @@ AntdCheckCard.defaultProps = {
|
|
|
175
116
|
persistence_type: 'local'
|
|
176
117
|
}
|
|
177
118
|
|
|
178
|
-
export default AntdCheckCard;
|
|
119
|
+
export default AntdCheckCard;
|
|
120
|
+
|
|
121
|
+
export const propTypes = AntdCheckCard.propTypes;
|
|
122
|
+
export const defaultProps = AntdCheckCard.defaultProps;
|
|
@@ -1,85 +1,13 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { CheckCard } from '@ant-design/pro-card';
|
|
4
|
-
import { parseChildrenToArray } from '../../utils';
|
|
5
|
-
import { isString, isUndefined } from 'lodash';
|
|
6
|
-
import useCss from '../../../hooks/useCss';
|
|
7
|
-
import PropsContext from '../../../contexts/PropsContext';
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
const AntdCheckCardGroup = (props) => {
|
|
11
|
-
|
|
12
|
-
// 取得必要属性或参数
|
|
13
|
-
let {
|
|
14
|
-
id,
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
style,
|
|
18
|
-
key,
|
|
19
|
-
multiple,
|
|
20
|
-
allowNoValue,
|
|
21
|
-
bordered,
|
|
22
|
-
value,
|
|
23
|
-
defaultValue,
|
|
24
|
-
disabled,
|
|
25
|
-
size,
|
|
26
|
-
readOnly,
|
|
27
|
-
setProps,
|
|
28
|
-
loading_state,
|
|
29
|
-
persistence,
|
|
30
|
-
persisted_props,
|
|
31
|
-
persistence_type
|
|
32
|
-
} = props;
|
|
33
|
-
|
|
34
|
-
const context = useContext(PropsContext)
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (defaultValue && !value) {
|
|
38
|
-
setProps({ value: defaultValue })
|
|
39
|
-
}
|
|
40
|
-
}, [])
|
|
41
|
-
|
|
42
|
-
children = parseChildrenToArray(children)
|
|
4
|
+
const LazyAntdCheckCardGroup = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../../fragments/dataEntry/check-card/AntdCheckCardGroup.react'));
|
|
43
5
|
|
|
6
|
+
const AntdCheckCardGroup = (props) => {
|
|
44
7
|
return (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className :
|
|
49
|
-
(className ? useCss(className) : undefined)
|
|
50
|
-
}
|
|
51
|
-
style={style}
|
|
52
|
-
key={key}
|
|
53
|
-
multiple={multiple}
|
|
54
|
-
bordered={bordered}
|
|
55
|
-
value={value}
|
|
56
|
-
defaultValue={defaultValue}
|
|
57
|
-
disabled={
|
|
58
|
-
context && !isUndefined(context.componentDisabled) ?
|
|
59
|
-
context.componentDisabled :
|
|
60
|
-
disabled
|
|
61
|
-
}
|
|
62
|
-
size={size}
|
|
63
|
-
onChange={(e) => {
|
|
64
|
-
// 只读模式下不进行值更新
|
|
65
|
-
if (!readOnly) {
|
|
66
|
-
if (allowNoValue) {
|
|
67
|
-
setProps({ value: e })
|
|
68
|
-
} else {
|
|
69
|
-
if (e && e.length !== 0) {
|
|
70
|
-
setProps({ value: e })
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}}
|
|
75
|
-
persistence={persistence}
|
|
76
|
-
persisted_props={persisted_props}
|
|
77
|
-
persistence_type={persistence_type}
|
|
78
|
-
data-dash-is-loading={
|
|
79
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
80
|
-
} >
|
|
81
|
-
{children}
|
|
82
|
-
</ CheckCard.Group>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdCheckCardGroup {...props} />
|
|
10
|
+
</Suspense>
|
|
83
11
|
);
|
|
84
12
|
}
|
|
85
13
|
|
|
@@ -214,4 +142,7 @@ AntdCheckCardGroup.defaultProps = {
|
|
|
214
142
|
persistence_type: 'local'
|
|
215
143
|
}
|
|
216
144
|
|
|
217
|
-
export default AntdCheckCardGroup;
|
|
145
|
+
export default AntdCheckCardGroup;
|
|
146
|
+
|
|
147
|
+
export const propTypes = AntdCheckCardGroup.propTypes;
|
|
148
|
+
export const defaultProps = AntdCheckCardGroup.defaultProps;
|
|
@@ -1,49 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Form } from 'antd';
|
|
4
|
-
import { isString } from 'lodash';
|
|
5
|
-
import useCss from '../../../hooks/useCss';
|
|
6
3
|
|
|
4
|
+
const LazyAntdForm = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../../fragments/dataEntry/form/AntdForm.react'));
|
|
7
5
|
|
|
8
|
-
// 定义表单组件AntdForm,api参数参考https://ant.design/components/form-cn/
|
|
9
6
|
const AntdForm = (props) => {
|
|
10
|
-
// 取得必要属性或参数
|
|
11
|
-
let {
|
|
12
|
-
id,
|
|
13
|
-
children,
|
|
14
|
-
className,
|
|
15
|
-
style,
|
|
16
|
-
key,
|
|
17
|
-
labelCol,
|
|
18
|
-
wrapperCol,
|
|
19
|
-
colon,
|
|
20
|
-
labelAlign,
|
|
21
|
-
labelWrap,
|
|
22
|
-
layout,
|
|
23
|
-
setProps,
|
|
24
|
-
loading_state
|
|
25
|
-
} = props;
|
|
26
|
-
|
|
27
7
|
return (
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className :
|
|
32
|
-
(className ? useCss(className) : undefined)
|
|
33
|
-
}
|
|
34
|
-
style={style}
|
|
35
|
-
key={key}
|
|
36
|
-
labelCol={labelCol}
|
|
37
|
-
wrapperCol={wrapperCol}
|
|
38
|
-
colon={colon}
|
|
39
|
-
labelAlign={labelAlign}
|
|
40
|
-
labelWrap={labelWrap}
|
|
41
|
-
layout={layout}
|
|
42
|
-
data-dash-is-loading={
|
|
43
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
44
|
-
}>
|
|
45
|
-
{children}
|
|
46
|
-
</Form>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdForm {...props} />
|
|
10
|
+
</Suspense>
|
|
47
11
|
);
|
|
48
12
|
}
|
|
49
13
|
|
|
@@ -142,4 +106,7 @@ AntdForm.defaultProps = {
|
|
|
142
106
|
labelWrap: false
|
|
143
107
|
}
|
|
144
108
|
|
|
145
|
-
export default AntdForm;
|
|
109
|
+
export default AntdForm;
|
|
110
|
+
|
|
111
|
+
export const propTypes = AntdForm.propTypes;
|
|
112
|
+
export const defaultProps = AntdForm.defaultProps;
|
|
@@ -1,61 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Suspense } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Form } from 'antd';
|
|
4
|
-
import { isString } from 'lodash';
|
|
5
|
-
import useCss from '../../../hooks/useCss';
|
|
6
3
|
|
|
7
|
-
const
|
|
4
|
+
const LazyAntdFormItem = React.lazy(() => import(/* webpackChunkName: "data_entry" */ '../../../fragments/dataEntry/form/AntdFormItem.react'));
|
|
8
5
|
|
|
9
|
-
// 定义表单项组件AntdFormItem,api参数参考https://ant.design/components/form-cn/
|
|
10
6
|
const AntdFormItem = (props) => {
|
|
11
|
-
// 取得必要属性或参数
|
|
12
|
-
let {
|
|
13
|
-
id,
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
style,
|
|
17
|
-
key,
|
|
18
|
-
labelCol,
|
|
19
|
-
colon,
|
|
20
|
-
wrapperCol,
|
|
21
|
-
label,
|
|
22
|
-
labelAlign,
|
|
23
|
-
tooltip,
|
|
24
|
-
extra,
|
|
25
|
-
help,
|
|
26
|
-
hidden,
|
|
27
|
-
required,
|
|
28
|
-
validateStatus,
|
|
29
|
-
setProps,
|
|
30
|
-
loading_state
|
|
31
|
-
} = props;
|
|
32
|
-
|
|
33
7
|
return (
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
className :
|
|
38
|
-
(className ? useCss(className) : undefined)
|
|
39
|
-
}
|
|
40
|
-
style={style}
|
|
41
|
-
key={key}
|
|
42
|
-
labelCol={labelCol}
|
|
43
|
-
colon={colon}
|
|
44
|
-
wrapperCol={wrapperCol}
|
|
45
|
-
label={label}
|
|
46
|
-
labelAlign={labelAlign}
|
|
47
|
-
tooltip={tooltip}
|
|
48
|
-
extra={extra}
|
|
49
|
-
help={help}
|
|
50
|
-
hasFeedback={true}
|
|
51
|
-
hidden={hidden}
|
|
52
|
-
required={required}
|
|
53
|
-
validateStatus={validateStatus}
|
|
54
|
-
data-dash-is-loading={
|
|
55
|
-
(loading_state && loading_state.is_loading) || undefined
|
|
56
|
-
}>
|
|
57
|
-
{children}
|
|
58
|
-
</Item>
|
|
8
|
+
<Suspense fallback={null}>
|
|
9
|
+
<LazyAntdFormItem {...props} />
|
|
10
|
+
</Suspense>
|
|
59
11
|
);
|
|
60
12
|
}
|
|
61
13
|
|
|
@@ -168,4 +120,7 @@ AntdFormItem.defaultProps = {
|
|
|
168
120
|
hidden: false
|
|
169
121
|
}
|
|
170
122
|
|
|
171
|
-
export default AntdFormItem;
|
|
123
|
+
export default AntdFormItem;
|
|
124
|
+
|
|
125
|
+
export const propTypes = AntdFormItem.propTypes;
|
|
126
|
+
export const defaultProps = AntdFormItem.defaultProps;
|
|
@@ -98,21 +98,21 @@ const str2Jsx = new Map([
|
|
|
98
98
|
])
|
|
99
99
|
|
|
100
100
|
// 递归推导多层菜单结构
|
|
101
|
-
const raw2Jsx = (obj, str2Jsx) => {
|
|
101
|
+
const raw2Jsx = (obj, str2Jsx, menuItemKeyToTitle) => {
|
|
102
102
|
// 若obj为数组
|
|
103
103
|
if (Array.isArray(obj)) {
|
|
104
104
|
// 若obj为数组,则针对数组中每个对象向下递归
|
|
105
|
-
obj = obj.map(obj_ => raw2Jsx(obj_, str2Jsx))
|
|
105
|
+
obj = obj.map(obj_ => raw2Jsx(obj_, str2Jsx, menuItemKeyToTitle))
|
|
106
106
|
|
|
107
107
|
} else if (obj.hasOwnProperty('component')) {
|
|
108
108
|
// 若obj包含children属性,则向下递归处理
|
|
109
109
|
if (obj.hasOwnProperty('children')) {
|
|
110
|
-
Object.assign(obj, { children: obj.children.map(obj_ => raw2Jsx(obj_, str2Jsx)) })
|
|
110
|
+
Object.assign(obj, { children: obj.children.map(obj_ => raw2Jsx(obj_, str2Jsx, menuItemKeyToTitle)) })
|
|
111
111
|
|
|
112
112
|
if (obj.component === 'SubMenu') {
|
|
113
113
|
obj = <SubMenu
|
|
114
114
|
key={obj.props.key}
|
|
115
|
-
title={obj.props.title}
|
|
115
|
+
title={obj.props.title || menuItemKeyToTitle[obj.props.key]}
|
|
116
116
|
disabled={obj.props.disabled}
|
|
117
117
|
icon={
|
|
118
118
|
obj.props.iconRenderer === 'fontawesome' ?
|
|
@@ -133,7 +133,7 @@ const raw2Jsx = (obj, str2Jsx) => {
|
|
|
133
133
|
} else {
|
|
134
134
|
obj = <ItemGroup
|
|
135
135
|
key={obj.props.key}
|
|
136
|
-
title={obj.props.title}
|
|
136
|
+
title={obj.props.title || menuItemKeyToTitle[obj.props.key]}
|
|
137
137
|
disabled={obj.props.disabled}
|
|
138
138
|
icon={
|
|
139
139
|
obj.props.iconRenderer === 'fontawesome' ?
|
|
@@ -160,7 +160,7 @@ const raw2Jsx = (obj, str2Jsx) => {
|
|
|
160
160
|
// 生成Item对应的jsx
|
|
161
161
|
obj = <Item
|
|
162
162
|
key={obj.props.key}
|
|
163
|
-
title={obj.props.title}
|
|
163
|
+
title={obj.props.title || menuItemKeyToTitle[obj.props.key]}
|
|
164
164
|
disabled={obj.props.disabled}
|
|
165
165
|
danger={obj.props.danger}
|
|
166
166
|
icon={
|
|
@@ -179,12 +179,12 @@ const raw2Jsx = (obj, str2Jsx) => {
|
|
|
179
179
|
}
|
|
180
180
|
name={obj.props && obj.props.name}
|
|
181
181
|
>
|
|
182
|
-
<UtilsLink href={obj.props.href} target={obj.props.target}>{obj.props.title}</UtilsLink>
|
|
182
|
+
<UtilsLink href={obj.props.href} target={obj.props.target}>{obj.props.title || menuItemKeyToTitle[obj.props.key]}</UtilsLink>
|
|
183
183
|
</Item>
|
|
184
184
|
} else {
|
|
185
185
|
obj = <Item
|
|
186
186
|
key={obj.props.key}
|
|
187
|
-
title={obj.props.title}
|
|
187
|
+
title={obj.props.title || menuItemKeyToTitle[obj.props.key]}
|
|
188
188
|
disabled={obj.props.disabled}
|
|
189
189
|
danger={obj.props.danger}
|
|
190
190
|
icon={
|
|
@@ -203,7 +203,7 @@ const raw2Jsx = (obj, str2Jsx) => {
|
|
|
203
203
|
}
|
|
204
204
|
name={obj.props && obj.props.name}
|
|
205
205
|
>
|
|
206
|
-
{obj.props.title}
|
|
206
|
+
{obj.props.title || menuItemKeyToTitle[obj.props.key]}
|
|
207
207
|
</Item>
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -220,6 +220,7 @@ const AntdMenu = (props) => {
|
|
|
220
220
|
style,
|
|
221
221
|
key,
|
|
222
222
|
menuItems,
|
|
223
|
+
menuItemKeyToTitle,
|
|
223
224
|
mode,
|
|
224
225
|
theme,
|
|
225
226
|
defaultOpenKeys,
|
|
@@ -253,7 +254,7 @@ const AntdMenu = (props) => {
|
|
|
253
254
|
}, [])
|
|
254
255
|
|
|
255
256
|
// 基于menuItems推导jsx数据结构
|
|
256
|
-
let _menuItems = raw2Jsx(menuItems, str2Jsx)
|
|
257
|
+
let _menuItems = raw2Jsx(menuItems, str2Jsx, menuItemKeyToTitle)
|
|
257
258
|
|
|
258
259
|
// 监听Item的点击事件
|
|
259
260
|
const listenSelected = (item) => {
|
|
@@ -358,6 +359,9 @@ AntdMenu.propTypes = {
|
|
|
358
359
|
// 用于构建菜单内容结构的对象
|
|
359
360
|
menuItems: PropTypes.array,
|
|
360
361
|
|
|
362
|
+
// 用于针对具体key值对应的菜单项定义组件型标题内容
|
|
363
|
+
menuItemKeyToTitle: PropTypes.objectOf(PropTypes.node),
|
|
364
|
+
|
|
361
365
|
// 用于设置导航菜单显示模式
|
|
362
366
|
// 默认'vertical'即垂直显示模式
|
|
363
367
|
// 'horizontal'表示水平显示模式
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
QuestionCircleOutlined,
|
|
41
41
|
DownOutlined
|
|
42
42
|
} from '@ant-design/icons';
|
|
43
|
-
import { isNumber, isEqual, isString,
|
|
43
|
+
import { isNumber, isEqual, isString, omitBy } from 'lodash';
|
|
44
44
|
import { str2Locale, locale2text } from '../components/locales.react';
|
|
45
45
|
import { propTypes, defaultProps } from '../components/dataDisplay/AntdTable.react';
|
|
46
46
|
|
|
@@ -275,7 +275,11 @@ class AntdTable extends Component {
|
|
|
275
275
|
) {
|
|
276
276
|
// 同步更新selectedRows的值
|
|
277
277
|
nextProps.setProps({
|
|
278
|
+
// 忽略组件型字段键值对
|
|
278
279
|
selectedRows: nextProps['data'].filter(item => nextProps['selectedRowKeys'].includes(item.key))
|
|
280
|
+
.map(
|
|
281
|
+
record => omitBy(record, value => value?.$$typeof)
|
|
282
|
+
)
|
|
279
283
|
})
|
|
280
284
|
}
|
|
281
285
|
|
|
@@ -456,7 +460,8 @@ class AntdTable extends Component {
|
|
|
456
460
|
|
|
457
461
|
setProps({
|
|
458
462
|
currentData: newData,
|
|
459
|
-
|
|
463
|
+
// 忽略组件型字段键值对
|
|
464
|
+
recentlyChangedRow: omitBy(row, value => value?.$$typeof),
|
|
460
465
|
recentlyChangedColumn: _changedColumn,
|
|
461
466
|
data: newData
|
|
462
467
|
})
|
|
@@ -938,7 +943,8 @@ class AntdTable extends Component {
|
|
|
938
943
|
nClicksDropdownItem: nClicksDropdownItem + 1,
|
|
939
944
|
recentlyClickedDropdownItemTitle: item.key,
|
|
940
945
|
recentlyDropdownItemClickedDataIndex: columns[i].dataIndex,
|
|
941
|
-
|
|
946
|
+
// 忽略组件型字段键值对
|
|
947
|
+
recentlyDropdownItemClickedRow: omitBy(record, value => value?.$$typeof)
|
|
942
948
|
})
|
|
943
949
|
}, 200);
|
|
944
950
|
}}>
|
|
@@ -1133,7 +1139,8 @@ class AntdTable extends Component {
|
|
|
1133
1139
|
setTimeout(function () {
|
|
1134
1140
|
setProps({
|
|
1135
1141
|
data: data,
|
|
1136
|
-
|
|
1142
|
+
// 忽略组件型字段键值对
|
|
1143
|
+
recentlyCheckedRow: omitBy(record, value => value?.$$typeof),
|
|
1137
1144
|
recentlyCheckedLabel: content.label,
|
|
1138
1145
|
recentlyCheckedDataIndex: columns[i]['dataIndex'],
|
|
1139
1146
|
recentlyCheckedStatus: e.target.checked
|
|
@@ -1173,7 +1180,8 @@ class AntdTable extends Component {
|
|
|
1173
1180
|
setTimeout(function () {
|
|
1174
1181
|
setProps({
|
|
1175
1182
|
data: data,
|
|
1176
|
-
|
|
1183
|
+
// 忽略组件型字段键值对
|
|
1184
|
+
recentlySwitchRow: omitBy(record, value => value?.$$typeof),
|
|
1177
1185
|
recentlySwitchDataIndex: columns[i]['dataIndex'],
|
|
1178
1186
|
recentlySwitchStatus: checked
|
|
1179
1187
|
})
|
|
@@ -1230,7 +1238,8 @@ class AntdTable extends Component {
|
|
|
1230
1238
|
() => {
|
|
1231
1239
|
setProps({
|
|
1232
1240
|
data: data,
|
|
1233
|
-
|
|
1241
|
+
// 忽略组件型字段键值对
|
|
1242
|
+
recentlySelectRow: omitBy(record, value => value?.$$typeof),
|
|
1234
1243
|
recentlySelectDataIndex: columns[i]['dataIndex'],
|
|
1235
1244
|
recentlySelectValue: value
|
|
1236
1245
|
})
|
|
@@ -1265,7 +1274,8 @@ class AntdTable extends Component {
|
|
|
1265
1274
|
// 阻止事件冒泡
|
|
1266
1275
|
e.stopPropagation();
|
|
1267
1276
|
setProps({
|
|
1268
|
-
|
|
1277
|
+
// 忽略组件型字段键值对
|
|
1278
|
+
recentlyButtonClickedRow: omitBy(record, value => value?.$$typeof),
|
|
1269
1279
|
nClicksButton: nClicksButton + 1,
|
|
1270
1280
|
clickedContent: content_.content,
|
|
1271
1281
|
clickedCustom: content_.custom,
|
|
@@ -1319,7 +1329,8 @@ class AntdTable extends Component {
|
|
|
1319
1329
|
// 阻止事件冒泡
|
|
1320
1330
|
e.stopPropagation();
|
|
1321
1331
|
setProps({
|
|
1322
|
-
|
|
1332
|
+
// 忽略组件型字段键值对
|
|
1333
|
+
recentlyButtonClickedRow: omitBy(record, value => value?.$$typeof),
|
|
1323
1334
|
nClicksButton: nClicksButton + 1,
|
|
1324
1335
|
clickedContent: content.content,
|
|
1325
1336
|
clickedCustom: content.custom,
|
|
@@ -1375,7 +1386,8 @@ class AntdTable extends Component {
|
|
|
1375
1386
|
// 阻止事件冒泡
|
|
1376
1387
|
e.stopPropagation();
|
|
1377
1388
|
setProps({
|
|
1378
|
-
|
|
1389
|
+
// 忽略组件型字段键值对
|
|
1390
|
+
recentlyButtonClickedRow: omitBy(record, value => value?.$$typeof),
|
|
1379
1391
|
nClicksButton: nClicksButton + 1,
|
|
1380
1392
|
clickedContent: content_.content,
|
|
1381
1393
|
clickedCustom: content_.custom,
|
|
@@ -1415,7 +1427,8 @@ class AntdTable extends Component {
|
|
|
1415
1427
|
// 阻止事件冒泡
|
|
1416
1428
|
e.stopPropagation();
|
|
1417
1429
|
setProps({
|
|
1418
|
-
|
|
1430
|
+
// 忽略组件型字段键值对
|
|
1431
|
+
recentlyButtonClickedRow: omitBy(record, value => value?.$$typeof),
|
|
1419
1432
|
nClicksButton: nClicksButton + 1,
|
|
1420
1433
|
clickedContent: content.content,
|
|
1421
1434
|
clickedCustom: content.custom,
|
|
@@ -1660,7 +1673,10 @@ class AntdTable extends Component {
|
|
|
1660
1673
|
onChange: (selectedRowKeys, selectedRows) => {
|
|
1661
1674
|
setProps({
|
|
1662
1675
|
selectedRowKeys: selectedRowKeys,
|
|
1663
|
-
|
|
1676
|
+
// 忽略组件型字段键值对
|
|
1677
|
+
selectedRows: selectedRows.map(
|
|
1678
|
+
record => omitBy(record, value => value?.$$typeof)
|
|
1679
|
+
)
|
|
1664
1680
|
})
|
|
1665
1681
|
}
|
|
1666
1682
|
}
|
|
@@ -1830,7 +1846,8 @@ class AntdTable extends Component {
|
|
|
1830
1846
|
onMouseEnter: event => {
|
|
1831
1847
|
setProps({
|
|
1832
1848
|
recentlyMouseEnterRowKey: record.key,
|
|
1833
|
-
|
|
1849
|
+
// 忽略组件型字段键值对
|
|
1850
|
+
recentlyMouseEnterRow: omitBy(record, value => value?.$$typeof)
|
|
1834
1851
|
})
|
|
1835
1852
|
}, // 鼠标移入行
|
|
1836
1853
|
};
|