bhd-components 0.9.8 → 0.9.10

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.
@@ -2,6 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
4
  import * as React from "react";
5
+ import { useRef } from "react";
5
6
  import "./index.less";
6
7
  import Table from "../../../table";
7
8
  import { Loading, NotData, ServerError } from "../../../images";
@@ -17,10 +18,18 @@ import i18Conversion from "../../../i18n";
17
18
  超长内容 出现滚动条 需在管理列定义好width 没有定义的max-width:300
18
19
  */ const BhdTableSimple = (props)=>{
19
20
  let { className, locale, borderBottom = false, rowSelection, ajaxErr, dataSource, kind = "simple", loading, notDataText = i18Conversion("noData") } = props;
21
+ const tableRef = useRef(null);
20
22
  const renderTableText = ()=>{
23
+ let minHeight = props.scroll.y.replace(/\)/, "");
24
+ minHeight = minHeight + " - 42px)";
25
+ let width = tableRef.current ? tableRef.current.offsetWidth - 42 : 0;
21
26
  if (ajaxErr) {
22
27
  return /*#__PURE__*/ _jsxs("div", {
23
28
  className: "app_BhdTableSimple_errorTable",
29
+ style: {
30
+ minHeight: minHeight,
31
+ width: width + 'px'
32
+ },
24
33
  children: [
25
34
  /*#__PURE__*/ _jsx("img", {
26
35
  src: ServerError,
@@ -36,7 +45,8 @@ import i18Conversion from "../../../i18n";
36
45
  return /*#__PURE__*/ _jsxs("div", {
37
46
  className: "app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable",
38
47
  style: {
39
- minHeight: "150px"
48
+ minHeight: minHeight,
49
+ width: width + 'px'
40
50
  },
41
51
  children: [
42
52
  /*#__PURE__*/ _jsx("img", {
@@ -56,7 +66,8 @@ import i18Conversion from "../../../i18n";
56
66
  return /*#__PURE__*/ _jsxs("div", {
57
67
  className: "app_BhdTableSimple_noTable",
58
68
  style: {
59
- width: "100%"
69
+ width: width + 'px',
70
+ minHeight: minHeight
60
71
  },
61
72
  children: [
62
73
  /*#__PURE__*/ _jsx("img", {
@@ -69,22 +80,12 @@ import i18Conversion from "../../../i18n";
69
80
  ]
70
81
  });
71
82
  };
72
- const loadingTable = /*#__PURE__*/ _jsxs("div", {
73
- className: "app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable",
74
- children: [
75
- /*#__PURE__*/ _jsx("img", {
76
- src: Loading,
77
- alt: "",
78
- style: {
79
- width: "48px",
80
- height: "48px"
81
- }
82
- }),
83
- /*#__PURE__*/ _jsx("p", {
84
- children: i18Conversion("Load")
85
- })
86
- ]
87
- });
83
+ // const loadingTable = (
84
+ // <div className="app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable">
85
+ // <img src={Loading} alt="" style={{ width: "48px", height: "48px" }} />
86
+ // <p>{i18Conversion("Load")}</p>
87
+ // </div>
88
+ // );
88
89
  const tableProps = _object_spread_props(_object_spread({
89
90
  style: {
90
91
  width: "100%"
@@ -104,6 +105,9 @@ import i18Conversion from "../../../i18n";
104
105
  // if (loading) {
105
106
  // return loadingTable;
106
107
  // }
107
- return /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps));
108
+ return /*#__PURE__*/ _jsx("div", {
109
+ ref: tableRef,
110
+ children: /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps))
111
+ });
108
112
  };
109
113
  export default BhdTableSimple;
@@ -3,6 +3,12 @@
3
3
  /* 无数据样式 */
4
4
  .app_BhdTableSimple_noTable {
5
5
  padding: 24px 0;
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ justify-content: center;
10
+ position: sticky;
11
+ left: 16px;
6
12
  img {
7
13
  width: 200px;
8
14
  height: 200px;
@@ -17,6 +23,13 @@
17
23
  /* 错误样式 */
18
24
  .app_BhdTableSimple_errorTable {
19
25
  padding: 24px 0;
26
+ display: flex;
27
+ flex-direction: column;
28
+ align-items: center;
29
+ justify-content: center;
30
+ position: sticky;
31
+ left: 16px;
32
+
20
33
  img {
21
34
  width: 200px;
22
35
  height: 200px;
@@ -4,6 +4,7 @@
4
4
  flex-direction: column;
5
5
  height: calc(100vh - 60px);
6
6
  background-color: #fff;
7
+ position: relative;
7
8
  :global {
8
9
  }
9
10
  .bhd_app_layout_header {
@@ -73,16 +74,16 @@
73
74
  margin-top: 16px;
74
75
  :global{
75
76
  /* table 无数据,异常时 */
76
- .app_BhdTableSimple_errorTable,.app_BhdTableSimple_noTable{
77
- padding-top: 120px;
78
- }
77
+ // .app_BhdTableSimple_errorTable,.app_BhdTableSimple_noTable{
78
+ // padding-top: 120px;
79
+ // }
79
80
  }
80
81
  }
81
82
  }
82
83
  .bhd_app_layout_footer {
83
84
  width: calc(100% - 60px);
84
85
  height: 56px;
85
- position: fixed;
86
+ position: absolute;
86
87
  z-index: 10;
87
88
  bottom: 0;
88
89
  display: flex;
@@ -2263,11 +2263,11 @@ const CustomerService = (props)=>{
2263
2263
  if (dom) {
2264
2264
  const con_h = document.getElementById('chat_content').clientHeight - 24; //滚动区域的高度
2265
2265
  const rectY = dom.getBoundingClientRect().y - 48;
2266
- const h = dom.clientHeight; //当前元素高度
2266
+ const h = dom.clientHeight + 24; //当前元素高度
2267
2267
  const topDom = dom.getElementsByClassName('operate_modal_showtop')[0];
2268
2268
  const bottomDom = dom.getElementsByClassName('operate_modal_showbottom')[0];
2269
2269
  if (topDom && bottomDom) {
2270
- // console.log(h,dom.getBoundingClientRect().y,rectY)
2270
+ console.log(h, con_h, rectY);
2271
2271
  if (rectY > 0) {
2272
2272
  topDom.style.cssText = "";
2273
2273
  bottomDom.style.cssText = "visibility: hidden;";
@@ -2277,8 +2277,15 @@ const CustomerService = (props)=>{
2277
2277
  bottomDom.style.cssText = "";
2278
2278
  }
2279
2279
  } else {
2280
- topDom.style.cssText = "visibility: hidden;";
2281
- bottomDom.style.cssText = "";
2280
+ // 上下都不显示
2281
+ if (h > con_h && h - con_h > Math.abs(rectY)) {
2282
+ console.log('rerererererer');
2283
+ topDom.style.cssText = "visibility: hidden;";
2284
+ bottomDom.style.cssText = `top:${-(h + rectY - 51)}px`;
2285
+ } else {
2286
+ topDom.style.cssText = "visibility: hidden;";
2287
+ bottomDom.style.cssText = "";
2288
+ }
2282
2289
  }
2283
2290
  }
2284
2291
  }
@@ -652,7 +652,7 @@
652
652
  &.bottom{
653
653
  top:3px;
654
654
  .operate{
655
- box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.1);
655
+ box-shadow: 0px -4px 10px 4px rgba(0, 0, 0, 0.1);
656
656
  }
657
657
  }
658
658
  }
@@ -647,7 +647,7 @@
647
647
  &.bottom{
648
648
  top:3px;
649
649
  .operate{
650
- box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.1);
650
+ box-shadow: 0px -4px 10px 4px rgba(0, 0, 0, 0.1);
651
651
  }
652
652
  }
653
653
  }
@@ -2,6 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
4
4
  import * as React from "react";
5
+ import { useRef } from "react";
5
6
  import "./index.less";
6
7
  import Table from "../../../table";
7
8
  import { Loading, NotData, ServerError } from "../../../images";
@@ -17,10 +18,18 @@ import i18Conversion from "../../../i18n";
17
18
  超长内容 出现滚动条 需在管理列定义好width 没有定义的max-width:300
18
19
  */ var BhdTableSimple = function(props) {
19
20
  var className = props.className, locale = props.locale, _props_borderBottom = props.borderBottom, borderBottom = _props_borderBottom === void 0 ? false : _props_borderBottom, rowSelection = props.rowSelection, ajaxErr = props.ajaxErr, dataSource = props.dataSource, _props_kind = props.kind, kind = _props_kind === void 0 ? "simple" : _props_kind, loading = props.loading, _props_notDataText = props.notDataText, notDataText = _props_notDataText === void 0 ? i18Conversion("noData") : _props_notDataText;
21
+ var tableRef = useRef(null);
20
22
  var renderTableText = function() {
23
+ var minHeight = props.scroll.y.replace(/\)/, "");
24
+ minHeight = minHeight + " - 42px)";
25
+ var width = tableRef.current ? tableRef.current.offsetWidth - 42 : 0;
21
26
  if (ajaxErr) {
22
27
  return /*#__PURE__*/ _jsxs("div", {
23
28
  className: "app_BhdTableSimple_errorTable",
29
+ style: {
30
+ minHeight: minHeight,
31
+ width: width + "px"
32
+ },
24
33
  children: [
25
34
  /*#__PURE__*/ _jsx("img", {
26
35
  src: ServerError,
@@ -36,7 +45,8 @@ import i18Conversion from "../../../i18n";
36
45
  return /*#__PURE__*/ _jsxs("div", {
37
46
  className: "app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable",
38
47
  style: {
39
- minHeight: "150px"
48
+ minHeight: minHeight,
49
+ width: width + "px"
40
50
  },
41
51
  children: [
42
52
  /*#__PURE__*/ _jsx("img", {
@@ -56,7 +66,8 @@ import i18Conversion from "../../../i18n";
56
66
  return /*#__PURE__*/ _jsxs("div", {
57
67
  className: "app_BhdTableSimple_noTable",
58
68
  style: {
59
- width: "100%"
69
+ width: width + "px",
70
+ minHeight: minHeight
60
71
  },
61
72
  children: [
62
73
  /*#__PURE__*/ _jsx("img", {
@@ -69,22 +80,12 @@ import i18Conversion from "../../../i18n";
69
80
  ]
70
81
  });
71
82
  };
72
- var loadingTable = /*#__PURE__*/ _jsxs("div", {
73
- className: "app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable",
74
- children: [
75
- /*#__PURE__*/ _jsx("img", {
76
- src: Loading,
77
- alt: "",
78
- style: {
79
- width: "48px",
80
- height: "48px"
81
- }
82
- }),
83
- /*#__PURE__*/ _jsx("p", {
84
- children: i18Conversion("Load")
85
- })
86
- ]
87
- });
83
+ // const loadingTable = (
84
+ // <div className="app_BhdTableSimple_noTable app_BhdTableSimple_noTable_loadingTable">
85
+ // <img src={Loading} alt="" style={{ width: "48px", height: "48px" }} />
86
+ // <p>{i18Conversion("Load")}</p>
87
+ // </div>
88
+ // );
88
89
  var tableProps = _object_spread_props(_object_spread({
89
90
  style: {
90
91
  width: "100%"
@@ -104,6 +105,9 @@ import i18Conversion from "../../../i18n";
104
105
  // if (loading) {
105
106
  // return loadingTable;
106
107
  // }
107
- return /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps));
108
+ return /*#__PURE__*/ _jsx("div", {
109
+ ref: tableRef,
110
+ children: /*#__PURE__*/ _jsx(Table, _object_spread({}, tableProps))
111
+ });
108
112
  };
109
113
  export default BhdTableSimple;
@@ -3,6 +3,12 @@
3
3
  /* 无数据样式 */
4
4
  .app_BhdTableSimple_noTable {
5
5
  padding: 24px 0;
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ justify-content: center;
10
+ position: sticky;
11
+ left: 16px;
6
12
  img {
7
13
  width: 200px;
8
14
  height: 200px;
@@ -17,6 +23,13 @@
17
23
  /* 错误样式 */
18
24
  .app_BhdTableSimple_errorTable {
19
25
  padding: 24px 0;
26
+ display: flex;
27
+ flex-direction: column;
28
+ align-items: center;
29
+ justify-content: center;
30
+ position: sticky;
31
+ left: 16px;
32
+
20
33
  img {
21
34
  width: 200px;
22
35
  height: 200px;
@@ -4,6 +4,7 @@
4
4
  flex-direction: column;
5
5
  height: calc(100vh - 60px);
6
6
  background-color: #fff;
7
+ position: relative;
7
8
  :global {
8
9
  }
9
10
  .bhd_app_layout_header {
@@ -73,16 +74,16 @@
73
74
  margin-top: 16px;
74
75
  :global{
75
76
  /* table 无数据,异常时 */
76
- .app_BhdTableSimple_errorTable,.app_BhdTableSimple_noTable{
77
- padding-top: 120px;
78
- }
77
+ // .app_BhdTableSimple_errorTable,.app_BhdTableSimple_noTable{
78
+ // padding-top: 120px;
79
+ // }
79
80
  }
80
81
  }
81
82
  }
82
83
  .bhd_app_layout_footer {
83
84
  width: calc(100% - 60px);
84
85
  height: 56px;
85
- position: fixed;
86
+ position: absolute;
86
87
  z-index: 10;
87
88
  bottom: 0;
88
89
  display: flex;
@@ -2312,11 +2312,11 @@ var CustomerService = function(props) {
2312
2312
  if (dom) {
2313
2313
  var con_h = document.getElementById("chat_content").clientHeight - 24; //滚动区域的高度
2314
2314
  var rectY = dom.getBoundingClientRect().y - 48;
2315
- var h = dom.clientHeight; //当前元素高度
2315
+ var h = dom.clientHeight + 24; //当前元素高度
2316
2316
  var topDom = dom.getElementsByClassName("operate_modal_showtop")[0];
2317
2317
  var bottomDom = dom.getElementsByClassName("operate_modal_showbottom")[0];
2318
2318
  if (topDom && bottomDom) {
2319
- // console.log(h,dom.getBoundingClientRect().y,rectY)
2319
+ console.log(h, con_h, rectY);
2320
2320
  if (rectY > 0) {
2321
2321
  topDom.style.cssText = "";
2322
2322
  bottomDom.style.cssText = "visibility: hidden;";
@@ -2326,8 +2326,15 @@ var CustomerService = function(props) {
2326
2326
  bottomDom.style.cssText = "";
2327
2327
  }
2328
2328
  } else {
2329
- topDom.style.cssText = "visibility: hidden;";
2330
- bottomDom.style.cssText = "";
2329
+ // 上下都不显示
2330
+ if (h > con_h && h - con_h > Math.abs(rectY)) {
2331
+ console.log("rerererererer");
2332
+ topDom.style.cssText = "visibility: hidden;";
2333
+ bottomDom.style.cssText = "top:".concat(-(h + rectY - 51), "px");
2334
+ } else {
2335
+ topDom.style.cssText = "visibility: hidden;";
2336
+ bottomDom.style.cssText = "";
2337
+ }
2331
2338
  }
2332
2339
  }
2333
2340
  }
@@ -652,7 +652,7 @@
652
652
  &.bottom{
653
653
  top:3px;
654
654
  .operate{
655
- box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.1);
655
+ box-shadow: 0px -4px 10px 4px rgba(0, 0, 0, 0.1);
656
656
  }
657
657
  }
658
658
  }
@@ -647,7 +647,7 @@
647
647
  &.bottom{
648
648
  top:3px;
649
649
  .operate{
650
- box-shadow: 0px -4px 10px 0px rgba(0, 0, 0, 0.1);
650
+ box-shadow: 0px -4px 10px 4px rgba(0, 0, 0, 0.1);
651
651
  }
652
652
  }
653
653
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.9.8",
3
+ "version": "0.9.10",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {