bhd-components 0.7.31 → 0.7.33

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.
@@ -16,7 +16,19 @@ import i18Conversion from "../../../i18n";
16
16
  className
17
17
  超长内容 出现滚动条 需在管理列定义好width 没有定义的max-width:300
18
18
  */ const BhdTableSimple = (props)=>{
19
- let { className , locale , borderBottom =false , rowSelection , ajaxErr , dataSource , kind ="simple" , loading , notDataText =i18Conversion("noData") } = props;
19
+ let { className ="" , locale , borderBottom =false , rowSelection , ajaxErr , dataSource , kind ="simple" , loading , notDataText =i18Conversion("noData") , components ={
20
+ table: null,
21
+ header: {
22
+ wrapper: null,
23
+ row: null,
24
+ cell: null
25
+ },
26
+ body: {
27
+ wrapper: null,
28
+ row: null,
29
+ cell: null
30
+ }
31
+ } } = props;
20
32
  const renderTableText = ()=>{
21
33
  if (ajaxErr) {
22
34
  return /*#__PURE__*/ _jsxs("div", {
@@ -72,12 +84,30 @@ import i18Conversion from "../../../i18n";
72
84
  })
73
85
  ]
74
86
  });
87
+ if (kind === "simple") {
88
+ className += " app_BhdTableSimple_simple";
89
+ }
90
+ if (loading) {
91
+ if (!components.body) {
92
+ components.body = {
93
+ wrapper: null,
94
+ row: null,
95
+ cell: null
96
+ };
97
+ }
98
+ components = _object_spread_props(_object_spread({}, components.body), {
99
+ body: {
100
+ wrapper: ()=>loadingTable
101
+ }
102
+ });
103
+ }
75
104
  const tableProps = _object_spread_props(_object_spread({
76
105
  style: {
77
106
  width: "100%"
78
107
  }
79
108
  }, props), {
80
109
  loading: false,
110
+ components,
81
111
  dataSource: ajaxErr ? [] : dataSource,
82
112
  className: `app_BhdTableSimple ${className || " "} ${rowSelection ? "app_BhdTableSimple_rowSelection" : ""}`,
83
113
  locale: {
@@ -85,12 +115,6 @@ import i18Conversion from "../../../i18n";
85
115
  },
86
116
  scroll: props.scroll
87
117
  });
88
- if (kind === "simple") {
89
- className += " app_BhdTableSimple_simple";
90
- }
91
- if (loading) {
92
- return loadingTable;
93
- }
94
118
  return /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps));
95
119
  };
96
120
  export default BhdTableSimple;
@@ -43,9 +43,8 @@
43
43
  justify-content: center;
44
44
  flex-direction: column;
45
45
  position: absolute;
46
- top: 50%;
47
46
  left: 50%;
48
- transform: translate(-50%, -50%);
47
+ transform: translateX(-50%);
49
48
  img {
50
49
  margin-bottom: 24px;
51
50
  }
@@ -5,7 +5,7 @@ import { CloseOutlined } from "@ant-design/icons";
5
5
  import { CustomDuihao } from "../icons/index";
6
6
  import "react-image-crop/dist/ReactCrop.css";
7
7
  import styles from "./index.module.less";
8
- const ScreenshotTool = /*#__PURE__*/ forwardRef((props)=>{
8
+ const ScreenshotTool = /*#__PURE__*/ forwardRef((props, ref)=>{
9
9
  let { imgBese64 , saveScreenshotBese64 , cancelScreenshot } = props;
10
10
  const [crop, setCrop] = useState();
11
11
  const [completedCrop, setCompletedCrop] = useState();
@@ -81,6 +81,8 @@ const Table = (props)=>{
81
81
  let minWidth = 0; //最小宽度
82
82
  let scrollWidth = 0; //出现滚动条时 滚动宽度
83
83
  columns = columns.map((item)=>{
84
+ // 克隆columns里的每项 保证每次拿到width都是唯一的
85
+ item = _object_spread({}, item);
84
86
  item.width = item.width || "auto";
85
87
  // item.width=parseFloat(item.width)
86
88
  if (widthPercentage.test(item.width)) {
@@ -16,7 +16,19 @@ import i18Conversion from "../../../i18n";
16
16
  className
17
17
  超长内容 出现滚动条 需在管理列定义好width 没有定义的max-width:300
18
18
  */ var BhdTableSimple = function(props) {
19
- var className = props.className, locale = props.locale, _props_borderBottom = props.borderBottom, borderBottom = _props_borderBottom === void 0 ? false : _props_borderBottom, rowSelection = props.rowSelection, ajaxErr = props.ajaxErr, dataSource = props.dataSource, _props_kind = props.kind, kind = _props_kind === void 0 ? "simple" : _props_kind, loading = props.loading, _props_notDataText = props.notDataText, notDataText = _props_notDataText === void 0 ? i18Conversion("noData") : _props_notDataText;
19
+ var _props_className = props.className, className = _props_className === void 0 ? "" : _props_className, locale = props.locale, _props_borderBottom = props.borderBottom, borderBottom = _props_borderBottom === void 0 ? false : _props_borderBottom, rowSelection = props.rowSelection, ajaxErr = props.ajaxErr, dataSource = props.dataSource, _props_kind = props.kind, kind = _props_kind === void 0 ? "simple" : _props_kind, loading = props.loading, _props_notDataText = props.notDataText, notDataText = _props_notDataText === void 0 ? i18Conversion("noData") : _props_notDataText, _props_components = props.components, components = _props_components === void 0 ? {
20
+ table: null,
21
+ header: {
22
+ wrapper: null,
23
+ row: null,
24
+ cell: null
25
+ },
26
+ body: {
27
+ wrapper: null,
28
+ row: null,
29
+ cell: null
30
+ }
31
+ } : _props_components;
20
32
  var renderTableText = function() {
21
33
  if (ajaxErr) {
22
34
  return /*#__PURE__*/ _jsxs("div", {
@@ -72,12 +84,32 @@ import i18Conversion from "../../../i18n";
72
84
  })
73
85
  ]
74
86
  });
87
+ if (kind === "simple") {
88
+ className += " app_BhdTableSimple_simple";
89
+ }
90
+ if (loading) {
91
+ if (!components.body) {
92
+ components.body = {
93
+ wrapper: null,
94
+ row: null,
95
+ cell: null
96
+ };
97
+ }
98
+ components = _object_spread_props(_object_spread({}, components.body), {
99
+ body: {
100
+ wrapper: function() {
101
+ return loadingTable;
102
+ }
103
+ }
104
+ });
105
+ }
75
106
  var tableProps = _object_spread_props(_object_spread({
76
107
  style: {
77
108
  width: "100%"
78
109
  }
79
110
  }, props), {
80
111
  loading: false,
112
+ components: components,
81
113
  dataSource: ajaxErr ? [] : dataSource,
82
114
  className: "app_BhdTableSimple ".concat(className || " ", " ").concat(rowSelection ? "app_BhdTableSimple_rowSelection" : ""),
83
115
  locale: {
@@ -85,12 +117,6 @@ import i18Conversion from "../../../i18n";
85
117
  },
86
118
  scroll: props.scroll
87
119
  });
88
- if (kind === "simple") {
89
- className += " app_BhdTableSimple_simple";
90
- }
91
- if (loading) {
92
- return loadingTable;
93
- }
94
120
  return /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps));
95
121
  };
96
122
  export default BhdTableSimple;
@@ -43,9 +43,8 @@
43
43
  justify-content: center;
44
44
  flex-direction: column;
45
45
  position: absolute;
46
- top: 50%;
47
46
  left: 50%;
48
- transform: translate(-50%, -50%);
47
+ transform: translateX(-50%);
49
48
  img {
50
49
  margin-bottom: 24px;
51
50
  }
@@ -6,7 +6,7 @@ import { CloseOutlined } from "@ant-design/icons";
6
6
  import { CustomDuihao } from "../icons/index";
7
7
  import "react-image-crop/dist/ReactCrop.css";
8
8
  import styles from "./index.module.less";
9
- var ScreenshotTool = /*#__PURE__*/ forwardRef(function(props) {
9
+ var ScreenshotTool = /*#__PURE__*/ forwardRef(function(props, ref) {
10
10
  var centerAspectCrop = function centerAspectCrop(mediaWidth, mediaHeight, aspect) {
11
11
  return centerCrop(makeAspectCrop({
12
12
  unit: "%",
@@ -82,6 +82,8 @@ var Table = function(props) {
82
82
  var minWidth = 0; //最小宽度
83
83
  var scrollWidth = 0; //出现滚动条时 滚动宽度
84
84
  columns = columns.map(function(item) {
85
+ // 克隆columns里的每项 保证每次拿到width都是唯一的
86
+ item = _object_spread({}, item);
85
87
  item.width = item.width || "auto";
86
88
  // item.width=parseFloat(item.width)
87
89
  if (widthPercentage.test(item.width)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.31",
3
+ "version": "0.7.33",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",