feffery_antd_components 0.1.2 → 0.1.5

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/usage.py CHANGED
@@ -9,6 +9,212 @@ app = dash.Dash(__name__)
9
9
  app.layout = html.Div(
10
10
  [
11
11
 
12
+ fac.AntdTable(
13
+ miniChartHeight=60,
14
+ miniChartAnimation=False,
15
+ summaryRowContents=[{'content': '测试', 'align': 'center'}] *
16
+ 5+[{'content': '测试测试', 'colSpan': 2, 'align': 'center'}],
17
+ summaryRowFixed=True,
18
+ columns=[
19
+ {
20
+ 'title': 'status-badge示例',
21
+ 'dataIndex': 'status-badge示例',
22
+ # 'width': '25%',
23
+ 'renderOptions': {
24
+ 'renderType': 'status-badge'
25
+ }
26
+ },
27
+ {
28
+ 'title': 'mini-bar示例',
29
+ 'dataIndex': 'mini-bar示例',
30
+ # 'width': '25%',
31
+ 'renderOptions': {
32
+ 'renderType': 'mini-bar'
33
+ }
34
+ },
35
+ {
36
+ 'title': 'ellipsis内容省略示例',
37
+ 'dataIndex': 'ellipsis内容省略示例',
38
+ 'renderOptions': {'renderType': 'ellipsis'}
39
+ },
40
+ {
41
+ # 注意,mini-progress模式接受的输入应当在0到1之间
42
+ 'title': 'mini-progress示例',
43
+ 'dataIndex': 'mini-progress示例',
44
+ # 'width': '25%',
45
+ 'renderOptions': {
46
+ 'renderType': 'mini-progress'
47
+ }
48
+ },
49
+ {
50
+ # 注意,mini-ring-progress模式接受的输入应当在0到1之间
51
+ 'title': 'mini-ring-progress示例',
52
+ 'dataIndex': 'mini-ring-progress示例',
53
+ # 'width': '25%',
54
+ 'renderOptions': {
55
+ 'renderType': 'mini-ring-progress'
56
+ }
57
+ },
58
+ {
59
+ 'title': 'mini-area示例',
60
+ 'dataIndex': 'mini-area示例',
61
+ # 'width': '25%',
62
+ 'renderOptions': {
63
+ 'renderType': 'mini-area'
64
+ }
65
+ },
66
+ {
67
+ 'title': 'mini-line示例',
68
+ 'dataIndex': 'mini-line示例',
69
+ # 'width': '25%',
70
+ 'renderOptions': {
71
+ 'renderType': 'mini-line'
72
+ }
73
+ },
74
+ ],
75
+ data=[
76
+ {
77
+ 'key': i,
78
+ 'ellipsis内容省略示例': '这是一段废话,用来演示超长内容再渲染巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉',
79
+ 'status-badge示例': {
80
+ 'status': 'processing',
81
+ 'text': '处理中'
82
+ },
83
+ 'mini-line示例': np.random.randint(1, 20, 10),
84
+ 'mini-bar示例': np.random.randint(1, 20, 10),
85
+ 'mini-progress示例': np.random.rand(),
86
+ 'mini-ring-progress示例': np.random.rand(),
87
+ 'mini-area示例': np.random.randint(1, 20, 10)
88
+ }
89
+ for i in range(50)
90
+ ],
91
+ maxHeight=400,
92
+ # maxWidth=800,
93
+ bordered=True,
94
+ containerId='docs-content' # 绑定局部滚动容器以确保悬浮层正常显示
95
+ ),
96
+
97
+ fac.AntdTable(
98
+ selectedRowKeys=['2', '4'],
99
+ rowSelectionWidth='4rem',
100
+ columns=[
101
+ {
102
+ 'title': '默认的checkbox模式',
103
+ 'dataIndex': f'默认的checkbox模式',
104
+ 'width': '33.33%',
105
+ # 'fixed': 'left'
106
+ },
107
+ {
108
+ 'title': '自定义选项的checkbox模式',
109
+ 'dataIndex': '自定义选项的checkbox模式',
110
+ 'width': '33.33%'
111
+ },
112
+ {
113
+ 'title': 'keyword模式',
114
+ 'dataIndex': 'keyword模式',
115
+ 'width': '33.33%'
116
+ }
117
+ ],
118
+ containerId='docs-content',
119
+ sticky=True,
120
+ pagination={
121
+ 'pageSize': 100
122
+ },
123
+ data=[
124
+ {
125
+ '默认的checkbox模式': i,
126
+ '自定义选项的checkbox模式': i,
127
+ 'keyword模式': i
128
+ }
129
+ for i in range(500)
130
+ ],
131
+ filterOptions={
132
+ '默认的checkbox模式': {
133
+ 'filterMode': 'keyword'
134
+ },
135
+ '自定义选项的checkbox模式': {
136
+ 'filterMode': 'keyword'
137
+ },
138
+ 'keyword模式': {
139
+ 'filterMode': 'keyword'
140
+ }
141
+ },
142
+ rowSelectionType='checkbox',
143
+ bordered=True,
144
+ # maxHeight=200,
145
+ maxWidth=1000,
146
+ style={
147
+ # 'width': '800px'
148
+ }
149
+ ),
150
+
151
+ html.Div(
152
+ [
153
+ fac.AntdAlert(
154
+ description='好样的',
155
+ message=[
156
+ html.Div(
157
+ [
158
+ fac.AntdText(
159
+ '这是一段测试文字,'
160
+ ),
161
+ fac.AntdText(
162
+ '加粗',
163
+ strong=True
164
+ ),
165
+ html.A(
166
+ '链接',
167
+ href='/'
168
+ )
169
+ ]
170
+ )
171
+ ],
172
+ showIcon=True
173
+ )
174
+ ]
175
+ ),
176
+
177
+
178
+ html.Div(
179
+ [
180
+ fac.AntdAlert(
181
+ description='这是一段辅助说明文字',
182
+ message=[
183
+ '君不见黄河之水天上来',
184
+ '奔流到海不复回',
185
+ '君不见高堂明镜悲白发',
186
+ '朝如青丝暮成雪',
187
+ '人生得意须尽欢',
188
+ '莫使金樽空对月',
189
+ '天生我材必有用',
190
+ '千金散尽还复来'
191
+ ],
192
+ showIcon=True,
193
+ messageRenderMode='loop-text'
194
+ )
195
+ ]
196
+ ),
197
+
198
+ html.Div(
199
+ [
200
+ fac.AntdAlert(
201
+ '这是一段辅助说明文字',
202
+ message=','.join([
203
+ '君不见黄河之水天上来',
204
+ '奔流到海不复回',
205
+ '君不见高堂明镜悲白发',
206
+ '朝如青丝暮成雪',
207
+ '人生得意须尽欢',
208
+ '莫使金樽空对月',
209
+ '天生我材必有用',
210
+ '千金散尽还复来'
211
+ ]) + '。',
212
+ description='这是跑马灯模式示例',
213
+ showIcon=True,
214
+ messageRenderMode='marquee'
215
+ )
216
+ ]
217
+ ),
12
218
 
13
219
  fac.AntdRadioGroup(
14
220
  options=[
@@ -891,6 +1097,7 @@ def test_(replyClicks, deleteClicks):
891
1097
  prevent_initial_call=True
892
1098
  )
893
1099
  def message_demo1(nClicks):
1100
+
894
1101
  return fac.AntdMessage(
895
1102
  content='全局提示框示例',
896
1103
  icon='fc-overtime',