@douyinfe/semi-ui 2.30.0-beta.0 → 2.30.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.
@@ -49,7 +49,16 @@ function confirm(props) {
49
49
  };
50
50
 
51
51
  function render(renderProps) {
52
+ const {
53
+ afterClose
54
+ } = renderProps; //@ts-ignore
55
+
52
56
  _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_ConfirmModal.default, Object.assign({}, renderProps, {
57
+ afterClose: function () {
58
+ //@ts-ignore
59
+ afterClose === null || afterClose === void 0 ? void 0 : afterClose(...arguments);
60
+ destroy();
61
+ },
53
62
  motion: props.motion
54
63
  })), div);
55
64
  }
@@ -87,11 +87,11 @@ export declare type OverrideCommonState = 'keyEntities' | 'treeData' | 'disabled
87
87
  export interface TreeSelectState extends Omit<BasicTreeSelectInnerData, OverrideCommonState | 'prevProps'>, Pick<TreeState, OverrideCommonState> {
88
88
  inputTriggerFocus: boolean;
89
89
  isOpen: boolean;
90
- isInput: boolean;
91
90
  rePosKey: number;
92
91
  dropdownMinWidth: null | number;
93
92
  isHovering: boolean;
94
93
  prevProps: TreeSelectProps;
94
+ isFocus: boolean;
95
95
  }
96
96
  declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
97
97
  static contextType: React.Context<ContextValue>;
@@ -179,6 +179,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
179
179
  'aria-label': PropTypes.Requireable<string>;
180
180
  showRestTagsPopover: PropTypes.Requireable<boolean>;
181
181
  restTagsPopoverProps: PropTypes.Requireable<object>;
182
+ preventScroll: PropTypes.Requireable<boolean>;
182
183
  };
183
184
  static defaultProps: Partial<TreeSelectProps>;
184
185
  inputRef: React.RefObject<typeof Input>;
@@ -442,12 +442,11 @@ class TreeSelect extends _baseComponent.default {
442
442
  triggerRender
443
443
  } = this.props;
444
444
  const {
445
- isOpen,
446
- isInput,
447
445
  inputValue,
448
446
  selectedKeys,
449
447
  checkedKeys,
450
- keyEntities
448
+ keyEntities,
449
+ isFocus
451
450
  } = this.state;
452
451
  const filterable = Boolean(filterTreeNode);
453
452
  const useCustomTrigger = typeof triggerRender === 'function';
@@ -459,7 +458,7 @@ class TreeSelect extends _baseComponent.default {
459
458
  const isEmptyTriggerSearch = isTriggerPositionSearch && (0, _isEmpty2.default)(checkedKeys);
460
459
  const isValueTriggerSearch = isTriggerPositionSearch && !(0, _isEmpty2.default)(checkedKeys);
461
460
  const classNames = useCustomTrigger ? (0, _classnames.default)(className) : (0, _classnames.default)(prefixcls, {
462
- [`${prefixcls}-focus`]: isOpen && !isInput,
461
+ [`${prefixcls}-focus`]: isFocus,
463
462
  [`${prefixcls}-disabled`]: disabled,
464
463
  [`${prefixcls}-single`]: !multiple,
465
464
  [`${prefixcls}-multiple`]: multiple,
@@ -599,7 +598,8 @@ class TreeSelect extends _baseComponent.default {
599
598
  showRestTagsPopover,
600
599
  restTagsPopoverProps,
601
600
  searchPosition,
602
- filterTreeNode
601
+ filterTreeNode,
602
+ preventScroll
603
603
  } = this.props;
604
604
  const {
605
605
  keyEntities,
@@ -638,7 +638,8 @@ class TreeSelect extends _baseComponent.default {
638
638
  autoFocus: autoFocus,
639
639
  renderTagItem: (itemKey, index) => this.renderTagItem(itemKey, index),
640
640
  onRemove: itemKey => this.removeTag(itemKey),
641
- expandRestTagsOnClick: false
641
+ expandRestTagsOnClick: false,
642
+ preventScroll: preventScroll
642
643
  });
643
644
  }; // render Tree
644
645
 
@@ -956,7 +957,8 @@ class TreeSelect extends _baseComponent.default {
956
957
  this.state = {
957
958
  inputTriggerFocus: false,
958
959
  isOpen: false,
959
- isInput: false,
960
+ isFocus: false,
961
+ // isInput: false,
960
962
  rePosKey: key,
961
963
  dropdownMinWidth: null,
962
964
  inputValue: '',
@@ -1255,7 +1257,12 @@ class TreeSelect extends _baseComponent.default {
1255
1257
  updateInputFocus: bool => {
1256
1258
  if (bool) {
1257
1259
  if (this.inputRef && this.inputRef.current) {
1258
- this.inputRef.current.focus();
1260
+ const {
1261
+ preventScroll
1262
+ } = this.props;
1263
+ this.inputRef.current.focus({
1264
+ preventScroll
1265
+ });
1259
1266
  }
1260
1267
 
1261
1268
  if (this.tagInputRef && this.tagInputRef.current) {
@@ -1270,8 +1277,12 @@ class TreeSelect extends _baseComponent.default {
1270
1277
  this.tagInputRef.current.blur();
1271
1278
  }
1272
1279
  }
1273
- } // eslint-disable-line
1274
-
1280
+ },
1281
+ updateIsFocus: bool => {
1282
+ this.setState({
1283
+ isFocus: bool
1284
+ });
1285
+ }
1275
1286
  });
1276
1287
  }
1277
1288
 
@@ -1408,7 +1419,8 @@ TreeSelect.propTypes = {
1408
1419
  checkRelation: _propTypes.default.string,
1409
1420
  'aria-label': _propTypes.default.string,
1410
1421
  showRestTagsPopover: _propTypes.default.bool,
1411
- restTagsPopoverProps: _propTypes.default.object
1422
+ restTagsPopoverProps: _propTypes.default.object,
1423
+ preventScroll: _propTypes.default.bool
1412
1424
  };
1413
1425
  TreeSelect.defaultProps = {
1414
1426
  searchPosition: _constants.strings.SEARCH_POSITION_DROPDOWN,
@@ -28,7 +28,16 @@ export default function confirm(props) {
28
28
  };
29
29
 
30
30
  function render(renderProps) {
31
+ const {
32
+ afterClose
33
+ } = renderProps; //@ts-ignore
34
+
31
35
  ReactDOM.render( /*#__PURE__*/React.createElement(ConfirmModal, Object.assign({}, renderProps, {
36
+ afterClose: function () {
37
+ //@ts-ignore
38
+ afterClose === null || afterClose === void 0 ? void 0 : afterClose(...arguments);
39
+ destroy();
40
+ },
32
41
  motion: props.motion
33
42
  })), div);
34
43
  }
@@ -87,11 +87,11 @@ export declare type OverrideCommonState = 'keyEntities' | 'treeData' | 'disabled
87
87
  export interface TreeSelectState extends Omit<BasicTreeSelectInnerData, OverrideCommonState | 'prevProps'>, Pick<TreeState, OverrideCommonState> {
88
88
  inputTriggerFocus: boolean;
89
89
  isOpen: boolean;
90
- isInput: boolean;
91
90
  rePosKey: number;
92
91
  dropdownMinWidth: null | number;
93
92
  isHovering: boolean;
94
93
  prevProps: TreeSelectProps;
94
+ isFocus: boolean;
95
95
  }
96
96
  declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState> {
97
97
  static contextType: React.Context<ContextValue>;
@@ -179,6 +179,7 @@ declare class TreeSelect extends BaseComponent<TreeSelectProps, TreeSelectState>
179
179
  'aria-label': PropTypes.Requireable<string>;
180
180
  showRestTagsPopover: PropTypes.Requireable<boolean>;
181
181
  restTagsPopoverProps: PropTypes.Requireable<object>;
182
+ preventScroll: PropTypes.Requireable<boolean>;
182
183
  };
183
184
  static defaultProps: Partial<TreeSelectProps>;
184
185
  inputRef: React.RefObject<typeof Input>;
@@ -393,12 +393,11 @@ class TreeSelect extends BaseComponent {
393
393
  triggerRender
394
394
  } = this.props;
395
395
  const {
396
- isOpen,
397
- isInput,
398
396
  inputValue,
399
397
  selectedKeys,
400
398
  checkedKeys,
401
- keyEntities
399
+ keyEntities,
400
+ isFocus
402
401
  } = this.state;
403
402
  const filterable = Boolean(filterTreeNode);
404
403
  const useCustomTrigger = typeof triggerRender === 'function';
@@ -412,7 +411,7 @@ class TreeSelect extends BaseComponent {
412
411
 
413
412
  const isValueTriggerSearch = isTriggerPositionSearch && !_isEmpty(checkedKeys);
414
413
  const classNames = useCustomTrigger ? cls(className) : cls(prefixcls, {
415
- [`${prefixcls}-focus`]: isOpen && !isInput,
414
+ [`${prefixcls}-focus`]: isFocus,
416
415
  [`${prefixcls}-disabled`]: disabled,
417
416
  [`${prefixcls}-single`]: !multiple,
418
417
  [`${prefixcls}-multiple`]: multiple,
@@ -552,7 +551,8 @@ class TreeSelect extends BaseComponent {
552
551
  showRestTagsPopover,
553
552
  restTagsPopoverProps,
554
553
  searchPosition,
555
- filterTreeNode
554
+ filterTreeNode,
555
+ preventScroll
556
556
  } = this.props;
557
557
  const {
558
558
  keyEntities,
@@ -591,7 +591,8 @@ class TreeSelect extends BaseComponent {
591
591
  autoFocus: autoFocus,
592
592
  renderTagItem: (itemKey, index) => this.renderTagItem(itemKey, index),
593
593
  onRemove: itemKey => this.removeTag(itemKey),
594
- expandRestTagsOnClick: false
594
+ expandRestTagsOnClick: false,
595
+ preventScroll: preventScroll
595
596
  });
596
597
  }; // render Tree
597
598
 
@@ -909,7 +910,8 @@ class TreeSelect extends BaseComponent {
909
910
  this.state = {
910
911
  inputTriggerFocus: false,
911
912
  isOpen: false,
912
- isInput: false,
913
+ isFocus: false,
914
+ // isInput: false,
913
915
  rePosKey: key,
914
916
  dropdownMinWidth: null,
915
917
  inputValue: '',
@@ -1207,7 +1209,12 @@ class TreeSelect extends BaseComponent {
1207
1209
  updateInputFocus: bool => {
1208
1210
  if (bool) {
1209
1211
  if (this.inputRef && this.inputRef.current) {
1210
- this.inputRef.current.focus();
1212
+ const {
1213
+ preventScroll
1214
+ } = this.props;
1215
+ this.inputRef.current.focus({
1216
+ preventScroll
1217
+ });
1211
1218
  }
1212
1219
 
1213
1220
  if (this.tagInputRef && this.tagInputRef.current) {
@@ -1222,8 +1229,12 @@ class TreeSelect extends BaseComponent {
1222
1229
  this.tagInputRef.current.blur();
1223
1230
  }
1224
1231
  }
1225
- } // eslint-disable-line
1226
-
1232
+ },
1233
+ updateIsFocus: bool => {
1234
+ this.setState({
1235
+ isFocus: bool
1236
+ });
1237
+ }
1227
1238
  });
1228
1239
  }
1229
1240
 
@@ -1360,7 +1371,8 @@ TreeSelect.propTypes = {
1360
1371
  checkRelation: PropTypes.string,
1361
1372
  'aria-label': PropTypes.string,
1362
1373
  showRestTagsPopover: PropTypes.bool,
1363
- restTagsPopoverProps: PropTypes.object
1374
+ restTagsPopoverProps: PropTypes.object,
1375
+ preventScroll: PropTypes.bool
1364
1376
  };
1365
1377
  TreeSelect.defaultProps = {
1366
1378
  searchPosition: strings.SEARCH_POSITION_DROPDOWN,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.30.0-beta.0",
3
+ "version": "2.30.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.30.0-beta.0",
21
- "@douyinfe/semi-animation-react": "2.30.0-beta.0",
22
- "@douyinfe/semi-foundation": "2.30.0-beta.0",
23
- "@douyinfe/semi-icons": "2.30.0-beta.0",
24
- "@douyinfe/semi-illustrations": "2.30.0-beta.0",
25
- "@douyinfe/semi-theme-default": "2.30.0-beta.0",
20
+ "@douyinfe/semi-animation": "2.30.0",
21
+ "@douyinfe/semi-animation-react": "2.30.0",
22
+ "@douyinfe/semi-foundation": "2.30.0",
23
+ "@douyinfe/semi-icons": "2.30.0",
24
+ "@douyinfe/semi-illustrations": "2.30.0",
25
+ "@douyinfe/semi-theme-default": "2.30.0",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "330e8cf3c8bced4dee7d5c77c7e3931a0f40376b",
72
+ "gitHead": "c433ecebd974f8bb013a030b22d9a22cb8e70e9e",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",