@douyinfe/semi-ui 2.38.0-beta.0 → 2.38.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/dist/css/semi.css +3 -2
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +34 -11
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/autoComplete/index.js +19 -0
- package/lib/cjs/select/index.js +1 -1
- package/lib/cjs/select/option.js +3 -3
- package/lib/cjs/tooltip/index.js +3 -3
- package/lib/es/autoComplete/index.js +19 -0
- package/lib/es/select/index.js +1 -1
- package/lib/es/select/option.js +3 -3
- package/lib/es/tooltip/index.js +3 -3
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -20285,7 +20285,7 @@ class Tooltip extends BaseComponent {
|
|
|
20285
20285
|
const icon = this.renderIcon();
|
|
20286
20286
|
const portalInnerStyle = omit_default()(containerStyle, motion ? ['transformOrigin'] : undefined);
|
|
20287
20287
|
const transformOrigin = get_default()(containerStyle, 'transformOrigin');
|
|
20288
|
-
const userOpacity = get_default()(style, 'opacity');
|
|
20288
|
+
const userOpacity = get_default()(style, 'opacity', null);
|
|
20289
20289
|
const opacity = userOpacity ? userOpacity : 1;
|
|
20290
20290
|
const inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(_cssAnimation, {
|
|
20291
20291
|
fillMode: "forwards",
|
|
@@ -20311,9 +20311,9 @@ class Tooltip extends BaseComponent {
|
|
|
20311
20311
|
display: "none"
|
|
20312
20312
|
} : {}), {
|
|
20313
20313
|
transformOrigin
|
|
20314
|
-
}), style), {
|
|
20314
|
+
}), style), userOpacity ? {
|
|
20315
20315
|
opacity: isPositionUpdated ? opacity : "0"
|
|
20316
|
-
})
|
|
20316
|
+
} : {})
|
|
20317
20317
|
}, portalEventSet, animationEventsNeedBind, {
|
|
20318
20318
|
role: role,
|
|
20319
20319
|
"x-placement": placement,
|
|
@@ -26676,9 +26676,10 @@ class AutoCompleteFoundation extends foundation {
|
|
|
26676
26676
|
}
|
|
26677
26677
|
}
|
|
26678
26678
|
destroy() {
|
|
26679
|
-
|
|
26679
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
26680
26680
|
// this.unBindKeyBoardEvent();
|
|
26681
26681
|
}
|
|
26682
|
+
|
|
26682
26683
|
_setDropdownWidth() {
|
|
26683
26684
|
const {
|
|
26684
26685
|
style,
|
|
@@ -26715,14 +26716,14 @@ class AutoCompleteFoundation extends foundation {
|
|
|
26715
26716
|
this.isPanelOpen = true;
|
|
26716
26717
|
this._adapter.toggleListVisible(true);
|
|
26717
26718
|
this._setDropdownWidth();
|
|
26718
|
-
|
|
26719
|
+
this._adapter.registerClickOutsideHandler(e => this.closeDropdown(e));
|
|
26719
26720
|
this._adapter.notifyDropdownVisibleChange(true);
|
|
26720
26721
|
this._modifyFocusIndexOnPanelOpen();
|
|
26721
26722
|
}
|
|
26722
26723
|
closeDropdown(e) {
|
|
26723
26724
|
this.isPanelOpen = false;
|
|
26724
26725
|
this._adapter.toggleListVisible(false);
|
|
26725
|
-
|
|
26726
|
+
this._adapter.unregisterClickOutsideHandler();
|
|
26726
26727
|
this._adapter.notifyDropdownVisibleChange(false);
|
|
26727
26728
|
// After closing the panel, you can still open the panel by pressing the enter key
|
|
26728
26729
|
// this.unBindKeyBoardEvent();
|
|
@@ -26933,6 +26934,9 @@ class AutoCompleteFoundation extends foundation {
|
|
|
26933
26934
|
case utils_keyCode.ESC:
|
|
26934
26935
|
this.closeDropdown();
|
|
26935
26936
|
break;
|
|
26937
|
+
case utils_keyCode.TAB:
|
|
26938
|
+
this.closeDropdown();
|
|
26939
|
+
break;
|
|
26936
26940
|
default:
|
|
26937
26941
|
break;
|
|
26938
26942
|
}
|
|
@@ -27025,7 +27029,7 @@ class AutoCompleteFoundation extends foundation {
|
|
|
27025
27029
|
// internal-issues:1231
|
|
27026
27030
|
setTimeout(() => {
|
|
27027
27031
|
this._adapter.notifyBlur(e);
|
|
27028
|
-
this.closeDropdown();
|
|
27032
|
+
// this.closeDropdown();
|
|
27029
27033
|
}, 100);
|
|
27030
27034
|
}
|
|
27031
27035
|
}
|
|
@@ -28303,6 +28307,7 @@ var autoComplete = __webpack_require__("PyaV");
|
|
|
28303
28307
|
|
|
28304
28308
|
|
|
28305
28309
|
|
|
28310
|
+
|
|
28306
28311
|
const autoComplete_prefixCls = autoComplete_constants_cssClasses.PREFIX;
|
|
28307
28312
|
const autoComplete_sizeSet = autoComplete_constants_strings.SIZE;
|
|
28308
28313
|
const autoComplete_positionSet = autoComplete_constants_strings.POSITION;
|
|
@@ -28427,6 +28432,24 @@ class AutoComplete extends BaseComponent {
|
|
|
28427
28432
|
this.setState({
|
|
28428
28433
|
rePosKey
|
|
28429
28434
|
});
|
|
28435
|
+
},
|
|
28436
|
+
registerClickOutsideHandler: cb => {
|
|
28437
|
+
const clickOutsideHandler = e => {
|
|
28438
|
+
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
28439
|
+
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
28440
|
+
const optionsDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(optionInstance);
|
|
28441
|
+
const target = e.target;
|
|
28442
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target)) {
|
|
28443
|
+
cb(e);
|
|
28444
|
+
}
|
|
28445
|
+
};
|
|
28446
|
+
this.clickOutsideHandler = clickOutsideHandler;
|
|
28447
|
+
document.addEventListener('mousedown', clickOutsideHandler, false);
|
|
28448
|
+
},
|
|
28449
|
+
unregisterClickOutsideHandler: () => {
|
|
28450
|
+
if (this.clickOutsideHandler) {
|
|
28451
|
+
document.removeEventListener('mousedown', this.clickOutsideHandler, false);
|
|
28452
|
+
}
|
|
28430
28453
|
}
|
|
28431
28454
|
});
|
|
28432
28455
|
}
|
|
@@ -67848,9 +67871,9 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
67848
67871
|
prefixCls,
|
|
67849
67872
|
renderOptionItem,
|
|
67850
67873
|
inputValue,
|
|
67851
|
-
|
|
67874
|
+
semiOptionId
|
|
67852
67875
|
} = _a,
|
|
67853
|
-
rest = select_option_rest(_a, ["children", "disabled", "value", "selected", "label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className", "style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue", "
|
|
67876
|
+
rest = select_option_rest(_a, ["children", "disabled", "value", "selected", "label", "empty", "emptyContent", "onSelect", "focused", "showTick", "className", "style", "onMouseEnter", "prefixCls", "renderOptionItem", "inputValue", "semiOptionId"]);
|
|
67854
67877
|
const optionClassName = classnames_default()(prefixCls, {
|
|
67855
67878
|
[`${prefixCls}-disabled`]: disabled,
|
|
67856
67879
|
[`${prefixCls}-selected`]: selected,
|
|
@@ -67909,7 +67932,7 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
67909
67932
|
},
|
|
67910
67933
|
onMouseEnter: e => onMouseEnter && onMouseEnter(e),
|
|
67911
67934
|
role: "option",
|
|
67912
|
-
id:
|
|
67935
|
+
id: semiOptionId,
|
|
67913
67936
|
"aria-selected": selected ? "true" : "false",
|
|
67914
67937
|
"aria-disabled": disabled ? "true" : "false",
|
|
67915
67938
|
style: style
|
|
@@ -68518,7 +68541,7 @@ class Select extends BaseComponent {
|
|
|
68518
68541
|
key: option.key || option.label + option.value + optionIndex,
|
|
68519
68542
|
renderOptionItem: renderOptionItem,
|
|
68520
68543
|
inputValue: inputValue,
|
|
68521
|
-
|
|
68544
|
+
semiOptionId: `${this.selectID}-option-${optionIndex}`
|
|
68522
68545
|
}), option.label);
|
|
68523
68546
|
}
|
|
68524
68547
|
return optionContent;
|