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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import { isString } from 'lodash';
|
|
4
|
+
import useCss from '../../../hooks/useCss';
|
|
5
|
+
import { propTypes, defaultProps } from '../../../components/dataEntry/form/AntdForm.react';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// 定义表单组件AntdForm,api参数参考https://ant.design/components/form-cn/
|
|
9
|
+
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
|
+
return (
|
|
28
|
+
<Form id={id}
|
|
29
|
+
className={
|
|
30
|
+
isString(className) ?
|
|
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>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default AntdForm;
|
|
51
|
+
|
|
52
|
+
AntdForm.defaultProps = defaultProps;
|
|
53
|
+
AntdForm.propTypes = propTypes;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form } from 'antd';
|
|
3
|
+
import { isString } from 'lodash';
|
|
4
|
+
import useCss from '../../../hooks/useCss';
|
|
5
|
+
import { propTypes, defaultProps } from '../../../components/dataEntry/form/AntdFormItem.react';
|
|
6
|
+
|
|
7
|
+
const { Item } = Form;
|
|
8
|
+
|
|
9
|
+
// 定义表单项组件AntdFormItem,api参数参考https://ant.design/components/form-cn/
|
|
10
|
+
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
|
+
return (
|
|
34
|
+
<Item id={id}
|
|
35
|
+
className={
|
|
36
|
+
isString(className) ?
|
|
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>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default AntdFormItem;
|
|
63
|
+
|
|
64
|
+
AntdFormItem.defaultProps = defaultProps;
|
|
65
|
+
AntdFormItem.propTypes = propTypes;
|
package/usage.py
CHANGED
|
@@ -1,66 +1,49 @@
|
|
|
1
1
|
import dash
|
|
2
|
+
import json
|
|
3
|
+
from dash import html
|
|
2
4
|
import feffery_antd_components as fac
|
|
3
|
-
from dash.dependencies import Input, Output
|
|
5
|
+
from dash.dependencies import Input, Output, State
|
|
4
6
|
|
|
5
7
|
app = dash.Dash(__name__, compress=True)
|
|
6
8
|
|
|
7
9
|
app.layout = dash.html.Div(
|
|
8
10
|
[
|
|
9
|
-
fac.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
treeData=[
|
|
21
|
-
{
|
|
22
|
-
'title': '四川省',
|
|
23
|
-
'key': '四川省',
|
|
24
|
-
'children': [
|
|
25
|
-
{
|
|
26
|
-
'title': '成都市',
|
|
27
|
-
'key': '成都市'
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
'title': '广安市',
|
|
31
|
-
'key': '广安市'
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
'title': '重庆市',
|
|
37
|
-
'key': '重庆市',
|
|
38
|
-
'children': [
|
|
39
|
-
{
|
|
40
|
-
'title': '渝中区',
|
|
41
|
-
'key': '渝中区',
|
|
42
|
-
'children': [
|
|
43
|
-
{
|
|
44
|
-
'title': '解放碑街道',
|
|
45
|
-
'key': '解放碑街道'
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
'title': '渝北区',
|
|
51
|
-
'key': '渝北区'
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
defaultExpandAll=True
|
|
57
|
-
)
|
|
11
|
+
fac.AntdTable(
|
|
12
|
+
id='demo-table',
|
|
13
|
+
columns=[
|
|
14
|
+
{
|
|
15
|
+
'title': '字段测试',
|
|
16
|
+
'dataIndex': '字段测试'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
'title': '自定义元素示例',
|
|
20
|
+
'dataIndex': '自定义元素示例'
|
|
21
|
+
}
|
|
58
22
|
],
|
|
59
|
-
|
|
23
|
+
data=[
|
|
24
|
+
{
|
|
25
|
+
'自定义元素示例': html.Div(
|
|
26
|
+
fac.AntdText(
|
|
27
|
+
'示例内容'*100,
|
|
28
|
+
style={
|
|
29
|
+
'textIndent': '2rem'
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
style={
|
|
33
|
+
'maxHeight': 50,
|
|
34
|
+
'overflowY': 'auto',
|
|
35
|
+
'textAlign': 'left'
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
] * 5,
|
|
40
|
+
bordered=True,
|
|
41
|
+
rowSelectionType='checkbox',
|
|
60
42
|
style={
|
|
61
43
|
'width': '100%'
|
|
62
44
|
}
|
|
63
|
-
)
|
|
45
|
+
),
|
|
46
|
+
html.Pre(id='demo-output')
|
|
64
47
|
],
|
|
65
48
|
style={
|
|
66
49
|
'padding': '50px 100px'
|
|
@@ -69,12 +52,18 @@ app.layout = dash.html.Div(
|
|
|
69
52
|
|
|
70
53
|
|
|
71
54
|
@app.callback(
|
|
72
|
-
Output('demo-
|
|
73
|
-
Input('
|
|
55
|
+
Output('demo-output', 'children'),
|
|
56
|
+
Input('demo-table', 'selectedRows')
|
|
74
57
|
)
|
|
75
|
-
def
|
|
58
|
+
def demo(selectedRows):
|
|
76
59
|
|
|
77
|
-
return
|
|
60
|
+
return json.dumps(
|
|
61
|
+
dict(
|
|
62
|
+
selectedRows=selectedRows
|
|
63
|
+
),
|
|
64
|
+
indent=4,
|
|
65
|
+
ensure_ascii=False
|
|
66
|
+
)
|
|
78
67
|
|
|
79
68
|
|
|
80
69
|
if __name__ == '__main__':
|