@snack-uikit/chips 0.11.5 → 0.11.6-preview-bd4095bc.0
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.
|
@@ -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-preview-bd4095bc.0",
|
|
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-preview-bd4095bc.0",
|
|
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": "53065276382788f1cae880a1303f6f5a47cdd750"
|
|
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;
|