basesite-shared-grid-lib 21.0.0-beta.5 → 21.0.0-beta.7
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.
|
Binary file
|
|
@@ -239,7 +239,7 @@ class OdataProvider {
|
|
|
239
239
|
query = query + '&' + customFilters.join('and');
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
query = query.replace('and$filter=', '
|
|
242
|
+
query = query.replace('and$filter=', '&$filter=');
|
|
243
243
|
return query;
|
|
244
244
|
};
|
|
245
245
|
/**
|
|
@@ -317,7 +317,15 @@ class OdataProvider {
|
|
|
317
317
|
if (!col.values || col.values.length === 0) {
|
|
318
318
|
return '';
|
|
319
319
|
}
|
|
320
|
-
|
|
320
|
+
// Fill-cell / set-filter columns are always equality-matched against
|
|
321
|
+
// a fixed list of backend-provided values, so the casing on both
|
|
322
|
+
// sides is already known to match. Skip the tolower() wrap that the
|
|
323
|
+
// generic string operators apply — wrapping the column in tolower()
|
|
324
|
+
// forces a full scan because LOWER(col) cannot use any index, and
|
|
325
|
+
// SQL Server's default collation is already case-insensitive.
|
|
326
|
+
// Resulting predicate: `col eq 'Value'` (single) or
|
|
327
|
+
// `(col eq 'V1' or col eq 'V2')` (multi).
|
|
328
|
+
const equalsClauses = col.values.map((v) => me.odataOperator.equals(colName, `'${me.encode(v)}'`));
|
|
321
329
|
return equalsClauses.length === 1
|
|
322
330
|
? equalsClauses[0]
|
|
323
331
|
: `(${equalsClauses.join(' or ')})`;
|
|
@@ -2424,7 +2432,10 @@ class GridLibraryComponent {
|
|
|
2424
2432
|
};
|
|
2425
2433
|
}
|
|
2426
2434
|
else if (res.columnType === 'fill') {
|
|
2427
|
-
const
|
|
2435
|
+
const hasConfiguredValues = (Array.isArray(res.filterValues) && res.filterValues.length > 0) ||
|
|
2436
|
+
(typeof res.fieldValue === 'string' && res.fieldValue.trim() !== '') ||
|
|
2437
|
+
(Array.isArray(res.fieldValue) && res.fieldValue.length > 0);
|
|
2438
|
+
const valueLabelMap = hasConfiguredValues ? this._buildFillValueLabelMap(res) : null;
|
|
2428
2439
|
return {
|
|
2429
2440
|
width: 120,
|
|
2430
2441
|
pinned: res.pinPosition,
|
|
@@ -2441,25 +2452,28 @@ class GridLibraryComponent {
|
|
|
2441
2452
|
field: res.field,
|
|
2442
2453
|
},
|
|
2443
2454
|
filterable: res.filterable,
|
|
2444
|
-
filter: 'agSetColumnFilter',
|
|
2445
|
-
filterParams:
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2455
|
+
filter: hasConfiguredValues ? 'agSetColumnFilter' : 'agTextColumnFilter',
|
|
2456
|
+
filterParams: hasConfiguredValues
|
|
2457
|
+
? {
|
|
2458
|
+
values: (params) => this._getFillFilterValues(res, params),
|
|
2459
|
+
refreshValuesOnOpen: true,
|
|
2460
|
+
defaultToNothingSelected: true,
|
|
2461
|
+
buttons: ['reset'],
|
|
2462
|
+
valueFormatter: (p) => {
|
|
2463
|
+
if (p?.value == null || p.value === '')
|
|
2464
|
+
return p?.value;
|
|
2465
|
+
return valueLabelMap?.get(String(p.value)) ?? p.value;
|
|
2466
|
+
},
|
|
2467
|
+
textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
|
|
2468
|
+
}
|
|
2469
|
+
: {
|
|
2470
|
+
comparator: (filterLocalDateAtMidnight, cellValue) => {
|
|
2471
|
+
if (cellValue == null)
|
|
2472
|
+
return 0;
|
|
2473
|
+
return 0;
|
|
2474
|
+
},
|
|
2475
|
+
buttons: ['reset'],
|
|
2459
2476
|
},
|
|
2460
|
-
// Case-insensitive search within the dropdown's filter box
|
|
2461
|
-
textFormatter: (v) => v == null ? '' : String(v).trim().toLowerCase(),
|
|
2462
|
-
},
|
|
2463
2477
|
};
|
|
2464
2478
|
}
|
|
2465
2479
|
else {
|