bhd-components 0.4.4 → 0.4.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.
- package/README.md +1 -1
- package/es2017/bhdSelect/index.js +14 -11
- package/esm/bhdSelect/index.js +14 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ const BhdSelect = (props)=>{
|
|
|
26
26
|
const [optionHei, setOptionHei] = useState(0); //option的宽度
|
|
27
27
|
const [filterValue, setFilterValue] = useState(""); //下拉搜索的内容
|
|
28
28
|
const [filterChildren, setfilterChildren] = useState([]);
|
|
29
|
-
const [selectWidth,
|
|
29
|
+
// const [selectWidth,setSelectWidth] = useState(0);//下拉框的宽度
|
|
30
30
|
const renderSuffixIcon = ()=>{
|
|
31
31
|
switch(arrowType){
|
|
32
32
|
case "table":
|
|
@@ -197,11 +197,11 @@ const BhdSelect = (props)=>{
|
|
|
197
197
|
};
|
|
198
198
|
useEffect(()=>{
|
|
199
199
|
// console.log(34343434,props);
|
|
200
|
-
if
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
// console.log(bhdSelectRef.current.getBoundingClientRect(),555555555);
|
|
204
|
-
}
|
|
200
|
+
// if(props.popupMatchSelectWidth){
|
|
201
|
+
// setSelectWidth(props.popupMatchSelectWidth);
|
|
202
|
+
// }else{
|
|
203
|
+
// // console.log(bhdSelectRef.current.getBoundingClientRect(),555555555);
|
|
204
|
+
// }
|
|
205
205
|
filterOption();
|
|
206
206
|
window.addEventListener("resize", initHeight);
|
|
207
207
|
return ()=>{
|
|
@@ -217,8 +217,7 @@ const BhdSelect = (props)=>{
|
|
|
217
217
|
let config = _object_spread_props(_object_spread({}, props), {
|
|
218
218
|
listHeight: optionHei,
|
|
219
219
|
popupClassName: `${styles.bhdSelect_option} ${popupClassName || ""} `,
|
|
220
|
-
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon()
|
|
221
|
-
popupMatchSelectWidth: selectWidth
|
|
220
|
+
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon()
|
|
222
221
|
});
|
|
223
222
|
delete config.mask;
|
|
224
223
|
delete config.className;
|
|
@@ -262,9 +261,13 @@ const BhdSelect = (props)=>{
|
|
|
262
261
|
}
|
|
263
262
|
}
|
|
264
263
|
//表格中使用下拉列表,定义下拉列表宽度
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
// console.log(props.dropdownStyle,'sdsddfdfdf');
|
|
265
|
+
// if(props.dropdownStyle != undefined && props.dropdownStyle.width != undefined){
|
|
266
|
+
// setSelectWidth(props.dropdownStyle.width)
|
|
267
|
+
// }else if( (props.dropdownStyle == undefined || props.dropdownStyle.width == undefined) && useType === 'table'){
|
|
268
|
+
// console.log(bhdSelectRef.current.parentNode.getBoundingClientRect().width-4,33333);
|
|
269
|
+
// setSelectWidth(bhdSelectRef.current.parentNode.getBoundingClientRect().width-4)
|
|
270
|
+
// }
|
|
268
271
|
props.onMouseEnter && props.onMouseEnter(e);
|
|
269
272
|
},
|
|
270
273
|
children: filterChildren
|
package/esm/bhdSelect/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var BhdSelect = function(props) {
|
|
|
29
29
|
var _useState1 = _sliced_to_array(useState(0), 2), optionHei = _useState1[0], setOptionHei = _useState1[1]; //option的宽度
|
|
30
30
|
var _useState2 = _sliced_to_array(useState(""), 2), filterValue = _useState2[0], setFilterValue = _useState2[1]; //下拉搜索的内容
|
|
31
31
|
var _useState3 = _sliced_to_array(useState([]), 2), filterChildren = _useState3[0], setfilterChildren = _useState3[1];
|
|
32
|
-
|
|
32
|
+
// const [selectWidth,setSelectWidth] = useState(0);//下拉框的宽度
|
|
33
33
|
var renderSuffixIcon = function() {
|
|
34
34
|
switch(arrowType){
|
|
35
35
|
case "table":
|
|
@@ -201,11 +201,11 @@ var BhdSelect = function(props) {
|
|
|
201
201
|
};
|
|
202
202
|
useEffect(function() {
|
|
203
203
|
// console.log(34343434,props);
|
|
204
|
-
if
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
// console.log(bhdSelectRef.current.getBoundingClientRect(),555555555);
|
|
208
|
-
}
|
|
204
|
+
// if(props.popupMatchSelectWidth){
|
|
205
|
+
// setSelectWidth(props.popupMatchSelectWidth);
|
|
206
|
+
// }else{
|
|
207
|
+
// // console.log(bhdSelectRef.current.getBoundingClientRect(),555555555);
|
|
208
|
+
// }
|
|
209
209
|
filterOption();
|
|
210
210
|
window.addEventListener("resize", initHeight);
|
|
211
211
|
return function() {
|
|
@@ -221,8 +221,7 @@ var BhdSelect = function(props) {
|
|
|
221
221
|
var config = _object_spread_props(_object_spread({}, props), {
|
|
222
222
|
listHeight: optionHei,
|
|
223
223
|
popupClassName: "".concat(styles.bhdSelect_option, " ").concat(popupClassName || "", " "),
|
|
224
|
-
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon()
|
|
225
|
-
popupMatchSelectWidth: selectWidth
|
|
224
|
+
suffixIcon: suffixIcon ? suffixIcon : renderSuffixIcon()
|
|
226
225
|
});
|
|
227
226
|
delete config.mask;
|
|
228
227
|
delete config.className;
|
|
@@ -266,9 +265,13 @@ var BhdSelect = function(props) {
|
|
|
266
265
|
}
|
|
267
266
|
}
|
|
268
267
|
//表格中使用下拉列表,定义下拉列表宽度
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
// console.log(props.dropdownStyle,'sdsddfdfdf');
|
|
269
|
+
// if(props.dropdownStyle != undefined && props.dropdownStyle.width != undefined){
|
|
270
|
+
// setSelectWidth(props.dropdownStyle.width)
|
|
271
|
+
// }else if( (props.dropdownStyle == undefined || props.dropdownStyle.width == undefined) && useType === 'table'){
|
|
272
|
+
// console.log(bhdSelectRef.current.parentNode.getBoundingClientRect().width-4,33333);
|
|
273
|
+
// setSelectWidth(bhdSelectRef.current.parentNode.getBoundingClientRect().width-4)
|
|
274
|
+
// }
|
|
272
275
|
props.onMouseEnter && props.onMouseEnter(e);
|
|
273
276
|
},
|
|
274
277
|
children: filterChildren
|