antd-mobile 5.42.1 → 5.42.2-alpha.1
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/2x/bundle/antd-mobile.cjs.development.js +13 -6
- package/2x/bundle/antd-mobile.cjs.js +4 -4
- package/2x/bundle/antd-mobile.es.development.js +13 -6
- package/2x/bundle/antd-mobile.es.js +372 -372
- package/2x/bundle/antd-mobile.umd.development.js +13 -6
- package/2x/bundle/antd-mobile.umd.js +4 -4
- package/2x/bundle/style.css +5 -0
- package/2x/cjs/components/space/space.css +4 -0
- package/2x/cjs/components/virtual-input/use-click-outside.d.ts +1 -1
- package/2x/cjs/components/virtual-input/use-click-outside.js +10 -4
- package/2x/cjs/components/virtual-input/virtual-input.css +1 -0
- package/2x/cjs/components/virtual-input/virtual-input.js +11 -3
- package/2x/es/components/space/space.css +4 -0
- package/2x/es/components/virtual-input/use-click-outside.d.ts +1 -1
- package/2x/es/components/virtual-input/use-click-outside.js +10 -4
- package/2x/es/components/virtual-input/virtual-input.css +1 -0
- package/2x/es/components/virtual-input/virtual-input.js +11 -3
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.development.js +13 -6
- package/bundle/antd-mobile.cjs.js +4 -4
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +13 -6
- package/bundle/antd-mobile.es.js +372 -372
- package/bundle/antd-mobile.umd.development.js +13 -6
- package/bundle/antd-mobile.umd.js +4 -4
- package/bundle/style.css +1 -1
- package/cjs/components/space/space.css +3 -0
- package/cjs/components/virtual-input/use-click-outside.d.ts +1 -1
- package/cjs/components/virtual-input/use-click-outside.js +10 -4
- package/cjs/components/virtual-input/virtual-input.css +1 -0
- package/cjs/components/virtual-input/virtual-input.js +11 -3
- package/es/components/space/space.css +3 -0
- package/es/components/virtual-input/use-click-outside.d.ts +1 -1
- package/es/components/virtual-input/use-click-outside.js +10 -4
- package/es/components/virtual-input/virtual-input.css +1 -0
- package/es/components/virtual-input/virtual-input.js +11 -3
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -27586,7 +27586,7 @@ const Multiple = (p) => {
|
|
|
27586
27586
|
const index = attachPropertiesToComponent(TreeSelect, {
|
|
27587
27587
|
Multiple
|
|
27588
27588
|
});
|
|
27589
|
-
function useClickOutside(handler, ref2) {
|
|
27589
|
+
function useClickOutside(handler, ref2, hasKeyboardProps = false) {
|
|
27590
27590
|
useEffect(() => {
|
|
27591
27591
|
function handleClick(event) {
|
|
27592
27592
|
if (!ref2.current || ref2.current.contains(event.target)) {
|
|
@@ -27594,9 +27594,9 @@ function useClickOutside(handler, ref2) {
|
|
|
27594
27594
|
}
|
|
27595
27595
|
handler(event);
|
|
27596
27596
|
}
|
|
27597
|
-
document.addEventListener("click", handleClick, true);
|
|
27597
|
+
document.addEventListener("click", handleClick, hasKeyboardProps ? true : false);
|
|
27598
27598
|
return () => {
|
|
27599
|
-
document.removeEventListener("click", handleClick, true);
|
|
27599
|
+
document.removeEventListener("click", handleClick, hasKeyboardProps ? true : false);
|
|
27600
27600
|
};
|
|
27601
27601
|
}, [handler, ref2]);
|
|
27602
27602
|
}
|
|
@@ -27684,7 +27684,7 @@ const VirtualInput = forwardRef((props, ref2) => {
|
|
|
27684
27684
|
}
|
|
27685
27685
|
useClickOutside(() => {
|
|
27686
27686
|
setBlur();
|
|
27687
|
-
}, rootRef);
|
|
27687
|
+
}, rootRef, !!mergedProps.keyboard);
|
|
27688
27688
|
const keyboard = mergedProps.keyboard;
|
|
27689
27689
|
const keyboardElement = keyboard && React__default.cloneElement(keyboard, {
|
|
27690
27690
|
onInput: (v) => {
|
|
@@ -27711,14 +27711,21 @@ const VirtualInput = forwardRef((props, ref2) => {
|
|
|
27711
27711
|
},
|
|
27712
27712
|
visible: hasFocus,
|
|
27713
27713
|
onClose: () => {
|
|
27714
|
-
var _a, _b;
|
|
27714
|
+
var _a, _b, _c;
|
|
27715
|
+
const activeElement = document.activeElement;
|
|
27716
|
+
if (activeElement === contentRef.current) {
|
|
27717
|
+
(_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
27718
|
+
}
|
|
27715
27719
|
setBlur();
|
|
27716
|
-
(
|
|
27720
|
+
(_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
27717
27721
|
},
|
|
27718
27722
|
getContainer: null
|
|
27719
27723
|
});
|
|
27720
27724
|
const setCaretPositionToEnd = (e2) => {
|
|
27721
27725
|
var _a, _b, _c;
|
|
27726
|
+
if (mergedProps.disabled) {
|
|
27727
|
+
return;
|
|
27728
|
+
}
|
|
27722
27729
|
if (caretPosition !== value.length) {
|
|
27723
27730
|
setCaretPosition(value.length);
|
|
27724
27731
|
(_b = (_a = mergedProps.cursor) === null || _a === void 0 ? void 0 : _a.onMove) === null || _b === void 0 ? void 0 : _b.call(_a, value.length);
|