feffery_antd_components 0.1.3 → 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.
Files changed (98) hide show
  1. package/DESCRIPTION +1 -1
  2. package/Project.toml +1 -1
  3. package/README.md +2 -2
  4. package/feffery_antd_components/AntdTable.py +61 -4
  5. package/feffery_antd_components/feffery_antd_components.min.js +9 -9
  6. package/feffery_antd_components/metadata.json +290 -1
  7. package/feffery_antd_components/package-info.json +3 -3
  8. package/package.json +3 -3
  9. package/src/FefferyAntdComponents.jl +3 -3
  10. package/src/jl/'feffery'_antdtable.jl +34 -4
  11. package/src/lib/components/AntdTable.react.js +190 -34
  12. package/usage.py +95 -5
  13. package/build/lib/feffery_antd_components/AntdAffix.py +0 -54
  14. package/build/lib/feffery_antd_components/AntdAlert.py +0 -58
  15. package/build/lib/feffery_antd_components/AntdAnchor.py +0 -54
  16. package/build/lib/feffery_antd_components/AntdAvatar.py +0 -79
  17. package/build/lib/feffery_antd_components/AntdBackTop.py +0 -52
  18. package/build/lib/feffery_antd_components/AntdBadge.py +0 -70
  19. package/build/lib/feffery_antd_components/AntdBreadcrumb.py +0 -74
  20. package/build/lib/feffery_antd_components/AntdButton.py +0 -66
  21. package/build/lib/feffery_antd_components/AntdCalendar.py +0 -75
  22. package/build/lib/feffery_antd_components/AntdCard.py +0 -86
  23. package/build/lib/feffery_antd_components/AntdCardGrid.py +0 -52
  24. package/build/lib/feffery_antd_components/AntdCarousel.py +0 -56
  25. package/build/lib/feffery_antd_components/AntdCascader.py +0 -91
  26. package/build/lib/feffery_antd_components/AntdCheckbox.py +0 -71
  27. package/build/lib/feffery_antd_components/AntdCheckboxGroup.py +0 -79
  28. package/build/lib/feffery_antd_components/AntdCol.py +0 -146
  29. package/build/lib/feffery_antd_components/AntdCollapse.py +0 -79
  30. package/build/lib/feffery_antd_components/AntdComment.py +0 -88
  31. package/build/lib/feffery_antd_components/AntdContent.py +0 -50
  32. package/build/lib/feffery_antd_components/AntdCountdown.py +0 -72
  33. package/build/lib/feffery_antd_components/AntdDatePicker.py +0 -93
  34. package/build/lib/feffery_antd_components/AntdDateRangePicker.py +0 -89
  35. package/build/lib/feffery_antd_components/AntdDescriptionItem.py +0 -58
  36. package/build/lib/feffery_antd_components/AntdDescriptions.py +0 -76
  37. package/build/lib/feffery_antd_components/AntdDivider.py +0 -62
  38. package/build/lib/feffery_antd_components/AntdDraggerUpload.py +0 -82
  39. package/build/lib/feffery_antd_components/AntdDrawer.py +0 -72
  40. package/build/lib/feffery_antd_components/AntdDropdown.py +0 -84
  41. package/build/lib/feffery_antd_components/AntdEmpty.py +0 -54
  42. package/build/lib/feffery_antd_components/AntdFooter.py +0 -50
  43. package/build/lib/feffery_antd_components/AntdForm.py +0 -72
  44. package/build/lib/feffery_antd_components/AntdFormItem.py +0 -84
  45. package/build/lib/feffery_antd_components/AntdHeader.py +0 -50
  46. package/build/lib/feffery_antd_components/AntdIcon.py +0 -48
  47. package/build/lib/feffery_antd_components/AntdImage.py +0 -62
  48. package/build/lib/feffery_antd_components/AntdInput.py +0 -99
  49. package/build/lib/feffery_antd_components/AntdInputNumber.py +0 -99
  50. package/build/lib/feffery_antd_components/AntdLayout.py +0 -50
  51. package/build/lib/feffery_antd_components/AntdMentions.py +0 -74
  52. package/build/lib/feffery_antd_components/AntdMenu.py +0 -81
  53. package/build/lib/feffery_antd_components/AntdMessage.py +0 -54
  54. package/build/lib/feffery_antd_components/AntdModal.py +0 -88
  55. package/build/lib/feffery_antd_components/AntdNotification.py +0 -60
  56. package/build/lib/feffery_antd_components/AntdPageHeader.py +0 -62
  57. package/build/lib/feffery_antd_components/AntdPagination.py +0 -95
  58. package/build/lib/feffery_antd_components/AntdParagraph.py +0 -70
  59. package/build/lib/feffery_antd_components/AntdPopconfirm.py +0 -80
  60. package/build/lib/feffery_antd_components/AntdPopover.py +0 -74
  61. package/build/lib/feffery_antd_components/AntdProgress.py +0 -88
  62. package/build/lib/feffery_antd_components/AntdRadio.py +0 -54
  63. package/build/lib/feffery_antd_components/AntdRadioGroup.py +0 -89
  64. package/build/lib/feffery_antd_components/AntdRate.py +0 -60
  65. package/build/lib/feffery_antd_components/AntdResult.py +0 -52
  66. package/build/lib/feffery_antd_components/AntdRibbon.py +0 -54
  67. package/build/lib/feffery_antd_components/AntdRow.py +0 -72
  68. package/build/lib/feffery_antd_components/AntdSelect.py +0 -117
  69. package/build/lib/feffery_antd_components/AntdSider.py +0 -68
  70. package/build/lib/feffery_antd_components/AntdSkeleton.py +0 -86
  71. package/build/lib/feffery_antd_components/AntdSlider.py +0 -68
  72. package/build/lib/feffery_antd_components/AntdSpace.py +0 -60
  73. package/build/lib/feffery_antd_components/AntdSpin.py +0 -68
  74. package/build/lib/feffery_antd_components/AntdStatistic.py +0 -74
  75. package/build/lib/feffery_antd_components/AntdSteps.py +0 -72
  76. package/build/lib/feffery_antd_components/AntdSwitch.py +0 -75
  77. package/build/lib/feffery_antd_components/AntdTabPane.py +0 -66
  78. package/build/lib/feffery_antd_components/AntdTable.py +0 -179
  79. package/build/lib/feffery_antd_components/AntdTabs.py +0 -81
  80. package/build/lib/feffery_antd_components/AntdTag.py +0 -54
  81. package/build/lib/feffery_antd_components/AntdTestLink.py +0 -58
  82. package/build/lib/feffery_antd_components/AntdText.py +0 -72
  83. package/build/lib/feffery_antd_components/AntdTimePicker.py +0 -93
  84. package/build/lib/feffery_antd_components/AntdTimeRangePicker.py +0 -93
  85. package/build/lib/feffery_antd_components/AntdTimeline.py +0 -68
  86. package/build/lib/feffery_antd_components/AntdTitle.py +0 -74
  87. package/build/lib/feffery_antd_components/AntdTooltip.py +0 -64
  88. package/build/lib/feffery_antd_components/AntdTransfer.py +0 -99
  89. package/build/lib/feffery_antd_components/AntdTree.py +0 -107
  90. package/build/lib/feffery_antd_components/AntdTreeSelect.py +0 -103
  91. package/build/lib/feffery_antd_components/AntdTypography.py +0 -50
  92. package/build/lib/feffery_antd_components/AntdUpload.py +0 -80
  93. package/build/lib/feffery_antd_components/Link.py +0 -58
  94. package/build/lib/feffery_antd_components/__init__.py +0 -53
  95. package/build/lib/feffery_antd_components/_imports_.py +0 -157
  96. package/build/lib/feffery_antd_components/feffery_antd_components.min.js +0 -344
  97. package/build/lib/feffery_antd_components/metadata.json +0 -14640
  98. package/build/lib/feffery_antd_components/package-info.json +0 -77
@@ -1,7 +1,7 @@
1
1
  import React, { Component, useContext, useState, useEffect, useRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Table, Tooltip, Popover, Popconfirm, ConfigProvider, Typography, Input, Form, Tag, Button, Space, message } from 'antd';
4
- import { TinyLine, TinyArea, TinyColumn, Progress } from '@ant-design/charts';
3
+ import { Table, Tooltip, Popover, Popconfirm, ConfigProvider, Typography, Input, Form, Tag, Button, Badge, Space, message } from 'antd';
4
+ import { TinyLine, TinyArea, TinyColumn, Progress, RingProgress } from '@ant-design/charts';
5
5
  import Highlighter from 'react-highlight-words';
6
6
  import { SearchOutlined, QuestionCircleOutlined } from '@ant-design/icons';
7
7
  import { str2Locale } from './locales.react';
@@ -298,6 +298,8 @@ export default class AntdTable extends Component {
298
298
  containerId,
299
299
  setProps,
300
300
  columns,
301
+ miniChartHeight,
302
+ miniChartAnimation,
301
303
  rowSelectionType,
302
304
  selectedRowKeys,
303
305
  rowSelectionWidth,
@@ -311,9 +313,12 @@ export default class AntdTable extends Component {
311
313
  pagination,
312
314
  bordered,
313
315
  maxHeight,
316
+ maxWidth,
314
317
  size,
315
318
  mode,
316
319
  nClicksButton,
320
+ summaryRowContents,
321
+ summaryRowFixed,
317
322
  loading_state
318
323
  } = this.props;
319
324
 
@@ -327,8 +332,8 @@ export default class AntdTable extends Component {
327
332
  pagination = {
328
333
  ...pagination,
329
334
  ...{
330
- showTotalPrefix: pagination?.showTotalPrefix ? pagination?.showTotalPrefix : '共 ',
331
- showTotalSuffix: pagination?.showTotalSuffix ? pagination?.showTotalSuffix : ' 条记录',
335
+ showTotalPrefix: pagination?.showTotalPrefix ? pagination.showTotalPrefix : '共 ',
336
+ showTotalSuffix: pagination?.showTotalSuffix ? pagination.showTotalSuffix : ' 条记录',
332
337
  }
333
338
  }
334
339
 
@@ -523,14 +528,17 @@ export default class AntdTable extends Component {
523
528
  if (columns[i]['renderOptions']['renderType'] == 'ellipsis') {
524
529
  columns[i]['ellipsis'] = true
525
530
  columns[i]['render'] = content => (
526
- <Tooltip placement="topLeft" title={content}>
531
+ <Tooltip
532
+ placement="topLeft"
533
+ title={content}
534
+ getPopupContainer={containerId ? () => (document.getElementById(containerId) ? document.getElementById(containerId) : document.body) : undefined}
535
+ >
527
536
  {content}
528
537
  </Tooltip>
529
538
  )
530
539
  }
531
540
  }
532
541
  }
533
-
534
542
  }
535
543
 
536
544
  // 配置字段渲染模式为link的相关参数
@@ -581,6 +589,21 @@ export default class AntdTable extends Component {
581
589
  }
582
590
  }
583
591
 
592
+ // 配置字段渲染模式为status-badge的相关参数
593
+ for (let i = 0; i < columns.length; i++) {
594
+ // 当前字段具有renderOptions参数时且renderOptions参数是字典时
595
+ if (columns[i]['renderOptions']) {
596
+ if (columns[i]['renderOptions'].hasOwnProperty('renderType')) {
597
+ // 当renderOptions参数的renderType值设置为status-badge时
598
+ if (columns[i]['renderOptions']['renderType'] == 'status-badge') {
599
+ columns[i]['render'] = content => (
600
+ <Badge status={content.status} text={content.text} />
601
+ )
602
+ }
603
+ }
604
+ }
605
+ }
606
+
584
607
  // 配置字段渲染模式为button的相关参数
585
608
  for (let i = 0; i < columns.length; i++) {
586
609
  // 当前字段具有renderOptions参数时且renderOptions参数是字典时
@@ -604,7 +627,7 @@ export default class AntdTable extends Component {
604
627
  okText={columns[i]['renderOptions']['renderButtonPopConfirmProps'].okText}
605
628
  cancelText={columns[i]['renderOptions']['renderButtonPopConfirmProps'].cancelText}
606
629
  disabled={content_.disabled}
607
- getPopupContainer={containerId ? () => document.getElementById(containerId) : undefined}
630
+ getPopupContainer={containerId ? () => (document.getElementById(containerId) ? document.getElementById(containerId) : document.body) : undefined}
608
631
  onConfirm={() => setProps({
609
632
  recentlyButtonClickedRow: record,
610
633
  nClicksButton: nClicksButton + 1,
@@ -628,7 +651,7 @@ export default class AntdTable extends Component {
628
651
  okText={columns[i]['renderOptions']['renderButtonPopConfirmProps'].okText}
629
652
  cancelText={columns[i]['renderOptions']['renderButtonPopConfirmProps'].cancelText}
630
653
  disabled={content.disabled}
631
- getPopupContainer={containerId ? () => document.getElementById(containerId) : undefined}
654
+ getPopupContainer={containerId ? () => (document.getElementById(containerId) ? document.getElementById(containerId) : document.body) : undefined}
632
655
  onConfirm={() => setProps({
633
656
  recentlyButtonClickedRow: record,
634
657
  nClicksButton: nClicksButton + 1,
@@ -719,50 +742,57 @@ export default class AntdTable extends Component {
719
742
  // 当renderOptions参数的renderType值设置为mini-line时
720
743
  if (columns[i]['renderOptions']['renderType'] == 'mini-line') {
721
744
  columns[i]['render'] = data => {
722
- var config = {
723
- height: "100%",
724
- width: "100%",
745
+ let config = {
725
746
  autoFit: true,
726
747
  padding: 0,
727
748
  data: data,
749
+ animation: miniChartAnimation,
728
750
  smooth: true,
729
751
  };
730
- return <div><TinyLine {...config} /></div>;
752
+ return <div style={{ height: miniChartHeight }}><TinyLine {...config} /></div>;
731
753
  }
732
754
  } else if (columns[i]['renderOptions']['renderType'] == 'mini-bar') {
733
755
  columns[i]['render'] = data => {
734
- var config = {
735
- height: "100%",
736
- width: "100%",
756
+ let config = {
737
757
  padding: 0,
738
758
  autoFit: true,
739
759
  data: data,
760
+ animation: miniChartAnimation,
740
761
  };
741
- return <div><TinyColumn {...config} /></div>;
762
+ return <div style={{ height: miniChartHeight }}><TinyColumn {...config} /></div>;
742
763
  }
743
764
  } else if (columns[i]['renderOptions']['renderType'] == 'mini-progress') {
744
765
  columns[i]['render'] = data => {
745
- var config = {
746
- height: "100%",
747
- width: "100%",
766
+ let config = {
748
767
  autoFit: true,
749
768
  padding: 0,
750
769
  percent: data,
770
+ animation: miniChartAnimation,
751
771
  color: ['#5B8FF9', '#E8EDF3'],
752
772
  };
753
- return <div><Progress {...config} /></div>;
773
+ return <div style={{ height: miniChartHeight }}><Progress {...config} /></div>;
774
+ }
775
+ } else if (columns[i]['renderOptions']['renderType'] == 'mini-ring-progress') {
776
+ columns[i]['render'] = data => {
777
+ let config = {
778
+ autoFit: true,
779
+ padding: 0,
780
+ percent: data,
781
+ animation: miniChartAnimation,
782
+ color: ['#5B8FF9', '#E8EDF3'],
783
+ };
784
+ return <div style={{ height: miniChartHeight }}><RingProgress {...config} /></div>;
754
785
  }
755
786
  } else if (columns[i]['renderOptions']['renderType'] == 'mini-area') {
756
787
  columns[i]['render'] = data => {
757
- var config = {
758
- height: "100%",
759
- width: "100%",
788
+ let config = {
760
789
  autoFit: true,
761
790
  padding: 0,
762
791
  data: data,
792
+ animation: miniChartAnimation,
763
793
  smooth: true,
764
794
  };
765
- return <div><TinyArea {...config} /></div>;
795
+ return <div style={{ height: miniChartHeight }}><TinyArea {...config} /></div>;
766
796
  }
767
797
  }
768
798
  }
@@ -793,7 +823,7 @@ export default class AntdTable extends Component {
793
823
  }}>{content}</div>}
794
824
  overlayStyle={{ maxWidth: '250px' }}
795
825
  placement={'bottom'}
796
- getPopupContainer={containerId ? () => document.getElementById(containerId) : undefined}>
826
+ getPopupContainer={containerId ? () => (document.getElementById(containerId) ? document.getElementById(containerId) : document.body) : undefined}>
797
827
  <QuestionCircleOutlined
798
828
  style={{
799
829
  color: '#8c8c8c',
@@ -863,9 +893,7 @@ export default class AntdTable extends Component {
863
893
  sticky={sticky}
864
894
  pagination={{ ...pagination, ...{ showTotal: total => `${pagination.showTotalPrefix}${total}${pagination.showTotalSuffix}` } }}
865
895
  bordered={bordered}
866
- scroll={{
867
- y: maxHeight ? maxHeight : 99999
868
- }}
896
+ scroll={{ x: maxWidth, y: maxHeight, scrollToFirstRowOnChange: true }}
869
897
  onChange={this.onPageChange}
870
898
  onRow={
871
899
  enableHoverListen ?
@@ -875,6 +903,17 @@ export default class AntdTable extends Component {
875
903
  };
876
904
  } : undefined
877
905
  }
906
+ summary={summaryRowContents ? () => (
907
+ <Table.Summary fixed={summaryRowFixed}>
908
+ <Table.Summary.Row>
909
+ {summaryRowContents.map((item, i) =>
910
+ <Table.Summary.Cell index={i} colSpan={item.colSpan} align={item.align}>
911
+ {item.content}
912
+ </Table.Summary.Cell>
913
+ )}
914
+ </Table.Summary.Row>
915
+ </Table.Summary>
916
+ ) : undefined}
878
917
  data-dash-is-loading={
879
918
  (loading_state && loading_state.is_loading) || undefined
880
919
  }
@@ -914,9 +953,12 @@ AntdTable.propTypes = {
914
953
  // 预处理方式
915
954
  renderOptions: PropTypes.exact({
916
955
 
917
- // 设置渲染处理类型,可选项有'link'、'ellipsis'、'mini-line'、'mini-bar'、'mini-progress'、'mini-area'、"tags'、'button'
956
+ // 设置渲染处理类型,可选项有'link'、'ellipsis'、'mini-line'、'mini-bar'、'mini-progress'、'mini-area'、'tags'、'button'
957
+ // 'copyable'、'status-badge'
918
958
  renderType: PropTypes.oneOf([
919
- 'link', 'ellipsis', 'mini-line', 'mini-bar', 'mini-progress', 'mini-area', 'tags', 'button', 'copyable'
959
+ 'link', 'ellipsis', 'mini-line', 'mini-bar', 'mini-progress',
960
+ 'mini-ring-progress', 'mini-area', 'tags', 'button', 'copyable',
961
+ 'status-badge'
920
962
  ]),
921
963
 
922
964
  // 当renderType='link'时,此参数会将传入的字符串作为渲染link的显示文字内容
@@ -961,6 +1003,12 @@ AntdTable.propTypes = {
961
1003
  })
962
1004
  ),
963
1005
 
1006
+ // 为迷你图模式单元格设置像素高度,默认为30
1007
+ miniChartHeight: PropTypes.number,
1008
+
1009
+ // 设置迷你图模式是否启用出现动画,默认为false
1010
+ miniChartAnimation: PropTypes.bool,
1011
+
964
1012
  // 设置表格单元格尺寸规格,可选的有'small'、'default'和'large'
965
1013
  size: PropTypes.oneOf(['small', 'default', 'large']),
966
1014
 
@@ -1018,7 +1066,75 @@ AntdTable.propTypes = {
1018
1066
  ),
1019
1067
 
1020
1068
  // 定义与columns匹配的行记录数组
1021
- data: PropTypes.arrayOf(PropTypes.object),
1069
+ data: PropTypes.arrayOf(
1070
+ PropTypes.objectOf(
1071
+ PropTypes.oneOfType([
1072
+ // 常规模式、ellipsis模式、copyable模式
1073
+ PropTypes.string,
1074
+
1075
+ // 常规模式、ellipsis模式、mini-prorgess模式、mini-ring-progress模式、copyable模式
1076
+ // 其中mini-prorgess模式、mini-ring-progress模式输入值需在0~1之间
1077
+ PropTypes.number,
1078
+
1079
+ // link模式
1080
+ PropTypes.exact({
1081
+ // href链接
1082
+ href: PropTypes.string,
1083
+ // target行为属性,默认为'_blank'
1084
+ target: PropTypes.string,
1085
+ // 设置是否禁用当前链接,默认为false
1086
+ disabled: PropTypes.bool
1087
+ }),
1088
+
1089
+ // mini-line模式、mini-bar模式、mini-area模式
1090
+ PropTypes.arrayOf(PropTypes.number),
1091
+
1092
+ // tags模式
1093
+ PropTypes.arrayOf(
1094
+ PropTypes.exact({
1095
+ // 标签颜色
1096
+ color: PropTypes.string,
1097
+ // 标签内容
1098
+ tag: PropTypes.oneOfType([
1099
+ PropTypes.string,
1100
+ PropTypes.number
1101
+ ])
1102
+ })
1103
+ ),
1104
+
1105
+ // button模式
1106
+ PropTypes.oneOfType([
1107
+ // 单按钮模式
1108
+ PropTypes.exact({
1109
+ // 设置是否禁用按钮,默认为false
1110
+ disabled: PropTypes.bool,
1111
+ // 设置按钮的type属性,同AntdButton
1112
+ type: PropTypes.oneOf(['primary', 'ghost', 'dashed', 'link', 'text', 'default']),
1113
+ // 设置按钮的danger属性,同AntdButton
1114
+ danger: PropTypes.bool,
1115
+ // 设置按钮的css样式
1116
+ style: PropTypes.object,
1117
+ // 设置按钮的文本内容
1118
+ content: PropTypes.oneOfType([
1119
+ PropTypes.string,
1120
+ PropTypes.number
1121
+ ])
1122
+ })
1123
+ ]),
1124
+
1125
+ // status-badge模式
1126
+ PropTypes.exact({
1127
+ // 设置状态徽标的状态
1128
+ status: PropTypes.oneOf(['success', 'processing', 'default', 'error', 'warning']),
1129
+ // 设置状态徽标的后缀文字内容
1130
+ text: PropTypes.oneOfType([
1131
+ PropTypes.string,
1132
+ PropTypes.number
1133
+ ])
1134
+ })
1135
+ ])
1136
+ )
1137
+ ),
1022
1138
 
1023
1139
  // 定义排序参数
1024
1140
  sortOptions: PropTypes.exact({
@@ -1034,7 +1150,7 @@ AntdTable.propTypes = {
1034
1150
  // 定义筛选参数
1035
1151
  filterOptions: PropTypes.object,
1036
1152
 
1037
- // 翻页相关参数
1153
+ // 翻页相关参数,设置为false时不展示和进行分页
1038
1154
  pagination: PropTypes.oneOfType([
1039
1155
  PropTypes.bool,
1040
1156
  PropTypes.exact({
@@ -1050,10 +1166,16 @@ AntdTable.propTypes = {
1050
1166
  // 当前的页码
1051
1167
  current: PropTypes.number,
1052
1168
 
1169
+ // 设置是否展示pageSize切换器,当total大于50时默认为true
1170
+ showSizeChanger: PropTypes.bool,
1171
+
1053
1172
  // 设定每页尺寸切换可选的范围
1054
1173
  pageSizeOptions: PropTypes.arrayOf(PropTypes.number),
1055
1174
 
1056
- // 设置是否渲染快速跳转控件
1175
+ // 设置是否显示原生页面悬浮提示title信息,默认为true
1176
+ showTitle: PropTypes.bool,
1177
+
1178
+ // 设置是否渲染快速跳转控件,默认为false
1057
1179
  showQuickJumper: PropTypes.bool,
1058
1180
 
1059
1181
  // 定义总记录行数显示部分的前缀文字,默认为"共 "
@@ -1069,8 +1191,16 @@ AntdTable.propTypes = {
1069
1191
  hideOnSinglePage: PropTypes.bool,
1070
1192
 
1071
1193
  // 设置是否开启简洁模式
1072
- simple: PropTypes.bool
1194
+ simple: PropTypes.bool,
1195
+
1196
+ // 设置是否禁用分页,默认为false
1197
+ disabled: PropTypes.bool,
1073
1198
 
1199
+ // 设置是否开启响应式,即分页尺寸会根据屏幕宽度自动进行调整
1200
+ responsive: PropTypes.bool,
1201
+
1202
+ // 设置分页器尺寸,可选的有'default'和'small',默认为'default'
1203
+ size: PropTypes.oneOf(['default', 'small'])
1074
1204
  })
1075
1205
  ]),
1076
1206
 
@@ -1080,6 +1210,9 @@ AntdTable.propTypes = {
1080
1210
  // 设置组件最大高度,每页超出部分将自动转换为竖向滑动浏览方式
1081
1211
  maxHeight: PropTypes.number,
1082
1212
 
1213
+ // 设置组件最大宽度,每页超出部分将自动转换为横向滑动浏览方式
1214
+ maxWidth: PropTypes.number,
1215
+
1083
1216
  // 经过修改操作后,当前状态下最新的dataSource数据
1084
1217
  currentData: PropTypes.array,
1085
1218
 
@@ -1110,6 +1243,26 @@ AntdTable.propTypes = {
1110
1243
  // 设置数据操纵模式,可选的有'client-side'(前端)、'server-side'(后端),默认为'client-side'
1111
1244
  mode: PropTypes.oneOf(['client-side', 'server-side']),
1112
1245
 
1246
+ // 设置总结栏内容数组,请与每个字段保持一一对应
1247
+ summaryRowContents: PropTypes.arrayOf(
1248
+ PropTypes.exact({
1249
+ // 总结栏单元格内容
1250
+ content: PropTypes.oneOfType([
1251
+ PropTypes.string,
1252
+ PropTypes.number
1253
+ ]),
1254
+
1255
+ // 设置当前值横跨的字段数量,默认为1
1256
+ colSpan: PropTypes.number,
1257
+
1258
+ // 设置列对齐方式,可选项有'left'、'center'、'right'
1259
+ align: PropTypes.oneOf(['left', 'center', 'right'])
1260
+ })
1261
+ ),
1262
+
1263
+ // 设置总结栏是否启用fixed功能,默认为false
1264
+ summaryRowFixed: PropTypes.bool,
1265
+
1113
1266
  loading_state: PropTypes.shape({
1114
1267
  /**
1115
1268
  * Determines if the component is loading or not
@@ -1134,6 +1287,9 @@ AntdTable.propTypes = {
1134
1287
 
1135
1288
  // 设置默认参数
1136
1289
  AntdTable.defaultProps = {
1290
+ summaryRowFixed: false,
1291
+ miniChartHeight: 30,
1292
+ miniChartAnimation: false,
1137
1293
  enableHoverListen: false,
1138
1294
  bordered: false,
1139
1295
  data: [],
package/usage.py CHANGED
@@ -8,24 +8,110 @@ app = dash.Dash(__name__)
8
8
 
9
9
  app.layout = html.Div(
10
10
  [
11
+
12
+ fac.AntdTable(
13
+ miniChartHeight=60,
14
+ miniChartAnimation=False,
15
+ summaryRowContents=[{'content': '测试', 'align': 'center'}]*5+[{'content': '测试测试', 'colSpan': 2, 'align': 'center'}],
16
+ summaryRowFixed=True,
17
+ columns=[
18
+ {
19
+ 'title': 'status-badge示例',
20
+ 'dataIndex': 'status-badge示例',
21
+ # 'width': '25%',
22
+ 'renderOptions': {
23
+ 'renderType': 'status-badge'
24
+ }
25
+ },
26
+ {
27
+ 'title': 'mini-bar示例',
28
+ 'dataIndex': 'mini-bar示例',
29
+ # 'width': '25%',
30
+ 'renderOptions': {
31
+ 'renderType': 'mini-bar'
32
+ }
33
+ },
34
+ {
35
+ 'title': 'ellipsis内容省略示例',
36
+ 'dataIndex': 'ellipsis内容省略示例',
37
+ 'renderOptions': {'renderType': 'ellipsis'}
38
+ },
39
+ {
40
+ # 注意,mini-progress模式接受的输入应当在0到1之间
41
+ 'title': 'mini-progress示例',
42
+ 'dataIndex': 'mini-progress示例',
43
+ # 'width': '25%',
44
+ 'renderOptions': {
45
+ 'renderType': 'mini-progress'
46
+ }
47
+ },
48
+ {
49
+ # 注意,mini-ring-progress模式接受的输入应当在0到1之间
50
+ 'title': 'mini-ring-progress示例',
51
+ 'dataIndex': 'mini-ring-progress示例',
52
+ # 'width': '25%',
53
+ 'renderOptions': {
54
+ 'renderType': 'mini-ring-progress'
55
+ }
56
+ },
57
+ {
58
+ 'title': 'mini-area示例',
59
+ 'dataIndex': 'mini-area示例',
60
+ # 'width': '25%',
61
+ 'renderOptions': {
62
+ 'renderType': 'mini-area'
63
+ }
64
+ },
65
+ {
66
+ 'title': 'mini-line示例',
67
+ 'dataIndex': 'mini-line示例',
68
+ # 'width': '25%',
69
+ 'renderOptions': {
70
+ 'renderType': 'mini-line'
71
+ }
72
+ },
73
+ ],
74
+ data=[
75
+ {
76
+ 'key': i,
77
+ 'ellipsis内容省略示例': '这是一段废话,用来演示超长内容再渲染巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉',
78
+ 'status-badge示例': {
79
+ 'status': 'processing',
80
+ 'text': '处理中'
81
+ },
82
+ 'mini-line示例': np.random.randint(1, 20, 10),
83
+ 'mini-bar示例': np.random.randint(1, 20, 10),
84
+ 'mini-progress示例': np.random.rand(),
85
+ 'mini-ring-progress示例': np.random.rand(),
86
+ 'mini-area示例': np.random.randint(1, 20, 10)
87
+ }
88
+ for i in range(50)
89
+ ],
90
+ maxHeight=400,
91
+ # maxWidth=800,
92
+ bordered=True,
93
+ containerId='docs-content' # 绑定局部滚动容器以确保悬浮层正常显示
94
+ ),
95
+
11
96
  fac.AntdTable(
12
97
  selectedRowKeys=['2', '4'],
13
- rowSelectionWidth='5rem',
98
+ rowSelectionWidth='4rem',
14
99
  columns=[
15
100
  {
16
101
  'title': '默认的checkbox模式',
17
102
  'dataIndex': f'默认的checkbox模式',
18
- 'width': 400
103
+ 'width': '33.33%',
104
+ # 'fixed': 'left'
19
105
  },
20
106
  {
21
107
  'title': '自定义选项的checkbox模式',
22
108
  'dataIndex': '自定义选项的checkbox模式',
23
- 'width': 400
109
+ 'width': '33.33%'
24
110
  },
25
111
  {
26
112
  'title': 'keyword模式',
27
113
  'dataIndex': 'keyword模式',
28
- 'width': 400
114
+ 'width': '33.33%'
29
115
  }
30
116
  ],
31
117
  containerId='docs-content',
@@ -53,8 +139,11 @@ app.layout = html.Div(
53
139
  }
54
140
  },
55
141
  rowSelectionType='checkbox',
142
+ bordered=True,
143
+ # maxHeight=200,
144
+ maxWidth=1000,
56
145
  style={
57
- 'width': '600px'
146
+ # 'width': '800px'
58
147
  }
59
148
  ),
60
149
 
@@ -1007,6 +1096,7 @@ def test_(replyClicks, deleteClicks):
1007
1096
  prevent_initial_call=True
1008
1097
  )
1009
1098
  def message_demo1(nClicks):
1099
+
1010
1100
  return fac.AntdMessage(
1011
1101
  content='全局提示框示例',
1012
1102
  icon='fc-overtime',
@@ -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)
@@ -1,58 +0,0 @@
1
- # AUTO GENERATED FILE - DO NOT EDIT
2
-
3
- from dash.development.base_component import Component, _explicitize_args
4
-
5
-
6
- class AntdAlert(Component):
7
- """An AntdAlert component.
8
-
9
-
10
- Keyword arguments:
11
-
12
- - id (string; optional)
13
-
14
- - className (string; optional)
15
-
16
- - closable (boolean; default False)
17
-
18
- - description (string; optional)
19
-
20
- - loading_state (dict; optional)
21
-
22
- `loading_state` is a dict with keys:
23
-
24
- - component_name (string; optional):
25
- Holds the name of the component that is loading.
26
-
27
- - is_loading (boolean; optional):
28
- Determines if the component is loading or not.
29
-
30
- - prop_name (string; optional):
31
- Holds which property is loading.
32
-
33
- - message (string | list of strings; optional)
34
-
35
- - messageRenderMode (a value equal to: 'default', 'loop-text', 'marquee'; default 'default')
36
-
37
- - showIcon (boolean; optional)
38
-
39
- - style (dict; optional)
40
-
41
- - type (a value equal to: 'success', 'info', 'warning', 'error'; optional)"""
42
- @_explicitize_args
43
- def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, description=Component.UNDEFINED, message=Component.UNDEFINED, type=Component.UNDEFINED, showIcon=Component.UNDEFINED, closable=Component.UNDEFINED, messageRenderMode=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
44
- self._prop_names = ['id', 'className', 'closable', 'description', 'loading_state', 'message', 'messageRenderMode', 'showIcon', 'style', 'type']
45
- self._type = 'AntdAlert'
46
- self._namespace = 'feffery_antd_components'
47
- self._valid_wildcard_attributes = []
48
- self.available_properties = ['id', 'className', 'closable', 'description', 'loading_state', 'message', 'messageRenderMode', 'showIcon', 'style', 'type']
49
- self.available_wildcard_properties = []
50
- _explicit_args = kwargs.pop('_explicit_args')
51
- _locals = locals()
52
- _locals.update(kwargs) # For wildcard attrs
53
- args = {k: _locals[k] for k in _explicit_args if k != 'children'}
54
- for k in []:
55
- if k not in args:
56
- raise TypeError(
57
- 'Required argument `' + k + '` was not specified.')
58
- super(AntdAlert, self).__init__(**args)