@douyinfe/semi-ui 2.56.0-alpha.0 → 2.56.0
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 +41 -9
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +76 -47
- 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/_base/base.css +5 -7
- package/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.js +2 -1
- package/lib/cjs/backtop/index.d.ts +1 -0
- package/lib/cjs/backtop/index.js +4 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/monthCalendar.js +3 -1
- package/lib/cjs/cascader/index.js +8 -4
- package/lib/cjs/datePicker/datePicker.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.js +5 -9
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +2 -2
- package/lib/cjs/form/field.d.ts +2 -2
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/locale/source/ro.d.ts +3 -170
- package/lib/cjs/locale/source/ro.js +5 -5
- package/lib/cjs/modal/confirm.d.ts +16 -16
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/radio/radioGroup.d.ts +1 -1
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/select/index.js +3 -3
- package/lib/cjs/switch/index.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +2 -2
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.js +2 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -1
- package/lib/cjs/timePicker/TimePicker.js +8 -8
- package/lib/cjs/timePicker/index.d.ts +1 -1
- package/lib/cjs/tooltip/index.js +4 -1
- package/lib/cjs/treeSelect/index.js +4 -3
- package/lib/cjs/typography/base.d.ts +8 -0
- package/lib/cjs/typography/base.js +28 -4
- package/lib/cjs/typography/title.d.ts +2 -2
- package/lib/es/_base/base.css +5 -7
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/autoComplete/index.js +2 -1
- package/lib/es/backtop/index.d.ts +1 -0
- package/lib/es/backtop/index.js +4 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/monthCalendar.js +3 -1
- package/lib/es/cascader/index.js +8 -4
- package/lib/es/datePicker/datePicker.d.ts +1 -1
- package/lib/es/datePicker/datePicker.js +5 -9
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +2 -2
- package/lib/es/form/field.d.ts +2 -2
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/locale/source/ro.d.ts +3 -170
- package/lib/es/locale/source/ro.js +6 -6
- package/lib/es/modal/confirm.d.ts +16 -16
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/radio/radioGroup.d.ts +1 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/select/index.js +3 -3
- package/lib/es/switch/index.d.ts +1 -1
- package/lib/es/table/Table.d.ts +2 -2
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/tagInput/index.js +2 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -1
- package/lib/es/timePicker/TimePicker.js +8 -8
- package/lib/es/timePicker/index.d.ts +1 -1
- package/lib/es/tooltip/index.js +4 -1
- package/lib/es/treeSelect/index.js +4 -3
- package/lib/es/typography/base.d.ts +8 -0
- package/lib/es/typography/base.js +28 -4
- package/lib/es/typography/title.d.ts +2 -2
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -20518,7 +20518,10 @@ class Tooltip extends BaseComponent {
|
|
|
20518
20518
|
let popupEl = this.containerEl && this.containerEl.current;
|
|
20519
20519
|
el = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(el);
|
|
20520
20520
|
popupEl = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(popupEl);
|
|
20521
|
-
|
|
20521
|
+
const target = e.target;
|
|
20522
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
20523
|
+
const isClickTriggerToHide = this.props.clickTriggerToHide ? el && el.contains(target) || path.includes(el) : false;
|
|
20524
|
+
if (el && !el.contains(target) && popupEl && !popupEl.contains(target) && !(path.includes(popupEl) || path.includes(el)) || isClickTriggerToHide) {
|
|
20522
20525
|
this.props.onClickOutSide(e);
|
|
20523
20526
|
cb();
|
|
20524
20527
|
}
|
|
@@ -22960,9 +22963,32 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
22960
22963
|
if (!rows || rows < 1) {
|
|
22961
22964
|
return false;
|
|
22962
22965
|
}
|
|
22963
|
-
const updateOverflow = rows <= 1 ? this.
|
|
22966
|
+
const updateOverflow = rows <= 1 ? this.compareSingleRow() : this.wrapperRef.current.scrollHeight > this.wrapperRef.current.offsetHeight;
|
|
22964
22967
|
return updateOverflow;
|
|
22965
22968
|
};
|
|
22969
|
+
/**
|
|
22970
|
+
* 通过将 content 给到 Range 对象,借助 Range 的 getBoundingClientRect 拿到 content 的准确 width
|
|
22971
|
+
* 不受 css ellipsis 与否的影响
|
|
22972
|
+
* By giving the content to the Range object, get the exact width of the content with the help of Range's getBoundingClientRect
|
|
22973
|
+
* Not affected by css ellipsis or not
|
|
22974
|
+
* https://github.com/DouyinFE/semi-design/issues/1731
|
|
22975
|
+
*/
|
|
22976
|
+
this.compareSingleRow = () => {
|
|
22977
|
+
if (!(document && document.createRange)) {
|
|
22978
|
+
return false;
|
|
22979
|
+
}
|
|
22980
|
+
const containerNode = this.wrapperRef.current;
|
|
22981
|
+
const containerWidth = containerNode.getBoundingClientRect().width;
|
|
22982
|
+
const childNodes = Array.from(containerNode.childNodes);
|
|
22983
|
+
const range = document.createRange();
|
|
22984
|
+
const contentWidth = childNodes.reduce((acc, node) => {
|
|
22985
|
+
var _a;
|
|
22986
|
+
range.selectNodeContents(node);
|
|
22987
|
+
return acc + ((_a = range.getBoundingClientRect().width) !== null && _a !== void 0 ? _a : 0);
|
|
22988
|
+
}, 0);
|
|
22989
|
+
range.detach();
|
|
22990
|
+
return contentWidth > containerWidth;
|
|
22991
|
+
};
|
|
22966
22992
|
this.showTooltip = () => {
|
|
22967
22993
|
var _a, _b;
|
|
22968
22994
|
const {
|
|
@@ -23069,14 +23095,15 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
|
|
|
23069
23095
|
expand: this.expandRef.current,
|
|
23070
23096
|
copy: this.copyRef && this.copyRef.current
|
|
23071
23097
|
};
|
|
23072
|
-
const content = util(this.wrapperRef.current, rows,
|
|
23073
23098
|
// Perform type conversion on children to prevent component crash due to non-string type of children
|
|
23074
|
-
|
|
23099
|
+
// https://github.com/DouyinFE/semi-design/issues/2167
|
|
23100
|
+
const realChildren = Array.isArray(children) ? children.join('') : String(children);
|
|
23101
|
+
const content = util(this.wrapperRef.current, rows, realChildren, extraNode, ELLIPSIS_STR, suffix, pos);
|
|
23075
23102
|
return new Promise(resolve => {
|
|
23076
23103
|
this.setState({
|
|
23077
23104
|
isOverflowed: false,
|
|
23078
23105
|
ellipsisContent: content,
|
|
23079
|
-
isTruncated:
|
|
23106
|
+
isTruncated: realChildren !== content
|
|
23080
23107
|
}, resolve);
|
|
23081
23108
|
});
|
|
23082
23109
|
});
|
|
@@ -26241,7 +26268,8 @@ class AutoComplete extends BaseComponent {
|
|
|
26241
26268
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
26242
26269
|
const optionsDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(optionInstance);
|
|
26243
26270
|
const target = e.target;
|
|
26244
|
-
|
|
26271
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
26272
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
26245
26273
|
cb(e);
|
|
26246
26274
|
}
|
|
26247
26275
|
};
|
|
@@ -28082,6 +28110,7 @@ function IconChevronUp_SvgComponent(props) {
|
|
|
28082
28110
|
const IconChevronUp_IconComponent = convertIcon(IconChevronUp_SvgComponent, 'chevron_up');
|
|
28083
28111
|
/* harmony default export */ const IconChevronUp = (IconChevronUp_IconComponent);
|
|
28084
28112
|
;// CONCATENATED MODULE: ./backtop/index.tsx
|
|
28113
|
+
|
|
28085
28114
|
var backtop_rest = undefined && undefined.__rest || function (s, e) {
|
|
28086
28115
|
var t = {};
|
|
28087
28116
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -28111,7 +28140,9 @@ class BackTop extends BaseComponent {
|
|
|
28111
28140
|
this.foundation = new BackTopFoundation(this.adapter);
|
|
28112
28141
|
}
|
|
28113
28142
|
componentDidMount() {
|
|
28143
|
+
var _a;
|
|
28114
28144
|
this.foundation.init();
|
|
28145
|
+
this.handler = throttle_default()(this.handleClick, (_a = this.props.duration) !== null && _a !== void 0 ? _a : BackTop.defaultProps.duration);
|
|
28115
28146
|
}
|
|
28116
28147
|
componentWillUnmount() {
|
|
28117
28148
|
this.foundation.destroy();
|
|
@@ -28169,7 +28200,7 @@ class BackTop extends BaseComponent {
|
|
|
28169
28200
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({}, others, {
|
|
28170
28201
|
className: preCls,
|
|
28171
28202
|
style: style,
|
|
28172
|
-
onClick: e => this.
|
|
28203
|
+
onClick: e => this.handler(e),
|
|
28173
28204
|
"x-semi-prop": "children"
|
|
28174
28205
|
}), backtopBtn) : null;
|
|
28175
28206
|
return content;
|
|
@@ -34012,7 +34043,9 @@ class monthCalendar extends BaseComponent {
|
|
|
34012
34043
|
const clickOutsideHandler = e => {
|
|
34013
34044
|
const cardInstance = this.cardRef && this.cardRef.get(key);
|
|
34014
34045
|
const cardDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(cardInstance);
|
|
34015
|
-
|
|
34046
|
+
const target = e.target;
|
|
34047
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
34048
|
+
if (cardDom && !cardDom.contains(target) && !path.includes(cardDom)) {
|
|
34016
34049
|
cb();
|
|
34017
34050
|
}
|
|
34018
34051
|
};
|
|
@@ -36711,7 +36744,7 @@ class CascaderFoundation extends foundation {
|
|
|
36711
36744
|
} else if (!isEmpty_default()(keyEntities)) {
|
|
36712
36745
|
cacheValue = this._getCacheValue(keyEntities);
|
|
36713
36746
|
}
|
|
36714
|
-
const selectedValue = !this._isControlledComponent() ? cacheValue : value;
|
|
36747
|
+
const selectedValue = !this._isControlledComponent() ? cacheValue : isUndefined_default()(value) ? [] : value;
|
|
36715
36748
|
if (util_isValid(selectedValue)) {
|
|
36716
36749
|
this.updateSelectedKey(selectedValue, keyEntities);
|
|
36717
36750
|
} else {
|
|
@@ -36725,10 +36758,7 @@ class CascaderFoundation extends foundation {
|
|
|
36725
36758
|
const {
|
|
36726
36759
|
keyEntities
|
|
36727
36760
|
} = this.getStates();
|
|
36728
|
-
|
|
36729
|
-
multiple
|
|
36730
|
-
} = this.getProps();
|
|
36731
|
-
!multiple && this.updateSelectedKey(value, keyEntities);
|
|
36761
|
+
this.updateSelectedKey(value, keyEntities);
|
|
36732
36762
|
}
|
|
36733
36763
|
/**
|
|
36734
36764
|
* When single selection, the clear objects of
|
|
@@ -46700,7 +46730,8 @@ class TagInput extends BaseComponent {
|
|
|
46700
46730
|
const clickOutsideHandler = e => {
|
|
46701
46731
|
const tagInputDom = this.tagInputRef && this.tagInputRef.current;
|
|
46702
46732
|
const target = e.target;
|
|
46703
|
-
|
|
46733
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
46734
|
+
if (tagInputDom && !tagInputDom.contains(target) && !path.includes(tagInputDom)) {
|
|
46704
46735
|
cb(e);
|
|
46705
46736
|
}
|
|
46706
46737
|
};
|
|
@@ -47575,7 +47606,8 @@ class Cascader extends BaseComponent {
|
|
|
47575
47606
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
47576
47607
|
const optionsDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(optionInstance);
|
|
47577
47608
|
const target = e.target;
|
|
47578
|
-
|
|
47609
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
47610
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
47579
47611
|
cb(e);
|
|
47580
47612
|
}
|
|
47581
47613
|
};
|
|
@@ -47745,9 +47777,9 @@ class Cascader extends BaseComponent {
|
|
|
47745
47777
|
}, []);
|
|
47746
47778
|
return formatKeys;
|
|
47747
47779
|
};
|
|
47748
|
-
const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
|
|
47749
|
-
const needUpdateValue = needUpdate('value') || isEmpty_default()(prevProps) && defaultValue;
|
|
47750
47780
|
if (multiple) {
|
|
47781
|
+
const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
|
|
47782
|
+
const needUpdateValue = needUpdate('value') || isEmpty_default()(prevProps) && defaultValue;
|
|
47751
47783
|
// when value and treedata need updated
|
|
47752
47784
|
if (needUpdateTreeData || needUpdateValue) {
|
|
47753
47785
|
// update state.keyEntities
|
|
@@ -47795,8 +47827,11 @@ class Cascader extends BaseComponent {
|
|
|
47795
47827
|
this.foundation.destroy();
|
|
47796
47828
|
}
|
|
47797
47829
|
componentDidUpdate(prevProps) {
|
|
47830
|
+
if (this.props.multiple) {
|
|
47831
|
+
return;
|
|
47832
|
+
}
|
|
47798
47833
|
let isOptionsChanged = false;
|
|
47799
|
-
if (!isEqual_default()(prevProps.treeData, this.props.treeData)
|
|
47834
|
+
if (!isEqual_default()(prevProps.treeData, this.props.treeData)) {
|
|
47800
47835
|
isOptionsChanged = true;
|
|
47801
47836
|
this.foundation.collectOptions();
|
|
47802
47837
|
}
|
|
@@ -60110,15 +60145,11 @@ class DatePicker extends BaseComponent {
|
|
|
60110
60145
|
this.clickOutSideHandler = e => {
|
|
60111
60146
|
const triggerEl = this.triggerElRef && this.triggerElRef.current;
|
|
60112
60147
|
const panelEl = this.panelRef && this.panelRef.current;
|
|
60113
|
-
const
|
|
60114
|
-
const
|
|
60115
|
-
|
|
60116
|
-
|
|
60117
|
-
|
|
60118
|
-
return;
|
|
60119
|
-
} else {
|
|
60120
|
-
if (clickOutSide) {
|
|
60121
|
-
this.props.onClickOutSide();
|
|
60148
|
+
const target = e.target;
|
|
60149
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
60150
|
+
if (!(triggerEl && triggerEl.contains(target)) && !(panelEl && panelEl.contains(target)) && !(path.includes(triggerEl) || path.includes(panelEl))) {
|
|
60151
|
+
this.props.onClickOutSide();
|
|
60152
|
+
if (!this.adapter.needConfirm()) {
|
|
60122
60153
|
this.foundation.closePanel(e);
|
|
60123
60154
|
}
|
|
60124
60155
|
}
|
|
@@ -70923,9 +70954,9 @@ class Select extends BaseComponent {
|
|
|
70923
70954
|
const optionInstance = this.optionsRef && this.optionsRef.current;
|
|
70924
70955
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
70925
70956
|
const optionsDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(optionInstance);
|
|
70926
|
-
|
|
70927
|
-
|
|
70928
|
-
if (optionsDom &&
|
|
70957
|
+
const target = e.target;
|
|
70958
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
70959
|
+
if (!(optionsDom && optionsDom.contains(target)) && !(triggerDom && triggerDom.contains(target)) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
70929
70960
|
cb(e);
|
|
70930
70961
|
}
|
|
70931
70962
|
};
|
|
@@ -86589,6 +86620,7 @@ class TimePicker extends BaseComponent {
|
|
|
86589
86620
|
this.foundation = new timePicker_foundation(this.adapter);
|
|
86590
86621
|
this.timePickerRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
86591
86622
|
this.savePanelRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
|
|
86623
|
+
this.useCustomTrigger = typeof this.props.triggerRender === 'function';
|
|
86592
86624
|
}
|
|
86593
86625
|
get adapter() {
|
|
86594
86626
|
var _this2 = this;
|
|
@@ -86604,11 +86636,11 @@ class TimePicker extends BaseComponent {
|
|
|
86604
86636
|
}
|
|
86605
86637
|
this.clickOutSideHandler = e => {
|
|
86606
86638
|
const panel = this.savePanelRef && this.savePanelRef.current;
|
|
86607
|
-
const
|
|
86608
|
-
const
|
|
86609
|
-
|
|
86610
|
-
|
|
86611
|
-
this.foundation.handlePanelClose(
|
|
86639
|
+
const trigger = this.timePickerRef && this.timePickerRef.current;
|
|
86640
|
+
const target = e.target;
|
|
86641
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
86642
|
+
if (!(panel && panel.contains(target)) && !(trigger && trigger.contains(target)) && !(path.includes(trigger) || path.includes(panel))) {
|
|
86643
|
+
this.foundation.handlePanelClose(true, e);
|
|
86612
86644
|
}
|
|
86613
86645
|
};
|
|
86614
86646
|
document.addEventListener('mousedown', this.clickOutSideHandler);
|
|
@@ -86772,7 +86804,6 @@ class TimePicker extends BaseComponent {
|
|
|
86772
86804
|
rest = TimePicker_rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "dropdownMargin", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "onChangeWithDateFirst", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow", "stopPropagation"]);
|
|
86773
86805
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
86774
86806
|
const position = this.foundation.getPosition();
|
|
86775
|
-
const useCustomTrigger = typeof triggerRender === 'function';
|
|
86776
86807
|
const {
|
|
86777
86808
|
open,
|
|
86778
86809
|
inputValue,
|
|
@@ -86806,7 +86837,7 @@ class TimePicker extends BaseComponent {
|
|
|
86806
86837
|
onBlur: this.handleBlur
|
|
86807
86838
|
});
|
|
86808
86839
|
const outerProps = {};
|
|
86809
|
-
if (useCustomTrigger) {
|
|
86840
|
+
if (this.useCustomTrigger) {
|
|
86810
86841
|
outerProps.onClick = this.openPanel;
|
|
86811
86842
|
}
|
|
86812
86843
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", Object.assign({
|
|
@@ -86829,7 +86860,7 @@ class TimePicker extends BaseComponent {
|
|
|
86829
86860
|
margin: dropdownMargin,
|
|
86830
86861
|
autoAdjustOverflow: autoAdjustOverflow,
|
|
86831
86862
|
stopPropagation: stopPropagation
|
|
86832
|
-
}, useCustomTrigger ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
|
|
86863
|
+
}, this.useCustomTrigger ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
|
|
86833
86864
|
triggerRender: triggerRender,
|
|
86834
86865
|
disabled: disabled,
|
|
86835
86866
|
value: value,
|
|
@@ -90389,7 +90420,6 @@ class TreeSelectFoundation extends foundation {
|
|
|
90389
90420
|
} = this.getProps();
|
|
90390
90421
|
const realFilterProp = treeNodeFilterProp !== 'label' ? treeNodeFilterProp : get_default()(keyMaps, 'label', 'label');
|
|
90391
90422
|
const newExpandedKeys = new Set(expandedKeys);
|
|
90392
|
-
let filteredNodes = [];
|
|
90393
90423
|
let filteredOptsKeys = [];
|
|
90394
90424
|
let expandedOptsKeys = [];
|
|
90395
90425
|
let newFlattenNodes = [];
|
|
@@ -90399,21 +90429,19 @@ class TreeSelectFoundation extends foundation {
|
|
|
90399
90429
|
expandedOptsKeys.forEach(item => newExpandedKeys.add(item));
|
|
90400
90430
|
newFlattenNodes = flattenTreeData(treeData, newExpandedKeys, keyMaps);
|
|
90401
90431
|
} else {
|
|
90402
|
-
|
|
90432
|
+
filteredOptsKeys = Object.values(keyEntities).filter(item => {
|
|
90403
90433
|
const {
|
|
90404
90434
|
data
|
|
90405
90435
|
} = item;
|
|
90406
90436
|
return filter(sugInput, data, filterTreeNode, realFilterProp);
|
|
90407
|
-
});
|
|
90408
|
-
filteredNodes = filteredOpts.map(item => item.data);
|
|
90409
|
-
filteredOptsKeys = filteredOpts.map(item => item.key);
|
|
90437
|
+
}).map(item => item.key);
|
|
90410
90438
|
expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
|
|
90411
90439
|
const shownChildKeys = findDescendantKeys(filteredOptsKeys, keyEntities, true);
|
|
90412
90440
|
filteredShownKeys = new Set([...shownChildKeys, ...expandedOptsKeys]);
|
|
90413
90441
|
newFlattenNodes = flattenTreeData(treeData, new Set(expandedOptsKeys), keyMaps, showFilteredOnly && filteredShownKeys);
|
|
90414
90442
|
}
|
|
90415
90443
|
const newFilteredExpandedKeys = new Set(expandedOptsKeys);
|
|
90416
|
-
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys)
|
|
90444
|
+
this._adapter.notifySearch(sugInput, Array.from(newFilteredExpandedKeys));
|
|
90417
90445
|
this._adapter.updateState({
|
|
90418
90446
|
expandedKeys: newExpandedKeys,
|
|
90419
90447
|
flattenNodes: newFlattenNodes,
|
|
@@ -91809,7 +91837,8 @@ class TreeSelect extends BaseComponent {
|
|
|
91809
91837
|
const triggerDom = this.triggerRef && this.triggerRef.current;
|
|
91810
91838
|
const optionsDom = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default().findDOMNode(optionInstance);
|
|
91811
91839
|
const target = e.target;
|
|
91812
|
-
|
|
91840
|
+
const path = e.composedPath && e.composedPath() || [target];
|
|
91841
|
+
if (optionsDom && (!optionsDom.contains(target) || !optionsDom.contains(target.parentNode)) && triggerDom && !triggerDom.contains(target) && !(path.includes(triggerDom) || path.includes(optionsDom))) {
|
|
91813
91842
|
cb(e);
|
|
91814
91843
|
}
|
|
91815
91844
|
};
|
|
@@ -91837,8 +91866,8 @@ class TreeSelect extends BaseComponent {
|
|
|
91837
91866
|
notifySelect: (selectKey, bool, node) => {
|
|
91838
91867
|
this.props.onSelect && this.props.onSelect(selectKey, bool, node);
|
|
91839
91868
|
},
|
|
91840
|
-
notifySearch: (input, filteredExpandedKeys
|
|
91841
|
-
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys
|
|
91869
|
+
notifySearch: (input, filteredExpandedKeys) => {
|
|
91870
|
+
this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
|
|
91842
91871
|
},
|
|
91843
91872
|
cacheFlattenNodes: bool => {
|
|
91844
91873
|
this.setState({
|