@vkontakte/vkui 7.3.6 → 7.3.8
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/dist/components/ChipsInputBase/Chip/Chip.d.ts.map +1 -1
- package/dist/components/ChipsInputBase/Chip/Chip.js +1 -0
- package/dist/components/ChipsInputBase/Chip/Chip.js.map +1 -1
- package/dist/components/Clickable/Clickable.d.ts.map +1 -1
- package/dist/components/Clickable/Clickable.js +3 -2
- package/dist/components/Clickable/Clickable.js.map +1 -1
- package/dist/components/PanelHeader/PanelHeader.d.ts +0 -2
- package/dist/components/PanelHeader/PanelHeader.d.ts.map +1 -1
- package/dist/components/PanelHeader/PanelHeader.js.map +1 -1
- package/dist/components/UsersStack/UsersStack.d.ts +1 -1
- package/dist/components/UsersStack/UsersStack.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/ChipsInputBase/Chip/Chip.js +1 -0
- package/dist/cssm/components/ChipsInputBase/Chip/Chip.js.map +1 -1
- package/dist/cssm/components/Clickable/Clickable.js +1 -1
- package/dist/cssm/components/Clickable/Clickable.js.map +1 -1
- package/dist/cssm/components/PanelHeader/PanelHeader.js.map +1 -1
- package/dist/cssm/components/UsersStack/UsersStack.js.map +1 -1
- package/dist/cssm/index.js +1 -0
- package/dist/cssm/index.js.map +1 -1
- package/dist/cssm/lib/layouts/gaps.js +1 -1
- package/dist/cssm/lib/layouts/gaps.js.map +1 -1
- package/dist/cssm/lib/object.js +12 -0
- package/dist/cssm/lib/object.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/layouts/gaps.js +1 -1
- package/dist/lib/layouts/gaps.js.map +1 -1
- package/dist/lib/object.d.ts +1 -0
- package/dist/lib/object.d.ts.map +1 -1
- package/dist/lib/object.js +12 -0
- package/dist/lib/object.js.map +1 -1
- package/dist/vkui.css +1 -1
- package/dist/vkui.css.map +1 -1
- package/package.json +1 -1
- package/src/components/ChipsInputBase/Chip/Chip.tsx +1 -0
- package/src/components/Clickable/Clickable.tsx +1 -0
- package/src/components/PanelHeader/PanelHeader.tsx +0 -2
- package/src/components/UsersStack/UsersStack.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/lib/layouts/gaps.ts +1 -1
- package/src/lib/object.ts +19 -0
package/package.json
CHANGED
|
@@ -84,6 +84,7 @@ export const Chip = ({
|
|
|
84
84
|
{!readOnly && removable && (
|
|
85
85
|
<div className={styles.removable}>
|
|
86
86
|
<button
|
|
87
|
+
type="button"
|
|
87
88
|
tabIndex={-1} // [reason]: чтобы можно было выставлять состояние фокуса только программно через `*.focus()`
|
|
88
89
|
disabled={disabled}
|
|
89
90
|
className={styles.remove}
|
|
@@ -54,7 +54,7 @@ export interface UsersStackProps extends HTMLAttributesWithRootRef<HTMLDivElemen
|
|
|
54
54
|
size?: 's' | 'm' | 'l';
|
|
55
55
|
/**
|
|
56
56
|
* Количество аватарок, которые будут показаны.
|
|
57
|
-
* Если в массиве `photos` больше элементов и используется размер `
|
|
57
|
+
* Если в массиве `photos` больше элементов и не используется размер `s`, то будет показано количество остальных элементов.
|
|
58
58
|
*/
|
|
59
59
|
visibleCount?: number;
|
|
60
60
|
/**
|
package/src/index.ts
CHANGED
|
@@ -201,6 +201,8 @@ export { SimpleCell } from './components/SimpleCell/SimpleCell';
|
|
|
201
201
|
export type { SimpleCellProps } from './components/SimpleCell/SimpleCell';
|
|
202
202
|
export { CellButton } from './components/CellButton/CellButton';
|
|
203
203
|
export type { CellButtonProps } from './components/CellButton/CellButton';
|
|
204
|
+
export { CellButtonGroup } from './components/CellButtonGroup/CellButtonGroup';
|
|
205
|
+
export type { CellButtonGroupProps } from './components/CellButtonGroup/CellButtonGroup';
|
|
204
206
|
export { HorizontalCell } from './components/HorizontalCell/HorizontalCell';
|
|
205
207
|
export type { HorizontalCellProps } from './components/HorizontalCell/HorizontalCell';
|
|
206
208
|
export { HorizontalCellShowMore } from './components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore';
|
package/src/lib/layouts/gaps.ts
CHANGED
|
@@ -37,7 +37,7 @@ export type GapsProp = GapProp | [GapProp, GapProp];
|
|
|
37
37
|
export function calculateGap(
|
|
38
38
|
gap: GapsProp | undefined,
|
|
39
39
|
): [GapProp, GapProp] | [undefined, undefined] {
|
|
40
|
-
if (
|
|
40
|
+
if (gap === undefined) {
|
|
41
41
|
return [undefined, undefined];
|
|
42
42
|
}
|
|
43
43
|
if (typeof gap === 'number' || typeof gap === 'string') {
|
package/src/lib/object.ts
CHANGED
|
@@ -12,3 +12,22 @@ export function mapObject<T extends Object, R extends Record<keyof T, any>>(
|
|
|
12
12
|
{} as R,
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
17
|
+
export function filterObject<T extends Object, R extends Record<keyof T, any>>(
|
|
18
|
+
object: T,
|
|
19
|
+
filter: (value: T[keyof T], key: keyof T) => boolean,
|
|
20
|
+
): R {
|
|
21
|
+
return Object.entries(object).reduce(
|
|
22
|
+
(acc, [key, value]) => {
|
|
23
|
+
if (filter(value, key as keyof T)) {
|
|
24
|
+
Object.assign(acc, {
|
|
25
|
+
[key]: value,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return acc;
|
|
29
|
+
},
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions, @typescript-eslint/prefer-reduce-type-parameter
|
|
31
|
+
{} as R,
|
|
32
|
+
);
|
|
33
|
+
}
|