@adaptabletools/adaptable 23.0.20 → 23.0.21
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.
- package/package.json +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +8 -0
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -8
- package/src/AdaptableState/InitialState.d.ts +1 -1
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FormatColumnApiImpl.js +15 -0
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +0 -3
- package/src/Api/Implementation/StateApiImpl.d.ts +2 -0
- package/src/Api/Implementation/StateApiImpl.js +15 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +7 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +3 -0
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +5 -0
- package/src/Api/Internal/FormatColumnInternalApi.js +22 -0
- package/src/Api/Internal/StateInternalApi.d.ts +6 -1
- package/src/Api/Internal/StateInternalApi.js +44 -0
- package/src/Api/StateApi.d.ts +20 -0
- package/src/Redux/Store/AdaptableReduxMerger.js +24 -6
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Utilities/Helpers/SettingsPanelHelper.js +2 -2
- package/src/View/Components/ColumnFilter/components/FloatingFilterValues.js +9 -40
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +15 -13
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +15 -0
- package/src/agGrid/AdaptableFilterHandler.d.ts +5 -1
- package/src/agGrid/AdaptableFilterHandler.js +44 -0
- package/src/components/Combobox/comboboxUtils.d.ts +6 -0
- package/src/components/Combobox/comboboxUtils.js +1 -1
- package/src/components/Combobox/index.js +11 -2
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
|
@@ -3,6 +3,7 @@ export class AdaptableFilterHandler {
|
|
|
3
3
|
colId;
|
|
4
4
|
filterDisplayValuesResult;
|
|
5
5
|
previousFilterDisplayValuesResult;
|
|
6
|
+
rememberedInFilterValues = new Map();
|
|
6
7
|
constructor(adaptableApi) {
|
|
7
8
|
this.adaptableApi = adaptableApi;
|
|
8
9
|
}
|
|
@@ -44,6 +45,7 @@ export class AdaptableFilterHandler {
|
|
|
44
45
|
return this.fetchFilterDisplayValues(options);
|
|
45
46
|
}
|
|
46
47
|
async fetchFilterDisplayValues(options) {
|
|
48
|
+
this.rememberSelectedLazyInFilterValues(undefined);
|
|
47
49
|
return this.adaptableApi.gridApi.internalApi
|
|
48
50
|
.getDistinctFilterDisplayValuesForColumn({
|
|
49
51
|
columnId: this.colId,
|
|
@@ -55,10 +57,51 @@ export class AdaptableFilterHandler {
|
|
|
55
57
|
limit: options.limit,
|
|
56
58
|
})
|
|
57
59
|
.then((result) => {
|
|
60
|
+
this.rememberSelectedLazyInFilterValues(result);
|
|
58
61
|
this.filterDisplayValuesResult = result;
|
|
59
62
|
return result;
|
|
60
63
|
});
|
|
61
64
|
}
|
|
65
|
+
rememberSelectedLazyInFilterValues(result) {
|
|
66
|
+
if (!this.adaptableApi.optionsApi.getFilterOptions().customInFilterValues) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const paginatedResult = result ?? this.getLastCachedFilterDisplayValues();
|
|
70
|
+
if (paginatedResult?.hasMore === undefined) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const columnFilter = this.adaptableApi.filterApi.columnFilterApi.getColumnFilterForColumn(this.colId);
|
|
74
|
+
const selectedInputs = new Set((columnFilter?.Predicates ?? [])
|
|
75
|
+
.filter((predicate) => predicate.PredicateId === 'In' || predicate.PredicateId === 'NotIn')
|
|
76
|
+
.flatMap((predicate) => (Array.isArray(predicate.Inputs) ? predicate.Inputs : [])));
|
|
77
|
+
for (const value of this.rememberedInFilterValues.keys()) {
|
|
78
|
+
if (!selectedInputs.has(value)) {
|
|
79
|
+
this.rememberedInFilterValues.delete(value);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (!selectedInputs.size) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const visit = (values) => {
|
|
86
|
+
if (!values) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (const item of values) {
|
|
90
|
+
if (selectedInputs.has(item.value)) {
|
|
91
|
+
this.rememberedInFilterValues.set(item.value, item);
|
|
92
|
+
}
|
|
93
|
+
visit(item.children);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
visit(this.getLastCachedFilterDisplayValues()?.values);
|
|
97
|
+
visit(result?.values);
|
|
98
|
+
}
|
|
99
|
+
getRememberedLazyInFilterValues() {
|
|
100
|
+
return Array.from(this.rememberedInFilterValues.values());
|
|
101
|
+
}
|
|
102
|
+
getRememberedLazyInFilterValue(value) {
|
|
103
|
+
return this.rememberedInFilterValues.get(value);
|
|
104
|
+
}
|
|
62
105
|
onNewRowsLoaded() {
|
|
63
106
|
this.resetFilterDisplayValues();
|
|
64
107
|
}
|
|
@@ -83,5 +126,6 @@ export class AdaptableFilterHandler {
|
|
|
83
126
|
destroy() {
|
|
84
127
|
this.filterDisplayValuesResult = undefined;
|
|
85
128
|
this.previousFilterDisplayValuesResult = undefined;
|
|
129
|
+
this.rememberedInFilterValues.clear();
|
|
86
130
|
}
|
|
87
131
|
}
|
|
@@ -57,6 +57,12 @@ export type ComboboxCommonProps<T extends ComboboxItemType> = {
|
|
|
57
57
|
* is cleared on close and every open starts from the full list.
|
|
58
58
|
*/
|
|
59
59
|
persistFilterOnReopen?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Extra items used only to resolve selected values that are not in `items`
|
|
62
|
+
* (e.g. selected In Filter values hidden by the current search page).
|
|
63
|
+
* Not shown in the dropdown list.
|
|
64
|
+
*/
|
|
65
|
+
lookupItems?: T[];
|
|
60
66
|
/**
|
|
61
67
|
* Custom filter function, or `null` to disable built-in filtering
|
|
62
68
|
* (e.g. when options are already filtered server-side).
|
|
@@ -17,7 +17,7 @@ export function valueToItem(stringValue, lookup) {
|
|
|
17
17
|
export function valueToItems(stringValues, lookup) {
|
|
18
18
|
if (stringValues == null)
|
|
19
19
|
return undefined;
|
|
20
|
-
return stringValues.map((v) => lookup.get(v)
|
|
20
|
+
return stringValues.map((v) => lookup.get(v) ?? { value: v, label: String(v ?? '') });
|
|
21
21
|
}
|
|
22
22
|
export function toStringValue(item) {
|
|
23
23
|
return item?.value ?? null;
|
|
@@ -196,9 +196,18 @@ const useGetAllItems = (props) => {
|
|
|
196
196
|
?
|
|
197
197
|
[].concat(props.items)
|
|
198
198
|
: props.items;
|
|
199
|
+
const lookupItems = props.lookupItems;
|
|
199
200
|
const itemByValue = useMemo(() => {
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
const map = new Map(allItems.map((item) => [item.value, item]));
|
|
202
|
+
if (lookupItems) {
|
|
203
|
+
for (const item of lookupItems) {
|
|
204
|
+
if (!map.has(item.value)) {
|
|
205
|
+
map.set(item.value, item);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return map;
|
|
210
|
+
}, [allItems, lookupItems]);
|
|
202
211
|
const creatableInput = useCreatable(props, allItems, itemByValue);
|
|
203
212
|
const { inputValue, onInputValueChange } = useMenulistFilterInput(props, {
|
|
204
213
|
inputValue: creatableInput.inputValue,
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "23.0.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1787139899825 || Date.now(),
|
|
4
|
+
VERSION: "23.0.21" || '--current-version--',
|
|
5
5
|
};
|