@douyinfe/semi-foundation 2.56.2 → 2.56.3-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.
@@ -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;
@@ -455,6 +455,7 @@ class TreeSelectFoundation extends _foundation.default {
455
455
  filteredExpandedKeys: new Set(expandedOptsKeys),
456
456
  filteredShownKeys: new Set([])
457
457
  });
458
+ this._adapter.rePositionDropdown();
458
459
  }
459
460
  handleInputChange(sugInput) {
460
461
  // Input is used as controlled component
@@ -504,6 +505,7 @@ class TreeSelectFoundation extends _foundation.default {
504
505
  filteredExpandedKeys: newFilteredExpandedKeys,
505
506
  filteredShownKeys
506
507
  });
508
+ this._adapter.rePositionDropdown();
507
509
  }
508
510
  handleNodeSelect(e, treeNode) {
509
511
  const isDisabled = this._isDisabled(treeNode);
@@ -772,7 +774,8 @@ class TreeSelectFoundation extends _foundation.default {
772
774
  * When the search box is on the trigger, the focus event processing method
773
775
  */
774
776
  handleInputTriggerFocus() {
775
- this.clearInput();
777
+ const inputValue = this.getState('inputValue');
778
+ inputValue && this.clearInput();
776
779
  this._adapter.updateState({
777
780
  inputTriggerFocus: true
778
781
  });
@@ -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
  };
@@ -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;
@@ -448,6 +448,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
448
448
  filteredExpandedKeys: new Set(expandedOptsKeys),
449
449
  filteredShownKeys: new Set([])
450
450
  });
451
+ this._adapter.rePositionDropdown();
451
452
  }
452
453
  handleInputChange(sugInput) {
453
454
  // Input is used as controlled component
@@ -497,6 +498,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
497
498
  filteredExpandedKeys: newFilteredExpandedKeys,
498
499
  filteredShownKeys
499
500
  });
501
+ this._adapter.rePositionDropdown();
500
502
  }
501
503
  handleNodeSelect(e, treeNode) {
502
504
  const isDisabled = this._isDisabled(treeNode);
@@ -765,7 +767,8 @@ export default class TreeSelectFoundation extends BaseFoundation {
765
767
  * When the search box is on the trigger, the focus event processing method
766
768
  */
767
769
  handleInputTriggerFocus() {
768
- this.clearInput();
770
+ const inputValue = this.getState('inputValue');
771
+ inputValue && this.clearInput();
769
772
  this._adapter.updateState({
770
773
  inputTriggerFocus: true
771
774
  });
@@ -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.56.2",
3
+ "version": "2.56.3-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.56.2",
10
+ "@douyinfe/semi-animation": "2.56.3-alpha.0",
11
11
  "async-validator": "^3.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "date-fns": "^2.29.3",
@@ -24,7 +24,7 @@
24
24
  "*.scss",
25
25
  "*.css"
26
26
  ],
27
- "gitHead": "c2d893b432056eac3b7b9aa14828867fa74467fc",
27
+ "gitHead": "112dabb82871bf247cf5ccda1c734c8503151a0e",
28
28
  "devDependencies": {
29
29
  "@babel/plugin-transform-runtime": "^7.15.8",
30
30
  "@babel/preset-env": "^7.15.8",
@@ -601,6 +601,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
601
601
  filteredExpandedKeys: new Set(expandedOptsKeys),
602
602
  filteredShownKeys: new Set([])
603
603
  });
604
+ this._adapter.rePositionDropdown();
604
605
  }
605
606
 
606
607
  handleInputChange(sugInput: string) {
@@ -640,6 +641,7 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
640
641
  filteredExpandedKeys: newFilteredExpandedKeys,
641
642
  filteredShownKeys,
642
643
  });
644
+ this._adapter.rePositionDropdown();
643
645
  }
644
646
 
645
647
  handleNodeSelect(e: any, treeNode: BasicTreeNodeProps) {
@@ -871,7 +873,8 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
871
873
  * When the search box is on the trigger, the focus event processing method
872
874
  */
873
875
  handleInputTriggerFocus() {
874
- this.clearInput();
876
+ const inputValue = this.getState('inputValue');
877
+ inputValue && this.clearInput();
875
878
  this._adapter.updateState({
876
879
  inputTriggerFocus: true
877
880
  });