bhd-components 0.6.3 → 0.6.5

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.
@@ -265,12 +265,23 @@ const BhdSelect = (props)=>{
265
265
  }
266
266
  }
267
267
  //表格中使用下拉列表,定义下拉列表宽度
268
- // console.log(props.dropdownStyle,'sdsddfdfdf');
268
+ //表格中使用下拉列表,定义下拉列表宽度
269
269
  if (props.dropdownStyle != undefined && props.dropdownStyle.width != undefined) {
270
270
  setSelectWidth(props.dropdownStyle.width);
271
- } else if ((props.dropdownStyle == undefined || props.dropdownStyle.width == undefined) && useType === 'table') {
271
+ } else if (useType === "table") {
272
272
  try {
273
- setSelectWidth(bhdSelectRef.current.parentNode.getBoundingClientRect().width + 14);
273
+ let width = bhdSelectRef.current.parentNode.getBoundingClientRect().width + 14;
274
+ let minWidth = props.popupMatchSelectWidth;
275
+ //设置了最小宽度
276
+ if (minWidth != undefined && minWidth >= width) {
277
+ setSelectWidth(minWidth);
278
+ } else if (minWidth != undefined && minWidth < width) {
279
+ setSelectWidth(width);
280
+ } else if (minWidth == undefined && width < 60) {
281
+ setSelectWidth(60);
282
+ } else {
283
+ setSelectWidth(width);
284
+ }
274
285
  } catch (error) {}
275
286
  }
276
287
  props.onMouseEnter && props.onMouseEnter(e);
@@ -269,12 +269,23 @@ var BhdSelect = function(props) {
269
269
  }
270
270
  }
271
271
  //表格中使用下拉列表,定义下拉列表宽度
272
- // console.log(props.dropdownStyle,'sdsddfdfdf');
272
+ //表格中使用下拉列表,定义下拉列表宽度
273
273
  if (props.dropdownStyle != undefined && props.dropdownStyle.width != undefined) {
274
274
  setSelectWidth(props.dropdownStyle.width);
275
- } else if ((props.dropdownStyle == undefined || props.dropdownStyle.width == undefined) && useType === "table") {
275
+ } else if (useType === "table") {
276
276
  try {
277
- setSelectWidth(bhdSelectRef.current.parentNode.getBoundingClientRect().width + 14);
277
+ var width = bhdSelectRef.current.parentNode.getBoundingClientRect().width + 14;
278
+ var minWidth = props.popupMatchSelectWidth;
279
+ //设置了最小宽度
280
+ if (minWidth != undefined && minWidth >= width) {
281
+ setSelectWidth(minWidth);
282
+ } else if (minWidth != undefined && minWidth < width) {
283
+ setSelectWidth(width);
284
+ } else if (minWidth == undefined && width < 60) {
285
+ setSelectWidth(60);
286
+ } else {
287
+ setSelectWidth(width);
288
+ }
278
289
  } catch (error) {}
279
290
  }
280
291
  props.onMouseEnter && props.onMouseEnter(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",