@douyinfe/semi-foundation 2.31.2-alpha.0 → 2.31.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.
@@ -219,7 +219,8 @@ class SelectFoundation extends _foundation.default {
219
219
  handleValueChange(value) {
220
220
  const {
221
221
  allowCreate,
222
- autoClearSearchValue
222
+ autoClearSearchValue,
223
+ remote
223
224
  } = this.getProps();
224
225
  const {
225
226
  inputValue
@@ -239,7 +240,7 @@ class SelectFoundation extends _foundation.default {
239
240
 
240
241
  this._adapter.rePositionDropdown();
241
242
 
242
- if (this._isFilterable() && !autoClearSearchValue && inputValue) {
243
+ if (this._isFilterable() && !autoClearSearchValue && inputValue && !remote) {
243
244
  originalOptions = this._filterOption(originalOptions, inputValue);
244
245
  }
245
246
 
@@ -197,7 +197,8 @@ export default class SelectFoundation extends BaseFoundation {
197
197
  handleValueChange(value) {
198
198
  const {
199
199
  allowCreate,
200
- autoClearSearchValue
200
+ autoClearSearchValue,
201
+ remote
201
202
  } = this.getProps();
202
203
  const {
203
204
  inputValue
@@ -217,7 +218,7 @@ export default class SelectFoundation extends BaseFoundation {
217
218
 
218
219
  this._adapter.rePositionDropdown();
219
220
 
220
- if (this._isFilterable() && !autoClearSearchValue && inputValue) {
221
+ if (this._isFilterable() && !autoClearSearchValue && inputValue && !remote) {
221
222
  originalOptions = this._filterOption(originalOptions, inputValue);
222
223
  }
223
224
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.31.2-alpha.0",
3
+ "version": "2.31.2",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
@@ -23,7 +23,7 @@
23
23
  "*.scss",
24
24
  "*.css"
25
25
  ],
26
- "gitHead": "b502692ae72f3cb550595912d9caefe0517c52c6",
26
+ "gitHead": "43a8fa54b5c662bad2fbb53603846b5c33f5d8da",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -94,7 +94,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
94
94
  if (isFilterable && isMultiple) {
95
95
  // when filter and multiple, only focus input
96
96
  this.focusInput();
97
- } else if (isFilterable && !isMultiple){
97
+ } else if (isFilterable && !isMultiple) {
98
98
  // when filter and not multiple, only show input and focus input
99
99
  this.toggle2SearchInput(true);
100
100
  } else {
@@ -196,7 +196,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
196
196
 
197
197
  // call when props.value change
198
198
  handleValueChange(value: PropValue) {
199
- const { allowCreate, autoClearSearchValue } = this.getProps();
199
+ const { allowCreate, autoClearSearchValue, remote } = this.getProps();
200
200
  const { inputValue } = this.getStates();
201
201
  let originalOptions;
202
202
  // AllowCreate and controlled mode, no need to re-collect optionList
@@ -212,7 +212,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
212
212
  // Multi-selection, controlled mode, you need to reposition the drop-down menu after updating
213
213
  this._adapter.rePositionDropdown();
214
214
 
215
- if (this._isFilterable() && !autoClearSearchValue && inputValue) {
215
+ if (this._isFilterable() && !autoClearSearchValue && inputValue && !remote) {
216
216
  originalOptions = this._filterOption(originalOptions, inputValue);
217
217
  }
218
218
 
@@ -555,7 +555,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
555
555
  clearInput(event?: any) {
556
556
  const { inputValue } = this.getStates();
557
557
  // only when input is not null, select should notifySearch and updateOptions
558
- if (inputValue !== ''){
558
+ if (inputValue !== '') {
559
559
  this._adapter.updateInputValue('');
560
560
  this._adapter.notifySearch('', event);
561
561
  // reset options filter
@@ -793,16 +793,16 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
793
793
  isOpen ? this._getEnableFocusIndex(offset) : this.open();
794
794
  }
795
795
 
796
- _handleTabKeyDown(event: any){
796
+ _handleTabKeyDown(event: any) {
797
797
  const { isOpen } = this.getStates();
798
798
  this._adapter.updateFocusState(false);
799
799
 
800
- if (isOpen){
800
+ if (isOpen) {
801
801
  const container = this._adapter.getContainer();
802
802
  const focusableElements = this._adapter.getFocusableElements(container);
803
803
  const focusableNum = focusableElements.length;
804
804
 
805
- if (focusableNum > 0){
805
+ if (focusableNum > 0) {
806
806
  // Shift + Tab will move focus backward
807
807
  if (event.shiftKey) {
808
808
  this._handlePanelOpenShiftTabKeyDown(focusableElements, event);
@@ -823,7 +823,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
823
823
  _handlePanelOpenTabKeyDown(focusableElements: any[], event: any) {
824
824
  const activeElement = this._adapter.getActiveElement();
825
825
  const isFocusInContainer = this._adapter.getIsFocusInContainer();
826
- if (!isFocusInContainer){
826
+ if (!isFocusInContainer) {
827
827
  // focus in trigger, set next focus to the first element in container
828
828
  focusableElements[0].focus();
829
829
  this._adapter.setIsFocusInContainer(true);
@@ -854,7 +854,7 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
854
854
 
855
855
  _handleEnterKeyDown(event: KeyboardEvent) {
856
856
  const { isOpen, options, focusIndex } = this.getStates();
857
- if (!isOpen){
857
+ if (!isOpen) {
858
858
  this.open();
859
859
  } else {
860
860
  if (focusIndex !== -1) {