bhd-components 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/dist/table.esm.es5.development.css +89 -33
- package/dist/table.esm.es5.development.js +8 -4
- package/dist/table.esm.es5.production.css +1 -1
- package/dist/table.esm.es5.production.js +1 -1
- package/es2017/index.d.ts +70 -66
- package/es2017/index.js +7 -0
- package/es2017/table/index.js +6 -3
- package/es2017/table/index.module.less +79 -1
- package/es2017/tableSelect/index.d.ts +3 -0
- package/es2017/tableSelect/index.js +74 -0
- package/es2017/tableSelect/index.module.less +21 -0
- package/es2017/theme/variable.less +625 -0
- package/es2017/titleBar/index.d.ts +11 -0
- package/es2017/titleBar/index.js +51 -0
- package/es2017/titleBar/index.module.less +44 -0
- package/es2017/viewImage/index.d.ts +3 -0
- package/es2017/viewImage/index.js +180 -0
- package/es2017/viewImage/index.module.less +170 -0
- package/esm/index.d.ts +70 -66
- package/esm/index.js +7 -0
- package/esm/table/index.js +6 -3
- package/esm/table/index.module.less +79 -1
- package/esm/tableSelect/index.d.ts +3 -0
- package/esm/tableSelect/index.js +74 -0
- package/esm/tableSelect/index.module.less +21 -0
- package/esm/theme/variable.less +625 -0
- package/esm/titleBar/index.d.ts +11 -0
- package/esm/titleBar/index.js +51 -0
- package/esm/titleBar/index.module.less +44 -0
- package/esm/viewImage/index.d.ts +3 -0
- package/esm/viewImage/index.js +185 -0
- package/esm/viewImage/index.module.less +170 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -21,14 +21,4 @@ import BhdComponents from 'bhd-components';
|
|
|
21
21
|
- **文档插件:** https://docusaurus.io/docs/api/plugin-methods
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
待研究事宜:
|
|
25
|
-
1.文档语法熟悉 初步熟悉
|
|
26
|
-
2.antd组件的样式污染问题
|
|
27
|
-
1.通过provider 配置专属主题
|
|
28
|
-
3.中英文等全局配置问题
|
|
29
|
-
1.通过provider 配置专属主题
|
|
30
|
-
4.构建版本时 支持umd
|
|
31
|
-
5.构建版本后 按需加载问题
|
|
32
|
-
6.构建es6的包时,less需转成css
|
|
33
|
-
|
|
34
24
|
https://pkg.ice.work/guide/preview#%E6%96%87%E6%A1%A3%E7%BB%93%E6%9E%84
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
.
|
|
1
|
+
.index_module_Table__5278674b {
|
|
2
2
|
width: 100%;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.index_module_Table__5278674b {
|
|
5
5
|
/* 多选框间距问题 */
|
|
6
6
|
/* 分页器 */
|
|
7
7
|
}
|
|
8
|
-
.
|
|
9
|
-
.
|
|
8
|
+
.index_module_Table__5278674b table th,
|
|
9
|
+
.index_module_Table__5278674b table td {
|
|
10
10
|
border: none;
|
|
11
11
|
border-bottom: 1px solid #e8e8e8;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.index_module_Table__5278674b table > .bhd-table-thead > tr > .bhd-table-cell {
|
|
14
14
|
font-weight: 400;
|
|
15
15
|
font-size: 16px;
|
|
16
16
|
color: rgba(0, 0, 0, 0.85);
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
background: #fafafa;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.index_module_Table__5278674b table > .bhd-table-thead > tr > .bhd-table-cell:nth-child(1) {
|
|
21
21
|
padding-left: 40px;
|
|
22
22
|
}
|
|
23
|
-
.
|
|
23
|
+
.index_module_Table__5278674b table > .bhd-table-thead > tr > .bhd-table-cell:last-child {
|
|
24
24
|
padding-right: 40px;
|
|
25
25
|
}
|
|
26
|
-
.
|
|
26
|
+
.index_module_Table__5278674b table > .bhd-table-thead > tr > .bhd-table-cell::before {
|
|
27
27
|
display: none;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
.index_module_Table__5278674b table tbody tr.bhd-table-placeholder:hover td {
|
|
30
30
|
background-color: #ffffff;
|
|
31
31
|
}
|
|
32
|
-
.
|
|
32
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) {
|
|
33
33
|
background: transparent;
|
|
34
34
|
}
|
|
35
|
-
.
|
|
35
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder):hover td {
|
|
36
36
|
background-color: #ffeeeb !important;
|
|
37
37
|
}
|
|
38
|
-
.
|
|
38
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td {
|
|
39
39
|
word-wrap: break-word;
|
|
40
40
|
word-break: break-all;
|
|
41
41
|
overflow: hidden;
|
|
@@ -43,68 +43,124 @@
|
|
|
43
43
|
text-overflow: ellipsis;
|
|
44
44
|
/* 多选框 距右的距离 */
|
|
45
45
|
}
|
|
46
|
-
.
|
|
46
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td:nth-child(1) {
|
|
47
47
|
padding-left: 40px;
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td:last-child {
|
|
50
50
|
padding-right: 40px;
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column {
|
|
53
53
|
-webkit-padding-end: 16px;
|
|
54
54
|
padding-inline-end: 16px;
|
|
55
55
|
}
|
|
56
|
-
.
|
|
56
|
+
.index_module_Table__5278674b .bhd-table-wrapper {
|
|
57
57
|
/* check 选中变色 */
|
|
58
58
|
/* scroll 固定列 设置overflow:hidden 阴影消失问题 */
|
|
59
59
|
}
|
|
60
|
-
.
|
|
60
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-selection-col {
|
|
61
61
|
width: 72px !important;
|
|
62
62
|
}
|
|
63
|
-
.
|
|
63
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-tbody > tr.bhd-table-row-selected > td {
|
|
64
64
|
background: #ffffff;
|
|
65
65
|
}
|
|
66
|
-
.
|
|
67
|
-
.
|
|
66
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-left-first::after,
|
|
67
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-left-last::after {
|
|
68
68
|
right: 2px;
|
|
69
69
|
}
|
|
70
|
-
.
|
|
71
|
-
.
|
|
70
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-right-first::after,
|
|
71
|
+
.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-right-last::after {
|
|
72
72
|
left: 2px;
|
|
73
73
|
}
|
|
74
|
-
.
|
|
74
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item {
|
|
75
75
|
border-color: transparent;
|
|
76
76
|
}
|
|
77
|
-
.
|
|
77
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-link {
|
|
78
78
|
border: none !important;
|
|
79
79
|
background: none !important;
|
|
80
80
|
}
|
|
81
|
-
.
|
|
81
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active {
|
|
82
82
|
background-color: #f4523b;
|
|
83
83
|
}
|
|
84
|
-
.
|
|
84
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active:hover {
|
|
85
85
|
background-color: #ff7d66;
|
|
86
86
|
}
|
|
87
|
-
.
|
|
87
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active:hover > a {
|
|
88
88
|
color: #ffffff;
|
|
89
89
|
}
|
|
90
|
-
.
|
|
90
|
+
.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active > a {
|
|
91
91
|
color: #ffffff;
|
|
92
92
|
}
|
|
93
|
-
.
|
|
93
|
+
.index_module_Table__5278674b .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item {
|
|
94
94
|
border: none !important;
|
|
95
95
|
background: none !important;
|
|
96
96
|
color: rgba(0, 0, 0, 0.25) !important;
|
|
97
97
|
}
|
|
98
|
-
.
|
|
98
|
+
.index_module_Table__5278674b .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item a {
|
|
99
99
|
color: rgba(0, 0, 0, 0.25) !important;
|
|
100
100
|
}
|
|
101
|
-
.
|
|
101
|
+
.index_module_Table__5278674b .bhd-pagination.bhd-pagination-mini .bhd-pagination-item {
|
|
102
102
|
margin-right: 8px !important;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.index_module_Table__5278674b .bhd-pagination.bhd-pagination-mini .bhd-pagination-item:not(.bhd-pagination-item-active):hover {
|
|
105
105
|
background-color: transparent !important;
|
|
106
106
|
}
|
|
107
|
-
.
|
|
107
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table th,
|
|
108
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table td {
|
|
109
|
+
border: none;
|
|
110
|
+
border-bottom: 1px solid #EBEBEB;
|
|
111
|
+
}
|
|
112
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table > .bhd-table-thead > tr > .bhd-table-cell {
|
|
113
|
+
font-weight: 500;
|
|
114
|
+
font-size: 16px;
|
|
115
|
+
color: rgba(0, 0, 0, 0.85);
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
padding-top: 8px;
|
|
118
|
+
padding-bottom: 8px;
|
|
119
|
+
background-color: #fafafa;
|
|
120
|
+
}
|
|
121
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table > .bhd-table-thead > tr > .bhd-table-cell:nth-child(1) {
|
|
122
|
+
padding-left: 40px;
|
|
123
|
+
}
|
|
124
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table > .bhd-table-thead > tr > .bhd-table-cell:last-child {
|
|
125
|
+
padding-right: 40px;
|
|
126
|
+
}
|
|
127
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table > .bhd-table-thead > tr > .bhd-table-cell::before {
|
|
128
|
+
display: none;
|
|
129
|
+
}
|
|
130
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table > .bhd-table-thead > tr > .bhd-table-cell.bhd-table-selection-column {
|
|
131
|
+
-webkit-padding-end: 16px;
|
|
132
|
+
padding-inline-end: 16px;
|
|
133
|
+
}
|
|
134
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr.bhd-table-placeholder:hover td {
|
|
135
|
+
background-color: #ffffff;
|
|
136
|
+
}
|
|
137
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) {
|
|
138
|
+
background: transparent;
|
|
139
|
+
}
|
|
140
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder):hover td {
|
|
141
|
+
background-color: #F5F5F5 !important;
|
|
142
|
+
}
|
|
143
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td {
|
|
144
|
+
word-wrap: break-word;
|
|
145
|
+
word-break: break-all;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
padding-top: 13.5px;
|
|
150
|
+
padding-bottom: 13.5px;
|
|
151
|
+
/* 多选框 距右的距离 */
|
|
152
|
+
}
|
|
153
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td:nth-child(1) {
|
|
154
|
+
padding-left: 40px;
|
|
155
|
+
}
|
|
156
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td:last-child {
|
|
157
|
+
padding-right: 40px;
|
|
158
|
+
}
|
|
159
|
+
.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column {
|
|
160
|
+
-webkit-padding-end: 16px;
|
|
161
|
+
padding-inline-end: 16px;
|
|
162
|
+
}
|
|
163
|
+
.index_module_columnTootipClassName__5278674b .bhd-tooltip-content .bhd-tooltip-inner {
|
|
108
164
|
color: rgba(0, 0, 0, 0.85);
|
|
109
165
|
word-break: break-all;
|
|
110
166
|
}
|
|
@@ -3,11 +3,12 @@ import 'core-js/modules/es.array.map.js';
|
|
|
3
3
|
import 'core-js/modules/es.regexp.test.js';
|
|
4
4
|
import 'core-js/modules/es.regexp.exec.js';
|
|
5
5
|
import 'core-js/modules/es.string.fixed.js';
|
|
6
|
+
import 'core-js/modules/es.array.concat.js';
|
|
6
7
|
import { useState, useRef, useEffect } from 'react';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
9
|
import 'react-dom';
|
|
9
10
|
|
|
10
|
-
var modules_63b47c51 = {"Table":"
|
|
11
|
+
var modules_63b47c51 = {"Table":"index_module_Table__5278674b","SmallTable":"index_module_SmallTable__5278674b","columnTootipClassName":"index_module_columnTootipClassName__5278674b"};
|
|
11
12
|
|
|
12
13
|
var getTextSize = function(str) {
|
|
13
14
|
var fontSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 14;
|
|
@@ -87,12 +88,15 @@ var Table = function(props) {
|
|
|
87
88
|
180,
|
|
88
89
|
240,
|
|
89
90
|
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, _props_bordered = props.bordered, bordered = _props_bordered === void 0 ? false : _props_bordered;
|
|
91
|
+
] : _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, kind = props.kind;
|
|
91
92
|
var _useState = _slicedToArray(useState(props.columns || []), 2), columns = _useState[0], setColumns = _useState[1];
|
|
92
93
|
var _useState1 = _slicedToArray(useState(props.scroll || undefined), 2), scrollObject = _useState1[0], setScrollObject = _useState1[1];
|
|
93
94
|
var columnTootipClassName = props.columnTootipClassName, columnTootipColor = props.columnTootipColor;
|
|
94
95
|
var initColumns = function() {
|
|
95
|
-
var
|
|
96
|
+
var scrollBarDom = tableRef.current.getElementsByClassName("bhd-table-cell-scrollbar")[0];
|
|
97
|
+
var scrollBarWidth = scrollBarDom ? scrollBarDom.clientWidth : 0;
|
|
98
|
+
var tableWidth = bordered ? tableRef.current.offsetWidth - 2 - scrollBarWidth : tableRef.current.offsetWidth - scrollBarWidth;
|
|
99
|
+
console.log("gaodug", scrollBarWidth);
|
|
96
100
|
var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
|
|
97
101
|
setColumns(selfColumns);
|
|
98
102
|
var obj = scrollObject ? scrollObject : {};
|
|
@@ -250,7 +254,7 @@ var Table = function(props) {
|
|
|
250
254
|
}
|
|
251
255
|
});
|
|
252
256
|
return /*#__PURE__*/ jsx("div", {
|
|
253
|
-
className: modules_63b47c51.Table,
|
|
257
|
+
className: "".concat(modules_63b47c51.Table, " ").concat(kind === "simple" ? modules_63b47c51.SmallTable : ""),
|
|
254
258
|
ref: tableRef,
|
|
255
259
|
children: /*#__PURE__*/ jsx(Table$1, _objectSpread({}, config))
|
|
256
260
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.index_module_Table__5278674b{width:100%}.index_module_Table__5278674b table td,.index_module_Table__5278674b table th{border:none;border-bottom:1px solid #e8e8e8}.index_module_Table__5278674b 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__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:first-child{padding-left:40px}.index_module_Table__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:last-child{padding-right:40px}.index_module_Table__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:before{display:none}.index_module_Table__5278674b table tbody tr.bhd-table-placeholder:hover td{background-color:#fff}.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder){background:transparent}.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder):hover td{background-color:#ffeeeb!important}.index_module_Table__5278674b 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__5278674b table tbody tr:not(.bhd-table-placeholder) td:first-child{padding-left:40px}.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td:last-child{padding-right:40px}.index_module_Table__5278674b table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column{-webkit-padding-end:16px;padding-inline-end:16px}.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-selection-col{width:72px!important}.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-tbody>tr.bhd-table-row-selected>td{background:#fff}.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-left-first:after,.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-left-last:after{right:2px}.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-right-first:after,.index_module_Table__5278674b .bhd-table-wrapper .bhd-table-cell-fix-right-last:after{left:2px}.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item{border-color:transparent}.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-link{background:none!important;border:none!important}.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active{background-color:#f4523b}.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active:hover{background-color:#ff7d66}.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active:hover>a,.index_module_Table__5278674b .bhd-pagination .bhd-pagination-item-active>a{color:#fff}.index_module_Table__5278674b .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item{background:none!important;border:none!important;color:rgba(0,0,0,.25)!important}.index_module_Table__5278674b .bhd-pagination.bhd-pagination-disabled .bhd-pagination-item a{color:rgba(0,0,0,.25)!important}.index_module_Table__5278674b .bhd-pagination.bhd-pagination-mini .bhd-pagination-item{margin-right:8px!important}.index_module_Table__5278674b .bhd-pagination.bhd-pagination-mini .bhd-pagination-item:not(.bhd-pagination-item-active):hover{background-color:transparent!important}.index_module_Table__5278674b.index_module_SmallTable__5278674b table td,.index_module_Table__5278674b.index_module_SmallTable__5278674b table th{border:none;border-bottom:1px solid #ebebeb}.index_module_Table__5278674b.index_module_SmallTable__5278674b table>.bhd-table-thead>tr>.bhd-table-cell{background-color:#fafafa;color:rgba(0,0,0,.85);font-size:16px;font-weight:500;padding-bottom:8px;padding-top:8px;white-space:nowrap}.index_module_Table__5278674b.index_module_SmallTable__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:first-child{padding-left:40px}.index_module_Table__5278674b.index_module_SmallTable__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:last-child{padding-right:40px}.index_module_Table__5278674b.index_module_SmallTable__5278674b table>.bhd-table-thead>tr>.bhd-table-cell:before{display:none}.index_module_Table__5278674b.index_module_SmallTable__5278674b table>.bhd-table-thead>tr>.bhd-table-cell.bhd-table-selection-column{-webkit-padding-end:16px;padding-inline-end:16px}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr.bhd-table-placeholder:hover td{background-color:#fff}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder){background:transparent}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder):hover td{background-color:#f5f5f5!important}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td{word-wrap:break-word;overflow:hidden;padding-bottom:13.5px;padding-top:13.5px;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td:first-child{padding-left:40px}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td:last-child{padding-right:40px}.index_module_Table__5278674b.index_module_SmallTable__5278674b table tbody tr:not(.bhd-table-placeholder) td.bhd-table-selection-column{-webkit-padding-end:16px;padding-inline-end:16px}.index_module_columnTootipClassName__5278674b .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
|
|
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"core-js/modules/es.array.concat.js";import{useState as l,useRef as a,useEffect as d}from"react";import"react/jsx-runtime";import"react-dom";var u={Table:"index_module_Table__5278674b",SmallTable:"index_module_SmallTable__5278674b",columnTootipClassName:"index_module_columnTootipClassName__5278674b"},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 a=r.children,d=r.title,u=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 u?u(t):u)?h(!(s(d)<e)):h(!0)},onMouseLeave:function(){h(!1)},children:a})}))},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=a(null),p=a({timer:null}),f=i.defaultWidthRang,C=void 0===f?[180,240,320]:f,g=i.isFixedLeft,v=void 0===g||g,T=i.isFixedRight,E=void 0===T||T,N=i.bordered,y=void 0!==N&&N,_=i.kind,b=t(l(i.columns||[]),2),x=b[0],L=b[1],S=t(l(i.scroll||void 0),2),R=S[0],O=S[1],j=i.columnTootipClassName,F=i.columnTootipColor,I=function(){var t=s.current.getElementsByClassName("bhd-table-cell-scrollbar")[0],e=t?t.clientWidth:0,r=y?s.current.offsetWidth-2-e:s.current.offsetWidth-e;console.log("gaodug",e);var l=W(i.columns,r).columns;L(l);var a=R||{};a=n(o({},a),{x:r}),O(a)},W=function(t,i){var r=0,l=0,a=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],a+=t.widthRang[1]):(l+=t.width,a+=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:j||u.columnTootipClassName,color:F||"#FFF",children:e("span",{children:t})})}),t});var d=i-l;if(d>0){var s=0;t=(t=t.map(function(t){return"auto"===t.width&&(t.width=t.widthRang[0]+d/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=d<0?t.map(function(e,n){return v&&0===n&&(e.fixed="left"),E&&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:a}},M=function(){clearTimeout(p.current.timer),p.current.timer=setTimeout(function(){I()},1e3)};d(function(){return I(),window.addEventListener("resize",M),function(){clearTimeout(p.current.timer),window.removeEventListener("resize",M)}},[i.columns]);var A=n(o({bordered:!1},i),{columns:x,scroll:R||{x:"auto"}});return e("div",{className:"".concat(u.Table," ").concat("simple"===_?u.SmallTable:""),ref:s,children:e(r,o({},A))})};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
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
11
|
-
export { default as
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
14
|
-
export { default as
|
|
15
|
-
export { default as
|
|
16
|
-
export { default as
|
|
17
|
-
export { default as
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as
|
|
31
|
-
export { default as
|
|
32
|
-
export { default as
|
|
33
|
-
export { default as
|
|
34
|
-
export { default as
|
|
35
|
-
export { default as
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as
|
|
39
|
-
export { default as
|
|
40
|
-
export { default as
|
|
41
|
-
export { default as
|
|
42
|
-
export { default as
|
|
43
|
-
export { default as
|
|
44
|
-
export { default as
|
|
45
|
-
export { default as
|
|
46
|
-
export { default as
|
|
47
|
-
export { default as
|
|
48
|
-
export { default as
|
|
49
|
-
export { default as
|
|
50
|
-
export { default as
|
|
51
|
-
export { default as
|
|
52
|
-
export { default as
|
|
53
|
-
export { default as
|
|
54
|
-
export { default as
|
|
55
|
-
export { default as
|
|
56
|
-
export { default as
|
|
57
|
-
export { default as
|
|
58
|
-
export { default as
|
|
59
|
-
export { default as
|
|
60
|
-
export { default as
|
|
61
|
-
export { default as
|
|
62
|
-
export { default as
|
|
63
|
-
export { default as
|
|
64
|
-
export { default as
|
|
65
|
-
export { default as
|
|
66
|
-
export { default as
|
|
1
|
+
import "./theme/variable.less";
|
|
2
|
+
export { default as Affix } from "antd/es/affix";
|
|
3
|
+
export { default as Alert } from "antd/es/alert";
|
|
4
|
+
export { default as Anchor } from "antd/es/anchor";
|
|
5
|
+
export { default as AutoComplete } from "antd/es/auto-complete";
|
|
6
|
+
export { default as Avatar } from "antd/es/avatar";
|
|
7
|
+
export { default as FloatButton } from "antd/es/float-button";
|
|
8
|
+
export { default as BackTop } from "antd/es/back-top";
|
|
9
|
+
export { default as Badge } from "antd/es/badge";
|
|
10
|
+
export { default as Breadcrumb } from "antd/es/breadcrumb";
|
|
11
|
+
export { default as Button } from "antd/es/button";
|
|
12
|
+
export { default as Calendar } from "antd/es/calendar";
|
|
13
|
+
export { default as Card } from "antd/es/card";
|
|
14
|
+
export { default as Carousel } from "antd/es/carousel";
|
|
15
|
+
export { default as Cascader } from "antd/es/cascader";
|
|
16
|
+
export { default as Checkbox } from "antd/es/checkbox";
|
|
17
|
+
export { default as Col } from "antd/es/col";
|
|
18
|
+
export { default as Collapse } from "antd/es/collapse";
|
|
19
|
+
export { default as DatePicker } from "antd/es/date-picker";
|
|
20
|
+
export { default as Descriptions } from "antd/es/descriptions";
|
|
21
|
+
export { default as Divider } from "antd/es/divider";
|
|
22
|
+
export { default as Drawer } from "antd/es/drawer";
|
|
23
|
+
export { default as Dropdown } from "antd/es/dropdown";
|
|
24
|
+
export { default as Empty } from "antd/es/empty";
|
|
25
|
+
export { default as Form } from "antd/es/form";
|
|
26
|
+
export { default as Grid } from "antd/es/grid";
|
|
27
|
+
export { default as Image } from "antd/es/image";
|
|
28
|
+
export { default as Input } from "antd/es/input";
|
|
29
|
+
export { default as InputNumber } from "antd/es/input-number";
|
|
30
|
+
export { default as Layout } from "antd/es/layout";
|
|
31
|
+
export { default as List } from "antd/es/list";
|
|
32
|
+
export { default as Mentions } from "antd/es/mentions";
|
|
33
|
+
export { default as Menu } from "antd/es/menu";
|
|
34
|
+
export { default as Modal } from "antd/es/modal";
|
|
35
|
+
export { default as notification } from "antd/es/notification";
|
|
36
|
+
export { default as Popconfirm } from "antd/es/popconfirm";
|
|
37
|
+
export { default as Popover } from "antd/es/popover";
|
|
38
|
+
export { default as Progress } from "antd/es/progress";
|
|
39
|
+
export { default as Radio } from "antd/es/radio";
|
|
40
|
+
export { default as Rate } from "antd/es/rate";
|
|
41
|
+
export { default as Result } from "antd/es/result";
|
|
42
|
+
export { default as Row } from "antd/es/row";
|
|
43
|
+
export { default as Segmented } from "antd/es/segmented";
|
|
44
|
+
export { default as Select } from "antd/es/select";
|
|
45
|
+
export { default as Skeleton } from "antd/es/skeleton";
|
|
46
|
+
export { default as Slider } from "antd/es/slider";
|
|
47
|
+
export { default as Space } from "antd/es/space";
|
|
48
|
+
export { default as Spin } from "antd/es/spin";
|
|
49
|
+
export { default as Statistic } from "antd/es/statistic";
|
|
50
|
+
export { default as Steps } from "antd/es/steps";
|
|
51
|
+
export { default as Switch } from "antd/es/switch";
|
|
52
|
+
export { default as Tabs } from "antd/es/tabs";
|
|
53
|
+
export { default as Tag } from "antd/es/tag";
|
|
54
|
+
export { default as theme } from "antd/es/theme";
|
|
55
|
+
export { default as TimePicker } from "antd/es/time-picker";
|
|
56
|
+
export { default as Timeline } from "antd/es/timeline";
|
|
57
|
+
export { default as Tooltip } from "antd/es/tooltip";
|
|
58
|
+
export { default as Tour } from "antd/es/tour";
|
|
59
|
+
export { default as App } from "antd/es/app";
|
|
60
|
+
export { default as Transfer } from "antd/es/transfer";
|
|
61
|
+
export { default as Tree } from "antd/es/tree";
|
|
62
|
+
export { default as TreeSelect } from "antd/es/tree-select";
|
|
63
|
+
export { default as Typography } from "antd/es/typography";
|
|
64
|
+
export { default as Upload } from "antd/es/upload";
|
|
65
|
+
export { default as Watermark } from "antd/es/watermark";
|
|
66
|
+
export { default as QRCode } from "antd/es/qrcode";
|
|
67
|
+
export { default as version } from "antd/es/version";
|
|
67
68
|
export { default as Provider } from "./provider";
|
|
68
69
|
export { default as TextTootip } from "./textTootip";
|
|
69
70
|
export { default as zh_CN } from "antd/locale/zh_CN";
|
|
@@ -71,3 +72,6 @@ export { default as en_US } from "antd/locale/en_US";
|
|
|
71
72
|
export { default as Table } from "./table";
|
|
72
73
|
export { default as message } from './message';
|
|
73
74
|
export { default as Pagination } from './pagination';
|
|
75
|
+
export { default as BhdTableSelect } from './tableSelect';
|
|
76
|
+
export { default as TitleBar } from "./titleBar";
|
|
77
|
+
export { default as ViewImage } from "./viewImage";
|
package/es2017/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: xiazhi
|
|
3
|
+
* @Date: 2023-06-05 16:43:26
|
|
4
|
+
*/ /* 样式变量 */ import "./theme/variable.less";
|
|
1
5
|
/* antd 默认组件 */ export { default as Affix } from "antd/es/affix";
|
|
2
6
|
export { default as Alert } from "antd/es/alert";
|
|
3
7
|
export { default as Anchor } from "antd/es/anchor";
|
|
@@ -73,3 +77,6 @@ export { default as en_US } from "antd/locale/en_US";
|
|
|
73
77
|
export { default as Table } from "./table/index"; //改写table逻辑
|
|
74
78
|
export { default as message } from "./message/index"; //封装message
|
|
75
79
|
export { default as Pagination } from "./pagination/index"; //封装Pagination
|
|
80
|
+
export { default as BhdTableSelect } from "./tableSelect/index"; //封装 Table Head Select
|
|
81
|
+
export { default as TitleBar } from "./titleBar/index"; //标题栏
|
|
82
|
+
export { default as ViewImage } from "./viewImage/index"; //查看大图
|
package/es2017/table/index.js
CHANGED
|
@@ -35,12 +35,15 @@ const Table = (props)=>{
|
|
|
35
35
|
180,
|
|
36
36
|
240,
|
|
37
37
|
320
|
|
38
|
-
] , isFixedLeft =true , isFixedRight =true , bordered =false } = props;
|
|
38
|
+
] , isFixedLeft =true , isFixedRight =true , bordered =false , kind } = 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
|
-
|
|
43
|
+
let scrollBarDom = tableRef.current.getElementsByClassName("bhd-table-cell-scrollbar")[0];
|
|
44
|
+
const scrollBarWidth = scrollBarDom ? scrollBarDom.clientWidth : 0;
|
|
45
|
+
const tableWidth = bordered ? tableRef.current.offsetWidth - 2 - scrollBarWidth : tableRef.current.offsetWidth - scrollBarWidth;
|
|
46
|
+
console.log("gaodug", scrollBarWidth);
|
|
44
47
|
let { columns: selfColumns } = initColumnsWidth(props.columns, tableWidth);
|
|
45
48
|
setColumns(selfColumns);
|
|
46
49
|
let obj = scrollObject ? scrollObject : {};
|
|
@@ -172,7 +175,7 @@ const Table = (props)=>{
|
|
|
172
175
|
}
|
|
173
176
|
});
|
|
174
177
|
return /*#__PURE__*/ _jsx("div", {
|
|
175
|
-
className: styles.Table
|
|
178
|
+
className: `${styles.Table} ${kind === "simple" ? styles.SmallTable : ''}`,
|
|
176
179
|
ref: tableRef,
|
|
177
180
|
children: /*#__PURE__*/ _jsx(AntdTable, _object_spread({}, config))
|
|
178
181
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
// @import url("../theme/variable.less");
|
|
2
|
+
|
|
1
3
|
.Table {
|
|
2
4
|
width: 100%;
|
|
5
|
+
// color:@customColor;
|
|
3
6
|
:global {
|
|
4
7
|
table {
|
|
5
8
|
th,
|
|
@@ -14,13 +17,13 @@
|
|
|
14
17
|
font-size: 16px;
|
|
15
18
|
color: rgba(0, 0, 0, 0.85);
|
|
16
19
|
white-space: nowrap;
|
|
20
|
+
background: #fafafa;
|
|
17
21
|
&:nth-child(1) {
|
|
18
22
|
padding-left: 40px;
|
|
19
23
|
}
|
|
20
24
|
&:last-child {
|
|
21
25
|
padding-right: 40px;
|
|
22
26
|
}
|
|
23
|
-
background: #fafafa;
|
|
24
27
|
&::before {
|
|
25
28
|
display: none;
|
|
26
29
|
}
|
|
@@ -126,6 +129,81 @@
|
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
131
|
}
|
|
132
|
+
|
|
133
|
+
&.SmallTable{
|
|
134
|
+
:global{
|
|
135
|
+
table {
|
|
136
|
+
th,
|
|
137
|
+
td {
|
|
138
|
+
border: none;
|
|
139
|
+
border-bottom: 1px solid #EBEBEB;
|
|
140
|
+
}
|
|
141
|
+
& > .bhd-table-thead {
|
|
142
|
+
& > tr {
|
|
143
|
+
& > .bhd-table-cell {
|
|
144
|
+
font-weight: 500;
|
|
145
|
+
font-size: 16px;
|
|
146
|
+
color: rgba(0, 0, 0, 0.85);
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
padding-top: 8px;
|
|
149
|
+
padding-bottom: 8px;
|
|
150
|
+
background-color: #fafafa;
|
|
151
|
+
&:nth-child(1) {
|
|
152
|
+
padding-left: 40px;
|
|
153
|
+
}
|
|
154
|
+
&:last-child {
|
|
155
|
+
padding-right: 40px;
|
|
156
|
+
}
|
|
157
|
+
// background: @color-background-fillquaternary-Tr;
|
|
158
|
+
&::before {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
&.bhd-table-selection-column {
|
|
162
|
+
padding-inline-end: 16px;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
tbody {
|
|
168
|
+
tr.bhd-table-placeholder {
|
|
169
|
+
&:hover {
|
|
170
|
+
td {
|
|
171
|
+
background-color: #ffffff;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
tr:not(.bhd-table-placeholder) {
|
|
176
|
+
background: transparent;
|
|
177
|
+
&:hover {
|
|
178
|
+
td {
|
|
179
|
+
background-color: #F5F5F5 !important;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
td {
|
|
183
|
+
word-wrap: break-word;
|
|
184
|
+
word-break: break-all;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
text-overflow: ellipsis;
|
|
188
|
+
padding-top: 13.5px;
|
|
189
|
+
padding-bottom: 13.5px;
|
|
190
|
+
&:nth-child(1) {
|
|
191
|
+
padding-left: 40px;
|
|
192
|
+
}
|
|
193
|
+
&:last-child {
|
|
194
|
+
padding-right: 40px;
|
|
195
|
+
}
|
|
196
|
+
/* 多选框 距右的距离 */
|
|
197
|
+
&.bhd-table-selection-column {
|
|
198
|
+
padding-inline-end: 16px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
}
|
|
129
207
|
}
|
|
130
208
|
|
|
131
209
|
.columnTootipClassName {
|