@salutejs/plasma-hope 1.387.0 → 1.387.1-dev.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.
Files changed (229) hide show
  1. package/components/Button/views/b2c/ButtonB2C.d.ts +1 -1
  2. package/components/Button/views/web/ButtonWeb.d.ts +1 -1
  3. package/components/Card/CardBadge.d.ts +12 -1
  4. package/components/Card/CardBadge.d.ts.map +1 -1
  5. package/components/Card/CardBadge.js +19 -4
  6. package/components/PreviewGallery/PreviewGalleryItemBase.d.ts +1 -1
  7. package/components/PreviewGallery/PreviewGalleryItemBase.d.ts.map +1 -1
  8. package/components/PreviewGallery/PreviewGalleryItemBase.js +1 -2
  9. package/components/Upload/UploadMessage.d.ts.map +1 -1
  10. package/components/Upload/UploadMessage.js +2 -2
  11. package/es/components/Card/CardBadge.js +17 -3
  12. package/es/components/PreviewGallery/PreviewGalleryItemBase.js +1 -2
  13. package/es/components/Upload/UploadMessage.js +1 -1
  14. package/es/index.js +0 -10
  15. package/index.d.ts +0 -10
  16. package/index.js +0 -110
  17. package/package.json +11 -11
  18. package/components/Badge/Badge.d.ts +0 -21
  19. package/components/Badge/Badge.d.ts.map +0 -1
  20. package/components/Badge/Badge.js +0 -30
  21. package/components/Badge/index.d.ts +0 -5
  22. package/components/Badge/index.d.ts.map +0 -1
  23. package/components/Badge/index.js +0 -25
  24. package/components/Cell/Cell.d.ts +0 -18
  25. package/components/Cell/Cell.d.ts.map +0 -1
  26. package/components/Cell/Cell.js +0 -32
  27. package/components/Cell/index.d.ts +0 -3
  28. package/components/Cell/index.d.ts.map +0 -1
  29. package/components/Cell/index.js +0 -12
  30. package/components/Dropdown/Dropdown.component-test.js +0 -547
  31. package/components/Dropdown/Dropdown.d.ts +0 -20
  32. package/components/Dropdown/Dropdown.d.ts.map +0 -1
  33. package/components/Dropdown/Dropdown.js +0 -64
  34. package/components/Dropdown/Dropdown.types.d.ts +0 -16
  35. package/components/Dropdown/Dropdown.types.d.ts.map +0 -1
  36. package/components/Dropdown/Dropdown.types.js +0 -7
  37. package/components/Dropdown/DropdownItem.d.ts +0 -30
  38. package/components/Dropdown/DropdownItem.d.ts.map +0 -1
  39. package/components/Dropdown/DropdownItem.js +0 -122
  40. package/components/Dropdown/DropdownList.d.ts +0 -22
  41. package/components/Dropdown/DropdownList.d.ts.map +0 -1
  42. package/components/Dropdown/DropdownList.js +0 -23
  43. package/components/Dropdown/DropdownMenu.d.ts +0 -30
  44. package/components/Dropdown/DropdownMenu.d.ts.map +0 -1
  45. package/components/Dropdown/DropdownMenu.js +0 -60
  46. package/components/Dropdown/DropdownPopup.d.ts +0 -18
  47. package/components/Dropdown/DropdownPopup.d.ts.map +0 -1
  48. package/components/Dropdown/DropdownPopup.js +0 -47
  49. package/components/Dropdown/DropdownUncontrolled.d.ts +0 -12
  50. package/components/Dropdown/DropdownUncontrolled.d.ts.map +0 -1
  51. package/components/Dropdown/DropdownUncontrolled.js +0 -69
  52. package/components/Dropdown/index.d.ts +0 -13
  53. package/components/Dropdown/index.d.ts.map +0 -1
  54. package/components/Dropdown/index.js +0 -53
  55. package/components/Dropdown/keyboardNavigation/index.d.ts +0 -2
  56. package/components/Dropdown/keyboardNavigation/index.d.ts.map +0 -1
  57. package/components/Dropdown/keyboardNavigation/index.js +0 -18
  58. package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.d.ts +0 -20
  59. package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.d.ts.map +0 -1
  60. package/components/Dropdown/keyboardNavigation/useKeyboardNavigation.js +0 -58
  61. package/components/Dropdown/keyboardNavigation/useOnComboType.d.ts +0 -6
  62. package/components/Dropdown/keyboardNavigation/useOnComboType.d.ts.map +0 -1
  63. package/components/Dropdown/keyboardNavigation/useOnComboType.js +0 -30
  64. package/components/Dropdown/keyboardNavigation/useSearchString.d.ts +0 -5
  65. package/components/Dropdown/keyboardNavigation/useSearchString.d.ts.map +0 -1
  66. package/components/Dropdown/keyboardNavigation/useSearchString.js +0 -46
  67. package/components/Dropdown/keyboardNavigation/utils.d.ts +0 -39
  68. package/components/Dropdown/keyboardNavigation/utils.d.ts.map +0 -1
  69. package/components/Dropdown/keyboardNavigation/utils.js +0 -175
  70. package/components/Dropdown/withAssistiveDropdown.d.ts +0 -27
  71. package/components/Dropdown/withAssistiveDropdown.d.ts.map +0 -1
  72. package/components/Dropdown/withAssistiveDropdown.js +0 -134
  73. package/components/Editable/Editable.component-test.js +0 -114
  74. package/components/Editable/Editable.d.ts +0 -36
  75. package/components/Editable/Editable.d.ts.map +0 -1
  76. package/components/Editable/Editable.js +0 -154
  77. package/components/Editable/index.d.ts +0 -2
  78. package/components/Editable/index.d.ts.map +0 -1
  79. package/components/Editable/index.js +0 -16
  80. package/components/List/List.d.ts +0 -3
  81. package/components/List/List.d.ts.map +0 -1
  82. package/components/List/List.js +0 -14
  83. package/components/List/ListItem.d.ts +0 -3
  84. package/components/List/ListItem.d.ts.map +0 -1
  85. package/components/List/ListItem.js +0 -14
  86. package/components/List/index.d.ts +0 -3
  87. package/components/List/index.d.ts.map +0 -1
  88. package/components/List/index.js +0 -19
  89. package/components/Price/Price.d.ts +0 -8
  90. package/components/Price/Price.d.ts.map +0 -1
  91. package/components/Price/Price.js +0 -17
  92. package/components/Price/index.d.ts +0 -3
  93. package/components/Price/index.d.ts.map +0 -1
  94. package/components/Price/index.js +0 -12
  95. package/components/Select/Select.d.ts +0 -35
  96. package/components/Select/Select.d.ts.map +0 -1
  97. package/components/Select/Select.js +0 -38
  98. package/components/Select/Select.utils.d.ts +0 -18
  99. package/components/Select/Select.utils.d.ts.map +0 -1
  100. package/components/Select/Select.utils.js +0 -50
  101. package/components/Select/SelectButton.d.ts +0 -20
  102. package/components/Select/SelectButton.d.ts.map +0 -1
  103. package/components/Select/SelectButton.js +0 -75
  104. package/components/Select/SelectDropdown.d.ts +0 -6
  105. package/components/Select/SelectDropdown.d.ts.map +0 -1
  106. package/components/Select/SelectDropdown.js +0 -16
  107. package/components/Select/SelectGroup.d.ts +0 -2
  108. package/components/Select/SelectGroup.d.ts.map +0 -1
  109. package/components/Select/SelectGroup.js +0 -13
  110. package/components/Select/SelectView.d.ts +0 -18
  111. package/components/Select/SelectView.d.ts.map +0 -1
  112. package/components/Select/SelectView.js +0 -29
  113. package/components/Select/index.d.ts +0 -5
  114. package/components/Select/index.d.ts.map +0 -1
  115. package/components/Select/index.js +0 -19
  116. package/components/Select/types.d.ts +0 -4
  117. package/components/Select/types.d.ts.map +0 -1
  118. package/components/Select/types.js +0 -5
  119. package/components/Select/views/b2c/SelectButton.d.ts +0 -4
  120. package/components/Select/views/b2c/SelectButton.d.ts.map +0 -1
  121. package/components/Select/views/b2c/SelectButton.js +0 -18
  122. package/components/Select/views/b2c/SelectDropdown.d.ts +0 -2
  123. package/components/Select/views/b2c/SelectDropdown.d.ts.map +0 -1
  124. package/components/Select/views/b2c/SelectDropdown.js +0 -11
  125. package/components/Select/views/b2c/SelectView.d.ts +0 -7
  126. package/components/Select/views/b2c/SelectView.d.ts.map +0 -1
  127. package/components/Select/views/b2c/SelectView.js +0 -76
  128. package/components/Select/views/web/SelectView.d.ts +0 -7
  129. package/components/Select/views/web/SelectView.d.ts.map +0 -1
  130. package/components/Select/views/web/SelectView.js +0 -73
  131. package/components/Select/withMultiSelect.d.ts +0 -24
  132. package/components/Select/withMultiSelect.d.ts.map +0 -1
  133. package/components/Select/withMultiSelect.js +0 -54
  134. package/components/Select/withSingleSelect.d.ts +0 -20
  135. package/components/Select/withSingleSelect.d.ts.map +0 -1
  136. package/components/Select/withSingleSelect.js +0 -47
  137. package/components/Slider/Slider.d.ts +0 -4
  138. package/components/Slider/Slider.d.ts.map +0 -1
  139. package/components/Slider/Slider.js +0 -14
  140. package/components/Slider/index.d.ts +0 -2
  141. package/components/Slider/index.d.ts.map +0 -1
  142. package/components/Slider/index.js +0 -12
  143. package/components/Switch/Switch.d.ts +0 -6
  144. package/components/Switch/Switch.d.ts.map +0 -1
  145. package/components/Switch/Switch.js +0 -17
  146. package/components/Switch/index.d.ts +0 -3
  147. package/components/Switch/index.d.ts.map +0 -1
  148. package/components/Switch/index.js +0 -12
  149. package/components/Typography/Body/index.d.ts +0 -2
  150. package/components/Typography/Body/index.d.ts.map +0 -1
  151. package/components/Typography/Body/index.js +0 -18
  152. package/components/Typography/Button/index.d.ts +0 -2
  153. package/components/Typography/Button/index.d.ts.map +0 -1
  154. package/components/Typography/Button/index.js +0 -18
  155. package/components/Typography/Caption/index.d.ts +0 -2
  156. package/components/Typography/Caption/index.d.ts.map +0 -1
  157. package/components/Typography/Caption/index.js +0 -12
  158. package/components/Typography/Footnote/index.d.ts +0 -2
  159. package/components/Typography/Footnote/index.d.ts.map +0 -1
  160. package/components/Typography/Footnote/index.js +0 -18
  161. package/components/Typography/Headline/index.d.ts +0 -4
  162. package/components/Typography/Headline/index.d.ts.map +0 -1
  163. package/components/Typography/Headline/index.js +0 -52
  164. package/components/Typography/Paragraph/index.d.ts +0 -2
  165. package/components/Typography/Paragraph/index.d.ts.map +0 -1
  166. package/components/Typography/Paragraph/index.js +0 -36
  167. package/components/Typography/Subtitle/index.d.ts +0 -2
  168. package/components/Typography/Subtitle/index.d.ts.map +0 -1
  169. package/components/Typography/Subtitle/index.js +0 -21
  170. package/components/Typography/Underline/index.d.ts +0 -2
  171. package/components/Typography/Underline/index.d.ts.map +0 -1
  172. package/components/Typography/Underline/index.js +0 -12
  173. package/components/Typography/index.d.ts +0 -11
  174. package/components/Typography/index.d.ts.map +0 -1
  175. package/components/Typography/index.js +0 -223
  176. package/es/components/Badge/Badge.js +0 -22
  177. package/es/components/Badge/index.js +0 -2
  178. package/es/components/Cell/Cell.js +0 -25
  179. package/es/components/Cell/index.js +0 -1
  180. package/es/components/Dropdown/Dropdown.component-test.js +0 -544
  181. package/es/components/Dropdown/Dropdown.js +0 -55
  182. package/es/components/Dropdown/Dropdown.types.js +0 -3
  183. package/es/components/Dropdown/DropdownItem.js +0 -114
  184. package/es/components/Dropdown/DropdownList.js +0 -15
  185. package/es/components/Dropdown/DropdownMenu.js +0 -53
  186. package/es/components/Dropdown/DropdownPopup.js +0 -39
  187. package/es/components/Dropdown/DropdownUncontrolled.js +0 -61
  188. package/es/components/Dropdown/index.js +0 -6
  189. package/es/components/Dropdown/keyboardNavigation/index.js +0 -1
  190. package/es/components/Dropdown/keyboardNavigation/useKeyboardNavigation.js +0 -52
  191. package/es/components/Dropdown/keyboardNavigation/useOnComboType.js +0 -24
  192. package/es/components/Dropdown/keyboardNavigation/useSearchString.js +0 -40
  193. package/es/components/Dropdown/keyboardNavigation/utils.js +0 -170
  194. package/es/components/Dropdown/withAssistiveDropdown.js +0 -126
  195. package/es/components/Editable/Editable.component-test.js +0 -111
  196. package/es/components/Editable/Editable.js +0 -145
  197. package/es/components/Editable/index.js +0 -1
  198. package/es/components/List/List.js +0 -7
  199. package/es/components/List/ListItem.js +0 -7
  200. package/es/components/List/index.js +0 -2
  201. package/es/components/Price/Price.js +0 -10
  202. package/es/components/Price/index.js +0 -1
  203. package/es/components/Select/Select.js +0 -29
  204. package/es/components/Select/Select.utils.js +0 -44
  205. package/es/components/Select/SelectButton.js +0 -67
  206. package/es/components/Select/SelectDropdown.js +0 -9
  207. package/es/components/Select/SelectGroup.js +0 -6
  208. package/es/components/Select/SelectView.js +0 -21
  209. package/es/components/Select/index.js +0 -2
  210. package/es/components/Select/types.js +0 -1
  211. package/es/components/Select/views/b2c/SelectButton.js +0 -12
  212. package/es/components/Select/views/b2c/SelectDropdown.js +0 -5
  213. package/es/components/Select/views/b2c/SelectView.js +0 -67
  214. package/es/components/Select/views/web/SelectView.js +0 -64
  215. package/es/components/Select/withMultiSelect.js +0 -46
  216. package/es/components/Select/withSingleSelect.js +0 -39
  217. package/es/components/Slider/Slider.js +0 -7
  218. package/es/components/Slider/index.js +0 -1
  219. package/es/components/Switch/Switch.js +0 -10
  220. package/es/components/Switch/index.js +0 -1
  221. package/es/components/Typography/Body/index.js +0 -1
  222. package/es/components/Typography/Button/index.js +0 -1
  223. package/es/components/Typography/Caption/index.js +0 -1
  224. package/es/components/Typography/Footnote/index.js +0 -1
  225. package/es/components/Typography/Headline/index.js +0 -20
  226. package/es/components/Typography/Paragraph/index.js +0 -1
  227. package/es/components/Typography/Subtitle/index.js +0 -14
  228. package/es/components/Typography/Underline/index.js +0 -1
  229. package/es/components/Typography/index.js +0 -9
@@ -1,544 +0,0 @@
1
- var _StandardTypoStyle, _span;
2
- import React from 'react';
3
- import { createGlobalStyle } from 'styled-components';
4
- import { standard as standardTypo } from '@salutejs/plasma-typo';
5
- import { IconLocation } from '@salutejs/plasma-icons';
6
- import { mount, CypressTestDecorator, getComponent } from '@salutejs/plasma-cy-utils';
7
- var StandardTypoStyle = /*#__PURE__*/createGlobalStyle(standardTypo);
8
- var items = [{
9
- value: 'north_america',
10
- label: 'Северная Америка',
11
- contentLeft: /*#__PURE__*/React.createElement(IconLocation, {
12
- color: "inherit"
13
- }),
14
- contentRight: /*#__PURE__*/React.createElement(IconLocation, {
15
- color: "inherit"
16
- })
17
- }, {
18
- value: 'south_america',
19
- label: 'Южная Америка',
20
- items: [{
21
- value: 'brazil',
22
- label: 'Бразилия',
23
- items: [{
24
- value: 'rio_de_janeiro',
25
- label: 'Рио-де-Жанейро'
26
- }, {
27
- value: 'sao_paulo',
28
- label: 'Сан-Паулу'
29
- }]
30
- }, {
31
- value: 'argentina',
32
- label: 'Аргентина',
33
- items: [{
34
- value: 'buenos_aires',
35
- label: 'Буэнос-Айрес'
36
- }, {
37
- value: 'cordoba',
38
- label: 'Кордова'
39
- }]
40
- }, {
41
- value: 'colombia',
42
- label: 'Колумбия',
43
- items: [{
44
- value: 'bogota',
45
- label: 'Богота'
46
- }, {
47
- value: 'medellin',
48
- label: 'Медельин'
49
- }]
50
- }]
51
- }, {
52
- value: 'europe',
53
- label: 'Европа',
54
- items: [{
55
- value: 'france',
56
- label: 'Франция',
57
- items: [{
58
- value: 'paris',
59
- label: 'Париж'
60
- }, {
61
- value: 'lyon',
62
- label: 'Лион'
63
- }]
64
- }, {
65
- value: 'germany',
66
- label: 'Германия',
67
- items: [{
68
- value: 'berlin',
69
- label: 'Берлин'
70
- }, {
71
- value: 'munich',
72
- label: 'Мюнхен'
73
- }]
74
- }, {
75
- value: 'italy',
76
- label: 'Италия',
77
- items: [{
78
- value: 'rome',
79
- label: 'Рим'
80
- }, {
81
- value: 'milan',
82
- label: 'Милан'
83
- }]
84
- }, {
85
- value: 'spain',
86
- label: 'Испания',
87
- items: [{
88
- value: 'madrid',
89
- label: 'Мадрид'
90
- }, {
91
- value: 'barcelona',
92
- label: 'Барселона'
93
- }]
94
- }, {
95
- value: 'united_kingdom',
96
- label: 'Великобритания',
97
- items: [{
98
- value: 'london',
99
- label: 'Лондон'
100
- }, {
101
- value: 'manchester',
102
- label: 'Манчестер'
103
- }]
104
- }]
105
- }, {
106
- value: 'asia',
107
- label: 'Азия',
108
- items: [{
109
- value: 'china',
110
- label: 'Китай',
111
- items: [{
112
- value: 'beijing',
113
- label: 'Пекин'
114
- }, {
115
- value: 'shanghai',
116
- label: 'Шанхай'
117
- }]
118
- }, {
119
- value: 'japan',
120
- label: 'Япония',
121
- items: [{
122
- value: 'tokyo',
123
- label: 'Токио'
124
- }, {
125
- value: 'osaka',
126
- label: 'Осака'
127
- }]
128
- }, {
129
- value: 'india',
130
- label: 'Индия',
131
- items: [{
132
- value: 'delhi',
133
- label: 'Дели'
134
- }, {
135
- value: 'mumbai',
136
- label: 'Мумбаи'
137
- }]
138
- }, {
139
- value: 'south_korea',
140
- label: 'Южная Корея',
141
- items: [{
142
- value: 'seoul',
143
- label: 'Сеул'
144
- }, {
145
- value: 'busan',
146
- label: 'Пусан'
147
- }]
148
- }, {
149
- value: 'thailand',
150
- label: 'Таиланд',
151
- items: [{
152
- value: 'bangkok',
153
- label: 'Бангкок'
154
- }, {
155
- value: 'phuket',
156
- label: 'Пхукет'
157
- }]
158
- }]
159
- }, {
160
- value: 'africa',
161
- label: 'Африка',
162
- disabled: true
163
- }];
164
- describe('plasma-b2c: Dropdown', function () {
165
- var _CypressTestDecorator, _Dropdown, _Dropdown2, _Dropdown3, _Dropdown4, _Dropdown5, _Dropdown6, _Dropdown7, _Dropdown8, _Button, _Button2, _CypressTestDecorator2, _Button3, _Button4, _Button5, _CypressTestDecorator3, _CypressTestDecorator4, _CypressTestDecorator5, _CypressTestDecorator6, _Button6, _Button7, _CypressTestDecorator7, _Button8;
166
- var Dropdown = getComponent('Dropdown');
167
- var Button = getComponent('Button');
168
- var CypressTestDecoratorWithTypo = function CypressTestDecoratorWithTypo(_ref) {
169
- var children = _ref.children;
170
- return /*#__PURE__*/React.createElement(CypressTestDecorator, null, _StandardTypoStyle || (_StandardTypoStyle = /*#__PURE__*/React.createElement(StandardTypoStyle, null)), children);
171
- };
172
- it('default', function () {
173
- cy.viewport(1000, 500);
174
- mount(_CypressTestDecorator || (_CypressTestDecorator = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
175
- items: items
176
- }, /*#__PURE__*/React.createElement(Button, {
177
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
178
- })))));
179
- cy.get('button').click();
180
- cy.get('#south_america').click();
181
- cy.get('#argentina').click();
182
- cy.matchImageSnapshot();
183
- });
184
- it('prop: size', function () {
185
- cy.viewport(1500, 500);
186
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement("div", {
187
- style: {
188
- display: 'flex',
189
- gap: '200px'
190
- }
191
- }, _Dropdown || (_Dropdown = /*#__PURE__*/React.createElement(Dropdown, {
192
- items: items,
193
- size: "xs",
194
- closeOnOverlayClick: false
195
- }, /*#__PURE__*/React.createElement(Button, {
196
- id: "xs",
197
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D XS"
198
- }))), _Dropdown2 || (_Dropdown2 = /*#__PURE__*/React.createElement(Dropdown, {
199
- items: items,
200
- size: "s",
201
- closeOnOverlayClick: false
202
- }, /*#__PURE__*/React.createElement(Button, {
203
- id: "s",
204
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D S"
205
- }))), _Dropdown3 || (_Dropdown3 = /*#__PURE__*/React.createElement(Dropdown, {
206
- items: items,
207
- size: "m",
208
- closeOnOverlayClick: false
209
- }, /*#__PURE__*/React.createElement(Button, {
210
- id: "m",
211
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D M"
212
- }))), _Dropdown4 || (_Dropdown4 = /*#__PURE__*/React.createElement(Dropdown, {
213
- items: items,
214
- size: "l",
215
- closeOnOverlayClick: false
216
- }, /*#__PURE__*/React.createElement(Button, {
217
- id: "l",
218
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D L"
219
- }))))));
220
- cy.get('#xs').click();
221
- cy.get('#s').click();
222
- cy.get('#m').click();
223
- cy.get('#l').click();
224
- cy.matchImageSnapshot();
225
- });
226
- it('prop: size, variant', function () {
227
- cy.viewport(1500, 500);
228
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement("div", {
229
- style: {
230
- display: 'flex',
231
- gap: '200px'
232
- }
233
- }, _Dropdown5 || (_Dropdown5 = /*#__PURE__*/React.createElement(Dropdown, {
234
- items: items,
235
- size: "xs",
236
- closeOnOverlayClick: false,
237
- variant: "tight"
238
- }, /*#__PURE__*/React.createElement(Button, {
239
- id: "xs",
240
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D XS"
241
- }))), _Dropdown6 || (_Dropdown6 = /*#__PURE__*/React.createElement(Dropdown, {
242
- items: items,
243
- size: "s",
244
- closeOnOverlayClick: false,
245
- variant: "tight"
246
- }, /*#__PURE__*/React.createElement(Button, {
247
- id: "s",
248
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D S"
249
- }))), _Dropdown7 || (_Dropdown7 = /*#__PURE__*/React.createElement(Dropdown, {
250
- items: items,
251
- size: "m",
252
- closeOnOverlayClick: false,
253
- variant: "tight"
254
- }, /*#__PURE__*/React.createElement(Button, {
255
- id: "m",
256
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D M"
257
- }))), _Dropdown8 || (_Dropdown8 = /*#__PURE__*/React.createElement(Dropdown, {
258
- items: items,
259
- size: "l",
260
- closeOnOverlayClick: false,
261
- variant: "tight"
262
- }, /*#__PURE__*/React.createElement(Button, {
263
- id: "l",
264
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D L"
265
- }))))));
266
- cy.get('#xs').click();
267
- cy.get('#s').click();
268
- cy.get('#m').click();
269
- cy.get('#l').click();
270
- cy.matchImageSnapshot();
271
- });
272
- it('prop: onHover', function () {
273
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
274
- items: items,
275
- onHover: function onHover(index) {
276
- expect(index).to.eq(0);
277
- }
278
- }, _Button || (_Button = /*#__PURE__*/React.createElement(Button, {
279
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
280
- })))));
281
- cy.get('button').click();
282
- cy.get('#north_america').trigger('mouseover');
283
- });
284
- it('prop: onItemSelect', function () {
285
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
286
- items: items,
287
- onItemSelect: function onItemSelect(item, event) {
288
- expect(item).to.eq(items[0]);
289
- expect(event.type).to.eq('click');
290
- }
291
- }, _Button2 || (_Button2 = /*#__PURE__*/React.createElement(Button, {
292
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
293
- })))));
294
- cy.get('button').click();
295
- cy.get('#north_america').click();
296
- });
297
- it('prop: trigger', function () {
298
- cy.viewport(1000, 500);
299
- mount(_CypressTestDecorator2 || (_CypressTestDecorator2 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
300
- items: items,
301
- trigger: "hover"
302
- }, /*#__PURE__*/React.createElement(Button, {
303
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
304
- })))));
305
- cy.get('button').trigger('mouseover');
306
- cy.get('#asia').trigger('mouseover');
307
- cy.get('#india').trigger('mouseover');
308
- cy.get('#delhi').should('be.visible');
309
- cy.matchImageSnapshot();
310
- });
311
- it('prop: placement', function () {
312
- cy.viewport(500, 800);
313
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
314
- placement: ['top', 'bottom'],
315
- items: items,
316
- closeOnOverlayClick: false
317
- }, _Button3 || (_Button3 = /*#__PURE__*/React.createElement(Button, {
318
- id: "top",
319
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
320
- }))), /*#__PURE__*/React.createElement("div", {
321
- style: {
322
- height: '600px'
323
- }
324
- }), /*#__PURE__*/React.createElement(Dropdown, {
325
- placement: ['top', 'bottom'],
326
- items: items,
327
- closeOnOverlayClick: false
328
- }, _Button4 || (_Button4 = /*#__PURE__*/React.createElement(Button, {
329
- id: "bottom",
330
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
331
- })))));
332
- cy.get('#top').click();
333
- cy.get('#bottom').click();
334
- cy.matchImageSnapshot();
335
- });
336
- it('prop: offset', function () {
337
- cy.viewport(1000, 500);
338
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
339
- items: items,
340
- offset: [20, 20]
341
- }, _Button5 || (_Button5 = /*#__PURE__*/React.createElement(Button, {
342
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
343
- })))));
344
- cy.get('button').click();
345
- cy.get('#south_america').click();
346
- cy.get('#argentina').click();
347
- cy.matchImageSnapshot();
348
- });
349
- it('prop: listWidth', function () {
350
- cy.viewport(1000, 500);
351
- mount(_CypressTestDecorator3 || (_CypressTestDecorator3 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
352
- items: items,
353
- listWidth: "300px"
354
- }, /*#__PURE__*/React.createElement(Button, {
355
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
356
- })))));
357
- cy.get('button').click();
358
- cy.get('#south_america').click();
359
- cy.get('#argentina').click();
360
- cy.matchImageSnapshot();
361
- });
362
- it('prop: hasArrow', function () {
363
- cy.viewport(1000, 500);
364
- mount(_CypressTestDecorator4 || (_CypressTestDecorator4 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
365
- items: items,
366
- hasArrow: false
367
- }, /*#__PURE__*/React.createElement(Button, {
368
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
369
- })))));
370
- cy.get('button').click();
371
- cy.get('#south_america').click();
372
- cy.get('#argentina').click();
373
- cy.matchImageSnapshot();
374
- });
375
- it('prop: closeOnSelect', function () {
376
- mount(_CypressTestDecorator5 || (_CypressTestDecorator5 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
377
- items: items,
378
- closeOnSelect: false
379
- }, /*#__PURE__*/React.createElement(Button, {
380
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
381
- })))));
382
- cy.get('button').click();
383
- cy.get('#north_america').click();
384
- cy.get('#north_america').should('be.visible');
385
- });
386
- it('prop: closeOnOverlayClick', function () {
387
- mount(_CypressTestDecorator6 || (_CypressTestDecorator6 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, _span || (_span = /*#__PURE__*/React.createElement("span", {
388
- id: "outer"
389
- }, "outer text")), /*#__PURE__*/React.createElement(Dropdown, {
390
- items: items,
391
- closeOnOverlayClick: false
392
- }, /*#__PURE__*/React.createElement(Button, {
393
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
394
- })))));
395
- cy.get('button').click();
396
- cy.get('#outer').click();
397
- cy.get('#north_america').should('be.visible');
398
- });
399
- it('prop: onToggle', function () {
400
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
401
- items: items,
402
- onToggle: function onToggle(isOpen, event) {
403
- expect(isOpen).to.be.oneOf([true, false]);
404
- expect(event.type).to.eq('click');
405
- }
406
- }, _Button6 || (_Button6 = /*#__PURE__*/React.createElement(Button, {
407
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
408
- })))));
409
- cy.get('button').click();
410
- cy.get('button').click();
411
- });
412
- it('prop: onItemClick', function () {
413
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
414
- items: items,
415
- onItemClick: function onItemClick(item, event) {
416
- expect(item).to.eq(items[0]);
417
- expect(event.type).to.eq('click');
418
- }
419
- }, _Button7 || (_Button7 = /*#__PURE__*/React.createElement(Button, {
420
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
421
- })))));
422
- cy.get('button').click();
423
- cy.get('#north_america').click();
424
- });
425
- it('prop: listHeight, listOverflow', function () {
426
- mount(_CypressTestDecorator7 || (_CypressTestDecorator7 = /*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
427
- items: items,
428
- listOverflow: "scroll",
429
- listHeight: 6
430
- }, /*#__PURE__*/React.createElement(Button, {
431
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
432
- })))));
433
- cy.get('button').click();
434
- cy.matchImageSnapshot();
435
- });
436
- it('keyboard interactions', function () {
437
- cy.viewport(1000, 500);
438
- mount(/*#__PURE__*/React.createElement(CypressTestDecoratorWithTypo, null, /*#__PURE__*/React.createElement(Dropdown, {
439
- items: items,
440
- onItemSelect: function onItemSelect(item, event) {
441
- expect(item).to.eq(items[0]);
442
- expect(event.type).to.eq('keydown');
443
- }
444
- }, _Button8 || (_Button8 = /*#__PURE__*/React.createElement(Button, {
445
- text: "\u0421\u043F\u0438\u0441\u043E\u043A \u0441\u0442\u0440\u0430\u043D"
446
- })))));
447
- cy.get('body').realClick();
448
- cy.realPress('Tab');
449
-
450
- // Arrow Down
451
- cy.realPress('ArrowDown');
452
- cy.get('#listbox1').should('be.visible');
453
- cy.get('#north_america').should('have.class', 'dropdown-item-is-focused');
454
- cy.get('button').should('have.focus');
455
- cy.realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowDown');
456
- cy.get('#europe').should('have.class', 'dropdown-item-is-focused');
457
- cy.realPress('Escape');
458
-
459
- // Arrow Up
460
- cy.realPress('ArrowUp');
461
- cy.get('#north_america').should('have.class', 'dropdown-item-is-focused');
462
- cy.realPress('ArrowUp');
463
- cy.get('#africa').should('have.class', 'dropdown-item-is-focused');
464
- cy.realPress('Escape');
465
-
466
- // Arrows Right and Left
467
- cy.realPress('ArrowDown').realPress('ArrowDown').realPress('ArrowRight');
468
- cy.get('#listbox1').should('be.visible');
469
- cy.get('#listbox2').should('be.visible');
470
- cy.get('#brazil').should('have.class', 'dropdown-item-is-focused');
471
- cy.get('button').should('have.focus');
472
- cy.get('#south_america').should('have.class', 'dropdown-item-is-active');
473
- cy.realPress('ArrowLeft');
474
- cy.get('#listbox1').should('be.visible');
475
- cy.get('#listbox2').should('not.be.visible');
476
- cy.get('#south_america').should('have.class', 'dropdown-item-is-focused');
477
- cy.realPress('ArrowDown').realPress('ArrowRight');
478
- cy.get('#france').should('have.class', 'dropdown-item-is-focused');
479
- cy.get('button').should('have.focus');
480
- cy.get('#europe').should('have.class', 'dropdown-item-is-active');
481
- cy.realPress('ArrowRight');
482
- cy.get('#europe').should('have.class', 'dropdown-item-is-active');
483
- cy.get('#france').should('have.class', 'dropdown-item-is-active');
484
- cy.get('#paris').should('have.class', 'dropdown-item-is-focused');
485
- cy.realPress('ArrowLeft').realPress('ArrowLeft').realPress('ArrowLeft');
486
- cy.get('#listbox1').should('not.be.visible');
487
- cy.get('button').should('have.focus');
488
-
489
- // Escape
490
- cy.realPress('Escape');
491
- cy.get('#listbox1').should('not.be.visible');
492
- cy.get('button').should('have.focus');
493
-
494
- // Home
495
- cy.realPress('Home');
496
- cy.get('#listbox1').should('be.visible');
497
- cy.get('button').should('have.focus');
498
- cy.get('#north_america').should('have.class', 'dropdown-item-is-focused');
499
- cy.realPress('Escape');
500
-
501
- // End
502
- cy.realPress('End');
503
- cy.get('#listbox1').should('be.visible');
504
- cy.get('button').should('have.focus');
505
- cy.get('#africa').should('have.class', 'dropdown-item-is-focused');
506
- cy.realPress('Escape');
507
-
508
- // Page Down
509
- cy.realPress('PageDown');
510
- cy.get('#listbox1').should('not.be.visible');
511
- cy.get('button').should('have.focus');
512
- cy.realPress('ArrowDown');
513
- cy.realPress('PageDown');
514
- cy.get('button').should('have.focus');
515
- cy.get('#africa').should('have.class', 'dropdown-item-is-focused');
516
- cy.realPress('Escape');
517
-
518
- // Page Up
519
- cy.realPress('PageUp');
520
- cy.get('#listbox1').should('not.be.visible');
521
- cy.get('button').should('have.focus');
522
- cy.realPress('ArrowDown');
523
- cy.realPress('ArrowDown');
524
- cy.realPress('PageUp');
525
- cy.get('button').should('have.focus');
526
- cy.get('#north_america').should('have.class', 'dropdown-item-is-focused');
527
- cy.realPress('Escape');
528
-
529
- // Space
530
- cy.realPress('ArrowDown').realPress('ArrowDown').realPress('Space').realPress('ArrowLeft').realPress('ArrowUp').realPress('Space');
531
- cy.get('#listbox1').should('not.be.visible');
532
- cy.get('button').should('have.focus');
533
-
534
- // Enter
535
- cy.realPress('Enter').realPress('ArrowDown').realPress('Enter').realPress('ArrowLeft').realPress('ArrowUp').realPress('Enter');
536
- cy.get('#listbox1').should('not.be.visible');
537
- cy.get('button').should('have.focus');
538
-
539
- // Tab
540
- cy.realPress('ArrowDown').realPress('Tab');
541
- cy.get('#listbox1').should('not.be.visible');
542
- cy.get('button').should('not.have.focus');
543
- });
544
- });
@@ -1,55 +0,0 @@
1
- var _excluded = ["disabled", "closeOnSelect", "onItemClick", "onToggle", "onItemSelect"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
9
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
10
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
11
- import React, { useState, useCallback } from 'react';
12
- import styled from 'styled-components';
13
- import { DropdownUncontrolled } from './DropdownUncontrolled';
14
- import { applyDropdownListCssProperties } from './DropdownList';
15
- import { collectPackageInfo } from '../../collectPackageInfo';
16
- collectPackageInfo('Dropdown/Dropdown');
17
- var StyledDropdownUncontrolled = /*#__PURE__*/styled(DropdownUncontrolled).withConfig({
18
- componentId: "plasma-web-core__sc-1aw1the-0"
19
- })(["", ";"], applyDropdownListCssProperties);
20
-
21
- /**
22
- * Выпадающий список без внешнего контроля видимости.
23
- */
24
- export var Dropdown = function Dropdown(_ref) {
25
- var disabled = _ref.disabled,
26
- _ref$closeOnSelect = _ref.closeOnSelect,
27
- closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
28
- onItemClick = _ref.onItemClick,
29
- onToggleExternal = _ref.onToggle,
30
- onItemSelectExternal = _ref.onItemSelect,
31
- rest = _objectWithoutProperties(_ref, _excluded);
32
- var _useState = useState(false),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- isOpen = _useState2[0],
35
- setIsOpen = _useState2[1];
36
- var onToggle = useCallback(function (newIsOpen, event) {
37
- setIsOpen(newIsOpen);
38
- onToggleExternal === null || onToggleExternal === void 0 || onToggleExternal(newIsOpen, event);
39
- }, [onToggleExternal, disabled]);
40
- var onItemSelect = useCallback(function (item, event) {
41
- if (closeOnSelect) {
42
- onToggle === null || onToggle === void 0 || onToggle(false, event);
43
- }
44
- if (onItemSelectExternal) {
45
- return onItemSelectExternal(item, event);
46
- }
47
- return onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item, event);
48
- }, [closeOnSelect, onToggle, onItemSelectExternal, onItemClick]);
49
- return /*#__PURE__*/React.createElement(StyledDropdownUncontrolled, _extends({}, rest, {
50
- opened: isOpen,
51
- disabled: disabled,
52
- onToggle: onToggle,
53
- onItemSelect: onItemSelect
54
- }));
55
- };
@@ -1,3 +0,0 @@
1
- import { collectPackageInfo } from '../../collectPackageInfo';
2
- collectPackageInfo('Dropdown/Dropdown.types');
3
- export {};