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.
@@ -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 { Pagination } from "antd";
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) {
@@ -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('div');
38
- outer.style.visibility = 'hidden';
39
- outer.style.overflow = 'scroll'; // forcing scrollbar to appear
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('div');
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
- const tableWidth = bordered ? tableRef.current.offsetWidth - 2 - recordScrollBarWidth : tableRef.current.offsetWidth - recordScrollBarWidth;
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 { Pagination } from "antd";
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) {
@@ -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 : {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.38",
3
+ "version": "0.7.40",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",