@kne/super-select 0.1.43 → 0.1.44
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/dist/index.css +3 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +15 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -239,6 +239,9 @@ const pxToNumber = value => {
|
|
|
239
239
|
return match ? Number(match[0]) : 0;
|
|
240
240
|
};
|
|
241
241
|
|
|
242
|
+
/** 未传 overlayWidth 时的面板最小宽度(与 .overlay-content min-width 一致) */
|
|
243
|
+
const DEFAULT_OVERLAY_MIN_WIDTH = 300;
|
|
244
|
+
|
|
242
245
|
// 与 Modal 模式一致:面板内用临时 value,确认后才写回
|
|
243
246
|
const ModalContent = _ref => {
|
|
244
247
|
let {
|
|
@@ -538,11 +541,6 @@ const SelectInput = createWithIntlProvider({
|
|
|
538
541
|
});
|
|
539
542
|
const useMobileSheet = isMobile && !disableMobileSheet;
|
|
540
543
|
const useBoundaryMount = !!(isMobile && fixedModeClass === MOBILE_POPUP_MODE.boundary);
|
|
541
|
-
const mergedOverlayStyle = useMemo(() => {
|
|
542
|
-
return Object.assign({}, overlayStyle, zIndex != null ? {
|
|
543
|
-
zIndex
|
|
544
|
-
} : null);
|
|
545
|
-
}, [overlayStyle, zIndex]);
|
|
546
544
|
const transformValue = value => {
|
|
547
545
|
if (single) {
|
|
548
546
|
return isNotEmpty(value) ? [value] : [];
|
|
@@ -579,8 +577,19 @@ const SelectInput = createWithIntlProvider({
|
|
|
579
577
|
setInnerWidth(innerEl.clientWidth);
|
|
580
578
|
};
|
|
581
579
|
const popupOverlayWidth = useMemo(() => {
|
|
582
|
-
|
|
580
|
+
const configured = overlayWidth != null && overlayWidth !== '' ? pxToNumber(overlayWidth) : DEFAULT_OVERLAY_MIN_WIDTH;
|
|
581
|
+
return numberToPx$1(Math.max(containerWidth || 0, configured));
|
|
583
582
|
}, [containerWidth, overlayWidth]);
|
|
583
|
+
|
|
584
|
+
// 同步给 Dropdown 外层 minWidth,避免 antd 按窄触发器裁剪面板
|
|
585
|
+
const mergedOverlayStyle = useMemo(() => {
|
|
586
|
+
return Object.assign({}, overlayStyle, zIndex != null ? {
|
|
587
|
+
zIndex
|
|
588
|
+
} : null, {
|
|
589
|
+
minWidth: popupOverlayWidth,
|
|
590
|
+
['--overlay-width']: popupOverlayWidth
|
|
591
|
+
});
|
|
592
|
+
}, [overlayStyle, zIndex, popupOverlayWidth]);
|
|
584
593
|
const resizeRef = useResize(containerWidthChange);
|
|
585
594
|
const setContainerRef = useCallback(node => {
|
|
586
595
|
resizeRef.current = node;
|