@cloud-ru/uikit-product-mobile-chips 0.8.38 → 0.8.40
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/CHANGELOG.md +27 -0
- package/dist/cjs/components/AdaptiveChips/AdaptiveChips.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceCustom.js +1 -1
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceDate.js +2 -2
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceDateRange.js +2 -2
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceMultiple.js +4 -4
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceSingle.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceSingle.js +4 -4
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceTime.js +2 -2
- package/dist/cjs/components/MobileChipChoice/hooks.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoice/hooks.js +1 -1
- package/dist/cjs/components/MobileChipChoice/types.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoice/utils/options.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoice/utils/utils.d.ts +1 -1
- package/dist/cjs/components/MobileChipChoiceRow/MobileChipChoiceRow.js +4 -4
- package/dist/cjs/helperComponents/ButtonClearValue/ButtonClearValue.js +1 -1
- package/dist/esm/components/AdaptiveChips/AdaptiveChips.d.ts +1 -1
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceCustom.js +1 -1
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceDate.js +2 -2
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceDateRange.js +2 -2
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceMultiple.js +4 -4
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceSingle.d.ts +1 -1
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceSingle.js +4 -4
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceTime.js +2 -2
- package/dist/esm/components/MobileChipChoice/hooks.d.ts +1 -1
- package/dist/esm/components/MobileChipChoice/hooks.js +1 -1
- package/dist/esm/components/MobileChipChoice/types.d.ts +1 -1
- package/dist/esm/components/MobileChipChoice/utils/options.d.ts +1 -1
- package/dist/esm/components/MobileChipChoice/utils/utils.d.ts +1 -1
- package/dist/esm/components/MobileChipChoiceRow/MobileChipChoiceRow.js +4 -4
- package/dist/esm/helperComponents/ButtonClearValue/ButtonClearValue.js +1 -1
- package/package.json +9 -7
- package/src/components/MobileChipChoice/components/MobileChipChoiceMultiple.tsx +2 -1
- package/src/components/MobileChipChoice/components/MobileChipChoiceSingle.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.8.40 (2025-11-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-7560:** add searchable prop into chips ([8c30e4e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/8c30e4ef1395d4de5d2522dddb15432efc635446))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* **FF-7560:** add types deps into chips ([ff4eb37](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/ff4eb37448671e27d129441b042090f997f4b1c5))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 0.8.39 (2025-11-13)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **PD-3377:** removed contributors ([121640f](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/121640f7b88b20a728a6ad2c39de8841532bb308))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## 0.8.38 (2025-11-13)
|
|
7
34
|
|
|
8
35
|
### Only dependencies have been changed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithLayoutType } from '@
|
|
1
|
+
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { ChipChoice, ChipChoiceRowProps, FiltersState } from '@snack-uikit/chips';
|
|
3
3
|
export type AdaptiveChipChoiceRow<T extends FiltersState> = WithLayoutType<ChipChoiceRowProps<T>>;
|
|
4
4
|
export declare function AdaptiveChipChoiceRow<T extends FiltersState>({ layoutType, ...props }: AdaptiveChipChoiceRow<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,7 @@ exports.MobileChipChoiceCustom = MobileChipChoiceCustom;
|
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
const react_1 = require("react");
|
|
17
17
|
const uncontrollable_1 = require("uncontrollable");
|
|
18
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
18
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
19
19
|
const utils_1 = require("@snack-uikit/utils");
|
|
20
20
|
const constants_1 = require("../../../constants");
|
|
21
21
|
const hooks_1 = require("../hooks");
|
|
@@ -18,8 +18,8 @@ exports.MobileChipChoiceDate = MobileChipChoiceDate;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const uncontrollable_1 = require("uncontrollable");
|
|
21
|
-
const uikit_product_locale_1 = require("@
|
|
22
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
21
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
22
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
23
23
|
const calendar_1 = require("@snack-uikit/calendar");
|
|
24
24
|
const scroll_1 = require("@snack-uikit/scroll");
|
|
25
25
|
const utils_1 = require("@snack-uikit/utils");
|
|
@@ -18,8 +18,8 @@ exports.MobileChipChoiceDateRange = MobileChipChoiceDateRange;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const uncontrollable_1 = require("uncontrollable");
|
|
21
|
-
const uikit_product_locale_1 = require("@
|
|
22
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
21
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
22
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
23
23
|
const calendar_1 = require("@snack-uikit/calendar");
|
|
24
24
|
const constants_1 = require("../../../constants");
|
|
25
25
|
const hooks_1 = require("../hooks");
|
|
@@ -18,8 +18,8 @@ exports.MobileChipChoiceMultiple = MobileChipChoiceMultiple;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const uncontrollable_1 = require("uncontrollable");
|
|
21
|
-
const uikit_product_locale_1 = require("@
|
|
22
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
21
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
22
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
23
23
|
const button_1 = require("@snack-uikit/button");
|
|
24
24
|
const utils_1 = require("@snack-uikit/utils");
|
|
25
25
|
const constants_1 = require("../../../constants");
|
|
@@ -53,7 +53,7 @@ function MobileChipChoiceMultiple(_a) {
|
|
|
53
53
|
const { flattenOptions } = (0, utils_2.kindFlattenOptions)({ options });
|
|
54
54
|
return flattenOptions;
|
|
55
55
|
}, [options]);
|
|
56
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
56
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
57
57
|
const [searchValue = '', setSearchValue] = (0, react_1.useState)('');
|
|
58
58
|
const [open, setOpen] = (0, uncontrollable_1.useUncontrolledProp)(openProp, false, onOpenChange);
|
|
59
59
|
const handleOnKeyDown = (0, hooks_1.useHandleOnKeyDown)({ setOpen });
|
|
@@ -120,7 +120,7 @@ function MobileChipChoiceMultiple(_a) {
|
|
|
120
120
|
handleOnCancelClick();
|
|
121
121
|
}
|
|
122
122
|
setOpen(open);
|
|
123
|
-
}, label: label, virtualized: virtualized, footer: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footerTopLine, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.counter, children: `${t('MobileChips.selectedN')}${(value === null || value === void 0 ? void 0 : value.length) || 0}` }), (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { label: t('MobileChips.resetAll'), onClick: () => {
|
|
123
|
+
}, label: label, search: searchable ? { value: searchValue, onChange: setSearchValue } : undefined, virtualized: virtualized, footer: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footer, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.footerTopLine, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.counter, children: `${t('MobileChips.selectedN')}${(value === null || value === void 0 ? void 0 : value.length) || 0}` }), (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { label: t('MobileChips.resetAll'), onClick: () => {
|
|
124
124
|
handleSelectionChange([]);
|
|
125
125
|
}, size: 'm' })] }), autoApply ? ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, { fullWidth: true, label: t('MobileChips.select'), onClick: () => {
|
|
126
126
|
setOpen(false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemId } from '@
|
|
1
|
+
import { ItemId } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
2
2
|
import { ContentRenderProps, MobileChipChoiceSingleProps } from '../types';
|
|
3
3
|
export type ChipChoiceSingleValueFormatterProps = {
|
|
4
4
|
label?: ItemId;
|
|
@@ -19,8 +19,8 @@ exports.MobileChipChoiceSingle = MobileChipChoiceSingle;
|
|
|
19
19
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
20
|
const react_1 = require("react");
|
|
21
21
|
const uncontrollable_1 = require("uncontrollable");
|
|
22
|
-
const uikit_product_locale_1 = require("@
|
|
23
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
22
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
23
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
24
24
|
const utils_1 = require("@snack-uikit/utils");
|
|
25
25
|
const constants_1 = require("../../../constants");
|
|
26
26
|
const hooks_1 = require("../hooks");
|
|
@@ -45,7 +45,7 @@ function MobileChipChoiceSingle(_a) {
|
|
|
45
45
|
const { flattenOptions } = (0, utils_2.kindFlattenOptions)({ options });
|
|
46
46
|
return flattenOptions;
|
|
47
47
|
}, [options]);
|
|
48
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
48
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
49
49
|
const { t } = (0, uikit_product_locale_1.useLocale)('Chips');
|
|
50
50
|
const [open, setOpen] = (0, uncontrollable_1.useUncontrolledProp)(openProp, false, onOpenChange);
|
|
51
51
|
const handleOnKeyDown = (0, hooks_1.useHandleOnKeyDown)({ setOpen });
|
|
@@ -108,5 +108,5 @@ function MobileChipChoiceSingle(_a) {
|
|
|
108
108
|
handleOnCancelClick();
|
|
109
109
|
}
|
|
110
110
|
setOpen(open);
|
|
111
|
-
}, label: label, virtualized: virtualized, footer: !autoApply && autoApplyFooter ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footer, children: autoApplyFooter }) : undefined, children: (0, jsx_runtime_1.jsx)(ChipChoiceBase_1.ChipChoiceBase, Object.assign({}, rest, { ref: chipRef, onClearButtonClick: onClearButtonClick, value: value, valueToRender: valueToRender, label: label, loading: rest.loading, size: size, onKeyDown: handleOnKeyDown() })) }));
|
|
111
|
+
}, search: searchable ? { value: searchValue, onChange: setSearchValue } : undefined, label: label, virtualized: virtualized, footer: !autoApply && autoApplyFooter ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footer, children: autoApplyFooter }) : undefined, children: (0, jsx_runtime_1.jsx)(ChipChoiceBase_1.ChipChoiceBase, Object.assign({}, rest, { ref: chipRef, onClearButtonClick: onClearButtonClick, value: value, valueToRender: valueToRender, label: label, loading: rest.loading, size: size, onKeyDown: handleOnKeyDown() })) }));
|
|
112
112
|
}
|
|
@@ -18,8 +18,8 @@ exports.MobileChipChoiceTime = MobileChipChoiceTime;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const uncontrollable_1 = require("uncontrollable");
|
|
21
|
-
const uikit_product_locale_1 = require("@
|
|
22
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
21
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
22
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
23
23
|
const calendar_1 = require("@snack-uikit/calendar");
|
|
24
24
|
const utils_1 = require("@snack-uikit/utils");
|
|
25
25
|
const constants_1 = require("../../../constants");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, KeyboardEventHandler } from 'react';
|
|
2
|
-
import { MobileDroplistProps } from '@
|
|
2
|
+
import { MobileDroplistProps } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { AccordionOption, BaseOption, ContentRenderProps, FilterOption, NestListOption } from './types';
|
|
4
4
|
type UseHandleOnKeyDownProps = {
|
|
5
5
|
setOpen(open: boolean): void;
|
|
@@ -9,7 +9,7 @@ exports.useAutoApplyFooter = useAutoApplyFooter;
|
|
|
9
9
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
10
|
const fuzzy_search_1 = __importDefault(require("fuzzy-search"));
|
|
11
11
|
const react_1 = require("react");
|
|
12
|
-
const uikit_product_locale_1 = require("@
|
|
12
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
13
13
|
const button_1 = require("@snack-uikit/button");
|
|
14
14
|
const constants_1 = require("../../constants");
|
|
15
15
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { BaseItemProps, DroplistProps, GroupItemProps, GroupSelectItemProps, ItemContentProps, ItemId, NextListItemProps, SelectionMultipleState, SelectionSingleState } from '@
|
|
2
|
+
import { BaseItemProps, DroplistProps, GroupItemProps, GroupSelectItemProps, ItemContentProps, ItemId, NextListItemProps, SelectionMultipleState, SelectionSingleState } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { TruncateStringProps } from '@snack-uikit/truncate-string';
|
|
4
4
|
import { WithSupportProps } from '@snack-uikit/utils';
|
|
5
5
|
import { BaseChipProps, Size } from '../../types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ItemId, MobileDroplistProps } from '@
|
|
2
|
+
import { ItemId, MobileDroplistProps } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { ContentRenderProps, FilterOption } from '../types';
|
|
4
4
|
export declare function transformOptionsToItems<T extends ContentRenderProps = ContentRenderProps>(options: FilterOption<T>[], contentRender?: (option: {
|
|
5
5
|
label: ItemId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ItemId } from '@
|
|
2
|
+
import { ItemId } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { ContentRenderProps, FilterOption } from '../types';
|
|
4
4
|
export type FlattenOption<T extends ContentRenderProps = ContentRenderProps> = {
|
|
5
5
|
value: ItemId;
|
|
@@ -19,10 +19,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const react_1 = require("react");
|
|
21
21
|
const uncontrollable_1 = require("uncontrollable");
|
|
22
|
-
const uikit_product_icons_1 = require("@
|
|
23
|
-
const uikit_product_locale_1 = require("@
|
|
24
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
25
|
-
const uikit_product_mobile_tooltip_1 = require("@
|
|
22
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
23
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
24
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
25
|
+
const uikit_product_mobile_tooltip_1 = require("@cloud-ru/uikit-product-mobile-tooltip");
|
|
26
26
|
const button_1 = require("@snack-uikit/button");
|
|
27
27
|
const divider_1 = require("@snack-uikit/divider");
|
|
28
28
|
const utils_1 = require("@snack-uikit/utils");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ButtonClearValue = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const uikit_product_icons_1 = require("@
|
|
9
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
10
10
|
const constants_1 = require("../../constants");
|
|
11
11
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
12
12
|
exports.ButtonClearValue = (0, react_1.forwardRef)(({ size, onClick, tabIndex = -1, onKeyDown, 'data-test-id': dataTestId }, ref) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithLayoutType } from '@
|
|
1
|
+
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { ChipChoice, ChipChoiceRowProps, FiltersState } from '@snack-uikit/chips';
|
|
3
3
|
export type AdaptiveChipChoiceRow<T extends FiltersState> = WithLayoutType<ChipChoiceRowProps<T>>;
|
|
4
4
|
export declare function AdaptiveChipChoiceRow<T extends FiltersState>({ layoutType, ...props }: AdaptiveChipChoiceRow<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useRef } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { MobileDropdown } from '@
|
|
15
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
16
16
|
import { useValueControl } from '@snack-uikit/utils';
|
|
17
17
|
import { CHIP_CHOICE_TEST_IDS, SIZE } from '../../../constants';
|
|
18
18
|
import { useHandleOnKeyDown } from '../hooks';
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useMemo, useRef } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { useLocale } from '@
|
|
16
|
-
import { MobileDropdown } from '@
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
17
17
|
import { Calendar } from '@snack-uikit/calendar';
|
|
18
18
|
import { Scroll } from '@snack-uikit/scroll';
|
|
19
19
|
import { useValueControl } from '@snack-uikit/utils';
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useRef } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { useLocale } from '@
|
|
16
|
-
import { MobileDropdown } from '@
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
17
17
|
import { Calendar } from '@snack-uikit/calendar';
|
|
18
18
|
import { CHIP_CHOICE_TEST_IDS, DEFAULT_EMPTY_VALUE, SIZE } from '../../../constants';
|
|
19
19
|
import { useHandleOnKeyDown } from '../hooks';
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { useLocale } from '@
|
|
16
|
-
import { MobileDroplist } from '@
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
|
+
import { MobileDroplist } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
17
17
|
import { ButtonFilled, ButtonFunction } from '@snack-uikit/button';
|
|
18
18
|
import { useValueControl } from '@snack-uikit/utils';
|
|
19
19
|
import { CHIP_CHOICE_TEST_IDS, SIZE } from '../../../constants';
|
|
@@ -47,7 +47,7 @@ export function MobileChipChoiceMultiple(_a) {
|
|
|
47
47
|
const { flattenOptions } = kindFlattenOptions({ options });
|
|
48
48
|
return flattenOptions;
|
|
49
49
|
}, [options]);
|
|
50
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
50
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
51
51
|
const [searchValue = '', setSearchValue] = useState('');
|
|
52
52
|
const [open, setOpen] = useUncontrolledProp(openProp, false, onOpenChange);
|
|
53
53
|
const handleOnKeyDown = useHandleOnKeyDown({ setOpen });
|
|
@@ -114,7 +114,7 @@ export function MobileChipChoiceMultiple(_a) {
|
|
|
114
114
|
handleOnCancelClick();
|
|
115
115
|
}
|
|
116
116
|
setOpen(open);
|
|
117
|
-
}, label: label, virtualized: virtualized, footer: _jsxs("div", { className: styles.footer, children: [_jsxs("div", { className: styles.footerTopLine, children: [_jsx("span", { className: styles.counter, children: `${t('MobileChips.selectedN')}${(value === null || value === void 0 ? void 0 : value.length) || 0}` }), _jsx(ButtonFunction, { label: t('MobileChips.resetAll'), onClick: () => {
|
|
117
|
+
}, label: label, search: searchable ? { value: searchValue, onChange: setSearchValue } : undefined, virtualized: virtualized, footer: _jsxs("div", { className: styles.footer, children: [_jsxs("div", { className: styles.footerTopLine, children: [_jsx("span", { className: styles.counter, children: `${t('MobileChips.selectedN')}${(value === null || value === void 0 ? void 0 : value.length) || 0}` }), _jsx(ButtonFunction, { label: t('MobileChips.resetAll'), onClick: () => {
|
|
118
118
|
handleSelectionChange([]);
|
|
119
119
|
}, size: 'm' })] }), autoApply ? (_jsx(ButtonFilled, { fullWidth: true, label: t('MobileChips.select'), onClick: () => {
|
|
120
120
|
setOpen(false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemId } from '@
|
|
1
|
+
import { ItemId } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
2
2
|
import { ContentRenderProps, MobileChipChoiceSingleProps } from '../types';
|
|
3
3
|
export type ChipChoiceSingleValueFormatterProps = {
|
|
4
4
|
label?: ItemId;
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { useLocale } from '@
|
|
16
|
-
import { MobileDroplist } from '@
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
|
+
import { MobileDroplist } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
17
17
|
import { useValueControl } from '@snack-uikit/utils';
|
|
18
18
|
import { CHIP_CHOICE_TEST_IDS, SIZE } from '../../../constants';
|
|
19
19
|
import { useAutoApplyFooter, useHandleOnKeyDown, useOptionSearch } from '../hooks';
|
|
@@ -38,7 +38,7 @@ export function MobileChipChoiceSingle(_a) {
|
|
|
38
38
|
const { flattenOptions } = kindFlattenOptions({ options });
|
|
39
39
|
return flattenOptions;
|
|
40
40
|
}, [options]);
|
|
41
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
41
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
42
42
|
const { t } = useLocale('Chips');
|
|
43
43
|
const [open, setOpen] = useUncontrolledProp(openProp, false, onOpenChange);
|
|
44
44
|
const handleOnKeyDown = useHandleOnKeyDown({ setOpen });
|
|
@@ -101,5 +101,5 @@ export function MobileChipChoiceSingle(_a) {
|
|
|
101
101
|
handleOnCancelClick();
|
|
102
102
|
}
|
|
103
103
|
setOpen(open);
|
|
104
|
-
}, label: label, virtualized: virtualized, footer: !autoApply && autoApplyFooter ? _jsx("div", { className: styles.footer, children: autoApplyFooter }) : undefined, children: _jsx(ChipChoiceBase, Object.assign({}, rest, { ref: chipRef, onClearButtonClick: onClearButtonClick, value: value, valueToRender: valueToRender, label: label, loading: rest.loading, size: size, onKeyDown: handleOnKeyDown() })) }));
|
|
104
|
+
}, search: searchable ? { value: searchValue, onChange: setSearchValue } : undefined, label: label, virtualized: virtualized, footer: !autoApply && autoApplyFooter ? _jsx("div", { className: styles.footer, children: autoApplyFooter }) : undefined, children: _jsx(ChipChoiceBase, Object.assign({}, rest, { ref: chipRef, onClearButtonClick: onClearButtonClick, value: value, valueToRender: valueToRender, label: label, loading: rest.loading, size: size, onKeyDown: handleOnKeyDown() })) }));
|
|
105
105
|
}
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useMemo, useRef } from 'react';
|
|
14
14
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
15
|
-
import { useLocale } from '@
|
|
16
|
-
import { MobileDropdown } from '@
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
17
17
|
import { TimePicker } from '@snack-uikit/calendar';
|
|
18
18
|
import { useValueControl } from '@snack-uikit/utils';
|
|
19
19
|
import { CHIP_CHOICE_TEST_IDS, SIZE } from '../../../constants';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, KeyboardEventHandler } from 'react';
|
|
2
|
-
import { MobileDroplistProps } from '@
|
|
2
|
+
import { MobileDroplistProps } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { AccordionOption, BaseOption, ContentRenderProps, FilterOption, NestListOption } from './types';
|
|
4
4
|
type UseHandleOnKeyDownProps = {
|
|
5
5
|
setOpen(open: boolean): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import FuzzySearch from 'fuzzy-search';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import { useLocale } from '@
|
|
4
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
5
5
|
import { ButtonFilled, ButtonFunction } from '@snack-uikit/button';
|
|
6
6
|
import { CHIP_CHOICE_TEST_IDS } from '../../constants';
|
|
7
7
|
import styles from './styles.module.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { BaseItemProps, DroplistProps, GroupItemProps, GroupSelectItemProps, ItemContentProps, ItemId, NextListItemProps, SelectionMultipleState, SelectionSingleState } from '@
|
|
2
|
+
import { BaseItemProps, DroplistProps, GroupItemProps, GroupSelectItemProps, ItemContentProps, ItemId, NextListItemProps, SelectionMultipleState, SelectionSingleState } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { TruncateStringProps } from '@snack-uikit/truncate-string';
|
|
4
4
|
import { WithSupportProps } from '@snack-uikit/utils';
|
|
5
5
|
import { BaseChipProps, Size } from '../../types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ItemId, MobileDroplistProps } from '@
|
|
2
|
+
import { ItemId, MobileDroplistProps } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { ContentRenderProps, FilterOption } from '../types';
|
|
4
4
|
export declare function transformOptionsToItems<T extends ContentRenderProps = ContentRenderProps>(options: FilterOption<T>[], contentRender?: (option: {
|
|
5
5
|
label: ItemId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ItemId } from '@
|
|
2
|
+
import { ItemId } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
3
3
|
import { ContentRenderProps, FilterOption } from '../types';
|
|
4
4
|
export type FlattenOption<T extends ContentRenderProps = ContentRenderProps> = {
|
|
5
5
|
value: ItemId;
|
|
@@ -13,10 +13,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { useUncontrolledProp } from 'uncontrollable';
|
|
16
|
-
import { CrossSVG, PlusSVG } from '@
|
|
17
|
-
import { useLocale } from '@
|
|
18
|
-
import { MobileDroplist } from '@
|
|
19
|
-
import { MobileTooltip } from '@
|
|
16
|
+
import { CrossSVG, PlusSVG } from '@cloud-ru/uikit-product-icons';
|
|
17
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
18
|
+
import { MobileDroplist } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
19
|
+
import { MobileTooltip } from '@cloud-ru/uikit-product-mobile-tooltip';
|
|
20
20
|
import { ButtonFunction } from '@snack-uikit/button';
|
|
21
21
|
import { Divider } from '@snack-uikit/divider';
|
|
22
22
|
import { extractSupportProps } from '@snack-uikit/utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { CrossSVG } from '@
|
|
3
|
+
import { CrossSVG } from '@cloud-ru/uikit-product-icons';
|
|
4
4
|
import { BUTTON_SIZE } from '../../constants';
|
|
5
5
|
import styles from './styles.module.css';
|
|
6
6
|
export const ButtonClearValue = forwardRef(({ size, onClick, tabIndex = -1, onKeyDown, 'data-test-id': dataTestId }, ref) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-mobile-chips",
|
|
3
3
|
"title": "Mobile Chips",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.40",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -30,17 +30,16 @@
|
|
|
30
30
|
"name": "Akhremenko Grigorii",
|
|
31
31
|
"url": "https://github.com/AGrigorii"
|
|
32
32
|
},
|
|
33
|
-
"contributors": [],
|
|
34
33
|
"license": "Apache-2.0",
|
|
35
34
|
"publishConfig": {
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@cloud-ru/uikit-product-icons": "15.1.
|
|
41
|
-
"@cloud-ru/uikit-product-mobile-dropdown": "0.9.
|
|
42
|
-
"@cloud-ru/uikit-product-mobile-tooltip": "0.4.
|
|
43
|
-
"@cloud-ru/uikit-product-utils": "7.0.
|
|
39
|
+
"@cloud-ru/uikit-product-icons": "15.1.4",
|
|
40
|
+
"@cloud-ru/uikit-product-mobile-dropdown": "0.9.24",
|
|
41
|
+
"@cloud-ru/uikit-product-mobile-tooltip": "0.4.68",
|
|
42
|
+
"@cloud-ru/uikit-product-utils": "7.0.3",
|
|
44
43
|
"@snack-uikit/button": "0.19.15",
|
|
45
44
|
"@snack-uikit/calendar": "0.13.0",
|
|
46
45
|
"@snack-uikit/chips": "0.28.0",
|
|
@@ -57,5 +56,8 @@
|
|
|
57
56
|
"peerDependencies": {
|
|
58
57
|
"@cloud-ru/uikit-product-locale": "*"
|
|
59
58
|
},
|
|
60
|
-
"
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/fuzzy-search": "2.1.5"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "8afcaf6d680d27642fc81efd26811cd0ddbb9739"
|
|
61
63
|
}
|
|
@@ -72,7 +72,7 @@ export function MobileChipChoiceMultiple<T extends ContentRenderProps = ContentR
|
|
|
72
72
|
return flattenOptions;
|
|
73
73
|
}, [options]);
|
|
74
74
|
|
|
75
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
75
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
76
76
|
|
|
77
77
|
const [searchValue = '', setSearchValue] = useState<string>('');
|
|
78
78
|
|
|
@@ -173,6 +173,7 @@ export function MobileChipChoiceMultiple<T extends ContentRenderProps = ContentR
|
|
|
173
173
|
setOpen(open);
|
|
174
174
|
}}
|
|
175
175
|
label={label}
|
|
176
|
+
search={searchable ? { value: searchValue, onChange: setSearchValue } : undefined}
|
|
176
177
|
virtualized={virtualized}
|
|
177
178
|
footer={
|
|
178
179
|
<div className={styles.footer}>
|
|
@@ -58,7 +58,7 @@ export function MobileChipChoiceSingle<T extends ContentRenderProps = ContentRen
|
|
|
58
58
|
return flattenOptions;
|
|
59
59
|
}, [options]);
|
|
60
60
|
|
|
61
|
-
const searchable = searchableProp && Object.values(flattenOptions).length >
|
|
61
|
+
const searchable = searchableProp && Object.values(flattenOptions).length > 10;
|
|
62
62
|
|
|
63
63
|
const { t } = useLocale('Chips');
|
|
64
64
|
|
|
@@ -156,6 +156,7 @@ export function MobileChipChoiceSingle<T extends ContentRenderProps = ContentRen
|
|
|
156
156
|
}
|
|
157
157
|
setOpen(open);
|
|
158
158
|
}}
|
|
159
|
+
search={searchable ? { value: searchValue, onChange: setSearchValue } : undefined}
|
|
159
160
|
label={label}
|
|
160
161
|
virtualized={virtualized}
|
|
161
162
|
footer={!autoApply && autoApplyFooter ? <div className={styles.footer}>{autoApplyFooter}</div> : undefined}
|