@douyinfe/semi-ui 2.49.0 → 2.49.2

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.
@@ -131,11 +131,7 @@ class YearAndMonth extends _baseComponent.default {
131
131
  const right = _constants2.strings.PANEL_TYPE_RIGHT;
132
132
  const needDisabled = year => {
133
133
  if (panelType === right && currentYear[left]) {
134
- if (currentMonth[left] <= currentMonth[right]) {
135
- return currentYear[left] > year;
136
- } else {
137
- return currentYear[left] >= year;
138
- }
134
+ return currentYear[left] > year;
139
135
  }
140
136
  return false;
141
137
  };
@@ -130,7 +130,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
130
130
  onDeselect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
131
131
  onSelect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
132
132
  allowCreate?: boolean;
133
- triggerRender?: (props?: import("../select").TriggerRenderProps) => React.ReactNode;
133
+ triggerRender?: (props: import("../select").TriggerRenderProps) => React.ReactNode;
134
134
  onClear?: () => void;
135
135
  virtualize?: import("../select").virtualListProps;
136
136
  onFocus?: (e: React.FocusEvent<Element, Element>) => void;
@@ -76,7 +76,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
76
76
  onDeselect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
77
77
  onSelect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
78
78
  allowCreate?: boolean;
79
- triggerRender?: (props?: import("../select/index").TriggerRenderProps) => import("react").ReactNode;
79
+ triggerRender?: (props: import("../select/index").TriggerRenderProps) => import("react").ReactNode;
80
80
  onClear?: () => void;
81
81
  virtualize?: import("../select/index").virtualListProps;
82
82
  onFocus?: (e: import("react").FocusEvent<Element, Element>) => void;
@@ -1,4 +1,6 @@
1
1
  import './_base/base.css';
2
+ export { default as BaseFoundation } from '@douyinfe/semi-foundation/lib/cjs/base/foundation';
3
+ export { default as BaseComponent } from "./_base/baseComponent";
2
4
  export { default as Anchor } from './anchor';
3
5
  export { default as AutoComplete } from './autoComplete';
4
6
  export { default as Avatar } from './avatar';
package/lib/cjs/index.js CHANGED
@@ -51,6 +51,18 @@ Object.defineProperty(exports, "Banner", {
51
51
  return _banner.default;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "BaseComponent", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _baseComponent.default;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "BaseFoundation", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _foundation.default;
64
+ }
65
+ });
54
66
  Object.defineProperty(exports, "Breadcrumb", {
55
67
  enumerable: true,
56
68
  get: function () {
@@ -562,6 +574,8 @@ Object.defineProperty(exports, "withFormState", {
562
574
  }
563
575
  });
564
576
  require("./_base/base.css");
577
+ var _foundation = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/base/foundation"));
578
+ var _baseComponent = _interopRequireDefault(require("./_base/baseComponent"));
565
579
  var _anchor = _interopRequireDefault(require("./anchor"));
566
580
  var _autoComplete = _interopRequireDefault(require("./autoComplete"));
567
581
  var _avatar = _interopRequireDefault(require("./avatar"));
@@ -117,6 +117,7 @@ class NotificationList extends _baseComponent.default {
117
117
  }
118
118
  static addNotice(notice) {
119
119
  var _a;
120
+ notice = Object.assign(Object.assign({}, defaultConfig), notice);
120
121
  const id = (_a = notice.id) !== null && _a !== void 0 ? _a : (0, _uuid.default)('notification');
121
122
  if (!ref) {
122
123
  const {
@@ -160,27 +161,27 @@ class NotificationList extends _baseComponent.default {
160
161
  return id;
161
162
  }
162
163
  static info(opts) {
163
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
164
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
164
165
  type: 'info'
165
166
  }));
166
167
  }
167
168
  static success(opts) {
168
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
169
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
169
170
  type: 'success'
170
171
  }));
171
172
  }
172
173
  static error(opts) {
173
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
174
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
174
175
  type: 'error'
175
176
  }));
176
177
  }
177
178
  static warning(opts) {
178
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
179
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
179
180
  type: 'warning'
180
181
  }));
181
182
  }
182
183
  static open(opts) {
183
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
184
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
184
185
  type: 'default'
185
186
  }));
186
187
  }
@@ -139,7 +139,7 @@ export type SelectProps = {
139
139
  onDeselect?: (value: SelectProps['value'], option: Record<string, any>) => void;
140
140
  onSelect?: (value: SelectProps['value'], option: Record<string, any>) => void;
141
141
  allowCreate?: boolean;
142
- triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
142
+ triggerRender?: (props: TriggerRenderProps) => React.ReactNode;
143
143
  onClear?: () => void;
144
144
  virtualize?: virtualListProps;
145
145
  onFocus?: (e: React.FocusEvent) => void;
@@ -77,7 +77,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
77
77
  onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
78
78
  renderSelectedItem?: RenderSelectedItem;
79
79
  getPopupContainer?: () => HTMLElement;
80
- triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
80
+ triggerRender?: (props: TriggerRenderProps) => React.ReactNode;
81
81
  onBlur?: (e: React.MouseEvent) => void;
82
82
  onChange?: OnChange;
83
83
  onFocus?: (e: React.MouseEvent) => void;
@@ -190,7 +190,6 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
190
190
  triggerRef: React.RefObject<HTMLDivElement>;
191
191
  optionsRef: React.RefObject<any>;
192
192
  clickOutsideHandler: any;
193
- _flattenNodes: TreeState['flattenNodes'];
194
193
  onNodeClick: any;
195
194
  onNodeDoubleClick: any;
196
195
  onMotionEnd: any;
@@ -247,6 +246,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
247
246
  };
248
247
  getTreeNodeKey: (treeNode: TreeNodeData) => string;
249
248
  handlePopoverClose: (isVisible: any) => void;
249
+ afterClose: () => void;
250
250
  renderTreeNode: (treeNode: FlattenNode, ind: number, style: React.CSSProperties) => JSX.Element;
251
251
  itemKey: (index: number, data: Record<string, any>) => any;
252
252
  renderNodeList: () => JSX.Element;
@@ -689,13 +689,27 @@ class TreeSelect extends _baseComponent.default {
689
689
  searchAutoFocus,
690
690
  searchPosition
691
691
  } = this.props;
692
- if (isVisible === false && Boolean(filterTreeNode)) {
693
- this.foundation.clearInput();
692
+ // inputValue 清空,如果有选中值的话,选中项能够快速回显
693
+ // Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
694
+ if (isVisible === false && filterTreeNode) {
695
+ this.foundation.clearInputValue();
694
696
  }
695
697
  if (filterTreeNode && searchPosition === _constants.strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
696
698
  this.foundation.focusInput(true);
697
699
  }
698
700
  };
701
+ this.afterClose = () => {
702
+ // flattenNode 的变化将导致弹出层面板中的选项数目变化
703
+ // 在弹层完全收起之后,再通过 clearInput 重新计算 state 中的 expandedKey, flattenNode
704
+ // 防止在弹出层未收起时弹层面板中选项数目变化导致视觉上出现弹层闪动问题
705
+ // Changes to flattenNode will cause the number of options in the popup panel to change
706
+ // After the pop-up layer is completely closed, recalculate the expandedKey and flattenNode in the state through clearInput.
707
+ // Prevent the pop-up layer from flickering visually due to changes in the number of options in the pop-up panel when the pop-up layer is not collapsed.
708
+ const {
709
+ filterTreeNode
710
+ } = this.props;
711
+ filterTreeNode && this.foundation.clearInput();
712
+ };
699
713
  this.renderTreeNode = (treeNode, ind, style) => {
700
714
  const {
701
715
  data,
@@ -728,6 +742,7 @@ class TreeSelect extends _baseComponent.default {
728
742
  this.renderNodeList = () => {
729
743
  const {
730
744
  flattenNodes,
745
+ cachedFlattenNodes,
731
746
  motionKeys,
732
747
  motionType,
733
748
  filteredKeys
@@ -743,7 +758,7 @@ class TreeSelect extends _baseComponent.default {
743
758
  if (!virtualize || (0, _isEmpty2.default)(virtualize)) {
744
759
  return /*#__PURE__*/_react.default.createElement(_nodeList.default, {
745
760
  flattenNodes: flattenNodes,
746
- flattenList: this._flattenNodes,
761
+ flattenList: cachedFlattenNodes,
747
762
  motionKeys: motionExpand ? motionKeys : new Set([]),
748
763
  motionType: motionType,
749
764
  // When motionKeys is empty, but filteredKeys is not empty (that is, the search hits), this situation should be distinguished from ordinary motionKeys
@@ -862,6 +877,7 @@ class TreeSelect extends _baseComponent.default {
862
877
  keyEntities: {},
863
878
  treeData: [],
864
879
  flattenNodes: [],
880
+ cachedFlattenNodes: undefined,
865
881
  selectedKeys: [],
866
882
  checkedKeys: new Set(),
867
883
  halfCheckedKeys: new Set(),
@@ -891,6 +907,7 @@ class TreeSelect extends _baseComponent.default {
891
907
  };
892
908
  }
893
909
  static getDerivedStateFromProps(props, prevState) {
910
+ var _a;
894
911
  const {
895
912
  prevProps,
896
913
  rePosKey
@@ -908,6 +925,8 @@ class TreeSelect extends _baseComponent.default {
908
925
  };
909
926
  const needUpdateTreeData = needUpdate('treeData');
910
927
  const needUpdateExpandedKeys = needUpdate('expandedKeys');
928
+ const isExpandControlled = ('expandedKeys' in props);
929
+ const isSearching = Boolean(props.filterTreeNode && prevState.inputValue && prevState.inputValue.length);
911
930
  // TreeNode
912
931
  if (needUpdateTreeData) {
913
932
  treeData = props.treeData;
@@ -926,31 +945,97 @@ class TreeSelect extends _baseComponent.default {
926
945
  }
927
946
  }
928
947
  const expandAllWhenDataChange = needUpdateTreeData && props.expandAll;
929
- // expandedKeys
930
- if (needUpdateExpandedKeys || prevProps && needUpdate('autoExpandParent')) {
931
- newState.expandedKeys = (0, _treeUtil.calcExpandedKeys)(props.expandedKeys, keyEntities, props.autoExpandParent || !prevProps);
932
- // only show animation when treeData does not change
933
- if (prevProps && props.motion && !treeData) {
934
- const {
935
- motionKeys,
936
- motionType
937
- } = (0, _treeUtil.calcMotionKeys)(prevState.expandedKeys, newState.expandedKeys, keyEntities);
938
- newState.motionKeys = new Set(motionKeys);
939
- newState.motionType = motionType;
948
+ if (!isSearching) {
949
+ // expandedKeys
950
+ if (needUpdateExpandedKeys || prevProps && needUpdate('autoExpandParent')) {
951
+ newState.expandedKeys = (0, _treeUtil.calcExpandedKeys)(props.expandedKeys, keyEntities, props.autoExpandParent || !prevProps);
952
+ // only show animation when treeData does not change
953
+ if (prevProps && props.motion && !treeData) {
954
+ const {
955
+ motionKeys,
956
+ motionType
957
+ } = (0, _treeUtil.calcMotionKeys)(prevState.expandedKeys, newState.expandedKeys, keyEntities);
958
+ newState.motionKeys = new Set(motionKeys);
959
+ newState.motionType = motionType;
960
+ if (motionType === 'hide') {
961
+ // cache flatten nodes: expandedKeys changed may not be triggered by interaction
962
+ newState.cachedFlattenNodes = (0, _treeUtil2.cloneDeep)(prevState.flattenNodes);
963
+ }
964
+ }
965
+ } else if (!prevProps && (props.defaultExpandAll || props.expandAll) || expandAllWhenDataChange) {
966
+ newState.expandedKeys = new Set(Object.keys(keyEntities));
967
+ } else if (!prevProps && props.defaultExpandedKeys) {
968
+ newState.expandedKeys = (0, _treeUtil.calcExpandedKeys)(props.defaultExpandedKeys, keyEntities);
969
+ } else if (!prevProps && props.defaultValue) {
970
+ newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)((0, _treeUtil.normalizeValue)(props.defaultValue, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
971
+ } else if (!prevProps && props.value) {
972
+ newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)((0, _treeUtil.normalizeValue)(props.value, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
973
+ } else if (!isExpandControlled && needUpdateTreeData && props.value) {
974
+ // 当 treeData 已经设置具体的值,并且设置了 props.loadData ,则认为 treeData 的更新是因为 loadData 导致的
975
+ // 如果是因为 loadData 导致 treeData改变, 此时在这里重新计算 key 会导致为未选中的展开项目被收起
976
+ // 所以此时不需要重新计算 expandedKeys,因为在点击展开按钮时候已经把被展开的项添加到 expandedKeys 中
977
+ // When treeData has a specific value and props.loadData is set, it is considered that the update of treeData is caused by loadData
978
+ // If the treeData is changed because of loadData, recalculating the key here will cause the unselected expanded items to be collapsed
979
+ // So there is no need to recalculate expandedKeys at this time, because the expanded item has been added to expandedKeys when the expand button is clicked
980
+ if (!(prevState.treeData && ((_a = prevState.treeData) === null || _a === void 0 ? void 0 : _a.length) > 0 && props.loadData)) {
981
+ newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)(props.value, keyEntities, props.multiple, valueEntities);
982
+ }
983
+ }
984
+ if (!newState.expandedKeys) {
985
+ delete newState.expandedKeys;
986
+ }
987
+ if (treeData || newState.expandedKeys) {
988
+ const flattenNodes = (0, _treeUtil.flattenTreeData)(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys, keyMaps);
989
+ newState.flattenNodes = flattenNodes;
990
+ }
991
+ } else {
992
+ let filteredState;
993
+ // treeData changed while searching
994
+ if (treeData) {
995
+ // Get filter data
996
+ filteredState = (0, _treeUtil.filterTreeData)({
997
+ treeData,
998
+ inputValue: prevState.inputValue,
999
+ filterTreeNode: props.filterTreeNode,
1000
+ filterProps: props.treeNodeFilterProp,
1001
+ showFilteredOnly: props.showFilteredOnly,
1002
+ keyEntities: newState.keyEntities,
1003
+ prevExpandedKeys: [...prevState.filteredExpandedKeys],
1004
+ keyMaps: keyMaps
1005
+ });
1006
+ newState.flattenNodes = filteredState.flattenNodes;
1007
+ newState.motionKeys = new Set([]);
1008
+ newState.filteredKeys = filteredState.filteredKeys;
1009
+ newState.filteredShownKeys = filteredState.filteredShownKeys;
1010
+ newState.filteredExpandedKeys = filteredState.filteredExpandedKeys;
1011
+ }
1012
+ // expandedKeys changed while searching
1013
+ if (props.expandedKeys) {
1014
+ newState.filteredExpandedKeys = (0, _treeUtil.calcExpandedKeys)(props.expandedKeys, keyEntities, props.autoExpandParent || !prevProps);
1015
+ if (prevProps && props.motion) {
1016
+ const prevKeys = prevState ? prevState.filteredExpandedKeys : new Set([]);
1017
+ // only show animation when treeData does not change
1018
+ if (!treeData) {
1019
+ const motionResult = (0, _treeUtil.calcMotionKeys)(prevKeys, newState.filteredExpandedKeys, keyEntities);
1020
+ let {
1021
+ motionKeys
1022
+ } = motionResult;
1023
+ const {
1024
+ motionType
1025
+ } = motionResult;
1026
+ if (props.showFilteredOnly) {
1027
+ motionKeys = motionKeys.filter(key => prevState.filteredShownKeys.has(key));
1028
+ }
1029
+ if (motionType === 'hide') {
1030
+ // cache flatten nodes: expandedKeys changed may not be triggered by interaction
1031
+ newState.cachedFlattenNodes = (0, _treeUtil2.cloneDeep)(prevState.flattenNodes);
1032
+ }
1033
+ newState.motionKeys = new Set(motionKeys);
1034
+ newState.motionType = motionType;
1035
+ }
1036
+ }
1037
+ newState.flattenNodes = (0, _treeUtil.flattenTreeData)(treeData || prevState.treeData, newState.filteredExpandedKeys || prevState.filteredExpandedKeys, keyMaps, props.showFilteredOnly && prevState.filteredShownKeys);
940
1038
  }
941
- } else if (!prevProps && (props.defaultExpandAll || props.expandAll) || expandAllWhenDataChange) {
942
- newState.expandedKeys = new Set(Object.keys(keyEntities));
943
- } else if (!prevProps && props.defaultExpandedKeys) {
944
- newState.expandedKeys = (0, _treeUtil.calcExpandedKeys)(props.defaultExpandedKeys, keyEntities);
945
- } else if (!prevProps && props.defaultValue) {
946
- newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)((0, _treeUtil.normalizeValue)(props.defaultValue, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
947
- } else if (!prevProps && props.value) {
948
- newState.expandedKeys = (0, _treeUtil.calcExpandedKeysForValues)((0, _treeUtil.normalizeValue)(props.value, withObject, keyMaps), keyEntities, props.multiple, valueEntities);
949
- }
950
- // flattenNodes
951
- if (treeData || needUpdateExpandedKeys) {
952
- const flattenNodes = (0, _treeUtil.flattenTreeData)(treeData || prevState.treeData, newState.expandedKeys || prevState.expandedKeys, keyMaps);
953
- newState.flattenNodes = flattenNodes;
954
1039
  }
955
1040
  // selectedKeys: single mode controlled
956
1041
  const isMultiple = props.multiple;
@@ -1057,7 +1142,9 @@ class TreeSelect extends _baseComponent.default {
1057
1142
  this.props.onSearch && this.props.onSearch(input, filteredExpandedKeys);
1058
1143
  },
1059
1144
  cacheFlattenNodes: bool => {
1060
- this._flattenNodes = bool ? (0, _treeUtil2.cloneDeep)(this.state.flattenNodes) : null;
1145
+ this.setState({
1146
+ cachedFlattenNodes: bool ? (0, _treeUtil2.cloneDeep)(this.state.flattenNodes) : undefined
1147
+ });
1061
1148
  },
1062
1149
  notifyLoad: (newLoadedKeys, data) => {
1063
1150
  const {
@@ -1202,7 +1289,8 @@ class TreeSelect extends _baseComponent.default {
1202
1289
  autoAdjustOverflow: autoAdjustOverflow,
1203
1290
  mouseLeaveDelay: mouseLeaveDelay,
1204
1291
  mouseEnterDelay: mouseEnterDelay,
1205
- onVisibleChange: this.handlePopoverClose
1292
+ onVisibleChange: this.handlePopoverClose,
1293
+ afterClose: this.afterClose
1206
1294
  }, selection);
1207
1295
  }
1208
1296
  }
@@ -124,11 +124,7 @@ class YearAndMonth extends BaseComponent {
124
124
  const right = strings.PANEL_TYPE_RIGHT;
125
125
  const needDisabled = year => {
126
126
  if (panelType === right && currentYear[left]) {
127
- if (currentMonth[left] <= currentMonth[right]) {
128
- return currentYear[left] > year;
129
- } else {
130
- return currentYear[left] >= year;
131
- }
127
+ return currentYear[left] > year;
132
128
  }
133
129
  return false;
134
130
  };
@@ -130,7 +130,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
130
130
  onDeselect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
131
131
  onSelect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
132
132
  allowCreate?: boolean;
133
- triggerRender?: (props?: import("../select").TriggerRenderProps) => React.ReactNode;
133
+ triggerRender?: (props: import("../select").TriggerRenderProps) => React.ReactNode;
134
134
  onClear?: () => void;
135
135
  virtualize?: import("../select").virtualListProps;
136
136
  onFocus?: (e: React.FocusEvent<Element, Element>) => void;
@@ -76,7 +76,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
76
76
  onDeselect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
77
77
  onSelect?: (value: string | number | any[] | Record<string, any>, option: Record<string, any>) => void;
78
78
  allowCreate?: boolean;
79
- triggerRender?: (props?: import("../select/index").TriggerRenderProps) => import("react").ReactNode;
79
+ triggerRender?: (props: import("../select/index").TriggerRenderProps) => import("react").ReactNode;
80
80
  onClear?: () => void;
81
81
  virtualize?: import("../select/index").virtualListProps;
82
82
  onFocus?: (e: import("react").FocusEvent<Element, Element>) => void;
package/lib/es/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import './_base/base.css';
2
+ export { default as BaseFoundation } from '@douyinfe/semi-foundation/lib/es/base/foundation';
3
+ export { default as BaseComponent } from "./_base/baseComponent";
2
4
  export { default as Anchor } from './anchor';
3
5
  export { default as AutoComplete } from './autoComplete';
4
6
  export { default as Avatar } from './avatar';
package/lib/es/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import './_base/base.css';
2
+ export { default as BaseFoundation } from '@douyinfe/semi-foundation/lib/es/base/foundation';
3
+ export { default as BaseComponent } from "./_base/baseComponent";
2
4
  export { default as Anchor } from './anchor';
3
5
  export { default as AutoComplete } from './autoComplete';
4
6
  export { default as Avatar } from './avatar';
@@ -110,6 +110,7 @@ class NotificationList extends BaseComponent {
110
110
  }
111
111
  static addNotice(notice) {
112
112
  var _a;
113
+ notice = Object.assign(Object.assign({}, defaultConfig), notice);
113
114
  const id = (_a = notice.id) !== null && _a !== void 0 ? _a : getUuid('notification');
114
115
  if (!ref) {
115
116
  const {
@@ -153,27 +154,27 @@ class NotificationList extends BaseComponent {
153
154
  return id;
154
155
  }
155
156
  static info(opts) {
156
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
157
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
157
158
  type: 'info'
158
159
  }));
159
160
  }
160
161
  static success(opts) {
161
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
162
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
162
163
  type: 'success'
163
164
  }));
164
165
  }
165
166
  static error(opts) {
166
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
167
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
167
168
  type: 'error'
168
169
  }));
169
170
  }
170
171
  static warning(opts) {
171
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
172
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
172
173
  type: 'warning'
173
174
  }));
174
175
  }
175
176
  static open(opts) {
176
- return this.addNotice(Object.assign(Object.assign(Object.assign({}, defaultConfig), opts), {
177
+ return this.addNotice(Object.assign(Object.assign({}, opts), {
177
178
  type: 'default'
178
179
  }));
179
180
  }
@@ -139,7 +139,7 @@ export type SelectProps = {
139
139
  onDeselect?: (value: SelectProps['value'], option: Record<string, any>) => void;
140
140
  onSelect?: (value: SelectProps['value'], option: Record<string, any>) => void;
141
141
  allowCreate?: boolean;
142
- triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
142
+ triggerRender?: (props: TriggerRenderProps) => React.ReactNode;
143
143
  onClear?: () => void;
144
144
  virtualize?: virtualListProps;
145
145
  onFocus?: (e: React.FocusEvent) => void;
@@ -77,7 +77,7 @@ export interface TreeSelectProps extends Omit<BasicTreeSelectProps, OverrideComm
77
77
  onSelect?: (selectedKey: string, selected: boolean, selectedNode: TreeNodeData) => void;
78
78
  renderSelectedItem?: RenderSelectedItem;
79
79
  getPopupContainer?: () => HTMLElement;
80
- triggerRender?: (props?: TriggerRenderProps) => React.ReactNode;
80
+ triggerRender?: (props: TriggerRenderProps) => React.ReactNode;
81
81
  onBlur?: (e: React.MouseEvent) => void;
82
82
  onChange?: OnChange;
83
83
  onFocus?: (e: React.MouseEvent) => void;
@@ -190,7 +190,6 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
190
190
  triggerRef: React.RefObject<HTMLDivElement>;
191
191
  optionsRef: React.RefObject<any>;
192
192
  clickOutsideHandler: any;
193
- _flattenNodes: TreeState['flattenNodes'];
194
193
  onNodeClick: any;
195
194
  onNodeDoubleClick: any;
196
195
  onMotionEnd: any;
@@ -247,6 +246,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
247
246
  };
248
247
  getTreeNodeKey: (treeNode: TreeNodeData) => string;
249
248
  handlePopoverClose: (isVisible: any) => void;
249
+ afterClose: () => void;
250
250
  renderTreeNode: (treeNode: FlattenNode, ind: number, style: React.CSSProperties) => JSX.Element;
251
251
  itemKey: (index: number, data: Record<string, any>) => any;
252
252
  renderNodeList: () => JSX.Element;