feffery_antd_components 0.1.1 → 0.1.4
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/README.md +2 -2
- package/feffery_antd_components/AntdAlert.py +2 -2
- package/feffery_antd_components/AntdTable.py +66 -5
- package/feffery_antd_components/feffery_antd_components.min.js +9 -9
- package/feffery_antd_components/metadata.json +324 -5
- package/feffery_antd_components/package-info.json +3 -3
- package/package.json +3 -3
- package/src/FefferyAntdComponents.jl +3 -3
- package/src/jl/'feffery'_antdalert.jl +2 -2
- package/src/jl/'feffery'_antdtable.jl +37 -5
- package/src/lib/components/AntdAlert.react.js +19 -11
- package/src/lib/components/AntdTable.react.js +304 -126
- package/usage.py +206 -0
- package/build/lib/feffery_antd_components/AntdAffix.py +0 -54
- package/build/lib/feffery_antd_components/AntdAlert.py +0 -58
- package/build/lib/feffery_antd_components/AntdAnchor.py +0 -54
- package/build/lib/feffery_antd_components/AntdAvatar.py +0 -79
- package/build/lib/feffery_antd_components/AntdBackTop.py +0 -52
- package/build/lib/feffery_antd_components/AntdBadge.py +0 -70
- package/build/lib/feffery_antd_components/AntdBreadcrumb.py +0 -74
- package/build/lib/feffery_antd_components/AntdButton.py +0 -66
- package/build/lib/feffery_antd_components/AntdCalendar.py +0 -75
- package/build/lib/feffery_antd_components/AntdCard.py +0 -86
- package/build/lib/feffery_antd_components/AntdCardGrid.py +0 -52
- package/build/lib/feffery_antd_components/AntdCarousel.py +0 -56
- package/build/lib/feffery_antd_components/AntdCascader.py +0 -91
- package/build/lib/feffery_antd_components/AntdCheckbox.py +0 -71
- package/build/lib/feffery_antd_components/AntdCheckboxGroup.py +0 -79
- package/build/lib/feffery_antd_components/AntdCol.py +0 -146
- package/build/lib/feffery_antd_components/AntdCollapse.py +0 -79
- package/build/lib/feffery_antd_components/AntdComment.py +0 -88
- package/build/lib/feffery_antd_components/AntdContent.py +0 -50
- package/build/lib/feffery_antd_components/AntdCountdown.py +0 -72
- package/build/lib/feffery_antd_components/AntdDatePicker.py +0 -93
- package/build/lib/feffery_antd_components/AntdDateRangePicker.py +0 -89
- package/build/lib/feffery_antd_components/AntdDescriptionItem.py +0 -58
- package/build/lib/feffery_antd_components/AntdDescriptions.py +0 -76
- package/build/lib/feffery_antd_components/AntdDivider.py +0 -62
- package/build/lib/feffery_antd_components/AntdDraggerUpload.py +0 -82
- package/build/lib/feffery_antd_components/AntdDrawer.py +0 -72
- package/build/lib/feffery_antd_components/AntdDropdown.py +0 -84
- package/build/lib/feffery_antd_components/AntdEmpty.py +0 -54
- package/build/lib/feffery_antd_components/AntdFooter.py +0 -50
- package/build/lib/feffery_antd_components/AntdForm.py +0 -72
- package/build/lib/feffery_antd_components/AntdFormItem.py +0 -84
- package/build/lib/feffery_antd_components/AntdHeader.py +0 -50
- package/build/lib/feffery_antd_components/AntdIcon.py +0 -48
- package/build/lib/feffery_antd_components/AntdImage.py +0 -62
- package/build/lib/feffery_antd_components/AntdInput.py +0 -99
- package/build/lib/feffery_antd_components/AntdInputNumber.py +0 -99
- package/build/lib/feffery_antd_components/AntdLayout.py +0 -50
- package/build/lib/feffery_antd_components/AntdMentions.py +0 -74
- package/build/lib/feffery_antd_components/AntdMenu.py +0 -81
- package/build/lib/feffery_antd_components/AntdMessage.py +0 -54
- package/build/lib/feffery_antd_components/AntdModal.py +0 -88
- package/build/lib/feffery_antd_components/AntdNotification.py +0 -60
- package/build/lib/feffery_antd_components/AntdPageHeader.py +0 -62
- package/build/lib/feffery_antd_components/AntdPagination.py +0 -95
- package/build/lib/feffery_antd_components/AntdParagraph.py +0 -70
- package/build/lib/feffery_antd_components/AntdPopconfirm.py +0 -80
- package/build/lib/feffery_antd_components/AntdPopover.py +0 -74
- package/build/lib/feffery_antd_components/AntdProgress.py +0 -88
- package/build/lib/feffery_antd_components/AntdRadio.py +0 -54
- package/build/lib/feffery_antd_components/AntdRadioGroup.py +0 -89
- package/build/lib/feffery_antd_components/AntdRate.py +0 -60
- package/build/lib/feffery_antd_components/AntdResult.py +0 -52
- package/build/lib/feffery_antd_components/AntdRibbon.py +0 -54
- package/build/lib/feffery_antd_components/AntdRow.py +0 -72
- package/build/lib/feffery_antd_components/AntdSelect.py +0 -117
- package/build/lib/feffery_antd_components/AntdSider.py +0 -68
- package/build/lib/feffery_antd_components/AntdSkeleton.py +0 -86
- package/build/lib/feffery_antd_components/AntdSlider.py +0 -68
- package/build/lib/feffery_antd_components/AntdSpace.py +0 -60
- package/build/lib/feffery_antd_components/AntdSpin.py +0 -68
- package/build/lib/feffery_antd_components/AntdStatistic.py +0 -74
- package/build/lib/feffery_antd_components/AntdSteps.py +0 -72
- package/build/lib/feffery_antd_components/AntdSwitch.py +0 -75
- package/build/lib/feffery_antd_components/AntdTabPane.py +0 -66
- package/build/lib/feffery_antd_components/AntdTable.py +0 -179
- package/build/lib/feffery_antd_components/AntdTabs.py +0 -81
- package/build/lib/feffery_antd_components/AntdTag.py +0 -54
- package/build/lib/feffery_antd_components/AntdTestLink.py +0 -58
- package/build/lib/feffery_antd_components/AntdText.py +0 -72
- package/build/lib/feffery_antd_components/AntdTimePicker.py +0 -93
- package/build/lib/feffery_antd_components/AntdTimeRangePicker.py +0 -93
- package/build/lib/feffery_antd_components/AntdTimeline.py +0 -68
- package/build/lib/feffery_antd_components/AntdTitle.py +0 -74
- package/build/lib/feffery_antd_components/AntdTooltip.py +0 -64
- package/build/lib/feffery_antd_components/AntdTransfer.py +0 -99
- package/build/lib/feffery_antd_components/AntdTree.py +0 -107
- package/build/lib/feffery_antd_components/AntdTreeSelect.py +0 -103
- package/build/lib/feffery_antd_components/AntdTypography.py +0 -50
- package/build/lib/feffery_antd_components/AntdUpload.py +0 -80
- package/build/lib/feffery_antd_components/Link.py +0 -58
- package/build/lib/feffery_antd_components/__init__.py +0 -53
- package/build/lib/feffery_antd_components/_imports_.py +0 -157
- package/build/lib/feffery_antd_components/feffery_antd_components.min.js +0 -344
- package/build/lib/feffery_antd_components/metadata.json +0 -14640
- package/build/lib/feffery_antd_components/package-info.json +0 -77
|
@@ -2,6 +2,8 @@ import React, { Component } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import TextLoop from 'react-text-loop'
|
|
4
4
|
import { Alert } from 'antd';
|
|
5
|
+
import { omit } from "ramda";
|
|
6
|
+
import { renderDashComponents } from "dash-extensions-js";
|
|
5
7
|
import Marquee from 'react-fast-marquee';
|
|
6
8
|
import 'antd/dist/antd.css';
|
|
7
9
|
|
|
@@ -13,8 +15,6 @@ export default class AntdAlert extends Component {
|
|
|
13
15
|
id,
|
|
14
16
|
className,
|
|
15
17
|
style,
|
|
16
|
-
description,
|
|
17
|
-
message,
|
|
18
18
|
type,
|
|
19
19
|
showIcon,
|
|
20
20
|
closable,
|
|
@@ -23,18 +23,25 @@ export default class AntdAlert extends Component {
|
|
|
23
23
|
loading_state
|
|
24
24
|
} = this.props;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
// 解析非children参数传入的其他组件数组
|
|
27
|
+
let nProps = omit(
|
|
28
|
+
["setProps", "children", "loading_state", "className"],
|
|
29
|
+
this.props
|
|
30
|
+
);
|
|
31
|
+
nProps = renderDashComponents(nProps, ["message", "description"]);
|
|
32
|
+
|
|
33
|
+
if (messageRenderMode === 'loop-text' && Array.isArray(nProps.message)) {
|
|
27
34
|
return (
|
|
28
35
|
<Alert id={id}
|
|
29
36
|
className={className}
|
|
30
37
|
style={style}
|
|
31
38
|
message={
|
|
32
39
|
<TextLoop mask>
|
|
33
|
-
{message.map(item => <div>{item}</div>)}
|
|
40
|
+
{nProps.message.map(item => <div>{item}</div>)}
|
|
34
41
|
</TextLoop>
|
|
35
42
|
}
|
|
36
43
|
type={type}
|
|
37
|
-
description={description}
|
|
44
|
+
description={nProps.description}
|
|
38
45
|
showIcon={showIcon}
|
|
39
46
|
closable={closable}
|
|
40
47
|
data-dash-is-loading={
|
|
@@ -51,12 +58,12 @@ export default class AntdAlert extends Component {
|
|
|
51
58
|
message={
|
|
52
59
|
messageRenderMode === 'marquee' ?
|
|
53
60
|
<Marquee pauseOnHover gradient={false}>
|
|
54
|
-
{message}
|
|
61
|
+
{nProps.message}
|
|
55
62
|
</Marquee> :
|
|
56
|
-
message
|
|
63
|
+
nProps.message
|
|
57
64
|
}
|
|
58
65
|
type={type}
|
|
59
|
-
description={description}
|
|
66
|
+
description={nProps.description}
|
|
60
67
|
showIcon={showIcon}
|
|
61
68
|
closable={closable}>
|
|
62
69
|
</Alert>
|
|
@@ -66,6 +73,7 @@ export default class AntdAlert extends Component {
|
|
|
66
73
|
|
|
67
74
|
// 定义参数或属性
|
|
68
75
|
AntdAlert.propTypes = {
|
|
76
|
+
|
|
69
77
|
// 组件id
|
|
70
78
|
id: PropTypes.string,
|
|
71
79
|
|
|
@@ -76,12 +84,12 @@ AntdAlert.propTypes = {
|
|
|
76
84
|
style: PropTypes.object,
|
|
77
85
|
|
|
78
86
|
// 设置警告组件内的额外信息元素
|
|
79
|
-
description: PropTypes.
|
|
87
|
+
description: PropTypes.any,
|
|
80
88
|
|
|
81
89
|
// 设置显示的文字信息
|
|
82
90
|
message: PropTypes.oneOfType([
|
|
83
|
-
PropTypes.
|
|
84
|
-
PropTypes.arrayOf(PropTypes.
|
|
91
|
+
PropTypes.any,
|
|
92
|
+
PropTypes.arrayOf(PropTypes.any)
|
|
85
93
|
]),
|
|
86
94
|
|
|
87
95
|
// 设置提示类型,可选的有'success'、'info'、'warning'和'error'四种
|