@gravity-ui/blog-constructor 5.16.0 → 5.16.1-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/cjs/blocks/Feed/Feed.js +2 -1
- package/build/cjs/components/FeedHeader/components/Controls/customRenders.js +1 -1
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +9 -0
- package/build/cjs/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +2 -1
- package/build/esm/blocks/Feed/Feed.js +2 -1
- package/build/esm/components/FeedHeader/components/Controls/customRenders.js +1 -1
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.css +9 -0
- package/build/esm/components/FeedHeader/components/CustomSwitcher/CustomSwitcher.js +2 -1
- package/package.json +1 -1
@@ -56,11 +56,12 @@ const Feed = ({ image }) => {
|
|
56
56
|
dispatch({ type: reducer_1.ActionTypes.SetErrorLoad, payload: value });
|
57
57
|
};
|
58
58
|
const handleChangeQueryParams = (0, react_1.useCallback)((value) => {
|
59
|
+
var _a;
|
59
60
|
dispatch({ type: reducer_1.ActionTypes.QueryParamsChange, payload: value });
|
60
61
|
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
61
62
|
const result = hasFirstPageQuery
|
62
63
|
? Object.assign(Object.assign({}, value), { [PAGE_QUERY]: null }) : Object.assign({}, value);
|
63
|
-
router.updateQueryCallback(result);
|
64
|
+
(_a = router === null || router === void 0 ? void 0 : router.updateQueryCallback) === null || _a === void 0 ? void 0 : _a.call(router, result);
|
64
65
|
}, [router]);
|
65
66
|
const fetchData = (0, react_1.useCallback)(async ({ page, query }) => {
|
66
67
|
if (query && getPosts) {
|
@@ -13,7 +13,7 @@ const renderSwitcher = ({ initial, list, defaultLabel }) =>
|
|
13
13
|
// eslint-disable-next-line react/display-name
|
14
14
|
({ onClick, ref, onKeyDown, open, renderClear }) => (react_1.default.createElement(CustomSwitcher_1.CustomSwitcher, { initial: initial, defaultLabel: defaultLabel, list: list, controlRef: ref, onClick: onClick, onKeyDown: onKeyDown, renderClear: renderClear, open: open }));
|
15
15
|
exports.renderSwitcher = renderSwitcher;
|
16
|
-
const renderFilter = ({ value,
|
16
|
+
const renderFilter = ({ value, onChange, onKeyDown }) => (react_1.default.createElement(uikit_1.TextInput, { controlProps: { size: 1 }, value: value, view: "clear", placeholder: (0, i18n_1.i18)(i18n_1.Keyset.Search), onUpdate: onChange, onKeyDown: onKeyDown, className: b('popup-filter') }));
|
17
17
|
exports.renderFilter = renderFilter;
|
18
18
|
const renderOption = (option) => (react_1.default.createElement(CustomSelectOption_1.CustomSelectOption, { data: option }));
|
19
19
|
exports.renderOption = renderOption;
|
@@ -38,6 +38,9 @@ unpredictable css rules order in build */
|
|
38
38
|
border-color: var(--g-color-base-generic-hover);
|
39
39
|
cursor: pointer;
|
40
40
|
}
|
41
|
+
.bc-feed-custom-switcher__custom-switcher-element {
|
42
|
+
color: var(--g-color-text-primary);
|
43
|
+
}
|
41
44
|
.bc-feed-custom-switcher__custom-switcher-element_content {
|
42
45
|
display: inline-block;
|
43
46
|
flex-grow: 1;
|
@@ -63,6 +66,11 @@ unpredictable css rules order in build */
|
|
63
66
|
min-width: 30px;
|
64
67
|
height: 100%;
|
65
68
|
}
|
69
|
+
.bc-feed-custom-switcher__custom-switcher-element_overlay {
|
70
|
+
position: absolute;
|
71
|
+
inset: 0;
|
72
|
+
border-radius: var(--g-border-radius-xl);
|
73
|
+
}
|
66
74
|
.bc-feed-custom-switcher__switcher-arrow {
|
67
75
|
width: 16px;
|
68
76
|
height: 16px;
|
@@ -70,4 +78,5 @@ unpredictable css rules order in build */
|
|
70
78
|
.bc-feed-custom-switcher__clear {
|
71
79
|
width: 11px;
|
72
80
|
height: 11px;
|
81
|
+
color: var(--g-color-text-primary);
|
73
82
|
}
|
@@ -18,7 +18,8 @@ const CustomSwitcher = ({ initial, defaultLabel, list, onClick, controlRef, onKe
|
|
18
18
|
return items.length ? items : [defaultLabel];
|
19
19
|
}, [defaultLabel, initial, list]);
|
20
20
|
const hasCounter = itemsNames.length > 1;
|
21
|
-
return (react_1.default.createElement("button", { className: b('custom-switcher'),
|
21
|
+
return (react_1.default.createElement("button", { className: b('custom-switcher'), ref: controlRef, onKeyDown: onKeyDown, "aria-expanded": open },
|
22
|
+
react_1.default.createElement("div", { onClick: onClick, className: b('custom-switcher-element', { overlay: true }) }),
|
22
23
|
react_1.default.createElement("div", { className: b('custom-switcher-element', { content: true }) }, itemsNames === null || itemsNames === void 0 ? void 0 : itemsNames.join(', ')),
|
23
24
|
renderClear &&
|
24
25
|
renderClear({
|
@@ -52,11 +52,12 @@ export const Feed = ({ image }) => {
|
|
52
52
|
dispatch({ type: ActionTypes.SetErrorLoad, payload: value });
|
53
53
|
};
|
54
54
|
const handleChangeQueryParams = useCallback((value) => {
|
55
|
+
var _a;
|
55
56
|
dispatch({ type: ActionTypes.QueryParamsChange, payload: value });
|
56
57
|
const hasFirstPageQuery = Object.keys(value).some((queryKey) => queryKey === PAGE_QUERY && value[queryKey] === FIRST_PAGE);
|
57
58
|
const result = hasFirstPageQuery
|
58
59
|
? Object.assign(Object.assign({}, value), { [PAGE_QUERY]: null }) : Object.assign({}, value);
|
59
|
-
router.updateQueryCallback(result);
|
60
|
+
(_a = router === null || router === void 0 ? void 0 : router.updateQueryCallback) === null || _a === void 0 ? void 0 : _a.call(router, result);
|
60
61
|
}, [router]);
|
61
62
|
const fetchData = useCallback(async ({ page, query }) => {
|
62
63
|
if (query && getPosts) {
|
@@ -9,5 +9,5 @@ const b = block('feed-controls');
|
|
9
9
|
export const renderSwitcher = ({ initial, list, defaultLabel }) =>
|
10
10
|
// eslint-disable-next-line react/display-name
|
11
11
|
({ onClick, ref, onKeyDown, open, renderClear }) => (React.createElement(CustomSwitcher, { initial: initial, defaultLabel: defaultLabel, list: list, controlRef: ref, onClick: onClick, onKeyDown: onKeyDown, renderClear: renderClear, open: open }));
|
12
|
-
export const renderFilter = ({ value,
|
12
|
+
export const renderFilter = ({ value, onChange, onKeyDown }) => (React.createElement(TextInput, { controlProps: { size: 1 }, value: value, view: "clear", placeholder: i18(Keyset.Search), onUpdate: onChange, onKeyDown: onKeyDown, className: b('popup-filter') }));
|
13
13
|
export const renderOption = (option) => (React.createElement(CustomSelectOption, { data: option }));
|
@@ -38,6 +38,9 @@ unpredictable css rules order in build */
|
|
38
38
|
border-color: var(--g-color-base-generic-hover);
|
39
39
|
cursor: pointer;
|
40
40
|
}
|
41
|
+
.bc-feed-custom-switcher__custom-switcher-element {
|
42
|
+
color: var(--g-color-text-primary);
|
43
|
+
}
|
41
44
|
.bc-feed-custom-switcher__custom-switcher-element_content {
|
42
45
|
display: inline-block;
|
43
46
|
flex-grow: 1;
|
@@ -63,6 +66,11 @@ unpredictable css rules order in build */
|
|
63
66
|
min-width: 30px;
|
64
67
|
height: 100%;
|
65
68
|
}
|
69
|
+
.bc-feed-custom-switcher__custom-switcher-element_overlay {
|
70
|
+
position: absolute;
|
71
|
+
inset: 0;
|
72
|
+
border-radius: var(--g-border-radius-xl);
|
73
|
+
}
|
66
74
|
.bc-feed-custom-switcher__switcher-arrow {
|
67
75
|
width: 16px;
|
68
76
|
height: 16px;
|
@@ -70,4 +78,5 @@ unpredictable css rules order in build */
|
|
70
78
|
.bc-feed-custom-switcher__clear {
|
71
79
|
width: 11px;
|
72
80
|
height: 11px;
|
81
|
+
color: var(--g-color-text-primary);
|
73
82
|
}
|
@@ -15,7 +15,8 @@ export const CustomSwitcher = ({ initial, defaultLabel, list, onClick, controlRe
|
|
15
15
|
return items.length ? items : [defaultLabel];
|
16
16
|
}, [defaultLabel, initial, list]);
|
17
17
|
const hasCounter = itemsNames.length > 1;
|
18
|
-
return (React.createElement("button", { className: b('custom-switcher'),
|
18
|
+
return (React.createElement("button", { className: b('custom-switcher'), ref: controlRef, onKeyDown: onKeyDown, "aria-expanded": open },
|
19
|
+
React.createElement("div", { onClick: onClick, className: b('custom-switcher-element', { overlay: true }) }),
|
19
20
|
React.createElement("div", { className: b('custom-switcher-element', { content: true }) }, itemsNames === null || itemsNames === void 0 ? void 0 : itemsNames.join(', ')),
|
20
21
|
renderClear &&
|
21
22
|
renderClear({
|