@redocly/theme 0.37.2 → 0.37.3
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.
|
@@ -26,7 +26,7 @@ function Catalog(props) {
|
|
|
26
26
|
return (react_1.default.createElement(CatalogHighlight_1.HighlightContext.Provider, { value: [filterTerm] },
|
|
27
27
|
react_1.default.createElement(exports.CatalogPageWrapper, { "data-component-name": "Catalog/Catalog", withoutFilters: !filters.length },
|
|
28
28
|
react_1.default.createElement(FiltersSidebar, { menu: react_1.default.createElement(FilterContent_1.FilterContent, { setFilterTerm: setFilterTerm, filters: filters, filterTerm: filterTerm, filterValuesCasing: catalogConfig.filterValuesCasing }) }),
|
|
29
|
-
filterPopoverVisible && (react_1.default.createElement(FilterPopover_1.FilterPopover, { onClose: () => setFilterPopoverVisible(false), filters: filters, filterValuesCasing: catalogConfig.filterValuesCasing })),
|
|
29
|
+
filterPopoverVisible && (react_1.default.createElement(FilterPopover_1.FilterPopover, { onClose: () => setFilterPopoverVisible(false), setFilterTerm: setFilterTerm, filterTerm: filterTerm, filters: filters, filterValuesCasing: catalogConfig.filterValuesCasing })),
|
|
30
30
|
react_1.default.createElement(CatalogActions_1.CatalogActions, { onOpenFilter: () => setFilterPopoverVisible(true), filters: filters, filterTerm: filterTerm }),
|
|
31
31
|
react_1.default.createElement(exports.CatalogPageContent, null,
|
|
32
32
|
react_1.default.createElement(exports.CatalogPageDescriptionWrapper, null,
|
|
@@ -4,5 +4,7 @@ export type FilterPopoverProps = {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
filters: ResolvedFilter[];
|
|
6
6
|
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
7
|
+
filterTerm: string;
|
|
8
|
+
setFilterTerm: (term: string) => void;
|
|
7
9
|
};
|
|
8
|
-
export declare function FilterPopover({ onClose, filters, filterValuesCasing, }: FilterPopoverProps): JSX.Element;
|
|
10
|
+
export declare function FilterPopover({ onClose, filters, filterValuesCasing, filterTerm, setFilterTerm, }: FilterPopoverProps): JSX.Element;
|
|
@@ -9,8 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const utils_1 = require("../../core/utils");
|
|
10
10
|
const hooks_1 = require("../../core/hooks");
|
|
11
11
|
const FilterContent_1 = require("../../components/Filter/FilterContent");
|
|
12
|
-
function FilterPopover({ onClose, filters, filterValuesCasing, }) {
|
|
13
|
-
const [filterTerm, setFilterTerm] = react_1.default.useState('');
|
|
12
|
+
function FilterPopover({ onClose, filters, filterValuesCasing, filterTerm, setFilterTerm, }) {
|
|
14
13
|
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
15
14
|
const { translate } = useTranslate();
|
|
16
15
|
return (react_1.default.createElement(FilterPopoverWrapper, { "data-component-name": "Filter/FilterPopover" },
|
package/package.json
CHANGED
|
@@ -47,6 +47,8 @@ export default function Catalog(props: CatalogProps): JSX.Element {
|
|
|
47
47
|
{filterPopoverVisible && (
|
|
48
48
|
<FilterPopover
|
|
49
49
|
onClose={() => setFilterPopoverVisible(false)}
|
|
50
|
+
setFilterTerm={setFilterTerm}
|
|
51
|
+
filterTerm={filterTerm}
|
|
50
52
|
filters={filters}
|
|
51
53
|
filterValuesCasing={catalogConfig.filterValuesCasing}
|
|
52
54
|
/>
|
|
@@ -12,15 +12,17 @@ export type FilterPopoverProps = {
|
|
|
12
12
|
onClose: () => void;
|
|
13
13
|
filters: ResolvedFilter[];
|
|
14
14
|
filterValuesCasing?: NonNullable<ThemeConfig['catalog']>[string]['filterValuesCasing'];
|
|
15
|
+
filterTerm: string;
|
|
16
|
+
setFilterTerm: (term: string) => void;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export function FilterPopover({
|
|
18
20
|
onClose,
|
|
19
21
|
filters,
|
|
20
22
|
filterValuesCasing,
|
|
23
|
+
filterTerm,
|
|
24
|
+
setFilterTerm,
|
|
21
25
|
}: FilterPopoverProps): JSX.Element {
|
|
22
|
-
const [filterTerm, setFilterTerm] = React.useState('');
|
|
23
|
-
|
|
24
26
|
const { useTranslate } = useThemeHooks();
|
|
25
27
|
const { translate } = useTranslate();
|
|
26
28
|
|