@vkontakte/vkui 4.35.0 → 4.35.3
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/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.cache/.tsbuildinfo +10 -10
- package/dist/cjs/components/Banner/Banner.js +41 -47
- package/dist/cjs/components/Banner/Banner.js.map +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js +1 -1
- package/dist/cjs/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.js +3 -0
- package/dist/cjs/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScrollArrow.js +1 -1
- package/dist/cjs/components/HorizontalScroll/HorizontalScrollArrow.js.map +1 -1
- package/dist/cjs/components/PanelHeaderContent/PanelHeaderContent.js +1 -2
- package/dist/cjs/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/cjs/components/Popper/Popper.js +53 -50
- package/dist/cjs/components/Popper/Popper.js.map +1 -1
- package/dist/cjs/lib/platform.js +9 -4
- package/dist/cjs/lib/platform.js.map +1 -1
- package/dist/components/Banner/Banner.js +41 -48
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/CustomSelect/CustomSelect.js +1 -1
- package/dist/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.js +2 -0
- package/dist/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/components/HorizontalScroll/HorizontalScrollArrow.js +2 -2
- package/dist/components/HorizontalScroll/HorizontalScrollArrow.js.map +1 -1
- package/dist/components/PanelHeaderContent/PanelHeaderContent.js +1 -2
- package/dist/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/components/Popper/Popper.js +53 -50
- package/dist/components/Popper/Popper.js.map +1 -1
- package/dist/components.css +13 -13
- package/dist/components.css.map +1 -1
- package/dist/cssm/components/Banner/Banner.js +41 -48
- package/dist/cssm/components/Banner/Banner.js.map +1 -1
- package/dist/cssm/components/Button/Button.css +1 -1
- package/dist/cssm/components/CalendarDay/CalendarDay.css +1 -1
- package/dist/cssm/components/CalendarDays/CalendarDays.css +1 -1
- package/dist/cssm/components/Card/Card.css +1 -1
- package/dist/cssm/components/CardGrid/CardGrid.css +1 -1
- package/dist/cssm/components/Cell/Cell.css +1 -1
- package/dist/cssm/components/CellButton/CellButton.css +1 -1
- package/dist/cssm/components/Checkbox/Checkbox.css +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js +1 -1
- package/dist/cssm/components/CustomSelect/CustomSelect.js.map +1 -1
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.js +2 -0
- package/dist/cssm/components/CustomSelectDropdown/CustomSelectDropdown.js.map +1 -1
- package/dist/cssm/components/CustomSelectOption/CustomSelectOption.css +1 -1
- package/dist/cssm/components/Dropdown/Dropdown.css +1 -1
- package/dist/cssm/components/FixedLayout/FixedLayout.css +1 -1
- package/dist/cssm/components/FormItem/FormItem.css +1 -1
- package/dist/cssm/components/GridAvatar/GridAvatar.css +1 -1
- package/dist/cssm/components/HorizontalScroll/HorizontalScrollArrow.js +2 -2
- package/dist/cssm/components/HorizontalScroll/HorizontalScrollArrow.js.map +1 -1
- package/dist/cssm/components/ModalRoot/ModalRoot.css +1 -1
- package/dist/cssm/components/Panel/Panel.css +1 -1
- package/dist/cssm/components/PanelHeader/PanelHeader.css +1 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.css +1 -1
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.js +1 -2
- package/dist/cssm/components/PanelHeaderContent/PanelHeaderContent.js.map +1 -1
- package/dist/cssm/components/Popper/Popper.js +53 -50
- package/dist/cssm/components/Popper/Popper.js.map +1 -1
- package/dist/cssm/components/Radio/Radio.css +1 -1
- package/dist/cssm/components/RadioGroup/RadioGroup.css +1 -1
- package/dist/cssm/components/Removable/Removable.css +1 -1
- package/dist/cssm/components/RichCell/RichCell.css +1 -1
- package/dist/cssm/components/SimpleCell/SimpleCell.css +1 -1
- package/dist/cssm/components/Snackbar/Snackbar.css +1 -1
- package/dist/cssm/components/Spacing/Spacing.css +1 -1
- package/dist/cssm/components/SplitLayout/SplitLayout.css +1 -1
- package/dist/cssm/components/Switch/Switch.css +1 -1
- package/dist/cssm/components/Typography/Headline/Headline.css +1 -1
- package/dist/cssm/components/Typography/Text/Text.css +1 -1
- package/dist/cssm/lib/platform.js +8 -3
- package/dist/cssm/lib/platform.js.map +1 -1
- package/dist/cssm/styles/components.css +13 -13
- package/dist/cssm/styles/unstable.css +1 -1
- package/dist/lib/platform.js +8 -3
- package/dist/lib/platform.js.map +1 -1
- package/dist/unstable.css +1 -1
- package/dist/unstable.css.map +1 -1
- package/dist/vkui.css +13 -13
- package/dist/vkui.css.map +1 -1
- package/package.json +1 -1
- package/src/components/Banner/Banner.tsx +58 -63
- package/src/components/CustomSelect/CustomSelect.tsx +1 -1
- package/src/components/CustomSelectDropdown/CustomSelectDropdown.tsx +2 -0
- package/src/components/HorizontalScroll/HorizontalScrollArrow.tsx +2 -2
- package/src/components/PanelHeader/PanelHeader.css +8 -13
- package/src/components/PanelHeaderContent/PanelHeaderContent.css +8 -2
- package/src/components/PanelHeaderContent/PanelHeaderContent.tsx +1 -2
- package/src/components/Popper/Popper.tsx +37 -31
- package/src/components/Spacing/Readme.md +20 -20
- package/src/components/Spacing/Spacing.css +5 -1
- package/src/components/Typography/Headline/Headline.css +10 -0
- package/src/components/Typography/Text/Text.css +10 -0
- package/src/lib/platform.ts +12 -6
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { HasComponent, HasChildren } from "../../types";
|
|
3
2
|
import { classNames } from "../../lib/classNames";
|
|
4
3
|
import { usePlatform } from "../../hooks/usePlatform";
|
|
5
4
|
import { IOS } from "../../lib/platform";
|
|
@@ -80,18 +79,6 @@ export interface BannerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
80
79
|
actions?: React.ReactNode;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
type BannerTypographyProps = Pick<BannerProps, "size"> &
|
|
84
|
-
HasComponent &
|
|
85
|
-
HasChildren;
|
|
86
|
-
|
|
87
|
-
const BannerHeader = ({ size, ...restProps }: BannerTypographyProps) => {
|
|
88
|
-
return size === "m" ? (
|
|
89
|
-
<Title level="2" weight="2" {...restProps} />
|
|
90
|
-
) : (
|
|
91
|
-
<Headline weight="2" {...restProps} />
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
82
|
/**
|
|
96
83
|
* @see https://vkcom.github.io/VKUI/#/Banner
|
|
97
84
|
*/
|
|
@@ -113,8 +100,46 @@ export const Banner = ({
|
|
|
113
100
|
}: BannerProps) => {
|
|
114
101
|
const platform = usePlatform();
|
|
115
102
|
|
|
103
|
+
const HeaderTypography = size === "m" ? Title : Headline;
|
|
116
104
|
const SubheaderTypography = size === "m" ? Text : Subhead;
|
|
117
105
|
|
|
106
|
+
const IconDismissIOS =
|
|
107
|
+
mode === "image" ? Icon24DismissDark : Icon24DismissSubstract;
|
|
108
|
+
|
|
109
|
+
const content = (
|
|
110
|
+
<React.Fragment>
|
|
111
|
+
{mode === "image" && background && (
|
|
112
|
+
<div aria-hidden="true" vkuiClass="Banner__bg">
|
|
113
|
+
{background}
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
116
|
+
|
|
117
|
+
{before && <div vkuiClass="Banner__before">{before}</div>}
|
|
118
|
+
|
|
119
|
+
<div vkuiClass="Banner__content">
|
|
120
|
+
{hasReactNode(header) && (
|
|
121
|
+
<HeaderTypography
|
|
122
|
+
Component="span"
|
|
123
|
+
vkuiClass="Banner__header"
|
|
124
|
+
weight="2"
|
|
125
|
+
level={size === "m" ? "2" : "1"}
|
|
126
|
+
>
|
|
127
|
+
{header}
|
|
128
|
+
</HeaderTypography>
|
|
129
|
+
)}
|
|
130
|
+
{hasReactNode(subheader) && (
|
|
131
|
+
<SubheaderTypography Component="span" vkuiClass="Banner__subheader">
|
|
132
|
+
{subheader}
|
|
133
|
+
</SubheaderTypography>
|
|
134
|
+
)}
|
|
135
|
+
{hasReactNode(text) && <Text vkuiClass="Banner__text">{text}</Text>}
|
|
136
|
+
{hasReactNode(actions) && React.Children.count(actions) > 0 && (
|
|
137
|
+
<div vkuiClass="Banner__actions">{actions}</div>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
</React.Fragment>
|
|
141
|
+
);
|
|
142
|
+
|
|
118
143
|
return (
|
|
119
144
|
<section
|
|
120
145
|
{...restProps}
|
|
@@ -126,46 +151,24 @@ export const Banner = ({
|
|
|
126
151
|
mode === "image" && imageTheme === "dark" && "Banner--inverted"
|
|
127
152
|
)}
|
|
128
153
|
>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<div aria-hidden="true" vkuiClass="Banner__bg">
|
|
137
|
-
{background}
|
|
138
|
-
</div>
|
|
139
|
-
)}
|
|
140
|
-
|
|
141
|
-
{before && <div vkuiClass="Banner__before">{before}</div>}
|
|
142
|
-
|
|
143
|
-
<div vkuiClass="Banner__content">
|
|
144
|
-
{hasReactNode(header) && (
|
|
145
|
-
<BannerHeader
|
|
146
|
-
size={size}
|
|
147
|
-
Component="span"
|
|
148
|
-
vkuiClass="Banner__header"
|
|
149
|
-
>
|
|
150
|
-
{header}
|
|
151
|
-
</BannerHeader>
|
|
152
|
-
)}
|
|
153
|
-
{hasReactNode(subheader) && (
|
|
154
|
-
<SubheaderTypography Component="span" vkuiClass="Banner__subheader">
|
|
155
|
-
{subheader}
|
|
156
|
-
</SubheaderTypography>
|
|
157
|
-
)}
|
|
158
|
-
{hasReactNode(text) && <Text vkuiClass="Banner__text">{text}</Text>}
|
|
159
|
-
{hasReactNode(actions) && React.Children.count(actions) > 0 && (
|
|
160
|
-
<div vkuiClass="Banner__actions">{actions}</div>
|
|
161
|
-
)}
|
|
162
|
-
</div>
|
|
154
|
+
{asideMode === "expand" ? (
|
|
155
|
+
<Tappable
|
|
156
|
+
vkuiClass="Banner__in"
|
|
157
|
+
activeMode={platform === IOS ? "opacity" : "background"}
|
|
158
|
+
role="button"
|
|
159
|
+
>
|
|
160
|
+
{content}
|
|
163
161
|
|
|
164
|
-
{!!asideMode && (
|
|
165
162
|
<div vkuiClass="Banner__aside">
|
|
166
|
-
|
|
163
|
+
<Icon24Chevron />
|
|
164
|
+
</div>
|
|
165
|
+
</Tappable>
|
|
166
|
+
) : (
|
|
167
|
+
<div vkuiClass="Banner__in">
|
|
168
|
+
{content}
|
|
167
169
|
|
|
168
|
-
|
|
170
|
+
{asideMode === "dismiss" && (
|
|
171
|
+
<div vkuiClass="Banner__aside">
|
|
169
172
|
<IconButton
|
|
170
173
|
aria-label={dismissLabel}
|
|
171
174
|
vkuiClass="Banner__dismiss"
|
|
@@ -173,20 +176,12 @@ export const Banner = ({
|
|
|
173
176
|
hoverMode="opacity"
|
|
174
177
|
hasActive={false}
|
|
175
178
|
>
|
|
176
|
-
{platform === IOS ?
|
|
177
|
-
mode === "image" ? (
|
|
178
|
-
<Icon24DismissDark />
|
|
179
|
-
) : (
|
|
180
|
-
<Icon24DismissSubstract />
|
|
181
|
-
)
|
|
182
|
-
) : (
|
|
183
|
-
<Icon24Cancel />
|
|
184
|
-
)}
|
|
179
|
+
{platform === IOS ? <IconDismissIOS /> : <Icon24Cancel />}
|
|
185
180
|
</IconButton>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
</div>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
)}
|
|
190
185
|
</section>
|
|
191
186
|
);
|
|
192
187
|
};
|
|
@@ -243,7 +243,7 @@ function CustomSelectComponent(props: CustomSelectProps) {
|
|
|
243
243
|
}, [props.value]);
|
|
244
244
|
|
|
245
245
|
useIsomorphicLayoutEffect(() => {
|
|
246
|
-
if (nativeSelectValue) {
|
|
246
|
+
if (nativeSelectValue !== undefined) {
|
|
247
247
|
const event = new Event("change", { bubbles: true });
|
|
248
248
|
|
|
249
249
|
selectElRef.current?.dispatchEvent(event);
|
|
@@ -7,6 +7,7 @@ import { Popper, Placement } from "../Popper/Popper";
|
|
|
7
7
|
import { Spinner } from "../Spinner/Spinner";
|
|
8
8
|
import { HasRef } from "../../types";
|
|
9
9
|
import { useIsomorphicLayoutEffect } from "../../lib/useIsomorphicLayoutEffect";
|
|
10
|
+
import { noop } from "../../lib/utils";
|
|
10
11
|
import "./CustomSelectDropdown.css";
|
|
11
12
|
|
|
12
13
|
export interface CustomSelectDropdownProps
|
|
@@ -35,6 +36,7 @@ function getObserverModifier<T extends HTMLElement>(
|
|
|
35
36
|
name: "customSelectChildrenChange",
|
|
36
37
|
enabled: true,
|
|
37
38
|
phase: "main",
|
|
39
|
+
fn: noop,
|
|
38
40
|
effect: ({ instance }) => {
|
|
39
41
|
const observer = new MutationObserver(instance.forceUpdate);
|
|
40
42
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import {
|
|
3
3
|
Icon24Chevron,
|
|
4
|
-
|
|
4
|
+
Icon24ChevronCompactLeft,
|
|
5
5
|
Icon16Chevron,
|
|
6
6
|
Icon16ChevronLeft,
|
|
7
7
|
} from "@vkontakte/icons";
|
|
@@ -29,7 +29,7 @@ export const HorizontalScrollArrow = ({
|
|
|
29
29
|
if (size === "m") {
|
|
30
30
|
ArrowIcon = direction === "left" ? Icon16ChevronLeft : Icon16Chevron;
|
|
31
31
|
} else {
|
|
32
|
-
ArrowIcon = direction === "left" ?
|
|
32
|
+
ArrowIcon = direction === "left" ? Icon24ChevronCompactLeft : Icon24Chevron;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return (
|
|
@@ -110,10 +110,6 @@
|
|
|
110
110
|
padding: 0 4px;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
.PanelHeader--ios.PanelHeader--no-before .PanelHeader__content > * {
|
|
114
|
-
padding-left: 0;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
113
|
.PanelHeader--ios.PanelHeader--no-before .PanelHeader__content {
|
|
118
114
|
padding-left: 8px;
|
|
119
115
|
}
|
|
@@ -167,15 +163,6 @@
|
|
|
167
163
|
padding: 0 4px;
|
|
168
164
|
}
|
|
169
165
|
|
|
170
|
-
.PanelHeader--android.PanelHeader--no-before .PanelHeader__content > *,
|
|
171
|
-
.PanelHeader--vkcom.PanelHeader--no-before .PanelHeader__content > * {
|
|
172
|
-
padding-left: 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.PanelHeader--android.PanelHeader--no-before .PanelHeader__content {
|
|
176
|
-
padding-left: 16px;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
166
|
.SplitCol--spaced
|
|
180
167
|
.PanelHeader--android.PanelHeader--no-before:not(.ModalPageHeader__in)
|
|
181
168
|
.PanelHeader__content {
|
|
@@ -191,6 +178,10 @@
|
|
|
191
178
|
padding-right: 16px;
|
|
192
179
|
}
|
|
193
180
|
|
|
181
|
+
.PanelHeader--android.PanelHeader--no-before .PanelHeader__content {
|
|
182
|
+
padding-left: 16px;
|
|
183
|
+
}
|
|
184
|
+
|
|
194
185
|
.SplitCol--spaced
|
|
195
186
|
.PanelHeader--android.PanelHeader--no-after:not(.ModalPageHeader__in)
|
|
196
187
|
.PanelHeader__content {
|
|
@@ -246,3 +237,7 @@
|
|
|
246
237
|
flex-shrink: 0;
|
|
247
238
|
flex-grow: 1;
|
|
248
239
|
}
|
|
240
|
+
|
|
241
|
+
.PanelHeader--no-before .PanelHeader__content > * {
|
|
242
|
+
padding-left: 0;
|
|
243
|
+
}
|
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.PanelHeaderContent__status,
|
|
28
|
-
.PanelHeaderContent__children-in
|
|
29
|
-
.PanelHeaderContent__children .Headline {
|
|
28
|
+
.PanelHeaderContent__children-in {
|
|
30
29
|
overflow: hidden;
|
|
31
30
|
white-space: nowrap;
|
|
32
31
|
text-overflow: ellipsis;
|
|
@@ -105,3 +104,10 @@
|
|
|
105
104
|
.PanelHeaderContent--vkcom .PanelHeaderContent__in {
|
|
106
105
|
align-items: center;
|
|
107
106
|
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* VKCOM
|
|
110
|
+
*/
|
|
111
|
+
.PanelHeader--no-before .PanelHeaderContent--vkcom {
|
|
112
|
+
padding-left: 16px;
|
|
113
|
+
}
|
|
@@ -71,12 +71,11 @@ export const PanelHeaderContent = ({
|
|
|
71
71
|
activeMode: "opacity",
|
|
72
72
|
}
|
|
73
73
|
: {};
|
|
74
|
-
const baseClassNames = getClassName("PanelHeaderContent", platform);
|
|
75
74
|
|
|
76
75
|
return (
|
|
77
76
|
<div
|
|
78
77
|
{...rootProps}
|
|
79
|
-
vkuiClass={
|
|
78
|
+
vkuiClass={getClassName("PanelHeaderContent", platform)}
|
|
80
79
|
style={style}
|
|
81
80
|
className={className}
|
|
82
81
|
>
|
|
@@ -81,6 +81,39 @@ const ARROW_PADDING = 8;
|
|
|
81
81
|
const ARROW_WIDTH = 20;
|
|
82
82
|
const ARROW_HEIGHT = 8;
|
|
83
83
|
|
|
84
|
+
const preventOverflowModifier: Modifier<string> = {
|
|
85
|
+
name: "preventOverflow",
|
|
86
|
+
options: {
|
|
87
|
+
mainAxis: false,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const flipModifier: Modifier<string> = {
|
|
92
|
+
name: "flip",
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const arrowModifier: Modifier<string> = {
|
|
96
|
+
name: "arrow",
|
|
97
|
+
options: {
|
|
98
|
+
padding: ARROW_PADDING,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const sameWidthModifier: Modifier<string> = {
|
|
103
|
+
name: "sameWidth",
|
|
104
|
+
enabled: true,
|
|
105
|
+
phase: "beforeWrite",
|
|
106
|
+
requires: ["computeStyles"],
|
|
107
|
+
fn: ({ state }) => {
|
|
108
|
+
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
109
|
+
},
|
|
110
|
+
effect: ({ state }) => {
|
|
111
|
+
state.elements.popper.style.width = `${
|
|
112
|
+
(state.elements.reference as HTMLElement).offsetWidth
|
|
113
|
+
}px`;
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
84
117
|
/**
|
|
85
118
|
* @see https://vkcom.github.io/VKUI/#/Popper
|
|
86
119
|
*/
|
|
@@ -112,12 +145,7 @@ export const Popper = ({
|
|
|
112
145
|
|
|
113
146
|
const modifiers = React.useMemo(() => {
|
|
114
147
|
const modifiers: Array<Modifier<string>> = [
|
|
115
|
-
|
|
116
|
-
name: "preventOverflow",
|
|
117
|
-
options: {
|
|
118
|
-
mainAxis: false,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
148
|
+
preventOverflowModifier,
|
|
121
149
|
{
|
|
122
150
|
name: "offset",
|
|
123
151
|
options: {
|
|
@@ -127,37 +155,15 @@ export const Popper = ({
|
|
|
127
155
|
],
|
|
128
156
|
},
|
|
129
157
|
},
|
|
130
|
-
|
|
131
|
-
name: "flip",
|
|
132
|
-
},
|
|
158
|
+
flipModifier,
|
|
133
159
|
];
|
|
134
160
|
|
|
135
161
|
if (arrow) {
|
|
136
|
-
modifiers.push(
|
|
137
|
-
name: "arrow",
|
|
138
|
-
options: {
|
|
139
|
-
padding: ARROW_PADDING,
|
|
140
|
-
},
|
|
141
|
-
});
|
|
162
|
+
modifiers.push(arrowModifier);
|
|
142
163
|
}
|
|
143
164
|
|
|
144
165
|
if (sameWidth) {
|
|
145
|
-
|
|
146
|
-
name: "sameWidth",
|
|
147
|
-
enabled: true,
|
|
148
|
-
phase: "beforeWrite",
|
|
149
|
-
requires: ["computeStyles"],
|
|
150
|
-
fn: ({ state }) => {
|
|
151
|
-
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
152
|
-
},
|
|
153
|
-
effect: ({ state }) => {
|
|
154
|
-
state.elements.popper.style.width = `${
|
|
155
|
-
(state.elements.reference as HTMLElement).offsetWidth
|
|
156
|
-
}px`;
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
modifiers.push(sameWidth);
|
|
166
|
+
modifiers.push(sameWidthModifier);
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
if (customModifiers) {
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
<Group
|
|
32
32
|
header={<Header mode="secondary">Default Spacing (empty, 8px)</Header>}
|
|
33
33
|
>
|
|
34
|
-
<
|
|
35
|
-
<
|
|
34
|
+
<SimpleCell before={<Icon28Notifications />}>Уведомления</SimpleCell>
|
|
35
|
+
<SimpleCell before={<Icon28BlockOutline />}>Не беспокоить</SimpleCell>
|
|
36
36
|
|
|
37
37
|
<Spacing />
|
|
38
38
|
|
|
39
|
-
<
|
|
40
|
-
<
|
|
39
|
+
<SimpleCell before={<Icon28UserOutline />}>Учётная запись</SimpleCell>
|
|
40
|
+
<SimpleCell before={<Icon28SlidersOutline />}>Основные</SimpleCell>
|
|
41
41
|
</Group>
|
|
42
42
|
|
|
43
43
|
<Group header={<Header mode="secondary">Spacing 16px</Header>}>
|
|
44
|
-
<
|
|
45
|
-
<
|
|
44
|
+
<SimpleCell before={<Icon28Notifications />}>Уведомления</SimpleCell>
|
|
45
|
+
<SimpleCell before={<Icon28BlockOutline />}>Не беспокоить</SimpleCell>
|
|
46
46
|
|
|
47
47
|
<Spacing size={16} />
|
|
48
48
|
|
|
49
|
-
<
|
|
50
|
-
<
|
|
49
|
+
<SimpleCell before={<Icon28UserOutline />}>Учётная запись</SimpleCell>
|
|
50
|
+
<SimpleCell before={<Icon28SlidersOutline />}>Основные</SimpleCell>
|
|
51
51
|
</Group>
|
|
52
52
|
|
|
53
53
|
<Group
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
<Header mode="secondary">Spacing with centered separator 16px</Header>
|
|
56
56
|
}
|
|
57
57
|
>
|
|
58
|
-
<
|
|
59
|
-
<
|
|
58
|
+
<SimpleCell before={<Icon28Notifications />}>Уведомления</SimpleCell>
|
|
59
|
+
<SimpleCell before={<Icon28BlockOutline />}>Не беспокоить</SimpleCell>
|
|
60
60
|
|
|
61
61
|
<Spacing size={16}>
|
|
62
62
|
<Separator />
|
|
63
63
|
</Spacing>
|
|
64
64
|
|
|
65
|
-
<
|
|
66
|
-
<
|
|
65
|
+
<SimpleCell before={<Icon28UserOutline />}>Учётная запись</SimpleCell>
|
|
66
|
+
<SimpleCell before={<Icon28SlidersOutline />}>Основные</SimpleCell>
|
|
67
67
|
</Group>
|
|
68
68
|
|
|
69
69
|
<Group
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
</Header>
|
|
74
74
|
}
|
|
75
75
|
>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
76
|
+
<SimpleCell before={<Icon28Notifications />}>Уведомления</SimpleCell>
|
|
77
|
+
<SimpleCell before={<Icon28BlockOutline />}>Не беспокоить</SimpleCell>
|
|
78
78
|
|
|
79
79
|
<Spacing>
|
|
80
80
|
<Separator />
|
|
81
81
|
</Spacing>
|
|
82
82
|
|
|
83
|
-
<
|
|
84
|
-
<
|
|
83
|
+
<SimpleCell before={<Icon28UserOutline />}>Учётная запись</SimpleCell>
|
|
84
|
+
<SimpleCell before={<Icon28SlidersOutline />}>Основные</SimpleCell>
|
|
85
85
|
</Group>
|
|
86
86
|
|
|
87
87
|
<Group
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
</Header>
|
|
92
92
|
}
|
|
93
93
|
>
|
|
94
|
-
<
|
|
95
|
-
<
|
|
94
|
+
<SimpleCell before={<Icon28Notifications />}>Уведомления</SimpleCell>
|
|
95
|
+
<SimpleCell before={<Icon28BlockOutline />}>Не беспокоить</SimpleCell>
|
|
96
96
|
|
|
97
97
|
<Spacing size={12} />
|
|
98
98
|
<Separator />
|
|
99
99
|
<Spacing size={20} />
|
|
100
100
|
|
|
101
|
-
<
|
|
102
|
-
<
|
|
101
|
+
<SimpleCell before={<Icon28UserOutline />}>Учётная запись</SimpleCell>
|
|
102
|
+
<SimpleCell before={<Icon28SlidersOutline />}>Основные</SimpleCell>
|
|
103
103
|
</Group>
|
|
104
104
|
</Panel>
|
|
105
105
|
</View>
|
|
@@ -12,12 +12,16 @@
|
|
|
12
12
|
padding-right: var(--vkui--size_base_padding_horizontal--regular);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.Spacing--separator-top {
|
|
16
|
+
justify-content: start;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
.Spacing--separator-center {
|
|
16
20
|
justify-content: center;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.Spacing--separator-bottom {
|
|
20
|
-
|
|
24
|
+
justify-content: end;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
.Spacing--separator::after {
|
package/src/lib/platform.ts
CHANGED
|
@@ -23,13 +23,19 @@ function isPlatformAlias(
|
|
|
23
23
|
* @see {@link https://dev.vk.com/mini-apps/development/launch-params#vk_platform vk_platform}
|
|
24
24
|
*/
|
|
25
25
|
function getPlatformByQueryString(queryString: string): Platform | undefined {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
try {
|
|
27
|
+
const parsedQuery = querystring.parse(queryString);
|
|
28
|
+
const platformAliasByQuery = parsedQuery["vk_platform"];
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
return typeof platformAliasByQuery === "string" &&
|
|
31
|
+
isPlatformAlias(platformAliasByQuery)
|
|
32
|
+
? PLATFORM_ALIAS[platformAliasByQuery]
|
|
33
|
+
: undefined;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.warn(e);
|
|
36
|
+
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
const platformByQueryString = canUseDOM
|