@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/dist/cjs/components/Explorer/Explorer.d.ts.map +1 -1
- package/dist/cjs/components/Explorer/helpers/useFilters.d.ts +3 -0
- package/dist/cjs/components/Explorer/helpers/useFilters.d.ts.map +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Explorer/Explorer.d.ts.map +1 -1
- package/dist/esm/components/Explorer/helpers/useFilters.d.ts +3 -0
- package/dist/esm/components/Explorer/helpers/useFilters.d.ts.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Explorer/Explorer.module.scss +3 -1
- package/src/components/Explorer/Explorer.tsx +10 -7
- package/src/components/Explorer/helpers/useFilters.tsx +4 -0
- package/src/components/Filters/Filters.module.scss +1 -0
- package/src/components/Filters/Filters.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-ui",
|
|
3
|
-
"version": "0.72.
|
|
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": "
|
|
116
|
+
"gitHead": "c979cfcc87f8c0d686f9965a0cfb63f54083cb76"
|
|
117
117
|
}
|
|
@@ -57,7 +57,9 @@
|
|
|
57
57
|
height: calc(100vh - #{$header-height} - 30px);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
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
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
};
|
|
@@ -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.
|
|
223
|
+
buttonContext={ButtonContext.Icon}
|
|
224
224
|
onButtonClicked={toggleExpanded}
|
|
225
225
|
dataTestId="filters-toggle"
|
|
226
226
|
/>
|