bhd-components 0.2.1 → 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.
- package/dist/{17d83214.esm.es5.development.js → 88060020.esm.es5.development.js} +18679 -17303
- package/dist/e40d2239.esm.es5.production.js +228 -0
- package/dist/table.esm.es5.development.css +66 -18
- package/dist/table.esm.es5.development.js +13 -207
- package/dist/table.esm.es5.production.css +1 -1
- package/dist/table.esm.es5.production.js +1 -1
- package/es2017/icons/index.d.ts +1 -0
- package/es2017/icons/index.js +1 -0
- package/es2017/index.d.ts +4 -4
- package/es2017/index.js +4 -4
- package/es2017/message/index.d.ts +18 -0
- package/es2017/message/index.js +42 -0
- package/es2017/message/index.module.less +91 -0
- package/es2017/pagination/index.d.ts +4 -0
- package/es2017/pagination/index.js +13 -0
- package/es2017/pagination/index.module.less +49 -0
- package/es2017/table/index.js +8 -7
- package/es2017/table/index.module.less +57 -0
- package/esm/icons/index.d.ts +1 -0
- package/esm/icons/index.js +1 -0
- package/esm/index.d.ts +4 -4
- package/esm/index.js +4 -4
- package/esm/message/index.d.ts +18 -0
- package/esm/message/index.js +42 -0
- package/esm/message/index.module.less +91 -0
- package/esm/pagination/index.d.ts +4 -0
- package/esm/pagination/index.js +13 -0
- package/esm/pagination/index.module.less +49 -0
- package/esm/table/index.js +8 -7
- package/esm/table/index.module.less +57 -0
- package/package.json +5 -3
- package/dist/844d192b.esm.es5.production.js +0 -211
|
@@ -1,62 +1,110 @@
|
|
|
1
|
-
.
|
|
1
|
+
.index_module_Table__6cae44c3 {
|
|
2
2
|
width: 100%;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.index_module_Table__6cae44c3 {
|
|
5
5
|
/* 多选框间距问题 */
|
|
6
|
+
/* 分页器 */
|
|
6
7
|
}
|
|
7
|
-
.
|
|
8
|
-
.
|
|
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
|
-
.
|
|
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
|
-
.
|
|
20
|
+
.index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell:nth-child(1) {
|
|
20
21
|
padding-left: 40px;
|
|
21
22
|
}
|
|
22
|
-
.
|
|
23
|
+
.index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell:last-child {
|
|
23
24
|
padding-right: 40px;
|
|
24
25
|
}
|
|
25
|
-
.
|
|
26
|
+
.index_module_Table__6cae44c3 table > .bhd-table-thead > tr > .bhd-table-cell::before {
|
|
26
27
|
display: none;
|
|
27
28
|
}
|
|
28
|
-
.
|
|
29
|
+
.index_module_Table__6cae44c3 table tbody tr.bhd-table-placeholder:hover td {
|
|
29
30
|
background-color: #ffffff;
|
|
30
31
|
}
|
|
31
|
-
.
|
|
32
|
+
.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) {
|
|
32
33
|
background: transparent;
|
|
33
34
|
}
|
|
34
|
-
.
|
|
35
|
+
.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder):hover td {
|
|
35
36
|
background-color: #ffeeeb !important;
|
|
36
37
|
}
|
|
37
|
-
.
|
|
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;
|
|
41
42
|
white-space: nowrap;
|
|
42
43
|
text-overflow: ellipsis;
|
|
44
|
+
/* 多选框 距右的距离 */
|
|
43
45
|
}
|
|
44
|
-
.
|
|
46
|
+
.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:nth-child(1) {
|
|
45
47
|
padding-left: 40px;
|
|
46
48
|
}
|
|
47
|
-
.
|
|
49
|
+
.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td:last-child {
|
|
48
50
|
padding-right: 40px;
|
|
49
51
|
}
|
|
50
|
-
.
|
|
52
|
+
.index_module_Table__6cae44c3 table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column {
|
|
53
|
+
-webkit-padding-end: 16px;
|
|
54
|
+
padding-inline-end: 16px;
|
|
55
|
+
}
|
|
56
|
+
.index_module_Table__6cae44c3 .bhd-table-wrapper {
|
|
51
57
|
/* check 选中变色 */
|
|
58
|
+
/* scroll 固定列 设置overflow:hidden 阴影消失问题 */
|
|
52
59
|
}
|
|
53
|
-
.
|
|
60
|
+
.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-selection-col {
|
|
54
61
|
width: 72px !important;
|
|
55
62
|
}
|
|
56
|
-
.
|
|
63
|
+
.index_module_Table__6cae44c3 .bhd-table-wrapper .bhd-table-tbody > tr.bhd-table-row-selected > td {
|
|
57
64
|
background: #ffffff;
|
|
58
65
|
}
|
|
59
|
-
.
|
|
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 {
|
|
68
|
+
right: 2px;
|
|
69
|
+
}
|
|
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 {
|
|
72
|
+
left: 2px;
|
|
73
|
+
}
|
|
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 {
|
|
60
108
|
color: rgba(0, 0, 0, 0.85);
|
|
61
109
|
word-break: break-all;
|
|
62
110
|
}
|
|
@@ -1,111 +1,14 @@
|
|
|
1
|
+
import { _ as _slicedToArray, j as jsx, a as _objectSpreadProps, b as _objectSpread, T as Tooltip, c as Table$1 } from './88060020.esm.es5.development.js';
|
|
1
2
|
import 'core-js/modules/es.array.map.js';
|
|
3
|
+
import 'core-js/modules/es.regexp.test.js';
|
|
2
4
|
import 'core-js/modules/es.regexp.exec.js';
|
|
3
5
|
import 'core-js/modules/es.string.fixed.js';
|
|
4
6
|
import { useState, useRef, useEffect } from 'react';
|
|
5
|
-
import { j as jsx, T as Tooltip, a as Table$1 } from './17d83214.esm.es5.development.js';
|
|
6
7
|
import 'react/jsx-runtime';
|
|
7
8
|
import 'react-dom';
|
|
8
9
|
|
|
9
|
-
var modules_63b47c51 = {"Table":"
|
|
10
|
+
var modules_63b47c51 = {"Table":"index_module_Table__6cae44c3","columnTootipClassName":"index_module_columnTootipClassName__6cae44c3"};
|
|
10
11
|
|
|
11
|
-
function _arrayLikeToArray$1(arr, len) {
|
|
12
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
13
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
14
|
-
return arr2;
|
|
15
|
-
}
|
|
16
|
-
function _arrayWithHoles$1(arr) {
|
|
17
|
-
if (Array.isArray(arr)) return arr;
|
|
18
|
-
}
|
|
19
|
-
function _defineProperty$1(obj, key, value) {
|
|
20
|
-
if (key in obj) {
|
|
21
|
-
Object.defineProperty(obj, key, {
|
|
22
|
-
value: value,
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
writable: true
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
obj[key] = value;
|
|
29
|
-
}
|
|
30
|
-
return obj;
|
|
31
|
-
}
|
|
32
|
-
function _iterableToArrayLimit$1(arr, i) {
|
|
33
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
34
|
-
if (_i == null) return;
|
|
35
|
-
var _arr = [];
|
|
36
|
-
var _n = true;
|
|
37
|
-
var _d = false;
|
|
38
|
-
var _s, _e;
|
|
39
|
-
try {
|
|
40
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
41
|
-
_arr.push(_s.value);
|
|
42
|
-
if (i && _arr.length === i) break;
|
|
43
|
-
}
|
|
44
|
-
} catch (err) {
|
|
45
|
-
_d = true;
|
|
46
|
-
_e = err;
|
|
47
|
-
} finally{
|
|
48
|
-
try {
|
|
49
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
50
|
-
} finally{
|
|
51
|
-
if (_d) throw _e;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return _arr;
|
|
55
|
-
}
|
|
56
|
-
function _nonIterableRest$1() {
|
|
57
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
-
}
|
|
59
|
-
function _objectSpread$1(target) {
|
|
60
|
-
for(var i = 1; i < arguments.length; i++){
|
|
61
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
62
|
-
var ownKeys = Object.keys(source);
|
|
63
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
64
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
65
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
ownKeys.forEach(function(key) {
|
|
69
|
-
_defineProperty$1(target, key, source[key]);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return target;
|
|
73
|
-
}
|
|
74
|
-
function ownKeys$1(object, enumerableOnly) {
|
|
75
|
-
var keys = Object.keys(object);
|
|
76
|
-
if (Object.getOwnPropertySymbols) {
|
|
77
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
78
|
-
if (enumerableOnly) {
|
|
79
|
-
symbols = symbols.filter(function(sym) {
|
|
80
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
keys.push.apply(keys, symbols);
|
|
84
|
-
}
|
|
85
|
-
return keys;
|
|
86
|
-
}
|
|
87
|
-
function _objectSpreadProps$1(target, source) {
|
|
88
|
-
source = source != null ? source : {};
|
|
89
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
90
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
91
|
-
} else {
|
|
92
|
-
ownKeys$1(Object(source)).forEach(function(key) {
|
|
93
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return target;
|
|
97
|
-
}
|
|
98
|
-
function _slicedToArray$1(arr, i) {
|
|
99
|
-
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
|
|
100
|
-
}
|
|
101
|
-
function _unsupportedIterableToArray$1(o, minLen) {
|
|
102
|
-
if (!o) return;
|
|
103
|
-
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
104
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
105
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
106
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
107
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
108
|
-
}
|
|
109
12
|
var getTextSize = function(str) {
|
|
110
13
|
var fontSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 14;
|
|
111
14
|
var result = 0;
|
|
@@ -122,7 +25,7 @@ var getTextSize = function(str) {
|
|
|
122
25
|
};
|
|
123
26
|
var TextTootip = function(props) {
|
|
124
27
|
var children = props.children, title = props.title, width = props.width;
|
|
125
|
-
var _useState = _slicedToArray
|
|
28
|
+
var _useState = _slicedToArray(useState(false), 2), open = _useState[0], setOpen = _useState[1];
|
|
126
29
|
var mouseEnter = function(e) {
|
|
127
30
|
var w = 0;
|
|
128
31
|
if (typeof width === "function") {
|
|
@@ -139,7 +42,7 @@ var TextTootip = function(props) {
|
|
|
139
42
|
var mouseLeave = function() {
|
|
140
43
|
setOpen(false);
|
|
141
44
|
};
|
|
142
|
-
return /*#__PURE__*/ jsx(Tooltip, _objectSpreadProps
|
|
45
|
+
return /*#__PURE__*/ jsx(Tooltip, _objectSpreadProps(_objectSpread({}, props), {
|
|
143
46
|
open: open,
|
|
144
47
|
children: /*#__PURE__*/ jsx("span", {
|
|
145
48
|
onMouseEnter: mouseEnter,
|
|
@@ -150,104 +53,6 @@ var TextTootip = function(props) {
|
|
|
150
53
|
};
|
|
151
54
|
var TextTootip$1 = TextTootip;
|
|
152
55
|
|
|
153
|
-
function _arrayLikeToArray(arr, len) {
|
|
154
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
155
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
156
|
-
return arr2;
|
|
157
|
-
}
|
|
158
|
-
function _arrayWithHoles(arr) {
|
|
159
|
-
if (Array.isArray(arr)) return arr;
|
|
160
|
-
}
|
|
161
|
-
function _defineProperty(obj, key, value) {
|
|
162
|
-
if (key in obj) {
|
|
163
|
-
Object.defineProperty(obj, key, {
|
|
164
|
-
value: value,
|
|
165
|
-
enumerable: true,
|
|
166
|
-
configurable: true,
|
|
167
|
-
writable: true
|
|
168
|
-
});
|
|
169
|
-
} else {
|
|
170
|
-
obj[key] = value;
|
|
171
|
-
}
|
|
172
|
-
return obj;
|
|
173
|
-
}
|
|
174
|
-
function _iterableToArrayLimit(arr, i) {
|
|
175
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
176
|
-
if (_i == null) return;
|
|
177
|
-
var _arr = [];
|
|
178
|
-
var _n = true;
|
|
179
|
-
var _d = false;
|
|
180
|
-
var _s, _e;
|
|
181
|
-
try {
|
|
182
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
183
|
-
_arr.push(_s.value);
|
|
184
|
-
if (i && _arr.length === i) break;
|
|
185
|
-
}
|
|
186
|
-
} catch (err) {
|
|
187
|
-
_d = true;
|
|
188
|
-
_e = err;
|
|
189
|
-
} finally{
|
|
190
|
-
try {
|
|
191
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
192
|
-
} finally{
|
|
193
|
-
if (_d) throw _e;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return _arr;
|
|
197
|
-
}
|
|
198
|
-
function _nonIterableRest() {
|
|
199
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
200
|
-
}
|
|
201
|
-
function _objectSpread(target) {
|
|
202
|
-
for(var i = 1; i < arguments.length; i++){
|
|
203
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
204
|
-
var ownKeys = Object.keys(source);
|
|
205
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
206
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
207
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
208
|
-
}));
|
|
209
|
-
}
|
|
210
|
-
ownKeys.forEach(function(key) {
|
|
211
|
-
_defineProperty(target, key, source[key]);
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
return target;
|
|
215
|
-
}
|
|
216
|
-
function ownKeys(object, enumerableOnly) {
|
|
217
|
-
var keys = Object.keys(object);
|
|
218
|
-
if (Object.getOwnPropertySymbols) {
|
|
219
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
220
|
-
if (enumerableOnly) {
|
|
221
|
-
symbols = symbols.filter(function(sym) {
|
|
222
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
keys.push.apply(keys, symbols);
|
|
226
|
-
}
|
|
227
|
-
return keys;
|
|
228
|
-
}
|
|
229
|
-
function _objectSpreadProps(target, source) {
|
|
230
|
-
source = source != null ? source : {};
|
|
231
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
232
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
233
|
-
} else {
|
|
234
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
235
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
return target;
|
|
239
|
-
}
|
|
240
|
-
function _slicedToArray(arr, i) {
|
|
241
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
242
|
-
}
|
|
243
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
244
|
-
if (!o) return;
|
|
245
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
246
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
247
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
248
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
249
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
250
|
-
}
|
|
251
56
|
var widthPercentage = /^\d+%$/;
|
|
252
57
|
var widthPx = /^\d+px$/;
|
|
253
58
|
/* 获取元素的宽度 */ var getElementPadding = function(node) {
|
|
@@ -282,16 +87,17 @@ var Table = function(props) {
|
|
|
282
87
|
180,
|
|
283
88
|
240,
|
|
284
89
|
320
|
|
285
|
-
] : _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;
|
|
286
91
|
var _useState = _slicedToArray(useState(props.columns || []), 2), columns = _useState[0], setColumns = _useState[1];
|
|
287
92
|
var _useState1 = _slicedToArray(useState(props.scroll || undefined), 2), scrollObject = _useState1[0], setScrollObject = _useState1[1];
|
|
288
93
|
var columnTootipClassName = props.columnTootipClassName, columnTootipColor = props.columnTootipColor;
|
|
289
94
|
var initColumns = function() {
|
|
290
|
-
var
|
|
95
|
+
var tableWidth = bordered ? tableRef.current.offsetWidth - 2 : tableRef.current.offsetWidth;
|
|
96
|
+
var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
|
|
291
97
|
setColumns(selfColumns);
|
|
292
98
|
var obj = scrollObject ? scrollObject : {};
|
|
293
99
|
obj = _objectSpreadProps(_objectSpread({}, obj), {
|
|
294
|
-
x:
|
|
100
|
+
x: tableWidth
|
|
295
101
|
});
|
|
296
102
|
setScrollObject(obj);
|
|
297
103
|
};
|
|
@@ -304,7 +110,7 @@ var Table = function(props) {
|
|
|
304
110
|
// item.width=parseFloat(item.width)
|
|
305
111
|
if (widthPercentage.test(item.width)) {
|
|
306
112
|
//检测到宽度为百分比 则转换为具体px 如大于100% 则视为自适应
|
|
307
|
-
item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * item.width;
|
|
113
|
+
item.width = parseFloat(item.width) >= 100 ? "auto" : tableWidth * parseFloat(item.width) / 100;
|
|
308
114
|
} else if (typeof item.width === "number") {
|
|
309
115
|
//检测为number 则为具体的像素值
|
|
310
116
|
item.width = item.width;
|
|
@@ -369,7 +175,6 @@ var Table = function(props) {
|
|
|
369
175
|
}
|
|
370
176
|
return item;
|
|
371
177
|
});
|
|
372
|
-
// console.log("diffdiff",diff,tableWidth,minWidth,avgWidth,columns,autoNum)
|
|
373
178
|
columns = columns.map(function(item, index) {
|
|
374
179
|
//存在适应自适应列侯 多余宽度 则平均分配每一列(除最后一列)
|
|
375
180
|
if (avgWidth > 0 && index !== columns.length - 1) {
|
|
@@ -410,7 +215,9 @@ var Table = function(props) {
|
|
|
410
215
|
}, obj.style)
|
|
411
216
|
});
|
|
412
217
|
};
|
|
413
|
-
|
|
218
|
+
// if(isNaN(item.width)){
|
|
219
|
+
// console.log("宽度宽度",item,item.width,item.widthRang)
|
|
220
|
+
// }
|
|
414
221
|
return item;
|
|
415
222
|
});
|
|
416
223
|
return {
|
|
@@ -448,7 +255,6 @@ var Table = function(props) {
|
|
|
448
255
|
children: /*#__PURE__*/ jsx(Table$1, _objectSpread({}, config))
|
|
449
256
|
});
|
|
450
257
|
};
|
|
451
|
-
// let BhdTable=Provider(Table)
|
|
452
258
|
Table.SELECTION_COLUMN = Table$1.SELECTION_COLUMN;
|
|
453
259
|
Table.EXPAND_COLUMN = Table$1.EXPAND_COLUMN;
|
|
454
260
|
Table.SELECTION_ALL = Table$1.SELECTION_ALL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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"core-js/modules/es.array.map.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.fixed.js";import{useState as
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@ant-design/icons';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ant-design/icons";
|
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';
|
|
@@ -68,6 +66,8 @@ export { default as QRCode } from 'antd/es/qrcode';
|
|
|
68
66
|
export { default as version } from 'antd/es/version';
|
|
69
67
|
export { default as Provider } from "./provider";
|
|
70
68
|
export { default as TextTootip } from "./textTootip";
|
|
71
|
-
export { default as zh_CN } from "antd/locale/
|
|
72
|
-
export { default as en_US } from "antd/locale/
|
|
69
|
+
export { default as zh_CN } from "antd/locale/zh_CN";
|
|
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";
|
|
@@ -70,6 +68,8 @@ export { default as QRCode } from "antd/es/qrcode";
|
|
|
70
68
|
export { default as version } from "antd/es/version";
|
|
71
69
|
/* 自定义修改 */ export { default as Provider } from "./provider/index";
|
|
72
70
|
export { default as TextTootip } from "./textTootip/index";
|
|
73
|
-
export { default as zh_CN } from "antd/locale/
|
|
74
|
-
export { default as en_US } from "antd/locale/
|
|
71
|
+
export { default as zh_CN } from "antd/locale/zh_CN";
|
|
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;
|