@yibozhang/pro-table 0.1.8 → 0.1.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.
- package/bundles/yibozhang-pro-table.umd.js +7 -7
- package/bundles/yibozhang-pro-table.umd.js.map +1 -1
- package/bundles/yibozhang-pro-table.umd.min.js +1 -1
- package/bundles/yibozhang-pro-table.umd.min.js.map +1 -1
- package/esm2015/lib/utils/select-width-detector.js +8 -8
- package/fesm2015/yibozhang-pro-table.js +7 -7
- package/fesm2015/yibozhang-pro-table.js.map +1 -1
- package/package.json +1 -1
|
@@ -3633,7 +3633,7 @@
|
|
|
3633
3633
|
var actualSelect = element.querySelector('.ant-select');
|
|
3634
3634
|
return actualSelect || element;
|
|
3635
3635
|
}
|
|
3636
|
-
// 获取原始的 nz-select 组件元素(用于读取 custom-
|
|
3636
|
+
// 获取原始的 nz-select 组件元素(用于读取 custom-maxWidth 属性)
|
|
3637
3637
|
function getOriginalSelectElement(element) {
|
|
3638
3638
|
// 如果已经是 nz-select 组件标签,直接返回
|
|
3639
3639
|
if (element.tagName === 'NZ-SELECT') {
|
|
@@ -3655,13 +3655,13 @@
|
|
|
3655
3655
|
if (!actualSelect) {
|
|
3656
3656
|
return;
|
|
3657
3657
|
}
|
|
3658
|
-
//
|
|
3658
|
+
// 检查是否有自定义最大宽度属性
|
|
3659
3659
|
var originalSelect = getOriginalSelectElement(selectElement);
|
|
3660
3660
|
if (originalSelect) {
|
|
3661
|
-
var
|
|
3662
|
-
if (
|
|
3663
|
-
//
|
|
3664
|
-
actualSelect.style.
|
|
3661
|
+
var customMaxWidth = originalSelect.getAttribute('custom-maxWidth');
|
|
3662
|
+
if (customMaxWidth) {
|
|
3663
|
+
// 使用自定义最大宽度
|
|
3664
|
+
actualSelect.style.maxWidth = customMaxWidth;
|
|
3665
3665
|
return;
|
|
3666
3666
|
}
|
|
3667
3667
|
}
|
|
@@ -3672,7 +3672,7 @@
|
|
|
3672
3672
|
if (parentWidth > 0) {
|
|
3673
3673
|
// 设置宽度,可以减去一些 padding/margin 来避免溢出
|
|
3674
3674
|
// 这里直接使用父元素宽度,如果需要可以调整
|
|
3675
|
-
actualSelect.style.
|
|
3675
|
+
actualSelect.style.maxWidth = parentWidth + "px";
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
}
|