@lavalogic/scoria 0.37.13 → 0.37.14

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.
@@ -55,14 +55,18 @@
55
55
 
56
56
  const hasFilterFn = $derived(!!def.filterFn && typeof def.filterFn === 'function');
57
57
 
58
- // const hasAcceptableColumnType = $derived(
59
- // (def instanceof AccessorDef && searchableTypes.has(def.accessorType)) ||
60
- // (def instanceof AbstractDisplayDef && searchableTypes.has(def.displayType))
61
- // );
58
+ // A column declares it is filterable when it either (a) has a local
59
+ // `filterFn`, (b) declares a `filterValueType` (server-side filtering
60
+ // case: `paginationRepo.dateFilter` etc. are only defined for LOCAL
61
+ // data repositories, so remote-pagination tables otherwise silently
62
+ // hide every typed column from the quick-filter row), or (c) is keyed
63
+ // in `customFilters` (remote filter chips supplied via
64
+ // `defsWrapper.remoteFilters`).
65
+ const hasDeclaredFilterType = $derived(def.filterValueType != null);
62
66
 
63
67
  const isSearchable = $derived(
64
- def.allowFiltering && (hasFilterFn || customFilters?.has(def.id) == true)
65
- // ((hasFilterFn && hasAcceptableColumnType) || customFilters?.has(def.id) == true) // removed hasAcceptableColumnType due to it being redundant
68
+ def.allowFiltering &&
69
+ (hasFilterFn || hasDeclaredFilterType || customFilters?.has(def.id) == true)
66
70
  );
67
71
 
68
72
  const isNumeric = $derived(
@@ -50,8 +50,25 @@
50
50
 
51
51
  const hasFilterFn = $derived(!!def.filterFn && typeof def.filterFn === 'function');
52
52
 
53
+ // A column declares it is filterable when it either (a) has a local
54
+ // `filterFn` (set on AccessorDef subclasses, and on Display/Bubble/
55
+ // Progress defs whose underlying data repo is local), or (b) declares
56
+ // a `filterValueType` (in which case the server is expected to do
57
+ // the filtering and the UI just renders an input of the matching
58
+ // type), or (c) is keyed in `customFilters` (remote filter chips
59
+ // supplied via `defsWrapper.remoteFilters`).
60
+ //
61
+ // Without case (b) a remote-pagination Table would silently hide
62
+ // every typed column from the quick-filter row and the advanced
63
+ // filter panel - `paginationRepo.dateFilter` and friends are only
64
+ // populated on LOCAL data repositories, so `setupDefaultColumnDefs`
65
+ // assigns `def.filterFn = undefined` for every typed column and
66
+ // the bare `hasFilterFn` gate would lock the input out.
67
+ const hasDeclaredFilterType = $derived(def.filterValueType != null);
68
+
53
69
  const isSearchable = $derived(
54
- def.allowFiltering && (hasFilterFn || customFilters?.has(def.id) == true)
70
+ def.allowFiltering &&
71
+ (hasFilterFn || hasDeclaredFilterType || customFilters?.has(def.id) == true)
55
72
  );
56
73
 
57
74
  const isSelect = $derived(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.37.13",
4
+ "version": "0.37.14",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },