bhd-components 0.7.38 → 0.7.40
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 +1 -1
- package/dist/{78b8007b.esm.es5.development.js → 47cd911e.esm.es5.development.js} +1 -1
- package/dist/{1a5da86d.esm.es5.production.js → bf4a8574.esm.es5.production.js} +1 -1
- package/dist/index.esm.es5.development.js +10 -5
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/bhdAppLayout/index.js +1 -1
- package/es2017/table/index.js +10 -5
- package/esm/bhdAppLayout/index.js +1 -1
- package/esm/table/index.js +5 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
import { useState, useLayoutEffect, useRef } from "react";
|
|
6
6
|
import styles from "./index.module.less";
|
|
7
7
|
import TitleBar from "../titleBar";
|
|
8
|
-
import
|
|
8
|
+
import Pagination from "../pagination/index";
|
|
9
9
|
import i18Conversion from "../i18n";
|
|
10
10
|
import BhdTableSimple from "./components/BhdTableSimple/index";
|
|
11
11
|
function BhdAppLayout(props) {
|
package/es2017/table/index.js
CHANGED
|
@@ -34,13 +34,13 @@ const getParentWidth = (node)=>{
|
|
|
34
34
|
/* 记录的滚动条宽度 */ let recordScrollBarWidth = 0;
|
|
35
35
|
function getScrollbarWidth() {
|
|
36
36
|
// Creating invisible container
|
|
37
|
-
const outer = document.createElement(
|
|
38
|
-
outer.style.visibility =
|
|
39
|
-
outer.style.overflow =
|
|
37
|
+
const outer = document.createElement("div");
|
|
38
|
+
outer.style.visibility = "hidden";
|
|
39
|
+
outer.style.overflow = "scroll"; // forcing scrollbar to appear
|
|
40
40
|
// outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps
|
|
41
41
|
document.body.appendChild(outer);
|
|
42
42
|
// Creating inner element and placing it in the container
|
|
43
|
-
const inner = document.createElement(
|
|
43
|
+
const inner = document.createElement("div");
|
|
44
44
|
outer.appendChild(inner);
|
|
45
45
|
// Calculating difference between container's full width and the child width
|
|
46
46
|
const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
|
|
@@ -67,7 +67,12 @@ const Table = (props)=>{
|
|
|
67
67
|
// )[0];
|
|
68
68
|
const scrollBarWidth = getScrollbarWidth();
|
|
69
69
|
recordScrollBarWidth = scrollBarWidth || recordScrollBarWidth;
|
|
70
|
-
|
|
70
|
+
let tableWidth = bordered ? tableRef.current.offsetWidth - 2 - recordScrollBarWidth : tableRef.current.offsetWidth - recordScrollBarWidth;
|
|
71
|
+
if (props.rowSelection) {
|
|
72
|
+
//多选框
|
|
73
|
+
let selectWidth = kind === "simple" ? 40 : 72;
|
|
74
|
+
tableWidth -= selectWidth;
|
|
75
|
+
}
|
|
71
76
|
let { columns: selfColumns } = initColumnsWidth(props.columns, tableWidth);
|
|
72
77
|
setColumns(selfColumns);
|
|
73
78
|
let obj = scrollObject ? scrollObject : {};
|
|
@@ -6,7 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import { useState, useLayoutEffect, useRef } from "react";
|
|
7
7
|
import styles from "./index.module.less";
|
|
8
8
|
import TitleBar from "../titleBar";
|
|
9
|
-
import
|
|
9
|
+
import Pagination from "../pagination/index";
|
|
10
10
|
import i18Conversion from "../i18n";
|
|
11
11
|
import BhdTableSimple from "./components/BhdTableSimple/index";
|
|
12
12
|
function BhdAppLayout(props) {
|
package/esm/table/index.js
CHANGED
|
@@ -69,6 +69,11 @@ var Table = function(props) {
|
|
|
69
69
|
var scrollBarWidth = getScrollbarWidth();
|
|
70
70
|
recordScrollBarWidth = scrollBarWidth || recordScrollBarWidth;
|
|
71
71
|
var tableWidth = bordered ? tableRef.current.offsetWidth - 2 - recordScrollBarWidth : tableRef.current.offsetWidth - recordScrollBarWidth;
|
|
72
|
+
if (props.rowSelection) {
|
|
73
|
+
//多选框
|
|
74
|
+
var selectWidth = kind === "simple" ? 40 : 72;
|
|
75
|
+
tableWidth -= selectWidth;
|
|
76
|
+
}
|
|
72
77
|
var _initColumnsWidth = initColumnsWidth(props.columns, tableWidth), selfColumns = _initColumnsWidth.columns;
|
|
73
78
|
setColumns(selfColumns);
|
|
74
79
|
var obj = scrollObject ? scrollObject : {};
|