Skip to content

Commit 32a0c00

Browse files
committed
chore: apply dynamic value to all places
1 parent e94366a commit 32a0c00

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

packages/pluggableWidgets/combobox-web/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212

1313
### Added
1414

15-
- We enabled a configurable debounce interval for datasource filter operations as well, via a existing property filterInputDebounceInterval.
15+
- We added the option to configure a debounce interval for datasource filter operations as well.
1616

1717
## [2.5.0] - 2025-08-12
1818

packages/pluggableWidgets/combobox-web/src/helpers/Association/BaseAssociationSelector.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export class BaseAssociationSelector<T extends string | string[], R extends Refe
2727
private _valuesMap: Map<string, ObjectItem> = new Map();
2828
private lazyLoader: LazyLoadProvider = new LazyLoadProvider();
2929

30-
constructor() {
30+
constructor(props: { filterInputDebounceInterval: number }) {
3131
this.caption = new AssociationSimpleCaptionsProvider(this._valuesMap);
32-
this.options = new AssociationOptionsProvider(this.caption, this._valuesMap, 200);
32+
this.options = new AssociationOptionsProvider(this.caption, this._valuesMap, props.filterInputDebounceInterval);
3333
}
3434

3535
updateProps(props: ComboboxContainerProps): void {
@@ -45,8 +45,7 @@ export class BaseAssociationSelector<T extends string | string[], R extends Refe
4545
customContent,
4646
customContentType,
4747
lazyLoading,
48-
loadingType,
49-
filterInputDebounceInterval
48+
loadingType
5049
] = extractAssociationProps(props);
5150

5251
this.lazyLoader.updateProps(ds);
@@ -65,8 +64,7 @@ export class BaseAssociationSelector<T extends string | string[], R extends Refe
6564
ds,
6665
filterType,
6766
lazyLoading,
68-
attributeId: captionType === "attribute" ? (captionProvider as ListAttributeValue<string>).id : undefined,
69-
filterInputDebounceInterval
67+
attributeId: captionType === "attribute" ? (captionProvider as ListAttributeValue<string>).id : undefined
7068
});
7169

7270
if (

packages/pluggableWidgets/combobox-web/src/helpers/BaseDatasourceOptionsProvider.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@ export class BaseDatasourceOptionsProvider extends BaseOptionsProvider<ObjectIte
2020
private attributeId?: ListAttributeValue["id"];
2121
protected loading: boolean = false;
2222
private debouncedSetFilter: (filterCondition: FilterCondition | undefined) => void;
23-
private filterInputDebounceInterval: number;
2423

2524
constructor(
2625
caption: CaptionsProvider,
2726
protected valuesMap: Map<string, ObjectItem>,
2827
filterInputDebounceInterval: number = 200
2928
) {
3029
super(caption);
31-
this.filterInputDebounceInterval = filterInputDebounceInterval;
3230

3331
const [debouncedFn] = debounce((filterCondition: FilterCondition | undefined) => {
3432
this.ds?.setFilter(filterCondition);
35-
}, this.filterInputDebounceInterval);
33+
}, filterInputDebounceInterval);
3634

3735
this.debouncedSetFilter = debouncedFn;
3836
}

packages/pluggableWidgets/combobox-web/src/helpers/Database/DatabaseMultiSelectionSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export class DatabaseMultiSelectionSelector implements MultiSelector {
3434
private _objectsMap: Map<string, ObjectItem> = new Map();
3535
selectedItemsSorting: SelectedItemsSortingEnum = "none";
3636

37-
constructor() {
37+
constructor(props: { filterInputDebounceInterval: number }) {
3838
this.caption = new DatabaseCaptionsProvider(this._objectsMap);
39-
this.options = new DatabaseOptionsProvider(this.caption, this._objectsMap, 200);
39+
this.options = new DatabaseOptionsProvider(this.caption, this._objectsMap, props.filterInputDebounceInterval);
4040
}
4141

4242
getOptions(): string[] {

packages/pluggableWidgets/combobox-web/src/helpers/Database/DatabaseSingleSelectionSelector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ export class DatabaseSingleSelectionSelector<T extends string | Big, R extends E
3333
protected _attr: R | undefined;
3434
private selection?: SelectionSingleValue;
3535

36-
constructor() {
36+
constructor(props: { filterInputDebounceInterval: number }) {
3737
this.caption = new DatabaseCaptionsProvider(this._objectsMap);
38-
this.options = new DatabaseOptionsProvider(this.caption, this._objectsMap, 200);
38+
this.options = new DatabaseOptionsProvider(this.caption, this._objectsMap, props.filterInputDebounceInterval);
3939
this.values = new DatabaseValuesProvider(this._objectsMap);
4040
}
4141

packages/pluggableWidgets/combobox-web/src/helpers/getSelector.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ export function getSelector(props: ComboboxContainerProps): Selector {
1313
return new EnumBooleanSingleSelector();
1414
} else if (props.optionsSourceType === "association") {
1515
return props.attributeAssociation.type === "Reference"
16-
? new AssociationSingleSelector()
17-
: new AssociationMultiSelector();
16+
? new AssociationSingleSelector({ filterInputDebounceInterval: props.filterInputDebounceInterval })
17+
: new AssociationMultiSelector({ filterInputDebounceInterval: props.filterInputDebounceInterval });
1818
} else {
1919
throw new Error(`'optionsSourceType' of type '${props.optionsSourceType}' is not supported`);
2020
}
2121
} else if (props.source === "database") {
2222
if (props.optionsSourceDatabaseItemSelection?.type === "Multi") {
23-
return new DatabaseMultiSelectionSelector();
23+
return new DatabaseMultiSelectionSelector({
24+
filterInputDebounceInterval: props.filterInputDebounceInterval
25+
});
2426
} else {
25-
return new DatabaseSingleSelectionSelector();
27+
return new DatabaseSingleSelectionSelector({
28+
filterInputDebounceInterval: props.filterInputDebounceInterval
29+
});
2630
}
2731
} else if (props.source === "static") {
2832
return new StaticSingleSelector();

0 commit comments

Comments
 (0)