feffery_antd_components 0.1.3 → 0.1.6

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.
Files changed (150) hide show
  1. package/DESCRIPTION +1 -1
  2. package/NAMESPACE +2 -0
  3. package/Project.toml +1 -1
  4. package/README.md +2 -2
  5. package/feffery_antd_components/AntdAnchor.py +9 -3
  6. package/feffery_antd_components/AntdButton.py +5 -3
  7. package/feffery_antd_components/AntdCascader.py +5 -3
  8. package/feffery_antd_components/AntdDatePicker.py +5 -3
  9. package/feffery_antd_components/AntdDateRangePicker.py +5 -3
  10. package/feffery_antd_components/AntdInput.py +5 -3
  11. package/feffery_antd_components/AntdInputNumber.py +5 -3
  12. package/feffery_antd_components/AntdMentions.py +5 -3
  13. package/feffery_antd_components/AntdMessage.py +5 -3
  14. package/{build/lib/feffery_antd_components/AntdEmpty.py → feffery_antd_components/AntdPasteImage.py} +11 -13
  15. package/feffery_antd_components/AntdSelect.py +7 -3
  16. package/feffery_antd_components/AntdTable.py +80 -5
  17. package/feffery_antd_components/AntdTimePicker.py +5 -3
  18. package/feffery_antd_components/AntdTimeRangePicker.py +5 -3
  19. package/feffery_antd_components/AntdTree.py +6 -10
  20. package/feffery_antd_components/AntdTreeSelect.py +7 -3
  21. package/{build/lib/feffery_antd_components/AntdDescriptionItem.py → feffery_antd_components/AntdWatermark.py} +18 -12
  22. package/feffery_antd_components/_imports_.py +4 -0
  23. package/feffery_antd_components/feffery_antd_components.min.js +9 -9
  24. package/feffery_antd_components/metadata.json +903 -69
  25. package/feffery_antd_components/package-info.json +18 -14
  26. package/package.json +18 -14
  27. package/src/FefferyAntdComponents.jl +5 -3
  28. package/src/jl/'feffery'_antdanchor.jl +4 -1
  29. package/src/jl/'feffery'_antdbutton.jl +2 -1
  30. package/src/jl/'feffery'_antdcascader.jl +2 -1
  31. package/src/jl/'feffery'_antddatepicker.jl +2 -1
  32. package/src/jl/'feffery'_antddaterangepicker.jl +2 -1
  33. package/src/jl/'feffery'_antdinput.jl +2 -1
  34. package/src/jl/'feffery'_antdinputnumber.jl +2 -1
  35. package/src/jl/'feffery'_antdmentions.jl +2 -1
  36. package/src/jl/'feffery'_antdmessage.jl +2 -1
  37. package/src/jl/'feffery'_antdpasteimage.jl +28 -0
  38. package/src/jl/'feffery'_antdselect.jl +3 -1
  39. package/src/jl/'feffery'_antdtable.jl +46 -6
  40. package/src/jl/'feffery'_antdtimepicker.jl +2 -1
  41. package/src/jl/'feffery'_antdtimerangepicker.jl +2 -1
  42. package/src/jl/'feffery'_antdtree.jl +3 -5
  43. package/src/jl/'feffery'_antdtreeselect.jl +3 -1
  44. package/src/jl/'feffery'_antdwatermark.jl +39 -0
  45. package/src/lib/components/AntdAnchor.react.js +18 -3
  46. package/src/lib/components/AntdButton.react.js +5 -1
  47. package/src/lib/components/AntdCascader.react.js +5 -0
  48. package/src/lib/components/AntdDatePicker.react.js +5 -0
  49. package/src/lib/components/AntdDateRangePicker.react.js +5 -0
  50. package/src/lib/components/AntdInput.react.js +8 -0
  51. package/src/lib/components/AntdInputNumber.react.js +5 -0
  52. package/src/lib/components/AntdMentions.react.js +5 -0
  53. package/src/lib/components/AntdMessage.react.js +6 -1
  54. package/src/lib/components/AntdPasteImage.react.js +170 -0
  55. package/src/lib/components/AntdSelect.react.js +11 -0
  56. package/src/lib/components/AntdTable.react.js +226 -37
  57. package/src/lib/components/AntdTimePicker.react.js +5 -0
  58. package/src/lib/components/AntdTimeRangePicker.react.js +5 -0
  59. package/src/lib/components/AntdTree.react.js +6 -13
  60. package/src/lib/components/AntdTreeSelect.react.js +11 -0
  61. package/src/lib/components/AntdWatermark.react.js +115 -0
  62. package/src/lib/components/styles.css +12 -11
  63. package/src/lib/components/tabs/AntdTabs.react.js +4 -0
  64. package/src/lib/index.js +5 -1
  65. package/usage.py +298 -25
  66. package/webpack.config.js +9 -3
  67. package/build/lib/feffery_antd_components/AntdAffix.py +0 -54
  68. package/build/lib/feffery_antd_components/AntdAlert.py +0 -58
  69. package/build/lib/feffery_antd_components/AntdAnchor.py +0 -54
  70. package/build/lib/feffery_antd_components/AntdAvatar.py +0 -79
  71. package/build/lib/feffery_antd_components/AntdBackTop.py +0 -52
  72. package/build/lib/feffery_antd_components/AntdBadge.py +0 -70
  73. package/build/lib/feffery_antd_components/AntdBreadcrumb.py +0 -74
  74. package/build/lib/feffery_antd_components/AntdButton.py +0 -66
  75. package/build/lib/feffery_antd_components/AntdCalendar.py +0 -75
  76. package/build/lib/feffery_antd_components/AntdCard.py +0 -86
  77. package/build/lib/feffery_antd_components/AntdCardGrid.py +0 -52
  78. package/build/lib/feffery_antd_components/AntdCarousel.py +0 -56
  79. package/build/lib/feffery_antd_components/AntdCascader.py +0 -91
  80. package/build/lib/feffery_antd_components/AntdCheckbox.py +0 -71
  81. package/build/lib/feffery_antd_components/AntdCheckboxGroup.py +0 -79
  82. package/build/lib/feffery_antd_components/AntdCol.py +0 -146
  83. package/build/lib/feffery_antd_components/AntdCollapse.py +0 -79
  84. package/build/lib/feffery_antd_components/AntdComment.py +0 -88
  85. package/build/lib/feffery_antd_components/AntdContent.py +0 -50
  86. package/build/lib/feffery_antd_components/AntdCountdown.py +0 -72
  87. package/build/lib/feffery_antd_components/AntdDatePicker.py +0 -93
  88. package/build/lib/feffery_antd_components/AntdDateRangePicker.py +0 -89
  89. package/build/lib/feffery_antd_components/AntdDescriptions.py +0 -76
  90. package/build/lib/feffery_antd_components/AntdDivider.py +0 -62
  91. package/build/lib/feffery_antd_components/AntdDraggerUpload.py +0 -82
  92. package/build/lib/feffery_antd_components/AntdDrawer.py +0 -72
  93. package/build/lib/feffery_antd_components/AntdDropdown.py +0 -84
  94. package/build/lib/feffery_antd_components/AntdFooter.py +0 -50
  95. package/build/lib/feffery_antd_components/AntdForm.py +0 -72
  96. package/build/lib/feffery_antd_components/AntdFormItem.py +0 -84
  97. package/build/lib/feffery_antd_components/AntdHeader.py +0 -50
  98. package/build/lib/feffery_antd_components/AntdIcon.py +0 -48
  99. package/build/lib/feffery_antd_components/AntdImage.py +0 -62
  100. package/build/lib/feffery_antd_components/AntdInput.py +0 -99
  101. package/build/lib/feffery_antd_components/AntdInputNumber.py +0 -99
  102. package/build/lib/feffery_antd_components/AntdLayout.py +0 -50
  103. package/build/lib/feffery_antd_components/AntdMentions.py +0 -74
  104. package/build/lib/feffery_antd_components/AntdMenu.py +0 -81
  105. package/build/lib/feffery_antd_components/AntdMessage.py +0 -54
  106. package/build/lib/feffery_antd_components/AntdModal.py +0 -88
  107. package/build/lib/feffery_antd_components/AntdNotification.py +0 -60
  108. package/build/lib/feffery_antd_components/AntdPageHeader.py +0 -62
  109. package/build/lib/feffery_antd_components/AntdPagination.py +0 -95
  110. package/build/lib/feffery_antd_components/AntdParagraph.py +0 -70
  111. package/build/lib/feffery_antd_components/AntdPopconfirm.py +0 -80
  112. package/build/lib/feffery_antd_components/AntdPopover.py +0 -74
  113. package/build/lib/feffery_antd_components/AntdProgress.py +0 -88
  114. package/build/lib/feffery_antd_components/AntdRadio.py +0 -54
  115. package/build/lib/feffery_antd_components/AntdRadioGroup.py +0 -89
  116. package/build/lib/feffery_antd_components/AntdRate.py +0 -60
  117. package/build/lib/feffery_antd_components/AntdResult.py +0 -52
  118. package/build/lib/feffery_antd_components/AntdRibbon.py +0 -54
  119. package/build/lib/feffery_antd_components/AntdRow.py +0 -72
  120. package/build/lib/feffery_antd_components/AntdSelect.py +0 -117
  121. package/build/lib/feffery_antd_components/AntdSider.py +0 -68
  122. package/build/lib/feffery_antd_components/AntdSkeleton.py +0 -86
  123. package/build/lib/feffery_antd_components/AntdSlider.py +0 -68
  124. package/build/lib/feffery_antd_components/AntdSpace.py +0 -60
  125. package/build/lib/feffery_antd_components/AntdSpin.py +0 -68
  126. package/build/lib/feffery_antd_components/AntdStatistic.py +0 -74
  127. package/build/lib/feffery_antd_components/AntdSteps.py +0 -72
  128. package/build/lib/feffery_antd_components/AntdSwitch.py +0 -75
  129. package/build/lib/feffery_antd_components/AntdTabPane.py +0 -66
  130. package/build/lib/feffery_antd_components/AntdTable.py +0 -179
  131. package/build/lib/feffery_antd_components/AntdTabs.py +0 -81
  132. package/build/lib/feffery_antd_components/AntdTag.py +0 -54
  133. package/build/lib/feffery_antd_components/AntdTestLink.py +0 -58
  134. package/build/lib/feffery_antd_components/AntdText.py +0 -72
  135. package/build/lib/feffery_antd_components/AntdTimePicker.py +0 -93
  136. package/build/lib/feffery_antd_components/AntdTimeRangePicker.py +0 -93
  137. package/build/lib/feffery_antd_components/AntdTimeline.py +0 -68
  138. package/build/lib/feffery_antd_components/AntdTitle.py +0 -74
  139. package/build/lib/feffery_antd_components/AntdTooltip.py +0 -64
  140. package/build/lib/feffery_antd_components/AntdTransfer.py +0 -99
  141. package/build/lib/feffery_antd_components/AntdTree.py +0 -107
  142. package/build/lib/feffery_antd_components/AntdTreeSelect.py +0 -103
  143. package/build/lib/feffery_antd_components/AntdTypography.py +0 -50
  144. package/build/lib/feffery_antd_components/AntdUpload.py +0 -80
  145. package/build/lib/feffery_antd_components/Link.py +0 -58
  146. package/build/lib/feffery_antd_components/__init__.py +0 -53
  147. package/build/lib/feffery_antd_components/_imports_.py +0 -157
  148. package/build/lib/feffery_antd_components/feffery_antd_components.min.js +0 -344
  149. package/build/lib/feffery_antd_components/metadata.json +0 -14640
  150. package/build/lib/feffery_antd_components/package-info.json +0 -77
@@ -0,0 +1,115 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { WaterMark } from '@ant-design/pro-layout';
4
+ import '@ant-design/pro-layout/dist/layout.css';
5
+
6
+ const parseChildrenToArray = children => {
7
+ if (children && !Array.isArray(children)) {
8
+ return [children];
9
+ }
10
+ return children;
11
+ };
12
+
13
+ // 定义水印组件AntdWatermark,api参数参考https://procomponents.ant.design/components/water-mark
14
+ export default class AntdWatermark extends Component {
15
+ render() {
16
+ // 取得必要属性或参数
17
+ let {
18
+ id,
19
+ children,
20
+ className,
21
+ style,
22
+ content,
23
+ rotate,
24
+ zIndex,
25
+ fontColor,
26
+ fontSize,
27
+ gapX,
28
+ gapY,
29
+ loading_state
30
+ } = this.props;
31
+
32
+ children = parseChildrenToArray(children)
33
+
34
+ return (
35
+ <WaterMark id={id}
36
+ className={className}
37
+ style={style}
38
+ content={content}
39
+ rotate={rotate}
40
+ zIndex={zIndex}
41
+ fontColor={fontColor}
42
+ fontSize={fontSize}
43
+ gapX={gapX}
44
+ gapY={gapY}
45
+ data-dash-is-loading={
46
+ (loading_state && loading_state.is_loading) || undefined
47
+ }>
48
+ {children}
49
+ </WaterMark>
50
+ );
51
+ }
52
+ }
53
+
54
+ // 定义参数或属性
55
+ AntdWatermark.propTypes = {
56
+ // 部件id
57
+ id: PropTypes.string,
58
+
59
+ /**
60
+ * The content of the tab - will only be displayed if this tab is selected
61
+ */
62
+ children: PropTypes.node,
63
+
64
+ // css类名
65
+ className: PropTypes.string,
66
+
67
+ // 自定义css字典
68
+ style: PropTypes.object,
69
+
70
+ // 设置水印文字内容
71
+ content: PropTypes.string,
72
+
73
+ // 设置水印旋转角度,默认-22
74
+ rotate: PropTypes.number,
75
+
76
+ // 设置水印z-index
77
+ zIndex: PropTypes.number,
78
+
79
+ // 设置水印文字颜色
80
+ fontColor: PropTypes.string,
81
+
82
+ // 设置水印字体像素大小,默认16
83
+ fontSize: PropTypes.number,
84
+
85
+ // 水印之间的水平像素间距,默认为212
86
+ gapX: PropTypes.number,
87
+
88
+ // 水印之间的垂直间距,默认为222
89
+ gapY: PropTypes.number,
90
+
91
+ loading_state: PropTypes.shape({
92
+ /**
93
+ * Determines if the component is loading or not
94
+ */
95
+ is_loading: PropTypes.bool,
96
+ /**
97
+ * Holds which property is loading
98
+ */
99
+ prop_name: PropTypes.string,
100
+ /**
101
+ * Holds the name of the component that is loading
102
+ */
103
+ component_name: PropTypes.string
104
+ }),
105
+
106
+ /**
107
+ * Dash-assigned callback that should be called to report property changes
108
+ * to Dash, to make them available for callbacks.
109
+ */
110
+ setProps: PropTypes.func
111
+ };
112
+
113
+ // 设置默认参数
114
+ AntdWatermark.defaultProps = {
115
+ }
@@ -39,14 +39,6 @@
39
39
  line-height: 1;
40
40
  }
41
41
 
42
- /* .ant-spin-nested-loading {
43
- height: 100%!important;
44
- }
45
-
46
- .ant-spin-container {
47
- height: 100%!important;
48
- } */
49
-
50
42
  .comment-action {
51
43
  padding-left: 8px;
52
44
  cursor: 'auto';
@@ -61,6 +53,15 @@
61
53
  vertical-align: -0.125em !important;
62
54
  }
63
55
 
64
- /* .ant-breadcrumb-link > svg {
65
- vertical-align: middle;
66
- } */
56
+
57
+ .feffery-paste-image-container {
58
+ height: 400px;
59
+ overflow: auto;
60
+ border: 1px solid #d9d9d9;
61
+ transition: all .3s, height 0s;
62
+ cursor: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAkdJREFUSEtjZMABcnNny3ByMpQyMzNpISv59u3XtokTM/tx6UMXZ4QJJCTM5+Dh+WIB4zMxMe83M1NhkJUVRdFz8eJ9hgcPXr/+9etXGEzi3z+mG9OmZb/AZinYgqbqqWVvvzC2Gyv8YgLxP3xjYvjwR4AhM8sTq0Obm1czmCj+gsu9+cx879MPxicNbTn2WH2Qnzftb5rTF7Dhh2+yM7z8yMzw8x8rgyAfKwPci1Cd/xkYGF69+8Ugwv2bQV3yN4OqxB+wzPaLnA+fvGdxmDAh8wGyJWD9teVT70dYflUAsb/+ZGTgZAMZQxgwIdl+9Bbbg0uPmBOnTMk9gNcCwsZiV0GRBTP38eC1l52dlYGL+efnt1/++5Hlg23XJRmi4/1xWjJ16jqGz5+/MTAw/N84aVJ2AMlBRMiCSZPWMLS3JzLk509nYGRknDZxYmY2zBKMSMbmTEIW9PevZOjqSgFrBVnCwMAwf9KkrCQQgyoW9PQsZ+jtTYO7DdkSqljQ2bmU4f9/rEm7iioWgJz+8+d3hl+/fsJ9cfHi7W+HDl3zppoF6JbQxAJkS2hmAcyS06evUD+IkJP44cNnvh4+fNWHqnGAbMGhQ+c/HzlyyQ9sQU3ZlIeRVt/kcJUFhDIaNn0oFlSXTX0UZfVVlmYWVJVNeRxk8l2GlQV7PbDrJv7CjhgfzFEQ/R0oyvtPCJvim+/FGWLjfUmqKlCCCKSzrHhyAA87QzA2U5i5RMKcXUzYSLHhwYNniEgmpLGsbG4XITXY5Lu6kssAynVWbI/9nxAAAAAASUVORK5CYII=), auto;
63
+ }
64
+
65
+ .feffery-paste-image-container:hover {
66
+ border: 1px solid rgb(64, 169, 255);
67
+ }
@@ -107,6 +107,10 @@ export default class AntdTabs extends Component {
107
107
  }
108
108
  overlayStyle={{ maxWidth: "250px" }}
109
109
  placement={"right"}
110
+ getPopupContainer={(triggerNode) => {
111
+ console.log(triggerNode.parentNode)
112
+ return triggerNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
113
+ }}
110
114
  >
111
115
  <InfoCircleOutlined
112
116
  style={{
package/src/lib/index.js CHANGED
@@ -76,6 +76,8 @@ import AntdCalendar from './components/AntdCalendar.react'
76
76
  import AntdComment from './components/AntdComment.react'
77
77
  import AntdDescriptions from './components/descriptions/AntdDescriptions.react'
78
78
  import AntdDescriptionItem from './components/descriptions/AntdDescriptionItem.react'
79
+ import AntdWatermark from './components/AntdWatermark.react'
80
+ import AntdPasteImage from './components/AntdPasteImage.react'
79
81
 
80
82
  export {
81
83
  AntdDatePicker,
@@ -154,5 +156,7 @@ export {
154
156
  AntdCalendar,
155
157
  AntdComment,
156
158
  AntdDescriptions,
157
- AntdDescriptionItem
159
+ AntdDescriptionItem,
160
+ AntdWatermark,
161
+ AntdPasteImage
158
162
  };
package/usage.py CHANGED
@@ -8,28 +8,73 @@ app = dash.Dash(__name__)
8
8
 
9
9
  app.layout = html.Div(
10
10
  [
11
+ fac.AntdPasteImage(
12
+ id='test',
13
+ style={
14
+ 'height': '500px',
15
+ 'width': '800px',
16
+ 'marginBottom': '100px'
17
+ }
18
+ ),
19
+
20
+ html.Div(id='test-output'),
21
+ fac.AntdWatermark(
22
+ html.Div(
23
+ style={
24
+ 'width': '800px',
25
+ 'height': '400px'
26
+ }
27
+ ),
28
+ content='水印测试',
29
+ fontSize=28
30
+ ),
11
31
  fac.AntdTable(
12
32
  selectedRowKeys=['2', '4'],
13
- rowSelectionWidth='5rem',
33
+ rowSelectionWidth='4rem',
14
34
  columns=[
15
35
  {
16
36
  'title': '默认的checkbox模式',
17
37
  'dataIndex': f'默认的checkbox模式',
18
- 'width': 400
38
+ 'width': '33.33%',
39
+ 'conditionStyle': '''
40
+ (record, index) => {
41
+ if (record.默认的checkbox模式 >= 10) {
42
+ return {
43
+ style: {
44
+ color: "red"
45
+ }
46
+ }
47
+ }
48
+ if (record.默认的checkbox模式 % 2 === 0) {
49
+ return {
50
+ style: {
51
+ backgroundColor: "#ffe7ba"
52
+ }
53
+ }
54
+ }
55
+ return {
56
+ style: {
57
+ fontWeight: "bold"
58
+ }
59
+ }
60
+ }
61
+ '''
62
+ # 'fixed': 'left'
19
63
  },
20
64
  {
21
65
  'title': '自定义选项的checkbox模式',
22
66
  'dataIndex': '自定义选项的checkbox模式',
23
- 'width': 400
67
+ 'width': '33.33%'
24
68
  },
25
69
  {
26
70
  'title': 'keyword模式',
27
71
  'dataIndex': 'keyword模式',
28
- 'width': 400
72
+ 'width': '33.33%'
29
73
  }
30
74
  ],
31
- containerId='docs-content',
32
- sticky=True,
75
+ sticky={
76
+ 'offsetHeader': 800
77
+ },
33
78
  pagination={
34
79
  'pageSize': 100
35
80
  },
@@ -53,11 +98,181 @@ app.layout = html.Div(
53
98
  }
54
99
  },
55
100
  rowSelectionType='checkbox',
101
+ bordered=True,
102
+ # maxHeight=200,
103
+ maxWidth=1000,
56
104
  style={
57
- 'width': '600px'
105
+ # 'width': '800px'
58
106
  }
59
107
  ),
60
108
 
109
+
110
+ fac.AntdImage(
111
+ src='https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp'
112
+ ),
113
+
114
+ fac.AntdRate(
115
+ count=10,
116
+ tooltips=[f'等级{i + 1}' for i in range(10)]
117
+ ),
118
+
119
+ fac.AntdButton(
120
+ '触发对话框',
121
+ type='primary',
122
+ id='modal-demo-trigger-1'
123
+ ),
124
+
125
+ fac.AntdModal(
126
+ fac.AntdText('对话框内容测试'),
127
+ id='modal-demo-1',
128
+ visible=False,
129
+ title={
130
+ 'content': '标题测试',
131
+ 'prefixIcon': 'search'
132
+ },
133
+ renderFooter=True
134
+ ),
135
+
136
+ fac.AntdTree(
137
+ id='tree-demo',
138
+ treeData=[
139
+ {
140
+ 'title': '重庆市',
141
+ 'key': '重庆市',
142
+ 'children': [
143
+ {
144
+ 'title': '渝北区',
145
+ 'key': '渝北区'
146
+ },
147
+ {
148
+ 'title': '江北区',
149
+ 'key': '江北区',
150
+ 'disabled': True
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ 'title': '北京市',
156
+ 'key': '北京市',
157
+ 'children': [
158
+ {
159
+ 'title': '西城区',
160
+ 'key': '西城区'
161
+ },
162
+ {
163
+ 'title': '东城区',
164
+ 'key': '东城区'
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ 'title': '四川省',
170
+ 'key': '四川省',
171
+ 'children': [
172
+ {
173
+ 'title': '成都市',
174
+ 'key': '成都市',
175
+ 'children': [
176
+ {
177
+ 'title': '天府新区',
178
+ 'key': '天府新区'
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ }
184
+ ],
185
+ multiple=True,
186
+ checkable=True
187
+ ),
188
+
189
+ fac.AntdParagraph('巴拉巴拉'*100, style={'textIndent': '2em'}),
190
+
191
+ fac.AntdTable(
192
+ miniChartHeight=60,
193
+ miniChartAnimation=False,
194
+ summaryRowContents=[{'content': '测试', 'align': 'center'}] *
195
+ 5+[{'content': '测试测试', 'colSpan': 2, 'align': 'center'}],
196
+ summaryRowFixed=True,
197
+ columns=[
198
+ {
199
+ 'title': 'status-badge示例',
200
+ 'dataIndex': 'status-badge示例',
201
+ # 'width': '25%',
202
+ 'renderOptions': {
203
+ 'renderType': 'status-badge'
204
+ }
205
+ },
206
+ {
207
+ 'title': 'mini-bar示例',
208
+ 'dataIndex': 'mini-bar示例',
209
+ # 'width': '25%',
210
+ 'renderOptions': {
211
+ 'renderType': 'mini-bar'
212
+ }
213
+ },
214
+ {
215
+ 'title': 'ellipsis内容省略示例',
216
+ 'dataIndex': 'ellipsis内容省略示例',
217
+ 'renderOptions': {'renderType': 'ellipsis'}
218
+ },
219
+ {
220
+ # 注意,mini-progress模式接受的输入应当在0到1之间
221
+ 'title': 'mini-progress示例',
222
+ 'dataIndex': 'mini-progress示例',
223
+ # 'width': '25%',
224
+ 'renderOptions': {
225
+ 'renderType': 'mini-progress'
226
+ }
227
+ },
228
+ {
229
+ # 注意,mini-ring-progress模式接受的输入应当在0到1之间
230
+ 'title': 'mini-ring-progress示例',
231
+ 'dataIndex': 'mini-ring-progress示例',
232
+ # 'width': '25%',
233
+ 'renderOptions': {
234
+ 'renderType': 'mini-ring-progress'
235
+ }
236
+ },
237
+ {
238
+ 'title': 'mini-area示例',
239
+ 'dataIndex': 'mini-area示例',
240
+ # 'width': '25%',
241
+ 'renderOptions': {
242
+ 'renderType': 'mini-area'
243
+ }
244
+ },
245
+ {
246
+ 'title': 'mini-line示例',
247
+ 'dataIndex': 'mini-line示例',
248
+ # 'width': '25%',
249
+ 'renderOptions': {
250
+ 'renderType': 'mini-line'
251
+ }
252
+ },
253
+ ],
254
+ data=[
255
+ {
256
+ 'key': i,
257
+ 'ellipsis内容省略示例': '这是一段废话,用来演示超长内容再渲染巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉',
258
+ 'status-badge示例': {
259
+ 'status': 'processing',
260
+ 'text': '处理中'
261
+ },
262
+ 'mini-line示例': np.random.randint(1, 20, 10),
263
+ 'mini-bar示例': np.random.randint(1, 20, 10),
264
+ 'mini-progress示例': np.random.rand(),
265
+ 'mini-ring-progress示例': np.random.rand(),
266
+ 'mini-area示例': np.random.randint(1, 20, 10)
267
+ }
268
+ for i in range(50)
269
+ ],
270
+ maxHeight=400,
271
+ # maxWidth=800,
272
+ bordered=True,
273
+ containerId='docs-content' # 绑定局部滚动容器以确保悬浮层正常显示
274
+ ),
275
+
61
276
  html.Div(
62
277
  [
63
278
  fac.AntdAlert(
@@ -105,6 +320,66 @@ app.layout = html.Div(
105
320
  ]
106
321
  ),
107
322
 
323
+
324
+ fac.AntdTabs(
325
+ [
326
+ fac.AntdTabPane(
327
+ html.Div(
328
+ '标签页1测试',
329
+ style={
330
+ 'backgroundColor': 'rgba(241, 241, 241, 0.4)',
331
+ 'height': '200px',
332
+ 'display': 'flex',
333
+ 'justifyContent': 'center',
334
+ 'alignItems': 'center'
335
+ }
336
+ ),
337
+ tab='标签页1',
338
+ key='标签页1',
339
+ titleSideInfoPopover={
340
+ 'title': '标签页1说明',
341
+ 'content': '这是标签页1的说明文字内容示例'
342
+ }
343
+ ),
344
+ fac.AntdTabPane(
345
+ html.Div(
346
+ fac.AntdButton('标签页2测试', type='primary'),
347
+ style={
348
+ 'backgroundColor': 'rgba(241, 241, 241, 0.4)',
349
+ 'height': '200px',
350
+ 'display': 'flex',
351
+ 'justifyContent': 'center',
352
+ 'alignItems': 'center'
353
+ }
354
+ ),
355
+ tab='标签页2',
356
+ key='标签页2',
357
+ titleSideInfoPopover={
358
+ 'title': '标签页2说明',
359
+ 'content': '这是标签页2的说明文字内容示例'
360
+ }
361
+ ),
362
+ fac.AntdTabPane(
363
+ html.Div(
364
+ fac.AntdButton('标签页3测试', type='dashed'),
365
+ style={
366
+ 'backgroundColor': 'rgba(241, 241, 241, 0.4)',
367
+ 'height': '200px',
368
+ 'display': 'flex',
369
+ 'justifyContent': 'center',
370
+ 'alignItems': 'center'
371
+ }
372
+ ),
373
+ tab='标签页3',
374
+ key='标签页3',
375
+ titleSideInfoPopover={
376
+ 'title': '标签页3说明',
377
+ 'content': '这是标签页3的说明文字内容示例'
378
+ }
379
+ )
380
+ ]
381
+ ),
382
+
108
383
  html.Div(
109
384
  [
110
385
  fac.AntdAlert(
@@ -537,24 +812,6 @@ app.layout = html.Div(
537
812
  '触发全局提示框', id='message-trigger-button-demo1', type='primary'),
538
813
  html.Div(id='message-container-demo1'),
539
814
 
540
- fac.AntdButton(
541
- '触发对话框',
542
- type='primary',
543
- id='modal-demo-trigger-1'
544
- ),
545
-
546
- fac.AntdModal(
547
- fac.AntdText('对话框内容测试'),
548
- id='modal-demo-1',
549
- visible=False,
550
- title={
551
- 'content': '标题测试',
552
- 'prefixIcon': 'search'
553
- },
554
- renderFooter=True
555
- ),
556
-
557
-
558
815
  fac.AntdPopover(
559
816
  fac.AntdButton(
560
817
  '鼠标悬浮于此',
@@ -1007,6 +1264,7 @@ def test_(replyClicks, deleteClicks):
1007
1264
  prevent_initial_call=True
1008
1265
  )
1009
1266
  def message_demo1(nClicks):
1267
+
1010
1268
  return fac.AntdMessage(
1011
1269
  content='全局提示框示例',
1012
1270
  icon='fc-overtime',
@@ -1023,5 +1281,20 @@ def modal_demo_callback1(nClicks):
1023
1281
  return True
1024
1282
 
1025
1283
 
1284
+ @app.callback(
1285
+ Output('test-output', 'children'),
1286
+ Input('test', 'currentPastedImages')
1287
+ )
1288
+ def paste_image_test(currentPastedImages):
1289
+
1290
+ if currentPastedImages:
1291
+ return [
1292
+ html.Img(
1293
+ src=currentPastedImage
1294
+ )
1295
+ for currentPastedImage in currentPastedImages
1296
+ ]
1297
+
1298
+
1026
1299
  if __name__ == '__main__':
1027
1300
  app.run_server(debug=True)
package/webpack.config.js CHANGED
@@ -25,12 +25,12 @@ module.exports = (env, argv) => {
25
25
  }
26
26
 
27
27
  let filename = (overrides.output || {}).filename;
28
- if(!filename) {
28
+ if (!filename) {
29
29
  const modeSuffix = mode === 'development' ? 'dev' : 'min';
30
30
  filename = `${dashLibraryName}.${modeSuffix}.js`;
31
31
  }
32
32
 
33
- const entry = overrides.entry || {main: './src/lib/index.js'};
33
+ const entry = overrides.entry || { main: './src/lib/index.js' };
34
34
 
35
35
  const devtool = overrides.devtool || 'source-map';
36
36
 
@@ -62,7 +62,7 @@ module.exports = (env, argv) => {
62
62
  },
63
63
  },
64
64
  {
65
- test: /\.css$/,
65
+ test: /\.(css|less)$/,
66
66
  use: [
67
67
  {
68
68
  loader: 'style-loader',
@@ -73,6 +73,12 @@ module.exports = (env, argv) => {
73
73
  {
74
74
  loader: 'css-loader',
75
75
  },
76
+ {
77
+ loader: 'less-loader',
78
+ options: {
79
+ javascriptEnabled: true
80
+ }
81
+ }
76
82
  ],
77
83
  },
78
84
  ],
@@ -1,54 +0,0 @@
1
- # AUTO GENERATED FILE - DO NOT EDIT
2
-
3
- from dash.development.base_component import Component, _explicitize_args
4
-
5
-
6
- class AntdAffix(Component):
7
- """An AntdAffix component.
8
-
9
-
10
- Keyword arguments:
11
-
12
- - children (a list of or a singular dash component, string or number; optional)
13
-
14
- - id (string; optional)
15
-
16
- - className (string; optional)
17
-
18
- - loading_state (dict; optional)
19
-
20
- `loading_state` is a dict with keys:
21
-
22
- - component_name (string; optional):
23
- Holds the name of the component that is loading.
24
-
25
- - is_loading (boolean; optional):
26
- Determines if the component is loading or not.
27
-
28
- - prop_name (string; optional):
29
- Holds which property is loading.
30
-
31
- - offsetBottom (number; optional)
32
-
33
- - offsetTop (number; optional)
34
-
35
- - style (dict; optional)
36
-
37
- - target (string; optional)"""
38
- @_explicitize_args
39
- def __init__(self, children=None, id=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, offsetBottom=Component.UNDEFINED, offsetTop=Component.UNDEFINED, target=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
40
- self._prop_names = ['children', 'id', 'className', 'loading_state', 'offsetBottom', 'offsetTop', 'style', 'target']
41
- self._type = 'AntdAffix'
42
- self._namespace = 'feffery_antd_components'
43
- self._valid_wildcard_attributes = []
44
- self.available_properties = ['children', 'id', 'className', 'loading_state', 'offsetBottom', 'offsetTop', 'style', 'target']
45
- self.available_wildcard_properties = []
46
- _explicit_args = kwargs.pop('_explicit_args')
47
- _locals = locals()
48
- _locals.update(kwargs) # For wildcard attrs
49
- args = {k: _locals[k] for k in _explicit_args if k != 'children'}
50
- for k in []:
51
- if k not in args:
52
- raise TypeError(
53
- 'Required argument `' + k + '` was not specified.')
54
- super(AntdAffix, self).__init__(children=children, **args)