@salutejs/plasma-new-hope 0.82.1-canary.1210.9126725322.0 → 0.83.0-canary.1213.9159050781.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Button/Button.css +9 -6
- package/cjs/components/Button/Button.js +16 -2
- package/cjs/components/Button/Button.js.map +1 -1
- package/cjs/components/Button/Button.styles.js +31 -10
- package/cjs/components/Button/Button.styles.js.map +1 -1
- package/cjs/components/Button/Button.styles_nedem1.css +8 -0
- package/cjs/components/Button/Button.tokens.js +5 -0
- package/cjs/components/Button/Button.tokens.js.map +1 -1
- package/cjs/components/Button/variations/_stretching/base.js +1 -1
- package/cjs/components/Button/variations/_stretching/base.js.map +1 -1
- package/{es/components/Button/variations/_stretching/base_1lx0ute.css → cjs/components/Button/variations/_stretching/base_hy8dc.css} +1 -1
- package/cjs/components/Drawer/Drawer.css +9 -6
- package/cjs/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -6
- package/cjs/components/Header/ui/HeaderArrow/HeaderArrow.css +9 -6
- package/cjs/components/IconButton/IconButton.css +10 -7
- package/cjs/components/IconButton/IconButton.styles.js +1 -1
- package/{es/components/IconButton/IconButton.styles_1hknr37.css → cjs/components/IconButton/IconButton.styles_7v8g0e.css} +1 -1
- package/cjs/components/Notification/Notification.css +9 -6
- package/cjs/components/Notification/NotificationsProvider.css +9 -6
- package/cjs/components/Pagination/Pagination.css +9 -6
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -6
- package/cjs/components/Panel/ui/PanelHeader/PanelHeader.css +9 -6
- package/cjs/components/Select/Select.css +9 -6
- package/cjs/components/Select/ui/SelectTarget/SelectTarget.css +9 -6
- package/cjs/components/Toast/Toast.css +9 -6
- package/cjs/components/Toast/ToastController.css +9 -6
- package/cjs/index.css +12 -9
- package/es/components/Button/Button.css +9 -6
- package/es/components/Button/Button.js +17 -3
- package/es/components/Button/Button.js.map +1 -1
- package/es/components/Button/Button.styles.js +29 -11
- package/es/components/Button/Button.styles.js.map +1 -1
- package/es/components/Button/Button.styles_nedem1.css +8 -0
- package/es/components/Button/Button.tokens.js +5 -0
- package/es/components/Button/Button.tokens.js.map +1 -1
- package/es/components/Button/variations/_stretching/base.js +1 -1
- package/es/components/Button/variations/_stretching/base.js.map +1 -1
- package/{cjs/components/Button/variations/_stretching/base_1lx0ute.css → es/components/Button/variations/_stretching/base_hy8dc.css} +1 -1
- package/es/components/Drawer/Drawer.css +9 -6
- package/es/components/Drawer/ui/DrawerContent/DrawerContent.css +9 -6
- package/es/components/Header/ui/HeaderArrow/HeaderArrow.css +9 -6
- package/es/components/IconButton/IconButton.css +10 -7
- package/es/components/IconButton/IconButton.styles.js +1 -1
- package/{cjs/components/IconButton/IconButton.styles_1hknr37.css → es/components/IconButton/IconButton.styles_7v8g0e.css} +1 -1
- package/es/components/Notification/Notification.css +9 -6
- package/es/components/Notification/NotificationsProvider.css +9 -6
- package/es/components/Pagination/Pagination.css +9 -6
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -6
- package/es/components/Panel/ui/PanelHeader/PanelHeader.css +9 -6
- package/es/components/Select/Select.css +9 -6
- package/es/components/Select/ui/SelectTarget/SelectTarget.css +9 -6
- package/es/components/Toast/Toast.css +9 -6
- package/es/components/Toast/ToastController.css +9 -6
- package/es/index.css +12 -9
- package/package.json +2 -2
- package/styled-components/cjs/components/Avatar/Avatar.template-doc.mdx +1 -3
- package/styled-components/cjs/components/Badge/Badge.template-doc.mdx +9 -9
- package/styled-components/cjs/components/Button/Button.js +16 -2
- package/styled-components/cjs/components/Button/Button.styles.js +20 -12
- package/styled-components/cjs/components/Button/Button.template-doc.mdx +51 -8
- package/styled-components/cjs/components/Button/Button.tokens.js +5 -0
- package/styled-components/cjs/components/Button/variations/_stretching/base.js +1 -1
- package/styled-components/cjs/components/Checkbox/Checkbox.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Chip/Chip.template-doc.mdx +1 -1
- package/styled-components/cjs/components/Combobox/Combobox.template-doc.mdx +14 -14
- package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +5 -5
- package/styled-components/cjs/components/Drawer/Drawer.template-doc.mdx +3 -3
- package/styled-components/cjs/components/Dropdown/Dropdown.template-doc.mdx +261 -262
- package/styled-components/cjs/components/Image/Image.template-doc.mdx +1 -1
- package/styled-components/cjs/components/Link/Link.template-doc.mdx +4 -4
- package/styled-components/cjs/components/Modal/Modal.template-doc.mdx +33 -85
- package/styled-components/cjs/components/Notification/Notification.template-doc.mdx +2 -1
- package/styled-components/cjs/components/Popover/Popover.template-doc.mdx +3 -3
- package/styled-components/cjs/components/Popup/Popup.template-doc.mdx +74 -70
- package/styled-components/cjs/components/Radiobox/Radiobox.template-doc.mdx +1 -2
- package/styled-components/cjs/components/Segment/Segment.template-doc.mdx +2 -2
- package/styled-components/cjs/components/Skeleton/Skeleton.template-doc.mdx +4 -4
- package/styled-components/cjs/components/Tabs/Tabs.template-doc.mdx +1 -1
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +2 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.config.js +19 -19
- package/styled-components/cjs/examples/plasma_b2c/components/Button/Button.stories.tsx +67 -21
- package/styled-components/cjs/examples/plasma_web/components/Button/Button.config.js +19 -19
- package/styled-components/cjs/examples/plasma_web/components/Button/Button.stories.tsx +90 -28
- package/styled-components/cjs/examples/sds_engineer/components/Button/Button.config.js +19 -19
- package/styled-components/cjs/examples/sds_engineer/components/Button/Button.stories.tsx +90 -28
- package/styled-components/es/components/Avatar/Avatar.template-doc.mdx +1 -3
- package/styled-components/es/components/Badge/Badge.template-doc.mdx +9 -9
- package/styled-components/es/components/Button/Button.js +17 -3
- package/styled-components/es/components/Button/Button.styles.js +19 -11
- package/styled-components/es/components/Button/Button.template-doc.mdx +51 -8
- package/styled-components/es/components/Button/Button.tokens.js +5 -0
- package/styled-components/es/components/Button/variations/_stretching/base.js +1 -1
- package/styled-components/es/components/Checkbox/Checkbox.template-doc.mdx +2 -2
- package/styled-components/es/components/Chip/Chip.template-doc.mdx +1 -1
- package/styled-components/es/components/Combobox/Combobox.template-doc.mdx +14 -14
- package/styled-components/es/components/Counter/Counter.template-doc.mdx +5 -5
- package/styled-components/es/components/Drawer/Drawer.template-doc.mdx +3 -3
- package/styled-components/es/components/Dropdown/Dropdown.template-doc.mdx +261 -262
- package/styled-components/es/components/Image/Image.template-doc.mdx +1 -1
- package/styled-components/es/components/Link/Link.template-doc.mdx +4 -4
- package/styled-components/es/components/Modal/Modal.template-doc.mdx +33 -85
- package/styled-components/es/components/Notification/Notification.template-doc.mdx +2 -1
- package/styled-components/es/components/Popover/Popover.template-doc.mdx +3 -3
- package/styled-components/es/components/Popup/Popup.template-doc.mdx +74 -70
- package/styled-components/es/components/Radiobox/Radiobox.template-doc.mdx +1 -2
- package/styled-components/es/components/Segment/Segment.template-doc.mdx +2 -2
- package/styled-components/es/components/Skeleton/Skeleton.template-doc.mdx +4 -4
- package/styled-components/es/components/Tabs/Tabs.template-doc.mdx +1 -1
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +2 -2
- package/styled-components/es/examples/plasma_b2c/components/Button/Button.config.js +19 -19
- package/styled-components/es/examples/plasma_b2c/components/Button/Button.stories.tsx +67 -21
- package/styled-components/es/examples/plasma_web/components/Button/Button.config.js +19 -19
- package/styled-components/es/examples/plasma_web/components/Button/Button.stories.tsx +90 -28
- package/styled-components/es/examples/sds_engineer/components/Button/Button.config.js +19 -19
- package/styled-components/es/examples/sds_engineer/components/Button/Button.stories.tsx +90 -28
- package/types/components/Button/Button.d.ts.map +1 -1
- package/types/components/Button/Button.styles.d.ts +5 -1
- package/types/components/Button/Button.styles.d.ts.map +1 -1
- package/types/components/Button/Button.tokens.d.ts +5 -0
- package/types/components/Button/Button.tokens.d.ts.map +1 -1
- package/types/components/Button/Button.types.d.ts +10 -0
- package/types/components/Button/Button.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Button/Button.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Button/Button.config.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Button/Button.config.d.ts.map +1 -1
- package/cjs/components/Button/Button.styles_uqvh6u.css +0 -5
- package/es/components/Button/Button.styles_uqvh6u.css +0 -5
- package/styled-components/cjs/components/Cell/Cell.template-doc.mdx +0 -68
- package/styled-components/cjs/components/Divider/Divider.template-docs.mdx +0 -57
- package/styled-components/cjs/components/IconButton/IconButton.template-doc.mdx +0 -156
- package/styled-components/cjs/components/Pagination/Pagination.template-doc.mdx +0 -130
- package/styled-components/cjs/components/Progress/Progress.template-doc.mdx +0 -33
- package/styled-components/cjs/components/Toolbar/Toolbar.template-doc.mdx +0 -120
- package/styled-components/es/components/Cell/Cell.template-doc.mdx +0 -68
- package/styled-components/es/components/Divider/Divider.template-docs.mdx +0 -57
- package/styled-components/es/components/IconButton/IconButton.template-doc.mdx +0 -156
- package/styled-components/es/components/Pagination/Pagination.template-doc.mdx +0 -130
- package/styled-components/es/components/Progress/Progress.template-doc.mdx +0 -33
- package/styled-components/es/components/Toolbar/Toolbar.template-doc.mdx +0 -120
@@ -3,21 +3,20 @@ id: dropdown
|
|
3
3
|
title: Dropdown
|
4
4
|
---
|
5
5
|
|
6
|
-
import { PropsTable, Description } from '@site/src/components';
|
6
|
+
import { PropsTable, Description, StorybookLink } from '@site/src/components';
|
7
7
|
import Tabs from '@theme/Tabs';
|
8
8
|
import TabItem from '@theme/TabItem';
|
9
9
|
|
10
10
|
# Dropdown
|
11
11
|
Выпадающий многоуровневый список.
|
12
12
|
|
13
|
+
<StorybookLink name="Dropdown" />
|
14
|
+
|
13
15
|
<Description name="Dropdown" />
|
14
16
|
<PropsTable name="Dropdown" />
|
15
17
|
|
16
18
|
## Использование
|
17
|
-
Обязательным параметром является только массив `items`.
|
18
|
-
Внутри items может быть такой же вложенный массив items.
|
19
|
-
|
20
|
-
Формат следующий:
|
19
|
+
Обязательным параметром является только массив `items`. Внутри items может быть такой же вложенный массив items. Формат следующий:
|
21
20
|
|
22
21
|
```tsx
|
23
22
|
type Items = Array<{
|
@@ -69,272 +68,272 @@ type Items = Array<{
|
|
69
68
|
<TabItem value="default" label="Default" default>
|
70
69
|
```tsx live
|
71
70
|
import React from 'react';
|
72
|
-
import { Button, Dropdown } from '@salutejs/
|
71
|
+
import { Button, Dropdown } from '@salutejs/plasma-web';
|
73
72
|
|
74
73
|
export function App() {
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
</TabItem>
|
119
|
-
|
120
|
-
<TabItem value="size" label="Size">
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
{
|
131
|
-
|
132
|
-
|
133
|
-
},
|
134
|
-
{
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
{
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
{
|
143
|
-
|
144
|
-
|
145
|
-
},
|
146
|
-
{
|
147
|
-
|
148
|
-
|
149
|
-
},
|
150
|
-
|
151
|
-
},
|
152
|
-
{
|
153
|
-
|
154
|
-
|
155
|
-
},
|
156
|
-
|
157
|
-
},
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
</div>
|
190
|
-
);
|
191
|
-
}
|
192
|
-
```
|
193
|
-
</TabItem>
|
194
|
-
|
195
|
-
<TabItem value="placement" label="Placement">
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
{
|
206
|
-
|
207
|
-
|
208
|
-
},
|
209
|
-
{
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
{
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
{
|
218
|
-
|
219
|
-
|
220
|
-
},
|
221
|
-
{
|
222
|
-
|
223
|
-
|
224
|
-
},
|
225
|
-
|
226
|
-
},
|
227
|
-
{
|
228
|
-
|
229
|
-
|
230
|
-
},
|
231
|
-
|
232
|
-
},
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
</div>
|
264
|
-
);
|
265
|
-
}
|
266
|
-
```
|
267
|
-
</TabItem>
|
268
|
-
|
269
|
-
<TabItem value="trigger" label="Trigger">
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
{
|
281
|
-
|
282
|
-
|
283
|
-
},
|
284
|
-
{
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
{
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
{
|
293
|
-
|
294
|
-
|
295
|
-
},
|
296
|
-
{
|
297
|
-
|
298
|
-
|
299
|
-
},
|
300
|
-
|
301
|
-
},
|
302
|
-
{
|
303
|
-
|
304
|
-
|
305
|
-
},
|
306
|
-
|
307
|
-
},
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
</div>
|
320
|
-
);
|
321
|
-
}
|
322
|
-
```
|
323
|
-
</TabItem>
|
74
|
+
const items = [
|
75
|
+
{
|
76
|
+
value: 'north_america',
|
77
|
+
label: 'Северная Америка',
|
78
|
+
},
|
79
|
+
{
|
80
|
+
value: 'south_america',
|
81
|
+
label: 'Южная Америка',
|
82
|
+
items: [
|
83
|
+
{
|
84
|
+
value: 'brazil',
|
85
|
+
label: 'Бразилия',
|
86
|
+
items: [
|
87
|
+
{
|
88
|
+
value: 'rio_de_janeiro',
|
89
|
+
label: 'Рио-де-Жанейро',
|
90
|
+
},
|
91
|
+
{
|
92
|
+
value: 'sao_paulo',
|
93
|
+
label: 'Сан-Паулу',
|
94
|
+
},
|
95
|
+
],
|
96
|
+
},
|
97
|
+
{
|
98
|
+
value: 'argentina',
|
99
|
+
label: 'Аргентина',
|
100
|
+
},
|
101
|
+
],
|
102
|
+
},
|
103
|
+
];
|
104
|
+
|
105
|
+
|
106
|
+
return (
|
107
|
+
<div style={{ height:"300px" }}>
|
108
|
+
<Dropdown
|
109
|
+
items={items}
|
110
|
+
>
|
111
|
+
<Button text="Список стран" />
|
112
|
+
</Dropdown>
|
113
|
+
</div>
|
114
|
+
);
|
115
|
+
}
|
116
|
+
```
|
117
|
+
</TabItem>
|
118
|
+
|
119
|
+
<TabItem value="size" label="Size">
|
120
|
+
Размер `Dropdown` задается с помощью свойства `size`.<br />
|
121
|
+
Возможные значения свойства: `"l"`, `"m"`, `"s"` или `"xs"`.
|
122
|
+
|
123
|
+
```tsx live
|
124
|
+
import React from 'react';
|
125
|
+
import { Button, Dropdown } from '@salutejs/plasma-web';
|
126
|
+
|
127
|
+
export function App() {
|
128
|
+
const items = [
|
129
|
+
{
|
130
|
+
value: 'north_america',
|
131
|
+
label: 'Северная Америка',
|
132
|
+
},
|
133
|
+
{
|
134
|
+
value: 'south_america',
|
135
|
+
label: 'Южная Америка',
|
136
|
+
items: [
|
137
|
+
{
|
138
|
+
value: 'brazil',
|
139
|
+
label: 'Бразилия',
|
140
|
+
items: [
|
141
|
+
{
|
142
|
+
value: 'rio_de_janeiro',
|
143
|
+
label: 'Рио-де-Жанейро',
|
144
|
+
},
|
145
|
+
{
|
146
|
+
value: 'sao_paulo',
|
147
|
+
label: 'Сан-Паулу',
|
148
|
+
},
|
149
|
+
],
|
150
|
+
},
|
151
|
+
{
|
152
|
+
value: 'argentina',
|
153
|
+
label: 'Аргентина',
|
154
|
+
},
|
155
|
+
],
|
156
|
+
},
|
157
|
+
];
|
158
|
+
|
159
|
+
return (
|
160
|
+
<div style={{ height: "300px", display: "flex", gap: "50px" }}>
|
161
|
+
<Dropdown
|
162
|
+
items={items}
|
163
|
+
size="l"
|
164
|
+
>
|
165
|
+
<Button text="Список стран" />
|
166
|
+
</Dropdown>
|
167
|
+
|
168
|
+
<Dropdown
|
169
|
+
items={items}
|
170
|
+
size="m" // default
|
171
|
+
>
|
172
|
+
<Button text="Список стран" />
|
173
|
+
</Dropdown>
|
174
|
+
|
175
|
+
<Dropdown
|
176
|
+
items={items}
|
177
|
+
size="s"
|
178
|
+
>
|
179
|
+
<Button text="Список стран" />
|
180
|
+
</Dropdown>
|
181
|
+
|
182
|
+
<Dropdown
|
183
|
+
items={items}
|
184
|
+
size="xs"
|
185
|
+
>
|
186
|
+
<Button text="Список стран" />
|
187
|
+
</Dropdown>
|
188
|
+
</div>
|
189
|
+
);
|
190
|
+
}
|
191
|
+
```
|
192
|
+
</TabItem>
|
193
|
+
|
194
|
+
<TabItem value="placement" label="Placement">
|
195
|
+
Параметр `placement` принимает либо строку: `"top"`, `"right"`, `"bottom"`, `"left"`, `"auto"`, либо массив этих же значений, например: `["top", "bottom"]`.<br />
|
196
|
+
Default value для placement - `"bottom"`.
|
197
|
+
|
198
|
+
```tsx live
|
199
|
+
import React from 'react';
|
200
|
+
import { Button, Dropdown } from '@salutejs/plasma-web';
|
201
|
+
|
202
|
+
export function App() {
|
203
|
+
const items = [
|
204
|
+
{
|
205
|
+
value: 'north_america',
|
206
|
+
label: 'Северная Америка',
|
207
|
+
},
|
208
|
+
{
|
209
|
+
value: 'south_america',
|
210
|
+
label: 'Южная Америка',
|
211
|
+
items: [
|
212
|
+
{
|
213
|
+
value: 'brazil',
|
214
|
+
label: 'Бразилия',
|
215
|
+
items: [
|
216
|
+
{
|
217
|
+
value: 'rio_de_janeiro',
|
218
|
+
label: 'Рио-де-Жанейро',
|
219
|
+
},
|
220
|
+
{
|
221
|
+
value: 'sao_paulo',
|
222
|
+
label: 'Сан-Паулу',
|
223
|
+
},
|
224
|
+
],
|
225
|
+
},
|
226
|
+
{
|
227
|
+
value: 'argentina',
|
228
|
+
label: 'Аргентина',
|
229
|
+
},
|
230
|
+
],
|
231
|
+
},
|
232
|
+
];
|
233
|
+
|
234
|
+
return (
|
235
|
+
<div style={{ height: "300px", display: "flex", gap: "50px" }}>
|
236
|
+
<Dropdown
|
237
|
+
items={items}
|
238
|
+
>
|
239
|
+
<Button text="Список стран" />
|
240
|
+
</Dropdown>
|
241
|
+
|
242
|
+
<Dropdown
|
243
|
+
items={items}
|
244
|
+
placement="right"
|
245
|
+
>
|
246
|
+
<Button text="Список стран" />
|
247
|
+
</Dropdown>
|
248
|
+
|
249
|
+
<Dropdown
|
250
|
+
items={items}
|
251
|
+
placement="left"
|
252
|
+
>
|
253
|
+
<Button text="Список стран" />
|
254
|
+
</Dropdown>
|
255
|
+
|
256
|
+
<Dropdown
|
257
|
+
items={items}
|
258
|
+
placement={['top', 'bottom']}
|
259
|
+
>
|
260
|
+
<Button text="Список стран" />
|
261
|
+
</Dropdown>
|
262
|
+
</div>
|
263
|
+
);
|
264
|
+
}
|
265
|
+
```
|
266
|
+
</TabItem>
|
267
|
+
|
268
|
+
<TabItem value="trigger" label="Trigger">
|
269
|
+
Параметр `trigger` принимает строку: `"click"` или `"hover"`.<br />
|
270
|
+
Default value - `"click"`.<br />
|
271
|
+
Для примера показано значение `"hover"`.
|
272
|
+
|
273
|
+
```tsx live
|
274
|
+
import React from 'react';
|
275
|
+
import { Button, Dropdown } from '@salutejs/plasma-web';
|
276
|
+
|
277
|
+
export function App() {
|
278
|
+
const items = [
|
279
|
+
{
|
280
|
+
value: 'north_america',
|
281
|
+
label: 'Северная Америка',
|
282
|
+
},
|
283
|
+
{
|
284
|
+
value: 'south_america',
|
285
|
+
label: 'Южная Америка',
|
286
|
+
items: [
|
287
|
+
{
|
288
|
+
value: 'brazil',
|
289
|
+
label: 'Бразилия',
|
290
|
+
items: [
|
291
|
+
{
|
292
|
+
value: 'rio_de_janeiro',
|
293
|
+
label: 'Рио-де-Жанейро',
|
294
|
+
},
|
295
|
+
{
|
296
|
+
value: 'sao_paulo',
|
297
|
+
label: 'Сан-Паулу',
|
298
|
+
},
|
299
|
+
],
|
300
|
+
},
|
301
|
+
{
|
302
|
+
value: 'argentina',
|
303
|
+
label: 'Аргентина',
|
304
|
+
},
|
305
|
+
],
|
306
|
+
},
|
307
|
+
];
|
308
|
+
|
309
|
+
|
310
|
+
return (
|
311
|
+
<div style={{ height:"300px" }}>
|
312
|
+
<Dropdown
|
313
|
+
items={items}
|
314
|
+
trigger="hover"
|
315
|
+
>
|
316
|
+
<Button text="Список стран" />
|
317
|
+
</Dropdown>
|
318
|
+
</div>
|
319
|
+
);
|
320
|
+
}
|
321
|
+
```
|
322
|
+
</TabItem>
|
324
323
|
</Tabs>
|
325
324
|
|
326
325
|
## Клавиатурная навигация
|
327
326
|
|
328
327
|
Данный компонент соответствует требования W3C: [Combobox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) и частично [TreeView](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/).
|
329
328
|
|
330
|
-
- `Tab` - закрывает
|
331
|
-
- `Enter` - открывает/закрывает
|
332
|
-
- `Space` - открывает/закрывает
|
333
|
-
- `Home` - открывает
|
334
|
-
- `End` - открывает
|
329
|
+
- `Tab` - закрывает дропдаун. Перемещает фокус на следующий элемент на странице;
|
330
|
+
- `Enter` - открывает/закрывает дропдаун. Если на элементе - выбирает его;
|
331
|
+
- `Space` - открывает/закрывает дропдаун. Если на элементе - выбирает его;
|
332
|
+
- `Home` - открывает дропдаун и перемещает фокус на первый элемент;
|
333
|
+
- `End` - открывает дропдаун и перемещает фокус на последний элемент;
|
335
334
|
- `PageUp` - перемещает фокус на 10 элементов выше либо в начало списка;
|
336
335
|
- `PageDown` - перемещает фокус на 10 элементов ниже либо в конце списка;
|
337
|
-
- `ArrowUp` - открывает
|
338
|
-
- `ArrowDown` - открывает
|
336
|
+
- `ArrowUp` - открывает дропдаун и перемещает фокус на первый элемент. Перемещает фокус на один элемент выше;
|
337
|
+
- `ArrowDown` - открывает дропдаун и перемещает фокус на первый элемент. Перемещает фокус на один элемент ниже;
|
339
338
|
- `ArrowRight` - если фокус на элементе вложенного списка - открывает его и перемещает фокус на первый элемент;
|
340
339
|
- `ArrowLeft` - закрывает текущий список и перемещает фокус на предыдущий;
|
@@ -11,13 +11,13 @@ import { PropsTable, Description } from '@site/src/components';
|
|
11
11
|
|
12
12
|
```tsx live
|
13
13
|
import React from 'react';
|
14
|
-
import {
|
14
|
+
import { P1, Link } from '@salutejs/{{ package }}';
|
15
15
|
|
16
16
|
export function App() {
|
17
17
|
return (
|
18
|
-
<
|
19
|
-
Скачайте <Link href="/" target="_blank"
|
20
|
-
</
|
18
|
+
<P1>
|
19
|
+
Скачайте <Link href="/" target="_blank">приложение</Link>.
|
20
|
+
</P1>
|
21
21
|
);
|
22
22
|
}
|
23
23
|
```
|