@douyinfe/semi-foundation 2.67.0 → 2.67.2-alpha.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.
@@ -378,9 +378,16 @@ class SelectFoundation extends _foundation.default {
378
378
  closeCb,
379
379
  notToggleInput
380
380
  } = closeConfig || {};
381
+ const {
382
+ isFocus
383
+ } = this.getStates();
381
384
  this._adapter.closeMenu();
382
385
  this._adapter.notifyDropdownVisibleChange(false);
383
386
  this._adapter.setIsFocusInContainer(false);
387
+ if (isFocus) {
388
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
389
+ this._focusTrigger();
390
+ }
384
391
  // this.unBindKeyBoardEvent();
385
392
  // this._notifyBlur(e);
386
393
  // this._adapter.updateFocusState(false);
@@ -411,7 +418,6 @@ class SelectFoundation extends _foundation.default {
411
418
  const isMultiple = this._isMultiple();
412
419
  if (!isMultiple) {
413
420
  this._handleSingleSelect(option, event);
414
- this._focusTrigger();
415
421
  } else {
416
422
  this._handleMultipleSelect(option, event);
417
423
  }
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
83
83
  export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
84
84
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
85
85
  export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
86
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
86
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
87
87
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
88
88
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -369,9 +369,16 @@ export default class SelectFoundation extends BaseFoundation {
369
369
  closeCb,
370
370
  notToggleInput
371
371
  } = closeConfig || {};
372
+ const {
373
+ isFocus
374
+ } = this.getStates();
372
375
  this._adapter.closeMenu();
373
376
  this._adapter.notifyDropdownVisibleChange(false);
374
377
  this._adapter.setIsFocusInContainer(false);
378
+ if (isFocus) {
379
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
380
+ this._focusTrigger();
381
+ }
375
382
  // this.unBindKeyBoardEvent();
376
383
  // this._notifyBlur(e);
377
384
  // this._adapter.updateFocusState(false);
@@ -402,7 +409,6 @@ export default class SelectFoundation extends BaseFoundation {
402
409
  const isMultiple = this._isMultiple();
403
410
  if (!isMultiple) {
404
411
  this._handleSingleSelect(option, event);
405
- this._focusTrigger();
406
412
  } else {
407
413
  this._handleMultipleSelect(option, event);
408
414
  }
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
83
83
  export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
84
84
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
85
85
  export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
86
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
86
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
87
87
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
88
88
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.67.0",
3
+ "version": "2.67.2-alpha.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.67.0",
10
+ "@douyinfe/semi-animation": "2.67.2-alpha.0",
11
11
  "@mdx-js/mdx": "^3.0.1",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
@@ -28,7 +28,7 @@
28
28
  "*.scss",
29
29
  "*.css"
30
30
  ],
31
- "gitHead": "e3d492cb6bf73316034b31c10565dd6cbb71b21a",
31
+ "gitHead": "9ad910e9b057e33d05d7194786dfeb76519f89cb",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
@@ -400,9 +400,14 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
400
400
  close(closeConfig?: { event?: any; closeCb?: () => void; notToggleInput?: boolean }) {
401
401
  // to support A11y, closing the panel trigger does not necessarily lose focus
402
402
  const { event, closeCb, notToggleInput } = closeConfig || {};
403
+ const { isFocus } = this.getStates();
403
404
  this._adapter.closeMenu();
404
405
  this._adapter.notifyDropdownVisibleChange(false);
405
406
  this._adapter.setIsFocusInContainer(false);
407
+ if (isFocus) {
408
+ // if the isFocus state is true, refocus the trigger case see in https://github.com/DouyinFE/semi-design/issues/2465
409
+ this._focusTrigger();
410
+ }
406
411
  // this.unBindKeyBoardEvent();
407
412
  // this._notifyBlur(e);
408
413
  // this._adapter.updateFocusState(false);
@@ -438,7 +443,6 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
438
443
  const isMultiple = this._isMultiple();
439
444
  if (!isMultiple) {
440
445
  this._handleSingleSelect(option, event);
441
- this._focusTrigger();
442
446
  } else {
443
447
  this._handleMultipleSelect(option, event);
444
448
  }