@cloud-ru/uikit-product-mobile-chips 0.8.39 → 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 +16 -0
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceMultiple.js +2 -2
- package/dist/cjs/components/MobileChipChoice/components/MobileChipChoiceSingle.js +2 -2
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceMultiple.js +2 -2
- package/dist/esm/components/MobileChipChoice/components/MobileChipChoiceSingle.js +2 -2
- package/package.json +5 -2
- 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,22 @@
|
|
|
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
|
+
|
|
6
22
|
## 0.8.39 (2025-11-13)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -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);
|
|
@@ -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
|
}
|
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",
|
|
@@ -56,5 +56,8 @@
|
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@cloud-ru/uikit-product-locale": "*"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/fuzzy-search": "2.1.5"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "8afcaf6d680d27642fc81efd26811cd0ddbb9739"
|
|
60
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}
|