@snack-uikit/chips 0.11.5 → 0.11.6
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
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.11.6 (2024-02-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-4205:** update locale usage ([bd4095b](https://github.com/cloud-ru-tech/snack-uikit/commit/bd4095bc875c2efc95a0549a366d5b40dd424741))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 0.11.5 (2024-02-09)
|
|
7
18
|
|
|
8
19
|
### Only dependencies have been changed
|
|
@@ -22,8 +22,8 @@ import { CHIP_CHOICE_ROW_SIZE, MAP_ROW_SIZE_TO_BUTTON_SIZE, MAP_ROW_SIZE_TO_CHOI
|
|
|
22
22
|
import styles from './styles.module.css';
|
|
23
23
|
export function ChipChoiceRow(_a) {
|
|
24
24
|
var { filters, onChange, showClearAllButton = true, clearAllButtonLabel: clearAllButtonLabelProp, className, value, defaultValue, size = CHIP_CHOICE_ROW_SIZE.S } = _a, rest = __rest(_a, ["filters", "onChange", "showClearAllButton", "clearAllButtonLabel", "className", "value", "defaultValue", "size"]);
|
|
25
|
-
const
|
|
26
|
-
const clearAllButtonLabel = clearAllButtonLabelProp !== null && clearAllButtonLabelProp !== void 0 ? clearAllButtonLabelProp :
|
|
25
|
+
const { t } = useLocale('Chips');
|
|
26
|
+
const clearAllButtonLabel = clearAllButtonLabelProp !== null && clearAllButtonLabelProp !== void 0 ? clearAllButtonLabelProp : t('clearAllButton');
|
|
27
27
|
const [state, setState] = useUncontrolledProp(value, (defaultValue !== null && defaultValue !== void 0 ? defaultValue : {}), newState => {
|
|
28
28
|
const result = typeof newState === 'function' ? newState(state) : newState;
|
|
29
29
|
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"title": "Chips",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.6",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"*.css",
|
|
10
10
|
"*.woff",
|
|
@@ -33,14 +33,16 @@
|
|
|
33
33
|
"scripts": {},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@snack-uikit/button": "0.16.0",
|
|
36
|
-
"@snack-uikit/calendar": "0.7.
|
|
36
|
+
"@snack-uikit/calendar": "0.7.5",
|
|
37
37
|
"@snack-uikit/droplist": "0.13.4",
|
|
38
38
|
"@snack-uikit/icons": "0.20.1",
|
|
39
39
|
"@snack-uikit/loaders": "0.5.0",
|
|
40
|
-
"@snack-uikit/locale": "0.3.0",
|
|
41
40
|
"@snack-uikit/utils": "3.2.0",
|
|
42
41
|
"classnames": "2.3.2",
|
|
43
42
|
"uncontrollable": "8.0.2"
|
|
44
43
|
},
|
|
45
|
-
"
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@snack-uikit/locale": "*"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "5e7b0b6d34f40c4266070bf918e9cdf127ac882c"
|
|
46
48
|
}
|
|
@@ -44,9 +44,9 @@ export function ChipChoiceRow<TState extends FiltersState>({
|
|
|
44
44
|
size = CHIP_CHOICE_ROW_SIZE.S,
|
|
45
45
|
...rest
|
|
46
46
|
}: ChipChoiceRowProps<TState>) {
|
|
47
|
-
const
|
|
47
|
+
const { t } = useLocale('Chips');
|
|
48
48
|
|
|
49
|
-
const clearAllButtonLabel = clearAllButtonLabelProp ??
|
|
49
|
+
const clearAllButtonLabel = clearAllButtonLabelProp ?? t('clearAllButton');
|
|
50
50
|
|
|
51
51
|
const [state, setState] = useUncontrolledProp<TState>(value, (defaultValue ?? {}) as TState, newState => {
|
|
52
52
|
const result = typeof newState === 'function' ? newState(state) : newState;
|