@axinom/mosaic-ui 0.72.3 → 0.72.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-ui",
3
- "version": "0.72.3",
3
+ "version": "0.72.5",
4
4
  "description": "UI components for building Axinom Mosaic applications",
5
5
  "author": "Axinom",
6
6
  "license": "PROPRIETARY",
@@ -113,5 +113,5 @@
113
113
  "publishConfig": {
114
114
  "access": "public"
115
115
  },
116
- "gitHead": "1d30532534a6a7c578ceb791443c04a806238d94"
116
+ "gitHead": "c979cfcc87f8c0d686f9965a0cfb63f54083cb76"
117
117
  }
@@ -57,7 +57,9 @@
57
57
  height: calc(100vh - #{$header-height} - 30px);
58
58
  }
59
59
 
60
- .filtersHidden {
60
+ // When no filters are rendered, the List spans both grid columns so it
61
+ // fills the full available width instead of only the second (1fr) track.
62
+ .listFullWidth {
61
63
  grid-column: 1 / -1;
62
64
  }
63
65
  }
@@ -262,13 +262,15 @@ export const Explorer = React.forwardRef(function Explorer<T extends Data>(
262
262
  listRef.current?.resetSelection();
263
263
  }, []);
264
264
 
265
- const { activeFilters, Filters, collapseFilters } = useFilters<T>({
266
- stationKey,
267
- globalStateOptions,
268
- filterOptions,
269
- defaultFilterValues,
270
- onFiltersChange: onFilterChangedHandler,
271
- });
265
+ const { activeFilters, Filters, collapseFilters, hasFilters } = useFilters<T>(
266
+ {
267
+ stationKey,
268
+ globalStateOptions,
269
+ filterOptions,
270
+ defaultFilterValues,
271
+ onFiltersChange: onFilterChangedHandler,
272
+ },
273
+ );
272
274
 
273
275
  const {
274
276
  data,
@@ -454,6 +456,7 @@ export const Explorer = React.forwardRef(function Explorer<T extends Data>(
454
456
  {Filters}
455
457
  <List<T>
456
458
  ref={listRef}
459
+ className={clsx({ [classes.listFullWidth]: !hasFilters })}
457
460
  columns={columns}
458
461
  data={data}
459
462
  isLoading={isLoading}
@@ -17,6 +17,9 @@ interface UseFiltersReturnType<T extends Data> {
17
17
  readonly Filters: JSX.Element;
18
18
  readonly activeFilters: FilterValues<T>;
19
19
  readonly collapseFilters: () => void;
20
+ /** Whether any filters are available to render. Mirrors the condition the
21
+ * `Filters` component uses to decide whether it renders anything at all. */
22
+ readonly hasFilters: boolean;
20
23
  }
21
24
 
22
25
  export const useFilters = <T extends Data>({
@@ -70,5 +73,6 @@ export const useFilters = <T extends Data>({
70
73
  Filters: FilterComponent,
71
74
  activeFilters,
72
75
  collapseFilters,
76
+ hasFilters: Boolean(filterOptions?.length),
73
77
  };
74
78
  };
@@ -50,6 +50,7 @@
50
50
  font-weight: bold;
51
51
  white-space: nowrap;
52
52
  color: var(--mosaic-neutral-1);
53
+ padding-left: 5px;
53
54
  }
54
55
  }
55
56
 
@@ -220,7 +220,7 @@ const FiltersComponent = <T extends Data>(
220
220
  <Button
221
221
  icon={IconName.Filters}
222
222
  className={classes.headerButton}
223
- buttonContext={ButtonContext.None}
223
+ buttonContext={ButtonContext.Icon}
224
224
  onButtonClicked={toggleExpanded}
225
225
  dataTestId="filters-toggle"
226
226
  />