bhd-components 0.2.2 → 0.2.3

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.
@@ -1,40 +1,41 @@
1
- .index_module_Table__84e7aa4c {
1
+ .index_module_Table__6cae44c3 {
2
2
  width: 100%;
3
3
  }
4
- .index_module_Table__84e7aa4c {
4
+ .index_module_Table__6cae44c3 {
5
5
  /* 多选框间距问题 */
6
+ /* 分页器 */
6
7
  }
7
- .index_module_Table__84e7aa4c table th,
8
- .index_module_Table__84e7aa4c table td {
8
+ .index_module_Table__6cae44c3 table th,
9
+ .index_module_Table__6cae44c3 table td {
9
10
  border: none;
10
11
  border-bottom: 1px solid #e8e8e8;
11
12
  }
12
- .index_module_Table__84e7aa4c table > .bhd-table-thead > tr > .bhd-table-cell {
13
+ .index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell {
13
14
  font-weight: 400;
14
15
  font-size: 16px;
15
16
  color: rgba(0, 0, 0, 0.85);
16
17
  white-space: nowrap;
17
18
  background: #fafafa;
18
19
  }
19
- .index_module_Table__84e7aa4c table > .bhd-table-thead > tr > .bhd-table-cell:nth-child(1) {
20
+ .index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell:nth-child(1) {
20
21
  padding-left: 40px;
21
22
  }
22
- .index_module_Table__84e7aa4c table > .bhd-table-thead > tr > .bhd-table-cell:last-child {
23
+ .index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell:last-child {
23
24
  padding-right: 40px;
24
25
  }
25
- .index_module_Table__84e7aa4c table > .bhd-table-thead > tr > .bhd-table-cell::before {
26
+ .index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell::before {
26
27
  display: none;
27
28
  }
28
- .index_module_Table__84e7aa4c table tbody tr.bhd-table-placeholder:hover td {
29
+ .index_module_Table__6cae44c3 table tbody tr.bhd-table-placeholder:hover td {
29
30
  background-color: #ffffff;
30
31
  }
31
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) {
32
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) {
32
33
  background: transparent;
33
34
  }
34
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder):hover td {
35
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder):hover td {
35
36
  background-color: #ffeeeb !important;
36
37
  }
37
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td {
38
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td {
38
39
  word-wrap: break-word;
39
40
  word-break: break-all;
40
41
  overflow: hidden;
@@ -42,35 +43,68 @@
42
43
  text-overflow: ellipsis;
43
44
  /* 多选框 距右的距离 */
44
45
  }
45
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td:nth-child(1) {
46
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:nth-child(1) {
46
47
  padding-left: 40px;
47
48
  }
48
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td:last-child {
49
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:last-child {
49
50
  padding-right: 40px;
50
51
  }
51
- .index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column {
52
+ .index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column {
52
53
  -webkit-padding-end: 16px;
53
54
  padding-inline-end: 16px;
54
55
  }
55
- .index_module_Table__84e7aa4c .bhd-table-wrapper {
56
+ .index_module_Table__6cae44c3 .bhd-table-wrapper {
56
57
  /* check 选中变色 */
57
58
  /* scroll 固定列 设置overflow:hidden 阴影消失问题 */
58
59
  }
59
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-selection-col {
60
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-selection-col {
60
61
  width: 72px !important;
61
62
  }
62
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-tbody > tr.bhd-table-row-selected > td {
63
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-tbody > tr.bhd-table-row-selected > td {
63
64
  background: #ffffff;
64
65
  }
65
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-left-first::after,
66
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-left-last::after {
66
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-left-first::after,
67
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-left-last::after {
67
68
  right: 2px;
68
69
  }
69
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-right-first::after,
70
- .index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-right-last::after {
70
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-right-first::after,
71
+ .index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-right-last::after {
71
72
  left: 2px;
72
73
  }
73
- .index_module_columnTootipClassName__84e7aa4c .bhd-tooltip-content .bhd-tooltip-inner {
74
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item {
75
+ border-color: transparent;
76
+ }
77
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-link {
78
+ border: none !important;
79
+ background: none !important;
80
+ }
81
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active {
82
+ background-color: #f4523b;
83
+ }
84
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active:hover {
85
+ background-color: #ff7d66;
86
+ }
87
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active:hover > a {
88
+ color: #ffffff;
89
+ }
90
+ .index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active > a {
91
+ color: #ffffff;
92
+ }
93
+ .index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item {
94
+ border: none !important;
95
+ background: none !important;
96
+ color: rgba(0, 0, 0, 0.25) !important;
97
+ }
98
+ .index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item a {
99
+ color: rgba(0, 0, 0, 0.25) !important;
100
+ }
101
+ .index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-mini .bhd-pagination-item {
102
+ margin-right: 8px !important;
103
+ }
104
+ .index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-mini .bhd-pagination-item:not(.bhd-pagination-item-active):hover {
105
+ background-color: transparent !important;
106
+ }
107
+ .index_module_columnTootipClassName__6cae44c3 .bhd-tooltip-content .bhd-tooltip-inner {
74
108
  color: rgba(0, 0, 0, 0.85);
75
109
  word-break: break-all;
76
110
  }
@@ -7,7 +7,7 @@ import { useState, useRef, useEffect } from 'react';
7
7
  import 'react/jsx-runtime';
8
8
  import 'react-dom';
9
9
 
10
- var modules_63b47c51 = {"Table":"index_module_Table__84e7aa4c","columnTootipClassName":"index_module_columnTootipClassName__84e7aa4c"};
10
+ var modules_63b47c51 = {"Table":"index_module_Table__6cae44c3","columnTootipClassName":"index_module_columnTootipClassName__6cae44c3"};
11
11
 
12
12
  var getTextSize = function(str) {
13
13
  var fontSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 14;
@@ -87,16 +87,17 @@ var Table = function(props) {
87
87
  180,
88
88
  240,
89
89
  320
90
- ] : _props_defaultWidthRang, _props_isFixedLeft = props.isFixedLeft, isFixedLeft = _props_isFixedLeft === void 0 ? true : _props_isFixedLeft, _props_isFixedRight = props.isFixedRight, isFixedRight = _props_isFixedRight === void 0 ? true : _props_isFixedRight;
90
+ ] : _props_defaultWidthRang, _props_isFixedLeft = props.isFixedLeft, isFixedLeft = _props_isFixedLeft === void 0 ? true : _props_isFixedLeft, _props_isFixedRight = props.isFixedRight, isFixedRight = _props_isFixedRight === void 0 ? true : _props_isFixedRight, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered;
91
91
  var _useState = _slicedToArray(useState(props.columns || []), 2), columns = _useState[0], setColumns = _useState[1];
92
92
  var _useState1 = _slicedToArray(useState(props.scroll || undefined), 2), scrollObject = _useState1[0], setScrollObject = _useState1[1];
93
93
  var columnTootipClassName = props.columnTootipClassName, columnTootipColor = props.columnTootipColor;
94
94
  var initColumns = function() {
95
- var _initColumnsWidth = initColumnsWidth(props.columns, tableRef.current.offsetWidth), selfColumns = _initColumnsWidth.columns;
95
+ var tableWidth = bordered ? tableRef.current.offsetWidth - 2 : tableRef.current.offsetWidth;
96
+ var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
96
97
  setColumns(selfColumns);
97
98
  var obj = scrollObject ? scrollObject : {};
98
99
  obj = _objectSpreadProps(_objectSpread({}, obj), {
99
- x: tableRef.current.offsetWidth
100
+ x: tableWidth
100
101
  });
101
102
  setScrollObject(obj);
102
103
  };
@@ -109,7 +110,7 @@ var Table = function(props) {
109
110
  // item.width=parseFloat(item.width)
110
111
  if (widthPercentage.test(item.width)) {
111
112
  //检测到宽度为百分比 则转换为具体px 如大于100% 则视为自适应
112
- item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * item.width;
113
+ item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * parseFloat(item.width) / 100;
113
114
  } else if (typeof item.width === "number") {
114
115
  //检测为number 则为具体的像素值
115
116
  item.width = item.width;
@@ -174,7 +175,6 @@ var Table = function(props) {
174
175
  }
175
176
  return item;
176
177
  });
177
- // console.log("diffdiff",diff,tableWidth,minWidth,avgWidth,columns,autoNum)
178
178
  columns = columns.map(function(item, index) {
179
179
  //存在适应自适应列侯 多余宽度 则平均分配每一列(除最后一列)
180
180
  if (avgWidth > 0 && index !== columns.length - 1) {
@@ -215,7 +215,9 @@ var Table = function(props) {
215
215
  }, obj.style)
216
216
  });
217
217
  };
218
- console.log("宽度宽度", item, item.width, item.widthRang);
218
+ // if(isNaN(item.width)){
219
+ // console.log("宽度宽度",item,item.width,item.widthRang)
220
+ // }
219
221
  return item;
220
222
  });
221
223
  return {
@@ -253,7 +255,6 @@ var Table = function(props) {
253
255
  children: /*#__PURE__*/ jsx(Table$1, _objectSpread({}, config))
254
256
  });
255
257
  };
256
- // let BhdTable=Provider(Table)
257
258
  Table.SELECTION_COLUMN = Table$1.SELECTION_COLUMN;
258
259
  Table.EXPAND_COLUMN = Table$1.EXPAND_COLUMN;
259
260
  Table.SELECTION_ALL = Table$1.SELECTION_ALL;
@@ -1 +1 @@
1
- .index_module_Table__84e7aa4c{width:100%}.index_module_Table__84e7aa4c table td,.index_module_Table__84e7aa4c table th{border:none;border-bottom:1px solid #e8e8e8}.index_module_Table__84e7aa4c table>.bhd-table-thead>tr>.bhd-table-cell{background:#fafafa;color:rgba(0,0,0,.85);font-size:16px;font-weight:400;white-space:nowrap}.index_module_Table__84e7aa4c table>.bhd-table-thead>tr>.bhd-table-cell:first-child{padding-left:40px}.index_module_Table__84e7aa4c table>.bhd-table-thead>tr>.bhd-table-cell:last-child{padding-right:40px}.index_module_Table__84e7aa4c table>.bhd-table-thead>tr>.bhd-table-cell:before{display:none}.index_module_Table__84e7aa4c table tbody tr.bhd-table-placeholder:hover td{background-color:#fff}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder){background:transparent}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder):hover td{background-color:#ffeeeb!important}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td{word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td:first-child{padding-left:40px}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td:last-child{padding-right:40px}.index_module_Table__84e7aa4c table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column{-webkit-padding-end:16px;padding-inline-end:16px}.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-selection-col{width:72px!important}.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-tbody>tr.bhd-table-row-selected>td{background:#fff}.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-left-first:after,.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-left-last:after{right:2px}.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-right-first:after,.index_module_Table__84e7aa4c .bhd-table-wrapper .bhd-table-cell-fix-right-last:after{left:2px}.index_module_columnTootipClassName__84e7aa4c .bhd-tooltip-content .bhd-tooltip-inner{color:rgba(0,0,0,.85);word-break:break-all}
1
+ .index_module_Table__6cae44c3{width:100%}.index_module_Table__6cae44c3 table td,.index_module_Table__6cae44c3 table th{border:none;border-bottom:1px solid #e8e8e8}.index_module_Table__6cae44c3 table>.bhd-table-thead>tr>.bhd-table-cell{background:#fafafa;color:rgba(0,0,0,.85);font-size:16px;font-weight:400;white-space:nowrap}.index_module_Table__6cae44c3 table>.bhd-table-thead>tr>.bhd-table-cell:first-child{padding-left:40px}.index_module_Table__6cae44c3 table>.bhd-table-thead>tr>.bhd-table-cell:last-child{padding-right:40px}.index_module_Table__6cae44c3 table>.bhd-table-thead>tr>.bhd-table-cell:before{display:none}.index_module_Table__6cae44c3 table tbody tr.bhd-table-placeholder:hover td{background-color:#fff}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder){background:transparent}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder):hover td{background-color:#ffeeeb!important}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td{word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:first-child{padding-left:40px}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:last-child{padding-right:40px}.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column{-webkit-padding-end:16px;padding-inline-end:16px}.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-selection-col{width:72px!important}.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-tbody>tr.bhd-table-row-selected>td{background:#fff}.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-left-first:after,.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-left-last:after{right:2px}.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-right-first:after,.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-cell-fix-right-last:after{left:2px}.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item{border-color:transparent}.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-link{background:none!important;border:none!important}.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active{background-color:#f4523b}.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active:hover{background-color:#ff7d66}.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active:hover>a,.index_module_Table__6cae44c3 .bhd-pagination .bhd-pagination-item-active>a{color:#fff}.index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item{background:none!important;border:none!important;color:rgba(0,0,0,.25)!important}.index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item a{color:rgba(0,0,0,.25)!important}.index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-mini .bhd-pagination-item{margin-right:8px!important}.index_module_Table__6cae44c3 .bhd-pagination.bhd-pagination-mini .bhd-pagination-item:not(.bhd-pagination-item-active):hover{background-color:transparent!important}.index_module_columnTootipClassName__6cae44c3 .bhd-tooltip-content .bhd-tooltip-inner{color:rgba(0,0,0,.85);word-break:break-all}
@@ -1 +1 @@
1
- import{_ as t,j as e,a as n,b as o,T as i,c as r}from"./e40d2239.esm.es5.production.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.regexp.test.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.fixed.js";import{useState as l,useRef as d,useEffect as u}from"react";import"react/jsx-runtime";import"react-dom";var a={Table:"index_module_Table__84e7aa4c",columnTootipClassName:"index_module_columnTootipClassName__84e7aa4c"},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14,n=0,o=document.createElement("div");return o.style.position="absolute",o.style.whiteSpace="nowrap",o.style.fontSize=e+"px",o.style.opacity="0",o.innerText=t,document.body.append(o),n=o.getBoundingClientRect().width,document.body.removeChild(o),n},c=function(r){var d=r.children,u=r.title,a=r.width,c=t(l(!1),2),m=c[0],h=c[1];return e(i,n(o({},r),{open:m,children:e("span",{onMouseEnter:function(t){var e=0;(e="function"==typeof a?a(t):a)?h(!(s(u)<e)):h(!0)},onMouseLeave:function(){h(!1)},children:d})}))},m=/^\d+%$/,h=/^\d+px$/,p=function(t){var e={};return parseFloat((e=window.getComputedStyle?getComputedStyle(t,null):t.currentStyle)["padding-left"])+parseFloat(e["padding-right"])},w=function(t){try{for(;t&&"TD"!==t.nodeName;)t=t.parentElement;var e=p(t);return t.clientWidth-e}catch(t){return null}},f=function(i){var s=d(null),p=d({timer:null}),f=i.defaultWidthRang,C=void 0===f?[180,240,320]:f,g=i.isFixedLeft,v=void 0===g||g,E=i.isFixedRight,N=void 0===E||E,T=t(l(i.columns||[]),2),y=T[0],L=T[1],x=t(l(i.scroll||void 0),2),_=x[0],R=x[1],O=i.columnTootipClassName,S=i.columnTootipColor,j=function(){var t=b(i.columns,s.current.offsetWidth).columns;L(t);var e=_||{};e=n(o({},e),{x:s.current.offsetWidth}),R(e)},b=function(t,i){var r=0,l=0,d=0;t=t.map(function(t){return t.width=t.width||"auto",m.test(t.width)?t.width=parseFloat(t.width)>=100?"auto":i*t.width:"number"==typeof t.width?t.width=t.width:h.test(t.width)?t.width=parseFloat(t.width):t.width="auto","auto"===t.width?(r+=1,t.widthRang||(t.widthRang=C),l+=t.widthRang[0],d+=t.widthRang[1]):(l+=t.width,d+=t.width),t.onColumnCell||(t.onColumnCell=t.onCell||function(){return{}}),t.render||(t.ellipsis={showTitle:!1},t.render=function(t){return e(c,{width:function(t){return w(t.target)},title:t,trigger:"hover",overlayClassName:O||a.columnTootipClassName,color:S||"#FFF",children:e("span",{children:t})})}),t});var u=i-l;if(u>0){var s=0;t=(t=t.map(function(t){return"auto"===t.width&&(t.width=t.widthRang[0]+u/r,t.width>t.widthRang[2]&&(s+=t.width-t.widthRang[2],t.width=t.widthRang[2])),t})).map(function(e,n){return s>0&&n!==t.length-1&&(e.width+=s/t.length-1),e})}else t=u<0?t.map(function(e,n){return v&&0===n&&(e.fixed="left"),N&&n===t.length-1&&(e.fixed="right"),"auto"===e.width&&(e.width=e.widthRang[1]),e}):t.map(function(t){return"auto"===t.width&&(t.width=t.widthRang[0]),t});return t.map(function(t){return t.onCell=function(e,i){var r="function"==typeof t.onColumnCell?t.onColumnCell(e,i):{};return r.style=r.style?r.style:{},n(o({},r),{style:o({maxWidth:t.width+"px"},r.style)})},console.log("宽度宽度",t,t.width,t.widthRang),t}),{columns:t,scrollWidth:d}},I=function(){clearTimeout(p.current.timer),p.current.timer=setTimeout(function(){j()},1e3)};u(function(){return j(),window.addEventListener("resize",I),function(){clearTimeout(p.current.timer),window.removeEventListener("resize",I)}},[i.columns]);var F=n(o({bordered:!1},i),{columns:y,scroll:_||{x:"auto"}});return e("div",{className:a.Table,ref:s,children:e(r,o({},F))})};f.SELECTION_COLUMN=r.SELECTION_COLUMN,f.EXPAND_COLUMN=r.EXPAND_COLUMN,f.SELECTION_ALL=r.SELECTION_ALL,f.SELECTION_INVERT=r.SELECTION_INVERT,f.SELECTION_NONE=r.SELECTION_NONE,f.Column=r.Column,f.ColumnGroup=r.ColumnGroup;export{f as default};
1
+ import{_ as t,j as e,a as n,b as o,T as i,c as r}from"./e40d2239.esm.es5.production.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.regexp.test.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.fixed.js";import{useState as l,useRef as d,useEffect as u}from"react";import"react/jsx-runtime";import"react-dom";var a={Table:"index_module_Table__6cae44c3",columnTootipClassName:"index_module_columnTootipClassName__6cae44c3"},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14,n=0,o=document.createElement("div");return o.style.position="absolute",o.style.whiteSpace="nowrap",o.style.fontSize=e+"px",o.style.opacity="0",o.innerText=t,document.body.append(o),n=o.getBoundingClientRect().width,document.body.removeChild(o),n},c=function(r){var d=r.children,u=r.title,a=r.width,c=t(l(!1),2),m=c[0],h=c[1];return e(i,n(o({},r),{open:m,children:e("span",{onMouseEnter:function(t){var e=0;(e="function"==typeof a?a(t):a)?h(!(s(u)<e)):h(!0)},onMouseLeave:function(){h(!1)},children:d})}))},m=/^\d+%$/,h=/^\d+px$/,p=function(t){var e={};return parseFloat((e=window.getComputedStyle?getComputedStyle(t,null):t.currentStyle)["padding-left"])+parseFloat(e["padding-right"])},w=function(t){try{for(;t&&"TD"!==t.nodeName;)t=t.parentElement;var e=p(t);return t.clientWidth-e}catch(t){return null}},f=function(i){var s=d(null),p=d({timer:null}),f=i.defaultWidthRang,C=void 0===f?[180,240,320]:f,g=i.isFixedLeft,v=void 0===g||g,E=i.isFixedRight,N=void 0===E||E,T=i.bordered,y=void 0!==T&&T,L=t(l(i.columns||[]),2),x=L[0],_=L[1],R=t(l(i.scroll||void 0),2),O=R[0],S=R[1],b=i.columnTootipClassName,j=i.columnTootipColor,F=function(){var t=y?s.current.offsetWidth-2:s.current.offsetWidth,e=I(i.columns,t).columns;_(e);var r=O||{};r=n(o({},r),{x:t}),S(r)},I=function(t,i){var r=0,l=0,d=0;t=t.map(function(t){return t.width=t.width||"auto",m.test(t.width)?t.width=parseFloat(t.width)>=100?"auto":i*parseFloat(t.width)/100:"number"==typeof t.width?t.width=t.width:h.test(t.width)?t.width=parseFloat(t.width):t.width="auto","auto"===t.width?(r+=1,t.widthRang||(t.widthRang=C),l+=t.widthRang[0],d+=t.widthRang[1]):(l+=t.width,d+=t.width),t.onColumnCell||(t.onColumnCell=t.onCell||function(){return{}}),t.render||(t.ellipsis={showTitle:!1},t.render=function(t){return e(c,{width:function(t){return w(t.target)},title:t,trigger:"hover",overlayClassName:b||a.columnTootipClassName,color:j||"#FFF",children:e("span",{children:t})})}),t});var u=i-l;if(u>0){var s=0;t=(t=t.map(function(t){return"auto"===t.width&&(t.width=t.widthRang[0]+u/r,t.width>t.widthRang[2]&&(s+=t.width-t.widthRang[2],t.width=t.widthRang[2])),t})).map(function(e,n){return s>0&&n!==t.length-1&&(e.width+=s/t.length-1),e})}else t=u<0?t.map(function(e,n){return v&&0===n&&(e.fixed="left"),N&&n===t.length-1&&(e.fixed="right"),"auto"===e.width&&(e.width=e.widthRang[1]),e}):t.map(function(t){return"auto"===t.width&&(t.width=t.widthRang[0]),t});return t.map(function(t){return t.onCell=function(e,i){var r="function"==typeof t.onColumnCell?t.onColumnCell(e,i):{};return r.style=r.style?r.style:{},n(o({},r),{style:o({maxWidth:t.width+"px"},r.style)})},t}),{columns:t,scrollWidth:d}},M=function(){clearTimeout(p.current.timer),p.current.timer=setTimeout(function(){F()},1e3)};u(function(){return F(),window.addEventListener("resize",M),function(){clearTimeout(p.current.timer),window.removeEventListener("resize",M)}},[i.columns]);var W=n(o({bordered:!1},i),{columns:x,scroll:O||{x:"auto"}});return e("div",{className:a.Table,ref:s,children:e(r,o({},W))})};f.SELECTION_COLUMN=r.SELECTION_COLUMN,f.EXPAND_COLUMN=r.EXPAND_COLUMN,f.SELECTION_ALL=r.SELECTION_ALL,f.SELECTION_INVERT=r.SELECTION_INVERT,f.SELECTION_NONE=r.SELECTION_NONE,f.Column=r.Column,f.ColumnGroup=r.ColumnGroup;export{f as default};
package/es2017/index.d.ts CHANGED
@@ -30,10 +30,8 @@ export { default as Layout } from 'antd/es/layout';
30
30
  export { default as List } from 'antd/es/list';
31
31
  export { default as Mentions } from 'antd/es/mentions';
32
32
  export { default as Menu } from 'antd/es/menu';
33
- export { default as message } from 'antd/es/message';
34
33
  export { default as Modal } from 'antd/es/modal';
35
34
  export { default as notification } from 'antd/es/notification';
36
- export { default as Pagination } from 'antd/es/pagination';
37
35
  export { default as Popconfirm } from 'antd/es/popconfirm';
38
36
  export { default as Popover } from 'antd/es/popover';
39
37
  export { default as Progress } from 'antd/es/progress';
@@ -71,3 +69,5 @@ export { default as TextTootip } from "./textTootip";
71
69
  export { default as zh_CN } from "antd/locale/zh_CN";
72
70
  export { default as en_US } from "antd/locale/en_US";
73
71
  export { default as Table } from "./table";
72
+ export { default as message } from './message';
73
+ export { default as Pagination } from './pagination';
package/es2017/index.js CHANGED
@@ -31,10 +31,8 @@ export { default as Layout } from "antd/es/layout";
31
31
  export { default as List } from "antd/es/list";
32
32
  export { default as Mentions } from "antd/es/mentions";
33
33
  export { default as Menu } from "antd/es/menu";
34
- export { default as message } from "antd/es/message";
35
34
  export { default as Modal } from "antd/es/modal";
36
35
  export { default as notification } from "antd/es/notification";
37
- export { default as Pagination } from "antd/es/pagination";
38
36
  export { default as Popconfirm } from "antd/es/popconfirm";
39
37
  export { default as Popover } from "antd/es/popover";
40
38
  export { default as Progress } from "antd/es/progress";
@@ -73,3 +71,5 @@ export { default as TextTootip } from "./textTootip/index";
73
71
  export { default as zh_CN } from "antd/locale/zh_CN";
74
72
  export { default as en_US } from "antd/locale/en_US";
75
73
  export { default as Table } from "./table/index"; //改写table逻辑
74
+ export { default as message } from "./message/index"; //封装message
75
+ export { default as Pagination } from "./pagination/index"; //封装Pagination
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import type { ArgsProps } from "antd/es/message";
3
+ declare const BhdMessage: {
4
+ customSuccess: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
5
+ customWarning: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
6
+ customError: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
7
+ info: import("antd/es/message/interface").TypeOpen;
8
+ success: import("antd/es/message/interface").TypeOpen;
9
+ error: import("antd/es/message/interface").TypeOpen;
10
+ warning: import("antd/es/message/interface").TypeOpen;
11
+ loading: import("antd/es/message/interface").TypeOpen;
12
+ open: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
13
+ destroy: (key?: React.Key) => void;
14
+ config: (config: import("antd/es/message/interface").ConfigOptions) => void;
15
+ useMessage: typeof import("antd/es/message/useMessage").default;
16
+ _InternalPanelDoNotUseOrYouWillBeFired: typeof import("antd/es/message/PurePanel").default;
17
+ };
18
+ export default BhdMessage;
@@ -0,0 +1,42 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import styles from "./index.module.less";
6
+ import { message } from "antd";
7
+ import { ExclamationCircleFilled } from "../icons/index";
8
+ const BhdMessage = _object_spread_props(_object_spread({}, message), {
9
+ customSuccess: (config)=>{
10
+ let className = styles.customSuccess;
11
+ if (typeof config === "string") return message.success({
12
+ content: config,
13
+ className
14
+ });
15
+ return message.success(_object_spread_props(_object_spread({}, config), {
16
+ className: `${className} ${config.className || ""}`
17
+ }));
18
+ },
19
+ customWarning: (config)=>{
20
+ let className = styles.customWarning;
21
+ if (typeof config === "string") return message.warning({
22
+ content: config,
23
+ className
24
+ });
25
+ return message.warning(_object_spread_props(_object_spread({}, config), {
26
+ className: `${className} ${config.className || ""}`
27
+ }));
28
+ },
29
+ customError: (config)=>{
30
+ let className = styles.customError;
31
+ if (typeof config === "string") return message.error({
32
+ content: config,
33
+ className,
34
+ icon: /*#__PURE__*/ _jsx(ExclamationCircleFilled, {})
35
+ });
36
+ return message.error(_object_spread_props(_object_spread({}, config), {
37
+ className: `${className} ${config.className || ""}`,
38
+ icon: config.icon || /*#__PURE__*/ _jsx(ExclamationCircleFilled, {})
39
+ }));
40
+ }
41
+ });
42
+ export default BhdMessage;
@@ -0,0 +1,91 @@
1
+ // .bhd-message-notice {
2
+ // /* success */
3
+ // &.bhd-message-notice-success {
4
+ // .bhd-message-notice-content {
5
+ // background: #5991ef;
6
+ // color: #ffffff;
7
+ // font-weight: 500;
8
+ // // font-family: 'PingFang SC';
9
+ // font-size: 14px;
10
+ // .bhd-message-success {
11
+ // & > .anticon {
12
+ // color: #ffffff;
13
+ // font-size: 14px;
14
+ // }
15
+ // }
16
+ // }
17
+ // }
18
+ // /* warn */
19
+ // &.bhd-message-notice-warning {
20
+ // }
21
+ // /* error */
22
+ // &.bhd-message-notice-error {
23
+ // .bhd-message-notice-content {
24
+ // background-color: #f8700c;
25
+ // color: #ffffff;
26
+ // font-weight: 500;
27
+ // // font-family: 'PingFang SC';
28
+ // font-size: 14px;
29
+ // .bhd-message-error {
30
+ // & > .anticon {
31
+ // color: #ffffff;
32
+ // font-size: 14px;
33
+ // }
34
+ // }
35
+ // }
36
+ // }
37
+ // }
38
+
39
+ /* 成功 */
40
+ .customSuccess {
41
+ :global {
42
+ .bhd-message-notice-content {
43
+ background: #5991ef !important;
44
+ color: #ffffff;
45
+ font-weight: 500;
46
+ font-size: 14px;
47
+ .bhd-message-success {
48
+ & > .anticon {
49
+ color: #ffffff;
50
+ font-size: 14px;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ /* 警告 */
58
+ .customWarning {
59
+ :global {
60
+ .bhd-message-notice-content {
61
+ background-color: #fadb14 !important;
62
+ color: #ffffff;
63
+ font-weight: 500;
64
+ font-size: 14px;
65
+ .bhd-message-warning {
66
+ & > .anticon {
67
+ color: #ffffff;
68
+ font-size: 14px;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ /* 错误 */
76
+ .customError {
77
+ :global {
78
+ .bhd-message-notice-content {
79
+ background-color: #f8700c !important;
80
+ color: #ffffff;
81
+ font-weight: 500;
82
+ font-size: 14px;
83
+ .bhd-message-error {
84
+ & > .anticon {
85
+ color: #ffffff;
86
+ font-size: 14px;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { PaginationProps } from "antd/es/pagination";
3
+ declare const BhdPagination: (props: PaginationProps) => JSX.Element;
4
+ export default BhdPagination;
@@ -0,0 +1,13 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import styles from "./index.module.less";
6
+ import { Pagination } from "antd";
7
+ const BhdPagination = (props)=>{
8
+ let className = `${styles.pagination} ${props.className || ""}`;
9
+ return /*#__PURE__*/ _jsx(Pagination, _object_spread_props(_object_spread({}, props), {
10
+ className: className
11
+ }));
12
+ };
13
+ export default BhdPagination;
@@ -0,0 +1,49 @@
1
+ .pagination{
2
+ :global{
3
+ .bhd-pagination-item{
4
+ border-color: transparent;
5
+ }
6
+ .bhd-pagination-item-link{
7
+ border: none!important;
8
+ background: none!important;
9
+ }
10
+ .bhd-pagination-item-active{
11
+ background-color: #f4523b;
12
+ &:hover{
13
+ background-color: #ff7d66;
14
+ &>a{
15
+ color: #FFFFFF;
16
+ }
17
+ }
18
+ &>a{
19
+ color: #FFFFFF;
20
+ }
21
+ }
22
+ }
23
+ }
24
+
25
+ :global{
26
+ .bhd-pagination-disabled{
27
+ .bhd-pagination-item{
28
+ border: none!important;
29
+ background: none!important;
30
+ color: rgba(0, 0, 0, 0.25)!important;
31
+ a{
32
+ color: rgba(0, 0, 0, 0.25)!important;
33
+ }
34
+ }
35
+ }
36
+
37
+ .bhd-pagination-mini{
38
+ .bhd-pagination-item{
39
+ margin-right: 8px !important;
40
+ }
41
+ .bhd-pagination-item:not(.bhd-pagination-item-active){
42
+ &:hover{
43
+ background-color:transparent!important;
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+
@@ -35,16 +35,17 @@ const Table = (props)=>{
35
35
  180,
36
36
  240,
37
37
  320
38
- ] , isFixedLeft =true , isFixedRight =true } = props;
38
+ ] , isFixedLeft =true , isFixedRight =true , bordered =false } = props;
39
39
  const [columns, setColumns] = useState(props.columns || []);
40
40
  const [scrollObject, setScrollObject] = useState(props.scroll || undefined);
41
41
  let { columnTootipClassName , columnTootipColor } = props;
42
42
  const initColumns = ()=>{
43
- let { columns: selfColumns } = initColumnsWidth(props.columns, tableRef.current.offsetWidth);
43
+ const tableWidth = bordered ? tableRef.current.offsetWidth - 2 : tableRef.current.offsetWidth;
44
+ let { columns: selfColumns } = initColumnsWidth(props.columns, tableWidth);
44
45
  setColumns(selfColumns);
45
46
  let obj = scrollObject ? scrollObject : {};
46
47
  obj = _object_spread_props(_object_spread({}, obj), {
47
- x: tableRef.current.offsetWidth
48
+ x: tableWidth
48
49
  });
49
50
  setScrollObject(obj);
50
51
  };
@@ -56,7 +57,7 @@ const Table = (props)=>{
56
57
  item.width = item.width || "auto";
57
58
  // item.width=parseFloat(item.width)
58
59
  if (widthPercentage.test(item.width)) //检测到宽度为百分比 则转换为具体px 如大于100% 则视为自适应
59
- item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * item.width;
60
+ item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * parseFloat(item.width) / 100;
60
61
  else if (typeof item.width === "number") //检测为number 则为具体的像素值
61
62
  item.width = item.width;
62
63
  else if (widthPx.test(item.width)) //检测为 "12px" 则为具体的值
@@ -109,7 +110,6 @@ const Table = (props)=>{
109
110
  }
110
111
  return item;
111
112
  });
112
- // console.log("diffdiff",diff,tableWidth,minWidth,avgWidth,columns,autoNum)
113
113
  columns = columns.map((item, index)=>{
114
114
  //存在适应自适应列侯 多余宽度 则平均分配每一列(除最后一列)
115
115
  if (avgWidth > 0 && index !== columns.length - 1) item.width += avgWidth / columns.length - 1;
@@ -137,7 +137,9 @@ const Table = (props)=>{
137
137
  }, obj.style)
138
138
  });
139
139
  };
140
- console.log("宽度宽度", item, item.width, item.widthRang);
140
+ // if(isNaN(item.width)){
141
+ // console.log("宽度宽度",item,item.width,item.widthRang)
142
+ // }
141
143
  return item;
142
144
  });
143
145
  return {
@@ -175,7 +177,6 @@ const Table = (props)=>{
175
177
  children: /*#__PURE__*/ _jsx(AntdTable, _object_spread({}, config))
176
178
  });
177
179
  };
178
- // let BhdTable=Provider(Table)
179
180
  Table.SELECTION_COLUMN = AntdTable.SELECTION_COLUMN;
180
181
  Table.EXPAND_COLUMN = AntdTable.EXPAND_COLUMN;
181
182
  Table.SELECTION_ALL = AntdTable.SELECTION_ALL;
@@ -55,8 +55,8 @@
55
55
  padding-right: 40px;
56
56
  }
57
57
  /* 多选框 距右的距离 */
58
- &.bhd-table-selection-column{
59
- padding-inline-end:16px;
58
+ &.bhd-table-selection-column {
59
+ padding-inline-end: 16px;
60
60
  }
61
61
  }
62
62
  }
@@ -73,13 +73,58 @@
73
73
  }
74
74
 
75
75
  /* scroll 固定列 设置overflow:hidden 阴影消失问题 */
76
- .bhd-table-cell-fix-left-first::after,.bhd-table-cell-fix-left-last::after{
76
+ .bhd-table-cell-fix-left-first::after,
77
+ .bhd-table-cell-fix-left-last::after {
77
78
  right: 2px;
78
79
  }
79
- .bhd-table-cell-fix-right-first::after,.bhd-table-cell-fix-right-last::after{
80
+ .bhd-table-cell-fix-right-first::after,
81
+ .bhd-table-cell-fix-right-last::after {
80
82
  left: 2px;
81
83
  }
82
84
  }
85
+ /* 分页器 */
86
+ .bhd-pagination {
87
+ .bhd-pagination-item {
88
+ border-color: transparent;
89
+ }
90
+ .bhd-pagination-item-link {
91
+ border: none !important;
92
+ background: none !important;
93
+ }
94
+ .bhd-pagination-item-active {
95
+ background-color: #f4523b;
96
+ &:hover {
97
+ background-color: #ff7d66;
98
+ & > a {
99
+ color: #ffffff;
100
+ }
101
+ }
102
+ & > a {
103
+ color: #ffffff;
104
+ }
105
+ }
106
+ &.bhd-pagination-disabled {
107
+ .bhd-pagination-item {
108
+ border: none !important;
109
+ background: none !important;
110
+ color: rgba(0, 0, 0, 0.25) !important;
111
+ a {
112
+ color: rgba(0, 0, 0, 0.25) !important;
113
+ }
114
+ }
115
+ }
116
+
117
+ &.bhd-pagination-mini {
118
+ .bhd-pagination-item {
119
+ margin-right: 8px !important;
120
+ }
121
+ .bhd-pagination-item:not(.bhd-pagination-item-active) {
122
+ &:hover {
123
+ background-color: transparent !important;
124
+ }
125
+ }
126
+ }
127
+ }
83
128
  }
84
129
  }
85
130
 
package/esm/index.d.ts CHANGED
@@ -30,10 +30,8 @@ export { default as Layout } from 'antd/es/layout';
30
30
  export { default as List } from 'antd/es/list';
31
31
  export { default as Mentions } from 'antd/es/mentions';
32
32
  export { default as Menu } from 'antd/es/menu';
33
- export { default as message } from 'antd/es/message';
34
33
  export { default as Modal } from 'antd/es/modal';
35
34
  export { default as notification } from 'antd/es/notification';
36
- export { default as Pagination } from 'antd/es/pagination';
37
35
  export { default as Popconfirm } from 'antd/es/popconfirm';
38
36
  export { default as Popover } from 'antd/es/popover';
39
37
  export { default as Progress } from 'antd/es/progress';
@@ -71,3 +69,5 @@ export { default as TextTootip } from "./textTootip";
71
69
  export { default as zh_CN } from "antd/locale/zh_CN";
72
70
  export { default as en_US } from "antd/locale/en_US";
73
71
  export { default as Table } from "./table";
72
+ export { default as message } from './message';
73
+ export { default as Pagination } from './pagination';
package/esm/index.js CHANGED
@@ -31,10 +31,8 @@ export { default as Layout } from "antd/es/layout";
31
31
  export { default as List } from "antd/es/list";
32
32
  export { default as Mentions } from "antd/es/mentions";
33
33
  export { default as Menu } from "antd/es/menu";
34
- export { default as message } from "antd/es/message";
35
34
  export { default as Modal } from "antd/es/modal";
36
35
  export { default as notification } from "antd/es/notification";
37
- export { default as Pagination } from "antd/es/pagination";
38
36
  export { default as Popconfirm } from "antd/es/popconfirm";
39
37
  export { default as Popover } from "antd/es/popover";
40
38
  export { default as Progress } from "antd/es/progress";
@@ -73,3 +71,5 @@ export { default as TextTootip } from "./textTootip/index";
73
71
  export { default as zh_CN } from "antd/locale/zh_CN";
74
72
  export { default as en_US } from "antd/locale/en_US";
75
73
  export { default as Table } from "./table/index"; //改写table逻辑
74
+ export { default as message } from "./message/index"; //封装message
75
+ export { default as Pagination } from "./pagination/index"; //封装Pagination
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import type { ArgsProps } from "antd/es/message";
3
+ declare const BhdMessage: {
4
+ customSuccess: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
5
+ customWarning: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
6
+ customError: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
7
+ info: import("antd/es/message/interface").TypeOpen;
8
+ success: import("antd/es/message/interface").TypeOpen;
9
+ error: import("antd/es/message/interface").TypeOpen;
10
+ warning: import("antd/es/message/interface").TypeOpen;
11
+ loading: import("antd/es/message/interface").TypeOpen;
12
+ open: (config: ArgsProps) => import("antd/es/message/interface").MessageType;
13
+ destroy: (key?: React.Key) => void;
14
+ config: (config: import("antd/es/message/interface").ConfigOptions) => void;
15
+ useMessage: typeof import("antd/es/message/useMessage").default;
16
+ _InternalPanelDoNotUseOrYouWillBeFired: typeof import("antd/es/message/PurePanel").default;
17
+ };
18
+ export default BhdMessage;
@@ -0,0 +1,42 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import styles from "./index.module.less";
6
+ import { message } from "antd";
7
+ import { ExclamationCircleFilled } from "../icons/index";
8
+ var BhdMessage = _object_spread_props(_object_spread({}, message), {
9
+ customSuccess: function(config) {
10
+ var className = styles.customSuccess;
11
+ if (typeof config === "string") return message.success({
12
+ content: config,
13
+ className: className
14
+ });
15
+ return message.success(_object_spread_props(_object_spread({}, config), {
16
+ className: "".concat(className, " ").concat(config.className || "")
17
+ }));
18
+ },
19
+ customWarning: function(config) {
20
+ var className = styles.customWarning;
21
+ if (typeof config === "string") return message.warning({
22
+ content: config,
23
+ className: className
24
+ });
25
+ return message.warning(_object_spread_props(_object_spread({}, config), {
26
+ className: "".concat(className, " ").concat(config.className || "")
27
+ }));
28
+ },
29
+ customError: function(config) {
30
+ var className = styles.customError;
31
+ if (typeof config === "string") return message.error({
32
+ content: config,
33
+ className: className,
34
+ icon: /*#__PURE__*/ _jsx(ExclamationCircleFilled, {})
35
+ });
36
+ return message.error(_object_spread_props(_object_spread({}, config), {
37
+ className: "".concat(className, " ").concat(config.className || ""),
38
+ icon: config.icon || /*#__PURE__*/ _jsx(ExclamationCircleFilled, {})
39
+ }));
40
+ }
41
+ });
42
+ export default BhdMessage;
@@ -0,0 +1,91 @@
1
+ // .bhd-message-notice {
2
+ // /* success */
3
+ // &.bhd-message-notice-success {
4
+ // .bhd-message-notice-content {
5
+ // background: #5991ef;
6
+ // color: #ffffff;
7
+ // font-weight: 500;
8
+ // // font-family: 'PingFang SC';
9
+ // font-size: 14px;
10
+ // .bhd-message-success {
11
+ // & > .anticon {
12
+ // color: #ffffff;
13
+ // font-size: 14px;
14
+ // }
15
+ // }
16
+ // }
17
+ // }
18
+ // /* warn */
19
+ // &.bhd-message-notice-warning {
20
+ // }
21
+ // /* error */
22
+ // &.bhd-message-notice-error {
23
+ // .bhd-message-notice-content {
24
+ // background-color: #f8700c;
25
+ // color: #ffffff;
26
+ // font-weight: 500;
27
+ // // font-family: 'PingFang SC';
28
+ // font-size: 14px;
29
+ // .bhd-message-error {
30
+ // & > .anticon {
31
+ // color: #ffffff;
32
+ // font-size: 14px;
33
+ // }
34
+ // }
35
+ // }
36
+ // }
37
+ // }
38
+
39
+ /* 成功 */
40
+ .customSuccess {
41
+ :global {
42
+ .bhd-message-notice-content {
43
+ background: #5991ef !important;
44
+ color: #ffffff;
45
+ font-weight: 500;
46
+ font-size: 14px;
47
+ .bhd-message-success {
48
+ & > .anticon {
49
+ color: #ffffff;
50
+ font-size: 14px;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ /* 警告 */
58
+ .customWarning {
59
+ :global {
60
+ .bhd-message-notice-content {
61
+ background-color: #fadb14 !important;
62
+ color: #ffffff;
63
+ font-weight: 500;
64
+ font-size: 14px;
65
+ .bhd-message-warning {
66
+ & > .anticon {
67
+ color: #ffffff;
68
+ font-size: 14px;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ /* 错误 */
76
+ .customError {
77
+ :global {
78
+ .bhd-message-notice-content {
79
+ background-color: #f8700c !important;
80
+ color: #ffffff;
81
+ font-weight: 500;
82
+ font-size: 14px;
83
+ .bhd-message-error {
84
+ & > .anticon {
85
+ color: #ffffff;
86
+ font-size: 14px;
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { PaginationProps } from "antd/es/pagination";
3
+ declare const BhdPagination: (props: PaginationProps) => JSX.Element;
4
+ export default BhdPagination;
@@ -0,0 +1,13 @@
1
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
2
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
3
+ import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
4
+ import * as React from "react";
5
+ import styles from "./index.module.less";
6
+ import { Pagination } from "antd";
7
+ var BhdPagination = function(props) {
8
+ var className = "".concat(styles.pagination, " ").concat(props.className || "");
9
+ return /*#__PURE__*/ _jsx(Pagination, _object_spread_props(_object_spread({}, props), {
10
+ className: className
11
+ }));
12
+ };
13
+ export default BhdPagination;
@@ -0,0 +1,49 @@
1
+ .pagination{
2
+ :global{
3
+ .bhd-pagination-item{
4
+ border-color: transparent;
5
+ }
6
+ .bhd-pagination-item-link{
7
+ border: none!important;
8
+ background: none!important;
9
+ }
10
+ .bhd-pagination-item-active{
11
+ background-color: #f4523b;
12
+ &:hover{
13
+ background-color: #ff7d66;
14
+ &>a{
15
+ color: #FFFFFF;
16
+ }
17
+ }
18
+ &>a{
19
+ color: #FFFFFF;
20
+ }
21
+ }
22
+ }
23
+ }
24
+
25
+ :global{
26
+ .bhd-pagination-disabled{
27
+ .bhd-pagination-item{
28
+ border: none!important;
29
+ background: none!important;
30
+ color: rgba(0, 0, 0, 0.25)!important;
31
+ a{
32
+ color: rgba(0, 0, 0, 0.25)!important;
33
+ }
34
+ }
35
+ }
36
+
37
+ .bhd-pagination-mini{
38
+ .bhd-pagination-item{
39
+ margin-right: 8px !important;
40
+ }
41
+ .bhd-pagination-item:not(.bhd-pagination-item-active){
42
+ &:hover{
43
+ background-color:transparent!important;
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+
@@ -36,16 +36,17 @@ var Table = function(props) {
36
36
  180,
37
37
  240,
38
38
  320
39
- ] : _props_defaultWidthRang, _props_isFixedLeft = props.isFixedLeft, isFixedLeft = _props_isFixedLeft === void 0 ? true : _props_isFixedLeft, _props_isFixedRight = props.isFixedRight, isFixedRight = _props_isFixedRight === void 0 ? true : _props_isFixedRight;
39
+ ] : _props_defaultWidthRang, _props_isFixedLeft = props.isFixedLeft, isFixedLeft = _props_isFixedLeft === void 0 ? true : _props_isFixedLeft, _props_isFixedRight = props.isFixedRight, isFixedRight = _props_isFixedRight === void 0 ? true : _props_isFixedRight, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered;
40
40
  var _useState = _sliced_to_array(useState(props.columns || []), 2), columns = _useState[0], setColumns = _useState[1];
41
41
  var _useState1 = _sliced_to_array(useState(props.scroll || undefined), 2), scrollObject = _useState1[0], setScrollObject = _useState1[1];
42
42
  var columnTootipClassName = props.columnTootipClassName, columnTootipColor = props.columnTootipColor;
43
43
  var initColumns = function() {
44
- var _initColumnsWidth = initColumnsWidth(props.columns, tableRef.current.offsetWidth), selfColumns = _initColumnsWidth.columns;
44
+ var tableWidth = bordered ? tableRef.current.offsetWidth - 2 : tableRef.current.offsetWidth;
45
+ var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
45
46
  setColumns(selfColumns);
46
47
  var obj = scrollObject ? scrollObject : {};
47
48
  obj = _object_spread_props(_object_spread({}, obj), {
48
- x: tableRef.current.offsetWidth
49
+ x: tableWidth
49
50
  });
50
51
  setScrollObject(obj);
51
52
  };
@@ -57,7 +58,7 @@ var Table = function(props) {
57
58
  item.width = item.width || "auto";
58
59
  // item.width=parseFloat(item.width)
59
60
  if (widthPercentage.test(item.width)) //检测到宽度为百分比 则转换为具体px 如大于100% 则视为自适应
60
- item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * item.width;
61
+ item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * parseFloat(item.width) / 100;
61
62
  else if (typeof item.width === "number") //检测为number 则为具体的像素值
62
63
  item.width = item.width;
63
64
  else if (widthPx.test(item.width)) //检测为 "12px" 则为具体的值
@@ -114,7 +115,6 @@ var Table = function(props) {
114
115
  }
115
116
  return item;
116
117
  });
117
- // console.log("diffdiff",diff,tableWidth,minWidth,avgWidth,columns,autoNum)
118
118
  columns = columns.map(function(item, index) {
119
119
  //存在适应自适应列侯 多余宽度 则平均分配每一列(除最后一列)
120
120
  if (avgWidth > 0 && index !== columns.length - 1) item.width += avgWidth / columns.length - 1;
@@ -142,7 +142,9 @@ var Table = function(props) {
142
142
  }, obj.style)
143
143
  });
144
144
  };
145
- console.log("宽度宽度", item, item.width, item.widthRang);
145
+ // if(isNaN(item.width)){
146
+ // console.log("宽度宽度",item,item.width,item.widthRang)
147
+ // }
146
148
  return item;
147
149
  });
148
150
  return {
@@ -180,7 +182,6 @@ var Table = function(props) {
180
182
  children: /*#__PURE__*/ _jsx(AntdTable, _object_spread({}, config))
181
183
  });
182
184
  };
183
- // let BhdTable=Provider(Table)
184
185
  Table.SELECTION_COLUMN = AntdTable.SELECTION_COLUMN;
185
186
  Table.EXPAND_COLUMN = AntdTable.EXPAND_COLUMN;
186
187
  Table.SELECTION_ALL = AntdTable.SELECTION_ALL;
@@ -55,8 +55,8 @@
55
55
  padding-right: 40px;
56
56
  }
57
57
  /* 多选框 距右的距离 */
58
- &.bhd-table-selection-column{
59
- padding-inline-end:16px;
58
+ &.bhd-table-selection-column {
59
+ padding-inline-end: 16px;
60
60
  }
61
61
  }
62
62
  }
@@ -73,13 +73,58 @@
73
73
  }
74
74
 
75
75
  /* scroll 固定列 设置overflow:hidden 阴影消失问题 */
76
- .bhd-table-cell-fix-left-first::after,.bhd-table-cell-fix-left-last::after{
76
+ .bhd-table-cell-fix-left-first::after,
77
+ .bhd-table-cell-fix-left-last::after {
77
78
  right: 2px;
78
79
  }
79
- .bhd-table-cell-fix-right-first::after,.bhd-table-cell-fix-right-last::after{
80
+ .bhd-table-cell-fix-right-first::after,
81
+ .bhd-table-cell-fix-right-last::after {
80
82
  left: 2px;
81
83
  }
82
84
  }
85
+ /* 分页器 */
86
+ .bhd-pagination {
87
+ .bhd-pagination-item {
88
+ border-color: transparent;
89
+ }
90
+ .bhd-pagination-item-link {
91
+ border: none !important;
92
+ background: none !important;
93
+ }
94
+ .bhd-pagination-item-active {
95
+ background-color: #f4523b;
96
+ &:hover {
97
+ background-color: #ff7d66;
98
+ & > a {
99
+ color: #ffffff;
100
+ }
101
+ }
102
+ & > a {
103
+ color: #ffffff;
104
+ }
105
+ }
106
+ &.bhd-pagination-disabled {
107
+ .bhd-pagination-item {
108
+ border: none !important;
109
+ background: none !important;
110
+ color: rgba(0, 0, 0, 0.25) !important;
111
+ a {
112
+ color: rgba(0, 0, 0, 0.25) !important;
113
+ }
114
+ }
115
+ }
116
+
117
+ &.bhd-pagination-mini {
118
+ .bhd-pagination-item {
119
+ margin-right: 8px !important;
120
+ }
121
+ .bhd-pagination-item:not(.bhd-pagination-item-active) {
122
+ &:hover {
123
+ background-color: transparent !important;
124
+ }
125
+ }
126
+ }
127
+ }
83
128
  }
84
129
  }
85
130
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",
@@ -50,7 +50,8 @@
50
50
  "@swc/helpers": "^0.4.14",
51
51
  "antd": "^5.4.6",
52
52
  "less": "^4.1.3",
53
- "less-loader": "^11.1.0"
53
+ "less-loader": "^11.1.0",
54
+ "raw-loader": "^4.0.2"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@ice/pkg": "^1.0.0",